@pisell/materials 1.0.421 → 1.0.422

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.
@@ -7,7 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useEffect, useMemo, useState } from 'react';
8
8
  import Delete from '@pisell/icon/es/Delete';
9
9
  import { useControllableValue, useMemoizedFn } from 'ahooks';
10
- import { isNumber } from '@pisell/utils';
10
+ import { isNumber, isUndefined } from '@pisell/utils';
11
11
  import Presets from "./Presets";
12
12
  import Keyboard from "../Keyboard";
13
13
  import VirtualKeyInput from "../VirtualKeyInput";
@@ -186,7 +186,7 @@ var BaseNumberKeyboard = function BaseNumberKeyboard(props) {
186
186
  return handleChangeValue(e.target.value);
187
187
  },
188
188
  renderInput: function renderInput(props) {
189
- if (!props.value) {
189
+ if (isUndefined(props.value) || props.value === '') {
190
190
  return /*#__PURE__*/React.createElement(VirtualInput, {
191
191
  autoFocus: true,
192
192
  placeholder: placeholder,
@@ -6,6 +6,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useState } from 'react';
8
8
  import classNames from 'classnames';
9
+ import { isUndefined } from "@pisell/utils";
9
10
  import "./index.less";
10
11
  var VirtualInput = function VirtualInput(props) {
11
12
  var value = props.value,
@@ -29,7 +30,7 @@ var VirtualInput = function VirtualInput(props) {
29
30
  className: classNames('pisell-virtual-input-value', {
30
31
  'pisell-virtual-input-value-focus': isFocus
31
32
  })
32
- }, value, !value && /*#__PURE__*/React.createElement("div", {
33
+ }, value, (isUndefined(value) || value === '') && /*#__PURE__*/React.createElement("div", {
33
34
  className: "pisell-virtual-input-placeholder"
34
35
  }, placeholder), /*#__PURE__*/React.createElement("div", {
35
36
  className: "pisell-virtual-input-caret-container"
@@ -214,7 +214,7 @@ var BaseNumberKeyboard = (props) => {
214
214
  value,
215
215
  onChange: (e) => handleChangeValue(e.target.value),
216
216
  renderInput: (props2) => {
217
- if (!props2.value) {
217
+ if ((0, import_utils.isUndefined)(props2.value) || props2.value === "") {
218
218
  return /* @__PURE__ */ import_react.default.createElement(
219
219
  import_VirtualInput.default,
220
220
  {
@@ -34,6 +34,7 @@ __export(VirtualInput_exports, {
34
34
  module.exports = __toCommonJS(VirtualInput_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_classnames = __toESM(require("classnames"));
37
+ var import_utils = require("@pisell/utils");
37
38
  var import_index = require("./index.less");
38
39
  var VirtualInput = (props) => {
39
40
  const { value, autoFocus, placeholder = "" } = props;
@@ -55,7 +56,7 @@ var VirtualInput = (props) => {
55
56
  })
56
57
  },
57
58
  value,
58
- !value && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-virtual-input-placeholder" }, placeholder),
59
+ ((0, import_utils.isUndefined)(value) || value === "") && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-virtual-input-placeholder" }, placeholder),
59
60
  /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-virtual-input-caret-container" }, isFocus && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-virtual-input-caret" }))
60
61
  );
61
62
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.421",
3
+ "version": "1.0.422",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -65,8 +65,8 @@
65
65
  "crypto-js": "^4.2.0",
66
66
  "@zxing/library": "0.21.2",
67
67
  "@pisell/utils": "1.0.42",
68
- "@pisell/date-picker": "1.0.111",
69
- "@pisell/icon": "0.0.10"
68
+ "@pisell/icon": "0.0.10",
69
+ "@pisell/date-picker": "1.0.111"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "react": "^18.0.0",