amis-core 2.3.2-beta.1 → 2.4.0
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.
- package/esm/Root.js +1 -1
- package/esm/RootRenderer.js +1 -1
- package/esm/SchemaRenderer.js +10 -3
- package/esm/Scoped.js +1 -1
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +1 -1
- package/esm/_virtual/index.js +1 -1
- package/esm/actions/Action.d.ts +2 -1
- package/esm/actions/Action.js +90 -15
- package/esm/actions/AjaxAction.js +2 -3
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.d.ts +4 -1
- package/esm/actions/BroadcastAction.js +8 -8
- package/esm/actions/CmptAction.d.ts +1 -1
- package/esm/actions/CmptAction.js +5 -2
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.d.ts +6 -1
- package/esm/actions/CustomAction.js +7 -7
- package/esm/actions/DialogAction.d.ts +4 -1
- package/esm/actions/DialogAction.js +9 -5
- package/esm/actions/DrawerAction.d.ts +4 -1
- package/esm/actions/DrawerAction.js +9 -5
- package/esm/actions/EmailAction.js +1 -1
- package/esm/actions/LinkAction.js +5 -6
- package/esm/actions/LoopAction.js +1 -1
- package/esm/actions/PageAction.js +1 -1
- package/esm/actions/ParallelAction.js +1 -1
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +3 -2
- package/esm/components/PopOver.js +2 -3
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.d.ts +1 -1
- package/esm/factory.js +2 -2
- package/esm/index.d.ts +20 -9
- package/esm/index.js +5 -2
- package/esm/locale.js +1 -1
- package/esm/node_modules/@restart/hooks/esm/useCommittedRef.js +1 -1
- package/esm/node_modules/@restart/hooks/esm/useEventCallback.js +1 -1
- package/esm/node_modules/dom-helpers/esm/addEventListener.js +1 -1
- package/esm/node_modules/dom-helpers/esm/canUseDOM.js +1 -1
- package/esm/node_modules/dom-helpers/esm/contains.js +1 -1
- package/esm/node_modules/dom-helpers/esm/listen.js +1 -1
- package/esm/node_modules/dom-helpers/esm/ownerDocument.js +1 -1
- package/esm/node_modules/dom-helpers/esm/removeEventListener.js +1 -1
- package/esm/node_modules/prop-types/factoryWithThrowingShims.js +51 -60
- package/esm/node_modules/prop-types/index.js +4 -13
- package/esm/node_modules/prop-types/lib/ReactPropTypesSecret.js +4 -13
- package/esm/node_modules/react-overlays/esm/Portal.js +1 -1
- package/esm/node_modules/react-overlays/esm/ownerDocument.js +1 -1
- package/esm/node_modules/react-overlays/esm/safeFindDOMNode.js +1 -1
- package/esm/node_modules/react-overlays/esm/useRootClose.js +1 -3
- package/esm/node_modules/react-overlays/esm/useWaitForDOMRef.js +1 -1
- package/esm/renderers/Form.d.ts +7 -1
- package/esm/renderers/Form.js +17 -6
- package/esm/renderers/Item.d.ts +6 -6
- package/esm/renderers/Item.js +24 -16
- package/esm/renderers/Options.d.ts +1 -1
- package/esm/renderers/Options.js +2 -2
- package/esm/renderers/Placeholder.js +1 -1
- package/esm/renderers/builtin.js +1 -1
- package/esm/renderers/wrapControl.js +1 -1
- package/esm/store/app.js +1 -1
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.js +1 -1
- package/esm/store/form.js +2 -2
- package/esm/store/formItem.js +1 -1
- package/esm/store/iRenderer.js +1 -1
- package/esm/store/index.d.ts +26 -13
- package/esm/store/index.js +2 -2
- package/esm/store/list.js +1 -1
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.js +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.js +1 -1
- package/esm/store/root.d.ts +2 -0
- package/esm/store/root.js +10 -4
- package/esm/store/service.js +1 -1
- package/esm/store/table.js +1 -1
- package/esm/store/table2.js +1 -1
- package/esm/theme.js +1 -1
- package/esm/types.d.ts +27 -0
- package/esm/utils/Animation.js +1 -1
- package/esm/utils/ColorScale.js +1 -1
- package/esm/utils/DataSchema.js +1 -1
- package/esm/utils/DataScope.js +1 -1
- package/esm/utils/RootClose.js +1 -1
- package/esm/utils/SimpleMap.js +1 -1
- package/esm/utils/api.d.ts +1 -1
- package/esm/utils/api.js +17 -5
- package/esm/utils/attachmentAdpator.js +1 -1
- package/esm/utils/autobind.js +1 -1
- package/esm/utils/columnsSplit.js +1 -1
- package/esm/utils/dataMapping.js +1 -1
- package/esm/utils/date.js +1 -1
- package/esm/utils/debug.js +1 -1
- package/esm/utils/decodeEntity.d.ts +5 -0
- package/esm/utils/decodeEntity.js +16 -0
- package/esm/utils/dom.js +1 -1
- package/esm/utils/errors.js +1 -1
- package/esm/utils/escapeHtml.js +1 -1
- package/esm/utils/filter-schema.js +1 -1
- package/esm/utils/filter.js +7 -5
- package/esm/utils/formatDuration.js +1 -1
- package/esm/utils/formula.js +1 -1
- package/esm/utils/getVariable.js +1 -1
- package/esm/utils/grammar.js +1 -1
- package/esm/utils/handleAction.js +1 -1
- package/esm/utils/helper.js +6 -1
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.d.ts +5 -1
- package/esm/utils/icon.js +11 -1
- package/esm/utils/image.js +1 -1
- package/esm/utils/index.d.ts +1 -0
- package/esm/utils/isPureVariable.js +1 -1
- package/esm/utils/json-schema-2-amis-schema.js +1 -1
- package/esm/utils/keyToPath.js +1 -1
- package/esm/utils/makeSorter.js +1 -1
- package/esm/utils/normalizeLink.js +1 -1
- package/esm/utils/normalizeOptions.js +1 -1
- package/esm/utils/object.js +1 -1
- package/esm/utils/offset.js +1 -1
- package/esm/utils/offsetParent.js +1 -1
- package/esm/utils/optionValueCompare.js +1 -1
- package/esm/utils/position.js +1 -1
- package/esm/utils/prettyBytes.js +1 -1
- package/esm/utils/renderer-event.js +1 -1
- package/esm/utils/replaceText.js +1 -1
- package/esm/utils/resize-sensor.js +1 -1
- package/esm/utils/resolveVariable.js +1 -1
- package/esm/utils/resolveVariableAndFilter.js +1 -1
- package/esm/utils/scrollPosition.js +1 -1
- package/esm/utils/string2regExp.js +1 -1
- package/esm/utils/stripNumber.js +1 -1
- package/esm/utils/style.js +1 -1
- package/esm/utils/toNumber.js +1 -1
- package/esm/utils/tokenize.js +1 -1
- package/esm/utils/tpl-builtin.js +1 -1
- package/esm/utils/tpl-lodash.js +1 -1
- package/esm/utils/tpl.js +1 -1
- package/esm/utils/uncontrollable.js +1 -1
- package/esm/utils/validations.js +1 -1
- package/lib/Root.js +1 -1
- package/lib/RootRenderer.js +1 -1
- package/lib/SchemaRenderer.js +10 -3
- package/lib/Scoped.js +1 -1
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +1 -1
- package/lib/_virtual/index.js +1 -1
- package/lib/actions/Action.d.ts +2 -1
- package/lib/actions/Action.js +94 -15
- package/lib/actions/AjaxAction.js +2 -7
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.d.ts +4 -1
- package/lib/actions/BroadcastAction.js +8 -8
- package/lib/actions/CmptAction.d.ts +1 -1
- package/lib/actions/CmptAction.js +5 -2
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.d.ts +6 -1
- package/lib/actions/CustomAction.js +7 -7
- package/lib/actions/DialogAction.d.ts +4 -1
- package/lib/actions/DialogAction.js +9 -5
- package/lib/actions/DrawerAction.d.ts +4 -1
- package/lib/actions/DrawerAction.js +9 -5
- package/lib/actions/EmailAction.js +1 -1
- package/lib/actions/LinkAction.js +5 -10
- package/lib/actions/LoopAction.js +1 -1
- package/lib/actions/PageAction.js +1 -1
- package/lib/actions/ParallelAction.js +1 -1
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.js +3 -2
- package/lib/components/PopOver.js +2 -3
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.d.ts +1 -1
- package/lib/factory.js +2 -2
- package/lib/index.d.ts +20 -9
- package/lib/index.js +6 -1
- package/lib/locale.js +1 -1
- package/lib/node_modules/@restart/hooks/esm/useCommittedRef.js +1 -1
- package/lib/node_modules/@restart/hooks/esm/useEventCallback.js +1 -1
- package/lib/node_modules/dom-helpers/esm/addEventListener.js +1 -1
- package/lib/node_modules/dom-helpers/esm/canUseDOM.js +1 -1
- package/lib/node_modules/dom-helpers/esm/contains.js +1 -1
- package/lib/node_modules/dom-helpers/esm/listen.js +1 -1
- package/lib/node_modules/dom-helpers/esm/ownerDocument.js +1 -1
- package/lib/node_modules/dom-helpers/esm/removeEventListener.js +1 -1
- package/lib/node_modules/prop-types/factoryWithThrowingShims.js +51 -60
- package/lib/node_modules/prop-types/index.js +3 -12
- package/lib/node_modules/prop-types/lib/ReactPropTypesSecret.js +4 -13
- package/lib/node_modules/react-overlays/esm/Portal.js +1 -1
- package/lib/node_modules/react-overlays/esm/ownerDocument.js +1 -1
- package/lib/node_modules/react-overlays/esm/safeFindDOMNode.js +1 -1
- package/lib/node_modules/react-overlays/esm/useRootClose.js +1 -3
- package/lib/node_modules/react-overlays/esm/useWaitForDOMRef.js +1 -1
- package/lib/renderers/Form.d.ts +7 -1
- package/lib/renderers/Form.js +17 -6
- package/lib/renderers/Item.d.ts +6 -6
- package/lib/renderers/Item.js +24 -16
- package/lib/renderers/Options.d.ts +1 -1
- package/lib/renderers/Options.js +2 -2
- package/lib/renderers/Placeholder.js +1 -1
- package/lib/renderers/builtin.js +1 -1
- package/lib/renderers/wrapControl.js +1 -1
- package/lib/store/app.js +1 -1
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.js +1 -1
- package/lib/store/form.js +2 -2
- package/lib/store/formItem.js +1 -1
- package/lib/store/iRenderer.js +1 -1
- package/lib/store/index.d.ts +26 -13
- package/lib/store/index.js +2 -2
- package/lib/store/list.js +1 -1
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.js +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.js +1 -1
- package/lib/store/root.d.ts +2 -0
- package/lib/store/root.js +9 -3
- package/lib/store/service.js +1 -1
- package/lib/store/table.js +1 -1
- package/lib/store/table2.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +27 -0
- package/lib/utils/Animation.js +1 -1
- package/lib/utils/ColorScale.js +1 -1
- package/lib/utils/DataSchema.js +1 -1
- package/lib/utils/DataScope.js +1 -1
- package/lib/utils/RootClose.js +1 -1
- package/lib/utils/SimpleMap.js +1 -1
- package/lib/utils/api.d.ts +1 -1
- package/lib/utils/api.js +16 -4
- package/lib/utils/attachmentAdpator.js +1 -1
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/columnsSplit.js +1 -1
- package/lib/utils/dataMapping.js +1 -1
- package/lib/utils/date.js +1 -1
- package/lib/utils/debug.js +1 -1
- package/lib/utils/decodeEntity.d.ts +5 -0
- package/lib/utils/decodeEntity.js +20 -0
- package/lib/utils/dom.js +1 -1
- package/lib/utils/errors.js +1 -1
- package/lib/utils/escapeHtml.js +1 -1
- package/lib/utils/filter-schema.js +1 -1
- package/lib/utils/filter.js +7 -5
- package/lib/utils/formatDuration.js +1 -1
- package/lib/utils/formula.js +1 -1
- package/lib/utils/getVariable.js +1 -1
- package/lib/utils/grammar.js +1 -1
- package/lib/utils/handleAction.js +1 -1
- package/lib/utils/helper.js +6 -1
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.d.ts +5 -1
- package/lib/utils/icon.js +11 -1
- package/lib/utils/image.js +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/isPureVariable.js +1 -1
- package/lib/utils/json-schema-2-amis-schema.js +1 -1
- package/lib/utils/keyToPath.js +1 -1
- package/lib/utils/makeSorter.js +1 -1
- package/lib/utils/normalizeLink.js +1 -1
- package/lib/utils/normalizeOptions.js +1 -1
- package/lib/utils/object.js +1 -1
- package/lib/utils/offset.js +1 -1
- package/lib/utils/offsetParent.js +1 -1
- package/lib/utils/optionValueCompare.js +1 -1
- package/lib/utils/position.js +1 -1
- package/lib/utils/prettyBytes.js +1 -1
- package/lib/utils/renderer-event.js +1 -1
- package/lib/utils/replaceText.js +1 -1
- package/lib/utils/resize-sensor.js +1 -1
- package/lib/utils/resolveVariable.js +1 -1
- package/lib/utils/resolveVariableAndFilter.js +1 -1
- package/lib/utils/scrollPosition.js +1 -1
- package/lib/utils/string2regExp.js +1 -1
- package/lib/utils/stripNumber.js +1 -1
- package/lib/utils/style.js +1 -1
- package/lib/utils/toNumber.js +1 -1
- package/lib/utils/tokenize.js +1 -1
- package/lib/utils/tpl-builtin.js +1 -1
- package/lib/utils/tpl-lodash.js +1 -1
- package/lib/utils/tpl.js +1 -1
- package/lib/utils/uncontrollable.js +1 -1
- package/lib/utils/validations.js +1 -1
- package/package.json +4 -3
- package/esm/_virtual/index2.js +0 -8
- package/esm/_virtual/react-is.development.js +0 -8
- package/esm/_virtual/react-is.production.min.js +0 -8
- package/esm/node_modules/object-assign/index.js +0 -104
- package/esm/node_modules/prop-types/checkPropTypes.js +0 -120
- package/esm/node_modules/prop-types/factoryWithTypeCheckers.js +0 -630
- package/esm/node_modules/prop-types/lib/has.js +0 -16
- package/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -195
- package/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -31
- package/esm/node_modules/prop-types/node_modules/react-is/index.js +0 -26
- package/esm/node_modules/warning/warning.js +0 -67
- package/lib/_virtual/index2.js +0 -12
- package/lib/_virtual/react-is.development.js +0 -12
- package/lib/_virtual/react-is.production.min.js +0 -12
- package/lib/node_modules/object-assign/index.js +0 -108
- package/lib/node_modules/prop-types/checkPropTypes.js +0 -124
- package/lib/node_modules/prop-types/factoryWithTypeCheckers.js +0 -634
- package/lib/node_modules/prop-types/lib/has.js +0 -20
- package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -199
- package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -35
- package/lib/node_modules/prop-types/node_modules/react-is/index.js +0 -30
- package/lib/node_modules/warning/warning.js +0 -71
package/esm/renderers/Item.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -33,12 +33,11 @@ import 'lodash/isObject';
|
|
|
33
33
|
import 'lodash/isString';
|
|
34
34
|
import 'lodash/isBoolean';
|
|
35
35
|
import { getVariable } from '../utils/getVariable.js';
|
|
36
|
-
import '../utils/image.js';
|
|
37
36
|
import 'lodash';
|
|
37
|
+
import '../utils/image.js';
|
|
38
38
|
import '../actions/Action.js';
|
|
39
39
|
import '../utils/resize-sensor.js';
|
|
40
40
|
import '../node_modules/dom-helpers/esm/addEventListener.js';
|
|
41
|
-
import '../node_modules/warning/warning.js';
|
|
42
41
|
import '../utils/SimpleMap.js';
|
|
43
42
|
import 'lodash/mapValues';
|
|
44
43
|
import 'lodash/camelCase';
|
|
@@ -48,6 +47,14 @@ import '../utils/Animation.js';
|
|
|
48
47
|
import Overlay from '../components/Overlay.js';
|
|
49
48
|
import PopOver from '../components/PopOver.js';
|
|
50
49
|
|
|
50
|
+
var getItemLabelClassName = function (props) {
|
|
51
|
+
var staticLabelClassName = props.staticLabelClassName, labelClassName = props.labelClassName;
|
|
52
|
+
return props.static && staticLabelClassName ? staticLabelClassName : labelClassName;
|
|
53
|
+
};
|
|
54
|
+
var getItemInputClassName = function (props) {
|
|
55
|
+
var staticInputClassName = props.staticInputClassName, inputClassName = props.inputClassName;
|
|
56
|
+
return props.static && staticInputClassName ? staticInputClassName : inputClassName;
|
|
57
|
+
};
|
|
51
58
|
var FormItemWrap = /** @class */ (function (_super) {
|
|
52
59
|
__extends(FormItemWrap, _super);
|
|
53
60
|
function FormItemWrap(props) {
|
|
@@ -310,7 +317,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
310
317
|
};
|
|
311
318
|
FormItemWrap.prototype.renderControl = function () {
|
|
312
319
|
var _a;
|
|
313
|
-
var _b = this.props,
|
|
320
|
+
var _b = this.props, model = _b.formItem, cx = _b.classnames; _b.children; var type = _b.type, renderControl = _b.renderControl; _b.formItemConfig; var sizeMutable = _b.sizeMutable, size = _b.size, defaultSize = _b.defaultSize, useMobileUI = _b.useMobileUI, rest = __rest(_b, ["formItem", "classnames", "children", "type", "renderControl", "formItemConfig", "sizeMutable", "size", "defaultSize", "useMobileUI"]);
|
|
314
321
|
var mobileUI = useMobileUI && isMobile();
|
|
315
322
|
if (renderControl) {
|
|
316
323
|
var controlSize = size || defaultSize;
|
|
@@ -322,7 +329,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
322
329
|
typeof controlSize === 'string' &&
|
|
323
330
|
!!controlSize &&
|
|
324
331
|
controlSize !== 'full',
|
|
325
|
-
_a), model === null || model === void 0 ? void 0 : model.errClassNames,
|
|
332
|
+
_a), model === null || model === void 0 ? void 0 : model.errClassNames, getItemInputClassName(this.props)) }));
|
|
326
333
|
}
|
|
327
334
|
return null;
|
|
328
335
|
};
|
|
@@ -352,7 +359,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
352
359
|
FormItemWrap.layoutRenderers = {
|
|
353
360
|
horizontal: function (props, renderControl) {
|
|
354
361
|
var _a, _b, _c;
|
|
355
|
-
var className = props.className, cx = props.classnames, description = props.description, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, desc = props.desc, label = props.label,
|
|
362
|
+
var className = props.className, cx = props.classnames, description = props.description, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, desc = props.desc, label = props.label, render = props.render, required = props.required, caption = props.caption, remark = props.remark, labelRemark = props.labelRemark, env = props.env, model = props.formItem, renderLabel = props.renderLabel, renderDescription = props.renderDescription, hint = props.hint, data = props.data, showErrorMsg = props.showErrorMsg, useMobileUI = props.useMobileUI; props.translate; var isStatic = props.static, staticClassName = props.staticClassName;
|
|
356
363
|
// 强制不渲染 label 的话
|
|
357
364
|
if (renderLabel === false) {
|
|
358
365
|
label = label === false ? false : '';
|
|
@@ -363,7 +370,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
363
370
|
var right = getWidthRate(horizontal.right);
|
|
364
371
|
var labelAlign = props.labelAlign || props.formLabelAlign;
|
|
365
372
|
var labelWidth = props.labelWidth || props.formLabelWidth;
|
|
366
|
-
return (React.createElement("div", { "data-role": "form-item", className: cx("Form-item Form-item--horizontal", className, (_a = {
|
|
373
|
+
return (React.createElement("div", { "data-role": "form-item", className: cx("Form-item Form-item--horizontal", isStatic && staticClassName ? staticClassName : className, (_a = {
|
|
367
374
|
'Form-item--horizontal-justify': horizontal.justify
|
|
368
375
|
},
|
|
369
376
|
_a["is-error"] = model && !model.valid,
|
|
@@ -375,7 +382,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
375
382
|
: 'normal')] = horizontal.leftFixed,
|
|
376
383
|
_b["Form-itemColumn--".concat(left)] = !horizontal.leftFixed,
|
|
377
384
|
_b['Form-label--left'] = labelAlign === 'left',
|
|
378
|
-
_b),
|
|
385
|
+
_b), getItemLabelClassName(props)), style: labelWidth != null ? { width: labelWidth } : undefined },
|
|
379
386
|
React.createElement("span", null,
|
|
380
387
|
label
|
|
381
388
|
? render('label', typeof label === 'string' ? filter(label, data) : label)
|
|
@@ -436,14 +443,14 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
436
443
|
},
|
|
437
444
|
normal: function (props, renderControl) {
|
|
438
445
|
var _a;
|
|
439
|
-
var className = props.className, cx = props.classnames, desc = props.desc, description = props.description, label = props.label,
|
|
446
|
+
var className = props.className, cx = props.classnames, desc = props.desc, description = props.description, label = props.label, render = props.render, required = props.required, caption = props.caption, remark = props.remark, labelRemark = props.labelRemark, env = props.env, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, model = props.formItem, renderLabel = props.renderLabel, renderDescription = props.renderDescription, hint = props.hint, data = props.data, showErrorMsg = props.showErrorMsg, useMobileUI = props.useMobileUI; props.translate;
|
|
440
447
|
description = description || desc;
|
|
441
448
|
return (React.createElement("div", { "data-role": "form-item", className: cx("Form-item Form-item--normal", className, (_a = {
|
|
442
449
|
'is-error': model && !model.valid
|
|
443
450
|
},
|
|
444
451
|
_a["is-required"] = required,
|
|
445
452
|
_a), model === null || model === void 0 ? void 0 : model.errClassNames) },
|
|
446
|
-
label && renderLabel !== false ? (React.createElement("label", { className: cx("Form-label",
|
|
453
|
+
label && renderLabel !== false ? (React.createElement("label", { className: cx("Form-label", getItemLabelClassName(props)) },
|
|
447
454
|
React.createElement("span", null,
|
|
448
455
|
label
|
|
449
456
|
? render('label', typeof label === 'string' ? filter(label, data) : label)
|
|
@@ -498,7 +505,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
498
505
|
},
|
|
499
506
|
inline: function (props, renderControl) {
|
|
500
507
|
var _a;
|
|
501
|
-
var className = props.className, cx = props.classnames, desc = props.desc, description = props.description, label = props.label,
|
|
508
|
+
var className = props.className, cx = props.classnames, desc = props.desc, description = props.description, label = props.label, render = props.render, required = props.required, caption = props.caption, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, model = props.formItem, remark = props.remark, labelRemark = props.labelRemark, env = props.env, hint = props.hint, renderLabel = props.renderLabel, renderDescription = props.renderDescription, data = props.data, showErrorMsg = props.showErrorMsg, useMobileUI = props.useMobileUI; props.translate;
|
|
502
509
|
var labelWidth = props.labelWidth || props.formLabelWidth;
|
|
503
510
|
description = description || desc;
|
|
504
511
|
return (React.createElement("div", { "data-role": "form-item", className: cx("Form-item Form-item--inline", className, (_a = {
|
|
@@ -506,7 +513,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
506
513
|
},
|
|
507
514
|
_a["is-required"] = required,
|
|
508
515
|
_a), model === null || model === void 0 ? void 0 : model.errClassNames) },
|
|
509
|
-
label && renderLabel !== false ? (React.createElement("label", { className: cx("Form-label",
|
|
516
|
+
label && renderLabel !== false ? (React.createElement("label", { className: cx("Form-label", getItemLabelClassName(props)), style: labelWidth != null ? { width: labelWidth } : undefined },
|
|
510
517
|
React.createElement("span", null,
|
|
511
518
|
label
|
|
512
519
|
? render('label', typeof label === 'string' ? filter(label, data) : label)
|
|
@@ -564,7 +571,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
564
571
|
},
|
|
565
572
|
row: function (props, renderControl) {
|
|
566
573
|
var _a;
|
|
567
|
-
var className = props.className, cx = props.classnames, desc = props.desc, description = props.description, label = props.label,
|
|
574
|
+
var className = props.className, cx = props.classnames, desc = props.desc, description = props.description, label = props.label, render = props.render, required = props.required, caption = props.caption, remark = props.remark, labelRemark = props.labelRemark, env = props.env, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, model = props.formItem, renderLabel = props.renderLabel, renderDescription = props.renderDescription, hint = props.hint, data = props.data, showErrorMsg = props.showErrorMsg, useMobileUI = props.useMobileUI; props.translate;
|
|
568
575
|
var labelWidth = props.labelWidth || props.formLabelWidth;
|
|
569
576
|
description = description || desc;
|
|
570
577
|
return (React.createElement("div", { "data-role": "form-item", className: cx("Form-item Form-item--row", className, (_a = {
|
|
@@ -573,7 +580,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
573
580
|
_a["is-required"] = required,
|
|
574
581
|
_a), model === null || model === void 0 ? void 0 : model.errClassNames) },
|
|
575
582
|
React.createElement("div", { className: cx('Form-rowInner') },
|
|
576
|
-
label && renderLabel !== false ? (React.createElement("label", { className: cx("Form-label",
|
|
583
|
+
label && renderLabel !== false ? (React.createElement("label", { className: cx("Form-label", getItemLabelClassName(props)), style: labelWidth != null ? { width: labelWidth } : undefined },
|
|
577
584
|
React.createElement("span", null,
|
|
578
585
|
render('label', typeof label === 'string' ? filter(label, data) : label),
|
|
579
586
|
required && (label || labelRemark) ? (React.createElement("span", { className: cx("Form-star") }, "*")) : null,
|
|
@@ -688,6 +695,7 @@ var detectProps = [
|
|
|
688
695
|
'desc',
|
|
689
696
|
'description',
|
|
690
697
|
'disabled',
|
|
698
|
+
'static',
|
|
691
699
|
'draggable',
|
|
692
700
|
'editable',
|
|
693
701
|
'editButtonClassName',
|
|
@@ -792,7 +800,7 @@ function asFormItem(config) {
|
|
|
792
800
|
};
|
|
793
801
|
class_1.prototype.renderControl = function () {
|
|
794
802
|
var _a;
|
|
795
|
-
var _b = this.props,
|
|
803
|
+
var _b = this.props, model = _b.formItem, cx = _b.classnames; _b.children; var type = _b.type, size = _b.size, defaultSize = _b.defaultSize, useMobileUI = _b.useMobileUI, rest = __rest(_b, ["formItem", "classnames", "children", "type", "size", "defaultSize", "useMobileUI"]);
|
|
796
804
|
var controlSize = size || defaultSize;
|
|
797
805
|
var mobileUI = useMobileUI && isMobile();
|
|
798
806
|
//@ts-ignore
|
|
@@ -806,7 +814,7 @@ function asFormItem(config) {
|
|
|
806
814
|
typeof controlSize === 'string' &&
|
|
807
815
|
!!controlSize &&
|
|
808
816
|
controlSize !== 'full',
|
|
809
|
-
_a), model === null || model === void 0 ? void 0 : model.errClassNames,
|
|
817
|
+
_a), model === null || model === void 0 ? void 0 : model.errClassNames, getItemInputClassName(this.props)) })),
|
|
810
818
|
isOpened ? this.buildSchema() : null));
|
|
811
819
|
};
|
|
812
820
|
return class_1;
|
|
@@ -6,7 +6,7 @@ import { Api, PlainObject, OptionProps, BaseApiObject } from '../types';
|
|
|
6
6
|
import { FormControlProps, FormItemBasicConfig, FormBaseControl } from './Item';
|
|
7
7
|
export declare type OptionsControlComponent = React.ComponentType<FormControlProps>;
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import { Option } from '../types';
|
|
9
|
+
import type { Option } from '../types';
|
|
10
10
|
export { Option };
|
|
11
11
|
export interface FormOptionsControl extends FormBaseControl {
|
|
12
12
|
/**
|
package/esm/renderers/Options.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -34,12 +34,12 @@ import 'classnames';
|
|
|
34
34
|
import 'lodash/isObject';
|
|
35
35
|
import 'lodash/isString';
|
|
36
36
|
import 'lodash/isBoolean';
|
|
37
|
+
import 'lodash';
|
|
37
38
|
import '../utils/image.js';
|
|
38
39
|
import { keyToPath } from '../utils/keyToPath.js';
|
|
39
40
|
import { resolveEventData } from '../utils/renderer-event.js';
|
|
40
41
|
import '../utils/resize-sensor.js';
|
|
41
42
|
import '../node_modules/dom-helpers/esm/addEventListener.js';
|
|
42
|
-
import '../node_modules/warning/warning.js';
|
|
43
43
|
import '../utils/SimpleMap.js';
|
|
44
44
|
import 'lodash/mapValues';
|
|
45
45
|
import 'lodash/camelCase';
|
package/esm/renderers/builtin.js
CHANGED
package/esm/store/app.js
CHANGED
package/esm/store/combo.js
CHANGED
package/esm/store/crud.js
CHANGED
package/esm/store/form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -73,7 +73,7 @@ var FormStore = ServiceStore.named('FormStore')
|
|
|
73
73
|
if (current.storeType === 'FormItemStore') {
|
|
74
74
|
formItems.push(current);
|
|
75
75
|
}
|
|
76
|
-
else if (current.storeType
|
|
76
|
+
else if (!['ComboStore', 'TableStore'].includes(current.storeType)) {
|
|
77
77
|
pool.push.apply(pool, current.children);
|
|
78
78
|
}
|
|
79
79
|
}
|
package/esm/store/formItem.js
CHANGED
package/esm/store/iRenderer.js
CHANGED
package/esm/store/index.d.ts
CHANGED
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
import { Instance } from 'mobx-state-tree';
|
|
2
|
-
import { iRendererStore
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { iRendererStore } from './iRenderer';
|
|
3
|
+
import type { IIRendererStore } from './iRenderer';
|
|
4
|
+
import { ServiceStore } from './service';
|
|
5
|
+
import type { IServiceStore } from './service';
|
|
6
|
+
import { ComboStore } from './combo';
|
|
7
|
+
import type { IComboStore } from './combo';
|
|
8
|
+
import { FormStore } from './form';
|
|
9
|
+
import type { IFormStore } from './form';
|
|
10
|
+
import { CRUDStore } from './crud';
|
|
11
|
+
import type { ICRUDStore } from './crud';
|
|
12
|
+
import { TableStore } from './table';
|
|
13
|
+
import type { IColumn, IRow, ITableStore } from './table';
|
|
14
|
+
import { TableStore2 } from './table2';
|
|
15
|
+
import type { IColumn2, IRow2, ITableStore2 } from './table2';
|
|
16
|
+
import { ListStore } from './list';
|
|
17
|
+
import type { IListStore } from './list';
|
|
18
|
+
import { ModalStore } from './modal';
|
|
19
|
+
import type { IModalStore } from './modal';
|
|
11
20
|
import { TranslateFn } from '../locale';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
21
|
+
import { StoreNode } from './node';
|
|
22
|
+
import type { IStoreNode } from './node';
|
|
23
|
+
import { FormItemStore } from './formItem';
|
|
24
|
+
import type { IFormItemStore } from './formItem';
|
|
25
|
+
import { PaginationStore } from './pagination';
|
|
26
|
+
import type { IPaginationStore } from './pagination';
|
|
27
|
+
import { AppStore } from './app';
|
|
28
|
+
import type { IAppStore } from './app';
|
|
16
29
|
export declare const RendererStore: import("mobx-state-tree").IModelType<{
|
|
17
30
|
storeType: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
18
31
|
}, {
|
package/esm/store/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -32,7 +32,7 @@ import { AppStore } from './app.js';
|
|
|
32
32
|
export { AppStore } from './app.js';
|
|
33
33
|
import { RootStore } from './root.js';
|
|
34
34
|
|
|
35
|
-
setLivelinessChecking(
|
|
35
|
+
setLivelinessChecking('ignore' );
|
|
36
36
|
var allowedStoreList = [
|
|
37
37
|
ServiceStore,
|
|
38
38
|
FormStore,
|
package/esm/store/list.js
CHANGED
package/esm/store/manager.js
CHANGED
package/esm/store/modal.js
CHANGED
package/esm/store/node.js
CHANGED
package/esm/store/pagination.js
CHANGED
package/esm/store/root.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export declare const RootStore: import("mobx-state-tree").IModelType<{
|
|
|
33
33
|
query: import("mobx-state-tree").IType<any, any, any>;
|
|
34
34
|
visibleState: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
35
35
|
disableState: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
36
|
+
staticState: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
36
37
|
}, {
|
|
37
38
|
readonly parentStore: any;
|
|
38
39
|
readonly __: any;
|
|
@@ -79,5 +80,6 @@ export declare const RootStore: import("mobx-state-tree").IModelType<{
|
|
|
79
80
|
updateLocation(location?: any): void;
|
|
80
81
|
setVisible(id: string, value: boolean): void;
|
|
81
82
|
setDisable(id: string, value: boolean): void;
|
|
83
|
+
setStatic(id: string, value: boolean): void;
|
|
82
84
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
83
85
|
export declare type IRootStore = Instance<typeof RootStore>;
|
package/esm/store/root.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ import { __assign } from 'tslib';
|
|
|
7
7
|
import { types } from 'mobx-state-tree';
|
|
8
8
|
import { parseQuery } from '../utils/helper.js';
|
|
9
9
|
import { ServiceStore } from './service.js';
|
|
10
|
-
import { createObject } from '../utils/object.js';
|
|
10
|
+
import { createObject, extendObject } from '../utils/object.js';
|
|
11
11
|
|
|
12
12
|
var RootStore = ServiceStore.named('RootStore')
|
|
13
13
|
.props({
|
|
@@ -15,12 +15,13 @@ var RootStore = ServiceStore.named('RootStore')
|
|
|
15
15
|
runtimeErrorStack: types.frozen(),
|
|
16
16
|
query: types.frozen(),
|
|
17
17
|
visibleState: types.optional(types.frozen(), {}),
|
|
18
|
-
disableState: types.optional(types.frozen(), {})
|
|
18
|
+
disableState: types.optional(types.frozen(), {}),
|
|
19
|
+
staticState: types.optional(types.frozen(), {})
|
|
19
20
|
})
|
|
20
21
|
.views(function (self) { return ({
|
|
21
22
|
get downStream() {
|
|
22
23
|
return self.query
|
|
23
|
-
? createObject(
|
|
24
|
+
? createObject(extendObject(self.data && self.data.__super ? self.data.__super : null, __assign(__assign({}, self.query), { __query: self.query })), self.data)
|
|
24
25
|
: self.data;
|
|
25
26
|
}
|
|
26
27
|
}); })
|
|
@@ -41,6 +42,11 @@ var RootStore = ServiceStore.named('RootStore')
|
|
|
41
42
|
var _a;
|
|
42
43
|
var state = __assign(__assign({}, self.disableState), (_a = {}, _a[id] = value, _a));
|
|
43
44
|
self.disableState = state;
|
|
45
|
+
},
|
|
46
|
+
setStatic: function (id, value) {
|
|
47
|
+
var _a;
|
|
48
|
+
var state = __assign(__assign({}, self.staticState), (_a = {}, _a[id] = value, _a));
|
|
49
|
+
self.staticState = state;
|
|
44
50
|
}
|
|
45
51
|
}); });
|
|
46
52
|
|
package/esm/store/service.js
CHANGED
package/esm/store/table.js
CHANGED
package/esm/store/table2.js
CHANGED
package/esm/theme.js
CHANGED
package/esm/types.d.ts
CHANGED
|
@@ -222,9 +222,11 @@ export interface Schema {
|
|
|
222
222
|
visibleOn?: string;
|
|
223
223
|
hiddenOn?: string;
|
|
224
224
|
disabledOn?: string;
|
|
225
|
+
staticOn?: string;
|
|
225
226
|
visible?: boolean;
|
|
226
227
|
hidden?: boolean;
|
|
227
228
|
disabled?: boolean;
|
|
229
|
+
static?: boolean;
|
|
228
230
|
children?: JSX.Element | ((props: any, schema?: any) => JSX.Element) | null;
|
|
229
231
|
definitions?: Definitions;
|
|
230
232
|
[propName: string]: any;
|
|
@@ -449,5 +451,30 @@ export interface BaseSchemaWithoutType {
|
|
|
449
451
|
actions: ListenerAction[];
|
|
450
452
|
};
|
|
451
453
|
};
|
|
454
|
+
/**
|
|
455
|
+
* 是否静态展示
|
|
456
|
+
*/
|
|
457
|
+
static?: boolean;
|
|
458
|
+
/**
|
|
459
|
+
* 是否静态展示表达式
|
|
460
|
+
*/
|
|
461
|
+
staticOn?: SchemaExpression;
|
|
462
|
+
/**
|
|
463
|
+
* 静态展示空值占位
|
|
464
|
+
*/
|
|
465
|
+
staticPlaceholder?: string;
|
|
466
|
+
/**
|
|
467
|
+
* 静态展示表单项类名
|
|
468
|
+
*/
|
|
469
|
+
staticClassName?: SchemaClassName;
|
|
470
|
+
/**
|
|
471
|
+
* 静态展示表单项Label类名
|
|
472
|
+
*/
|
|
473
|
+
staticLabelClassName?: SchemaClassName;
|
|
474
|
+
/**
|
|
475
|
+
* 静态展示表单项Value类名
|
|
476
|
+
*/
|
|
477
|
+
staticInputClassName?: SchemaClassName;
|
|
478
|
+
staticSchema?: any;
|
|
452
479
|
}
|
|
453
480
|
export {};
|
package/esm/utils/Animation.js
CHANGED
package/esm/utils/ColorScale.js
CHANGED
package/esm/utils/DataSchema.js
CHANGED
package/esm/utils/DataScope.js
CHANGED
package/esm/utils/RootClose.js
CHANGED
package/esm/utils/SimpleMap.js
CHANGED
package/esm/utils/api.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare function buildApi(api: Api, data?: object, options?: {
|
|
|
13
13
|
export declare function str2function(contents: string, ...args: Array<string>): Function | null;
|
|
14
14
|
export declare function str2AsyncFunction(contents: string, ...args: Array<string>): Function | null;
|
|
15
15
|
export declare function responseAdaptor(ret: fetcherResult, api: ApiObject): Payload;
|
|
16
|
-
export declare function wrapFetcher(fn: (config: fetcherConfig) => Promise<fetcherResult>, tracker?: (eventTrack: EventTrack, data: any) => void):
|
|
16
|
+
export declare function wrapFetcher(fn: (config: fetcherConfig) => Promise<fetcherResult>, tracker?: (eventTrack: EventTrack, data: any) => void): any;
|
|
17
17
|
export declare function wrapAdaptor(promise: Promise<fetcherResult>, api: ApiObject): Promise<Payload>;
|
|
18
18
|
/**
|
|
19
19
|
* 请求远程 js 文件然后 new Function 执行,用于 schemaApi 支持 JavaScript
|
package/esm/utils/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -13,7 +13,7 @@ import { tokenize } from './tokenize.js';
|
|
|
13
13
|
import { dataMapping } from './dataMapping.js';
|
|
14
14
|
import './filter.js';
|
|
15
15
|
import { evalExpression } from './tpl.js';
|
|
16
|
-
import { qsparse, JSONTraverse, qsstringify,
|
|
16
|
+
import { qsparse, JSONTraverse, qsstringify, uuid, isObjectShallowModified, hasFile, object2formData } from './helper.js';
|
|
17
17
|
import isPlainObject from 'lodash/isPlainObject';
|
|
18
18
|
import { debug, warning } from './debug.js';
|
|
19
19
|
|
|
@@ -138,7 +138,10 @@ function buildApi(api, data, options) {
|
|
|
138
138
|
}
|
|
139
139
|
else {
|
|
140
140
|
api.query = data;
|
|
141
|
-
|
|
141
|
+
var query = qsstringify(data);
|
|
142
|
+
if (query) {
|
|
143
|
+
api.url = "".concat(api.url, "?").concat(query);
|
|
144
|
+
}
|
|
142
145
|
}
|
|
143
146
|
}
|
|
144
147
|
if (api.data && api.attachDataToQuery !== false) {
|
|
@@ -149,7 +152,10 @@ function buildApi(api, data, options) {
|
|
|
149
152
|
}
|
|
150
153
|
else {
|
|
151
154
|
api.query = api.data;
|
|
152
|
-
|
|
155
|
+
var query = qsstringify(api.data);
|
|
156
|
+
if (query) {
|
|
157
|
+
api.url = "".concat(api.url, "?").concat(query);
|
|
158
|
+
}
|
|
153
159
|
}
|
|
154
160
|
delete api.data;
|
|
155
161
|
}
|
|
@@ -296,7 +302,11 @@ function responseAdaptor(ret, api) {
|
|
|
296
302
|
return payload;
|
|
297
303
|
}
|
|
298
304
|
function wrapFetcher(fn, tracker) {
|
|
299
|
-
|
|
305
|
+
// 避免重复处理
|
|
306
|
+
if (fn._wrappedFetcher) {
|
|
307
|
+
return fn;
|
|
308
|
+
}
|
|
309
|
+
var wrappedFetcher = function (api, data, options) {
|
|
300
310
|
var _a, _b, _c;
|
|
301
311
|
api = buildApi(api, data, options);
|
|
302
312
|
if (api.requestAdaptor) {
|
|
@@ -354,6 +364,8 @@ function wrapFetcher(fn, tracker) {
|
|
|
354
364
|
}
|
|
355
365
|
return wrapAdaptor(fn(api), api);
|
|
356
366
|
};
|
|
367
|
+
wrappedFetcher._wrappedFetcher = true;
|
|
368
|
+
return wrappedFetcher;
|
|
357
369
|
}
|
|
358
370
|
function wrapAdaptor(promise, api) {
|
|
359
371
|
var _this = this;
|