@pisell/materials 6.11.12 → 6.11.13

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.
Files changed (215) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +2 -2
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +3 -3
  9. package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
  10. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +0 -1
  11. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
  12. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +0 -1
  13. package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  14. package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  15. package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  16. package/es/components/dataSourceComponents/fields/index.d.ts +14 -14
  17. package/es/components/pisellDataSourceContainer/hooks/useDataSourceKey.d.ts +0 -1
  18. package/es/components/pisellDatePicker/index.d.ts +0 -1
  19. package/es/components/productCard/cartSkuCard/components/Gift/index.js +1 -1
  20. package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +5 -3
  21. package/es/components/productCard/cartSkuCard/components/basicInfo/index.less +1 -1
  22. package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  23. package/es/components/productCard/cartSkuCard/components/timeRange/index.js +1 -0
  24. package/es/components/productCard/cartSkuCard/index.js +5 -1
  25. package/es/components/productCard/components/Packages/utils.d.ts +1 -1
  26. package/es/components/table/Table/utils.d.ts +1 -1
  27. package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
  28. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +0 -1
  29. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
  30. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +0 -1
  31. package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  32. package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  33. package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  34. package/lib/components/dataSourceComponents/fields/index.d.ts +14 -14
  35. package/lib/components/pisellDataSourceContainer/hooks/useDataSourceKey.d.ts +0 -1
  36. package/lib/components/pisellDatePicker/index.d.ts +0 -1
  37. package/lib/components/productCard/cartSkuCard/components/Gift/index.js +1 -1
  38. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +7 -1
  39. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.less +1 -1
  40. package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  41. package/lib/components/productCard/cartSkuCard/components/timeRange/index.js +1 -0
  42. package/lib/components/productCard/cartSkuCard/index.js +5 -1
  43. package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
  44. package/lib/components/table/Table/utils.d.ts +1 -1
  45. package/package.json +3 -3
  46. package/es/components/PisellCards/components/GraphicTextCard/components/BadgeWrapper.d.ts +0 -5
  47. package/es/components/PisellCards/components/GraphicTextCard/components/TextContent.d.ts +0 -27
  48. package/es/components/PisellCards/components/GraphicTextCard/hooks/index.d.ts +0 -5
  49. package/es/components/PisellCards/components/GraphicTextCard/hooks/useGraphicTextCardClick.d.ts +0 -15
  50. package/es/components/PisellCards/components/GraphicTextCard/hooks/useGraphicTextCardStyle.d.ts +0 -18
  51. package/es/components/PisellCards/components/GraphicTextCard/types.d.ts +0 -290
  52. package/es/components/PisellCards/components/GraphicTextCard/utils/index.d.ts +0 -19
  53. package/es/components/PisellCards/components/MultilevelCard/components/PanelWrapper.d.ts +0 -7
  54. package/es/components/PisellCards/components/TextCard/TextCard.d.ts +0 -8
  55. package/es/components/PisellCards/components/TextCard/components/BadgeWrapper.d.ts +0 -26
  56. package/es/components/PisellCards/components/TextCard/components/IconWrapper.d.ts +0 -17
  57. package/es/components/PisellCards/components/TextCard/components/TextContent.d.ts +0 -21
  58. package/es/components/PisellCards/components/TextCard/components/index.d.ts +0 -6
  59. package/es/components/PisellCards/components/TextCard/index.d.ts +0 -5
  60. package/es/components/PisellCards/components/TextCard/types.d.ts +0 -270
  61. package/es/components/PisellSteps/PisellSteps.d.ts +0 -14
  62. package/es/components/PisellSuperTabs/PisellSuperTabs.d.ts +0 -8
  63. package/es/components/PisellSuperTabs/hooks/index.d.ts +0 -1
  64. package/es/components/PisellSuperTabs/hooks/useTabsState.d.ts +0 -7
  65. package/es/components/PisellSuperTabs/index.d.ts +0 -3
  66. package/es/components/PisellSuperTabs/types.d.ts +0 -212
  67. package/es/components/PisellTabbar/constants.d.ts +0 -47
  68. package/es/components/PisellTabbar/hooks/index.d.ts +0 -2
  69. package/es/components/PisellTabbar/hooks/useActiveKey.d.ts +0 -55
  70. package/es/components/PisellTabbar/hooks/useExpand.d.ts +0 -42
  71. package/es/components/PisellTabbar/template/Template1/constants.d.ts +0 -10
  72. package/es/components/PisellTabbar/template/Template1/utils/index.d.ts +0 -35
  73. package/es/components/PisellTabbar/types.d.ts +0 -90
  74. package/es/components/PisellTabbar/utils/index.d.ts +0 -69
  75. package/es/components/cardPro/index.d.ts +0 -4
  76. package/es/components/config-provider/index.d.ts +0 -10
  77. package/es/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +0 -26
  78. package/es/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +0 -27
  79. package/es/components/dataSourceComponents/fields/Upload/constants.d.ts +0 -9
  80. package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +0 -15
  81. package/es/components/drag-sort-tree/TreeItem/index.d.ts +0 -19
  82. package/es/components/drag-sort-tree/index.d.ts +0 -5
  83. package/es/components/filter/components/Dropdown/types.d.ts +0 -13
  84. package/es/components/filter/components/FilterButton/types.d.ts +0 -24
  85. package/es/components/filter/types.d.ts +0 -48
  86. package/es/components/iconfont/index.d.ts +0 -8
  87. package/es/components/login-and-register/index.d.ts +0 -82
  88. package/es/components/pisell-config-provider/context.d.ts +0 -22
  89. package/es/components/pisellAdjustPrice/status.d.ts +0 -32
  90. package/es/components/pisellAdjustPrice/type.d.ts +0 -22
  91. package/es/components/pisellEmpty/index.d.ts +0 -19
  92. package/es/components/pisellFilter/type.d.ts +0 -5
  93. package/es/components/pisellGridPro/index.d.ts +0 -4
  94. package/es/components/pisellLookup/components/LookupTrigger.d.ts +0 -3
  95. package/es/components/pisellQuickFilter/type.d.ts +0 -12
  96. package/es/components/pisellStatisticList/index.d.ts +0 -22
  97. package/es/components/pisellToast/squareToast/index.d.ts +0 -15
  98. package/es/components/pisellToast/squareToast/methods.d.ts +0 -13
  99. package/es/components/pisellToast/squareToast/renderImperatively.d.ts +0 -28
  100. package/es/components/pisellToast/squareToast/toast.d.ts +0 -25
  101. package/es/components/productCard/cartSkuCard/components/Gift/types.d.ts +0 -29
  102. package/es/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +0 -14
  103. package/es/components/productCard/cartSkuCard/components/Promotion/index.d.ts +0 -7
  104. package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +0 -36
  105. package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +0 -46
  106. package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -9
  107. package/es/components/productCard/cartSkuCard/index.d.ts +0 -11
  108. package/es/components/productCard/cartSkuCard/locales.d.ts +0 -178
  109. package/es/components/productCard/components/Action/index.d.ts +0 -4
  110. package/es/components/productCard/components/Header/DeleteButton/index.d.ts +0 -4
  111. package/es/components/productCard/locales.d.ts +0 -138
  112. package/es/components/productCard/status.d.ts +0 -32
  113. package/es/components/productCard/types.d.ts +0 -95
  114. package/es/components/select/index.d.ts +0 -9
  115. package/es/components/table/Actions/component/ViewMode/index.d.ts +0 -9
  116. package/es/components/table/Table/fields/select/Edit/index.d.ts +0 -4
  117. package/es/components/table/types.d.ts +0 -268
  118. package/es/components/translation/utils.d.ts +0 -9
  119. package/es/components/virtual-keyboard/Amount/themeConfig.d.ts +0 -32
  120. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -15
  121. package/es/components/virtual-keyboard/Keyboard/index.d.ts +0 -21
  122. package/es/components/virtual-keyboard/Number/themeConfig.d.ts +0 -32
  123. package/es/components/virtual-keyboard/Number/types.d.ts +0 -26
  124. package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -13
  125. package/es/locales/en-US.d.ts +0 -384
  126. package/es/locales/index.d.ts +0 -1
  127. package/es/locales/ja.d.ts +0 -348
  128. package/es/locales/pt.d.ts +0 -348
  129. package/es/locales/zh-CN.d.ts +0 -379
  130. package/es/locales/zh-TW.d.ts +0 -379
  131. package/lib/components/PisellCards/components/GraphicTextCard/components/BadgeWrapper.d.ts +0 -5
  132. package/lib/components/PisellCards/components/GraphicTextCard/components/TextContent.d.ts +0 -27
  133. package/lib/components/PisellCards/components/GraphicTextCard/hooks/index.d.ts +0 -5
  134. package/lib/components/PisellCards/components/GraphicTextCard/hooks/useGraphicTextCardClick.d.ts +0 -15
  135. package/lib/components/PisellCards/components/GraphicTextCard/hooks/useGraphicTextCardStyle.d.ts +0 -18
  136. package/lib/components/PisellCards/components/GraphicTextCard/types.d.ts +0 -290
  137. package/lib/components/PisellCards/components/GraphicTextCard/utils/index.d.ts +0 -19
  138. package/lib/components/PisellCards/components/MultilevelCard/components/PanelWrapper.d.ts +0 -7
  139. package/lib/components/PisellCards/components/TextCard/TextCard.d.ts +0 -8
  140. package/lib/components/PisellCards/components/TextCard/components/BadgeWrapper.d.ts +0 -26
  141. package/lib/components/PisellCards/components/TextCard/components/IconWrapper.d.ts +0 -17
  142. package/lib/components/PisellCards/components/TextCard/components/TextContent.d.ts +0 -21
  143. package/lib/components/PisellCards/components/TextCard/components/index.d.ts +0 -6
  144. package/lib/components/PisellCards/components/TextCard/index.d.ts +0 -5
  145. package/lib/components/PisellCards/components/TextCard/types.d.ts +0 -270
  146. package/lib/components/PisellSteps/PisellSteps.d.ts +0 -14
  147. package/lib/components/PisellSuperTabs/PisellSuperTabs.d.ts +0 -8
  148. package/lib/components/PisellSuperTabs/hooks/index.d.ts +0 -1
  149. package/lib/components/PisellSuperTabs/hooks/useTabsState.d.ts +0 -7
  150. package/lib/components/PisellSuperTabs/index.d.ts +0 -3
  151. package/lib/components/PisellSuperTabs/types.d.ts +0 -212
  152. package/lib/components/PisellTabbar/constants.d.ts +0 -47
  153. package/lib/components/PisellTabbar/hooks/index.d.ts +0 -2
  154. package/lib/components/PisellTabbar/hooks/useActiveKey.d.ts +0 -55
  155. package/lib/components/PisellTabbar/hooks/useExpand.d.ts +0 -42
  156. package/lib/components/PisellTabbar/template/Template1/constants.d.ts +0 -10
  157. package/lib/components/PisellTabbar/template/Template1/utils/index.d.ts +0 -35
  158. package/lib/components/PisellTabbar/types.d.ts +0 -90
  159. package/lib/components/PisellTabbar/utils/index.d.ts +0 -69
  160. package/lib/components/cardPro/index.d.ts +0 -4
  161. package/lib/components/config-provider/index.d.ts +0 -10
  162. package/lib/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +0 -26
  163. package/lib/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +0 -27
  164. package/lib/components/dataSourceComponents/fields/Upload/constants.d.ts +0 -9
  165. package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +0 -15
  166. package/lib/components/drag-sort-tree/TreeItem/index.d.ts +0 -19
  167. package/lib/components/drag-sort-tree/index.d.ts +0 -5
  168. package/lib/components/filter/components/Dropdown/types.d.ts +0 -13
  169. package/lib/components/filter/components/FilterButton/types.d.ts +0 -24
  170. package/lib/components/filter/types.d.ts +0 -48
  171. package/lib/components/iconfont/index.d.ts +0 -8
  172. package/lib/components/login-and-register/index.d.ts +0 -82
  173. package/lib/components/pisell-config-provider/context.d.ts +0 -22
  174. package/lib/components/pisellAdjustPrice/status.d.ts +0 -32
  175. package/lib/components/pisellAdjustPrice/type.d.ts +0 -22
  176. package/lib/components/pisellEmpty/index.d.ts +0 -19
  177. package/lib/components/pisellFilter/type.d.ts +0 -5
  178. package/lib/components/pisellGridPro/index.d.ts +0 -4
  179. package/lib/components/pisellLookup/components/LookupTrigger.d.ts +0 -3
  180. package/lib/components/pisellQuickFilter/type.d.ts +0 -12
  181. package/lib/components/pisellStatisticList/index.d.ts +0 -22
  182. package/lib/components/pisellToast/squareToast/index.d.ts +0 -15
  183. package/lib/components/pisellToast/squareToast/methods.d.ts +0 -13
  184. package/lib/components/pisellToast/squareToast/renderImperatively.d.ts +0 -28
  185. package/lib/components/pisellToast/squareToast/toast.d.ts +0 -25
  186. package/lib/components/productCard/cartSkuCard/components/Gift/types.d.ts +0 -29
  187. package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +0 -14
  188. package/lib/components/productCard/cartSkuCard/components/Promotion/index.d.ts +0 -7
  189. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +0 -36
  190. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +0 -46
  191. package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -9
  192. package/lib/components/productCard/cartSkuCard/index.d.ts +0 -11
  193. package/lib/components/productCard/cartSkuCard/locales.d.ts +0 -178
  194. package/lib/components/productCard/components/Action/index.d.ts +0 -4
  195. package/lib/components/productCard/components/Header/DeleteButton/index.d.ts +0 -4
  196. package/lib/components/productCard/locales.d.ts +0 -138
  197. package/lib/components/productCard/status.d.ts +0 -32
  198. package/lib/components/productCard/types.d.ts +0 -95
  199. package/lib/components/select/index.d.ts +0 -9
  200. package/lib/components/table/Actions/component/ViewMode/index.d.ts +0 -9
  201. package/lib/components/table/Table/fields/select/Edit/index.d.ts +0 -4
  202. package/lib/components/table/types.d.ts +0 -268
  203. package/lib/components/translation/utils.d.ts +0 -9
  204. package/lib/components/virtual-keyboard/Amount/themeConfig.d.ts +0 -32
  205. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -15
  206. package/lib/components/virtual-keyboard/Keyboard/index.d.ts +0 -21
  207. package/lib/components/virtual-keyboard/Number/themeConfig.d.ts +0 -32
  208. package/lib/components/virtual-keyboard/Number/types.d.ts +0 -26
  209. package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -13
  210. package/lib/locales/en-US.d.ts +0 -384
  211. package/lib/locales/index.d.ts +0 -1
  212. package/lib/locales/ja.d.ts +0 -348
  213. package/lib/locales/pt.d.ts +0 -348
  214. package/lib/locales/zh-CN.d.ts +0 -379
  215. package/lib/locales/zh-TW.d.ts +0 -379
