@pisell/materials 1.0.503 → 1.0.504

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 (81) 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/index.js +1 -1
  5. package/build/lowcode/meta.js +7 -7
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +26 -26
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +26 -26
  11. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
  12. package/es/components/dataSourceComponents/fields/index.d.ts +2 -2
  13. package/es/components/pisellAvatar/index.d.ts +19 -0
  14. package/es/components/pisellAvatar/index.js +89 -0
  15. package/es/components/pisellAvatar/index.less +25 -0
  16. package/es/components/pisellCustomCheckboxGroup/index.d.ts +15 -0
  17. package/es/components/pisellCustomCheckboxGroup/index.js +125 -0
  18. package/es/components/pisellCustomCheckboxGroup/index.less +0 -0
  19. package/es/components/pisellDropdown/index.d.ts +20 -0
  20. package/es/components/pisellDropdown/index.js +51 -0
  21. package/es/components/pisellDropdown/index.less +44 -0
  22. package/es/components/pisellImageCarousels/index.d.ts +20 -0
  23. package/es/components/pisellImageCarousels/index.js +106 -0
  24. package/es/components/pisellImageCarousels/index.less +92 -0
  25. package/es/components/pisellProgressBar/index.d.ts +14 -0
  26. package/es/components/pisellProgressBar/index.js +44 -0
  27. package/es/components/pisellProgressBar/index.less +48 -0
  28. package/es/components/pisellSectionHeaders/index.d.ts +21 -0
  29. package/es/components/pisellSectionHeaders/index.js +39 -0
  30. package/es/components/pisellSectionHeaders/index.less +48 -0
  31. package/es/components/pisellViewGrid/index.d.ts +16 -0
  32. package/es/components/pisellViewGrid/index.js +88 -0
  33. package/es/components/pisellViewGrid/index.less +30 -0
  34. package/es/components/table/Table/utils.d.ts +1 -1
  35. package/es/index.d.ts +9 -2
  36. package/es/index.js +10 -3
  37. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
  38. package/lib/components/dataSourceComponents/fields/index.d.ts +2 -2
  39. package/lib/components/pisellAvatar/index.d.ts +19 -0
  40. package/lib/components/pisellAvatar/index.js +108 -0
  41. package/lib/components/pisellAvatar/index.less +25 -0
  42. package/lib/components/pisellCustomCheckboxGroup/index.d.ts +15 -0
  43. package/lib/components/pisellCustomCheckboxGroup/index.js +94 -0
  44. package/lib/components/pisellCustomCheckboxGroup/index.less +0 -0
  45. package/lib/components/pisellDropdown/index.d.ts +20 -0
  46. package/lib/components/pisellDropdown/index.js +72 -0
  47. package/lib/components/pisellDropdown/index.less +44 -0
  48. package/lib/components/pisellImageCarousels/index.d.ts +20 -0
  49. package/lib/components/pisellImageCarousels/index.js +107 -0
  50. package/lib/components/pisellImageCarousels/index.less +92 -0
  51. package/lib/components/pisellProgressBar/index.d.ts +14 -0
  52. package/lib/components/pisellProgressBar/index.js +62 -0
  53. package/lib/components/pisellProgressBar/index.less +48 -0
  54. package/lib/components/pisellSectionHeaders/index.d.ts +21 -0
  55. package/lib/components/pisellSectionHeaders/index.js +58 -0
  56. package/lib/components/pisellSectionHeaders/index.less +48 -0
  57. package/lib/components/pisellViewGrid/index.d.ts +16 -0
  58. package/lib/components/pisellViewGrid/index.js +109 -0
  59. package/lib/components/pisellViewGrid/index.less +30 -0
  60. package/lib/components/table/Table/utils.d.ts +1 -1
  61. package/lib/index.d.ts +9 -2
  62. package/lib/index.js +23 -2
  63. package/lowcode/pisell-avatar/__screenshots__/avatar-1.jpg +0 -0
  64. package/lowcode/pisell-avatar/meta.ts +111 -0
  65. package/lowcode/pisell-avatar/snippets.ts +14 -0
  66. package/lowcode/pisell-custom-checkbox-group/__screenshots__/card-1.png +0 -0
  67. package/lowcode/pisell-custom-checkbox-group/meta.ts +202 -0
  68. package/lowcode/pisell-custom-checkbox-group/snippets.ts +56 -0
  69. package/lowcode/pisell-dropdown/__screenshots__/dropdown-1.png +0 -0
  70. package/lowcode/pisell-dropdown/meta.ts +180 -0
  71. package/lowcode/pisell-dropdown/snippets.ts +69 -0
  72. package/lowcode/pisell-image-carousels/meta.ts +143 -0
  73. package/lowcode/pisell-image-carousels/snippets.ts +26 -0
  74. package/lowcode/pisell-progress-bar/meta.ts +115 -0
  75. package/lowcode/pisell-progress-bar/snippets.ts +15 -0
  76. package/lowcode/pisell-section-headers/meta.ts +91 -0
  77. package/lowcode/pisell-section-headers/snippets.ts +22 -0
  78. package/lowcode/pisell-view-grid/__screenshots__/card-1.png +0 -0
  79. package/lowcode/pisell-view-grid/meta.ts +167 -0
  80. package/lowcode/pisell-view-grid/snippets.ts +54 -0
  81. package/package.json +4 -3
