@pisell/materials 1.0.449 → 1.0.451
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +150 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +28 -28
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +23 -23
- package/es/components/collapse/index.d.ts +11 -2
- package/es/components/collapse/index.js +28 -22
- package/es/components/colorPicker/index.d.ts +4 -0
- package/es/components/colorPicker/index.js +6 -0
- package/es/components/dataSourceComponents/dataSourceForm/formItem.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceForm/formItem.js +46 -0
- package/es/components/dataSourceComponents/dataSourceForm/group/index.d.ts +20 -0
- package/es/components/dataSourceComponents/dataSourceForm/group/index.js +65 -0
- package/es/components/dataSourceComponents/dataSourceForm/group/index.less +42 -0
- package/es/components/dataSourceComponents/dataSourceForm/index.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceForm/index.js +75 -0
- package/es/components/dataSourceComponents/dataSourceForm/index.less +24 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +10 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.js +6 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.d.ts +8 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +24 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/hooks/useFormSetting.d.ts +5 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/hooks/useFormSetting.js +11 -0
- package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +147 -0
- package/es/components/dataSourceComponents/dataSourceForm/serve.js +253 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +36 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +217 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.less +4 -0
- package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +16 -0
- package/es/components/dataSourceComponents/dataSourceForm/type.js +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +36 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +188 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useColumns.d.ts +11 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +56 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.d.ts +2 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +39 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +10 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.js +35 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +27 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +41 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/usePagination.d.ts +16 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/usePagination.js +14 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +19 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +51 -0
- package/es/components/dataSourceComponents/dataSourceTable/index.d.ts +4 -0
- package/es/components/dataSourceComponents/dataSourceTable/index.js +208 -0
- package/es/components/dataSourceComponents/dataSourceTable/provider/tableSetting/TableSettingContext.d.ts +7 -0
- package/es/components/dataSourceComponents/dataSourceTable/provider/tableSetting/TableSettingContext.js +4 -0
- package/es/components/dataSourceComponents/dataSourceTable/provider/tableSetting/TableSettingProvider.d.ts +8 -0
- package/es/components/dataSourceComponents/dataSourceTable/provider/tableSetting/TableSettingProvider.js +20 -0
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +15 -0
- package/es/components/dataSourceComponents/dataSourceTable/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Checkbox/ReadPretty.d.ts +7 -0
- package/es/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +14 -0
- package/es/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +7 -0
- package/es/components/dataSourceComponents/fields/Checkbox/WithMode.js +7 -0
- package/es/components/dataSourceComponents/fields/Checkbox/index.d.ts +6 -0
- package/es/components/dataSourceComponents/fields/Checkbox/index.js +6 -0
- package/es/components/dataSourceComponents/fields/Checkbox/type.d.ts +9 -0
- package/es/components/dataSourceComponents/fields/Checkbox/type.js +1 -0
- package/es/components/dataSourceComponents/fields/ColorPicker/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/ColorPicker/ReadPretty.js +9 -0
- package/es/components/dataSourceComponents/fields/ColorPicker/WithMode.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/ColorPicker/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/ColorPicker/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/ColorPicker/index.js +4 -0
- package/es/components/dataSourceComponents/fields/ColorPicker/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/ColorPicker/type.js +1 -0
- package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +7 -0
- package/es/components/dataSourceComponents/fields/DatePicker/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/DatePicker/WithMode.js +17 -0
- package/es/components/dataSourceComponents/fields/DatePicker/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/DatePicker/index.js +4 -0
- package/es/components/dataSourceComponents/fields/DatePicker/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/DatePicker/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Input/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input/ReadPretty.js +5 -0
- package/es/components/dataSourceComponents/fields/Input/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/Input/index.d.ts +13 -0
- package/es/components/dataSourceComponents/fields/Input/index.js +12 -0
- package/es/components/dataSourceComponents/fields/Input/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Input/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Input.Json/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input.Json/ReadPretty.js +11 -0
- package/es/components/dataSourceComponents/fields/Input.Json/WithMode.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Input.Json/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/Input.Json/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Input.Json/index.js +4 -0
- package/es/components/dataSourceComponents/fields/Input.Json/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Input.Json/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Input.Password/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input.Password/ReadPretty.js +5 -0
- package/es/components/dataSourceComponents/fields/Input.Password/WithMode.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Input.Password/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/Input.Password/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Input.Password/index.js +4 -0
- package/es/components/dataSourceComponents/fields/Input.Password/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Input.Password/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.js +5 -0
- package/es/components/dataSourceComponents/fields/Input.TextArea/WithMode.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Input.TextArea/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/Input.TextArea/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Input.TextArea/index.js +4 -0
- package/es/components/dataSourceComponents/fields/Input.TextArea/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Input.TextArea/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.js +9 -0
- package/es/components/dataSourceComponents/fields/Input.Url/WithMode.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Input.Url/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/Input.Url/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Input.Url/index.js +4 -0
- package/es/components/dataSourceComponents/fields/Input.Url/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Input.Url/type.js +1 -0
- package/es/components/dataSourceComponents/fields/InputNumber/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/InputNumber/ReadPretty.js +7 -0
- package/es/components/dataSourceComponents/fields/InputNumber/WithMode.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/InputNumber/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/InputNumber/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/InputNumber/index.js +4 -0
- package/es/components/dataSourceComponents/fields/InputNumber/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/InputNumber/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Radio/ReadPretty.d.ts +7 -0
- package/es/components/dataSourceComponents/fields/Radio/ReadPretty.js +14 -0
- package/es/components/dataSourceComponents/fields/Radio/WithMode.d.ts +7 -0
- package/es/components/dataSourceComponents/fields/Radio/WithMode.js +7 -0
- package/es/components/dataSourceComponents/fields/Radio/index.d.ts +6 -0
- package/es/components/dataSourceComponents/fields/Radio/index.js +6 -0
- package/es/components/dataSourceComponents/fields/Radio/type.d.ts +8 -0
- package/es/components/dataSourceComponents/fields/Radio/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Select/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Select/ReadPretty.js +9 -0
- package/es/components/dataSourceComponents/fields/Select/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Select/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Select/index.js +4 -0
- package/es/components/dataSourceComponents/fields/Select/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Select/type.js +1 -0
- package/es/components/dataSourceComponents/fields/TimePicker/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/TimePicker/ReadPretty.js +6 -0
- package/es/components/dataSourceComponents/fields/TimePicker/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/TimePicker/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/TimePicker/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/TimePicker/index.js +4 -0
- package/es/components/dataSourceComponents/fields/TimePicker/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/TimePicker/type.js +1 -0
- package/es/components/dataSourceComponents/fields/index.d.ts +16 -0
- package/es/components/dataSourceComponents/fields/index.js +27 -0
- package/es/components/dataSourceComponents/hooks/useActions.d.ts +16 -0
- package/es/components/dataSourceComponents/hooks/useActions.js +302 -0
- package/es/components/dataSourceComponents/hooks/useCtxActions.d.ts +8 -0
- package/es/components/dataSourceComponents/hooks/useCtxActions.js +14 -0
- package/es/components/dataSourceComponents/hooks/useDataSource.d.ts +5 -0
- package/es/components/dataSourceComponents/hooks/useDataSource.js +11 -0
- package/es/components/dataSourceComponents/hooks/useParseActionsVariable.d.ts +6 -0
- package/es/components/dataSourceComponents/hooks/useParseActionsVariable.js +61 -0
- package/es/components/dataSourceComponents/hooks/useValueMap.d.ts +8 -0
- package/es/components/dataSourceComponents/hooks/useValueMap.js +22 -0
- package/es/components/dataSourceComponents/hooks/useVariables.d.ts +2 -0
- package/es/components/dataSourceComponents/hooks/useVariables.js +6 -0
- package/es/components/dataSourceComponents/provider/actions/ActionsContext.d.ts +6 -0
- package/es/components/dataSourceComponents/provider/actions/ActionsContext.js +3 -0
- package/es/components/dataSourceComponents/provider/actions/ActionsProvider.d.ts +9 -0
- package/es/components/dataSourceComponents/provider/actions/ActionsProvider.js +28 -0
- package/es/components/dataSourceComponents/provider/fields/DataSourceContext.d.ts +75 -0
- package/es/components/dataSourceComponents/provider/fields/DataSourceContext.js +6 -0
- package/es/components/dataSourceComponents/provider/fields/DataSourceProvider.d.ts +8 -0
- package/es/components/dataSourceComponents/provider/fields/DataSourceProvider.js +20 -0
- package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +9 -0
- package/es/components/dataSourceComponents/provider/variables/VariablesContext.js +8 -0
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.d.ts +4 -0
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +82 -0
- package/es/components/form/index.d.ts +2 -8
- package/es/components/form/index.js +3 -1
- package/es/components/page/index.js +3 -2
- package/es/components/pisellAnchor/index.js +0 -1
- package/es/components/pisellStatistic/index.js +0 -1
- package/es/components/pisellUpload/index.js +0 -1
- package/es/components/pisellUploadCrop/index.js +0 -1
- package/es/components/pisellWalletCard/index.js +0 -2
- package/es/components/pisellWalletPassCard/index.js +4 -1
- package/es/components/productCard/components/Action/index.d.ts +4 -0
- package/es/components/productCard/components/{Actions → Action}/index.js +7 -6
- package/{lib/components/productCard/components/Actions → es/components/productCard/components/Action}/index.less +1 -1
- package/es/components/productCard/components/AmountFooter/index.d.ts +2 -2
- package/es/components/productCard/components/AmountFooter/index.js +13 -7
- package/es/components/productCard/components/AmountFooter/index.less +9 -0
- package/es/components/productCard/components/Header/index.d.ts +1 -1
- package/es/components/productCard/components/Header/index.js +17 -18
- package/es/components/productCard/components/Header/index.less +4 -0
- package/es/components/productCard/components/Note/index.d.ts +1 -1
- package/es/components/productCard/components/Note/index.js +11 -4
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +1 -1
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.js +14 -12
- package/es/components/productCard/components/Packages/components/options/index.less +1 -0
- package/es/components/productCard/components/Packages/index.d.ts +1 -1
- package/es/components/productCard/components/Packages/index.js +14 -5
- package/es/components/productCard/components/Sales/index.d.ts +1 -1
- package/es/components/productCard/components/Sales/index.js +23 -6
- package/es/components/productCard/components/Time/components/Like/index.d.ts +2 -2
- package/es/components/productCard/components/Time/components/Like/index.js +3 -3
- package/es/components/productCard/components/Time/index.d.ts +1 -1
- package/es/components/productCard/components/Time/index.js +28 -14
- package/es/components/productCard/components/Time/index.less +10 -0
- package/es/components/productCard/hooks/useOpenNote.d.ts +3 -0
- package/es/components/productCard/hooks/useOpenNote.js +58 -0
- package/es/components/productCard/index.js +76 -33
- package/es/components/productCard/index.less +8 -3
- package/es/components/productCard/locales.d.ts +24 -0
- package/es/components/productCard/locales.js +29 -0
- package/es/components/productCard/types.d.ts +6 -0
- package/es/components/productCard/utils.js +23 -5
- package/es/components/record-view/index.js +0 -3
- package/es/components/section-footers/index.js +0 -1
- package/es/components/select/index.d.ts +1 -1
- package/es/components/select/index.js +2 -1
- package/es/components/table/utils.d.ts +5 -6
- package/es/components/table/utils.js +7 -1
- package/es/components/tabs/index.js +0 -4
- package/es/hooks/useSetRequest.d.ts +2 -0
- package/es/hooks/useSetRequest.js +8 -0
- package/es/index.d.ts +13 -0
- package/es/index.js +16 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +2 -1
- package/es/utils/mergeWith.d.ts +1 -0
- package/es/utils/mergeWith.js +31 -0
- package/lib/components/collapse/index.d.ts +11 -2
- package/lib/components/collapse/index.js +27 -21
- package/lib/components/colorPicker/index.d.ts +4 -0
- package/lib/components/{productCard/components/Holder → colorPicker}/index.js +9 -11
- package/lib/components/dataSourceComponents/dataSourceForm/formItem.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceForm/formItem.js +59 -0
- package/lib/components/dataSourceComponents/dataSourceForm/group/index.d.ts +20 -0
- package/lib/components/dataSourceComponents/dataSourceForm/group/index.js +80 -0
- package/lib/components/dataSourceComponents/dataSourceForm/group/index.less +42 -0
- package/lib/components/dataSourceComponents/dataSourceForm/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceForm/index.js +103 -0
- package/lib/components/dataSourceComponents/dataSourceForm/index.less +24 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +10 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.js +35 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.d.ts +8 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +54 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/hooks/useFormSetting.d.ts +5 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/hooks/useFormSetting.js +41 -0
- package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +147 -0
- package/lib/components/dataSourceComponents/dataSourceForm/serve.js +141 -0
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +36 -0
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +157 -0
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.less +4 -0
- package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +16 -0
- package/lib/components/dataSourceComponents/dataSourceForm/type.js +17 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +36 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +177 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useColumns.d.ts +11 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +85 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.d.ts +2 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +55 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +10 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.js +45 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +27 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +62 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/usePagination.d.ts +16 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/usePagination.js +37 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +19 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +56 -0
- package/lib/components/dataSourceComponents/dataSourceTable/index.d.ts +4 -0
- package/lib/components/dataSourceComponents/dataSourceTable/index.js +193 -0
- package/lib/components/dataSourceComponents/dataSourceTable/provider/tableSetting/TableSettingContext.d.ts +7 -0
- package/lib/components/dataSourceComponents/dataSourceTable/provider/tableSetting/TableSettingContext.js +33 -0
- package/lib/components/dataSourceComponents/dataSourceTable/provider/tableSetting/TableSettingProvider.d.ts +8 -0
- package/lib/components/dataSourceComponents/dataSourceTable/provider/tableSetting/TableSettingProvider.js +52 -0
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +15 -0
- package/lib/components/dataSourceComponents/dataSourceTable/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Checkbox/ReadPretty.d.ts +7 -0
- package/lib/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +47 -0
- package/lib/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +7 -0
- package/lib/components/dataSourceComponents/fields/Checkbox/WithMode.js +41 -0
- package/lib/components/dataSourceComponents/fields/Checkbox/index.d.ts +6 -0
- package/lib/components/dataSourceComponents/fields/Checkbox/index.js +40 -0
- package/lib/components/dataSourceComponents/fields/Checkbox/type.d.ts +9 -0
- package/lib/components/dataSourceComponents/fields/Checkbox/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/ColorPicker/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/ColorPicker/ReadPretty.js +40 -0
- package/lib/components/dataSourceComponents/fields/ColorPicker/WithMode.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/ColorPicker/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/ColorPicker/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/ColorPicker/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/ColorPicker/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/ColorPicker/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +41 -0
- package/lib/components/dataSourceComponents/fields/DatePicker/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/DatePicker/WithMode.js +50 -0
- package/lib/components/dataSourceComponents/fields/DatePicker/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/DatePicker/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/DatePicker/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/DatePicker/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Input/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input/ReadPretty.js +39 -0
- package/lib/components/dataSourceComponents/fields/Input/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/Input/index.d.ts +13 -0
- package/lib/components/dataSourceComponents/fields/Input/index.js +46 -0
- package/lib/components/dataSourceComponents/fields/Input/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Input/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/ReadPretty.js +45 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/WithMode.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/ReadPretty.js +39 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/WithMode.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.js +39 -0
- package/lib/components/dataSourceComponents/fields/Input.TextArea/WithMode.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Input.TextArea/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/Input.TextArea/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Input.TextArea/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/Input.TextArea/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Input.TextArea/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.js +41 -0
- package/lib/components/dataSourceComponents/fields/Input.Url/WithMode.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Input.Url/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/Input.Url/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Input.Url/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/Input.Url/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Url/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/InputNumber/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/InputNumber/ReadPretty.js +40 -0
- package/lib/components/dataSourceComponents/fields/InputNumber/WithMode.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/InputNumber/WithMode.js +42 -0
- package/lib/components/dataSourceComponents/fields/InputNumber/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/InputNumber/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/InputNumber/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/InputNumber/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Radio/ReadPretty.d.ts +7 -0
- package/lib/components/dataSourceComponents/fields/Radio/ReadPretty.js +47 -0
- package/lib/components/dataSourceComponents/fields/Radio/WithMode.d.ts +7 -0
- package/lib/components/dataSourceComponents/fields/Radio/WithMode.js +41 -0
- package/lib/components/dataSourceComponents/fields/Radio/index.d.ts +6 -0
- package/lib/components/dataSourceComponents/fields/Radio/index.js +40 -0
- package/lib/components/dataSourceComponents/fields/Radio/type.d.ts +8 -0
- package/lib/components/dataSourceComponents/fields/Radio/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Select/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Select/ReadPretty.js +42 -0
- package/lib/components/dataSourceComponents/fields/Select/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Select/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Select/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/Select/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Select/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/TimePicker/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/TimePicker/ReadPretty.js +40 -0
- package/lib/components/dataSourceComponents/fields/TimePicker/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/TimePicker/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/TimePicker/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/TimePicker/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/TimePicker/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/TimePicker/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/index.d.ts +16 -0
- package/lib/components/dataSourceComponents/fields/index.js +64 -0
- package/lib/components/dataSourceComponents/hooks/useActions.d.ts +16 -0
- package/lib/components/dataSourceComponents/hooks/useActions.js +184 -0
- package/lib/components/dataSourceComponents/hooks/useCtxActions.d.ts +8 -0
- package/lib/components/dataSourceComponents/hooks/useCtxActions.js +41 -0
- package/lib/components/dataSourceComponents/hooks/useDataSource.d.ts +5 -0
- package/lib/components/dataSourceComponents/hooks/useDataSource.js +41 -0
- package/lib/components/dataSourceComponents/hooks/useParseActionsVariable.d.ts +6 -0
- package/lib/components/dataSourceComponents/hooks/useParseActionsVariable.js +73 -0
- package/lib/components/dataSourceComponents/hooks/useValueMap.d.ts +8 -0
- package/lib/components/dataSourceComponents/hooks/useValueMap.js +39 -0
- package/lib/components/dataSourceComponents/hooks/useVariables.d.ts +2 -0
- package/lib/components/dataSourceComponents/hooks/useVariables.js +40 -0
- package/lib/components/dataSourceComponents/provider/actions/ActionsContext.d.ts +6 -0
- package/lib/components/dataSourceComponents/provider/actions/ActionsContext.js +27 -0
- package/lib/components/dataSourceComponents/provider/actions/ActionsProvider.d.ts +9 -0
- package/lib/components/dataSourceComponents/provider/actions/ActionsProvider.js +46 -0
- package/lib/components/dataSourceComponents/provider/fields/DataSourceContext.d.ts +75 -0
- package/lib/components/dataSourceComponents/provider/fields/DataSourceContext.js +35 -0
- package/lib/components/dataSourceComponents/provider/fields/DataSourceProvider.d.ts +8 -0
- package/lib/components/dataSourceComponents/provider/fields/DataSourceProvider.js +46 -0
- package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +9 -0
- package/lib/components/dataSourceComponents/provider/variables/VariablesContext.js +39 -0
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.d.ts +4 -0
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +104 -0
- package/lib/components/form/index.d.ts +2 -8
- package/lib/components/form/index.js +3 -2
- package/lib/components/page/index.js +7 -3
- package/lib/components/pisellAnchor/index.js +0 -5
- package/lib/components/pisellStatistic/index.js +0 -5
- package/lib/components/pisellUpload/index.js +0 -5
- package/lib/components/pisellUploadCrop/index.js +0 -5
- package/lib/components/pisellWalletCard/index.js +0 -10
- package/lib/components/pisellWalletPassCard/index.js +3 -0
- package/lib/components/productCard/components/Action/index.d.ts +4 -0
- package/lib/components/productCard/components/{Actions → Action}/index.js +11 -10
- package/{es/components/productCard/components/Actions → lib/components/productCard/components/Action}/index.less +1 -1
- package/lib/components/productCard/components/AmountFooter/index.d.ts +2 -2
- package/lib/components/productCard/components/AmountFooter/index.js +8 -8
- package/lib/components/productCard/components/AmountFooter/index.less +9 -0
- package/lib/components/productCard/components/Header/index.d.ts +1 -1
- package/lib/components/productCard/components/Header/index.js +8 -8
- package/lib/components/productCard/components/Header/index.less +4 -0
- package/lib/components/productCard/components/Note/index.d.ts +1 -1
- package/lib/components/productCard/components/Note/index.js +14 -2
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +1 -1
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.js +7 -3
- package/lib/components/productCard/components/Packages/components/options/index.less +1 -0
- package/lib/components/productCard/components/Packages/index.d.ts +1 -1
- package/lib/components/productCard/components/Packages/index.js +7 -3
- package/lib/components/productCard/components/Sales/index.d.ts +1 -1
- package/lib/components/productCard/components/Sales/index.js +13 -3
- package/lib/components/productCard/components/Time/components/Like/index.d.ts +2 -2
- package/lib/components/productCard/components/Time/components/Like/index.js +3 -3
- package/lib/components/productCard/components/Time/index.d.ts +1 -1
- package/lib/components/productCard/components/Time/index.js +17 -10
- package/lib/components/productCard/components/Time/index.less +10 -0
- package/lib/components/productCard/hooks/useOpenNote.d.ts +3 -0
- package/lib/components/productCard/hooks/useOpenNote.js +79 -0
- package/lib/components/productCard/index.js +96 -43
- package/lib/components/productCard/index.less +8 -3
- package/lib/components/productCard/locales.d.ts +24 -0
- package/lib/components/productCard/locales.js +47 -0
- package/lib/components/productCard/types.d.ts +6 -0
- package/lib/components/productCard/utils.js +18 -3
- package/lib/components/record-view/index.js +0 -15
- package/lib/components/section-footers/index.js +0 -5
- package/lib/components/select/index.d.ts +1 -1
- package/lib/components/select/index.js +2 -1
- package/lib/components/table/utils.d.ts +5 -6
- package/lib/components/table/utils.js +7 -1
- package/lib/components/tabs/index.js +0 -20
- package/lib/hooks/useSetRequest.d.ts +2 -0
- package/lib/hooks/useSetRequest.js +42 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +39 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +4 -1
- package/lib/utils/mergeWith.d.ts +1 -0
- package/lib/utils/mergeWith.js +56 -0
- package/lowcode/_utils/defaultSchema.ts +430 -0
- package/lowcode/color-picker/__screenshots__/input-1.png +0 -0
- package/lowcode/color-picker/meta.ts +298 -0
- package/lowcode/color-picker/snippets.ts +9 -0
- package/lowcode/data-source-form/__screenshots__/form-1.png +0 -0
- package/lowcode/data-source-form/constants.ts +39 -0
- package/lowcode/data-source-form/meta.ts +797 -0
- package/lowcode/data-source-form/snippets.ts +130 -0
- package/lowcode/data-source-form/utils.ts +343 -0
- package/lowcode/data-source-table/__screenshots__/table-1.png +0 -0
- package/lowcode/data-source-table/meta.ts +2697 -0
- package/lowcode/data-source-table/snippets.ts +84 -0
- package/lowcode/data-source-table/utils.tsx +140 -0
- package/lowcode/form/meta.ts +118 -22
- package/lowcode/form/snippets.ts +2 -481
- package/lowcode/form-group/meta.ts +346 -0
- package/lowcode/form-group/snippets.ts +16 -0
- package/lowcode/form-item-checkbox/meta.ts +88 -0
- package/lowcode/form-item-checkbox/snippets.ts +35 -0
- package/lowcode/form-item-checkbox.group/__screenshots__/checkbox-group-1.png +0 -0
- package/lowcode/form-item-checkbox.group/meta.ts +159 -0
- package/lowcode/form-item-color-picker/__screenshots__/input-1.png +0 -0
- package/lowcode/form-item-color-picker/meta.ts +301 -0
- package/lowcode/form-item-color-picker/snippets.ts +9 -0
- package/lowcode/form-item-date-picker/__screenshots__/date-picker-1.png +0 -0
- package/lowcode/form-item-date-picker/__screenshots__/date-picker-2.png +0 -0
- package/lowcode/form-item-date-picker/__screenshots__/date-picker-3.png +0 -0
- package/lowcode/form-item-date-picker/__screenshots__/date-picker-4.png +0 -0
- package/lowcode/form-item-date-picker/__screenshots__/date-picker-5.png +0 -0
- package/lowcode/form-item-date-picker/meta.ts +290 -0
- package/lowcode/form-item-date-picker/snippets.ts +50 -0
- package/lowcode/form-item-input/__screenshots__/input-1.png +0 -0
- package/lowcode/form-item-input/meta.ts +227 -0
- package/lowcode/form-item-input/snippets.ts +12 -0
- package/lowcode/form-item-input-number/__screenshots__/input-number-1.png +0 -0
- package/lowcode/form-item-input-number/meta.ts +228 -0
- package/lowcode/form-item-input-number/snippets.ts +12 -0
- package/lowcode/form-item-input.json/meta.ts +213 -0
- package/lowcode/form-item-input.json/snippets.ts +16 -0
- package/lowcode/form-item-input.password/__screenshots__/input-password-1.png +0 -0
- package/lowcode/form-item-input.password/meta.ts +198 -0
- package/lowcode/form-item-input.password/snippets.ts +12 -0
- package/lowcode/form-item-input.text-area/__screenshots__/input-text-area-1.png +0 -0
- package/lowcode/form-item-input.text-area/meta.ts +213 -0
- package/lowcode/form-item-input.text-area/snippets.ts +16 -0
- package/lowcode/form-item-input.url/meta.ts +213 -0
- package/lowcode/form-item-input.url/snippets.ts +15 -0
- package/lowcode/form-item-radio/__screenshots__/radio-1.png +0 -0
- package/lowcode/form-item-radio/meta.ts +72 -0
- package/lowcode/form-item-radio/snippets.ts +36 -0
- package/lowcode/form-item-radio.group/__screenshots__/radio-group-1.png +0 -0
- package/lowcode/form-item-radio.group/meta.ts +221 -0
- package/lowcode/form-item-select/__screenshots__/select-1.png +0 -0
- package/lowcode/form-item-select/meta.ts +463 -0
- package/lowcode/form-item-select/snippets.ts +28 -0
- package/lowcode/form-item-time-picker/__screenshots__/time-picker-1.png +0 -0
- package/lowcode/form-item-time-picker/meta.ts +235 -0
- package/lowcode/form-item-time-picker/snippets.ts +10 -0
- package/lowcode/form.item/meta.ts +104 -25
- package/lowcode/pisell-text.amount/meta.ts +1 -1
- package/lowcode/product-card/snippets.ts +10 -2
- package/lowcode/submit-button/meta.ts +1002 -0
- package/lowcode/submit-button/snippets.ts +15 -0
- package/lowcode/timeline/meta.ts +1 -2
- package/package.json +2 -2
- package/es/components/productCard/components/Actions/index.d.ts +0 -4
- package/es/components/productCard/components/Holder/index.d.ts +0 -4
- package/es/components/productCard/components/Holder/index.js +0 -11
- package/es/components/productCard/components/Holder/index.less +0 -11
- package/lib/components/productCard/components/Actions/index.d.ts +0 -4
- package/lib/components/productCard/components/Holder/index.d.ts +0 -4
- package/lib/components/productCard/components/Holder/index.less +0 -11
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
import { useMemoizedFn } from 'ahooks';
|
|
6
|
+
import { message } from 'antd';
|
|
7
|
+
import useFormat from "../dataSourceTable/hooks/useFormat";
|
|
8
|
+
import { createNocobaseData, customApi, getNocobaseData, updateNocobaseData, getNocobaseDataList, deleteNocobaseData } from "../dataSourceForm/serve";
|
|
9
|
+
import useParseActionsVariable from "./useParseActionsVariable";
|
|
10
|
+
import useVariables from "./useVariables";
|
|
11
|
+
import useDataSource from "./useDataSource";
|
|
12
|
+
var useActions = function useActions() {
|
|
13
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
14
|
+
propsDataSource = _ref.dataSource,
|
|
15
|
+
propsCurrentValue = _ref.currentValue;
|
|
16
|
+
// const { currentValue: ctxCurrentValue } = useFormSetting();
|
|
17
|
+
var _useDataSource = useDataSource(),
|
|
18
|
+
ctxDataSource = _useDataSource.dataSource;
|
|
19
|
+
var _useVariables = useVariables(),
|
|
20
|
+
parseVariable = _useVariables.parseVariable;
|
|
21
|
+
var _useParseActionsVaria = useParseActionsVariable(),
|
|
22
|
+
parseActions = _useParseActionsVaria.parseActions;
|
|
23
|
+
var currentDataSource = propsDataSource || ctxDataSource;
|
|
24
|
+
var currentValue = propsCurrentValue;
|
|
25
|
+
var _ref2 = currentDataSource || {},
|
|
26
|
+
isCustomApi = _ref2.isCustomApi,
|
|
27
|
+
originalActions = _ref2.actions,
|
|
28
|
+
options = _ref2.options,
|
|
29
|
+
headerDataSource = _ref2.headerDataSource,
|
|
30
|
+
name = _ref2.name,
|
|
31
|
+
dataSourceKey = _ref2.dataSourceKey;
|
|
32
|
+
var _useFormat = useFormat({
|
|
33
|
+
dataSourceKey: dataSourceKey
|
|
34
|
+
}),
|
|
35
|
+
formatListResult = _useFormat.formatListResult,
|
|
36
|
+
formatListParams = _useFormat.formatListParams;
|
|
37
|
+
var getParsedActions = useMemoizedFn(function () {
|
|
38
|
+
return parseActions(originalActions, {});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// 生成自定义 API 请求函数
|
|
42
|
+
var genCustomApi = useMemoizedFn(function (_ref3) {
|
|
43
|
+
var method = _ref3.method,
|
|
44
|
+
path = _ref3.path,
|
|
45
|
+
parsedPath = _ref3.parsedPath,
|
|
46
|
+
params = _ref3.params,
|
|
47
|
+
headers = _ref3.headers,
|
|
48
|
+
body = _ref3.body;
|
|
49
|
+
return /*#__PURE__*/function () {
|
|
50
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
|
|
51
|
+
var result;
|
|
52
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
53
|
+
while (1) switch (_context.prev = _context.next) {
|
|
54
|
+
case 0:
|
|
55
|
+
_context.next = 2;
|
|
56
|
+
return customApi(parsedPath || path, data, {
|
|
57
|
+
method: method,
|
|
58
|
+
baseUrl: options === null || options === void 0 ? void 0 : options.baseUrl,
|
|
59
|
+
params: params,
|
|
60
|
+
headers: headers,
|
|
61
|
+
body: body
|
|
62
|
+
});
|
|
63
|
+
case 2:
|
|
64
|
+
result = _context.sent;
|
|
65
|
+
if (!(dataSourceKey === 'mypisell-api')) {
|
|
66
|
+
_context.next = 5;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
return _context.abrupt("return", result.data);
|
|
70
|
+
case 5:
|
|
71
|
+
return _context.abrupt("return", result);
|
|
72
|
+
case 6:
|
|
73
|
+
case "end":
|
|
74
|
+
return _context.stop();
|
|
75
|
+
}
|
|
76
|
+
}, _callee);
|
|
77
|
+
}));
|
|
78
|
+
return function (_x) {
|
|
79
|
+
return _ref4.apply(this, arguments);
|
|
80
|
+
};
|
|
81
|
+
}();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// 获取公共请求头
|
|
85
|
+
var getHeaders = useMemoizedFn(function () {
|
|
86
|
+
return headerDataSource ? {
|
|
87
|
+
'x-data-source': headerDataSource
|
|
88
|
+
} : {};
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// 创建数据
|
|
92
|
+
var create = useMemoizedFn( /*#__PURE__*/function () {
|
|
93
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(values) {
|
|
94
|
+
var actions, createApi;
|
|
95
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
96
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
97
|
+
case 0:
|
|
98
|
+
if (!isCustomApi) {
|
|
99
|
+
_context2.next = 6;
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
actions = getParsedActions();
|
|
103
|
+
createApi = genCustomApi(actions === null || actions === void 0 ? void 0 : actions.create);
|
|
104
|
+
return _context2.abrupt("return", createApi(values));
|
|
105
|
+
case 6:
|
|
106
|
+
return _context2.abrupt("return", createNocobaseData({
|
|
107
|
+
key: name,
|
|
108
|
+
data: values,
|
|
109
|
+
headers: getHeaders()
|
|
110
|
+
}));
|
|
111
|
+
case 7:
|
|
112
|
+
case "end":
|
|
113
|
+
return _context2.stop();
|
|
114
|
+
}
|
|
115
|
+
}, _callee2);
|
|
116
|
+
}));
|
|
117
|
+
return function (_x2) {
|
|
118
|
+
return _ref5.apply(this, arguments);
|
|
119
|
+
};
|
|
120
|
+
}());
|
|
121
|
+
|
|
122
|
+
// 获取数据
|
|
123
|
+
var get = useMemoizedFn( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
124
|
+
var actions, getApi;
|
|
125
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
126
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
127
|
+
case 0:
|
|
128
|
+
if (!(currentValue === 'server')) {
|
|
129
|
+
_context3.next = 10;
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
if (!isCustomApi) {
|
|
133
|
+
_context3.next = 7;
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
actions = getParsedActions();
|
|
137
|
+
if (actions !== null && actions !== void 0 && actions.get) {
|
|
138
|
+
_context3.next = 5;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
return _context3.abrupt("return", {});
|
|
142
|
+
case 5:
|
|
143
|
+
getApi = genCustomApi(actions === null || actions === void 0 ? void 0 : actions.get);
|
|
144
|
+
return _context3.abrupt("return", getApi({}));
|
|
145
|
+
case 7:
|
|
146
|
+
return _context3.abrupt("return", getNocobaseData({
|
|
147
|
+
key: name,
|
|
148
|
+
id: '1'
|
|
149
|
+
}));
|
|
150
|
+
case 10:
|
|
151
|
+
if (!currentValue) {
|
|
152
|
+
_context3.next = 12;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
return _context3.abrupt("return", parseVariable === null || parseVariable === void 0 ? void 0 : parseVariable(currentValue, {}));
|
|
156
|
+
case 12:
|
|
157
|
+
return _context3.abrupt("return", {});
|
|
158
|
+
case 13:
|
|
159
|
+
case "end":
|
|
160
|
+
return _context3.stop();
|
|
161
|
+
}
|
|
162
|
+
}, _callee3);
|
|
163
|
+
})));
|
|
164
|
+
|
|
165
|
+
// 更新数据
|
|
166
|
+
var update = useMemoizedFn( /*#__PURE__*/function () {
|
|
167
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(values) {
|
|
168
|
+
var actions, updateApi, id;
|
|
169
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
170
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
171
|
+
case 0:
|
|
172
|
+
if (!isCustomApi) {
|
|
173
|
+
_context4.next = 8;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
actions = getParsedActions();
|
|
177
|
+
if (actions.update) {
|
|
178
|
+
_context4.next = 4;
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
return _context4.abrupt("return", {});
|
|
182
|
+
case 4:
|
|
183
|
+
updateApi = genCustomApi(actions === null || actions === void 0 ? void 0 : actions.update);
|
|
184
|
+
return _context4.abrupt("return", updateApi(values));
|
|
185
|
+
case 8:
|
|
186
|
+
id = values === null || values === void 0 ? void 0 : values.id;
|
|
187
|
+
if (id) {
|
|
188
|
+
_context4.next = 12;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
message.error('请先获取数据');
|
|
192
|
+
return _context4.abrupt("return", {});
|
|
193
|
+
case 12:
|
|
194
|
+
return _context4.abrupt("return", updateNocobaseData({
|
|
195
|
+
key: name,
|
|
196
|
+
id: id,
|
|
197
|
+
data: values
|
|
198
|
+
}));
|
|
199
|
+
case 13:
|
|
200
|
+
case "end":
|
|
201
|
+
return _context4.stop();
|
|
202
|
+
}
|
|
203
|
+
}, _callee4);
|
|
204
|
+
}));
|
|
205
|
+
return function (_x3) {
|
|
206
|
+
return _ref7.apply(this, arguments);
|
|
207
|
+
};
|
|
208
|
+
}());
|
|
209
|
+
|
|
210
|
+
// 获取数据列表
|
|
211
|
+
var list = useMemoizedFn( /*#__PURE__*/function () {
|
|
212
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
|
|
213
|
+
var formatParams, actions, listApi;
|
|
214
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
215
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
216
|
+
case 0:
|
|
217
|
+
formatParams = formatListParams(params);
|
|
218
|
+
if (!isCustomApi) {
|
|
219
|
+
_context5.next = 11;
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
actions = getParsedActions();
|
|
223
|
+
if (actions !== null && actions !== void 0 && actions.list) {
|
|
224
|
+
_context5.next = 5;
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
return _context5.abrupt("return", []);
|
|
228
|
+
case 5:
|
|
229
|
+
listApi = genCustomApi(actions === null || actions === void 0 ? void 0 : actions.list);
|
|
230
|
+
_context5.t0 = formatListResult;
|
|
231
|
+
_context5.next = 9;
|
|
232
|
+
return listApi(formatParams);
|
|
233
|
+
case 9:
|
|
234
|
+
_context5.t1 = _context5.sent;
|
|
235
|
+
return _context5.abrupt("return", (0, _context5.t0)(_context5.t1));
|
|
236
|
+
case 11:
|
|
237
|
+
if (name) {
|
|
238
|
+
_context5.next = 13;
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
return _context5.abrupt("return", {});
|
|
242
|
+
case 13:
|
|
243
|
+
_context5.t2 = formatListResult;
|
|
244
|
+
_context5.next = 16;
|
|
245
|
+
return getNocobaseDataList({
|
|
246
|
+
key: name,
|
|
247
|
+
params: formatParams,
|
|
248
|
+
headers: getHeaders()
|
|
249
|
+
});
|
|
250
|
+
case 16:
|
|
251
|
+
_context5.t3 = _context5.sent;
|
|
252
|
+
return _context5.abrupt("return", (0, _context5.t2)(_context5.t3));
|
|
253
|
+
case 18:
|
|
254
|
+
case "end":
|
|
255
|
+
return _context5.stop();
|
|
256
|
+
}
|
|
257
|
+
}, _callee5);
|
|
258
|
+
}));
|
|
259
|
+
return function (_x4) {
|
|
260
|
+
return _ref8.apply(this, arguments);
|
|
261
|
+
};
|
|
262
|
+
}());
|
|
263
|
+
var destroy = useMemoizedFn( /*#__PURE__*/function () {
|
|
264
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(id) {
|
|
265
|
+
var actions, deleteApi;
|
|
266
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
267
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
268
|
+
case 0:
|
|
269
|
+
if (!isCustomApi) {
|
|
270
|
+
_context6.next = 6;
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
actions = getParsedActions();
|
|
274
|
+
if (actions.destroy) {
|
|
275
|
+
_context6.next = 4;
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
return _context6.abrupt("return", {});
|
|
279
|
+
case 4:
|
|
280
|
+
deleteApi = genCustomApi(actions === null || actions === void 0 ? void 0 : actions.destroy);
|
|
281
|
+
return _context6.abrupt("return", deleteApi({}));
|
|
282
|
+
case 6:
|
|
283
|
+
return _context6.abrupt("return", deleteNocobaseData(name, id, getHeaders()));
|
|
284
|
+
case 7:
|
|
285
|
+
case "end":
|
|
286
|
+
return _context6.stop();
|
|
287
|
+
}
|
|
288
|
+
}, _callee6);
|
|
289
|
+
}));
|
|
290
|
+
return function (_x5) {
|
|
291
|
+
return _ref9.apply(this, arguments);
|
|
292
|
+
};
|
|
293
|
+
}());
|
|
294
|
+
return {
|
|
295
|
+
create: create,
|
|
296
|
+
get: get,
|
|
297
|
+
update: update,
|
|
298
|
+
list: list,
|
|
299
|
+
destroy: destroy
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
export default useActions;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import ActionsContext from "../provider/actions/ActionsContext";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 组件上下文中操作的provider
|
|
6
|
+
* visible
|
|
7
|
+
* setVisible
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
var useCtxActions = function useCtxActions() {
|
|
11
|
+
var ctx = useContext(ActionsContext);
|
|
12
|
+
return ctx;
|
|
13
|
+
};
|
|
14
|
+
export default useCtxActions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import DataSourceContext from "../provider/fields/DataSourceContext";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 获取当前dataSource
|
|
6
|
+
*/
|
|
7
|
+
var useDataSource = function useDataSource() {
|
|
8
|
+
var config = useContext(DataSourceContext);
|
|
9
|
+
return config;
|
|
10
|
+
};
|
|
11
|
+
export default useDataSource;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Collection } from '../dataSourceForm/serve';
|
|
2
|
+
declare type Actions = Collection['actions'];
|
|
3
|
+
declare const useParseActionsVariable: () => {
|
|
4
|
+
parseActions: (actions: Actions, localVariables: Record<string, any>) => Record<string, any>;
|
|
5
|
+
};
|
|
6
|
+
export default useParseActionsVariable;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import { useMemoizedFn } from 'ahooks';
|
|
14
|
+
import useVariables from "./useVariables";
|
|
15
|
+
var useParseActionsVariable = function useParseActionsVariable() {
|
|
16
|
+
var _useVariables = useVariables(),
|
|
17
|
+
parseVariable = _useVariables.parseVariable;
|
|
18
|
+
var parseKeyValuePairs = useMemoizedFn(function (pairs, localVariables) {
|
|
19
|
+
return pairs === null || pairs === void 0 ? void 0 : pairs.map(function (_ref) {
|
|
20
|
+
var name = _ref.name,
|
|
21
|
+
value = _ref.value;
|
|
22
|
+
return {
|
|
23
|
+
name: name,
|
|
24
|
+
value: parseVariable === null || parseVariable === void 0 ? void 0 : parseVariable(value, localVariables)
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var parseActionsItem = function parseActionsItem(item, localVariables) {
|
|
29
|
+
var params = item.params,
|
|
30
|
+
headers = item.headers,
|
|
31
|
+
body = item.body,
|
|
32
|
+
path = item.path;
|
|
33
|
+
var parsedBody = !body ? body : Object.entries(body).reduce(function (acc, _ref2) {
|
|
34
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
35
|
+
key = _ref3[0],
|
|
36
|
+
value = _ref3[1];
|
|
37
|
+
acc[key] = parseVariable === null || parseVariable === void 0 ? void 0 : parseVariable(value, localVariables);
|
|
38
|
+
return acc;
|
|
39
|
+
}, {});
|
|
40
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
41
|
+
parsedPath: parseVariable === null || parseVariable === void 0 ? void 0 : parseVariable(path, localVariables),
|
|
42
|
+
params: parseKeyValuePairs(params, localVariables),
|
|
43
|
+
headers: parseKeyValuePairs(headers, localVariables),
|
|
44
|
+
body: parsedBody
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var parseActions = useMemoizedFn(function (actions, localVariables) {
|
|
48
|
+
if (!actions) return actions;
|
|
49
|
+
return Object.entries(actions).reduce(function (acc, _ref4) {
|
|
50
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
51
|
+
key = _ref5[0],
|
|
52
|
+
value = _ref5[1];
|
|
53
|
+
acc[key] = parseActionsItem(value, localVariables);
|
|
54
|
+
return acc;
|
|
55
|
+
}, {});
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
parseActions: parseActions
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export default useParseActionsVariable;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { isString } from '@pisell/utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 将 options 转换为 valueMap
|
|
6
|
+
* 使用在 ReadPretty Select Radio Checkbox 组件中
|
|
7
|
+
* @param options
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
var useValueMap = function useValueMap(options) {
|
|
11
|
+
return useMemo(function () {
|
|
12
|
+
return (options === null || options === void 0 ? void 0 : options.reduce(function (acc, item) {
|
|
13
|
+
var itemValue = item.value;
|
|
14
|
+
var itemLabel = item.label;
|
|
15
|
+
if (isString(itemValue) && isString(itemLabel)) {
|
|
16
|
+
acc[itemValue] = itemLabel;
|
|
17
|
+
}
|
|
18
|
+
return acc;
|
|
19
|
+
}, {})) || {};
|
|
20
|
+
}, [options]);
|
|
21
|
+
};
|
|
22
|
+
export default useValueMap;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["children"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import ActionsContext from "./ActionsContext";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 自定义请求的provider
|
|
15
|
+
* @param props
|
|
16
|
+
* @constructor
|
|
17
|
+
*/
|
|
18
|
+
var ActionsProvider = function ActionsProvider(props) {
|
|
19
|
+
var children = props.children,
|
|
20
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
21
|
+
var value = React.useMemo(function () {
|
|
22
|
+
return _objectSpread({}, rest);
|
|
23
|
+
}, [rest]);
|
|
24
|
+
return /*#__PURE__*/React.createElement(ActionsContext.Provider, {
|
|
25
|
+
value: value
|
|
26
|
+
}, children);
|
|
27
|
+
};
|
|
28
|
+
export default ActionsProvider;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ActionsItem } from '../../dataSourceForm/serve';
|
|
3
|
+
interface Field {
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
allowNull: boolean;
|
|
7
|
+
primaryKey: boolean;
|
|
8
|
+
unique: boolean;
|
|
9
|
+
autoIncrement: boolean;
|
|
10
|
+
description?: (null | string)[];
|
|
11
|
+
possibleTypes?: string[];
|
|
12
|
+
rawType: string;
|
|
13
|
+
interface: string;
|
|
14
|
+
uiSchema: UiSchema;
|
|
15
|
+
key?: string;
|
|
16
|
+
collectionName?: string;
|
|
17
|
+
collectionKey?: any;
|
|
18
|
+
dataSourceKey?: string;
|
|
19
|
+
defaultValue?: any;
|
|
20
|
+
}
|
|
21
|
+
interface UiSchema {
|
|
22
|
+
type?: string;
|
|
23
|
+
'x-component': string;
|
|
24
|
+
'x-component-props'?: Xcomponentprops;
|
|
25
|
+
'x-validator'?: string;
|
|
26
|
+
title: string;
|
|
27
|
+
default?: any;
|
|
28
|
+
enum?: any[];
|
|
29
|
+
}
|
|
30
|
+
interface Xcomponentprops {
|
|
31
|
+
style?: Style;
|
|
32
|
+
autoSize?: AutoSize;
|
|
33
|
+
stringMode?: boolean;
|
|
34
|
+
step?: string;
|
|
35
|
+
dateFormat?: string;
|
|
36
|
+
showTime?: boolean;
|
|
37
|
+
}
|
|
38
|
+
interface AutoSize {
|
|
39
|
+
minRows: number;
|
|
40
|
+
}
|
|
41
|
+
interface Style {
|
|
42
|
+
width: string;
|
|
43
|
+
}
|
|
44
|
+
export declare type ActionTypes = 'list' | 'get' | 'update' | 'create' | 'destroy';
|
|
45
|
+
export declare type DataSourceType = {
|
|
46
|
+
actions: {
|
|
47
|
+
get: ActionsItem;
|
|
48
|
+
update: ActionsItem;
|
|
49
|
+
create: ActionsItem;
|
|
50
|
+
delete: ActionsItem;
|
|
51
|
+
list: ActionsItem;
|
|
52
|
+
};
|
|
53
|
+
headerDataSource: string;
|
|
54
|
+
dataSourceKey: string;
|
|
55
|
+
filterTargetKey: string;
|
|
56
|
+
introspected: boolean;
|
|
57
|
+
isCustomApi: boolean;
|
|
58
|
+
key: string;
|
|
59
|
+
logging: boolean;
|
|
60
|
+
name: string;
|
|
61
|
+
title: string;
|
|
62
|
+
titleField: string;
|
|
63
|
+
types: ActionTypes[];
|
|
64
|
+
fields: Field[];
|
|
65
|
+
options: {
|
|
66
|
+
apiType: string;
|
|
67
|
+
baseUrl: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export interface DataSourceContextType {
|
|
71
|
+
dataSource: DataSourceType;
|
|
72
|
+
children?: React.ReactNode;
|
|
73
|
+
}
|
|
74
|
+
export declare const DataSourceContext: import("react").Context<DataSourceContextType>;
|
|
75
|
+
export default DataSourceContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DataSourceContextType } from './DataSourceContext';
|
|
3
|
+
/**
|
|
4
|
+
* @title: DataSource Provider
|
|
5
|
+
* @description: 提供页面配置的数据源
|
|
6
|
+
*/
|
|
7
|
+
declare const DataSourceProvider: React.FC<DataSourceContextType>;
|
|
8
|
+
export default DataSourceProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import DataSourceContext from "./DataSourceContext";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @title: DataSource Provider
|
|
6
|
+
* @description: 提供页面配置的数据源
|
|
7
|
+
*/
|
|
8
|
+
var DataSourceProvider = function DataSourceProvider(props) {
|
|
9
|
+
var children = props.children,
|
|
10
|
+
dataSource = props.dataSource;
|
|
11
|
+
var value = useMemo(function () {
|
|
12
|
+
return {
|
|
13
|
+
dataSource: dataSource
|
|
14
|
+
};
|
|
15
|
+
}, [dataSource]);
|
|
16
|
+
return /*#__PURE__*/React.createElement(DataSourceContext.Provider, {
|
|
17
|
+
value: value
|
|
18
|
+
}, children);
|
|
19
|
+
};
|
|
20
|
+
export default DataSourceProvider;
|