shineout 3.4.4-beta.9 → 3.4.5-beta.1

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
@@ -492,5 +492,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
492
492
  // 此文件由脚本自动生成,请勿直接修改。
493
493
  // This file was generated automatically by a script. Please do not modify it directly.
494
494
  var _default = exports.default = {
495
- version: '3.4.4-beta.9'
495
+ version: '3.4.5-beta.1'
496
496
  };
package/cjs/list/list.js CHANGED
@@ -23,7 +23,8 @@ var jssStyle = {
23
23
  checkbox: _shineoutStyle.useCheckboxStyle,
24
24
  empty: _shineoutStyle.useEmptyStyle,
25
25
  spin: _shineoutStyle.useSpinStyle,
26
- image: _shineoutStyle.useImageStyle
26
+ image: _shineoutStyle.useImageStyle,
27
+ select: _shineoutStyle.useSelectStyle
27
28
  };
28
29
  var _default = exports.default = function _default(props) {
29
30
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_base.List, _objectSpread({
package/dist/shineout.js CHANGED
@@ -11984,7 +11984,7 @@ var handleStyle = function handleStyle(style) {
11984
11984
  };
11985
11985
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11986
11986
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11987
- /* harmony default export */ var version = ('3.4.4-beta.9');
11987
+ /* harmony default export */ var version = ('3.4.5-beta.1');
11988
11988
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11989
11989
 
11990
11990
 
@@ -19112,16 +19112,16 @@ var ImageStyle = objectSpread2_default()(objectSpread2_default()({}, animation),
19112
19112
  },
19113
19113
  circle: {
19114
19114
  borderRadius: src.imageCircleBorderRadius,
19115
- border: "1px solid ".concat(src.imageBorderColor)
19115
+ outline: "1px solid ".concat(src.imageBorderColor)
19116
19116
  },
19117
19117
  rounded: {
19118
19118
  borderRadius: src.imageBorderRadius,
19119
- border: "1px solid ".concat(src.imageBorderColor)
19119
+ outline: "1px solid ".concat(src.imageBorderColor)
19120
19120
  },
19121
19121
  thumbnail: {
19122
19122
  borderRadius: src.imageBorderRadius,
19123
19123
  backgroundColor: '#FFFFFF',
19124
- border: "1px solid ".concat(src.imageBorderColor),
19124
+ outline: "1px solid ".concat(src.imageBorderColor),
19125
19125
  '& $inner': {
19126
19126
  top: 4,
19127
19127
  left: 4,
@@ -19911,6 +19911,9 @@ var listStyle = {
19911
19911
  border: "".concat(src.listBorderWidth, " solid ").concat(src.listBorderColor),
19912
19912
  borderRadius: src.listBorderRadius
19913
19913
  },
19914
+ wrapperEmpty: {
19915
+ justifyContent: 'center'
19916
+ },
19914
19917
  wrapperSmall: {},
19915
19918
  wrapperLarge: {},
19916
19919
  wrapperStriped: {
@@ -29870,6 +29873,7 @@ var useContainer = function useContainer() {
29870
29873
 
29871
29874
 
29872
29875
  var AbsoluteContext = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext)(false);
29876
+ AbsoluteContext.displayName = 'AbsoluteContext';
29873
29877
  /* harmony default export */ var absolute_context = (AbsoluteContext);
29874
29878
  ;// CONCATENATED MODULE: ../base/src/absolute-list/absolute-list.tsx
29875
29879
 
@@ -32108,6 +32112,67 @@ var card_group_jssStyle = {
32108
32112
  jssStyle: card_group_jssStyle
32109
32113
  }, props));
32110
32114
  });
32115
+ ;// CONCATENATED MODULE: ../hooks/src/common/use-in-view/use-in-view.ts
32116
+
32117
+
32118
+ var useInView = function useInView() {
32119
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
32120
+ var elementRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
32121
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
32122
+ _useState2 = slicedToArray_default()(_useState, 2),
32123
+ isInView = _useState2[0],
32124
+ setIsInView = _useState2[1];
32125
+ var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
32126
+ _useState4 = slicedToArray_default()(_useState3, 2),
32127
+ wasInView = _useState4[0],
32128
+ setWasInView = _useState4[1];
32129
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
32130
+ var element = elementRef.current;
32131
+ if (!element) return;
32132
+ var observer = new IntersectionObserver(function (_ref) {
32133
+ var _ref2 = slicedToArray_default()(_ref, 1),
32134
+ entry = _ref2[0];
32135
+ var inView = entry.isIntersecting;
32136
+ setIsInView(inView);
32137
+ if (inView) {
32138
+ setWasInView(true);
32139
+ // 如果设置了 once 选项,且元素已经出现过,则取消观察
32140
+ if (options.once) {
32141
+ observer.disconnect();
32142
+ }
32143
+ }
32144
+ }, {
32145
+ root: options.root || null,
32146
+ rootMargin: options.rootMargin || '0px',
32147
+ threshold: options.threshold || 0
32148
+ });
32149
+ observer.observe(element);
32150
+ return function () {
32151
+ observer.disconnect();
32152
+ };
32153
+ }, [options.root, options.rootMargin, options.threshold, options.once]);
32154
+ return {
32155
+ ref: elementRef,
32156
+ isInView: isInView,
32157
+ wasInView: wasInView
32158
+ };
32159
+ };
32160
+ /* harmony default export */ var use_in_view = (useInView);
32161
+
32162
+ // 使用示例
32163
+ // const Example = () => {
32164
+ // const { ref, isInView } = useInView({
32165
+ // threshold: 0.5,
32166
+ // rootMargin: '50px',
32167
+ // once: true
32168
+ // });
32169
+
32170
+ // return (
32171
+ // <div ref={ref}>
32172
+ // {isInView ? '元素在视窗中' : '元素不在视窗中'}
32173
+ // </div>
32174
+ // );
32175
+ // };
32111
32176
  ;// CONCATENATED MODULE: ../hooks/src/utils/uid.ts
