@expcat/tigercat-react 0.0.68 → 0.1.6
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/dist/chunk-2DOPHSZP.js +32 -0
- package/dist/chunk-2TS6X5RA.js +73 -0
- package/dist/chunk-2Y327ZU4.js +493 -0
- package/dist/chunk-3OF7XPIQ.js +90 -0
- package/dist/chunk-3WPKVV4N.js +140 -0
- package/dist/chunk-5FRENLDC.js +194 -0
- package/dist/chunk-5QKMQRCW.js +89 -0
- package/dist/chunk-5ZVSFIZD.js +50 -0
- package/dist/chunk-6MGEGOYJ.js +108 -0
- package/dist/chunk-6PUSRC6S.js +68 -0
- package/dist/chunk-6ZTCBQJ7.mjs +117 -0
- package/dist/chunk-72ZRDBXN.js +25 -0
- package/dist/chunk-77D7VQMG.js +43 -0
- package/dist/chunk-7P6PHSFM.js +548 -0
- package/dist/chunk-A3DJSVTE.js +68 -0
- package/dist/chunk-AQ6DHCP6.js +53 -0
- package/dist/chunk-AQQRWISY.js +184 -0
- package/dist/{chunk-7KRBDT2Z.mjs → chunk-BJU5N7WU.mjs} +1 -1
- package/dist/chunk-C5EFBJBR.js +540 -0
- package/dist/chunk-CIL2AC3F.js +119 -0
- package/dist/chunk-D3I2SY7X.js +301 -0
- package/dist/chunk-DZJUFU55.js +300 -0
- package/dist/chunk-EI2GHMQS.js +37 -0
- package/dist/chunk-ENR3RIMM.js +205 -0
- package/dist/chunk-EQWQXURG.js +18 -0
- package/dist/chunk-EUHWE7MN.js +267 -0
- package/dist/chunk-FQ6UHRAO.js +499 -0
- package/dist/chunk-GX74TC62.js +54 -0
- package/dist/chunk-HDDBBZQH.js +321 -0
- package/dist/chunk-IFY46RWU.js +25 -0
- package/dist/chunk-IQINYCU6.js +99 -0
- package/dist/chunk-IY4LEJYF.js +78 -0
- package/dist/chunk-JW64IJP2.js +210 -0
- package/dist/chunk-KUCFT2OA.js +43 -0
- package/dist/chunk-LNKI6HQ3.js +152 -0
- package/dist/chunk-LXA2YBAO.js +38 -0
- package/dist/chunk-MKWXJZ3T.js +74 -0
- package/dist/chunk-NEULKOYJ.js +48 -0
- package/dist/chunk-NI2WNZRT.js +38 -0
- package/dist/chunk-OFCKGWTS.js +12 -0
- package/dist/chunk-OTRGVENC.js +305 -0
- package/dist/chunk-P273E6XE.js +219 -0
- package/dist/chunk-Q3DPJHNM.js +407 -0
- package/dist/chunk-Q5Q7FG4U.js +271 -0
- package/dist/chunk-QFVE7GKD.js +109 -0
- package/dist/chunk-QL6UEG3U.js +27 -0
- package/dist/chunk-QORSSZX4.js +144 -0
- package/dist/chunk-R4JSBXGG.js +12 -0
- package/dist/chunk-R5BQHZWB.js +698 -0
- package/dist/chunk-R7MS42PL.js +90 -0
- package/dist/{chunk-KMQOLVWP.mjs → chunk-STEIWBMF.mjs} +2 -1
- package/dist/chunk-TB2UHDOZ.js +19 -0
- package/dist/chunk-TBIEWDY5.js +175 -0
- package/dist/chunk-TJFS44SH.js +48 -0
- package/dist/chunk-TZ26HQAW.js +85 -0
- package/dist/chunk-U4ZVEPYD.js +71 -0
- package/dist/chunk-UFAXJVMD.js +120 -0
- package/dist/chunk-VJJ76I7U.js +19 -0
- package/dist/chunk-VO4WDK4K.js +37 -0
- package/dist/chunk-VSF4DF7N.js +84 -0
- package/dist/chunk-VVO4V4IK.js +56 -0
- package/dist/chunk-WK5HN4OH.js +113 -0
- package/dist/chunk-XZDJ5FRB.js +333 -0
- package/dist/chunk-YE2M2HNM.js +168 -0
- package/dist/chunk-YYGTJKP5.js +39 -0
- package/dist/chunk-ZREFCRX3.js +52 -0
- package/dist/components/Alert.d.ts +24 -0
- package/dist/components/Alert.js +10 -0
- package/dist/components/Avatar.d.ts +12 -0
- package/dist/components/Avatar.js +10 -0
- package/dist/components/Badge.d.ts +12 -0
- package/dist/components/Badge.js +10 -0
- package/dist/components/Breadcrumb.d.ts +13 -0
- package/dist/components/Breadcrumb.js +14 -0
- package/dist/components/BreadcrumbItem.d.ts +21 -0
- package/dist/components/BreadcrumbItem.js +11 -0
- package/dist/components/Button.d.mts +1 -0
- package/dist/components/Button.d.ts +9 -0
- package/dist/components/Button.js +10 -0
- package/dist/components/Button.mjs +1 -1
- package/dist/components/Card.d.ts +33 -0
- package/dist/components/Card.js +10 -0
- package/dist/components/Checkbox.d.ts +48 -0
- package/dist/components/Checkbox.js +11 -0
- package/dist/components/CheckboxGroup.d.ts +39 -0
- package/dist/components/CheckboxGroup.js +14 -0
- package/dist/components/Code.d.ts +9 -0
- package/dist/components/Code.js +16 -0
- package/dist/components/Col.d.ts +7 -0
- package/dist/components/Col.js +11 -0
- package/dist/components/ConfigProvider.d.ts +14 -0
- package/dist/components/ConfigProvider.js +14 -0
- package/dist/components/Container.d.ts +13 -0
- package/dist/components/Container.js +10 -0
- package/dist/components/Content.d.ts +9 -0
- package/dist/components/Content.js +10 -0
- package/dist/components/DatePicker.d.ts +24 -0
- package/dist/components/DatePicker.js +10 -0
- package/dist/components/Descriptions.d.ts +53 -0
- package/dist/components/Descriptions.js +16 -0
- package/dist/components/Divider.d.ts +12 -0
- package/dist/components/Divider.js +10 -0
- package/dist/components/Drawer.d.ts +19 -0
- package/dist/components/Drawer.js +11 -0
- package/dist/components/Dropdown.d.ts +22 -0
- package/dist/components/Dropdown.js +16 -0
- package/dist/components/DropdownItem.d.ts +17 -0
- package/dist/components/DropdownItem.js +13 -0
- package/dist/components/DropdownMenu.d.ts +13 -0
- package/dist/components/DropdownMenu.js +10 -0
- package/dist/components/Footer.d.ts +9 -0
- package/dist/components/Footer.js +10 -0
- package/dist/components/Form.d.ts +56 -0
- package/dist/components/Form.js +14 -0
- package/dist/components/FormItem.d.ts +16 -0
- package/dist/components/FormItem.js +11 -0
- package/dist/components/Header.d.ts +9 -0
- package/dist/components/Header.js +10 -0
- package/dist/components/Icon.d.ts +9 -0
- package/dist/components/Icon.js +10 -0
- package/dist/components/Input.d.mts +18 -2
- package/dist/components/Input.d.ts +44 -0
- package/dist/components/Input.js +10 -0
- package/dist/components/Input.mjs +1 -1
- package/dist/components/Layout.d.ts +9 -0
- package/dist/components/Layout.js +10 -0
- package/dist/components/Link.d.ts +10 -0
- package/dist/components/Link.js +10 -0
- package/dist/components/List.d.ts +94 -0
- package/dist/components/List.js +12 -0
- package/dist/components/List.mjs +2 -2
- package/dist/components/Loading.d.ts +8 -0
- package/dist/components/Loading.js +10 -0
- package/dist/components/Menu.d.ts +35 -0
- package/dist/components/Menu.js +14 -0
- package/dist/components/MenuItem.d.ts +20 -0
- package/dist/components/MenuItem.js +11 -0
- package/dist/components/MenuItemGroup.d.ts +16 -0
- package/dist/components/MenuItemGroup.js +12 -0
- package/dist/components/Message.d.ts +44 -0
- package/dist/components/Message.js +20 -0
- package/dist/components/Modal.d.ts +41 -0
- package/dist/components/Modal.js +11 -0
- package/dist/components/Notification.d.ts +40 -0
- package/dist/components/Notification.js +20 -0
- package/dist/components/Pagination.d.ts +11 -0
- package/dist/components/Pagination.js +16 -0
- package/dist/components/Popconfirm.d.ts +34 -0
- package/dist/components/Popconfirm.js +10 -0
- package/dist/components/Popover.d.ts +14 -0
- package/dist/components/Popover.js +10 -0
- package/dist/components/Progress.d.ts +8 -0
- package/dist/components/Progress.js +10 -0
- package/dist/components/Radio.d.ts +20 -0
- package/dist/components/Radio.js +11 -0
- package/dist/components/RadioGroup.d.ts +28 -0
- package/dist/components/RadioGroup.js +14 -0
- package/dist/components/Row.d.ts +11 -0
- package/dist/components/Row.js +14 -0
- package/dist/components/Select.d.ts +23 -0
- package/dist/components/Select.js +10 -0
- package/dist/components/Sidebar.d.ts +9 -0
- package/dist/components/Sidebar.js +10 -0
- package/dist/components/Skeleton.d.ts +7 -0
- package/dist/components/Skeleton.js +10 -0
- package/dist/components/Slider.d.ts +12 -0
- package/dist/components/Slider.js +10 -0
- package/dist/components/Space.d.ts +11 -0
- package/dist/components/Space.js +10 -0
- package/dist/components/Steps.d.ts +31 -0
- package/dist/components/Steps.js +14 -0
- package/dist/components/StepsItem.d.ts +36 -0
- package/dist/components/StepsItem.js +10 -0
- package/dist/components/SubMenu.d.ts +20 -0
- package/dist/components/SubMenu.js +13 -0
- package/dist/components/Switch.d.ts +12 -0
- package/dist/components/Switch.js +10 -0
- package/dist/components/TabPane.d.ts +42 -0
- package/dist/components/TabPane.js +10 -0
- package/dist/components/Table.d.ts +46 -0
- package/dist/components/Table.js +10 -0
- package/dist/components/Tabs.d.ts +43 -0
- package/dist/components/Tabs.js +14 -0
- package/dist/components/Tag.d.ts +16 -0
- package/dist/components/Tag.js +10 -0
- package/dist/components/Text.d.ts +9 -0
- package/dist/components/Text.js +10 -0
- package/dist/components/Textarea.d.ts +13 -0
- package/dist/components/Textarea.js +10 -0
- package/dist/components/TimePicker.d.ts +28 -0
- package/dist/components/TimePicker.js +10 -0
- package/dist/components/Timeline.d.ts +47 -0
- package/dist/components/Timeline.js +10 -0
- package/dist/components/Tooltip.d.ts +15 -0
- package/dist/components/Tooltip.js +10 -0
- package/dist/components/Tree.d.ts +154 -0
- package/dist/components/Tree.js +16 -0
- package/dist/components/Upload.d.ts +16 -0
- package/dist/components/Upload.js +11 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.js +364 -0
- package/dist/index.mjs +3 -3
- package/package.json +3 -6
- package/dist/chunk-QN7NIX7D.mjs +0 -82
- package/dist/styles/index.css +0 -6
- package/dist/styles/index.d.mts +0 -2
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tigercatCore = require('@expcat/tigercat-core');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
10
|
+
|
|
11
|
+
// src/components/StepsItem.tsx
|
|
12
|
+
var StepsContext = React.createContext(null);
|
|
13
|
+
function useStepsContext() {
|
|
14
|
+
return React.useContext(StepsContext);
|
|
15
|
+
}
|
|
16
|
+
var Steps = ({
|
|
17
|
+
current = 0,
|
|
18
|
+
status = "process",
|
|
19
|
+
direction = "horizontal",
|
|
20
|
+
size = "default",
|
|
21
|
+
simple = false,
|
|
22
|
+
clickable = false,
|
|
23
|
+
className,
|
|
24
|
+
style,
|
|
25
|
+
onChange,
|
|
26
|
+
children,
|
|
27
|
+
...props
|
|
28
|
+
}) => {
|
|
29
|
+
const containerClasses = tigercatCore.classNames(tigercatCore.getStepsContainerClasses(direction), className);
|
|
30
|
+
const handleStepClick = (index) => {
|
|
31
|
+
if (!clickable) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
onChange?.(index);
|
|
35
|
+
};
|
|
36
|
+
const contextValue = {
|
|
37
|
+
current,
|
|
38
|
+
status,
|
|
39
|
+
direction,
|
|
40
|
+
size,
|
|
41
|
+
simple,
|
|
42
|
+
clickable,
|
|
43
|
+
handleStepClick: clickable ? handleStepClick : void 0
|
|
44
|
+
};
|
|
45
|
+
const totalCount = React__default.default.Children.count(children);
|
|
46
|
+
const stepsWithProps = React__default.default.Children.map(children, (child, index) => {
|
|
47
|
+
if (React__default.default.isValidElement(child) && child.type === StepsItem) {
|
|
48
|
+
return React__default.default.cloneElement(child, {
|
|
49
|
+
stepIndex: index,
|
|
50
|
+
isLast: index === totalCount - 1
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return child;
|
|
54
|
+
});
|
|
55
|
+
const mergedStyle = {
|
|
56
|
+
...style ?? {}
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StepsContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx("ol", { ...props, className: containerClasses, style: mergedStyle, children: stepsWithProps }) });
|
|
59
|
+
};
|
|
60
|
+
var StepsItem = ({
|
|
61
|
+
title,
|
|
62
|
+
description,
|
|
63
|
+
icon,
|
|
64
|
+
status: customStatus,
|
|
65
|
+
disabled = false,
|
|
66
|
+
stepIndex = 0,
|
|
67
|
+
isLast = false,
|
|
68
|
+
className,
|
|
69
|
+
style,
|
|
70
|
+
...props
|
|
71
|
+
}) => {
|
|
72
|
+
const stepsContext = useStepsContext() || {
|
|
73
|
+
current: 0,
|
|
74
|
+
status: "process",
|
|
75
|
+
direction: "horizontal",
|
|
76
|
+
size: "default",
|
|
77
|
+
simple: false,
|
|
78
|
+
clickable: false
|
|
79
|
+
};
|
|
80
|
+
const stepStatus = tigercatCore.calculateStepStatus(
|
|
81
|
+
stepIndex,
|
|
82
|
+
stepsContext.current,
|
|
83
|
+
stepsContext.status,
|
|
84
|
+
customStatus
|
|
85
|
+
);
|
|
86
|
+
const isClickable = !!stepsContext.handleStepClick && !disabled;
|
|
87
|
+
const itemClasses = tigercatCore.classNames(
|
|
88
|
+
tigercatCore.getStepItemClasses(stepsContext.direction, isLast, stepsContext.simple),
|
|
89
|
+
className
|
|
90
|
+
);
|
|
91
|
+
const iconClasses = tigercatCore.getStepIconClasses(stepStatus, stepsContext.size, stepsContext.simple, !!icon);
|
|
92
|
+
const tailClasses = tigercatCore.getStepTailClasses(stepsContext.direction, stepStatus, isLast);
|
|
93
|
+
const contentClasses = tigercatCore.getStepContentClasses(stepsContext.direction, stepsContext.simple);
|
|
94
|
+
const titleClasses = tigercatCore.getStepTitleClasses(stepStatus, stepsContext.size, isClickable);
|
|
95
|
+
const descriptionClasses = tigercatCore.getStepDescriptionClasses(stepStatus, stepsContext.size);
|
|
96
|
+
const handleClick = (event) => {
|
|
97
|
+
if (!isClickable) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
stepsContext.handleStepClick?.(stepIndex);
|
|
101
|
+
};
|
|
102
|
+
const renderIcon = () => {
|
|
103
|
+
if (icon) {
|
|
104
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: iconClasses, children: icon });
|
|
105
|
+
}
|
|
106
|
+
if (stepStatus === "finish") {
|
|
107
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: iconClasses, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
108
|
+
"svg",
|
|
109
|
+
{
|
|
110
|
+
className: tigercatCore.stepFinishIconSvgClasses,
|
|
111
|
+
fill: "none",
|
|
112
|
+
stroke: "currentColor",
|
|
113
|
+
viewBox: tigercatCore.stepFinishIconViewBox,
|
|
114
|
+
"aria-hidden": "true",
|
|
115
|
+
focusable: "false",
|
|
116
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
117
|
+
"path",
|
|
118
|
+
{
|
|
119
|
+
strokeLinecap: tigercatCore.stepFinishIconPathStrokeLinecap,
|
|
120
|
+
strokeLinejoin: tigercatCore.stepFinishIconPathStrokeLinejoin,
|
|
121
|
+
strokeWidth: tigercatCore.stepFinishIconPathStrokeWidth,
|
|
122
|
+
d: tigercatCore.stepFinishIconPathD
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
) });
|
|
127
|
+
}
|
|
128
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: iconClasses, children: stepIndex + 1 });
|
|
129
|
+
};
|
|
130
|
+
const renderContent = () => {
|
|
131
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: contentClasses, children: [
|
|
132
|
+
stepsContext.clickable ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
133
|
+
"button",
|
|
134
|
+
{
|
|
135
|
+
type: "button",
|
|
136
|
+
className: titleClasses,
|
|
137
|
+
onClick: handleClick,
|
|
138
|
+
disabled: !isClickable,
|
|
139
|
+
"aria-disabled": disabled || void 0,
|
|
140
|
+
children: title
|
|
141
|
+
}
|
|
142
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: titleClasses, children: title }),
|
|
143
|
+
!stepsContext.simple && description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClasses, children: description })
|
|
144
|
+
] });
|
|
145
|
+
};
|
|
146
|
+
if (stepsContext.direction === "vertical") {
|
|
147
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
148
|
+
"li",
|
|
149
|
+
{
|
|
150
|
+
...props,
|
|
151
|
+
className: itemClasses,
|
|
152
|
+
style,
|
|
153
|
+
"aria-current": stepIndex === stepsContext.current ? "step" : void 0,
|
|
154
|
+
"aria-disabled": disabled || void 0,
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
157
|
+
renderIcon(),
|
|
158
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tailClasses })
|
|
159
|
+
] }),
|
|
160
|
+
renderContent()
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
166
|
+
"li",
|
|
167
|
+
{
|
|
168
|
+
...props,
|
|
169
|
+
className: itemClasses,
|
|
170
|
+
style,
|
|
171
|
+
"aria-current": stepIndex === stepsContext.current ? "step" : void 0,
|
|
172
|
+
"aria-disabled": disabled || void 0,
|
|
173
|
+
children: [
|
|
174
|
+
renderIcon(),
|
|
175
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tailClasses }),
|
|
176
|
+
renderContent()
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
exports.Steps = Steps;
|
|
183
|
+
exports.StepsItem = StepsItem;
|
|
184
|
+
exports.useStepsContext = useStepsContext;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Select } from './chunk-YYKJ63LD.mjs';
|
|
2
|
-
import { Button } from './chunk-
|
|
2
|
+
import { Button } from './chunk-STEIWBMF.mjs';
|
|
3
3
|
import { useState, useMemo } from 'react';
|
|
4
4
|
import { getSpinnerSVG, paginateData, calculatePagination, classNames, getListClasses, listSizeClasses, listGridContainerClasses, getGridColumnClasses, listWrapperClasses, listLoadingOverlayClasses, getListHeaderFooterClasses, listEmptyStateClasses, listPaginationContainerClasses, getLoadingOverlaySpinnerClasses, getListItemClasses, listItemAvatarClasses, listItemTitleClasses, listItemDescriptionClasses, listItemContentClasses, listItemMetaClasses, listItemExtraClasses } from '@expcat/tigercat-core';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|