shineout 3.4.0 → 3.4.2-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/README-zh_CN.md CHANGED
@@ -14,49 +14,52 @@
14
14
  <img src="https://img.shields.io/badge/React-%3E%3D16.8.0-green.svg?style=flat-square">
15
15
  </p>
16
16
 
17
- ## 特性
17
+ ## 特性
18
18
 
19
19
  - 精巧且友好的 API
20
20
  - 开箱即用的高性能 React 组件
21
21
  - 接口永远向下兼容
22
22
  - 灵活的主题配置
23
23
 
24
- ## 依赖
24
+ ## 🛠️ 依赖
25
25
 
26
26
  ```
27
27
  react >= 16.8.0
28
28
  react-dom >= 16.8.0
29
29
  ```
30
30
 
31
- ## 浏览器支持
31
+ ## 🖥 浏览器支持
32
32
 
33
33
  | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png" alt="Electron" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Electron |
34
34
  | --------- | --------- | --------- | --------- | --------- | --------- |
35
35
  | Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions| last 2 versions |
36
36
 
37
- ## 安装
37
+ ## 📦 安装
38
38
 
39
39
  ```bash
40
- yarn add shineout
40
+ npm install shineout
41
41
  ```
42
- // or
42
+
43
43
  ```bash
44
- npm install shineout
44
+ yarn add shineout
45
45
  ```
46
46
 
47
- ## CDN
47
+ ```bash
48
+ pnpm add shineout
49
+ ```
50
+ ## 🔗 CDN
48
51
 
49
52
  ```html
50
53
  <script crossorigin src="https://unpkg.com/shineout/dist/shineout.min.js"></script>
51
54
  ```
52
55
 
53
- ## 使用
56
+ ## 🔨 使用
54
57
 
55
- ```javascript
58
+ ```tsx
56
59
  import { Button } from 'shineout'
57
60
 
58
- <Button />
61
+ <Button>Click me</Button>
59
62
  ```
60
63
 
61
- ## 开源许可
64
+ ## 📄 开源许可
62
65
  [MIT](./LICENSE)
package/README.md CHANGED
@@ -14,52 +14,54 @@ English | [简体中文](./README-zh_CN.md)
14
14
  <img src="https://img.shields.io/badge/React-%3E%3D16.8.0-green.svg?style=flat-square">
15
15
  </p>
16
16
 
17
- ## Features
17
+ ## Features
18
18
 
19
19
  - A concise and friendly API
20
20
  - A set of high-performance React components out of the box.
21
21
  - Always backward compatible
22
22
  - Flexible theme customization
23
23
 
24
- ## Requirements
24
+ ## 🛠️ Requirements
25
25
 
26
26
  ```
27
27
  react >= 16.8.0
28
28
  react-dom >= 16.8.0
29
29
  ```
30
30
 
31
- ## Browsers support
31
+ ## 🖥 Browsers support
32
32
 
33
33
  | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png" alt="Electron" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Electron |
34
34
  | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
35
35
  | Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
36
36
 
37
- ## Installation
37
+ ## 📦 Installation
38
38
 
39
39
  ```bash
40
- yarn add shineout
40
+ npm install shineout
41
41
  ```
42
42
 
43
- // or
43
+ ```bash
44
+ yarn add shineout
45
+ ```
44
46
 
45
47
  ```bash
46
- npm install shineout
48
+ pnpm add shineout
47
49
  ```
48
50
 
49
- ## CDN
51
+ ## 🔗 CDN
50
52
 
51
53
  ```html
52
54
  <script crossorigin src="https://unpkg.com/shineout/dist/shineout.min.js"></script>
53
55
  ```
54
56
 
55
- ## Usage
57
+ ## 🔨 Usage
56
58
 
57
- ```javascript
59
+ ```tsx
58
60
  import { Button } from 'shineout'
59
61
 
60
- ;<Button />
62
+ <Button>Click me</Button>
61
63
  ```
62
64
 
63
- ## LICENSE
65
+ ## 📄 LICENSE
64
66
 
65
67
  [MIT](./LICENSE)
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.0'
495
+ version: '3.4.2-beta.1'
496
496
  };
@@ -22,6 +22,7 @@ export type ReactComponentType = React.ComponentType<BaseTestProps>;
22
22
  export declare function baseTest(Component: ReactComponentType | JSX.Element, selector: string, styleV?: StyleProps, styleRender?: string, className?: string, data?: any): void;
23
23
  export declare function childrenTest(Component: React.ComponentType<BaseTestProps>, selector: string): void;
