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/esm/deprecated.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { util } from "@sheinx/hooks";
2
+ var devUseWarning = util.devUseWarning;
1
3
  export var color = {
2
4
  danger: 'rgb(255, 77, 80)',
3
5
  gray100: 'rgb(244, 245, 248)',
@@ -13,26 +15,26 @@ export var color = {
13
15
  primary: 'rgb(44, 95, 193)',
14
16
  secondary: 'rgb(51, 62, 89)',
15
17
  setColor: function setColor(_e) {
16
- console.warn('shineout: color.setColor is deprecated');
18
+ devUseWarning.warn('color.setColor is deprecated');
17
19
  },
18
20
  success: 'rgb(82, 196, 26)',
19
21
  warning: 'rgb(255, 140, 0)'
20
22
  };
21
23
  export var style = {
22
24
  getClassName: function getClassName() {
23
- console.warn('shineout: style.getClassName is deprecated');
25
+ devUseWarning.warn('style.getClassName is deprecated');
24
26
  },
25
27
  setStyle: function setStyle() {
26
- console.warn('shineout: style.getClassName is deprecated');
28
+ devUseWarning.warn('style.setStyle is deprecated');
27
29
  return function () {};
28
30
  },
29
31
  cleanCache: function cleanCache() {
30
- console.warn('shineout: style.getClassName is deprecated');
32
+ devUseWarning.warn('style.cleanCache is deprecated');
31
33
  },
32
34
  setInjectType: function setInjectType() {
33
- console.warn('shineout: style.getClassName is deprecated');
35
+ devUseWarning.warn('style.setInjectType is deprecated');
34
36
  },
35
37
  getInjectType: function getInjectType() {
36
- console.warn('shineout: style.getClassName is deprecated');
38
+ devUseWarning.warn('style.getInjectType is deprecated');
37
39
  }
38
40
  };
@@ -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;
@@ -26,6 +26,7 @@ var useFieldCommon = function useFieldCommon(props, Origin, type) {
26
26
  name: props.name,
27
27
  defaultValue: props.defaultValue,
28
28
  reserveAble: (_props$reserveAble = props.reserveAble) !== null && _props$reserveAble !== void 0 ? _props$reserveAble : formConfig.reserveAble,
29
+ formName: formConfig.formName,
29
30
  rules: props.rules,
30
31
  onError: props.onError,
31
32
  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/esm/icon/icon.js CHANGED
@@ -18,5 +18,6 @@ export default function icon() {
18
18
  }));
19
19
  };
20
20
  ShineoutIcon.displayName = 'ShineoutIcon';
21
+ ShineoutIcon.isShineoutIcon = true;
21
22
  return ShineoutIcon;
22
23
  }
package/esm/index.js CHANGED
@@ -61,5 +61,5 @@ export * from "./deprecated";
61
61
  import * as _TYPE from "./type";
62
62
  export { _TYPE as TYPE };
63
63
  export default {
64
- version: '3.5.2'
64
+ version: '3.5.3-beta.2'
65
65
  };
@@ -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,5 +1,5 @@
1
1
  "use client";
2
- import IPopover from "./popover";
2
+ import IPopover, { IPopoverContent } from "./popover";
3
3
  import IConfirm from "./confirm";
4
4
 
5
5
  // confirm
@@ -9,4 +9,5 @@ ConfirmComp.displayName = 'ShineoutPopoverConfirm';
9
9
  var PopoverComp = IPopover;
10
10
  PopoverComp.displayName = 'ShineoutPopover';
11
11
  PopoverComp.Confirm = ConfirmComp;
12
+ PopoverComp.Content = IPopoverContent;
12
13
  export 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;
@@ -5,13 +5,24 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  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); }
7
7
  import { Popover } from '@sheinx/base';
8
+ import { util } from '@sheinx/hooks';
8
9
  import { usePopoverStyle } from '@sheinx/shineout-style';
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
+ var devUseWarning = util.devUseWarning;
10
12
  var jssStyle = {
11
13
  popover: usePopoverStyle
12
14
  };
13
- export default (function (props) {
15
+ var IPopover = function IPopover(props) {
14
16
  return /*#__PURE__*/_jsx(Popover, _objectSpread({
15
17
  jssStyle: jssStyle
16
18
  }, props));
17
- });
19
+ };
20
+ export var IPopoverContent = function IPopoverContent(props) {
21
+ devUseWarning.deprecated('Popover.Content', 'useTextStyle', 'Popover');
22
+ return /*#__PURE__*/_jsx(Popover, _objectSpread(_objectSpread({
23
+ jssStyle: jssStyle
24
+ }, props), {}, {
25
+ useTextStyle: true
26
+ }));
27
+ };
28
+ export default IPopover;
@@ -21,7 +21,7 @@ var cloneObject = function cloneObject(source) {
21
21
  target[key] = target[key];
22
22
  }
23
23
  } catch (e) {
24
- console.error('should not pass non-serializable data', source);
24
+ console.error('[shineout] should not pass non-serializable data', source);
25
25
  console.error(e);
26
26
  target = {};
27
27
  }
@@ -5,7 +5,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5
5
  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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  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); }
