shineout 3.5.2 → 3.5.3-beta.2

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/deprecated.js CHANGED
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.style = exports.color = void 0;
7
+ var _hooks = require("@sheinx/hooks");
8
+ var devUseWarning = _hooks.util.devUseWarning;
7
9
  var color = exports.color = {
8
10
  danger: 'rgb(255, 77, 80)',
9
11
  gray100: 'rgb(244, 245, 248)',
@@ -19,26 +21,26 @@ var color = exports.color = {
19
21
  primary: 'rgb(44, 95, 193)',
20
22
  secondary: 'rgb(51, 62, 89)',
21
23
  setColor: function setColor(_e) {
22
- console.warn('shineout: color.setColor is deprecated');
24
+ devUseWarning.warn('color.setColor is deprecated');
23
25
  },
24
26
  success: 'rgb(82, 196, 26)',
25
27
  warning: 'rgb(255, 140, 0)'
26
28
  };
27
29
  var style = exports.style = {
28
30
  getClassName: function getClassName() {
29
- console.warn('shineout: style.getClassName is deprecated');
31
+ devUseWarning.warn('style.getClassName is deprecated');
30
32
  },
31
33
  setStyle: function setStyle() {
32
- console.warn('shineout: style.getClassName is deprecated');
34
+ devUseWarning.warn('style.setStyle is deprecated');
33
35
  return function () {};
34
36
  },
35
37
  cleanCache: function cleanCache() {
36
- console.warn('shineout: style.getClassName is deprecated');
38
+ devUseWarning.warn('style.cleanCache is deprecated');
37
39
  },
38
40
  setInjectType: function setInjectType() {
39
- console.warn('shineout: style.getClassName is deprecated');
41
+ devUseWarning.warn('style.setInjectType is deprecated');
40
42
  },
41
43
  getInjectType: function getInjectType() {
42
- console.warn('shineout: style.getClassName is deprecated');
44
+ devUseWarning.warn('style.getInjectType is deprecated');
43
45
  }
44
46
  };
@@ -17,11 +17,11 @@ export interface ExtendsFieldProps<T, Name = string> extends Omit<FormFieldProps
17
17
  */
18
18
  title?: string;
19
19
  }
20
- export interface FiledItemCommonProps {
20
+ export interface FieldItemCommonProps {
21
21
  defaultValue?: any;
22
22
  onChange?: (...args: any) => void;
23
23
  beforeChange?: (value: any) => any;
24
24
  }
25
25
  export type GetWithFieldProps<Props, Value, Name = string> = Omit<Props, 'beforeChange'> & ExtendsFieldProps<Value, Name>;
26
- declare const useFieldCommon: <Props extends FiledItemCommonProps, Value, Name extends string | string[] = string>(props: GetWithFieldProps<Props, Value, Name>, Origin: React.ComponentType<Props>, type?: 'number' | 'string' | 'array') => JSX.Element;
26
+ declare const useFieldCommon: <Props extends FieldItemCommonProps, Value, Name extends string | string[] = string>(props: GetWithFieldProps<Props, Value, Name>, Origin: React.ComponentType<Props>, type?: 'number' | 'string' | 'array') => JSX.Element;
27
27
  export default useFieldCommon;
@@ -33,6 +33,7 @@ var useFieldCommon = function useFieldCommon(props, Origin, type) {
33
33
  name: props.name,
34
34
  defaultValue: props.defaultValue,
35
35
  reserveAble: (_props$reserveAble = props.reserveAble) !== null && _props$reserveAble !== void 0 ? _props$reserveAble : formConfig.reserveAble,
36
+ formName: formConfig.formName,
36
37
  rules: props.rules,
37
38
  onError: props.onError,
38
39
  bind: props.bind,
@@ -5,5 +5,6 @@ type args = Parameters<typeof makeIcon>;
5
5
  export default function icon(...args: args): {
6
6
  (props: IconCompProps): JSX.Element;
7
7
  displayName: string;
8
+ isShineoutIcon: boolean;
8
9
  };
9
10
  export {};
package/cjs/icon/icon.js CHANGED
@@ -24,5 +24,6 @@ function icon() {
24
24
  }));
25
25
  };
26
26
  ShineoutIcon.displayName = 'ShineoutIcon';
27
+ ShineoutIcon.isShineoutIcon = true;
27
28
  return ShineoutIcon;
28
29
  }
