shineout 3.6.0-beta.29 → 3.6.0-beta.30

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.
package/cjs/index.js CHANGED
@@ -514,5 +514,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
514
514
  // 此文件由脚本自动生成,请勿直接修改。
515
515
  // This file was generated automatically by a script. Please do not modify it directly.
516
516
  var _default = exports.default = {
517
- version: '3.6.0-beta.29'
517
+ version: '3.6.0-beta.30'
518
518
  };
package/dist/shineout.js CHANGED
@@ -12139,7 +12139,7 @@ var handleStyle = function handleStyle(style) {
12139
12139
  };
12140
12140
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12141
12141
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12142
- /* harmony default export */ var version = ('3.6.0-beta.29');
12142
+ /* harmony default export */ var version = ('3.6.0-beta.30');
12143
12143
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12144
12144
 
12145
12145
 
@@ -29642,6 +29642,11 @@ var usePopup = function usePopup(props) {
29642
29642
  updatePosition();
29643
29643
  }
29644
29644
  setOpenState(!!props.open);
29645
+
29646
+ // 外部传了open时,需要正常的触发onCollapse;触发了onCollapse才能让组件内部的edit状态正确,否则可能会出现弹出层打开了但是用户却无法选择的情况
29647
+ if (props.open !== undefined) {
29648
+ changeOpen(!!props.open);
29649
+ }
29645
29650
  }, [props.open]);
29646
29651
 
29647
29652
  // const getPopUpHeight = () => {
