amis-core 6.1.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/Root.js +1 -1
- package/esm/RootRenderer.js +1 -1
- package/esm/SchemaRenderer.js +1 -1
- package/esm/Scoped.js +4 -2
- package/esm/StatusScoped.js +1 -1
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +2 -2
- package/esm/actions/Action.js +1 -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 +1 -1
- package/esm/actions/DialogAction.js +1 -1
- package/esm/actions/DrawerAction.js +1 -1
- package/esm/actions/EmailAction.js +1 -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.d.ts +19 -0
- package/esm/actions/PrintAction.js +49 -0
- package/esm/actions/StatusAction.js +1 -1
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/actions/index.d.ts +1 -0
- package/esm/components/CustomStyle.js +1 -1
- package/esm/components/ErrorBoundary.js +1 -1
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +1 -1
- package/esm/components/PopOver.js +1 -1
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.js +1 -1
- package/esm/index.d.ts +2 -1
- package/esm/index.js +5 -3
- package/esm/locale.js +1 -1
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.js +4 -4
- package/esm/renderers/Item.js +1 -1
- package/esm/renderers/Options.js +1 -1
- 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 +5 -5
- package/esm/store/app.js +1 -1
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.js +1 -1
- package/esm/store/form.js +1 -1
- package/esm/store/formItem.js +1 -1
- package/esm/store/iRenderer.js +1 -1
- package/esm/store/index.js +1 -1
- package/esm/store/list.d.ts +11 -0
- package/esm/store/list.js +8 -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 +1 -1
- package/esm/store/service.js +5 -2
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +28 -27
- package/esm/store/table.js +8 -6
- 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 +1 -1
- package/esm/utils/SimpleMap.js +1 -1
- package/esm/utils/api.js +3 -2
- package/esm/utils/arraySlice.js +1 -1
- package/esm/utils/attachmentAdpator.js +3 -2
- package/esm/utils/autobind.js +1 -1
- package/esm/utils/browser.d.ts +1 -0
- package/esm/utils/browser.js +7 -2
- 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 +7 -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/getVariable.js +1 -1
- package/esm/utils/grammar.js +1 -1
- package/esm/utils/handleAction.js +1 -1
- package/esm/utils/helper.js +1 -1
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.js +1 -1
- package/esm/utils/image.js +1 -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/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.d.ts +6 -0
- package/esm/utils/printElement.js +71 -0
- 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.js +1 -1
- package/esm/utils/style.js +1 -1
- package/esm/utils/toNumber.js +1 -1
- package/esm/utils/tokenize.js +1 -1
- package/esm/utils/tpl-builtin.js +1 -1
- package/esm/utils/tpl-lodash.js +1 -1
- package/esm/utils/tpl.js +1 -1
- package/esm/utils/uncontrollable.js +1 -1
- package/esm/utils/validateId.js +1 -1
- package/esm/utils/validations.js +1 -1
- package/lib/Root.js +1 -1
- package/lib/RootRenderer.js +1 -1
- package/lib/SchemaRenderer.js +1 -1
- package/lib/Scoped.js +4 -2
- package/lib/StatusScoped.js +1 -1
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +2 -2
- package/lib/actions/Action.js +1 -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 +1 -1
- package/lib/actions/DialogAction.js +1 -1
- package/lib/actions/DrawerAction.js +1 -1
- package/lib/actions/EmailAction.js +1 -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.d.ts +19 -0
- package/lib/actions/PrintAction.js +53 -0
- package/lib/actions/StatusAction.js +1 -1
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/actions/index.d.ts +1 -0
- package/lib/components/CustomStyle.js +1 -1
- package/lib/components/ErrorBoundary.js +1 -1
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.js +1 -1
- package/lib/components/PopOver.js +1 -1
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.js +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +5 -2
- package/lib/locale.js +1 -1
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.js +3 -3
- package/lib/renderers/Item.js +1 -1
- package/lib/renderers/Options.js +1 -1
- 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 +5 -5
- package/lib/store/app.js +1 -1
- package/lib/store/combo.d.ts +25 -24
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.js +1 -1
- package/lib/store/form.d.ts +11 -10
- package/lib/store/form.js +1 -1
- package/lib/store/formItem.js +1 -1
- package/lib/store/iRenderer.js +1 -1
- package/lib/store/index.js +1 -1
- package/lib/store/list.d.ts +11 -0
- package/lib/store/list.js +8 -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 +1 -1
- package/lib/store/service.js +5 -2
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +48 -47
- package/lib/store/table.js +8 -6
- 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 +1 -1
- package/lib/utils/SimpleMap.js +1 -1
- package/lib/utils/api.js +3 -2
- package/lib/utils/arraySlice.js +1 -1
- package/lib/utils/attachmentAdpator.js +3 -2
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/browser.d.ts +1 -0
- package/lib/utils/browser.js +7 -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 +7 -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/getVariable.js +1 -1
- package/lib/utils/grammar.js +1 -1
- package/lib/utils/handleAction.js +1 -1
- package/lib/utils/helper.js +1 -1
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.js +1 -1
- package/lib/utils/image.js +1 -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/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.d.ts +6 -0
- package/lib/utils/printElement.js +75 -0
- 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.js +1 -1
- package/lib/utils/style.js +1 -1
- package/lib/utils/toNumber.js +1 -1
- package/lib/utils/tokenize.js +1 -1
- package/lib/utils/tpl-builtin.js +1 -1
- package/lib/utils/tpl-lodash.js +1 -1
- package/lib/utils/tpl.js +1 -1
- package/lib/utils/uncontrollable.js +1 -1
- package/lib/utils/validateId.js +1 -1
- package/lib/utils/validations.js +1 -1
- package/package.json +3 -8
package/esm/utils/concatData.js
CHANGED
package/esm/utils/dataMapping.js
CHANGED
package/esm/utils/date.js
CHANGED
package/esm/utils/debug.js
CHANGED
package/esm/utils/dom.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.
|
|
2
|
+
* amis-core v6.2.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -123,7 +123,7 @@ function calculatePosition(placement, overlayNode, target, container, padding, c
|
|
|
123
123
|
? overlayHeight
|
|
124
124
|
: overlayHeight / 2;
|
|
125
125
|
// 如果还有其他可选项,则做位置判断,是否在可视区域,不完全在则继续看其他定位情况。
|
|
126
|
-
if (tests.length) {
|
|
126
|
+
if (tests.length || isAuto) {
|
|
127
127
|
var transformed = {
|
|
128
128
|
x: clip.x + positionLeft / scaleX,
|
|
129
129
|
y: clip.y + positionTop / scaleY,
|
|
@@ -147,6 +147,11 @@ function calculatePosition(placement, overlayNode, target, container, padding, c
|
|
|
147
147
|
if (visibleX && visibleY) {
|
|
148
148
|
break;
|
|
149
149
|
}
|
|
150
|
+
else if (isAuto && tests.length === 0) {
|
|
151
|
+
// 如果是 auto 模式,且最后一个方向都不可见,则直接平移到可见区域
|
|
152
|
+
visibleY || (positionTop = window.innerHeight - transformed.height);
|
|
153
|
+
visibleX || (positionLeft = window.innerWidth - transformed.width);
|
|
154
|
+
}
|
|
150
155
|
}
|
|
151
156
|
}
|
|
152
157
|
// todo arrow 位置支持
|
package/esm/utils/errors.js
CHANGED
package/esm/utils/escapeHtml.js
CHANGED
package/esm/utils/filter.js
CHANGED
package/esm/utils/formula.js
CHANGED
package/esm/utils/getVariable.js
CHANGED
package/esm/utils/grammar.js
CHANGED
package/esm/utils/helper.js
CHANGED
package/esm/utils/highlight.js
CHANGED
package/esm/utils/icon.js
CHANGED
package/esm/utils/image.js
CHANGED
package/esm/utils/keyToPath.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
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-core v6.2.0
|
|
3
|
+
* Copyright 2018-2024 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 打印元素,参考 https://github.com/szepeshazi/print-elements 里的实现
|
|
8
|
+
* 原理就是遍历节点加上打印样式,然后打印完了再清理掉
|
|
9
|
+
* 对代码做了改造和优化
|
|
10
|
+
*/
|
|
11
|
+
var hideFromPrintClass = 'pe-no-print';
|
|
12
|
+
var preservePrintClass = 'pe-preserve-print';
|
|
13
|
+
var preserveAncestorClass = 'pe-preserve-ancestor';
|
|
14
|
+
var bodyElementName = 'BODY';
|
|
15
|
+
function hide(element) {
|
|
16
|
+
if (!element.classList.contains(preservePrintClass)) {
|
|
17
|
+
element.classList.add(hideFromPrintClass);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function preserve(element, isStartingElement) {
|
|
21
|
+
element.classList.remove(hideFromPrintClass);
|
|
22
|
+
element.classList.add(preservePrintClass);
|
|
23
|
+
if (!isStartingElement) {
|
|
24
|
+
element.classList.add(preserveAncestorClass);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function clean(element) {
|
|
28
|
+
element.classList.remove(hideFromPrintClass);
|
|
29
|
+
element.classList.remove(preservePrintClass);
|
|
30
|
+
element.classList.remove(preserveAncestorClass);
|
|
31
|
+
}
|
|
32
|
+
function walkSiblings(element, callback) {
|
|
33
|
+
var sibling = element.previousElementSibling;
|
|
34
|
+
while (sibling) {
|
|
35
|
+
callback(sibling);
|
|
36
|
+
sibling = sibling.previousElementSibling;
|
|
37
|
+
}
|
|
38
|
+
sibling = element.nextElementSibling;
|
|
39
|
+
while (sibling) {
|
|
40
|
+
callback(sibling);
|
|
41
|
+
sibling = sibling.nextElementSibling;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function attachPrintClasses(element, isStartingElement) {
|
|
45
|
+
preserve(element, isStartingElement);
|
|
46
|
+
walkSiblings(element, hide);
|
|
47
|
+
}
|
|
48
|
+
function cleanup(element, isStartingElement) {
|
|
49
|
+
clean(element);
|
|
50
|
+
walkSiblings(element, clean);
|
|
51
|
+
}
|
|
52
|
+
function walkTree(element, callback) {
|
|
53
|
+
var currentElement = element;
|
|
54
|
+
callback(currentElement, true);
|
|
55
|
+
currentElement = currentElement.parentElement;
|
|
56
|
+
while (currentElement && currentElement.nodeName !== bodyElementName) {
|
|
57
|
+
callback(currentElement, false);
|
|
58
|
+
currentElement = currentElement.parentElement;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function printElements(elements) {
|
|
62
|
+
for (var i = 0; i < elements.length; i++) {
|
|
63
|
+
walkTree(elements[i], attachPrintClasses);
|
|
64
|
+
}
|
|
65
|
+
window.print();
|
|
66
|
+
for (var i = 0; i < elements.length; i++) {
|
|
67
|
+
walkTree(elements[i], cleanup);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { printElements };
|
package/esm/utils/replaceText.js
CHANGED
package/esm/utils/stripNumber.js
CHANGED
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
package/lib/Scoped.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.
|
|
2
|
+
* amis-core v6.2.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -72,6 +72,7 @@ require('./actions/EmailAction.js');
|
|
|
72
72
|
require('./actions/LinkAction.js');
|
|
73
73
|
require('./actions/ToastAction.js');
|
|
74
74
|
require('./actions/PageAction.js');
|
|
75
|
+
require('./actions/PrintAction.js');
|
|
75
76
|
var Action = require('./actions/Action.js');
|
|
76
77
|
|
|
77
78
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -124,7 +125,8 @@ function splitTarget(target) {
|
|
|
124
125
|
if (pos_1.length) {
|
|
125
126
|
var parts = [];
|
|
126
127
|
pos_1.reduceRight(function (arr, index) {
|
|
127
|
-
|
|
128
|
+
var _a;
|
|
129
|
+
arr.unshift((_a = target.slice(index + 1)) === null || _a === void 0 ? void 0 : _a.trim());
|
|
128
130
|
target = target.slice(0, index);
|
|
129
131
|
return arr;
|
|
130
132
|
}, parts);
|
package/lib/StatusScoped.js
CHANGED
package/lib/WithRootStore.js
CHANGED
package/lib/WithStore.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.
|
|
2
|
+
* amis-core v6.2.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -153,7 +153,7 @@ function HocStoreFactory(renderer) {
|
|
|
153
153
|
// 目前主要的问题是,如果 combo 中表单项名字和 combo 本身的名字一样,会导致里面的值会被覆盖成数组
|
|
154
154
|
((_c = props.store) === null || _c === void 0 ? void 0 : _c.storeType) === 'ComboStore'
|
|
155
155
|
? undefined
|
|
156
|
-
: helper.syncDataFromSuper(store.data, props.data.__super, prevProps.data.__super, store, false)), props.updatePristineAfterStoreDataReInit === false);
|
|
156
|
+
: helper.syncDataFromSuper(tslib.__assign(tslib.__assign({}, store.data), props.data), props.data.__super, prevProps.data.__super, store, false)), props.updatePristineAfterStoreDataReInit === false);
|
|
157
157
|
}
|
|
158
158
|
else {
|
|
159
159
|
store.initData(object.createObject(props.scope, props.data), props.updatePristineAfterStoreDataReInit === false);
|
package/lib/actions/Action.js
CHANGED