package/cjs/index.js CHANGED
@@ -500,5 +500,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
500
500
  // 此文件由脚本自动生成,请勿直接修改。
501
501
  // This file was generated automatically by a script. Please do not modify it directly.
502
502
  var _default = exports.default = {
503
- version: '3.5.2'
503
+ version: '3.5.3-beta.2'
504
504
  };
@@ -1,4 +1,4 @@
1
- import IPopover from './popover';
1
+ import IPopover, { IPopoverContent } from './popover';
2
2
  import IConfirm from './confirm';
3
3
  type RefConfirm = typeof IConfirm;
4
4
  export interface ConfirmComponent extends RefConfirm {
@@ -8,6 +8,7 @@ type RefPopover = typeof IPopover;
8
8
  export interface PopoverComponent extends RefPopover {
9
9
  displayName: string;
10
10
  Confirm: ConfirmComponent;
11
+ Content: typeof IPopoverContent;
11
12
  }
12
13
  declare const PopoverComp: PopoverComponent;
13
14
  export default PopoverComp;
@@ -1,13 +1,16 @@
1
1
  "use strict";
2
2
  "use client";
3
3
 
4
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
8
- var _popover = _interopRequireDefault(require("./popover"));
9
+ var _popover = _interopRequireWildcard(require("./popover"));
9
10
  var _confirm = _interopRequireDefault(require("./confirm"));
10
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
14
  // confirm
12
15
 
13
16
  var ConfirmComp = _confirm.default;
@@ -15,4 +18,5 @@ ConfirmComp.displayName = 'ShineoutPopoverConfirm';
15
18
  var PopoverComp = _popover.default;
16
19
  PopoverComp.displayName = 'ShineoutPopover';
17
20
  PopoverComp.Confirm = ConfirmComp;
21
+ PopoverComp.Content = _popover.IPopoverContent;
18
22
  var _default = exports.default = PopoverComp;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { PopoverProps } from './popover.type';
3
- declare const _default: (props: PopoverProps) => JSX.Element;
4
- export default _default;
3
+ declare const IPopover: (props: PopoverProps) => JSX.Element;
4
+ export declare const IPopoverContent: (props: PopoverProps) => JSX.Element;
5
+ export default IPopover;
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.default = exports.IPopoverContent = void 0;
7
7
  var _base = require("@sheinx/base");
8
+ var _hooks = require("@sheinx/hooks");
8
9
  var _shineoutStyle = require("@sheinx/shineout-style");
9
10
  var _jsxRuntime = require("react/jsx-runtime");
10
11
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
@@ -13,11 +14,21 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
14
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
15
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
15
16
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
+ var devUseWarning = _hooks.util.devUseWarning;
16
18
  var jssStyle = {
17
19
  popover: _shineoutStyle.usePopoverStyle
18
20
  };
19
- var _default = exports.default = function _default(props) {
21
+ var IPopover = function IPopover(props) {
20
22
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_base.Popover, _objectSpread({
21
23
  jssStyle: jssStyle
22
24
  }, props));
23
- };
25
+ };
26
+ var IPopoverContent = exports.IPopoverContent = function IPopoverContent(props) {
27
+ devUseWarning.deprecated('Popover.Content', 'useTextStyle', 'Popover');
28
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_base.Popover, _objectSpread(_objectSpread({
29
+ jssStyle: jssStyle
30
+ }, props), {}, {
31
+ useTextStyle: true
32
+ }));
33
+ };
34
+ var _default = exports.default = IPopover;
@@ -27,7 +27,7 @@ var cloneObject = function cloneObject(source) {
27
27
  target[key] = target[key];
28
28
  }
29
29
  } catch (e) {
30
- console.error('should not pass non-serializable data', source);
30
+ console.error('[shineout] should not pass non-serializable data', source);
31
31
  console.error(e);
32
32
  target = {};
33
33
  }
@@ -13,6 +13,7 @@ exports.isDark = isDark;
13
13
  exports.isLight = isLight;
14
14
  exports.judgeDark = judgeDark;
15
15
  exports.rgbTohsl = exports.rgbToHex = void 0;
16
+ var _hooks = require("@sheinx/hooks");
16
17
  var _is = require("./is");
17
18
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
18
19
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -21,6 +22,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
21
22
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
22
23
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23
24
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
25
+ var devUseWarning = _hooks.util.devUseWarning;
24
26
  var CSS_INTEGER = '[-\\+]?\\d+%?';
