@pisell/materials 1.0.355 → 1.0.356

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.
@@ -1,9 +1,13 @@
1
+ var _excluded = ["mode", "onChange", "value", "format", "defaultValue"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
3
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
4
  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
5
  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); }
4
6
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
7
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
8
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
+ 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; }
10
+ 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; }
7
11
  import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
8
12
  import dayjs from 'dayjs';
9
13
  import { Button, ConfigProvider, DatePicker, Drawer, Input, Modal } from 'antd';
@@ -26,7 +30,9 @@ var DatePickerCpt = function DatePickerCpt(props) {
26
30
  var mode = props.mode,
27
31
  onChange = props.onChange,
28
32
  value = props.value,
29
- propsFormat = props.format;
33
+ propsFormat = props.format,
34
+ defaultValue = props.defaultValue,
35
+ others = _objectWithoutProperties(props, _excluded);
30
36
  var _useContext = useContext(ConfigProvider.ConfigContext),
31
37
  locale = _useContext.locale;
32
38
  var _useState = useState(''),
@@ -167,8 +173,9 @@ var DatePickerCpt = function DatePickerCpt(props) {
167
173
  }
168
174
  };
169
175
  if (!mode || mode === 'date') {
170
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DatePicker, {
176
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DatePicker, _extends({}, others, {
171
177
  ref: ref,
178
+ defaultValue: defaultValue,
172
179
  showNow: false,
173
180
  onChange: handleChange,
174
181
  open: popupOpen,
@@ -273,7 +280,7 @@ var DatePickerCpt = function DatePickerCpt(props) {
273
280
  className: "pisell-lowcode-picker-panel-container pisell-lowcode-picker-date-panel-container"
274
281
  }, dom)));
275
282
  }
276
- }));
283
+ })));
277
284
  }
278
285
  return /*#__PURE__*/React.createElement(DatePicker, props);
279
286
  };
@@ -51,7 +51,7 @@ var isValidDate = (dateString, format) => {
51
51
  pc: 1080
52
52
  });
53
53
  var DatePickerCpt = (props) => {
54
- const { mode, onChange, value, format: propsFormat } = props;
54
+ const { mode, onChange, value, format: propsFormat, defaultValue, ...others } = props;
55
55
  const { locale } = (0, import_react.useContext)(import_antd.ConfigProvider.ConfigContext);
56
56
  const [currentShortcut, setCurrentShortcut] = (0, import_react.useState)("");
57
57
  const [open, setOpen] = (0, import_react.useState)(false);
@@ -184,7 +184,9 @@ var DatePickerCpt = (props) => {
184
184
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
185
185
  import_antd.DatePicker,
186
186
  {
187
+ ...others,
187
188
  ref,
189
+ defaultValue,
188
190
  showNow: false,
189
191
  onChange: handleChange,
190
192
  open: popupOpen,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.355",
3
+ "version": "1.0.356",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -62,8 +62,8 @@
62
62
  "react-window": "^1.8.10",
63
63
  "react-virtualized-auto-sizer": "^1.0.20",
64
64
  "crypto-js": "^4.2.0",
65
- "@pisell/utils": "1.0.27",
66
65
  "@pisell/icon": "0.0.10",
66
+ "@pisell/utils": "1.0.27",
67
67
  "@pisell/date-picker": "1.0.88"
68
68
  },
69
69
  "peerDependencies": {