8
+ import { util } from '@sheinx/hooks';
8
9
  import { isOne, isPercent } from "./is";
10
+ var devUseWarning = util.devUseWarning;
9
11
  var CSS_INTEGER = '[-\\+]?\\d+%?';
10
12
 
11
13
  // <http://www.w3.org/TR/css3-values/#number-value>
@@ -95,11 +97,11 @@ var toRGB = function toRGB(input) {
95
97
  };
96
98
  var isString = function isString(string) {
97
99
  if (!string) {
98
- console.error(new Error('the color is empty'));
100
+ devUseWarning.error('the color is empty');
99
101
  return false;
100
102
  }
101
103
  if (typeof string !== 'string') {
102
- console.error(new Error("the color is get a ".concat(_typeof(string), ", expect string")));
104
+ devUseWarning.error("the color is get a ".concat(_typeof(string), ", expect string"));
103
105
  return false;
104
106
  }
105
107
  return true;
@@ -201,7 +203,7 @@ var isDarkRgb = function isDarkRgb(color) {
201
203
  b = _matchs2[3];
202
204
  return Number(r) * 0.299 + Number(g) * 0.578 + Number(b) * 0.114 < 192;
203
205
  }
204
- console.error(new Error("the string '".concat(color, "' is not a legal color")));
206
+ devUseWarning.error("the string '".concat(color, "' is not a legal color"));
205
207
  return undefined;
206
208
  };
207
209
  var toHex = function toHex(rgb, noAlpha, a) {
@@ -278,7 +280,7 @@ var rgbTranlate = function rgbTranlate(target) {
278
280
  if (matchs) {
279
281
  return target(matchs, noAlpha, Number(matchs[4]));
280
282
  }
281
- console.error(new Error("the string '".concat(rgb, "' is not a rgb color")));
283
+ devUseWarning.error("the string '".concat(rgb, "' is not a rgb color"));
282
284
  return '';
283
285
  };
284
286
  };
@@ -301,7 +303,7 @@ export function hexToRgb(hex) {
301
303
  if (matchs) {
302
304
  return getRgba(matchs, 8);
303
305
  }
304
- console.error(new Error("the string '".concat(hex, "' is not a hex color")));
306
+ devUseWarning.error("the string '".concat(hex, "' is not a hex color"));
305
307
  return '';
306
308
  }
307
309
  export function hslToRgb(hsl) {
@@ -315,7 +317,7 @@ export function hslToRgb(hsl) {
315
317
  if (matchs) {
316
318
  return translateHsl(matchs, matchs[4]);
317
319
  }
318
- console.error(new Error("the string '".concat(hsl, "' is not a hsl color")));
320
+ devUseWarning.error("the string '".concat(hsl, "' is not a hsl color"));
319
321
  return '';
320
322
  }
321
323
  // @ts-ignore
@@ -1,8 +1,10 @@
1
+ import { util } from "@sheinx/hooks";
2
+ var devUseWarning = util.devUseWarning;
1
3
  export function range(end) {
2
4
  var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3
5
  var delta = end - start;
4
6
  if (typeof delta !== 'number' || Number.isNaN(delta)) {
5
- console.error(new Error('end can not computed with start'));
7
+ devUseWarning.error('end can not computed with start');
6
8
  }
7
9
  return Array.from({
8
10
  length: end - start
@@ -12,7 +14,7 @@ export function range(end) {
12
14
  }
13
15
  export function split(total, nums) {
14
16
  if (typeof total !== 'number' || total === 0) {
15
- console.error(new Error('total mast be a number(not equal 0)'));
17
+ devUseWarning.error('total mast be a number(not equal 0)');
16
18
  }
17
19
  var remain = 1;
18
20
  var nilCount = 0;
@@ -1,7 +1,9 @@
1
1
  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); }
2
+ import { util } from "@sheinx/hooks";
3
+ var devUseWarning = util.devUseWarning;
2
4
  export function capitalize(str) {
3
5
  if (typeof str !== 'string') {
4
- console.error(new Error('str should be a string'));
6
+ devUseWarning.error('str should be a string');
5
7
  }
6
8
  return str && str[0].toUpperCase() + str.slice(1);
7
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shineout",
3
- "version": "3.5.2",
3
+ "version": "3.5.3-beta.2",
4
4
  "description": "A components library for React",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -16,10 +16,10 @@
16
16
  "module": "./esm/index.js",
17
17
  "typings": "./cjs/index.d.ts",
18
18
  "dependencies": {
19
- "@sheinx/base": "3.5.2",
20
- "@sheinx/hooks": "3.5.2",
21
- "@sheinx/shineout-style": "3.5.2",
22
- "@sheinx/theme": "3.5.2",
19
+ "@sheinx/base": "3.5.3-beta.2",
20
+ "@sheinx/hooks": "3.5.3-beta.2",
21
+ "@sheinx/shineout-style": "3.5.3-beta.2",
22
+ "@sheinx/theme": "3.5.3-beta.2",
23
23
  "classnames": "^2.0.0",
24
24
  "immer": "^10.0.0",
25
25
  "deep-eql": "^4.0.0"