@expcat/tigercat-react 1.2.31 → 1.2.34
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-UQOMRXTD.mjs → chunk-7E24KEVK.mjs} +60 -44
- package/dist/{chunk-P4INKEQ3.js → chunk-7JFP3MIW.js} +60 -44
- package/dist/{chunk-IWLUYAZV.mjs → chunk-AIXYHS2L.mjs} +53 -42
- package/dist/{chunk-FXVKJWUP.js → chunk-ANN5P7TJ.js} +5 -1
- package/dist/{chunk-D62GWQBX.mjs → chunk-CHS54PVQ.mjs} +14 -3
- package/dist/{chunk-IUOTJ73N.mjs → chunk-D4FXVNRW.mjs} +1 -1
- package/dist/{chunk-SXHP4Q7O.js → chunk-DSXII6ZF.js} +23 -10
- package/dist/{chunk-UHRZKZVU.mjs → chunk-FWIYDMJA.mjs} +19 -5
- package/dist/{chunk-KTV3ZDSQ.js → chunk-H2YHUFMK.js} +2 -2
- package/dist/{chunk-WWDCH2XX.mjs → chunk-JOB47R6Q.mjs} +5 -1
- package/dist/{chunk-K5B4XXAI.js → chunk-LROHXQWX.js} +2 -2
- package/dist/{chunk-R4OVIDAY.mjs → chunk-M26BTAIB.mjs} +28 -3
- package/dist/{chunk-77F5YT4E.js → chunk-O7WBBZ7J.js} +27 -2
- package/dist/{chunk-AKDBQOKX.mjs → chunk-RL6HARKE.mjs} +20 -7
- package/dist/{chunk-CPNDCACQ.mjs → chunk-RVO6R37N.mjs} +1 -1
- package/dist/{chunk-OHSJ4KTU.js → chunk-TLU3ROLT.js} +17 -6
- package/dist/{chunk-IXHXSD2E.js → chunk-VAZYY35F.js} +55 -44
- package/dist/{chunk-APODZAVO.js → chunk-VHHYTCZQ.js} +2 -2
- package/dist/{chunk-VUODYCCC.mjs → chunk-VXOLIMK2.mjs} +1 -1
- package/dist/{chunk-KEF2PEP4.js → chunk-WYKUC5MM.js} +19 -5
- package/dist/components/CropUpload.js +4 -3
- package/dist/components/CropUpload.mjs +3 -2
- package/dist/components/DataTableWithToolbar.js +3 -3
- package/dist/components/DataTableWithToolbar.mjs +2 -2
- package/dist/components/Drawer.js +3 -2
- package/dist/components/Drawer.mjs +2 -1
- package/dist/components/FormWizard.js +2 -2
- package/dist/components/FormWizard.mjs +1 -1
- package/dist/components/Kanban.js +3 -3
- package/dist/components/Kanban.mjs +2 -2
- package/dist/components/Modal.js +3 -2
- package/dist/components/Modal.mjs +2 -1
- package/dist/components/Pagination.js +3 -2
- package/dist/components/Pagination.mjs +2 -1
- package/dist/components/Table.js +2 -2
- package/dist/components/Table.mjs +1 -1
- package/dist/components/TaskBoard.js +2 -2
- package/dist/components/TaskBoard.mjs +1 -1
- package/dist/components/VirtualTable.js +2 -2
- package/dist/components/VirtualTable.mjs +1 -1
- package/dist/index.js +11 -11
- package/dist/index.mjs +10 -10
- package/package.json +2 -2
|
@@ -72,6 +72,7 @@ var FormWizard = ({
|
|
|
72
72
|
nextText,
|
|
73
73
|
finishText,
|
|
74
74
|
locale,
|
|
75
|
+
labels: labelsOverride,
|
|
75
76
|
beforeNext,
|
|
76
77
|
autoSave,
|
|
77
78
|
onChange,
|
|
@@ -86,7 +87,10 @@ var FormWizard = ({
|
|
|
86
87
|
() => mergeTigerLocale(config.locale, locale),
|
|
87
88
|
[config.locale, locale]
|
|
88
89
|
);
|
|
89
|
-
const labels = useMemo(
|
|
90
|
+
const labels = useMemo(
|
|
91
|
+
() => getFormWizardLabels(mergedLocale, labelsOverride),
|
|
92
|
+
[mergedLocale, labelsOverride]
|
|
93
|
+
);
|
|
90
94
|
const [innerCurrent, setInnerCurrent] = useState(defaultCurrent);
|
|
91
95
|
useEffect(() => {
|
|
92
96
|
if (current !== void 0) setInnerCurrent(current);
|
|
@@ -180,52 +184,64 @@ var FormWizard = ({
|
|
|
180
184
|
[steps]
|
|
181
185
|
);
|
|
182
186
|
return /* @__PURE__ */ jsxs("div", { className: wrapperClasses, style, "data-tiger-form-wizard": true, ...props, children: [
|
|
183
|
-
showSteps && steps.length > 0 && /* @__PURE__ */ jsx(
|
|
184
|
-
"
|
|
185
|
-
bordered ? "border-b border-[var(--tiger-border,#e5e7eb)]" : ""
|
|
186
|
-
), children: /* @__PURE__ */ jsx(
|
|
187
|
-
Steps,
|
|
187
|
+
showSteps && steps.length > 0 && /* @__PURE__ */ jsx(
|
|
188
|
+
"div",
|
|
188
189
|
{
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
className: classNames(
|
|
191
|
+
"px-6 py-5 bg-[var(--tiger-surface-muted,#f9fafb)]/95 backdrop-blur-sm transition-all duration-300",
|
|
192
|
+
bordered ? "border-b border-[var(--tiger-border,#e5e7eb)]" : ""
|
|
193
|
+
),
|
|
194
|
+
children: /* @__PURE__ */ jsx(
|
|
195
|
+
Steps,
|
|
196
|
+
{
|
|
197
|
+
current: currentIndex,
|
|
198
|
+
direction,
|
|
199
|
+
size,
|
|
200
|
+
simple,
|
|
201
|
+
clickable,
|
|
202
|
+
onChange: handleStepChange,
|
|
203
|
+
children: stepsNodes
|
|
204
|
+
}
|
|
205
|
+
)
|
|
196
206
|
}
|
|
197
|
-
)
|
|
207
|
+
),
|
|
198
208
|
/* @__PURE__ */ jsx("div", { className: "px-8 py-6 flex flex-col items-center w-full min-h-[120px] transition-all duration-300", children: contentNode }),
|
|
199
|
-
showActions && /* @__PURE__ */ jsxs(
|
|
200
|
-
"
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
209
|
+
showActions && /* @__PURE__ */ jsxs(
|
|
210
|
+
"div",
|
|
211
|
+
{
|
|
212
|
+
className: classNames(
|
|
213
|
+
"flex items-center justify-between gap-3 px-8 py-4 bg-[var(--tiger-surface-muted,#f9fafb)]/95 backdrop-blur-sm transition-all duration-300",
|
|
214
|
+
bordered ? "border-t border-[var(--tiger-border,#e5e7eb)]" : ""
|
|
215
|
+
),
|
|
216
|
+
children: [
|
|
217
|
+
!isFirst ? /* @__PURE__ */ jsx(
|
|
218
|
+
Button,
|
|
219
|
+
{
|
|
220
|
+
htmlType: "button",
|
|
221
|
+
variant: "secondary",
|
|
222
|
+
className: "group",
|
|
223
|
+
onClick: handlePrev,
|
|
224
|
+
size: size === "small" ? "sm" : "md",
|
|
225
|
+
icon: /* @__PURE__ */ jsx(ArrowLeftIcon, {}),
|
|
226
|
+
children: resolveLocaleText(labels.prevText, prevText)
|
|
227
|
+
}
|
|
228
|
+
) : /* @__PURE__ */ jsx("div", {}),
|
|
229
|
+
/* @__PURE__ */ jsx(
|
|
230
|
+
Button,
|
|
231
|
+
{
|
|
232
|
+
htmlType: "button",
|
|
233
|
+
variant: "primary",
|
|
234
|
+
className: "group",
|
|
235
|
+
onClick: handleNext,
|
|
236
|
+
size: size === "small" ? "sm" : "md",
|
|
237
|
+
icon: isLast ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(ArrowRightIcon, {}),
|
|
238
|
+
iconPosition: isLast ? "left" : "right",
|
|
239
|
+
children: isLast ? resolveLocaleText(labels.finishText, finishText) : resolveLocaleText(labels.nextText, nextText)
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
)
|
|
229
245
|
] });
|
|
230
246
|
};
|
|
231
247
|
var FormWizard_default = FormWizard;
|
|
@@ -72,6 +72,7 @@ var FormWizard = ({
|
|
|
72
72
|
nextText,
|
|
73
73
|
finishText,
|
|
74
74
|
locale,
|
|
75
|
+
labels: labelsOverride,
|
|
75
76
|
beforeNext,
|
|
76
77
|
autoSave,
|
|
77
78
|
onChange,
|
|
@@ -86,7 +87,10 @@ var FormWizard = ({
|
|
|
86
87
|
() => _tigercatcore.mergeTigerLocale.call(void 0, config.locale, locale),
|
|
87
88
|
[config.locale, locale]
|
|
88
89
|
);
|
|
89
|
-
const labels = _react.useMemo.call(void 0,
|
|
90
|
+
const labels = _react.useMemo.call(void 0,
|
|
91
|
+
() => _tigercatcore.getFormWizardLabels.call(void 0, mergedLocale, labelsOverride),
|
|
92
|
+
[mergedLocale, labelsOverride]
|
|
93
|
+
);
|
|
90
94
|
const [innerCurrent, setInnerCurrent] = _react.useState.call(void 0, defaultCurrent);
|
|
91
95
|
_react.useEffect.call(void 0, () => {
|
|
92
96
|
if (current !== void 0) setInnerCurrent(current);
|
|
@@ -180,52 +184,64 @@ var FormWizard = ({
|
|
|
180
184
|
[steps]
|
|
181
185
|
);
|
|
182
186
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: wrapperClasses, style, "data-tiger-form-wizard": true, ...props, children: [
|
|
183
|
-
showSteps && steps.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
184
|
-
"
|
|
185
|
-
bordered ? "border-b border-[var(--tiger-border,#e5e7eb)]" : ""
|
|
186
|
-
), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
187
|
-
_chunkM7HBWFQOjs.Steps,
|
|
187
|
+
showSteps && steps.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
188
|
+
"div",
|
|
188
189
|
{
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
className: _tigercatcore.classNames.call(void 0,
|
|
191
|
+
"px-6 py-5 bg-[var(--tiger-surface-muted,#f9fafb)]/95 backdrop-blur-sm transition-all duration-300",
|
|
192
|
+
bordered ? "border-b border-[var(--tiger-border,#e5e7eb)]" : ""
|
|
193
|
+
),
|
|
194
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
195
|
+
_chunkM7HBWFQOjs.Steps,
|
|
196
|
+
{
|
|
197
|
+
current: currentIndex,
|
|
198
|
+
direction,
|
|
199
|
+
size,
|
|
200
|
+
simple,
|
|
201
|
+
clickable,
|
|
202
|
+
onChange: handleStepChange,
|
|
203
|
+
children: stepsNodes
|
|
204
|
+
}
|
|
205
|
+
)
|
|
196
206
|
}
|
|
197
|
-
)
|
|
207
|
+
),
|
|
198
208
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "px-8 py-6 flex flex-col items-center w-full min-h-[120px] transition-all duration-300", children: contentNode }),
|
|
199
|
-
showActions && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
200
|
-
"
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
209
|
+
showActions && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
210
|
+
"div",
|
|
211
|
+
{
|
|
212
|
+
className: _tigercatcore.classNames.call(void 0,
|
|
213
|
+
"flex items-center justify-between gap-3 px-8 py-4 bg-[var(--tiger-surface-muted,#f9fafb)]/95 backdrop-blur-sm transition-all duration-300",
|
|
214
|
+
bordered ? "border-t border-[var(--tiger-border,#e5e7eb)]" : ""
|
|
215
|
+
),
|
|
216
|
+
children: [
|
|
217
|
+
!isFirst ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
218
|
+
_chunk56ZV3VVYjs.Button,
|
|
219
|
+
{
|
|
220
|
+
htmlType: "button",
|
|
221
|
+
variant: "secondary",
|
|
222
|
+
className: "group",
|
|
223
|
+
onClick: handlePrev,
|
|
224
|
+
size: size === "small" ? "sm" : "md",
|
|
225
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ArrowLeftIcon, {}),
|
|
226
|
+
children: _tigercatcore.resolveLocaleText.call(void 0, labels.prevText, prevText)
|
|
227
|
+
}
|
|
228
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}),
|
|
229
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
230
|
+
_chunk56ZV3VVYjs.Button,
|
|
231
|
+
{
|
|
232
|
+
htmlType: "button",
|
|
233
|
+
variant: "primary",
|
|
234
|
+
className: "group",
|
|
235
|
+
onClick: handleNext,
|
|
236
|
+
size: size === "small" ? "sm" : "md",
|
|
237
|
+
icon: isLast ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ArrowRightIcon, {}),
|
|
238
|
+
iconPosition: isLast ? "left" : "right",
|
|
239
|
+
children: isLast ? _tigercatcore.resolveLocaleText.call(void 0, labels.finishText, finishText) : _tigercatcore.resolveLocaleText.call(void 0, labels.nextText, nextText)
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
)
|
|
229
245
|
] });
|
|
230
246
|
};
|
|
231
247
|
var FormWizard_default = FormWizard;
|
|
@@ -487,6 +487,8 @@ import {
|
|
|
487
487
|
classNames,
|
|
488
488
|
getTableHeaderClasses,
|
|
489
489
|
getTableHeaderCellClasses,
|
|
490
|
+
getTableFixedHeaderCellClasses,
|
|
491
|
+
getFixedColumnStyle,
|
|
490
492
|
getCheckboxCellClasses,
|
|
491
493
|
getExpandIconCellClasses
|
|
492
494
|
} from "@expcat/tigercat-core";
|
|
@@ -513,17 +515,7 @@ function renderTableHeader(ctx, view) {
|
|
|
513
515
|
const isSorted = ctx.sortState.key === column.key;
|
|
514
516
|
const sortDirection = isSorted ? ctx.sortState.direction : null;
|
|
515
517
|
const ariaSort = column.sortable ? sortDirection === "asc" ? "ascending" : sortDirection === "desc" ? "descending" : "none" : void 0;
|
|
516
|
-
const
|
|
517
|
-
const isFixedRight = column.fixed === "right";
|
|
518
|
-
const fixedStyle = isFixedLeft ? {
|
|
519
|
-
position: "sticky",
|
|
520
|
-
left: `${ctx.fixedColumnsInfo.leftOffsets[column.key] || 0}px`,
|
|
521
|
-
zIndex: 15
|
|
522
|
-
} : isFixedRight ? {
|
|
523
|
-
position: "sticky",
|
|
524
|
-
right: `${ctx.fixedColumnsInfo.rightOffsets[column.key] || 0}px`,
|
|
525
|
-
zIndex: 15
|
|
526
|
-
} : void 0;
|
|
518
|
+
const fixedStyle = getFixedColumnStyle(column, ctx.fixedColumnsInfo, 15);
|
|
527
519
|
const widthStyle = column.width ? {
|
|
528
520
|
width: typeof column.width === "number" ? `${column.width}px` : column.width
|
|
529
521
|
} : void 0;
|
|
@@ -540,7 +532,12 @@ function renderTableHeader(ctx, view) {
|
|
|
540
532
|
!!column.sortable,
|
|
541
533
|
column.headerClassName
|
|
542
534
|
),
|
|
543
|
-
(
|
|
535
|
+
getTableFixedHeaderCellClasses({
|
|
536
|
+
view: "table",
|
|
537
|
+
column,
|
|
538
|
+
stickyHeader,
|
|
539
|
+
fixedInfo: ctx.fixedColumnsInfo
|
|
540
|
+
})
|
|
544
541
|
),
|
|
545
542
|
style,
|
|
546
543
|
draggable: columnDraggable ? true : void 0,
|
|
@@ -605,6 +602,8 @@ import {
|
|
|
605
602
|
classNames as classNames2,
|
|
606
603
|
getTableRowClasses,
|
|
607
604
|
getTableCellClasses,
|
|
605
|
+
getTableFixedCellClasses,
|
|
606
|
+
getFixedColumnStyle as getFixedColumnStyle2,
|
|
608
607
|
getCheckboxCellClasses as getCheckboxCellClasses2,
|
|
609
608
|
getExpandIconCellClasses as getExpandIconCellClasses2,
|
|
610
609
|
getExpandedRowClasses,
|
|
@@ -713,26 +712,22 @@ function renderTableBody(ctx, view) {
|
|
|
713
712
|
ctx.displayColumns.map((column) => {
|
|
714
713
|
const dataKey = column.dataKey || column.key;
|
|
715
714
|
const cellValue = record[dataKey];
|
|
716
|
-
const
|
|
717
|
-
const isFixedRight = column.fixed === "right";
|
|
718
|
-
const fixedStyle = isFixedLeft ? {
|
|
719
|
-
position: "sticky",
|
|
720
|
-
left: `${ctx.fixedColumnsInfo.leftOffsets[column.key] || 0}px`,
|
|
721
|
-
zIndex: 10
|
|
722
|
-
} : isFixedRight ? {
|
|
723
|
-
position: "sticky",
|
|
724
|
-
right: `${ctx.fixedColumnsInfo.rightOffsets[column.key] || 0}px`,
|
|
725
|
-
zIndex: 10
|
|
726
|
-
} : void 0;
|
|
715
|
+
const fixedStyle = getFixedColumnStyle2(column, ctx.fixedColumnsInfo, 10);
|
|
727
716
|
const widthStyle = column.width ? {
|
|
728
717
|
width: typeof column.width === "number" ? `${column.width}px` : column.width
|
|
729
718
|
} : void 0;
|
|
730
719
|
const style = fixedStyle ? { ...widthStyle, ...fixedStyle } : widthStyle;
|
|
731
|
-
const
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
720
|
+
const stickyCellClass = getTableFixedCellClasses({
|
|
721
|
+
view: "table",
|
|
722
|
+
column,
|
|
723
|
+
record,
|
|
724
|
+
rowIndex: index,
|
|
725
|
+
striped,
|
|
726
|
+
stripedActive: striped && index % 2 === 0,
|
|
727
|
+
selected: isSelected,
|
|
728
|
+
hoverable,
|
|
729
|
+
fixedInfo: ctx.fixedColumnsInfo
|
|
730
|
+
});
|
|
736
731
|
const isEditing = ctx.editingCell?.rowIndex === index && ctx.editingCell?.columnKey === column.key;
|
|
737
732
|
const cellEditable = ctx.isCellEditable(column.key, index);
|
|
738
733
|
return /* @__PURE__ */ jsx3(
|
|
@@ -831,8 +826,8 @@ function renderSummaryRow(ctx, view) {
|
|
|
831
826
|
// src/components/Table/render-pagination.tsx
|
|
832
827
|
import {
|
|
833
828
|
formatIntlNumber,
|
|
834
|
-
formatPageAriaLabel,
|
|
835
829
|
formatPaginationTotal,
|
|
830
|
+
formatPaginationPageIndicator,
|
|
836
831
|
getPaginationLabels,
|
|
837
832
|
getSimplePaginationContainerClasses,
|
|
838
833
|
getSimplePaginationTotalClasses,
|
|
@@ -852,18 +847,20 @@ function renderPagination(ctx, view) {
|
|
|
852
847
|
const paginationConfig = pagination;
|
|
853
848
|
const total = paginationConfig.total !== void 0 && paginationConfig.total > 0 ? paginationConfig.total : ctx.processedData.length;
|
|
854
849
|
const locale = view.disableI18n ? void 0 : view.locale;
|
|
855
|
-
const labels =
|
|
850
|
+
const labels = getPaginationLabels(locale);
|
|
856
851
|
const localeCode = locale?.locale;
|
|
857
|
-
const
|
|
858
|
-
const
|
|
859
|
-
const
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
const
|
|
852
|
+
const finalTotalText = paginationConfig.totalText ? paginationConfig.totalText(total, [startIndex, endIndex]) : formatPaginationTotal(labels.totalText, total, [startIndex, endIndex], localeCode);
|
|
853
|
+
const finalPrevText = paginationConfig.prevText || labels.prevPageAriaLabel;
|
|
854
|
+
const finalNextText = paginationConfig.nextText || labels.nextPageAriaLabel;
|
|
855
|
+
const finalPageIndicatorText = paginationConfig.pageIndicatorText ? paginationConfig.pageIndicatorText(ctx.currentPage, totalPages) : formatPaginationPageIndicator(
|
|
856
|
+
labels.pageIndicatorText,
|
|
857
|
+
ctx.currentPage,
|
|
858
|
+
totalPages,
|
|
859
|
+
localeCode
|
|
860
|
+
);
|
|
861
|
+
const finalPrevAriaLabel = view.disableI18n ? finalPrevText : labels.prevPageAriaLabel;
|
|
862
|
+
const finalNextAriaLabel = view.disableI18n ? finalNextText : labels.nextPageAriaLabel;
|
|
863
|
+
const normalizedPageSizeOptions = paginationConfig.pageSizeOptions || [10, 20, 50, 100];
|
|
867
864
|
return /* @__PURE__ */ jsxs4("div", { className: getSimplePaginationContainerClasses(), children: [
|
|
868
865
|
paginationConfig.showTotal !== false && /* @__PURE__ */ jsx5("div", { className: getSimplePaginationTotalClasses(), children: finalTotalText }),
|
|
869
866
|
/* @__PURE__ */ jsxs4("div", { className: getSimplePaginationControlsClasses(), children: [
|
|
@@ -872,8 +869,13 @@ function renderPagination(ctx, view) {
|
|
|
872
869
|
{
|
|
873
870
|
className: getSimplePaginationSelectClasses(),
|
|
874
871
|
value: ctx.currentPageSize,
|
|
872
|
+
"aria-label": labels.itemsPerPageText,
|
|
875
873
|
onChange: (e) => ctx.handlePageSizeChange(Number(e.target.value)),
|
|
876
|
-
children:
|
|
874
|
+
children: normalizedPageSizeOptions.map((option) => {
|
|
875
|
+
const value = typeof option === "number" ? option : option.value;
|
|
876
|
+
const label = typeof option === "number" ? `${formatIntlNumber(value, localeCode)} ${labels.itemsPerPageText}` : option.label ?? `${formatIntlNumber(value, localeCode)} ${labels.itemsPerPageText}`;
|
|
877
|
+
return /* @__PURE__ */ jsx5("option", { value, children: paginationConfig.pageSizeText ? paginationConfig.pageSizeText(value) : label }, value);
|
|
878
|
+
})
|
|
877
879
|
}
|
|
878
880
|
),
|
|
879
881
|
/* @__PURE__ */ jsxs4("div", { className: getSimplePaginationButtonsWrapperClasses(), children: [
|
|
@@ -882,16 +884,25 @@ function renderPagination(ctx, view) {
|
|
|
882
884
|
{
|
|
883
885
|
className: getSimplePaginationButtonClasses(!hasPrev),
|
|
884
886
|
disabled: !hasPrev,
|
|
887
|
+
"aria-label": finalPrevAriaLabel,
|
|
885
888
|
onClick: () => ctx.handlePageChange(ctx.currentPage - 1),
|
|
886
889
|
children: finalPrevText
|
|
887
890
|
}
|
|
888
891
|
),
|
|
889
|
-
/* @__PURE__ */ jsx5(
|
|
892
|
+
/* @__PURE__ */ jsx5(
|
|
893
|
+
"span",
|
|
894
|
+
{
|
|
895
|
+
className: getSimplePaginationPageIndicatorClasses(),
|
|
896
|
+
"aria-label": finalPageIndicatorText,
|
|
897
|
+
children: finalPageIndicatorText
|
|
898
|
+
}
|
|
899
|
+
),
|
|
890
900
|
/* @__PURE__ */ jsx5(
|
|
891
901
|
"button",
|
|
892
902
|
{
|
|
893
903
|
className: getSimplePaginationButtonClasses(!hasNext),
|
|
894
904
|
disabled: !hasNext,
|
|
905
|
+
"aria-label": finalNextAriaLabel,
|
|
895
906
|
onClick: () => ctx.handlePageChange(ctx.currentPage + 1),
|
|
896
907
|
children: finalNextText
|
|
897
908
|
}
|
|
@@ -271,6 +271,7 @@ var TaskBoard = ({
|
|
|
271
271
|
renderColumnFooter,
|
|
272
272
|
renderEmptyColumn,
|
|
273
273
|
locale,
|
|
274
|
+
labels: labelsOverride,
|
|
274
275
|
className,
|
|
275
276
|
style,
|
|
276
277
|
...rest
|
|
@@ -280,7 +281,10 @@ var TaskBoard = ({
|
|
|
280
281
|
() => _tigercatcore.mergeTigerLocale.call(void 0, config.locale, locale),
|
|
281
282
|
[config.locale, locale]
|
|
282
283
|
);
|
|
283
|
-
const labels = _react.useMemo.call(void 0,
|
|
284
|
+
const labels = _react.useMemo.call(void 0,
|
|
285
|
+
() => _tigercatcore.getTaskBoardLabels.call(void 0, mergedLocale, labelsOverride),
|
|
286
|
+
[mergedLocale, labelsOverride]
|
|
287
|
+
);
|
|
284
288
|
const [innerColumns, setInnerColumns] = _react.useState.call(void 0, defaultColumns);
|
|
285
289
|
_react.useEffect.call(void 0, () => {
|
|
286
290
|
if (controlledColumns !== void 0) setInnerColumns(controlledColumns);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTigerConfig
|
|
3
|
+
} from "./chunk-QAIBQHIO.mjs";
|
|
1
4
|
import {
|
|
2
5
|
renderBodyPortal,
|
|
3
6
|
useBodyScrollLock,
|
|
@@ -30,7 +33,8 @@ import {
|
|
|
30
33
|
resolveLocaleText,
|
|
31
34
|
resolveSwipeGesture,
|
|
32
35
|
restoreFocus,
|
|
33
|
-
shouldCloseOnMaskClick
|
|
36
|
+
shouldCloseOnMaskClick,
|
|
37
|
+
mergeTigerLocale
|
|
34
38
|
} from "@expcat/tigercat-core";
|
|
35
39
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
36
40
|
var CloseIcon = () => /* @__PURE__ */ jsx(
|
|
@@ -76,11 +80,17 @@ var Drawer = ({
|
|
|
76
80
|
onAfterLeave,
|
|
77
81
|
closeAriaLabel,
|
|
78
82
|
locale,
|
|
83
|
+
labels,
|
|
79
84
|
children,
|
|
80
85
|
footer,
|
|
81
86
|
style,
|
|
82
87
|
...rest
|
|
83
88
|
}) => {
|
|
89
|
+
const config = useTigerConfig();
|
|
90
|
+
const mergedLocale = useMemo(
|
|
91
|
+
() => mergeTigerLocale(config.locale, locale),
|
|
92
|
+
[config.locale, locale]
|
|
93
|
+
);
|
|
84
94
|
const [hasBeenOpened, setHasBeenOpened] = React.useState(open);
|
|
85
95
|
const [deferredRendered, setDeferredRendered] = React.useState(open);
|
|
86
96
|
useEffect(() => {
|
|
@@ -142,8 +152,9 @@ var Drawer = ({
|
|
|
142
152
|
const resolvedCloseAriaLabel = resolveLocaleText(
|
|
143
153
|
"Close drawer",
|
|
144
154
|
closeAriaLabel,
|
|
145
|
-
|
|
146
|
-
|
|
155
|
+
labels?.closeAriaLabel,
|
|
156
|
+
mergedLocale?.drawer?.closeAriaLabel,
|
|
157
|
+
mergedLocale?.common?.closeText
|
|
147
158
|
);
|
|
148
159
|
useEffect(() => {
|
|
149
160
|
if (open) {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
+
var _chunkTDODFBBOjs = require('./chunk-TDODFBBO.js');
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
var _chunk56ZV3VVYjs = require('./chunk-56ZV3VVY.js');
|
|
4
7
|
|
|
5
8
|
|
|
@@ -32,6 +35,7 @@ var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
|
32
35
|
|
|
33
36
|
|
|
34
37
|
|
|
38
|
+
|
|
35
39
|
|
|
36
40
|
|
|
37
41
|
var _tigercatcore = require('@expcat/tigercat-core');
|
|
@@ -61,10 +65,16 @@ var Modal = ({
|
|
|
61
65
|
okText,
|
|
62
66
|
cancelText,
|
|
63
67
|
locale,
|
|
68
|
+
labels,
|
|
64
69
|
style,
|
|
65
70
|
draggable: isDraggable = false,
|
|
66
71
|
...rest
|
|
67
72
|
}) => {
|
|
73
|
+
const config = _chunkTDODFBBOjs.useTigerConfig.call(void 0, );
|
|
74
|
+
const mergedLocale = _react.useMemo.call(void 0,
|
|
75
|
+
() => _tigercatcore.mergeTigerLocale.call(void 0, config.locale, locale),
|
|
76
|
+
[config.locale, locale]
|
|
77
|
+
);
|
|
68
78
|
const [hasBeenOpened, setHasBeenOpened] = _react2.default.useState(open);
|
|
69
79
|
const [dragOffset, setDragOffset] = _react2.default.useState({ x: 0, y: 0 });
|
|
70
80
|
_react.useEffect.call(void 0, () => {
|
|
@@ -126,20 +136,23 @@ var Modal = ({
|
|
|
126
136
|
const resolvedCloseAriaLabel = _tigercatcore.resolveLocaleText.call(void 0,
|
|
127
137
|
"Close",
|
|
128
138
|
closeAriaLabel,
|
|
129
|
-
_optionalChain([
|
|
130
|
-
_optionalChain([
|
|
139
|
+
_optionalChain([labels, 'optionalAccess', _6 => _6.closeAriaLabel]),
|
|
140
|
+
_optionalChain([mergedLocale, 'optionalAccess', _7 => _7.modal, 'optionalAccess', _8 => _8.closeAriaLabel]),
|
|
141
|
+
_optionalChain([mergedLocale, 'optionalAccess', _9 => _9.common, 'optionalAccess', _10 => _10.closeText])
|
|
131
142
|
);
|
|
132
143
|
const resolvedCancelText = _tigercatcore.resolveLocaleText.call(void 0,
|
|
133
144
|
"\u53D6\u6D88",
|
|
134
145
|
cancelText,
|
|
135
|
-
_optionalChain([
|
|
136
|
-
_optionalChain([
|
|
146
|
+
_optionalChain([labels, 'optionalAccess', _11 => _11.cancelText]),
|
|
147
|
+
_optionalChain([mergedLocale, 'optionalAccess', _12 => _12.modal, 'optionalAccess', _13 => _13.cancelText]),
|
|
148
|
+
_optionalChain([mergedLocale, 'optionalAccess', _14 => _14.common, 'optionalAccess', _15 => _15.cancelText])
|
|
137
149
|
);
|
|
138
150
|
const resolvedOkText = _tigercatcore.resolveLocaleText.call(void 0,
|
|
139
151
|
"\u786E\u5B9A",
|
|
140
152
|
okText,
|
|
141
|
-
_optionalChain([
|
|
142
|
-
_optionalChain([
|
|
153
|
+
_optionalChain([labels, 'optionalAccess', _16 => _16.okText]),
|
|
154
|
+
_optionalChain([mergedLocale, 'optionalAccess', _17 => _17.modal, 'optionalAccess', _18 => _18.okText]),
|
|
155
|
+
_optionalChain([mergedLocale, 'optionalAccess', _19 => _19.common, 'optionalAccess', _20 => _20.okText])
|
|
143
156
|
);
|
|
144
157
|
const reactId = _react.useId.call(void 0, );
|
|
145
158
|
const modalId = _react.useMemo.call(void 0, () => `tiger-modal-${reactId}`, [reactId]);
|
|
@@ -175,7 +188,7 @@ var Modal = ({
|
|
|
175
188
|
}, []);
|
|
176
189
|
const handleTouchStart = _react.useCallback.call(void 0,
|
|
177
190
|
(event) => {
|
|
178
|
-
_optionalChain([dialogDivProps, 'access',
|
|
191
|
+
_optionalChain([dialogDivProps, 'access', _21 => _21.onTouchStart, 'optionalCall', _22 => _22(event)]);
|
|
179
192
|
if (!open || !mobileSheet) return;
|
|
180
193
|
const point = _tigercatcore.getGestureTouchPoint.call(void 0, event.touches);
|
|
181
194
|
touchStartRef.current = point;
|
|
@@ -185,7 +198,7 @@ var Modal = ({
|
|
|
185
198
|
);
|
|
186
199
|
const handleTouchMove = _react.useCallback.call(void 0,
|
|
187
200
|
(event) => {
|
|
188
|
-
_optionalChain([dialogDivProps, 'access',
|
|
201
|
+
_optionalChain([dialogDivProps, 'access', _23 => _23.onTouchMove, 'optionalCall', _24 => _24(event)]);
|
|
189
202
|
if (!touchStartRef.current) return;
|
|
190
203
|
const point = _tigercatcore.getGestureTouchPoint.call(void 0, event.touches);
|
|
191
204
|
if (point) {
|
|
@@ -196,7 +209,7 @@ var Modal = ({
|
|
|
196
209
|
);
|
|
197
210
|
const handleTouchEnd = _react.useCallback.call(void 0,
|
|
198
211
|
(event) => {
|
|
199
|
-
_optionalChain([dialogDivProps, 'access',
|
|
212
|
+
_optionalChain([dialogDivProps, 'access', _25 => _25.onTouchEnd, 'optionalCall', _26 => _26(event)]);
|
|
200
213
|
const gesture = _tigercatcore.resolveSwipeGesture.call(void 0,
|
|
201
214
|
touchStartRef.current,
|
|
202
215
|
_nullishCoalesce(_tigercatcore.getGestureTouchPoint.call(void 0, event.changedTouches), () => ( touchCurrentRef.current)),
|
|
@@ -211,7 +224,7 @@ var Modal = ({
|
|
|
211
224
|
);
|
|
212
225
|
const handleTouchCancel = _react.useCallback.call(void 0,
|
|
213
226
|
(event) => {
|
|
214
|
-
_optionalChain([dialogDivProps, 'access',
|
|
227
|
+
_optionalChain([dialogDivProps, 'access', _27 => _27.onTouchCancel, 'optionalCall', _28 => _28(event)]);
|
|
215
228
|
resetTouchGesture();
|
|
216
229
|
},
|
|
217
230
|
[dialogDivProps, resetTouchGesture]
|