shineout 3.2.0-rc.4 → 3.2.0

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.
Files changed (43) hide show
  1. package/cjs/form/form-field.d.ts +1 -1
  2. package/cjs/form/index.d.ts +1 -1
  3. package/cjs/index.js +1 -1
  4. package/cjs/input/number.js +2 -1
  5. package/cjs/menu/index.d.ts +6 -0
  6. package/cjs/menu/index.js +4 -0
  7. package/cjs/menu/interface.d.ts +1 -0
  8. package/cjs/menu/menu.js +2 -1
  9. package/cjs/menu/search.d.ts +4 -0
  10. package/cjs/menu/search.js +27 -0
  11. package/cjs/menu/search.type.d.ts +2 -0
  12. package/cjs/menu/search.type.js +5 -0
  13. package/cjs/modal/modal.d.ts +6 -6
  14. package/cjs/modal/submit.js +2 -1
  15. package/cjs/tests/setupTest.d.ts +1 -0
  16. package/cjs/tests/setupTest.js +19 -0
  17. package/cjs/tests/utils.d.ts +1 -0
  18. package/cjs/tests/utils.js +4 -3
  19. package/cjs/upload/use-upload-common.d.ts +1 -1
  20. package/dist/shineout.js +1432 -987
  21. package/dist/shineout.js.map +1 -1
  22. package/dist/shineout.min.js +1 -1
  23. package/dist/shineout.min.js.map +1 -1
  24. package/esm/form/form-field.d.ts +1 -1
  25. package/esm/form/index.d.ts +1 -1
  26. package/esm/index.js +1 -1
  27. package/esm/input/number.js +3 -2
  28. package/esm/menu/index.d.ts +6 -0
  29. package/esm/menu/index.js +4 -0
  30. package/esm/menu/interface.d.ts +1 -0
  31. package/esm/menu/menu.js +3 -2
  32. package/esm/menu/search.d.ts +4 -0
  33. package/esm/menu/search.js +20 -0
  34. package/esm/menu/search.type.d.ts +2 -0
  35. package/esm/menu/search.type.js +1 -0
  36. package/esm/modal/modal.d.ts +6 -6
  37. package/esm/modal/submit.js +3 -2
  38. package/esm/tests/setupTest.d.ts +1 -0
  39. package/esm/tests/setupTest.js +17 -0
  40. package/esm/tests/utils.d.ts +1 -0
  41. package/esm/tests/utils.js +4 -4
  42. package/esm/upload/use-upload-common.d.ts +1 -1
  43. package/package.json +5 -5
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { FormFieldProps } from './form.type';
3
- declare const _default: <T>(props: FormFieldProps<T>) => JSX.Element;
3
+ declare const _default: <T extends unknown = any>(props: FormFieldProps<T>) => JSX.Element;
4
4
  export default _default;
@@ -13,7 +13,7 @@ declare const Reset: ((props: import("./interface").SubmitProps) => JSX.Element)
13
13
  declare const Item: ((props: import("./form.type").FormItemProps) => JSX.Element) & {
14
14
  displayName: string;
15
15
  };
