@trionesdev/antd-mobile-react 0.0.2-beta.3 → 0.0.2-beta.4

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.
@@ -4,6 +4,7 @@
4
4
  import { DemoBlock } from "../../DemoBlock";
5
5
  import React from 'react';
6
6
  import Input from "../index";
7
+ import Space from "../../Space";
7
8
  export default (function () {
8
9
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DemoBlock, {
9
10
  title: "\u57FA\u7840\u7528\u6CD5",
@@ -66,5 +67,39 @@ export default (function () {
66
67
  }
67
68
  }, /*#__PURE__*/React.createElement(Input.Textarea, {
68
69
  placeholder: '请输入内容'
69
- })));
70
+ })), /*#__PURE__*/React.createElement(DemoBlock, {
71
+ title: "\u53D8\u4F53"
72
+ }, /*#__PURE__*/React.createElement(Space, {
73
+ direction: "vertical",
74
+ block: true
75
+ }, /*#__PURE__*/React.createElement(Input, {
76
+ variant: "outlined",
77
+ placeholder: "outlined"
78
+ }), /*#__PURE__*/React.createElement(Input, {
79
+ variant: "filled",
80
+ placeholder: "filled"
81
+ }), /*#__PURE__*/React.createElement(Input, {
82
+ variant: "borderless",
83
+ placeholder: "borderless"
84
+ }), /*#__PURE__*/React.createElement(Input, {
85
+ variant: "underlined",
86
+ placeholder: "underlined"
87
+ }))), /*#__PURE__*/React.createElement(DemoBlock, {
88
+ title: "\u5C3A\u5BF8"
89
+ }, /*#__PURE__*/React.createElement(Space, {
90
+ direction: "vertical",
91
+ block: true
92
+ }, /*#__PURE__*/React.createElement(Input.Textarea, {
93
+ variant: "outlined",
94
+ placeholder: "outlined"
95
+ }), /*#__PURE__*/React.createElement(Input.Textarea, {
96
+ variant: "filled",
97
+ placeholder: "filled"
98
+ }), /*#__PURE__*/React.createElement(Input.Textarea, {
99
+ variant: "borderless",
100
+ placeholder: "borderless"
101
+ }), /*#__PURE__*/React.createElement(Input.Textarea, {
102
+ variant: "underlined",
103
+ placeholder: "underlined"
104
+ }))));
70
105
  });
@@ -9,7 +9,7 @@ $inputSm: 24Px;
9
9
  $inputMd: 32Px;
10
10
  $inputLg: 40Px;
11
11
 
12
- $placeholderColor : #808080;
12
+ $placeholderColor: #808080;
13
13
 
14
14
  .#{$inputCls} {
15
15
  box-sizing: border-box;
@@ -53,13 +53,12 @@ $placeholderColor : #808080;
53
53
  padding: variable.$trionesInputPaddingBlock 0;
54
54
  gap: 4Px;
55
55
 
56
-
57
-
58
56
  .#{$inputCls} {
59
57
  padding: 0;
60
58
  background-color: transparent;
61
59
 
62
- &-prifix {}
60
+ &-prifix {
61
+ }
63
62
 
64
63
  &-suffix {
65
64
  display: inline-flex;
@@ -93,7 +92,33 @@ $placeholderColor : #808080;
93
92
  }
94
93
  }
95
94
 
96
- .#{$inputGroupWrapperCls} {}
95
+ .#{$inputCls} {
96
+ &-outlined {
97
+ border-radius: variable.$trionesBorderRadius;
98
+ border: 1Px solid variable.$trionesBorderColor;
99
+ padding-inline: 4Px;
100
+ }
101
+
102
+ &-filled {
103
+ border-radius: variable.$trionesBorderRadius;
104
+ background-color: variable.$trionesColorFillTertiary;
105
+ padding-inline: 4Px;
106
+ border: 0;
107
+ }
108
+ &-borderless {
109
+ border: 0;
110
+ }
111
+
112
+ &-underlined {
113
+ border-top: 0;
114
+ border-left: 0;
115
+ border-right: 0;
116
+ border-bottom: 1Px solid variable.$trionesBorderColor;
117
+ }
118
+ }
119
+
120
+ .#{$inputGroupWrapperCls} {
121
+ }
97
122
 
98
123
 
99
124
  .#{$inputPotCls} {
@@ -181,9 +206,8 @@ $placeholderColor : #808080;
181
206
  .#{$inputCls}-textarea {
182
207
  box-sizing: border-box;
183
208
  width: 100%;
184
- border: 0;
185
209
  outline: 0;
186
- padding: variable.$trionesInputPaddingBlock 0;
210
+ padding-block: variable.$trionesInputPaddingBlock;
187
211
  font-size: variable.$trionesInputInputFontSize;
188
212
 
189
213
  &::placeholder {
@@ -196,4 +220,4 @@ $placeholderColor : #808080;
196
220
  50% {
197
221
  background-color: transparent;
198
222
  }
199
- }
223
+ }
@@ -1,8 +1,10 @@
1
1
  import React, { FC, PropsWithChildren } from 'react';
2
2
  import { BaseInputProps } from './base-input';
3
+ import { variantType } from "./types";
3
4
  export type InputAffixWrapperProps = BaseInputProps & {
4
5
  prefix?: React.ReactNode;
5
6
  suffix?: React.ReactNode;
7
+ variant?: variantType;
6
8
  allowClear?: boolean;
7
9
  onClear?: () => void;
8
10
  };
