yootd 0.0.38 → 0.0.40

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.
@@ -25,7 +25,7 @@ var statusText = {
25
25
  5: '已撤回'
26
26
  };
27
27
  export var ApprovalProcess = function ApprovalProcess(_ref) {
28
- var _queryProcess$data$hi, _queryProcess$data;
28
+ var _queryProcess$hisTask;
29
29
  var id = _ref.id;
30
30
  var mb = useBem('approval-process');
31
31
  var request = useRequest();
@@ -46,13 +46,14 @@ export var ApprovalProcess = function ApprovalProcess(_ref) {
46
46
  className: "".concat(mb.b('steps').b('info').b('avatar').b('status').b('icon'))
47
47
  })
48
48
  };
49
- var queryProcess = useQuery({
50
- queryKey: ['approvalProcess'],
51
- queryFn: function queryFn() {
52
- return request("/v1/proc/instances/".concat(id, "/detail"));
53
- }
54
- });
55
- var steps = (_queryProcess$data$hi = (_queryProcess$data = queryProcess.data) === null || _queryProcess$data === void 0 ? void 0 : _queryProcess$data.hisTasks) !== null && _queryProcess$data$hi !== void 0 ? _queryProcess$data$hi : [];
49
+ var _useQuery = useQuery({
50
+ queryKey: ['approvalProcess', id],
51
+ queryFn: function queryFn() {
52
+ return request("/v1/proc/instances/".concat(id, "/detail"));
53
+ }
54
+ }),
55
+ queryProcess = _useQuery.data;
56
+ var steps = (_queryProcess$hisTask = queryProcess === null || queryProcess === void 0 ? void 0 : queryProcess.hisTasks) !== null && _queryProcess$hisTask !== void 0 ? _queryProcess$hisTask : [];
56
57
  return /*#__PURE__*/React.createElement("div", {
57
58
  className: "".concat(mb)
58
59
  }, steps.map(function (step, index) {
@@ -3,6 +3,7 @@ import dayjs from 'dayjs';
3
3
  import { FC } from 'react';
4
4
  type PickerType = 'time' | 'date' | 'week' | 'month' | 'quarter' | 'year';
5
5
  export type DateIntervalProps = AntdDatePickerProps & {
6
+ defaultType?: PickerType;
6
7
  options?: {
7
8
  label: string;
8
9
  value: PickerType;
@@ -1,4 +1,4 @@
1
- var _excluded = ["options", "onChange", "value"];
1
+ var _excluded = ["defaultType", "options", "onChange", "value"];
2
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
3
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
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."); }
@@ -10,13 +10,34 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
10
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; }
11
11
  import { DatePicker as AntdDatePicker, Select } from 'antd';
12
12
  import React, { useEffect, useMemo, useState } from 'react';
13
+ var defaultOptions = [{
14
+ label: '时间',
15
+ value: 'time'
16
+ }, {
17
+ label: '日期',
18
+ value: 'date'
19
+ }, {
20
+ label: '周',
21
+ value: 'week'
22
+ }, {
23
+ label: '月份',
24
+ value: 'month'
25
+ }, {
26
+ label: '季度',
27
+ value: 'quarter'
28
+ }, {
29
+ label: '年份',
30
+ value: 'year'
31
+ }];
13
32
  export var DateInterval = function DateInterval(_ref) {
14
33
  var _options$;
15
- var options = _ref.options,
34
+ var defaultType = _ref.defaultType,
35
+ _ref$options = _ref.options,
36
+ options = _ref$options === void 0 ? defaultOptions : _ref$options,
16
37
  onChange = _ref.onChange,
17
38
  value = _ref.value,
18
39
  props = _objectWithoutProperties(_ref, _excluded);
19
- var _useState = useState((options === null || options === void 0 || (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value) || 'time'),
40
+ var _useState = useState(defaultType !== null && defaultType !== void 0 ? defaultType : options === null || options === void 0 || (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value),
20
41
  _useState2 = _slicedToArray(_useState, 2),
21
42
  type = _useState2[0],
22
43
  setType = _useState2[1];
@@ -38,13 +59,6 @@ export var DateInterval = function DateInterval(_ref) {
38
59
  type: type
39
60
  });
40
61
  };
41
- var handleSelectChange = function handleSelectChange(e) {
42
- setType(e);
43
- onChange === null || onChange === void 0 || onChange({
44
- date: date,
45
- type: e
46
- });
47
- };
48
62
  var datePickerMap = useMemo(function () {
49
63
  return {
50
64
  time: /*#__PURE__*/React.createElement(AntdDatePicker.TimePicker, _extends({}, props, {
@@ -99,13 +113,20 @@ export var DateInterval = function DateInterval(_ref) {
99
113
  }))
100
114
  };
101
115
  }, [type, date]);
116
+ var handleSelectChange = function handleSelectChange(e) {
117
+ setType(e);
118
+ onChange === null || onChange === void 0 || onChange({
119
+ date: date,
120
+ type: e
121
+ });
122
+ };
102
123
  // 设置初始值
103
124
  useEffect(function () {
104
125
  if ((value === null || value === void 0 ? void 0 : value.type) != null) {
105
126
  setType(value.type);
106
127
  } else {
107
128
  var _options$2;
108
- setType((options === null || options === void 0 || (_options$2 = options[0]) === null || _options$2 === void 0 ? void 0 : _options$2.value) || 'time');
129
+ setType(defaultType !== null && defaultType !== void 0 ? defaultType : options === null || options === void 0 || (_options$2 = options[0]) === null || _options$2 === void 0 ? void 0 : _options$2.value);
109
130
  }
110
131
  if ((value === null || value === void 0 ? void 0 : value.date) != null) {
111
132
  setDate(value.date);
@@ -118,25 +139,7 @@ export var DateInterval = function DateInterval(_ref) {
118
139
  style: {
119
140
  width: 92
120
141
  },
121
- options: options != null ? options : [{
122
- label: '时间',
123
- value: 'time'
124
- }, {
125
- label: '日期',
126
- value: 'date'
127
- }, {
128
- label: '周',
129
- value: 'week'
130
- }, {
131
- label: '月份',
132
- value: 'month'
133
- }, {
134
- label: '季度',
135
- value: 'quarter'
136
- }, {
137
- label: '年份',
138
- value: 'year'
139
- }],
142
+ options: options,
140
143
  onChange: handleSelectChange
141
144
  }), datePickerMap[type]);
142
145
  };
@@ -3,6 +3,7 @@ import dayjs from 'dayjs';
3
3
  import { FC } from 'react';
4
4
  type PickerType = 'time' | 'date' | 'week' | 'month' | 'quarter' | 'year';
5
5
  export type DateRangeProps = RangePickerProps & {
6
+ defaultType?: PickerType;
6
7
  options?: {
7
8
  label: string;
8
9
  value: PickerType;
@@ -1,4 +1,4 @@
1
- var _excluded = ["options", "value", "onChange"];
1
+ var _excluded = ["defaultType", "options", "value", "onChange"];
2
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
3
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
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."); }
@@ -31,12 +31,13 @@ var defaultOptions = [{
31
31
  }];
32
32
  export var DateRange = function DateRange(_ref) {
33
33
  var _options$;
34
- var _ref$options = _ref.options,
34
+ var defaultType = _ref.defaultType,
35
+ _ref$options = _ref.options,
35
36
  options = _ref$options === void 0 ? defaultOptions : _ref$options,
36
37
  value = _ref.value,
37
38
  onChange = _ref.onChange,
38
39
  props = _objectWithoutProperties(_ref, _excluded);
39
- var _useState = useState(options === null || options === void 0 || (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value),
40
+ var _useState = useState(defaultType !== null && defaultType !== void 0 ? defaultType : options === null || options === void 0 || (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value),
40
41
  _useState2 = _slicedToArray(_useState, 2),
41
42
  type = _useState2[0],
42
43
  setType = _useState2[1];
@@ -118,7 +119,7 @@ export var DateRange = function DateRange(_ref) {
118
119
  setType(value === null || value === void 0 ? void 0 : value.type);
119
120
  } else {
120
121
  var _options$2;
121
- setType(options === null || options === void 0 || (_options$2 = options[0]) === null || _options$2 === void 0 ? void 0 : _options$2.value);
122
+ setType(defaultType !== null && defaultType !== void 0 ? defaultType : options === null || options === void 0 || (_options$2 = options[0]) === null || _options$2 === void 0 ? void 0 : _options$2.value);
122
123
  }
123
124
  if ((value === null || value === void 0 ? void 0 : value.dates) != null) {
124
125
  setDates(value === null || value === void 0 ? void 0 : value.dates);
@@ -18,7 +18,7 @@ var ModalComponent = function ModalComponent(_ref) {
18
18
  // title content block
19
19
  var tcb = mb.b('title').b('content');
20
20
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("svg", {
21
- className: "".concat(mb.e('color-defs'))
21
+ className: "".concat(mb.e('color-defs'), " fixed -top-full -right-full")
22
22
  }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
23
23
  id: "paint0_linear_589_9609",
24
24
  x1: "132.5",
package/package.json CHANGED
@@ -1,101 +1,101 @@
1
- {
2
- "name": "yootd",
3
- "version": "0.0.38",
4
- "description": "A react library developed with dumi",
5
- "license": "MIT",
6
- "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "files": [
9
- "dist"
10
- ],
11
- "scripts": {
12
- "build": "father build",
13
- "build:watch": "father dev",
14
- "dev": "dumi dev",
15
- "docs:build": "dumi build",
16
- "docs:preview": "dumi preview",
17
- "doctor": "father doctor",
18
- "lint": "npm run lint:es && npm run lint:css",
19
- "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
20
- "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
21
- "prepare": "husky install && dumi setup",
22
- "prepublishOnly": "father doctor && npm run build",
23
- "start": "npm run dev"
24
- },
25
- "commitlint": {
26
- "extends": [
27
- "@commitlint/config-conventional"
28
- ]
29
- },
30
- "lint-staged": {
31
- "*.{md,json}": [
32
- "prettier --write --no-error-on-unmatched-pattern"
33
- ],
34
- "*.{css,less}": [
35
- "stylelint --fix",
36
- "prettier --write"
37
- ],
38
- "*.{js,jsx}": [
39
- "eslint --fix",
40
- "prettier --write"
41
- ],
42
- "*.{ts,tsx}": [
43
- "eslint --fix",
44
- "prettier --parser=typescript --write"
45
- ]
46
- },
47
- "devDependencies": {
48
- "@commitlint/cli": "^17.1.2",
49
- "@commitlint/config-conventional": "^17.1.0",
50
- "@dnd-kit/core": "^6.1.0",
51
- "@dnd-kit/modifiers": "^7.0.0",
52
- "@dnd-kit/sortable": "^8.0.0",
53
- "@dnd-kit/utilities": "^3.2.2",
54
- "@tanstack/react-query": "^5.59.15",
55
- "@types/lodash": "^4.17.12",
56
- "@types/react": "^18.0.0",
57
- "@types/react-dom": "^18.0.0",
58
- "@umijs/lint": "^4.0.0",
59
- "@vladmandic/face-api": "^1.7.14",
60
- "antd": "^5.21.4",
61
- "axios": "^1.7.7",
62
- "dayjs": "^1.11.13",
63
- "dumi": "^2.3.0",
64
- "dumi-theme-antd": "^0.4.2",
65
- "eslint": "^8.23.0",
66
- "father": "^4.1.0",
67
- "husky": "^8.0.1",
68
- "lint-staged": "^13.0.3",
69
- "lodash": "^4.17.21",
70
- "nanoid": "^5.0.8",
71
- "prettier": "^2.7.1",
72
- "prettier-plugin-organize-imports": "^3.0.0",
73
- "prettier-plugin-packagejson": "^2.2.18",
74
- "react": "^18.0.0",
75
- "react-dom": "^18.0.0",
76
- "sass": "^1.80.0",
77
- "stylelint": "^14.9.1",
78
- "yootd-webrtc-sdk": "^1.0.1"
79
- },
80
- "peerDependencies": {
81
- "@dnd-kit/core": ">=6.1.0",
82
- "@dnd-kit/modifiers": ">=7.0.0",
83
- "@dnd-kit/sortable": ">=8.0.0",
84
- "@dnd-kit/utilities": ">=3.2.2",
85
- "@tanstack/react-query": ">=5.59.15",
86
- "@vladmandic/face-api": "^1.7.14",
87
- "@xyflow/react": ">=12.3.3",
88
- "antd": ">=5.21.4",
89
- "axios": ">=1.7.7",
90
- "dayjs": ">=1.11.13",
91
- "lodash": ">=4.17.21",
92
- "nanoid": ">=5.0.8",
93
- "react": ">=16.9.0",
94
- "react-dom": ">=16.9.0",
95
- "yootd-webrtc-sdk": "^1.0.1"
96
- },
97
- "publishConfig": {
98
- "access": "public"
99
- },
100
- "authors": []
101
- }
1
+ {
2
+ "name": "yootd",
3
+ "version": "0.0.40",
4
+ "description": "A react library developed with dumi",
5
+ "license": "MIT",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "father build",
13
+ "build:watch": "father dev",
14
+ "dev": "dumi dev",
15
+ "docs:build": "dumi build",
16
+ "docs:preview": "dumi preview",
17
+ "doctor": "father doctor",
18
+ "lint": "npm run lint:es && npm run lint:css",
19
+ "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
20
+ "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
21
+ "prepare": "husky install && dumi setup",
22
+ "prepublishOnly": "father doctor && npm run build",
23
+ "start": "npm run dev"
24
+ },
25
+ "commitlint": {
26
+ "extends": [
27
+ "@commitlint/config-conventional"
28
+ ]
29
+ },
30
+ "lint-staged": {
31
+ "*.{md,json}": [
32
+ "prettier --write --no-error-on-unmatched-pattern"
33
+ ],
34
+ "*.{css,less}": [
35
+ "stylelint --fix",
36
+ "prettier --write"
37
+ ],
38
+ "*.{js,jsx}": [
39
+ "eslint --fix",
40
+ "prettier --write"
41
+ ],
42
+ "*.{ts,tsx}": [
43
+ "eslint --fix",
44
+ "prettier --parser=typescript --write"
45
+ ]
46
+ },
47
+ "devDependencies": {
48
+ "@commitlint/cli": "^17.1.2",
49
+ "@commitlint/config-conventional": "^17.1.0",
50
+ "@dnd-kit/core": "^6.1.0",
51
+ "@dnd-kit/modifiers": "^7.0.0",
52
+ "@dnd-kit/sortable": "^8.0.0",
53
+ "@dnd-kit/utilities": "^3.2.2",
54
+ "@tanstack/react-query": "^5.59.15",
55
+ "@types/lodash": "^4.17.12",
56
+ "@types/react": "^18.0.0",
57
+ "@types/react-dom": "^18.0.0",
58
+ "@umijs/lint": "^4.0.0",
59
+ "@vladmandic/face-api": "^1.7.14",
60
+ "antd": "^5.21.4",
61
+ "axios": "^1.7.7",
62
+ "dayjs": "^1.11.13",
63
+ "dumi": "^2.3.0",
64
+ "dumi-theme-antd": "^0.4.2",
65
+ "eslint": "^8.23.0",
66
+ "father": "^4.1.0",
67
+ "husky": "^8.0.1",
68
+ "lint-staged": "^13.0.3",
69
+ "lodash": "^4.17.21",
70
+ "nanoid": "^5.0.8",
71
+ "prettier": "^2.7.1",
72
+ "prettier-plugin-organize-imports": "^3.0.0",
73
+ "prettier-plugin-packagejson": "^2.2.18",
74
+ "react": "^18.0.0",
75
+ "react-dom": "^18.0.0",
76
+ "sass": "^1.80.0",
77
+ "stylelint": "^14.9.1",
78
+ "yootd-webrtc-sdk": "^1.0.1"
79
+ },
80
+ "peerDependencies": {
81
+ "@dnd-kit/core": ">=6.1.0",
82
+ "@dnd-kit/modifiers": ">=7.0.0",
83
+ "@dnd-kit/sortable": ">=8.0.0",
84
+ "@dnd-kit/utilities": ">=3.2.2",
85
+ "@tanstack/react-query": ">=5.59.15",
86
+ "@vladmandic/face-api": "^1.7.14",
87
+ "@xyflow/react": ">=12.3.3",
88
+ "antd": ">=5.21.4",
89
+ "axios": ">=1.7.7",
90
+ "dayjs": ">=1.11.13",
91
+ "lodash": ">=4.17.21",
92
+ "nanoid": ">=5.0.8",
93
+ "react": ">=16.9.0",
94
+ "react-dom": ">=16.9.0",
95
+ "yootd-webrtc-sdk": "^1.0.1"
96
+ },
97
+ "publishConfig": {
98
+ "access": "public"
99
+ },
100
+ "authors": []
101
+ }