@pisell/materials 3.3.85 → 3.3.86
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 +6 -6
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +21 -21
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +21 -21
- package/es/components/Pagination/index.d.ts +4 -5
- package/es/components/Pagination/index.js +77 -59
- package/es/components/Pagination/index.less +13 -7
- package/es/components/PisellFields/index.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +2 -3
- package/es/components/filter/components/Dropdown/index.js +6 -2
- package/es/components/filter/components/FilterButton/index.js +19 -4
- package/es/components/filter/components/FilterButton/types.d.ts +8 -0
- package/es/components/filter/components/FilterItem/AsyncOptionsSelectWrapper.d.ts +21 -0
- package/es/components/filter/components/FilterItem/AsyncOptionsSelectWrapper.js +90 -0
- package/es/components/filter/components/FilterItem/index.d.ts +3 -3
- package/es/components/filter/components/FilterItem/index.js +138 -7
- package/es/components/filter/components/FilterItem/index.less +90 -0
- package/es/components/filter/types.d.ts +4 -2
- package/es/components/pisellBatchActionBar/PisellBatchActionBar.js +38 -29
- package/es/components/pisellCurrency/PisellCurrency.less +163 -25
- package/es/components/pisellCurrency/PisellCurrency.stories.js +1 -1
- package/es/components/pisellCurrency/index.d.ts +2 -1
- package/es/components/pisellCurrency/index.js +16 -1
- package/es/components/pisellDataSourceContainer/components/ColumnsSetting/index.d.ts +7 -1
- package/es/components/pisellDataSourceContainer/components/ColumnsSetting/index.js +30 -3
- package/es/components/pisellDataSourceContainer/components/ColumnsSetting/utils.d.ts +28 -0
- package/es/components/pisellDataSourceContainer/components/ColumnsSetting/utils.js +68 -0
- package/es/components/pisellDataSourceContainer/components/Table/index.d.ts +1 -0
- package/es/components/pisellDataSourceContainer/components/Table/index.js +5 -3
- package/es/components/pisellDataSourceContainer/components/Table/useColumns.d.ts +1 -0
- package/es/components/pisellDataSourceContainer/components/Table/useColumns.js +37 -15
- package/es/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +21 -15
- package/es/components/pisellDateTimeDisplay/PisellDateTimeDisplay.less +2 -1
- package/es/components/pisellDateTimeDisplay/hooks/useCurrentTime.js +6 -4
- package/es/components/pisellDateTimeDisplay/utils/localeUtils.d.ts +2 -2
- package/es/components/pisellDateTimeDisplay/utils/localeUtils.js +15 -4
- package/es/components/pisellDateTimeDisplay/utils/relativeDay.d.ts +1 -0
- package/es/components/pisellDateTimeDisplay/utils/relativeDay.js +4 -2
- package/es/components/pisellEmail/PisellEmail.less +119 -10
- package/es/components/pisellEmail/PisellEmail.stories.js +1 -1
- package/es/components/pisellEmail/index.d.ts +3 -1
- package/es/components/pisellEmail/index.js +17 -1
- package/es/components/pisellFilter/index.js +76 -10
- package/es/components/pisellFind/index.js +11 -2
- package/es/components/pisellGridPro/ToolBar/index.less +23 -0
- package/es/components/pisellGridPro/index.d.ts +4 -0
- package/es/components/pisellLongText/PisellLongText.less +72 -4
- package/es/components/pisellLongText/PisellLongText.stories.js +1 -1
- package/es/components/pisellLongText/index.d.ts +2 -1
- package/es/components/pisellLongText/index.js +16 -1
- package/es/components/pisellLookup/PisellLookup.js +18 -9
- package/es/components/pisellLookup/PisellLookup.less +39 -16
- package/es/components/pisellLookup/components/LookupTrigger.js +14 -4
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.less +159 -124
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.stories.js +1 -1
- package/es/components/pisellMultipleSelect/components/EditView.js +8 -2
- package/es/components/pisellMultipleSelect/components/ReadOnlyView.d.ts +1 -1
- package/es/components/pisellMultipleSelect/components/ReadOnlyView.js +15 -11
- package/es/components/pisellMultipleSelect/index.d.ts +2 -1
- package/es/components/pisellMultipleSelect/index.js +16 -1
- package/es/components/pisellNumber/PisellNumber.less +135 -17
- package/es/components/pisellNumber/PisellNumber.stories.js +1 -1
- package/es/components/pisellNumber/index.d.ts +2 -1
- package/es/components/pisellNumber/index.js +16 -1
- package/es/components/pisellPercent/PisellPercent.less +142 -24
- package/es/components/pisellPercent/PisellPercent.stories.js +1 -1
- package/es/components/pisellPercent/index.d.ts +2 -1
- package/es/components/pisellPercent/index.js +16 -1
- package/es/components/pisellPhone/PisellPhone.less +122 -27
- package/es/components/pisellPhone/PisellPhone.stories.js +1 -1
- package/es/components/pisellPhone/components/EditView.js +1 -1
- package/es/components/pisellPhone/components/ReadOnlyView.js +15 -6
- package/es/components/pisellPhone/index.d.ts +2 -1
- package/es/components/pisellPhone/index.js +16 -1
- package/es/components/pisellRating/PisellRating.less +20 -12
- package/es/components/pisellRating/PisellRating.stories.js +1 -1
- package/es/components/pisellRating/index.d.ts +2 -1
- package/es/components/pisellRating/index.js +16 -1
- package/es/components/pisellRecordBoard/PisellRecordBoard.d.ts +8 -0
- package/es/components/pisellRecordBoard/PisellRecordBoard.js +243 -0
- package/es/components/pisellRecordBoard/PisellRecordBoard.stories.d.ts +81 -0
- package/es/components/pisellRecordBoard/PisellRecordBoard.stories.js +2358 -0
- package/es/components/pisellRecordBoard/context/RecordBoardContext.js +2 -0
- package/es/components/pisellRecordBoard/context/RecordBoardProvider.js +13 -0
- package/es/components/pisellRecordBoard/hooks/useRecordBoardContext.js +29 -0
- package/es/components/pisellRecordBoard/index.d.ts +35 -0
- package/es/components/pisellRecordBoard/index.js +23 -0
- package/es/components/pisellRecordBoard/layouts/CardLayout/CardList.js +36 -0
- package/es/components/pisellRecordBoard/layouts/CardLayout/index.js +20 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +14 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.js +242 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.less +100 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/index.d.ts +13 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/index.js +20 -0
- package/es/components/pisellRecordBoard/shellFrame/BatchActionBar/index.d.ts +8 -0
- package/es/components/pisellRecordBoard/shellFrame/BatchActionBar/index.js +90 -0
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.d.ts +15 -0
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.js +138 -0
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.d.ts +8 -0
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +66 -0
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.less +2 -0
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +14 -0
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.js +66 -0
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.less +78 -0
- package/es/components/pisellRecordBoard/shellFrame/Search/index.d.ts +10 -0
- package/es/components/pisellRecordBoard/shellFrame/Search/index.js +41 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +112 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +11 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +215 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.d.ts +17 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.js +77 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.d.ts +16 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +65 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.less +41 -0
- package/es/components/pisellRecordBoard/shellFrame/index.d.ts +26 -0
- package/es/components/pisellRecordBoard/shellFrame/index.js +104 -0
- package/es/components/pisellRecordBoard/types.js +1 -0
- package/es/components/pisellRecordBoard/utils/recordBoardColumns.d.ts +41 -0
- package/es/components/pisellRecordBoard/utils/recordBoardColumns.js +508 -0
- package/es/components/pisellRecordBoard/utils/withRecordBoard.js +27 -0
- package/es/components/pisellShellFrame/PisellShellFrame.js +107 -0
- package/es/components/pisellShellFrame/PisellShellFrame.less +78 -0
- package/es/components/pisellShellFrame/PisellShellFrame.stories.js +195 -0
- package/es/components/pisellShellFrame/index.js +1 -0
- package/es/components/pisellShellFrame/types.js +1 -0
- package/es/components/pisellSingleLineText/PisellSingleLineText.stories.js +1 -1
- package/es/components/pisellSingleLineText/index.d.ts +2 -1
- package/es/components/pisellSingleLineText/index.js +16 -1
- package/es/components/pisellSingleSelect/PisellSingleSelect.less +103 -46
- package/es/components/pisellSingleSelect/PisellSingleSelect.stories.js +1 -1
- package/es/components/pisellSingleSelect/components/EditView.js +8 -2
- package/es/components/pisellSingleSelect/components/ReadOnlyView.d.ts +1 -1
- package/es/components/pisellSingleSelect/components/ReadOnlyView.js +10 -6
- package/es/components/pisellSingleSelect/index.d.ts +2 -1
- package/es/components/pisellSingleSelect/index.js +16 -1
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +6 -3
- package/es/components/pisellUrl/PisellUrl.less +120 -11
- package/es/components/pisellUrl/PisellUrl.stories.js +1 -1
- package/es/components/pisellUrl/index.d.ts +3 -1
- package/es/components/pisellUrl/index.js +17 -1
- package/es/components/productCard/components/Packages/utils.d.ts +1 -1
- package/es/components/select/index.less +18 -2
- package/es/components/sort/index.js +25 -3
- package/es/components/table/Table/fields/select/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/index.d.ts +1 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/index.d.ts +6 -2
- package/es/index.js +2 -0
- package/es/locales/en-US.d.ts +36 -0
- package/es/locales/en-US.js +50 -2
- package/es/locales/index.js +2 -2
- package/es/locales/ja.d.ts +2 -0
- package/es/locales/ja.js +2 -0
- package/es/locales/pt.d.ts +2 -0
- package/es/locales/pt.js +2 -0
- package/es/locales/zh-CN.d.ts +36 -0
- package/es/locales/zh-CN.js +54 -6
- package/es/locales/zh-TW.d.ts +36 -0
- package/es/locales/zh-TW.js +54 -6
- package/es/utils/tagColor.js +39 -0
- package/lib/components/Pagination/index.d.ts +4 -5
- package/lib/components/Pagination/index.js +44 -21
- package/lib/components/Pagination/index.less +13 -7
- package/lib/components/PisellFields/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +2 -3
- package/lib/components/filter/components/Dropdown/index.js +9 -2
- package/lib/components/filter/components/FilterButton/index.js +14 -3
- package/lib/components/filter/components/FilterButton/types.d.ts +8 -0
- package/lib/components/filter/components/FilterItem/AsyncOptionsSelectWrapper.d.ts +21 -0
- package/lib/components/filter/components/FilterItem/AsyncOptionsSelectWrapper.js +69 -0
- package/lib/components/filter/components/FilterItem/index.d.ts +3 -3
- package/lib/components/filter/components/FilterItem/index.js +133 -4
- package/lib/components/filter/components/FilterItem/index.less +90 -0
- package/lib/components/filter/types.d.ts +4 -2
- package/lib/components/pisellBatchActionBar/PisellBatchActionBar.js +26 -23
- package/lib/components/pisellCurrency/PisellCurrency.less +163 -25
- package/lib/components/pisellCurrency/PisellCurrency.stories.js +1 -1
- package/lib/components/pisellCurrency/index.d.ts +2 -1
- package/lib/components/pisellCurrency/index.js +7 -0
- package/lib/components/pisellDataSourceContainer/components/ColumnsSetting/index.d.ts +7 -1
- package/lib/components/pisellDataSourceContainer/components/ColumnsSetting/index.js +18 -2
- package/lib/components/pisellDataSourceContainer/components/ColumnsSetting/utils.d.ts +28 -0
- package/lib/components/pisellDataSourceContainer/components/ColumnsSetting/utils.js +81 -0
- package/lib/components/pisellDataSourceContainer/components/Table/index.d.ts +1 -0
- package/lib/components/pisellDataSourceContainer/components/Table/index.js +3 -1
- package/lib/components/pisellDataSourceContainer/components/Table/useColumns.d.ts +1 -0
- package/lib/components/pisellDataSourceContainer/components/Table/useColumns.js +25 -14
- package/lib/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +17 -11
- package/lib/components/pisellDateTimeDisplay/PisellDateTimeDisplay.less +2 -1
- package/lib/components/pisellDateTimeDisplay/hooks/useCurrentTime.js +7 -1
- package/lib/components/pisellDateTimeDisplay/utils/localeUtils.d.ts +2 -2
- package/lib/components/pisellDateTimeDisplay/utils/localeUtils.js +10 -2
- package/lib/components/pisellDateTimeDisplay/utils/relativeDay.d.ts +1 -0
- package/lib/components/pisellDateTimeDisplay/utils/relativeDay.js +2 -1
- package/lib/components/pisellEmail/PisellEmail.less +119 -10
- package/lib/components/pisellEmail/PisellEmail.stories.js +1 -1
- package/lib/components/pisellEmail/index.d.ts +3 -1
- package/lib/components/pisellEmail/index.js +10 -2
- package/lib/components/pisellFilter/index.js +79 -8
- package/lib/components/pisellFind/index.js +11 -2
- package/lib/components/pisellGridPro/ToolBar/index.less +23 -0
- package/lib/components/pisellGridPro/index.d.ts +4 -0
- package/lib/components/pisellLongText/PisellLongText.less +72 -4
- package/lib/components/pisellLongText/PisellLongText.stories.js +1 -1
- package/lib/components/pisellLongText/index.d.ts +2 -1
- package/lib/components/pisellLongText/index.js +7 -0
- package/lib/components/pisellLookup/PisellLookup.js +12 -6
- package/lib/components/pisellLookup/PisellLookup.less +39 -16
- package/lib/components/pisellLookup/components/LookupTrigger.js +9 -3
- package/lib/components/pisellMultipleSelect/PisellMultipleSelect.less +159 -124
- package/lib/components/pisellMultipleSelect/PisellMultipleSelect.stories.js +1 -1
- package/lib/components/pisellMultipleSelect/components/EditView.js +4 -1
- package/lib/components/pisellMultipleSelect/components/ReadOnlyView.d.ts +1 -1
- package/lib/components/pisellMultipleSelect/components/ReadOnlyView.js +29 -1
- package/lib/components/pisellMultipleSelect/index.d.ts +2 -1
- package/lib/components/pisellMultipleSelect/index.js +7 -0
- package/lib/components/pisellNumber/PisellNumber.less +135 -17
- package/lib/components/pisellNumber/PisellNumber.stories.js +1 -1
- package/lib/components/pisellNumber/index.d.ts +2 -1
- package/lib/components/pisellNumber/index.js +7 -0
- package/lib/components/pisellPercent/PisellPercent.less +142 -24
- package/lib/components/pisellPercent/PisellPercent.stories.js +1 -1
- package/lib/components/pisellPercent/index.d.ts +2 -1
- package/lib/components/pisellPercent/index.js +7 -0
- package/lib/components/pisellPhone/PisellPhone.less +122 -27
- package/lib/components/pisellPhone/PisellPhone.stories.js +1 -1
- package/lib/components/pisellPhone/components/EditView.js +1 -1
- package/lib/components/pisellPhone/components/ReadOnlyView.js +18 -4
- package/lib/components/pisellPhone/index.d.ts +2 -1
- package/lib/components/pisellPhone/index.js +7 -0
- package/lib/components/pisellRating/PisellRating.less +20 -12
- package/lib/components/pisellRating/PisellRating.stories.js +1 -1
- package/lib/components/pisellRating/index.d.ts +2 -1
- package/lib/components/pisellRating/index.js +7 -0
- package/lib/components/pisellRecordBoard/PisellRecordBoard.d.ts +8 -0
- package/lib/components/pisellRecordBoard/PisellRecordBoard.js +263 -0
- package/lib/components/pisellRecordBoard/PisellRecordBoard.stories.d.ts +81 -0
- package/lib/components/pisellRecordBoard/PisellRecordBoard.stories.js +1673 -0
- package/lib/components/pisellRecordBoard/context/RecordBoardContext.js +30 -0
- package/lib/components/pisellRecordBoard/context/RecordBoardProvider.js +46 -0
- package/lib/components/pisellRecordBoard/hooks/useRecordBoardContext.js +47 -0
- package/lib/components/pisellRecordBoard/index.d.ts +35 -0
- package/lib/components/pisellRecordBoard/index.js +59 -0
- package/lib/components/pisellRecordBoard/layouts/CardLayout/CardList.js +46 -0
- package/lib/components/pisellRecordBoard/layouts/CardLayout/index.js +46 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +14 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.js +264 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.less +100 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/index.d.ts +13 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/index.js +46 -0
- package/lib/components/pisellRecordBoard/shellFrame/BatchActionBar/index.d.ts +8 -0
- package/lib/components/pisellRecordBoard/shellFrame/BatchActionBar/index.js +108 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.d.ts +15 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.js +173 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.d.ts +8 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +100 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.less +2 -0
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +14 -0
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.js +90 -0
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.less +78 -0
- package/lib/components/pisellRecordBoard/shellFrame/Search/index.d.ts +10 -0
- package/lib/components/pisellRecordBoard/shellFrame/Search/index.js +53 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +112 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +11 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +247 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.d.ts +17 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.js +93 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.d.ts +16 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +85 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.less +41 -0
- package/lib/components/pisellRecordBoard/shellFrame/index.d.ts +26 -0
- package/lib/components/pisellRecordBoard/shellFrame/index.js +137 -0
- package/lib/components/pisellRecordBoard/types.js +17 -0
- package/lib/components/pisellRecordBoard/utils/recordBoardColumns.d.ts +41 -0
- package/lib/components/pisellRecordBoard/utils/recordBoardColumns.js +365 -0
- package/lib/components/pisellRecordBoard/utils/withRecordBoard.js +49 -0
- package/lib/components/pisellShellFrame/PisellShellFrame.js +113 -0
- package/lib/components/pisellShellFrame/PisellShellFrame.less +78 -0
- package/lib/components/pisellShellFrame/PisellShellFrame.stories.js +129 -0
- package/lib/components/pisellShellFrame/index.js +40 -0
- package/lib/components/pisellShellFrame/types.js +17 -0
- package/lib/components/pisellSingleLineText/PisellSingleLineText.stories.js +1 -1
- package/lib/components/pisellSingleLineText/index.d.ts +2 -1
- package/lib/components/pisellSingleLineText/index.js +7 -0
- package/lib/components/pisellSingleSelect/PisellSingleSelect.less +103 -46
- package/lib/components/pisellSingleSelect/PisellSingleSelect.stories.js +1 -1
- package/lib/components/pisellSingleSelect/components/EditView.js +4 -1
- package/lib/components/pisellSingleSelect/components/ReadOnlyView.d.ts +1 -1
- package/lib/components/pisellSingleSelect/components/ReadOnlyView.js +12 -9
- package/lib/components/pisellSingleSelect/index.d.ts +2 -1
- package/lib/components/pisellSingleSelect/index.js +7 -0
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +6 -2
- package/lib/components/pisellUrl/PisellUrl.less +120 -11
- package/lib/components/pisellUrl/PisellUrl.stories.js +1 -1
- package/lib/components/pisellUrl/index.d.ts +3 -1
- package/lib/components/pisellUrl/index.js +10 -2
- package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
- package/lib/components/select/index.less +18 -2
- package/lib/components/sort/index.js +13 -3
- package/lib/components/table/Table/fields/select/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/index.d.ts +1 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/index.d.ts +6 -2
- package/lib/index.js +6 -0
- package/lib/locales/en-US.d.ts +36 -0
- package/lib/locales/en-US.js +42 -2
- package/lib/locales/index.js +2 -2
- package/lib/locales/ja.d.ts +2 -0
- package/lib/locales/ja.js +2 -0
- package/lib/locales/pt.d.ts +2 -0
- package/lib/locales/pt.js +2 -0
- package/lib/locales/zh-CN.d.ts +36 -0
- package/lib/locales/zh-CN.js +46 -6
- package/lib/locales/zh-TW.d.ts +36 -0
- package/lib/locales/zh-TW.js +46 -6
- package/lib/utils/tagColor.js +60 -0
- package/lowcode/auto-resize-text/meta.ts +1 -1
- package/package.json +3 -3
- package/es/components/PisellProcedure/PisellProcedure.stories.d.ts +0 -163
- package/es/components/PisellProcedure/index.d.ts +0 -5
- package/es/components/PisellSteps/PisellSteps.d.ts +0 -14
- package/es/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.d.ts +0 -7
- package/es/components/pisellDateTimeDisplay/formats/index.d.ts +0 -1
- package/es/components/pisellDateTimeDisplay/types.d.ts +0 -347
- package/es/components/pisellDateTimeDisplay/utils/formatTime.d.ts +0 -19
- package/es/components/pisellDateTimeDisplay/utils/getRefreshInterval.d.ts +0 -18
- package/es/components/pisellLookup/PisellLookup.d.ts +0 -4
- package/es/components/pisellLookup/PisellLookup.stories.d.ts +0 -129
- package/es/components/pisellLookup/components/HotWords.d.ts +0 -7
- package/es/components/pisellLookup/components/LookupAuxiliary.d.ts +0 -7
- package/es/components/pisellLookup/components/LookupResultHost.d.ts +0 -7
- package/es/components/pisellLookup/components/LookupTrigger.d.ts +0 -3
- package/es/components/pisellLookup/components/SearchHistory.d.ts +0 -7
- package/es/components/pisellLookup/components/SuggestWords.d.ts +0 -7
- package/es/components/pisellLookup/components/index.d.ts +0 -9
- package/es/components/pisellLookup/hooks/index.d.ts +0 -6
- package/es/components/pisellLookup/hooks/useSearchHistory.d.ts +0 -48
- package/es/components/pisellLookup/index.d.ts +0 -6
- package/es/components/pisellLookup/types.d.ts +0 -666
- package/es/components/pisellLookup/utils/index.d.ts +0 -5
- package/es/components/pisellLookup/utils/trigger.d.ts +0 -42
- package/es/components/pisellSort/type.d.ts +0 -7
- package/es/components/pisellTimeRangeDisplay/types.d.ts +0 -137
- package/es/components/pisellTimeRangeDisplay/utils/parseTimeRange.d.ts +0 -23
- package/es/components/sort/types.d.ts +0 -20
- package/es/components/virtualInput/index.d.ts +0 -29
- package/es/hooks/useThemeTokens.d.ts +0 -7
- package/lib/components/PisellProcedure/PisellProcedure.stories.d.ts +0 -163
- package/lib/components/PisellProcedure/index.d.ts +0 -5
- package/lib/components/PisellSteps/PisellSteps.d.ts +0 -14
- package/lib/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.d.ts +0 -7
- package/lib/components/pisellDateTimeDisplay/formats/index.d.ts +0 -1
- package/lib/components/pisellDateTimeDisplay/types.d.ts +0 -347
- package/lib/components/pisellDateTimeDisplay/utils/formatTime.d.ts +0 -19
- package/lib/components/pisellDateTimeDisplay/utils/getRefreshInterval.d.ts +0 -18
- package/lib/components/pisellLookup/PisellLookup.d.ts +0 -4
- package/lib/components/pisellLookup/PisellLookup.stories.d.ts +0 -129
- package/lib/components/pisellLookup/components/HotWords.d.ts +0 -7
- package/lib/components/pisellLookup/components/LookupAuxiliary.d.ts +0 -7
- package/lib/components/pisellLookup/components/LookupResultHost.d.ts +0 -7
- package/lib/components/pisellLookup/components/LookupTrigger.d.ts +0 -3
- package/lib/components/pisellLookup/components/SearchHistory.d.ts +0 -7
- package/lib/components/pisellLookup/components/SuggestWords.d.ts +0 -7
- package/lib/components/pisellLookup/components/index.d.ts +0 -9
- package/lib/components/pisellLookup/hooks/index.d.ts +0 -6
- package/lib/components/pisellLookup/hooks/useSearchHistory.d.ts +0 -48
- package/lib/components/pisellLookup/index.d.ts +0 -6
- package/lib/components/pisellLookup/types.d.ts +0 -666
- package/lib/components/pisellLookup/utils/index.d.ts +0 -5
- package/lib/components/pisellLookup/utils/trigger.d.ts +0 -42
- package/lib/components/pisellSort/type.d.ts +0 -7
- package/lib/components/pisellTimeRangeDisplay/types.d.ts +0 -137
- package/lib/components/pisellTimeRangeDisplay/utils/parseTimeRange.d.ts +0 -23
- package/lib/components/sort/types.d.ts +0 -20
- package/lib/components/virtualInput/index.d.ts +0 -29
- package/lib/hooks/useThemeTokens.d.ts +0 -7
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
* PisellCurrency 组件导出
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { getText } from "../../locales";
|
|
6
|
+
import PisellCurrency from "./PisellCurrency";
|
|
7
|
+
|
|
8
|
+
/** RecordBoard 列 type 联动排序:内置 0 → 9 / 9 → 0 */
|
|
9
|
+
PisellCurrency.SortOptions = {
|
|
10
|
+
getSortItems: function getSortItems(fieldKey) {
|
|
11
|
+
return [{
|
|
12
|
+
key: "".concat(fieldKey, ":asc"),
|
|
13
|
+
label: getText('sort-0-9')
|
|
14
|
+
}, {
|
|
15
|
+
key: "".concat(fieldKey, ":desc"),
|
|
16
|
+
label: getText('sort-9-0')
|
|
17
|
+
}];
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export { PisellCurrency };
|
|
6
21
|
|
|
7
22
|
// 公共类型从 types 中重新导出,方便使用
|
|
@@ -6,6 +6,7 @@ export declare const COLUMNS_SHARED_STATE_KEYS: {
|
|
|
6
6
|
};
|
|
7
7
|
export interface ColumnsSettingProps {
|
|
8
8
|
scopeId?: string;
|
|
9
|
+
__id?: string;
|
|
9
10
|
}
|
|
10
11
|
export interface ColumnSettingItem {
|
|
11
12
|
key: string;
|
|
@@ -16,7 +17,12 @@ export interface ColumnSettingItem {
|
|
|
16
17
|
sortIndex?: number;
|
|
17
18
|
fixed?: 'left' | 'right' | boolean;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
/**
|
|
21
|
+
* 暴露给父组件的 ref 方法
|
|
22
|
+
*/
|
|
23
|
+
export interface ColumnsSettingRef {
|
|
24
|
+
}
|
|
25
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<ColumnsSettingProps & DataSourceContainerContextType & React.RefAttributes<ColumnsSettingRef> & {
|
|
20
26
|
refId?: string | undefined;
|
|
21
27
|
}, "ref"> & React.RefAttributes<any>>;
|
|
22
28
|
export default _default;
|
|
@@ -4,9 +4,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
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; }
|
|
5
5
|
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; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { forwardRef, useState, useEffect } from 'react';
|
|
7
|
+
import React, { forwardRef, useState, useEffect, useImperativeHandle } from 'react';
|
|
8
8
|
import withContainer from "../../utils/withContainer";
|
|
9
9
|
import ColumnsSetting from "../../../table/Actions/component/ColumnsSetting";
|
|
10
|
+
import { saveColumnSettingToLocal } from "./utils";
|
|
10
11
|
export var COLUMNS_SHARED_STATE_KEYS = {
|
|
11
12
|
columnsValue: function columnsValue(instanceId) {
|
|
12
13
|
return "".concat(instanceId, ":columns:value");
|
|
@@ -15,14 +16,23 @@ export var COLUMNS_SHARED_STATE_KEYS = {
|
|
|
15
16
|
return "".concat(instanceId, ":columns:change");
|
|
16
17
|
}
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 暴露给父组件的 ref 方法
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
var WithColumnsSetting = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
19
25
|
var refManager = props.refManager,
|
|
20
26
|
_props$scopeId = props.scopeId,
|
|
21
|
-
scopeId = _props$scopeId === void 0 ? 'table' : _props$scopeId
|
|
27
|
+
scopeId = _props$scopeId === void 0 ? 'table' : _props$scopeId,
|
|
28
|
+
__id = props.__id;
|
|
22
29
|
var _useState = useState([]),
|
|
23
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
24
31
|
value = _useState2[0],
|
|
25
32
|
setValue = _useState2[1];
|
|
33
|
+
useImperativeHandle(ref, function () {
|
|
34
|
+
return {};
|
|
35
|
+
}, []);
|
|
26
36
|
useEffect(function () {
|
|
27
37
|
var unsubscribe = refManager.subscribeSharedState(COLUMNS_SHARED_STATE_KEYS.columnsValue(scopeId), setValue);
|
|
28
38
|
return unsubscribe;
|
|
@@ -31,6 +41,23 @@ var WithColumnsSetting = /*#__PURE__*/forwardRef(function (props) {
|
|
|
31
41
|
var typedValue = newValue;
|
|
32
42
|
setValue(typedValue);
|
|
33
43
|
refManager.setSharedState(COLUMNS_SHARED_STATE_KEYS.columnsChange(scopeId), typedValue);
|
|
44
|
+
if (__id) {
|
|
45
|
+
saveColumnSettingToLocal({
|
|
46
|
+
componentId: __id,
|
|
47
|
+
columnSetting: typedValue.map(function (col, index) {
|
|
48
|
+
var _col$sortIndex;
|
|
49
|
+
return {
|
|
50
|
+
key: col.key,
|
|
51
|
+
dataIndex: col.dataIndex,
|
|
52
|
+
title: col.title,
|
|
53
|
+
titleString: col.titleString,
|
|
54
|
+
isShow: col.isShow,
|
|
55
|
+
sortIndex: (_col$sortIndex = col.sortIndex) !== null && _col$sortIndex !== void 0 ? _col$sortIndex : index,
|
|
56
|
+
fixed: col.fixed
|
|
57
|
+
};
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
}
|
|
34
61
|
};
|
|
35
62
|
return /*#__PURE__*/React.createElement(ColumnsSetting, {
|
|
36
63
|
value: value,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 列设置工具:持久化复用 @pisell/utils 的 saveColumnSettingToLocal / getColumnSettingFromLocal;
|
|
3
|
+
* mergeColumnSettingSimple 为 Table 列与本地缓存的合并逻辑,保留在此。
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { getColumnSettingFromLocal, clearColumnSettingFromLocal } from '@pisell/utils';
|
|
7
|
+
export { getColumnSettingFromLocal, clearColumnSettingFromLocal };
|
|
8
|
+
/** 与 DataSourceContainer ColumnsSetting 调用处类型兼容的列设置项(含 React.ReactNode title) */
|
|
9
|
+
export interface ColumnSettingItemForSave {
|
|
10
|
+
key: string;
|
|
11
|
+
dataIndex: string;
|
|
12
|
+
title?: React.ReactNode;
|
|
13
|
+
titleString?: string;
|
|
14
|
+
isShow: boolean;
|
|
15
|
+
sortIndex?: number;
|
|
16
|
+
fixed?: 'left' | 'right' | boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const saveColumnSettingToLocal: (params: {
|
|
19
|
+
componentId: string;
|
|
20
|
+
columnSetting: ColumnSettingItemForSave[];
|
|
21
|
+
}) => void;
|
|
22
|
+
export declare const mergeColumnSettingSimple: ({ columns, componentId, }: {
|
|
23
|
+
columns: Record<string, any>[];
|
|
24
|
+
componentId?: string | undefined;
|
|
25
|
+
}) => {
|
|
26
|
+
isShow: any;
|
|
27
|
+
sortIndex: any;
|
|
28
|
+
}[];
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
/**
|
|
8
|
+
* 列设置工具:持久化复用 @pisell/utils 的 saveColumnSettingToLocal / getColumnSettingFromLocal;
|
|
9
|
+
* mergeColumnSettingSimple 为 Table 列与本地缓存的合并逻辑,保留在此。
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { saveColumnSettingToLocal as saveColumnSettingToLocalFromUtils, getColumnSettingFromLocal, clearColumnSettingFromLocal } from '@pisell/utils';
|
|
13
|
+
export { getColumnSettingFromLocal, clearColumnSettingFromLocal };
|
|
14
|
+
|
|
15
|
+
/** 与 DataSourceContainer ColumnsSetting 调用处类型兼容的列设置项(含 React.ReactNode title) */
|
|
16
|
+
|
|
17
|
+
export var saveColumnSettingToLocal = function saveColumnSettingToLocal(params) {
|
|
18
|
+
saveColumnSettingToLocalFromUtils({
|
|
19
|
+
componentId: params.componentId,
|
|
20
|
+
columnSetting: params.columnSetting
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
export var mergeColumnSettingSimple = function mergeColumnSettingSimple(_ref) {
|
|
24
|
+
var columns = _ref.columns,
|
|
25
|
+
componentId = _ref.componentId;
|
|
26
|
+
if (!componentId) {
|
|
27
|
+
return columns.map(function (item, index) {
|
|
28
|
+
var _item$isShow;
|
|
29
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
30
|
+
isShow: (_item$isShow = item.isShow) !== null && _item$isShow !== void 0 ? _item$isShow : true,
|
|
31
|
+
sortIndex: index
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
var cachedColumns = getColumnSettingFromLocal(componentId);
|
|
36
|
+
if (!cachedColumns || !Array.isArray(cachedColumns)) {
|
|
37
|
+
return columns.map(function (item, index) {
|
|
38
|
+
var _item$isShow2;
|
|
39
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
40
|
+
isShow: (_item$isShow2 = item.isShow) !== null && _item$isShow2 !== void 0 ? _item$isShow2 : true,
|
|
41
|
+
sortIndex: index
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
var cachedMap = new Map(cachedColumns.map(function (item) {
|
|
46
|
+
return [item.dataIndex, item];
|
|
47
|
+
}));
|
|
48
|
+
var mergedColumns = columns.map(function (item, index) {
|
|
49
|
+
var _item$isShow3;
|
|
50
|
+
var cached = cachedMap.get(item.dataIndex);
|
|
51
|
+
if (cached) {
|
|
52
|
+
var _cached$isShow, _cached$sortIndex;
|
|
53
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
54
|
+
isShow: (_cached$isShow = cached.isShow) !== null && _cached$isShow !== void 0 ? _cached$isShow : true,
|
|
55
|
+
sortIndex: (_cached$sortIndex = cached.sortIndex) !== null && _cached$sortIndex !== void 0 ? _cached$sortIndex : index
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
59
|
+
isShow: (_item$isShow3 = item.isShow) !== null && _item$isShow3 !== void 0 ? _item$isShow3 : true,
|
|
60
|
+
sortIndex: index
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
mergedColumns.sort(function (a, b) {
|
|
64
|
+
var _a$sortIndex, _b$sortIndex;
|
|
65
|
+
return ((_a$sortIndex = a.sortIndex) !== null && _a$sortIndex !== void 0 ? _a$sortIndex : 0) - ((_b$sortIndex = b.sortIndex) !== null && _b$sortIndex !== void 0 ? _b$sortIndex : 0);
|
|
66
|
+
});
|
|
67
|
+
return mergedColumns;
|
|
68
|
+
};
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { DataSourceContainerContextType } from '../../type';
|
|
3
3
|
declare const _default: React.ForwardRefExoticComponent<Omit<Partial<import("antd").TableProps<any>> & DataSourceContainerContextType & {
|
|
4
4
|
scopeId?: string | undefined;
|
|
5
|
+
__id?: string | undefined;
|
|
5
6
|
} & React.RefAttributes<unknown> & {
|
|
6
7
|
refId?: string | undefined;
|
|
7
8
|
}, "ref"> & React.RefAttributes<any>>;
|
|
@@ -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 = ["serverActions", "refManager", "columns", "scopeId"];
|
|
2
|
+
var _excluded = ["serverActions", "refManager", "columns", "scopeId", "__id"];
|
|
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -19,14 +19,16 @@ var WithTable = /*#__PURE__*/forwardRef(function (props) {
|
|
|
19
19
|
columns = props.columns,
|
|
20
20
|
_props$scopeId = props.scopeId,
|
|
21
21
|
scopeId = _props$scopeId === void 0 ? 'table' : _props$scopeId,
|
|
22
|
+
__id = props.__id,
|
|
22
23
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
23
24
|
var data = listAction.data,
|
|
24
25
|
loading = listAction.loading;
|
|
25
|
-
// 🔥 使用 useColumns hook
|
|
26
|
+
// 🔥 使用 useColumns hook 管理列状态(支持本地缓存)
|
|
26
27
|
var _useColumns = useColumns({
|
|
27
28
|
columns: columns || [],
|
|
28
29
|
scopeId: scopeId,
|
|
29
|
-
refManager: refManager
|
|
30
|
+
refManager: refManager,
|
|
31
|
+
__id: __id
|
|
30
32
|
}),
|
|
31
33
|
visibleColumns = _useColumns.visibleColumns;
|
|
32
34
|
return /*#__PURE__*/React.createElement(Table, _extends({}, otherProps, {
|
|
@@ -6,6 +6,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { useState, useEffect, useMemo } from 'react';
|
|
8
8
|
import { COLUMNS_SHARED_STATE_KEYS } from "../ColumnsSetting";
|
|
9
|
+
import { mergeColumnSettingSimple } from "../ColumnsSetting/utils";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* useColumns Hook 参数
|
|
@@ -14,7 +15,8 @@ import { COLUMNS_SHARED_STATE_KEYS } from "../ColumnsSetting";
|
|
|
14
15
|
var useColumns = function useColumns(params) {
|
|
15
16
|
var columns = params.columns,
|
|
16
17
|
scopeId = params.scopeId,
|
|
17
|
-
refManager = params.refManager
|
|
18
|
+
refManager = params.refManager,
|
|
19
|
+
__id = params.__id;
|
|
18
20
|
|
|
19
21
|
// 本地状态:存储列配置
|
|
20
22
|
var _useState = useState([]),
|
|
@@ -23,14 +25,30 @@ var useColumns = function useColumns(params) {
|
|
|
23
25
|
setColumnSettings = _useState2[1];
|
|
24
26
|
useEffect(function () {
|
|
25
27
|
if (!(columns !== null && columns !== void 0 && columns.length)) return;
|
|
26
|
-
|
|
28
|
+
|
|
29
|
+
// 🔄 合并本地缓存和默认配置
|
|
30
|
+
var mergedColumns = mergeColumnSettingSimple({
|
|
31
|
+
columns: columns.map(function (col, index) {
|
|
32
|
+
return {
|
|
33
|
+
key: col.key || col.dataIndex,
|
|
34
|
+
dataIndex: col.dataIndex,
|
|
35
|
+
title: col.title,
|
|
36
|
+
titleString: typeof col.title === 'string' ? col.title : col.dataIndex,
|
|
37
|
+
isShow: typeof col.isShow === 'boolean' ? col.isShow : true,
|
|
38
|
+
sortIndex: index,
|
|
39
|
+
fixed: col.fixed
|
|
40
|
+
};
|
|
41
|
+
}),
|
|
42
|
+
componentId: __id
|
|
43
|
+
});
|
|
44
|
+
var settings = mergedColumns.map(function (col) {
|
|
27
45
|
return {
|
|
28
|
-
key: col.key
|
|
46
|
+
key: col.key,
|
|
29
47
|
dataIndex: col.dataIndex,
|
|
30
48
|
title: col.title,
|
|
31
|
-
titleString:
|
|
32
|
-
isShow:
|
|
33
|
-
sortIndex:
|
|
49
|
+
titleString: col.titleString,
|
|
50
|
+
isShow: col.isShow,
|
|
51
|
+
sortIndex: col.sortIndex,
|
|
34
52
|
fixed: col.fixed
|
|
35
53
|
};
|
|
36
54
|
});
|
|
@@ -38,7 +56,7 @@ var useColumns = function useColumns(params) {
|
|
|
38
56
|
// 写入共享状态(使用统一的 key,供 ColumnsSetting 读取)
|
|
39
57
|
refManager.setSharedState(COLUMNS_SHARED_STATE_KEYS.columnsValue(scopeId), settings);
|
|
40
58
|
setColumnSettings(settings);
|
|
41
|
-
}, [columns, refManager, scopeId]);
|
|
59
|
+
}, [columns, refManager, scopeId, __id]);
|
|
42
60
|
|
|
43
61
|
/**
|
|
44
62
|
* 订阅:监听 ColumnsSetting 的修改
|
|
@@ -47,22 +65,26 @@ var useColumns = function useColumns(params) {
|
|
|
47
65
|
var unsubscribe = refManager.subscribeSharedState(COLUMNS_SHARED_STATE_KEYS.columnsChange(scopeId), setColumnSettings);
|
|
48
66
|
return unsubscribe;
|
|
49
67
|
}, [refManager, scopeId]);
|
|
50
|
-
|
|
51
|
-
if (!(columns !== null && columns !== void 0 && columns.length)) return
|
|
52
|
-
|
|
68
|
+
return useMemo(function () {
|
|
69
|
+
if (!(columns !== null && columns !== void 0 && columns.length)) return {
|
|
70
|
+
visibleColumns: []
|
|
71
|
+
};
|
|
72
|
+
if (!(columnSettings !== null && columnSettings !== void 0 && columnSettings.length)) return {
|
|
73
|
+
visibleColumns: columns
|
|
74
|
+
};
|
|
53
75
|
|
|
54
76
|
// 创建 dataIndex 到原始 column 的映射
|
|
55
77
|
var columnMap = new Map(columns.map(function (col) {
|
|
56
78
|
return [col.dataIndex, col];
|
|
57
79
|
}));
|
|
58
|
-
|
|
80
|
+
var visibleColumns = columnSettings.filter(function (setting) {
|
|
59
81
|
return setting.isShow;
|
|
60
82
|
}).map(function (setting) {
|
|
61
83
|
return columnMap.get(setting.dataIndex);
|
|
62
|
-
}).filter(Boolean);
|
|
84
|
+
}).filter(Boolean);
|
|
85
|
+
return {
|
|
86
|
+
visibleColumns: visibleColumns
|
|
87
|
+
};
|
|
63
88
|
}, [columns, columnSettings]);
|
|
64
|
-
return {
|
|
65
|
-
visibleColumns: visibleColumns
|
|
66
|
-
};
|
|
67
89
|
};
|
|
68
90
|
export default useColumns;
|
|
@@ -12,6 +12,7 @@ import { useCurrentTime } from "./hooks";
|
|
|
12
12
|
import { getRefreshInterval, isChinese as checkIsChinese, getRelativeDay, getRelativeDayLabel, getDayjsLocale } from "./utils";
|
|
13
13
|
import { TimeDisplay, DateDisplay, WeekdayDisplay } from "./components";
|
|
14
14
|
import { DATETIME_DISPLAY_FORMATS } from "./formats/dateTimeDisplayFormats";
|
|
15
|
+
import useEngineContext from "../../hooks/useEngineContext";
|
|
15
16
|
import "./PisellDateTimeDisplay.less";
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -42,8 +43,9 @@ import "./PisellDateTimeDisplay.less";
|
|
|
42
43
|
* />
|
|
43
44
|
*/
|
|
44
45
|
export var PisellDateTimeDisplay = function PisellDateTimeDisplay(props) {
|
|
45
|
-
var _ref, _presetSource$localeK;
|
|
46
|
-
var
|
|
46
|
+
var _context$engine, _ref, _presetSource$localeK;
|
|
47
|
+
var valueProp = props.value,
|
|
48
|
+
_props$layout = props.layout,
|
|
47
49
|
layout = _props$layout === void 0 ? 'horizontal' : _props$layout,
|
|
48
50
|
_props$textAlign = props.textAlign,
|
|
49
51
|
textAlign = _props$textAlign === void 0 ? 'center' : _props$textAlign,
|
|
@@ -67,9 +69,10 @@ export var PisellDateTimeDisplay = function PisellDateTimeDisplay(props) {
|
|
|
67
69
|
onClick = props.onClick,
|
|
68
70
|
className = props.className,
|
|
69
71
|
style = props.style;
|
|
70
|
-
|
|
72
|
+
var context = useEngineContext();
|
|
73
|
+
var resolvedLocale = locale || (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en';
|
|
71
74
|
// 多语言格式:formatByLocale 优先,否则用内置 DATETIME_DISPLAY_FORMATS;再与单项 props 合并(单项优先)
|
|
72
|
-
var localeKey = getDayjsLocale(
|
|
75
|
+
var localeKey = getDayjsLocale(resolvedLocale);
|
|
73
76
|
var baseLocale = localeKey.split('-')[0];
|
|
74
77
|
var presetSource = formatByLocale !== null && formatByLocale !== void 0 ? formatByLocale : DATETIME_DISPLAY_FORMATS;
|
|
75
78
|
var preset = (_ref = (_presetSource$localeK = presetSource[localeKey]) !== null && _presetSource$localeK !== void 0 ? _presetSource$localeK : presetSource[baseLocale]) !== null && _ref !== void 0 ? _ref : {};
|
|
@@ -81,17 +84,20 @@ export var PisellDateTimeDisplay = function PisellDateTimeDisplay(props) {
|
|
|
81
84
|
// 计算刷新间隔
|
|
82
85
|
var computedRefreshInterval = refreshInterval !== null && refreshInterval !== void 0 ? refreshInterval : getRefreshInterval(effectiveTimeFormat);
|
|
83
86
|
|
|
84
|
-
// 使用自定义 hook
|
|
87
|
+
// 使用自定义 hook 管理当前时间(仅在没有 value 时用于展示)
|
|
85
88
|
var currentTime = useCurrentTime({
|
|
86
89
|
refreshInterval: computedRefreshInterval,
|
|
87
|
-
disabled: disableAutoRefresh,
|
|
88
|
-
locale:
|
|
90
|
+
disabled: disableAutoRefresh || valueProp !== undefined,
|
|
91
|
+
locale: resolvedLocale,
|
|
89
92
|
onUpdate: onTimeUpdate
|
|
90
93
|
});
|
|
91
94
|
|
|
95
|
+
// 展示时间:传入 value 时用 value 并应用当前 locale,否则用已带 locale 的 currentTime
|
|
96
|
+
var displayTime = valueProp !== undefined && valueProp !== null ? dayjs(valueProp).locale(localeKey) : currentTime;
|
|
97
|
+
|
|
92
98
|
// 如果有自定义格式化,直接使用
|
|
93
99
|
if (customFormat) {
|
|
94
|
-
var formattedTime =
|
|
100
|
+
var formattedTime = displayTime.format(customFormat);
|
|
95
101
|
var _containerInlineStyle = _objectSpread({
|
|
96
102
|
background: containerStyle === null || containerStyle === void 0 ? void 0 : containerStyle.background,
|
|
97
103
|
borderRadius: containerStyle === null || containerStyle === void 0 ? void 0 : containerStyle.borderRadius,
|
|
@@ -120,7 +126,7 @@ export var PisellDateTimeDisplay = function PisellDateTimeDisplay(props) {
|
|
|
120
126
|
|
|
121
127
|
// 日期与星期一体:若日期以相对日(今天/昨天/明天)展示,则不展示星期
|
|
122
128
|
var referenceDate = dayjs();
|
|
123
|
-
var relativeDay = effectiveDateFormat !== null && effectiveDateFormat !== void 0 && effectiveDateFormat.showRelativeDay ? getRelativeDay(
|
|
129
|
+
var relativeDay = effectiveDateFormat !== null && effectiveDateFormat !== void 0 && effectiveDateFormat.showRelativeDay ? getRelativeDay(displayTime, referenceDate) : null;
|
|
124
130
|
var hideWeekdayWhenDateRelative = showDate && relativeDay !== null;
|
|
125
131
|
|
|
126
132
|
// 构建容器样式
|
|
@@ -140,14 +146,14 @@ export var PisellDateTimeDisplay = function PisellDateTimeDisplay(props) {
|
|
|
140
146
|
case 'time':
|
|
141
147
|
return showTime ? /*#__PURE__*/React.createElement(TimeDisplay, {
|
|
142
148
|
key: "time",
|
|
143
|
-
time:
|
|
149
|
+
time: displayTime,
|
|
144
150
|
format: effectiveTimeFormat,
|
|
145
151
|
style: timeStyle
|
|
146
152
|
}) : null;
|
|
147
153
|
case 'date':
|
|
148
154
|
return showDate ? /*#__PURE__*/React.createElement(DateDisplay, {
|
|
149
155
|
key: "date",
|
|
150
|
-
date:
|
|
156
|
+
date: displayTime,
|
|
151
157
|
format: effectiveDateFormat,
|
|
152
158
|
referenceDate: dayjs(),
|
|
153
159
|
style: dateStyle
|
|
@@ -155,7 +161,7 @@ export var PisellDateTimeDisplay = function PisellDateTimeDisplay(props) {
|
|
|
155
161
|
case 'weekday':
|
|
156
162
|
return showWeekday && !hideWeekdayWhenDateRelative ? /*#__PURE__*/React.createElement(WeekdayDisplay, {
|
|
157
163
|
key: "weekday",
|
|
158
|
-
weekday:
|
|
164
|
+
weekday: displayTime,
|
|
159
165
|
format: effectiveWeekdayFormat,
|
|
160
166
|
style: weekdayStyle
|
|
161
167
|
}) : null;
|
|
@@ -203,15 +209,15 @@ export var PisellDateTimeDisplay = function PisellDateTimeDisplay(props) {
|
|
|
203
209
|
var timeField = showTime ? renderField('time') : null;
|
|
204
210
|
|
|
205
211
|
// 判断是否为中文环境
|
|
206
|
-
var currentLocale =
|
|
212
|
+
var currentLocale = displayTime.locale();
|
|
207
213
|
var isChinese = checkIsChinese(currentLocale);
|
|
208
214
|
|
|
209
215
|
// 当同时显示日期和星期时,使用合并格式;有相对日时只展示相对日,不展示具体日期与星期
|
|
210
216
|
if (showDate && showWeekday) {
|
|
211
217
|
var _labels$relativeDay;
|
|
212
218
|
var labels = effectiveDateFormat === null || effectiveDateFormat === void 0 ? void 0 : effectiveDateFormat.relativeDayLabels;
|
|
213
|
-
var dateStr = relativeDay ? (_labels$relativeDay = labels === null || labels === void 0 ? void 0 : labels[relativeDay]) !== null && _labels$relativeDay !== void 0 ? _labels$relativeDay : getRelativeDayLabel(relativeDay,
|
|
214
|
-
var weekdayStr =
|
|
219
|
+
var dateStr = relativeDay ? (_labels$relativeDay = labels === null || labels === void 0 ? void 0 : labels[relativeDay]) !== null && _labels$relativeDay !== void 0 ? _labels$relativeDay : getRelativeDayLabel(relativeDay, displayTime.locale()) : isChinese ? displayTime.format('M月D日') : displayTime.format('D MMM');
|
|
220
|
+
var weekdayStr = displayTime.format('ddd');
|
|
215
221
|
// 相对日替换掉原日期展示:有今天/昨天/明天时只显示相对日,不拼接具体日期或星期
|
|
216
222
|
var combinedStr = relativeDay ? dateStr : isChinese ? "".concat(weekdayStr, " ").concat(dateStr) : "".concat(weekdayStr, ", ").concat(dateStr);
|
|
217
223
|
|
|
@@ -8,6 +8,7 @@ import { useState, useEffect } from 'react';
|
|
|
8
8
|
import dayjs from 'dayjs';
|
|
9
9
|
import { getDayjsLocale } from "../utils/localeUtils";
|
|
10
10
|
import usePisellConfig from "../../pisell-config-provider/hooks/usePisellConfig";
|
|
11
|
+
import useEngineContext from "../../../hooks/useEngineContext";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* useCurrentTime Hook 配置项
|
|
@@ -33,6 +34,7 @@ import usePisellConfig from "../../pisell-config-provider/hooks/usePisellConfig"
|
|
|
33
34
|
* @returns 当前时间(Dayjs 对象)
|
|
34
35
|
*/
|
|
35
36
|
export function useCurrentTime(options) {
|
|
37
|
+
var _context$engine;
|
|
36
38
|
var _ref = options || {},
|
|
37
39
|
_ref$refreshInterval = _ref.refreshInterval,
|
|
38
40
|
refreshInterval = _ref$refreshInterval === void 0 ? 60000 : _ref$refreshInterval,
|
|
@@ -40,13 +42,13 @@ export function useCurrentTime(options) {
|
|
|
40
42
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
41
43
|
userLocale = _ref.locale,
|
|
42
44
|
onUpdate = _ref.onUpdate;
|
|
43
|
-
|
|
44
|
-
// 获取全局配置中的 locale
|
|
45
45
|
var globalConfig = usePisellConfig();
|
|
46
|
+
var context = useEngineContext();
|
|
46
47
|
var globalLocale = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.locale;
|
|
48
|
+
var engineLocale = context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale;
|
|
47
49
|
|
|
48
|
-
//
|
|
49
|
-
var dayjsLocale = getDayjsLocale(userLocale || globalLocale);
|
|
50
|
+
// 优先级:用户指定 > 全局配置 > engine.props.locale > 'en'
|
|
51
|
+
var dayjsLocale = getDayjsLocale(userLocale || globalLocale || engineLocale || 'en');
|
|
50
52
|
|
|
51
53
|
// 初始化时间
|
|
52
54
|
var _useState = useState(function () {
|
|
@@ -14,9 +14,9 @@ export declare function normalizeLocale(locale: string): string;
|
|
|
14
14
|
export declare function isChinese(locale: string): boolean;
|
|
15
15
|
/**
|
|
16
16
|
* 获取 dayjs 兼容的 locale 代码
|
|
17
|
-
* 未传 locale
|
|
17
|
+
* 未传 locale 时:优先 materials 当前语言(globalConfig / umi_locale),若为默认 en-US 则用 @pisell/utils getLocale
|
|
18
18
|
* @param locale 原始 locale 代码(可选)
|
|
19
|
-
* @returns dayjs 兼容的 locale
|
|
19
|
+
* @returns dayjs 兼容的 locale 代码(与已加载的 zh-cn、en 对齐)
|
|
20
20
|
* @example 'zh-CN' -> 'zh-cn', 'en-US' -> 'en'
|
|
21
21
|
*/
|
|
22
22
|
export declare function getDayjsLocale(locale?: string): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { locales as utilsLocales } from '@pisell/utils';
|
|
1
2
|
import { getCurrentLocale } from "../../../utils/locale";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -21,16 +22,26 @@ export function isChinese(locale) {
|
|
|
21
22
|
return normalizedLocale.startsWith('zh');
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
/** dayjs 常用 locale 与项目已加载的 locale 对齐(zh-cn、en),en-us 等统一用 en */
|
|
26
|
+
function toDayjsLoadedLocale(normalized) {
|
|
27
|
+
if (normalized.startsWith('en')) return 'en';
|
|
28
|
+
return normalized;
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
/**
|
|
25
32
|
* 获取 dayjs 兼容的 locale 代码
|
|
26
|
-
* 未传 locale
|
|
33
|
+
* 未传 locale 时:优先 materials 当前语言(globalConfig / umi_locale),若为默认 en-US 则用 @pisell/utils getLocale
|
|
27
34
|
* @param locale 原始 locale 代码(可选)
|
|
28
|
-
* @returns dayjs 兼容的 locale
|
|
35
|
+
* @returns dayjs 兼容的 locale 代码(与已加载的 zh-cn、en 对齐)
|
|
29
36
|
* @example 'zh-CN' -> 'zh-cn', 'en-US' -> 'en'
|
|
30
37
|
*/
|
|
31
38
|
export function getDayjsLocale(locale) {
|
|
32
39
|
if (!locale) {
|
|
33
|
-
|
|
40
|
+
var fromMaterials = getCurrentLocale();
|
|
41
|
+
var fromUtils = typeof utilsLocales.getLocale === 'function' ? utilsLocales.getLocale() : undefined;
|
|
42
|
+
// 优先 materials(umi_locale / ConfigProvider),仅当为默认 en-US 时再用 utils,保证多语言能展示
|
|
43
|
+
var raw = (fromMaterials && fromMaterials !== 'en-US' ? fromMaterials : undefined) || (typeof fromUtils === 'string' && fromUtils ? fromUtils : undefined) || fromMaterials;
|
|
44
|
+
return toDayjsLoadedLocale(normalizeLocale(raw));
|
|
34
45
|
}
|
|
35
|
-
return normalizeLocale(locale);
|
|
46
|
+
return toDayjsLoadedLocale(normalizeLocale(locale));
|
|
36
47
|
}
|
|
@@ -15,6 +15,7 @@ export declare type RelativeDay = 'today' | 'yesterday' | 'tomorrow';
|
|
|
15
15
|
export declare function getRelativeDay(date: Dayjs, reference: Dayjs): RelativeDay | null;
|
|
16
16
|
/**
|
|
17
17
|
* 根据 locale 返回相对日期的展示文案
|
|
18
|
+
* 未传 locale 时使用 getDayjsLocale()(与 locales.getLocale 同源)
|
|
18
19
|
*
|
|
19
20
|
* @param day 'today' | 'yesterday' | 'tomorrow'
|
|
20
21
|
* @param locale dayjs locale,如 'zh-cn'、'en'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isChinese as checkIsChinese } from "./localeUtils";
|
|
1
|
+
import { isChinese as checkIsChinese, getDayjsLocale } from "./localeUtils";
|
|
2
2
|
var LABELS_ZH = {
|
|
3
3
|
today: '今天',
|
|
4
4
|
yesterday: '昨天',
|
|
@@ -34,12 +34,14 @@ export function getRelativeDay(date, reference) {
|
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* 根据 locale 返回相对日期的展示文案
|
|
37
|
+
* 未传 locale 时使用 getDayjsLocale()(与 locales.getLocale 同源)
|
|
37
38
|
*
|
|
38
39
|
* @param day 'today' | 'yesterday' | 'tomorrow'
|
|
39
40
|
* @param locale dayjs locale,如 'zh-cn'、'en'
|
|
40
41
|
* @returns 如 '今天'、'Today'
|
|
41
42
|
*/
|
|
42
43
|
export function getRelativeDayLabel(day, locale) {
|
|
43
|
-
var
|
|
44
|
+
var resolvedLocale = locale !== null && locale !== void 0 ? locale : getDayjsLocale();
|
|
45
|
+
var isZh = checkIsChinese(resolvedLocale);
|
|
44
46
|
return isZh ? LABELS_ZH[day] : LABELS_EN[day];
|
|
45
47
|
}
|