yootd 0.0.18 → 0.0.19

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,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { SelectProps } from "..";
2
3
  import './index.scss';
3
4
  import { SchoolProps } from './types/types';
4
- export declare const School: React.FC<SchoolProps>;
5
+ export declare const School: React.FC<SchoolProps & SelectProps>;
@@ -1,4 +1,6 @@
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 = ["type", "multiple", "style", "showSearch", "value", "onChange", "allowClear", "placeholder"];
3
+ 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); }
2
4
  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; }
3
5
  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; }
4
6
  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; }
@@ -10,6 +12,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
12
  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; }
11
13
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
14
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
+ 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; }
16
+ 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; }
13
17
  import { useQuery } from '@tanstack/react-query';
14
18
  import React, { useEffect, useMemo, useState } from 'react';
15
19
  import { Select } from "./..";
@@ -27,7 +31,8 @@ export var School = function School(_ref) {
27
31
  onChange = _ref.onChange,
28
32
  _ref$allowClear = _ref.allowClear,
29
33
  allowClear = _ref$allowClear === void 0 ? true : _ref$allowClear,
30
- placeholder = _ref.placeholder;
34
+ placeholder = _ref.placeholder,
35
+ rest = _objectWithoutProperties(_ref, _excluded);
31
36
  var mb = useBem('School');
32
37
  var request = useRequest();
33
38
  // 选择的系部id
@@ -276,7 +281,7 @@ export var School = function School(_ref) {
276
281
  return /*#__PURE__*/React.createElement("div", {
277
282
  className: isSingle ? '' : "".concat(mb),
278
283
  style: isSingle ? {} : style
279
- }, type === 'major' || type === 'class' ? null : /*#__PURE__*/React.createElement(Select, {
284
+ }, type === 'major' || type === 'class' ? null : /*#__PURE__*/React.createElement(Select, _extends({
280
285
  allowClear: allowClear,
281
286
  className: "".concat(mb.b('school-select')),
282
287
  value: type === 'collegeMajor' || type === 'college' ? collegeId : gradeId,
@@ -290,7 +295,7 @@ export var School = function School(_ref) {
290
295
  options: firstSelectOptions,
291
296
  onChange: changeFirstSelect,
292
297
  mode: type !== 'collegeMajor' && type !== 'gradeClass' ? multiple ? 'multiple' : undefined : undefined
293
- }), type === 'college' || type === 'grade' ? null : /*#__PURE__*/React.createElement(Select, {
298
+ }, type !== 'collegeMajor' && type !== 'gradeClass' ? rest : {})), type === 'college' || type === 'grade' ? null : /*#__PURE__*/React.createElement(Select, _extends({
294
299
  allowClear: allowClear,
295
300
  value: type === 'collegeMajor' || type === 'major' ? majorId : classId,
296
301
  mode: type !== 'collegeMajor' && type !== 'gradeClass' ? multiple ? 'multiple' : undefined : undefined,
@@ -303,5 +308,5 @@ export var School = function School(_ref) {
303
308
  },
304
309
  options: secondSelectOptions,
305
310
  onChange: changeSecondSelect
306
- }));
311
+ }, type !== 'collegeMajor' && type !== 'gradeClass' ? rest : {})));
307
312
  };
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { SelectProps } from "..";
2
3
  import './index.scss';
3
4
  import { YearTermProps } from './types/types';
4
- export declare const YearTerm: React.FC<YearTermProps>;
5
+ export declare const YearTerm: React.FC<YearTermProps & SelectProps>;
@@ -1,9 +1,13 @@
1
+ var _excluded = ["type", "style", "showSearch", "value", "onChange", "allowClear", "placeholder"];
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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
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 { useQuery } from '@tanstack/react-query';
8
12
  import React, { useEffect, useMemo, useState } from 'react';
9
13
  import { Select } from "./..";
@@ -20,7 +24,8 @@ export var YearTerm = function YearTerm(_ref) {
20
24
  onChange = _ref.onChange,
21
25
  _ref$allowClear = _ref.allowClear,
22
26
  allowClear = _ref$allowClear === void 0 ? true : _ref$allowClear,
23
- placeholder = _ref.placeholder;
27
+ placeholder = _ref.placeholder,
28
+ rest = _objectWithoutProperties(_ref, _excluded);
24
29
  var mb = useBem('YearTerm');
25
30
  var request = useRequest();
26
31
  // 选择的学年id
@@ -140,7 +145,7 @@ export var YearTerm = function YearTerm(_ref) {
140
145
  return /*#__PURE__*/React.createElement("div", {
141
146
  className: isSingle ? '' : "".concat(mb),
142
147
  style: isSingle ? {} : style
143
- }, type === 'term' ? null : /*#__PURE__*/React.createElement(Select, {
148
+ }, type === 'term' ? null : /*#__PURE__*/React.createElement(Select, _extends({
144
149
  value: yearId,
145
150
  allowClear: allowClear,
146
151
  className: "".concat(mb.b('school-select')),
@@ -153,7 +158,7 @@ export var YearTerm = function YearTerm(_ref) {
153
158
  },
154
159
  options: allYearOptions,
155
160
  onChange: changeFirstSelect
156
- }), type === 'year' ? null : /*#__PURE__*/React.createElement(Select, {
161
+ }, type !== 'yearTerm' ? rest : {})), type === 'year' ? null : /*#__PURE__*/React.createElement(Select, _extends({
157
162
  value: termId,
158
163
  allowClear: allowClear,
159
164
  showSearch: showSearch,
@@ -165,5 +170,5 @@ export var YearTerm = function YearTerm(_ref) {
165
170
  },
166
171
  options: termOptions,
167
172
  onChange: changeSecondSelect
168
- }));
173
+ }, type !== 'yearTerm' ? rest : {})));
169
174
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yootd",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",