@@ -0,0 +1,48 @@
1
+ @prefix: pisell-section-headers;
2
+ @height: 56px;
3
+
4
+ .@{prefix} {
5
+ width: 100%;
6
+ height: @height;
7
+ z-index: 100;
8
+ position: fixed;
9
+ top: 0;
10
+ left: 0;
11
+ border-bottom: 1px solid var(--Gray-300, #d0d5dd);
12
+ box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
13
+
14
+ &-fixed {
15
+ position: fixed;
16
+ top: 0;
17
+ left: 0;
18
+ }
19
+
20
+ &-placeholder {
21
+ height: @height;
22
+ width: 100%;
23
+ }
24
+
25
+ &-content {
26
+ height: 100%;
27
+ padding: 16px;
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: space-between;
31
+ gap: 10px;
32
+ }
33
+
34
+ &-back {
35
+ cursor: pointer;
36
+ }
37
+
38
+ &-main {
39
+ flex: 1;
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ }
44
+
45
+ &-actions {
46
+ cursor: pointer;
47
+ }
48
+ }
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface PisellViewGridProps {
4
+ columns?: number;
5
+ horizontalGap?: number;
6
+ verticalGap?: number;
7
+ singleRow?: boolean;
8
+ dataSource?: any[];
9
+ renderItem?: (item: any, index: number) => React.ReactNode;
10
+ loading?: boolean;
11
+ children?: React.ReactNode;
12
+ className?: string;
13
+ style?: React.CSSProperties;
14
+ }
15
+ declare const PisellViewGrid: React.FC<PisellViewGridProps>;
16
+ export default PisellViewGrid;
@@ -0,0 +1,109 @@
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/pisellViewGrid/index.tsx
30
+ var pisellViewGrid_exports = {};
31
+ __export(pisellViewGrid_exports, {
32
+ default: () => pisellViewGrid_default
33
+ });
34
+ module.exports = __toCommonJS(pisellViewGrid_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_next = require("@alifd/next");
37
+ var import_classnames = __toESM(require("classnames"));
38
+ var import_index = require("./index.less");
39
+ var PisellViewGrid = ({
40
+ columns = 3,
41
+ horizontalGap = 10,
42
+ verticalGap = 10,
43
+ singleRow = false,
44
+ dataSource = [],
45
+ renderItem,
46
+ loading = false,
47
+ children,
48
+ className,
49
+ style
50
+ }) => {
51
+ const classes = (0, import_classnames.default)(
52
+ "pisell-view-grid",
53
+ {
54
+ "pisell-view-grid-single-row": singleRow
55
+ },
56
+ className
57
+ );
58
+ const containerStyle = {
59
+ ...style,
60
+ display: "flex",
61
+ flexWrap: singleRow ? "nowrap" : "wrap",
62
+ margin: 0,
63
+ // 移除外边距
64
+ padding: 0,
65
+ // 移除内边距
66
+ overflowX: singleRow ? "auto" : "visible",
67
+ // position: 'relative' as const,
68
+ width: "100%",
69
+ height: "100%"
70
+ // 确保填充父容器
71
+ };
72
+ const renderGridItems = () => {
73
+ const items = (dataSource == null ? void 0 : dataSource.length) ? dataSource : import_react.default.Children.toArray(children);
74
+ return items.map((item, index) => /* @__PURE__ */ import_react.default.createElement(
75
+ "div",
76
+ {
77
+ key: index,
78
+ className: "pisell-view-grid-item",
79
+ style: {
80
+ width: `calc(${100 / columns}% - ${horizontalGap}px)`,
81
+ // 修正宽度计算
82
+ marginRight: (index + 1) % columns === 0 ? 0 : horizontalGap,
83
+ marginBottom: singleRow ? 0 : verticalGap,
84
+ flexShrink: 0
85
+ }
86
+ },
87
+ (dataSource == null ? void 0 : dataSource.length) ? renderItem == null ? void 0 : renderItem(item, index) : index
88
+ ));
89
+ };
90
+ return /* @__PURE__ */ import_react.default.createElement(import_next.Loading, { visible: loading, fullScreen: false, style: { width: "100%" } }, /* @__PURE__ */ import_react.default.createElement("div", { className: classes, style }, /* @__PURE__ */ import_react.default.createElement(
91
+ "div",
92
+ {
93
+ className: "pisell-view-grid-content",
94
+ style: {
95
+ gap: `${verticalGap}px ${horizontalGap}px`,
96
+ gridTemplateColumns: `repeat(${columns}, 1fr)`
97
+ }
98
+ },
99
+ dataSource.map((item, index) => /* @__PURE__ */ import_react.default.createElement(
100
+ "div",
101
+ {
102
+ key: index,
103
+ className: "pisell-view-grid-item"
104
+ },
105
+ renderItem == null ? void 0 : renderItem(item, index)
106
+ ))
107
+ )));
108
+ };
109
+ var pisellViewGrid_default = PisellViewGrid;
@@ -0,0 +1,30 @@
1
+ .pisell-view-grid {
2
+ position: relative;
3
+ width: 100%;
4
+ height: 100%;
5
+ box-sizing: border-box;
6
+
7
+ &-content {
8
+ display: grid;
9
+ // grid-template-columns: repeat(4, 1fr);
10
+ // gap: 10px;
11
+ }
12
+
13
+ &-item {
14
+ width: 100%;
15
+ }
16
+
17
+ &-single-row {
18
+ &::-webkit-scrollbar {
19
+ display: none;
20
+ }
21
+ -ms-overflow-style: none;
22
+ scrollbar-width: none;
23
+ }
24
+
25
+ // &-item {
26
+ // box-sizing: border-box;
27
+ // display: inline-block;
28
+ // vertical-align: top;
29
+ // }
30
+ }
@@ -167,7 +167,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
167
167
  sort?: SortType | undefined;
168
168
  mode: "" | "localStorage" | "remote";
169
169
  currentViewMode: ModeType;
170
- }) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
170
+ }) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
171
171
  export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