@@ -1,4 +1,8 @@
1
- var _excluded = ["children", "prefix", "suffix", "allowClear", "value", "onChange", "onClear"];
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 = ["children", "prefix", "suffix", "variant", "allowClear", "value", "onChange", "onClear"];
3
+ 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; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
5
+ 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); }
2
6
  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; }
3
7
  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; }
4
8
  import { CloseCircleFill } from "../../../antd-mobile-icons-react";
@@ -9,6 +13,8 @@ export var InputAffixWrapper = function InputAffixWrapper(_ref) {
9
13
  var children = _ref.children,
10
14
  prefix = _ref.prefix,
11
15
  suffix = _ref.suffix,
16
+ _ref$variant = _ref.variant,
17
+ variant = _ref$variant === void 0 ? 'borderless' : _ref$variant,
12
18
  allowClear = _ref.allowClear,
13
19
  value = _ref.value,
14
20
  onChange = _ref.onChange,
@@ -16,7 +22,7 @@ export var InputAffixWrapper = function InputAffixWrapper(_ref) {
16
22
  rest = _objectWithoutProperties(_ref, _excluded);
17
23
  var innerStyle = rest.style || {};
18
24
  return /*#__PURE__*/React.createElement("div", {
19
- className: classNames([inputAffixWrapperCls]),
25
+ className: classNames([inputAffixWrapperCls, _defineProperty({}, "".concat(inputCls, "-").concat(variant), variant), rest.className]),
20
26
  style: innerStyle
21
27
  }, prefix && /*#__PURE__*/React.createElement("div", {
22
28
  className: classNames(["".concat(inputCls, "-prefix")])
@@ -1,10 +1,12 @@
1
1
  import React, { FC } from 'react';
2
2
  import './index.scss';
3
+ import { variantType } from "./types";
3
4
  export type InputProps = {
4
5
  className?: string;
5
6
  style?: React.CSSProperties;
6
7
  placeholder?: string;
7
8
  type?: 'text' | 'password' | 'textarea';
9
+ variant?: variantType;
8
10
  disabled?: boolean;
9
11
  allowClear?: boolean;
10
12
  prefix?: React.ReactNode;
@@ -1,11 +1,13 @@
1
1
  import React, { FC } from 'react';
2
2
  import './index.scss';
3
+ import { variantType } from './types';
3
4
  export type InputTextareaProps = {
4
5
  className?: string;
5
6
  style?: React.CSSProperties;
6
7
  placeholder?: string;
7
8
  disabled?: boolean;
8
9
  allowClear?: boolean;
10
+ variant?: variantType;
9
11
  rows?: number;
10
12
  value?: any;
11
13
  onChange?: (e: any) => void;
@@ -1,3 +1,7 @@
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); }
1
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
6
  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."); }
3
7
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -14,6 +18,8 @@ export var Textarea = function Textarea(_ref) {
14
18
  placeholder = _ref.placeholder,
15
19
  disabled = _ref.disabled,
16
20
  allowClear = _ref.allowClear,
21
+ _ref$variant = _ref.variant,
22
+ variant = _ref$variant === void 0 ? 'borderless' : _ref$variant,
17
23
  rows = _ref.rows,
18
24
  value = _ref.value,
19
25
  onChange = _ref.onChange;
@@ -31,7 +37,7 @@ export var Textarea = function Textarea(_ref) {
31
37
  setInternalValue(value);
32
38
  }, [value]);
33
39
  return /*#__PURE__*/React.createElement("textarea", {
34
- className: classNames("".concat(inputCls, "-textarea"), className),
40
+ className: classNames("".concat(inputCls, "-textarea"), _defineProperty({}, "".concat(inputCls, "-").concat(variant), variant), className),
35
41
  style: style,
36
42
  placeholder: placeholder,
37
43
  disabled: disabled,
@@ -1,2 +1,3 @@
1
+ export type variantType = 'outlined' | 'borderless' | 'filled' | 'underlined' | undefined;
1
2
  export declare const inputCls = "triones-antm-input";
2
3
  export declare const inputAffixWrapperCls = "triones-antm-input-affix-wrapper";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trionesdev/antd-mobile-react",
3
- "version": "0.0.2-beta.3",
3
+ "version": "0.0.2-beta.4",
4
4
  "description": "antd mobile react ",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
19
19
  "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
20
20
  "prepublishOnly": "father doctor && npm run build",
21
- "publish": "npm publish --registry=https://registry.npmjs.org/",
21
+ "publish": "npm publish --tag latest --registry=https://registry.npmjs.org/",
22
22
  "publishOnly": "npm publish --ignore-scripts --registry=https://registry.npmjs.org/"
23
23
  },
24
24
  "authors": [
@@ -89,7 +89,7 @@
89
89
  "stylelint": "^16.12.0"
90
90
  },
91
91
  "dependencies": {
92
- "@trionesdev/antd-mobile-base-react": "^0.0.2-beta.3",
92
+ "@trionesdev/antd-mobile-base-react": "^0.0.2-beta.4",
93
93
  "ahooks": "^3.8.4",
94
94
  "crypto-js": "^4.2.0",
95
95
  "rc-field-form": "^2.7.0",
@@ -98,7 +98,7 @@
98
98
  },
99
99
  "optionalDependencies": {
100
100
  "@trionesdev/antd-mobile-base-react": "workspace:*",
101
- "@trionesdev/antd-mobile-icons-react": "0.0.2-beta.3"
101
+ "@trionesdev/antd-mobile-icons-react": "0.0.2-beta.4"
102
102
  },
103
- "gitHead": "72b3e398935c0811b26170adf2246e525f2aadcc"
103
+ "gitHead": "7d22b9c62fa05902a5afff83ba1091f0ad0843c3"
104
104
  }