@sheinx/base 3.3.6-beta.7 → 3.3.7-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.
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group.d.ts","sourceRoot":"","sources":["checkbox-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAQ3D,QAAA,MAAM,KAAK;;;oBA2FG,GAAG;wBACC,GAAG;;CAHpB,CAAC;AAMF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"checkbox-group.d.ts","sourceRoot":"","sources":["checkbox-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAQ3D,QAAA,MAAM,KAAK;;;oBAiGG,GAAG;wBACC,GAAG;;CAHpB,CAAC;AAMF,eAAe,KAAK,CAAC"}
@@ -48,6 +48,10 @@ var Group = function Group(props0) {
48
48
  } else {
49
49
  datum.remove(raw);
50
50
  }
51
+ if (children && /*#__PURE__*/_react.default.isValidElement(children)) {
52
+ var _children$props$onCha, _children$props;
53
+ (_children$props$onCha = (_children$props = children.props).onChange) === null || _children$props$onCha === void 0 || _children$props$onCha.call(_children$props, checked ? children.props.htmlValue : undefined, checked, children.props.htmlValue);
54
+ }
51
55
  });
52
56
  var isChecked = (0, _hooks.usePersistFn)(function (d) {
53
57
  return datum.check(d);
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { ReultMoreProps } from './result-more.type';
2
+ import { ResultMoreProps } from './result-more.type';
3
3
  export declare function getResetMore(onFilter: boolean, container: HTMLElement, doms: NodeListOf<HTMLElement>): number;
4
- declare const _default: <DataItem, Value>(props: ReultMoreProps<DataItem, Value>) => JSX.Element;
4
+ declare const _default: <DataItem, Value>(props: ResultMoreProps<DataItem, Value>) => JSX.Element;
5
5
  export default _default;
6
6
  //# sourceMappingURL=result-more.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"result-more.d.ts","sourceRoot":"","sources":["result-more.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKpD,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,WAAW,EACtB,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,UA6D9B;;AA4FD,wBAAyC"}
1
+ {"version":3,"file":"result-more.d.ts","sourceRoot":"","sources":["result-more.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAKrD,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,WAAW,EACtB,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,UA6D9B;;AA4FD,wBAAyC"}
@@ -91,7 +91,7 @@ var More = function More(props) {
91
91
  var before = [];
92
92
  var after = [];
93
93
  var itemsLength = 0;
94
- var tagStlye = shouldShowMore ? {
94
+ var tagStyle = shouldShowMore ? {
95
95
  position: 'absolute',
96
96
  zIndex: -100,
97
97
  userSelect: 'none',
@@ -139,7 +139,7 @@ var More = function More(props) {
139
139
  className: styles.tag,
140
140
  jssStyle: jssStyle,
141
141
  size: size,
142
- style: tagStlye,
142
+ style: tagStyle,
143
143
  mode: visible ? 'fill' : 'bright',
144
144
  color: visible ? 'info' : 'default',
145
145
  children: shouldShowMore ? '+' : "+".concat(itemsLength)
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { SelectProps } from './select.type';
3
- export interface ReultMoreProps<DataItem, Value> extends Pick<SelectProps<DataItem, Value>, 'jssStyle' | 'size' | 'multiple' | 'placeholder' | 'keygen' | 'value' | 'compressed' | 'compressedBound' | 'compressedClassName' | 'disabled' | 'onFilter'> {
3
+ export interface ResultMoreProps<DataItem, Value> extends Pick<SelectProps<DataItem, Value>, 'jssStyle' | 'size' | 'multiple' | 'placeholder' | 'keygen' | 'value' | 'compressed' | 'compressedBound' | 'compressedClassName' | 'disabled' | 'onFilter'> {
4
4
  data: React.ReactNode[];
5
5
  more?: number;
6
6
  showNum?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"result-more.type.d.ts","sourceRoot":"","sources":["result-more.type.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,cAAc,CAAC,QAAQ,EAAE,KAAK,CAC7C,SAAQ,IAAI,CACV,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,EAC1B,UAAU,GACV,MAAM,GACN,UAAU,GACV,aAAa,GACb,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,iBAAiB,GACjB,qBAAqB,GACrB,UAAU,GACV,UAAU,CACb;IACD,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C"}
1
+ {"version":3,"file":"result-more.type.d.ts","sourceRoot":"","sources":["result-more.type.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,eAAe,CAAC,QAAQ,EAAE,KAAK,CAC9C,SAAQ,IAAI,CACV,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,EAC1B,UAAU,GACV,MAAM,GACN,UAAU,GACV,aAAa,GACb,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,iBAAiB,GACjB,qBAAqB,GACrB,UAAU,GACV,UAAU,CACb;IACD,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C"}
package/cjs/tag/tag.js CHANGED
@@ -20,7 +20,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
20
20
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
21
21
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
22
22
  var Done = 2;
23
- var Pendding = 1;
23
+ var Pending = 1;
24
24
  var Tag = function Tag(props) {
25
25
  var _jssStyle$tag;
26
26
  var jssStyle = props.jssStyle,
@@ -103,7 +103,7 @@ var Tag = function Tag(props) {
103
103
  if (!showClose) {
104
104
  return null;
105
105
  }
106
- if (dismiss === Pendding) {
106
+ if (dismiss === Pending) {
107
107
  // 后面用 Spin 替换
108
108
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {});
109
109
  }
@@ -14,7 +14,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
14
14
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
15
  var Done = 2;
16
16
  var Finish = 0;
17
- var Pendding = 1;
17
+ var Pending = 1;
18
18
  var isEmpty = _hooks.util.isEmpty,
19
19
  isPromise = _hooks.util.isPromise,
20
20
  isString = _hooks.util.isString,
@@ -65,7 +65,7 @@ var useTag = function useTag(props) {
65
65
  if (typeof onClose === 'function') {
66
66
  callback = onClose(e);
67
67
  if (isPromise(callback)) {
68
- setDismiss(Pendding);
68
+ setDismiss(Pending);
69
69
  callback.then(function () {
70
70
  setDismiss(Done);
71
71
  }).catch(function () {
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group.d.ts","sourceRoot":"","sources":["checkbox-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAQ3D,QAAA,MAAM,KAAK;;;oBA2FG,GAAG;wBACC,GAAG;;CAHpB,CAAC;AAMF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"checkbox-group.d.ts","sourceRoot":"","sources":["checkbox-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAQ3D,QAAA,MAAM,KAAK;;;oBAiGG,GAAG;wBACC,GAAG;;CAHpB,CAAC;AAMF,eAAe,KAAK,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { useInputAble, useListSelectMultiple, usePersistFn, util } from '@sheinx/hooks';
2
- import groupContext from "./group-context";
2
+ import GroupContext from "./group-context";
3
3
  import Checkbox from "./checkbox";
4
4
  import React from 'react';
5
5
  import classNames from 'classnames';
@@ -42,6 +42,10 @@ var Group = function Group(props0) {
42
42
  } else {
43
43
  datum.remove(raw);
44
44
  }
45
+ if (children && /*#__PURE__*/React.isValidElement(children)) {
46
+ var _children$props$onCha, _children$props;
47
+ (_children$props$onCha = (_children$props = children.props).onChange) === null || _children$props$onCha === void 0 || _children$props$onCha.call(_children$props, checked ? children.props.htmlValue : undefined, checked, children.props.htmlValue);
48
+ }
45
49
  });
46
50
  var isChecked = usePersistFn(function (d) {
47
51
  return datum.check(d);
@@ -67,7 +71,7 @@ var Group = function Group(props0) {
67
71
  return /*#__PURE__*/_jsx("div", {
68
72
  className: groupClass,
69
73
  style: style,
70
- children: /*#__PURE__*/_jsx(groupContext.Provider, {
74
+ children: /*#__PURE__*/_jsx(GroupContext.Provider, {
71
75
  value: providerValue,
72
76
  children: children
73
77
  })
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { ReultMoreProps } from './result-more.type';
2
+ import { ResultMoreProps } from './result-more.type';
3
3
  export declare function getResetMore(onFilter: boolean, container: HTMLElement, doms: NodeListOf<HTMLElement>): number;
4
- declare const _default: <DataItem, Value>(props: ReultMoreProps<DataItem, Value>) => JSX.Element;
4
+ declare const _default: <DataItem, Value>(props: ResultMoreProps<DataItem, Value>) => JSX.Element;
5
5
  export default _default;
6
6
  //# sourceMappingURL=result-more.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"result-more.d.ts","sourceRoot":"","sources":["result-more.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKpD,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,WAAW,EACtB,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,UA6D9B;;AA4FD,wBAAyC"}
1
+ {"version":3,"file":"result-more.d.ts","sourceRoot":"","sources":["result-more.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAKrD,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,WAAW,EACtB,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,UA6D9B;;AA4FD,wBAAyC"}
@@ -81,7 +81,7 @@ var More = function More(props) {
81
81
  var before = [];
82
82
  var after = [];
83
83
  var itemsLength = 0;
84
- var tagStlye = shouldShowMore ? {
84
+ var tagStyle = shouldShowMore ? {
85
85
  position: 'absolute',
86
86
  zIndex: -100,
87
87
  userSelect: 'none',
@@ -129,7 +129,7 @@ var More = function More(props) {
129
129
  className: styles.tag,
130
130
  jssStyle: jssStyle,
131
131
  size: size,
132
- style: tagStlye,
132
+ style: tagStyle,
133
133
  mode: visible ? 'fill' : 'bright',
134
134
  color: visible ? 'info' : 'default',
135
135
  children: shouldShowMore ? '+' : "+".concat(itemsLength)
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { SelectProps } from './select.type';
3
- export interface ReultMoreProps<DataItem, Value> extends Pick<SelectProps<DataItem, Value>, 'jssStyle' | 'size' | 'multiple' | 'placeholder' | 'keygen' | 'value' | 'compressed' | 'compressedBound' | 'compressedClassName' | 'disabled' | 'onFilter'> {
3
+ export interface ResultMoreProps<DataItem, Value> extends Pick<SelectProps<DataItem, Value>, 'jssStyle' | 'size' | 'multiple' | 'placeholder' | 'keygen' | 'value' | 'compressed' | 'compressedBound' | 'compressedClassName' | 'disabled' | 'onFilter'> {
4
4
  data: React.ReactNode[];
5
5
  more?: number;
6
6
  showNum?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"result-more.type.d.ts","sourceRoot":"","sources":["result-more.type.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,cAAc,CAAC,QAAQ,EAAE,KAAK,CAC7C,SAAQ,IAAI,CACV,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,EAC1B,UAAU,GACV,MAAM,GACN,UAAU,GACV,aAAa,GACb,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,iBAAiB,GACjB,qBAAqB,GACrB,UAAU,GACV,UAAU,CACb;IACD,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C"}
1
+ {"version":3,"file":"result-more.type.d.ts","sourceRoot":"","sources":["result-more.type.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,eAAe,CAAC,QAAQ,EAAE,KAAK,CAC9C,SAAQ,IAAI,CACV,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,EAC1B,UAAU,GACV,MAAM,GACN,UAAU,GACV,aAAa,GACb,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,iBAAiB,GACjB,qBAAqB,GACrB,UAAU,GACV,UAAU,CACb;IACD,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C"}
package/esm/tag/tag.js CHANGED
@@ -14,7 +14,7 @@ import TagInput from "./tag-input";
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
16
  var Done = 2;
17
- var Pendding = 1;
17
+ var Pending = 1;
18
18
  var Tag = function Tag(props) {
19
19
  var _jssStyle$tag;
20
20
  var jssStyle = props.jssStyle,
@@ -97,7 +97,7 @@ var Tag = function Tag(props) {
97
97
  if (!showClose) {
98
98
  return null;
99
99
  }
100
- if (dismiss === Pendding) {
100
+ if (dismiss === Pending) {
101
101
  // 后面用 Spin 替换
102
102
  return /*#__PURE__*/_jsx("span", {});
103
103
  }
@@ -8,7 +8,7 @@ import { util } from '@sheinx/hooks';
8
8
  import { useState, useEffect } from 'react';
9
9
  var Done = 2;
10
10
  var Finish = 0;
11
- var Pendding = 1;
11
+ var Pending = 1;
12
12
  var isEmpty = util.isEmpty,
13
13
  isPromise = util.isPromise,
14
14
  isString = util.isString,
@@ -59,7 +59,7 @@ var useTag = function useTag(props) {
59
59
  if (typeof onClose === 'function') {
60
60
  callback = onClose(e);
61
61
  if (isPromise(callback)) {
62
- setDismiss(Pendding);
62
+ setDismiss(Pending);
63
63
  callback.then(function () {
64
64
  setDismiss(Done);
65
65
  }).catch(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.3.6-beta.7",
3
+ "version": "3.3.7-beta.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "module": "./esm/index.js",
11
11
  "typings": "./cjs/index.d.ts",
12
12
  "dependencies": {
13
- "@sheinx/hooks": "3.3.6-beta.7",
13
+ "@sheinx/hooks": "3.3.7-beta.1",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.1.3-alpha.0"