32112
32177
  function generateUUID() {
32113
32178
  var c = crypto || typeof window !== 'undefined' && window.crypto; // 获取加密库
@@ -34084,11 +34149,15 @@ var CheckboxWithContext = function CheckboxWithContext(props) {
34084
34149
 
34085
34150
 
34086
34151
 
34152
+
34087
34153
  var Item = function Item(props) {
34088
34154
  var _props$jssStyle, _props$jssStyle$cardG;
34089
34155
  var _useContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(CardGroupContext),
34090
34156
  container = _useContext.container;
34091
34157
  var classes = (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$cardG = _props$jssStyle.cardGroup) === null || _props$jssStyle$cardG === void 0 ? void 0 : _props$jssStyle$cardG.call(_props$jssStyle);
34158
+ var _useInView = use_in_view(),
34159
+ itemRef = _useInView.ref,
34160
+ isInView = _useInView.isInView;
34092
34161
  var handleChange = usePersistFn(function (_, checked) {
34093
34162
  if (props.onChange) props.onChange(checked, props.value);
34094
34163
  });
@@ -34112,9 +34181,15 @@ var Item = function Item(props) {
34112
34181
  className: classes === null || classes === void 0 ? void 0 : classes.checkbox
34113
34182
  })]
34114
34183
  });
34184
+ var itemStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
34185
+ return objectSpread2_default()(objectSpread2_default()({}, props.style), {}, {
34186
+ visibility: isInView ? 'visible' : 'hidden'
34187
+ });
34188
+ }, [isInView, props.style]);
34115
34189
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
34190
+ ref: itemRef,
34116
34191
  className: cls,
34117
- style: props.style,
34192
+ style: itemStyle,
34118
34193
  children: renderChildren(content)
34119
34194
  });
34120
34195
  };
@@ -37428,6 +37503,11 @@ var result_isObject = is_isObject,
37428
37503
  result_isUnMatchedData = isUnMatchedData,
37429
37504
  result_isFunc = isFunc,
37430
37505
  result_isArray = isArray;
37506
+ var getValueArr = function getValueArr(v) {
37507
+ return (result_isArray(v) ? v : [v]).filter(function (v) {
37508
+ return v !== undefined && v !== null;
37509
+ });
37510
+ };
37431
37511
  var result_Result = function Result(props) {
37432
37512
  var jssStyle = props.jssStyle,
37433
37513
  multiple = props.multiple,
@@ -37444,6 +37524,7 @@ var result_Result = function Result(props) {
37444
37524
  placeholder = props.placeholder,
37445
37525
  filterText = props.filterText,
37446
37526
  inputText = props.inputText,
37527
+ inputRef = props.inputRef,
37447
37528
  compressed = props.compressed,
37448
37529
  compressedBound = props.compressedBound,
37449
37530
  compressedClassName = props.compressedClassName,
@@ -37613,11 +37694,6 @@ var result_Result = function Result(props) {
37613
37694
  children: content
37614
37695
  }, 'single');
37615
37696
  };
