amis 1.9.1-beta.12 → 1.9.1-beta.21
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/lib/components/AssociatedSelection.d.ts +40 -40
- package/lib/components/Badge.d.ts +1 -1
- package/lib/components/Badge.js.map +1 -1
- package/lib/components/ChainedSelection.d.ts +40 -40
- package/lib/components/GroupedSelection.d.ts +40 -40
- package/lib/components/GroupedSelection.js +3 -2
- package/lib/components/GroupedSelection.js.map +2 -2
- package/lib/components/PickerContainer.d.ts +1 -0
- package/lib/components/PickerContainer.js +4 -4
- package/lib/components/PickerContainer.js.map +2 -2
- package/lib/components/Radios.d.ts +10 -10
- package/lib/components/ResultBox.d.ts +44 -40
- package/lib/components/ResultBox.js +40 -6
- package/lib/components/ResultBox.js.map +2 -2
- package/lib/components/ResultList.d.ts +43 -53
- package/lib/components/ResultList.js +34 -22
- package/lib/components/ResultList.js.map +2 -2
- package/lib/components/ResultTableList.d.ts +40 -40
- package/lib/components/ResultTableList.js +16 -17
- package/lib/components/ResultTableList.js.map +2 -2
- package/lib/components/ResultTreeList.d.ts +40 -40
- package/lib/components/Select.d.ts +498 -294
- package/lib/components/Select.js +58 -10
- package/lib/components/Select.js.map +2 -2
- package/lib/components/Selection.d.ts +41 -40
- package/lib/components/Selection.js.map +2 -2
- package/lib/components/TableSelection.d.ts +42 -40
- package/lib/components/TableSelection.js +7 -2
- package/lib/components/TableSelection.js.map +2 -2
- package/lib/components/TabsTransfer.d.ts +2 -2
- package/lib/components/TabsTransfer.js.map +1 -1
- package/lib/components/TooltipWrapper.d.ts +1 -1
- package/lib/components/TooltipWrapper.js.map +2 -2
- package/lib/components/Transfer.d.ts +40 -40
- package/lib/components/Transfer.js +1 -1
- package/lib/components/Transfer.js.map +2 -2
- package/lib/components/TransferDropDown.d.ts +43 -40
- package/lib/components/TransferDropDown.js +2 -2
- package/lib/components/TransferDropDown.js.map +2 -2
- package/lib/components/TreeSelection.d.ts +40 -40
- package/lib/components/TreeSelection.js +3 -2
- package/lib/components/TreeSelection.js.map +2 -2
- package/lib/components/formula/Editor.d.ts +45 -41
- package/lib/components/formula/Editor.js +8 -2
- package/lib/components/formula/Editor.js.map +2 -2
- package/lib/components/formula/Picker.d.ts +43 -41
- package/lib/components/formula/Picker.js +40 -20
- package/lib/components/formula/Picker.js.map +2 -2
- package/lib/components/formula/VariableList.d.ts +2 -0
- package/lib/components/formula/VariableList.js +15 -5
- package/lib/components/formula/VariableList.js.map +2 -2
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.js +5 -1
- package/lib/components/index.js.map +2 -2
- package/lib/components/schema-editor/SchemaVariableList.d.ts +1 -0
- package/lib/components/schema-editor/SchemaVariableList.js +2 -2
- package/lib/components/schema-editor/SchemaVariableList.js.map +2 -2
- package/lib/components/schema-editor/SchemaVariableListPicker.d.ts +1 -0
- package/lib/components/schema-editor/SchemaVariableListPicker.js +2 -2
- package/lib/components/schema-editor/SchemaVariableListPicker.js.map +2 -2
- package/lib/components/table/HeadCellFilter.js +4 -1
- package/lib/components/table/HeadCellFilter.js.map +2 -2
- package/lib/components/table/HeadCellSort.js +30 -24
- package/lib/components/table/HeadCellSort.js.map +2 -2
- package/lib/components/table/index.d.ts +6 -3
- package/lib/components/table/index.js +72 -86
- package/lib/components/table/index.js.map +2 -2
- package/lib/index.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/de-DE.js.map +2 -2
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/en-US.js.map +2 -2
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/Action.d.ts +21 -4
- package/lib/renderers/Action.js +44 -20
- package/lib/renderers/Action.js.map +2 -2
- package/lib/renderers/Breadcrumb.js +2 -2
- package/lib/renderers/Breadcrumb.js.map +2 -2
- package/lib/renderers/CRUD.js +3 -0
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/Form/InputFormula.d.ts +5 -1
- package/lib/renderers/Form/InputFormula.js +2 -2
- package/lib/renderers/Form/InputFormula.js.map +2 -2
- package/lib/renderers/Form/InputImage.js.map +2 -2
- package/lib/renderers/Form/InputTag.d.ts +8 -0
- package/lib/renderers/Form/InputTag.js +2 -2
- package/lib/renderers/Form/InputTag.js.map +2 -2
- package/lib/renderers/Form/InputTree.d.ts +4 -0
- package/lib/renderers/Form/InputTree.js +2 -2
- package/lib/renderers/Form/InputTree.js.map +2 -2
- package/lib/renderers/Form/Picker.d.ts +1 -1
- package/lib/renderers/Form/Picker.js +38 -23
- package/lib/renderers/Form/Picker.js.map +2 -2
- package/lib/renderers/Form/Select.d.ts +19 -0
- package/lib/renderers/Form/Select.js +2 -2
- package/lib/renderers/Form/Select.js.map +2 -2
- package/lib/renderers/Form/Transfer.d.ts +1 -0
- package/lib/renderers/Form/Transfer.js +4 -0
- package/lib/renderers/Form/Transfer.js.map +2 -2
- package/lib/renderers/Form/wrapControl.js +10 -10
- package/lib/renderers/Form/wrapControl.js.map +2 -2
- package/lib/renderers/QRCode.d.ts +16 -0
- package/lib/renderers/QRCode.js +25 -1
- package/lib/renderers/QRCode.js.map +2 -2
- package/lib/renderers/Service.js +0 -1
- package/lib/renderers/Service.js.map +2 -2
- package/lib/renderers/Steps.d.ts +2 -2
- package/lib/renderers/Steps.js +1 -1
- package/lib/renderers/Steps.js.map +2 -2
- package/lib/renderers/Table/exportExcel.js +50 -36
- package/lib/renderers/Table/exportExcel.js.map +2 -2
- package/lib/renderers/Table/index.js +2 -1
- package/lib/renderers/Table/index.js.map +2 -2
- package/lib/renderers/Table-v2/HeadCellSearchDropdown.d.ts +1 -1
- package/lib/renderers/Table-v2/HeadCellSearchDropdown.js +38 -24
- package/lib/renderers/Table-v2/HeadCellSearchDropdown.js.map +2 -2
- package/lib/renderers/Table-v2/index.d.ts +10 -4
- package/lib/renderers/Table-v2/index.js +109 -58
- package/lib/renderers/Table-v2/index.js.map +2 -2
- package/lib/renderers/Tabs.d.ts +6 -2
- package/lib/renderers/Tabs.js +21 -0
- package/lib/renderers/Tabs.js.map +2 -2
- package/lib/store/table-v2.d.ts +210 -4
- package/lib/store/table-v2.js +82 -5
- package/lib/store/table-v2.js.map +2 -2
- package/lib/themes/ang-ie11.css +140 -44
- package/lib/themes/ang.css +140 -33
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +140 -44
- package/lib/themes/antd.css +140 -33
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +297 -197
- package/lib/themes/cxd.css +151 -38
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +140 -44
- package/lib/themes/dark.css +140 -33
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default-ie11.css +297 -197
- package/lib/themes/default.css +151 -38
- package/lib/themes/default.css.map +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.js.map +1 -1
- package/lib/utils/formula.js +7 -5
- package/lib/utils/formula.js.map +2 -2
- package/lib/utils/helper.d.ts +1 -0
- package/lib/utils/helper.js +11 -1
- package/lib/utils/helper.js.map +2 -2
- package/package.json +2 -2
- package/schema.json +103 -35
- package/scss/_properties.scss +11 -6
- package/scss/components/_formula.scss +45 -4
- package/scss/components/_modal.scss +1 -1
- package/scss/components/_result-box.scss +34 -2
- package/scss/components/form/_checks.scss +47 -44
- package/scss/components/form/_date.scss +28 -19
- package/scss/components/form/_icon-picker.scss +10 -6
- package/scss/components/form/_select.scss +77 -34
- package/scss/components/form/_selection.scss +9 -6
- package/scss/components/form/_switch.scss +1 -0
- package/scss/components/form/_text.scss +2 -0
- package/scss/components/form/_transfer.scss +2 -1
- package/scss/themes/_cxd-variables.scss +3 -1
- package/scss/themes/cxd.scss +9 -6
- package/sdk/ang-ie11.css +159 -46
- package/sdk/ang.css +159 -35
- package/sdk/antd-ie11.css +159 -46
- package/sdk/antd.css +159 -35
- 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 +317 -199
- package/sdk/cxd.css +171 -40
- package/sdk/dark-ie11.css +159 -46
- package/sdk/dark.css +159 -35
- package/sdk/exceljs.js +1 -1
- package/sdk/locale/de-DE.js +2 -2
- 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 +317 -199
- package/sdk/sdk.css +171 -40
- package/sdk/sdk.js +1353 -1351
- 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/Badge.tsx +1 -1
- package/src/components/GroupedSelection.tsx +3 -2
- package/src/components/PickerContainer.tsx +13 -8
- package/src/components/ResultBox.tsx +95 -11
- package/src/components/ResultList.tsx +48 -51
- package/src/components/ResultTableList.tsx +32 -33
- package/src/components/Select.tsx +138 -17
- package/src/components/Selection.tsx +1 -0
- package/src/components/TableSelection.tsx +15 -8
- package/src/components/TabsTransfer.tsx +2 -2
- package/src/components/TooltipWrapper.tsx +20 -14
- package/src/components/Transfer.tsx +0 -4
- package/src/components/TransferDropDown.tsx +9 -1
- package/src/components/TreeSelection.tsx +2 -1
- package/src/components/formula/Editor.tsx +17 -2
- package/src/components/formula/Picker.tsx +44 -7
- package/src/components/formula/VariableList.tsx +36 -2
- package/src/components/index.tsx +4 -0
- package/src/components/schema-editor/SchemaVariableList.tsx +4 -2
- package/src/components/schema-editor/SchemaVariableListPicker.tsx +4 -1
- package/src/components/table/HeadCellFilter.tsx +4 -1
- package/src/components/table/HeadCellSort.tsx +1 -1
- package/src/components/table/index.tsx +66 -90
- package/src/locale/de-DE.ts +2 -2
- package/src/locale/en-US.ts +2 -2
- package/src/locale/zh-CN.ts +1 -1
- package/src/renderers/Action.tsx +64 -19
- package/src/renderers/Breadcrumb.tsx +11 -12
- package/src/renderers/CRUD.tsx +2 -0
- package/src/renderers/Form/InputFormula.tsx +9 -2
- package/src/renderers/Form/InputImage.tsx +4 -2
- package/src/renderers/Form/InputTag.tsx +14 -0
- package/src/renderers/Form/InputTree.tsx +7 -0
- package/src/renderers/Form/Picker.tsx +11 -1
- package/src/renderers/Form/Select.tsx +32 -1
- package/src/renderers/Form/Transfer.tsx +6 -0
- package/src/renderers/Form/wrapControl.tsx +10 -10
- package/src/renderers/QRCode.tsx +50 -1
- package/src/renderers/Service.tsx +0 -1
- package/src/renderers/Steps.tsx +5 -5
- package/src/renderers/Table/exportExcel.ts +29 -12
- package/src/renderers/Table/index.tsx +9 -7
- package/src/renderers/Table-v2/HeadCellSearchDropdown.tsx +14 -9
- package/src/renderers/Table-v2/index.tsx +130 -58
- package/src/renderers/Tabs.tsx +33 -3
- package/src/store/table-v2.ts +104 -7
- package/src/types.ts +2 -1
- package/src/utils/formula.ts +7 -5
- package/src/utils/helper.ts +12 -2
@@ -6,8 +6,8 @@
|
|
6
6
|
"/src/components/TreeSelection.tsx"
|
7
7
|
],
|
8
8
|
"names": [],
|
9
|
-
"mappings": ";;;;AAAA,yCAA8D;AAC9D,kCAAmC;AACnC,6DAA0B;AAC1B,iDAA8C;AAC9C,qEAAkC;AAElC,0CAA8D;AAC9D,mEAAgC;AAChC,oCAAqC;AACrC,iCAA6B;AAU7B;IAAmC,8CAGlC;IAHD;QAAA,
|
9
|
+
"mappings": ";;;;AAAA,yCAA8D;AAC9D,kCAAmC;AACnC,6DAA0B;AAC1B,iDAA8C;AAC9C,qEAAkC;AAElC,0CAA8D;AAC9D,mEAAgC;AAChC,oCAAqC;AACrC,iCAA6B;AAU7B;IAAmC,8CAGlC;IAHD;QAAA,qEAgSC;QA3RC,WAAK,GAAuB;YAC1B,QAAQ,EAAE,EAAE;SACb,CAAC;;IAyRJ,CAAC;IAlRC,yCAAiB,GAAjB;QACE,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,0CAAkB,GAAlB,UAAmB,SAA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AO,CAAC,GAAG,CAAC,UAAC,MAAM,EAAE,GAAG,IAAK,OAAA,KAAI,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAnC,CAAmC,CAAC,CAAC;SAC1E;QAED,OAAO,CACL,uCAAK,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,IAC3C,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CACrB,IAAI,CACL,CAAC,CAAC,CAAC,CACF,uCAAK,SAAS,EAAE,EAAE,CAAC,2BAA2B,CAAC,IAC5C,MAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,IAAI,CAAC,KAAK,CAAC,mCAAI,EAAE,CAAC,WAAW,CAAC,CAC/C,CACP,CACG,CACP,CAAC;IACJ,CAAC;IAtRM,0BAAY,mDACd,yBAAa,CAAC,YAAY,KAC7B,MAAM,EAAE,OAAkB,IAC1B;IAoRJ,oBAAC;CAAA,AAhSD,CAAmC,yBAAa,GAgS/C;AAhSY,sCAAa;AAkS1B,kBAAe,IAAA,iBAAS,EACtB,IAAA,mBAAU,EACR,IAAA,+BAAc,EAAC,aAAa,EAAE;IAC5B,KAAK,EAAE,UAAU;CAClB,CAAC,CACH,CACF,CAAC",
|
10
10
|
"sourcesContent": [
|
11
|
-
"import {BaseSelection, BaseSelectionProps} from './Selection';\nimport {themeable} from '../theme';\nimport React from 'react';\nimport {uncontrollable} from 'uncontrollable';\nimport Checkbox from './Checkbox';\nimport {Option} from './Select';\nimport {autobind, eachTree, everyTree} from '../utils/helper';\nimport Spinner from './Spinner';\nimport {localeable} from '../locale';\nimport {Icon} from './icons';\n\nexport interface TreeSelectionProps extends BaseSelectionProps {\n expand?: 'all' | 'first' | 'root' | 'none';\n}\n\nexport interface TreeSelectionState {\n expanded: Array<string>;\n}\n\nexport class TreeSelection extends BaseSelection<\n TreeSelectionProps,\n TreeSelectionState\n> {\n valueArray: Array<Option>;\n state: TreeSelectionState = {\n expanded: []\n };\n\n static defaultProps = {\n ...BaseSelection.defaultProps,\n expand: 'first' as 'first'\n };\n\n componentDidMount() {\n this.syncExpanded();\n }\n\n componentDidUpdate(prevProps: TreeSelectionProps) {\n const props = this.props;\n\n if (\n !this.state.expanded.length &&\n (props.expand !== prevProps.expand || props.options !== prevProps.options)\n ) {\n this.syncExpanded();\n }\n }\n\n syncExpanded() {\n const options = this.props.options;\n const mode = this.props.expand;\n const expanded: Array<string> = [];\n\n if (!Array.isArray(options)) {\n return;\n }\n\n if (mode === 'first' || mode === 'root') {\n options.every((option, index) => {\n if (Array.isArray(option.children)) {\n expanded.push(`${index}`);\n return mode === 'root';\n }\n return true;\n });\n } else if (mode === 'all') {\n everyTree(options, (option, index, level, paths, indexes) => {\n if (Array.isArray(option.children)) {\n expanded.push(`${indexes.concat(index).join('-')}`);\n }\n return true;\n });\n }\n\n this.setState({expanded});\n }\n\n toggleOption(option: Option) {\n const {\n value,\n onChange,\n option2value,\n options,\n onDeferLoad,\n disabled,\n multiple,\n clearable\n } = this.props;\n\n if (disabled || option.disabled) {\n return;\n } else if (option.defer && !option.loaded) {\n onDeferLoad?.(option);\n return;\n }\n\n let valueArray = BaseSelection.value2array(value, options, option2value);\n\n if (\n option.value === void 0 &&\n Array.isArray(option.children) &&\n option.children.length &&\n multiple\n ) {\n const someCheckedFn = (child: Option) =>\n (Array.isArray(child.children) && child.children.length\n ? child.children.some(someCheckedFn)\n : false) ||\n (child.value !== void 0 && ~valueArray.indexOf(child));\n const someChecked = option.children.some(someCheckedFn);\n const eachFn = (child: Option) => {\n if (Array.isArray(child.children) && child.children.length) {\n child.children.forEach(eachFn);\n }\n\n if (child.value !== void 0) {\n const idx = valueArray.indexOf(child);\n\n ~idx && valueArray.splice(idx, 1);\n\n if (!someChecked) {\n valueArray.push(child);\n }\n }\n };\n option.children.forEach(eachFn);\n } else {\n let idx = valueArray.indexOf(option);\n\n if (~idx && (multiple || clearable)) {\n valueArray.splice(idx, 1);\n } else if (multiple) {\n valueArray.push(option);\n } else {\n valueArray = [option];\n }\n }\n\n let newValue: string | Array<Option> = option2value\n ? valueArray.map(item => option2value(item))\n : valueArray;\n\n onChange && onChange(multiple ? newValue : newValue[0]);\n }\n\n toggleCollapsed(option: Option, index: string) {\n const onDeferLoad = this.props.onDeferLoad;\n const expanded = this.state.expanded.concat();\n const idx = expanded.indexOf(index);\n\n if (~idx) {\n expanded.splice(idx, 1);\n } else {\n expanded.push(index);\n }\n\n this.setState(\n {\n expanded: expanded\n },\n option.defer && onDeferLoad ? () => onDeferLoad(option) : undefined\n );\n }\n\n renderItem(option: Option, index: number, indexes: Array<number> = []) {\n const {\n labelClassName,\n disabled,\n classnames: cx,\n itemClassName,\n itemRender,\n multiple\n } = this.props;\n const id = indexes.join('-');\n const valueArray = this.valueArray;\n let partial = false;\n let checked = false;\n let hasChildren = Array.isArray(option.children) && option.children.length;\n\n if (option.value === void 0 && hasChildren) {\n let allchecked = true;\n let partialChecked = false;\n const eachFn = (child: Option) => {\n if (Array.isArray(child.children) && child.children.length) {\n child.children.forEach(eachFn);\n }\n\n if (child.value !== void 0) {\n const isIn = !!~valueArray.indexOf(child);\n\n if (isIn && !partialChecked) {\n partialChecked = true;\n } else if (!isIn && allchecked) {\n allchecked = false;\n }\n\n checked = partialChecked;\n partial = partialChecked && !allchecked;\n }\n };\n\n option.children!.forEach(eachFn);\n } else {\n checked = !!~valueArray.indexOf(option);\n }\n\n const expaned = !!~this.state.expanded.indexOf(id);\n\n return (\n <div\n key={index}\n className={cx(\n 'TreeSelection-item',\n disabled || option.disabled || (option.defer && option.loading)\n ? 'is-disabled'\n : '',\n expaned ? 'is-expanded' : ''\n )}\n >\n <div\n className={cx(\n 'TreeSelection-itemInner',\n itemClassName,\n option.className,\n checked ? 'is-active' : ''\n )}\n onClick={() => this.toggleOption(option)}\n >\n {hasChildren || option.defer ? (\n <a\n onClick={(e: React.MouseEvent<any>) => {\n e.stopPropagation();\n this.toggleCollapsed(option, id);\n }}\n className={cx('Table-expandBtn', expaned ? 'is-active' : '')}\n >\n <Icon icon=\"right-arrow-bold\" className=\"icon\" />\n </a>\n ) : null}\n\n {option.defer && option.loading ? <Spinner show size=\"sm\" /> : null}\n\n {multiple && (!option.defer || option.loaded) ? (\n <Checkbox\n size=\"sm\"\n checked={checked}\n partial={partial}\n disabled={disabled || option.disabled}\n labelClassName={labelClassName}\n description={option.description}\n />\n ) : null}\n\n <div className={cx('TreeSelection-itemLabel')}>\n {itemRender(option, {\n index: index,\n multiple: multiple,\n checked: checked,\n onChange: () => this.toggleOption(option),\n disabled: disabled || option.disabled\n })}\n </div>\n\n {option.defer && option.loading ? <Spinner show size=\"sm\" /> : null}\n </div>\n {hasChildren ? (\n <div className={cx('TreeSelection-sublist')}>\n {option.children!.map((option, key) =>\n this.renderItem(option, key, indexes.concat(key))\n )}\n </div>\n ) : null}\n </div>\n );\n }\n\n render() {\n const {\n value,\n options,\n className,\n placeholder,\n classnames: cx,\n option2value,\n translate: __\n } = this.props;\n\n this.valueArray = BaseSelection.value2array(value, options, option2value);\n let body: Array<React.ReactNode> = [];\n\n if (Array.isArray(options) && options.length) {\n body = options.map((option, key) => this.renderItem(option, key, [key]));\n }\n\n return (\n <div className={cx('TreeSelection', className)}>\n {body && body.length ? (\n body\n ) : (\n <div className={cx('TreeSelection-placeholder')}>\n {__(placeholder)}\n </div>\n )}\n </div>\n );\n }\n}\n\nexport default themeable(\n localeable(\n uncontrollable(TreeSelection, {\n value: 'onChange'\n })\n )\n);\n"
|
11
|
+
"import {BaseSelection, BaseSelectionProps} from './Selection';\nimport {themeable} from '../theme';\nimport React from 'react';\nimport {uncontrollable} from 'uncontrollable';\nimport Checkbox from './Checkbox';\nimport {Option} from './Select';\nimport {autobind, eachTree, everyTree} from '../utils/helper';\nimport Spinner from './Spinner';\nimport {localeable} from '../locale';\nimport {Icon} from './icons';\n\nexport interface TreeSelectionProps extends BaseSelectionProps {\n expand?: 'all' | 'first' | 'root' | 'none';\n}\n\nexport interface TreeSelectionState {\n expanded: Array<string>;\n}\n\nexport class TreeSelection extends BaseSelection<\n TreeSelectionProps,\n TreeSelectionState\n> {\n valueArray: Array<Option>;\n state: TreeSelectionState = {\n expanded: []\n };\n\n static defaultProps = {\n ...BaseSelection.defaultProps,\n expand: 'first' as 'first'\n };\n\n componentDidMount() {\n this.syncExpanded();\n }\n\n componentDidUpdate(prevProps: TreeSelectionProps) {\n const props = this.props;\n\n if (\n !this.state.expanded.length &&\n (props.expand !== prevProps.expand || props.options !== prevProps.options)\n ) {\n this.syncExpanded();\n }\n }\n\n syncExpanded() {\n const options = this.props.options;\n const mode = this.props.expand;\n const expanded: Array<string> = [];\n\n if (!Array.isArray(options)) {\n return;\n }\n\n if (mode === 'first' || mode === 'root') {\n options.every((option, index) => {\n if (Array.isArray(option.children)) {\n expanded.push(`${index}`);\n return mode === 'root';\n }\n return true;\n });\n } else if (mode === 'all') {\n everyTree(options, (option, index, level, paths, indexes) => {\n if (Array.isArray(option.children)) {\n expanded.push(`${indexes.concat(index).join('-')}`);\n }\n return true;\n });\n }\n\n this.setState({expanded});\n }\n\n toggleOption(option: Option) {\n const {\n value,\n onChange,\n option2value,\n options,\n onDeferLoad,\n disabled,\n multiple,\n clearable\n } = this.props;\n\n if (disabled || option.disabled) {\n return;\n } else if (option.defer && !option.loaded) {\n onDeferLoad?.(option);\n return;\n }\n\n let valueArray = BaseSelection.value2array(value, options, option2value);\n\n if (\n option.value === void 0 &&\n Array.isArray(option.children) &&\n option.children.length &&\n multiple\n ) {\n const someCheckedFn = (child: Option) =>\n (Array.isArray(child.children) && child.children.length\n ? child.children.some(someCheckedFn)\n : false) ||\n (child.value !== void 0 && ~valueArray.indexOf(child));\n const someChecked = option.children.some(someCheckedFn);\n const eachFn = (child: Option) => {\n if (Array.isArray(child.children) && child.children.length) {\n child.children.forEach(eachFn);\n }\n\n if (child.value !== void 0) {\n const idx = valueArray.indexOf(child);\n\n ~idx && valueArray.splice(idx, 1);\n\n if (!someChecked) {\n valueArray.push(child);\n }\n }\n };\n option.children.forEach(eachFn);\n } else {\n let idx = valueArray.indexOf(option);\n\n if (~idx && (multiple || clearable)) {\n valueArray.splice(idx, 1);\n } else if (multiple) {\n valueArray.push(option);\n } else {\n valueArray = [option];\n }\n }\n\n let newValue: string | Array<Option> = option2value\n ? valueArray.map(item => option2value(item))\n : valueArray;\n\n onChange && onChange(multiple ? newValue : newValue[0]);\n }\n\n toggleCollapsed(option: Option, index: string) {\n const onDeferLoad = this.props.onDeferLoad;\n const expanded = this.state.expanded.concat();\n const idx = expanded.indexOf(index);\n\n if (~idx) {\n expanded.splice(idx, 1);\n } else {\n expanded.push(index);\n }\n\n this.setState(\n {\n expanded: expanded\n },\n option.defer && onDeferLoad ? () => onDeferLoad(option) : undefined\n );\n }\n\n renderItem(option: Option, index: number, indexes: Array<number> = []) {\n const {\n labelClassName,\n disabled,\n classnames: cx,\n itemClassName,\n itemRender,\n multiple\n } = this.props;\n const id = indexes.join('-');\n const valueArray = this.valueArray;\n let partial = false;\n let checked = false;\n let hasChildren = Array.isArray(option.children) && option.children.length;\n\n if (option.value === void 0 && hasChildren) {\n let allchecked = true;\n let partialChecked = false;\n const eachFn = (child: Option) => {\n if (Array.isArray(child.children) && child.children.length) {\n child.children.forEach(eachFn);\n }\n\n if (child.value !== void 0) {\n const isIn = !!~valueArray.indexOf(child);\n\n if (isIn && !partialChecked) {\n partialChecked = true;\n } else if (!isIn && allchecked) {\n allchecked = false;\n }\n\n checked = partialChecked;\n partial = partialChecked && !allchecked;\n }\n };\n\n option.children!.forEach(eachFn);\n } else {\n checked = !!~valueArray.indexOf(option);\n }\n\n const expaned = !!~this.state.expanded.indexOf(id);\n\n return (\n <div\n key={index}\n className={cx(\n 'TreeSelection-item',\n disabled || option.disabled || (option.defer && option.loading)\n ? 'is-disabled'\n : '',\n expaned ? 'is-expanded' : ''\n )}\n >\n <div\n className={cx(\n 'TreeSelection-itemInner',\n itemClassName,\n option.className,\n checked ? 'is-active' : ''\n )}\n onClick={() => this.toggleOption(option)}\n >\n {hasChildren || option.defer ? (\n <a\n onClick={(e: React.MouseEvent<any>) => {\n e.stopPropagation();\n this.toggleCollapsed(option, id);\n }}\n className={cx('Table-expandBtn', expaned ? 'is-active' : '')}\n >\n <Icon icon=\"right-arrow-bold\" className=\"icon\" />\n </a>\n ) : null}\n\n {option.defer && option.loading ? <Spinner show size=\"sm\" /> : null}\n\n {multiple && (!option.defer || option.loaded) ? (\n <Checkbox\n size=\"sm\"\n checked={checked}\n partial={partial}\n disabled={disabled || option.disabled}\n labelClassName={labelClassName}\n description={option.description}\n />\n ) : null}\n\n <div className={cx('TreeSelection-itemLabel')}>\n {itemRender(option, {\n index: index,\n multiple: multiple,\n checked: checked,\n onChange: () => this.toggleOption(option),\n disabled: disabled || option.disabled\n })}\n </div>\n\n {option.defer && option.loading ? <Spinner show size=\"sm\" /> : null}\n </div>\n {hasChildren ? (\n <div className={cx('TreeSelection-sublist')}>\n {option.children!.map((option, key) =>\n this.renderItem(option, key, indexes.concat(key))\n )}\n </div>\n ) : null}\n </div>\n );\n }\n\n render() {\n const {\n value,\n options,\n className,\n placeholder,\n classnames: cx,\n option2value,\n placeholderRender,\n translate: __\n } = this.props;\n\n this.valueArray = BaseSelection.value2array(value, options, option2value);\n let body: Array<React.ReactNode> = [];\n\n if (Array.isArray(options) && options.length) {\n body = options.map((option, key) => this.renderItem(option, key, [key]));\n }\n\n return (\n <div className={cx('TreeSelection', className)}>\n {body && body.length ? (\n body\n ) : (\n <div className={cx('TreeSelection-placeholder')}>\n {placeholderRender?.(this.props) ?? __(placeholder)}\n </div>\n )}\n </div>\n );\n }\n}\n\nexport default themeable(\n localeable(\n uncontrollable(TreeSelection, {\n value: 'onChange'\n })\n )\n);\n"
|
12
12
|
]
|
13
13
|
}
|
@@ -11,7 +11,7 @@ export interface VariableItem {
|
|
11
11
|
label: string;
|
12
12
|
value?: string;
|
13
13
|
children?: Array<VariableItem>;
|
14
|
-
type
|
14
|
+
type?: string;
|
15
15
|
tag?: string;
|
16
16
|
selectMode?: 'tree' | 'tabs';
|
17
17
|
}
|
@@ -53,6 +53,10 @@ export interface FormulaEditorProps extends ThemeProps, LocaleProps {
|
|
53
53
|
header: string;
|
54
54
|
variableClassName?: string;
|
55
55
|
functionClassName?: string;
|
56
|
+
/**
|
57
|
+
* 当前输入项字段 name: 用于避免循环绑定自身导致无限渲染
|
58
|
+
*/
|
59
|
+
selfVariableName?: string;
|
56
60
|
}
|
57
61
|
export interface FunctionsProps {
|
58
62
|
name: string;
|
@@ -92,7 +96,7 @@ export declare class FormulaEditor extends React.Component<FormulaEditorProps, F
|
|
92
96
|
render(): JSX.Element;
|
93
97
|
}
|
94
98
|
declare const _default: {
|
95
|
-
new (props: Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
99
|
+
new (props: Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
96
100
|
locale?: string | undefined;
|
97
101
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
98
102
|
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps): {
|
@@ -101,12 +105,12 @@ declare const _default: {
|
|
101
105
|
getWrappedInstance(): any;
|
102
106
|
render(): JSX.Element;
|
103
107
|
context: any;
|
104
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
108
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
105
109
|
locale?: string | undefined;
|
106
110
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
107
111
|
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
108
112
|
forceUpdate(callback?: (() => void) | undefined): void;
|
109
|
-
readonly props: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
113
|
+
readonly props: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
110
114
|
locale?: string | undefined;
|
111
115
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
112
116
|
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps> & Readonly<{
|
@@ -117,35 +121,35 @@ declare const _default: {
|
|
117
121
|
[key: string]: React.ReactInstance;
|
118
122
|
};
|
119
123
|
componentDidMount?(): void;
|
120
|
-
shouldComponentUpdate?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
124
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
121
125
|
locale?: string | undefined;
|
122
126
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
123
127
|
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
124
128
|
componentWillUnmount?(): void;
|
125
129
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
126
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
130
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
127
131
|
locale?: string | undefined;
|
128
132
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
129
133
|
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, prevState: Readonly<{}>): any;
|
130
|
-
componentDidUpdate?(prevProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
134
|
+
componentDidUpdate?(prevProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
131
135
|
locale?: string | undefined;
|
132
136
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
133
137
|
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
134
138
|
componentWillMount?(): void;
|
135
139
|
UNSAFE_componentWillMount?(): void;
|
136
|
-
componentWillReceiveProps?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
140
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
137
141
|
locale?: string | undefined;
|
138
142
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
139
143
|
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextContext: any): void;
|
140
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
144
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
141
145
|
locale?: string | undefined;
|
142
146
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
143
147
|
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextContext: any): void;
|
144
|
-
componentWillUpdate?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
148
|
+
componentWillUpdate?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
145
149
|
locale?: string | undefined;
|
146
150
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
147
151
|
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
148
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
152
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
149
153
|
locale?: string | undefined;
|
150
154
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
151
155
|
}, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
@@ -153,7 +157,7 @@ declare const _default: {
|
|
153
157
|
displayName: string;
|
154
158
|
contextType: React.Context<string>;
|
155
159
|
ComposedComponent: React.ComponentType<{
|
156
|
-
new (props: Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
160
|
+
new (props: Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
157
161
|
locale?: string | undefined;
|
158
162
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
159
163
|
}): {
|
@@ -162,12 +166,12 @@ declare const _default: {
|
|
162
166
|
getWrappedInstance(): any;
|
163
167
|
render(): JSX.Element;
|
164
168
|
context: any;
|
165
|
-
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
169
|
+
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
166
170
|
locale?: string | undefined;
|
167
171
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
168
172
|
}>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
|
169
173
|
forceUpdate(callback?: (() => void) | undefined): void;
|
170
|
-
readonly props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
174
|
+
readonly props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
171
175
|
locale?: string | undefined;
|
172
176
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
173
177
|
}> & Readonly<{
|
@@ -178,35 +182,35 @@ declare const _default: {
|
|
178
182
|
[key: string]: React.ReactInstance;
|
179
183
|
};
|
180
184
|
componentDidMount?(): void;
|
181
|
-
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
185
|
+
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
182
186
|
locale?: string | undefined;
|
183
187
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
184
188
|
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
185
189
|
componentWillUnmount?(): void;
|
186
190
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
187
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
191
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
188
192
|
locale?: string | undefined;
|
189
193
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
190
194
|
}>, prevState: Readonly<{}>): any;
|
191
|
-
componentDidUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
195
|
+
componentDidUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
192
196
|
locale?: string | undefined;
|
193
197
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
194
198
|
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
195
199
|
componentWillMount?(): void;
|
196
200
|
UNSAFE_componentWillMount?(): void;
|
197
|
-
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
201
|
+
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
198
202
|
locale?: string | undefined;
|
199
203
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
200
204
|
}>, nextContext: any): void;
|
201
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
205
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
202
206
|
locale?: string | undefined;
|
203
207
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
204
208
|
}>, nextContext: any): void;
|
205
|
-
componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
209
|
+
componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
206
210
|
locale?: string | undefined;
|
207
211
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
208
212
|
}>, nextState: Readonly<{}>, nextContext: any): void;
|
209
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
213
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
210
214
|
locale?: string | undefined;
|
211
215
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
212
216
|
}>, nextState: Readonly<{}>, nextContext: any): void;
|
@@ -218,7 +222,7 @@ declare const _default: {
|
|
218
222
|
ComposedComponent: typeof FormulaEditor;
|
219
223
|
}>;
|
220
224
|
} & import("hoist-non-react-statics").NonReactStatics<{
|
221
|
-
new (props: Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
225
|
+
new (props: Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
222
226
|
locale?: string | undefined;
|
223
227
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
224
228
|
}): {
|
@@ -227,12 +231,12 @@ declare const _default: {
|
|
227
231
|
getWrappedInstance(): any;
|
228
232
|
render(): JSX.Element;
|
229
233
|
context: any;
|
230
|
-
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
234
|
+
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
231
235
|
locale?: string | undefined;
|
232
236
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
233
237
|
}>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
|
234
238
|
forceUpdate(callback?: (() => void) | undefined): void;
|
235
|
-
readonly props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
239
|
+
readonly props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
236
240
|
locale?: string | undefined;
|
237
241
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
238
242
|
}> & Readonly<{
|
@@ -243,35 +247,35 @@ declare const _default: {
|
|
243
247
|
[key: string]: React.ReactInstance;
|
244
248
|
};
|
245
249
|
componentDidMount?(): void;
|
246
|
-
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
250
|
+
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
247
251
|
locale?: string | undefined;
|
248
252
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
249
253
|
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
250
254
|
componentWillUnmount?(): void;
|
251
255
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
252
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
256
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
253
257
|
locale?: string | undefined;
|
254
258
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
255
259
|
}>, prevState: Readonly<{}>): any;
|
256
|
-
componentDidUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
260
|
+
componentDidUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
257
261
|
locale?: string | undefined;
|
258
262
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
259
263
|
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
260
264
|
componentWillMount?(): void;
|
261
265
|
UNSAFE_componentWillMount?(): void;
|
262
|
-
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
266
|
+
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
263
267
|
locale?: string | undefined;
|
264
268
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
265
269
|
}>, nextContext: any): void;
|
266
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
270
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
267
271
|
locale?: string | undefined;
|
268
272
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
269
273
|
}>, nextContext: any): void;
|
270
|
-
componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
274
|
+
componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
271
275
|
locale?: string | undefined;
|
272
276
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
273
277
|
}>, nextState: Readonly<{}>, nextContext: any): void;
|
274
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
278
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
275
279
|
locale?: string | undefined;
|
276
280
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
277
281
|
}>, nextState: Readonly<{}>, nextContext: any): void;
|
@@ -283,7 +287,7 @@ declare const _default: {
|
|
283
287
|
ComposedComponent: typeof FormulaEditor;
|
284
288
|
}, {}> & {
|
285
289
|
ComposedComponent: {
|
286
|
-
new (props: Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
290
|
+
new (props: Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
287
291
|
locale?: string | undefined;
|
288
292
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
289
293
|
}): {
|
@@ -292,12 +296,12 @@ declare const _default: {
|
|
292
296
|
getWrappedInstance(): any;
|
293
297
|
render(): JSX.Element;
|
294
298
|
context: any;
|
295
|
-
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
299
|
+
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
296
300
|
locale?: string | undefined;
|
297
301
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
298
302
|
}>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
|
299
303
|
forceUpdate(callback?: (() => void) | undefined): void;
|
300
|
-
readonly props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
304
|
+
readonly props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
301
305
|
locale?: string | undefined;
|
302
306
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
303
307
|
}> & Readonly<{
|
@@ -308,35 +312,35 @@ declare const _default: {
|
|
308
312
|
[key: string]: React.ReactInstance;
|
309
313
|
};
|
310
314
|
componentDidMount?(): void;
|
311
|
-
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
315
|
+
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
312
316
|
locale?: string | undefined;
|
313
317
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
314
318
|
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
315
319
|
componentWillUnmount?(): void;
|
316
320
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
317
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
321
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
318
322
|
locale?: string | undefined;
|
319
323
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
320
324
|
}>, prevState: Readonly<{}>): any;
|
321
|
-
componentDidUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
325
|
+
componentDidUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
322
326
|
locale?: string | undefined;
|
323
327
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
324
328
|
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
325
329
|
componentWillMount?(): void;
|
326
330
|
UNSAFE_componentWillMount?(): void;
|
327
|
-
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
331
|
+
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
328
332
|
locale?: string | undefined;
|
329
333
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
330
334
|
}>, nextContext: any): void;
|
331
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
335
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
332
336
|
locale?: string | undefined;
|
333
337
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
334
338
|
}>, nextContext: any): void;
|
335
|
-
componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
339
|
+
componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
336
340
|
locale?: string | undefined;
|
337
341
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
338
342
|
}>, nextState: Readonly<{}>, nextContext: any): void;
|
339
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
343
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
|
340
344
|
locale?: string | undefined;
|
341
345
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
342
346
|
}>, nextState: Readonly<{}>, nextContext: any): void;
|
@@ -16,6 +16,7 @@ var CodeMirror_1 = (0, tslib_1.__importDefault)(require("../CodeMirror"));
|
|
16
16
|
var helper_1 = require("../../utils/helper");
|
17
17
|
var theme_1 = require("../../theme");
|
18
18
|
var locale_1 = require("../../locale");
|
19
|
+
var Toast_1 = require("../Toast");
|
19
20
|
var FormulaEditor = /** @class */ (function (_super) {
|
20
21
|
(0, tslib_1.__extends)(FormulaEditor, _super);
|
21
22
|
function FormulaEditor() {
|
@@ -114,6 +115,11 @@ var FormulaEditor = /** @class */ (function (_super) {
|
|
114
115
|
};
|
115
116
|
FormulaEditor.prototype.handleVariableSelect = function (item) {
|
116
117
|
var _a;
|
118
|
+
var _b = this.props, evalMode = _b.evalMode, selfVariableName = _b.selfVariableName;
|
119
|
+
if (item && item.label && selfVariableName === item.label) {
|
120
|
+
Toast_1.toast.warning('不能使用当前变量[self],避免循环引用。');
|
121
|
+
return;
|
122
|
+
}
|
117
123
|
(_a = this.editorPlugin) === null || _a === void 0 ? void 0 : _a.insertContent({
|
118
124
|
key: item.value,
|
119
125
|
name: item.label
|
@@ -127,7 +133,7 @@ var FormulaEditor = /** @class */ (function (_super) {
|
|
127
133
|
return (0, plugin_1.editorFactory)(dom, cm, this.props);
|
128
134
|
};
|
129
135
|
FormulaEditor.prototype.render = function () {
|
130
|
-
var _a = this.props, variables = _a.variables, header = _a.header, value = _a.value, functions = _a.functions, variableMode = _a.variableMode, __ = _a.translate, cx = _a.classnames, variableClassName = _a.variableClassName, functionClassName = _a.functionClassName, classPrefix = _a.classPrefix;
|
136
|
+
var _a = this.props, variables = _a.variables, header = _a.header, value = _a.value, functions = _a.functions, variableMode = _a.variableMode, __ = _a.translate, cx = _a.classnames, variableClassName = _a.variableClassName, functionClassName = _a.functionClassName, classPrefix = _a.classPrefix, selfVariableName = _a.selfVariableName;
|
131
137
|
var focused = this.state.focused;
|
132
138
|
var customFunctions = Array.isArray(functions) ? functions : [];
|
133
139
|
var functionList = (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], FormulaEditor.buildDefaultFunctions(doc_1.doc), true), customFunctions, true);
|
@@ -141,7 +147,7 @@ var FormulaEditor = /** @class */ (function (_super) {
|
|
141
147
|
react_1.default.createElement("div", { className: cx('FormulaEditor-panel') },
|
142
148
|
variableMode !== 'tabs' ? (react_1.default.createElement("div", { className: cx('FormulaEditor-panel-header') }, __('FormulaEditor.variable'))) : null,
|
143
149
|
react_1.default.createElement("div", { className: cx('FormulaEditor-panel-body', variableMode && "FormulaEditor-panel-body--".concat(variableMode)) },
|
144
|
-
react_1.default.createElement(VariableList_1.default, { classPrefix: classPrefix, className: cx('FormulaEditor-VariableList', 'FormulaEditor-VariableList-root', variableClassName), selectMode: variableMode, data: variables, onSelect: this.handleVariableSelect }))),
|
150
|
+
react_1.default.createElement(VariableList_1.default, { classPrefix: classPrefix, className: cx('FormulaEditor-VariableList', 'FormulaEditor-VariableList-root', variableClassName), selectMode: variableMode, data: variables, onSelect: this.handleVariableSelect, selfVariableName: selfVariableName }))),
|
145
151
|
react_1.default.createElement(FuncList_1.default, { className: functionClassName, title: __('FormulaEditor.function'), data: functionList, onSelect: this.handleFunctionSelect }))));
|
146
152
|
};
|
147
153
|
var _a;
|
@@ -6,8 +6,8 @@
|
|
6
6
|
"/src/components/formula/Editor.tsx"
|
7
7
|
],
|
8
8
|
"names": [],
|
9
|
-
"mappings": ";;;;AAAA;;GAEG;AACH,6DAA0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AC5B,KAAK,EAAE,EAAE,CAAC,wBAAwB,CAAC,EACnC,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,IAAI,CAAC,oBAAoB,GACnC,CACM,CACN,CACP,CAAC;IACJ,CAAC;;IA/MM,0BAAY,GAAuD;QACxE,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,IAAI;KACf,CAAC;IAkDF;QADC,iBAAQ;;;;oDAKR;IAGD;QADC,iBAAQ;;;;mDAKR;IAGD;QADC,iBAAQ;;;;oDAGR;IAGD;QADC,iBAAQ;;;;4DAGR;IAGD;QADC,iBAAQ;;;;iDAeR;IAGD;QADC,iBAAQ;;;;6DAGR;IAGD;QADC,iBAAQ;;;;6DAgBR;IAGD;QADC,iBAAQ;;;;uDAIR;IAGD;QADC,iBAAQ;;0EACU,WAAW,oBAAX,WAAW;;sDAE7B;IAmFH,oBAAC;CAAA,AAlPD,CAAmC,eAAK,CAAC,SAAS,GAkPjD;AAlPY,sCAAa;AAoP1B,kBAAe,IAAA,+BAAc,EAC3B,IAAA,iBAAS,EAAC,IAAA,mBAAU,EAAC,aAAa,CAAC,CAAC,EACpC;IACE,KAAK,EAAE,UAAU;CAClB,EACD,CAAC,UAAU,CAAC,CACb,CAAC",
|
10
10
|
"sourcesContent": [
|
11
|
-
"/**\n * @file 公式编辑器\n */\nimport React from 'react';\nimport {uncontrollable} from 'uncontrollable';\nimport {parse} from 'amis-formula';\nimport {doc} from 'amis-formula/dist/doc';\n\nimport {FormulaPlugin, editorFactory} from './plugin';\nimport FuncList from './FuncList';\nimport VariableList from './VariableList';\nimport CodeMirrorEditor from '../CodeMirror';\nimport {autobind, eachTree} from '../../utils/helper';\nimport {themeable, ThemeProps} from '../../theme';\nimport {localeable, LocaleProps} from '../../locale';\n\nexport interface VariableItem {\n label: string;\n value?: string;\n children?: Array<VariableItem>;\n type
|
11
|
+
"/**\n * @file 公式编辑器\n */\nimport React from 'react';\nimport {uncontrollable} from 'uncontrollable';\nimport {parse} from 'amis-formula';\nimport {doc} from 'amis-formula/dist/doc';\n\nimport {FormulaPlugin, editorFactory} from './plugin';\nimport FuncList from './FuncList';\nimport VariableList from './VariableList';\nimport CodeMirrorEditor from '../CodeMirror';\nimport {autobind, eachTree} from '../../utils/helper';\nimport {themeable, ThemeProps} from '../../theme';\nimport {localeable, LocaleProps} from '../../locale';\nimport {toast} from '../Toast';\n\nexport interface VariableItem {\n label: string;\n value?: string;\n children?: Array<VariableItem>;\n type?: string;\n tag?: string;\n selectMode?: 'tree' | 'tabs';\n}\n\nexport interface FuncGroup {\n groupName: string;\n items: Array<FuncItem>;\n}\n\nexport interface FuncItem {\n name: string; // 函数名\n example?: string; // 示例\n description?: string; // 描述\n [propName: string]: any;\n}\n\nexport interface FormulaEditorProps extends ThemeProps, LocaleProps {\n onChange?: (value: string) => void;\n value?: string;\n /**\n * evalMode 即直接就是表达式,否则\n * 需要 ${这里面才是表达式}\n * 默认为 true\n */\n evalMode?: boolean;\n\n /**\n * 用于提示的变量集合,默认为空\n */\n variables?: Array<VariableItem>;\n\n /**\n * 变量展现模式,可选值:'tabs' | 'tree'\n */\n variableMode?: 'tabs' | 'tree';\n\n /**\n * 函数集合,默认不需要传,即 amis-formula 里面那个函数\n * 如果有扩充,则需要传。\n */\n functions?: Array<FuncGroup>;\n\n /**\n * 顶部标题,默认为表达式\n */\n header: string;\n\n variableClassName?: string;\n\n functionClassName?: string;\n\n /**\n * 当前输入项字段 name: 用于避免循环绑定自身导致无限渲染\n */\n selfVariableName?: string;\n}\n\nexport interface FunctionsProps {\n name: string;\n items: FunctionProps[];\n}\n\nexport interface FunctionProps {\n name: string;\n intro: string;\n usage: string;\n example: string;\n}\n\nexport interface FormulaState {\n focused: boolean;\n}\n\nexport class FormulaEditor extends React.Component<\n FormulaEditorProps,\n FormulaState\n> {\n state: FormulaState = {\n focused: false\n };\n editorPlugin?: FormulaPlugin;\n\n static buildDefaultFunctions(\n doc: Array<{\n namespace: string;\n name: string;\n [propName: string]: any;\n }>\n ) {\n const funcs: Array<FuncGroup> = [];\n\n doc.forEach(item => {\n const namespace = item.namespace || 'Others';\n let exists = funcs.find(item => item.groupName === namespace);\n if (!exists) {\n exists = {\n groupName: namespace,\n items: []\n };\n funcs.push(exists);\n }\n exists.items.push(item);\n });\n\n return funcs;\n }\n\n static defaultProps: Pick<FormulaEditorProps, 'variables' | 'evalMode'> = {\n variables: [],\n evalMode: true\n };\n\n static highlightValue(\n value: string,\n variables: Array<VariableItem>,\n evalMode: boolean = true\n ) {\n if (!Array.isArray(variables) || !variables.length || !value) {\n return;\n }\n\n const varMap: {\n [propname: string]: string;\n } = {};\n\n eachTree(variables, item => {\n if (item.value) {\n const key = item.value;\n varMap[key] = item.label;\n }\n });\n const vars = Object.keys(varMap)\n .filter(item => item)\n .sort((a, b) => b.length - a.length);\n\n const content = value || '';\n let html = '';\n\n // 标记方法调用\n html = content.replace(/([A-Z]+)\\s*\\(/g, (_, func, pos) => {\n return _?.replace(func, `<span class=\"c-func\">${func}</span>`);\n });\n\n vars.forEach(v => {\n let from = 0;\n let idx = -1;\n while (~(idx = content.indexOf(v, from))) {\n html = html.replace(v, `<span class=\"c-field\">${varMap[v]}</span>`);\n from = idx + v.length;\n }\n });\n\n return {html};\n }\n\n componentWillUnmount() {\n this.editorPlugin?.dispose();\n }\n\n @autobind\n handleFocus() {\n this.setState({\n focused: true\n });\n }\n\n @autobind\n handleBlur() {\n this.setState({\n focused: false\n });\n }\n\n @autobind\n insertValue(value: any, type: 'variable' | 'func') {\n this.editorPlugin?.insertContent(value, type);\n }\n\n @autobind\n handleEditorMounted(cm: any, editor: any) {\n this.editorPlugin = new FormulaPlugin(editor, cm, () => this.props);\n }\n\n @autobind\n validate() {\n const value = this.props.value;\n\n try {\n value\n ? parse(value, {\n evalMode: this.props.evalMode\n })\n : null;\n } catch (e) {\n return e.message;\n }\n\n return;\n }\n\n @autobind\n handleFunctionSelect(item: FuncItem) {\n this.editorPlugin?.insertContent(`${item.name}`, 'func');\n }\n\n @autobind\n handleVariableSelect(item: VariableItem) {\n const {evalMode, selfVariableName} = this.props;\n\n if (item && item.label && selfVariableName === item.label) {\n toast.warning('不能使用当前变量[self],避免循环引用。');\n return;\n }\n\n this.editorPlugin?.insertContent(\n {\n key: item.value,\n name: item.label\n },\n 'variable'\n );\n }\n\n @autobind\n handleOnChange(value: any) {\n const onChange = this.props.onChange;\n onChange?.(value);\n }\n\n @autobind\n editorFactory(dom: HTMLElement, cm: any) {\n return editorFactory(dom, cm, this.props);\n }\n\n render() {\n const {\n variables,\n header,\n value,\n functions,\n variableMode,\n translate: __,\n classnames: cx,\n variableClassName,\n functionClassName,\n classPrefix,\n selfVariableName\n } = this.props;\n const {focused} = this.state;\n const customFunctions = Array.isArray(functions) ? functions : [];\n const functionList = [\n ...FormulaEditor.buildDefaultFunctions(doc),\n ...customFunctions\n ];\n\n return (\n <div\n className={cx(`FormulaEditor`, {\n 'is-focused': focused\n })}\n >\n <section className={cx(`FormulaEditor-content`)}>\n <header className={cx(`FormulaEditor-header`)}>\n {__(header || 'FormulaEditor.title')}\n </header>\n\n <CodeMirrorEditor\n className={cx('FormulaEditor-editor')}\n value={value}\n onChange={this.handleOnChange}\n editorFactory={this.editorFactory}\n editorDidMount={this.handleEditorMounted}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n </section>\n\n <section className={cx('FormulaEditor-settings')}>\n <div className={cx('FormulaEditor-panel')}>\n {variableMode !== 'tabs' ? (\n <div className={cx('FormulaEditor-panel-header')}>\n {__('FormulaEditor.variable')}\n </div>\n ) : null}\n <div\n className={cx(\n 'FormulaEditor-panel-body',\n variableMode && `FormulaEditor-panel-body--${variableMode}`\n )}\n >\n <VariableList\n classPrefix={classPrefix}\n className={cx(\n 'FormulaEditor-VariableList',\n 'FormulaEditor-VariableList-root',\n variableClassName\n )}\n selectMode={variableMode}\n data={variables!}\n onSelect={this.handleVariableSelect}\n selfVariableName={selfVariableName}\n />\n </div>\n </div>\n\n <FuncList\n className={functionClassName}\n title={__('FormulaEditor.function')}\n data={functionList}\n onSelect={this.handleFunctionSelect}\n />\n </section>\n </div>\n );\n }\n}\n\nexport default uncontrollable(\n themeable(localeable(FormulaEditor)),\n {\n value: 'onChange'\n },\n ['validate']\n);\n"
|
12
12
|
]
|
13
13
|
}
|