Socket
Socket
Sign inDemoInstall

amis-core

Package Overview
Dependencies
59
Maintainers
4
Versions
73
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.6.3 to 6.0.0

esm/utils/browser.d.ts

58

esm/actions/Action.js
/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -185,5 +185,5 @@ */

var additional, action, mergeData, expression, isStop, preventDefault, key, api, cmptFlag, targetComponent, args, afterMappingData, actionData, data, stopped, actionResult, stopPropagation;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
return __generator(this, function (_v) {
switch (_v.label) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
return __generator(this, function (_w) {
switch (_w.label) {
case 0:

@@ -196,3 +196,3 @@ additional = {

// __rendererData默认为renderer.props.data,兼容表单项值变化时的data读取
if (!event.data.__rendererData) {
if (!((_a = event.data) === null || _a === void 0 ? void 0 : _a.__rendererData)) {
additional = {

@@ -206,3 +206,3 @@ event: event,

: additional, renderer.props.data), event.data);
expression = (_a = action.expression) !== null && _a !== void 0 ? _a : action.execOn;
expression = (_b = action.expression) !== null && _b !== void 0 ? _b : action.execOn;
isStop = false;

@@ -212,4 +212,4 @@ if (!expression) return [3 /*break*/, 2];

case 1:
isStop = !(_v.sent());
_v.label = 2;
isStop = !(_w.sent());
_w.label = 2;
case 2:

@@ -223,4 +223,4 @@ if (isStop) {

case 3:
preventDefault = _v.sent();
_v.label = 4;
preventDefault = _w.sent();
_w.label = 4;
case 4:

@@ -233,21 +233,21 @@ key = {

if (action.actionType === 'dialog') {
action.dialog = __assign({}, ((_b = action.dialog) !== null && _b !== void 0 ? _b : (_c = action.args) === null || _c === void 0 ? void 0 : _c.dialog));
(_d = action.args) === null || _d === void 0 ? true : delete _d.dialog;
action.dialog = __assign({}, ((_c = action.dialog) !== null && _c !== void 0 ? _c : (_d = action.args) === null || _d === void 0 ? void 0 : _d.dialog));
(_e = action.args) === null || _e === void 0 ? true : delete _e.dialog;
}
else if (action.actionType === 'drawer') {
action.drawer = __assign({}, ((_e = action.drawer) !== null && _e !== void 0 ? _e : (_f = action.args) === null || _f === void 0 ? void 0 : _f.drawer));
(_g = action.args) === null || _g === void 0 ? true : delete _g.drawer;
action.drawer = __assign({}, ((_f = action.drawer) !== null && _f !== void 0 ? _f : (_g = action.args) === null || _g === void 0 ? void 0 : _g.drawer));
(_h = action.args) === null || _h === void 0 ? true : delete _h.drawer;
}
else if (['ajax', 'download'].includes(action.actionType)) {
api = (_h = action.api) !== null && _h !== void 0 ? _h : (_j = action.args) === null || _j === void 0 ? void 0 : _j.api;
api = (_j = action.api) !== null && _j !== void 0 ? _j : (_k = action.args) === null || _k === void 0 ? void 0 : _k.api;
action.api = typeof api === 'string' ? api : __assign({}, api);
action.options = __assign({}, ((_k = action.options) !== null && _k !== void 0 ? _k : (_l = action.args) === null || _l === void 0 ? void 0 : _l.options));
action.messages = __assign({}, ((_m = action.messages) !== null && _m !== void 0 ? _m : (_o = action.args) === null || _o === void 0 ? void 0 : _o.messages));
(_p = action.args) === null || _p === void 0 ? true : delete _p.api;
(_q = action.args) === null || _q === void 0 ? true : delete _q.options;
(_r = action.args) === null || _r === void 0 ? true : delete _r.messages;
action.options = __assign({}, ((_l = action.options) !== null && _l !== void 0 ? _l : (_m = action.args) === null || _m === void 0 ? void 0 : _m.options));
action.messages = __assign({}, ((_o = action.messages) !== null && _o !== void 0 ? _o : (_p = action.args) === null || _p === void 0 ? void 0 : _p.messages));
(_q = action.args) === null || _q === void 0 ? true : delete _q.api;
(_r = action.args) === null || _r === void 0 ? true : delete _r.options;
(_s = action.args) === null || _s === void 0 ? true : delete _s.messages;
}
cmptFlag = key.componentId || key.componentName;
targetComponent = cmptFlag
? (_s = event.context.scoped) === null || _s === void 0 ? void 0 : _s[action.componentId ? 'getComponentById' : 'getComponentByName'](cmptFlag)
? (_t = event.context.scoped) === null || _t === void 0 ? void 0 : _t[action.componentId ? 'getComponentById' : 'getComponentByName'](cmptFlag)
: renderer;

@@ -260,3 +260,7 @@ args = dataMapping(action.args, mergeData, function (key) {

var cmptIgnoreMap = {
'input-table': ['condition']
'input-table': ['condition'],
'table': ['condition'],
'table2': ['condition'],
'crud': ['condition'],
'combo': ['condition']
};

@@ -276,3 +280,3 @@ var curCmptType = (_a = targetComponent === null || targetComponent === void 0 ? void 0 : targetComponent.props) === null || _a === void 0 ? void 0 : _a.type;

: mergeData;
(_t = console.group) === null || _t === void 0 ? void 0 : _t.call(console, "run action ".concat(action.actionType));
(_u = console.group) === null || _u === void 0 ? void 0 : _u.call(console, "run action ".concat(action.actionType));
console.debug("[".concat(action.actionType, "] action args, data"), args, data);

@@ -282,3 +286,3 @@ stopped = false;

case 5:
actionResult = _v.sent();
actionResult = _w.sent();
// 二次确认弹窗如果取消,则终止后续动作

@@ -293,7 +297,7 @@ if ((action === null || action === void 0 ? void 0 : action.actionType) === 'confirmDialog' && !actionResult) {

case 6:
stopPropagation = _v.sent();
_v.label = 7;
stopPropagation = _w.sent();
_w.label = 7;
case 7:
console.debug("[".concat(action.actionType, "] action end event"), event);
(_u = console.groupEnd) === null || _u === void 0 ? void 0 : _u.call(console);
(_v = console.groupEnd) === null || _v === void 0 ? void 0 : _v.call(console);
// 阻止原有动作执行

@@ -300,0 +304,0 @@ preventDefault && event.preventDefault();

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -9,2 +9,3 @@ */

import { registerAction } from './Action.js';
import { getRendererByName } from '../factory.js';
import { createObject } from '../utils/object.js';

@@ -23,8 +24,8 @@

CmptAction.prototype.run = function (action, renderer, event) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
return __awaiter(this, void 0, void 0, function () {
var key, dataMergeMode, path, beforeSetData, res, component, msg, result, e_1;
var _t, _u;
return __generator(this, function (_v) {
switch (_v.label) {
var key, dataMergeMode, path, beforeSetData, res, component, msg, _5, dispatchEvent_1, data, valid, e_1, result, e_2;
var _6, _7, _8, _9, _10;
return __generator(this, function (_11) {
switch (_11.label) {
case 0:

@@ -39,7 +40,7 @@ key = action.componentId || action.componentName;

case 1:
res = _v.sent();
res = _11.sent();
if (res === false) {
return [2 /*return*/];
}
_v.label = 2;
_11.label = 2;
case 2:

@@ -71,29 +72,67 @@ component = key

}
_v.label = 3;
if (!(action.actionType === 'validateFormItem' &&
((_o = getRendererByName((_m = component === null || component === void 0 ? void 0 : component.props) === null || _m === void 0 ? void 0 : _m.type)) === null || _o === void 0 ? void 0 : _o.isFormItem))) return [3 /*break*/, 7];
_5 = (component === null || component === void 0 ? void 0 : component.props) || {}, dispatchEvent_1 = _5.dispatchEvent, data = _5.data;
_11.label = 3;
case 3:
_v.trys.push([3, 5, , 6]);
return [4 /*yield*/, ((_m = component === null || component === void 0 ? void 0 : component.doAction) === null || _m === void 0 ? void 0 : _m.call(component, action, action.args, true))];
_11.trys.push([3, 5, , 6]);
return [4 /*yield*/, ((_q = component === null || component === void 0 ? void 0 : (_p = component.props).onValidate) === null || _q === void 0 ? void 0 : _q.call(_p))];
case 4:
result = _v.sent();
valid = _11.sent();
if (valid) {
event.setData(createObject(event.data, (_6 = {},
_6[action.outputVar || "".concat(action.actionType, "Result")] = {
error: '',
value: (_s = (_r = component === null || component === void 0 ? void 0 : component.props) === null || _r === void 0 ? void 0 : _r.formItem) === null || _s === void 0 ? void 0 : _s.value
},
_6)));
dispatchEvent_1 && dispatchEvent_1('formItemValidateSucc', data);
}
else {
event.setData(createObject(event.data, (_7 = {},
_7[action.outputVar || "".concat(action.actionType, "Result")] = {
error: (((_u = (_t = component === null || component === void 0 ? void 0 : component.props) === null || _t === void 0 ? void 0 : _t.formItem) === null || _u === void 0 ? void 0 : _u.errors) || []).join(','),
value: (_w = (_v = component === null || component === void 0 ? void 0 : component.props) === null || _v === void 0 ? void 0 : _v.formItem) === null || _w === void 0 ? void 0 : _w.value
},
_7)));
dispatchEvent_1 && dispatchEvent_1('formItemValidateError', data);
}
return [3 /*break*/, 6];
case 5:
e_1 = _11.sent();
event.setData(createObject(event.data, (_8 = {},
_8[action.outputVar || "".concat(action.actionType, "Result")] = {
error: e_1.message || '未知错误',
value: (_y = (_x = component === null || component === void 0 ? void 0 : component.props) === null || _x === void 0 ? void 0 : _x.formItem) === null || _y === void 0 ? void 0 : _y.value
},
_8)));
dispatchEvent_1 && dispatchEvent_1('formItemValidateError', data);
return [3 /*break*/, 6];
case 6: return [2 /*return*/];
case 7:
_11.trys.push([7, 9, , 10]);
return [4 /*yield*/, ((_z = component === null || component === void 0 ? void 0 : component.doAction) === null || _z === void 0 ? void 0 : _z.call(component, action, action.args, true))];
case 8:
result = _11.sent();
if (['validate', 'submit'].includes(action.actionType)) {
event.setData(createObject(event.data, (_t = {},
_t[action.outputVar || "".concat(action.actionType, "Result")] = {
event.setData(createObject(event.data, (_9 = {},
_9[action.outputVar || "".concat(action.actionType, "Result")] = {
error: '',
payload: (_o = result === null || result === void 0 ? void 0 : result.__payload) !== null && _o !== void 0 ? _o : (_q = (_p = component === null || component === void 0 ? void 0 : component.props) === null || _p === void 0 ? void 0 : _p.store) === null || _q === void 0 ? void 0 : _q.data,
payload: (_0 = result === null || result === void 0 ? void 0 : result.__payload) !== null && _0 !== void 0 ? _0 : (_2 = (_1 = component === null || component === void 0 ? void 0 : component.props) === null || _1 === void 0 ? void 0 : _1.store) === null || _2 === void 0 ? void 0 : _2.data,
responseData: result === null || result === void 0 ? void 0 : result.__response
},
_t)));
_9)));
}
return [2 /*return*/, result];
case 5:
e_1 = _v.sent();
event.setData(createObject(event.data, (_u = {},
_u[action.outputVar || "".concat(action.actionType, "Result")] = {
error: e_1.message,
errors: e_1.name === 'ValidateError' ? e_1.detail : e_1,
payload: (_s = (_r = component === null || component === void 0 ? void 0 : component.props) === null || _r === void 0 ? void 0 : _r.store) === null || _s === void 0 ? void 0 : _s.data
case 9:
e_2 = _11.sent();
event.setData(createObject(event.data, (_10 = {},
_10[action.outputVar || "".concat(action.actionType, "Result")] = {
error: e_2.message,
errors: e_2.name === 'ValidateError' ? e_2.detail : e_2,
payload: (_4 = (_3 = component === null || component === void 0 ? void 0 : component.props) === null || _3 === void 0 ? void 0 : _3.store) === null || _4 === void 0 ? void 0 : _4.data
},
_u)));
return [3 /*break*/, 6];
case 6: return [2 /*return*/];
_10)));
return [3 /*break*/, 10];
case 10: return [2 /*return*/];
}

@@ -100,0 +139,0 @@ });

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -8,7 +8,8 @@ */

import { str2AsyncFunction } from '../utils/api.js';
import '../utils/browser.js';
import '../utils/ColorScale.js';
import 'react';
import 'lodash/chunk';
import 'lodash/isPlainObject';
import 'amis-formula';
import 'lodash/isPlainObject';
import '../utils/DataSchema.js';

@@ -15,0 +16,0 @@ import '../utils/DataScope.js';

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -12,6 +12,7 @@ */

import '../utils/api.js';
import '../utils/browser.js';
import '../utils/ColorScale.js';
import 'lodash/chunk';
import 'lodash/isPlainObject';
import 'amis-formula';
import 'lodash/isPlainObject';
import '../utils/DataSchema.js';

@@ -18,0 +19,0 @@ import '../utils/DataScope.js';

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -11,6 +11,7 @@ */

import '../utils/api.js';
import '../utils/browser.js';
import '../utils/ColorScale.js';
import 'lodash/chunk';
import 'lodash/isPlainObject';
import 'amis-formula';
import 'lodash/isPlainObject';
import '../utils/DataSchema.js';

@@ -17,0 +18,0 @@ import '../utils/DataScope.js';

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -16,4 +16,6 @@ */

export { autobindMethod, bind } from './utils/autobind.js';
export { chromeVersion } from './utils/browser.js';
export { ColorScale } from './utils/ColorScale.js';
export { columnsSplit } from './utils/columnsSplit.js';
export { concatData } from './utils/concatData.js';
export { dataMapping, resolveMapping, resolveMappingObject } from './utils/dataMapping.js';

@@ -145,3 +147,3 @@ export { DataSchema } from './utils/DataSchema.js';

// @ts-ignore
var version = '3.6.3';
var version = '6.0.0';
function render(schema, props, options, pathPrefix) {

@@ -148,0 +150,0 @@ if (props === void 0) { props = {}; }

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -18,4 +18,7 @@ */

import { findDOMNode } from 'react-dom';
import '../utils/browser.js';
import '../utils/ColorScale.js';
import 'lodash/chunk';
import { getVariable } from '../utils/getVariable.js';
import { createObject } from '../utils/object.js';
import { dataMapping } from '../utils/dataMapping.js';

@@ -25,3 +28,2 @@ import '../utils/DataSchema.js';

import 'moment';
import { createObject } from '../utils/object.js';
import 'amis-formula';

@@ -36,3 +38,2 @@ import '../utils/debug.js';

import 'lodash/isBoolean';
import { getVariable } from '../utils/getVariable.js';
import '../utils/image.js';

@@ -39,0 +40,0 @@ import 'lodash/isEqual';

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -26,2 +26,3 @@ */

import { optionValueCompare } from '../utils/optionValueCompare.js';
import '../utils/browser.js';
import '../utils/ColorScale.js';

@@ -148,3 +149,3 @@ import 'lodash/chunk';

var formItem = props.formItem;
if (prevProps.options !== props.options && formItem) {
if (!props.source && prevProps.options !== props.options && formItem) {
formItem.setOptions(normalizeOptions(props.options || [], undefined, props.valueField), this.changeOptionValue, props.data);

@@ -183,3 +184,4 @@ this.normalizeValue();

};
FormOptionsItem.prototype.dispatchOptionEvent = function (eventName, eventData) {
// 不推荐使用,缺少组件值
FormOptionsItem.prototype.oldDispatchOptionEvent = function (eventName, eventData) {
if (eventData === void 0) { eventData = ''; }

@@ -202,2 +204,19 @@ return __awaiter(this, void 0, void 0, function () {

};
FormOptionsItem.prototype.dispatchOptionEvent = function (eventName, eventData) {
if (eventData === void 0) { eventData = ''; }
return __awaiter(this, void 0, void 0, function () {
var _a, dispatchEvent, options, value, rendererEvent;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = this.props, dispatchEvent = _a.dispatchEvent, options = _a.options, value = _a.value;
return [4 /*yield*/, dispatchEvent(eventName, resolveEventData(this.props, __assign({ value: value, options: options, items: options }, eventData)))];
case 1:
rendererEvent = _b.sent();
// 返回阻塞标识
return [2 /*return*/, !!(rendererEvent === null || rendererEvent === void 0 ? void 0 : rendererEvent.prevented)];
}
});
});
};
FormOptionsItem.prototype.doAction = function (action, data, throwErrors) {

@@ -288,3 +307,5 @@ var _a = this.props, resetValue = _a.resetValue, onChange = _a.onChange;

newValue = this.toggleValue(option, value);
return [4 /*yield*/, this.dispatchOptionEvent('change', newValue)];
return [4 /*yield*/, this.dispatchOptionEvent('change', {
value: newValue
})];
case 1:

@@ -360,3 +381,5 @@ isPrevented = _b.sent();

newValue = this.formatValueArray(valueArray);
return [4 /*yield*/, this.dispatchOptionEvent('change', newValue)];
return [4 /*yield*/, this.dispatchOptionEvent('change', {
value: newValue
})];
case 1:

@@ -444,3 +467,6 @@ isPrevented = _b.sent();

// 触发事件通知,加载完成
this.dispatchOptionEvent('loadFinished', json);
// 废弃,不推荐使用
this.oldDispatchOptionEvent('loadFinished', json);
// 避免产生breakchange,增加新事件名,用来更正之前的设计问题
this.dispatchOptionEvent('deferLoadFinished', { result: json });
return [2 /*return*/];

@@ -527,4 +553,5 @@ }

return __awaiter(this, void 0, void 0, function () {
var _c, addControls, addDialog, disabled, labelField, onOpenDialog, optionLabel, addApi, source, data, valueField, deferField, model, createBtnLabel, env, __, parent, ctx, result, _d, payload, e_1, isPrevented, options;
var _c, addControls, addDialog, disabled, labelField, onOpenDialog, optionLabel, addApi, source, data, valueField, deferField, model, createBtnLabel, env, __, parent, ctx, customAddPrevent, result, _d, prevent, payload, e_1, isPrevented, options;
var _e;
var _this = this;
return __generator(this, function (_f) {

@@ -555,2 +582,3 @@ switch (_f.label) {

? __assign({ parent: parent }, value) : value);
customAddPrevent = false;
if (!skipForm) return [3 /*break*/, 1];

@@ -573,3 +601,25 @@ _d = ctx;

}
], __read((addControls || [])), false)
], __read((addControls || [])), false),
onSubmit: function (payload) { return __awaiter(_this, void 0, void 0, function () {
var labelKey, valueKey;
var _a;
var _b;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
labelKey = labelField || 'label';
valueKey = valueField || 'value';
return [4 /*yield*/, this.dispatchOptionEvent('addConfirm', {
item: (_a = {},
_a[labelKey] = payload[labelKey],
_a[valueKey] = (_b = payload[valueKey]) !== null && _b !== void 0 ? _b : payload[labelKey],
_a)
})];
case 1:
// 派发确认添加事件
customAddPrevent = _c.sent();
return [2 /*return*/, !customAddPrevent];
}
});
}); }
} }), ctx)];

@@ -581,10 +631,26 @@ case 2:

result = _d;
if (!(skipForm && addApi)) return [3 /*break*/, 7];
_f.label = 4;
if (!skipForm) return [3 /*break*/, 5];
return [4 /*yield*/, this.dispatchOptionEvent('addConfirm', {
item: result
})];
case 4:
_f.trys.push([4, 6, , 7]);
prevent = _f.sent();
if (prevent) {
return [2 /*return*/];
}
return [3 /*break*/, 6];
case 5:
if (customAddPrevent) {
return [2 /*return*/];
}
_f.label = 6;
case 6:
if (!(skipForm && addApi)) return [3 /*break*/, 10];
_f.label = 7;
case 7:
_f.trys.push([7, 9, , 10]);
return [4 /*yield*/, env.fetcher(addApi, result, {
method: 'post'
})];
case 5:
case 8:
payload = _f.sent();

@@ -599,4 +665,4 @@ if (!payload.ok) {

}
return [3 /*break*/, 7];
case 6:
return [3 /*break*/, 10];
case 9:
e_1 = _f.sent();

@@ -606,4 +672,4 @@ result = null;

!addApi.silent && env.notify('error', e_1.message);
return [3 /*break*/, 7];
case 7:
return [3 /*break*/, 10];
case 10:
// 有 result 说明弹框点了确认。否则就是取消了。

@@ -617,4 +683,4 @@ if (!result) {

}
return [4 /*yield*/, this.dispatchOptionEvent('add', __assign(__assign({}, result), { idx: idx }))];
case 8:
return [4 /*yield*/, this.oldDispatchOptionEvent('add', __assign(__assign({}, result), { idx: idx }))];
case 11:
isPrevented = _f.sent();

@@ -625,8 +691,8 @@ if (isPrevented) {

if (!(((parent === null || parent === void 0 ? void 0 : parent.hasOwnProperty(deferField)) && parent[deferField]) ||
(parent === null || parent === void 0 ? void 0 : parent.defer))) return [3 /*break*/, 10];
(parent === null || parent === void 0 ? void 0 : parent.defer))) return [3 /*break*/, 13];
return [4 /*yield*/, this.deferLoad(parent)];
case 9:
case 12:
_f.sent();
return [3 /*break*/, 11];
case 10:
return [3 /*break*/, 14];
case 13:
if (source && addApi) {

@@ -649,4 +715,4 @@ // 如果配置了 source 且配置了 addApi 直接重新拉取接口就够了

}
_f.label = 11;
case 11: return [2 /*return*/];
_f.label = 14;
case 14: return [2 /*return*/];
}

@@ -661,7 +727,8 @@ });

return __awaiter(this, void 0, void 0, function () {
var _c, editControls, editDialog, disabled, labelField, onOpenDialog, editApi, editInitApi, env, source, data, model, optionLabel, __, result, _d, payload, e_2, isPrevented, indexes;
var _c, editControls, editDialog, disabled, labelField, valueField, onOpenDialog, editApi, editInitApi, env, source, data, model, optionLabel, __, customEditPrevent, result, _d, prevent, payload, e_2, isPrevented, indexes;
var _this = this;
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
_c = this.props, editControls = _c.editControls, editDialog = _c.editDialog, disabled = _c.disabled, labelField = _c.labelField, onOpenDialog = _c.onOpenDialog, editApi = _c.editApi, editInitApi = _c.editInitApi, env = _c.env, source = _c.source, data = _c.data, model = _c.formItem, optionLabel = _c.optionLabel, __ = _c.translate;
_c = this.props, editControls = _c.editControls, editDialog = _c.editDialog, disabled = _c.disabled, labelField = _c.labelField, valueField = _c.valueField, onOpenDialog = _c.onOpenDialog, editApi = _c.editApi, editInitApi = _c.editInitApi, env = _c.env, source = _c.source, data = _c.data, model = _c.formItem, optionLabel = _c.optionLabel, __ = _c.translate;
if (disabled || !model) {

@@ -680,2 +747,3 @@ return [2 /*return*/];

}
customEditPrevent = false;
if (!skipForm) return [3 /*break*/, 1];

@@ -690,3 +758,25 @@ _d = value;

api: editApi,
controls: editControls
controls: editControls,
onSubmit: function (payload) { return __awaiter(_this, void 0, void 0, function () {
var labelKey, valueKey;
var _a;
var _b;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
labelKey = labelField || 'label';
valueKey = valueField || 'value';
return [4 /*yield*/, this.dispatchOptionEvent('editConfirm', {
item: (_a = {},
_a[labelKey] = payload[labelKey],
_a[valueKey] = (_b = payload[valueKey]) !== null && _b !== void 0 ? _b : payload[labelKey],
_a)
})];
case 1:
// 避免产生breakchange,增加新事件名,用来更正之前的设计问题
customEditPrevent = _c.sent();
return [2 /*return*/, !customEditPrevent];
}
});
}); }
} }), createObject(data, value))];

@@ -698,10 +788,26 @@ case 2:

result = _d;
if (!(skipForm && editApi)) return [3 /*break*/, 7];
_e.label = 4;
if (!skipForm) return [3 /*break*/, 5];
return [4 /*yield*/, this.dispatchOptionEvent('editConfirm', {
item: result
})];
case 4:
_e.trys.push([4, 6, , 7]);
prevent = _e.sent();
if (prevent) {
return [2 /*return*/];
}
return [3 /*break*/, 6];
case 5:
if (customEditPrevent) {
return [2 /*return*/];
}
_e.label = 6;
case 6:
if (!(skipForm && editApi)) return [3 /*break*/, 10];
_e.label = 7;
case 7:
_e.trys.push([7, 9, , 10]);
return [4 /*yield*/, env.fetcher(editApi, createObject(data, result), {
method: 'post'
})];
case 5:
case 8:
payload = _e.sent();

@@ -716,4 +822,4 @@ if (!payload.ok) {

}
return [3 /*break*/, 7];
case 6:
return [3 /*break*/, 10];
case 9:
e_2 = _e.sent();

@@ -723,4 +829,4 @@ result = null;

!editApi.silent && env.notify('error', e_2.message);
return [3 /*break*/, 7];
case 7:
return [3 /*break*/, 10];
case 10:
// 没有结果,说明取消了。

@@ -730,4 +836,4 @@ if (!result) {

}
return [4 /*yield*/, this.dispatchOptionEvent('edit', result)];
case 8:
return [4 /*yield*/, this.oldDispatchOptionEvent('edit', result)];
case 11:
isPrevented = _e.sent();

@@ -754,3 +860,3 @@ if (isPrevented) {

return __awaiter(this, void 0, void 0, function () {
var _c, deleteConfirmText, disabled, data, deleteApi, onDelete, env, model, source, valueField, __, ctx, confirmed, _d, isPrevented, result, options, indexes, e_3;
var _c, deleteConfirmText, disabled, data, deleteApi, onDelete, env, model, source, valueField, __, ctx, confirmed, _d, isPrevented, delConfirmPrevent, result, options, indexes, e_3;
return __generator(this, function (_e) {

@@ -777,3 +883,3 @@ switch (_e.label) {

}
return [4 /*yield*/, this.dispatchOptionEvent('delete', ctx)];
return [4 /*yield*/, this.oldDispatchOptionEvent('delete', ctx)];
case 4:

@@ -784,10 +890,18 @@ isPrevented = _e.sent();

}
_e.label = 5;
return [4 /*yield*/, this.dispatchOptionEvent('deleteConfirm', {
item: value
})];
case 5:
_e.trys.push([5, 8, , 9]);
if (!deleteApi) return [3 /*break*/, 7];
delConfirmPrevent = _e.sent();
if (delConfirmPrevent) {
return [2 /*return*/];
}
_e.label = 6;
case 6:
_e.trys.push([6, 9, , 10]);
if (!deleteApi) return [3 /*break*/, 8];
return [4 /*yield*/, env.fetcher(deleteApi, ctx, {
method: 'delete'
})];
case 6:
case 7:
result = _e.sent();

@@ -799,4 +913,4 @@ if (!result.ok) {

}
_e.label = 7;
case 7:
_e.label = 8;
case 8:
// 由外部代码实现删除逻辑

@@ -816,9 +930,9 @@ if (onDelete) {

}
return [3 /*break*/, 9];
case 8:
return [3 /*break*/, 10];
case 9:
e_3 = _e.sent();
console.error(e_3);
!deleteApi.silent && env.notify('error', e_3.message);
return [3 /*break*/, 9];
case 9: return [2 /*return*/];
return [3 /*break*/, 10];
case 10: return [2 /*return*/];
}

@@ -825,0 +939,0 @@ });

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -22,8 +22,9 @@ */

import { callStrFunction } from '../utils/api.js';
import '../utils/browser.js';
import '../utils/ColorScale.js';
import 'lodash/chunk';
import { getVariable } from '../utils/getVariable.js';
import 'lodash/isPlainObject';
import 'amis-formula';
import { tokenize } from '../utils/tokenize.js';
import 'lodash/isPlainObject';
import { getVariable } from '../utils/getVariable.js';
import '../utils/DataSchema.js';

@@ -30,0 +31,0 @@ import '../utils/DataScope.js';

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -20,2 +20,3 @@ */

import './utils/api.js';
import './utils/browser.js';
import './utils/ColorScale.js';

@@ -22,0 +23,0 @@ import 'lodash/chunk';

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -55,3 +55,3 @@ import { Instance, SnapshotIn } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -73,3 +73,3 @@ setCurrentAction(action: object): void;

fetchData: (api: import("../types").Api, data?: object | undefined, options?: import("../types").fetchOptions | undefined) => Promise<any>;
reInitData: (data: object | undefined, replace?: boolean) => void;
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
updateMessage: (msg?: string | undefined, error?: boolean) => void;

@@ -76,0 +76,0 @@ clearMessage: () => void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -11,8 +11,9 @@ */

import '../utils/api.js';
import '../utils/browser.js';
import '../utils/ColorScale.js';
import 'react';
import 'lodash/chunk';
import { createObject } from '../utils/object.js';
import 'amis-formula';
import 'lodash/isPlainObject';
import { createObject } from '../utils/object.js';
import '../utils/DataSchema.js';

@@ -19,0 +20,0 @@ import '../utils/DataScope.js';

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -80,3 +80,3 @@ import { Instance } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -98,3 +98,3 @@ setCurrentAction(action: object): void;

fetchData: (api: Api, data?: object | undefined, options?: fetchOptions | undefined) => Promise<any>;
reInitData: (data: object | undefined, replace?: boolean) => void;
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
updateMessage: (msg?: string | undefined, error?: boolean) => void;

@@ -154,4 +154,5 @@ clearMessage: () => void;

updateTotal: (total: number) => void;
resetSelection: () => void;
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
export type ICRUDStore = Instance<typeof CRUDStore>;
export {};
/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -22,2 +22,3 @@ */

import { filter } from '../utils/tpl.js';
import { TableStore } from './table.js';

@@ -322,3 +323,3 @@ var ServerError = /** @class */ (function (_super) {

self.items.replace(rowsData);
self.reInitData(data_2, !!api.replaceData);
self.reInitData(data_2, !!api.replaceData, api.concatDataFields);
options.syncResponse2Query !== false &&

@@ -388,3 +389,3 @@ updateQuery(pick(rest, Object.keys(self.query)), undefined, options.pageField || 'page', options.perPageField || 'perPage');

__saved: Date.now()
}, !!api && api.replaceData);
}, !!api && api.replaceData, api === null || api === void 0 ? void 0 : api.concatDataFields);
self.updatedAt = Date.now();

