yootd 0.0.73 → 0.0.75

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.
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { HolidayProps } from './types/types';
3
+ export declare const Holiday: React.FC<HolidayProps>;
@@ -0,0 +1,37 @@
1
+ var _excluded = ["showSearch"];
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); }
3
+ 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; }
4
+ 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; }
5
+ import { useQuery } from '@tanstack/react-query';
6
+ import React, { useMemo } from 'react';
7
+ import { Select } from "./..";
8
+ import { useRequest } from "../hooks/useRequest";
9
+ export var Holiday = function Holiday(_ref) {
10
+ var _ref$showSearch = _ref.showSearch,
11
+ showSearch = _ref$showSearch === void 0 ? true : _ref$showSearch,
12
+ rest = _objectWithoutProperties(_ref, _excluded);
13
+ var request = useRequest();
14
+ // 查询所有假期
15
+ var _useQuery = useQuery({
16
+ queryKey: ['holidayData'],
17
+ queryFn: function queryFn() {
18
+ return request('/v1/education/vacation/info/all');
19
+ }
20
+ }),
21
+ holidayData = _useQuery.data;
22
+ // 将职务数据处理成下拉框
23
+ var allHolidayOptions = useMemo(function () {
24
+ var _holidayData$content;
25
+ return holidayData === null || holidayData === void 0 || (_holidayData$content = holidayData.content) === null || _holidayData$content === void 0 ? void 0 : _holidayData$content.map(function (item) {
26
+ return {
27
+ label: item.vacationName,
28
+ value: item.vacationId
29
+ };
30
+ });
31
+ }, [holidayData]);
32
+ return /*#__PURE__*/React.createElement(Select, _extends({
33
+ options: allHolidayOptions,
34
+ showSearch: showSearch,
35
+ optionFilterProp: "label"
36
+ }, rest));
37
+ };
@@ -0,0 +1,22 @@
1
+ import { SelectProps } from 'yootd';
2
+
3
+ export interface PageData<T> {
4
+ content: T[];
5
+ page: {
6
+ number: number;
7
+ size: number;
8
+ totalElements: number;
9
+ totalPages: number;
10
+ };
11
+ }
12
+ // 查询职务返回的数据类型
13
+ export interface IjobTitleItem {
14
+ titleId: number;
15
+ titleName: string;
16
+ }
17
+ // 查询角色返回的数据类型
18
+ export interface IHolidayItem {
19
+ vacationId: number;
20
+ vacationName: string;
21
+ }
22
+ export type HolidayProps = SelectProps;
package/dist/index.d.ts CHANGED
@@ -24,6 +24,8 @@ export type { DepartmentProps } from './department/types/types';
24
24
  export { DropdownSelect } from './dropdown-select';
25
25
  export type { DropdownSelectProps } from './dropdown-select/types/type';
26
26
  export { Export } from './export';
27
+ export { Holiday } from './holiday';
28
+ export type { HolidayProps } from './holiday/types/types';
27
29
  export { JobTitle } from './job-title';
28
30
  export type { JobTitleProps } from './job-title/types/types';
29
31
  export { Role } from './role';
package/dist/index.js CHANGED
@@ -13,6 +13,7 @@ export { Dropdown } from "./dropdown";
13
13
  export { Department } from "./department";
14
14
  export { DropdownSelect } from "./dropdown-select";
15
15
  export { Export } from "./export";
16
+ export { Holiday } from "./holiday";
16
17
  export { JobTitle } from "./job-title";
17
18
  export { Role } from "./role";
18
19
  export { Flex } from "./flex";
@@ -215,18 +215,19 @@ export var TreeInternal = /*#__PURE__*/forwardRef(function (_ref, ref) {
215
215
  expandAllNodes(treeData);
216
216
  }
217
217
  }, [treeData]);
218
- return /*#__PURE__*/React.createElement("div", null, showSearch ? /*#__PURE__*/React.createElement(Search, {
219
- style: {
220
- marginBottom: 8
221
- },
218
+ return /*#__PURE__*/React.createElement("div", {
219
+ className: "".concat(mb)
220
+ }, showSearch ? /*#__PURE__*/React.createElement("div", {
221
+ className: "".concat(mb.e('search'))
222
+ }, /*#__PURE__*/React.createElement(Search, {
222
223
  placeholder: placeholder,
223
224
  onChange: onChange
224
- }) : null, /*#__PURE__*/React.createElement(AntTree, _extends({
225
+ })) : null, /*#__PURE__*/React.createElement(AntTree, _extends({
225
226
  ref: ref,
226
227
  onExpand: onExpand,
227
228
  expandedKeys: expandedKeys,
228
229
  autoExpandParent: autoExpandParent,
229
- className: "".concat(mb, " ").concat(className),
230
+ className: "".concat(className),
230
231
  treeData: titleRender ? _treeData : formatTreeData(_treeData),
231
232
  showIcon: showIcon
232
233
  }, props)));
@@ -1,4 +1,7 @@
1
1
  .yot-tree {
2
+ position: relative;
3
+ overflow: auto;
4
+ height: 100%;
2
5
  .ant-tree-node-content-wrapper.ant-tree-node-selected {
3
6
  background-color: var(--ant-color-primary-bg);
4
7
  .ant-tree-title {
@@ -22,4 +25,10 @@
22
25
  }
23
26
  }
24
27
  }
28
+ &__search {
29
+ position: sticky;
30
+ top: 0px;
31
+ z-index: 1;
32
+ margin-bottom: 10px;
33
+ }
25
34
  }
@@ -708,26 +708,26 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
708
708
  useEffect(function () {
709
709
  var handler = null;
710
710
  // let lastTime = Date.now();
711
- /* const start = () => {
712
- if (
713
- !faceFeature.anchor &&
714
- !faceFeature.emotion &&
715
- !faceFeature.character
716
- ) {
717
- return;
718
- }
719
- if (lastTime + 1000 <= Date.now()) {
720
- lastTime = Date.now();
721
- detect()
722
- .catch((e) => {
723
- console.log("error", e);
724
- })
725
- .finally(() => {
726
- handler = requestAnimationFrame(start);
727
- });
728
- } else {
729
- handler = requestAnimationFrame(start);
730
- }
711
+ /* const start = () => {
712
+ if (
713
+ !faceFeature.anchor &&
714
+ !faceFeature.emotion &&
715
+ !faceFeature.character
716
+ ) {
717
+ return;
718
+ }
719
+ if (lastTime + 1000 <= Date.now()) {
720
+ lastTime = Date.now();
721
+ detect()
722
+ .catch((e) => {
723
+ console.log("error", e);
724
+ })
725
+ .finally(() => {
726
+ handler = requestAnimationFrame(start);
727
+ });
728
+ } else {
729
+ handler = requestAnimationFrame(start);
730
+ }
731
731
  }; */
732
732
 
733
733
  var lastTime = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yootd",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",