amis-core 6.14.0-beta.4 → 6.14.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/Root.js +1 -1
- package/esm/RootRenderer.js +1 -1
- package/esm/SchemaRenderer.js +2 -1
- package/esm/Scoped.js +2 -1
- package/esm/StatusScoped.js +1 -1
- package/esm/StyleManager.js +1 -1
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +1 -1
- package/esm/actions/Action.js +2 -1
- package/esm/actions/AjaxAction.js +1 -1
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.js +1 -1
- package/esm/actions/CmptAction.js +1 -1
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.js +2 -1
- package/esm/actions/DialogAction.js +2 -1
- package/esm/actions/DrawerAction.js +2 -1
- package/esm/actions/EmailAction.js +1 -1
- package/esm/actions/EventAction.js +2 -1
- package/esm/actions/LinkAction.js +1 -1
- package/esm/actions/LoopAction.js +1 -1
- package/esm/actions/PageAction.js +1 -1
- package/esm/actions/ParallelAction.js +1 -1
- package/esm/actions/PrintAction.js +1 -1
- package/esm/actions/StatusAction.js +1 -1
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/actions/WaitAction.js +1 -1
- package/esm/components/Animations.js +2 -1
- package/esm/components/CustomStyle.js +60 -33
- package/esm/components/ErrorBoundary.js +1 -1
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +2 -1
- package/esm/components/PopOver.js +2 -1
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.js +1 -1
- package/esm/globalVar.js +1 -1
- package/esm/globalVarClientHandler.js +1 -1
- package/esm/globalVarDefaultValueHandler.js +1 -1
- package/esm/index.js +5 -5
- package/esm/locale.js +1 -1
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.js +1 -1
- package/esm/renderers/Item.js +1 -1
- package/esm/renderers/Options.d.ts +3 -2
- package/esm/renderers/Options.js +57 -5
- package/esm/renderers/Placeholder.js +1 -1
- package/esm/renderers/builtin.js +1 -1
- package/esm/renderers/register.js +1 -1
- package/esm/renderers/wrapControl.js +1 -1
- package/esm/store/app.js +2 -1
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.js +1 -1
- package/esm/store/form.js +1 -1
- package/esm/store/formItem.js +1 -1
- package/esm/store/iRenderer.js +2 -1
- package/esm/store/index.js +1 -1
- package/esm/store/list.js +1 -1
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.js +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.js +1 -1
- package/esm/store/root.js +2 -1
- package/esm/store/service.js +2 -1
- package/esm/store/status.js +1 -1
- package/esm/store/table.js +1 -1
- package/esm/store/table2.js +1 -1
- package/esm/theme.js +1 -1
- package/esm/utils/Animation.js +1 -1
- package/esm/utils/ColorScale.js +1 -1
- package/esm/utils/DataSchema.js +1 -1
- package/esm/utils/DataScope.js +1 -1
- package/esm/utils/RootClose.js +13 -3
- package/esm/utils/SimpleMap.js +1 -1
- package/esm/utils/animations.js +1 -1
- package/esm/utils/api.js +1 -1
- package/esm/utils/arraySlice.js +1 -1
- package/esm/utils/attachmentAdpator.js +1 -1
- package/esm/utils/autobind.js +1 -1
- package/esm/utils/browser.js +1 -1
- package/esm/utils/columnsSplit.js +1 -1
- package/esm/utils/concatData.js +1 -1
- package/esm/utils/dataMapping.js +1 -1
- package/esm/utils/date.js +1 -1
- package/esm/utils/debug.js +1 -1
- package/esm/utils/decodeEntity.js +1 -1
- package/esm/utils/dom.js +2 -2
- package/esm/utils/errors.js +1 -1
- package/esm/utils/escapeHtml.js +1 -1
- package/esm/utils/filter-schema.js +1 -1
- package/esm/utils/filter.js +1 -1
- package/esm/utils/formatDuration.js +1 -1
- package/esm/utils/formula.js +1 -1
- package/esm/utils/getPageId.js +1 -1
- package/esm/utils/getVariable.js +1 -1
- package/esm/utils/grammar.js +1 -1
- package/esm/utils/handleAction.js +1 -1
- package/esm/utils/helper.d.ts +2 -2
- package/esm/utils/helper.js +3 -3
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.js +1 -1
- package/esm/utils/image.js +1 -1
- package/esm/utils/index.js +2 -1
- package/esm/utils/isPureVariable.js +1 -1
- package/esm/utils/json-schema-2-amis-schema.js +1 -1
- package/esm/utils/keyToPath.js +1 -1
- package/esm/utils/labelToString.js +1 -1
- package/esm/utils/loopTooMuch.js +1 -1
- package/esm/utils/makeSorter.js +1 -1
- package/esm/utils/math.js +1 -1
- package/esm/utils/memoryParse.js +1 -1
- package/esm/utils/normalizeLink.js +1 -1
- package/esm/utils/normalizeOptions.js +1 -1
- package/esm/utils/object.js +1 -1
- package/esm/utils/offset.js +1 -1
- package/esm/utils/offsetParent.js +1 -1
- package/esm/utils/optionValueCompare.js +1 -1
- package/esm/utils/position.js +1 -1
- package/esm/utils/prettyBytes.js +1 -1
- package/esm/utils/printElement.js +1 -1
- package/esm/utils/renderer-event.js +1 -1
- package/esm/utils/replaceText.js +1 -1
- package/esm/utils/resize-sensor.js +1 -1
- package/esm/utils/resolveCondition.js +1 -1
- package/esm/utils/resolveVariable.js +1 -1
- package/esm/utils/resolveVariableAndFilter.js +1 -1
- package/esm/utils/resolveVariableAndFilterForAsync.js +1 -1
- package/esm/utils/scrollPosition.js +1 -1
- package/esm/utils/string2regExp.js +1 -1
- package/esm/utils/stripNumber.js +1 -1
- package/esm/utils/style-helper.d.ts +5 -1
- package/esm/utils/style-helper.js +30 -13
- package/esm/utils/style.js +1 -1
- package/esm/utils/toNumber.js +1 -1
- package/esm/utils/tokenize.js +1 -1
- package/esm/utils/tpl-builtin.js +1 -1
- package/esm/utils/tpl-lodash.js +1 -1
- package/esm/utils/tpl.js +1 -1
- package/esm/utils/uncontrollable.js +1 -1
- package/esm/utils/validateId.js +1 -1
- package/esm/utils/validations.js +1 -1
- package/esm/utils/visitedCache.js +1 -1
- package/lib/Root.js +1 -1
- package/lib/RootRenderer.js +1 -1
- package/lib/SchemaRenderer.js +2 -1
- package/lib/Scoped.js +2 -1
- package/lib/StatusScoped.js +1 -1
- package/lib/StyleManager.js +1 -1
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +1 -1
- package/lib/actions/Action.js +2 -1
- package/lib/actions/AjaxAction.js +1 -1
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.js +1 -1
- package/lib/actions/CmptAction.js +1 -1
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.js +2 -1
- package/lib/actions/DialogAction.js +2 -1
- package/lib/actions/DrawerAction.js +2 -1
- package/lib/actions/EmailAction.js +1 -1
- package/lib/actions/EventAction.js +2 -1
- package/lib/actions/LinkAction.js +1 -1
- package/lib/actions/LoopAction.js +1 -1
- package/lib/actions/PageAction.js +1 -1
- package/lib/actions/ParallelAction.js +1 -1
- package/lib/actions/PrintAction.js +1 -1
- package/lib/actions/StatusAction.js +1 -1
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/actions/WaitAction.js +1 -1
- package/lib/components/Animations.js +2 -1
- package/lib/components/CustomStyle.js +62 -31
- package/lib/components/ErrorBoundary.js +1 -1
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.js +2 -1
- package/lib/components/PopOver.js +2 -1
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.js +1 -1
- package/lib/globalVar.js +1 -1
- package/lib/globalVarClientHandler.js +1 -1
- package/lib/globalVarDefaultValueHandler.js +1 -1
- package/lib/index.js +5 -4
- package/lib/locale.js +1 -1
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.js +1 -1
- package/lib/renderers/Item.js +1 -1
- package/lib/renderers/Options.d.ts +3 -2
- package/lib/renderers/Options.js +57 -5
- package/lib/renderers/Placeholder.js +1 -1
- package/lib/renderers/builtin.js +1 -1
- package/lib/renderers/register.js +1 -1
- package/lib/renderers/wrapControl.js +1 -1
- package/lib/store/app.js +2 -1
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.js +1 -1
- package/lib/store/form.js +1 -1
- package/lib/store/formItem.js +1 -1
- package/lib/store/iRenderer.js +2 -1
- package/lib/store/index.js +1 -1
- package/lib/store/list.js +1 -1
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.js +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.js +1 -1
- package/lib/store/root.js +2 -1
- package/lib/store/service.js +2 -1
- package/lib/store/status.js +1 -1
- package/lib/store/table.js +1 -1
- package/lib/store/table2.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/utils/Animation.js +1 -1
- package/lib/utils/ColorScale.js +1 -1
- package/lib/utils/DataSchema.js +1 -1
- package/lib/utils/DataScope.js +1 -1
- package/lib/utils/RootClose.js +13 -2
- package/lib/utils/SimpleMap.js +1 -1
- package/lib/utils/animations.js +1 -1
- package/lib/utils/api.js +1 -1
- package/lib/utils/arraySlice.js +1 -1
- package/lib/utils/attachmentAdpator.js +1 -1
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/browser.js +1 -1
- package/lib/utils/columnsSplit.js +1 -1
- package/lib/utils/concatData.js +1 -1
- package/lib/utils/dataMapping.js +1 -1
- package/lib/utils/date.js +1 -1
- package/lib/utils/debug.js +1 -1
- package/lib/utils/decodeEntity.js +1 -1
- package/lib/utils/dom.js +2 -2
- package/lib/utils/errors.js +1 -1
- package/lib/utils/escapeHtml.js +1 -1
- package/lib/utils/filter-schema.js +1 -1
- package/lib/utils/filter.js +1 -1
- package/lib/utils/formatDuration.js +1 -1
- package/lib/utils/formula.js +1 -1
- package/lib/utils/getPageId.js +1 -1
- package/lib/utils/getVariable.js +1 -1
- package/lib/utils/grammar.js +1 -1
- package/lib/utils/handleAction.js +1 -1
- package/lib/utils/helper.d.ts +2 -2
- package/lib/utils/helper.js +3 -3
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.js +1 -1
- package/lib/utils/image.js +1 -1
- package/lib/utils/index.js +2 -1
- package/lib/utils/isPureVariable.js +1 -1
- package/lib/utils/json-schema-2-amis-schema.js +1 -1
- package/lib/utils/keyToPath.js +1 -1
- package/lib/utils/labelToString.js +1 -1
- package/lib/utils/loopTooMuch.js +1 -1
- package/lib/utils/makeSorter.js +1 -1
- package/lib/utils/math.js +1 -1
- package/lib/utils/memoryParse.js +1 -1
- package/lib/utils/normalizeLink.js +1 -1
- package/lib/utils/normalizeOptions.js +1 -1
- package/lib/utils/object.js +1 -1
- package/lib/utils/offset.js +1 -1
- package/lib/utils/offsetParent.js +1 -1
- package/lib/utils/optionValueCompare.js +1 -1
- package/lib/utils/position.js +1 -1
- package/lib/utils/prettyBytes.js +1 -1
- package/lib/utils/printElement.js +1 -1
- package/lib/utils/renderer-event.js +1 -1
- package/lib/utils/replaceText.js +1 -1
- package/lib/utils/resize-sensor.js +1 -1
- package/lib/utils/resolveCondition.js +1 -1
- package/lib/utils/resolveVariable.js +1 -1
- package/lib/utils/resolveVariableAndFilter.js +1 -1
- package/lib/utils/resolveVariableAndFilterForAsync.js +1 -1
- package/lib/utils/scrollPosition.js +1 -1
- package/lib/utils/string2regExp.js +1 -1
- package/lib/utils/stripNumber.js +1 -1
- package/lib/utils/style-helper.d.ts +5 -1
- package/lib/utils/style-helper.js +31 -12
- package/lib/utils/style.js +1 -1
- package/lib/utils/toNumber.js +1 -1
- package/lib/utils/tokenize.js +1 -1
- package/lib/utils/tpl-builtin.js +1 -1
- package/lib/utils/tpl-lodash.js +1 -1
- package/lib/utils/tpl.js +1 -1
- package/lib/utils/uncontrollable.js +1 -1
- package/lib/utils/validateId.js +1 -1
- package/lib/utils/validations.js +1 -1
- package/lib/utils/visitedCache.js +1 -1
- package/package.json +2 -2
package/esm/utils/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.5
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -40,6 +40,7 @@ import 'lodash/cloneDeep';
|
|
|
40
40
|
import 'lodash/map';
|
|
41
41
|
import 'lodash/isEmpty';
|
|
42
42
|
import 'lodash/kebabCase';
|
|
43
|
+
import 'lodash/some';
|
|
43
44
|
import 'uncontrollable';
|
|
44
45
|
import 'hoist-non-react-statics';
|
|
45
46
|
export { addRule, str2rules, validate, validateMessages, validateObject, validations } from './validations.js';
|
package/esm/utils/keyToPath.js
CHANGED
package/esm/utils/loopTooMuch.js
CHANGED
package/esm/utils/makeSorter.js
CHANGED
package/esm/utils/math.js
CHANGED
package/esm/utils/memoryParse.js
CHANGED
package/esm/utils/object.js
CHANGED
package/esm/utils/offset.js
CHANGED
package/esm/utils/position.js
CHANGED
package/esm/utils/prettyBytes.js
CHANGED
package/esm/utils/replaceText.js
CHANGED
package/esm/utils/stripNumber.js
CHANGED
|
@@ -54,16 +54,19 @@ export declare function insertCustomStyle(params: {
|
|
|
54
54
|
defaultData?: any;
|
|
55
55
|
customStyleClassPrefix?: string;
|
|
56
56
|
doc?: Document;
|
|
57
|
+
cssHasExpression?: boolean;
|
|
57
58
|
[propName: string]: any;
|
|
58
59
|
}): void;
|
|
59
60
|
/**
|
|
60
61
|
* 根据路径获取默认值
|
|
61
62
|
*/
|
|
62
63
|
export declare function getValueByPath(path: string, data: any): any;
|
|
64
|
+
export declare function hasExpression(customStyle: any): boolean;
|
|
63
65
|
export declare function formatCustomStyle(params: {
|
|
64
66
|
customStyle: any;
|
|
65
67
|
id?: string;
|
|
66
68
|
doc?: Document;
|
|
69
|
+
cssHasExpression?: boolean;
|
|
67
70
|
customStyleClassPrefix?: string;
|
|
68
71
|
[propName: string]: any;
|
|
69
72
|
}): {
|
|
@@ -78,6 +81,7 @@ export declare function insertEditCustomStyle(params: {
|
|
|
78
81
|
customStyle: any;
|
|
79
82
|
id?: string;
|
|
80
83
|
doc?: Document;
|
|
84
|
+
cssHasExpression?: boolean;
|
|
81
85
|
customStyleClassPrefix?: string;
|
|
82
86
|
[propName: string]: any;
|
|
83
87
|
}): string;
|
|
@@ -92,7 +96,7 @@ export interface InsertCustomStyle {
|
|
|
92
96
|
/**
|
|
93
97
|
* 移除自定义样式
|
|
94
98
|
*/
|
|
95
|
-
export declare function removeCustomStyle(type: string, id: string, doc?: Document, data?: any): void;
|
|
99
|
+
export declare function removeCustomStyle(type: string, id: string, doc?: Document, data?: any, cssHasExpression?: boolean): void;
|
|
96
100
|
export declare function formatInputThemeCss(themeCss: any): any;
|
|
97
101
|
export declare function setThemeClassName(params: {
|
|
98
102
|
name: string | string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.5
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -11,6 +11,8 @@ import map from 'lodash/map';
|
|
|
11
11
|
import isEmpty from 'lodash/isEmpty';
|
|
12
12
|
import kebabCase from 'lodash/kebabCase';
|
|
13
13
|
import { resolveVariableAndFilter } from './resolveVariableAndFilter.js';
|
|
14
|
+
import some from 'lodash/some';
|
|
15
|
+
import { isExpression } from './formula.js';
|
|
14
16
|
|
|
15
17
|
var valueMap = {
|
|
16
18
|
'marginTop': 'margin-top',
|
|
@@ -155,7 +157,8 @@ function formatStyle(themeCss, classNames, id, defaultData, data) {
|
|
|
155
157
|
}
|
|
156
158
|
var className = item.key + '-' + (id === null || id === void 0 ? void 0 : id.replace('u:', ''));
|
|
157
159
|
var weightsList = item.weights || {};
|
|
158
|
-
|
|
160
|
+
var cssHasExpression = hasExpression(body);
|
|
161
|
+
if (typeof (data === null || data === void 0 ? void 0 : data.index) === 'number' && cssHasExpression !== false) {
|
|
159
162
|
className += "-".concat(data.index);
|
|
160
163
|
}
|
|
161
164
|
var statusMap = {
|
|
@@ -269,14 +272,14 @@ function formatStyle(themeCss, classNames, id, defaultData, data) {
|
|
|
269
272
|
}
|
|
270
273
|
function insertCustomStyle(params) {
|
|
271
274
|
var _a;
|
|
272
|
-
var themeCss = params.themeCss, classNames = params.classNames, id = params.id, defaultData = params.defaultData, customStyleClassPrefix = params.customStyleClassPrefix, doc = params.doc, data = params.data;
|
|
275
|
+
var themeCss = params.themeCss, classNames = params.classNames, id = params.id, defaultData = params.defaultData, customStyleClassPrefix = params.customStyleClassPrefix, doc = params.doc, data = params.data, cssHasExpression = params.cssHasExpression;
|
|
273
276
|
if (!themeCss) {
|
|
274
277
|
return;
|
|
275
278
|
}
|
|
276
279
|
var value = formatStyle(themeCss, classNames, id, defaultData, data).value;
|
|
277
280
|
value = customStyleClassPrefix ? "".concat(customStyleClassPrefix, " ").concat(value) : value;
|
|
278
281
|
var classId = ((_a = id === null || id === void 0 ? void 0 : id.replace) === null || _a === void 0 ? void 0 : _a.call(id, 'u:', '')) || id + '';
|
|
279
|
-
if (typeof (data === null || data === void 0 ? void 0 : data.index) === 'number') {
|
|
282
|
+
if (typeof (data === null || data === void 0 ? void 0 : data.index) === 'number' && cssHasExpression !== false) {
|
|
280
283
|
classId += "-".concat(data.index);
|
|
281
284
|
}
|
|
282
285
|
// 这里需要插入到wrapperCustomStyle的前面
|
|
@@ -334,15 +337,27 @@ function traverseStyle(style, path, result) {
|
|
|
334
337
|
}
|
|
335
338
|
});
|
|
336
339
|
}
|
|
340
|
+
function hasExpression(customStyle) {
|
|
341
|
+
var styles = {};
|
|
342
|
+
traverseStyle(customStyle || {}, '', styles);
|
|
343
|
+
if (!isEmpty(styles)) {
|
|
344
|
+
return some(Object.keys(styles), function (key) {
|
|
345
|
+
return some(styles[key], function (value, k) {
|
|
346
|
+
return isExpression(value) || isExpression(k);
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
337
352
|
function formatCustomStyle(params) {
|
|
338
353
|
var _a, _b;
|
|
339
|
-
var customStyle = params.customStyle; params.doc; var data = params.data, customStyleClassPrefix = params.customStyleClassPrefix;
|
|
354
|
+
var customStyle = params.customStyle; params.doc; var data = params.data, cssHasExpression = params.cssHasExpression, customStyleClassPrefix = params.customStyleClassPrefix;
|
|
340
355
|
var id = ((_b = (_a = params.id) === null || _a === void 0 ? void 0 : _a.replace) === null || _b === void 0 ? void 0 : _b.call(_a, 'u:', '')) || params.id + '';
|
|
341
356
|
var styles = {};
|
|
342
357
|
traverseStyle(customStyle, '', styles);
|
|
343
358
|
var content = '';
|
|
344
359
|
var index = '';
|
|
345
|
-
if (typeof (data === null || data === void 0 ? void 0 : data.index) === 'number') {
|
|
360
|
+
if (typeof (data === null || data === void 0 ? void 0 : data.index) === 'number' && cssHasExpression !== false) {
|
|
346
361
|
index = "-".concat(data.index);
|
|
347
362
|
}
|
|
348
363
|
if (!isEmpty(styles)) {
|
|
@@ -352,17 +367,18 @@ function formatCustomStyle(params) {
|
|
|
352
367
|
}
|
|
353
368
|
Object.keys(styles).forEach(function (key) {
|
|
354
369
|
if (!isObject(styles[key])) {
|
|
355
|
-
|
|
370
|
+
// 这里如果有表达式 应该先运行表达式 在执行替换 否则表达式始终运行不过去
|
|
371
|
+
content += "\n".concat(className_1, " {\n ").concat(key, ": ").concat((resolveVariableAndFilter(styles[key], data, '| raw') || styles[key]).replace(/['|"]/g, ''), "\n}");
|
|
356
372
|
}
|
|
357
373
|
else if (key.startsWith('root')) {
|
|
358
374
|
var res = map(styles[key], function (value, key) {
|
|
359
|
-
return "".concat(key, ": ").concat(resolveVariableAndFilter(value.replace(/['|"]/g, ''),
|
|
375
|
+
return "".concat(key, ": ").concat((resolveVariableAndFilter(value, data, '| raw') || value).replace(/['|"]/g, ''), ";");
|
|
360
376
|
});
|
|
361
377
|
content += "\n".concat(key.replace(/root/g, className_1), " {\n ").concat(res.join('\n '), "\n}");
|
|
362
378
|
}
|
|
363
379
|
else {
|
|
364
380
|
var res = map(styles[key], function (value, key) {
|
|
365
|
-
return "".concat(key, ": ").concat(resolveVariableAndFilter(value.replace(/['|"]/g, ''),
|
|
381
|
+
return "".concat(key, ": ").concat((resolveVariableAndFilter(value, data, '| raw') || value).replace(/['|"]/g, ''), ";");
|
|
366
382
|
});
|
|
367
383
|
var keys = key.split(',');
|
|
368
384
|
content += "\n".concat(keys.map(function (key) { return "".concat(className_1, " ").concat(key); }), " {\n ").concat(res.join('\n '), "\n}");
|
|
@@ -392,10 +408,10 @@ function insertEditCustomStyle(params) {
|
|
|
392
408
|
/**
|
|
393
409
|
* 移除自定义样式
|
|
394
410
|
*/
|
|
395
|
-
function removeCustomStyle(type, id, doc, data) {
|
|
411
|
+
function removeCustomStyle(type, id, doc, data, cssHasExpression) {
|
|
396
412
|
var _a;
|
|
397
413
|
var styleId = 'amis-' + (type ? type + '-' : '') + (((_a = id.replace) === null || _a === void 0 ? void 0 : _a.call(id, 'u:', '')) || id + '');
|
|
398
|
-
if (typeof (data === null || data === void 0 ? void 0 : data.index) === 'number') {
|
|
414
|
+
if (typeof (data === null || data === void 0 ? void 0 : data.index) === 'number' && cssHasExpression !== false) {
|
|
399
415
|
styleId += "-".concat(data.index);
|
|
400
416
|
}
|
|
401
417
|
var style = (doc || document).getElementById(styleId);
|
|
@@ -422,8 +438,9 @@ function setThemeClassName(params) {
|
|
|
422
438
|
if (!id || !themeCss) {
|
|
423
439
|
return '';
|
|
424
440
|
}
|
|
441
|
+
var cssHasExpression = hasExpression(themeCss || {});
|
|
425
442
|
var index = '';
|
|
426
|
-
if (typeof (data === null || data === void 0 ? void 0 : data.index) === 'number') {
|
|
443
|
+
if (typeof (data === null || data === void 0 ? void 0 : data.index) === 'number' && cssHasExpression !== false) {
|
|
427
444
|
index = "-".concat(data.index);
|
|
428
445
|
}
|
|
429
446
|
function setClassName(name, id) {
|
|
@@ -443,4 +460,4 @@ function setThemeClassName(params) {
|
|
|
443
460
|
}
|
|
444
461
|
}
|
|
445
462
|
|
|
446
|
-
export { addStyle, findOrCreateStyle, formatCustomStyle, formatInputThemeCss, formatStyle, getValueByPath, inheritValueMap, insertCustomStyle, insertEditCustomStyle, insertStyle, removeCustomStyle, setThemeClassName, valueMap };
|
|
463
|
+
export { addStyle, findOrCreateStyle, formatCustomStyle, formatInputThemeCss, formatStyle, getValueByPath, hasExpression, inheritValueMap, insertCustomStyle, insertEditCustomStyle, insertStyle, removeCustomStyle, setThemeClassName, valueMap };
|
package/esm/utils/style.js
CHANGED
package/esm/utils/toNumber.js
CHANGED
package/esm/utils/tokenize.js
CHANGED
package/esm/utils/tpl-builtin.js
CHANGED
package/esm/utils/tpl-lodash.js
CHANGED
package/esm/utils/tpl.js
CHANGED
package/esm/utils/validateId.js
CHANGED
package/esm/utils/validations.js
CHANGED
package/lib/Root.js
CHANGED
package/lib/RootRenderer.js
CHANGED
package/lib/SchemaRenderer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.5
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -61,6 +61,7 @@ require('lodash/isObject');
|
|
|
61
61
|
require('lodash/map');
|
|
62
62
|
require('lodash/isEmpty');
|
|
63
63
|
require('lodash/kebabCase');
|
|
64
|
+
require('lodash/some');
|
|
64
65
|
require('./utils/resolveCondition.js');
|
|
65
66
|
require('./utils/Animation.js');
|
|
66
67
|
|
package/lib/Scoped.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.5
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -54,6 +54,7 @@ require('lodash/cloneDeep');
|
|
|
54
54
|
require('lodash/map');
|
|
55
55
|
require('lodash/isEmpty');
|
|
56
56
|
require('lodash/kebabCase');
|
|
57
|
+
require('lodash/some');
|
|
57
58
|
require('uncontrollable');
|
|
58
59
|
require('./utils/validations.js');
|
|
59
60
|
require('./utils/resolveCondition.js');
|
package/lib/StatusScoped.js
CHANGED
package/lib/StyleManager.js
CHANGED
package/lib/WithRootStore.js
CHANGED
package/lib/WithStore.js
CHANGED
package/lib/actions/Action.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.5
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -49,6 +49,7 @@ require('lodash/cloneDeep');
|
|
|
49
49
|
require('lodash/map');
|
|
50
50
|
require('lodash/isEmpty');
|
|
51
51
|
require('lodash/kebabCase');
|
|
52
|
+
require('lodash/some');
|
|
52
53
|
require('uncontrollable');
|
|
53
54
|
require('hoist-non-react-statics');
|
|
54
55
|
require('../utils/validations.js');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.5
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -47,6 +47,7 @@ require('lodash/cloneDeep');
|
|
|
47
47
|
require('lodash/map');
|
|
48
48
|
require('lodash/isEmpty');
|
|
49
49
|
require('lodash/kebabCase');
|
|
50
|
+
require('lodash/some');
|
|
50
51
|
require('uncontrollable');
|
|
51
52
|
require('hoist-non-react-statics');
|
|
52
53
|
require('../utils/validations.js');
|