@@ -608,2 +609,14 @@ }

};
/** 非Picker模式下,重置当前CRUD的所有的已选择项目 */
var resetSelection = function () {
var _a, _b, _c, _d;
// 初始化CRUD记录的已选择项目和未选择项目
setSelectedItems([]);
setUnSelectedItems([]);
var tableStore = (_b = (_a = self === null || self === void 0 ? void 0 : self.children) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, function (s) { return s.storeType === TableStore.name; });
if (tableStore) {
// 清空Table记录的已选择项目
(_d = (_c = tableStore).clear) === null || _d === void 0 ? void 0 : _d.call(_c);
}
};
return {

@@ -627,3 +640,4 @@ getData: getData,

updateColumns: updateColumns,
updateTotal: updateTotal
updateTotal: updateTotal,
resetSelection: resetSelection
};

@@ -630,0 +644,0 @@ });

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -134,4 +134,4 @@ */

.actions(function (self) {
function setValues(values, tag, replace) {
self.updateData(values, tag, replace);
function setValues(values, tag, replace, concatFields) {
self.updateData(values, tag, replace, concatFields);
// 如果数据域中有数据变化,就都reset一下,去掉之前残留的验证消息

@@ -305,3 +305,3 @@ self.items.forEach(function (item) {

}
: undefined, !!api.replaceData);
: undefined, !!api.replaceData, api.concatDataFields);
}

@@ -441,3 +441,3 @@ if (!!json.ok) return [3 /*break*/, 6];

_a.trys.push([1, , 5, 6]);
return [4 /*yield*/, validate(hooks, undefined, true, failedMessage, validateErrCb)];
return [4 /*yield*/, validate(hooks, true, true, failedMessage, validateErrCb)];
case 2:

@@ -444,0 +444,0 @@ _a.sent();

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -39,3 +39,3 @@ import { Instance, SnapshotIn } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object, replace?: boolean): void;
updateData(data?: object, tag?: object, replace?: boolean, concatFields?: string | string[]): void;
changeValue(name: string, value: any, changePristine?: boolean, force?: boolean, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -42,0 +42,0 @@ setCurrentAction(action: object): void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -18,5 +18,7 @@ */

import '../utils/api.js';
import '../utils/browser.js';
import '../utils/ColorScale.js';
import 'react';
import 'lodash/chunk';
import { concatData } from '../utils/concatData.js';
import '../utils/DataSchema.js';

@@ -92,4 +94,7 @@ import '../utils/DataScope.js';

},
updateData: function (data, tag, replace) {
updateData: function (data, tag, replace, concatFields) {
if (data === void 0) { data = {}; }
if (concatFields) {
data = concatData(data, self.data, concatFields);
}
var prev = self.data;

@@ -96,0 +101,0 @@ var newData;

@@ -106,3 +106,3 @@ import { SnapshotIn, Instance } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -109,0 +109,0 @@ setCurrentAction(action: object): void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -9,3 +9,2 @@ */

import isEqual from 'lodash/isEqual';
import find from 'lodash/find';
import { immutableExtends, guid } from '../utils/helper.js';

@@ -170,15 +169,21 @@ import { evalExpression } from '../utils/tpl.js';

self.selectedItems.clear();
self.items.forEach(function (item) {
if (~selected.indexOf(item.pristine)) {
self.selectedItems.push(item);
selected.forEach(function (item) {
var resolved = self.items.find(function (a) { return a.pristine === item; });
// 先严格比较,
if (!resolved) {
resolved = self.items.find(function (a) {
var selectValue = item[valueField || 'value'];
var itemValue = a.pristine[valueField || 'value'];
return selectValue === itemValue;
});
}
else if (find(selected, function (a) {
var selectValue = a[valueField || 'value'];
var itemValue = item.pristine[valueField || 'value'];
return self.strictMode
? selectValue === itemValue
: selectValue == itemValue;
})) {
self.selectedItems.push(item);
// 再宽松比较
if (!resolved) {
resolved = self.items.find(function (a) {
var selectValue = item[valueField || 'value'];
var itemValue = a.pristine[valueField || 'value'];
return selectValue == itemValue;
});
}
resolved && self.selectedItems.push(resolved);
});

@@ -185,0 +190,0 @@ }

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -53,3 +53,3 @@ import { SnapshotIn, Instance } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -71,3 +71,3 @@ setCurrentAction(action: object): void;

fetchData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
reInitData: (data: object | undefined, replace?: boolean) => void;
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
updateMessage: (msg?: string | undefined, error?: boolean) => void;

@@ -74,0 +74,0 @@ clearMessage: () => void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -26,2 +26,3 @@ import { Instance, SnapshotIn } from 'mobx-state-tree';

mode: import("mobx-state-tree").IType<string | undefined, string, string>;
ellipsisPageGap: import("mobx-state-tree").IType<number | undefined, number, number>;
}, {

@@ -45,3 +46,3 @@ readonly parentStore: any;

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -48,0 +49,0 @@ setCurrentAction(action: object): void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -23,3 +23,4 @@ */

outputName: '',
mode: 'normal'
mode: 'normal',
ellipsisPageGap: 5
})

@@ -26,0 +27,0 @@ .views(function (self) { return ({

@@ -52,3 +52,3 @@ import { Instance } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -70,3 +70,3 @@ setCurrentAction(action: object): void;

fetchData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
reInitData: (data: object | undefined, replace?: boolean) => void;
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
updateMessage: (msg?: string | undefined, error?: boolean) => void;

@@ -73,0 +73,0 @@ clearMessage: () => void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -11,8 +11,9 @@ */

import '../utils/api.js';
import '../utils/browser.js';
import '../utils/ColorScale.js';
import 'react';
import 'lodash/chunk';
import { extractObjectChain, createObjectFromChain } from '../utils/object.js';
import 'amis-formula';
import 'lodash/isPlainObject';
import { extractObjectChain, createObjectFromChain } from '../utils/object.js';
import '../utils/DataSchema.js';

@@ -19,0 +20,0 @@ import '../utils/DataScope.js';

@@ -49,3 +49,3 @@ import { Instance } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -67,3 +67,3 @@ setCurrentAction(action: object): void;

fetchData: (api: Api, data?: object, options?: fetchOptions) => Promise<any>;
reInitData: (data: object | undefined, replace?: boolean) => void;
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[]) => void;
updateMessage: (msg?: string, error?: boolean) => void;

@@ -70,0 +70,0 @@ clearMessage: () => void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -13,2 +13,3 @@ */

import { replaceText } from '../utils/replaceText.js';
import { concatData } from '../utils/concatData.js';
import { isObject, extendObject } from '../utils/object.js';

@@ -49,4 +50,7 @@

}
function reInitData(data, replace) {
function reInitData(data, replace, concatFields) {
if (replace === void 0) { replace = false; }
if (concatFields) {
data = concatData(data, self.data, concatFields);
}
var newData = extendObject(self.pristine, data, !replace);

@@ -97,3 +101,3 @@ self.data = self.pristine = newData;

data_1 = __assign(__assign({}, (replace ? {} : self.data)), normalizeApiResponseData(json.data));
reInitData(data_1, replace);
reInitData(data_1, replace, api.concatDataFields);
self.hasRemoteData = true;

@@ -164,3 +168,3 @@ if (!(options && options.onSuccess)) return [3 /*break*/, 4];

json.data &&
self.updateData(normalizeApiResponseData(json.data), undefined, !!api.replaceData);
self.updateData(normalizeApiResponseData(json.data), undefined, !!api.replaceData, api.concatDataFields);
self.hasRemoteData = true;

@@ -236,3 +240,3 @@ }

json.data &&
self.updateData(normalizeApiResponseData(json.data), undefined, !!api.replaceData);
self.updateData(normalizeApiResponseData(json.data), undefined, !!api.replaceData, api.concatDataFields);
}

@@ -351,3 +355,3 @@ if (!!json.ok) return [3 /*break*/, 4];

isObject(json.data.data) &&
self.updateData(json.data.data, undefined, !!api.replaceData);
self.updateData(json.data.data, undefined, !!api.replaceData, api.concatDataFields);
}

@@ -399,3 +403,3 @@ updateMessage((_h = (_g = (_f = api === null || api === void 0 ? void 0 : api.messages) === null || _f === void 0 ? void 0 : _f.success) !== null && _g !== void 0 ? _g : json.msg) !== null && _h !== void 0 ? _h : (options && options.successMessage));

json.ok &&
self.updateData(json.data, undefined, !!api.replaceData);
self.updateData(json.data, undefined, !!api.replaceData, api.concatDataFields);
if (!json.ok) {

@@ -402,0 +406,0 @@ throw new Error(json.msg);

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -17,3 +17,2 @@ */

import isEqual from 'lodash/isEqual';
import find from 'lodash/find';
import sortBy from 'lodash/sortBy';

@@ -868,2 +867,3 @@ import { immutableExtends, flattenTree, findTree, eachTree, guid, isVisible, hasVisibleExpression, isBreakpoint, difference, sortArray } from '../utils/helper.js';

var originColumns_1 = self.columns.concat();
var ids_1 = [];
columns = columns.map(function (item, index) {

@@ -873,3 +873,9 @@ var origin = item.id

: originColumns_1[index];
return __assign(__assign({}, item), { id: (origin === null || origin === void 0 ? void 0 : origin.id) || guid(), index: index, width: (origin === null || origin === void 0 ? void 0 : origin.width) || 0, minWidth: (origin === null || origin === void 0 ? void 0 : origin.minWidth) || 0, realWidth: (origin === null || origin === void 0 ? void 0 : origin.realWidth) || 0, rawIndex: index - PARTITION_INDEX, type: item.type || 'plain', pristine: item.pristine || item, toggled: item.toggled !== false, breakpoint: item.breakpoint, isPrimary: index === PARTITION_INDEX });
var id = (origin === null || origin === void 0 ? void 0 : origin.id) || guid();
// 还不知道为何会出现这个,先用这种方式避免 id 重复
if (ids_1.includes(id)) {
id = guid();
}
ids_1.push(id);
return __assign(__assign({}, item), { id: id, index: index, width: (origin === null || origin === void 0 ? void 0 : origin.width) || 0, minWidth: (origin === null || origin === void 0 ? void 0 : origin.minWidth) || 0, realWidth: (origin === null || origin === void 0 ? void 0 : origin.realWidth) || 0, rawIndex: index - PARTITION_INDEX, type: item.type || 'plain', pristine: item.pristine || item, toggled: item.toggled !== false, breakpoint: item.breakpoint, isPrimary: index === PARTITION_INDEX });
});

@@ -1117,12 +1123,21 @@ self.columns.replace(columns);

self.selectedRows.clear();
eachTree(self.rows, function (item) {
if (~selected.indexOf(item.pristine)) {
self.selectedRows.push(item.id);
selected.forEach(function (item) {
var resolved = self.rows.find(function (a) { return a.pristine === item; });
// 先严格比较,
if (!resolved) {
resolved = self.rows.find(function (a) {
var selectValue = item[valueField || 'value'];
var itemValue = a.pristine[valueField || 'value'];
return selectValue === itemValue;
});
}
else if (find(selected, function (a) {
return a[valueField || 'value'] &&
a[valueField || 'value'] == item.pristine[valueField || 'value'];
})) {
self.selectedRows.push(item.id);
// 再宽松比较
if (!resolved) {
resolved = self.rows.find(function (a) {
var selectValue = item[valueField || 'value'];
var itemValue = a.pristine[valueField || 'value'];
return selectValue == itemValue;
});
}
resolved && self.selectedRows.push(resolved);
});

@@ -1129,0 +1144,0 @@ updateCheckDisable();

@@ -6,2 +6,3 @@ import { Instance, SnapshotIn, IAnyModelType } from 'mobx-state-tree';

title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
name: import("mobx-state-tree").IType<string | undefined, string, string>;

@@ -77,2 +78,3 @@ toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;

title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
name: import("mobx-state-tree").IType<string | undefined, string, string>;

@@ -147,2 +149,3 @@ toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;

formsRef: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<any, any, any>>, [undefined]>;
canAccessSuperData: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
}, {

@@ -166,3 +169,3 @@ readonly parentStore: any;

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -184,3 +187,3 @@ setCurrentAction(action: object): void;

fetchData: (api: Api, data?: object | undefined, options?: fetchOptions | undefined) => Promise<any>;
reInitData: (data: object | undefined, replace?: boolean) => void;
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
updateMessage: (msg?: string | undefined, error?: boolean) => void;

@@ -196,2 +199,3 @@ clearMessage: () => void;

title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
name: import("mobx-state-tree").IType<string | undefined, string, string>;

@@ -210,2 +214,3 @@ toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;

title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
name: import("mobx-state-tree").IType<string | undefined, string, string>;

@@ -225,2 +230,3 @@ toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;

title: any;
label: any;
name: string;

@@ -239,2 +245,3 @@ toggled: boolean;

title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
name: import("mobx-state-tree").IType<string | undefined, string, string>;

@@ -255,2 +262,3 @@ toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;

title: any;
label: any;
name: string;

@@ -269,2 +277,3 @@ toggled: boolean;

title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
name: import("mobx-state-tree").IType<string | undefined, string, string>;

@@ -521,3 +530,5 @@ toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;

} & {
update: (config: Partial<STableStore2>) => void;
update: (config: Partial<STableStore2>, options?: {
resolveDefinitions?: ((ref: string) => any) | undefined;
} | undefined) => void;
persistSaveToggledColumns: () => void;

@@ -524,0 +535,0 @@ setOrderByInfo: (key: string, direction: 'asc' | 'desc') => void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -27,2 +27,3 @@ */

title: types.optional(types.frozen(), undefined),
label: types.optional(types.frozen(), undefined),
name: '',

@@ -154,3 +155,4 @@ toggled: false,

rowSelectionKeyField: 'id',
formsRef: types.optional(types.array(types.frozen()), [])
formsRef: types.optional(types.array(types.frozen()), []),
canAccessSuperData: false
})

@@ -160,3 +162,3 @@ .views(function (self) {

if (self.columnsTogglable === 'auto') {
return self.columns.filter.length > 10;
return self.columns.filter(function (item) { return !/^__/.test(item.type); }).length > 5;
}

@@ -254,3 +256,5 @@ return !!self.columnsTogglable;

get dataSource() {
return self.rows.map(function (item) { return item.data; });
return self.rows.map(function (item) {
return self.canAccessSuperData ? item.locals : item.data;
});
},

@@ -297,6 +301,13 @@ get currentSelectedRowKeys() {

.actions(function (self) {
function updateColumns(columns) {
function updateColumns(columns, options) {
if (columns && Array.isArray(columns)) {
var cols = columns.filter(function (column) { return column; }).concat();
cols = cols.map(function (item, index) { return (__assign(__assign({}, item), { index: index, type: item.type || 'plain', pristine: item, toggled: item.toggled !== false, breakpoint: item.breakpoint, children: item.children ? updateColumns(item.children) : [] })); });
cols = cols.map(function (item, index) {
if ((options === null || options === void 0 ? void 0 : options.resolveDefinitions) &&
typeof (item === null || item === void 0 ? void 0 : item.$ref) == 'string' &&
item.$ref) {
item = __assign(__assign({}, options.resolveDefinitions(item.$ref)), item);
}
return __assign(__assign({}, item), { index: index, type: item.type || 'plain', pristine: item, toggled: item.toggled !== false, breakpoint: item.breakpoint, children: item.children ? updateColumns(item.children, options) : [] });
});
return cols;

@@ -306,5 +317,7 @@ }

}
function update(config) {
function update(config, options) {
config.columnsTogglable !== void 0 &&
(self.columnsTogglable = config.columnsTogglable);
config.canAccessSuperData !== undefined &&
(self.canAccessSuperData = !!config.canAccessSuperData);
if (typeof config.orderBy === 'string') {

@@ -317,3 +330,3 @@ setOrderByInfo(config.orderBy, config.order === 'desc' ? 'desc' : 'asc');

if (config.columns && Array.isArray(config.columns)) {
self.columns.replace(updateColumns(config.columns));
self.columns.replace(updateColumns(config.columns, options));
}

@@ -510,3 +523,3 @@ }

__saved: Date.now()
}, !!api && api.replaceData);
}, !!api && api.replaceData, api === null || api === void 0 ? void 0 : api.concatDataFields);
self.updatedAt = Date.now();

@@ -513,0 +526,0 @@ }

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -133,2 +133,9 @@ /// <reference types="react" />

/**
* 是否将两次返回的数据字段,做一个合并。配置返回对象中的字段名,支持配置多个。
*
* 比如:同时返回 log 字段,第一次返回 {log: '1'},第二次返回 {log: '2'},合并后的结果是 {log: ['1', '2']]}
* 再比如:同时返回 items 字段,第一次返回 {items: [1, 2]},第二次返回 {items: [3, 4]},合并后的结果是 {items: [1, 2, 3, 4]}
*/
concatDataFields?: string | Array<string>;
/**
* 是否自动刷新,当 url 中的取值结果变化时,自动刷新数据。

@@ -135,0 +142,0 @@ *

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -349,2 +349,3 @@ import React from 'react';

export declare function isNumeric(value: any): boolean;
export type PrimitiveTypes = 'boolean' | 'number';
/**

@@ -354,5 +355,8 @@ * 解析Query字符串中的原始类型,目前仅支持转化布尔类型

* @param query 查询字符串
* @param options 配置参数
* @returns 解析后的查询字符串
*/
export declare function parsePrimitiveQueryString(rawQuery: Record<string, any>): any;
export declare function parsePrimitiveQueryString(rawQuery: Record<string, any>, options?: {
primitiveTypes: PrimitiveTypes[];
}): any;
/**

@@ -371,2 +375,3 @@ * 获取URL链接中的query参数(包含hash mode)

parsePrimitive?: boolean;
primitiveTypes?: PrimitiveTypes[];
}): Record<string, any>;

@@ -373,0 +378,0 @@ export declare function differenceFromAll<T>(allOptions: Array<T>, options: Array<T>, getValue: (item: T) => any): Array<T>;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -1444,13 +1444,30 @@ */

* @param query 查询字符串
* @param options 配置参数
* @returns 解析后的查询字符串
*/
function parsePrimitiveQueryString(rawQuery) {
function parsePrimitiveQueryString(rawQuery, options) {
if (!isPlainObject(rawQuery)) {
return rawQuery;
}
options = options || { primitiveTypes: ['boolean'] };
if (!Array.isArray(options.primitiveTypes) ||
options.primitiveTypes.length === 0) {
options.primitiveTypes = ['boolean'];
}
var query = JSONValueMap(rawQuery, function (value) {
/** 解析布尔类型,后续有需要在这里扩充 */
if (value === 'true' || value === 'false') {
var _a, _b;
if ((((_a = options === null || options === void 0 ? void 0 : options.primitiveTypes) === null || _a === void 0 ? void 0 : _a.includes('boolean')) && value === 'true') ||
value === 'false') {
/** 解析布尔类型 */
return value === 'true';
}
else if (((_b = options === null || options === void 0 ? void 0 : options.primitiveTypes) === null || _b === void 0 ? void 0 : _b.includes('number')) &&
isNumeric(value) &&
isFinite(value) &&
value >= -Number.MAX_SAFE_INTEGER &&
value <= Number.MAX_SAFE_INTEGER) {
/** 解析数字类型 */
var result = Number(value);
return !isNaN(result) ? result : value;
}
return value;

@@ -1469,3 +1486,3 @@ });

var _a;
var _b = (options || {}).parsePrimitive, parsePrimitive = _b === void 0 ? false : _b;
var _b = options || {}, _c = _b.parsePrimitive, parsePrimitive = _c === void 0 ? false : _c, _d = _b.primitiveTypes, primitiveTypes = _d === void 0 ? ['boolean'] : _d;
var query = (location && !(location instanceof Location) && (location === null || location === void 0 ? void 0 : location.query)) ||

@@ -1476,3 +1493,3 @@ (location && (location === null || location === void 0 ? void 0 : location.search) && qsparse(location.search.substring(1))) ||

? parsePrimitive
? parsePrimitiveQueryString(query)
? parsePrimitiveQueryString(query, { primitiveTypes: primitiveTypes })
: query

@@ -1479,0 +1496,0 @@ : {};

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

export * from './api';
export * from './attachmentAdpator';
export * from './autobind';
export * from './browser';
export * from './ColorScale';
export * from './columnsSplit';
export * from './concatData';
export * from './dataMapping';

@@ -7,0 +9,0 @@ export * from './DataSchema';

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -14,3 +14,3 @@ */

function createRendererEvent(type, context) {
var rendererEvent = {
var rendererEvent = Object.defineProperties({
context: extendObject({ pristineData: context.data }, context),

@@ -35,3 +35,19 @@ type: type,

}
};
}, {
context: {
enumerable: false
},
pristineData: {
enumerable: false
},
preventDefault: {
enumerable: false
},
stopPropagation: {
enumerable: false
},
setData: {
enumerable: false
}
});
return rendererEvent;

@@ -38,0 +54,0 @@ }

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -154,3 +154,3 @@ */

key = valueMap[key] || key;
styles.push("".concat(kebabCase(key), ": ").concat(value + ((weights === null || weights === void 0 ? void 0 : weights.important) ? ' !important' : ''), ";"));
styles.push("".concat(key.startsWith('--') ? key : kebabCase(key), ": ").concat(value + ((weights === null || weights === void 0 ? void 0 : weights.important) ? ' !important' : ''), ";"));
};

@@ -167,4 +167,3 @@ Object.keys(statusMap[status]).forEach(function (key) {

style_1['bottom-right-border-radius'] || 0,
style_1['bottom-left-border-radius'] || 0,
(weights === null || weights === void 0 ? void 0 : weights.important) ? ' !important' : ''
style_1['bottom-left-border-radius'] || 0
].join(' '));

@@ -176,4 +175,3 @@ }

var value = style_1[k];
value &&
fn(k, value + ((weights === null || weights === void 0 ? void 0 : weights.important) ? ' !important' : ''));
value && fn(k, value);
}

@@ -180,0 +178,0 @@ });

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -193,5 +193,5 @@ */

var additional, action, mergeData, expression, isStop, preventDefault, key, api, cmptFlag, targetComponent, args, afterMappingData, actionData, data, stopped, actionResult, stopPropagation;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
return tslib.__generator(this, function (_v) {
switch (_v.label) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
return tslib.__generator(this, function (_w) {
switch (_w.label) {
case 0:

@@ -204,3 +204,3 @@ additional = {

// __rendererData默认为renderer.props.data,兼容表单项值变化时的data读取
if (!event.data.__rendererData) {
if (!((_a = event.data) === null || _a === void 0 ? void 0 : _a.__rendererData)) {
additional = {

@@ -214,3 +214,3 @@ event: event,

: additional, renderer.props.data), event.data);
expression = (_a = action.expression) !== null && _a !== void 0 ? _a : action.execOn;
expression = (_b = action.expression) !== null && _b !== void 0 ? _b : action.execOn;
isStop = false;

@@ -220,4 +220,4 @@ if (!expression) return [3 /*break*/, 2];

case 1:
isStop = !(_v.sent());
_v.label = 2;
isStop = !(_w.sent());
_w.label = 2;
case 2:

@@ -231,4 +231,4 @@ if (isStop) {

case 3:
preventDefault = _v.sent();
_v.label = 4;
preventDefault = _w.sent();
_w.label = 4;
case 4:

@@ -241,21 +241,21 @@ key = {

if (action.actionType === 'dialog') {
action.dialog = tslib.__assign({}, ((_b = action.dialog) !== null && _b !== void 0 ? _b : (_c = action.args) === null || _c === void 0 ? void 0 : _c.dialog));
(_d = action.args) === null || _d === void 0 ? true : delete _d.dialog;
action.dialog = tslib.__assign({}, ((_c = action.dialog) !== null && _c !== void 0 ? _c : (_d = action.args) === null || _d === void 0 ? void 0 : _d.dialog));
(_e = action.args) === null || _e === void 0 ? true : delete _e.dialog;
}
else if (action.actionType === 'drawer') {
action.drawer = tslib.__assign({}, ((_e = action.drawer) !== null && _e !== void 0 ? _e : (_f = action.args) === null || _f === void 0 ? void 0 : _f.drawer));
(_g = action.args) === null || _g === void 0 ? true : delete _g.drawer;
action.drawer = tslib.__assign({}, ((_f = action.drawer) !== null && _f !== void 0 ? _f : (_g = action.args) === null || _g === void 0 ? void 0 : _g.drawer));
(_h = action.args) === null || _h === void 0 ? true : delete _h.drawer;
}
else if (['ajax', 'download'].includes(action.actionType)) {
api = (_h = action.api) !== null && _h !== void 0 ? _h : (_j = action.args) === null || _j === void 0 ? void 0 : _j.api;
api = (_j = action.api) !== null && _j !== void 0 ? _j : (_k = action.args) === null || _k === void 0 ? void 0 : _k.api;
action.api = typeof api === 'string' ? api : tslib.__assign({}, api);
action.options = tslib.__assign({}, ((_k = action.options) !== null && _k !== void 0 ? _k : (_l = action.args) === null || _l === void 0 ? void 0 : _l.options));
action.messages = tslib.__assign({}, ((_m = action.messages) !== null && _m !== void 0 ? _m : (_o = action.args) === null || _o === void 0 ? void 0 : _o.messages));
(_p = action.args) === null || _p === void 0 ? true : delete _p.api;
(_q = action.args) === null || _q === void 0 ? true : delete _q.options;
(_r = action.args) === null || _r === void 0 ? true : delete _r.messages;
action.options = tslib.__assign({}, ((_l = action.options) !== null && _l !== void 0 ? _l : (_m = action.args) === null || _m === void 0 ? void 0 : _m.options));
action.messages = tslib.__assign({}, ((_o = action.messages) !== null && _o !== void 0 ? _o : (_p = action.args) === null || _p === void 0 ? void 0 : _p.messages));
(_q = action.args) === null || _q === void 0 ? true : delete _q.api;
(_r = action.args) === null || _r === void 0 ? true : delete _r.options;
(_s = action.args) === null || _s === void 0 ? true : delete _s.messages;
}
cmptFlag = key.componentId || key.componentName;
targetComponent = cmptFlag
? (_s = event.context.scoped) === null || _s === void 0 ? void 0 : _s[action.componentId ? 'getComponentById' : 'getComponentByName'](cmptFlag)
? (_t = event.context.scoped) === null || _t === void 0 ? void 0 : _t[action.componentId ? 'getComponentById' : 'getComponentByName'](cmptFlag)
: renderer;

@@ -268,3 +268,7 @@ args = dataMapping.dataMapping(action.args, mergeData, function (key) {

var cmptIgnoreMap = {
'input-table': ['condition']
'input-table': ['condition'],
'table': ['condition'],
'table2': ['condition'],
'crud': ['condition'],
'combo': ['condition']
};

@@ -284,3 +288,3 @@ var curCmptType = (_a = targetComponent === null || targetComponent === void 0 ? void 0 : targetComponent.props) === null || _a === void 0 ? void 0 : _a.type;

: mergeData;
(_t = console.group) === null || _t === void 0 ? void 0 : _t.call(console, "run action ".concat(action.actionType));
(_u = console.group) === null || _u === void 0 ? void 0 : _u.call(console, "run action ".concat(action.actionType));
console.debug("[".concat(action.actionType, "] action args, data"), args, data);

@@ -290,3 +294,3 @@ stopped = false;

case 5:
actionResult = _v.sent();
actionResult = _w.sent();
// 二次确认弹窗如果取消,则终止后续动作

@@ -301,7 +305,7 @@ if ((action === null || action === void 0 ? void 0 : action.actionType) === 'confirmDialog' && !actionResult) {

case 6:
stopPropagation = _v.sent();
_v.label = 7;
stopPropagation = _w.sent();
_w.label = 7;
case 7:
console.debug("[".concat(action.actionType, "] action end event"), event);
(_u = console.groupEnd) === null || _u === void 0 ? void 0 : _u.call(console);
(_v = console.groupEnd) === null || _v === void 0 ? void 0 : _v.call(console);
// 阻止原有动作执行

@@ -308,0 +312,0 @@ preventDefault && event.preventDefault();

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -13,2 +13,3 @@ */

var Action = require('./Action.js');
var factory = require('../factory.js');
var object = require('../utils/object.js');

@@ -27,8 +28,8 @@

CmptAction.prototype.run = function (action, renderer, event) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
return tslib.__awaiter(this, void 0, void 0, function () {
var key, dataMergeMode, path, beforeSetData, res, component, msg, result, e_1;
var _t, _u;
return tslib.__generator(this, function (_v) {
switch (_v.label) {
var key, dataMergeMode, path, beforeSetData, res, component, msg, _5, dispatchEvent_1, data, valid, e_1, result, e_2;
var _6, _7, _8, _9, _10;
return tslib.__generator(this, function (_11) {
switch (_11.label) {
case 0:

@@ -43,7 +44,7 @@ key = action.componentId || action.componentName;

case 1:
res = _v.sent();
res = _11.sent();
if (res === false) {
return [2 /*return*/];
}
_v.label = 2;
_11.label = 2;
case 2:

@@ -75,29 +76,67 @@ component = key

}
_v.label = 3;
if (!(action.actionType === 'validateFormItem' &&
((_o = factory.getRendererByName((_m = component === null || component === void 0 ? void 0 : component.props) === null || _m === void 0 ? void 0 : _m.type)) === null || _o === void 0 ? void 0 : _o.isFormItem))) return [3 /*break*/, 7];
_5 = (component === null || component === void 0 ? void 0 : component.props) || {}, dispatchEvent_1 = _5.dispatchEvent, data = _5.data;
_11.label = 3;
case 3:
_v.trys.push([3, 5, , 6]);
return [4 /*yield*/, ((_m = component === null || component === void 0 ? void 0 : component.doAction) === null || _m === void 0 ? void 0 : _m.call(component, action, action.args, true))];
_11.trys.push([3, 5, , 6]);
return [4 /*yield*/, ((_q = component === null || component === void 0 ? void 0 : (_p = component.props).onValidate) === null || _q === void 0 ? void 0 : _q.call(_p))];
case 4:
result = _v.sent();
valid = _11.sent();
if (valid) {
event.setData(object.createObject(event.data, (_6 = {},
_6[action.outputVar || "".concat(action.actionType, "Result")] = {
error: '',
value: (_s = (_r = component === null || component === void 0 ? void 0 : component.props) === null || _r === void 0 ? void 0 : _r.formItem) === null || _s === void 0 ? void 0 : _s.value
},
_6)));
dispatchEvent_1 && dispatchEvent_1('formItemValidateSucc', data);
}
else {
event.setData(object.createObject(event.data, (_7 = {},
_7[action.outputVar || "".concat(action.actionType, "Result")] = {
error: (((_u = (_t = component === null || component === void 0 ? void 0 : component.props) === null || _t === void 0 ? void 0 : _t.formItem) === null || _u === void 0 ? void 0 : _u.errors) || []).join(','),
value: (_w = (_v = component === null || component === void 0 ? void 0 : component.props) === null || _v === void 0 ? void 0 : _v.formItem) === null || _w === void 0 ? void 0 : _w.value
},
_7)));
dispatchEvent_1 && dispatchEvent_1('formItemValidateError', data);
}
return [3 /*break*/, 6];
case 5:
e_1 = _11.sent();
event.setData(object.createObject(event.data, (_8 = {},
_8[action.outputVar || "".concat(action.actionType, "Result")] = {
error: e_1.message || '未知错误',
value: (_y = (_x = component === null || component === void 0 ? void 0 : component.props) === null || _x === void 0 ? void 0 : _x.formItem) === null || _y === void 0 ? void 0 : _y.value
},
_8)));
dispatchEvent_1 && dispatchEvent_1('formItemValidateError', data);
return [3 /*break*/, 6];
case 6: return [2 /*return*/];
case 7:
_11.trys.push([7, 9, , 10]);
return [4 /*yield*/, ((_z = component === null || component === void 0 ? void 0 : component.doAction) === null || _z === void 0 ? void 0 : _z.call(component, action, action.args, true))];
case 8:
result = _11.sent();
if (['validate', 'submit'].includes(action.actionType)) {
event.setData(object.createObject(event.data, (_t = {},
_t[action.outputVar || "".concat(action.actionType, "Result")] = {
event.setData(object.createObject(event.data, (_9 = {},
_9[action.outputVar || "".concat(action.actionType, "Result")] = {
error: '',
payload: (_o = result === null || result === void 0 ? void 0 : result.__payload) !== null && _o !== void 0 ? _o : (_q = (_p = component === null || component === void 0 ? void 0 : component.props) === null || _p === void 0 ? void 0 : _p.store) === null || _q === void 0 ? void 0 : _q.data,
payload: (_0 = result === null || result === void 0 ? void 0 : result.__payload) !== null && _0 !== void 0 ? _0 : (_2 = (_1 = component === null || component === void 0 ? void 0 : component.props) === null || _1 === void 0 ? void 0 : _1.store) === null || _2 === void 0 ? void 0 : _2.data,
responseData: result === null || result === void 0 ? void 0 : result.__response
},
_t)));
_9)));
}
return [2 /*return*/, result];
case 5:
e_1 = _v.sent();
event.setData(object.createObject(event.data, (_u = {},
_u[action.outputVar || "".concat(action.actionType, "Result")] = {
error: e_1.message,
errors: e_1.name === 'ValidateError' ? e_1.detail : e_1,
payload: (_s = (_r = component === null || component === void 0 ? void 0 : component.props) === null || _r === void 0 ? void 0 : _r.store) === null || _s === void 0 ? void 0 : _s.data
case 9:
e_2 = _11.sent();
event.setData(object.createObject(event.data, (_10 = {},
_10[action.outputVar || "".concat(action.actionType, "Result")] = {
error: e_2.message,
errors: e_2.name === 'ValidateError' ? e_2.detail : e_2,
payload: (_4 = (_3 = component === null || component === void 0 ? void 0 : component.props) === null || _3 === void 0 ? void 0 : _3.store) === null || _4 === void 0 ? void 0 : _4.data
},
_u)));
return [3 /*break*/, 6];
case 6: return [2 /*return*/];
_10)));
return [3 /*break*/, 10];
case 10: return [2 /*return*/];
}

@@ -104,0 +143,0 @@ });

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -12,6 +12,7 @@ */

var api = require('../utils/api.js');
require('../utils/browser.js');
require('../utils/ColorScale.js');
require('../utils/columnsSplit.js');
require('lodash/isPlainObject');
require('amis-formula');
require('lodash/isPlainObject');
require('../utils/DataSchema.js');

@@ -18,0 +19,0 @@ require('../utils/DataScope.js');

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -16,6 +16,7 @@ */

require('../utils/api.js');
require('../utils/browser.js');
require('../utils/ColorScale.js');
require('../utils/columnsSplit.js');
require('lodash/isPlainObject');
require('amis-formula');
require('lodash/isPlainObject');
require('../utils/DataSchema.js');

@@ -22,0 +23,0 @@ require('../utils/DataScope.js');

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -15,6 +15,7 @@ */

require('../utils/api.js');
require('../utils/browser.js');
require('../utils/ColorScale.js');
require('../utils/columnsSplit.js');
require('lodash/isPlainObject');
require('amis-formula');
require('lodash/isPlainObject');
require('../utils/DataSchema.js');

@@ -21,0 +22,0 @@ require('../utils/DataScope.js');

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -18,4 +18,6 @@ */

var autobind = require('./utils/autobind.js');
var browser = require('./utils/browser.js');
var ColorScale = require('./utils/ColorScale.js');
var columnsSplit = require('./utils/columnsSplit.js');
var concatData = require('./utils/concatData.js');
var dataMapping = require('./utils/dataMapping.js');

@@ -137,3 +139,3 @@ var DataSchema = require('./utils/DataSchema.js');

// @ts-ignore
var version = '3.6.3';
var version = '6.0.0';
function render(schema, props, options, pathPrefix) {

@@ -236,4 +238,6 @@ if (props === void 0) { props = {}; }

exports.bind = autobind.bind;
exports.chromeVersion = browser.chromeVersion;
exports.ColorScale = ColorScale.ColorScale;
exports.columnsSplit = columnsSplit.columnsSplit;
exports.concatData = concatData.concatData;
exports.dataMapping = dataMapping.dataMapping;

@@ -240,0 +244,0 @@ exports.resolveMapping = dataMapping.resolveMapping;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -22,4 +22,7 @@ */

var ReactDOM = require('react-dom');
require('../utils/browser.js');
require('../utils/ColorScale.js');
require('../utils/columnsSplit.js');
var getVariable = require('../utils/getVariable.js');
var object = require('../utils/object.js');
var dataMapping = require('../utils/dataMapping.js');

@@ -29,3 +32,2 @@ require('../utils/DataSchema.js');

require('moment');
var object = require('../utils/object.js');
require('amis-formula');

@@ -41,3 +43,2 @@ require('../utils/debug.js');

require('lodash/isBoolean');
var getVariable = require('../utils/getVariable.js');
require('../utils/highlight.js');

@@ -44,0 +45,0 @@ require('../utils/icon.js');

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -30,2 +30,3 @@ */

var optionValueCompare = require('../utils/optionValueCompare.js');
require('../utils/browser.js');
require('../utils/ColorScale.js');

@@ -164,3 +165,3 @@ require('../utils/columnsSplit.js');

var formItem = props.formItem;
if (prevProps.options !== props.options && formItem) {
if (!props.source && prevProps.options !== props.options && formItem) {
formItem.setOptions(normalizeOptions.normalizeOptions(props.options || [], undefined, props.valueField), this.changeOptionValue, props.data);

@@ -199,3 +200,4 @@ this.normalizeValue();

};
FormOptionsItem.prototype.dispatchOptionEvent = function (eventName, eventData) {
// 不推荐使用,缺少组件值
FormOptionsItem.prototype.oldDispatchOptionEvent = function (eventName, eventData) {
if (eventData === void 0) { eventData = ''; }

@@ -218,2 +220,19 @@ return tslib.__awaiter(this, void 0, void 0, function () {

};
FormOptionsItem.prototype.dispatchOptionEvent = function (eventName, eventData) {
if (eventData === void 0) { eventData = ''; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, dispatchEvent, options, value, rendererEvent$1;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = this.props, dispatchEvent = _a.dispatchEvent, options = _a.options, value = _a.value;
return [4 /*yield*/, dispatchEvent(eventName, rendererEvent.resolveEventData(this.props, tslib.__assign({ value: value, options: options, items: options }, eventData)))];
case 1:
rendererEvent$1 = _b.sent();
// 返回阻塞标识
return [2 /*return*/, !!(rendererEvent$1 === null || rendererEvent$1 === void 0 ? void 0 : rendererEvent$1.prevented)];
}
});
});
};
FormOptionsItem.prototype.doAction = function (action, data, throwErrors) {

@@ -304,3 +323,5 @@ var _a = this.props, resetValue = _a.resetValue, onChange = _a.onChange;

newValue = this.toggleValue(option, value);
return [4 /*yield*/, this.dispatchOptionEvent('change', newValue)];
return [4 /*yield*/, this.dispatchOptionEvent('change', {
value: newValue
})];
case 1:

@@ -376,3 +397,5 @@ isPrevented = _b.sent();

newValue = this.formatValueArray(valueArray);
return [4 /*yield*/, this.dispatchOptionEvent('change', newValue)];
return [4 /*yield*/, this.dispatchOptionEvent('change', {
value: newValue
})];
case 1:

@@ -460,3 +483,6 @@ isPrevented = _b.sent();

// 触发事件通知,加载完成
this.dispatchOptionEvent('loadFinished', json);
// 废弃,不推荐使用
this.oldDispatchOptionEvent('loadFinished', json);
// 避免产生breakchange,增加新事件名,用来更正之前的设计问题
this.dispatchOptionEvent('deferLoadFinished', { result: json });
return [2 /*return*/];

@@ -543,4 +569,5 @@ }

return tslib.__awaiter(this, void 0, void 0, function () {
var _c, addControls, addDialog, disabled, labelField, onOpenDialog, optionLabel, addApi, source, data, valueField, deferField, model, createBtnLabel, env, __, parent, ctx, result, _d, payload, e_1, isPrevented, options;
var _c, addControls, addDialog, disabled, labelField, onOpenDialog, optionLabel, addApi, source, data, valueField, deferField, model, createBtnLabel, env, __, parent, ctx, customAddPrevent, result, _d, prevent, payload, e_1, isPrevented, options;
var _e;
var _this = this;
return tslib.__generator(this, function (_f) {

@@ -571,2 +598,3 @@ switch (_f.label) {

? tslib.__assign({ parent: parent }, value) : value);
customAddPrevent = false;
if (!skipForm) return [3 /*break*/, 1];

@@ -589,3 +617,25 @@ _d = ctx;

}
], tslib.__read((addControls || [])), false)
], tslib.__read((addControls || [])), false),
onSubmit: function (payload) { return tslib.__awaiter(_this, void 0, void 0, function () {
var labelKey, valueKey;
var _a;
var _b;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
labelKey = labelField || 'label';
valueKey = valueField || 'value';
return [4 /*yield*/, this.dispatchOptionEvent('addConfirm', {
item: (_a = {},
_a[labelKey] = payload[labelKey],
_a[valueKey] = (_b = payload[valueKey]) !== null && _b !== void 0 ? _b : payload[labelKey],
_a)
})];
case 1:
// 派发确认添加事件
customAddPrevent = _c.sent();
return [2 /*return*/, !customAddPrevent];
}
});
}); }
} }), ctx)];

@@ -597,10 +647,26 @@ case 2:

result = _d;
if (!(skipForm && addApi)) return [3 /*break*/, 7];
_f.label = 4;
if (!skipForm) return [3 /*break*/, 5];
return [4 /*yield*/, this.dispatchOptionEvent('addConfirm', {
item: result
})];
case 4:
_f.trys.push([4, 6, , 7]);
prevent = _f.sent();
if (prevent) {
return [2 /*return*/];
}
return [3 /*break*/, 6];
case 5:
if (customAddPrevent) {
return [2 /*return*/];
}
_f.label = 6;
case 6:
if (!(skipForm && addApi)) return [3 /*break*/, 10];
_f.label = 7;
case 7:
_f.trys.push([7, 9, , 10]);
return [4 /*yield*/, env.fetcher(addApi, result, {
method: 'post'
})];
case 5:
case 8:
payload = _f.sent();

@@ -615,4 +681,4 @@ if (!payload.ok) {

}
return [3 /*break*/, 7];
case 6:
return [3 /*break*/, 10];
case 9:
e_1 = _f.sent();

@@ -622,4 +688,4 @@ result = null;

!addApi.silent && env.notify('error', e_1.message);
return [3 /*break*/, 7];
case 7:
return [3 /*break*/, 10];
case 10:
// 有 result 说明弹框点了确认。否则就是取消了。

@@ -633,4 +699,4 @@ if (!result) {

}
return [4 /*yield*/, this.dispatchOptionEvent('add', tslib.__assign(tslib.__assign({}, result), { idx: idx }))];
case 8:
return [4 /*yield*/, this.oldDispatchOptionEvent('add', tslib.__assign(tslib.__assign({}, result), { idx: idx }))];
case 11:
isPrevented = _f.sent();

@@ -641,8 +707,8 @@ if (isPrevented) {

if (!(((parent === null || parent === void 0 ? void 0 : parent.hasOwnProperty(deferField)) && parent[deferField]) ||
(parent === null || parent === void 0 ? void 0 : parent.defer))) return [3 /*break*/, 10];
(parent === null || parent === void 0 ? void 0 : parent.defer))) return [3 /*break*/, 13];
return [4 /*yield*/, this.deferLoad(parent)];
case 9:
case 12:
_f.sent();
return [3 /*break*/, 11];
case 10:
return [3 /*break*/, 14];
case 13:
if (source && addApi) {

@@ -665,4 +731,4 @@ // 如果配置了 source 且配置了 addApi 直接重新拉取接口就够了

}
_f.label = 11;
case 11: return [2 /*return*/];
_f.label = 14;
case 14: return [2 /*return*/];
}

@@ -677,7 +743,8 @@ });

return tslib.__awaiter(this, void 0, void 0, function () {
var _c, editControls, editDialog, disabled, labelField, onOpenDialog, editApi, editInitApi, env, source, data, model, optionLabel, __, result, _d, payload, e_2, isPrevented, indexes;
var _c, editControls, editDialog, disabled, labelField, valueField, onOpenDialog, editApi, editInitApi, env, source, data, model, optionLabel, __, customEditPrevent, result, _d, prevent, payload, e_2, isPrevented, indexes;
var _this = this;
return tslib.__generator(this, function (_e) {
switch (_e.label) {
case 0:
_c = this.props, editControls = _c.editControls, editDialog = _c.editDialog, disabled = _c.disabled, labelField = _c.labelField, onOpenDialog = _c.onOpenDialog, editApi = _c.editApi, editInitApi = _c.editInitApi, env = _c.env, source = _c.source, data = _c.data, model = _c.formItem, optionLabel = _c.optionLabel, __ = _c.translate;
_c = this.props, editControls = _c.editControls, editDialog = _c.editDialog, disabled = _c.disabled, labelField = _c.labelField, valueField = _c.valueField, onOpenDialog = _c.onOpenDialog, editApi = _c.editApi, editInitApi = _c.editInitApi, env = _c.env, source = _c.source, data = _c.data, model = _c.formItem, optionLabel = _c.optionLabel, __ = _c.translate;
if (disabled || !model) {

@@ -696,2 +763,3 @@ return [2 /*return*/];

}
customEditPrevent = false;
if (!skipForm) return [3 /*break*/, 1];

@@ -706,3 +774,25 @@ _d = value;

api: editApi,
controls: editControls
controls: editControls,
onSubmit: function (payload) { return tslib.__awaiter(_this, void 0, void 0, function () {
var labelKey, valueKey;
var _a;
var _b;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
labelKey = labelField || 'label';
valueKey = valueField || 'value';
return [4 /*yield*/, this.dispatchOptionEvent('editConfirm', {
item: (_a = {},
_a[labelKey] = payload[labelKey],
_a[valueKey] = (_b = payload[valueKey]) !== null && _b !== void 0 ? _b : payload[labelKey],
_a)
})];
case 1:
// 避免产生breakchange,增加新事件名,用来更正之前的设计问题
customEditPrevent = _c.sent();
return [2 /*return*/, !customEditPrevent];
}
});
}); }
} }), object.createObject(data, value))];

@@ -714,10 +804,26 @@ case 2:

result = _d;
if (!(skipForm && editApi)) return [3 /*break*/, 7];
_e.label = 4;
if (!skipForm) return [3 /*break*/, 5];
return [4 /*yield*/, this.dispatchOptionEvent('editConfirm', {
item: result
})];
case 4:
_e.trys.push([4, 6, , 7]);
prevent = _e.sent();
if (prevent) {
return [2 /*return*/];
}
return [3 /*break*/, 6];
case 5:
if (customEditPrevent) {
return [2 /*return*/];
}
_e.label = 6;
case 6:
if (!(skipForm && editApi)) return [3 /*break*/, 10];
_e.label = 7;
case 7:
_e.trys.push([7, 9, , 10]);
return [4 /*yield*/, env.fetcher(editApi, object.createObject(data, result), {
method: 'post'
})];
case 5:
case 8:
payload = _e.sent();

@@ -732,4 +838,4 @@ if (!payload.ok) {

}
return [3 /*break*/, 7];
case 6:
return [3 /*break*/, 10];
case 9:
e_2 = _e.sent();

@@ -739,4 +845,4 @@ result = null;

!editApi.silent && env.notify('error', e_2.message);
return [3 /*break*/, 7];
case 7:
return [3 /*break*/, 10];
case 10:
// 没有结果,说明取消了。

@@ -746,4 +852,4 @@ if (!result) {

}
return [4 /*yield*/, this.dispatchOptionEvent('edit', result)];
case 8:
return [4 /*yield*/, this.oldDispatchOptionEvent('edit', result)];
case 11:
isPrevented = _e.sent();

@@ -770,3 +876,3 @@ if (isPrevented) {

return tslib.__awaiter(this, void 0, void 0, function () {
var _c, deleteConfirmText, disabled, data, deleteApi, onDelete, env, model, source, valueField, __, ctx, confirmed, _d, isPrevented, result, options, indexes, e_3;
var _c, deleteConfirmText, disabled, data, deleteApi, onDelete, env, model, source, valueField, __, ctx, confirmed, _d, isPrevented, delConfirmPrevent, result, options, indexes, e_3;
return tslib.__generator(this, function (_e) {

@@ -793,3 +899,3 @@ switch (_e.label) {

}
return [4 /*yield*/, this.dispatchOptionEvent('delete', ctx)];
return [4 /*yield*/, this.oldDispatchOptionEvent('delete', ctx)];
case 4:

@@ -800,10 +906,18 @@ isPrevented = _e.sent();

}
_e.label = 5;
return [4 /*yield*/, this.dispatchOptionEvent('deleteConfirm', {
item: value
})];
case 5:
_e.trys.push([5, 8, , 9]);
if (!deleteApi) return [3 /*break*/, 7];
delConfirmPrevent = _e.sent();
if (delConfirmPrevent) {
return [2 /*return*/];
}
_e.label = 6;
case 6:
_e.trys.push([6, 9, , 10]);
if (!deleteApi) return [3 /*break*/, 8];
return [4 /*yield*/, env.fetcher(deleteApi, ctx, {
method: 'delete'
})];
case 6:
case 7:
result = _e.sent();

@@ -815,4 +929,4 @@ if (!result.ok) {

}
_e.label = 7;
case 7:
_e.label = 8;
case 8:
// 由外部代码实现删除逻辑

@@ -832,9 +946,9 @@ if (onDelete) {

}
return [3 /*break*/, 9];
case 8:
return [3 /*break*/, 10];
case 9:
e_3 = _e.sent();
console.error(e_3);
!deleteApi.silent && env.notify('error', e_3.message);
return [3 /*break*/, 9];
case 9: return [2 /*return*/];
return [3 /*break*/, 10];
case 10: return [2 /*return*/];
}

@@ -841,0 +955,0 @@ });

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -26,8 +26,9 @@ */

var api = require('../utils/api.js');
require('../utils/browser.js');
require('../utils/ColorScale.js');
require('../utils/columnsSplit.js');
var getVariable = require('../utils/getVariable.js');
require('lodash/isPlainObject');
require('amis-formula');
var tokenize = require('../utils/tokenize.js');
require('lodash/isPlainObject');
var getVariable = require('../utils/getVariable.js');
require('../utils/DataSchema.js');

@@ -34,0 +35,0 @@ require('../utils/DataScope.js');

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -33,3 +33,3 @@ import React from 'react';

renderDrawer(): React.ReactNode;
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
render(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
}
/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -24,2 +24,3 @@ */

require('./utils/api.js');
require('./utils/browser.js');
require('./utils/ColorScale.js');

@@ -26,0 +27,0 @@ require('./utils/columnsSplit.js');

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -55,3 +55,3 @@ import { Instance, SnapshotIn } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -73,3 +73,3 @@ setCurrentAction(action: object): void;

fetchData: (api: import("../types").Api, data?: object | undefined, options?: import("../types").fetchOptions | undefined) => Promise<any>;
reInitData: (data: object | undefined, replace?: boolean) => void;
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
updateMessage: (msg?: string | undefined, error?: boolean) => void;

@@ -76,0 +76,0 @@ clearMessage: () => void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -15,7 +15,8 @@ */

require('../utils/api.js');
require('../utils/browser.js');
require('../utils/ColorScale.js');
require('../utils/columnsSplit.js');
var object = require('../utils/object.js');
require('amis-formula');
require('lodash/isPlainObject');
var object = require('../utils/object.js');
require('../utils/DataSchema.js');

@@ -22,0 +23,0 @@ require('../utils/DataScope.js');

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -80,3 +80,3 @@ import { Instance } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -98,3 +98,3 @@ setCurrentAction(action: object): void;

fetchData: (api: Api, data?: object | undefined, options?: fetchOptions | undefined) => Promise<any>;
reInitData: (data: object | undefined, replace?: boolean) => void;
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
updateMessage: (msg?: string | undefined, error?: boolean) => void;

@@ -154,4 +154,5 @@ clearMessage: () => void;

updateTotal: (total: number) => void;
resetSelection: () => void;
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
export type ICRUDStore = Instance<typeof CRUDStore>;
export {};
/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -26,2 +26,3 @@ */

var tpl = require('../utils/tpl.js');
var table = require('./table.js');

@@ -330,3 +331,3 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

self.items.replace(rowsData);
self.reInitData(data_2, !!api$1.replaceData);
self.reInitData(data_2, !!api$1.replaceData, api$1.concatDataFields);
options.syncResponse2Query !== false &&

@@ -396,3 +397,3 @@ updateQuery(pick__default["default"](rest, Object.keys(self.query)), undefined, options.pageField || 'page', options.perPageField || 'perPage');

__saved: Date.now()
}, !!api$1 && api$1.replaceData);
}, !!api$1 && api$1.replaceData, api$1 === null || api$1 === void 0 ? void 0 : api$1.concatDataFields);
self.updatedAt = Date.now();

@@ -616,2 +617,14 @@ }

};
/** 非Picker模式下,重置当前CRUD的所有的已选择项目 */
var resetSelection = function () {
var _a, _b, _c, _d;
// 初始化CRUD记录的已选择项目和未选择项目
setSelectedItems([]);
setUnSelectedItems([]);
var tableStore = (_b = (_a = self === null || self === void 0 ? void 0 : self.children) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, function (s) { return s.storeType === table.TableStore.name; });
if (tableStore) {
// 清空Table记录的已选择项目
(_d = (_c = tableStore).clear) === null || _d === void 0 ? void 0 : _d.call(_c);
}
};
return {

@@ -635,3 +648,4 @@ getData: getData,

updateColumns: updateColumns,
updateTotal: updateTotal
updateTotal: updateTotal,
resetSelection: resetSelection
};

@@ -638,0 +652,0 @@ });

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -148,4 +148,4 @@ */

.actions(function (self) {
function setValues(values, tag, replace) {
self.updateData(values, tag, replace);
function setValues(values, tag, replace, concatFields) {
self.updateData(values, tag, replace, concatFields);
// 如果数据域中有数据变化,就都reset一下,去掉之前残留的验证消息

@@ -319,3 +319,3 @@ self.items.forEach(function (item) {

}
: undefined, !!api$1.replaceData);
: undefined, !!api$1.replaceData, api$1.concatDataFields);
}

@@ -455,3 +455,3 @@ if (!!json.ok) return [3 /*break*/, 6];

_a.trys.push([1, , 5, 6]);
return [4 /*yield*/, validate(hooks, undefined, true, failedMessage, validateErrCb)];
return [4 /*yield*/, validate(hooks, true, true, failedMessage, validateErrCb)];
case 2:

@@ -458,0 +458,0 @@ _a.sent();

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -39,3 +39,3 @@ import { Instance, SnapshotIn } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object, replace?: boolean): void;
updateData(data?: object, tag?: object, replace?: boolean, concatFields?: string | string[]): void;
changeValue(name: string, value: any, changePristine?: boolean, force?: boolean, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -42,0 +42,0 @@ setCurrentAction(action: object): void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -22,4 +22,6 @@ */

require('../utils/api.js');
require('../utils/browser.js');
require('../utils/ColorScale.js');
require('../utils/columnsSplit.js');
var concatData = require('../utils/concatData.js');
require('../utils/DataSchema.js');

@@ -99,4 +101,7 @@ require('../utils/DataScope.js');

},
updateData: function (data, tag, replace) {
updateData: function (data, tag, replace, concatFields) {
if (data === void 0) { data = {}; }
if (concatFields) {
data = concatData.concatData(data, self.data, concatFields);
}
var prev = self.data;

@@ -103,0 +108,0 @@ var newData;

@@ -106,3 +106,3 @@ import { SnapshotIn, Instance } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -109,0 +109,0 @@ setCurrentAction(action: object): void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -13,3 +13,2 @@ */

var isEqual = require('lodash/isEqual');
var find = require('lodash/find');
var helper = require('../utils/helper.js');

@@ -22,3 +21,2 @@ var tpl = require('../utils/tpl.js');

var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
var find__default = /*#__PURE__*/_interopDefaultLegacy(find);

@@ -180,15 +178,21 @@ var Item = mobxStateTree.types

self.selectedItems.clear();
self.items.forEach(function (item) {
if (~selected.indexOf(item.pristine)) {
self.selectedItems.push(item);
selected.forEach(function (item) {
var resolved = self.items.find(function (a) { return a.pristine === item; });
// 先严格比较,
if (!resolved) {
resolved = self.items.find(function (a) {
var selectValue = item[valueField || 'value'];
var itemValue = a.pristine[valueField || 'value'];
return selectValue === itemValue;
});
}
else if (find__default["default"](selected, function (a) {
var selectValue = a[valueField || 'value'];
var itemValue = item.pristine[valueField || 'value'];
return self.strictMode
? selectValue === itemValue
: selectValue == itemValue;
})) {
self.selectedItems.push(item);
// 再宽松比较
if (!resolved) {
resolved = self.items.find(function (a) {
var selectValue = item[valueField || 'value'];
var itemValue = a.pristine[valueField || 'value'];
return selectValue == itemValue;
});
}
resolved && self.selectedItems.push(resolved);
});

@@ -195,0 +199,0 @@ }

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -53,3 +53,3 @@ import { SnapshotIn, Instance } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -71,3 +71,3 @@ setCurrentAction(action: object): void;

fetchData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
reInitData: (data: object | undefined, replace?: boolean) => void;
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
updateMessage: (msg?: string | undefined, error?: boolean) => void;

@@ -74,0 +74,0 @@ clearMessage: () => void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -26,2 +26,3 @@ import { Instance, SnapshotIn } from 'mobx-state-tree';

mode: import("mobx-state-tree").IType<string | undefined, string, string>;
ellipsisPageGap: import("mobx-state-tree").IType<number | undefined, number, number>;
}, {

@@ -45,3 +46,3 @@ readonly parentStore: any;

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -48,0 +49,0 @@ setCurrentAction(action: object): void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -27,3 +27,4 @@ */

outputName: '',
mode: 'normal'
mode: 'normal',
ellipsisPageGap: 5
})

@@ -30,0 +31,0 @@ .views(function (self) { return ({

@@ -52,3 +52,3 @@ import { Instance } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -70,3 +70,3 @@ setCurrentAction(action: object): void;

fetchData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
reInitData: (data: object | undefined, replace?: boolean) => void;
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
updateMessage: (msg?: string | undefined, error?: boolean) => void;

@@ -73,0 +73,0 @@ clearMessage: () => void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -15,7 +15,8 @@ */

require('../utils/api.js');
require('../utils/browser.js');
require('../utils/ColorScale.js');
require('../utils/columnsSplit.js');
var object = require('../utils/object.js');
require('amis-formula');
require('lodash/isPlainObject');
var object = require('../utils/object.js');
require('../utils/DataSchema.js');

@@ -22,0 +23,0 @@ require('../utils/DataScope.js');

@@ -49,3 +49,3 @@ import { Instance } from 'mobx-state-tree';

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -67,3 +67,3 @@ setCurrentAction(action: object): void;

fetchData: (api: Api, data?: object, options?: fetchOptions) => Promise<any>;
reInitData: (data: object | undefined, replace?: boolean) => void;
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[]) => void;
updateMessage: (msg?: string, error?: boolean) => void;

@@ -70,0 +70,0 @@ clearMessage: () => void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -17,2 +17,3 @@ */

var replaceText = require('../utils/replaceText.js');
var concatData = require('../utils/concatData.js');
var object = require('../utils/object.js');

@@ -53,4 +54,7 @@

}
function reInitData(data, replace) {
function reInitData(data, replace, concatFields) {
if (replace === void 0) { replace = false; }
if (concatFields) {
data = concatData.concatData(data, self.data, concatFields);
}
var newData = object.extendObject(self.pristine, data, !replace);

@@ -101,3 +105,3 @@ self.data = self.pristine = newData;

data_1 = tslib.__assign(tslib.__assign({}, (replace ? {} : self.data)), api.normalizeApiResponseData(json.data));
reInitData(data_1, replace);
reInitData(data_1, replace, api$1.concatDataFields);
self.hasRemoteData = true;

@@ -168,3 +172,3 @@ if (!(options && options.onSuccess)) return [3 /*break*/, 4];

json.data &&
self.updateData(api.normalizeApiResponseData(json.data), undefined, !!api$1.replaceData);
self.updateData(api.normalizeApiResponseData(json.data), undefined, !!api$1.replaceData, api$1.concatDataFields);
self.hasRemoteData = true;

@@ -240,3 +244,3 @@ }

json.data &&
self.updateData(api.normalizeApiResponseData(json.data), undefined, !!api$1.replaceData);
self.updateData(api.normalizeApiResponseData(json.data), undefined, !!api$1.replaceData, api$1.concatDataFields);
}

@@ -355,3 +359,3 @@ if (!!json.ok) return [3 /*break*/, 4];

object.isObject(json.data.data) &&
self.updateData(json.data.data, undefined, !!api$1.replaceData);
self.updateData(json.data.data, undefined, !!api$1.replaceData, api$1.concatDataFields);
}

@@ -403,3 +407,3 @@ updateMessage((_h = (_g = (_f = api$1 === null || api$1 === void 0 ? void 0 : api$1.messages) === null || _f === void 0 ? void 0 : _f.success) !== null && _g !== void 0 ? _g : json.msg) !== null && _h !== void 0 ? _h : (options && options.successMessage));

json.ok &&
self.updateData(json.data, undefined, !!api.replaceData);
self.updateData(json.data, undefined, !!api.replaceData, api.concatDataFields);
if (!json.ok) {

@@ -406,0 +410,0 @@ throw new Error(json.msg);

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -21,3 +21,2 @@ */

var isEqual = require('lodash/isEqual');
var find = require('lodash/find');
var sortBy = require('lodash/sortBy');

@@ -31,3 +30,2 @@ var helper = require('../utils/helper.js');

var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
var find__default = /*#__PURE__*/_interopDefaultLegacy(find);
var sortBy__default = /*#__PURE__*/_interopDefaultLegacy(sortBy);

@@ -879,2 +877,3 @@

var originColumns_1 = self.columns.concat();
var ids_1 = [];
columns = columns.map(function (item, index) {

@@ -884,3 +883,9 @@ var origin = item.id

: originColumns_1[index];
return tslib.__assign(tslib.__assign({}, item), { id: (origin === null || origin === void 0 ? void 0 : origin.id) || helper.guid(), index: index, width: (origin === null || origin === void 0 ? void 0 : origin.width) || 0, minWidth: (origin === null || origin === void 0 ? void 0 : origin.minWidth) || 0, realWidth: (origin === null || origin === void 0 ? void 0 : origin.realWidth) || 0, rawIndex: index - PARTITION_INDEX, type: item.type || 'plain', pristine: item.pristine || item, toggled: item.toggled !== false, breakpoint: item.breakpoint, isPrimary: index === PARTITION_INDEX });
var id = (origin === null || origin === void 0 ? void 0 : origin.id) || helper.guid();
// 还不知道为何会出现这个,先用这种方式避免 id 重复
if (ids_1.includes(id)) {
id = helper.guid();
}
ids_1.push(id);
return tslib.__assign(tslib.__assign({}, item), { id: id, index: index, width: (origin === null || origin === void 0 ? void 0 : origin.width) || 0, minWidth: (origin === null || origin === void 0 ? void 0 : origin.minWidth) || 0, realWidth: (origin === null || origin === void 0 ? void 0 : origin.realWidth) || 0, rawIndex: index - PARTITION_INDEX, type: item.type || 'plain', pristine: item.pristine || item, toggled: item.toggled !== false, breakpoint: item.breakpoint, isPrimary: index === PARTITION_INDEX });
});

@@ -1128,12 +1133,21 @@ self.columns.replace(columns);

self.selectedRows.clear();
helper.eachTree(self.rows, function (item) {
if (~selected.indexOf(item.pristine)) {
self.selectedRows.push(item.id);
selected.forEach(function (item) {
var resolved = self.rows.find(function (a) { return a.pristine === item; });
// 先严格比较,
if (!resolved) {
resolved = self.rows.find(function (a) {
var selectValue = item[valueField || 'value'];
var itemValue = a.pristine[valueField || 'value'];
return selectValue === itemValue;
});
}
else if (find__default["default"](selected, function (a) {
return a[valueField || 'value'] &&
a[valueField || 'value'] == item.pristine[valueField || 'value'];
})) {
self.selectedRows.push(item.id);
// 再宽松比较
if (!resolved) {
resolved = self.rows.find(function (a) {
var selectValue = item[valueField || 'value'];
var itemValue = a.pristine[valueField || 'value'];
return selectValue == itemValue;
});
}
resolved && self.selectedRows.push(resolved);
});

@@ -1140,0 +1154,0 @@ updateCheckDisable();

@@ -6,2 +6,3 @@ import { Instance, SnapshotIn, IAnyModelType } from 'mobx-state-tree';

title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
name: import("mobx-state-tree").IType<string | undefined, string, string>;

@@ -77,2 +78,3 @@ toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;

title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
name: import("mobx-state-tree").IType<string | undefined, string, string>;

@@ -147,2 +149,3 @@ toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;

formsRef: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<any, any, any>>, [undefined]>;
canAccessSuperData: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
}, {

@@ -166,3 +169,3 @@ readonly parentStore: any;

reset(): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;

@@ -184,3 +187,3 @@ setCurrentAction(action: object): void;

fetchData: (api: Api, data?: object | undefined, options?: fetchOptions | undefined) => Promise<any>;
reInitData: (data: object | undefined, replace?: boolean) => void;
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
updateMessage: (msg?: string | undefined, error?: boolean) => void;

@@ -196,2 +199,3 @@ clearMessage: () => void;

title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
name: import("mobx-state-tree").IType<string | undefined, string, string>;

@@ -210,2 +214,3 @@ toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;

title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
name: import("mobx-state-tree").IType<string | undefined, string, string>;

@@ -225,2 +230,3 @@ toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;

title: any;
label: any;
name: string;

@@ -239,2 +245,3 @@ toggled: boolean;

title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
name: import("mobx-state-tree").IType<string | undefined, string, string>;

@@ -255,2 +262,3 @@ toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;

title: any;
label: any;
name: string;

@@ -269,2 +277,3 @@ toggled: boolean;

title: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
name: import("mobx-state-tree").IType<string | undefined, string, string>;

@@ -521,3 +530,5 @@ toggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;

} & {
update: (config: Partial<STableStore2>) => void;
update: (config: Partial<STableStore2>, options?: {
resolveDefinitions?: ((ref: string) => any) | undefined;
} | undefined) => void;
persistSaveToggledColumns: () => void;

@@ -524,0 +535,0 @@ setOrderByInfo: (key: string, direction: 'asc' | 'desc') => void;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -36,2 +36,3 @@ */

title: mobxStateTree.types.optional(mobxStateTree.types.frozen(), undefined),
label: mobxStateTree.types.optional(mobxStateTree.types.frozen(), undefined),
name: '',

@@ -163,3 +164,4 @@ toggled: false,

rowSelectionKeyField: 'id',
formsRef: mobxStateTree.types.optional(mobxStateTree.types.array(mobxStateTree.types.frozen()), [])
formsRef: mobxStateTree.types.optional(mobxStateTree.types.array(mobxStateTree.types.frozen()), []),
canAccessSuperData: false
})

@@ -169,3 +171,3 @@ .views(function (self) {

if (self.columnsTogglable === 'auto') {
return self.columns.filter.length > 10;
return self.columns.filter(function (item) { return !/^__/.test(item.type); }).length > 5;
}

@@ -263,3 +265,5 @@ return !!self.columnsTogglable;

get dataSource() {
return self.rows.map(function (item) { return item.data; });
return self.rows.map(function (item) {
return self.canAccessSuperData ? item.locals : item.data;
});
},

@@ -306,6 +310,13 @@ get currentSelectedRowKeys() {

.actions(function (self) {
function updateColumns(columns) {
function updateColumns(columns, options) {
if (columns && Array.isArray(columns)) {
var cols = columns.filter(function (column) { return column; }).concat();
cols = cols.map(function (item, index) { return (tslib.__assign(tslib.__assign({}, item), { index: index, type: item.type || 'plain', pristine: item, toggled: item.toggled !== false, breakpoint: item.breakpoint, children: item.children ? updateColumns(item.children) : [] })); });
cols = cols.map(function (item, index) {
if ((options === null || options === void 0 ? void 0 : options.resolveDefinitions) &&
typeof (item === null || item === void 0 ? void 0 : item.$ref) == 'string' &&
item.$ref) {
item = tslib.__assign(tslib.__assign({}, options.resolveDefinitions(item.$ref)), item);
}
return tslib.__assign(tslib.__assign({}, item), { index: index, type: item.type || 'plain', pristine: item, toggled: item.toggled !== false, breakpoint: item.breakpoint, children: item.children ? updateColumns(item.children, options) : [] });
});
return cols;

@@ -315,5 +326,7 @@ }

}
function update(config) {
function update(config, options) {
config.columnsTogglable !== void 0 &&
(self.columnsTogglable = config.columnsTogglable);
config.canAccessSuperData !== undefined &&
(self.canAccessSuperData = !!config.canAccessSuperData);
if (typeof config.orderBy === 'string') {

@@ -326,3 +339,3 @@ setOrderByInfo(config.orderBy, config.order === 'desc' ? 'desc' : 'asc');

if (config.columns && Array.isArray(config.columns)) {
self.columns.replace(updateColumns(config.columns));
self.columns.replace(updateColumns(config.columns, options));
}

@@ -519,3 +532,3 @@ }

__saved: Date.now()
}, !!api$1 && api$1.replaceData);
}, !!api$1 && api$1.replaceData, api$1 === null || api$1 === void 0 ? void 0 : api$1.concatDataFields);
self.updatedAt = Date.now();

@@ -522,0 +535,0 @@ }

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -133,2 +133,9 @@ /// <reference types="react" />

/**
* 是否将两次返回的数据字段,做一个合并。配置返回对象中的字段名,支持配置多个。
*
* 比如:同时返回 log 字段,第一次返回 {log: '1'},第二次返回 {log: '2'},合并后的结果是 {log: ['1', '2']]}
* 再比如:同时返回 items 字段,第一次返回 {items: [1, 2]},第二次返回 {items: [3, 4]},合并后的结果是 {items: [1, 2, 3, 4]}
*/
concatDataFields?: string | Array<string>;
/**
* 是否自动刷新,当 url 中的取值结果变化时,自动刷新数据。

@@ -135,0 +142,0 @@ *

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

@@ -349,2 +349,3 @@ import React from 'react';

export declare function isNumeric(value: any): boolean;
export type PrimitiveTypes = 'boolean' | 'number';
/**

@@ -354,5 +355,8 @@ * 解析Query字符串中的原始类型,目前仅支持转化布尔类型

* @param query 查询字符串
* @param options 配置参数
* @returns 解析后的查询字符串
*/
export declare function parsePrimitiveQueryString(rawQuery: Record<string, any>): any;
export declare function parsePrimitiveQueryString(rawQuery: Record<string, any>, options?: {
primitiveTypes: PrimitiveTypes[];
}): any;
/**

@@ -371,2 +375,3 @@ * 获取URL链接中的query参数(包含hash mode)

parsePrimitive?: boolean;
primitiveTypes?: PrimitiveTypes[];
}): Record<string, any>;

@@ -373,0 +378,0 @@ export declare function differenceFromAll<T>(allOptions: Array<T>, options: Array<T>, getValue: (item: T) => any): Array<T>;

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -1458,13 +1458,30 @@ */

* @param query 查询字符串
* @param options 配置参数
* @returns 解析后的查询字符串
*/
function parsePrimitiveQueryString(rawQuery) {
function parsePrimitiveQueryString(rawQuery, options) {
if (!isPlainObject__default["default"](rawQuery)) {
return rawQuery;
}
options = options || { primitiveTypes: ['boolean'] };
if (!Array.isArray(options.primitiveTypes) ||
options.primitiveTypes.length === 0) {
options.primitiveTypes = ['boolean'];
}
var query = JSONValueMap(rawQuery, function (value) {
/** 解析布尔类型,后续有需要在这里扩充 */
if (value === 'true' || value === 'false') {
var _a, _b;
if ((((_a = options === null || options === void 0 ? void 0 : options.primitiveTypes) === null || _a === void 0 ? void 0 : _a.includes('boolean')) && value === 'true') ||
value === 'false') {
/** 解析布尔类型 */
return value === 'true';
}
else if (((_b = options === null || options === void 0 ? void 0 : options.primitiveTypes) === null || _b === void 0 ? void 0 : _b.includes('number')) &&
isNumeric(value) &&
isFinite(value) &&
value >= -Number.MAX_SAFE_INTEGER &&
value <= Number.MAX_SAFE_INTEGER) {
/** 解析数字类型 */
var result = Number(value);
return !isNaN__default["default"](result) ? result : value;
}
return value;

@@ -1483,3 +1500,3 @@ });

var _a;
var _b = (options || {}).parsePrimitive, parsePrimitive = _b === void 0 ? false : _b;
var _b = options || {}, _c = _b.parsePrimitive, parsePrimitive = _c === void 0 ? false : _c, _d = _b.primitiveTypes, primitiveTypes = _d === void 0 ? ['boolean'] : _d;
var query = (location && !(location instanceof Location) && (location === null || location === void 0 ? void 0 : location.query)) ||

@@ -1490,3 +1507,3 @@ (location && (location === null || location === void 0 ? void 0 : location.search) && qsparse(location.search.substring(1))) ||

? parsePrimitive
? parsePrimitiveQueryString(query)
? parsePrimitiveQueryString(query, { primitiveTypes: primitiveTypes })
: query

@@ -1493,0 +1510,0 @@ : {};

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

export * from './api';
export * from './attachmentAdpator';
export * from './autobind';
export * from './browser';
export * from './ColorScale';
export * from './columnsSplit';
export * from './concatData';
export * from './dataMapping';

@@ -7,0 +9,0 @@ export * from './DataSchema';

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -22,3 +22,3 @@ */

function createRendererEvent(type, context) {
var rendererEvent = {
var rendererEvent = Object.defineProperties({
context: object.extendObject({ pristineData: context.data }, context),

@@ -43,3 +43,19 @@ type: type,

}
};
}, {
context: {
enumerable: false
},
pristineData: {
enumerable: false
},
preventDefault: {
enumerable: false
},
stopPropagation: {
enumerable: false
},
setData: {
enumerable: false
}
});
return rendererEvent;

@@ -46,0 +62,0 @@ }

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -166,3 +166,3 @@ */

key = valueMap[key] || key;
styles.push("".concat(kebabCase__default["default"](key), ": ").concat(value + ((weights === null || weights === void 0 ? void 0 : weights.important) ? ' !important' : ''), ";"));
styles.push("".concat(key.startsWith('--') ? key : kebabCase__default["default"](key), ": ").concat(value + ((weights === null || weights === void 0 ? void 0 : weights.important) ? ' !important' : ''), ";"));
};

@@ -179,4 +179,3 @@ Object.keys(statusMap[status]).forEach(function (key) {

style_1['bottom-right-border-radius'] || 0,
style_1['bottom-left-border-radius'] || 0,
(weights === null || weights === void 0 ? void 0 : weights.important) ? ' !important' : ''
style_1['bottom-left-border-radius'] || 0
].join(' '));

@@ -188,4 +187,3 @@ }

var value = style_1[k];
value &&
fn(k, value + ((weights === null || weights === void 0 ? void 0 : weights.important) ? ' !important' : ''));
value && fn(k, value);
}

@@ -192,0 +190,0 @@ });

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

/**
* amis-core v3.6.3
* amis-core v6.0.0
* Copyright 2018-2023 fex

@@ -4,0 +4,0 @@ */

{
"name": "amis-core",
"version": "3.6.3",
"version": "6.0.0",
"description": "amis-core",

@@ -28,2 +28,3 @@ "main": "lib/index.js",

"react-dom": "^18.2.0",
"resize-observer-polyfill": "^1.5.1",
"rimraf": "^3.0.2",

@@ -50,3 +51,3 @@ "rollup": "^2.79.1",

"dependencies": {
"amis-formula": "^3.6.3",
"amis-formula": "^6.0.0",
"classnames": "2.3.2",

@@ -112,3 +113,3 @@ "file-saver": "^2.0.2",

},
"gitHead": "78b053d9c075ca721ca2ceeee33a81f4b58daf3c"
"gitHead": "4adf8b9f4080bc440d54940899469706949e88cc"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc