@teamix/pro 1.5.28 → 1.5.30

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,6 +25,7 @@ export declare type ProActionConfig = ({
25
25
  } & RequestAction) | ({
26
26
  type: 'link';
27
27
  } & LinkAction);
28
+ export declare function registerCustomAction(id: string, component: React.FC): void;
28
29
  export declare function registerActionHandler(id: string, extendActionId: string, defaultConfig: any): void;
29
30
  export declare function useAction(config?: ProActionConfig, context?: any): any;
30
31
  export interface ProActionButtonProps extends ProActionCommonProps, ButtonProps {
@@ -40,6 +40,10 @@ import { usePopConfirmAction } from './pop-confirm';
40
40
  import { useDangerPopConfirmAction } from './danger-pop-confirm';
41
41
  import './index.scss';
42
42
  var RegistedActions = new Map();
43
+ var CustomActionMap = new Map();
44
+ export function registerCustomAction(id, component) {
45
+ CustomActionMap.set(id, component);
46
+ }
43
47
  export function registerActionHandler(id, extendActionId, defaultConfig) {
44
48
  RegistedActions.set(id, {
45
49
  extendActionId: extendActionId,
@@ -121,6 +125,7 @@ var buttonContent = function buttonContent(content, iconType, iconSize, context)
121
125
  }), renderedContent];
122
126
  };
123
127
  export var ProActionButton = function ProActionButton(props) {
128
+ var _CustomActionMap$get;
124
129
  var config = props.config,
125
130
  icon = props.icon,
126
131
  _props$iconSize = props.iconSize,
@@ -153,6 +158,18 @@ export var ProActionButton = function ProActionButton(props) {
153
158
  var content = /*#__PURE__*/React.createElement(Button, _objectSpread({
154
159
  type: type
155
160
  }, buttonProps), buttonContent(children, icon, iconSize, context));
161
+ var CustomActionComponent = (_CustomActionMap$get = CustomActionMap.get(config === null || config === void 0 ? void 0 : config.type)) !== null && _CustomActionMap$get !== void 0 ? _CustomActionMap$get : CustomActionMap.get(type);
162
+ if (CustomActionComponent) {
163
+ var triggerProps = _objectSpread({}, buttonProps);
164
+ if (config) {
165
+ triggerProps['type'] = type;
166
+ } else {
167
+ triggerProps['type'] = 'primary';
168
+ }
169
+ content = /*#__PURE__*/React.createElement(CustomActionComponent, _objectSpread({
170
+ triggerProps: triggerProps
171
+ }, context));
172
+ }
156
173
  var baseToolTipProps = _objectSpread({
157
174
  triggerType: 'hover',
158
175
  align: 't',
@@ -14,7 +14,8 @@ $noborder-font-weight-medium: calc(
14
14
  );
15
15
 
16
16
  .next-formily-item-inset.next-formily-item-inset.next-formily-item-inset {
17
+ width: 100%;
17
18
  display: flex;
18
19
  font-size: var(--font-size-body-1,12px);
19
20
  line-height: calc(var(--form-element-medium-height, 32px) - var(--input-border-width, 1px)*2);
20
- }
21
+ }
package/es/index.d.ts CHANGED
@@ -30,5 +30,5 @@ export * from './sidebar';
30
30
  export * from './utils';
31
31
  export * from './timeline';
32
32
  export * from './image';
33
- declare const version = "1.5.28";
33
+ declare const version = "1.5.30";
34
34
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, ProImage, hooks, nocode, templates, utils, };
package/es/index.js CHANGED
@@ -37,7 +37,7 @@ export * from './sidebar';
37
37
  export * from './utils';
38
38
  export * from './timeline';
39
39
  export * from './image';
40
- var version = '1.5.28';
40
+ var version = '1.5.30';
41
41
  // By TeamixTest
42
42
  window.postMessage({
43
43
  source: 'teamix-test-devtools',
@@ -25,6 +25,7 @@ export declare type ProActionConfig = ({
25
25
  } & RequestAction) | ({
26
26
  type: 'link';
27
27
  } & LinkAction);
28
+ export declare function registerCustomAction(id: string, component: React.FC): void;
28
29
  export declare function registerActionHandler(id: string, extendActionId: string, defaultConfig: any): void;
29
30
  export declare function useAction(config?: ProActionConfig, context?: any): any;
30
31
  export interface ProActionButtonProps extends ProActionCommonProps, ButtonProps {
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  var _exportNames = {
7
+ registerCustomAction: true,
7
8
  registerActionHandler: true,
8
9
  useAction: true,
9
10
  ProActionButton: true,
@@ -17,6 +18,7 @@ exports.ProActionButton = exports.ActionMenuButton = exports.ActionGroup = expor
17
18
  exports.ProActionGroup = ProActionGroup;
18
19
  exports.default = exports.ProActionMenuButton = void 0;
19
20
  exports.registerActionHandler = registerActionHandler;
21
+ exports.registerCustomAction = registerCustomAction;
20
22
  exports.useAction = useAction;
21
23
  var _react = _interopRequireDefault(require("react"));
22
24
  var _classnames = _interopRequireDefault(require("classnames"));
@@ -73,6 +75,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
73
75
  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; }
74
76
  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; }
75
77
  var RegistedActions = new Map();
78
+ var CustomActionMap = new Map();
79
+ function registerCustomAction(id, component) {
80
+ CustomActionMap.set(id, component);
81
+ }
76
82
  function registerActionHandler(id, extendActionId, defaultConfig) {
77
83
  RegistedActions.set(id, {
78
84
  extendActionId: extendActionId,
@@ -154,6 +160,7 @@ var buttonContent = function buttonContent(content, iconType, iconSize, context)
154
160
  }), renderedContent];
155
161
  };
156
162
  var ProActionButton = function ProActionButton(props) {
163
+ var _CustomActionMap$get;
157
164
  var config = props.config,
158
165
  icon = props.icon,
159
166
  _props$iconSize = props.iconSize,
@@ -186,6 +193,18 @@ var ProActionButton = function ProActionButton(props) {
186
193
  var content = /*#__PURE__*/_react.default.createElement(_components.Button, _objectSpread({
187
194
  type: type
188
195
  }, buttonProps), buttonContent(children, icon, iconSize, context));
196
+ var CustomActionComponent = (_CustomActionMap$get = CustomActionMap.get(config === null || config === void 0 ? void 0 : config.type)) !== null && _CustomActionMap$get !== void 0 ? _CustomActionMap$get : CustomActionMap.get(type);
197
+ if (CustomActionComponent) {
198
+ var triggerProps = _objectSpread({}, buttonProps);
199
+ if (config) {
200
+ triggerProps['type'] = type;
201
+ } else {
202
+ triggerProps['type'] = 'primary';
203
+ }
204
+ content = /*#__PURE__*/_react.default.createElement(CustomActionComponent, _objectSpread({
205
+ triggerProps: triggerProps
206
+ }, context));
207
+ }
189
208
  var baseToolTipProps = _objectSpread({
190
209
  triggerType: 'hover',
191
210
  align: 't',
@@ -14,7 +14,8 @@ $noborder-font-weight-medium: calc(
14
14
  );
15
15
 
16
16
  .next-formily-item-inset.next-formily-item-inset.next-formily-item-inset {
17
+ width: 100%;
17
18
  display: flex;
18
19
  font-size: var(--font-size-body-1,12px);
19
20
  line-height: calc(var(--form-element-medium-height, 32px) - var(--input-border-width, 1px)*2);
20
- }
21
+ }
package/lib/index.d.ts CHANGED
@@ -30,5 +30,5 @@ export * from './sidebar';
30
30
  export * from './utils';
31
31
  export * from './timeline';
32
32
  export * from './image';
33
- declare const version = "1.5.28";
33
+ declare const version = "1.5.30";
34
34
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, ProImage, hooks, nocode, templates, utils, };
package/lib/index.js CHANGED
@@ -299,7 +299,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
299
299
  if (!((_window = window) === null || _window === void 0 ? void 0 : _window.TEAMIXPRO_WITHOUT_ICON)) {
300
300
  _icon.default.setConfig(_utils.default.getTeamixIconConfig());
301
301
  }
302
- var version = '1.5.28';
302
+ var version = '1.5.30';
303
303
  // By TeamixTest
304
304
  exports.version = version;
305
305
  window.postMessage({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.5.28",
3
+ "version": "1.5.30",
4
4
  "description": "TeamixPro大包",
5
5
  "keywords": [
6
6
  "aliyun",