172
172
  export declare const stringify: (obj: Record<string, any>) => string;
173
173
  export {};
package/lib/index.d.ts CHANGED
@@ -111,12 +111,12 @@ export { default as PisellInformationEntry } from './components/pisellInformatio
111
111
  export { default as usePisellConfig } from './components/pisell-config-provider/hooks/usePisellConfig';
112
112
  export { globalConfig, default as PisellContext, } from './components/pisell-config-provider/context';
113
113
  export { default as PisellTags } from './components/pisellTags';
114
- export { default as PisellStatisticList } from './components/pisellStatisticList';
115
- export { default as PisellFloatingPanel } from './components/pisellFloatingPanel';
116
114
  export { default as PisellPriceKeyboard } from './components/virtual-keyboard/Amount';
117
115
  export { default as PisellNumberKeyboard } from './components/virtual-keyboard/Number';
118
116
  export { default as PisellAdjustPrice } from './components/pisellAdjustPrice';
119
117
  export { default as PisellAdjustPriceInputNumber } from './components/pisellAdjustPrice/PisellAdjustPriceInputNumber';
118
+ export { default as PisellStatisticList } from './components/pisellStatisticList';
119
+ export { default as PisellFloatingPanel } from './components/pisellFloatingPanel';
120
120
  export { default as ProductCard } from './components/productCard';