24
24
  export declare function inputValueTest(element: Element, value: string): void;
25
+ export declare function inputPlaceholderTest(element: Element, value: string): void;
25
26
  export declare function displayTest(Component: React.FC, displayName: string): void;
26
27
  export declare const delay: (time: number) => Promise<void>;
27
28
  type classNamesMapType = {
@@ -13,6 +13,7 @@ exports.componentsClassTest = componentsClassTest;
13
13
  exports.delay = exports.createClassName = void 0;
14
14
  exports.displayTest = displayTest;
15
15
  exports.hasAttributesTest = hasAttributesTest;
16
+ exports.inputPlaceholderTest = inputPlaceholderTest;
16
17
  exports.inputValueTest = inputValueTest;
17
18
  exports.snapshotTest = snapshotTest;
18
19
  exports.snapshotTestByClick = snapshotTestByClick;
@@ -136,6 +137,9 @@ function childrenTest(Component, selector) {
136
137
  function inputValueTest(element, value) {
137
138
  attributesTest(element, 'value', value);
138
139
  }
140
+ function inputPlaceholderTest(element, value) {
141
+ attributesTest(element, 'placeholder', value);
142
+ }
139
143
  function displayTest(Component, displayName) {
140
144
  test('should start with Shineout display', function () {
141
145
  expect(Component.displayName).toBe(displayName);
package/dist/shineout.js CHANGED
@@ -11991,7 +11991,7 @@ var handleStyle = function handleStyle(style) {
11991
11991
  };
11992
11992
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11993
11993
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11994
- /* harmony default export */ var version = ('3.4.0');
11994
+ /* harmony default export */ var version = ('3.4.2-beta.1');
11995
11995
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11996
11996
 
11997
11997
 
@@ -19562,8 +19562,8 @@ var groupSpace = function groupSpace(gap) {
19562
19562
  padding: "0 ".concat(gap),
19563
19563
  display: 'flex',
19564
19564
  alignItems: 'center',
19565
- border: "1px solid ".concat(src.inputBorderColor),
19566
- borderWidth: '0 1px',
19565
+ borderLeft: "1px solid ".concat(src.inputBorderColor),
19566
+ borderRight: "1px solid ".concat(src.inputBorderColor),
19567
19567
  background: src.inputGroupFontBackgroundColor,
19568
19568
  fontWeight: 'normal',
19569
19569
  color: src.inputGroupFontColor,
@@ -19771,8 +19771,8 @@ var input_input = objectSpread2_default()(objectSpread2_default()(objectSpread2_
19771
19771
  transform: 'rotate(45deg) translateY(3px)',
19772
19772
  width: '6px',
19773
19773
  height: '6px',
19774
- border: "1px solid ".concat(src.inputBorderColor),
19775
- borderWidth: '1px 0 0 1px',
19774
+ borderTop: "1px solid ".concat(src.inputBorderColor),
19775
+ borderLeft: "1px solid ".concat(src.inputBorderColor),
19776
19776
  background: 'inherit',
19777
19777
  content: "' '"
19778
19778
  },
@@ -26249,8 +26249,8 @@ var textarea_input = objectSpread2_default()(objectSpread2_default()(objectSprea
26249
26249
  transform: 'rotate(45deg) translateY(3px)',
26250
26250
  width: '6px',
26251
26251
  height: '6px',
26252
- border: "1px solid ".concat(src.textareaBorderColor),
26253
- borderWidth: '1px 0 0 1px',
26252
+ borderTop: "1px solid ".concat(src.textareaBorderColor),
26253
+ borderLeft: "1px solid ".concat(src.textareaBorderColor),
26254
26254
  background: 'inherit',
26255
26255
  content: "' '"
26256
26256
  },
@@ -26847,7 +26847,9 @@ var treeStyle = {
26847
26847
  },
26848
26848
  noline: {
26849
26849
  '& $iconWrapper': {
26850
- // left: 12,
26850
+ '& $icon': {
26851
+ transition: 'transform .2s cubic-bezier(.34,.69,.1,1)'
26852
+ }
26851
26853
  },
26852
26854
  '& $iconWrapper[data-expanded="false"][data-icon="false"]': {
26853
26855
  '& $icon': {
@@ -26869,16 +26871,38 @@ var treeStyle = {
26869
26871
  '&$leaf': {
26870
26872
  paddingLeft: 24
26871
26873
  }
26874
+ },
26875
+ '& > $root': {
26876
+ '& > $node': {
26877
+ paddingLeft: 24
26878
+ }
26872
26879
  }
26873
26880
  },
26874
26881
  root: {
26875
- '& > :first-child$node': {
26882
+ // '& > :first-child$node': {
26883
+ // '&::before': {
26884
+ // top: 18,
26885
+ // },
26886
+ // },
26887
+ // '& > :last-child$node': {
26888
+ // '&::before': {},
26889
+ // },
26890
+ '& > $node': {
26891
+ paddingLeft: 12,
26892
+ '& > $contentWrapper > $iconWrapper': {
26893
+ '&[dir=ltr]': {
26894
+ left: 0
26895
+ },
26896
+ '&[dir=rtl]': {
26897
+ right: 0
26898
+ }
26899
+ },
26876
26900
  '&::before': {
26877
- top: 18
26901
+ display: 'none'
26902
+ },
26903
+ '&::after': {
26904
+ display: 'none'
26878
26905
  }
26879
- },
26880
- '& > :last-child$node': {
26881
- '&::before': {}
26882
26906
  }
26883
26907
  },
26884
26908
  small: {},
@@ -26986,6 +27010,7 @@ var treeStyle = {
26986
27010
  borderRadius: '50%',
26987
27011
  color: src.treeItemFontColor,
26988
27012
  cursor: 'pointer',
27013
+ transition: 'background .2s ease',
26989
27014
  // transform: 'rotate(-90deg)',
26990
27015
  '&:hover': {
26991
27016
  background: src.treeItemHoverBackgroundColor
@@ -36643,6 +36668,7 @@ var result_Input = function Input(props) {
36643
36668
  placeholder: props.placeholder,
36644
36669
  autoComplete: 'off',
36645
36670
  value: value,
36671
+ readOnly: props.readOnly,
36646
36672
  maxLength: props.maxLength,
36647
36673
  disabled: props.disabled,
36648
36674
  onBlur: props.onBlur,
@@ -36736,12 +36762,13 @@ var Result = function Result(props) {
36736
36762
  className: className,
36737
36763
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
36738
36764
  className: styles === null || styles === void 0 ? void 0 : styles.resultTextPadding,
36739
- children: info.inputable ? /*#__PURE__*/(0,jsx_runtime.jsx)(result_Input, {
36765
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(result_Input, {
36740
36766
  onRef: function onRef(el) {
36741
36767
  _onRef.current.inputRef = el;
36742
36768
  context.inputRefs[info.index] = el;
36743
36769
  },
36744
- disabled: dis,
36770
+ disabled: dis && info.inputable,
36771
+ readOnly: !info.inputable,
36745
36772
  open: !!open,
36746
36773
  inputRef: inputRef,
36747
36774
  value: info.target || info.value || '',
@@ -36768,10 +36795,7 @@ var Result = function Result(props) {
36768
36795
  (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, e);
36769
36796
  },
36770
36797
  onClick: onClickProps
36771
- }, info.index) : info.target || info.value || /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
36772
- className: styles === null || styles === void 0 ? void 0 : styles.placeholder,
36773
- children: info.place
36774
- })
36798
+ }, info.index)
36775
36799
  }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
36776
36800
  className: styles === null || styles === void 0 ? void 0 : styles.resultTextBg
36777
36801
  })]
@@ -38904,7 +38928,7 @@ function useFormControl(props) {
38904
38928
  }
38905
38929
  }
38906
38930
  };
38907
- }, [name]);
38931
+ }, [name === null || name === void 0 ? void 0 : name.toString()]);
38908
38932
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
38909
38933
  updateError(isArray(name) ? name.join('|') : name, error);
38910
38934
  }, [error]);
@@ -46007,12 +46031,15 @@ var useForm = function useForm(props) {
46007
46031
  validate: false
46008
46032
  };
46009
46033
  onChange(function (draft) {
46010
- Object.keys(vals).forEach(function (key) {
46034
+ var values = Object.keys(vals);
46035
+ // 针对 name 为数组模式,如 datepicker 的 name={['startTime', 'endTime']} 时,前者校验可能需要依赖后者,因此需要提前将后者数据整合至 draft 用于多字段整合校验
46036
+ var nextDraft = Object.assign({}, current(draft), vals);
46037
+ values.forEach(function (key) {
46011
46038
  deepSet(draft, key, vals[key], deepSetOptions);
46012
46039
  if (option.validate) {
46013
46040
  var _context$validateMap$;
46014
46041
  (_context$validateMap$ = context.validateMap[key]) === null || _context$validateMap$ === void 0 || _context$validateMap$.forEach(function (validate) {
46015
- validate(key, vals[key], current(draft));
46042
+ validate(key, vals[key], nextDraft);
46016
46043
  });
46017
46044
  }
46018
46045
  });
@@ -50819,13 +50846,13 @@ var ListColumnsOption = function ListColumnsOption(props) {
50819
50846
  datum = props.datum,
50820
50847
  size = props.size,
50821
50848
  multiple = props.multiple,
50849
+ columns = props.columns,
50822
50850
  _props$columnWidth = props.columnWidth,
50823
50851
  columnWidth = _props$columnWidth === void 0 ? 160 : _props$columnWidth,
50824
- renderItemProp = props.renderItem,
50825
- closePop = props.closePop;
50852
+ renderItemProp = props.renderItem;
50826
50853
  var styles = jssStyle === null || jssStyle === void 0 || (_jssStyle$select = jssStyle.select) === null || _jssStyle$select === void 0 ? void 0 : _jssStyle$select.call(jssStyle);
50827
50854
  var style = {
50828
- width: columnWidth
50855
+ width: columns && columns <= 1 ? '100%' : columnWidth
50829
50856
  };
50830
50857
  var isChecked = datum.check(data);
50831
50858
  var isDisabled = datum.disabledCheck(data);
@@ -50992,6 +51019,7 @@ var ColumnsList = function ColumnsList(props) {
50992
51019
  data: item,
50993
51020
  size: size,
50994
51021
  datum: datum,
51022
+ columns: columns,
50995
51023
  multiple: multiple,
50996
51024
  columnWidth: columnWidth,
50997
51025
  renderItem: renderItemProp,
@@ -51733,7 +51761,7 @@ function Select(props0) {
51733
51761
  children: [tipNode, renderResult(), /*#__PURE__*/(0,jsx_runtime.jsx)(absolute_list, {
51734
51762
  adjust: adjust,
51735
51763
  focus: open,
51736
- fixedWidth: !props.columns && (autoAdapt ? 'min' : true),
51764
+ fixedWidth: (!props.columns || props.columns <= 1) && (autoAdapt ? 'min' : true),
51737
51765
  absolute: props.absolute,
51738
51766
  zIndex: props.zIndex,
51739
51767
  position: position,
@@ -59346,7 +59374,6 @@ var TabsHeader = function TabsHeader(props) {
59346
59374
  handleTransform = _useTransform.handleTransform,
59347
59375
  setTransform = _useTransform.setTransform;
59348
59376
  var headerStyle = (jssStyle === null || jssStyle === void 0 || (_jssStyle$tabs = jssStyle.tabs) === null || _jssStyle$tabs === void 0 ? void 0 : _jssStyle$tabs.call(jssStyle)) || {};
59349
- var headerClass = classnames_default()(headerStyle.header, {});
59350
59377
  var headerWrapperClass = classnames_default()(headerStyle.headerWrapper, {});
59351
59378
  var buttonStyle = (jssStyle === null || jssStyle === void 0 ? void 0 : jssStyle.button) || {};
59352
59379
  var calculateOffset = function calculateOffset(currentScrollOffsetStartValue, width, currentOffsetStartValue, currentOffsetEndOther, parentWidth) {
@@ -59419,12 +59446,13 @@ var TabsHeader = function TabsHeader(props) {
59419
59446
  });
59420
59447
  };
59421
59448
  var renderTab = function renderTab() {
59449
+ var headerClass = classnames_default()(headerStyle.header, shape === 'card' ? headerStyle.cardHr : '');
59422
59450
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
59423
59451
  ref: headerRef,
59424
59452
  className: headerClass,
59425
59453
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
59426
59454
  ref: scrollRef,
59427
- className: classnames_default()(headerStyle.headerScroll, shape === 'card' ? headerStyle.cardHr : ''),
59455
+ className: headerStyle.headerScroll,
59428
59456
  onWheel: handleTransform,
59429
59457
  style: transformStyle,
59430
59458
  children: [shape === 'button' && /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_button_button.Group, {
@@ -65054,7 +65082,7 @@ var upload_interface = __webpack_require__(8821);
65054
65082
 
65055
65083
 
65056
65084
  /* harmony default export */ var src_0 = ({
65057
- version: '3.4.0'
65085
+ version: '3.4.2-beta.1'
65058
65086
  });
65059
65087
  }();
65060
65088
  /******/ return __webpack_exports__;