@pisell/materials 1.0.1057 → 1.0.1059
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 +3 -3
- package/build/lowcode/preview.js +9 -9
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +20 -20
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +23 -23
- package/es/components/PisellCards/index.d.ts +3 -0
- package/es/components/PisellCards/index.js +3 -1
- package/es/components/PisellContactBrief/PisellContactBrief.d.ts +13 -0
- package/es/components/PisellContactBrief/PisellContactBrief.js +223 -0
- package/es/components/PisellContactBrief/PisellContactBrief.less +192 -0
- package/es/components/PisellContactBrief/PisellContactBrief.stories.d.ts +31 -0
- package/es/components/PisellContactBrief/PisellContactBrief.stories.js +196 -0
- package/es/components/PisellContactBrief/components/ContactFormModal.d.ts +23 -0
- package/es/components/PisellContactBrief/components/ContactFormModal.js +177 -0
- package/es/components/PisellContactBrief/components/index.d.ts +5 -0
- package/es/components/PisellContactBrief/components/index.js +4 -0
- package/es/components/PisellContactBrief/index.d.ts +6 -0
- package/es/components/PisellContactBrief/index.js +5 -0
- package/es/components/PisellContactBrief/locales.d.ts +55 -0
- package/es/components/PisellContactBrief/locales.js +54 -0
- package/es/components/PisellContactBrief/types.d.ts +82 -0
- package/es/components/PisellContactBrief/types.js +1 -0
- package/es/components/dataSourceComponents/fields/Tabs/Tabs.less +8 -0
- package/es/components/pisellActionPanel/PisellActionPanel.d.ts +13 -0
- package/es/components/pisellActionPanel/PisellActionPanel.js +98 -0
- package/es/components/pisellActionPanel/PisellActionPanel.less +69 -0
- package/es/components/pisellActionPanel/PisellActionPanel.stories.d.ts +19 -0
- package/es/components/pisellActionPanel/PisellActionPanel.stories.js +208 -0
- package/es/components/pisellActionPanel/index.d.ts +6 -0
- package/es/components/pisellActionPanel/index.js +5 -0
- package/es/components/pisellActionPanel/types.d.ts +83 -0
- package/es/components/pisellActionPanel/types.js +1 -0
- package/es/components/pisellBaseCard/PisellBaseCard.d.ts +8 -0
- package/es/components/pisellBaseCard/PisellBaseCard.js +96 -0
- package/es/components/pisellBaseCard/PisellBaseCard.less +25 -0
- package/es/components/pisellBaseCard/PisellBaseCard.stories.d.ts +19 -0
- package/es/components/pisellBaseCard/PisellBaseCard.stories.js +99 -0
- package/es/components/pisellBaseCard/index.d.ts +5 -0
- package/es/components/pisellBaseCard/index.js +4 -0
- package/es/components/pisellBaseCard/types.d.ts +45 -0
- package/es/components/pisellBaseCard/types.js +1 -0
- package/es/components/pisellCurrency/PisellCurrency.js +18 -12
- package/es/components/pisellCurrency/PisellCurrency.less +0 -123
- package/es/components/pisellCustomerBrief/PisellCustomerBrief.d.ts +15 -0
- package/es/components/pisellCustomerBrief/PisellCustomerBrief.js +145 -0
- package/es/components/pisellCustomerBrief/PisellCustomerBrief.less +8 -0
- package/es/components/pisellCustomerBrief/PisellCustomerBrief.stories.d.ts +23 -0
- package/es/components/pisellCustomerBrief/PisellCustomerBrief.stories.js +193 -0
- package/es/components/pisellCustomerBrief/index.d.ts +6 -0
- package/es/components/pisellCustomerBrief/index.js +5 -0
- package/es/components/pisellCustomerBrief/types.d.ts +82 -0
- package/es/components/pisellCustomerBrief/types.js +1 -0
- package/es/components/pisellEmail/PisellEmail.js +48 -42
- package/es/components/pisellEmail/PisellEmail.less +0 -92
- package/es/components/pisellEntityCard/PisellEntityCard.d.ts +8 -0
- package/es/components/pisellEntityCard/PisellEntityCard.js +474 -0
- package/es/components/pisellEntityCard/PisellEntityCard.less +362 -0
- package/es/components/pisellEntityCard/PisellEntityCard.stories.d.ts +47 -0
- package/es/components/pisellEntityCard/PisellEntityCard.stories.js +450 -0
- package/es/components/pisellEntityCard/index.d.ts +5 -0
- package/es/components/pisellEntityCard/index.js +4 -0
- package/es/components/pisellEntityCard/types.d.ts +144 -0
- package/es/components/pisellEntityCard/types.js +1 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +32 -4
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +4 -2
- package/es/components/pisellFloorMapLayout/components/ViewControls.d.ts +4 -0
- package/es/components/pisellFloorMapLayout/components/ViewControls.js +12 -2
- package/es/components/pisellFloorMapLayout/types.d.ts +2 -0
- package/es/components/pisellLongText/PisellLongText.js +18 -12
- package/es/components/pisellLongText/PisellLongText.less +0 -67
- package/es/components/pisellLookup/PisellLookup.js +8 -1
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.js +14 -6
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.less +18 -139
- package/es/components/pisellMultipleSelect/components/EditView.js +1 -0
- package/es/components/pisellNumber/PisellNumber.js +18 -12
- package/es/components/pisellNumber/PisellNumber.less +0 -103
- package/es/components/pisellPhone/PisellPhone.js +18 -12
- package/es/components/pisellPhone/PisellPhone.less +0 -119
- package/es/components/pisellPhone/components/EditView.js +44 -33
- package/es/components/pisellPhone/constants/countryCodes.d.ts +1 -0
- package/es/components/pisellPhone/constants/countryCodes.js +26 -25
- package/es/components/pisellPhone/types.d.ts +2 -2
- package/es/components/pisellPhone/utils/countryCodeHelper.d.ts +4 -4
- package/es/components/pisellPhone/utils/countryCodeHelper.js +5 -5
- package/es/components/pisellRating/PisellRating.js +7 -3
- package/es/components/pisellSingleLineText/PisellSingleLineText.js +27 -20
- package/es/components/pisellSingleLineText/PisellSingleLineText.less +58 -201
- package/es/components/pisellSingleSelect/PisellSingleSelect.js +14 -5
- package/es/components/pisellSingleSelect/PisellSingleSelect.less +5 -106
- package/es/components/pisellUrl/PisellUrl.js +48 -42
- package/es/components/pisellWalletPassCard/index.js +2 -1
- package/es/index.d.ts +15 -4
- package/es/index.js +8 -4
- package/es/theme/pisell-components.d.ts +14 -0
- package/es/theme/pisell-components.js +74 -0
- package/lib/components/PisellCards/index.d.ts +3 -0
- package/lib/components/PisellCards/index.js +3 -1
- package/lib/components/PisellContactBrief/PisellContactBrief.d.ts +13 -0
- package/lib/components/PisellContactBrief/PisellContactBrief.js +231 -0
- package/lib/components/PisellContactBrief/PisellContactBrief.less +192 -0
- package/lib/components/PisellContactBrief/PisellContactBrief.stories.d.ts +31 -0
- package/lib/components/PisellContactBrief/PisellContactBrief.stories.js +188 -0
- package/lib/components/PisellContactBrief/components/ContactFormModal.d.ts +23 -0
- package/lib/components/PisellContactBrief/components/ContactFormModal.js +154 -0
- package/lib/components/PisellContactBrief/components/index.d.ts +5 -0
- package/lib/components/PisellContactBrief/components/index.js +29 -0
- package/lib/components/PisellContactBrief/index.d.ts +6 -0
- package/lib/components/PisellContactBrief/index.js +29 -0
- package/lib/components/PisellContactBrief/locales.d.ts +55 -0
- package/lib/components/PisellContactBrief/locales.js +74 -0
- package/lib/components/PisellContactBrief/types.d.ts +82 -0
- package/lib/components/PisellContactBrief/types.js +17 -0
- package/lib/components/dataSourceComponents/fields/Tabs/Tabs.less +8 -0
- package/lib/components/pisellActionPanel/PisellActionPanel.d.ts +13 -0
- package/lib/components/pisellActionPanel/PisellActionPanel.js +124 -0
- package/lib/components/pisellActionPanel/PisellActionPanel.less +69 -0
- package/lib/components/pisellActionPanel/PisellActionPanel.stories.d.ts +19 -0
- package/lib/components/pisellActionPanel/PisellActionPanel.stories.js +186 -0
- package/lib/components/pisellActionPanel/index.d.ts +6 -0
- package/lib/components/pisellActionPanel/index.js +29 -0
- package/lib/components/pisellActionPanel/types.d.ts +83 -0
- package/lib/components/pisellActionPanel/types.js +17 -0
- package/lib/components/pisellBaseCard/PisellBaseCard.d.ts +8 -0
- package/lib/components/pisellBaseCard/PisellBaseCard.js +124 -0
- package/lib/components/pisellBaseCard/PisellBaseCard.less +25 -0
- package/lib/components/pisellBaseCard/PisellBaseCard.stories.d.ts +19 -0
- package/lib/components/pisellBaseCard/PisellBaseCard.stories.js +107 -0
- package/lib/components/pisellBaseCard/index.d.ts +5 -0
- package/lib/components/pisellBaseCard/index.js +29 -0
- package/lib/components/pisellBaseCard/types.d.ts +45 -0
- package/lib/components/pisellBaseCard/types.js +17 -0
- package/lib/components/pisellCurrency/PisellCurrency.js +16 -10
- package/lib/components/pisellCurrency/PisellCurrency.less +0 -123
- package/lib/components/pisellCustomerBrief/PisellCustomerBrief.d.ts +15 -0
- package/lib/components/pisellCustomerBrief/PisellCustomerBrief.js +143 -0
- package/lib/components/pisellCustomerBrief/PisellCustomerBrief.less +8 -0
- package/lib/components/pisellCustomerBrief/PisellCustomerBrief.stories.d.ts +23 -0
- package/lib/components/pisellCustomerBrief/PisellCustomerBrief.stories.js +171 -0
- package/lib/components/pisellCustomerBrief/index.d.ts +6 -0
- package/lib/components/pisellCustomerBrief/index.js +29 -0
- package/lib/components/pisellCustomerBrief/types.d.ts +82 -0
- package/lib/components/pisellCustomerBrief/types.js +17 -0
- package/lib/components/pisellEmail/PisellEmail.js +16 -10
- package/lib/components/pisellEmail/PisellEmail.less +0 -92
- package/lib/components/pisellEntityCard/PisellEntityCard.d.ts +8 -0
- package/lib/components/pisellEntityCard/PisellEntityCard.js +426 -0
- package/lib/components/pisellEntityCard/PisellEntityCard.less +362 -0
- package/lib/components/pisellEntityCard/PisellEntityCard.stories.d.ts +47 -0
- package/lib/components/pisellEntityCard/PisellEntityCard.stories.js +349 -0
- package/lib/components/pisellEntityCard/index.d.ts +5 -0
- package/lib/components/pisellEntityCard/index.js +29 -0
- package/lib/components/pisellEntityCard/types.d.ts +144 -0
- package/lib/components/pisellEntityCard/types.js +17 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +22 -3
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +2 -2
- package/lib/components/pisellFloorMapLayout/components/ViewControls.d.ts +4 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControls.js +11 -1
- package/lib/components/pisellFloorMapLayout/types.d.ts +2 -0
- package/lib/components/pisellLongText/PisellLongText.js +16 -10
- package/lib/components/pisellLongText/PisellLongText.less +0 -67
- package/lib/components/pisellLookup/PisellLookup.js +5 -1
- package/lib/components/pisellMultipleSelect/PisellMultipleSelect.js +62 -53
- package/lib/components/pisellMultipleSelect/PisellMultipleSelect.less +18 -139
- package/lib/components/pisellMultipleSelect/components/EditView.js +42 -30
- package/lib/components/pisellNumber/PisellNumber.js +16 -10
- package/lib/components/pisellNumber/PisellNumber.less +0 -103
- package/lib/components/pisellPhone/PisellPhone.js +16 -10
- package/lib/components/pisellPhone/PisellPhone.less +0 -119
- package/lib/components/pisellPhone/components/EditView.js +40 -24
- package/lib/components/pisellPhone/constants/countryCodes.d.ts +1 -0
- package/lib/components/pisellPhone/constants/countryCodes.js +24 -24
- package/lib/components/pisellPhone/types.d.ts +2 -2
- package/lib/components/pisellPhone/utils/countryCodeHelper.d.ts +4 -4
- package/lib/components/pisellPhone/utils/countryCodeHelper.js +1 -1
- package/lib/components/pisellRating/PisellRating.js +4 -2
- package/lib/components/pisellSingleLineText/PisellSingleLineText.js +16 -10
- package/lib/components/pisellSingleLineText/PisellSingleLineText.less +58 -201
- package/lib/components/pisellSingleSelect/PisellSingleSelect.js +34 -35
- package/lib/components/pisellSingleSelect/PisellSingleSelect.less +5 -106
- package/lib/components/pisellUrl/PisellUrl.js +16 -10
- package/lib/components/pisellWalletPassCard/index.js +1 -1
- package/lib/index.d.ts +15 -4
- package/lib/index.js +18 -3
- package/lib/theme/pisell-components.d.ts +14 -0
- package/lib/theme/pisell-components.js +89 -0
- package/lowcode/pisell-action-panel/meta.ts +146 -0
- package/lowcode/pisell-action-panel/snippets.ts +42 -0
- package/lowcode/pisell-base-card/meta.ts +98 -0
- package/lowcode/pisell-base-card/snippets.ts +13 -0
- package/lowcode/pisell-contact-brief/meta.ts +178 -0
- package/lowcode/pisell-contact-brief/snippets.ts +40 -0
- package/lowcode/pisell-customer-brief/meta.ts +262 -0
- package/lowcode/pisell-customer-brief/snippets.ts +46 -0
- package/lowcode/pisell-entity-card/meta.ts +296 -0
- package/lowcode/pisell-entity-card/snippets.ts +41 -0
- package/lowcode/pisell-floor-map-layout/meta.ts +37 -1
- package/package.json +4 -4
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/pisellEntityCard/PisellEntityCard.stories.tsx
|
|
20
|
+
var PisellEntityCard_stories_exports = {};
|
|
21
|
+
__export(PisellEntityCard_stories_exports, {
|
|
22
|
+
ActionButtonOnly: () => ActionButtonOnly,
|
|
23
|
+
ActionDefaultOff: () => ActionDefaultOff,
|
|
24
|
+
ActionIconOnly: () => ActionIconOnly,
|
|
25
|
+
ActionMixedWithCustomStyle: () => ActionMixedWithCustomStyle,
|
|
26
|
+
ActionTextOnly: () => ActionTextOnly,
|
|
27
|
+
B1Line: () => B1Line,
|
|
28
|
+
B2Horizontal: () => B2Horizontal,
|
|
29
|
+
B2Vertical: () => B2Vertical,
|
|
30
|
+
B5Standard: () => B5Standard,
|
|
31
|
+
B9Extended: () => B9Extended,
|
|
32
|
+
Clickable: () => Clickable,
|
|
33
|
+
Default: () => Default,
|
|
34
|
+
Disabled: () => Disabled,
|
|
35
|
+
MediaIcon: () => MediaIcon,
|
|
36
|
+
MediaThumbnail: () => MediaThumbnail,
|
|
37
|
+
PrimaryOnly: () => PrimaryOnly,
|
|
38
|
+
SlotPrimary: () => SlotPrimary,
|
|
39
|
+
SwipeToDelete: () => SwipeToDelete,
|
|
40
|
+
TagPositionInline: () => TagPositionInline,
|
|
41
|
+
WidthFull: () => WidthFull,
|
|
42
|
+
WithActions: () => WithActions,
|
|
43
|
+
default: () => PisellEntityCard_stories_default
|
|
44
|
+
});
|
|
45
|
+
module.exports = __toCommonJS(PisellEntityCard_stories_exports);
|
|
46
|
+
var import_icons = require("@ant-design/icons");
|
|
47
|
+
var import_PisellEntityCard = require("./PisellEntityCard");
|
|
48
|
+
var meta = {
|
|
49
|
+
title: "Data Display/PisellEntityCard",
|
|
50
|
+
component: import_PisellEntityCard.PisellEntityCard,
|
|
51
|
+
tags: ["autodocs"],
|
|
52
|
+
decorators: [
|
|
53
|
+
(Story) => /* @__PURE__ */ React.createElement("div", { style: { width: 340 } }, /* @__PURE__ */ React.createElement(Story, null))
|
|
54
|
+
],
|
|
55
|
+
argTypes: {
|
|
56
|
+
density: {
|
|
57
|
+
description: "信息密度",
|
|
58
|
+
control: "select",
|
|
59
|
+
options: ["B1", "B2", "B5", "B9"]
|
|
60
|
+
},
|
|
61
|
+
layout: {
|
|
62
|
+
description: "布局方向",
|
|
63
|
+
control: "radio",
|
|
64
|
+
options: ["horizontal", "vertical"]
|
|
65
|
+
},
|
|
66
|
+
width: {
|
|
67
|
+
description: "卡片宽度",
|
|
68
|
+
control: "select",
|
|
69
|
+
options: ["content", "full", 300, 340, 400]
|
|
70
|
+
},
|
|
71
|
+
showMedia: { description: "显示媒体区", control: "boolean" },
|
|
72
|
+
showPrimaryText: { description: "显示主文案", control: "boolean" },
|
|
73
|
+
showSecondaryText: { description: "显示次级文案", control: "boolean" },
|
|
74
|
+
showTags: { description: "显示标签", control: "boolean" },
|
|
75
|
+
showActions: { description: "显示底部操作", control: "boolean" },
|
|
76
|
+
swipeToDelete: { description: "开启左滑删除", control: "boolean" }
|
|
77
|
+
},
|
|
78
|
+
args: {
|
|
79
|
+
width: 340
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
var PisellEntityCard_stories_default = meta;
|
|
83
|
+
var defaultPrimary = "张三";
|
|
84
|
+
var defaultSecondary = [{ text: "产品经理 · 杭州" }, { text: "钉钉事业部" }];
|
|
85
|
+
var defaultTags = [{ text: "在职" }, { text: "正式" }];
|
|
86
|
+
var defaultMedia = {
|
|
87
|
+
type: "avatar",
|
|
88
|
+
src: "https://ui-avatars.com/api/?name=Zhang+San&background=4a90d9&color=fff&size=48",
|
|
89
|
+
alt: "头像",
|
|
90
|
+
size: 48
|
|
91
|
+
};
|
|
92
|
+
var Default = {
|
|
93
|
+
args: {
|
|
94
|
+
primaryText: defaultPrimary,
|
|
95
|
+
secondaryTexts: defaultSecondary,
|
|
96
|
+
media: defaultMedia,
|
|
97
|
+
density: "B2",
|
|
98
|
+
layout: "horizontal"
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
var PrimaryOnly = {
|
|
102
|
+
args: {
|
|
103
|
+
primaryText: "实体名称",
|
|
104
|
+
showMedia: false,
|
|
105
|
+
showSecondaryText: false,
|
|
106
|
+
showTags: false,
|
|
107
|
+
density: "B1"
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
var B1Line = {
|
|
111
|
+
args: {
|
|
112
|
+
primaryText: defaultPrimary,
|
|
113
|
+
media: {
|
|
114
|
+
...defaultMedia,
|
|
115
|
+
src: "https://ui-avatars.com/api/?name=Zhang+San&background=4a90d9&color=fff&size=24",
|
|
116
|
+
size: 24
|
|
117
|
+
},
|
|
118
|
+
density: "B1",
|
|
119
|
+
layout: "horizontal",
|
|
120
|
+
showSecondaryText: false,
|
|
121
|
+
showTags: false
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
var B2Horizontal = {
|
|
125
|
+
args: {
|
|
126
|
+
primaryText: defaultPrimary,
|
|
127
|
+
secondaryTexts: defaultSecondary,
|
|
128
|
+
media: defaultMedia,
|
|
129
|
+
density: "B2",
|
|
130
|
+
layout: "horizontal"
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
var B2Vertical = {
|
|
134
|
+
args: {
|
|
135
|
+
primaryText: defaultPrimary,
|
|
136
|
+
secondaryTexts: defaultSecondary,
|
|
137
|
+
media: {
|
|
138
|
+
...defaultMedia,
|
|
139
|
+
src: "https://ui-avatars.com/api/?name=Zhang+San&background=4a90d9&color=fff&size=64",
|
|
140
|
+
size: 64
|
|
141
|
+
},
|
|
142
|
+
density: "B2",
|
|
143
|
+
layout: "vertical"
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
var B5Standard = {
|
|
147
|
+
args: {
|
|
148
|
+
primaryText: defaultPrimary,
|
|
149
|
+
secondaryTexts: [
|
|
150
|
+
{ text: "产品经理 · 杭州" },
|
|
151
|
+
{ text: "钉钉事业部" },
|
|
152
|
+
{ text: "第三行描述" },
|
|
153
|
+
{ text: "第四行" },
|
|
154
|
+
{ text: "第五行" }
|
|
155
|
+
],
|
|
156
|
+
tags: defaultTags,
|
|
157
|
+
media: defaultMedia,
|
|
158
|
+
density: "B5",
|
|
159
|
+
layout: "horizontal"
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
var B9Extended = {
|
|
163
|
+
args: {
|
|
164
|
+
primaryText: defaultPrimary,
|
|
165
|
+
secondaryTexts: [
|
|
166
|
+
...defaultSecondary,
|
|
167
|
+
{ text: "带提示的说明", showTooltip: true }
|
|
168
|
+
],
|
|
169
|
+
tags: defaultTags,
|
|
170
|
+
media: defaultMedia,
|
|
171
|
+
density: "B9",
|
|
172
|
+
layout: "horizontal"
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
var ActionDefaultOff = {
|
|
176
|
+
args: {
|
|
177
|
+
primaryText: defaultPrimary,
|
|
178
|
+
secondaryTexts: defaultSecondary,
|
|
179
|
+
media: defaultMedia,
|
|
180
|
+
showActions: false,
|
|
181
|
+
actions: [
|
|
182
|
+
{ type: "text", label: "查看详情", onClick: () => {
|
|
183
|
+
} }
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
var ActionTextOnly = {
|
|
188
|
+
args: {
|
|
189
|
+
primaryText: defaultPrimary,
|
|
190
|
+
secondaryTexts: defaultSecondary,
|
|
191
|
+
media: defaultMedia,
|
|
192
|
+
showActions: true,
|
|
193
|
+
actions: [
|
|
194
|
+
{ type: "text", label: "查看详情", onClick: () => console.log("查看详情") },
|
|
195
|
+
{ type: "text", label: "Add Contact", onClick: () => console.log("Add Contact") }
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
var ActionButtonOnly = {
|
|
200
|
+
args: {
|
|
201
|
+
primaryText: defaultPrimary,
|
|
202
|
+
secondaryTexts: defaultSecondary,
|
|
203
|
+
media: defaultMedia,
|
|
204
|
+
showActions: true,
|
|
205
|
+
actions: [
|
|
206
|
+
{ type: "button", label: "选择", onClick: () => console.log("选择") },
|
|
207
|
+
{ type: "button", label: "编辑", onClick: () => console.log("编辑") }
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
var ActionIconOnly = {
|
|
212
|
+
args: {
|
|
213
|
+
primaryText: "Bill Camp",
|
|
214
|
+
secondaryTexts: [{ text: "Billcamp@pisell.com" }],
|
|
215
|
+
media: defaultMedia,
|
|
216
|
+
showActions: true,
|
|
217
|
+
actions: [
|
|
218
|
+
{ type: "icon", icon: /* @__PURE__ */ React.createElement(import_icons.EditOutlined, null), onClick: () => console.log("编辑") }
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
var ActionMixedWithCustomStyle = {
|
|
223
|
+
args: {
|
|
224
|
+
primaryText: defaultPrimary,
|
|
225
|
+
secondaryTexts: defaultSecondary,
|
|
226
|
+
media: defaultMedia,
|
|
227
|
+
showActions: true,
|
|
228
|
+
actions: [
|
|
229
|
+
{ type: "text", label: "Add Contact", icon: /* @__PURE__ */ React.createElement(import_icons.PlusOutlined, null), onClick: () => console.log("Add Contact"), style: { color: "#1677ff" } },
|
|
230
|
+
{ type: "button", label: "选择", onClick: () => console.log("选择"), style: { borderColor: "#52c41a", color: "#52c41a" } },
|
|
231
|
+
{ type: "icon", icon: /* @__PURE__ */ React.createElement(import_icons.EditOutlined, null), onClick: () => console.log("编辑"), style: { color: "#475467" } },
|
|
232
|
+
{ type: "icon", icon: /* @__PURE__ */ React.createElement(import_icons.DeleteOutlined, null), onClick: () => console.log("删除"), className: "pisell-entity-card-action-icon", style: { color: "#ff4d4f" } }
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
var WithActions = {
|
|
237
|
+
args: {
|
|
238
|
+
primaryText: defaultPrimary,
|
|
239
|
+
secondaryTexts: defaultSecondary,
|
|
240
|
+
media: defaultMedia,
|
|
241
|
+
showActions: true,
|
|
242
|
+
actions: [
|
|
243
|
+
{ type: "text", label: "查看详情", onClick: () => console.log("查看") },
|
|
244
|
+
{ type: "button", label: "选择", onClick: () => console.log("选择") }
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
var SwipeToDelete = {
|
|
249
|
+
args: {
|
|
250
|
+
primaryText: defaultPrimary,
|
|
251
|
+
secondaryTexts: defaultSecondary,
|
|
252
|
+
media: defaultMedia,
|
|
253
|
+
swipeToDelete: true,
|
|
254
|
+
onDelete: () => console.log("onDelete")
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
var TagPositionInline = {
|
|
258
|
+
args: {
|
|
259
|
+
primaryText: defaultPrimary,
|
|
260
|
+
tags: defaultTags,
|
|
261
|
+
tagPosition: "inline",
|
|
262
|
+
showMedia: false,
|
|
263
|
+
showSecondaryText: false
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
var WidthFull = {
|
|
267
|
+
args: {
|
|
268
|
+
primaryText: defaultPrimary,
|
|
269
|
+
secondaryTexts: defaultSecondary,
|
|
270
|
+
media: defaultMedia,
|
|
271
|
+
width: "full"
|
|
272
|
+
},
|
|
273
|
+
decorators: [
|
|
274
|
+
(Story) => /* @__PURE__ */ React.createElement("div", { style: { width: 340 } }, /* @__PURE__ */ React.createElement(Story, null))
|
|
275
|
+
]
|
|
276
|
+
};
|
|
277
|
+
var SlotPrimary = {
|
|
278
|
+
args: {
|
|
279
|
+
primaryText: "不应显示",
|
|
280
|
+
renderPrimary: () => /* @__PURE__ */ React.createElement("span", { style: { fontWeight: 700, color: "#1677ff" } }, "自定义主文案")
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
var MediaThumbnail = {
|
|
284
|
+
args: {
|
|
285
|
+
primaryText: "商品名称",
|
|
286
|
+
secondaryTexts: [{ text: "¥99.00" }],
|
|
287
|
+
media: {
|
|
288
|
+
type: "thumbnail",
|
|
289
|
+
src: "https://picsum.photos/seed/product/128/128",
|
|
290
|
+
alt: "商品图",
|
|
291
|
+
size: 64,
|
|
292
|
+
shape: "square"
|
|
293
|
+
},
|
|
294
|
+
density: "B2"
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
var MediaIcon = {
|
|
298
|
+
args: {
|
|
299
|
+
primaryText: defaultPrimary,
|
|
300
|
+
secondaryTexts: defaultSecondary,
|
|
301
|
+
media: {
|
|
302
|
+
type: "icon",
|
|
303
|
+
icon: /* @__PURE__ */ React.createElement(import_icons.UserOutlined, { style: { fontSize: 24 } }),
|
|
304
|
+
size: 40,
|
|
305
|
+
color: "#1677ff"
|
|
306
|
+
},
|
|
307
|
+
density: "B2"
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
var Clickable = {
|
|
311
|
+
args: {
|
|
312
|
+
primaryText: defaultPrimary,
|
|
313
|
+
secondaryTexts: defaultSecondary,
|
|
314
|
+
media: defaultMedia,
|
|
315
|
+
onClick: () => alert("卡片被点击")
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
var Disabled = {
|
|
319
|
+
args: {
|
|
320
|
+
primaryText: defaultPrimary,
|
|
321
|
+
secondaryTexts: defaultSecondary,
|
|
322
|
+
media: defaultMedia,
|
|
323
|
+
disabled: true
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
327
|
+
0 && (module.exports = {
|
|
328
|
+
ActionButtonOnly,
|
|
329
|
+
ActionDefaultOff,
|
|
330
|
+
ActionIconOnly,
|
|
331
|
+
ActionMixedWithCustomStyle,
|
|
332
|
+
ActionTextOnly,
|
|
333
|
+
B1Line,
|
|
334
|
+
B2Horizontal,
|
|
335
|
+
B2Vertical,
|
|
336
|
+
B5Standard,
|
|
337
|
+
B9Extended,
|
|
338
|
+
Clickable,
|
|
339
|
+
Default,
|
|
340
|
+
Disabled,
|
|
341
|
+
MediaIcon,
|
|
342
|
+
MediaThumbnail,
|
|
343
|
+
PrimaryOnly,
|
|
344
|
+
SlotPrimary,
|
|
345
|
+
SwipeToDelete,
|
|
346
|
+
TagPositionInline,
|
|
347
|
+
WidthFull,
|
|
348
|
+
WithActions
|
|
349
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PisellEntityCard 组件导出
|
|
3
|
+
*/
|
|
4
|
+
export { PisellEntityCard } from './PisellEntityCard';
|
|
5
|
+
export type { PisellEntityCardProps, EntityCardDensity, EntityCardLayout, EntityCardWidth, EntityCardMediaType, EntityCardMediaConfig, EntityCardSecondaryItem, EntityCardTagItem, EntityCardActionItem, EntityCardTagPosition, } from './types';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/pisellEntityCard/index.tsx
|
|
20
|
+
var pisellEntityCard_exports = {};
|
|
21
|
+
__export(pisellEntityCard_exports, {
|
|
22
|
+
PisellEntityCard: () => import_PisellEntityCard.PisellEntityCard
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(pisellEntityCard_exports);
|
|
25
|
+
var import_PisellEntityCard = require("./PisellEntityCard");
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
PisellEntityCard
|
|
29
|
+
});
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import type { PisellBaseCardProps } from '../pisellBaseCard/types';
|
|
3
|
+
/**
|
|
4
|
+
* 实体卡信息密度等级
|
|
5
|
+
* - B1: 最小单位,一行
|
|
6
|
+
* - B2: 主+次级两行
|
|
7
|
+
* - B5: 次级最多 5 行
|
|
8
|
+
* - B9: 全部展示
|
|
9
|
+
*/
|
|
10
|
+
export declare type EntityCardDensity = 'B1' | 'B2' | 'B5' | 'B9';
|
|
11
|
+
/**
|
|
12
|
+
* 实体卡布局方向
|
|
13
|
+
*/
|
|
14
|
+
export declare type EntityCardLayout = 'horizontal' | 'vertical';
|
|
15
|
+
/**
|
|
16
|
+
* 实体卡宽度模式
|
|
17
|
+
* - content: 由内容撑满
|
|
18
|
+
* - full: 撑满父容器
|
|
19
|
+
* - number: 固定像素宽度
|
|
20
|
+
*/
|
|
21
|
+
export declare type EntityCardWidth = 'content' | 'full' | number;
|
|
22
|
+
/**
|
|
23
|
+
* 媒体类型:头像 / 缩略图 / 图标
|
|
24
|
+
*/
|
|
25
|
+
export declare type EntityCardMediaType = 'avatar' | 'thumbnail' | 'icon';
|
|
26
|
+
/**
|
|
27
|
+
* 实体卡媒体配置(头像、缩略图、图标)
|
|
28
|
+
*/
|
|
29
|
+
export interface EntityCardMediaConfig {
|
|
30
|
+
/** 类型 */
|
|
31
|
+
type: EntityCardMediaType;
|
|
32
|
+
/** 图片地址(avatar/thumbnail 使用) */
|
|
33
|
+
src?: string;
|
|
34
|
+
/** 替换文本 / 描述 */
|
|
35
|
+
alt?: string;
|
|
36
|
+
/** 图标节点(type 为 icon 时使用) */
|
|
37
|
+
icon?: ReactNode;
|
|
38
|
+
/** 尺寸,如 24、48、64 或 CSS 值 */
|
|
39
|
+
size?: number | string;
|
|
40
|
+
/** 形状(avatar/thumbnail):circle | square */
|
|
41
|
+
shape?: 'circle' | 'square';
|
|
42
|
+
/** 图标颜色(type 为 icon 时) */
|
|
43
|
+
color?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 次级文案单项(可带提示)
|
|
47
|
+
*/
|
|
48
|
+
export interface EntityCardSecondaryItem {
|
|
49
|
+
/** 文本内容 */
|
|
50
|
+
text: string;
|
|
51
|
+
/** 是否显示提示 icon(如 info-circle) */
|
|
52
|
+
showTooltip?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 实体卡标签项
|
|
56
|
+
*/
|
|
57
|
+
export interface EntityCardTagItem {
|
|
58
|
+
/** 标签文案 */
|
|
59
|
+
text: string;
|
|
60
|
+
/** 可选自定义样式 */
|
|
61
|
+
style?: CSSProperties;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 实体卡底部操作项
|
|
65
|
+
* 支持文本、按钮、图标三种形式,可各自通过 style / className 更改样式
|
|
66
|
+
*/
|
|
67
|
+
export interface EntityCardActionItem {
|
|
68
|
+
/** 展示形式:文本 / 按钮 / 图标 */
|
|
69
|
+
type: 'text' | 'button' | 'icon';
|
|
70
|
+
/** 文案(text/button 时显示) */
|
|
71
|
+
label?: string;
|
|
72
|
+
/** 图标节点(icon 时单独展示,或 button 旁图标) */
|
|
73
|
+
icon?: ReactNode;
|
|
74
|
+
/** 点击回调 */
|
|
75
|
+
onClick?: () => void;
|
|
76
|
+
/** 单项内联样式 */
|
|
77
|
+
style?: CSSProperties;
|
|
78
|
+
/** 单项类名,用于自定义样式 */
|
|
79
|
+
className?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* 标签展示位置:与主标题同行 / 次级信息下方
|
|
83
|
+
*/
|
|
84
|
+
export declare type EntityCardTagPosition = 'inline' | 'below';
|
|
85
|
+
/**
|
|
86
|
+
* PisellEntityCard 组件 Props
|
|
87
|
+
* 基于 PisellBaseCard,使用结构化配置展示实体信息,支持密度、布局、左滑删除与插槽
|
|
88
|
+
*/
|
|
89
|
+
export interface PisellEntityCardProps extends PisellBaseCardProps {
|
|
90
|
+
/** 媒体区:头像 / 缩略图 / 图标配置 */
|
|
91
|
+
media?: EntityCardMediaConfig;
|
|
92
|
+
/** 主文案(Name/Title) */
|
|
93
|
+
primaryText?: string;
|
|
94
|
+
/** 副标题:与主标题同一行、紧跟主标题后的部分(如电话号),14px Regular #667085 */
|
|
95
|
+
subtitleText?: string;
|
|
96
|
+
/** 次级文案列表,顺序即展示顺序;可带 showTooltip */
|
|
97
|
+
secondaryTexts?: EntityCardSecondaryItem[];
|
|
98
|
+
/** 标签列表,顺序即展示顺序 */
|
|
99
|
+
tags?: EntityCardTagItem[];
|
|
100
|
+
/** 底部操作列表(View Detail、Select 等) */
|
|
101
|
+
actions?: EntityCardActionItem[];
|
|
102
|
+
/** 是否显示媒体区 @default true */
|
|
103
|
+
showMedia?: boolean;
|
|
104
|
+
/** 是否显示主文案 @default true */
|
|
105
|
+
showPrimaryText?: boolean;
|
|
106
|
+
/** 是否显示副标题(与主标题同行) @default true */
|
|
107
|
+
showSubtitle?: boolean;
|
|
108
|
+
/** 是否显示次级文案 @default true */
|
|
109
|
+
showSecondaryText?: boolean;
|
|
110
|
+
/** 是否显示标签 @default true */
|
|
111
|
+
showTags?: boolean;
|
|
112
|
+
/** 是否显示底部 Action 区 @default false */
|
|
113
|
+
showActions?: boolean;
|
|
114
|
+
/** 信息密度 @default 'B2' */
|
|
115
|
+
density?: EntityCardDensity;
|
|
116
|
+
/** 布局方向 @default 'horizontal' */
|
|
117
|
+
layout?: EntityCardLayout;
|
|
118
|
+
/** 卡片宽度 @default 'content' */
|
|
119
|
+
width?: EntityCardWidth;
|
|
120
|
+
/** 是否开启左滑删除 @default false */
|
|
121
|
+
swipeToDelete?: boolean;
|
|
122
|
+
/** 左滑后点击删除时回调 */
|
|
123
|
+
onDelete?: () => void;
|
|
124
|
+
/** 标签展示位置 @default 'below' */
|
|
125
|
+
tagPosition?: EntityCardTagPosition;
|
|
126
|
+
/** 内容区 gap(CSS gap 值) */
|
|
127
|
+
contentGap?: number | string;
|
|
128
|
+
/** 主文案行数限制(CSS -webkit-line-clamp) */
|
|
129
|
+
primaryLineClamp?: number;
|
|
130
|
+
/** 次级文案行数限制(按密度有默认值,可覆盖) */
|
|
131
|
+
secondaryLineClamp?: number;
|
|
132
|
+
/** 自定义渲染媒体区 */
|
|
133
|
+
renderMedia?: () => ReactNode;
|
|
134
|
+
/** 自定义渲染主文案区 */
|
|
135
|
+
renderPrimary?: () => ReactNode;
|
|
136
|
+
/** 自定义渲染副标题区(与主标题同行) */
|
|
137
|
+
renderSubtitle?: () => ReactNode;
|
|
138
|
+
/** 自定义渲染次级文案区 */
|
|
139
|
+
renderSecondary?: () => ReactNode;
|
|
140
|
+
/** 自定义渲染标签区 */
|
|
141
|
+
renderTags?: () => ReactNode;
|
|
142
|
+
/** 自定义渲染底部操作区 */
|
|
143
|
+
renderActions?: () => ReactNode;
|
|
144
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/components/pisellEntityCard/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -126,6 +126,24 @@ function PisellFloorMapLayoutInner(props, ref) {
|
|
|
126
126
|
[zoom.defaultScale, zoom.min, zoom.max, zoom.step]
|
|
127
127
|
);
|
|
128
128
|
const [scale, setScale] = (0, import_react.useState)(zoomConfig.initialScale);
|
|
129
|
+
const [isFullscreen, setIsFullscreen] = (0, import_react.useState)(false);
|
|
130
|
+
(0, import_react.useEffect)(() => {
|
|
131
|
+
const el = containerRef.current;
|
|
132
|
+
if (!el) return;
|
|
133
|
+
const onFullscreenChange = () => setIsFullscreen(document.fullscreenElement === el);
|
|
134
|
+
document.addEventListener("fullscreenchange", onFullscreenChange);
|
|
135
|
+
return () => document.removeEventListener("fullscreenchange", onFullscreenChange);
|
|
136
|
+
}, []);
|
|
137
|
+
const toggleFullscreen = (0, import_react.useCallback)(() => {
|
|
138
|
+
var _a, _b;
|
|
139
|
+
const el = containerRef.current;
|
|
140
|
+
if (!el) return;
|
|
141
|
+
if (document.fullscreenElement) {
|
|
142
|
+
(_a = document.exitFullscreen) == null ? void 0 : _a.call(document);
|
|
143
|
+
} else {
|
|
144
|
+
(_b = el.requestFullscreen) == null ? void 0 : _b.call(el);
|
|
145
|
+
}
|
|
146
|
+
}, []);
|
|
129
147
|
const fitBounds = (0, import_react.useCallback)(() => {
|
|
130
148
|
const ctx = transformRef.current;
|
|
131
149
|
const container = containerRef.current;
|
|
@@ -175,9 +193,10 @@ function PisellFloorMapLayoutInner(props, ref) {
|
|
|
175
193
|
var _a;
|
|
176
194
|
return (_a = transformRef.current) == null ? void 0 : _a.resetTransform();
|
|
177
195
|
},
|
|
178
|
-
fitBounds
|
|
196
|
+
fitBounds,
|
|
197
|
+
toggleFullscreen
|
|
179
198
|
}),
|
|
180
|
-
[fitBounds]
|
|
199
|
+
[fitBounds, toggleFullscreen]
|
|
181
200
|
);
|
|
182
201
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
183
202
|
"div",
|
|
@@ -244,7 +263,7 @@ function PisellFloorMapLayoutInner(props, ref) {
|
|
|
244
263
|
onItemLeave
|
|
245
264
|
}
|
|
246
265
|
)
|
|
247
|
-
), /* @__PURE__ */ import_react.default.createElement(import_ViewControls.default, { api: controlsApi, config: controls, scale }));
|
|
266
|
+
), /* @__PURE__ */ import_react.default.createElement(import_ViewControls.default, { api: controlsApi, config: controls, scale, isFullscreen }));
|
|
248
267
|
}
|
|
249
268
|
)
|
|
250
269
|
);
|
|
@@ -178,7 +178,7 @@ var WithPan = {
|
|
|
178
178
|
},
|
|
179
179
|
zoom: { defaultScale: 1 },
|
|
180
180
|
pan: { enabled: true },
|
|
181
|
-
controls: { showZoom: true, showReset: true, showFitBounds: true }
|
|
181
|
+
controls: { showZoom: true, showReset: true, showFitBounds: true, showFullscreen: true }
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
var shapeItems = [
|
|
@@ -684,7 +684,7 @@ var FigmaDesign = {
|
|
|
684
684
|
},
|
|
685
685
|
zoom: { defaultScale: 0.8, min: 0.5, max: 2 },
|
|
686
686
|
pan: { enabled: true },
|
|
687
|
-
controls: { showZoom: true },
|
|
687
|
+
controls: { showZoom: true, showFullscreen: true },
|
|
688
688
|
style: { height: "100%" }
|
|
689
689
|
}
|
|
690
690
|
)
|
|
@@ -8,6 +8,8 @@ export interface ViewControlsApi {
|
|
|
8
8
|
resetTransform: () => void;
|
|
9
9
|
/** 区域定位,可能由主组件基于 items 计算后封装 */
|
|
10
10
|
fitBounds?: () => void;
|
|
11
|
+
/** 切换全屏(requestFullscreen / exitFullscreen) */
|
|
12
|
+
toggleFullscreen?: () => void;
|
|
11
13
|
}
|
|
12
14
|
export interface ViewControlsProps {
|
|
13
15
|
/** 控制 API */
|
|
@@ -16,6 +18,8 @@ export interface ViewControlsProps {
|
|
|
16
18
|
config?: FloorMapControlsConfig;
|
|
17
19
|
/** 当前缩放比例(1 = 100%),用于 Stepper 展示 */
|
|
18
20
|
scale?: number;
|
|
21
|
+
/** 当前是否处于全屏 */
|
|
22
|
+
isFullscreen?: boolean;
|
|
19
23
|
className?: string;
|
|
20
24
|
}
|
|
21
25
|
export declare function ViewControls(props: ViewControlsProps): JSX.Element;
|
|
@@ -39,10 +39,11 @@ var import_icons = require("@ant-design/icons");
|
|
|
39
39
|
var import_ViewControls = require("./ViewControls.less");
|
|
40
40
|
var PREFIX = "pisell-floor-map-layout";
|
|
41
41
|
function ViewControls(props) {
|
|
42
|
-
const { api, config = {}, scale = 1, className } = props;
|
|
42
|
+
const { api, config = {}, scale = 1, isFullscreen = false, className } = props;
|
|
43
43
|
const showZoom = config.showZoom !== false;
|
|
44
44
|
const showReset = config.showReset === true;
|
|
45
45
|
const showFitBounds = config.showFitBounds === true;
|
|
46
|
+
const showFullscreen = config.showFullscreen === true;
|
|
46
47
|
const scalePercent = Math.round(scale * 100);
|
|
47
48
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${PREFIX}-view-controls`, className) }, showZoom && /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-view-controls-zoom-stepper` }, /* @__PURE__ */ import_react.default.createElement(
|
|
48
49
|
"button",
|
|
@@ -80,6 +81,15 @@ function ViewControls(props) {
|
|
|
80
81
|
"aria-label": "区域定位"
|
|
81
82
|
},
|
|
82
83
|
"⊞"
|
|
84
|
+
), showFullscreen && api.toggleFullscreen && /* @__PURE__ */ import_react.default.createElement(
|
|
85
|
+
"button",
|
|
86
|
+
{
|
|
87
|
+
type: "button",
|
|
88
|
+
className: `${PREFIX}-view-controls-btn`,
|
|
89
|
+
onClick: () => api.toggleFullscreen(),
|
|
90
|
+
"aria-label": isFullscreen ? "退出全屏" : "全屏"
|
|
91
|
+
},
|
|
92
|
+
isFullscreen ? /* @__PURE__ */ import_react.default.createElement(import_icons.FullscreenExitOutlined, null) : /* @__PURE__ */ import_react.default.createElement(import_icons.FullscreenOutlined, null)
|
|
83
93
|
));
|
|
84
94
|
}
|
|
85
95
|
var ViewControls_default = ViewControls;
|