amis 1.9.1-beta.1 → 1.9.1-beta.3
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/RootRenderer.js +10 -2
- package/lib/RootRenderer.js.map +2 -2
- package/lib/Schema.d.ts +3 -2
- package/lib/Schema.js.map +1 -1
- package/lib/components/Alert2.d.ts +10 -10
- package/lib/components/Button.d.ts +11 -10
- package/lib/components/Button.js +2 -2
- package/lib/components/Button.js.map +2 -2
- package/lib/components/CalendarMobile.d.ts +40 -40
- package/lib/components/Checkbox.js +1 -1
- package/lib/components/Checkbox.js.map +2 -2
- package/lib/components/ContextMenu.d.ts +4 -0
- package/lib/components/ContextMenu.js +23 -7
- package/lib/components/ContextMenu.js.map +2 -2
- package/lib/components/DatePicker.d.ts +40 -40
- package/lib/components/DateRangePicker.d.ts +40 -40
- package/lib/components/Form.d.ts +22 -0
- package/lib/components/Form.js +44 -0
- package/lib/components/Form.js.map +13 -0
- package/lib/components/FormField.d.ts +65 -0
- package/lib/components/FormField.js +48 -0
- package/lib/components/FormField.js.map +13 -0
- package/lib/components/InputBox.d.ts +10 -10
- package/lib/components/InputBox.js +4 -3
- package/lib/components/InputBox.js.map +2 -2
- package/lib/components/InputBoxWithSuggestion.d.ts +280 -0
- package/lib/components/InputBoxWithSuggestion.js +65 -0
- package/lib/components/InputBoxWithSuggestion.js.map +13 -0
- package/lib/components/ListGroup.d.ts +10 -10
- package/lib/components/PickerContainer.d.ts +4 -2
- package/lib/components/PickerContainer.js +28 -5
- package/lib/components/PickerContainer.js.map +2 -2
- package/lib/components/Radios.d.ts +10 -10
- package/lib/components/ResultBox.d.ts +40 -40
- package/lib/components/SearchBox.d.ts +40 -40
- package/lib/components/Select.d.ts +195 -202
- package/lib/components/Select.js +7 -3
- package/lib/components/Select.js.map +2 -2
- package/lib/components/Textarea.d.ts +568 -2
- package/lib/components/Textarea.js +129 -1
- package/lib/components/Textarea.js.map +2 -2
- package/lib/components/Toast.js +11 -9
- package/lib/components/Toast.js.map +2 -2
- package/lib/components/UserSelect.d.ts +500 -0
- package/lib/components/UserSelect.js +559 -0
- package/lib/components/UserSelect.js.map +13 -0
- package/lib/components/UserTabSelect.d.ts +320 -0
- package/lib/components/UserTabSelect.js +163 -0
- package/lib/components/UserTabSelect.js.map +13 -0
- package/lib/components/WithRemoteConfig.d.ts +7 -0
- package/lib/components/WithRemoteConfig.js +17 -11
- package/lib/components/WithRemoteConfig.js.map +2 -2
- package/lib/components/calendar/DaysView.d.ts +26 -1
- package/lib/components/calendar/DaysView.js +48 -14
- package/lib/components/calendar/DaysView.js.map +2 -2
- package/lib/components/calendar/TimeView.d.ts +1 -1
- package/lib/components/calendar/TimeView.js +8 -2
- package/lib/components/calendar/TimeView.js.map +2 -2
- package/lib/components/icons.d.ts +7 -1
- package/lib/components/icons.js +17 -1
- package/lib/components/icons.js.map +2 -2
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -1
- package/lib/components/index.js.map +2 -2
- package/lib/components/json-schema/Array.d.ts +3 -0
- package/lib/components/json-schema/Array.js +125 -0
- package/lib/components/json-schema/Array.js.map +13 -0
- package/lib/components/json-schema/Item.d.ts +3 -0
- package/lib/components/json-schema/Item.js +34 -0
- package/lib/components/json-schema/Item.js.map +13 -0
- package/lib/components/json-schema/Object.d.ts +3 -0
- package/lib/components/json-schema/Object.js +178 -0
- package/lib/components/json-schema/Object.js.map +13 -0
- package/lib/components/json-schema/index.d.ts +279 -0
- package/lib/components/json-schema/index.js +16 -0
- package/lib/components/json-schema/index.js.map +13 -0
- package/lib/components/schema-editor/Array.js +2 -2
- package/lib/components/schema-editor/Array.js.map +2 -2
- package/lib/components/schema-editor/Common.d.ts +2 -0
- package/lib/components/schema-editor/Common.js +39 -3
- package/lib/components/schema-editor/Common.js.map +2 -2
- package/lib/components/schema-editor/Object.js +2 -2
- package/lib/components/schema-editor/Object.js.map +2 -2
- package/lib/components/schema-editor/index.d.ts +45 -41
- package/lib/components/schema-editor/index.js +5 -5
- package/lib/components/schema-editor/index.js.map +2 -2
- package/lib/hooks/use-validation-resolver.d.ts +1 -0
- package/lib/hooks/use-validation-resolver.js +49 -0
- package/lib/hooks/use-validation-resolver.js.map +13 -0
- package/lib/icons/department.js +17 -0
- package/lib/icons/menu.js +9 -0
- package/lib/icons/post.js +15 -0
- package/lib/icons/role.js +14 -0
- package/lib/icons/user-remove.js +12 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/lib/index.js.map +2 -2
- package/lib/locale/de-DE.js +11 -1
- package/lib/locale/de-DE.js.map +2 -2
- package/lib/locale/en-US.js +12 -1
- package/lib/locale/en-US.js.map +2 -2
- package/lib/locale/zh-CN.js +14 -3
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/Action.js +25 -11
- package/lib/renderers/Action.js.map +2 -2
- package/lib/renderers/CRUD.js +5 -1
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/Dialog.js +9 -3
- package/lib/renderers/Dialog.js.map +2 -2
- package/lib/renderers/Drawer.js +5 -1
- package/lib/renderers/Drawer.js.map +2 -2
- package/lib/renderers/Form/InputDate.d.ts +2 -2
- package/lib/renderers/Form/InputDate.js.map +2 -2
- package/lib/renderers/Form/JSONSchema.d.ts +23 -0
- package/lib/renderers/Form/JSONSchema.js +44 -0
- package/lib/renderers/Form/JSONSchema.js.map +13 -0
- package/lib/renderers/Form/JSONSchemaEditor.d.ts +2 -3
- package/lib/renderers/Form/JSONSchemaEditor.js +9 -24
- package/lib/renderers/Form/JSONSchemaEditor.js.map +2 -2
- package/lib/renderers/Form/Textarea.d.ts +1 -8
- package/lib/renderers/Form/Textarea.js +11 -75
- package/lib/renderers/Form/Textarea.js.map +2 -2
- package/lib/renderers/Form/UserSelect.d.ts +54 -0
- package/lib/renderers/Form/UserSelect.js +197 -0
- package/lib/renderers/Form/UserSelect.js.map +13 -0
- package/lib/renderers/Form/index.d.ts +1 -1
- package/lib/renderers/Form/index.js +88 -42
- package/lib/renderers/Form/index.js.map +2 -2
- package/lib/renderers/Log.d.ts +13 -1
- package/lib/renderers/Log.js +82 -16
- package/lib/renderers/Log.js.map +2 -2
- package/lib/renderers/Page.js +5 -1
- package/lib/renderers/Page.js.map +2 -2
- package/lib/renderers/Service.js +5 -1
- package/lib/renderers/Service.js.map +2 -2
- package/lib/renderers/Wizard.js +37 -14
- package/lib/renderers/Wizard.js.map +2 -2
- package/lib/store/form.js +65 -45
- package/lib/store/form.js.map +2 -2
- package/lib/themes/ang-ie11.css +561 -21
- package/lib/themes/ang.css +538 -9
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +561 -21
- package/lib/themes/antd.css +538 -9
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +561 -21
- package/lib/themes/cxd.css +538 -9
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +561 -21
- package/lib/themes/dark.css +538 -9
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default-ie11.css +561 -21
- package/lib/themes/default.css +538 -9
- package/lib/themes/default.css.map +1 -1
- package/lib/utils/api.js +1 -1
- package/lib/utils/api.js.map +2 -2
- package/lib/utils/renderer-event.js.map +2 -2
- package/package.json +2 -1
- package/schema.json +539 -3
- package/scss/_properties.scss +20 -8
- package/scss/components/_input-box.scss +22 -1
- package/scss/components/_json-schema.scss +124 -0
- package/scss/components/_log.scss +37 -5
- package/scss/components/form/_date-range.scss +1 -0
- package/scss/components/form/_select.scss +9 -0
- package/scss/components/form/_user-select.scss +422 -0
- package/scss/themes/_common.scss +2 -0
- package/sdk/ang-ie11.css +651 -21
- package/sdk/ang.css +628 -9
- package/sdk/antd-ie11.css +651 -21
- package/sdk/antd.css +628 -9
- 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 +651 -21
- package/sdk/cxd.css +628 -9
- package/sdk/dark-ie11.css +651 -21
- package/sdk/dark.css +628 -9
- package/sdk/exceljs.js +1 -1
- package/sdk/locale/de-DE.js +11 -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 +651 -21
- package/sdk/sdk.css +628 -9
- package/sdk/sdk.js +1655 -1643
- 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/RootRenderer.tsx +27 -15
- package/src/Schema.ts +5 -1
- package/src/components/Button.tsx +3 -0
- package/src/components/Checkbox.tsx +2 -1
- package/src/components/ContextMenu.tsx +25 -7
- package/src/components/Form.tsx +70 -0
- package/src/components/FormField.tsx +127 -0
- package/src/components/InputBox.tsx +4 -1
- package/src/components/InputBoxWithSuggestion.tsx +113 -0
- package/src/components/PickerContainer.tsx +20 -5
- package/src/components/Select.tsx +18 -10
- package/src/components/Textarea.tsx +234 -2
- package/src/components/Toast.tsx +19 -18
- package/src/components/UserSelect.tsx +850 -0
- package/src/components/UserTabSelect.tsx +261 -0
- package/src/components/WithRemoteConfig.tsx +22 -7
- package/src/components/calendar/DaysView.tsx +53 -16
- package/src/components/calendar/TimeView.tsx +10 -5
- package/src/components/icons.tsx +17 -1
- package/src/components/index.tsx +3 -1
- package/src/components/json-schema/Array.tsx +216 -0
- package/src/components/json-schema/Item.tsx +47 -0
- package/src/components/json-schema/Object.tsx +339 -0
- package/src/components/json-schema/index.tsx +44 -0
- package/src/components/schema-editor/Array.tsx +3 -1
- package/src/components/schema-editor/Common.tsx +61 -4
- package/src/components/schema-editor/Object.tsx +3 -1
- package/src/components/schema-editor/index.tsx +12 -5
- package/src/hooks/use-validation-resolver.ts +45 -0
- package/src/icons/department.svg +17 -0
- package/src/icons/menu.svg +2 -0
- package/src/icons/post.svg +15 -0
- package/src/icons/role.svg +14 -0
- package/src/icons/user-remove.svg +12 -0
- package/src/index.tsx +2 -0
- package/src/locale/de-DE.ts +11 -1
- package/src/locale/en-US.ts +12 -1
- package/src/locale/zh-CN.ts +14 -3
- package/src/renderers/Action.tsx +10 -9
- package/src/renderers/CRUD.tsx +5 -1
- package/src/renderers/Dialog.tsx +9 -3
- package/src/renderers/Drawer.tsx +5 -1
- package/src/renderers/Form/InputDate.tsx +9 -4
- package/src/renderers/Form/JSONSchema.tsx +56 -0
- package/src/renderers/Form/JSONSchemaEditor.tsx +8 -27
- package/src/renderers/Form/Textarea.tsx +7 -117
- package/src/renderers/Form/UserSelect.tsx +263 -0
- package/src/renderers/Form/index.tsx +28 -18
- package/src/renderers/Log.tsx +148 -13
- package/src/renderers/Page.tsx +6 -1
- package/src/renderers/Service.tsx +5 -1
- package/src/renderers/Wizard.tsx +24 -10
- package/src/store/form.ts +24 -17
- package/src/utils/api.ts +1 -1
- package/src/utils/renderer-event.ts +0 -2
@@ -6,8 +6,8 @@
|
|
6
6
|
"/src/renderers/Form/InputDate.tsx"
|
7
7
|
],
|
8
8
|
"names": [],
|
9
|
-
"mappings": ";;;;AAAA,6DAA0B;AAC1B,+BAAmE;AAEnE,uDAIiC;AACjC,+DAA4B;AAC5B,+BAA6B;AAC7B,
|
9
|
+
"mappings": ";;;;AAAA,6DAA0B;AAC1B,+BAAmE;AAEnE,uDAIiC;AACjC,+DAA4B;AAC5B,+BAA6B;AAC7B,qFAEqC;AAErC,6CAAgF;AAgRhF;IAAyC,4CAGxC;IAeC,qBAAY,KAAgB;QAA5B,YACE,kBAAM,KAAK,CAAC,SA+Bb;QA5BG,IAAA,OAAO,GAQL,KAAK,QARA,EACP,OAAO,GAOL,KAAK,QAPA,EACP,KAAK,GAMH,KAAK,MANF,EACL,YAAY,GAKV,KAAK,aALK,EACZ,iBAAiB,GAIf,KAAK,kBAJU,EACjB,IAAI,GAGF,KAAK,KAHH,EACJ,MAAM,GAEJ,KAAK,OAFD,EACN,GAAG,GACD,KAAK,IADJ,CACK;QAEV,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ChB,UAAU,EAAE,EAAE,EACd,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,IAAI,IACnB;IATS,oBAAoB;QAHhC,IAAA,eAAQ,EAAC;YACR,IAAI,EAAE,aAAa;SACpB,CAAC;OACW,oBAAoB,CAUhC;IAAD,2BAAC;CAAA,AAVD,CAA0C,WAAW,GAUpD;AAVY,oDAAoB;AAejC;IAA4C,uDAAW;IAAvD;;IAUA,CAAC;IATQ,mCAAY,mDACd,WAAW,CAAC,YAAY,KAC3B,WAAW,EAAE,qBAAqB,EAClC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,EAAE,EACd,QAAQ,EAAE,UAAU,EACpB,aAAa,EAAE,IAAI,IACnB;IATS,sBAAsB;QAHlC,IAAA,eAAQ,EAAC;YACR,IAAI,EAAE,eAAe;SACtB,CAAC;OACW,sBAAsB,CAUlC;IAAD,6BAAC;CAAA,AAVD,CAA4C,WAAW,GAUtD;AAVY,wDAAsB;AAenC;IAAyC,oDAAW;IAApD;;IAUA,CAAC;IATQ,gCAAY,mDACd,WAAW,CAAC,YAAY,KAC3B,WAAW,EAAE,kBAAkB,EAC/B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,EAAE,EACd,QAAQ,EAAE,OAAO,EACjB,aAAa,EAAE,IAAI,IACnB;IATS,mBAAmB;QAH/B,IAAA,eAAQ,EAAC;YACR,IAAI,EAAE,YAAY;SACnB,CAAC;OACW,mBAAmB,CAU/B;IAAD,0BAAC;CAAA,AAVD,CAAyC,WAAW,GAUnD;AAVY,kDAAmB",
|
10
10
|
"sourcesContent": [
|
11
|
-
"import React from 'react';\nimport {FormItem, FormControlProps, FormBaseControl} from './Item';\nimport cx from 'classnames';\nimport {\n filterDate,\n isPureVariable,\n resolveVariableAndFilter\n} from '../../utils/tpl-builtin';\nimport moment from 'moment';\nimport 'moment/locale/zh-cn';\nimport DatePicker, {DatePicker as BaseDatePicker} from '../../components/DatePicker';\nimport {SchemaObject} from '../../Schema';\nimport {createObject, anyChanged, isMobile, autobind} from '../../utils/helper';\nimport {Action} from '../../types';\n\nexport interface InputDateBaseControlSchema extends FormBaseControl {\n /**\n * 指定为日期选择控件\n */\n type:\n | 'input-date'\n | 'input-datetime'\n | 'input-time'\n | 'input-month'\n | 'input-quarter'\n | 'input-year';\n\n /**\n * 是否显示清除按钮\n */\n clearable?: boolean;\n\n /**\n * 日期存储格式\n */\n format?: string;\n\n /**\n * 日期展示格式\n */\n inputFormat?: string;\n\n /**\n * 设定是否存储 utc 时间。\n */\n utc?: boolean;\n\n /**\n * 是否为内联模式?\n */\n emebed?: boolean;\n\n /**\n * 边框模式,全边框,还是半边框,或者没边框。\n */\n borderMode?: 'full' | 'half' | 'none';\n}\n\n/**\n * Date日期选择控件\n * 文档:https://baidu.gitee.io/amis/docs/components/form/date\n */\nexport interface DateControlSchema extends InputDateBaseControlSchema {\n /**\n * 指定为日期选择控件\n */\n type: 'input-date';\n\n /**\n * 日期存储格式\n * @default X\n */\n format?: string;\n\n /**\n * 日期展示格式\n * @default YYYY-MM-DD\n */\n inputFormat?: string;\n\n /**\n * 点选日期后是否关闭弹窗\n */\n closeOnSelect?: boolean;\n\n /**\n * 限制最小日期\n */\n minDate?: string;\n\n /**\n * 限制最大日期\n */\n maxDate?: string;\n}\n\n/**\n * Datetime日期时间选择控件\n * 文档:https://baidu.gitee.io/amis/docs/components/form/datetime\n */\nexport interface DateTimeControlSchema extends InputDateBaseControlSchema {\n /**\n * 指定为日期时间选择控件\n */\n type: 'input-datetime';\n\n /**\n * 日期存储格式\n * @default X\n */\n format?: string;\n\n /**\n * 日期展示格式\n * @default YYYY-MM-DD HH:mm\n */\n inputFormat?: string;\n\n /**\n * 时间的格式。\n *\n * @default HH:mm\n */\n timeFormat?: string;\n\n /**\n * 限制最小日期\n */\n minDate?: string;\n\n /**\n * 限制最大日期\n */\n maxDate?: string;\n\n /**\n * 不记得了\n */\n timeConstraints?: any;\n}\n\n/**\n * Time 时间选择控件\n * 文档:https://baidu.gitee.io/amis/docs/components/form/time\n */\nexport interface TimeControlSchema extends InputDateBaseControlSchema {\n /**\n * 指定为日期时间选择控件\n */\n type: 'input-time';\n\n /**\n * 日期存储格式\n * @default X\n */\n format?: string;\n\n /**\n * 日期展示格式\n * @default YYYY-MM-DD HH:mm\n */\n inputFormat?: string;\n\n /**\n * 时间的格式。\n *\n * @default HH:mm\n */\n timeFormat?: string;\n\n /**\n * 不记得了\n */\n timeConstraints?: any;\n}\n\n/**\n * Month 月份选择控件\n * 文档:https://baidu.gitee.io/amis/docs/components/form/Month\n */\nexport interface MonthControlSchema extends InputDateBaseControlSchema {\n /**\n * 指定为月份时间选择控件\n */\n type: 'input-month';\n\n /**\n * 月份存储格式\n * @default X\n */\n format?: string;\n\n /**\n * 月份展示格式\n * @default YYYY-MM\n */\n inputFormat?: string;\n}\n\n/**\n * 季度选择控件\n */\nexport interface QuarterControlSchema extends InputDateBaseControlSchema {\n /**\n * 指定为月份时间选择控件\n */\n type: 'input-quarter';\n\n /**\n * 月份存储格式\n * @default X\n */\n format?: string;\n\n /**\n * 月份展示格式\n * @default YYYY-MM\n */\n inputFormat?: string;\n}\n\n/**\n * 年份选择控件\n */\nexport interface YearControlSchema extends InputDateBaseControlSchema {\n /**\n * 指定为月份时间选择控件\n */\n type: 'input-year';\n\n /**\n * 月份存储格式\n * @default X\n */\n format?: string;\n\n /**\n * 月份展示格式\n * @default YYYY-MM\n */\n inputFormat?: string;\n}\n\nexport interface DateProps extends FormControlProps {\n inputFormat?: string;\n timeFormat?: string;\n format?: string;\n valueFormat?: string;\n timeConstraints?: {\n hours?: {\n min: number;\n max: number;\n step: number;\n };\n minutes?: {\n min: number;\n max: number;\n step: number;\n };\n seconds: {\n min: number;\n max: number;\n step: number;\n };\n };\n closeOnSelect?: boolean;\n disabled: boolean;\n iconClassName?: string;\n utc?: boolean; // 设定是否存储 utc 时间。\n minDate?: string;\n maxDate?: string;\n}\n\ninterface DateControlState {\n minDate?: moment.Moment;\n maxDate?: moment.Moment;\n schedules?: Array<{\n startTime: Date;\n endTime: Date;\n content: any;\n className?: string;\n }>;\n}\n\nexport default class DateControl extends React.PureComponent<\n DateProps,\n DateControlState\n> {\n static defaultProps = {\n format: 'X',\n viewMode: 'days',\n inputFormat: 'YYYY-MM-DD',\n timeConstraints: {\n minutes: {\n step: 1\n }\n },\n clearable: true\n };\n\n dateRef?: BaseDatePicker;\n\n constructor(props: DateProps) {\n super(props);\n\n const {\n minDate,\n maxDate,\n value,\n defaultValue,\n setPrinstineValue,\n data,\n format,\n utc\n } = props;\n\n if (defaultValue && value === defaultValue) {\n const date = filterDate(defaultValue, data, format);\n setPrinstineValue((utc ? moment.utc(date) : date).format(format));\n }\n\n let schedulesData = props.schedules;\n if (typeof schedulesData === 'string') {\n const resolved = resolveVariableAndFilter(schedulesData, data, '| raw');\n if (Array.isArray(resolved)) {\n schedulesData = resolved;\n }\n }\n\n this.state = {\n minDate: minDate ? filterDate(minDate, data, format) : undefined,\n maxDate: maxDate ? filterDate(maxDate, data, format) : undefined,\n schedules: schedulesData\n };\n }\n\n componentDidUpdate(prevProps: DateProps) {\n const props = this.props;\n\n if (prevProps.defaultValue !== props.defaultValue) {\n const date = filterDate(props.defaultValue, props.data, props.format);\n props.setPrinstineValue(\n (props.utc ? moment.utc(date) : date).format(props.format)\n );\n }\n\n if (\n prevProps.minDate !== props.minDate ||\n prevProps.maxDate !== props.maxDate ||\n prevProps.data !== props.data\n ) {\n this.setState({\n minDate: props.minDate\n ? filterDate(props.minDate, props.data, this.props.format)\n : undefined,\n maxDate: props.maxDate\n ? filterDate(props.maxDate, props.data, this.props.format)\n : undefined\n });\n }\n\n if (\n anyChanged(['schedules', 'data'], prevProps, props) &&\n typeof props.schedules === 'string' &&\n isPureVariable(props.schedules)\n ) {\n const schedulesData = resolveVariableAndFilter(\n props.schedules,\n props.data,\n '| raw'\n );\n const preSchedulesData = resolveVariableAndFilter(\n prevProps.schedules,\n prevProps.data,\n '| raw'\n );\n if (Array.isArray(schedulesData) && preSchedulesData !== schedulesData) {\n this.setState({\n schedules: schedulesData\n });\n }\n }\n }\n\n // 日程点击事件\n onScheduleClick(scheduleData: any) {\n const {scheduleAction, onAction, data, translate: __} = this.props;\n const defaultscheduleAction = {\n actionType: 'dialog',\n dialog: {\n title: __('Schedule'),\n actions: [],\n body: {\n type: 'table',\n columns: [\n {\n name: 'time',\n label: __('Time')\n },\n {\n name: 'content',\n label: __('Content')\n }\n ],\n data: '${scheduleData}'\n }\n }\n };\n\n onAction &&\n onAction(\n null,\n scheduleAction || defaultscheduleAction,\n createObject(data, scheduleData)\n );\n }\n\n @autobind\n getRef(ref: BaseDatePicker) {\n this.dateRef = ref;\n }\n\n // 派发有event的事件\n @autobind\n dispatchEvent(e: React.SyntheticEvent<HTMLElement>) {\n const {dispatchEvent, data} = this.props;\n dispatchEvent(e, data);\n }\n\n // 动作\n doAction(action: Action, data: object, throwErrors: boolean) {\n const {resetValue} = this.props;\n\n if (action.actionType === 'clear') {\n this.dateRef?.clear();\n return;\n }\n\n if (action.actionType === 'reset' && resetValue) {\n this.dateRef?.reset(resetValue);\n }\n }\n\n // 值的变化\n @autobind\n async handleChange(nextValue: any) {\n const {dispatchEvent, data} = this.props;\n const dispatcher = dispatchEvent('change', createObject(data, {value: nextValue}));\n if (dispatcher?.prevented) {\n return;\n }\n this.props.onChange(nextValue);\n }\n\n render() {\n let {\n className,\n defaultValue,\n defaultData,\n classnames: cx,\n minDate,\n maxDate,\n type,\n format,\n timeFormat,\n valueFormat,\n env,\n largeMode,\n render,\n useMobileUI,\n ...rest\n } = this.props;\n const mobileUI = useMobileUI && isMobile();\n\n if (type === 'time' && timeFormat) {\n format = timeFormat;\n }\n\n return (\n <div\n className={cx(\n `DateControl`,\n {\n 'is-date': /date$/.test(type),\n 'is-datetime': /datetime$/.test(type)\n },\n className\n )}\n >\n <DatePicker\n {...rest}\n useMobileUI={useMobileUI}\n popOverContainer={\n mobileUI && env && env.getModalContainer\n ? env.getModalContainer\n : mobileUI\n ? undefined\n : rest.popOverContainer\n }\n timeFormat={timeFormat}\n format={valueFormat || format}\n {...this.state}\n classnames={cx}\n onRef={this.getRef}\n schedules={this.state.schedules}\n largeMode={largeMode}\n onScheduleClick={this.onScheduleClick.bind(this)}\n onChange={this.handleChange}\n onFocus={this.dispatchEvent}\n onBlur={this.dispatchEvent}\n />\n </div>\n );\n }\n}\n\n@FormItem({\n type: 'input-date',\n weight: -150\n})\nexport class DateControlRenderer extends DateControl {\n static defaultProps = {\n ...DateControl.defaultProps,\n placeholder: 'Date.placeholder',\n dateFormat: 'YYYY-MM-DD',\n timeFormat: '',\n strictMode: false\n };\n}\n\n@FormItem({\n type: 'input-datetime'\n})\nexport class DatetimeControlRenderer extends DateControl {\n static defaultProps = {\n ...DateControl.defaultProps,\n placeholder: 'DateTime.placeholder',\n inputFormat: 'YYYY-MM-DD HH:mm:ss',\n dateFormat: 'LL',\n timeFormat: 'HH:mm:ss',\n closeOnSelect: false,\n strictMode: false\n };\n}\n\n@FormItem({\n type: 'input-time'\n})\nexport class TimeControlRenderer extends DateControl {\n static defaultProps = {\n ...DateControl.defaultProps,\n placeholder: 'Time.placeholder',\n inputFormat: 'HH:mm',\n dateFormat: '',\n timeFormat: 'HH:mm',\n viewMode: 'time',\n closeOnSelect: false\n };\n}\n\n@FormItem({\n type: 'input-month'\n})\nexport class MonthControlRenderer extends DateControl {\n static defaultProps = {\n ...DateControl.defaultProps,\n placeholder: 'Month.placeholder',\n inputFormat: 'YYYY-MM',\n dateFormat: 'MM',\n timeFormat: '',\n viewMode: 'months',\n closeOnSelect: true\n };\n}\n\n@FormItem({\n type: 'input-quarter'\n})\nexport class QuarterControlRenderer extends DateControl {\n static defaultProps = {\n ...DateControl.defaultProps,\n placeholder: 'Quarter.placeholder',\n inputFormat: 'YYYY [Q]Q',\n dateFormat: 'YYYY [Q]Q',\n timeFormat: '',\n viewMode: 'quarters',\n closeOnSelect: true\n };\n}\n\n@FormItem({\n type: 'input-year'\n})\nexport class YearControlRenderer extends DateControl {\n static defaultProps = {\n ...DateControl.defaultProps,\n placeholder: 'Year.placeholder',\n inputFormat: 'YYYY',\n dateFormat: 'YYYY',\n timeFormat: '',\n viewMode: 'years',\n closeOnSelect: true\n };\n}\n"
|
11
|
+
"import React from 'react';\nimport {FormItem, FormControlProps, FormBaseControl} from './Item';\nimport cx from 'classnames';\nimport {\n filterDate,\n isPureVariable,\n resolveVariableAndFilter\n} from '../../utils/tpl-builtin';\nimport moment from 'moment';\nimport 'moment/locale/zh-cn';\nimport DatePicker, {\n DatePicker as BaseDatePicker\n} from '../../components/DatePicker';\nimport {SchemaObject} from '../../Schema';\nimport {createObject, anyChanged, isMobile, autobind} from '../../utils/helper';\nimport {Action} from '../../types';\n\nexport interface InputDateBaseControlSchema extends FormBaseControl {\n /**\n * 指定为日期选择控件\n */\n type:\n | 'input-date'\n | 'input-datetime'\n | 'input-time'\n | 'input-month'\n | 'input-quarter'\n | 'input-year';\n\n /**\n * 是否显示清除按钮\n */\n clearable?: boolean;\n\n /**\n * 日期存储格式\n */\n format?: string;\n\n /**\n * 日期展示格式\n */\n inputFormat?: string;\n\n /**\n * 设定是否存储 utc 时间。\n */\n utc?: boolean;\n\n /**\n * 是否为内联模式?\n */\n emebed?: boolean;\n\n /**\n * 边框模式,全边框,还是半边框,或者没边框。\n */\n borderMode?: 'full' | 'half' | 'none';\n}\n\n/**\n * Date日期选择控件\n * 文档:https://baidu.gitee.io/amis/docs/components/form/date\n */\nexport interface DateControlSchema extends InputDateBaseControlSchema {\n /**\n * 指定为日期选择控件\n */\n type: 'input-date';\n\n /**\n * 日期存储格式\n * @default X\n */\n format?: string;\n\n /**\n * 日期展示格式\n * @default YYYY-MM-DD\n */\n inputFormat?: string;\n\n /**\n * 点选日期后是否关闭弹窗\n */\n closeOnSelect?: boolean;\n\n /**\n * 限制最小日期\n */\n minDate?: string;\n\n /**\n * 限制最大日期\n */\n maxDate?: string;\n}\n\n/**\n * Datetime日期时间选择控件\n * 文档:https://baidu.gitee.io/amis/docs/components/form/datetime\n */\nexport interface DateTimeControlSchema extends InputDateBaseControlSchema {\n /**\n * 指定为日期时间选择控件\n */\n type: 'input-datetime';\n\n /**\n * 日期存储格式\n * @default X\n */\n format?: string;\n\n /**\n * 日期展示格式\n * @default YYYY-MM-DD HH:mm\n */\n inputFormat?: string;\n\n /**\n * 时间的格式。\n *\n * @default HH:mm\n */\n timeFormat?: string;\n\n /**\n * 限制最小日期\n */\n minDate?: string;\n\n /**\n * 限制最大日期\n */\n maxDate?: string;\n\n /**\n * 时间输入范围限制\n */\n timeConstraints?: any;\n}\n\n/**\n * Time 时间选择控件\n * 文档:https://baidu.gitee.io/amis/docs/components/form/time\n */\nexport interface TimeControlSchema extends InputDateBaseControlSchema {\n /**\n * 指定为日期时间选择控件\n */\n type: 'input-time';\n\n /**\n * 日期存储格式\n * @default X\n */\n format?: string;\n\n /**\n * 日期展示格式\n * @default YYYY-MM-DD HH:mm\n */\n inputFormat?: string;\n\n /**\n * 时间的格式。\n *\n * @default HH:mm\n */\n timeFormat?: string;\n\n /**\n * 时间输入范围限制\n */\n timeConstraints?: any;\n}\n\n/**\n * Month 月份选择控件\n * 文档:https://baidu.gitee.io/amis/docs/components/form/Month\n */\nexport interface MonthControlSchema extends InputDateBaseControlSchema {\n /**\n * 指定为月份时间选择控件\n */\n type: 'input-month';\n\n /**\n * 月份存储格式\n * @default X\n */\n format?: string;\n\n /**\n * 月份展示格式\n * @default YYYY-MM\n */\n inputFormat?: string;\n}\n\n/**\n * 季度选择控件\n */\nexport interface QuarterControlSchema extends InputDateBaseControlSchema {\n /**\n * 指定为月份时间选择控件\n */\n type: 'input-quarter';\n\n /**\n * 月份存储格式\n * @default X\n */\n format?: string;\n\n /**\n * 月份展示格式\n * @default YYYY-MM\n */\n inputFormat?: string;\n}\n\n/**\n * 年份选择控件\n */\nexport interface YearControlSchema extends InputDateBaseControlSchema {\n /**\n * 指定为月份时间选择控件\n */\n type: 'input-year';\n\n /**\n * 月份存储格式\n * @default X\n */\n format?: string;\n\n /**\n * 月份展示格式\n * @default YYYY-MM\n */\n inputFormat?: string;\n}\n\nexport interface DateProps extends FormControlProps {\n inputFormat?: string;\n timeFormat?: string;\n format?: string;\n valueFormat?: string;\n timeConstraints?: {\n hours?: {\n min: number;\n max: number;\n step: number;\n };\n minutes?: {\n min: number;\n max: number;\n step: number;\n };\n seconds: {\n min: number;\n max: number;\n step: number;\n };\n };\n closeOnSelect?: boolean;\n disabled: boolean;\n iconClassName?: string;\n utc?: boolean; // 设定是否存储 utc 时间。\n minDate?: string;\n maxDate?: string;\n}\n\ninterface DateControlState {\n minDate?: moment.Moment;\n maxDate?: moment.Moment;\n schedules?: Array<{\n startTime: Date;\n endTime: Date;\n content: any;\n className?: string;\n }>;\n}\n\nexport default class DateControl extends React.PureComponent<\n DateProps,\n DateControlState\n> {\n static defaultProps = {\n format: 'X',\n viewMode: 'days',\n inputFormat: 'YYYY-MM-DD',\n timeConstraints: {\n minutes: {\n step: 1\n }\n },\n clearable: true\n };\n\n dateRef?: BaseDatePicker;\n\n constructor(props: DateProps) {\n super(props);\n\n const {\n minDate,\n maxDate,\n value,\n defaultValue,\n setPrinstineValue,\n data,\n format,\n utc\n } = props;\n\n if (defaultValue && value === defaultValue) {\n const date = filterDate(defaultValue, data, format);\n setPrinstineValue((utc ? moment.utc(date) : date).format(format));\n }\n\n let schedulesData = props.schedules;\n if (typeof schedulesData === 'string') {\n const resolved = resolveVariableAndFilter(schedulesData, data, '| raw');\n if (Array.isArray(resolved)) {\n schedulesData = resolved;\n }\n }\n\n this.state = {\n minDate: minDate ? filterDate(minDate, data, format) : undefined,\n maxDate: maxDate ? filterDate(maxDate, data, format) : undefined,\n schedules: schedulesData\n };\n }\n\n componentDidUpdate(prevProps: DateProps) {\n const props = this.props;\n\n if (prevProps.defaultValue !== props.defaultValue) {\n const date = filterDate(props.defaultValue, props.data, props.format);\n props.setPrinstineValue(\n (props.utc ? moment.utc(date) : date).format(props.format)\n );\n }\n\n if (\n prevProps.minDate !== props.minDate ||\n prevProps.maxDate !== props.maxDate ||\n prevProps.data !== props.data\n ) {\n this.setState({\n minDate: props.minDate\n ? filterDate(props.minDate, props.data, this.props.format)\n : undefined,\n maxDate: props.maxDate\n ? filterDate(props.maxDate, props.data, this.props.format)\n : undefined\n });\n }\n\n if (\n anyChanged(['schedules', 'data'], prevProps, props) &&\n typeof props.schedules === 'string' &&\n isPureVariable(props.schedules)\n ) {\n const schedulesData = resolveVariableAndFilter(\n props.schedules,\n props.data,\n '| raw'\n );\n const preSchedulesData = resolveVariableAndFilter(\n prevProps.schedules,\n prevProps.data,\n '| raw'\n );\n if (Array.isArray(schedulesData) && preSchedulesData !== schedulesData) {\n this.setState({\n schedules: schedulesData\n });\n }\n }\n }\n\n // 日程点击事件\n onScheduleClick(scheduleData: any) {\n const {scheduleAction, onAction, data, translate: __} = this.props;\n const defaultscheduleAction = {\n actionType: 'dialog',\n dialog: {\n title: __('Schedule'),\n actions: [],\n body: {\n type: 'table',\n columns: [\n {\n name: 'time',\n label: __('Time')\n },\n {\n name: 'content',\n label: __('Content')\n }\n ],\n data: '${scheduleData}'\n }\n }\n };\n\n onAction &&\n onAction(\n null,\n scheduleAction || defaultscheduleAction,\n createObject(data, scheduleData)\n );\n }\n\n @autobind\n getRef(ref: BaseDatePicker) {\n this.dateRef = ref;\n }\n\n // 派发有event的事件\n @autobind\n dispatchEvent(e: React.SyntheticEvent<HTMLElement>) {\n const {dispatchEvent, data} = this.props;\n dispatchEvent(e, data);\n }\n\n // 动作\n doAction(action: Action, data: object, throwErrors: boolean) {\n const {resetValue} = this.props;\n\n if (action.actionType === 'clear') {\n this.dateRef?.clear();\n return;\n }\n\n if (action.actionType === 'reset' && resetValue) {\n this.dateRef?.reset(resetValue);\n }\n }\n\n // 值的变化\n @autobind\n async handleChange(nextValue: any) {\n const {dispatchEvent, data} = this.props;\n const dispatcher = dispatchEvent(\n 'change',\n createObject(data, {value: nextValue})\n );\n if (dispatcher?.prevented) {\n return;\n }\n this.props.onChange(nextValue);\n }\n\n render() {\n let {\n className,\n defaultValue,\n defaultData,\n classnames: cx,\n minDate,\n maxDate,\n type,\n format,\n timeFormat,\n valueFormat,\n env,\n largeMode,\n render,\n useMobileUI,\n ...rest\n } = this.props;\n const mobileUI = useMobileUI && isMobile();\n\n if (type === 'time' && timeFormat) {\n format = timeFormat;\n }\n\n return (\n <div\n className={cx(\n `DateControl`,\n {\n 'is-date': /date$/.test(type),\n 'is-datetime': /datetime$/.test(type)\n },\n className\n )}\n >\n <DatePicker\n {...rest}\n useMobileUI={useMobileUI}\n popOverContainer={\n mobileUI && env && env.getModalContainer\n ? env.getModalContainer\n : mobileUI\n ? undefined\n : rest.popOverContainer\n }\n timeFormat={timeFormat}\n format={valueFormat || format}\n {...this.state}\n classnames={cx}\n onRef={this.getRef}\n schedules={this.state.schedules}\n largeMode={largeMode}\n onScheduleClick={this.onScheduleClick.bind(this)}\n onChange={this.handleChange}\n onFocus={this.dispatchEvent}\n onBlur={this.dispatchEvent}\n />\n </div>\n );\n }\n}\n\n@FormItem({\n type: 'input-date',\n weight: -150\n})\nexport class DateControlRenderer extends DateControl {\n static defaultProps = {\n ...DateControl.defaultProps,\n placeholder: 'Date.placeholder',\n dateFormat: 'YYYY-MM-DD',\n timeFormat: '',\n strictMode: false\n };\n}\n\n@FormItem({\n type: 'input-datetime'\n})\nexport class DatetimeControlRenderer extends DateControl {\n static defaultProps = {\n ...DateControl.defaultProps,\n placeholder: 'DateTime.placeholder',\n inputFormat: 'YYYY-MM-DD HH:mm:ss',\n dateFormat: 'LL',\n timeFormat: 'HH:mm:ss',\n closeOnSelect: false,\n strictMode: false\n };\n}\n\n@FormItem({\n type: 'input-time'\n})\nexport class TimeControlRenderer extends DateControl {\n static defaultProps = {\n ...DateControl.defaultProps,\n placeholder: 'Time.placeholder',\n inputFormat: 'HH:mm',\n dateFormat: '',\n timeFormat: 'HH:mm',\n viewMode: 'time',\n closeOnSelect: false\n };\n}\n\n@FormItem({\n type: 'input-month'\n})\nexport class MonthControlRenderer extends DateControl {\n static defaultProps = {\n ...DateControl.defaultProps,\n placeholder: 'Month.placeholder',\n inputFormat: 'YYYY-MM',\n dateFormat: 'MM',\n timeFormat: '',\n viewMode: 'months',\n closeOnSelect: true\n };\n}\n\n@FormItem({\n type: 'input-quarter'\n})\nexport class QuarterControlRenderer extends DateControl {\n static defaultProps = {\n ...DateControl.defaultProps,\n placeholder: 'Quarter.placeholder',\n inputFormat: 'YYYY [Q]Q',\n dateFormat: 'YYYY [Q]Q',\n timeFormat: '',\n viewMode: 'quarters',\n closeOnSelect: true\n };\n}\n\n@FormItem({\n type: 'input-year'\n})\nexport class YearControlRenderer extends DateControl {\n static defaultProps = {\n ...DateControl.defaultProps,\n placeholder: 'Year.placeholder',\n inputFormat: 'YYYY',\n dateFormat: 'YYYY',\n timeFormat: '',\n viewMode: 'years',\n closeOnSelect: true\n };\n}\n"
|
12
12
|
]
|
13
13
|
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { FormControlProps, FormBaseControl } from './Item';
|
3
|
+
/**
|
4
|
+
* JSON Schema
|
5
|
+
* 文档:https://baidu.gitee.io/amis/docs/components/form/json-schema
|
6
|
+
*/
|
7
|
+
export interface JSONSchemaControlSchema extends FormBaseControl {
|
8
|
+
/**
|
9
|
+
* 指定为 JSON Schema
|
10
|
+
*/
|
11
|
+
type: 'json-schema';
|
12
|
+
/**
|
13
|
+
* json-schema 详情,支持关联上下文数据
|
14
|
+
*/
|
15
|
+
schema?: any;
|
16
|
+
}
|
17
|
+
export interface JSONSchemaProps extends FormControlProps, Omit<JSONSchemaControlSchema, 'type' | 'className' | 'descriptionClassName' | 'inputClassName'> {
|
18
|
+
}
|
19
|
+
export default class JSONSchemaControl extends React.PureComponent<JSONSchemaProps> {
|
20
|
+
render(): JSX.Element;
|
21
|
+
}
|
22
|
+
export declare class JSONSchemaRenderer extends JSONSchemaControl {
|
23
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.JSONSchemaRenderer = void 0;
|
4
|
+
var tslib_1 = require("tslib");
|
5
|
+
var react_1 = (0, tslib_1.__importDefault)(require("react"));
|
6
|
+
var Item_1 = require("./Item");
|
7
|
+
var index_1 = (0, tslib_1.__importDefault)(require("../../components/json-schema/index"));
|
8
|
+
var WithRemoteConfig_1 = require("../../components/WithRemoteConfig");
|
9
|
+
var EnhancedInputJSONSchema = (0, WithRemoteConfig_1.withRemoteConfig)({
|
10
|
+
sourceField: 'schema',
|
11
|
+
injectedPropsFilter: function (props) {
|
12
|
+
return {
|
13
|
+
schema: props.config,
|
14
|
+
loading: props.loading
|
15
|
+
};
|
16
|
+
}
|
17
|
+
})(index_1.default);
|
18
|
+
var JSONSchemaControl = /** @class */ (function (_super) {
|
19
|
+
(0, tslib_1.__extends)(JSONSchemaControl, _super);
|
20
|
+
function JSONSchemaControl() {
|
21
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
22
|
+
}
|
23
|
+
JSONSchemaControl.prototype.render = function () {
|
24
|
+
var rest = (0, tslib_1.__rest)(this.props, []);
|
25
|
+
return react_1.default.createElement(EnhancedInputJSONSchema, (0, tslib_1.__assign)({}, rest));
|
26
|
+
};
|
27
|
+
return JSONSchemaControl;
|
28
|
+
}(react_1.default.PureComponent));
|
29
|
+
exports.default = JSONSchemaControl;
|
30
|
+
var JSONSchemaRenderer = /** @class */ (function (_super) {
|
31
|
+
(0, tslib_1.__extends)(JSONSchemaRenderer, _super);
|
32
|
+
function JSONSchemaRenderer() {
|
33
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
34
|
+
}
|
35
|
+
JSONSchemaRenderer = (0, tslib_1.__decorate)([
|
36
|
+
(0, Item_1.FormItem)({
|
37
|
+
type: 'json-schema',
|
38
|
+
strictMode: false
|
39
|
+
})
|
40
|
+
], JSONSchemaRenderer);
|
41
|
+
return JSONSchemaRenderer;
|
42
|
+
}(JSONSchemaControl));
|
43
|
+
exports.JSONSchemaRenderer = JSONSchemaRenderer;
|
44
|
+
//# sourceMappingURL=./renderers/Form/JSONSchema.js.map
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"file": "JSONSchema.js",
|
4
|
+
"sourceRoot": "",
|
5
|
+
"sources": [
|
6
|
+
"/src/renderers/Form/JSONSchema.tsx"
|
7
|
+
],
|
8
|
+
"names": [],
|
9
|
+
"mappings": ";;;;AAAA,6DAA0B;AAC1B,+BAAmE;AAEnE,0FAAiE;AAMjE,sEAAmE;AAyBnE,IAAM,uBAAuB,GAAG,IAAA,mCAAgB,EAAC;IAC/C,WAAW,EAAE,QAAQ;IACrB,mBAAmB,EAAE,UAAA,KAAK;QACxB,OAAO;YACL,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC;IACJ,CAAC;CACF,CAAC,CAAC,eAAsB,CAAC,CAAC;AAC3B;IAA+C,kDAAoC;IAAnF;;IAMA,CAAC;IALC,kCAAM,GAAN;QACE,IAAU,IAAI,uBAAI,IAAI,CAAC,KAAK,EAAtB,EAAS,CAAa,CAAC;QAE7B,OAAO,8BAAC,uBAAuB,4BAAK,IAAI,EAAI,CAAC;IAC/C,CAAC;IACH,wBAAC;AAAD,CAAC,AAND,CAA+C,eAAK,CAAC,aAAa,GAMjE;;AAMD;IAAwC,mDAAiB;IAAzD;;IAA2D,CAAC;IAA/C,kBAAkB;QAJ9B,IAAA,eAAQ,EAAC;YACR,IAAI,EAAE,aAAa;YACnB,UAAU,EAAE,KAAK;SAClB,CAAC;OACW,kBAAkB,CAA6B;IAAD,yBAAC;CAAA,AAA5D,CAAwC,iBAAiB,GAAG;AAA/C,gDAAkB",
|
10
|
+
"sourcesContent": [
|
11
|
+
"import React from 'react';\nimport {FormItem, FormControlProps, FormBaseControl} from './Item';\nimport {autobind, isObjectShallowModified} from '../../utils/helper';\nimport InputJSONSchema from '../../components/json-schema/index';\nimport {\n isPureVariable,\n resolveVariableAndFilter\n} from '../../utils/tpl-builtin';\nimport {isApiOutdated, isEffectiveApi} from '../../utils/api';\nimport {withRemoteConfig} from '../../components/WithRemoteConfig';\n\n/**\n * JSON Schema\n * 文档:https://baidu.gitee.io/amis/docs/components/form/json-schema\n */\nexport interface JSONSchemaControlSchema extends FormBaseControl {\n /**\n * 指定为 JSON Schema\n */\n type: 'json-schema';\n\n /**\n * json-schema 详情,支持关联上下文数据\n */\n schema?: any;\n}\n\nexport interface JSONSchemaProps\n extends FormControlProps,\n Omit<\n JSONSchemaControlSchema,\n 'type' | 'className' | 'descriptionClassName' | 'inputClassName'\n > {}\n\nconst EnhancedInputJSONSchema = withRemoteConfig({\n sourceField: 'schema',\n injectedPropsFilter: props => {\n return {\n schema: props.config,\n loading: props.loading\n };\n }\n})(InputJSONSchema as any);\nexport default class JSONSchemaControl extends React.PureComponent<JSONSchemaProps> {\n render() {\n const {...rest} = this.props;\n\n return <EnhancedInputJSONSchema {...rest} />;\n }\n}\n\n@FormItem({\n type: 'json-schema',\n strictMode: false\n})\nexport class JSONSchemaRenderer extends JSONSchemaControl {}\n"
|
12
|
+
]
|
13
|
+
}
|
@@ -15,7 +15,7 @@ export interface JSONSchemaEditorControlSchema extends FormBaseControl {
|
|
15
15
|
definitions?: {
|
16
16
|
[propName: string]: {
|
17
17
|
title: string;
|
18
|
-
type: 'string' | 'number' | '
|
18
|
+
type: 'string' | 'number' | 'integer' | 'object' | 'array' | 'boolean' | 'null';
|
19
19
|
[propName: string]: any;
|
20
20
|
};
|
21
21
|
};
|
@@ -56,8 +56,7 @@ export default class JSONSchemaEditorControl extends React.PureComponent<JSONSch
|
|
56
56
|
static defaultProps: {
|
57
57
|
enableAdvancedSetting: boolean;
|
58
58
|
};
|
59
|
-
|
60
|
-
renderModalProps({ value, onChange }: any): JSX.Element;
|
59
|
+
renderModalProps(value: any, onChange: (value: any) => void): JSX.Element;
|
61
60
|
render(): JSX.Element;
|
62
61
|
}
|
63
62
|
export declare class JSONSchemaEditorRenderer extends JSONSchemaEditorControl {
|
@@ -9,39 +9,24 @@ var helper_1 = require("../../utils/helper");
|
|
9
9
|
var JSONSchemaEditorControl = /** @class */ (function (_super) {
|
10
10
|
(0, tslib_1.__extends)(JSONSchemaEditorControl, _super);
|
11
11
|
function JSONSchemaEditorControl() {
|
12
|
-
|
13
|
-
// todo 完善这块配置
|
14
|
-
_this.settings = {
|
15
|
-
common: [
|
16
|
-
{
|
17
|
-
type: 'input-text',
|
18
|
-
name: 'title',
|
19
|
-
label: _this.props.translate('JSONSchema.title')
|
20
|
-
},
|
21
|
-
{
|
22
|
-
type: 'textarea',
|
23
|
-
name: 'description',
|
24
|
-
label: _this.props.translate('JSONSchema.description')
|
25
|
-
}
|
26
|
-
]
|
27
|
-
};
|
28
|
-
return _this;
|
12
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
29
13
|
}
|
30
|
-
JSONSchemaEditorControl.prototype.renderModalProps = function (
|
31
|
-
var
|
32
|
-
var
|
14
|
+
JSONSchemaEditorControl.prototype.renderModalProps = function (value, onChange) {
|
15
|
+
var _a = this.props, render = _a.render, advancedSettings = _a.advancedSettings;
|
16
|
+
var fields = (advancedSettings === null || advancedSettings === void 0 ? void 0 : advancedSettings[value === null || value === void 0 ? void 0 : value.type]) || [];
|
33
17
|
return render("modal", {
|
34
18
|
type: 'form',
|
35
19
|
wrapWithPanel: false,
|
36
|
-
body:
|
20
|
+
body: fields,
|
21
|
+
submitOnChange: true
|
37
22
|
}, {
|
38
23
|
data: value,
|
39
|
-
|
24
|
+
onSubmit: function (value) { return onChange(value); }
|
40
25
|
});
|
41
26
|
};
|
42
27
|
JSONSchemaEditorControl.prototype.render = function () {
|
43
28
|
var _a = this.props, enableAdvancedSetting = _a.enableAdvancedSetting, rest = (0, tslib_1.__rest)(_a, ["enableAdvancedSetting"]);
|
44
|
-
return (react_1.default.createElement(index_1.default, (0, tslib_1.__assign)({}, rest, {
|
29
|
+
return (react_1.default.createElement(index_1.default, (0, tslib_1.__assign)({}, rest, { enableAdvancedSetting: enableAdvancedSetting, renderModalProps: this.renderModalProps })));
|
45
30
|
};
|
46
31
|
JSONSchemaEditorControl.defaultProps = {
|
47
32
|
enableAdvancedSetting: false
|
@@ -49,7 +34,7 @@ var JSONSchemaEditorControl = /** @class */ (function (_super) {
|
|
49
34
|
(0, tslib_1.__decorate)([
|
50
35
|
helper_1.autobind,
|
51
36
|
(0, tslib_1.__metadata)("design:type", Function),
|
52
|
-
(0, tslib_1.__metadata)("design:paramtypes", [Object]),
|
37
|
+
(0, tslib_1.__metadata)("design:paramtypes", [Object, Function]),
|
53
38
|
(0, tslib_1.__metadata)("design:returntype", void 0)
|
54
39
|
], JSONSchemaEditorControl.prototype, "renderModalProps", null);
|
55
40
|
return JSONSchemaEditorControl;
|
@@ -6,8 +6,8 @@
|
|
6
6
|
"/src/renderers/Form/JSONSchemaEditor.tsx"
|
7
7
|
],
|
8
8
|
"names": [],
|
9
|
-
"mappings": ";;;;AAAA,6DAA0B;AAC1B,+BAAmE;AACnE,4FAAoE;AACpE,6CAA4C;AAyE5C;IAAqD,wDAA0C;IAA/F
|
9
|
+
"mappings": ";;;;AAAA,6DAA0B;AAC1B,+BAAmE;AACnE,4FAAoE;AACpE,6CAA4C;AAyE5C;IAAqD,wDAA0C;IAA/F;;IAmCA,CAAC;IA7BC,kDAAgB,GAAhB,UAAiB,KAAU,EAAE,QAA8B;QACnD,IAAA,KAA6B,IAAI,CAAC,KAAK,EAAtC,MAAM,YAAA,EAAE,gBAAgB,sBAAc,CAAC;QAC9C,IAAM,MAAM,GAAG,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAC,KAAI,EAAE,CAAC;QACrD,OAAO,MAAM,CACX,OAAO,EACP;YACE,IAAI,EAAE,MAAM;YACZ,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,MAAM;YACZ,cAAc,EAAE,IAAI;SACrB,EACD;YACE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,UAAC,KAAU,IAAK,OAAA,QAAQ,CAAC,KAAK,CAAC,EAAf,CAAe;SAC1C,CACF,CAAC;IACJ,CAAC;IAED,wCAAM,GAAN;QACE,IAAM,KAAmC,IAAI,CAAC,KAAK,EAA5C,qBAAqB,2BAAA,EAAK,IAAI,2BAA/B,yBAAgC,CAAa,CAAC;QAEpD,OAAO,CACL,8BAAC,eAAgB,4BACX,IAAI,IACR,qBAAqB,EAAE,qBAAqB,EAC5C,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,IACvC,CACH,CAAC;IACJ,CAAC;IAjCM,oCAAY,GAAG;QACpB,qBAAqB,EAAE,KAAK;KAC7B,CAAC;IAGF;QADC,iBAAQ;;;;mEAiBR;IAaH,8BAAC;CAAA,AAnCD,CAAqD,eAAK,CAAC,aAAa,GAmCvE;kBAnCoB,uBAAuB;AAwC5C;IAA8C,yDAAuB;IAArE;;IAAuE,CAAC;IAA3D,wBAAwB;QAHpC,IAAA,eAAQ,EAAC;YACR,IAAI,EAAE,oBAAoB;SAC3B,CAAC;OACW,wBAAwB,CAAmC;IAAD,+BAAC;CAAA,AAAxE,CAA8C,uBAAuB,GAAG;AAA3D,4DAAwB",
|
10
10
|
"sourcesContent": [
|
11
|
-
"import React from 'react';\nimport {FormItem, FormControlProps, FormBaseControl} from './Item';\nimport JSONSchemaEditor from '../../components/schema-editor/index';\nimport {autobind} from '../../utils/helper';\n\n/**\n * JSON Schema Editor\n * 文档:https://baidu.gitee.io/amis/docs/components/form/json-schema-editor\n */\nexport interface JSONSchemaEditorControlSchema extends FormBaseControl {\n /**\n * 指定为 JSON Schema Editor\n */\n type: 'json-schema-editor';\n\n /**\n * 可以理解为类型模板,方便快速定义复杂类型\n */\n definitions?: {\n [propName: string]: {\n title: string;\n type:\n | 'string'\n | 'number'\n | '
|
11
|
+
"import React from 'react';\nimport {FormItem, FormControlProps, FormBaseControl} from './Item';\nimport JSONSchemaEditor from '../../components/schema-editor/index';\nimport {autobind} from '../../utils/helper';\n\n/**\n * JSON Schema Editor\n * 文档:https://baidu.gitee.io/amis/docs/components/form/json-schema-editor\n */\nexport interface JSONSchemaEditorControlSchema extends FormBaseControl {\n /**\n * 指定为 JSON Schema Editor\n */\n type: 'json-schema-editor';\n\n /**\n * 可以理解为类型模板,方便快速定义复杂类型\n */\n definitions?: {\n [propName: string]: {\n title: string;\n type:\n | 'string'\n | 'number'\n | 'integer'\n | 'object'\n | 'array'\n | 'boolean'\n | 'null';\n [propName: string]: any;\n };\n };\n\n /**\n * 顶层是否允许修改类型\n */\n rootTypeMutable?: boolean;\n\n /**\n * 顶层类型信息是否隐藏\n */\n showRootInfo?: boolean;\n\n /**\n * 禁用类型,默认禁用了 null 类型\n */\n disabledTypes?: Array<string>;\n\n /**\n * 开启详情配置\n */\n enableAdvancedSetting?: boolean;\n\n /**\n * 自定义详情配置面板如:\n *\n * {\n * boolean: [\n * {type: \"input-text\", name: \"aa\", label: \"AA\" }\n * ]\n * }\n *\n * 当配置布尔字段详情时,就会出现以上配置\n */\n advancedSettings?: {\n [propName: string]: any;\n };\n}\n\nexport interface JSONSchemaEditorProps\n extends FormControlProps,\n Omit<\n JSONSchemaEditorControlSchema,\n 'type' | 'className' | 'descriptionClassName' | 'inputClassName'\n > {}\n\nexport default class JSONSchemaEditorControl extends React.PureComponent<JSONSchemaEditorProps> {\n static defaultProps = {\n enableAdvancedSetting: false\n };\n\n @autobind\n renderModalProps(value: any, onChange: (value: any) => void) {\n const {render, advancedSettings} = this.props;\n const fields = advancedSettings?.[value?.type] || [];\n return render(\n `modal`,\n {\n type: 'form',\n wrapWithPanel: false,\n body: fields,\n submitOnChange: true\n },\n {\n data: value,\n onSubmit: (value: any) => onChange(value)\n }\n );\n }\n\n render() {\n const {enableAdvancedSetting, ...rest} = this.props;\n\n return (\n <JSONSchemaEditor\n {...rest}\n enableAdvancedSetting={enableAdvancedSetting}\n renderModalProps={this.renderModalProps}\n />\n );\n }\n}\n\n@FormItem({\n type: 'json-schema-editor'\n})\nexport class JSONSchemaEditorRenderer extends JSONSchemaEditorControl {}\n"
|
12
12
|
]
|
13
13
|
}
|
@@ -56,18 +56,11 @@ export interface TextAreaState {
|
|
56
56
|
}
|
57
57
|
export default class TextAreaControl extends React.Component<TextAreaProps, TextAreaState> {
|
58
58
|
static defaultProps: Partial<TextAreaProps>;
|
59
|
-
|
60
|
-
focused: boolean;
|
61
|
-
};
|
62
|
-
input?: HTMLInputElement;
|
63
|
-
inputRef: (ref: any) => HTMLInputElement;
|
59
|
+
inputRef: React.RefObject<any>;
|
64
60
|
doAction(action: ListenerAction, args: any): void;
|
65
|
-
valueToString(value: any): string;
|
66
61
|
focus(): void;
|
67
|
-
handleChange(e: React.ChangeEvent<HTMLTextAreaElement>): void;
|
68
62
|
handleFocus(e: React.FocusEvent<HTMLTextAreaElement>): void;
|
69
63
|
handleBlur(e: React.FocusEvent<HTMLTextAreaElement>): void;
|
70
|
-
handleClear(): Promise<void>;
|
71
64
|
render(): JSX.Element;
|
72
65
|
}
|
73
66
|
export declare class TextAreaControlRenderer extends TextAreaControl {
|
@@ -5,57 +5,29 @@ var tslib_1 = require("tslib");
|
|
5
5
|
var react_1 = (0, tslib_1.__importDefault)(require("react"));
|
6
6
|
var Item_1 = require("./Item");
|
7
7
|
var Textarea_1 = (0, tslib_1.__importDefault)(require("../../components/Textarea"));
|
8
|
-
var icons_1 = require("../../components/icons");
|
9
|
-
var react_dom_1 = require("react-dom");
|
10
8
|
var helper_1 = require("../../utils/helper");
|
11
9
|
var Decorators_1 = require("../../actions/Decorators");
|
12
10
|
var TextAreaControl = /** @class */ (function (_super) {
|
13
11
|
(0, tslib_1.__extends)(TextAreaControl, _super);
|
14
12
|
function TextAreaControl() {
|
15
13
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
16
|
-
_this.
|
17
|
-
focused: false
|
18
|
-
};
|
19
|
-
_this.inputRef = function (ref) { return (_this.input = (0, react_dom_1.findDOMNode)(ref)); };
|
14
|
+
_this.inputRef = react_1.default.createRef();
|
20
15
|
return _this;
|
21
16
|
}
|
22
17
|
TextAreaControl.prototype.doAction = function (action, args) {
|
23
18
|
var actionType = action === null || action === void 0 ? void 0 : action.actionType;
|
19
|
+
var onChange = this.props.onChange;
|
24
20
|
if (!!~['clear', 'reset'].indexOf(actionType)) {
|
25
|
-
this.
|
21
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(this.props.resetValue);
|
22
|
+
this.focus();
|
26
23
|
}
|
27
24
|
else if (actionType === 'focus') {
|
28
25
|
this.focus();
|
29
26
|
}
|
30
27
|
};
|
31
|
-
TextAreaControl.prototype.valueToString = function (value) {
|
32
|
-
return typeof value === 'undefined' || value === null
|
33
|
-
? ''
|
34
|
-
: typeof value === 'string'
|
35
|
-
? value
|
36
|
-
: JSON.stringify(value);
|
37
|
-
};
|
38
28
|
TextAreaControl.prototype.focus = function () {
|
39
|
-
var
|
40
|
-
|
41
|
-
return;
|
42
|
-
}
|
43
|
-
this.setState({
|
44
|
-
focused: true
|
45
|
-
}, function () {
|
46
|
-
if (!_this.input) {
|
47
|
-
return;
|
48
|
-
}
|
49
|
-
_this.input.focus();
|
50
|
-
// 光标放到最后
|
51
|
-
var len = _this.input.value.length;
|
52
|
-
len && _this.input.setSelectionRange(len, len);
|
53
|
-
});
|
54
|
-
};
|
55
|
-
TextAreaControl.prototype.handleChange = function (e) {
|
56
|
-
var onChange = this.props.onChange;
|
57
|
-
var value = e.currentTarget.value;
|
58
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
29
|
+
var _a;
|
30
|
+
(_a = this.inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
59
31
|
};
|
60
32
|
TextAreaControl.prototype.handleFocus = function (e) {
|
61
33
|
var onFocus = this.props.onFocus;
|
@@ -76,35 +48,11 @@ var TextAreaControl = /** @class */ (function (_super) {
|
|
76
48
|
onBlur && onBlur(e);
|
77
49
|
});
|
78
50
|
};
|
79
|
-
TextAreaControl.prototype.handleClear = function () {
|
80
|
-
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
81
|
-
var _a, onChange, resetValue;
|
82
|
-
return (0, tslib_1.__generator)(this, function (_b) {
|
83
|
-
_a = this.props, onChange = _a.onChange, resetValue = _a.resetValue;
|
84
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(resetValue);
|
85
|
-
this.focus();
|
86
|
-
return [2 /*return*/];
|
87
|
-
});
|
88
|
-
});
|
89
|
-
};
|
90
51
|
TextAreaControl.prototype.render = function () {
|
91
|
-
var
|
92
|
-
|
93
|
-
var counter = showCounter ? this.valueToString(value).length : 0;
|
94
|
-
return (react_1.default.createElement("div", { className: cx("TextareaControl", (_a = {},
|
95
|
-
_a["TextareaControl--border".concat((0, helper_1.ucFirst)(borderMode))] = borderMode,
|
96
|
-
_a['is-focused'] = this.state.focused,
|
97
|
-
_a['is-disabled'] = disabled,
|
98
|
-
_a), className) },
|
99
|
-
react_1.default.createElement(Textarea_1.default, { className: cx("TextareaControl-input"), autoComplete: "off", ref: this.inputRef, name: name, disabled: disabled, value: this.valueToString(value), placeholder: placeholder, autoCorrect: "off", spellCheck: "false", readOnly: readOnly, minRows: minRows || undefined, maxRows: maxRows || undefined, onChange: this.handleChange, onFocus: this.handleFocus, onBlur: this.handleBlur }),
|
100
|
-
clearable && !disabled && value ? (react_1.default.createElement("a", { onClick: this.handleClear, className: cx('TextareaControl-clear') },
|
101
|
-
react_1.default.createElement(icons_1.Icon, { icon: "input-clear", className: "icon" }))) : null,
|
102
|
-
showCounter ? (react_1.default.createElement("span", { className: cx('TextareaControl-counter', {
|
103
|
-
'is-empty': counter === 0,
|
104
|
-
'is-clearable': clearable && !disabled && value
|
105
|
-
}) }, "".concat(counter).concat(typeof maxLength === 'number' && maxLength ? "/".concat(maxLength) : ''))) : null));
|
52
|
+
var rest = (0, tslib_1.__rest)(this.props, []);
|
53
|
+
return (react_1.default.createElement(Textarea_1.default, (0, tslib_1.__assign)({}, rest, { onFocus: this.handleFocus, onBlur: this.handleBlur })));
|
106
54
|
};
|
107
|
-
var _a, _b
|
55
|
+
var _a, _b;
|
108
56
|
TextAreaControl.defaultProps = {
|
109
57
|
minRows: 3,
|
110
58
|
maxRows: 20,
|
@@ -112,32 +60,20 @@ var TextAreaControl = /** @class */ (function (_super) {
|
|
112
60
|
resetValue: '',
|
113
61
|
clearable: false
|
114
62
|
};
|
115
|
-
(0, tslib_1.__decorate)([
|
116
|
-
helper_1.autobind,
|
117
|
-
(0, tslib_1.__metadata)("design:type", Function),
|
118
|
-
(0, tslib_1.__metadata)("design:paramtypes", [typeof (_a = typeof react_1.default !== "undefined" && react_1.default.ChangeEvent) === "function" ? _a : Object]),
|
119
|
-
(0, tslib_1.__metadata)("design:returntype", void 0)
|
120
|
-
], TextAreaControl.prototype, "handleChange", null);
|
121
63
|
(0, tslib_1.__decorate)([
|
122
64
|
helper_1.autobind,
|
123
65
|
(0, Decorators_1.bindRendererEvent)('focus'),
|
124
66
|
(0, tslib_1.__metadata)("design:type", Function),
|
125
|
-
(0, tslib_1.__metadata)("design:paramtypes", [typeof (
|
67
|
+
(0, tslib_1.__metadata)("design:paramtypes", [typeof (_a = typeof react_1.default !== "undefined" && react_1.default.FocusEvent) === "function" ? _a : Object]),
|
126
68
|
(0, tslib_1.__metadata)("design:returntype", void 0)
|
127
69
|
], TextAreaControl.prototype, "handleFocus", null);
|
128
70
|
(0, tslib_1.__decorate)([
|
129
71
|
helper_1.autobind,
|
130
72
|
(0, Decorators_1.bindRendererEvent)('blur'),
|
131
73
|
(0, tslib_1.__metadata)("design:type", Function),
|
132
|
-
(0, tslib_1.__metadata)("design:paramtypes", [typeof (
|
74
|
+
(0, tslib_1.__metadata)("design:paramtypes", [typeof (_b = typeof react_1.default !== "undefined" && react_1.default.FocusEvent) === "function" ? _b : Object]),
|
133
75
|
(0, tslib_1.__metadata)("design:returntype", void 0)
|
134
76
|
], TextAreaControl.prototype, "handleBlur", null);
|
135
|
-
(0, tslib_1.__decorate)([
|
136
|
-
helper_1.autobind,
|
137
|
-
(0, tslib_1.__metadata)("design:type", Function),
|
138
|
-
(0, tslib_1.__metadata)("design:paramtypes", []),
|
139
|
-
(0, tslib_1.__metadata)("design:returntype", Promise)
|
140
|
-
], TextAreaControl.prototype, "handleClear", null);
|
141
77
|
return TextAreaControl;
|
142
78
|
}(react_1.default.Component));
|
143
79
|
exports.default = TextAreaControl;
|
@@ -6,8 +6,8 @@
|
|
6
6
|
"/src/renderers/Form/Textarea.tsx"
|
7
7
|
],
|
8
8
|
"names": [],
|
9
|
-
"mappings": ";;;;AAAA,6DAA0B;AAC1B,+BAAmE;AAEnE,oFAAiD;
|
9
|
+
"mappings": ";;;;AAAA,6DAA0B;AAC1B,+BAAmE;AAEnE,oFAAiD;AAGjD,6CAAqD;AAErD,uDAA2D;AAoE3D;IAA6C,gDAG5C;IAHD;QAAA,qEAuEC;QA3DC,cAAQ,GAAG,eAAK,CAAC,SAAS,EAAO,CAAC;;IA2DpC,CAAC;IAzDC,kCAAQ,GAAR,UAAS,MAAsB,EAAE,IAAS;QACxC,IAAM,UAAU,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAoB,CAAC;QAChD,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QAErC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YAC7C,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAClC,IAAI,CAAC,KAAK,EAAE,CAAC;SACd;aAAM,IAAI,UAAU,KAAK,OAAO,EAAE;YACjC,IAAI,CAAC,KAAK,EAAE,CAAC;SACd;IACH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L,eAAK,CAAC,UAAU;;sDAW9B;IAID;QAFC,iBAAQ;QACR,IAAA,8BAAiB,EAAuC,MAAM,CAAC;;0EAClD,eAAK,oBAAL,eAAK,CAAC,UAAU;;qDAe7B;IASH,sBAAC;CAAA,AAvED,CAA6C,eAAK,CAAC,SAAS,GAuE3D;kBAvEoB,eAAe;AA4EpC;IAA6C,wDAAe;IAA5D;;IAA8D,CAAC;IAAlD,uBAAuB;QAHnC,IAAA,eAAQ,EAAC;YACR,IAAI,EAAE,UAAU;SACjB,CAAC;OACW,uBAAuB,CAA2B;IAAD,8BAAC;CAAA,AAA/D,CAA6C,eAAe,GAAG;AAAlD,0DAAuB",
|
10
10
|
"sourcesContent": [
|
11
|
-
"import React from 'react';\nimport {FormItem, FormControlProps, FormBaseControl} from './Item';\nimport cx from 'classnames';\nimport Textarea from '../../components/Textarea';\nimport {Icon} from '../../components/icons';\nimport {findDOMNode} from 'react-dom';\nimport {autobind, ucFirst} from '../../utils/helper';\n\nimport {bindRendererEvent} from '../../actions/Decorators';\nimport type {ListenerAction} from '../../actions/Action';\n\n/**\n * TextArea 多行文本输入框。\n * 文档:https://baidu.gitee.io/amis/docs/components/form/textarea\n */\nexport interface TextareaControlSchema extends FormBaseControl {\n /**\n * 指定为多行文本输入框\n */\n type: 'textarea';\n\n /**\n * 最大行数\n */\n maxRows?: number;\n\n /**\n * 最小行数\n */\n minRows?: number;\n\n /**\n * 是否只读\n */\n readOnly?: boolean;\n\n /**\n * 边框模式,全边框,还是半边框,或者没边框。\n */\n borderMode?: 'full' | 'half' | 'none';\n\n /**\n * 限制文字个数\n */\n maxLength?: number;\n\n /**\n * 是否显示计数\n */\n showCounter?: boolean;\n\n /**\n * 输入内容是否可清除\n */\n clearable?: boolean;\n\n /**\n * 重置值\n */\n resetValue?: string;\n}\n\nexport type TextAreaRendererEvent = 'blur' | 'focus';\n\nexport interface TextAreaProps extends FormControlProps {\n placeholder?: string;\n minRows?: number;\n maxRows?: number;\n clearable?: boolean;\n resetValue?: string;\n}\n\nexport interface TextAreaState {\n focused: boolean;\n}\n\nexport default class TextAreaControl extends React.Component<\n TextAreaProps,\n TextAreaState\n> {\n static defaultProps: Partial<TextAreaProps> = {\n minRows: 3,\n maxRows: 20,\n trimContents: true,\n resetValue: '',\n clearable: false\n };\n\n
|
11
|
+
"import React from 'react';\nimport {FormItem, FormControlProps, FormBaseControl} from './Item';\nimport cx from 'classnames';\nimport Textarea from '../../components/Textarea';\nimport {Icon} from '../../components/icons';\nimport {findDOMNode} from 'react-dom';\nimport {autobind, ucFirst} from '../../utils/helper';\n\nimport {bindRendererEvent} from '../../actions/Decorators';\nimport type {ListenerAction} from '../../actions/Action';\n\n/**\n * TextArea 多行文本输入框。\n * 文档:https://baidu.gitee.io/amis/docs/components/form/textarea\n */\nexport interface TextareaControlSchema extends FormBaseControl {\n /**\n * 指定为多行文本输入框\n */\n type: 'textarea';\n\n /**\n * 最大行数\n */\n maxRows?: number;\n\n /**\n * 最小行数\n */\n minRows?: number;\n\n /**\n * 是否只读\n */\n readOnly?: boolean;\n\n /**\n * 边框模式,全边框,还是半边框,或者没边框。\n */\n borderMode?: 'full' | 'half' | 'none';\n\n /**\n * 限制文字个数\n */\n maxLength?: number;\n\n /**\n * 是否显示计数\n */\n showCounter?: boolean;\n\n /**\n * 输入内容是否可清除\n */\n clearable?: boolean;\n\n /**\n * 重置值\n */\n resetValue?: string;\n}\n\nexport type TextAreaRendererEvent = 'blur' | 'focus';\n\nexport interface TextAreaProps extends FormControlProps {\n placeholder?: string;\n minRows?: number;\n maxRows?: number;\n clearable?: boolean;\n resetValue?: string;\n}\n\nexport interface TextAreaState {\n focused: boolean;\n}\n\nexport default class TextAreaControl extends React.Component<\n TextAreaProps,\n TextAreaState\n> {\n static defaultProps: Partial<TextAreaProps> = {\n minRows: 3,\n maxRows: 20,\n trimContents: true,\n resetValue: '',\n clearable: false\n };\n\n inputRef = React.createRef<any>();\n\n doAction(action: ListenerAction, args: any) {\n const actionType = action?.actionType as string;\n const onChange = this.props.onChange;\n\n if (!!~['clear', 'reset'].indexOf(actionType)) {\n onChange?.(this.props.resetValue);\n this.focus();\n } else if (actionType === 'focus') {\n this.focus();\n }\n }\n\n focus() {\n this.inputRef.current?.focus();\n }\n\n @autobind\n @bindRendererEvent<TextAreaProps, TextAreaRendererEvent>('focus')\n handleFocus(e: React.FocusEvent<HTMLTextAreaElement>) {\n const {onFocus} = this.props;\n\n this.setState(\n {\n focused: true\n },\n () => {\n onFocus && onFocus(e);\n }\n );\n }\n\n @autobind\n @bindRendererEvent<TextAreaProps, TextAreaRendererEvent>('blur')\n handleBlur(e: React.FocusEvent<HTMLTextAreaElement>) {\n const {onBlur, trimContents, value, onChange} = this.props;\n\n this.setState(\n {\n focused: false\n },\n () => {\n if (trimContents && value && typeof value === 'string') {\n onChange(value.trim());\n }\n\n onBlur && onBlur(e);\n }\n );\n }\n\n render() {\n const {...rest} = this.props;\n\n return (\n <Textarea {...rest} onFocus={this.handleFocus} onBlur={this.handleBlur} />\n );\n }\n}\n\n@FormItem({\n type: 'textarea'\n})\nexport class TextAreaControlRenderer extends TextAreaControl {}\n"
|
12
12
|
]
|
13
13
|
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { OptionsControlProps, Option, FormOptionsControl } from './Options';
|
3
|
+
import { PlainObject } from '../../types';
|
4
|
+
/**
|
5
|
+
* UserSelect 移动端人员选择。
|
6
|
+
*/
|
7
|
+
export interface UserSelectControlSchema extends FormOptionsControl {
|
8
|
+
type: 'users-select';
|
9
|
+
}
|
10
|
+
export interface UserSelectProps extends OptionsControlProps {
|
11
|
+
/**
|
12
|
+
* 部门可选
|
13
|
+
*/
|
14
|
+
isDep?: boolean;
|
15
|
+
/**
|
16
|
+
* 人员可选
|
17
|
+
*/
|
18
|
+
isRef?: boolean;
|
19
|
+
/**
|
20
|
+
*
|
21
|
+
*/
|
22
|
+
showNav?: boolean;
|
23
|
+
/**
|
24
|
+
* 导航头标题
|
25
|
+
*/
|
26
|
+
navTitle?: string;
|
27
|
+
/**
|
28
|
+
* 选项卡模式
|
29
|
+
*/
|
30
|
+
tabMode?: boolean;
|
31
|
+
tabOptions?: Array<any>;
|
32
|
+
/**
|
33
|
+
* 搜索字段
|
34
|
+
*/
|
35
|
+
searchTerm?: string;
|
36
|
+
/**
|
37
|
+
* 搜索携带的额外参数
|
38
|
+
*/
|
39
|
+
searchParam?: PlainObject;
|
40
|
+
}
|
41
|
+
export default class UserSelectControl extends React.Component<UserSelectProps, any> {
|
42
|
+
static defaultProps: Partial<UserSelectProps>;
|
43
|
+
input?: HTMLInputElement;
|
44
|
+
unHook: Function;
|
45
|
+
lazyloadRemote: Function;
|
46
|
+
constructor(props: UserSelectProps);
|
47
|
+
componentWillUnmount(): void;
|
48
|
+
onSearch(input: string, cancelExecutor: Function, param?: PlainObject): Promise<any>;
|
49
|
+
deferLoad(data?: Object, isRef?: boolean, param?: PlainObject): Promise<any>;
|
50
|
+
changeValue(value: Option | Array<Option> | string | void): Promise<void>;
|
51
|
+
render(): JSX.Element;
|
52
|
+
}
|
53
|
+
export declare class UserSelectControlRenderer extends UserSelectControl {
|
54
|
+
}
|