amis 1.5.6-beta.4 → 1.5.6-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/lib/Schema.d.ts +1 -1
- package/lib/Schema.js.map +1 -1
- package/lib/components/AsideNav.d.ts +1 -1
- package/lib/components/AsideNav.js.map +1 -1
- package/lib/components/CodeMirror.d.ts +26 -0
- package/lib/components/CodeMirror.js +104 -0
- package/lib/components/CodeMirror.js.map +13 -0
- package/lib/components/Collapse.d.ts +22 -21
- package/lib/components/Collapse.js.map +2 -2
- package/lib/components/ColorPicker.d.ts +85 -84
- package/lib/components/ColorPicker.js +15 -3
- package/lib/components/ColorPicker.js.map +2 -2
- package/lib/components/DatePicker.js +7 -3
- package/lib/components/DatePicker.js.map +2 -2
- package/lib/components/DateRangePicker.d.ts +85 -84
- package/lib/components/DateRangePicker.js +5 -3
- package/lib/components/DateRangePicker.js.map +2 -2
- package/lib/components/MonthRangePicker.d.ts +85 -84
- package/lib/components/MonthRangePicker.js +5 -3
- package/lib/components/MonthRangePicker.js.map +2 -2
- package/lib/components/PickerContainer.d.ts +2 -1
- package/lib/components/PickerContainer.js +3 -3
- package/lib/components/PickerContainer.js.map +2 -2
- package/lib/components/PopUp.d.ts +93 -0
- package/lib/components/PopUp.js +58 -0
- package/lib/components/PopUp.js.map +13 -0
- package/lib/components/Steps.d.ts +1 -0
- package/lib/components/Steps.js +5 -3
- package/lib/components/Steps.js.map +2 -2
- package/lib/components/TabsTransferPicker.js +1 -1
- package/lib/components/TabsTransferPicker.js.map +2 -2
- package/lib/components/TransferPicker.d.ts +0 -1
- package/lib/components/TransferPicker.js +2 -15
- package/lib/components/TransferPicker.js.map +2 -2
- package/lib/components/formula/Editor.d.ts +560 -0
- package/lib/components/formula/Editor.js +186 -0
- package/lib/components/formula/Editor.js.map +13 -0
- package/lib/components/formula/FuncList.d.ts +67 -0
- package/lib/components/formula/FuncList.js +35 -0
- package/lib/components/formula/FuncList.js.map +13 -0
- package/lib/components/formula/Picker.d.ts +493 -0
- package/lib/components/formula/Picker.js +48 -0
- package/lib/components/formula/Picker.js.map +13 -0
- package/lib/components/formula/VariableList.d.ts +9 -0
- package/lib/components/formula/VariableList.js +15 -0
- package/lib/components/formula/VariableList.js.map +13 -0
- package/lib/components/formula/plugin.d.ts +18 -0
- package/lib/components/formula/plugin.js +136 -0
- package/lib/components/formula/plugin.js.map +13 -0
- package/lib/helper.css +57 -57
- package/lib/helper.css.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/lib/index.js.map +2 -2
- package/lib/renderers/Form/InputColor.d.ts +84 -84
- package/lib/renderers/Form/InputColor.js +2 -2
- package/lib/renderers/Form/InputColor.js.map +2 -2
- package/lib/renderers/Form/InputDate.js +2 -2
- package/lib/renderers/Form/InputDate.js.map +2 -2
- package/lib/renderers/Form/InputDateRange.js +2 -2
- package/lib/renderers/Form/InputDateRange.js.map +2 -2
- package/lib/renderers/Form/InputFormula.d.ts +35 -0
- package/lib/renderers/Form/InputFormula.js +25 -0
- package/lib/renderers/Form/InputFormula.js.map +13 -0
- package/lib/renderers/Form/InputMonthRange.js +2 -2
- package/lib/renderers/Form/InputMonthRange.js.map +2 -2
- package/lib/renderers/Form/InputQuarterRange.js +2 -2
- package/lib/renderers/Form/InputQuarterRange.js.map +2 -2
- package/lib/renderers/Form/InputYearRange.js +2 -2
- package/lib/renderers/Form/InputYearRange.js.map +2 -2
- package/lib/renderers/Form/TreeSelect.d.ts +1 -0
- package/lib/renderers/Form/TreeSelect.js +11 -8
- package/lib/renderers/Form/TreeSelect.js.map +2 -2
- package/lib/renderers/Steps.js +2 -2
- package/lib/renderers/Steps.js.map +2 -2
- package/lib/themes/ang-ie11.css +261 -0
- package/lib/themes/ang.css +261 -0
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +261 -0
- package/lib/themes/antd.css +261 -0
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +261 -0
- package/lib/themes/cxd.css +261 -0
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +261 -0
- package/lib/themes/dark.css +261 -0
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default.css +261 -0
- package/lib/themes/default.css.map +1 -1
- package/lib/utils/api.js +2 -2
- package/lib/utils/api.js.map +2 -2
- package/package.json +4 -2
- package/scss/_variables.scss +1 -1
- package/scss/components/_formula.scss +122 -0
- package/scss/components/_popup.scss +123 -0
- package/scss/components/_steps.scss +60 -0
- package/scss/components/form/_color.scss +4 -0
- package/scss/components/form/_date-range.scss +4 -0
- package/scss/components/form/_date.scss +3 -0
- package/scss/components/form/_tree-select.scss +4 -0
- package/scss/helper/background/_background-color.scss +1 -1
- package/scss/helper/border/_border-color.scss +1 -1
- package/scss/helper/typography/_text-color.scss +1 -1
- package/scss/themes/_common.scss +2 -0
- package/sdk/ang-ie11.css +875 -0
- package/sdk/ang.css +875 -0
- package/sdk/antd-ie11.css +875 -0
- package/sdk/antd.css +875 -0
- package/sdk/charts.js +15 -15
- package/sdk/codemirror.js +14 -0
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +875 -0
- package/sdk/cxd.css +875 -0
- package/sdk/dark-ie11.css +875 -0
- package/sdk/dark.css +875 -0
- package/sdk/exceljs.js +1 -1
- package/sdk/helper.css +57 -57
- package/sdk/helper.css.map +1 -1
- package/sdk/markdown.js +69 -69
- package/sdk/papaparse.js +1 -1
- package/sdk/renderers/Form/CityDB.js +1 -1
- package/sdk/rest.js +18 -18
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +875 -0
- package/sdk/sdk.css +875 -0
- package/sdk/sdk.js +1219 -1201
- package/sdk/thirds/hls.js/hls.js +1 -1
- package/sdk/thirds/mpegts.js/mpegts.js +1 -1
- package/sdk/tinymce.js +57 -57
- package/src/Schema.ts +1 -0
- package/src/components/AsideNav.tsx +1 -1
- package/src/components/CodeMirror.tsx +99 -0
- package/src/components/Collapse.tsx +2 -1
- package/src/components/ColorPicker.tsx +45 -3
- package/src/components/DatePicker.tsx +33 -3
- package/src/components/DateRangePicker.tsx +17 -3
- package/src/components/MonthRangePicker.tsx +18 -4
- package/src/components/PickerContainer.tsx +10 -6
- package/src/components/PopUp.tsx +133 -0
- package/src/components/Steps.tsx +8 -3
- package/src/components/TabsTransferPicker.tsx +1 -1
- package/src/components/TransferPicker.tsx +1 -11
- package/src/components/formula/Editor.tsx +261 -0
- package/src/components/formula/FuncList.tsx +82 -0
- package/src/components/formula/Picker.tsx +86 -0
- package/src/components/formula/VariableList.tsx +49 -0
- package/src/components/formula/plugin.ts +177 -0
- package/src/index.tsx +1 -0
- package/src/renderers/Form/InputColor.tsx +2 -3
- package/src/renderers/Form/InputDate.tsx +2 -0
- package/src/renderers/Form/InputDateRange.tsx +2 -0
- package/src/renderers/Form/InputFormula.tsx +75 -0
- package/src/renderers/Form/InputMonthRange.tsx +2 -0
- package/src/renderers/Form/InputQuarterRange.tsx +2 -0
- package/src/renderers/Form/InputYearRange.tsx +2 -0
- package/src/renderers/Form/TreeSelect.tsx +82 -63
- package/src/renderers/Steps.tsx +4 -2
- package/src/utils/api.ts +5 -2
@@ -0,0 +1,75 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import FormItem, {FormBaseControl, FormControlProps} from './Item';
|
3
|
+
import FormulaPicker from '../../components/formula/Picker';
|
4
|
+
import type {FuncGroup, VariableItem} from '../../components/formula/Editor';
|
5
|
+
|
6
|
+
/**
|
7
|
+
* InputFormula 公式编辑器
|
8
|
+
* 文档:https://baidu.gitee.io/amis/docs/components/form/input-formula
|
9
|
+
*/
|
10
|
+
export interface InputFormulaControlSchema extends FormBaseControl {
|
11
|
+
type: 'input-formula';
|
12
|
+
|
13
|
+
/**
|
14
|
+
* evalMode 即直接就是表达式,否则
|
15
|
+
* 需要 ${这里面才是表达式}
|
16
|
+
* 默认为 true
|
17
|
+
*/
|
18
|
+
evalMode?: boolean;
|
19
|
+
|
20
|
+
/**
|
21
|
+
* 用于提示的变量集合,默认为空
|
22
|
+
*/
|
23
|
+
variables: Array<VariableItem>;
|
24
|
+
|
25
|
+
variableMode?: 'tabs' | 'tree';
|
26
|
+
|
27
|
+
/**
|
28
|
+
* 函数集合,默认不需要传,即 amis-formula 里面那个函数
|
29
|
+
* 如果有扩充,则需要传。
|
30
|
+
*/
|
31
|
+
functions: Array<FuncGroup>;
|
32
|
+
|
33
|
+
/**
|
34
|
+
* 顶部标题,默认为表达式
|
35
|
+
*/
|
36
|
+
header: string;
|
37
|
+
}
|
38
|
+
|
39
|
+
export interface InputFormulaProps
|
40
|
+
extends FormControlProps,
|
41
|
+
Omit<
|
42
|
+
InputFormulaControlSchema,
|
43
|
+
'options' | 'inputClassName' | 'className' | 'descriptionClassName'
|
44
|
+
> {}
|
45
|
+
|
46
|
+
@FormItem({
|
47
|
+
type: 'input-formula'
|
48
|
+
})
|
49
|
+
export class InputFormulaRenderer extends React.Component<InputFormulaProps> {
|
50
|
+
render() {
|
51
|
+
const {
|
52
|
+
selectedOptions,
|
53
|
+
disabled,
|
54
|
+
onChange,
|
55
|
+
evalMode,
|
56
|
+
variables,
|
57
|
+
variableMode,
|
58
|
+
functions,
|
59
|
+
header
|
60
|
+
} = this.props;
|
61
|
+
|
62
|
+
return (
|
63
|
+
<FormulaPicker
|
64
|
+
value={selectedOptions}
|
65
|
+
disabled={disabled}
|
66
|
+
onChange={onChange}
|
67
|
+
evalMode={evalMode}
|
68
|
+
variables={variables}
|
69
|
+
variableMode={variableMode}
|
70
|
+
functions={functions}
|
71
|
+
header={header}
|
72
|
+
/>
|
73
|
+
);
|
74
|
+
}
|
75
|
+
}
|
@@ -170,6 +170,7 @@ export default class MonthRangeControl extends React.Component<MonthRangeProps>
|
|
170
170
|
maxDuration,
|
171
171
|
data,
|
172
172
|
format,
|
173
|
+
env,
|
173
174
|
...rest
|
174
175
|
} = this.props;
|
175
176
|
|
@@ -184,6 +185,7 @@ export default class MonthRangeControl extends React.Component<MonthRangeProps>
|
|
184
185
|
maxDate={maxDate ? filterDate(maxDate, data, format) : undefined}
|
185
186
|
minDuration={minDuration ? parseDuration(minDuration) : undefined}
|
186
187
|
maxDuration={maxDuration ? parseDuration(maxDuration) : undefined}
|
188
|
+
useMobileUI={env.useMobileUI}
|
187
189
|
/>
|
188
190
|
</div>
|
189
191
|
);
|
@@ -26,6 +26,7 @@ export default class QuarterRangeControl extends InputDateRange {
|
|
26
26
|
maxDuration,
|
27
27
|
data,
|
28
28
|
format,
|
29
|
+
env,
|
29
30
|
...rest
|
30
31
|
} = this.props;
|
31
32
|
|
@@ -44,6 +45,7 @@ export default class QuarterRangeControl extends InputDateRange {
|
|
44
45
|
maxDate={maxDate ? filterDate(maxDate, data, format) : undefined}
|
45
46
|
minDuration={minDuration ? parseDuration(minDuration) : undefined}
|
46
47
|
maxDuration={maxDuration ? parseDuration(maxDuration) : undefined}
|
48
|
+
useMobileUI={env.useMobileUI}
|
47
49
|
/>
|
48
50
|
</div>
|
49
51
|
);
|
@@ -26,6 +26,7 @@ export default class YearRangeControl extends InputDateRange {
|
|
26
26
|
maxDuration,
|
27
27
|
data,
|
28
28
|
format,
|
29
|
+
env,
|
29
30
|
...rest
|
30
31
|
} = this.props;
|
31
32
|
|
@@ -44,6 +45,7 @@ export default class YearRangeControl extends InputDateRange {
|
|
44
45
|
maxDate={maxDate ? filterDate(maxDate, data, format) : undefined}
|
45
46
|
minDuration={minDuration ? parseDuration(minDuration) : undefined}
|
46
47
|
maxDuration={maxDuration ? parseDuration(maxDuration) : undefined}
|
48
|
+
useMobileUI={env.useMobileUI}
|
47
49
|
/>
|
48
50
|
</div>
|
49
51
|
);
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import Overlay from '../../components/Overlay';
|
3
3
|
import PopOver from '../../components/PopOver';
|
4
|
+
import PopUp from '../../components/PopUp';
|
4
5
|
|
5
6
|
import {
|
6
7
|
OptionsControl,
|
@@ -17,7 +18,7 @@ import {Api} from '../../types';
|
|
17
18
|
import {isEffectiveApi} from '../../utils/api';
|
18
19
|
import Spinner from '../../components/Spinner';
|
19
20
|
import ResultBox from '../../components/ResultBox';
|
20
|
-
import {autobind, getTreeAncestors} from '../../utils/helper';
|
21
|
+
import {autobind, getTreeAncestors, isMobile} from '../../utils/helper';
|
21
22
|
import {findDOMNode} from 'react-dom';
|
22
23
|
import {normalizeOptions} from '../../components/Select';
|
23
24
|
|
@@ -90,6 +91,7 @@ export interface TreeSelectProps extends OptionsControlProps {
|
|
90
91
|
hideNodePathLabel?: boolean;
|
91
92
|
enableNodePath?: boolean;
|
92
93
|
pathSeparator?: string;
|
94
|
+
useMobileUI?: boolean;
|
93
95
|
}
|
94
96
|
|
95
97
|
export interface TreeSelectState {
|
@@ -502,67 +504,51 @@ export default class TreeSelectControl extends React.Component<
|
|
502
504
|
: options;
|
503
505
|
|
504
506
|
return (
|
505
|
-
<
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
creatable={creatable}
|
551
|
-
createTip={createTip}
|
552
|
-
rootCreatable={rootCreatable}
|
553
|
-
rootCreateTip={rootCreateTip}
|
554
|
-
onEdit={onEdit}
|
555
|
-
editable={editable}
|
556
|
-
editTip={editTip}
|
557
|
-
removable={removable}
|
558
|
-
removeTip={removeTip}
|
559
|
-
onDelete={onDelete}
|
560
|
-
bultinCUD={!addControls && !editControls}
|
561
|
-
onDeferLoad={deferLoad}
|
562
|
-
onExpandTree={expandTreeOptions}
|
563
|
-
/>
|
564
|
-
</PopOver>
|
565
|
-
</Overlay>
|
507
|
+
<TreeSelector
|
508
|
+
classPrefix={ns}
|
509
|
+
onlyChildren={onlyChildren}
|
510
|
+
labelField={labelField}
|
511
|
+
valueField={valueField}
|
512
|
+
disabled={disabled}
|
513
|
+
onChange={this.handleChange}
|
514
|
+
joinValues={joinValues}
|
515
|
+
extractValue={extractValue}
|
516
|
+
delimiter={delimiter}
|
517
|
+
placeholder={__(optionsPlaceholder)}
|
518
|
+
options={filtedOptions}
|
519
|
+
highlightTxt={this.state.inputValue}
|
520
|
+
multiple={multiple}
|
521
|
+
initiallyOpen={initiallyOpen}
|
522
|
+
unfoldedLevel={unfoldedLevel}
|
523
|
+
withChildren={withChildren}
|
524
|
+
rootLabel={__(rootLabel)}
|
525
|
+
rootValue={rootValue}
|
526
|
+
showIcon={showIcon}
|
527
|
+
showRadio={showRadio}
|
528
|
+
cascade={cascade}
|
529
|
+
foldedField="collapsed"
|
530
|
+
hideRoot
|
531
|
+
value={value || ''}
|
532
|
+
nodePath={nodePath}
|
533
|
+
enableNodePath={enableNodePath}
|
534
|
+
pathSeparator={pathSeparator}
|
535
|
+
maxLength={maxLength}
|
536
|
+
minLength={minLength}
|
537
|
+
onAdd={onAdd}
|
538
|
+
creatable={creatable}
|
539
|
+
createTip={createTip}
|
540
|
+
rootCreatable={rootCreatable}
|
541
|
+
rootCreateTip={rootCreateTip}
|
542
|
+
onEdit={onEdit}
|
543
|
+
editable={editable}
|
544
|
+
editTip={editTip}
|
545
|
+
removable={removable}
|
546
|
+
removeTip={removeTip}
|
547
|
+
onDelete={onDelete}
|
548
|
+
bultinCUD={!addControls && !editControls}
|
549
|
+
onDeferLoad={deferLoad}
|
550
|
+
onExpandTree={expandTreeOptions}
|
551
|
+
/>
|
566
552
|
);
|
567
553
|
}
|
568
554
|
|
@@ -581,9 +567,13 @@ export default class TreeSelectControl extends React.Component<
|
|
581
567
|
autoComplete,
|
582
568
|
selectedOptions,
|
583
569
|
placeholder,
|
570
|
+
popOverContainer,
|
571
|
+
env,
|
584
572
|
translate: __
|
585
573
|
} = this.props;
|
586
574
|
|
575
|
+
const { isOpened } = this.state;
|
576
|
+
const { useMobileUI } = env;
|
587
577
|
return (
|
588
578
|
<div ref={this.container} className={cx(`TreeSelectControl`, className)}>
|
589
579
|
<ResultBox
|
@@ -622,7 +612,36 @@ export default class TreeSelectControl extends React.Component<
|
|
622
612
|
>
|
623
613
|
{loading ? <Spinner size="sm" /> : undefined}
|
624
614
|
</ResultBox>
|
625
|
-
{
|
615
|
+
{ !(useMobileUI && isMobile()) && isOpened ? (
|
616
|
+
<Overlay
|
617
|
+
container={popOverContainer || (() => this.container.current)}
|
618
|
+
target={() => this.target}
|
619
|
+
show
|
620
|
+
>
|
621
|
+
<PopOver
|
622
|
+
classPrefix={ns}
|
623
|
+
className={`${ns}TreeSelect-popover`}
|
624
|
+
style={{
|
625
|
+
minWidth: this.target ? this.target.offsetWidth : undefined
|
626
|
+
}}
|
627
|
+
onHide={this.close}
|
628
|
+
overlay
|
629
|
+
>
|
630
|
+
{this.renderOuter()}
|
631
|
+
</PopOver>
|
632
|
+
</Overlay>
|
633
|
+
) : null}
|
634
|
+
{
|
635
|
+
useMobileUI && isMobile() && (
|
636
|
+
<PopUp
|
637
|
+
className={cx(`${ns}TreeSelect-popup`)}
|
638
|
+
isShow={isOpened}
|
639
|
+
onHide={this.close}
|
640
|
+
>
|
641
|
+
{this.renderOuter()}
|
642
|
+
</PopUp>
|
643
|
+
)
|
644
|
+
}
|
626
645
|
</div>
|
627
646
|
);
|
628
647
|
}
|
package/src/renderers/Steps.tsx
CHANGED
@@ -83,9 +83,10 @@ export function StepsCmpt(props: StepsProps) {
|
|
83
83
|
data,
|
84
84
|
source,
|
85
85
|
config,
|
86
|
-
render
|
86
|
+
render,
|
87
|
+
env
|
87
88
|
} = props;
|
88
|
-
|
89
|
+
|
89
90
|
const stepsRow =
|
90
91
|
(resolveVariable(source, data) as Array<StepSchema>) ||
|
91
92
|
config ||
|
@@ -140,6 +141,7 @@ export function StepsCmpt(props: StepsProps) {
|
|
140
141
|
className={className}
|
141
142
|
status={status}
|
142
143
|
mode={mode}
|
144
|
+
useMobileUI={env.useMobileUI}
|
143
145
|
></Steps>
|
144
146
|
);
|
145
147
|
}
|
package/src/utils/api.ts
CHANGED
@@ -98,14 +98,17 @@ export function buildApi(
|
|
98
98
|
if (~idx) {
|
99
99
|
const hashIdx = api.url.indexOf('#');
|
100
100
|
const params = qsparse(
|
101
|
-
api.url.substring(
|
101
|
+
api.url.substring(
|
102
|
+
idx + 1,
|
103
|
+
~hashIdx && hashIdx > idx ? hashIdx : undefined
|
104
|
+
)
|
102
105
|
);
|
103
106
|
api.url =
|
104
107
|
tokenize(api.url.substring(0, idx + 1), data, '| url_encode') +
|
105
108
|
qsstringify(
|
106
109
|
(api.query = dataMapping(params, data, undefined, api.convertKeyToPath))
|
107
110
|
) +
|
108
|
-
(~hashIdx ? api.url.substring(hashIdx) : '');
|
111
|
+
(~hashIdx && hashIdx > idx ? api.url.substring(hashIdx) : '');
|
109
112
|
} else {
|
110
113
|
api.url = tokenize(api.url, data, '| url_encode');
|
111
114
|
}
|