@pisell/materials 6.4.6 → 6.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +150 -150
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +22 -27
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +23 -28
- package/dist/umd/materials.min.css +1 -0
- package/dist/umd/materials.min.js +1 -0
- package/dist/umd/static/DotsSix.57d66266.svg +1 -0
- package/dist/umd/static/arrow-left.e542294f.svg +1 -0
- package/dist/umd/static/arrow-right.763f03e0.svg +1 -0
- package/dist/umd/static/filter-lines.04a54ae9.svg +1 -0
- package/dist/umd/static/help-circle.31c9be40.svg +1 -0
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +1 -0
- package/es/components/appVersionControl/index.d.ts +0 -1
- package/es/components/auto-complete-number/index.d.ts +0 -1
- package/es/components/badge/index.d.ts +0 -1
- package/es/components/batch-editor/fields/index.d.ts +0 -1
- package/es/components/batch-editor/index.d.ts +1 -0
- package/es/components/calendar/index.d.ts +0 -1
- package/es/components/cardPro/index.d.ts +3 -0
- package/es/components/checkbox/index.d.ts +0 -1
- package/es/components/classicLayout/index.d.ts +0 -1
- package/es/components/colorPicker/index.d.ts +0 -1
- package/es/components/config-provider/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +11 -4
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -3
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +6 -7
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -4
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +92 -6
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
- package/es/components/dataSourceComponents/fields/ColorPicker/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/IconSelect/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +24 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/TimePicker/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Translation/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +5 -5
- package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +0 -3
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +5 -18
- package/es/components/date-picker/index.d.ts +1 -0
- package/es/components/dropdown/index.d.ts +0 -1
- package/es/components/filter/components/items/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/es/components/filter/components/items/text/index.d.ts +0 -1
- package/es/components/filter/types.d.ts +1 -0
- package/es/components/iconfont/index.js +1 -1
- package/es/components/page/index.d.ts +1 -3
- package/es/components/page/index.js +2 -4
- package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
- package/es/components/pisellCard/index.d.ts +0 -1
- package/es/components/pisellDatePicker/index.d.ts +0 -1
- package/es/components/pisellToast/index.d.ts +1 -0
- package/es/components/pisellToast/index.js +1 -0
- package/es/components/pisellToast/squareToast/index.js +28 -0
- package/es/components/pisellToast/squareToast/index.less +60 -0
- package/es/components/pisellToast/squareToast/methods.js +136 -0
- package/es/components/pisellToast/squareToast/renderImperatively.js +165 -0
- package/es/components/pisellToast/squareToast/toast.js +60 -0
- package/es/components/pisellUpload/index.d.ts +0 -1
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +73 -5
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
- package/es/components/productCard/cartSkuCard/index.js +2 -11
- package/es/components/productCard/components/Divider/index.d.ts +0 -1
- package/es/components/productCard/components/Header/DeleteButton/index.d.ts +3 -0
- package/es/components/productCard/components/Time/components/Like/index.d.ts +0 -1
- package/es/components/productCard/components/Time/index.d.ts +0 -1
- package/es/components/radio/index.d.ts +0 -1
- package/es/components/segmented/index.d.ts +0 -1
- package/es/components/select-time/RightPanel/index.d.ts +0 -1
- package/es/components/skeleton/index.d.ts +0 -1
- package/es/components/slider/index.d.ts +0 -1
- package/es/components/sort/components/InlineMenu/index.d.ts +0 -1
- package/es/components/table/Actions/component/ViewMode/index.d.ts +0 -1
- package/es/components/table/Summary/index.d.ts +0 -1
- package/es/components/table/Table/fields/date/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/date/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/image/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/image/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/index.d.ts +3 -2
- package/es/components/table/Table/fields/link/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/link/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/number/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/number/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/numberRange/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/numberRange/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/oldRangePicker/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/oldRangePicker/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/oldRangePicker/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/pSwitch/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/pSwitch/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/rangePicker/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/rangePicker/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/rangePicker/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/search/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/search/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/select/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/select/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/select/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/text/Sort/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/index.d.ts +1 -0
- package/es/components/table/Table/fields/treeSelect/Config/index.d.ts +0 -1
- package/es/components/table/Table/fields/treeSelect/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/treeSelect/Sort/index.d.ts +0 -1
- package/es/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/Table/utils.js +22 -1
- package/es/components/table/TableFilter/SortIcon.d.ts +0 -1
- package/es/components/table/hooks/useTableSetting.d.ts +3 -4
- package/es/components/table/hooks/useTableSetting.js +113 -5
- package/es/components/table/index.js +14 -3
- package/es/components/table/types.d.ts +268 -0
- package/es/components/time-picker/index.d.ts +0 -1
- package/es/components/upload/index.d.ts +0 -1
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -1
- package/es/components/virtual-keyboard/Time/utils.d.ts +0 -1
- package/es/components/walletCard/Guest/index.d.ts +0 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/components/appVersionControl/index.d.ts +0 -1
- package/lib/components/auto-complete-number/index.d.ts +0 -1
- package/lib/components/badge/index.d.ts +0 -1
- package/lib/components/batch-editor/fields/index.d.ts +0 -1
- package/lib/components/batch-editor/index.d.ts +1 -0
- package/lib/components/calendar/index.d.ts +0 -1
- package/lib/components/cardPro/index.d.ts +3 -0
- package/lib/components/checkbox/index.d.ts +0 -1
- package/lib/components/classicLayout/index.d.ts +0 -1
- package/lib/components/colorPicker/index.d.ts +0 -1
- package/lib/components/config-provider/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +8 -2
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -3
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +6 -7
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -4
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +78 -7
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
- package/lib/components/dataSourceComponents/fields/ColorPicker/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/IconSelect/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +24 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/TimePicker/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Translation/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +5 -5
- package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +0 -3
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +10 -20
- package/lib/components/date-picker/index.d.ts +1 -0
- package/lib/components/dropdown/index.d.ts +0 -1
- package/lib/components/filter/components/items/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/index.d.ts +0 -1
- package/lib/components/filter/types.d.ts +1 -0
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/page/index.d.ts +1 -3
- package/lib/components/page/index.js +2 -3
- package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
- package/lib/components/pisellCard/index.d.ts +0 -1
- package/lib/components/pisellDatePicker/index.d.ts +0 -1
- package/lib/components/pisellToast/index.d.ts +1 -0
- package/lib/components/pisellToast/index.js +7 -1
- package/lib/components/pisellToast/squareToast/index.js +58 -0
- package/lib/components/pisellToast/squareToast/index.less +60 -0
- package/lib/components/pisellToast/squareToast/methods.js +150 -0
- package/lib/components/pisellToast/squareToast/renderImperatively.js +148 -0
- package/lib/components/pisellToast/squareToast/toast.js +88 -0
- package/lib/components/pisellUpload/index.d.ts +0 -1
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +45 -11
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
- package/lib/components/productCard/cartSkuCard/index.js +2 -13
- package/lib/components/productCard/components/Divider/index.d.ts +0 -1
- package/lib/components/productCard/components/Header/DeleteButton/index.d.ts +3 -0
- package/lib/components/productCard/components/Time/components/Like/index.d.ts +0 -1
- package/lib/components/productCard/components/Time/index.d.ts +0 -1
- package/lib/components/radio/index.d.ts +0 -1
- package/lib/components/segmented/index.d.ts +0 -1
- package/lib/components/select-time/RightPanel/index.d.ts +0 -1
- package/lib/components/skeleton/index.d.ts +0 -1
- package/lib/components/slider/index.d.ts +0 -1
- package/lib/components/sort/components/InlineMenu/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ViewMode/index.d.ts +0 -1
- package/lib/components/table/Summary/index.d.ts +0 -1
- package/lib/components/table/Table/fields/date/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/date/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/image/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/image/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/index.d.ts +3 -2
- package/lib/components/table/Table/fields/link/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/link/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/number/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/number/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/numberRange/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/numberRange/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/oldRangePicker/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/oldRangePicker/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/oldRangePicker/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/pSwitch/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/pSwitch/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/rangePicker/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/rangePicker/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/rangePicker/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/search/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/search/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/select/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/select/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/select/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/text/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/index.d.ts +1 -0
- package/lib/components/table/Table/fields/treeSelect/Config/index.d.ts +0 -1
- package/lib/components/table/Table/fields/treeSelect/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/treeSelect/Sort/index.d.ts +0 -1
- package/lib/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/Table/utils.js +18 -1
- package/lib/components/table/TableFilter/SortIcon.d.ts +0 -1
- package/lib/components/table/hooks/useTableSetting.d.ts +3 -4
- package/lib/components/table/hooks/useTableSetting.js +114 -4
- package/lib/components/table/index.js +12 -1
- package/lib/components/table/types.d.ts +268 -0
- package/lib/components/time-picker/index.d.ts +0 -1
- package/lib/components/upload/index.d.ts +0 -1
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -1
- package/lib/components/virtual-keyboard/Time/utils.d.ts +0 -1
- package/lib/components/walletCard/Guest/index.d.ts +0 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -0
- package/lowcode/data-source-table/meta.ts +239 -0
- package/lowcode/table/meta.ts +104 -0
- package/package.json +11 -11
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +0 -3
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/es/components/pisell-config-provider/index.d.ts +0 -13
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +0 -3
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -6
- package/es/components/virtual-keyboard/Amount/types.d.ts +0 -44
- package/es/components/walletCard/index.d.ts +0 -67
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +0 -3
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/lib/components/pisell-config-provider/index.d.ts +0 -13
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +0 -3
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -6
- package/lib/components/virtual-keyboard/Amount/types.d.ts +0 -44
- package/lib/components/walletCard/index.d.ts +0 -67
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
.pisell-square-toast-wrap {
|
|
2
|
+
pointer-events: none;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.pisell-square-toast-modal {
|
|
6
|
+
pointer-events: none;
|
|
7
|
+
user-select: none;
|
|
8
|
+
min-width: 190px;
|
|
9
|
+
min-height: 74px;
|
|
10
|
+
|
|
11
|
+
// Toast 容器
|
|
12
|
+
.pisell-square-toast {
|
|
13
|
+
min-width: 190px;
|
|
14
|
+
max-width: 201px;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
padding: 32px 12px;
|
|
20
|
+
border-radius: 8px;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
background: rgba(0, 0, 0, 0.8);
|
|
23
|
+
|
|
24
|
+
.pisell-square-toast-icon-wrapper {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
margin-bottom: 11px;
|
|
29
|
+
|
|
30
|
+
.pisell-square-toast-icon {
|
|
31
|
+
font-size: 50px;
|
|
32
|
+
color: #ffffff;
|
|
33
|
+
width: 50px;
|
|
34
|
+
height: 50px;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
|
|
39
|
+
&-loading {
|
|
40
|
+
animation: fadenum 1s infinite linear;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// 内容区域
|
|
46
|
+
.pisell-square-toast-content {
|
|
47
|
+
font-size: 20px;
|
|
48
|
+
line-height: 1.5;
|
|
49
|
+
color: #ffffff;
|
|
50
|
+
text-align: center;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// loading 旋转动画
|
|
56
|
+
@keyframes fadenum {
|
|
57
|
+
to {
|
|
58
|
+
transform: rotate(360deg);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellToast/squareToast/methods.tsx
|
|
30
|
+
var methods_exports = {};
|
|
31
|
+
__export(methods_exports, {
|
|
32
|
+
clear: () => clear,
|
|
33
|
+
fail: () => fail,
|
|
34
|
+
hide: () => hide,
|
|
35
|
+
info: () => info,
|
|
36
|
+
loading: () => loading,
|
|
37
|
+
show: () => show,
|
|
38
|
+
success: () => success
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(methods_exports);
|
|
41
|
+
var import_react = __toESM(require("react"));
|
|
42
|
+
var import_toast = __toESM(require("./toast"));
|
|
43
|
+
var import_renderImperatively = require("./renderImperatively");
|
|
44
|
+
var currentHandler = null;
|
|
45
|
+
var currentTimeout = null;
|
|
46
|
+
var defaultProps = {
|
|
47
|
+
duration: 2e3,
|
|
48
|
+
mask: false,
|
|
49
|
+
icon: "info"
|
|
50
|
+
};
|
|
51
|
+
function mergeProps(a, b) {
|
|
52
|
+
const filteredB = Object.keys(b).reduce((acc, key) => {
|
|
53
|
+
if (b[key] !== void 0) {
|
|
54
|
+
acc[key] = b[key];
|
|
55
|
+
}
|
|
56
|
+
return acc;
|
|
57
|
+
}, {});
|
|
58
|
+
return {
|
|
59
|
+
...a,
|
|
60
|
+
...filteredB
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
var show = (configOrContent, duration, afterClose) => {
|
|
64
|
+
var _a;
|
|
65
|
+
let props;
|
|
66
|
+
if (typeof configOrContent === "string" || import_react.default.isValidElement(configOrContent)) {
|
|
67
|
+
props = mergeProps(defaultProps, {
|
|
68
|
+
content: configOrContent,
|
|
69
|
+
...duration !== void 0 && { duration },
|
|
70
|
+
...afterClose !== void 0 && { afterClose }
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
props = mergeProps(defaultProps, configOrContent || {});
|
|
74
|
+
}
|
|
75
|
+
const element = /* @__PURE__ */ import_react.default.createElement(
|
|
76
|
+
import_toast.default,
|
|
77
|
+
{
|
|
78
|
+
...props,
|
|
79
|
+
onCancel: () => {
|
|
80
|
+
currentHandler = null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
if (currentHandler) {
|
|
85
|
+
if ((_a = currentHandler.isRendered) == null ? void 0 : _a.call(currentHandler)) {
|
|
86
|
+
currentHandler.replace(element);
|
|
87
|
+
} else {
|
|
88
|
+
currentHandler.close();
|
|
89
|
+
currentHandler = (0, import_renderImperatively.renderImperatively)(element);
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
currentHandler = (0, import_renderImperatively.renderImperatively)(element);
|
|
93
|
+
}
|
|
94
|
+
if (currentTimeout) {
|
|
95
|
+
window.clearTimeout(currentTimeout);
|
|
96
|
+
}
|
|
97
|
+
if (props.duration !== 0) {
|
|
98
|
+
currentTimeout = window.setTimeout(() => {
|
|
99
|
+
clear();
|
|
100
|
+
}, props.duration);
|
|
101
|
+
}
|
|
102
|
+
const instance = {
|
|
103
|
+
close: () => {
|
|
104
|
+
if (currentHandler) {
|
|
105
|
+
currentHandler.close();
|
|
106
|
+
currentHandler = null;
|
|
107
|
+
}
|
|
108
|
+
if (currentTimeout) {
|
|
109
|
+
window.clearTimeout(currentTimeout);
|
|
110
|
+
currentTimeout = null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
return instance;
|
|
115
|
+
};
|
|
116
|
+
var clear = () => {
|
|
117
|
+
if (currentHandler) {
|
|
118
|
+
currentHandler.close();
|
|
119
|
+
currentHandler = null;
|
|
120
|
+
}
|
|
121
|
+
if (currentTimeout) {
|
|
122
|
+
window.clearTimeout(currentTimeout);
|
|
123
|
+
currentTimeout = null;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
var success = (content, duration, afterClose) => {
|
|
127
|
+
return show({ content, icon: "success", duration, afterClose });
|
|
128
|
+
};
|
|
129
|
+
var info = (content, duration, afterClose) => {
|
|
130
|
+
return show({ content, icon: "info", duration, afterClose });
|
|
131
|
+
};
|
|
132
|
+
var loading = (content, duration, afterClose) => {
|
|
133
|
+
return show({ content, icon: "loading", duration, afterClose });
|
|
134
|
+
};
|
|
135
|
+
var fail = (content, duration, afterClose) => {
|
|
136
|
+
return show({ content, icon: "error", duration, afterClose });
|
|
137
|
+
};
|
|
138
|
+
var hide = () => {
|
|
139
|
+
clear();
|
|
140
|
+
};
|
|
141
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
142
|
+
0 && (module.exports = {
|
|
143
|
+
clear,
|
|
144
|
+
fail,
|
|
145
|
+
hide,
|
|
146
|
+
info,
|
|
147
|
+
loading,
|
|
148
|
+
show,
|
|
149
|
+
success
|
|
150
|
+
});
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellToast/squareToast/renderImperatively.tsx
|
|
30
|
+
var renderImperatively_exports = {};
|
|
31
|
+
__export(renderImperatively_exports, {
|
|
32
|
+
render: () => render,
|
|
33
|
+
renderImperatively: () => renderImperatively,
|
|
34
|
+
renderToBody: () => renderToBody,
|
|
35
|
+
unmount: () => unmount,
|
|
36
|
+
unstableSetRender: () => unstableSetRender
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(renderImperatively_exports);
|
|
39
|
+
var ReactDOM = __toESM(require("react-dom"));
|
|
40
|
+
var import_client = require("react-dom/client");
|
|
41
|
+
var import_react = __toESM(require("react"));
|
|
42
|
+
var MARK = "__pisell_react_root__";
|
|
43
|
+
function render(node, container) {
|
|
44
|
+
const root = container[MARK] || (0, import_client.createRoot)(container);
|
|
45
|
+
root.render(node);
|
|
46
|
+
container[MARK] = root;
|
|
47
|
+
}
|
|
48
|
+
async function unmount(container) {
|
|
49
|
+
return Promise.resolve().then(() => {
|
|
50
|
+
var _a;
|
|
51
|
+
(_a = container[MARK]) == null ? void 0 : _a.unmount();
|
|
52
|
+
delete container[MARK];
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
var defaultReactRender = (node, container) => {
|
|
56
|
+
if (process.env.NODE_ENV !== "production") {
|
|
57
|
+
const majorVersion = parseInt(import_react.default.version.split(".")[0], 10);
|
|
58
|
+
const fullKeys = Object.keys(ReactDOM);
|
|
59
|
+
console.warn(
|
|
60
|
+
majorVersion < 19 || fullKeys.includes("createRoot"),
|
|
61
|
+
`[Compatible] Toast support React is 16 ~ 18.`
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
render(node, container);
|
|
65
|
+
return () => {
|
|
66
|
+
return unmount(container);
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
var unstableRender = defaultReactRender;
|
|
70
|
+
function unstableSetRender(render2) {
|
|
71
|
+
if (render2) {
|
|
72
|
+
unstableRender = render2;
|
|
73
|
+
}
|
|
74
|
+
return unstableRender;
|
|
75
|
+
}
|
|
76
|
+
function renderToBody(element) {
|
|
77
|
+
const container = document.createElement("div");
|
|
78
|
+
document.body.appendChild(container);
|
|
79
|
+
return unstableSetRender()(element, container);
|
|
80
|
+
}
|
|
81
|
+
function renderImperatively(element) {
|
|
82
|
+
const Wrapper = import_react.default.forwardRef((_, ref) => {
|
|
83
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
84
|
+
const closedRef = (0, import_react.useRef)(false);
|
|
85
|
+
const [elementToRender, setElementToRender] = (0, import_react.useState)(element);
|
|
86
|
+
const keyRef = (0, import_react.useRef)(0);
|
|
87
|
+
(0, import_react.useEffect)(() => {
|
|
88
|
+
if (!closedRef.current) {
|
|
89
|
+
setOpen(true);
|
|
90
|
+
} else {
|
|
91
|
+
afterClose();
|
|
92
|
+
}
|
|
93
|
+
}, []);
|
|
94
|
+
function onCancel() {
|
|
95
|
+
var _a, _b;
|
|
96
|
+
closedRef.current = true;
|
|
97
|
+
setOpen(false);
|
|
98
|
+
(_b = (_a = elementToRender.props).onCancel) == null ? void 0 : _b.call(_a);
|
|
99
|
+
}
|
|
100
|
+
function afterClose() {
|
|
101
|
+
var _a, _b;
|
|
102
|
+
unmount2();
|
|
103
|
+
(_b = (_a = elementToRender.props).afterClose) == null ? void 0 : _b.call(_a);
|
|
104
|
+
}
|
|
105
|
+
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
106
|
+
close: onCancel,
|
|
107
|
+
replace: (element2) => {
|
|
108
|
+
var _a, _b;
|
|
109
|
+
keyRef.current++;
|
|
110
|
+
(_b = (_a = elementToRender.props).afterClose) == null ? void 0 : _b.call(_a);
|
|
111
|
+
setElementToRender(element2);
|
|
112
|
+
}
|
|
113
|
+
}));
|
|
114
|
+
return import_react.default.cloneElement(elementToRender, {
|
|
115
|
+
...elementToRender.props,
|
|
116
|
+
key: keyRef.current,
|
|
117
|
+
open,
|
|
118
|
+
onCancel,
|
|
119
|
+
afterClose
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
const wrapperRef = import_react.default.createRef();
|
|
123
|
+
const unmount2 = renderToBody(/* @__PURE__ */ import_react.default.createElement(Wrapper, { ref: wrapperRef }));
|
|
124
|
+
return {
|
|
125
|
+
close: async () => {
|
|
126
|
+
var _a, _b, _c;
|
|
127
|
+
if (!wrapperRef.current) {
|
|
128
|
+
unmount2();
|
|
129
|
+
(_b = (_a = element.props).afterClose) == null ? void 0 : _b.call(_a);
|
|
130
|
+
} else {
|
|
131
|
+
(_c = wrapperRef.current) == null ? void 0 : _c.close();
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
replace: (element2) => {
|
|
135
|
+
var _a;
|
|
136
|
+
(_a = wrapperRef.current) == null ? void 0 : _a.replace(element2);
|
|
137
|
+
},
|
|
138
|
+
isRendered: () => !!wrapperRef.current
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
142
|
+
0 && (module.exports = {
|
|
143
|
+
render,
|
|
144
|
+
renderImperatively,
|
|
145
|
+
renderToBody,
|
|
146
|
+
unmount,
|
|
147
|
+
unstableSetRender
|
|
148
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellToast/squareToast/toast.tsx
|
|
30
|
+
var toast_exports = {};
|
|
31
|
+
__export(toast_exports, {
|
|
32
|
+
default: () => toast_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(toast_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_modal = __toESM(require("../../modal"));
|
|
37
|
+
var import_icon = __toESM(require("../../icon"));
|
|
38
|
+
var import_classnames = __toESM(require("classnames"));
|
|
39
|
+
var import_index = require("./index.less");
|
|
40
|
+
var icons = {
|
|
41
|
+
info: "",
|
|
42
|
+
success: "iconchenggong-1-01",
|
|
43
|
+
error: "icon-warning",
|
|
44
|
+
warning: "icon-warning",
|
|
45
|
+
loading: "icon-loading",
|
|
46
|
+
fail: "icon-warning"
|
|
47
|
+
};
|
|
48
|
+
var Toast = ({
|
|
49
|
+
content,
|
|
50
|
+
open,
|
|
51
|
+
icon,
|
|
52
|
+
className,
|
|
53
|
+
...rest
|
|
54
|
+
}) => {
|
|
55
|
+
const iconElement = (0, import_react.useMemo)(() => {
|
|
56
|
+
if (icon === null || icon === void 0) return null;
|
|
57
|
+
if (typeof icon === "string" && icon in icons) {
|
|
58
|
+
if (!icons[icon]) return null;
|
|
59
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
60
|
+
import_icon.default,
|
|
61
|
+
{
|
|
62
|
+
type: icons[icon],
|
|
63
|
+
className: `pisell-square-toast-icon pisell-square-toast-icon-${icon}`
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
return icon;
|
|
68
|
+
}, [icon]);
|
|
69
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
70
|
+
import_modal.default,
|
|
71
|
+
{
|
|
72
|
+
open,
|
|
73
|
+
footer: null,
|
|
74
|
+
closable: false,
|
|
75
|
+
centered: true,
|
|
76
|
+
maskTransitionName: "",
|
|
77
|
+
transitionName: "",
|
|
78
|
+
width: "unset",
|
|
79
|
+
wrapClassName: "pisell-square-toast-wrap",
|
|
80
|
+
className: (0, import_classnames.default)("pisell-square-toast-modal", className),
|
|
81
|
+
bodyStyle: { padding: 0 },
|
|
82
|
+
destroyOnClose: true,
|
|
83
|
+
modalRender: () => /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-square-toast` }, iconElement && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-square-toast-icon-wrapper" }, iconElement), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-square-toast-content" }, content)),
|
|
84
|
+
...rest
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
var toast_default = Toast;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare type NativeProps<S extends string = never> = {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties & Partial<Record<S, string>>;
|
|
6
|
+
};
|
|
7
|
+
declare type PropagationEvent = 'click';
|
|
8
|
+
import './index.less';
|
|
9
|
+
declare type SideType = 'left' | 'right';
|
|
10
|
+
export declare type SwipeActionRef = {
|
|
11
|
+
close: () => void;
|
|
12
|
+
show: (side?: SideType) => void;
|
|
13
|
+
};
|
|
14
|
+
declare type ActionColor = 'light' | 'weak' | 'primary' | 'success' | 'warning' | 'danger';
|
|
15
|
+
export declare type Action = {
|
|
16
|
+
key: string | number;
|
|
17
|
+
text: ReactNode;
|
|
18
|
+
color?: ActionColor | string;
|
|
19
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
};
|
|
22
|
+
export declare type SwipeActionProps = {
|
|
23
|
+
rightActions?: Action[];
|
|
24
|
+
leftActions?: Action[];
|
|
25
|
+
onAction?: (action: Action, e: React.MouseEvent) => void;
|
|
26
|
+
closeOnTouchOutside?: boolean;
|
|
27
|
+
closeOnAction?: boolean;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
stopPropagation?: PropagationEvent[];
|
|
30
|
+
onActionsReveal?: (side: SideType) => void;
|
|
31
|
+
onClose?: () => void;
|
|
32
|
+
escapeDom?: string;
|
|
33
|
+
} & NativeProps<'--background'>;
|
|
34
|
+
export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
|
35
|
+
rightActions?: Action[] | undefined;
|
|
36
|
+
leftActions?: Action[] | undefined;
|
|
37
|
+
onAction?: ((action: Action, e: React.MouseEvent) => void) | undefined;
|
|
38
|
+
closeOnTouchOutside?: boolean | undefined;
|
|
39
|
+
closeOnAction?: boolean | undefined;
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
stopPropagation?: "click"[] | undefined;
|
|
42
|
+
onActionsReveal?: ((side: SideType) => void) | undefined;
|
|
43
|
+
onClose?: (() => void) | undefined;
|
|
44
|
+
escapeDom?: string | undefined;
|
|
45
|
+
} & NativeProps<"--background"> & React.RefAttributes<SwipeActionRef>>;
|
|
46
|
+
export {};
|
|
@@ -110,17 +110,26 @@ var SwipeAction = (0, import_react.forwardRef)(
|
|
|
110
110
|
const rootRef = (0, import_react.useRef)(null);
|
|
111
111
|
const leftRef = (0, import_react.useRef)(null);
|
|
112
112
|
const rightRef = (0, import_react.useRef)(null);
|
|
113
|
+
const [containerHeight, setContainerHeight] = (0, import_react.useState)(0);
|
|
113
114
|
function getWidth(ref2) {
|
|
114
115
|
const element = ref2.current;
|
|
115
116
|
if (!element) return 0;
|
|
116
117
|
return element.offsetWidth;
|
|
117
118
|
}
|
|
119
|
+
function getHeight(ref2) {
|
|
120
|
+
const element = ref2.current;
|
|
121
|
+
if (!element) return 0;
|
|
122
|
+
return element.offsetHeight;
|
|
123
|
+
}
|
|
118
124
|
function getLeftWidth() {
|
|
119
125
|
return getWidth(leftRef);
|
|
120
126
|
}
|
|
121
127
|
function getRightWidth() {
|
|
122
128
|
return getWidth(rightRef);
|
|
123
129
|
}
|
|
130
|
+
function getRootHeight() {
|
|
131
|
+
return getHeight(rootRef);
|
|
132
|
+
}
|
|
124
133
|
const [{ x }, api] = (0, import_web.useSpring)(
|
|
125
134
|
() => ({
|
|
126
135
|
x: 0,
|
|
@@ -213,6 +222,20 @@ var SwipeAction = (0, import_react.forwardRef)(
|
|
|
213
222
|
},
|
|
214
223
|
close
|
|
215
224
|
}));
|
|
225
|
+
(0, import_react.useEffect)(() => {
|
|
226
|
+
const updateHeight = () => {
|
|
227
|
+
const height = getRootHeight();
|
|
228
|
+
setContainerHeight(height);
|
|
229
|
+
};
|
|
230
|
+
updateHeight();
|
|
231
|
+
const resizeObserver = new ResizeObserver(updateHeight);
|
|
232
|
+
if (rootRef.current) {
|
|
233
|
+
resizeObserver.observe(rootRef.current);
|
|
234
|
+
}
|
|
235
|
+
return () => {
|
|
236
|
+
resizeObserver.disconnect();
|
|
237
|
+
};
|
|
238
|
+
}, []);
|
|
216
239
|
(0, import_react.useEffect)(() => {
|
|
217
240
|
if (!props.closeOnTouchOutside) return;
|
|
218
241
|
function handle(e) {
|
|
@@ -238,14 +261,32 @@ var SwipeAction = (0, import_react.forwardRef)(
|
|
|
238
261
|
document.removeEventListener("mousedown", handle);
|
|
239
262
|
};
|
|
240
263
|
}, [props.closeOnTouchOutside, props.escapeDom]);
|
|
241
|
-
|
|
264
|
+
const getRightContainerClass = () => {
|
|
265
|
+
const baseClass = `${classPrefix}-actions ${classPrefix}-actions-right`;
|
|
266
|
+
if (containerHeight > 180) {
|
|
267
|
+
return `${baseClass} ${classPrefix}-height-large`;
|
|
268
|
+
} else if (containerHeight > 120) {
|
|
269
|
+
return `${baseClass} ${classPrefix}-height-medium`;
|
|
270
|
+
}
|
|
271
|
+
return `${baseClass} ${classPrefix}-height-small`;
|
|
272
|
+
};
|
|
273
|
+
const getRightActionButtonClass = () => {
|
|
274
|
+
if (containerHeight > 180) {
|
|
275
|
+
return `${classPrefix}-action-height-large`;
|
|
276
|
+
} else if (containerHeight > 120) {
|
|
277
|
+
return `${classPrefix}-action-height-medium`;
|
|
278
|
+
}
|
|
279
|
+
return `${classPrefix}-action-height-small`;
|
|
280
|
+
};
|
|
281
|
+
function renderAction(action, isRightAction = false) {
|
|
242
282
|
const color = action.color ?? "light";
|
|
243
283
|
const _style = action.style || {};
|
|
284
|
+
const buttonClass = isRightAction ? `${classPrefix}-action-button ${getRightActionButtonClass()}` : `${classPrefix}-action-button`;
|
|
244
285
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
245
286
|
Button,
|
|
246
287
|
{
|
|
247
288
|
key: action.key,
|
|
248
|
-
className:
|
|
289
|
+
className: buttonClass,
|
|
249
290
|
style: {
|
|
250
291
|
"--background-color": colorRecord[color] ?? color,
|
|
251
292
|
..._style
|
|
@@ -285,7 +326,7 @@ var SwipeAction = (0, import_react.forwardRef)(
|
|
|
285
326
|
className: `${classPrefix}-actions ${classPrefix}-actions-left`,
|
|
286
327
|
ref: leftRef
|
|
287
328
|
},
|
|
288
|
-
props.leftActions.map(renderAction)
|
|
329
|
+
props.leftActions.map((action) => renderAction(action, false))
|
|
289
330
|
)
|
|
290
331
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
291
332
|
"div",
|
|
@@ -312,14 +353,7 @@ var SwipeAction = (0, import_react.forwardRef)(
|
|
|
312
353
|
)
|
|
313
354
|
), withStopPropagation(
|
|
314
355
|
props.stopPropagation,
|
|
315
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
316
|
-
"div",
|
|
317
|
-
{
|
|
318
|
-
className: `${classPrefix}-actions ${classPrefix}-actions-right`,
|
|
319
|
-
ref: rightRef
|
|
320
|
-
},
|
|
321
|
-
props.rightActions.map(renderAction)
|
|
322
|
-
)
|
|
356
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: getRightContainerClass(), ref: rightRef }, props.rightActions.map((action) => renderAction(action, true)))
|
|
323
357
|
))
|
|
324
358
|
)
|
|
325
359
|
);
|
|
@@ -33,3 +33,42 @@
|
|
|
33
33
|
padding-right: 4px;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
+
|
|
37
|
+
.pisell-custom-swipe-action-action-button {
|
|
38
|
+
min-width: 80px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* 容器样式 */
|
|
42
|
+
.pisell-custom-swipe-action-height-large {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
background-color: rgba(67, 93, 147, 0.3);
|
|
46
|
+
justify-content: flex-start;
|
|
47
|
+
|
|
48
|
+
.pisell-number-selector-btn {
|
|
49
|
+
width: 40px !important;
|
|
50
|
+
height: 40px !important;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.pisell-custom-swipe-action-height-medium {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
background-color: rgba(67, 93, 147, 0.3);
|
|
58
|
+
|
|
59
|
+
.pisell-number-selector-btn {
|
|
60
|
+
width: 40px !important;
|
|
61
|
+
height: 40px !important;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* 按钮样式 */
|
|
66
|
+
.pisell-custom-swipe-action-action-height-large {
|
|
67
|
+
height: 60px;
|
|
68
|
+
width: 200px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.pisell-custom-swipe-action-action-height-medium {
|
|
72
|
+
flex: 1;
|
|
73
|
+
width: 200px;
|
|
74
|
+
}
|
|
@@ -199,7 +199,7 @@ var CartSkuCard = (props) => {
|
|
|
199
199
|
}
|
|
200
200
|
return renderA2();
|
|
201
201
|
};
|
|
202
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
202
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
203
203
|
import_swipeAction.SwipeAction,
|
|
204
204
|
{
|
|
205
205
|
closeOnAction: false,
|
|
@@ -219,18 +219,7 @@ var CartSkuCard = (props) => {
|
|
|
219
219
|
},
|
|
220
220
|
renderContent()
|
|
221
221
|
)
|
|
222
|
-
)
|
|
223
|
-
"div",
|
|
224
|
-
{
|
|
225
|
-
className: (0, import_classnames.default)(PREFIX, `${PREFIX}-${type}`),
|
|
226
|
-
onClick: (e) => {
|
|
227
|
-
e.preventDefault();
|
|
228
|
-
e.stopPropagation();
|
|
229
|
-
onCard == null ? void 0 : onCard(dataSource);
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
renderContent()
|
|
233
|
-
)));
|
|
222
|
+
);
|
|
234
223
|
};
|
|
235
224
|
var cartSkuCard_default = CartSkuCard;
|
|
236
225
|
// Annotate the CommonJS export names for ESM import in node:
|