@pisell/materials 1.0.206 → 1.0.207
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 +1 -1
- package/build/lowcode/preview.js +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +20 -20
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +20 -20
- package/es/components/DragSortList/index.d.ts +1 -1
- package/es/components/MultipleContainersSortList/index.d.ts +1 -1
- package/es/components/Pagination/index.d.ts +2 -2
- package/es/components/Pagination/index.js +14 -9
- package/es/components/auto-complete/index.d.ts +5 -1
- package/es/components/calendar/index.d.ts +1 -1
- package/es/components/checkbox/index.d.ts +1 -1
- package/es/components/config-provider/index.d.ts +2 -2
- package/es/components/date-picker/index.d.ts +1 -1
- package/es/components/div/index.d.ts +1 -1
- package/es/components/div/index.js +2 -6
- package/es/components/drawer/index.d.ts +0 -1
- package/es/components/drawer/index.js +4 -42
- package/es/components/dropdown/index.d.ts +2 -2
- package/es/components/filter/components/QuickFilter/index.d.ts +2 -2
- package/es/components/filter/components/items/index.d.ts +6 -6
- package/es/components/filter/components/items/text/Editor/index.d.ts +1 -1
- package/es/components/filter/components/items/text/Preview/index.d.ts +1 -1
- package/es/components/filter/components/items/text/index.d.ts +2 -2
- package/es/components/filter/index.d.ts +2 -2
- package/es/components/form/index.d.ts +1 -1
- package/es/components/page/index.d.ts +2 -2
- package/es/components/page/index.js +1 -14
- package/es/components/qrcode/index.d.ts +2 -2
- package/es/components/radio/index.d.ts +1 -1
- package/es/components/record-view/index.less +0 -2
- package/es/components/select/index.d.ts +5 -2
- package/es/components/select/index.js +2 -60
- package/es/components/skeleton/index.d.ts +1 -1
- package/es/components/slider/index.d.ts +2 -2
- package/es/components/table/Actions/Sort/index.d.ts +12 -0
- package/es/components/table/Actions/Sort/index.js +59 -0
- package/es/components/table/Actions/Sort/index.less +0 -0
- package/es/components/table/Actions/index.d.ts +2 -2
- package/es/components/table/Actions/index.js +1 -1
- package/es/components/table/BasicTable/index.d.ts +2 -2
- package/es/components/table/Header/index.d.ts +2 -2
- package/es/components/table/Summary/index.d.ts +2 -2
- package/es/components/table/Table/SelectField/index.d.ts +2 -2
- package/es/components/table/Table/fields/date/Config/index.d.ts +1 -1
- package/es/components/table/Table/fields/date/Show/index.d.ts +2 -2
- package/es/components/table/Table/fields/date/Show/index.js +1 -2
- package/es/components/table/Table/fields/date/Sort/index.d.ts +1 -1
- package/es/components/table/Table/fields/date/index.d.ts +3 -3
- package/es/components/table/Table/fields/image/Config/index.d.ts +1 -1
- package/es/components/table/Table/fields/image/Show/index.d.ts +1 -1
- package/es/components/table/Table/fields/image/Show/index.js +1 -2
- package/es/components/table/Table/fields/image/Sort/index.d.ts +1 -1
- package/es/components/table/Table/fields/image/index.d.ts +3 -3
- package/es/components/table/Table/fields/index.d.ts +57 -57
- package/es/components/table/Table/fields/link/Config/index.d.ts +1 -1
- package/es/components/table/Table/fields/link/Show/index.d.ts +1 -1
- package/es/components/table/Table/fields/link/Show/index.js +5 -7
- package/es/components/table/Table/fields/link/Sort/index.d.ts +1 -1
- package/es/components/table/Table/fields/link/index.d.ts +3 -3
- package/es/components/table/Table/fields/number/Config/index.d.ts +1 -1
- package/es/components/table/Table/fields/number/Show/index.d.ts +1 -1
- package/es/components/table/Table/fields/number/Show/index.js +1 -2
- package/es/components/table/Table/fields/number/Sort/index.d.ts +1 -1
- package/es/components/table/Table/fields/number/index.d.ts +3 -3
- package/es/components/table/Table/fields/pSwitch/Config/index.d.ts +1 -1
- package/es/components/table/Table/fields/pSwitch/Show/index.d.ts +2 -2
- package/es/components/table/Table/fields/pSwitch/Show/index.js +1 -2
- package/es/components/table/Table/fields/pSwitch/Sort/index.d.ts +1 -1
- package/es/components/table/Table/fields/pSwitch/index.d.ts +3 -3
- package/es/components/table/Table/fields/rangePicker/Config/index.d.ts +1 -1
- package/es/components/table/Table/fields/rangePicker/Show/index.d.ts +1 -1
- package/es/components/table/Table/fields/rangePicker/Sort/index.d.ts +1 -1
- package/es/components/table/Table/fields/rangePicker/index.d.ts +3 -3
- package/es/components/table/Table/fields/search/Config/index.d.ts +1 -1
- package/es/components/table/Table/fields/search/Show/index.d.ts +1 -1
- package/es/components/table/Table/fields/search/Show/index.js +1 -2
- package/es/components/table/Table/fields/search/Sort/index.d.ts +1 -1
- package/es/components/table/Table/fields/search/index.d.ts +3 -3
- package/es/components/table/Table/fields/select/Config/index.d.ts +1 -1
- package/es/components/table/Table/fields/select/Show/index.d.ts +1 -1
- package/es/components/table/Table/fields/select/Sort/index.d.ts +1 -1
- package/es/components/table/Table/fields/select/index.d.ts +3 -3
- package/es/components/table/Table/fields/text/Config/index.d.ts +1 -1
- package/es/components/table/Table/fields/text/Edit/index.js +3 -8
- package/es/components/table/Table/fields/text/Show/index.d.ts +1 -1
- package/es/components/table/Table/fields/text/Show/index.js +1 -2
- package/es/components/table/Table/fields/text/Sort/index.d.ts +1 -1
- package/es/components/table/Table/fields/text/index.d.ts +3 -3
- package/es/components/table/Table/index.js +4 -5
- package/es/components/table/Table/tableConfig/SortRow/index.d.ts +2 -2
- package/es/components/table/Table/tableConfig/summary/index.d.ts +2 -2
- package/es/components/table/TableFilter/SortIcon.d.ts +2 -2
- package/es/components/table/TableFilter/numberFilter.js +4 -5
- package/es/components/table/TableFilter/selectFilter.js +2 -3
- package/es/components/table/TableFilter/stringFilter.js +3 -4
- package/es/components/table/model.d.ts +1 -1
- package/es/components/table/model.js +29 -1
- package/es/components/tabs/index.d.ts +2 -5
- package/es/components/tabs/index.js +8 -51
- package/es/components/time-picker/index.d.ts +1 -1
- package/es/components/upload/index.d.ts +1 -1
- package/es/index.d.ts +1 -5
- package/es/index.js +5 -6
- package/es/utils/hoc.d.ts +4 -4
- package/es/utils/hoc.js +8 -9
- package/es/utils/miniRedux.d.ts +1 -1
- package/lib/components/DragSortList/index.d.ts +1 -1
- package/lib/components/MultipleContainersSortList/index.d.ts +1 -1
- package/lib/components/Pagination/index.d.ts +2 -2
- package/lib/components/Pagination/index.js +8 -9
- package/lib/components/auto-complete/index.d.ts +5 -1
- package/lib/components/calendar/index.d.ts +1 -1
- package/lib/components/checkbox/index.d.ts +1 -1
- package/lib/components/config-provider/index.d.ts +2 -2
- package/lib/components/date-picker/index.d.ts +1 -1
- package/lib/components/div/index.d.ts +1 -1
- package/lib/components/div/index.js +2 -2
- package/lib/components/drawer/index.d.ts +0 -1
- package/lib/components/drawer/index.js +1 -37
- package/lib/components/dropdown/index.d.ts +2 -2
- package/lib/components/filter/components/QuickFilter/index.d.ts +2 -2
- package/lib/components/filter/components/items/index.d.ts +6 -6
- package/lib/components/filter/components/items/text/Editor/index.d.ts +1 -1
- package/lib/components/filter/components/items/text/Preview/index.d.ts +1 -1
- package/lib/components/filter/components/items/text/index.d.ts +2 -2
- package/lib/components/filter/index.d.ts +2 -2
- package/lib/components/form/index.d.ts +1 -1
- package/lib/components/page/index.d.ts +2 -2
- package/lib/components/page/index.js +1 -13
- package/lib/components/qrcode/index.d.ts +2 -2
- package/lib/components/radio/index.d.ts +1 -1
- package/lib/components/record-view/index.less +0 -2
- package/lib/components/select/index.d.ts +5 -2
- package/lib/components/select/index.js +1 -67
- package/lib/components/skeleton/index.d.ts +1 -1
- package/lib/components/slider/index.d.ts +2 -2
- package/lib/components/table/Actions/Sort/index.d.ts +12 -0
- package/lib/components/table/Actions/Sort/index.js +86 -0
- package/lib/components/table/Actions/Sort/index.less +0 -0
- package/lib/components/table/Actions/index.d.ts +2 -2
- package/lib/components/table/Actions/index.js +2 -2
- package/lib/components/table/BasicTable/index.d.ts +2 -2
- package/lib/components/table/Header/index.d.ts +2 -2
- package/lib/components/table/Summary/index.d.ts +2 -2
- package/lib/components/table/Table/SelectField/index.d.ts +2 -2
- package/lib/components/table/Table/fields/date/Config/index.d.ts +1 -1
- package/lib/components/table/Table/fields/date/Show/index.d.ts +2 -2
- package/lib/components/table/Table/fields/date/Show/index.js +1 -2
- package/lib/components/table/Table/fields/date/Sort/index.d.ts +1 -1
- package/lib/components/table/Table/fields/date/index.d.ts +3 -3
- package/lib/components/table/Table/fields/image/Config/index.d.ts +1 -1
- package/lib/components/table/Table/fields/image/Show/index.d.ts +1 -1
- package/lib/components/table/Table/fields/image/Show/index.js +1 -2
- package/lib/components/table/Table/fields/image/Sort/index.d.ts +1 -1
- package/lib/components/table/Table/fields/image/index.d.ts +3 -3
- package/lib/components/table/Table/fields/index.d.ts +57 -57
- package/lib/components/table/Table/fields/link/Config/index.d.ts +1 -1
- package/lib/components/table/Table/fields/link/Show/index.d.ts +1 -1
- package/lib/components/table/Table/fields/link/Show/index.js +5 -7
- package/lib/components/table/Table/fields/link/Sort/index.d.ts +1 -1
- package/lib/components/table/Table/fields/link/index.d.ts +3 -3
- package/lib/components/table/Table/fields/number/Config/index.d.ts +1 -1
- package/lib/components/table/Table/fields/number/Show/index.d.ts +1 -1
- package/lib/components/table/Table/fields/number/Show/index.js +1 -2
- package/lib/components/table/Table/fields/number/Sort/index.d.ts +1 -1
- package/lib/components/table/Table/fields/number/index.d.ts +3 -3
- package/lib/components/table/Table/fields/pSwitch/Config/index.d.ts +1 -1
- package/lib/components/table/Table/fields/pSwitch/Show/index.d.ts +2 -2
- package/lib/components/table/Table/fields/pSwitch/Show/index.js +1 -2
- package/lib/components/table/Table/fields/pSwitch/Sort/index.d.ts +1 -1
- package/lib/components/table/Table/fields/pSwitch/index.d.ts +3 -3
- package/lib/components/table/Table/fields/rangePicker/Config/index.d.ts +1 -1
- package/lib/components/table/Table/fields/rangePicker/Show/index.d.ts +1 -1
- package/lib/components/table/Table/fields/rangePicker/Sort/index.d.ts +1 -1
- package/lib/components/table/Table/fields/rangePicker/index.d.ts +3 -3
- package/lib/components/table/Table/fields/search/Config/index.d.ts +1 -1
- package/lib/components/table/Table/fields/search/Show/index.d.ts +1 -1
- package/lib/components/table/Table/fields/search/Show/index.js +1 -2
- package/lib/components/table/Table/fields/search/Sort/index.d.ts +1 -1
- package/lib/components/table/Table/fields/search/index.d.ts +3 -3
- package/lib/components/table/Table/fields/select/Config/index.d.ts +1 -1
- package/lib/components/table/Table/fields/select/Show/index.d.ts +1 -1
- package/lib/components/table/Table/fields/select/Sort/index.d.ts +1 -1
- package/lib/components/table/Table/fields/select/index.d.ts +3 -3
- package/lib/components/table/Table/fields/text/Config/index.d.ts +1 -1
- package/lib/components/table/Table/fields/text/Edit/index.js +1 -2
- package/lib/components/table/Table/fields/text/Show/index.d.ts +1 -1
- package/lib/components/table/Table/fields/text/Show/index.js +1 -2
- package/lib/components/table/Table/fields/text/Sort/index.d.ts +1 -1
- package/lib/components/table/Table/fields/text/index.d.ts +3 -3
- package/lib/components/table/Table/index.js +2 -3
- package/lib/components/table/Table/tableConfig/SortRow/index.d.ts +2 -2
- package/lib/components/table/Table/tableConfig/summary/index.d.ts +2 -2
- package/lib/components/table/TableFilter/SortIcon.d.ts +2 -2
- package/lib/components/table/TableFilter/numberFilter.js +4 -5
- package/lib/components/table/TableFilter/selectFilter.js +2 -3
- package/lib/components/table/TableFilter/stringFilter.js +3 -4
- package/lib/components/table/model.d.ts +1 -1
- package/lib/components/table/model.js +34 -1
- package/lib/components/tabs/index.d.ts +2 -5
- package/lib/components/tabs/index.js +1 -50
- package/lib/components/time-picker/index.d.ts +1 -1
- package/lib/components/upload/index.d.ts +1 -1
- package/lib/index.d.ts +1 -5
- package/lib/index.js +2 -14
- package/lib/utils/hoc.d.ts +4 -4
- package/lib/utils/hoc.js +3 -3
- package/lib/utils/miniRedux.d.ts +1 -1
- package/package.json +3 -3
- package/dist/umd/materials.min.css +0 -1
- package/dist/umd/materials.min.js +0 -1
- package/dist/umd/static/DotsSix.57d66266.svg +0 -1
- package/dist/umd/static/arrow-left.e542294f.svg +0 -1
- package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
- package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
- package/dist/umd/static/help-circle.31c9be40.svg +0 -1
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
- package/es/components/classicLayout/index.d.ts +0 -4
- package/es/components/classicLayout/index.js +0 -25
- package/es/components/classicLayout/index.less +0 -22
- package/es/components/component/index.d.ts +0 -11
- package/es/components/component/index.js +0 -10
- package/es/components/drawer/index.less +0 -34
- package/es/components/list/index.d.ts +0 -7
- package/es/components/list/index.js +0 -104
- package/es/components/list/index.less +0 -38
- package/es/components/select/index.less +0 -11
- package/es/components/sort/components/InlineMenu/index.d.ts +0 -15
- package/es/components/sort/components/InlineMenu/index.js +0 -87
- package/es/components/sort/components/InlineMenu/index.less +0 -20
- package/es/components/sort/index.d.ts +0 -18
- package/es/components/sort/index.js +0 -113
- package/es/components/sort/index.less +0 -10
- package/es/components/table/Table/fields/utils/index.d.ts +0 -1
- package/es/components/table/Table/fields/utils/index.js +0 -29
- package/es/components/tabs/index.less +0 -60
- package/es/locales/en-US.d.ts +0 -21
- package/es/locales/en-US.js +0 -22
- package/es/locales/index.d.ts +0 -1
- package/es/locales/index.js +0 -21
- package/es/locales/zh-CN.d.ts +0 -21
- package/es/locales/zh-CN.js +0 -22
- package/es/locales/zh-TW.d.ts +0 -21
- package/es/locales/zh-TW.js +0 -22
- package/es/utils/locale.d.ts +0 -1
- package/es/utils/locale.js +0 -5
- package/es/utils/platform.d.ts +0 -1
- package/es/utils/platform.js +0 -8
- package/lib/components/classicLayout/index.d.ts +0 -4
- package/lib/components/classicLayout/index.js +0 -59
- package/lib/components/classicLayout/index.less +0 -22
- package/lib/components/component/index.d.ts +0 -11
- package/lib/components/component/index.js +0 -29
- package/lib/components/drawer/index.less +0 -34
- package/lib/components/list/index.d.ts +0 -7
- package/lib/components/list/index.js +0 -134
- package/lib/components/list/index.less +0 -38
- package/lib/components/select/index.less +0 -11
- package/lib/components/sort/components/InlineMenu/index.d.ts +0 -15
- package/lib/components/sort/components/InlineMenu/index.js +0 -89
- package/lib/components/sort/components/InlineMenu/index.less +0 -20
- package/lib/components/sort/index.d.ts +0 -18
- package/lib/components/sort/index.js +0 -147
- package/lib/components/sort/index.less +0 -10
- package/lib/components/table/Table/fields/utils/index.d.ts +0 -1
- package/lib/components/table/Table/fields/utils/index.js +0 -46
- package/lib/components/tabs/index.less +0 -60
- package/lib/locales/en-US.d.ts +0 -21
- package/lib/locales/en-US.js +0 -44
- package/lib/locales/index.d.ts +0 -1
- package/lib/locales/index.js +0 -58
- package/lib/locales/zh-CN.d.ts +0 -21
- package/lib/locales/zh-CN.js +0 -44
- package/lib/locales/zh-TW.d.ts +0 -21
- package/lib/locales/zh-TW.js +0 -44
- package/lib/utils/locale.d.ts +0 -1
- package/lib/utils/locale.js +0 -32
- package/lib/utils/platform.d.ts +0 -1
- package/lib/utils/platform.js +0 -36
|
@@ -1 +0,0 @@
|
|
|
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>
|
|
@@ -1 +0,0 @@
|
|
|
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>
|
|
@@ -1 +0,0 @@
|
|
|
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>
|
|
@@ -1 +0,0 @@
|
|
|
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>
|
|
@@ -1 +0,0 @@
|
|
|
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>
|
|
@@ -1 +0,0 @@
|
|
|
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,25 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function _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; }
|
|
3
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
|
-
import React from "react";
|
|
6
|
-
import classNames from "classnames";
|
|
7
|
-
import "./index.less";
|
|
8
|
-
var prefix = "pisell-lowcode-";
|
|
9
|
-
var ClassicLayout = function ClassicLayout(props) {
|
|
10
|
-
var header = props.header,
|
|
11
|
-
content = props.content,
|
|
12
|
-
footer = props.footer,
|
|
13
|
-
style = props.style,
|
|
14
|
-
fixedHeader = props.fixedHeader,
|
|
15
|
-
fixedFooter = props.fixedFooter;
|
|
16
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
17
|
-
className: "".concat(prefix, "claseic-layout"),
|
|
18
|
-
style: style
|
|
19
|
-
}, /*#__PURE__*/React.createElement("header", {
|
|
20
|
-
className: classNames(_defineProperty({}, "".concat(prefix, "claseic-layout-fixed-header"), fixedHeader))
|
|
21
|
-
}, header), content, /*#__PURE__*/React.createElement("footer", {
|
|
22
|
-
className: classNames(_defineProperty({}, "".concat(prefix, "claseic-layout-fixed-footer"), fixedFooter))
|
|
23
|
-
}, footer));
|
|
24
|
-
};
|
|
25
|
-
export default ClassicLayout;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
@pisell-prefix: pisell-lowcode;
|
|
2
|
-
|
|
3
|
-
.@{pisell-prefix} {
|
|
4
|
-
&-claseic-layout {
|
|
5
|
-
position: relative;
|
|
6
|
-
overflow: auto;
|
|
7
|
-
height: 100%;
|
|
8
|
-
width: 100%;
|
|
9
|
-
}
|
|
10
|
-
&-claseic-layout-fixed-header {
|
|
11
|
-
position: sticky;
|
|
12
|
-
top: 0;
|
|
13
|
-
z-index: 1;
|
|
14
|
-
width: 100%;
|
|
15
|
-
}
|
|
16
|
-
&-claseic-layout-fixed-footer {
|
|
17
|
-
position: sticky;
|
|
18
|
-
bottom: 0;
|
|
19
|
-
z-index: 1;
|
|
20
|
-
width: 100%;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface ComponentProps {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* 低代码组件壳子 目前不做任何处理直接返回 如需容器包裹自行处理
|
|
7
|
-
* @param props
|
|
8
|
-
* @constructor
|
|
9
|
-
*/
|
|
10
|
-
declare const Component: (props: ComponentProps) => React.ReactNode;
|
|
11
|
-
export default Component;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
@pisell-prefix: pisell-lowcode;
|
|
2
|
-
|
|
3
|
-
.@{pisell-prefix} {
|
|
4
|
-
&-drawer-outside-wrap {
|
|
5
|
-
position: absolute;
|
|
6
|
-
padding: 10px;
|
|
7
|
-
background-color: transparent;
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
}
|
|
11
|
-
&-drawer-outside-wrap-right {
|
|
12
|
-
left: -82px;
|
|
13
|
-
}
|
|
14
|
-
&-drawer-outside-action-wrap {
|
|
15
|
-
width: 56px;
|
|
16
|
-
height: 56px;
|
|
17
|
-
border-radius: 99px;
|
|
18
|
-
background: var(--base-white, #fff);
|
|
19
|
-
transition: background 300ms ease;
|
|
20
|
-
box-shadow: 0px 4px 8px 0px rgba(13, 22, 25, 0.02),
|
|
21
|
-
0px 12px 20px 0px rgba(0, 0, 0, 0.16);
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
margin-bottom: 20px;
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
&:hover {
|
|
28
|
-
background: #e8e8ee;
|
|
29
|
-
}
|
|
30
|
-
.anticon {
|
|
31
|
-
font-size: 20px;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["className", "paginationType", "pagination", "footer", "header", "listHeight", "loadMoreData", "arrow"];
|
|
3
|
-
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; }
|
|
4
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
-
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); }
|
|
7
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
9
|
-
import React, { useMemo, useRef } from "react";
|
|
10
|
-
import classNames from "classnames";
|
|
11
|
-
import { List as AntList, Skeleton } from "antd";
|
|
12
|
-
import { getUniqueId } from "@pisell/utils";
|
|
13
|
-
import InfiniteScroll from "react-infinite-scroll-component";
|
|
14
|
-
import { DoubleRightOutlined } from "@ant-design/icons";
|
|
15
|
-
import { useScroll } from "ahooks";
|
|
16
|
-
import Pagination from "../Pagination";
|
|
17
|
-
import "./index.less";
|
|
18
|
-
var prefix = "pisell-lowcode-";
|
|
19
|
-
var downArrow = /*#__PURE__*/React.createElement("div", {
|
|
20
|
-
className: "".concat(prefix, "list-arrow-wrap ").concat(prefix, "list-arrow-down")
|
|
21
|
-
}, /*#__PURE__*/React.createElement(DoubleRightOutlined, {
|
|
22
|
-
style: {
|
|
23
|
-
transform: "rotate(90deg)"
|
|
24
|
-
}
|
|
25
|
-
}));
|
|
26
|
-
var upArrow = /*#__PURE__*/React.createElement("div", {
|
|
27
|
-
className: "".concat(prefix, "list-arrow-wrap ").concat(prefix, "list-arrow-up")
|
|
28
|
-
}, /*#__PURE__*/React.createElement(DoubleRightOutlined, {
|
|
29
|
-
style: {
|
|
30
|
-
transform: "rotate(-90deg)"
|
|
31
|
-
}
|
|
32
|
-
}));
|
|
33
|
-
var List = function List(props) {
|
|
34
|
-
var className = props.className,
|
|
35
|
-
paginationType = props.paginationType,
|
|
36
|
-
pagination = props.pagination,
|
|
37
|
-
footer = props.footer,
|
|
38
|
-
header = props.header,
|
|
39
|
-
listHeight = props.listHeight,
|
|
40
|
-
loadMoreData = props.loadMoreData,
|
|
41
|
-
arrow = props.arrow,
|
|
42
|
-
others = _objectWithoutProperties(props, _excluded);
|
|
43
|
-
var listRef = useRef(null);
|
|
44
|
-
var scrollListId = useMemo(function () {
|
|
45
|
-
return "scrollableDiv-".concat(getUniqueId());
|
|
46
|
-
}, []);
|
|
47
|
-
var position = useScroll(listRef);
|
|
48
|
-
var isShowDownArrow = useMemo(function () {
|
|
49
|
-
var _listRef$current, _listRef$current2;
|
|
50
|
-
return arrow && (listRef === null || listRef === void 0 ? void 0 : listRef.current) && ((position === null || position === void 0 ? void 0 : position.top) || 0) + (listRef === null || listRef === void 0 ? void 0 : (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.clientHeight) < ((_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 ? void 0 : _listRef$current2.scrollHeight);
|
|
51
|
-
}, [position, arrow]);
|
|
52
|
-
var isShowUpArrow = useMemo(function () {
|
|
53
|
-
return arrow && ((position === null || position === void 0 ? void 0 : position.top) || 0) > 0;
|
|
54
|
-
}, [position, arrow]);
|
|
55
|
-
var _footer = useMemo(function () {
|
|
56
|
-
if (!(pagination && paginationType === "default") && !footer) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, pagination && paginationType === "default" && /*#__PURE__*/React.createElement(Pagination, _extends({
|
|
60
|
-
showLessItems: true
|
|
61
|
-
}, pagination)), footer);
|
|
62
|
-
}, [pagination, footer]);
|
|
63
|
-
var list = useMemo(function () {
|
|
64
|
-
var _props$grid2;
|
|
65
|
-
if (paginationType === "scroll") {
|
|
66
|
-
var _props$grid;
|
|
67
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
className: "".concat(prefix, "scroll-list-wrap")
|
|
69
|
-
}, header && /*#__PURE__*/React.createElement("div", {
|
|
70
|
-
className: "".concat(prefix, "scroll-header-wrap")
|
|
71
|
-
}, header), /*#__PURE__*/React.createElement("div", {
|
|
72
|
-
id: scrollListId,
|
|
73
|
-
ref: listRef,
|
|
74
|
-
style: {
|
|
75
|
-
height: listHeight || 400,
|
|
76
|
-
overflow: "auto"
|
|
77
|
-
}
|
|
78
|
-
}, isShowUpArrow && upArrow, /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
79
|
-
dataLength: props.dataSource.length,
|
|
80
|
-
next: loadMoreData,
|
|
81
|
-
hasMore: props.dataSource.length < ((pagination === null || pagination === void 0 ? void 0 : pagination.total) || 999999),
|
|
82
|
-
loader: props.dataSource.length > 0 && /*#__PURE__*/React.createElement(Skeleton, {
|
|
83
|
-
avatar: true,
|
|
84
|
-
paragraph: {
|
|
85
|
-
rows: 1
|
|
86
|
-
},
|
|
87
|
-
active: true,
|
|
88
|
-
className: "".concat(prefix, "scroll-skeleton")
|
|
89
|
-
}),
|
|
90
|
-
scrollableTarget: scrollListId
|
|
91
|
-
}, /*#__PURE__*/React.createElement(AntList, _extends({}, others, {
|
|
92
|
-
className: classNames(className, _defineProperty({}, "".concat(prefix, "list-one-line-wrap"), props === null || props === void 0 ? void 0 : (_props$grid = props.grid) === null || _props$grid === void 0 ? void 0 : _props$grid.oneLine))
|
|
93
|
-
}))), isShowDownArrow && downArrow), _footer && /*#__PURE__*/React.createElement("div", {
|
|
94
|
-
className: "".concat(prefix, "scroll-footer-wrap")
|
|
95
|
-
}, _footer));
|
|
96
|
-
}
|
|
97
|
-
return /*#__PURE__*/React.createElement(AntList, _extends({}, props, {
|
|
98
|
-
className: classNames(className, _defineProperty({}, "".concat(prefix, "list-one-line-wrap"), props === null || props === void 0 ? void 0 : (_props$grid2 = props.grid) === null || _props$grid2 === void 0 ? void 0 : _props$grid2.oneLine))
|
|
99
|
-
}));
|
|
100
|
-
}, [props, _footer, isShowDownArrow, isShowUpArrow]);
|
|
101
|
-
return list;
|
|
102
|
-
};
|
|
103
|
-
List.Item = AntList.Item;
|
|
104
|
-
export default List;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
@pisell-prefix: pisell-lowcode;
|
|
2
|
-
|
|
3
|
-
.@{pisell-prefix} {
|
|
4
|
-
&-list-one-line-wrap {
|
|
5
|
-
.pisell-lowcode-row {
|
|
6
|
-
flex-flow: row nowrap;
|
|
7
|
-
overflow: auto;
|
|
8
|
-
& > div {
|
|
9
|
-
flex-shrink: 0;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
&-scroll-list-wrap {
|
|
14
|
-
position: relative;
|
|
15
|
-
}
|
|
16
|
-
&-list-arrow-wrap {
|
|
17
|
-
width: 40px;
|
|
18
|
-
height: 40px;
|
|
19
|
-
border-radius: 50%;
|
|
20
|
-
background: rgba(0, 0, 0, 0.05);
|
|
21
|
-
display: flex;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
align-items: center;
|
|
24
|
-
color: #0B5FDB;
|
|
25
|
-
}
|
|
26
|
-
&-list-arrow-down {
|
|
27
|
-
position: absolute;
|
|
28
|
-
bottom: 20px;
|
|
29
|
-
left: 50%;
|
|
30
|
-
transform: rotateX(-50%);
|
|
31
|
-
}
|
|
32
|
-
&-list-arrow-up {
|
|
33
|
-
position: absolute;
|
|
34
|
-
top: 20px;
|
|
35
|
-
left: 50%;
|
|
36
|
-
transform: rotateX(-50%);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { MenuProps } from "antd";
|
|
3
|
-
import "./index.less";
|
|
4
|
-
interface InlineMenuProps {
|
|
5
|
-
items: any[];
|
|
6
|
-
value?: [string, string];
|
|
7
|
-
onChange?: (val: string, detail: Parameters<Required<MenuProps>["onClick"]>[0]) => void;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* 内嵌展示的菜单 只支持两级
|
|
11
|
-
* @param props
|
|
12
|
-
* @constructor
|
|
13
|
-
*/
|
|
14
|
-
declare const InlineMenu: (props: InlineMenuProps) => React.JSX.Element;
|
|
15
|
-
export default InlineMenu;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
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
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useMemo } from "react";
|
|
8
|
-
import { Menu, Divider } from "antd";
|
|
9
|
-
import { CheckOutlined } from "@ant-design/icons";
|
|
10
|
-
import { useControllableValue } from "ahooks";
|
|
11
|
-
import "./index.less";
|
|
12
|
-
var prefix = "pisell-lowcode-";
|
|
13
|
-
/**
|
|
14
|
-
* 内嵌展示的菜单 只支持两级
|
|
15
|
-
* @param props
|
|
16
|
-
* @constructor
|
|
17
|
-
*/
|
|
18
|
-
var InlineMenu = function InlineMenu(props) {
|
|
19
|
-
var items = props.items;
|
|
20
|
-
var _useControllableValue = useControllableValue(props),
|
|
21
|
-
_useControllableValue2 = _slicedToArray(_useControllableValue, 2),
|
|
22
|
-
state = _useControllableValue2[0],
|
|
23
|
-
setState = _useControllableValue2[1];
|
|
24
|
-
var childItems = useMemo(function () {
|
|
25
|
-
var _items$find;
|
|
26
|
-
return ((_items$find = items.find(function (item) {
|
|
27
|
-
return item.key === (state === null || state === void 0 ? void 0 : state[1]);
|
|
28
|
-
})) === null || _items$find === void 0 ? void 0 : _items$find.children) || items[0].children;
|
|
29
|
-
}, [state, items]);
|
|
30
|
-
var handleParentClick = function handleParentClick(detail) {
|
|
31
|
-
var children = items.find(function (item) {
|
|
32
|
-
return item.key === detail.key;
|
|
33
|
-
});
|
|
34
|
-
var defaultKey = children.children[0].key;
|
|
35
|
-
setState([defaultKey, detail.key], {
|
|
36
|
-
key: defaultKey,
|
|
37
|
-
item: children.children[0],
|
|
38
|
-
keyPath: [defaultKey, detail.key]
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
var handleChildrenClick = function handleChildrenClick(detail) {
|
|
42
|
-
var parent = items.find(function (item) {
|
|
43
|
-
return item.children.some(function (c) {
|
|
44
|
-
return c.key === detail.key;
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
setState([detail.key, parent.key], {
|
|
48
|
-
key: detail.key,
|
|
49
|
-
item: detail.item,
|
|
50
|
-
keyPath: [detail.key, parent.key]
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className: "".concat(prefix, "inline-menu-wrap")
|
|
55
|
-
}, /*#__PURE__*/React.createElement(Menu, {
|
|
56
|
-
items: items.map(function (item) {
|
|
57
|
-
return {
|
|
58
|
-
key: item.key,
|
|
59
|
-
label: /*#__PURE__*/React.createElement("span", {
|
|
60
|
-
className: "".concat(prefix, "menu-item-label-wrap")
|
|
61
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
62
|
-
className: "".concat(prefix, "menu-item-label")
|
|
63
|
-
}, item.label), item.key === (state === null || state === void 0 ? void 0 : state[1]) && /*#__PURE__*/React.createElement(CheckOutlined, null))
|
|
64
|
-
};
|
|
65
|
-
}),
|
|
66
|
-
onClick: handleParentClick,
|
|
67
|
-
selectedKeys: [state === null || state === void 0 ? void 0 : state[1]]
|
|
68
|
-
}), /*#__PURE__*/React.createElement(Divider, {
|
|
69
|
-
style: {
|
|
70
|
-
margin: "6px 0"
|
|
71
|
-
}
|
|
72
|
-
}), /*#__PURE__*/React.createElement(Menu, {
|
|
73
|
-
items: childItems.map(function (item) {
|
|
74
|
-
return {
|
|
75
|
-
key: item.key,
|
|
76
|
-
label: /*#__PURE__*/React.createElement("span", {
|
|
77
|
-
className: "".concat(prefix, "menu-item-label-wrap")
|
|
78
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
79
|
-
className: "".concat(prefix, "menu-item-label")
|
|
80
|
-
}, item.label), item.key === (state === null || state === void 0 ? void 0 : state[0]) && /*#__PURE__*/React.createElement(CheckOutlined, null))
|
|
81
|
-
};
|
|
82
|
-
}),
|
|
83
|
-
onClick: handleChildrenClick,
|
|
84
|
-
selectedKeys: [state === null || state === void 0 ? void 0 : state[0]]
|
|
85
|
-
}));
|
|
86
|
-
};
|
|
87
|
-
export default InlineMenu;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
@pisell-prefix: pisell-lowcode;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
.@{pisell-prefix} {
|
|
5
|
-
&-inline-menu-wrap {
|
|
6
|
-
min-width: 200px;
|
|
7
|
-
}
|
|
8
|
-
&-menu-item-label-wrap {
|
|
9
|
-
width: 100%;
|
|
10
|
-
display: flex;
|
|
11
|
-
justify-content: space-between;
|
|
12
|
-
}
|
|
13
|
-
&-menu-item-label {
|
|
14
|
-
margin-right: 16px;
|
|
15
|
-
}
|
|
16
|
-
&-menu-title-content {
|
|
17
|
-
width: 100%;
|
|
18
|
-
display: inline-block;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { MenuProps } from "antd";
|
|
3
|
-
import "./index.less";
|
|
4
|
-
export declare type SortItemProps = {
|
|
5
|
-
type: "date" | "string" | "number";
|
|
6
|
-
label: string;
|
|
7
|
-
name: string;
|
|
8
|
-
};
|
|
9
|
-
declare type SortListProps = {
|
|
10
|
-
list: SortItemProps[];
|
|
11
|
-
onChange?: (val: string, detail: Parameters<Required<MenuProps>["onClick"]>[0]) => void;
|
|
12
|
-
button?: React.ReactNode;
|
|
13
|
-
style?: React.CSSProperties;
|
|
14
|
-
value?: any;
|
|
15
|
-
placement?: "bottom" | "bottomLeft" | "bottomRight" | "top" | "topLeft" | "topRight";
|
|
16
|
-
};
|
|
17
|
-
declare const Sort: React.FC<SortListProps>;
|
|
18
|
-
export default Sort;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function _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); }
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
-
import React, { useMemo } from "react";
|
|
9
|
-
import { Button, Dropdown, Popover } from "antd";
|
|
10
|
-
import SwitchVertical01 from "@pisell/icon/es/SwitchVertical01";
|
|
11
|
-
import { isMobile } from "../../utils/platform";
|
|
12
|
-
import { getText } from "../../locales";
|
|
13
|
-
import InlineMenu from "./components/InlineMenu";
|
|
14
|
-
import "./index.less";
|
|
15
|
-
var prefix = "pisell-lowcode-";
|
|
16
|
-
var sortChildrenMap = {
|
|
17
|
-
date: function date(key) {
|
|
18
|
-
return [{
|
|
19
|
-
key: "".concat(key, ":desc"),
|
|
20
|
-
label: getText("sort-oldest-to-newest")
|
|
21
|
-
}, {
|
|
22
|
-
key: "".concat(key, ":asc"),
|
|
23
|
-
label: getText("sort-newest-to-oldest")
|
|
24
|
-
}];
|
|
25
|
-
},
|
|
26
|
-
time: function time(key) {
|
|
27
|
-
return [{
|
|
28
|
-
key: "".concat(key, ":desc"),
|
|
29
|
-
label: getText("sort-from-morning-to-night")
|
|
30
|
-
}, {
|
|
31
|
-
key: "".concat(key, ":asc"),
|
|
32
|
-
label: getText("sort-from-evening-to-morning")
|
|
33
|
-
}];
|
|
34
|
-
},
|
|
35
|
-
string: function string(key) {
|
|
36
|
-
return [{
|
|
37
|
-
key: "".concat(key, ":asc"),
|
|
38
|
-
label: getText("sort-a-z")
|
|
39
|
-
}, {
|
|
40
|
-
key: "".concat(key, ":desc"),
|
|
41
|
-
label: getText("sort-z-a")
|
|
42
|
-
}];
|
|
43
|
-
},
|
|
44
|
-
number: function number(key) {
|
|
45
|
-
return [{
|
|
46
|
-
key: "".concat(key, ":asc"),
|
|
47
|
-
label: getText("sort-0-9")
|
|
48
|
-
}, {
|
|
49
|
-
key: "".concat(key, ":desc"),
|
|
50
|
-
label: getText("sort-9-0")
|
|
51
|
-
}];
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
var Sort = function Sort(_ref) {
|
|
55
|
-
var _ref$list = _ref.list,
|
|
56
|
-
list = _ref$list === void 0 ? [] : _ref$list,
|
|
57
|
-
onChange = _ref.onChange,
|
|
58
|
-
button = _ref.button,
|
|
59
|
-
style = _ref.style,
|
|
60
|
-
value = _ref.value,
|
|
61
|
-
placement = _ref.placement;
|
|
62
|
-
var sortItems = useMemo(function () {
|
|
63
|
-
return list.map(function (d) {
|
|
64
|
-
return {
|
|
65
|
-
key: d.name,
|
|
66
|
-
label: d.label,
|
|
67
|
-
children: sortChildrenMap[d.type](d.name)
|
|
68
|
-
};
|
|
69
|
-
});
|
|
70
|
-
}, [list]);
|
|
71
|
-
var onClick = function onClick(detail) {
|
|
72
|
-
var _detail$keyPath;
|
|
73
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(detail === null || detail === void 0 ? void 0 : (_detail$keyPath = detail.keyPath) === null || _detail$keyPath === void 0 ? void 0 : _detail$keyPath[0], detail);
|
|
74
|
-
};
|
|
75
|
-
var btnContent = useMemo(function () {
|
|
76
|
-
return button || /*#__PURE__*/React.createElement(Button, {
|
|
77
|
-
icon: /*#__PURE__*/React.createElement(SwitchVertical01, null),
|
|
78
|
-
style: style
|
|
79
|
-
}, getText("sort-button-text"));
|
|
80
|
-
}, [button, style]);
|
|
81
|
-
var content = useMemo(function () {
|
|
82
|
-
var others = {};
|
|
83
|
-
if (value) {
|
|
84
|
-
others = _objectSpread(_objectSpread({}, others), {}, {
|
|
85
|
-
value: value
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
return /*#__PURE__*/React.createElement(InlineMenu, _extends({
|
|
89
|
-
items: sortItems,
|
|
90
|
-
onChange: onChange
|
|
91
|
-
}, others));
|
|
92
|
-
}, [value, sortItems, onChange]);
|
|
93
|
-
if (isMobile()) {
|
|
94
|
-
return /*#__PURE__*/React.createElement(Popover, {
|
|
95
|
-
placement: placement,
|
|
96
|
-
content: content,
|
|
97
|
-
arrow: false,
|
|
98
|
-
overlayClassName: "".concat(prefix, "mobile-sort-overlay"),
|
|
99
|
-
trigger: ["click", "hover"]
|
|
100
|
-
}, btnContent);
|
|
101
|
-
}
|
|
102
|
-
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
103
|
-
trigger: ["click", "hover"],
|
|
104
|
-
placement: placement,
|
|
105
|
-
menu: {
|
|
106
|
-
items: sortItems,
|
|
107
|
-
onClick: onClick,
|
|
108
|
-
selectable: true,
|
|
109
|
-
selectedKeys: value
|
|
110
|
-
}
|
|
111
|
-
}, btnContent);
|
|
112
|
-
};
|
|
113
|
-
export default Sort;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getValueByKeys: (obj: Record<string, any>, keys: string[] | string) => any;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
3
|
-
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; }
|
|
4
|
-
import { isString } from "@pisell/utils";
|
|
5
|
-
export var getValueByKeys = function getValueByKeys(obj, keys) {
|
|
6
|
-
if (!keys) return keys;
|
|
7
|
-
if (isString(keys)) {
|
|
8
|
-
keys = [keys];
|
|
9
|
-
}
|
|
10
|
-
var result = obj;
|
|
11
|
-
var _iterator = _createForOfIteratorHelper(keys),
|
|
12
|
-
_step;
|
|
13
|
-
try {
|
|
14
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
15
|
-
var _result, _result$hasOwnPropert, _result2;
|
|
16
|
-
var key = _step.value;
|
|
17
|
-
if (result && (_result = result) !== null && _result !== void 0 && (_result$hasOwnPropert = (_result2 = _result).hasOwnProperty) !== null && _result$hasOwnPropert !== void 0 && _result$hasOwnPropert.call(_result2, key)) {
|
|
18
|
-
result = result[key];
|
|
19
|
-
} else {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
} catch (err) {
|
|
24
|
-
_iterator.e(err);
|
|
25
|
-
} finally {
|
|
26
|
-
_iterator.f();
|
|
27
|
-
}
|
|
28
|
-
return result;
|
|
29
|
-
};
|