@pisell/materials 6.4.6 → 6.4.8
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 +7 -7
- package/build/lowcode/preview.js +150 -150
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +22 -27
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +23 -28
- package/dist/umd/materials.min.css +1 -0
- package/dist/umd/materials.min.js +1 -0
- package/dist/umd/static/DotsSix.57d66266.svg +1 -0
- package/dist/umd/static/arrow-left.e542294f.svg +1 -0
- package/dist/umd/static/arrow-right.763f03e0.svg +1 -0
- package/dist/umd/static/filter-lines.04a54ae9.svg +1 -0
- package/dist/umd/static/help-circle.31c9be40.svg +1 -0
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +1 -0
- package/es/components/appVersionControl/index.d.ts +0 -1
- package/es/components/auto-complete-number/index.d.ts +0 -1
- package/es/components/badge/index.d.ts +0 -1
- package/es/components/batch-editor/fields/index.d.ts +0 -1
- package/es/components/batch-editor/index.d.ts +1 -0
- package/es/components/calendar/index.d.ts +0 -1
- package/es/components/cardPro/index.d.ts +3 -0
- package/es/components/checkbox/index.d.ts +0 -1
- package/es/components/classicLayout/index.d.ts +0 -1
- package/es/components/colorPicker/index.d.ts +0 -1
- package/es/components/config-provider/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +11 -4
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -3
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +6 -7
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -4
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +92 -6
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
- package/es/components/dataSourceComponents/fields/ColorPicker/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/IconSelect/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +24 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/TimePicker/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Translation/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +5 -5
- package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +0 -3
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +5 -18
- package/es/components/date-picker/index.d.ts +1 -0
- package/es/components/dropdown/index.d.ts +0 -1
- package/es/components/filter/components/items/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/es/components/filter/components/items/text/index.d.ts +0 -1
- package/es/components/filter/types.d.ts +1 -0
- package/es/components/iconfont/index.js +1 -1
- package/es/components/page/index.d.ts +1 -3
- package/es/components/page/index.js +2 -4
- package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
- package/es/components/pisellCard/index.d.ts +0 -1
- package/es/components/pisellDatePicker/index.d.ts +0 -1
- package/es/components/pisellToast/index.d.ts +1 -0
- package/es/components/pisellToast/index.js +1 -0
- package/es/components/pisellToast/squareToast/index.js +28 -0
- package/es/components/pisellToast/squareToast/index.less +60 -0
- package/es/components/pisellToast/squareToast/methods.js +136 -0
- package/es/components/pisellToast/squareToast/renderImperatively.js +165 -0
- package/es/components/pisellToast/squareToast/toast.js +60 -0
- package/es/components/pisellUpload/index.d.ts +0 -1
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +73 -5
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
- package/es/components/productCard/cartSkuCard/index.js +2 -11
- package/es/components/productCard/components/Divider/index.d.ts +0 -1
- package/es/components/productCard/components/Header/DeleteButton/index.d.ts +3 -0
- package/es/components/productCard/components/Time/components/Like/index.d.ts +0 -1
- package/es/components/productCard/components/Time/index.d.ts +0 -1
- package/es/components/radio/index.d.ts +0 -1
- package/es/components/segmented/index.d.ts +0 -1
- package/es/components/select-time/RightPanel/index.d.ts +0 -1
- package/es/components/skeleton/index.d.ts +0 -1
- package/es/components/slider/index.d.ts +0 -1
- package/es/components/sort/components/InlineMenu/index.d.ts +0 -1
- package/es/components/table/Actions/component/ViewMode/index.d.ts +0 -1
- package/es/components/table/Summary/index.d.ts +0 -1
- package/es/components/table/Table/fields/date/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/date/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/image/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/image/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/index.d.ts +3 -2
- package/es/components/table/Table/fields/link/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/link/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/number/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/number/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/numberRange/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/numberRange/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/oldRangePicker/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/oldRangePicker/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/oldRangePicker/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/pSwitch/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/pSwitch/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/rangePicker/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/rangePicker/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/rangePicker/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/search/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/search/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/select/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/select/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/select/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/text/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/index.d.ts +1 -0
- package/es/components/table/Table/fields/treeSelect/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/treeSelect/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/treeSelect/Sort/index.d.ts +0 -1
- package/es/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/Table/utils.js +22 -1
- package/es/components/table/TableFilter/SortIcon.d.ts +0 -1
- package/es/components/table/hooks/useTableSetting.d.ts +3 -4
- package/es/components/table/hooks/useTableSetting.js +113 -5
- package/es/components/table/index.js +14 -3
- package/es/components/table/types.d.ts +268 -0
- package/es/components/time-picker/index.d.ts +0 -1
- package/es/components/upload/index.d.ts +0 -1
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -1
- package/es/components/virtual-keyboard/Time/utils.d.ts +0 -1
- package/es/components/walletCard/Guest/index.d.ts +0 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/components/appVersionControl/index.d.ts +0 -1
- package/lib/components/auto-complete-number/index.d.ts +0 -1
- package/lib/components/badge/index.d.ts +0 -1
- package/lib/components/batch-editor/fields/index.d.ts +0 -1
- package/lib/components/batch-editor/index.d.ts +1 -0
- package/lib/components/calendar/index.d.ts +0 -1
- package/lib/components/cardPro/index.d.ts +3 -0
- package/lib/components/checkbox/index.d.ts +0 -1
- package/lib/components/classicLayout/index.d.ts +0 -1
- package/lib/components/colorPicker/index.d.ts +0 -1
- package/lib/components/config-provider/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +8 -2
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -3
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +6 -7
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -4
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +78 -7
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
- package/lib/components/dataSourceComponents/fields/ColorPicker/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/IconSelect/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +24 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/TimePicker/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Translation/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +5 -5
- package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +0 -3
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +10 -20
- package/lib/components/date-picker/index.d.ts +1 -0
- package/lib/components/dropdown/index.d.ts +0 -1
- package/lib/components/filter/components/items/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/index.d.ts +0 -1
- package/lib/components/filter/types.d.ts +1 -0
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/page/index.d.ts +1 -3
- package/lib/components/page/index.js +2 -3
- package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
- package/lib/components/pisellCard/index.d.ts +0 -1
- package/lib/components/pisellDatePicker/index.d.ts +0 -1
- package/lib/components/pisellToast/index.d.ts +1 -0
- package/lib/components/pisellToast/index.js +7 -1
- package/lib/components/pisellToast/squareToast/index.js +58 -0
- package/lib/components/pisellToast/squareToast/index.less +60 -0
- package/lib/components/pisellToast/squareToast/methods.js +150 -0
- package/lib/components/pisellToast/squareToast/renderImperatively.js +148 -0
- package/lib/components/pisellToast/squareToast/toast.js +88 -0
- package/lib/components/pisellUpload/index.d.ts +0 -1
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +45 -11
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
- package/lib/components/productCard/cartSkuCard/index.js +2 -13
- package/lib/components/productCard/components/Divider/index.d.ts +0 -1
- package/lib/components/productCard/components/Header/DeleteButton/index.d.ts +3 -0
- package/lib/components/productCard/components/Time/components/Like/index.d.ts +0 -1
- package/lib/components/productCard/components/Time/index.d.ts +0 -1
- package/lib/components/radio/index.d.ts +0 -1
- package/lib/components/segmented/index.d.ts +0 -1
- package/lib/components/select-time/RightPanel/index.d.ts +0 -1
- package/lib/components/skeleton/index.d.ts +0 -1
- package/lib/components/slider/index.d.ts +0 -1
- package/lib/components/sort/components/InlineMenu/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ViewMode/index.d.ts +0 -1
- package/lib/components/table/Summary/index.d.ts +0 -1
- package/lib/components/table/Table/fields/date/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/date/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/image/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/image/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/index.d.ts +3 -2
- package/lib/components/table/Table/fields/link/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/link/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/number/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/number/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/numberRange/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/numberRange/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/oldRangePicker/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/oldRangePicker/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/oldRangePicker/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/pSwitch/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/pSwitch/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/rangePicker/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/rangePicker/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/rangePicker/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/search/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/search/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/select/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/select/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/select/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/text/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/index.d.ts +1 -0
- package/lib/components/table/Table/fields/treeSelect/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/treeSelect/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/treeSelect/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/Table/utils.js +18 -1
- package/lib/components/table/TableFilter/SortIcon.d.ts +0 -1
- package/lib/components/table/hooks/useTableSetting.d.ts +3 -4
- package/lib/components/table/hooks/useTableSetting.js +114 -4
- package/lib/components/table/index.js +12 -1
- package/lib/components/table/types.d.ts +268 -0
- package/lib/components/time-picker/index.d.ts +0 -1
- package/lib/components/upload/index.d.ts +0 -1
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -1
- package/lib/components/virtual-keyboard/Time/utils.d.ts +0 -1
- package/lib/components/walletCard/Guest/index.d.ts +0 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -0
- package/lowcode/data-source-table/meta.ts +239 -0
- package/lowcode/table/meta.ts +104 -0
- package/package.json +11 -11
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +0 -3
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/es/components/pisell-config-provider/index.d.ts +0 -13
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +0 -3
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -6
- package/es/components/virtual-keyboard/Amount/types.d.ts +0 -44
- package/es/components/walletCard/index.d.ts +0 -67
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +0 -3
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/lib/components/pisell-config-provider/index.d.ts +0 -13
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +0 -3
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -6
- package/lib/components/virtual-keyboard/Amount/types.d.ts +0 -44
- package/lib/components/walletCard/index.d.ts +0 -67
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M8 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM8 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM8 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.707 4.293a1 1 0 0 1 0 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l5.293 5.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L16.586 13H5a1 1 0 1 1 0-2h11.586l-5.293-5.293a1 1 0 0 1 0-1.414Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 6a1 1 0 0 1 1-1h18a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1Zm3 6a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1Zm3 6a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12Zm11.258-3.976a2 2 0 0 0-2.225 1.308 1 1 0 1 1-1.886-.664 4 4 0 0 1 7.773 1.333c0 1.53-1.135 2.54-1.945 3.081a8.044 8.044 0 0 1-1.686.848l-.035.013-.011.003-.004.002h-.002L11.92 13l.316.949a1 1 0 0 1-.633-1.897l.016-.006.074-.027a6.051 6.051 0 0 0 1.172-.6c.69-.46 1.055-.95 1.055-1.419v-.001a2 2 0 0 0-1.662-1.975ZM11 17a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H12a1 1 0 0 1-1-1Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.293 3.293a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L8 6.414V20a1 1 0 1 1-2 0V6.414L3.707 8.707a1 1 0 0 1-1.414-1.414l4-4ZM16 17.586V4a1 1 0 1 1 2 0v13.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 1.414-1.414L16 17.586Z"/></svg>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["columns", "dataSource", "operationContent"];
|
|
2
|
+
var _excluded = ["columns", "dataSource", "operationContent", "currentSettingKey"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
5
5
|
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); } }
|
|
@@ -29,6 +29,7 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
29
29
|
var propsColumns = props.columns,
|
|
30
30
|
dataSource = props.dataSource,
|
|
31
31
|
operationContent = props.operationContent,
|
|
32
|
+
currentSettingKey = props.currentSettingKey,
|
|
32
33
|
others = _objectWithoutProperties(props, _excluded);
|
|
33
34
|
var tableRef = useRef(null);
|
|
34
35
|
var componentId = useComponentId(props);
|
|
@@ -45,6 +46,9 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
45
46
|
}
|
|
46
47
|
return originData;
|
|
47
48
|
}, [originData, __designMode]);
|
|
49
|
+
var formatCurrentSettingKey = useMemo(function () {
|
|
50
|
+
return currentSettingKey || props.__id || "";
|
|
51
|
+
}, [currentSettingKey]);
|
|
48
52
|
var _useDataSourceKey = useDataSourceKey(),
|
|
49
53
|
dataSourceKey = _useDataSourceKey.dataSourceKey,
|
|
50
54
|
dataSourceKeyRef = _useDataSourceKey.dataSourceKeyRef;
|
|
@@ -60,12 +64,13 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
60
64
|
containerProps = _useDrawerState.containerProps,
|
|
61
65
|
Container = _useDrawerState.Container,
|
|
62
66
|
drawerContent = _useDrawerState.drawerContent;
|
|
63
|
-
var _useTableQuery = useTableQuery(props),
|
|
67
|
+
var _useTableQuery = useTableQuery(props, formatCurrentSettingKey),
|
|
64
68
|
queryPageConfig = _useTableQuery.queryPageConfig,
|
|
65
69
|
handleValuesChange = _useTableQuery.handleValuesChange,
|
|
66
70
|
refreshData = _useTableQuery.refreshData,
|
|
67
71
|
handleFilterChange = _useTableQuery.handleFilterChange,
|
|
68
|
-
refreshCurrentPage = _useTableQuery.refreshCurrentPage
|
|
72
|
+
refreshCurrentPage = _useTableQuery.refreshCurrentPage,
|
|
73
|
+
getInitialValues = _useTableQuery.getInitialValues;
|
|
69
74
|
var handleAllValuesChange = function handleAllValuesChange(changedValues, values) {
|
|
70
75
|
var _props$onValuesChange;
|
|
71
76
|
props === null || props === void 0 || (_props$onValuesChange = props.onValuesChange) === null || _props$onValuesChange === void 0 || _props$onValuesChange.call(props, changedValues, values);
|
|
@@ -137,7 +142,8 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
137
142
|
closeDrawer: closeDrawer,
|
|
138
143
|
refreshData: refreshData,
|
|
139
144
|
handleFilterChange: handleFilterChange,
|
|
140
|
-
tableRef: tableRef
|
|
145
|
+
tableRef: tableRef,
|
|
146
|
+
getInitialValues: getInitialValues
|
|
141
147
|
});
|
|
142
148
|
useImperativeHandle(ref, function () {
|
|
143
149
|
if (tableRef.current) {
|
|
@@ -151,6 +157,7 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
151
157
|
return /*#__PURE__*/React.createElement(TableSettingProvider, null, /*#__PURE__*/React.createElement(Table, _extends({
|
|
152
158
|
ref: tableRef
|
|
153
159
|
}, others, transformProps, {
|
|
160
|
+
currentSettingKey: formatCurrentSettingKey,
|
|
154
161
|
dataSource: (data === null || data === void 0 ? void 0 : data.data) || [],
|
|
155
162
|
loading: list === null || list === void 0 ? void 0 : list.loading,
|
|
156
163
|
onValuesChange: handleAllValuesChange
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import './index.less';
|
|
3
2
|
interface BaseFilterItem {
|
|
4
3
|
name?: string;
|
|
@@ -22,6 +21,7 @@ interface FilterProps {
|
|
|
22
21
|
placeholder: string;
|
|
23
22
|
key: string;
|
|
24
23
|
};
|
|
24
|
+
getInitialValues?: () => Record<string, any>;
|
|
25
25
|
}
|
|
26
26
|
declare const Filter: (props: FilterProps) => JSX.Element;
|
|
27
27
|
export default Filter;
|
|
@@ -37,7 +37,8 @@ var Filter = function Filter(props) {
|
|
|
37
37
|
handleValuesChange = props.handleValuesChange,
|
|
38
38
|
search = props.search,
|
|
39
39
|
filterBy = props.filterBy,
|
|
40
|
-
show = props.show
|
|
40
|
+
show = props.show,
|
|
41
|
+
getInitialValues = props.getInitialValues;
|
|
41
42
|
var _Form$useForm = Form.useForm(),
|
|
42
43
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
43
44
|
form = _Form$useForm2[0];
|
|
@@ -149,6 +150,9 @@ var Filter = function Filter(props) {
|
|
|
149
150
|
allowClear: true
|
|
150
151
|
}) : null;
|
|
151
152
|
}, [search]);
|
|
153
|
+
var initialValues = useMemo(function () {
|
|
154
|
+
return getInitialValues === null || getInitialValues === void 0 ? void 0 : getInitialValues();
|
|
155
|
+
}, [search, filterBy]);
|
|
152
156
|
return /*#__PURE__*/React.createElement(Form, {
|
|
153
157
|
labelCol: {
|
|
154
158
|
span: 0
|
|
@@ -157,7 +161,8 @@ var Filter = function Filter(props) {
|
|
|
157
161
|
size: "large",
|
|
158
162
|
layout: "inline",
|
|
159
163
|
className: "filter-form-wrapper",
|
|
160
|
-
onValuesChange: onValuesChange
|
|
164
|
+
onValuesChange: onValuesChange,
|
|
165
|
+
initialValues: initialValues
|
|
161
166
|
}, searchDom, filterDom, show && sortButtonShow && /*#__PURE__*/React.createElement(FilterButton, {
|
|
162
167
|
value: list,
|
|
163
168
|
quickFilterMaxLength: quickFilterMaxLength,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { Drawer } from 'antd';
|
|
3
2
|
import { OperationItem } from '../type';
|
|
4
3
|
declare const useDrawerState: (operationContent?: {
|
|
@@ -9,7 +8,7 @@ declare const useDrawerState: (operationContent?: {
|
|
|
9
8
|
openDrawer: (item: OperationItem) => void;
|
|
10
9
|
closeDrawer: () => void;
|
|
11
10
|
drawerContent: import("react").ReactNode;
|
|
12
|
-
Container: {
|
|
11
|
+
Container: typeof Drawer | {
|
|
13
12
|
(props: import("../../../pisellModal").PisellModalProps): JSX.Element;
|
|
14
13
|
confirm: (props: import("../../../pisellModal/components/functions").PisellModalFuncProps) => {
|
|
15
14
|
destroy: () => void;
|
|
@@ -33,7 +32,7 @@ declare const useDrawerState: (operationContent?: {
|
|
|
33
32
|
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
34
33
|
};
|
|
35
34
|
Information: (props: import("../../../pisellModal/components/Information").InformationProps) => JSX.Element;
|
|
36
|
-
}
|
|
35
|
+
};
|
|
37
36
|
containerProps: {};
|
|
38
37
|
};
|
|
39
38
|
export default useDrawerState;
|
|
@@ -9,6 +9,7 @@ interface UseTablePropsProps {
|
|
|
9
9
|
refreshData: () => void;
|
|
10
10
|
handleFilterChange: (changedFields: any, allFields: any) => void;
|
|
11
11
|
tableRef: any;
|
|
12
|
+
getInitialValues: () => Record<string, any>;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* 处理table的props
|
|
@@ -17,6 +18,7 @@ interface UseTablePropsProps {
|
|
|
17
18
|
* @returns
|
|
18
19
|
*/
|
|
19
20
|
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
21
|
+
currentComponentId: any;
|
|
20
22
|
title: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
21
23
|
pagination: {
|
|
22
24
|
total: number;
|
|
@@ -28,9 +30,11 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
28
30
|
columns: import("./useColumns").Column[];
|
|
29
31
|
subTitle: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
30
32
|
buttons: any[] | null;
|
|
31
|
-
filter:
|
|
33
|
+
filter: any;
|
|
32
34
|
onRow: (record: any) => any;
|
|
33
35
|
actionButtons: any[] | null;
|
|
36
|
+
__id?: string | undefined;
|
|
37
|
+
currentSettingKey?: string | undefined;
|
|
34
38
|
titleButtons?: {
|
|
35
39
|
show: boolean;
|
|
36
40
|
maxCount: number;
|
|
@@ -42,12 +46,6 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
42
46
|
items: OperationItem[];
|
|
43
47
|
} | undefined;
|
|
44
48
|
operation?: {
|
|
45
|
-
/**
|
|
46
|
-
* 处理table的props
|
|
47
|
-
* 转换title
|
|
48
|
-
* @param props
|
|
49
|
-
* @returns
|
|
50
|
-
*/
|
|
51
49
|
show: boolean;
|
|
52
50
|
title: string;
|
|
53
51
|
width: number;
|
|
@@ -94,5 +92,6 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
94
92
|
create?: Record<string, any> | undefined;
|
|
95
93
|
destroy?: Record<string, any> | undefined;
|
|
96
94
|
} | undefined;
|
|
95
|
+
localSettings?: import("../../../table/types").LocalSettingsType | undefined;
|
|
97
96
|
};
|
|
98
97
|
export default useTableProps;
|
|
@@ -35,7 +35,8 @@ var useTableProps = function useTableProps(props) {
|
|
|
35
35
|
closeDrawer = props.closeDrawer,
|
|
36
36
|
refreshData = props.refreshData,
|
|
37
37
|
handleFilterChange = props.handleFilterChange,
|
|
38
|
-
tableRef = props.tableRef
|
|
38
|
+
tableRef = props.tableRef,
|
|
39
|
+
getInitialValues = props.getInitialValues;
|
|
39
40
|
var propsTitle = originProps.title,
|
|
40
41
|
propsSubTitle = originProps.subTitle,
|
|
41
42
|
titleButtons = originProps.titleButtons,
|
|
@@ -45,7 +46,9 @@ var useTableProps = function useTableProps(props) {
|
|
|
45
46
|
search = originProps.search,
|
|
46
47
|
clickToDetail = originProps.clickToDetail,
|
|
47
48
|
propsOnRow = originProps.onRow,
|
|
48
|
-
filterBy = originProps.filterBy
|
|
49
|
+
filterBy = originProps.filterBy,
|
|
50
|
+
currentSettingKey = originProps.currentSettingKey,
|
|
51
|
+
__id = originProps.__id;
|
|
49
52
|
var _ref = operation || {},
|
|
50
53
|
items = _ref.items,
|
|
51
54
|
show = _ref.show,
|
|
@@ -279,12 +282,15 @@ var useTableProps = function useTableProps(props) {
|
|
|
279
282
|
if (!(propsFilter !== null && propsFilter !== void 0 && propsFilter.show) && !(search !== null && search !== void 0 && search.show)) {
|
|
280
283
|
return null;
|
|
281
284
|
}
|
|
282
|
-
|
|
285
|
+
var dom = /*#__PURE__*/React.createElement(Filter, _extends({}, propsFilter, {
|
|
283
286
|
componentId: componentId,
|
|
284
287
|
search: search,
|
|
285
288
|
handleValuesChange: handleFilterChange,
|
|
286
|
-
filterBy: filterBy
|
|
289
|
+
filterBy: filterBy,
|
|
290
|
+
getInitialValues: getInitialValues
|
|
287
291
|
}));
|
|
292
|
+
dom.__proto__.items = propsFilter === null || propsFilter === void 0 ? void 0 : propsFilter.items;
|
|
293
|
+
return dom;
|
|
288
294
|
}, [propsFilter, search]);
|
|
289
295
|
var onRow = useMemoizedFn(function (record) {
|
|
290
296
|
if (!(clickToDetail !== null && clickToDetail !== void 0 && clickToDetail.show)) {
|
|
@@ -315,6 +321,7 @@ var useTableProps = function useTableProps(props) {
|
|
|
315
321
|
});
|
|
316
322
|
});
|
|
317
323
|
return _objectSpread(_objectSpread({}, originProps), {}, {
|
|
324
|
+
currentComponentId: componentId,
|
|
318
325
|
title: title,
|
|
319
326
|
pagination: pagination,
|
|
320
327
|
columns: columns,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DataSourceTableProps } from '../type';
|
|
3
2
|
declare type Params = {
|
|
4
3
|
pagination?: {
|
|
@@ -12,7 +11,7 @@ declare type Params = {
|
|
|
12
11
|
sortBy: string;
|
|
13
12
|
};
|
|
14
13
|
};
|
|
15
|
-
declare const useTableQuery: (props: DataSourceTableProps) => {
|
|
14
|
+
declare const useTableQuery: (props: DataSourceTableProps, currentSettingHash: string) => {
|
|
16
15
|
queryPageConfig: {
|
|
17
16
|
page: number;
|
|
18
17
|
pageSize: number;
|
|
@@ -29,5 +28,6 @@ declare const useTableQuery: (props: DataSourceTableProps) => {
|
|
|
29
28
|
refreshData: () => void;
|
|
30
29
|
handleFilterChange: (changedFields: any, allFields: any) => void;
|
|
31
30
|
refreshCurrentPage: () => void;
|
|
31
|
+
getInitialValues: () => Record<string, any>;
|
|
32
32
|
};
|
|
33
33
|
export default useTableQuery;
|
|
@@ -10,13 +10,24 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
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
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import { useState } from 'react';
|
|
13
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
14
14
|
import { useMemoizedFn } from 'ahooks';
|
|
15
|
-
|
|
15
|
+
import { getCurrentViewModeFromLocalStorage, getTableSettingByCurrentViewMode, setTableSettingToLocalStorage } from "../../../table/Table/utils";
|
|
16
|
+
var useTableQuery = function useTableQuery(props, currentSettingHash) {
|
|
16
17
|
var _tabs$items, _tabs$items2;
|
|
17
18
|
var filterBy = props.filterBy,
|
|
18
19
|
sortBy = props.sortBy,
|
|
19
|
-
tabs = props.tabs
|
|
20
|
+
tabs = props.tabs,
|
|
21
|
+
localSettings = props.localSettings;
|
|
22
|
+
var tableId = useMemo(function () {
|
|
23
|
+
if (props.__designMode === 'design') {
|
|
24
|
+
return 'designMode-mock-table-id';
|
|
25
|
+
}
|
|
26
|
+
return (props === null || props === void 0 ? void 0 : props.currentComponentId) || props.__id;
|
|
27
|
+
}, [props.__id, props.__designMode, props === null || props === void 0 ? void 0 : props.currentComponentId]);
|
|
28
|
+
var currentViewMode = useMemo(function () {
|
|
29
|
+
return getCurrentViewModeFromLocalStorage(tableId) || 'grid';
|
|
30
|
+
}, [tableId]);
|
|
20
31
|
|
|
21
32
|
// 分页配置
|
|
22
33
|
var _useState = useState({
|
|
@@ -28,19 +39,50 @@ var useTableQuery = function useTableQuery(props) {
|
|
|
28
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
40
|
queryPageConfig = _useState2[0],
|
|
30
41
|
setQueryPageConfig = _useState2[1];
|
|
42
|
+
var getInitialValues = useMemoizedFn(function () {
|
|
43
|
+
try {
|
|
44
|
+
if (!tableId) return {};
|
|
45
|
+
var setting = getTableSettingByCurrentViewMode(tableId, currentViewMode);
|
|
46
|
+
console.log('setting22', setting);
|
|
47
|
+
return (setting === null || setting === void 0 ? void 0 : setting.filters) || {};
|
|
48
|
+
} catch (e) {
|
|
49
|
+
return {};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// 初始读取本地 filters(若开启本地记忆且 scope 包含 filters)
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
var _localSettings$scope;
|
|
56
|
+
if (!tableId) return;
|
|
57
|
+
var enable = !!(localSettings !== null && localSettings !== void 0 && localSettings.enable && (_localSettings$scope = localSettings.scope) !== null && _localSettings$scope !== void 0 && _localSettings$scope.includes('filters'));
|
|
58
|
+
if (!enable) return;
|
|
59
|
+
var setting = getTableSettingByCurrentViewMode(tableId, currentViewMode);
|
|
60
|
+
var persisted = (setting === null || setting === void 0 ? void 0 : setting.filters) || {};
|
|
61
|
+
if (persisted && Object.keys(persisted).length > 0) {
|
|
62
|
+
setQueryPageConfig(function (prev) {
|
|
63
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
64
|
+
filter: _objectSpread(_objectSpread({}, prev.filter), persisted)
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, [tableId, currentViewMode, JSON.stringify(localSettings)]);
|
|
31
69
|
|
|
32
70
|
// 分页变化
|
|
33
71
|
var handleValuesChange = useMemoizedFn(function (params, allParams) {
|
|
72
|
+
var _localSettings$scope2;
|
|
34
73
|
var _ref = params.pagination || {},
|
|
35
74
|
page = _ref.page,
|
|
36
75
|
size = _ref.size;
|
|
76
|
+
var nextFilterForSave = null;
|
|
37
77
|
setQueryPageConfig(function (prev) {
|
|
38
78
|
var sort = prev.sort || sortBy;
|
|
39
79
|
var filter = prev.filter;
|
|
40
80
|
if ("tabs" in params) {
|
|
41
81
|
var _params$tabs, _params$tabs2;
|
|
42
82
|
sort = ((_params$tabs = params.tabs) === null || _params$tabs === void 0 ? void 0 : _params$tabs.sortBy) || sortBy || "";
|
|
43
|
-
|
|
83
|
+
var tabsFilter = ((_params$tabs2 = params.tabs) === null || _params$tabs2 === void 0 ? void 0 : _params$tabs2.filterBy) || {};
|
|
84
|
+
filter = _objectSpread(_objectSpread({}, prev.filter), tabsFilter);
|
|
85
|
+
nextFilterForSave = filter;
|
|
44
86
|
}
|
|
45
87
|
if ("order_by" in params) {
|
|
46
88
|
var _allParams$tabs;
|
|
@@ -53,14 +95,57 @@ var useTableQuery = function useTableQuery(props) {
|
|
|
53
95
|
filter: filter
|
|
54
96
|
});
|
|
55
97
|
});
|
|
98
|
+
|
|
99
|
+
// 当 tabs 变化导致 filter 变更时,同步写入本地(遵循 localSettings)
|
|
100
|
+
var enable = !!(localSettings !== null && localSettings !== void 0 && localSettings.enable && (_localSettings$scope2 = localSettings.scope) !== null && _localSettings$scope2 !== void 0 && _localSettings$scope2.includes('filters'));
|
|
101
|
+
if (enable && tableId && nextFilterForSave) {
|
|
102
|
+
var excluded = new Set((localSettings === null || localSettings === void 0 ? void 0 : localSettings.excludedFilterFields) || []);
|
|
103
|
+
var filtered = {};
|
|
104
|
+
Object.keys(nextFilterForSave).forEach(function (k) {
|
|
105
|
+
if (!excluded.has(k)) {
|
|
106
|
+
filtered[k] = nextFilterForSave[k];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
setTableSettingToLocalStorage({
|
|
110
|
+
tableId: tableId,
|
|
111
|
+
tableSettingObj: {
|
|
112
|
+
filters: filtered
|
|
113
|
+
},
|
|
114
|
+
currentViewMode: currentViewMode,
|
|
115
|
+
currentSettingHash: currentSettingHash
|
|
116
|
+
});
|
|
117
|
+
}
|
|
56
118
|
});
|
|
57
119
|
var handleFilterChange = useMemoizedFn(function (changedFields, allFields) {
|
|
120
|
+
var _localSettings$scope3;
|
|
121
|
+
var nextFilter = _objectSpread({}, allFields);
|
|
58
122
|
setQueryPageConfig(function (prev) {
|
|
59
123
|
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
60
124
|
page: 1,
|
|
61
|
-
filter: _objectSpread(_objectSpread(_objectSpread({}, prev.filter),
|
|
125
|
+
filter: _objectSpread(_objectSpread(_objectSpread({}, prev.filter), nextFilter), filterBy || {})
|
|
62
126
|
});
|
|
63
127
|
});
|
|
128
|
+
|
|
129
|
+
// 写入本地(仅当开启本地记忆且 scope 包含 filters)
|
|
130
|
+
var enable = !!(localSettings !== null && localSettings !== void 0 && localSettings.enable && (_localSettings$scope3 = localSettings.scope) !== null && _localSettings$scope3 !== void 0 && _localSettings$scope3.includes('filters'));
|
|
131
|
+
if (enable && tableId) {
|
|
132
|
+
// 按 excludedFilterFields 过滤写入
|
|
133
|
+
var excluded = new Set((localSettings === null || localSettings === void 0 ? void 0 : localSettings.excludedFilterFields) || []);
|
|
134
|
+
var filtered = {};
|
|
135
|
+
Object.keys(nextFilter || {}).forEach(function (k) {
|
|
136
|
+
if (!excluded.has(k)) {
|
|
137
|
+
filtered[k] = nextFilter[k];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
setTableSettingToLocalStorage({
|
|
141
|
+
tableId: tableId,
|
|
142
|
+
tableSettingObj: {
|
|
143
|
+
filters: filtered
|
|
144
|
+
},
|
|
145
|
+
currentViewMode: currentViewMode,
|
|
146
|
+
currentSettingHash: currentSettingHash
|
|
147
|
+
});
|
|
148
|
+
}
|
|
64
149
|
});
|
|
65
150
|
var refreshData = useMemoizedFn(function () {
|
|
66
151
|
setQueryPageConfig(function (prev) {
|
|
@@ -80,7 +165,8 @@ var useTableQuery = function useTableQuery(props) {
|
|
|
80
165
|
handleValuesChange: handleValuesChange,
|
|
81
166
|
refreshData: refreshData,
|
|
82
167
|
handleFilterChange: handleFilterChange,
|
|
83
|
-
refreshCurrentPage: refreshCurrentPage
|
|
168
|
+
refreshCurrentPage: refreshCurrentPage,
|
|
169
|
+
getInitialValues: getInitialValues
|
|
84
170
|
};
|
|
85
171
|
};
|
|
86
172
|
export default useTableQuery;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ColumnType } from 'antd/es/table';
|
|
3
|
+
import { LocalSettingsType } from '../../table/types';
|
|
4
|
+
import { DataSourceType } from '../provider/dataSource/DataSourceContext';
|
|
5
|
+
export declare type OperationItem = {
|
|
6
|
+
label?: string;
|
|
7
|
+
openMode: 'modal' | 'drawer' | 'custom';
|
|
8
|
+
openContentSize: 'small' | 'middle' | 'large';
|
|
9
|
+
openTitle: string;
|
|
10
|
+
actionType: 'detail' | 'edit' | 'delete' | 'custom';
|
|
11
|
+
key: string;
|
|
12
|
+
buttonProps?: any;
|
|
13
|
+
onClick?: (record: any) => void;
|
|
14
|
+
afterClose?: () => void;
|
|
15
|
+
};
|
|
16
|
+
export interface DataSourceTableProps {
|
|
17
|
+
__id?: string;
|
|
18
|
+
currentComponentId?: string;
|
|
19
|
+
currentSettingKey?: string;
|
|
20
|
+
title?: string | React.ReactNode | (() => React.ReactNode);
|
|
21
|
+
subTitle?: string | React.ReactNode | (() => React.ReactNode);
|
|
22
|
+
titleButtons?: {
|
|
23
|
+
show: boolean;
|
|
24
|
+
maxCount: number;
|
|
25
|
+
items: OperationItem[];
|
|
26
|
+
};
|
|
27
|
+
tableButtons?: {
|
|
28
|
+
show: boolean;
|
|
29
|
+
maxCount: number;
|
|
30
|
+
items: OperationItem[];
|
|
31
|
+
};
|
|
32
|
+
buttons?: any[];
|
|
33
|
+
operation?: {
|
|
34
|
+
show: boolean;
|
|
35
|
+
title: string;
|
|
36
|
+
width: number;
|
|
37
|
+
align: 'left' | 'center' | 'right';
|
|
38
|
+
fixed: 'left' | 'right' | false;
|
|
39
|
+
type: 'link' | 'button';
|
|
40
|
+
items: OperationItem[];
|
|
41
|
+
};
|
|
42
|
+
operationContent?: {
|
|
43
|
+
[key: string]: React.ReactNode;
|
|
44
|
+
};
|
|
45
|
+
dataSource: DataSourceType;
|
|
46
|
+
columns: ColumnType<any>[];
|
|
47
|
+
filter: any;
|
|
48
|
+
search?: {
|
|
49
|
+
show: boolean;
|
|
50
|
+
placeholder: string;
|
|
51
|
+
};
|
|
52
|
+
__designMode: string;
|
|
53
|
+
componentId: string;
|
|
54
|
+
clickToDetail?: {
|
|
55
|
+
show: boolean;
|
|
56
|
+
useCustomAction: boolean;
|
|
57
|
+
actionType: string;
|
|
58
|
+
openMode: 'modal' | 'drawer';
|
|
59
|
+
openContentSize: 'small' | 'middle' | 'large';
|
|
60
|
+
openTitle: string;
|
|
61
|
+
key: string;
|
|
62
|
+
};
|
|
63
|
+
onRow?: any;
|
|
64
|
+
filterBy?: Record<string, any>;
|
|
65
|
+
sortBy: string;
|
|
66
|
+
tabs?: {
|
|
67
|
+
show: boolean;
|
|
68
|
+
type: string;
|
|
69
|
+
items: {
|
|
70
|
+
name: string;
|
|
71
|
+
filterBy: Record<string, any>;
|
|
72
|
+
sortBy: string;
|
|
73
|
+
}[];
|
|
74
|
+
};
|
|
75
|
+
onValuesChange?: (changedValues: any, values: any) => void;
|
|
76
|
+
extraParams?: {
|
|
77
|
+
list?: Record<string, any>;
|
|
78
|
+
get?: Record<string, any>;
|
|
79
|
+
update?: Record<string, any>;
|
|
80
|
+
create?: Record<string, any>;
|
|
81
|
+
destroy?: Record<string, any>;
|
|
82
|
+
};
|
|
83
|
+
localSettings?: LocalSettingsType;
|
|
84
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取nocobase数据列表
|
|
3
|
+
*/
|
|
4
|
+
export declare const getCountryDataList: () => Promise<any>;
|
|
5
|
+
export interface Country {
|
|
6
|
+
id: number;
|
|
7
|
+
name: {
|
|
8
|
+
en: string;
|
|
9
|
+
"zh-CN": string;
|
|
10
|
+
"zh-HK": string;
|
|
11
|
+
original: string;
|
|
12
|
+
};
|
|
13
|
+
code: string;
|
|
14
|
+
calling_code: string;
|
|
15
|
+
currency_code: string;
|
|
16
|
+
sort: number;
|
|
17
|
+
status: string;
|
|
18
|
+
created_at: string;
|
|
19
|
+
updated_at: string;
|
|
20
|
+
prefix: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const useCountries: () => {
|
|
23
|
+
data: Country[];
|
|
24
|
+
};
|