121
121
  export { default as Collapse } from './components/collapse';
122
122
  export { default as CardMetricItem } from './components/cardMetricItem';
@@ -142,3 +142,10 @@ export { default as DataSourceWrapper } from './components/dataSourceComponents/
142
142
  export { default as DataSourceTypography } from './components/dataSourceComponents/dataSourceShow/dataSourceTypography';
143
143
  export { default as DataSourceImage } from './components/dataSourceComponents/dataSourceShow/dataSourceImage';
144
144
  export { default as DataSourceQRCode } from './components/dataSourceComponents/dataSourceShow/dataSourceQRCode';
145
+ export { default as PisellAvatar } from './components/pisellAvatar';
146
+ export { default as PisellViewGrid } from './components/pisellViewGrid';
147
+ export { default as PisellCustomCheckboxGroup } from './components/pisellCustomCheckboxGroup';
148
+ export { default as PisellDropdown } from './components/pisellDropdown';
149
+ export { default as PisellSectionHeaders } from './components/pisellSectionHeaders';
150
+ export { default as PisellProgressBar } from './components/pisellProgressBar';
151
+ export { default as PisellImageCarousels } from './components/pisellImageCarousels';
package/lib/index.js CHANGED
@@ -102,6 +102,7 @@ __export(src_exports, {
102
102
  PisellAdjustPriceInputNumber: () => import_PisellAdjustPriceInputNumber.default,
103
103
  PisellAlert: () => import_pisellAlert.default,
104
104
  PisellAnchor: () => import_pisellAnchor.default,
105
+ PisellAvatar: () => import_pisellAvatar.default,
105
106
  PisellCard: () => import_pisellCard.default,
106
107
  PisellCardList: () => import_pisellCardList.default,
107
108
  PisellCheckboxGroup: () => import_pisellCheckboxGroup.default,
@@ -109,24 +110,30 @@ __export(src_exports, {
109
110
  PisellContainer: () => import_pisellContainer.default,
110
111
  PisellContext: () => import_context.default,
111
112
  PisellCountdown: () => import_pisellCountdown.default,
113
+ PisellCustomCheckboxGroup: () => import_pisellCustomCheckboxGroup.default,
112
114
  PisellDatePicker: () => import_pisellDatePicker.default,
115
+ PisellDropdown: () => import_pisellDropdown.default,
113
116
  PisellEmpty: () => import_pisellEmpty.default,
114
117
  PisellFloatingPanel: () => import_pisellFloatingPanel.default,
118
+ PisellImageCarousels: () => import_pisellImageCarousels.default,
115
119
  PisellInformationEntry: () => import_pisellInformationEntry.default,
116
120
  PisellInput: () => import_pisellInput.default,
117
121
  PisellLoading: () => import_pisellLoading.default,
118
122
  PisellModal: () => import_pisellModal.default,
119
123
  PisellNumberKeyboard: () => import_Number.default,
120
124
  PisellPriceKeyboard: () => import_Amount.default,
125
+ PisellProgressBar: () => import_pisellProgressBar.default,
121
126
  PisellQrcode: () => import_pisellQrcode.default,
122
127
  PisellRow: () => import_pisellRow.default,
123
128
  PisellScan: () => import_pisellScan.default,
129
+ PisellSectionHeaders: () => import_pisellSectionHeaders.default,
124
130
  PisellStatisticList: () => import_pisellStatisticList.default,
125
131
  PisellTags: () => import_pisellTags.default,
126
132
  PisellText: () => import_pisellText.default,
127
133
  PisellToast: () => import_pisellToast.default,
128
134
  PisellTooltip: () => import_pisellTooltip.default,
129
135
  PisellUpload: () => import_pisellUpload.default,
136
+ PisellViewGrid: () => import_pisellViewGrid.default,
130
137
  PisellWalletPassCard: () => import_pisellWalletPassCard.default,
131
138
  Popconfirm: () => import_antd21.Popconfirm,
132
139
  Popover: () => import_antd22.Popover,
@@ -289,12 +296,12 @@ var import_pisellInformationEntry = __toESM(require("./components/pisellInformat
289
296
  var import_usePisellConfig = __toESM(require("./components/pisell-config-provider/hooks/usePisellConfig"));
290
297
  var import_context = __toESM(require("./components/pisell-config-provider/context"));
291
298
  var import_pisellTags = __toESM(require("./components/pisellTags"));
292
- var import_pisellStatisticList = __toESM(require("./components/pisellStatisticList"));
293
- var import_pisellFloatingPanel = __toESM(require("./components/pisellFloatingPanel"));
294
299
  var import_Amount = __toESM(require("./components/virtual-keyboard/Amount"));
295
300
  var import_Number = __toESM(require("./components/virtual-keyboard/Number"));
296
301
  var import_pisellAdjustPrice = __toESM(require("./components/pisellAdjustPrice"));
297
302
  var import_PisellAdjustPriceInputNumber = __toESM(require("./components/pisellAdjustPrice/PisellAdjustPriceInputNumber"));
303
+ var import_pisellStatisticList = __toESM(require("./components/pisellStatisticList"));
304
+ var import_pisellFloatingPanel = __toESM(require("./components/pisellFloatingPanel"));
298
305
  var import_productCard = __toESM(require("./components/productCard"));
299
306
  var import_collapse = __toESM(require("./components/collapse"));
300
307
  var import_cardMetricItem = __toESM(require("./components/cardMetricItem"));
@@ -320,6 +327,13 @@ var import_dataSourceWrapper = __toESM(require("./components/dataSourceComponent
320
327
  var import_dataSourceTypography = __toESM(require("./components/dataSourceComponents/dataSourceShow/dataSourceTypography"));
321
328
  var import_dataSourceImage = __toESM(require("./components/dataSourceComponents/dataSourceShow/dataSourceImage"));
322
329
  var import_dataSourceQRCode = __toESM(require("./components/dataSourceComponents/dataSourceShow/dataSourceQRCode"));
330
+ var import_pisellAvatar = __toESM(require("./components/pisellAvatar"));
331
+ var import_pisellViewGrid = __toESM(require("./components/pisellViewGrid"));
332
+ var import_pisellCustomCheckboxGroup = __toESM(require("./components/pisellCustomCheckboxGroup"));
333
+ var import_pisellDropdown = __toESM(require("./components/pisellDropdown"));
334
+ var import_pisellSectionHeaders = __toESM(require("./components/pisellSectionHeaders"));
335
+ var import_pisellProgressBar = __toESM(require("./components/pisellProgressBar"));
336
+ var import_pisellImageCarousels = __toESM(require("./components/pisellImageCarousels"));
323
337
  // Annotate the CommonJS export names for ESM import in node:
324
338
  0 && (module.exports = {
325
339
  Affix,
@@ -395,6 +409,7 @@ var import_dataSourceQRCode = __toESM(require("./components/dataSourceComponents
395
409
  PisellAdjustPriceInputNumber,
396
410
  PisellAlert,
397
411
  PisellAnchor,
412
+ PisellAvatar,
398
413
  PisellCard,
399
414
  PisellCardList,
400
415
  PisellCheckboxGroup,
@@ -402,24 +417,30 @@ var import_dataSourceQRCode = __toESM(require("./components/dataSourceComponents
402
417
  PisellContainer,
403
418
  PisellContext,
404
419
  PisellCountdown,
420
+ PisellCustomCheckboxGroup,
405
421
  PisellDatePicker,
422
+ PisellDropdown,
406
423
  PisellEmpty,
407
424
  PisellFloatingPanel,
425
+ PisellImageCarousels,
408
426
  PisellInformationEntry,
409
427
  PisellInput,
410
428
  PisellLoading,
411
429
  PisellModal,
412
430
  PisellNumberKeyboard,
413
431
  PisellPriceKeyboard,
432
+ PisellProgressBar,
414
433
  PisellQrcode,
415
434
  PisellRow,
416
435
  PisellScan,
436
+ PisellSectionHeaders,
417
437
  PisellStatisticList,
418
438
  PisellTags,
419
439
  PisellText,
420
440
  PisellToast,
421
441
  PisellTooltip,
422
442
  PisellUpload,
443
+ PisellViewGrid,
423
444
  PisellWalletPassCard,
424
445
  Popconfirm,
425
446
  Popover,
@@ -0,0 +1,111 @@
1
+ import snippets from "./snippets";
2
+
3
+ export default {
4
+ snippets,
5
+ componentName: "PisellAvatar",
6
+ title: "头像",
7
+ category: "数据展示",
8
+ devMode: "proCode",
9
+ npm: {
10
+ package: "@pisell/materials",
11
+ version: "1.0.1",
12
+ exportName: "PisellAvatar",
13
+ main: "src/index.tsx",
14
+ destructuring: true,
15
+ subName: "",
16
+ },
17
+ props: [
18
+ {
19
+ name: "icon",
20
+ title: { label: "头像图标", tip: "icon | 设置头像的自定义图标" },
21
+ propType: "node",
22
+ },
23
+ {
24
+ name: "shape",
25
+ title: { label: "头像形状", tip: "shape | 指定头像的形状" },
26
+ propType: { type: "oneOf", value: ["circle", "square"] },
27
+ defaultValue: "circle",
28
+ },
29
+ {
30
+ name: "borderRadius",
31
+ title: { label: "圆角度数", tip: "borderRadius | 方形头像的圆角大小" },
32
+ propType: "number",
33
+ defaultValue: 4,
34
+ condition: {
35
+ type: "JSFunction",
36
+ value: "target => target.getProps().getPropValue('shape') === 'square'",
37
+ },
38
+ },
39
+ {
40
+ name: "size",
41
+ title: { label: "尺寸", tip: "size | 设置头像的大小" },
42
+ propType: {
43
+ type: "oneOf",
44
+ value: ["xs", "sm", "md", "lg", "xl", "xxl"],
45
+ },
46
+ defaultValue: "xs",
47
+ },
48
+ {
49
+ name: "useTextAvatar",
50
+ title: { label: "使用文本头像", tip: "useTextAvatar | 是否使用文本作为头像" },
51
+ propType: "bool",
52
+ defaultValue: false,
53
+ },
54
+ {
55
+ name: "children",
56
+ title: { label: "文本内容", tip: "children | 文本头像的内容" },
57
+ propType: "string",
58
+ condition: {
59
+ type: "JSFunction",
60
+ value: "target => target.getProps().getPropValue('useTextAvatar')",
61
+ },
62
+ },
63
+ {
64
+ name: "src",
65
+ title: { label: "图片地址", tip: "src | 图片类头像的资源地址" },
66
+ propType: "string",
67
+ },
68
+ {
69
+ name: "alt",
70
+ title: {
71
+ label: "替代文本",
72
+ tip: "alt | 图像无法显示时的替代文本",
73
+ },
74
+ propType: "string",
75
+ setter: "PisellI18nSetter",
76
+ },
77
+ {
78
+ name: "onError",
79
+ title: {
80
+ label: "图片加载失败的事件",
81
+ tip: "图片加载失败的事件,返回 false 会关闭组件默认的 fallback 行为",
82
+ },
83
+ propType: "func",
84
+ },
85
+ {
86
+ name: "gap",
87
+ title: {
88
+ label: "文字边距",
89
+ tip: "gap | 字符类型距离左右两侧边界单位像素",
90
+ },
91
+ propType: "number",
92
+ },
93
+ ],
94
+ configure: {
95
+ supports: {
96
+ style: true,
97
+ events: [
98
+ {
99
+ name: "onError",
100
+ template:
101
+ "onError(${extParams}){\n// 图片加载失败的事件\nconsole.log('onError');}",
102
+ },
103
+ {
104
+ name: "onClick",
105
+ template:
106
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
107
+ }
108
+ ],
109
+ },
110
+ },
111
+ };
@@ -0,0 +1,14 @@
1
+ export default [
2
+ {
3
+ title: '头像',
4
+ screenshot: 'https://alifd.alicdn.com/fusion-cool/icons/icon-antd/avatar-1.jpg',
5
+ schema: {
6
+ componentName: 'PisellAvatar',
7
+ props: {
8
+ src: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
9
+ borderRadius: 4,
10
+ size: 'xs'
11
+ },
12
+ },
13
+ },
14
+ ];
@@ -0,0 +1,202 @@
1
+ import snippets from "./snippets";
2
+
3
+ export default {
4
+ snippets,
5
+ componentName: "PisellCustomCheckboxGroup",
6
+ title: "自定义选项卡",
7
+ category: "数据展示",
8
+ docUrl: "",
9
+ screenshot: "",
10
+ devMode: "proCode",
11
+ npm: {
12
+ package: "@pisell/materials",
13
+ version: "1.0.1",
14
+ exportName: "PisellCustomCheckboxGroup",
15
+ main: "src/index.tsx",
16
+ destructuring: true,
17
+ subName: "",
18
+ },
19
+ props: [
20
+ {
21
+ title: '数据源',
22
+ display: 'block',
23
+ type: 'group',
24
+ items: [
25
+ {
26
+ name: 'dataSource',
27
+ title: { label: '列表数据源', tip: 'dataSource | 列表数据源' },
28
+ propType: { type: 'arrayOf', value: 'any' },
29
+ setter: ['JsonSetter', 'VariableSetter'],
30
+ },
31
+ {
32
+ name: 'loading',
33
+ title: {
34
+ label: '是否加载中',
35
+ tip: 'loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位',
36
+ },
37
+ propType: 'bool',
38
+ defaultValue: false,
39
+ setter: ['BoolSetter', 'VariableSetter'],
40
+ },
41
+ {
42
+ name: 'rowKey',
43
+ title: {
44
+ label: '行Key',
45
+ tip: 'rowKey | 当 renderItem 自定义渲染列表项有效时,自定义每一行的 key 的获取方式',
46
+ },
47
+ propType: {
48
+ type: 'oneOfType',
49
+ value: ['string', 'function'],
50
+ },
51
+ defaultValue: 'id',
52
+ setter: [
53
+ 'StringSetter',
54
+ {
55
+ componentName: 'FunctionSetter',
56
+ props: {
57
+ template:
58
+ 'rowKey(item,${extParams}){\n// 自定义每一行的 key\nreturn `key-${item.id}`;\n}',
59
+ },
60
+ },
61
+ 'VariableSetter',
62
+ ],
63
+ },
64
+ {
65
+ name: 'disabled',
66
+ title: { label: '禁用选择', tip: 'disabled | 是否禁用选择' },
67
+ propType: 'boolean',
68
+ defaultValue: false,
69
+ setter: 'BoolSetter',
70
+ },
71
+ {
72
+ name: 'isMultiple',
73
+ title: { label: '是否多选', tip: 'isMultiple | 是否多选' },
74
+ propType: 'boolean',
75
+ setter: 'BoolSetter',
76
+ },
77
+ {
78
+ name: "value",
79
+ title: { label: "Value", tip: "value | 当前选中的值" },
80
+ propType: "string",
81
+ setter: "StringSetter",
82
+ },
83
+ {
84
+ name: 'allowAdd',
85
+ title: { label: '允许添加', tip: 'allowAdd | 是否允许添加' },
86
+ propType: 'boolean',
87
+ defaultValue: false,
88
+ setter: 'BoolSetter',
89
+ },
90
+ ],
91
+ },
92
+ {
93
+ title: '栅格 ',
94
+ display: 'block',
95
+ type: 'group',
96
+ items: [
97
+ {
98
+ name: 'columns',
99
+ title: { label: '列数', tip: 'columns | 列数' },
100
+ propType: 'number',
101
+ setter: 'NumberSetter',
102
+ defaultValue: 3,
103
+ },
104
+ {
105
+ name: 'horizontalGap',
106
+ title: { label: '水平间隔', tip: 'horizontalGap | 栅格水平间隔,单位为像素(px)' },
107
+ propType: 'number',
108
+ setter: {
109
+ componentName: 'NumberSetter', props: {
110
+ min: 0,
111
+ },
112
+ },
113
+ defaultValue: 10,
114
+ },
115
+ {
116
+ name: 'verticalGap',
117
+ title: { label: '垂直间隔', tip: 'verticalGap | 栅格垂直间隔,单位为像素(px)' },
118
+ propType: 'number',
119
+ setter: {
120
+ componentName: 'NumberSetter',
121
+ props: {
122
+ min: 0,
123
+ },
124
+ },
125
+ defaultValue: 10,
126
+ },
127
+ {
128
+ name: 'singleRow',
129
+ title: { label: '一行展示', tip: 'singleRow | 一行展示' },
130
+ propType: 'boolean',
131
+ defaultValue: false,
132
+ setter: 'BoolSetter',
133
+ },
134
+ ]
135
+ },
136
+ {
137
+ title: '扩展',
138
+ display: 'block',
139
+ type: 'group',
140
+ items: [
141
+ {
142
+ name: 'renderItem',
143
+ title: {
144
+ label: '渲染函数',
145
+ tip: 'renderItem | 当使用 dataSource 时,可以用 `renderItem` 自定义渲染列表项',
146
+ },
147
+ propType: 'func',
148
+ setter: [
149
+ {
150
+ componentName: 'SlotSetter',
151
+ title: '渲染函数插槽',
152
+ initialValue: {
153
+ type: 'JSSlot',
154
+ params: ['item'],
155
+ value: [
156
+ {
157
+ componentName: 'List.Item',
158
+ props: {},
159
+ children: {
160
+ componentName: 'Typography.Text',
161
+ props: {
162
+ children: {
163
+ type: 'JSExpression',
164
+ value: 'this.item.text',
165
+ },
166
+ },
167
+ },
168
+ },
169
+ ],
170
+ },
171
+ },
172
+ {
173
+ componentName: 'FunctionSetter',
174
+ props: {
175
+ template: 'renderItem(item,${extParams}){\n// 自定义渲染列表项\nreturn `item`;\n}',
176
+ },
177
+ },
178
+ 'VariableSetter',
179
+ ],
180
+ },
181
+ ],
182
+ }
183
+ ],
184
+ configure: {
185
+ supports: {
186
+ style: true,
187
+ events: [
188
+ {
189
+ name: 'onChange',
190
+ template: 'onChange(value,${extParams}){\n// 选中值改变时的回调\nconsole.log("value",value);\n}',
191
+ },
192
+ {
193
+ name: 'onAdd',
194
+ template: 'onAdd(${extParams}){\n// 点击添加按钮时的回调\n}',
195
+ },
196
+ ],
197
+ },
198
+ component: {
199
+ isContainer: true,
200
+ },
201
+ },
202
+ };