@trionesdev/antd-mobile-base-react 0.0.2-beta.20 → 0.0.2-beta.22

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.
@@ -12,7 +12,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  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; }
14
14
  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; }
15
- import React, { useContext, useState } from 'react';
15
+ import React, { useContext, useEffect, useState } from 'react';
16
16
  import "./index.scss";
17
17
  import { CheckboxRound } from "./checkbox-round";
18
18
  import { CheckboxButton } from "./checkbox-button";
@@ -46,6 +46,13 @@ export var Checkbox = function Checkbox(_ref) {
46
46
  (_onValueChange = (_ref4 = ctx).onValueChange) === null || _onValueChange === void 0 || _onValueChange.call(_ref4, ctxValue);
47
47
  }
48
48
  };
49
+ useEffect(function () {
50
+ if (rest.checked !== undefined) {
51
+ if (rest.checked !== innerChecked) {
52
+ setInnerChecked(rest.checked);
53
+ }
54
+ }
55
+ }, [rest.checked]);
49
56
  if (shape === 'round') {
50
57
  return /*#__PURE__*/React.createElement(CheckboxRound, _extends({}, rest, {
51
58
  checked: innerChecked,
@@ -10,6 +10,7 @@ export type FormCellProps = {
10
10
  extra?: React.CSSProperties;
11
11
  arrow?: React.CSSProperties;
12
12
  };
13
+ value?: React.ReactNode;
13
14
  size?: AntSize;
14
15
  variant?: VariantType;
15
16
  placeholder?: string;
@@ -16,6 +16,7 @@ export var FormCell = function FormCell(_ref) {
16
16
  style = _ref.style,
17
17
  styles = _ref.styles,
18
18
  children = _ref.children,
19
+ value = _ref.value,
19
20
  _ref$size = _ref.size,
20
21
  size = _ref$size === void 0 ? 'medium' : _ref$size,
21
22
  _ref$variant = _ref.variant,
@@ -44,7 +45,7 @@ export var FormCell = function FormCell(_ref) {
44
45
  }, /*#__PURE__*/React.createElement("div", {
45
46
  className: classNames("".concat(cls, "-content")),
46
47
  style: styles === null || styles === void 0 ? void 0 : styles.content
47
- }, children || placeholder && /*#__PURE__*/React.createElement("div", {
48
+ }, children || value || placeholder && /*#__PURE__*/React.createElement("div", {
48
49
  className: classNames("".concat(cls, "-placeholder"))
49
50
  }, placeholder)), extra && /*#__PURE__*/React.createElement("div", {
50
51
  className: classNames("".concat(cls, "-extra")),
package/package.json CHANGED
@@ -1,17 +1,9 @@
1
1
  {
2
2
  "name": "@trionesdev/antd-mobile-base-react",
3
- "version": "0.0.2-beta.20",
3
+ "version": "0.0.2-beta.22",
4
4
  "description": "antd mobile base react",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
- "scripts": {
8
- "dev": "father dev",
9
- "build": "father build",
10
- "build:deps": "father prebundle",
11
- "prepublishOnly": "father doctor && npm run build",
12
- "publish": "npm publish --tag latest --registry=https://registry.npmjs.org/",
13
- "publishOnly": "npm publish --ignore-scripts --registry=https://registry.npmjs.org/"
14
- },
15
7
  "keywords": [],
16
8
  "authors": [
17
9
  "fengxiaotx@163.com"
@@ -30,7 +22,6 @@
30
22
  "react": ">=16.9.0"
31
23
  },
32
24
  "devDependencies": {
33
- "@trionesdev/antd-mobile-icons-react": "0.0.2-beta.20",
34
25
  "@types/crypto-js": "^4.2.2",
35
26
  "@types/lodash-es": "^4.17.12",
36
27
  "@types/node": "^18.19.123",
@@ -45,7 +36,14 @@
45
36
  "rc-field-form": "^2.7.0",
46
37
  "rc-util": "^5.44.3",
47
38
  "react": "^18.0.0",
48
- "runes2": "^1.1.4"
39
+ "runes2": "^1.1.4",
40
+ "@trionesdev/antd-mobile-icons-react": "0.0.2-beta.21"
49
41
  },
50
- "gitHead": "6826587141b29a1e9eda58f95d92210671cbd31c"
51
- }
42
+ "gitHead": "6826587141b29a1e9eda58f95d92210671cbd31c",
43
+ "scripts": {
44
+ "dev": "father dev",
45
+ "build": "father build",
46
+ "build:deps": "father prebundle",
47
+ "publishOnly": "npm publish --ignore-scripts --registry=https://registry.npmjs.org/"
48
+ }
49
+ }