16
- declare const Field: (<T>(props: import("./form.type").FormFieldProps<T>) => JSX.Element) & {
16
+ declare const Field: (<T extends unknown = any>(props: import("./form.type").FormFieldProps<T>) => JSX.Element) & {
17
17
  displayName: string;
18
18
  };
19
19
  declare const FieldSet: (<T>(props: import("./form.type").FormFieldSetProps<T>) => JSX.Element) & {
package/esm/index.js CHANGED
@@ -58,5 +58,5 @@ export * from "./deprecated";
58
58
  import * as _TYPE from "./type";
59
59
  export { _TYPE as TYPE };
60
60
  export default {
61
- version: '3.2.0-rc.4'
61
+ version: '3.2.0'
62
62
  };
@@ -6,12 +6,13 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
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 React from 'react';
8
8
  import { InputNumber as UnStyledInputNumber } from '@sheinx/base';
9
- import { useInnerTitleStyle, useInputStyle } from '@sheinx/shineout-style';
9
+ import { useInnerTitleStyle, useInputStyle, usePopoverStyle } from '@sheinx/shineout-style';
10
10
  import useFieldCommon from "../hooks/use-field-common";
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  var jssStyle = {
13
13
  input: useInputStyle,
14
- innerTitle: useInnerTitleStyle
14
+ innerTitle: useInnerTitleStyle,
15
+ popover: usePopoverStyle
15
16
  };
16
17
  var InputNumber = function InputNumber(props) {
17
18
  return /*#__PURE__*/_jsx(UnStyledInputNumber, _objectSpread(_objectSpread({}, props), {}, {
@@ -1,7 +1,13 @@
1
1
  import Menu from './menu';
2
+ import Search from './search';
2
3
  type RefMenu = typeof Menu;
4
+ type RefSearch = typeof Search;
5
+ export interface SearchComponent extends RefSearch {
6
+ displayName: string;
7
+ }
3
8
  export interface MenuComponent extends RefMenu {
4
9
  displayName: string;
10
+ Search: SearchComponent;
5
11
  }
6
12
  declare const MenuComp: MenuComponent;
7
13
  export default MenuComp;
package/esm/menu/index.js CHANGED
@@ -1,5 +1,9 @@
1
1
  "use client";
2
2
  import Menu from "./menu";
3
+ import Search from "./search";
4
+ var SearchComp = Search;
5
+ SearchComp.displayName = 'ShineoutMenuSearch';
3
6
  var MenuComp = Menu;
4
7
  MenuComp.displayName = 'ShineoutMenu';
8
+ MenuComp.Search = SearchComp;
5
9
  export default MenuComp;
@@ -1 +1,2 @@
1
1
  export type { MenuProps as Props } from './menu.type';
2
+ export type { MenuSearchProps as SearchProps } from './search.type';
package/esm/menu/menu.js CHANGED
@@ -6,10 +6,11 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
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 React from 'react';
8
8
  import { Menu } from '@sheinx/base';
9
- import { useMenuStyle } from '@sheinx/shineout-style';
9
+ import { useMenuStyle, usePopoverStyle } from '@sheinx/shineout-style';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  var jssStyle = {
12
- menu: useMenuStyle
12
+ menu: useMenuStyle,
13
+ popover: usePopoverStyle
13
14
  };
14
15
  export default (function (props) {
15
16
  return /*#__PURE__*/_jsx(Menu, _objectSpread({
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { MenuSearchProps } from './search.type';
3
+ declare const _default: (props: MenuSearchProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,20 @@
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
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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
+ import React from 'react';
8
+ import { MenuSearch } from '@sheinx/base';
9
+ import { useMenuSearchStyle, useInputStyle, usePopoverStyle } from '@sheinx/shineout-style';
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ var jssStyle = {
12
+ menuSearch: useMenuSearchStyle,
13
+ input: useInputStyle,
14
+ popover: usePopoverStyle
15
+ };
16
+ export default (function (props) {
17
+ return /*#__PURE__*/_jsx(MenuSearch, _objectSpread({
18
+ jssStyle: jssStyle
19
+ }, props));
20
+ });
@@ -0,0 +1,2 @@
1
+ import { MenuSearchProps as UnStyledMenuSearchProps } from '@sheinx/base';
2
+ export type MenuSearchProps = Omit<UnStyledMenuSearchProps, 'jssStyle'>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { ModalProps } from './modal.type';
3
3
  export declare const methods: {
4
- success: (options: Omit<import("@sheinx/base").ModalOptions, "jssStyle">) => void;
5
- info: (options: Omit<import("@sheinx/base").ModalOptions, "jssStyle">) => void;
6
- warn: (options: Omit<import("@sheinx/base").ModalOptions, "jssStyle">) => void;
7
- error: (options: Omit<import("@sheinx/base").ModalOptions, "jssStyle">) => void;
8
- confirm: (options: Omit<import("@sheinx/base").ModalOptions, "jssStyle">) => void;
9
- show: (options: Omit<import("@sheinx/base").ModalOptions, "jssStyle">) => void;
4
+ success: (options: Omit<import("@sheinx/base").ModalOptions, "jssStyle">) => (() => void) | undefined;
5
+ info: (options: Omit<import("@sheinx/base").ModalOptions, "jssStyle">) => (() => void) | undefined;
6
+ warn: (options: Omit<import("@sheinx/base").ModalOptions, "jssStyle">) => (() => void) | undefined;
7
+ error: (options: Omit<import("@sheinx/base").ModalOptions, "jssStyle">) => (() => void) | undefined;
8
+ confirm: (options: Omit<import("@sheinx/base").ModalOptions, "jssStyle">) => (() => void) | undefined;
9
+ show: (options: Omit<import("@sheinx/base").ModalOptions, "jssStyle">) => (() => void) | undefined;
10
10
  closeAll: () => void;
11
11
  };
12
12
  declare const _default: (props: ModalProps) => JSX.Element;
@@ -5,10 +5,11 @@ 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 { ModalSubmit } from '@sheinx/base';
8
- import { useButtonStyle } from '@sheinx/shineout-style';
8
+ import { useButtonStyle, useSpinStyle } from '@sheinx/shineout-style';
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  var jssStyle = {
11
- button: useButtonStyle
11
+ button: useButtonStyle,
12
+ spin: useSpinStyle
12
13
  };
13
14
  var Submit = function Submit(props) {
14
15
  return /*#__PURE__*/_jsx(ModalSubmit, _objectSpread({
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import { setJssConfig } from '@sheinx/shineout-style';
2
+ import { _convertCamelToDash } from "./utils";
3
+ import { setConfig } from "./..";
4
+ setConfig({
5
+ delay: 0
6
+ });
7
+ setJssConfig({
8
+ generateId: function generateId(rule, sheet) {
9
+ var options = sheet.options;
10
+ var ns = options.classNamePrefix;
11
+ if (!ns) {
12
+ console.warn('[sheinx/base]: styled should give namespace');
13
+ }
14
+ var prefix = 'soui-';
15
+ return "".concat(prefix).concat(ns).concat(_convertCamelToDash(rule.key));
16
+ }
17
+ });
@@ -27,5 +27,6 @@ export declare const delay: (time: number) => Promise<void>;
27
27
  type classNamesMapType = {
28
28
  [key: string]: string;
29
29
  };
30
+ export declare function _convertCamelToDash(str: string): string;
30
31
  export declare const createClassName: (componentsName: string, originClasses: string[], originItemClasses: string[]) => classNamesMapType;
31
32
  export {};
@@ -126,7 +126,7 @@ export var delay = function delay(time) {
126
126
  }, time);
127
127
  });
128
128
  };
129
- function _convertCamelToDash(str) {
129
+ export function _convertCamelToDash(str) {
130
130
  return str.replace(/([A-Z])/g, '-$1').replace(/^-/, '').toLowerCase();
131
131
  }
132
132
  function convertHashClassName(componentsName, key) {
@@ -136,12 +136,12 @@ function convertHashClassName(componentsName, key) {
136
136
 
137
137
  // Automatically generate corresponding className according to jss type
138
138
  export var createClassName = function createClassName(componentsName, originClasses, originItemClasses) {
139
- // const prefix = `so-${componentsName}-`;
139
+ var prefix = "soui-".concat(componentsName, "-");
140
140
  var classNamesMap = {};
141
141
  var classes = [].concat(_toConsumableArray(originClasses), _toConsumableArray(originItemClasses));
142
142
  classes.forEach(function (item) {
143
- // classNamesMap[item] = `${prefix}${convertCamelToDash(item)}`;
144
- classNamesMap[item] = convertHashClassName(componentsName, item);
143
+ classNamesMap[item] = "".concat(prefix).concat(_convertCamelToDash(item));
144
+ // classNamesMap[item] = convertHashClassName(componentsName, item);
145
145
  if (!originItemClasses.includes(item)) classNamesMap[item] = ".".concat(classNamesMap[item]);
146
146
  });
147
147
  return classNamesMap;
@@ -1,6 +1,6 @@
1
1
  import { UploadProps } from './upload.type';
2
2
  declare const useUploadCommon: (props: Pick<UploadProps<any>, 'rules'>) => {
3
3
  validateHook: (r: any) => void;
4
- rules: (import("../../../hooks/src/utils/rule/rule.type").RuleResultValue | import("../../../hooks/src/utils/rule/rule.type").FormItemObjectRule | ((value: any[] | undefined, formData: any, callback: (cbArgs: boolean | Error) => void, props?: any) => void))[];
4
+ rules: (import("../../../hooks/src/utils/rule/rule.type").RuleResultValue | import("../../../hooks/src/utils/rule/rule.type").FormItemObjectRule | ((value: any, formData: any, callback: (cbArgs: boolean | Error) => void, props?: any) => void))[];
5
5
  };
6
6
  export default useUploadCommon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shineout",
3
- "version": "3.2.0-rc.4",
3
+ "version": "3.2.0",
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.2.0-rc.4",
20
- "@sheinx/hooks": "3.2.0-rc.4",
21
- "@sheinx/shineout-style": "3.2.0-rc.4",
22
- "@sheinx/theme": "3.2.0-rc.4",
19
+ "@sheinx/base": "3.2.0",
20
+ "@sheinx/hooks": "3.2.0",
21
+ "@sheinx/shineout-style": "3.2.0",
22
+ "@sheinx/theme": "3.2.0",
23
23
  "classnames": "^2.0.0",
24
24
  "immer": "^10.0.0",
25
25
  "deep-eql": "^4.0.0"