25
27
 
26
28
  // <http://www.w3.org/TR/css3-values/#number-value>
@@ -110,11 +112,11 @@ var toRGB = function toRGB(input) {
110
112
  };
111
113
  var isString = function isString(string) {
112
114
  if (!string) {
113
- console.error(new Error('the color is empty'));
115
+ devUseWarning.error('the color is empty');
114
116
  return false;
115
117
  }
116
118
  if (typeof string !== 'string') {
117
- console.error(new Error("the color is get a ".concat(_typeof(string), ", expect string")));
119
+ devUseWarning.error("the color is get a ".concat(_typeof(string), ", expect string"));
118
120
  return false;
119
121
  }
120
122
  return true;
@@ -216,7 +218,7 @@ var isDarkRgb = function isDarkRgb(color) {
216
218
  b = _matchs2[3];
217
219
  return Number(r) * 0.299 + Number(g) * 0.578 + Number(b) * 0.114 < 192;
218
220
  }
219
- console.error(new Error("the string '".concat(color, "' is not a legal color")));
221
+ devUseWarning.error("the string '".concat(color, "' is not a legal color"));
220
222
  return undefined;
221
223
  };
222
224
  var toHex = function toHex(rgb, noAlpha, a) {
@@ -293,7 +295,7 @@ var rgbTranlate = function rgbTranlate(target) {
293
295
  if (matchs) {
294
296
  return target(matchs, noAlpha, Number(matchs[4]));
295
297
  }
296
- console.error(new Error("the string '".concat(rgb, "' is not a rgb color")));
298
+ devUseWarning.error("the string '".concat(rgb, "' is not a rgb color"));
297
299
  return '';
298
300
  };
299
301
  };
@@ -316,7 +318,7 @@ function hexToRgb(hex) {
316
318
  if (matchs) {
317
319
  return getRgba(matchs, 8);
318
320
  }
319
- console.error(new Error("the string '".concat(hex, "' is not a hex color")));
321
+ devUseWarning.error("the string '".concat(hex, "' is not a hex color"));
320
322
  return '';
321
323
  }
322
324
  function hslToRgb(hsl) {
@@ -330,7 +332,7 @@ function hslToRgb(hsl) {
330
332
  if (matchs) {
331
333
  return translateHsl(matchs, matchs[4]);
332
334
  }
333
- console.error(new Error("the string '".concat(hsl, "' is not a hsl color")));
335
+ devUseWarning.error("the string '".concat(hsl, "' is not a hsl color"));
334
336
  return '';
335
337
  }
336
338
  // @ts-ignore
@@ -10,11 +10,13 @@ exports.split = split;
10
10
  exports.sub = sub;
11
11
  exports.toPrecision = toPrecision;
12
12
  exports.validateNumber = validateNumber;
13
+ var _hooks = require("@sheinx/hooks");
14
+ var devUseWarning = _hooks.util.devUseWarning;
13
15
  function range(end) {
14
16
  var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
15
17
  var delta = end - start;
16
18
  if (typeof delta !== 'number' || Number.isNaN(delta)) {
17
- console.error(new Error('end can not computed with start'));
19
+ devUseWarning.error('end can not computed with start');
18
20
  }
19
21
  return Array.from({
20
22
  length: end - start
@@ -24,7 +26,7 @@ function range(end) {
24
26
  }
25
27
  function split(total, nums) {
26
28
  if (typeof total !== 'number' || total === 0) {
27
- console.error(new Error('total mast be a number(not equal 0)'));
29
+ devUseWarning.error('total mast be a number(not equal 0)');
28
30
  }
29
31
  var remain = 1;
30
32
  var nilCount = 0;
@@ -8,10 +8,12 @@ exports.getDirectionIconName = getDirectionIconName;
8
8
  exports.getRTLPosition = getRTLPosition;
9
9
  exports.removeProtocol = removeProtocol;
10
10
  exports.substitute = substitute;
11
+ var _hooks = require("@sheinx/hooks");
11
12
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
13
+ var devUseWarning = _hooks.util.devUseWarning;
12
14
  function capitalize(str) {
13
15
  if (typeof str !== 'string') {
14
- console.error(new Error('str should be a string'));
16
+ devUseWarning.error('str should be a string');
15
17
  }
16
18
  return str && str[0].toUpperCase() + str.slice(1);
17
19
  }