@@ -1,7 +0,0 @@
1
- import { UseTabsStateParams, UseTabsStateReturn } from '../types';
2
- /**
3
- * Tabs 状态管理 Hook
4
- * @description 处理受控/非受控模式的状态管理
5
- * @template T - 数据项类型
6
- */
7
- export declare const useTabsState: <T = any>(params: UseTabsStateParams<T>) => UseTabsStateReturn<T>;
@@ -1,3 +0,0 @@
1
- import PisellSuperTabs from './PisellSuperTabs';
2
- export default PisellSuperTabs;
3
- export type { PisellSuperTabsProps, TabDataItem } from './types';
@@ -1,212 +0,0 @@
1
- import { CSSProperties, ReactNode } from 'react';
2
- import type { PisellBasicGridProps } from '../PisellBasicGrid/types';
3
- import type { PisellScrollViewProps } from '../PisellScrollView/types';
4
- import type { PisellBasicCardProps } from '../PisellCards/types';
5
- /**
6
- * useTabsState Hook 参数
7
- */
8
- export interface UseTabsStateParams<T = any> {
9
- isControlled: boolean;
10
- /**
11
- * 当前激活的 Tab key(受控)
12
- */
13
- value?: string;
14
- /**
15
- * 默认激活的 Tab key(非受控)
16
- */
17
- defaultValue?: string;
18
- /**
19
- * Tab 切换时的回调
20
- */
21
- onChange?: (key: string, item: T) => void;
22
- }
23
- /**
24
- * useTabsState Hook 返回值
25
- */
26
- export interface UseTabsStateReturn<T = any> {
27
- /**
28
- * 当前激活的 Tab key
29
- */
30
- activeKey: string | undefined;
31
- /**
32
- * 切换 Tab 的方法
33
- */
34
- handleTabChange: (key: string, item: T) => void;
35
- }
36
- export interface RenderItemProps<T = any> extends PisellBasicCardProps {
37
- index: number;
38
- tabsState: UseTabsStateReturn<T>;
39
- tabsProps: PisellSuperTabsProps<T>;
40
- }
41
- /**
42
- * PisellSuperTabs 组件 Props
43
- * @template T - 数据源项的类型
44
- * @description 通用导航框架封装的全能型 Tab 组件
45
- */
46
- export interface PisellSuperTabsProps<T = any> {
47
- isControlled?: boolean;
48
- /**
49
- * 自定义类名
50
- * @description 添加到最外层容器的类名
51
- */
52
- className?: string;
53
- tabItemClassName?: string;
54
- tabItemStyle?: CSSProperties;
55
- /**
56
- * 自定义样式
57
- * @description 添加到最外层容器的样式
58
- */
59
- style?: CSSProperties;
60
- /**
61
- * 唯一标识
62
- * @description 必填,用于区分不同的 TabItem
63
- */
64
- id?: string;
65
- /**
66
- * 数据源
67
- * @description 支持多级嵌套,递归字段为 children
68
- * @example
69
- * [
70
- * { key: 'home', label: '首页' },
71
- * { key: 'products', label: '产品', children: [...] }
72
- * ]
73
- */
74
- dataSource?: T[];
75
- /**
76
- * 数据项的唯一标识字段
77
- * @default 'key'
78
- * @description 可以是字符串(字段名)或函数(自定义获取逻辑)
79
- * @example
80
- * // 字符串形式
81
- * rowKey="id"
82
- *
83
- * // 函数形式
84
- * rowKey={(record, index) => `${record.type}-${index}`}
85
- */
86
- rowKey?: string | ((record: T, index: number) => string);
87
- /**
88
- * 当前激活的 Tab key
89
- * @description 受控模式,需配合 onChange 使用
90
- */
91
- value?: string;
92
- /**
93
- * 默认激活的 Tab key
94
- * @description 非受控模式,仅初始化时生效
95
- */
96
- defaultValue?: string;
97
- /**
98
- * Tab 切换时的回调
99
- * @param key - 切换到的 Tab key
100
- * @param item - 切换到的数据项
101
- */
102
- onChange?: (key: string, item: T) => void;
103
- /**
104
- * 自定义 TabItem 渲染
105
- * @description 支持两种模式:
106
- * 1. 函数模式:(item, index, active) => ReactNode
107
- * 2. 插槽模式:直接传入 ReactNode
108
- * @example
109
- * // 函数模式
110
- * renderItem={(item, index, active) => (
111
- * <PisellCards.TabCard
112
- * {...item}
113
- * active={{ value: active }}
114
- * />
115
- * )}
116
- *
117
- * // 插槽模式
118
- * renderItem={<PisellCards.TabCard />}
119
- */
120
- renderItem?: ((props: RenderItemProps<T>) => ReactNode) | ReactNode;
121
- /**
122
- * PisellBasicGrid 组件的配置
123
- * @description 透传给 PisellBasicGrid 组件的所有 Props
124
- * @see PisellBasicGridProps
125
- * @example
126
- * gridProps={{
127
- * direction: 'horizontal',
128
- * gap: 16,
129
- * wrap: 'wrap',
130
- * columns: 4,
131
- * }}
132
- */
133
- gridProps?: Omit<PisellBasicGridProps<T>, 'dataSource' | 'renderItem' | 'rowKey' | 'children'>;
134
- /**
135
- * PisellScrollView 组件的配置
136
- * @description 透传给 PisellScrollView 组件的所有 Props
137
- * @see PisellScrollViewProps
138
- * @example
139
- * scrollViewProps={{
140
- * overflow: 'x',
141
- * scrollbarStyle: 'thin',
142
- * scrollActionsConfig: { show: true, type: 'lrArrows' },
143
- * }}
144
- */
145
- scrollViewProps?: Omit<PisellScrollViewProps, 'children'>;
146
- children?: ReactNode;
147
- /**
148
- * 左侧插槽
149
- */
150
- slotLeft?: ReactNode;
151
- slotLeftClassName?: string;
152
- slotLeftStyle?: CSSProperties;
153
- /**
154
- * 右侧插槽
155
- */
156
- slotRight?: ReactNode;
157
- slotRightClassName?: string;
158
- slotRightStyle?: CSSProperties;
159
- /**
160
- * 顶部插槽
161
- */
162
- slotTop?: ReactNode;
163
- slotTopClassName?: string;
164
- slotTopStyle?: CSSProperties;
165
- /**
166
- * 底部插槽
167
- */
168
- slotBottom?: ReactNode;
169
- slotBottomClassName?: string;
170
- slotBottomStyle?: CSSProperties;
171
- __designMode?: boolean;
172
- }
173
- /**
174
- * 数据项基础类型
175
- * @description 建议数据源中的每一项都包含这些字段
176
- */
177
- export interface TabDataItem {
178
- /**
179
- * 唯一标识
180
- * @description 必填,用于区分不同的 TabItem
181
- */
182
- key: string;
183
- /**
184
- * 标签文本
185
- */
186
- label?: string;
187
- /**
188
- * 图标
189
- */
190
- icon?: ReactNode;
191
- /**
192
- * 徽章配置
193
- */
194
- badge?: {
195
- count?: number;
196
- dot?: boolean;
197
- text?: string;
198
- };
199
- /**
200
- * 子级数据(多级嵌套)
201
- * @description 用于多级导航场景,具体渲染逻辑由 Card 组件实现
202
- */
203
- children?: TabDataItem[];
204
- /**
205
- * 是否禁用
206
- */
207
- disabled?: boolean;
208
- /**
209
- * 其他自定义字段
210
- */
211
- [key: string]: any;
212
- }
@@ -1,47 +0,0 @@
1
- import { TabbarLevelConfig, ExpandConfig, LevelType } from './types';
2
- /**
3
- * 默认层级配置
4
- */
5
- export declare const DEFAULT_LEVEL_CONFIG: Record<LevelType, TabbarLevelConfig>;
6
- /**
7
- * 获取展开配置
8
- */
9
- export declare const getExpandConfig: () => ExpandConfig;
10
- /**
11
- * 默认数据项配置
12
- */
13
- export declare const DEFAULT_ITEMS: {
14
- all: {
15
- id: string;
16
- shop_id: number;
17
- parent_id: number;
18
- name: any;
19
- slug: string;
20
- icon: string;
21
- };
22
- search: {
23
- id: string;
24
- shop_id: number;
25
- parent_id: number;
26
- name: any;
27
- text: any;
28
- slug: string;
29
- key: string;
30
- icon: string;
31
- customClick: boolean;
32
- };
33
- expand: {
34
- id: string;
35
- shop_id: number;
36
- parent_id: number;
37
- key: string;
38
- icon: string;
39
- name: string;
40
- slug: string;
41
- customClick: boolean;
42
- };
43
- };
44
- /**
45
- * 获取层级对应的添加项配置
46
- */
47
- export declare const LEVEL_ADD_ITEMS: Record<LevelType, ('all' | 'search' | 'expand')[]>;
@@ -1,2 +0,0 @@
1
- export { default as useActiveKey } from './useActiveKey';
2
- export { default as useExpand } from './useExpand';
@@ -1,55 +0,0 @@
1
- /**
2
- * useActiveKey Hook 参数
3
- */
4
- interface UseActiveKeyProps {
5
- /** 初始激活的 key 数组(对应多层级) */
6
- initialActiveKey?: (string | number)[];
7
- /** key 变化回调 */
8
- onChange?: (value: (string | number)[]) => void;
9
- }
10
- /**
11
- * useActiveKey Hook 返回值
12
- */
13
- interface UseActiveKeyReturn {
14
- /** 当前激活的 key 数组 */
15
- activeKey: (string | number)[];
16
- /** 设置指定层级的激活 key */
17
- setActiveKey: (level: number, key: string | number, cKey?: string | number) => void;
18
- /** 获取指定层级的激活 key */
19
- getActiveKey: (level: number) => string | number;
20
- /** 内部设置方法(用于同步外部值) */
21
- _setActiveKey: (value: (string | number)[]) => void;
22
- /** 设置缓存key */
23
- setCacheActiveKey: (val: (string | number)[]) => void;
24
- /** 重置value为缓存key */
25
- resetActiveKey: () => void;
26
- /** 获取缓存key */
27
- getCacheActiveKey: () => (string | number)[];
28
- }
29
- /**
30
- * Tabbar 激活状态管理 Hook
31
- *
32
- * 用于管理多层级 Tabbar 的激活状态,支持级联选择
33
- *
34
- * @param props - Hook 配置参数
35
- * @returns 激活状态和操作方法
36
- *
37
- * @example
38
- * ```tsx
39
- * const { activeKey, setActiveKey, getActiveKey } = useActiveKey({
40
- * initialActiveKey: [1, 10],
41
- * onChange: (value) => console.log('当前选中:', value)
42
- * });
43
- *
44
- * // 设置第 0 层级的 key,并清除后续层级
45
- * setActiveKey(0, '2');
46
- *
47
- * // 设置第 0 层级的 key,并同时设置第 1 层级
48
- * setActiveKey(0, '2', '20');
49
- *
50
- * // 获取第 0 层级的 key
51
- * const level0Key = getActiveKey(0);
52
- * ```
53
- */
54
- declare const useActiveKey: (props: UseActiveKeyProps) => UseActiveKeyReturn;
55
- export default useActiveKey;
@@ -1,42 +0,0 @@
1
- import { ExpandState, LevelType } from '../types';
2
- /**
3
- * useExpand Hook 参数
4
- */
5
- interface UseExpandProps {
6
- /** 初始展开状态 */
7
- initialExpand?: Partial<ExpandState>;
8
- }
9
- /**
10
- * useExpand Hook 返回值
11
- */
12
- interface UseExpandReturn {
13
- /** 展开状态 */
14
- expand: ExpandState;
15
- /** 设置展开状态 */
16
- setExpand: (state: ExpandState) => void;
17
- /** 切换指定层级的展开状态 */
18
- toggleExpand: (level: LevelType) => void;
19
- /** 获取指定层级的展开状态 */
20
- getExpand: (level: LevelType) => boolean;
21
- closeAll: () => void;
22
- }
23
- /**
24
- * Tabbar 展开状态管理 Hook
25
- * 用于管理多层级的展开/收起状态
26
- *
27
- * @param props - Hook 配置参数
28
- * @returns 展开状态和操作方法
29
- *
30
- * @example
31
- * ```tsx
32
- * const { expand, toggleExpand, getExpand } = useExpand({
33
- * initialExpand: { level1: false }
34
- * });
35
- *
36
- * <button onClick={() => toggleExpand('level1')}>
37
- * {getExpand('level1') ? '收起' : '展开'}
38
- * </button>
39
- * ```
40
- */
41
- declare const useExpand: (props?: UseExpandProps) => UseExpandReturn;
42
- export default useExpand;
@@ -1,10 +0,0 @@
1
- import { TabbarLevelConfig, LevelType } from '../../types';
2
- export { getExpandConfig, DEFAULT_ITEMS } from '../../constants';
3
- /**
4
- * 默认层级配置
5
- */
6
- export declare const DEFAULT_LEVEL_CONFIG: Record<LevelType, TabbarLevelConfig>;
7
- /**
8
- * 获取层级对应的添加项配置
9
- */
10
- export declare const LEVEL_ADD_ITEMS: Record<LevelType, ('all' | 'search' | 'expand')[]>;
@@ -1,35 +0,0 @@
1
- /**
2
- * PisellTabbar 工具函数
3
- */
4
- import { TabbarDataSource } from '../../../types';
5
- /**
6
- * 向数据源添加特殊项(如 all、search、expand 按钮)
7
- *
8
- * @param dataSource - 原始数据源
9
- * @param keys - 要添加的特殊项 key 数组
10
- * @returns 添加了特殊项的新数据源
11
- *
12
- * @example
13
- * ```tsx
14
- * const newData = addDataSourceItemsByKey(categoryData, ['expand', 'all']);
15
- * // 返回: [expandItem, allItem, ...categoryData]
16
- * ```
17
- */
18
- export declare const addDataSourceItemsByKey: (dataSource: TabbarDataSource[], keys: ('all' | 'search' | 'expand')[]) => TabbarDataSource[];
19
- /**
20
- * 获取默认激活的 key 数组
21
- *
22
- * @param dataSource - 数据源
23
- * @param rowKey - 用作唯一标识的字段名
24
- * @returns 默认激活的 key 数组(多层级)
25
- *
26
- * @description
27
- * 默认选中第一项,如果第一项有子级,同时选中第一个子级
28
- *
29
- * @example
30
- * ```tsx
31
- * const defaultKeys = getDefaultActiveKey(categoryData, 'id');
32
- * // 返回: [1, 0] (第一层级的第一项ID,第二层级的第一项ID)
33
- * ```
34
- */
35
- export declare const getDefaultActiveKey: (dataSource: TabbarDataSource[], rowKey: string) => (string | number)[];
@@ -1,90 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- /**
3
- * Tabbar 数据源项类型
4
- */
5
- export interface TabbarDataSource {
6
- /** 唯一标识 */
7
- id: string | number;
8
- /** 店铺ID */
9
- shop_id?: number;
10
- /** 父级ID */
11
- parent_id?: number;
12
- /** 显示名称 */
13
- name: string;
14
- /** URL slug */
15
- slug?: string;
16
- /** 图标 URL 或图标名称 */
17
- icon?: string;
18
- /** 子级数据 */
19
- children?: TabbarDataSource[];
20
- /** 自定义点击事件标识 */
21
- customClick?: boolean;
22
- /** 唯一 key */
23
- key?: string;
24
- }
25
- /**
26
- * 层级配置
27
- */
28
- export interface TabbarLevelConfig {
29
- /** SuperTabs 背景色 */
30
- superTabsBg: string;
31
- /** 卡片宽度 */
32
- cardWidth: number;
33
- /** 卡片高度 */
34
- cardHeight: number;
35
- /** 左侧缩进 */
36
- paddingLeft?: number;
37
- }
38
- /**
39
- * 展开配置
40
- */
41
- export interface ExpandConfig {
42
- /** 激活状态配置 */
43
- active: {
44
- icon: string;
45
- text: string;
46
- };
47
- /** 未激活状态配置 */
48
- inactive: {
49
- icon: string;
50
- text: string;
51
- };
52
- }
53
- /**
54
- * 展开状态
55
- */
56
- export interface ExpandState {
57
- level1: boolean;
58
- level2: boolean;
59
- level3: boolean;
60
- }
61
- /**
62
- * 层级类型
63
- */
64
- export declare type LevelType = 'level1' | 'level2' | 'level3';
65
- /**
66
- * PisellTabbar 组件属性
67
- */
68
- export interface PisellTabbarProps {
69
- /** 数据源 */
70
- dataSource?: TabbarDataSource[];
71
- /** 当前选中的值(多层级 key 数组) */
72
- value?: (string | number)[];
73
- /** 值变化回调 */
74
- onChange?: (value: (string | number)[]) => void;
75
- /** 自定义类名 */
76
- className?: string;
77
- /** 自定义样式 */
78
- style?: CSSProperties;
79
- /** 层级配置(可按层级自定义) */
80
- levelConfig?: Partial<Record<LevelType, Partial<TabbarLevelConfig>>>;
81
- /** 展开配置 */
82
- expandConfig?: ExpandConfig;
83
- /** 最大层级数 */
84
- maxLevel?: 1 | 2 | 3;
85
- onSearch?: (value: string) => void;
86
- __designMode?: boolean;
87
- }
88
- export interface PisellTabbarRef {
89
- closeSearchMode: () => void;
90
- }
@@ -1,69 +0,0 @@
1
- /**
2
- * PisellTabbar 工具函数
3
- */
4
- import { TabbarDataSource } from '../types';
5
- /**
6
- * 默认的特殊项配置
7
- */
8
- export declare const defaultItems: {
9
- all: {
10
- id: number;
11
- shop_id: number;
12
- parent_id: number;
13
- name: any;
14
- slug: string;
15
- icon: string;
16
- };
17
- search: {
18
- id: number;
19
- shop_id: number;
20
- parent_id: number;
21
- name: any;
22
- text: any;
23
- slug: string;
24
- key: string;
25
- icon: string;
26
- customClick: boolean;
27
- };
28
- expand: {
29
- id: number;
30
- shop_id: number;
31
- parent_id: number;
32
- key: string;
33
- icon: string;
34
- name: string;
35
- slug: string;
36
- customClick: boolean;
37
- };
38
- };
39
- /**
40
- * 向数据源添加特殊项(如 all、search、expand 按钮)
41
- *
42
- * @param dataSource - 原始数据源
43
- * @param keys - 要添加的特殊项 key 数组
44
- * @returns 添加了特殊项的新数据源
45
- *
46
- * @example
47
- * ```tsx
48
- * const newData = addDataSourceItemsByKey(categoryData, ['expand', 'all']);
49
- * // 返回: [expandItem, allItem, ...categoryData]
50
- * ```
51
- */
52
- export declare const addDataSourceItemsByKey: (dataSource: TabbarDataSource[], keys: ('all' | 'search' | 'expand')[]) => TabbarDataSource[];
53
- /**
54
- * 获取默认激活的 key 数组
55
- *
56
- * @param dataSource - 数据源
57
- * @param rowKey - 用作唯一标识的字段名
58
- * @returns 默认激活的 key 数组(多层级)
59
- *
60
- * @description
61
- * 默认选中第一项,如果第一项有子级,同时选中第一个子级
62
- *
63
- * @example
64
- * ```tsx
65
- * const defaultKeys = getDefaultActiveKey(categoryData, 'id');
66
- * // 返回: [1, 0] (第一层级的第一项ID,第二层级的第一项ID)
67
- * ```
68
- */
69
- export declare const getDefaultActiveKey: (dataSource: TabbarDataSource[], rowKey: string) => (string | number)[];
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- declare const _default: (props: any) => React.JSX.Element;
4
- export default _default;
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { ConfigProviderProps as OriginalConfigProviderProps } from "antd/es/config-provider";
3
- import "dayjs/locale/zh-cn";
4
- import "dayjs/locale/ja";
5
- import "dayjs/locale/pt";
6
- export interface ConfigProviderProps extends OriginalConfigProviderProps {
7
- [key: string]: any;
8
- }
9
- declare const ConfigProvider: (props: ConfigProviderProps) => React.JSX.Element;
10
- export default ConfigProvider;
@@ -1,26 +0,0 @@
1
- /**
2
- * 获取nocobase数据列表
3
- */
4
- export declare const getCountryDataList: () => Promise<any>;
5
- export interface Country {
6
- id: number;
7
- name: {
8
- en: string;
9
- 'zh-CN': string;
10
- 'zh-HK': string;
11
- 'ja': string;
12
- 'pt': string;
13
- original: string;
14
- };
15
- code: string;
16
- calling_code: string;
17
- currency_code: string;
18
- sort: number;
19
- status: string;
20
- created_at: string;
21
- updated_at: string;
22
- prefix: string;
23
- }
24
- export declare const useCountries: () => {
25
- data: Country[];
26
- };
@@ -1,27 +0,0 @@
1
- /**
2
- * 获取nocobase数据列表
3
- */
4
- export declare const getCountryDataList: () => Promise<any>;
5
- export declare const getShopCountryDataList: (locale?: any) => Promise<any>;
6
- export interface Country {
7
- id: number;
8
- name: {
9
- en: string;
10
- 'zh-CN': string;
11
- 'zh-HK': string;
12
- 'ja': string;
13
- 'pt': string;
14
- original: string;
15
- };
16
- code: string;
17
- calling_code: string;
18
- currency_code: string;
19
- sort: number;
20
- status: string;
21
- created_at: string;
22
- updated_at: string;
23
- prefix: string;
24
- }
25
- export declare const useCountries: () => {
26
- data: Country[];
27
- };
@@ -1,9 +0,0 @@
1
- export declare const SUPPORTED_LANGUAGES: readonly ["original", "en", "zh-CN", "zh-HK", "ja", "pt"];
2
- export declare const DEFAULT_MAX_COUNT = 9;
3
- export declare const DEFAULT_UID = "-1";
4
- export declare const MEDIA_TYPES: {
5
- readonly VIDEO: "video/";
6
- readonly AUDIO: "audio/";
7
- };
8
- export declare const IMAGE_QUALITY = 0.8;
9
- export declare const IMAGE_TYPE = "image/jpeg";
@@ -1,15 +0,0 @@
1
- /// <reference types="react" />
2
- export interface VariablesContextType {
3
- children?: React.ReactNode;
4
- variables?: Record<string, any>;
5
- registerVariable?: (value: Record<string, any>) => void;
6
- parseVariable?: (str: string, localVariables?: Record<string, any>) => any;
7
- registerValueVariable?: (componentId: string, value: Record<string, any>) => void;
8
- registerFunctionVariable?: (componentId: string, value: Record<string, any>) => void;
9
- subscribeVariables?: (listener: (allVariables: Record<string, any>, updateVariables: Record<string, any>) => void) => () => void;
10
- config?: {
11
- disabledHistoryListener?: boolean;
12
- };
13
- }
14
- export declare const VariablesContext: import("react").Context<VariablesContextType>;
15
- export default VariablesContext;