37616
- var getValueArr = function getValueArr(v) {
37617
- return (result_isArray(v) ? v : [v]).filter(function (v) {
37618
- return v !== undefined && v !== null;
37619
- });
37620
- };
37621
37697
  var renderMultipleResult = function renderMultipleResult() {
37622
37698
  if (isEmptyResult()) return renderNbsp();
37623
37699
  // [TODO] separator 处理逻辑后续交给 hooks 处理,此处临时处理
@@ -37688,8 +37764,21 @@ var result_Result = function Result(props) {
37688
37764
  onFilter === null || onFilter === void 0 || onFilter('', 'blur');
37689
37765
  }, 400);
37690
37766
  }
37767
+
37768
+ // 单选场景下,焦点时自动选中input文本
37769
+ if (!multiple && focus && showInput && mounted.current) {
37770
+ var _result2 = getDataByValues(value);
37771
+ if (_result2.length > 0) {
37772
+ var inputTmpText = renderResultContent(_result2[0]);
37773
+ inputTmpText && props.setInputText(inputTmpText);
37774
+ }
37775
+ setTimeout(function () {
37776
+ var _inputRef$current;
37777
+ inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.select();
37778
+ }, 10);
37779
+ }
37691
37780
  mounted.current = true;
37692
- }, [focus]);
37781
+ }, [focus, placeholder, multiple]);
37693
37782
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
37694
37783
  handleResetMore();
37695
37784
  }, [valueProp, data]);
@@ -42905,11 +42994,13 @@ var Quick = function Quick(props) {
42905
42994
  format = props.format,
42906
42995
  options = props.options,
42907
42996
  children = props.children,
42908
- type = props.type;
42997
+ type = props.type,
42998
+ closePop = props.closePop;
42909
42999
  var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$datePicker = jssStyle.datePicker) === null || _jssStyle$datePicker === void 0 ? void 0 : _jssStyle$datePicker.call(jssStyle);
42910
43000
  var quickDateCache = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
42911
43001
  var quickActiveKey = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
42912
43002
  var handleClick = function handleClick(item, index) {
43003
+ var immediate = item.immediate;
42913
43004
  var itemV = isFunc(item.value) ? item.value() : item.value;
42914
43005
  quickDateCache.current = itemV;
42915
43006
  quickActiveKey.current = index;
@@ -42924,6 +43015,9 @@ var Quick = function Quick(props) {
42924
43015
  });
42925
43016
  props.setDateArr(dateArr);
42926
43017
  props.setCurrentArr(dateArr, 'quick', item);
43018
+ if (immediate && closePop) {
43019
+ closePop();
43020
+ }
42927
43021
  };