@@ -39609,6 +39614,8 @@ var Result = function Result(props) {
39609
39614
  var dis = info.index === 1 ? disabledRight : disabledLeft;
39610
39615
  var className = classnames_default()(styles === null || styles === void 0 ? void 0 : styles.resultText, info.target && (styles === null || styles === void 0 ? void 0 : styles.placeholder), dis && (styles === null || styles === void 0 ? void 0 : styles.resultTextDisabled), info.index === activeIndex && (styles === null || styles === void 0 ? void 0 : styles.resultTextActive));
39611
39616
  var formFieldId = (fieldId === null || fieldId === void 0 ? void 0 : fieldId.split(separator)) || [];
39617
+ var inputValue = info.target || info.value || '';
39618
+ var displayValue = props.type === 'week' && inputValue ? "".concat(inputValue).concat(getLocale(locale, 'weekShort')) : inputValue;
39612
39619
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
39613
39620
  className: className,
39614
39621
  id: formFieldId[info.index],
@@ -39624,7 +39631,7 @@ var Result = function Result(props) {
39624
39631
  readOnly: !info.inputable,
39625
39632
  open: !!open,
39626
39633
  inputRef: inputRef,
39627
- value: info.target || info.value || '',
39634
+ value: displayValue,
39628
39635
  placeholder: info.place,
39629
39636
  onChange: function onChange(s) {
39630
39637
  _onChange(s, info.index);
@@ -44166,6 +44173,10 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
44166
44173
  if (props.formatResult) {
44167
44174
  if (typeof props.formatResult === 'string') {
44168
44175
  return getFormatValueArr(dateArr, props.formatResult);
44176
+ } else if (typeof props.formatResult === 'function') {
44177
+ return dateArr.map(function (item) {
44178
+ return props.formatResult(item);
44179
+ });
44169
44180
  } else {
44170
44181
  return dateArr.map(function (item) {
44171
44182
  if (!item) return '';
@@ -45100,6 +45111,7 @@ var Day = function Day(props) {
45100
45111
  if (match) format = match[0];
45101
45112
  }
45102
45113
  var showNeedConfirm = props.needConfirm && !props.range;
45114
+ if (props.type !== 'datetime' && props.type !== 'date' && !showNeedConfirm) return null;
45103
45115
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
45104
45116
  className: styles === null || styles === void 0 ? void 0 : styles.pickerFooter,
45105
45117
  dir: direction,
@@ -45129,13 +45141,13 @@ var Day = function Day(props) {
45129
45141
  marginRight: showNeedConfirm ? 'auto' : undefined,
45130
45142
  paddingLeft: showNeedConfirm ? props.type === 'date' ? 22 : 6 : undefined
45131
45143
  },
45132
- children: [props.showSelNow && props.type === 'date' && /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_link_link, {
45144
+ children: [props.type === 'date' && /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_link_link, {
45133
45145
  type: "primary",
45134
45146
  jssStyle: jssStyle,
45135
45147
  className: styles === null || styles === void 0 ? void 0 : styles.pickerFooterBtn,
45136
45148
  onClick: selNow,
45137
45149
  children: getLocale(locale, 'now')
45138
- }), props.showSelNow && props.type === 'datetime' && /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_link_link, {
45150
+ }), props.type === 'datetime' && /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_link_link, {
45139
45151
  type: "primary",
45140
45152
  jssStyle: jssStyle,
45141
45153
  className: styles === null || styles === void 0 ? void 0 : styles.pickerFooterBtn,
@@ -50431,11 +50443,28 @@ var use_form_flow_UseFormItem = function UseFormItem(props) {
50431
50443
  /* harmony default export */ var use_form_flow = (use_form_flow_UseFormItem);
50432
50444
  ;// CONCATENATED MODULE: ../base/src/form/form-flow.tsx
50433
50445
 
50446
+
50434
50447
  var FormFlow = function FormFlow(props) {
50448
+ var _props$names;
50435
50449
  var datum = use_form_flow({
50436
50450
  names: props.names
50437
50451
  });
50438
- if (isFunc(props.children)) return props.children(datum);
50452
+ var valueOfNames = (_props$names = props.names) === null || _props$names === void 0 ? void 0 : _props$names.map(function (name) {
50453
+ return datum === null || datum === void 0 ? void 0 : datum.get(name);
50454
+ });
50455
+ var memoizedResult = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
50456
+ if (!props.strict) return;
50457
+ if (isFunc(props.children)) {
50458
+ return props.children(datum);
50459
+ }
50460
+ return props.children;
50461
+ }, [valueOfNames === null || valueOfNames === void 0 ? void 0 : valueOfNames.toString()]);
50462
+ if (props.strict) {
50463
+ return memoizedResult;
50464
+ }
50465
+ if (isFunc(props.children)) {
50466
+ return props.children(datum);
50467
+ }
50439
50468
  return props.children;
50440
50469
  };
50441
50470
  /* harmony default export */ var form_flow = (FormFlow);
@@ -55600,36 +55629,36 @@ var PaginationJumper = function PaginationJumper(props) {
55600
55629
  total = props.total,
55601
55630
  pageSize = props.pageSize,
55602
55631
  disabled = props.disabled,
55603
- current = props.current,
55604
55632
  text = props.text,
55605
55633
  onChange = props.onChange;
55606
55634
  var paginationStyle = jssStyle === null || jssStyle === void 0 || (_jssStyle$pagination = jssStyle.pagination) === null || _jssStyle$pagination === void 0 ? void 0 : _jssStyle$pagination.call(jssStyle);
55607
55635
  var rootClasses = classnames_default()(paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.section, paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.jumper);
55608
55636
  var txt = text.jumper ? text.jumper.split('{input}') : [];
55609
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(String(current)),
55637
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
55610
55638
  _useState2 = slicedToArray_default()(_useState, 2),
55611
55639
  value = _useState2[0],
55612
55640
  setValue = _useState2[1];
55613
55641
  var getMax = function getMax() {
55614
55642
  return Math.ceil(total / pageSize) || 1;
55615
55643
  };
55644
+ var cleatInternalState = function cleatInternalState() {
55645
+ setValue('');
55646
+ };
55616
55647
  var handleKeyDown = function handleKeyDown(e) {
55617
55648
  if (e.key === 'Enter' || e.keyCode === 13) {
55618
- var _current = parseInt(e.target.value, 10);
55619
- if (!Number.isFinite(_current)) return;
55620
- if (_current < 1) _current = 1;
55649
+ var current = parseInt(e.target.value, 10);
55650
+ if (!Number.isFinite(current)) return;
55651
+ if (current < 1) current = 1;
55621
55652
  var max = getMax();
55622
- if (_current > max) _current = max;
55623
- onChange(_current);
55624
- setValue(String(_current));
55653
+ if (current > max) current = max;
55654
+ onChange(current);
55655
+ setValue(String(current));
55656
+ setTimeout(cleatInternalState, 20);
55625
55657
  }
55626
55658
  };
55627
55659
  var handleChange = function handleChange(v) {
55628
55660
  setValue(v || '');
55629
55661
  };
55630
- var handleBlur = function handleBlur() {
55631
- setValue(String(current));
55632
- };
55633
55662
  var renderInput = function renderInput() {
55634
55663
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_input_input, {
55635
55664
  jssStyle: jssStyle,
@@ -55642,7 +55671,7 @@ var PaginationJumper = function PaginationJumper(props) {
55642
55671
  disabled: disabled,
55643
55672
  onChange: handleChange,
55644
55673
  onKeyDown: handleKeyDown,
55645
- onBlur: handleBlur
55674
+ onBlur: cleatInternalState
55646
55675
  });
55647
55676
  };
55648
55677
  var renderPrefixText = function renderPrefixText() {
@@ -55657,9 +55686,6 @@ var PaginationJumper = function PaginationJumper(props) {
55657
55686
  children: txt[1]
55658
55687
  }) : undefined;
55659
55688
  };
55660
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
55661
- setValue(String(current));
55662
- }, [current]);
55663
55689
  if (simple) {
55664
55690
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
55665
55691
  className: rootClasses,
@@ -56040,7 +56066,6 @@ var PaginationSimple = function PaginationSimple(props) {
56040
56066
  total: total,
56041
56067
  text: text,
56042
56068
  size: size,
56043
- current: current,
56044
56069
  pageSize: pageSize,
56045
56070
  onChange: onChange
56046
56071
  });
@@ -56198,7 +56223,6 @@ var Pagination = function Pagination(props) {
56198
56223
  return /*#__PURE__*/(0,jsx_runtime.jsx)(pagination_jumper, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
56199
56224
  text: text,
56200
56225
  total: total,
56201
- current: current,
56202
56226
  pageSize: pageSize,
56203
56227
  onChange: onChange
56204
56228
  }), i);
@@ -69605,7 +69629,7 @@ var upload_interface = __webpack_require__(8821);
69605
69629
 
69606
69630
 
69607
69631
  /* harmony default export */ var src_0 = ({
69608
- version: '3.6.0-beta.29'
69632
+ version: '3.6.0-beta.30'
69609
69633
  });
69610
69634
  }();
69611
69635
  /******/ return __webpack_exports__;