amis 1.10.0 → 1.10.1-beta.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/lib/components/Checkbox.js +8 -2
- package/lib/components/Checkbox.js.map +2 -2
- package/lib/components/Select.js +4 -2
- package/lib/components/Select.js.map +2 -2
- package/lib/components/formula/Picker.d.ts +0 -1
- package/lib/components/formula/Picker.js +8 -17
- package/lib/components/formula/Picker.js.map +2 -2
- package/lib/index.js +1 -1
- package/lib/renderers/Form/InputFormula.js +1 -1
- package/lib/renderers/Form/InputFormula.js.map +2 -2
- package/lib/renderers/Form/InputImage.d.ts +1 -1
- package/lib/renderers/Form/InputImage.js +6 -2
- package/lib/renderers/Form/InputImage.js.map +2 -2
- package/lib/themes/ang-ie11.css +30 -18
- package/lib/themes/ang.css +33 -19
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +25 -13
- package/lib/themes/antd.css +33 -19
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +32 -20
- package/lib/themes/cxd.css +35 -21
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +27 -15
- package/lib/themes/dark.css +33 -19
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default-ie11.css +32 -20
- package/lib/themes/default.css +35 -21
- package/lib/themes/default.css.map +1 -1
- package/package.json +1 -1
- package/scss/_properties.scss +5 -3
- package/scss/components/_formula.scss +2 -3
- package/scss/components/form/_checks.scss +26 -16
- package/scss/themes/_cxd-variables.scss +2 -2
- package/sdk/ang-ie11.css +34 -19
- package/sdk/ang.css +37 -20
- package/sdk/antd-ie11.css +29 -14
- package/sdk/antd.css +37 -20
- package/sdk/barcode.js +51 -51
- package/sdk/charts.js +14 -14
- package/sdk/codemirror.js +7 -7
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +36 -21
- package/sdk/cxd.css +39 -22
- package/sdk/dark-ie11.css +31 -16
- package/sdk/dark.css +37 -20
- package/sdk/exceljs.js +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 +16 -16
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +36 -21
- package/sdk/sdk.css +39 -22
- package/sdk/sdk.js +1333 -1333
- 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/components/Checkbox.tsx +10 -3
- package/src/components/Select.tsx +4 -2
- package/src/components/formula/Picker.tsx +27 -16
- package/src/renderers/Form/InputFormula.tsx +1 -1
- package/src/renderers/Form/InputImage.tsx +7 -5
@@ -74,7 +74,12 @@ export class Checkbox extends React.Component<CheckboxProps, any> {
|
|
74
74
|
labelClassName,
|
75
75
|
optionType
|
76
76
|
} = this.props;
|
77
|
-
|
77
|
+
const _checked = typeof checked !== 'undefined'
|
78
|
+
? checked
|
79
|
+
: typeof value === 'undefined'
|
80
|
+
? value
|
81
|
+
: value == trueValue;
|
82
|
+
|
78
83
|
return (
|
79
84
|
<label
|
80
85
|
className={cx(`Checkbox Checkbox--${type}`, className, {
|
@@ -82,9 +87,11 @@ export class Checkbox extends React.Component<CheckboxProps, any> {
|
|
82
87
|
// 'Checkbox--partial': partial
|
83
88
|
[`Checkbox--${size}`]: size,
|
84
89
|
'Checkbox--button': optionType === 'button',
|
85
|
-
'Checkbox--button--checked': optionType === 'button' &&
|
90
|
+
'Checkbox--button--checked': optionType === 'button' && _checked,
|
86
91
|
'Checkbox--button--disabled--unchecked':
|
87
|
-
optionType === 'button' && disabled && !
|
92
|
+
optionType === 'button' && disabled && !_checked,
|
93
|
+
'Checkbox--button--disabled--checked':
|
94
|
+
optionType === 'button' && disabled && _checked
|
88
95
|
})}
|
89
96
|
>
|
90
97
|
<input
|
@@ -411,7 +411,7 @@ export class Select extends React.Component<SelectProps, SelectState> {
|
|
411
411
|
inputValue: '',
|
412
412
|
highlightedIndex: -1,
|
413
413
|
selection: value2array(props.value, props),
|
414
|
-
itemHeight:
|
414
|
+
itemHeight: 32 /** Select选项高度保持一致 */,
|
415
415
|
pickerSelectItem: ''
|
416
416
|
};
|
417
417
|
}
|
@@ -726,7 +726,9 @@ export class Select extends React.Component<SelectProps, SelectState> {
|
|
726
726
|
|
727
727
|
@autobind
|
728
728
|
menuItemRef(ref: any) {
|
729
|
-
ref &&
|
729
|
+
if (ref && typeof ref.offsetHeight === 'number' && ref > 0) {
|
730
|
+
this.setState({itemHeight: ref.offsetHeight});
|
731
|
+
}
|
730
732
|
}
|
731
733
|
|
732
734
|
renderValue({inputValue, isOpen}: ControllerStateAndHelpers<any>) {
|
@@ -174,12 +174,6 @@ export class FormulaPicker extends React.Component<
|
|
174
174
|
this.setState({value}, () => this.handleConfirm());
|
175
175
|
}
|
176
176
|
|
177
|
-
@autobind
|
178
|
-
handleInputGroupChange(e: React.ChangeEvent<HTMLInputElement>) {
|
179
|
-
const onChange = this.props.onChange;
|
180
|
-
onChange && onChange(e.currentTarget.value);
|
181
|
-
}
|
182
|
-
|
183
177
|
@autobind
|
184
178
|
handleEditorChange(value: string) {
|
185
179
|
this.setState({
|
@@ -248,10 +242,11 @@ export class FormulaPicker extends React.Component<
|
|
248
242
|
const {translate: __} = this.props;
|
249
243
|
|
250
244
|
try {
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
245
|
+
value &&
|
246
|
+
parse(value, {
|
247
|
+
evalMode: this.props.evalMode,
|
248
|
+
allowFilter: false
|
249
|
+
});
|
255
250
|
|
256
251
|
return true;
|
257
252
|
} catch (e) {
|
@@ -380,14 +375,30 @@ export class FormulaPicker extends React.Component<
|
|
380
375
|
)}
|
381
376
|
{mode === 'input-group' && (
|
382
377
|
<>
|
383
|
-
<
|
384
|
-
className={cx(
|
385
|
-
|
386
|
-
|
387
|
-
|
378
|
+
<ResultBox
|
379
|
+
className={cx(
|
380
|
+
'FormulaPicker-input',
|
381
|
+
isOpened ? 'is-active' : '',
|
382
|
+
!!isError ? 'is-error' : ''
|
383
|
+
)}
|
384
|
+
allowInput={allowInput}
|
385
|
+
clearable={clearable}
|
388
386
|
value={value}
|
387
|
+
result={
|
388
|
+
allowInput
|
389
|
+
? void 0
|
390
|
+
: FormulaEditor.highlightValue(
|
391
|
+
value,
|
392
|
+
variables!,
|
393
|
+
this.props.evalMode
|
394
|
+
)
|
395
|
+
}
|
396
|
+
itemRender={this.renderFormulaValue}
|
397
|
+
onResultChange={noop}
|
398
|
+
onChange={this.handleInputChange}
|
389
399
|
disabled={disabled}
|
390
|
-
|
400
|
+
borderMode={borderMode}
|
401
|
+
placeholder={placeholder}
|
391
402
|
/>
|
392
403
|
|
393
404
|
<a
|
@@ -152,7 +152,7 @@ export class InputFormulaRenderer extends React.Component<InputFormulaProps> {
|
|
152
152
|
validate() {
|
153
153
|
const {translate: __, value} = this.props;
|
154
154
|
|
155
|
-
if (this.ref?.validate) {
|
155
|
+
if (this.ref?.validate && value) {
|
156
156
|
const res = this.ref.validate(value);
|
157
157
|
if (res !== true) {
|
158
158
|
return __('FormulaEditor.invalidData', {err: res});
|
@@ -703,7 +703,7 @@ export default class ImageControl extends React.Component<
|
|
703
703
|
locked: false
|
704
704
|
},
|
705
705
|
() => {
|
706
|
-
this.onChange(!!this.resolve);
|
706
|
+
this.onChange(!!this.resolve, false);
|
707
707
|
|
708
708
|
if (this.resolve) {
|
709
709
|
this.resolve(
|
@@ -773,7 +773,7 @@ export default class ImageControl extends React.Component<
|
|
773
773
|
});
|
774
774
|
}
|
775
775
|
|
776
|
-
async onChange(changeImmediately?: boolean) {
|
776
|
+
async onChange(changeImmediately?: boolean, changeEvent: boolean = true) {
|
777
777
|
const {
|
778
778
|
multiple,
|
779
779
|
onChange,
|
@@ -807,9 +807,11 @@ export default class ImageControl extends React.Component<
|
|
807
807
|
: newValue;
|
808
808
|
}
|
809
809
|
|
810
|
-
|
811
|
-
|
812
|
-
|
810
|
+
if (changeEvent) {
|
811
|
+
const dispatcher = await this.dispatchEvent('change');
|
812
|
+
if (dispatcher?.prevented) {
|
813
|
+
return;
|
814
|
+
}
|
813
815
|
}
|
814
816
|
|
815
817
|
onChange((this.emitValue = newValue || ''), undefined, changeImmediately);
|