@oceanbase/design 1.0.0-alpha.6 → 1.0.0-alpha.8

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 (70) hide show
  1. package/dist/design.min.js +1 -1
  2. package/dist/static/Inter-Medium.ea234620.woff2 +0 -0
  3. package/dist/static/Inter-Regular.34ba43c9.woff2 +0 -0
  4. package/dist/static/Inter-SemiBold.95439fb4.woff2 +0 -0
  5. package/es/alert/index.js +1 -4
  6. package/es/app/style/index.js +3 -6
  7. package/es/config-provider/index.js +13 -11
  8. package/es/descriptions/hooks/useItems.d.ts +6 -6
  9. package/es/descriptions/style/index.js +3 -1
  10. package/es/fonts/Inter-Medium.woff2 +0 -0
  11. package/es/fonts/Inter-Regular.woff2 +0 -0
  12. package/es/fonts/Inter-SemiBold.woff2 +0 -0
  13. package/es/form/FormItem.js +7 -9
  14. package/es/form/style/index.js +12 -10
  15. package/es/input/Input.d.ts +2 -0
  16. package/es/input/Input.js +23 -7
  17. package/es/input/Password.js +17 -5
  18. package/es/input/Search.js +17 -5
  19. package/es/input/TextArea.js +17 -5
  20. package/es/input/style/index.d.ts +9 -0
  21. package/es/input/style/index.js +17 -0
  22. package/es/input-number/index.js +11 -4
  23. package/es/input-number/style/index.d.ts +9 -0
  24. package/es/input-number/style/index.js +22 -0
  25. package/es/locale/ja-JP.js +2 -2
  26. package/es/segmented/index.d.ts +1 -0
  27. package/es/segmented/index.js +15 -7
  28. package/es/segmented/style/index.js +1 -0
  29. package/es/style/global.d.ts +4 -1
  30. package/es/style/global.js +75 -19
  31. package/es/table/index.d.ts +2 -2
  32. package/es/table/style/index.js +5 -1
  33. package/es/theme/default.d.ts +1 -1
  34. package/es/theme/default.js +1 -1
  35. package/es/typography/style/index.js +3 -0
  36. package/lib/alert/index.js +1 -3
  37. package/lib/app/style/index.js +2 -4
  38. package/lib/config-provider/index.js +13 -5
  39. package/lib/descriptions/hooks/useItems.d.ts +6 -6
  40. package/lib/descriptions/style/index.js +3 -0
  41. package/lib/fonts/Inter-Medium.woff2 +0 -0
  42. package/lib/fonts/Inter-Regular.woff2 +0 -0
  43. package/lib/fonts/Inter-SemiBold.woff2 +0 -0
  44. package/lib/form/FormItem.js +5 -6
  45. package/lib/form/style/index.js +17 -12
  46. package/lib/input/Input.d.ts +2 -0
  47. package/lib/input/Input.js +35 -12
  48. package/lib/input/Password.js +20 -3
  49. package/lib/input/Search.js +30 -11
  50. package/lib/input/TextArea.js +20 -3
  51. package/lib/input/style/index.d.ts +9 -0
  52. package/lib/input/style/index.js +46 -0
  53. package/lib/input-number/index.js +18 -3
  54. package/lib/input-number/style/index.d.ts +9 -0
  55. package/lib/input-number/style/index.js +51 -0
  56. package/lib/locale/ja-JP.js +2 -2
  57. package/lib/segmented/index.d.ts +1 -0
  58. package/lib/segmented/index.js +10 -3
  59. package/lib/segmented/style/index.js +1 -0
  60. package/lib/style/global.d.ts +4 -1
  61. package/lib/style/global.js +77 -10
  62. package/lib/table/index.d.ts +2 -2
  63. package/lib/table/style/index.js +5 -1
  64. package/lib/theme/default.d.ts +1 -1
  65. package/lib/theme/default.js +1 -1
  66. package/lib/typography/style/index.js +3 -0
  67. package/package.json +3 -2
  68. package/dist/static/Inter.f6bcdfb6.woff2 +0 -0
  69. package/es/fonts/Inter.woff2 +0 -0
  70. package/lib/fonts/Inter.woff2 +0 -0