42928
43022
  if (!(quickSelect !== null && quickSelect !== void 0 && quickSelect.length)) {
42929
43023
  return children || null;
@@ -43301,6 +43395,7 @@ var Picker = function Picker(props) {
43301
43395
  className: styles === null || styles === void 0 ? void 0 : styles.pickerBox,
43302
43396
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)(quick, {
43303
43397
  quickSelect: props.quickSelect,
43398
+ closePop: props.closePop,
43304
43399
  range: props.range,
43305
43400
  jssStyle: jssStyle,
43306
43401
  dateArr: dateArr,
@@ -51722,6 +51817,7 @@ function Select(props0) {
51722
51817
  allowOnFilter: showInput,
51723
51818
  focusSelected: focusSelected,
51724
51819
  inputText: inputText,
51820
+ inputRef: inputRef,
51725
51821
  filterText: filterText,
51726
51822
  onFilter: handleFilter,
51727
51823
  onRef: inputRef,
@@ -51925,10 +52021,16 @@ var PaginationSizeList = function PaginationSizeList(props) {
51925
52021
  pageSizeList = _props$pageSizeList === void 0 ? [10, 20, 30, 50, 100] : _props$pageSizeList,
51926
52022
  text = props.text,
51927
52023
  size = props.size,
52024
+ select = props.select,
51928
52025
  pageSize = props.pageSize,
51929
52026
  onChange = props.onChange;
51930
52027
  var paginationStyle = jssStyle === null || jssStyle === void 0 || (_jssStyle$pagination = jssStyle.pagination) === null || _jssStyle$pagination === void 0 ? void 0 : _jssStyle$pagination.call(jssStyle);
51931
52028
  var rootClasses = classnames_default()(paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.section, paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.sizeList);
52029
+ var _ref = select || {},
52030
+ absolute = _ref.absolute,
52031
+ position = _ref.position,
52032
+ zIndex = _ref.zIndex;
52033
+ console.log('position', position);
51932
52034
  var handleChange = function handleChange(pageSize) {
51933
52035
  var start = (current - 1) * props.pageSize + 1;
51934
52036
  onChange(Math.ceil(start / pageSize), pageSize);
@@ -51938,7 +52040,9 @@ var PaginationSizeList = function PaginationSizeList(props) {
51938
52040
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_select_select, {
51939
52041
  jssStyle: jssStyle,
51940
52042
  disabled: disabled,
51941
- absolute: true,
52043
+ zIndex: zIndex || undefined,
52044
+ absolute: absolute || true,
52045
+ position: position || undefined,
51942
52046
  autoAdapt: true,
51943
52047
  keygen: true,
51944
52048
  size: size,
@@ -52509,7 +52613,8 @@ var Pagination = function Pagination(props) {
52509
52613
  _props$text = props.text,
52510
52614
  text = _props$text === void 0 ? {} : _props$text,
52511
52615
  pageSizeList = props.pageSizeList,
52512
- style = props.style;
52616
+ style = props.style,
52617
+ select = props.select;
52513
52618
  var _usePagination = use_pagination({
52514
52619
  total: total,
52515
52620
  span: span,
@@ -52574,6 +52679,7 @@ var Pagination = function Pagination(props) {
52574
52679
  total: props.total || 0,
52575
52680
  text: text,
52576
52681
  size: size,
52682
+ select: select,
52577
52683
  current: current || 0,
52578
52684
  pageSize: pageSize,
52579
52685
  pageSizeList: pageSizeList,
@@ -52637,6 +52743,7 @@ var list_list_List = function List(props) {
52637
52743
  _props$pagination = props.pagination,
52638
52744
  pagination = _props$pagination === void 0 ? {} : _props$pagination;
52639
52745
  var listClasses = (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$list = _props$jssStyle.list) === null || _props$jssStyle$list === void 0 ? void 0 : _props$jssStyle$list.call(_props$jssStyle);
52746
+ var isEmpty = !isArray(data) || data.length <= 0;
52640
52747
  var inputAble = useInputAble({
52641
52748
  value: props.value,
52642
52749
  onChange: props.onChange,
@@ -52760,6 +52867,7 @@ var list_list_List = function List(props) {
52760
52867
  }
52761
52868
  });
52762
52869
  var renderList = function renderList() {
52870
+ if (isEmpty) return null;
52763
52871
  if (props.fixed) return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
52764
52872
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_list, {
52765
52873
  data: columnData,
@@ -52789,7 +52897,7 @@ var list_list_List = function List(props) {
52789
52897
  }), renderFooter()]
52790
52898
  });
52791
52899
  };
52792
- var wrapperClass = classnames_default()(props.className, listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapper, props.bordered && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperBordered), props.size === 'small' && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperSmall), props.size === 'large' && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperLarge), props.striped && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperStriped));
52900
+ var wrapperClass = classnames_default()(props.className, listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapper, isEmpty && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperEmpty), props.bordered && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperBordered), props.size === 'small' && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperSmall), props.size === 'large' && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperLarge), props.striped && (listClasses === null || listClasses === void 0 ? void 0 : listClasses.wrapperStriped));
52793
52901
  var wrapperStyle = objectSpread2_default()(objectSpread2_default()({}, props.style), {}, {
52794
52902
  height: props.height
52795
52903
  });
@@ -52819,7 +52927,8 @@ var list_jssStyle = {
52819
52927
  checkbox: useCheckboxStyle,
52820
52928
  empty: useEmptyStyle,
52821
52929
  spin: useSpinStyle,
52822
- image: useImageStyle
52930
+ image: useImageStyle,
52931
+ select: useSelectStyle
52823
52932
  };
52824
52933
  /* harmony default export */ var src_list_list_0 = (function (props) {
52825
52934
  return /*#__PURE__*/(0,jsx_runtime.jsx)(src_list_list, objectSpread2_default()({
@@ -65254,7 +65363,7 @@ var upload_interface = __webpack_require__(8821);
65254
65363
 
65255
65364
 
65256
65365
  /* harmony default export */ var src_0 = ({
65257
- version: '3.4.4-beta.9'
65366
+ version: '3.4.5-beta.1'
65258
65367
  });
65259
65368
  }();
65260
65369
  /******/ return __webpack_exports__;