package/es/alert/index.js CHANGED
@@ -13,7 +13,6 @@ import { CheckCircleOutlined, CloseCircleOutlined, ExclamationCircleOutlined, In
13
13
  import classNames from 'classnames';
14
14
  import ConfigProvider from "../config-provider";
15
15
  import useStyle from "./style";
16
- import theme from "../theme";
17
16
  import { jsx as _jsx } from "react/jsx-runtime";
18
17
  export * from 'antd/es/alert';
19
18
  var iconMapOutlined = {
@@ -33,10 +32,8 @@ var Alert = function Alert(_ref) {
33
32
  customizePrefixCls = _ref.prefixCls,
34
33
  className = _ref.className,
35
34
  restProps = _objectWithoutProperties(_ref, _excluded);
36
- var _theme$useToken = theme.useToken(),
37
- token = _theme$useToken.token;
38
35
  // banner exists and type is empty, use warning type by default for correct icon
39
- var type = banner && !typeProp ? 'warning' : typeProp;
36
+ var type = (banner && !typeProp ? 'warning' : typeProp) || 'info';
40
37
  var _useContext = useContext(ConfigProvider.ConfigContext),
41
38
  getPrefixCls = _useContext.getPrefixCls;
42
39
  var prefixCls = getPrefixCls('alert', customizePrefixCls);
@@ -1,11 +1,8 @@
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 _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; }
3
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
- 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); }
5
1
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
2
  export var genAppStyle = function genAppStyle(token) {
7
- var componentCls = token.componentCls;
8
- return _defineProperty({}, "".concat(componentCls), {});
3
+ var antCls = token.antCls,
4
+ componentCls = token.componentCls;
5
+ return {};
9
6
  };
10
7
  export default (function (prefixCls) {
11
8
  var useStyle = genComponentStyleHook('App', function (token) {
@@ -23,7 +23,7 @@ import { merge } from 'lodash';
23
23
  import App from "../app";
24
24
  import StaticFunction from "../static-function";
25
25
  import themeConfig from "../theme";
26
- import defaultTheme, { fontFamilyEn, fontWeightEn, fontWeightStrongEn } from "../theme/default";
26
+ import defaultTheme, { fontFamilyEn, fontWeightWeakEn, fontWeightEn, fontWeightStrongEn } from "../theme/default";
27
27
  import darkTheme from "../theme/dark";
28
28
  import compactTheme from "../theme/compact";
29
29
  import DefaultRenderEmpty from "./DefaultRenderEmpty";
@@ -44,7 +44,7 @@ var getLocaleTokenValue = function getLocaleTokenValue(mergedThemeToken, locale,
44
44
  return tokenValue !== mergedThemeToken[tokenKey] ? _defineProperty({}, tokenKey, tokenValue) : ['en', 'en-gb'].includes(locale.locale) ? _defineProperty({}, tokenKey, tokenValueEn) : {};
45
45
  };
46
46
  var ConfigProvider = function ConfigProvider(_ref3) {
47
- var _mergedTheme$token, _mergedTheme$token2, _mergedTheme$token3, _parentContext$pagina;
47
+ var _mergedTheme$token, _mergedTheme$token2, _mergedTheme$token3, _mergedTheme$token4, _parentContext$pagina;
48
48
  var children = _ref3.children,
49
49
  theme = _ref3.theme,
50
50
  locale = _ref3.locale,
@@ -87,9 +87,9 @@ var ConfigProvider = function ConfigProvider(_ref3) {
87
87
  var _themeConfig$useToken = themeConfig.useToken(),
88
88
  token = _themeConfig$useToken.token;
89
89
  var fontFamily = ((_mergedTheme$token = mergedTheme.token) === null || _mergedTheme$token === void 0 ? void 0 : _mergedTheme$token.fontFamily) || token.fontFamily;
90
- // @ts-ignore
91
- var fontWeight = ((_mergedTheme$token2 = mergedTheme.token) === null || _mergedTheme$token2 === void 0 ? void 0 : _mergedTheme$token2.fontWeight) || token.fontWeight;
92
- var fontWeightStrong = ((_mergedTheme$token3 = mergedTheme.token) === null || _mergedTheme$token3 === void 0 ? void 0 : _mergedTheme$token3.fontWeightStrong) || token.fontWeightStrong;
90
+ var fontWeightWeak = ((_mergedTheme$token2 = mergedTheme.token) === null || _mergedTheme$token2 === void 0 ? void 0 : _mergedTheme$token2.fontWeightWeak) || token.fontWeightWeak;
91
+ var fontWeight = ((_mergedTheme$token3 = mergedTheme.token) === null || _mergedTheme$token3 === void 0 ? void 0 : _mergedTheme$token3.fontWeight) || token.fontWeight;
92
+ var fontWeightStrong = ((_mergedTheme$token4 = mergedTheme.token) === null || _mergedTheme$token4 === void 0 ? void 0 : _mergedTheme$token4.fontWeightStrong) || token.fontWeightStrong;
93
93
 
94
94
  // inherit from parent StyleProvider
95
95
  var parentStyleContext = React.useContext(StyleContext);
@@ -100,12 +100,12 @@ var ConfigProvider = function ConfigProvider(_ref3) {
100
100
  card: merge({}, parentContext.card, card),
101
101
  collapse: merge({}, {
102
102
  expandIcon: function expandIcon(_ref8) {
103
- var _mergedTheme$token4, _mergedTheme$token5;
103
+ var _mergedTheme$token5, _mergedTheme$token6;
104
104
  var isActive = _ref8.isActive;
105
105
  return /*#__PURE__*/_jsx(CaretRightOutlined, {
106
106
  rotate: isActive ? 90 : 0,
107
107
  style: {
108
- color: ((_mergedTheme$token4 = mergedTheme.token) === null || _mergedTheme$token4 === void 0 ? void 0 : _mergedTheme$token4.colorIcon) || ((_mergedTheme$token5 = mergedTheme.token) === null || _mergedTheme$token5 === void 0 ? void 0 : _mergedTheme$token5.colorTextSecondary)
108
+ color: ((_mergedTheme$token5 = mergedTheme.token) === null || _mergedTheme$token5 === void 0 ? void 0 : _mergedTheme$token5.colorIcon) || ((_mergedTheme$token6 = mergedTheme.token) === null || _mergedTheme$token6 === void 0 ? void 0 : _mergedTheme$token6.colorTextSecondary)
109
109
  }
110
110
  });
111
111
  }
@@ -117,7 +117,7 @@ var ConfigProvider = function ConfigProvider(_ref3) {
117
117
  table: merge({}, {
118
118
  expandable: {
119
119
  expandIcon: function expandIcon(_ref9) {
120
- var _mergedTheme$token6, _mergedTheme$token7;
120
+ var _mergedTheme$token7, _mergedTheme$token8;
121
121
  var expandable = _ref9.expandable,
122
122
  expanded = _ref9.expanded,
123
123
  onExpand = _ref9.onExpand,
@@ -129,7 +129,7 @@ var ConfigProvider = function ConfigProvider(_ref3) {
129
129
  style: {
130
130
  transition: "transform 0.2s",
131
131
  transform: expanded ? 'rotate(90deg)' : undefined,
132
- color: ((_mergedTheme$token6 = mergedTheme.token) === null || _mergedTheme$token6 === void 0 ? void 0 : _mergedTheme$token6.colorIcon) || ((_mergedTheme$token7 = mergedTheme.token) === null || _mergedTheme$token7 === void 0 ? void 0 : _mergedTheme$token7.colorTextSecondary)
132
+ color: ((_mergedTheme$token7 = mergedTheme.token) === null || _mergedTheme$token7 === void 0 ? void 0 : _mergedTheme$token7.colorIcon) || ((_mergedTheme$token8 = mergedTheme.token) === null || _mergedTheme$token8 === void 0 ? void 0 : _mergedTheme$token8.colorTextSecondary)
133
133
  }
134
134
  });
135
135
  }
@@ -137,7 +137,7 @@ var ConfigProvider = function ConfigProvider(_ref3) {
137
137
  }, parentContext.table, table),
138
138
  tabs: merge({}, parentContext.tabs, tabs),
139
139
  theme: merge({}, mergedTheme, {
140
- token: _objectSpread(_objectSpread(_objectSpread({}, getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontFamily', fontFamily, fontFamilyEn)), getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeight', fontWeight, fontWeightEn)), getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeightStrong', fontWeightStrong, fontWeightStrongEn))
140
+ token: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontFamily', fontFamily, fontFamilyEn)), getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeightWeak', fontWeightWeak, fontWeightWeakEn)), getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeight', fontWeight, fontWeightEn)), getLocaleTokenValue(mergedTheme.token || {}, mergedLocale, 'fontWeightStrong', fontWeightStrong, fontWeightStrongEn))
141
141
  }),
142
142
  renderEmpty: parentContext.renderEmpty || function (componentName) {
143
143
  return /*#__PURE__*/_jsx(DefaultRenderEmpty, {
@@ -153,7 +153,9 @@ var ConfigProvider = function ConfigProvider(_ref3) {
153
153
  injectStaticFunction: false
154
154
  },
155
155
  children: /*#__PURE__*/_jsxs(StyleProvider, _objectSpread(_objectSpread({}, mergedStyleProviderProps), {}, {
156
- children: [/*#__PURE__*/_jsx(GlobalStyle, {}), /*#__PURE__*/_jsxs(App, _objectSpread(_objectSpread({
156
+ children: [/*#__PURE__*/_jsx(GlobalStyle, {
157
+ prefixCls: restProps.prefixCls
158
+ }), /*#__PURE__*/_jsxs(App, _objectSpread(_objectSpread({
157
159
  component: false
158
160
  }, appProps), {}, {
159
161
  children: [children, parentExtendedContext.injectStaticFunction && /*#__PURE__*/_jsx(StaticFunction, {})]
@@ -5,17 +5,17 @@ export default function useItems(items?: DescriptionsItemType[], children?: Reac
5
5
  key?: React.Key;
6
6
  label?: React.ReactNode;
7
7
  span?: number | "filled" | {
8
- xxl?: number;
9
- xl?: number;
10
- lg?: number;
11
- md?: number;
12
- sm?: number;
13
8
  xs?: number;
9
+ sm?: number;
10
+ md?: number;
11
+ lg?: number;
12
+ xl?: number;
13
+ xxl?: number;
14
14
  };
15
15
  style?: React.CSSProperties;
16
- className?: string;
17
16
  classNames?: Partial<Record<"label" | "content", string>>;
18
17
  styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
18
+ className?: string;
19
19
  labelStyle?: React.CSSProperties;
20
20
  contentStyle?: React.CSSProperties;
21
21
  }[];
@@ -34,7 +34,9 @@ export var genDescriptionsStyle = function genDescriptionsStyle(token) {
34
34
  var componentCls = token.componentCls,
35
35
  typographyComponentCls = token.typographyComponentCls,
36
36
  calc = token.calc;
37
- return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _objectSpread(_objectSpread({}, genVerticalStyle('default', token)), {}, _defineProperty(_defineProperty({}, "".concat(componentCls, "-item-container"), _defineProperty({}, "".concat(componentCls, "-item-content"), _defineProperty({
37
+ return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _objectSpread(_objectSpread({}, genVerticalStyle('default', token)), {}, _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-item-label"), {
38
+ fontWeight: token.fontWeightWeak
39
+ }), "".concat(componentCls, "-item-container"), _defineProperty({}, "".concat(componentCls, "-item-content"), _defineProperty({
38
40
  paddingRight: 12
39
41
  }, "".concat(typographyComponentCls, "-edit-content"), {
40
42
  insetInlineStart: 0,
Binary file
Binary file
Binary file
@@ -17,7 +17,6 @@ import ConfigProvider from "../config-provider";
17
17
  import { useTooltipTypeList } from "../tooltip/hooks/useTooltipTypeList";
18
18
  import useStyle from "./style";
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
- import { Fragment as _Fragment } from "react/jsx-runtime";
21
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
21
  var AntFormItem = AntForm.Item;
23
22
  export * from 'antd/es/form/FormItem';
@@ -67,13 +66,14 @@ var FormItem = function FormItem(_ref) {
67
66
  className: "".concat(prefixCls, "-item-description"),
68
67
  children: description
69
68
  }) : null;
69
+ var actionContent = action && (layout === 'vertical' || vertical) ? /*#__PURE__*/_jsx("span", {
70
+ className: "".concat(prefixCls, "-item-action"),
71
+ children: action
72
+ }) : null;
70
73
  return wrapSSR( /*#__PURE__*/_jsx(AntFormItem, _objectSpread(_objectSpread({
71
74
  layout: layout,
72
- label: action && (layout === 'vertical' || vertical) ? /*#__PURE__*/_jsxs(_Fragment, {
73
- children: [label, action && /*#__PURE__*/_jsx("span", {
74
- className: "".concat(prefixCls, "-item-action"),
75
- children: action
76
- })]
75
+ label: actionContent || descriptionContent ? /*#__PURE__*/_jsxs("div", {
76
+ children: [label, actionContent, descriptionContent]
77
77
  }) : label,
78
78
  tooltip: tooltip
79
79
  // auto set required for Switch children to hide optional mark
@@ -83,9 +83,7 @@ var FormItem = function FormItem(_ref) {
83
83
  prefixCls: customizePrefixCls,
84
84
  className: formItemCls
85
85
  }, restProps), {}, {
86
- children: /*#__PURE__*/_jsxs(_Fragment, {
87
- children: [descriptionContent, children]
88
- })
86
+ children: children
89
87
  })));
90
88
  };
91
89
  FormItem.useStatus = AntFormItem.useStatus;
@@ -6,23 +6,25 @@ import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
6
  export var genFormStyle = function genFormStyle(token) {
7
7
  var componentCls = token.componentCls,
8
8
  calc = token.calc;
9
- return _defineProperty(_defineProperty({}, componentCls, _defineProperty({}, "".concat(componentCls, "-item-extra"), {
9
+ return _defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty({}, "".concat(componentCls, "-item-explain, ").concat(componentCls, "-item-extra"), {
10
10
  paddingTop: token.paddingXXS,
11
11
  fontSize: token.fontSizeSM
12
- })), "".concat(componentCls).concat(componentCls, "-vertical"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-item:not(").concat(componentCls, "-item-horizontal)"), _defineProperty({}, "".concat(componentCls, "-item-label > label"), _defineProperty({
13
- width: '100%'
14
- }, "".concat(componentCls, "-item-action"), {
15
- position: 'absolute',
16
- right: 0
17
- }))), "".concat(componentCls, "-item-has-description"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-item-control-input"), {
12
+ }), "".concat(componentCls, "-item-explain + ").concat(componentCls, "-item-extra"), {
13
+ paddingTop: 0
14
+ })), "".concat(componentCls).concat(componentCls, "-vertical"), _defineProperty({}, "".concat(componentCls, "-item:not(").concat(componentCls, "-item-horizontal)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-item-control-input"), {
18
15
  minHeight: 'auto'
19
16
  }), "".concat(componentCls, "-item-label"), {
20
- paddingBottom: token.paddingXXS
17
+ paddingBottom: calc(token.paddingXXS).add(2).equal()
21
18
  }), "".concat(componentCls, "-item-description"), {
22
- paddingBottom: calc(token.paddingXXS).add(2).equal(),
19
+ paddingTop: token.paddingXXS,
23
20
  fontSize: token.fontSizeSM,
24
21
  color: token.colorTextDescription
25
- })));
22
+ }), "".concat(componentCls, "-item-label > label"), _defineProperty({
23
+ width: '100%'
24
+ }, "".concat(componentCls, "-item-action"), {
25
+ position: 'absolute',
26
+ right: 0
27
+ }))));
26
28
  };
27
29
  export default (function (prefixCls) {
28
30
  var useStyle = genComponentStyleHook('Form', function (token) {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { InputProps as AntInputProps, InputRef } from 'antd';
3
+ import type { ShowCountFormatter } from 'rc-input/es/interface';
3
4
  export * from 'antd/es/input/Input';
4
5
  export interface InputLocale {
5
6
  placeholder?: string;
@@ -7,5 +8,6 @@ export interface InputLocale {
7
8
  export interface InputProps extends AntInputProps {
8
9
  locale?: InputLocale;
9
10
  }
11
+ export declare const showCountFormatter: ShowCountFormatter;
10
12
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>>;
11
13
  export default Input;
package/es/input/Input.js CHANGED
@@ -1,5 +1,5 @@
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
- var _excluded = ["locale"];
2
+ var _excluded = ["prefixCls", "locale", "showCount"];
3
3
  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; }
4
4
  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; }
5
5
  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; }
@@ -11,21 +11,37 @@ import React, { forwardRef, useContext } from 'react';
11
11
  import { Input as AntInput } from 'antd';
12
12
  import ConfigProvider from "../config-provider";
13
13
  import defaultLocale from "../locale/en-US";
14
+ import useStyle from "./style";
14
15
  import { jsx as _jsx } from "react/jsx-runtime";
15
16
  export * from 'antd/es/input/Input';
16
- var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
17
+ export var showCountFormatter = function showCountFormatter(_ref) {
18
+ var count = _ref.count,
19
+ maxLength = _ref.maxLength;
20
+ return "".concat(count, "/").concat(maxLength);
21
+ };
22
+ var Input = /*#__PURE__*/forwardRef(function (_ref2, ref) {
17
23
  var _contextLocale$global, _defaultLocale$global;
18
- var customLocale = _ref.locale,
19
- restProps = _objectWithoutProperties(_ref, _excluded);
24
+ var customizePrefixCls = _ref2.prefixCls,
25
+ customLocale = _ref2.locale,
26
+ showCount = _ref2.showCount,
27
+ restProps = _objectWithoutProperties(_ref2, _excluded);
20
28
  var _useContext = useContext(ConfigProvider.ConfigContext),
29
+ getPrefixCls = _useContext.getPrefixCls,
21
30
  contextLocale = _useContext.locale;
22
31
  var inputLocale = _objectSpread(_objectSpread(_objectSpread({
23
32
  placeholder: (contextLocale === null || contextLocale === void 0 || (_contextLocale$global = contextLocale.global) === null || _contextLocale$global === void 0 ? void 0 : _contextLocale$global.inputPlaceholder) || ((_defaultLocale$global = defaultLocale.global) === null || _defaultLocale$global === void 0 ? void 0 : _defaultLocale$global.inputPlaceholder)
24
33
  }, defaultLocale.Input), contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Input), customLocale);
25
- return /*#__PURE__*/_jsx(AntInput, _objectSpread({
34
+ var prefixCls = getPrefixCls('input', customizePrefixCls);
35
+ var _useStyle = useStyle(prefixCls),
36
+ wrapSSR = _useStyle.wrapSSR;
37
+ return wrapSSR( /*#__PURE__*/_jsx(AntInput, _objectSpread({
26
38
  ref: ref,
27
- placeholder: inputLocale.placeholder
28
- }, restProps));
39
+ prefixCls: customizePrefixCls,
40
+ placeholder: inputLocale.placeholder,
41
+ showCount: showCount === true ? {
42
+ formatter: showCountFormatter
43
+ } : showCount
44
+ }, restProps)));
29
45
  });
30
46
  if (process.env.NODE_ENV !== 'production') {
31
47
  Input.displayName = 'Input';
@@ -1,5 +1,5 @@
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
- var _excluded = ["locale"];
2
+ var _excluded = ["prefixCls", "locale", "showCount"];
3
3
  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; }
4
4
  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; }
5
5
  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; }
@@ -11,21 +11,33 @@ import React, { forwardRef, useContext } from 'react';
11
11
  import { Input as AntInput } from 'antd';
12
12
  import ConfigProvider from "../config-provider";
13
13
  import defaultLocale from "../locale/en-US";
14
+ import { showCountFormatter } from "./Input";
15
+ import useStyle from "./style";
14
16
  import { jsx as _jsx } from "react/jsx-runtime";
15
17
  export * from 'antd/es/input/Password';
16
18
  var Password = /*#__PURE__*/forwardRef(function (_ref, ref) {
17
19
  var _contextLocale$global, _defaultLocale$global;
18
- var customLocale = _ref.locale,
20
+ var customizePrefixCls = _ref.prefixCls,
21
+ customLocale = _ref.locale,
22
+ showCount = _ref.showCount,
19
23
  restProps = _objectWithoutProperties(_ref, _excluded);
20
24
  var _useContext = useContext(ConfigProvider.ConfigContext),
25
+ getPrefixCls = _useContext.getPrefixCls,
21
26
  contextLocale = _useContext.locale;
27
+ var prefixCls = getPrefixCls('input', customizePrefixCls);
28
+ var _useStyle = useStyle(prefixCls),
29
+ wrapSSR = _useStyle.wrapSSR;
22
30
  var inputLocale = _objectSpread(_objectSpread(_objectSpread({
23
31
  placeholder: (contextLocale === null || contextLocale === void 0 || (_contextLocale$global = contextLocale.global) === null || _contextLocale$global === void 0 ? void 0 : _contextLocale$global.inputPlaceholder) || ((_defaultLocale$global = defaultLocale.global) === null || _defaultLocale$global === void 0 ? void 0 : _defaultLocale$global.inputPlaceholder)
24
32
  }, defaultLocale.Input), contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Input), customLocale);
25
- return /*#__PURE__*/_jsx(AntInput.Password, _objectSpread({
33
+ return wrapSSR( /*#__PURE__*/_jsx(AntInput.Password, _objectSpread({
26
34
  ref: ref,
27
- placeholder: inputLocale.placeholder
28
- }, restProps));
35
+ prefixCls: customizePrefixCls,
36
+ placeholder: inputLocale.placeholder,
37
+ showCount: showCount === true ? {
38
+ formatter: showCountFormatter
39
+ } : showCount
40
+ }, restProps)));
29
41
  });
30
42
  if (process.env.NODE_ENV !== 'production') {
31
43
  Password.displayName = 'Password';
@@ -1,5 +1,5 @@
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
- var _excluded = ["locale"];
2
+ var _excluded = ["prefixCls", "locale", "showCount"];
3
3
  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; }
4
4
  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; }
5
5
  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; }
@@ -11,21 +11,33 @@ import React, { forwardRef, useContext } from 'react';
11
11
  import { Input as AntInput } from 'antd';
12
12
  import ConfigProvider from "../config-provider";
13
13
  import defaultLocale from "../locale/en-US";
14
+ import { showCountFormatter } from "./Input";
15
+ import useStyle from "./style";
14
16
  import { jsx as _jsx } from "react/jsx-runtime";
15
17
  export * from 'antd/es/input/Search';
16
18
  var Search = /*#__PURE__*/forwardRef(function (_ref, ref) {
17
19
  var _contextLocale$global, _defaultLocale$global;
18
- var customLocale = _ref.locale,
20
+ var customizePrefixCls = _ref.prefixCls,
21
+ customLocale = _ref.locale,
22
+ showCount = _ref.showCount,
19
23
  restProps = _objectWithoutProperties(_ref, _excluded);
20
24
  var _useContext = useContext(ConfigProvider.ConfigContext),
25
+ getPrefixCls = _useContext.getPrefixCls,
21
26
  contextLocale = _useContext.locale;
27
+ var prefixCls = getPrefixCls('input', customizePrefixCls);
28
+ var _useStyle = useStyle(prefixCls),
29
+ wrapSSR = _useStyle.wrapSSR;
22
30
  var inputLocale = _objectSpread(_objectSpread(_objectSpread({
23
31
  placeholder: (contextLocale === null || contextLocale === void 0 || (_contextLocale$global = contextLocale.global) === null || _contextLocale$global === void 0 ? void 0 : _contextLocale$global.inputPlaceholder) || ((_defaultLocale$global = defaultLocale.global) === null || _defaultLocale$global === void 0 ? void 0 : _defaultLocale$global.inputPlaceholder)
24
32
  }, defaultLocale.Input), contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Input), customLocale);
25
- return /*#__PURE__*/_jsx(AntInput.Search, _objectSpread({
33
+ return wrapSSR( /*#__PURE__*/_jsx(AntInput.Search, _objectSpread({
26
34
  ref: ref,
27
- placeholder: inputLocale.placeholder
28
- }, restProps));
35
+ prefixCls: customizePrefixCls,
36
+ placeholder: inputLocale.placeholder,
37
+ showCount: showCount === true ? {
38
+ formatter: showCountFormatter
39
+ } : showCount
40
+ }, restProps)));
29
41
  });
30
42
  if (process.env.NODE_ENV !== 'production') {
31
43
  Search.displayName = 'Search';
@@ -1,5 +1,5 @@
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
- var _excluded = ["locale"];
2
+ var _excluded = ["prefixCls", "locale", "showCount"];
3
3
  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; }
4
4
  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; }
5
5
  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; }
@@ -11,21 +11,33 @@ import React, { forwardRef, useContext } from 'react';
11
11
  import { Input as AntInput } from 'antd';
12
12
  import ConfigProvider from "../config-provider";
13
13
  import defaultLocale from "../locale/en-US";
14
+ import { showCountFormatter } from "./Input";
15
+ import useStyle from "./style";
14
16
  import { jsx as _jsx } from "react/jsx-runtime";
15
17
  export * from 'antd/es/input/TextArea';
16
18
  var TextArea = /*#__PURE__*/forwardRef(function (_ref, ref) {
17
19
  var _contextLocale$global, _defaultLocale$global;
18
- var customLocale = _ref.locale,
20
+ var customizePrefixCls = _ref.prefixCls,
21
+ customLocale = _ref.locale,
22
+ showCount = _ref.showCount,
19
23
  restProps = _objectWithoutProperties(_ref, _excluded);
20
24
  var _useContext = useContext(ConfigProvider.ConfigContext),
25
+ getPrefixCls = _useContext.getPrefixCls,
21
26
  contextLocale = _useContext.locale;
27
+ var prefixCls = getPrefixCls('input', customizePrefixCls);
28
+ var _useStyle = useStyle(prefixCls),
29
+ wrapSSR = _useStyle.wrapSSR;
22
30
  var inputLocale = _objectSpread(_objectSpread(_objectSpread({
23
31
  placeholder: (contextLocale === null || contextLocale === void 0 || (_contextLocale$global = contextLocale.global) === null || _contextLocale$global === void 0 ? void 0 : _contextLocale$global.inputPlaceholder) || ((_defaultLocale$global = defaultLocale.global) === null || _defaultLocale$global === void 0 ? void 0 : _defaultLocale$global.inputPlaceholder)
24
32
  }, defaultLocale.Input), contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Input), customLocale);
25
- return /*#__PURE__*/_jsx(AntInput.TextArea, _objectSpread({
33
+ return wrapSSR( /*#__PURE__*/_jsx(AntInput.TextArea, _objectSpread({
26
34
  ref: ref,
27
- placeholder: inputLocale.placeholder
28
- }, restProps));
35
+ prefixCls: customizePrefixCls,
36
+ placeholder: inputLocale.placeholder,
37
+ showCount: showCount === true ? {
38
+ formatter: showCountFormatter
39
+ } : showCount
40
+ }, restProps)));
29
41
  });
30
42
  if (process.env.NODE_ENV !== 'production') {
31
43
  TextArea.displayName = 'TextArea';
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { FullToken, GenerateStyle } from '../../theme/interface';
3
+ export type InputToken = FullToken<'Input'>;
4
+ export declare const genInputStyle: GenerateStyle<InputToken>;
5
+ declare const _default: (prefixCls: string) => {
6
+ wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
+ hashId: string;
8
+ };
9
+ export default _default;
@@ -0,0 +1,17 @@
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 _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; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ 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); }
5
+ import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
+ export var genInputStyle = function genInputStyle(token) {
7
+ var componentCls = token.componentCls;
8
+ return _defineProperty({}, "".concat(componentCls, "-affix-wrapper"), _defineProperty({}, "".concat(componentCls, "-suffix"), {
9
+ fontSize: token.fontSizeSM
10
+ }));
11
+ };
12
+ export default (function (prefixCls) {
13
+ var useStyle = genComponentStyleHook('Input', function (token) {
14
+ return [genInputStyle(token)];
15
+ });
16
+ return useStyle(prefixCls);
17
+ });
@@ -1,5 +1,5 @@
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
- var _excluded = ["locale"];
2
+ var _excluded = ["prefixCls", "locale"];
3
3
  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; }
4
4
  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; }
5
5
  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; }
@@ -11,21 +11,28 @@ import { InputNumber as AntInputNumber } from 'antd';
11
11
  import React, { useContext } from 'react';
12
12
  import ConfigProvider from "../config-provider";
13
13
  import defaultLocale from "../locale/en-US";
14
+ import useStyle from "./style";
14
15
  import { jsx as _jsx } from "react/jsx-runtime";
15
16
  export * from 'antd/es/input-number';
16
17
  var InternalInputNumber = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
17
18
  var _contextLocale$global, _defaultLocale$global;
18
- var customLocale = _ref.locale,
19
+ var customizePrefixCls = _ref.prefixCls,
20
+ customLocale = _ref.locale,
19
21
  restProps = _objectWithoutProperties(_ref, _excluded);
20
22
  var _useContext = useContext(ConfigProvider.ConfigContext),
23
+ getPrefixCls = _useContext.getPrefixCls,
21
24
  contextLocale = _useContext.locale;
25
+ var prefixCls = getPrefixCls('input-number', customizePrefixCls);
26
+ var _useStyle = useStyle(prefixCls),
27
+ wrapSSR = _useStyle.wrapSSR;
22
28
  var inputNumberLocale = _objectSpread(_objectSpread(_objectSpread({
23
29
  placeholder: (contextLocale === null || contextLocale === void 0 || (_contextLocale$global = contextLocale.global) === null || _contextLocale$global === void 0 ? void 0 : _contextLocale$global.inputPlaceholder) || ((_defaultLocale$global = defaultLocale.global) === null || _defaultLocale$global === void 0 ? void 0 : _defaultLocale$global.inputPlaceholder)
24
30
  }, defaultLocale.InputNumber), contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.InputNumber), customLocale);
25
- return /*#__PURE__*/_jsx(AntInputNumber, _objectSpread({
31
+ return wrapSSR( /*#__PURE__*/_jsx(AntInputNumber, _objectSpread({
26
32
  ref: ref,
33
+ prefixCls: customizePrefixCls,
27
34
  placeholder: inputNumberLocale.placeholder
28
- }, restProps));
35
+ }, restProps)));
29
36
  });
30
37
  var InputNumber = InternalInputNumber;
31
38
  InputNumber._InternalPanelDoNotUseOrYouWillBeFired = AntInputNumber._InternalPanelDoNotUseOrYouWillBeFired;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { FullToken, GenerateStyle } from '../../theme/interface';
3
+ export type InputNumberToken = FullToken<'InputNumber'>;
4
+ export declare const genInputStyle: GenerateStyle<InputNumberToken>;
5
+ declare const _default: (prefixCls: string) => {
6
+ wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
+ hashId: string;
8
+ };
9
+ export default _default;
@@ -0,0 +1,22 @@
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 _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; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ 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); }
5
+ import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
+ export var genInputStyle = function genInputStyle(token) {
7
+ var antCls = token.antCls,
8
+ componentCls = token.componentCls;
9
+ var selectComponentCls = "".concat(antCls, "-select-selector");
10
+ return _defineProperty({}, "".concat(componentCls, "-group-wrapper"), _defineProperty({}, "".concat(componentCls, "-group-addon"), _defineProperty({
11
+ color: token.colorTextTertiary,
12
+ fontSize: token.fontSizeSM
13
+ }, selectComponentCls, {
14
+ color: token.colorTextTertiary
15
+ })));
16
+ };
17
+ export default (function (prefixCls) {
18
+ var useStyle = genComponentStyleHook('InputNumber', function (token) {
19
+ return [genInputStyle(token)];
20
+ });
21
+ return useStyle(prefixCls);
22
+ });
@@ -13,12 +13,12 @@ export default _objectSpread(_objectSpread({}, jaJP), {}, {
13
13
  total: '合計 ${total} 件'
14
14
  }),
15
15
  Drawer: {
16
- okText: '確定',
16
+ okText: 'OK',
17
17
  cancelText: 'キャンセル'
18
18
  },
19
19
  Table: _objectSpread(_objectSpread({}, jaJP.Table), {}, {
20
20
  batchOperationBar: {
21
- selected: '選択済み',
21
+ selected: '選択中',
22
22
  object: '件',
23
23
  cancel: 'キャンセル',
24
24
  collapse: '折りたたむ',
@@ -6,6 +6,7 @@ import type { SegmentedRawOption } from 'rc-segmented';
6
6
  export * from 'antd/es/segmented';
7
7
  type BadgeType = BadgeProps | BadgeProps['count'];
8
8
  export type SegmentedLabeledOption = AntSegmentedLabeledOption & {
9
+ icon?: React.ReactNode;
9
10
  ellipsis?: EllipsisConfig;
10
11
  badge?: BadgeType;
11
12
  };