@expcat/tigercat-core 1.3.4 → 1.4.0
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/icons/registry.cjs +1 -3
- package/dist/icons/registry.js +1 -3
- package/dist/index.cjs +526 -190
- package/dist/index.d.cts +366 -268
- package/dist/index.d.ts +366 -268
- package/dist/index.js +508 -189
- package/dist/{locale-BuZwW3Ok.d.ts → locale-9tTj1QdZ.d.ts} +166 -1
- package/dist/{locale-DDFn0b6z.d.cts → locale-DxwhmqfF.d.cts} +166 -1
- package/dist/locales/ar-SA.cjs +61 -2
- package/dist/locales/ar-SA.d.cts +1 -1
- package/dist/locales/ar-SA.d.ts +1 -1
- package/dist/locales/ar-SA.js +61 -2
- package/dist/locales/de-DE.cjs +61 -2
- package/dist/locales/de-DE.d.cts +1 -1
- package/dist/locales/de-DE.d.ts +1 -1
- package/dist/locales/de-DE.js +61 -2
- package/dist/locales/en-US.cjs +61 -1
- package/dist/locales/en-US.d.cts +1 -1
- package/dist/locales/en-US.d.ts +1 -1
- package/dist/locales/en-US.js +59 -1
- package/dist/locales/es-ES.cjs +61 -2
- package/dist/locales/es-ES.d.cts +1 -1
- package/dist/locales/es-ES.d.ts +1 -1
- package/dist/locales/es-ES.js +61 -2
- package/dist/locales/fr-FR.cjs +61 -2
- package/dist/locales/fr-FR.d.cts +1 -1
- package/dist/locales/fr-FR.d.ts +1 -1
- package/dist/locales/fr-FR.js +61 -2
- package/dist/locales/id-ID.cjs +2 -1
- package/dist/locales/id-ID.d.cts +1 -1
- package/dist/locales/id-ID.d.ts +1 -1
- package/dist/locales/id-ID.js +2 -1
- package/dist/locales/ja-JP.cjs +2 -1
- package/dist/locales/ja-JP.d.cts +1 -1
- package/dist/locales/ja-JP.d.ts +1 -1
- package/dist/locales/ja-JP.js +2 -1
- package/dist/locales/ko-KR.cjs +2 -1
- package/dist/locales/ko-KR.d.cts +1 -1
- package/dist/locales/ko-KR.d.ts +1 -1
- package/dist/locales/ko-KR.js +2 -1
- package/dist/locales/pt-BR.cjs +61 -2
- package/dist/locales/pt-BR.d.cts +1 -1
- package/dist/locales/pt-BR.d.ts +1 -1
- package/dist/locales/pt-BR.js +61 -2
- package/dist/locales/th-TH.cjs +2 -1
- package/dist/locales/th-TH.d.cts +1 -1
- package/dist/locales/th-TH.d.ts +1 -1
- package/dist/locales/th-TH.js +2 -1
- package/dist/locales/vi-VN.cjs +2 -1
- package/dist/locales/vi-VN.d.cts +1 -1
- package/dist/locales/vi-VN.d.ts +1 -1
- package/dist/locales/vi-VN.js +2 -1
- package/dist/locales/zh-CN.cjs +61 -1
- package/dist/locales/zh-CN.d.cts +1 -1
- package/dist/locales/zh-CN.d.ts +1 -1
- package/dist/locales/zh-CN.js +59 -1
- package/dist/locales/zh-TW.cjs +2 -1
- package/dist/locales/zh-TW.d.cts +1 -1
- package/dist/locales/zh-TW.d.ts +1 -1
- package/dist/locales/zh-TW.js +2 -1
- package/dist/{table-export-DOqFkseW.d.cts → table-export-BMBH75rj.d.cts} +1 -1
- package/dist/{table-export-CZ7wtGf4.d.ts → table-export-GRimhvlM.d.ts} +1 -1
- package/dist/tailwind/modern.cjs +1 -1
- package/dist/tailwind/modern.js +1 -1
- package/dist/utils/table-export.cjs +7 -0
- package/dist/utils/table-export.d.cts +2 -2
- package/dist/utils/table-export.d.ts +2 -2
- package/dist/utils/table-export.js +7 -0
- package/package.json +2 -10
- package/tokens/tailwind-tokens.js +3 -6
- package/tokens/tokens.css +15 -30
package/dist/index.cjs
CHANGED
|
@@ -43,12 +43,15 @@ __export(src_exports, {
|
|
|
43
43
|
ClockIconPath: () => ClockIconPath,
|
|
44
44
|
CloseIconPath: () => CloseIconPath,
|
|
45
45
|
DEFAULT_CHART_COLORS: () => DEFAULT_CHART_COLORS,
|
|
46
|
+
DEFAULT_FORM_VALIDATION_LABELS: () => DEFAULT_FORM_VALIDATION_LABELS,
|
|
46
47
|
DEFAULT_FORM_WIZARD_LABELS: () => DEFAULT_FORM_WIZARD_LABELS,
|
|
47
48
|
DEFAULT_HEATMAP_CANVAS_THRESHOLD: () => DEFAULT_HEATMAP_CANVAS_THRESHOLD,
|
|
48
49
|
DEFAULT_PAGINATION_LABELS: () => DEFAULT_PAGINATION_LABELS,
|
|
49
50
|
DEFAULT_TABLE_LABELS: () => DEFAULT_TABLE_LABELS,
|
|
50
51
|
DEFAULT_TASK_BOARD_LABELS: () => DEFAULT_TASK_BOARD_LABELS,
|
|
52
|
+
DEFAULT_TIME_PICKER_LABELS: () => DEFAULT_TIME_PICKER_LABELS,
|
|
51
53
|
DEFAULT_UPLOAD_CHUNK_SIZE: () => DEFAULT_UPLOAD_CHUNK_SIZE,
|
|
54
|
+
DEFAULT_UPLOAD_LABELS: () => DEFAULT_UPLOAD_LABELS,
|
|
52
55
|
DONUT_BASE_SHADOW: () => DONUT_BASE_SHADOW,
|
|
53
56
|
DONUT_EMPHASIS_SHADOW: () => DONUT_EMPHASIS_SHADOW,
|
|
54
57
|
DROPDOWN_CHEVRON_PATH: () => DROPDOWN_CHEVRON_PATH,
|
|
@@ -106,10 +109,13 @@ __export(src_exports, {
|
|
|
106
109
|
VIEW_TRANSITION_CSS: () => VIEW_TRANSITION_CSS,
|
|
107
110
|
WEEKDAYS: () => WEEKDAYS,
|
|
108
111
|
ZH_CN_DATEPICKER_LOCALE: () => ZH_CN_DATEPICKER_LOCALE,
|
|
112
|
+
ZH_CN_FORM_VALIDATION_LABELS: () => ZH_CN_FORM_VALIDATION_LABELS,
|
|
109
113
|
ZH_CN_FORM_WIZARD_LABELS: () => ZH_CN_FORM_WIZARD_LABELS,
|
|
110
114
|
ZH_CN_PAGINATION_LABELS: () => ZH_CN_PAGINATION_LABELS,
|
|
111
115
|
ZH_CN_TABLE_LABELS: () => ZH_CN_TABLE_LABELS,
|
|
112
116
|
ZH_CN_TASK_BOARD_LABELS: () => ZH_CN_TASK_BOARD_LABELS,
|
|
117
|
+
ZH_CN_TIME_PICKER_LABELS: () => ZH_CN_TIME_PICKER_LABELS,
|
|
118
|
+
ZH_CN_UPLOAD_LABELS: () => ZH_CN_UPLOAD_LABELS,
|
|
113
119
|
activeOpacityClasses: () => activeOpacityClasses,
|
|
114
120
|
activePressClasses: () => activePressClasses,
|
|
115
121
|
activityItemActionsClasses: () => activityItemActionsClasses,
|
|
@@ -119,6 +125,9 @@ __export(src_exports, {
|
|
|
119
125
|
activityItemHeaderClasses: () => activityItemHeaderClasses,
|
|
120
126
|
activityItemLayoutClasses: () => activityItemLayoutClasses,
|
|
121
127
|
activityItemTitleGroupClasses: () => activityItemTitleGroupClasses,
|
|
128
|
+
addDays: () => addDays,
|
|
129
|
+
addMonths: () => addMonths,
|
|
130
|
+
addYears: () => addYears,
|
|
122
131
|
affixWrapperClasses: () => affixWrapperClasses,
|
|
123
132
|
alertBannerClasses: () => alertBannerClasses,
|
|
124
133
|
alertBaseClasses: () => alertBaseClasses,
|
|
@@ -398,6 +407,7 @@ __export(src_exports, {
|
|
|
398
407
|
createImageAnnotationBox: () => createImageAnnotationBox,
|
|
399
408
|
createImageAnnotationPath: () => createImageAnnotationPath,
|
|
400
409
|
createInfiniteScrollObserver: () => createInfiniteScrollObserver,
|
|
410
|
+
createInstanceCounter: () => createInstanceCounter,
|
|
401
411
|
createLinePath: () => createLinePath,
|
|
402
412
|
createLinearScale: () => createLinearScale,
|
|
403
413
|
createLongPressController: () => createLongPressController,
|
|
@@ -593,6 +603,7 @@ __export(src_exports, {
|
|
|
593
603
|
focusMenuEdge: () => focusMenuEdge,
|
|
594
604
|
focusRingClasses: () => focusRingClasses,
|
|
595
605
|
focusRingInsetClasses: () => focusRingInsetClasses,
|
|
606
|
+
focusTimePickerOption: () => focusTimePickerOption,
|
|
596
607
|
formatActivityTime: () => formatActivityTime,
|
|
597
608
|
formatBadgeContent: () => formatBadgeContent,
|
|
598
609
|
formatChatTime: () => formatChatTime,
|
|
@@ -604,6 +615,7 @@ __export(src_exports, {
|
|
|
604
615
|
formatFileSize: () => formatFileSize,
|
|
605
616
|
formatFileSizeLabel: () => formatFileSizeLabel,
|
|
606
617
|
formatGanttDate: () => formatGanttDate,
|
|
618
|
+
formatInputNumberDisplay: () => formatInputNumberDisplay,
|
|
607
619
|
formatIntlNumber: () => formatIntlNumber,
|
|
608
620
|
formatMonthYear: () => formatMonthYear,
|
|
609
621
|
formatPageAriaLabel: () => formatPageAriaLabel,
|
|
@@ -739,6 +751,7 @@ __export(src_exports, {
|
|
|
739
751
|
getCropperResult: () => getCropperResult,
|
|
740
752
|
getCurrentActiveTourStep: () => getCurrentActiveTourStep,
|
|
741
753
|
getCurrentTime: () => getCurrentTime,
|
|
754
|
+
getCyclicIndex: () => getCyclicIndex,
|
|
742
755
|
getDatePickerDayCellClasses: () => getDatePickerDayCellClasses,
|
|
743
756
|
getDatePickerIconButtonClasses: () => getDatePickerIconButtonClasses,
|
|
744
757
|
getDatePickerInputClasses: () => getDatePickerInputClasses,
|
|
@@ -790,6 +803,7 @@ __export(src_exports, {
|
|
|
790
803
|
getFileListItemClasses: () => getFileListItemClasses,
|
|
791
804
|
getFileManagerContainerClasses: () => getFileManagerContainerClasses,
|
|
792
805
|
getFirstDayOfMonth: () => getFirstDayOfMonth,
|
|
806
|
+
getFirstVisibleChildKey: () => getFirstVisibleChildKey,
|
|
793
807
|
getFixedColumnOffsets: () => getFixedColumnOffsets,
|
|
794
808
|
getFixedColumnPosition: () => getFixedColumnPosition,
|
|
795
809
|
getFixedColumnStyle: () => getFixedColumnStyle,
|
|
@@ -805,6 +819,7 @@ __export(src_exports, {
|
|
|
805
819
|
getFormItemErrorClasses: () => getFormItemErrorClasses,
|
|
806
820
|
getFormItemFieldClasses: () => getFormItemFieldClasses,
|
|
807
821
|
getFormItemLabelClasses: () => getFormItemLabelClasses,
|
|
822
|
+
getFormValidationLabels: () => getFormValidationLabels,
|
|
808
823
|
getFormWizardLabels: () => getFormWizardLabels,
|
|
809
824
|
getFunnelGradientPrefix: () => getFunnelGradientPrefix,
|
|
810
825
|
getGanttDependencyPath: () => getGanttDependencyPath,
|
|
@@ -884,6 +899,7 @@ __export(src_exports, {
|
|
|
884
899
|
getMenuItemClasses: () => getMenuItemClasses,
|
|
885
900
|
getMenuItemIndent: () => getMenuItemIndent,
|
|
886
901
|
getMenuItems: () => getMenuItems,
|
|
902
|
+
getMenuNavigationKeys: () => getMenuNavigationKeys,
|
|
887
903
|
getMessageIconPath: () => getMessageIconPath,
|
|
888
904
|
getMessageTypeClasses: () => getMessageTypeClasses,
|
|
889
905
|
getModalContainerClasses: () => getModalContainerClasses,
|
|
@@ -1106,6 +1122,7 @@ __export(src_exports, {
|
|
|
1106
1122
|
getTransferItemClasses: () => getTransferItemClasses,
|
|
1107
1123
|
getTransformOrigin: () => getTransformOrigin,
|
|
1108
1124
|
getTransitionClasses: () => getTransitionClasses,
|
|
1125
|
+
getTreeKeyboardAction: () => getTreeKeyboardAction,
|
|
1109
1126
|
getTreeMapGradientPrefix: () => getTreeMapGradientPrefix,
|
|
1110
1127
|
getTreeNodeClasses: () => getTreeNodeClasses,
|
|
1111
1128
|
getTreeNodeExpandIconClasses: () => getTreeNodeExpandIconClasses,
|
|
@@ -1280,7 +1297,6 @@ __export(src_exports, {
|
|
|
1280
1297
|
isValidHex: () => isValidHex,
|
|
1281
1298
|
isValidUrl: () => isValidUrl,
|
|
1282
1299
|
isWipExceeded: () => isWipExceeded,
|
|
1283
|
-
kanbanAddCardClasses: () => kanbanAddCardClasses,
|
|
1284
1300
|
kanbanAddColumnClasses: () => kanbanAddColumnClasses,
|
|
1285
1301
|
kanbanCardCountClasses: () => kanbanCardCountClasses,
|
|
1286
1302
|
kanbanFilterHighlightClasses: () => kanbanFilterHighlightClasses,
|
|
@@ -1453,6 +1469,7 @@ __export(src_exports, {
|
|
|
1453
1469
|
parseDragData: () => parseDragData,
|
|
1454
1470
|
parseHeight: () => parseHeight,
|
|
1455
1471
|
parseHotkey: () => parseHotkey,
|
|
1472
|
+
parseInputNumberValue: () => parseInputNumberValue,
|
|
1456
1473
|
parseInputValue: () => parseInputValue,
|
|
1457
1474
|
parseMarkdownHeight: () => parseHeight,
|
|
1458
1475
|
parsePaneSize: () => parsePaneSize,
|
|
@@ -2492,6 +2509,10 @@ function normalizeStringOption(options, key) {
|
|
|
2492
2509
|
}
|
|
2493
2510
|
return options;
|
|
2494
2511
|
}
|
|
2512
|
+
function createInstanceCounter() {
|
|
2513
|
+
let counter = 0;
|
|
2514
|
+
return () => ++counter;
|
|
2515
|
+
}
|
|
2495
2516
|
|
|
2496
2517
|
// src/utils/icons/common.ts
|
|
2497
2518
|
var closeIconViewBox = "0 0 24 24";
|
|
@@ -2566,9 +2587,7 @@ var iconRegistry = {
|
|
|
2566
2587
|
"arrow-right": stroke24("M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"),
|
|
2567
2588
|
"arrow-up": stroke24("M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"),
|
|
2568
2589
|
"arrow-down": stroke24("M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"),
|
|
2569
|
-
search: stroke24(
|
|
2570
|
-
"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
|
|
2571
|
-
),
|
|
2590
|
+
search: stroke24("m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"),
|
|
2572
2591
|
plus: stroke24("M12 4.5v15m7.5-7.5h-15"),
|
|
2573
2592
|
minus: stroke24("M5 12h14"),
|
|
2574
2593
|
edit: stroke24(
|
|
@@ -2745,6 +2764,14 @@ function getFocusableElements(container) {
|
|
|
2745
2764
|
);
|
|
2746
2765
|
}
|
|
2747
2766
|
function createFocusTrap(container, options = {}) {
|
|
2767
|
+
if (!isBrowser()) {
|
|
2768
|
+
return {
|
|
2769
|
+
activate() {
|
|
2770
|
+
},
|
|
2771
|
+
deactivate() {
|
|
2772
|
+
}
|
|
2773
|
+
};
|
|
2774
|
+
}
|
|
2748
2775
|
const {
|
|
2749
2776
|
initialFocus = null,
|
|
2750
2777
|
returnFocusOnDeactivate = true,
|
|
@@ -2827,6 +2854,7 @@ function getOrCreateLiveRegion(level) {
|
|
|
2827
2854
|
return el;
|
|
2828
2855
|
}
|
|
2829
2856
|
function announceToScreenReader(message, level = "polite") {
|
|
2857
|
+
if (!isBrowser()) return;
|
|
2830
2858
|
const region = getOrCreateLiveRegion(level);
|
|
2831
2859
|
region.textContent = "";
|
|
2832
2860
|
requestAnimationFrame(() => {
|
|
@@ -2834,6 +2862,16 @@ function announceToScreenReader(message, level = "polite") {
|
|
|
2834
2862
|
});
|
|
2835
2863
|
}
|
|
2836
2864
|
function manageLiveRegion(level = "polite") {
|
|
2865
|
+
if (!isBrowser()) {
|
|
2866
|
+
return {
|
|
2867
|
+
announce() {
|
|
2868
|
+
},
|
|
2869
|
+
clear() {
|
|
2870
|
+
},
|
|
2871
|
+
destroy() {
|
|
2872
|
+
}
|
|
2873
|
+
};
|
|
2874
|
+
}
|
|
2837
2875
|
const region = getOrCreateLiveRegion(level);
|
|
2838
2876
|
return {
|
|
2839
2877
|
announce(message) {
|
|
@@ -2860,8 +2898,8 @@ function getActiveElement(doc) {
|
|
|
2860
2898
|
const active = doc?.activeElement;
|
|
2861
2899
|
return isHTMLElement(active) ? active : null;
|
|
2862
2900
|
}
|
|
2863
|
-
function captureActiveElement(doc
|
|
2864
|
-
return getActiveElement(doc);
|
|
2901
|
+
function captureActiveElement(doc) {
|
|
2902
|
+
return getActiveElement(doc ?? (isBrowser() ? document : void 0));
|
|
2865
2903
|
}
|
|
2866
2904
|
function focusElement(element, options) {
|
|
2867
2905
|
if (!element) return false;
|
|
@@ -2892,7 +2930,8 @@ function getMenuItems(container) {
|
|
|
2892
2930
|
function handleMenuNavigation(container, event) {
|
|
2893
2931
|
const items = getMenuItems(container);
|
|
2894
2932
|
if (items.length === 0) return false;
|
|
2895
|
-
const
|
|
2933
|
+
const activeElement = container.ownerDocument?.activeElement ?? (isBrowser() ? document.activeElement : null);
|
|
2934
|
+
const currentIndex = items.indexOf(activeElement);
|
|
2896
2935
|
let nextIndex = -1;
|
|
2897
2936
|
switch (event.key) {
|
|
2898
2937
|
case "ArrowDown":
|
|
@@ -3042,8 +3081,10 @@ var TIGER_LOCALE_KEYS = [
|
|
|
3042
3081
|
"pagination",
|
|
3043
3082
|
"table",
|
|
3044
3083
|
"datePicker",
|
|
3084
|
+
"timePicker",
|
|
3045
3085
|
"formWizard",
|
|
3046
|
-
"taskBoard"
|
|
3086
|
+
"taskBoard",
|
|
3087
|
+
"formValidation"
|
|
3047
3088
|
];
|
|
3048
3089
|
function isRecord3(value) {
|
|
3049
3090
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -3089,8 +3130,10 @@ function mergeTigerLocale(base, override) {
|
|
|
3089
3130
|
pagination: { ...base?.pagination, ...override?.pagination },
|
|
3090
3131
|
table: { ...base?.table, ...override?.table },
|
|
3091
3132
|
datePicker: { ...base?.datePicker, ...override?.datePicker },
|
|
3133
|
+
timePicker: { ...base?.timePicker, ...override?.timePicker },
|
|
3092
3134
|
formWizard: { ...base?.formWizard, ...override?.formWizard },
|
|
3093
|
-
taskBoard: { ...base?.taskBoard, ...override?.taskBoard }
|
|
3135
|
+
taskBoard: { ...base?.taskBoard, ...override?.taskBoard },
|
|
3136
|
+
formValidation: { ...base?.formValidation, ...override?.formValidation }
|
|
3094
3137
|
};
|
|
3095
3138
|
}
|
|
3096
3139
|
var RTL_LANGUAGE_CODES = /* @__PURE__ */ new Set(["ar", "fa", "he", "iw", "ps", "ur"]);
|
|
@@ -3276,6 +3319,118 @@ function getTaskBoardLabels(locale, overrides) {
|
|
|
3276
3319
|
boardAriaLabel: overrides?.boardAriaLabel ?? locale?.taskBoard?.boardAriaLabel ?? defaultLabels.boardAriaLabel
|
|
3277
3320
|
};
|
|
3278
3321
|
}
|
|
3322
|
+
var DEFAULT_FORM_VALIDATION_LABELS = {
|
|
3323
|
+
required: "This field is required",
|
|
3324
|
+
typeString: "Value must be a string",
|
|
3325
|
+
typeNumber: "Value must be a number",
|
|
3326
|
+
typeBoolean: "Value must be a boolean",
|
|
3327
|
+
typeArray: "Value must be an array",
|
|
3328
|
+
typeObject: "Value must be an object",
|
|
3329
|
+
email: "Please enter a valid email address",
|
|
3330
|
+
phone: "Please enter a valid phone number",
|
|
3331
|
+
url: "Please enter a valid URL",
|
|
3332
|
+
date: "Please enter a valid date",
|
|
3333
|
+
idCard: "Please enter a valid ID card number",
|
|
3334
|
+
minLength: "Minimum length is {min} characters",
|
|
3335
|
+
maxLength: "Maximum length is {max} characters",
|
|
3336
|
+
minValue: "Minimum value is {min}",
|
|
3337
|
+
maxValue: "Maximum value is {max}",
|
|
3338
|
+
minItems: "Minimum {min} items required",
|
|
3339
|
+
maxItems: "Maximum {max} items allowed",
|
|
3340
|
+
patternMismatch: "Value does not match the required pattern",
|
|
3341
|
+
validatorFailed: "Validation failed",
|
|
3342
|
+
validatorError: "Validation error occurred"
|
|
3343
|
+
};
|
|
3344
|
+
var ZH_CN_FORM_VALIDATION_LABELS = {
|
|
3345
|
+
required: "\u6B64\u5B57\u6BB5\u4E3A\u5FC5\u586B\u9879",
|
|
3346
|
+
typeString: "\u503C\u5FC5\u987B\u662F\u5B57\u7B26\u4E32",
|
|
3347
|
+
typeNumber: "\u503C\u5FC5\u987B\u662F\u6570\u5B57",
|
|
3348
|
+
typeBoolean: "\u503C\u5FC5\u987B\u662F\u5E03\u5C14\u503C",
|
|
3349
|
+
typeArray: "\u503C\u5FC5\u987B\u662F\u6570\u7EC4",
|
|
3350
|
+
typeObject: "\u503C\u5FC5\u987B\u662F\u5BF9\u8C61",
|
|
3351
|
+
email: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u90AE\u7BB1\u5730\u5740",
|
|
3352
|
+
phone: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u7535\u8BDD\u53F7\u7801",
|
|
3353
|
+
url: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u7F51\u5740",
|
|
3354
|
+
date: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u65E5\u671F",
|
|
3355
|
+
idCard: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u8EAB\u4EFD\u8BC1\u53F7\u7801",
|
|
3356
|
+
minLength: "\u957F\u5EA6\u4E0D\u80FD\u5C11\u4E8E {min} \u4E2A\u5B57\u7B26",
|
|
3357
|
+
maxLength: "\u957F\u5EA6\u4E0D\u80FD\u8D85\u8FC7 {max} \u4E2A\u5B57\u7B26",
|
|
3358
|
+
minValue: "\u6570\u503C\u4E0D\u80FD\u5C0F\u4E8E {min}",
|
|
3359
|
+
maxValue: "\u6570\u503C\u4E0D\u80FD\u5927\u4E8E {max}",
|
|
3360
|
+
minItems: "\u81F3\u5C11\u9700\u8981 {min} \u9879",
|
|
3361
|
+
maxItems: "\u6700\u591A\u5141\u8BB8 {max} \u9879",
|
|
3362
|
+
patternMismatch: "\u683C\u5F0F\u4E0D\u6B63\u786E",
|
|
3363
|
+
validatorFailed: "\u6821\u9A8C\u672A\u901A\u8FC7",
|
|
3364
|
+
validatorError: "\u6821\u9A8C\u65F6\u53D1\u751F\u9519\u8BEF"
|
|
3365
|
+
};
|
|
3366
|
+
function getFormValidationLabels(locale, overrides) {
|
|
3367
|
+
const isZh = !!locale?.locale?.startsWith("zh");
|
|
3368
|
+
const defaultLabels = isZh ? ZH_CN_FORM_VALIDATION_LABELS : DEFAULT_FORM_VALIDATION_LABELS;
|
|
3369
|
+
const fv = locale?.formValidation;
|
|
3370
|
+
const resolved = {};
|
|
3371
|
+
for (const key of Object.keys(defaultLabels)) {
|
|
3372
|
+
resolved[key] = overrides?.[key] ?? fv?.[key] ?? defaultLabels[key];
|
|
3373
|
+
}
|
|
3374
|
+
return resolved;
|
|
3375
|
+
}
|
|
3376
|
+
var DEFAULT_TIME_PICKER_LABELS = {
|
|
3377
|
+
hour: "Hour",
|
|
3378
|
+
minute: "Min",
|
|
3379
|
+
second: "Sec",
|
|
3380
|
+
now: "Now",
|
|
3381
|
+
ok: "OK",
|
|
3382
|
+
start: "Start",
|
|
3383
|
+
end: "End",
|
|
3384
|
+
clear: "Clear time",
|
|
3385
|
+
toggle: "Toggle time picker",
|
|
3386
|
+
dialog: "Time picker",
|
|
3387
|
+
selectTime: "Select time",
|
|
3388
|
+
selectTimeRange: "Select time range"
|
|
3389
|
+
};
|
|
3390
|
+
var ZH_CN_TIME_PICKER_LABELS = {
|
|
3391
|
+
hour: "\u65F6",
|
|
3392
|
+
minute: "\u5206",
|
|
3393
|
+
second: "\u79D2",
|
|
3394
|
+
now: "\u73B0\u5728",
|
|
3395
|
+
ok: "\u786E\u5B9A",
|
|
3396
|
+
start: "\u5F00\u59CB",
|
|
3397
|
+
end: "\u7ED3\u675F",
|
|
3398
|
+
clear: "\u6E05\u9664\u65F6\u95F4",
|
|
3399
|
+
toggle: "\u6253\u5F00\u65F6\u95F4\u9009\u62E9\u5668",
|
|
3400
|
+
dialog: "\u65F6\u95F4\u9009\u62E9\u5668",
|
|
3401
|
+
selectTime: "\u8BF7\u9009\u62E9\u65F6\u95F4",
|
|
3402
|
+
selectTimeRange: "\u8BF7\u9009\u62E9\u65F6\u95F4\u8303\u56F4"
|
|
3403
|
+
};
|
|
3404
|
+
var DEFAULT_UPLOAD_LABELS = {
|
|
3405
|
+
dragAreaAriaLabel: "Upload file by clicking or dragging",
|
|
3406
|
+
buttonAriaLabel: "Upload file",
|
|
3407
|
+
clickToUploadText: "Click to upload",
|
|
3408
|
+
dragAndDropText: "or drag and drop",
|
|
3409
|
+
acceptInfoText: "Accepted: {accept}",
|
|
3410
|
+
maxSizeInfoText: "Max size: {maxSize}",
|
|
3411
|
+
selectFileText: "Select File",
|
|
3412
|
+
uploadedFilesAriaLabel: "Uploaded files",
|
|
3413
|
+
successAriaLabel: "Success",
|
|
3414
|
+
errorAriaLabel: "Error",
|
|
3415
|
+
uploadingAriaLabel: "Uploading",
|
|
3416
|
+
removeFileAriaLabel: "Remove {fileName}",
|
|
3417
|
+
previewFileAriaLabel: "Preview {fileName}"
|
|
3418
|
+
};
|
|
3419
|
+
var ZH_CN_UPLOAD_LABELS = {
|
|
3420
|
+
dragAreaAriaLabel: "\u70B9\u51FB\u6216\u62D6\u62FD\u4E0A\u4F20\u6587\u4EF6",
|
|
3421
|
+
buttonAriaLabel: "\u4E0A\u4F20\u6587\u4EF6",
|
|
3422
|
+
clickToUploadText: "\u70B9\u51FB\u4E0A\u4F20",
|
|
3423
|
+
dragAndDropText: "\u6216\u62D6\u62FD\u5230\u6B64\u5904",
|
|
3424
|
+
acceptInfoText: "\u652F\u6301\uFF1A{accept}",
|
|
3425
|
+
maxSizeInfoText: "\u6700\u5927\u5927\u5C0F\uFF1A{maxSize}",
|
|
3426
|
+
selectFileText: "\u9009\u62E9\u6587\u4EF6",
|
|
3427
|
+
uploadedFilesAriaLabel: "\u5DF2\u4E0A\u4F20\u6587\u4EF6",
|
|
3428
|
+
successAriaLabel: "\u6210\u529F",
|
|
3429
|
+
errorAriaLabel: "\u9519\u8BEF",
|
|
3430
|
+
uploadingAriaLabel: "\u4E0A\u4F20\u4E2D",
|
|
3431
|
+
removeFileAriaLabel: "\u79FB\u9664 {fileName}",
|
|
3432
|
+
previewFileAriaLabel: "\u9884\u89C8 {fileName}"
|
|
3433
|
+
};
|
|
3279
3434
|
|
|
3280
3435
|
// src/utils/datepicker-i18n.ts
|
|
3281
3436
|
var EN_US_DATEPICKER_LOCALE = {
|
|
@@ -3376,35 +3531,104 @@ function getDatePickerLabels(locale, overrides) {
|
|
|
3376
3531
|
};
|
|
3377
3532
|
}
|
|
3378
3533
|
|
|
3534
|
+
// src/utils/picker-utils.ts
|
|
3535
|
+
var defaultIsDisabled = (item) => !!item?.disabled;
|
|
3536
|
+
function findFirstEnabledIndex(items, isDisabled = defaultIsDisabled) {
|
|
3537
|
+
for (let i = 0; i < items.length; i++) {
|
|
3538
|
+
if (!isDisabled(items[i])) return i;
|
|
3539
|
+
}
|
|
3540
|
+
return -1;
|
|
3541
|
+
}
|
|
3542
|
+
function findLastEnabledIndex(items, isDisabled = defaultIsDisabled) {
|
|
3543
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
3544
|
+
if (!isDisabled(items[i])) return i;
|
|
3545
|
+
}
|
|
3546
|
+
return -1;
|
|
3547
|
+
}
|
|
3548
|
+
function findNextEnabledIndex(items, current, direction, isDisabled = defaultIsDisabled) {
|
|
3549
|
+
if (items.length === 0) return -1;
|
|
3550
|
+
const start = current < 0 ? direction === 1 ? 0 : items.length - 1 : current + direction;
|
|
3551
|
+
for (let i = start; i >= 0 && i < items.length; i += direction) {
|
|
3552
|
+
if (!isDisabled(items[i])) return i;
|
|
3553
|
+
}
|
|
3554
|
+
return current;
|
|
3555
|
+
}
|
|
3556
|
+
function getCyclicIndex(length, current, direction) {
|
|
3557
|
+
if (length <= 0) return -1;
|
|
3558
|
+
return (current + direction + length) % length;
|
|
3559
|
+
}
|
|
3560
|
+
function getInitialPickerActiveIndex(items, activeFirst, isDisabled = defaultIsDisabled) {
|
|
3561
|
+
return activeFirst ? findFirstEnabledIndex(items, isDisabled) : -1;
|
|
3562
|
+
}
|
|
3563
|
+
function getPickerNavigationIndex(items, current, key, isDisabled = defaultIsDisabled) {
|
|
3564
|
+
switch (key) {
|
|
3565
|
+
case "ArrowDown":
|
|
3566
|
+
return findNextEnabledIndex(items, current, 1, isDisabled);
|
|
3567
|
+
case "ArrowUp":
|
|
3568
|
+
return findNextEnabledIndex(items, current, -1, isDisabled);
|
|
3569
|
+
case "Home":
|
|
3570
|
+
return findFirstEnabledIndex(items, isDisabled);
|
|
3571
|
+
case "End":
|
|
3572
|
+
return findLastEnabledIndex(items, isDisabled);
|
|
3573
|
+
default:
|
|
3574
|
+
return current;
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3577
|
+
function getPickerOptionId(listboxId, index) {
|
|
3578
|
+
return `${listboxId}-option-${index}`;
|
|
3579
|
+
}
|
|
3580
|
+
function getDisclosureStateAttr(open) {
|
|
3581
|
+
return { "data-state": open ? "open" : "closed" };
|
|
3582
|
+
}
|
|
3583
|
+
function getPickerComboboxAria({
|
|
3584
|
+
expanded,
|
|
3585
|
+
listboxId,
|
|
3586
|
+
activeIndex = -1,
|
|
3587
|
+
activeOptionId
|
|
3588
|
+
}) {
|
|
3589
|
+
return {
|
|
3590
|
+
role: "combobox",
|
|
3591
|
+
"aria-expanded": expanded,
|
|
3592
|
+
"aria-haspopup": "listbox",
|
|
3593
|
+
"aria-controls": expanded ? listboxId : void 0,
|
|
3594
|
+
"aria-activedescendant": expanded ? activeOptionId ?? (activeIndex >= 0 ? getPickerOptionId(listboxId, activeIndex) : void 0) : void 0,
|
|
3595
|
+
"data-state": expanded ? "open" : "closed"
|
|
3596
|
+
};
|
|
3597
|
+
}
|
|
3598
|
+
function getPickerListboxAria({ id, label } = {}) {
|
|
3599
|
+
return {
|
|
3600
|
+
id,
|
|
3601
|
+
role: "listbox",
|
|
3602
|
+
"aria-label": label
|
|
3603
|
+
};
|
|
3604
|
+
}
|
|
3605
|
+
function getPickerOptionAria({
|
|
3606
|
+
selected = false,
|
|
3607
|
+
disabled = false
|
|
3608
|
+
}) {
|
|
3609
|
+
return {
|
|
3610
|
+
role: "option",
|
|
3611
|
+
"aria-selected": selected,
|
|
3612
|
+
"aria-disabled": disabled || void 0
|
|
3613
|
+
};
|
|
3614
|
+
}
|
|
3615
|
+
function getPickerTriggerKeyAction(key, expanded) {
|
|
3616
|
+
switch (key) {
|
|
3617
|
+
case "Enter":
|
|
3618
|
+
case " ":
|
|
3619
|
+
return "toggle";
|
|
3620
|
+
case "ArrowDown":
|
|
3621
|
+
return expanded ? "none" : "open";
|
|
3622
|
+
case "Escape":
|
|
3623
|
+
return expanded ? "close" : "none";
|
|
3624
|
+
default:
|
|
3625
|
+
return "none";
|
|
3626
|
+
}
|
|
3627
|
+
}
|
|
3628
|
+
|
|
3379
3629
|
// src/utils/timepicker-utils.ts
|
|
3380
|
-
var
|
|
3381
|
-
|
|
3382
|
-
minute: "\u5206",
|
|
3383
|
-
second: "\u79D2",
|
|
3384
|
-
now: "\u73B0\u5728",
|
|
3385
|
-
ok: "\u786E\u5B9A",
|
|
3386
|
-
start: "\u5F00\u59CB",
|
|
3387
|
-
end: "\u7ED3\u675F",
|
|
3388
|
-
clear: "\u6E05\u9664\u65F6\u95F4",
|
|
3389
|
-
toggle: "\u6253\u5F00\u65F6\u95F4\u9009\u62E9\u5668",
|
|
3390
|
-
dialog: "\u65F6\u95F4\u9009\u62E9\u5668",
|
|
3391
|
-
selectTime: "\u8BF7\u9009\u62E9\u65F6\u95F4",
|
|
3392
|
-
selectTimeRange: "\u8BF7\u9009\u62E9\u65F6\u95F4\u8303\u56F4"
|
|
3393
|
-
};
|
|
3394
|
-
var EN_LABELS = {
|
|
3395
|
-
hour: "Hour",
|
|
3396
|
-
minute: "Min",
|
|
3397
|
-
second: "Sec",
|
|
3398
|
-
now: "Now",
|
|
3399
|
-
ok: "OK",
|
|
3400
|
-
start: "Start",
|
|
3401
|
-
end: "End",
|
|
3402
|
-
clear: "Clear time",
|
|
3403
|
-
toggle: "Toggle time picker",
|
|
3404
|
-
dialog: "Time picker",
|
|
3405
|
-
selectTime: "Select time",
|
|
3406
|
-
selectTimeRange: "Select time range"
|
|
3407
|
-
};
|
|
3630
|
+
var EN_LABELS = DEFAULT_TIME_PICKER_LABELS;
|
|
3631
|
+
var ZH_LABELS = ZH_CN_TIME_PICKER_LABELS;
|
|
3408
3632
|
var TIME_PICKER_LABELS_BY_LANGUAGE = {
|
|
3409
3633
|
en: EN_LABELS,
|
|
3410
3634
|
zh: ZH_LABELS,
|
|
@@ -3479,26 +3703,59 @@ var TIME_PICKER_LABELS_BY_LANGUAGE = {
|
|
|
3479
3703
|
selectTimeRange: "\u0627\u062E\u062A\u0631 \u0646\u0637\u0627\u0642 \u0627\u0644\u0648\u0642\u062A"
|
|
3480
3704
|
}
|
|
3481
3705
|
};
|
|
3706
|
+
function getTimePickerLocaleCode(locale) {
|
|
3707
|
+
return typeof locale === "string" ? locale : locale?.locale;
|
|
3708
|
+
}
|
|
3482
3709
|
function isZhLocale(locale) {
|
|
3483
|
-
return (locale ?? "").toLowerCase().startsWith("zh");
|
|
3710
|
+
return (getTimePickerLocaleCode(locale) ?? "").toLowerCase().startsWith("zh");
|
|
3484
3711
|
}
|
|
3485
3712
|
function getTimePickerLabels(locale, overrides) {
|
|
3486
|
-
const
|
|
3713
|
+
const localeCode = getTimePickerLocaleCode(locale);
|
|
3714
|
+
const language = (localeCode ?? "").split("-")[0]?.toLowerCase();
|
|
3487
3715
|
const base = language ? TIME_PICKER_LABELS_BY_LANGUAGE[language] ?? EN_LABELS : EN_LABELS;
|
|
3488
|
-
|
|
3716
|
+
const localeLabels = typeof locale === "string" ? void 0 : locale?.timePicker;
|
|
3717
|
+
return { ...base, ...localeLabels ?? {}, ...overrides ?? {} };
|
|
3489
3718
|
}
|
|
3490
3719
|
function pluralizeEn(value, singular) {
|
|
3491
3720
|
return getIntlPluralCategory(value, "en") === "one" ? singular : `${singular}s`;
|
|
3492
3721
|
}
|
|
3493
3722
|
function getTimePickerOptionAriaLabel(value, unit, locale, labelOverrides) {
|
|
3494
3723
|
const labels = getTimePickerLabels(locale, labelOverrides);
|
|
3724
|
+
const localeCode = getTimePickerLocaleCode(locale);
|
|
3495
3725
|
const unitLabel = unit === "hour" ? labels.hour : unit === "minute" ? labels.minute : labels.second;
|
|
3496
|
-
if (isZhLocale(locale)) return `${formatIntlNumber(value,
|
|
3497
|
-
const lc = (
|
|
3726
|
+
if (isZhLocale(locale)) return `${formatIntlNumber(value, localeCode)}${unitLabel}`;
|
|
3727
|
+
const lc = (localeCode ?? "").toLowerCase();
|
|
3498
3728
|
if (lc.startsWith("en") || !lc && !labelOverrides) {
|
|
3499
|
-
return `${formatIntlNumber(value,
|
|
3729
|
+
return `${formatIntlNumber(value, localeCode)} ${pluralizeEn(value, unit)}`;
|
|
3730
|
+
}
|
|
3731
|
+
return `${formatIntlNumber(value, localeCode)} ${unitLabel}`;
|
|
3732
|
+
}
|
|
3733
|
+
function focusTimePickerOption(panel, unit, action) {
|
|
3734
|
+
if (!panel) return;
|
|
3735
|
+
const nodes = Array.from(
|
|
3736
|
+
panel.querySelectorAll(`button[data-tiger-timepicker-unit="${unit}"]`)
|
|
3737
|
+
).filter((button) => !button.disabled);
|
|
3738
|
+
if (nodes.length === 0) return;
|
|
3739
|
+
const active = panel.ownerDocument.activeElement;
|
|
3740
|
+
const activeIndex = active ? nodes.indexOf(active) : -1;
|
|
3741
|
+
const selectedIndex = nodes.findIndex((button) => button.getAttribute("aria-selected") === "true");
|
|
3742
|
+
const baseIndex = activeIndex >= 0 ? activeIndex : Math.max(0, selectedIndex);
|
|
3743
|
+
let nextIndex = baseIndex;
|
|
3744
|
+
switch (action) {
|
|
3745
|
+
case "prev":
|
|
3746
|
+
nextIndex = findNextEnabledIndex(nodes, baseIndex, -1);
|
|
3747
|
+
break;
|
|
3748
|
+
case "next":
|
|
3749
|
+
nextIndex = findNextEnabledIndex(nodes, baseIndex, 1);
|
|
3750
|
+
break;
|
|
3751
|
+
case "first":
|
|
3752
|
+
nextIndex = findFirstEnabledIndex(nodes);
|
|
3753
|
+
break;
|
|
3754
|
+
case "last":
|
|
3755
|
+
nextIndex = findLastEnabledIndex(nodes);
|
|
3756
|
+
break;
|
|
3500
3757
|
}
|
|
3501
|
-
|
|
3758
|
+
nodes[nextIndex]?.focus();
|
|
3502
3759
|
}
|
|
3503
3760
|
var timePickerBaseClasses = "relative inline-block w-full max-w-xs";
|
|
3504
3761
|
var timePickerInputWrapperClasses = "relative flex items-center";
|
|
@@ -3635,67 +3892,67 @@ function interpolateUploadLabel(template, params) {
|
|
|
3635
3892
|
function getUploadLabels(locale, overrides) {
|
|
3636
3893
|
return {
|
|
3637
3894
|
dragAreaAriaLabel: resolveLocaleText(
|
|
3638
|
-
|
|
3895
|
+
DEFAULT_UPLOAD_LABELS.dragAreaAriaLabel,
|
|
3639
3896
|
overrides?.dragAreaAriaLabel,
|
|
3640
3897
|
locale?.upload?.dragAreaAriaLabel
|
|
3641
3898
|
),
|
|
3642
3899
|
buttonAriaLabel: resolveLocaleText(
|
|
3643
|
-
|
|
3900
|
+
DEFAULT_UPLOAD_LABELS.buttonAriaLabel,
|
|
3644
3901
|
overrides?.buttonAriaLabel,
|
|
3645
3902
|
locale?.upload?.buttonAriaLabel
|
|
3646
3903
|
),
|
|
3647
3904
|
clickToUploadText: resolveLocaleText(
|
|
3648
|
-
|
|
3905
|
+
DEFAULT_UPLOAD_LABELS.clickToUploadText,
|
|
3649
3906
|
overrides?.clickToUploadText,
|
|
3650
3907
|
locale?.upload?.clickToUploadText
|
|
3651
3908
|
),
|
|
3652
3909
|
dragAndDropText: resolveLocaleText(
|
|
3653
|
-
|
|
3910
|
+
DEFAULT_UPLOAD_LABELS.dragAndDropText,
|
|
3654
3911
|
overrides?.dragAndDropText,
|
|
3655
3912
|
locale?.upload?.dragAndDropText
|
|
3656
3913
|
),
|
|
3657
3914
|
acceptInfoText: resolveLocaleText(
|
|
3658
|
-
|
|
3915
|
+
DEFAULT_UPLOAD_LABELS.acceptInfoText,
|
|
3659
3916
|
overrides?.acceptInfoText,
|
|
3660
3917
|
locale?.upload?.acceptInfoText
|
|
3661
3918
|
),
|
|
3662
3919
|
maxSizeInfoText: resolveLocaleText(
|
|
3663
|
-
|
|
3920
|
+
DEFAULT_UPLOAD_LABELS.maxSizeInfoText,
|
|
3664
3921
|
overrides?.maxSizeInfoText,
|
|
3665
3922
|
locale?.upload?.maxSizeInfoText
|
|
3666
3923
|
),
|
|
3667
3924
|
selectFileText: resolveLocaleText(
|
|
3668
|
-
|
|
3925
|
+
DEFAULT_UPLOAD_LABELS.selectFileText,
|
|
3669
3926
|
overrides?.selectFileText,
|
|
3670
3927
|
locale?.upload?.selectFileText
|
|
3671
3928
|
),
|
|
3672
3929
|
uploadedFilesAriaLabel: resolveLocaleText(
|
|
3673
|
-
|
|
3930
|
+
DEFAULT_UPLOAD_LABELS.uploadedFilesAriaLabel,
|
|
3674
3931
|
overrides?.uploadedFilesAriaLabel,
|
|
3675
3932
|
locale?.upload?.uploadedFilesAriaLabel
|
|
3676
3933
|
),
|
|
3677
3934
|
successAriaLabel: resolveLocaleText(
|
|
3678
|
-
|
|
3935
|
+
DEFAULT_UPLOAD_LABELS.successAriaLabel,
|
|
3679
3936
|
overrides?.successAriaLabel,
|
|
3680
3937
|
locale?.upload?.successAriaLabel
|
|
3681
3938
|
),
|
|
3682
3939
|
errorAriaLabel: resolveLocaleText(
|
|
3683
|
-
|
|
3940
|
+
DEFAULT_UPLOAD_LABELS.errorAriaLabel,
|
|
3684
3941
|
overrides?.errorAriaLabel,
|
|
3685
3942
|
locale?.upload?.errorAriaLabel
|
|
3686
3943
|
),
|
|
3687
3944
|
uploadingAriaLabel: resolveLocaleText(
|
|
3688
|
-
|
|
3945
|
+
DEFAULT_UPLOAD_LABELS.uploadingAriaLabel,
|
|
3689
3946
|
overrides?.uploadingAriaLabel,
|
|
3690
3947
|
locale?.upload?.uploadingAriaLabel
|
|
3691
3948
|
),
|
|
3692
3949
|
removeFileAriaLabel: resolveLocaleText(
|
|
3693
|
-
|
|
3950
|
+
DEFAULT_UPLOAD_LABELS.removeFileAriaLabel,
|
|
3694
3951
|
overrides?.removeFileAriaLabel,
|
|
3695
3952
|
locale?.upload?.removeFileAriaLabel
|
|
3696
3953
|
),
|
|
3697
3954
|
previewFileAriaLabel: resolveLocaleText(
|
|
3698
|
-
|
|
3955
|
+
DEFAULT_UPLOAD_LABELS.previewFileAriaLabel,
|
|
3699
3956
|
overrides?.previewFileAriaLabel,
|
|
3700
3957
|
locale?.upload?.previewFileAriaLabel
|
|
3701
3958
|
)
|
|
@@ -3711,7 +3968,10 @@ var enUS = {
|
|
|
3711
3968
|
cancelText: "Cancel",
|
|
3712
3969
|
closeText: "Close",
|
|
3713
3970
|
loadingText: "Loading...",
|
|
3714
|
-
emptyText: "No data"
|
|
3971
|
+
emptyText: "No data",
|
|
3972
|
+
noMoreText: "No more data",
|
|
3973
|
+
searchPlaceholder: "Search",
|
|
3974
|
+
clearText: "Clear"
|
|
3715
3975
|
},
|
|
3716
3976
|
modal: {
|
|
3717
3977
|
closeAriaLabel: "Close",
|
|
@@ -3721,6 +3981,7 @@ var enUS = {
|
|
|
3721
3981
|
drawer: {
|
|
3722
3982
|
closeAriaLabel: "Close"
|
|
3723
3983
|
},
|
|
3984
|
+
upload: DEFAULT_UPLOAD_LABELS,
|
|
3724
3985
|
pagination: {
|
|
3725
3986
|
totalText: "Total {total} items",
|
|
3726
3987
|
itemsPerPageText: "/ page",
|
|
@@ -3750,6 +4011,7 @@ var enUS = {
|
|
|
3750
4011
|
lockColumnAriaLabel: "Lock column {column}",
|
|
3751
4012
|
unlockColumnAriaLabel: "Unlock column {column}"
|
|
3752
4013
|
},
|
|
4014
|
+
timePicker: DEFAULT_TIME_PICKER_LABELS,
|
|
3753
4015
|
formWizard: {
|
|
3754
4016
|
prevText: "Previous",
|
|
3755
4017
|
nextText: "Next",
|
|
@@ -3761,6 +4023,28 @@ var enUS = {
|
|
|
3761
4023
|
wipLimitText: "WIP limit: {limit}",
|
|
3762
4024
|
dragHintText: "Drag to move",
|
|
3763
4025
|
boardAriaLabel: "Task Board"
|
|
4026
|
+
},
|
|
4027
|
+
formValidation: {
|
|
4028
|
+
required: "This field is required",
|
|
4029
|
+
typeString: "Value must be a string",
|
|
4030
|
+
typeNumber: "Value must be a number",
|
|
4031
|
+
typeBoolean: "Value must be a boolean",
|
|
4032
|
+
typeArray: "Value must be an array",
|
|
4033
|
+
typeObject: "Value must be an object",
|
|
4034
|
+
email: "Please enter a valid email address",
|
|
4035
|
+
phone: "Please enter a valid phone number",
|
|
4036
|
+
url: "Please enter a valid URL",
|
|
4037
|
+
date: "Please enter a valid date",
|
|
4038
|
+
idCard: "Please enter a valid ID card number",
|
|
4039
|
+
minLength: "Minimum length is {min} characters",
|
|
4040
|
+
maxLength: "Maximum length is {max} characters",
|
|
4041
|
+
minValue: "Minimum value is {min}",
|
|
4042
|
+
maxValue: "Maximum value is {max}",
|
|
4043
|
+
minItems: "Minimum {min} items required",
|
|
4044
|
+
maxItems: "Maximum {max} items allowed",
|
|
4045
|
+
patternMismatch: "Value does not match the required pattern",
|
|
4046
|
+
validatorFailed: "Validation failed",
|
|
4047
|
+
validatorError: "Validation error occurred"
|
|
3764
4048
|
}
|
|
3765
4049
|
};
|
|
3766
4050
|
|
|
@@ -4013,6 +4297,18 @@ function isAtMax(value, max = Infinity) {
|
|
|
4013
4297
|
if (value === null || value === void 0) return false;
|
|
4014
4298
|
return value >= max;
|
|
4015
4299
|
}
|
|
4300
|
+
function formatInputNumberDisplay(value, options = {}) {
|
|
4301
|
+
if (value === null || value === void 0) return "";
|
|
4302
|
+
if (options.formatter) return options.formatter(value);
|
|
4303
|
+
if (options.precision !== void 0) return value.toFixed(options.precision);
|
|
4304
|
+
return String(value);
|
|
4305
|
+
}
|
|
4306
|
+
function parseInputNumberValue(str, options = {}) {
|
|
4307
|
+
if (str === "" || str === "-") return null;
|
|
4308
|
+
if (options.parser) return options.parser(str);
|
|
4309
|
+
const num = Number(str);
|
|
4310
|
+
return Number.isNaN(num) ? null : num;
|
|
4311
|
+
}
|
|
4016
4312
|
|
|
4017
4313
|
// src/utils/form-item-styles.ts
|
|
4018
4314
|
var FORM_ITEM_SPACING = {
|
|
@@ -4407,128 +4703,128 @@ function isEmpty(value) {
|
|
|
4407
4703
|
}
|
|
4408
4704
|
return false;
|
|
4409
4705
|
}
|
|
4410
|
-
function validateType(value, type, customMessage) {
|
|
4706
|
+
function validateType(value, type, customMessage, messages = DEFAULT_FORM_VALIDATION_LABELS) {
|
|
4411
4707
|
switch (type) {
|
|
4412
4708
|
case "string":
|
|
4413
4709
|
if (typeof value !== "string") {
|
|
4414
|
-
return customMessage ||
|
|
4710
|
+
return customMessage || messages.typeString;
|
|
4415
4711
|
}
|
|
4416
4712
|
break;
|
|
4417
4713
|
case "number":
|
|
4418
4714
|
if (typeof value !== "number" && isNaN(Number(value))) {
|
|
4419
|
-
return customMessage ||
|
|
4715
|
+
return customMessage || messages.typeNumber;
|
|
4420
4716
|
}
|
|
4421
4717
|
break;
|
|
4422
4718
|
case "boolean":
|
|
4423
4719
|
if (typeof value !== "boolean") {
|
|
4424
|
-
return customMessage ||
|
|
4720
|
+
return customMessage || messages.typeBoolean;
|
|
4425
4721
|
}
|
|
4426
4722
|
break;
|
|
4427
4723
|
case "array":
|
|
4428
4724
|
if (!Array.isArray(value)) {
|
|
4429
|
-
return customMessage ||
|
|
4725
|
+
return customMessage || messages.typeArray;
|
|
4430
4726
|
}
|
|
4431
4727
|
break;
|
|
4432
4728
|
case "object":
|
|
4433
4729
|
if (typeof value !== "object" || Array.isArray(value)) {
|
|
4434
|
-
return customMessage ||
|
|
4730
|
+
return customMessage || messages.typeObject;
|
|
4435
4731
|
}
|
|
4436
4732
|
break;
|
|
4437
4733
|
case "email":
|
|
4438
4734
|
if (typeof value === "string" && !EMAIL_PATTERN.test(value)) {
|
|
4439
|
-
return customMessage ||
|
|
4735
|
+
return customMessage || messages.email;
|
|
4440
4736
|
}
|
|
4441
4737
|
break;
|
|
4442
4738
|
case "phone":
|
|
4443
4739
|
if (typeof value === "string") {
|
|
4444
4740
|
const digits = value.replace(/\D/g, "");
|
|
4445
4741
|
if (!PHONE_PATTERN.test(value) || digits.length < 7) {
|
|
4446
|
-
return customMessage ||
|
|
4742
|
+
return customMessage || messages.phone;
|
|
4447
4743
|
}
|
|
4448
4744
|
}
|
|
4449
4745
|
break;
|
|
4450
4746
|
case "url":
|
|
4451
4747
|
if (typeof value === "string" && !URL_PATTERN.test(value)) {
|
|
4452
|
-
return customMessage ||
|
|
4748
|
+
return customMessage || messages.url;
|
|
4453
4749
|
}
|
|
4454
4750
|
break;
|
|
4455
4751
|
case "date":
|
|
4456
4752
|
if (!(value instanceof Date) && isNaN(Date.parse(String(value)))) {
|
|
4457
|
-
return customMessage ||
|
|
4753
|
+
return customMessage || messages.date;
|
|
4458
4754
|
}
|
|
4459
4755
|
break;
|
|
4460
4756
|
case "id-card":
|
|
4461
4757
|
if (typeof value === "string" && !ID_CARD_PATTERN.test(value)) {
|
|
4462
|
-
return customMessage ||
|
|
4758
|
+
return customMessage || messages.idCard;
|
|
4463
4759
|
}
|
|
4464
4760
|
break;
|
|
4465
4761
|
}
|
|
4466
4762
|
return null;
|
|
4467
4763
|
}
|
|
4468
|
-
function validateRange(value, min, max, customMessage) {
|
|
4764
|
+
function validateRange(value, min, max, customMessage, messages = DEFAULT_FORM_VALIDATION_LABELS) {
|
|
4469
4765
|
if (typeof value === "string") {
|
|
4470
4766
|
if (min !== void 0 && value.length < min) {
|
|
4471
|
-
return customMessage ||
|
|
4767
|
+
return customMessage || messages.minLength.replace("{min}", String(min));
|
|
4472
4768
|
}
|
|
4473
4769
|
if (max !== void 0 && value.length > max) {
|
|
4474
|
-
return customMessage ||
|
|
4770
|
+
return customMessage || messages.maxLength.replace("{max}", String(max));
|
|
4475
4771
|
}
|
|
4476
4772
|
}
|
|
4477
4773
|
if (typeof value === "number") {
|
|
4478
4774
|
if (min !== void 0 && value < min) {
|
|
4479
|
-
return customMessage ||
|
|
4775
|
+
return customMessage || messages.minValue.replace("{min}", String(min));
|
|
4480
4776
|
}
|
|
4481
4777
|
if (max !== void 0 && value > max) {
|
|
4482
|
-
return customMessage ||
|
|
4778
|
+
return customMessage || messages.maxValue.replace("{max}", String(max));
|
|
4483
4779
|
}
|
|
4484
4780
|
}
|
|
4485
4781
|
if (Array.isArray(value)) {
|
|
4486
4782
|
if (min !== void 0 && value.length < min) {
|
|
4487
|
-
return customMessage ||
|
|
4783
|
+
return customMessage || messages.minItems.replace("{min}", String(min));
|
|
4488
4784
|
}
|
|
4489
4785
|
if (max !== void 0 && value.length > max) {
|
|
4490
|
-
return customMessage ||
|
|
4786
|
+
return customMessage || messages.maxItems.replace("{max}", String(max));
|
|
4491
4787
|
}
|
|
4492
4788
|
}
|
|
4493
4789
|
return null;
|
|
4494
4790
|
}
|
|
4495
|
-
async function validateRule(value, rule, allValues) {
|
|
4791
|
+
async function validateRule(value, rule, allValues, messages = DEFAULT_FORM_VALIDATION_LABELS) {
|
|
4496
4792
|
if (!rule.required && isEmpty(value)) {
|
|
4497
4793
|
return null;
|
|
4498
4794
|
}
|
|
4499
4795
|
const transformedValue = rule.transform ? rule.transform(value) : value;
|
|
4500
4796
|
if (rule.required && isEmpty(transformedValue)) {
|
|
4501
|
-
return rule.message ||
|
|
4797
|
+
return rule.message || messages.required;
|
|
4502
4798
|
}
|
|
4503
4799
|
if (rule.type && !isEmpty(transformedValue)) {
|
|
4504
|
-
const typeError = validateType(transformedValue, rule.type, rule.message);
|
|
4800
|
+
const typeError = validateType(transformedValue, rule.type, rule.message, messages);
|
|
4505
4801
|
if (typeError) return typeError;
|
|
4506
4802
|
}
|
|
4507
4803
|
if (!isEmpty(transformedValue)) {
|
|
4508
|
-
const rangeError = validateRange(transformedValue, rule.min, rule.max, rule.message);
|
|
4804
|
+
const rangeError = validateRange(transformedValue, rule.min, rule.max, rule.message, messages);
|
|
4509
4805
|
if (rangeError) return rangeError;
|
|
4510
4806
|
}
|
|
4511
4807
|
if (rule.pattern && typeof transformedValue === "string") {
|
|
4512
4808
|
if (!rule.pattern.test(transformedValue)) {
|
|
4513
|
-
return rule.message ||
|
|
4809
|
+
return rule.message || messages.patternMismatch;
|
|
4514
4810
|
}
|
|
4515
4811
|
}
|
|
4516
4812
|
if (rule.validator) {
|
|
4517
4813
|
try {
|
|
4518
4814
|
const result = await rule.validator(transformedValue, allValues);
|
|
4519
4815
|
if (result === false) {
|
|
4520
|
-
return rule.message ||
|
|
4816
|
+
return rule.message || messages.validatorFailed;
|
|
4521
4817
|
}
|
|
4522
4818
|
if (typeof result === "string") {
|
|
4523
4819
|
return result;
|
|
4524
4820
|
}
|
|
4525
4821
|
} catch {
|
|
4526
|
-
return rule.message ||
|
|
4822
|
+
return rule.message || messages.validatorError;
|
|
4527
4823
|
}
|
|
4528
4824
|
}
|
|
4529
4825
|
return null;
|
|
4530
4826
|
}
|
|
4531
|
-
async function validateField(fieldName, value, rules, allValues, trigger) {
|
|
4827
|
+
async function validateField(fieldName, value, rules, allValues, trigger, messages = DEFAULT_FORM_VALIDATION_LABELS) {
|
|
4532
4828
|
if (!rules) {
|
|
4533
4829
|
return null;
|
|
4534
4830
|
}
|
|
@@ -4541,18 +4837,18 @@ async function validateField(fieldName, value, rules, allValues, trigger) {
|
|
|
4541
4837
|
continue;
|
|
4542
4838
|
}
|
|
4543
4839
|
}
|
|
4544
|
-
const error = await validateRule(value, rule, allValues);
|
|
4840
|
+
const error = await validateRule(value, rule, allValues, messages);
|
|
4545
4841
|
if (error) {
|
|
4546
4842
|
return error;
|
|
4547
4843
|
}
|
|
4548
4844
|
}
|
|
4549
4845
|
return null;
|
|
4550
4846
|
}
|
|
4551
|
-
async function validateForm(values, rules) {
|
|
4847
|
+
async function validateForm(values, rules, messages = DEFAULT_FORM_VALIDATION_LABELS) {
|
|
4552
4848
|
const errors = [];
|
|
4553
4849
|
for (const [fieldName, fieldRules] of Object.entries(rules)) {
|
|
4554
4850
|
const value = getValueByPath(values, fieldName);
|
|
4555
|
-
const error = await validateField(fieldName, value, fieldRules, values);
|
|
4851
|
+
const error = await validateField(fieldName, value, fieldRules, values, void 0, messages);
|
|
4556
4852
|
if (error) {
|
|
4557
4853
|
errors.push({
|
|
4558
4854
|
field: fieldName,
|
|
@@ -4565,14 +4861,14 @@ async function validateForm(values, rules) {
|
|
|
4565
4861
|
errors
|
|
4566
4862
|
};
|
|
4567
4863
|
}
|
|
4568
|
-
async function validateFormFields(values, rules, fieldNames, trigger) {
|
|
4864
|
+
async function validateFormFields(values, rules, fieldNames, trigger, messages = DEFAULT_FORM_VALIDATION_LABELS) {
|
|
4569
4865
|
const errors = [];
|
|
4570
4866
|
const uniqueFieldNames = Array.from(new Set(fieldNames));
|
|
4571
4867
|
for (const fieldName of uniqueFieldNames) {
|
|
4572
4868
|
const fieldRules = rules[fieldName];
|
|
4573
4869
|
if (!fieldRules) continue;
|
|
4574
4870
|
const value = getValueByPath(values, fieldName);
|
|
4575
|
-
const error = await validateField(fieldName, value, fieldRules, values, trigger);
|
|
4871
|
+
const error = await validateField(fieldName, value, fieldRules, values, trigger, messages);
|
|
4576
4872
|
if (error) {
|
|
4577
4873
|
errors.push({ field: fieldName, message: error });
|
|
4578
4874
|
}
|
|
@@ -4720,6 +5016,23 @@ function normalizeDate(date) {
|
|
|
4720
5016
|
normalized.setHours(0, 0, 0, 0);
|
|
4721
5017
|
return normalized;
|
|
4722
5018
|
}
|
|
5019
|
+
function addDays(date, days) {
|
|
5020
|
+
const next = new Date(date);
|
|
5021
|
+
next.setDate(next.getDate() + days);
|
|
5022
|
+
return next;
|
|
5023
|
+
}
|
|
5024
|
+
function addMonths(date, months) {
|
|
5025
|
+
const next = new Date(date);
|
|
5026
|
+
const day = next.getDate();
|
|
5027
|
+
next.setDate(1);
|
|
5028
|
+
next.setMonth(next.getMonth() + months);
|
|
5029
|
+
const maxDay = getDaysInMonth(next.getFullYear(), next.getMonth());
|
|
5030
|
+
next.setDate(Math.min(day, maxDay));
|
|
5031
|
+
return next;
|
|
5032
|
+
}
|
|
5033
|
+
function addYears(date, years) {
|
|
5034
|
+
return addMonths(date, years * 12);
|
|
5035
|
+
}
|
|
4723
5036
|
function isDateInRange(date, minDate, maxDate) {
|
|
4724
5037
|
if (isNaN(date.getTime())) return false;
|
|
4725
5038
|
const normalizedDate = normalizeDate(date);
|
|
@@ -6701,6 +7014,75 @@ function getVisibleTreeItems(treeData, expandedKeys = /* @__PURE__ */ new Set(),
|
|
|
6701
7014
|
traverse(treeData, 1);
|
|
6702
7015
|
return result;
|
|
6703
7016
|
}
|
|
7017
|
+
function getFirstVisibleChildKey(visibleItems, parentKey) {
|
|
7018
|
+
const index = visibleItems.findIndex((item) => item.key === parentKey);
|
|
7019
|
+
if (index < 0) return void 0;
|
|
7020
|
+
const base = visibleItems[index];
|
|
7021
|
+
for (let i = index + 1; i < visibleItems.length; i++) {
|
|
7022
|
+
const item = visibleItems[i];
|
|
7023
|
+
if (item.level <= base.level) break;
|
|
7024
|
+
if (item.parentKey === parentKey && !item.node.disabled) return item.key;
|
|
7025
|
+
}
|
|
7026
|
+
return void 0;
|
|
7027
|
+
}
|
|
7028
|
+
function getTreeKeyboardAction(ctx) {
|
|
7029
|
+
const {
|
|
7030
|
+
key,
|
|
7031
|
+
nodeKey,
|
|
7032
|
+
currentKey,
|
|
7033
|
+
focusableKeys,
|
|
7034
|
+
parentKey,
|
|
7035
|
+
firstChildKey,
|
|
7036
|
+
isExpandable,
|
|
7037
|
+
isExpanded,
|
|
7038
|
+
isParentExpanded,
|
|
7039
|
+
isChecked,
|
|
7040
|
+
selectable,
|
|
7041
|
+
checkable
|
|
7042
|
+
} = ctx;
|
|
7043
|
+
const currentIndex = focusableKeys.findIndex((k) => k === currentKey);
|
|
7044
|
+
const focusAt = (index) => ({
|
|
7045
|
+
type: "focus",
|
|
7046
|
+
key: focusableKeys[index] ?? currentKey
|
|
7047
|
+
});
|
|
7048
|
+
switch (key) {
|
|
7049
|
+
case "ArrowDown":
|
|
7050
|
+
return focusAt(currentIndex + 1);
|
|
7051
|
+
case "ArrowUp":
|
|
7052
|
+
return focusAt(currentIndex - 1);
|
|
7053
|
+
case "Home":
|
|
7054
|
+
return focusAt(0);
|
|
7055
|
+
case "End":
|
|
7056
|
+
return focusAt(focusableKeys.length - 1);
|
|
7057
|
+
case "ArrowRight":
|
|
7058
|
+
if (isExpandable && !isExpanded) return { type: "toggleExpand", key: nodeKey };
|
|
7059
|
+
if (isExpandable && isExpanded) return { type: "focus", key: firstChildKey ?? currentKey };
|
|
7060
|
+
return { type: "none" };
|
|
7061
|
+
case "ArrowLeft":
|
|
7062
|
+
if (isExpandable && isExpanded) return { type: "toggleExpand", key: nodeKey };
|
|
7063
|
+
return { type: "focus", key: parentKey ?? currentKey };
|
|
7064
|
+
case "Escape":
|
|
7065
|
+
if (isExpandable && isExpanded) return { type: "toggleExpand", key: nodeKey };
|
|
7066
|
+
if (parentKey !== void 0) {
|
|
7067
|
+
return {
|
|
7068
|
+
type: "collapseAndFocus",
|
|
7069
|
+
collapseKey: isParentExpanded ? parentKey : void 0,
|
|
7070
|
+
focusKey: parentKey
|
|
7071
|
+
};
|
|
7072
|
+
}
|
|
7073
|
+
return { type: "none" };
|
|
7074
|
+
case "Enter":
|
|
7075
|
+
if (selectable) return { type: "select", key: nodeKey };
|
|
7076
|
+
if (isExpandable) return { type: "toggleExpand", key: nodeKey };
|
|
7077
|
+
return { type: "none" };
|
|
7078
|
+
case " ":
|
|
7079
|
+
if (checkable) return { type: "check", key: nodeKey, checked: !isChecked };
|
|
7080
|
+
if (isExpandable) return { type: "toggleExpand", key: nodeKey };
|
|
7081
|
+
return { type: "none" };
|
|
7082
|
+
default:
|
|
7083
|
+
return null;
|
|
7084
|
+
}
|
|
7085
|
+
}
|
|
6704
7086
|
var treeBaseClasses = "w-full bg-white rounded-[var(--tiger-radius-md,0.5rem)]";
|
|
6705
7087
|
var treeNodeWrapperClasses = "select-none";
|
|
6706
7088
|
var treeNodeContentClasses = "flex items-center px-2 py-1.5 cursor-pointer rounded transition-colors duration-200";
|
|
@@ -7458,6 +7840,10 @@ function createSubmenuHeightTransitionController(element, options) {
|
|
|
7458
7840
|
}
|
|
7459
7841
|
};
|
|
7460
7842
|
}
|
|
7843
|
+
function getMenuNavigationKeys(mode, isRoot) {
|
|
7844
|
+
const isHorizontalRoot = isRoot && mode === "horizontal";
|
|
7845
|
+
return isHorizontalRoot ? { nextKey: "ArrowRight", prevKey: "ArrowLeft" } : { nextKey: "ArrowDown", prevKey: "ArrowUp" };
|
|
7846
|
+
}
|
|
7461
7847
|
function getMenuButtons(container) {
|
|
7462
7848
|
return Array.from(
|
|
7463
7849
|
container.querySelectorAll('button[data-tiger-menuitem="true"]')
|
|
@@ -8983,7 +9369,7 @@ function getCodeBlockCopyButtonClasses(isCopied, ...classes) {
|
|
|
8983
9369
|
);
|
|
8984
9370
|
}
|
|
8985
9371
|
|
|
8986
|
-
// src/theme/colors.ts
|
|
9372
|
+
// src/theme-runtime/colors.ts
|
|
8987
9373
|
var defaultThemeColors = {
|
|
8988
9374
|
primary: {
|
|
8989
9375
|
bg: "bg-[var(--tiger-primary,#2563eb)]",
|
|
@@ -9461,6 +9847,9 @@ function getInitialCropRect(imageWidth, imageHeight, aspectRatio) {
|
|
|
9461
9847
|
};
|
|
9462
9848
|
}
|
|
9463
9849
|
function cropCanvas(image, cropRect, displayWidth, displayHeight, outputType = "image/png", quality = 0.92) {
|
|
9850
|
+
if (!isBrowser()) {
|
|
9851
|
+
throw new Error("Image canvas cropping is only available in the browser");
|
|
9852
|
+
}
|
|
9464
9853
|
const scaleX = image.naturalWidth / displayWidth;
|
|
9465
9854
|
const scaleY = image.naturalHeight / displayHeight;
|
|
9466
9855
|
const sx = cropRect.x * scaleX;
|
|
@@ -9801,6 +10190,9 @@ function getAnchorLinkClasses(active, className) {
|
|
|
9801
10190
|
return [anchorLinkBaseClasses, active && anchorLinkActiveClasses, className].filter(Boolean).join(" ");
|
|
9802
10191
|
}
|
|
9803
10192
|
function getAnchorTargetElement(href) {
|
|
10193
|
+
if (!isBrowser()) {
|
|
10194
|
+
return null;
|
|
10195
|
+
}
|
|
9804
10196
|
if (!href || !href.startsWith("#")) {
|
|
9805
10197
|
return null;
|
|
9806
10198
|
}
|
|
@@ -9811,18 +10203,27 @@ function getAnchorTargetElement(href) {
|
|
|
9811
10203
|
return document.getElementById(id);
|
|
9812
10204
|
}
|
|
9813
10205
|
function getContainerScrollTop(container) {
|
|
10206
|
+
if (!isBrowser()) {
|
|
10207
|
+
return container?.scrollTop ?? 0;
|
|
10208
|
+
}
|
|
9814
10209
|
if (container === window) {
|
|
9815
10210
|
return window.scrollY || document.documentElement.scrollTop;
|
|
9816
10211
|
}
|
|
9817
10212
|
return container.scrollTop;
|
|
9818
10213
|
}
|
|
9819
10214
|
function getContainerHeight(container) {
|
|
10215
|
+
if (!isBrowser()) {
|
|
10216
|
+
return container?.clientHeight ?? 0;
|
|
10217
|
+
}
|
|
9820
10218
|
if (container === window) {
|
|
9821
10219
|
return window.innerHeight;
|
|
9822
10220
|
}
|
|
9823
10221
|
return container.clientHeight;
|
|
9824
10222
|
}
|
|
9825
10223
|
function getElementOffsetTop(element, container) {
|
|
10224
|
+
if (!isBrowser()) {
|
|
10225
|
+
return 0;
|
|
10226
|
+
}
|
|
9826
10227
|
if (container === window) {
|
|
9827
10228
|
const rect = element.getBoundingClientRect();
|
|
9828
10229
|
return rect.top + window.scrollY;
|
|
@@ -9842,6 +10243,9 @@ function getElementOffsetTop(element, container) {
|
|
|
9842
10243
|
return offset2;
|
|
9843
10244
|
}
|
|
9844
10245
|
function scrollToAnchor(href, container, targetOffset = 0) {
|
|
10246
|
+
if (!isBrowser()) {
|
|
10247
|
+
return;
|
|
10248
|
+
}
|
|
9845
10249
|
const element = getAnchorTargetElement(href);
|
|
9846
10250
|
if (!element) {
|
|
9847
10251
|
return;
|
|
@@ -9854,6 +10258,9 @@ function findActiveAnchor(links, container, bounds = 5, targetOffset = 0) {
|
|
|
9854
10258
|
if (links.length === 0) {
|
|
9855
10259
|
return "";
|
|
9856
10260
|
}
|
|
10261
|
+
if (!isBrowser()) {
|
|
10262
|
+
return links[0] || "";
|
|
10263
|
+
}
|
|
9857
10264
|
const scrollTop = getContainerScrollTop(container);
|
|
9858
10265
|
for (let i = links.length - 1; i >= 0; i--) {
|
|
9859
10266
|
const href = links[i];
|
|
@@ -9868,11 +10275,11 @@ function findActiveAnchor(links, container, bounds = 5, targetOffset = 0) {
|
|
|
9868
10275
|
return links[0] || "";
|
|
9869
10276
|
}
|
|
9870
10277
|
function createAnchorObserver(links, options) {
|
|
10278
|
+
if (!isBrowser()) return () => {
|
|
10279
|
+
};
|
|
9871
10280
|
if (typeof IntersectionObserver === "undefined") return () => {
|
|
9872
10281
|
};
|
|
9873
10282
|
const { offsetTop = 0, root = null, onChange } = options;
|
|
9874
|
-
if (!isBrowser()) return () => {
|
|
9875
|
-
};
|
|
9876
10283
|
const targets = /* @__PURE__ */ new Map();
|
|
9877
10284
|
for (const href of links) {
|
|
9878
10285
|
const el = getAnchorTargetElement(href);
|
|
@@ -13342,97 +13749,6 @@ function clampCronNumber(value, min, max) {
|
|
|
13342
13749
|
return Math.max(min, Math.min(max, Math.round(value)));
|
|
13343
13750
|
}
|
|
13344
13751
|
|
|
13345
|
-
// src/utils/picker-utils.ts
|
|
13346
|
-
var defaultIsDisabled = (item) => !!item?.disabled;
|
|
13347
|
-
function findFirstEnabledIndex(items, isDisabled = defaultIsDisabled) {
|
|
13348
|
-
for (let i = 0; i < items.length; i++) {
|
|
13349
|
-
if (!isDisabled(items[i])) return i;
|
|
13350
|
-
}
|
|
13351
|
-
return -1;
|
|
13352
|
-
}
|
|
13353
|
-
function findLastEnabledIndex(items, isDisabled = defaultIsDisabled) {
|
|
13354
|
-
for (let i = items.length - 1; i >= 0; i--) {
|
|
13355
|
-
if (!isDisabled(items[i])) return i;
|
|
13356
|
-
}
|
|
13357
|
-
return -1;
|
|
13358
|
-
}
|
|
13359
|
-
function findNextEnabledIndex(items, current, direction, isDisabled = defaultIsDisabled) {
|
|
13360
|
-
if (items.length === 0) return -1;
|
|
13361
|
-
const start = current < 0 ? direction === 1 ? 0 : items.length - 1 : current + direction;
|
|
13362
|
-
for (let i = start; i >= 0 && i < items.length; i += direction) {
|
|
13363
|
-
if (!isDisabled(items[i])) return i;
|
|
13364
|
-
}
|
|
13365
|
-
return current;
|
|
13366
|
-
}
|
|
13367
|
-
function getInitialPickerActiveIndex(items, activeFirst, isDisabled = defaultIsDisabled) {
|
|
13368
|
-
return activeFirst ? findFirstEnabledIndex(items, isDisabled) : -1;
|
|
13369
|
-
}
|
|
13370
|
-
function getPickerNavigationIndex(items, current, key, isDisabled = defaultIsDisabled) {
|
|
13371
|
-
switch (key) {
|
|
13372
|
-
case "ArrowDown":
|
|
13373
|
-
return findNextEnabledIndex(items, current, 1, isDisabled);
|
|
13374
|
-
case "ArrowUp":
|
|
13375
|
-
return findNextEnabledIndex(items, current, -1, isDisabled);
|
|
13376
|
-
case "Home":
|
|
13377
|
-
return findFirstEnabledIndex(items, isDisabled);
|
|
13378
|
-
case "End":
|
|
13379
|
-
return findLastEnabledIndex(items, isDisabled);
|
|
13380
|
-
default:
|
|
13381
|
-
return current;
|
|
13382
|
-
}
|
|
13383
|
-
}
|
|
13384
|
-
function getPickerOptionId(listboxId, index) {
|
|
13385
|
-
return `${listboxId}-option-${index}`;
|
|
13386
|
-
}
|
|
13387
|
-
function getDisclosureStateAttr(open) {
|
|
13388
|
-
return { "data-state": open ? "open" : "closed" };
|
|
13389
|
-
}
|
|
13390
|
-
function getPickerComboboxAria({
|
|
13391
|
-
expanded,
|
|
13392
|
-
listboxId,
|
|
13393
|
-
activeIndex = -1,
|
|
13394
|
-
activeOptionId
|
|
13395
|
-
}) {
|
|
13396
|
-
return {
|
|
13397
|
-
role: "combobox",
|
|
13398
|
-
"aria-expanded": expanded,
|
|
13399
|
-
"aria-haspopup": "listbox",
|
|
13400
|
-
"aria-controls": expanded ? listboxId : void 0,
|
|
13401
|
-
"aria-activedescendant": expanded ? activeOptionId ?? (activeIndex >= 0 ? getPickerOptionId(listboxId, activeIndex) : void 0) : void 0,
|
|
13402
|
-
"data-state": expanded ? "open" : "closed"
|
|
13403
|
-
};
|
|
13404
|
-
}
|
|
13405
|
-
function getPickerListboxAria({ id, label } = {}) {
|
|
13406
|
-
return {
|
|
13407
|
-
id,
|
|
13408
|
-
role: "listbox",
|
|
13409
|
-
"aria-label": label
|
|
13410
|
-
};
|
|
13411
|
-
}
|
|
13412
|
-
function getPickerOptionAria({
|
|
13413
|
-
selected = false,
|
|
13414
|
-
disabled = false
|
|
13415
|
-
}) {
|
|
13416
|
-
return {
|
|
13417
|
-
role: "option",
|
|
13418
|
-
"aria-selected": selected,
|
|
13419
|
-
"aria-disabled": disabled || void 0
|
|
13420
|
-
};
|
|
13421
|
-
}
|
|
13422
|
-
function getPickerTriggerKeyAction(key, expanded) {
|
|
13423
|
-
switch (key) {
|
|
13424
|
-
case "Enter":
|
|
13425
|
-
case " ":
|
|
13426
|
-
return "toggle";
|
|
13427
|
-
case "ArrowDown":
|
|
13428
|
-
return expanded ? "none" : "open";
|
|
13429
|
-
case "Escape":
|
|
13430
|
-
return expanded ? "close" : "none";
|
|
13431
|
-
default:
|
|
13432
|
-
return "none";
|
|
13433
|
-
}
|
|
13434
|
-
}
|
|
13435
|
-
|
|
13436
13752
|
// src/utils/spotlight-utils.ts
|
|
13437
13753
|
var spotlightRootClasses = "fixed inset-0 flex items-start justify-center px-4 py-6 sm:py-10";
|
|
13438
13754
|
var spotlightMaskClasses = "absolute inset-0 bg-black/35";
|
|
@@ -14683,6 +14999,7 @@ function exportTableToExcel(columns, data) {
|
|
|
14683
14999
|
return `<!doctype html><html><head><meta charset="utf-8"></head><body><table><thead><tr>${headerCells}</tr></thead><tbody>${bodyRows}</tbody></table></body></html>`;
|
|
14684
15000
|
}
|
|
14685
15001
|
function downloadCsv(csvContent, filename = "export") {
|
|
15002
|
+
if (!isBrowser()) return;
|
|
14686
15003
|
const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" });
|
|
14687
15004
|
const url = URL.createObjectURL(blob);
|
|
14688
15005
|
const link = document.createElement("a");
|
|
@@ -14695,6 +15012,7 @@ function downloadCsv(csvContent, filename = "export") {
|
|
|
14695
15012
|
URL.revokeObjectURL(url);
|
|
14696
15013
|
}
|
|
14697
15014
|
function downloadExcel(excelContent, filename = "export") {
|
|
15015
|
+
if (!isBrowser()) return;
|
|
14698
15016
|
const blob = new Blob([excelContent], { type: "application/vnd.ms-excel;charset=utf-8;" });
|
|
14699
15017
|
const url = URL.createObjectURL(blob);
|
|
14700
15018
|
const link = document.createElement("a");
|
|
@@ -16156,7 +16474,6 @@ var kanbanSwimlaneDotClasses = "w-2.5 h-2.5 rounded-full shrink-0";
|
|
|
16156
16474
|
var kanbanSwimlaneCollapsedClasses = "hidden";
|
|
16157
16475
|
var kanbanFilterHighlightClasses = "bg-[var(--tiger-warning,#fbbf24)]/20";
|
|
16158
16476
|
var kanbanAddColumnClasses = "flex items-center justify-center shrink-0 w-76 min-h-[120px] rounded-[var(--tiger-radius-lg,0.75rem)] border-2 border-dashed border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface-muted,#f9fafb)]/40 text-sm font-medium text-[var(--tiger-text-muted,#6b7280)] hover:border-[var(--tiger-primary,#2563eb)]/80 hover:text-[var(--tiger-primary,#2563eb)] hover:bg-[var(--tiger-surface,#ffffff)] hover:shadow-sm cursor-pointer transition-all duration-300 active:scale-98";
|
|
16159
|
-
var kanbanAddCardClasses = taskBoardAddCardClasses;
|
|
16160
16477
|
function filterCards(cards, filterText) {
|
|
16161
16478
|
if (!filterText.trim()) return cards;
|
|
16162
16479
|
const lower = filterText.toLowerCase();
|
|
@@ -17177,6 +17494,7 @@ function getChartSvgDataUrl(svg) {
|
|
|
17177
17494
|
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(serializeChartSvg(svg))}`;
|
|
17178
17495
|
}
|
|
17179
17496
|
function downloadChartSvg(svg, filename = "chart") {
|
|
17497
|
+
if (!isBrowser()) return;
|
|
17180
17498
|
downloadChartBlob(
|
|
17181
17499
|
new Blob([serializeChartSvg(svg)], { type: "image/svg+xml;charset=utf-8" }),
|
|
17182
17500
|
`${filename}.svg`
|
|
@@ -17216,6 +17534,7 @@ async function exportChartPng(svg, options = {}) {
|
|
|
17216
17534
|
});
|
|
17217
17535
|
}
|
|
17218
17536
|
async function downloadChartPng(svg, options = {}) {
|
|
17537
|
+
if (!isBrowser()) return;
|
|
17219
17538
|
const blob = await exportChartPng(svg, options);
|
|
17220
17539
|
downloadChartBlob(blob, `${options.filename ?? "chart"}.png`);
|
|
17221
17540
|
}
|
|
@@ -17392,7 +17711,7 @@ async function getCropperResult(cropper) {
|
|
|
17392
17711
|
return await cropper.getCropResult();
|
|
17393
17712
|
}
|
|
17394
17713
|
|
|
17395
|
-
// src/theme/checkbox.ts
|
|
17714
|
+
// src/theme-runtime/checkbox.ts
|
|
17396
17715
|
var checkboxSizeClasses2 = {
|
|
17397
17716
|
sm: "w-4 h-4",
|
|
17398
17717
|
md: "w-5 h-5",
|
|
@@ -17417,7 +17736,7 @@ function getCheckboxLabelClasses(size = "md", disabled = false) {
|
|
|
17417
17736
|
return [baseClasses2, sizeClass, disabledClasses].filter(Boolean).join(" ");
|
|
17418
17737
|
}
|
|
17419
17738
|
|
|
17420
|
-
// src/theme/switch.ts
|
|
17739
|
+
// src/theme-runtime/switch.ts
|
|
17421
17740
|
var switchBaseClasses = "relative inline-flex items-center rounded-full transition-all duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--tiger-focus-ring,var(--tiger-primary,#2563eb))] active:scale-[0.98]";
|
|
17422
17741
|
var switchSizeClasses = {
|
|
17423
17742
|
sm: "h-5 w-9",
|
|
@@ -17452,7 +17771,7 @@ function getSwitchThumbClasses(size = "md", checked = false) {
|
|
|
17452
17771
|
return classNames(baseClasses2, sizeClass, translateClass);
|
|
17453
17772
|
}
|
|
17454
17773
|
|
|
17455
|
-
// src/theme/slider.ts
|
|
17774
|
+
// src/theme-runtime/slider.ts
|
|
17456
17775
|
var sliderBaseClasses = "relative w-full";
|
|
17457
17776
|
var sliderTrackClasses = "bg-[var(--tiger-border,#e5e7eb)] rounded-full";
|
|
17458
17777
|
var sliderRangeClasses = "bg-[var(--tiger-primary,#2563eb)] rounded-full absolute h-full";
|
|
@@ -17491,7 +17810,7 @@ function getSliderTooltipClasses(size = "md") {
|
|
|
17491
17810
|
return [sliderTooltipClasses, sizeClass].filter(Boolean).join(" ");
|
|
17492
17811
|
}
|
|
17493
17812
|
|
|
17494
|
-
// src/theme/index.ts
|
|
17813
|
+
// src/theme-runtime/index.ts
|
|
17495
17814
|
var THEME_CSS_VARS = {
|
|
17496
17815
|
// Primary colors
|
|
17497
17816
|
primary: "--tiger-primary",
|
|
@@ -19054,7 +19373,7 @@ var designTokens = {
|
|
|
19054
19373
|
};
|
|
19055
19374
|
|
|
19056
19375
|
// src/index.ts
|
|
19057
|
-
var version = "1.
|
|
19376
|
+
var version = "1.4.0";
|
|
19058
19377
|
// Annotate the CommonJS export names for ESM import in node:
|
|
19059
19378
|
0 && (module.exports = {
|
|
19060
19379
|
ANIMATION_DURATION_FAST_MS,
|
|
@@ -19070,12 +19389,15 @@ var version = "1.2.0";
|
|
|
19070
19389
|
ClockIconPath,
|
|
19071
19390
|
CloseIconPath,
|
|
19072
19391
|
DEFAULT_CHART_COLORS,
|
|
19392
|
+
DEFAULT_FORM_VALIDATION_LABELS,
|
|
19073
19393
|
DEFAULT_FORM_WIZARD_LABELS,
|
|
19074
19394
|
DEFAULT_HEATMAP_CANVAS_THRESHOLD,
|
|
19075
19395
|
DEFAULT_PAGINATION_LABELS,
|
|
19076
19396
|
DEFAULT_TABLE_LABELS,
|
|
19077
19397
|
DEFAULT_TASK_BOARD_LABELS,
|
|
19398
|
+
DEFAULT_TIME_PICKER_LABELS,
|
|
19078
19399
|
DEFAULT_UPLOAD_CHUNK_SIZE,
|
|
19400
|
+
DEFAULT_UPLOAD_LABELS,
|
|
19079
19401
|
DONUT_BASE_SHADOW,
|
|
19080
19402
|
DONUT_EMPHASIS_SHADOW,
|
|
19081
19403
|
DROPDOWN_CHEVRON_PATH,
|
|
@@ -19133,10 +19455,13 @@ var version = "1.2.0";
|
|
|
19133
19455
|
VIEW_TRANSITION_CSS,
|
|
19134
19456
|
WEEKDAYS,
|
|
19135
19457
|
ZH_CN_DATEPICKER_LOCALE,
|
|
19458
|
+
ZH_CN_FORM_VALIDATION_LABELS,
|
|
19136
19459
|
ZH_CN_FORM_WIZARD_LABELS,
|
|
19137
19460
|
ZH_CN_PAGINATION_LABELS,
|
|
19138
19461
|
ZH_CN_TABLE_LABELS,
|
|
19139
19462
|
ZH_CN_TASK_BOARD_LABELS,
|
|
19463
|
+
ZH_CN_TIME_PICKER_LABELS,
|
|
19464
|
+
ZH_CN_UPLOAD_LABELS,
|
|
19140
19465
|
activeOpacityClasses,
|
|
19141
19466
|
activePressClasses,
|
|
19142
19467
|
activityItemActionsClasses,
|
|
@@ -19146,6 +19471,9 @@ var version = "1.2.0";
|
|
|
19146
19471
|
activityItemHeaderClasses,
|
|
19147
19472
|
activityItemLayoutClasses,
|
|
19148
19473
|
activityItemTitleGroupClasses,
|
|
19474
|
+
addDays,
|
|
19475
|
+
addMonths,
|
|
19476
|
+
addYears,
|
|
19149
19477
|
affixWrapperClasses,
|
|
19150
19478
|
alertBannerClasses,
|
|
19151
19479
|
alertBaseClasses,
|
|
@@ -19425,6 +19753,7 @@ var version = "1.2.0";
|
|
|
19425
19753
|
createImageAnnotationBox,
|
|
19426
19754
|
createImageAnnotationPath,
|
|
19427
19755
|
createInfiniteScrollObserver,
|
|
19756
|
+
createInstanceCounter,
|
|
19428
19757
|
createLinePath,
|
|
19429
19758
|
createLinearScale,
|
|
19430
19759
|
createLongPressController,
|
|
@@ -19620,6 +19949,7 @@ var version = "1.2.0";
|
|
|
19620
19949
|
focusMenuEdge,
|
|
19621
19950
|
focusRingClasses,
|
|
19622
19951
|
focusRingInsetClasses,
|
|
19952
|
+
focusTimePickerOption,
|
|
19623
19953
|
formatActivityTime,
|
|
19624
19954
|
formatBadgeContent,
|
|
19625
19955
|
formatChatTime,
|
|
@@ -19631,6 +19961,7 @@ var version = "1.2.0";
|
|
|
19631
19961
|
formatFileSize,
|
|
19632
19962
|
formatFileSizeLabel,
|
|
19633
19963
|
formatGanttDate,
|
|
19964
|
+
formatInputNumberDisplay,
|
|
19634
19965
|
formatIntlNumber,
|
|
19635
19966
|
formatMonthYear,
|
|
19636
19967
|
formatPageAriaLabel,
|
|
@@ -19766,6 +20097,7 @@ var version = "1.2.0";
|
|
|
19766
20097
|
getCropperResult,
|
|
19767
20098
|
getCurrentActiveTourStep,
|
|
19768
20099
|
getCurrentTime,
|
|
20100
|
+
getCyclicIndex,
|
|
19769
20101
|
getDatePickerDayCellClasses,
|
|
19770
20102
|
getDatePickerIconButtonClasses,
|
|
19771
20103
|
getDatePickerInputClasses,
|
|
@@ -19817,6 +20149,7 @@ var version = "1.2.0";
|
|
|
19817
20149
|
getFileListItemClasses,
|
|
19818
20150
|
getFileManagerContainerClasses,
|
|
19819
20151
|
getFirstDayOfMonth,
|
|
20152
|
+
getFirstVisibleChildKey,
|
|
19820
20153
|
getFixedColumnOffsets,
|
|
19821
20154
|
getFixedColumnPosition,
|
|
19822
20155
|
getFixedColumnStyle,
|
|
@@ -19832,6 +20165,7 @@ var version = "1.2.0";
|
|
|
19832
20165
|
getFormItemErrorClasses,
|
|
19833
20166
|
getFormItemFieldClasses,
|
|
19834
20167
|
getFormItemLabelClasses,
|
|
20168
|
+
getFormValidationLabels,
|
|
19835
20169
|
getFormWizardLabels,
|
|
19836
20170
|
getFunnelGradientPrefix,
|
|
19837
20171
|
getGanttDependencyPath,
|
|
@@ -19911,6 +20245,7 @@ var version = "1.2.0";
|
|
|
19911
20245
|
getMenuItemClasses,
|
|
19912
20246
|
getMenuItemIndent,
|
|
19913
20247
|
getMenuItems,
|
|
20248
|
+
getMenuNavigationKeys,
|
|
19914
20249
|
getMessageIconPath,
|
|
19915
20250
|
getMessageTypeClasses,
|
|
19916
20251
|
getModalContainerClasses,
|
|
@@ -20133,6 +20468,7 @@ var version = "1.2.0";
|
|
|
20133
20468
|
getTransferItemClasses,
|
|
20134
20469
|
getTransformOrigin,
|
|
20135
20470
|
getTransitionClasses,
|
|
20471
|
+
getTreeKeyboardAction,
|
|
20136
20472
|
getTreeMapGradientPrefix,
|
|
20137
20473
|
getTreeNodeClasses,
|
|
20138
20474
|
getTreeNodeExpandIconClasses,
|
|
@@ -20307,7 +20643,6 @@ var version = "1.2.0";
|
|
|
20307
20643
|
isValidHex,
|
|
20308
20644
|
isValidUrl,
|
|
20309
20645
|
isWipExceeded,
|
|
20310
|
-
kanbanAddCardClasses,
|
|
20311
20646
|
kanbanAddColumnClasses,
|
|
20312
20647
|
kanbanCardCountClasses,
|
|
20313
20648
|
kanbanFilterHighlightClasses,
|
|
@@ -20480,6 +20815,7 @@ var version = "1.2.0";
|
|
|
20480
20815
|
parseDragData,
|
|
20481
20816
|
parseHeight,
|
|
20482
20817
|
parseHotkey,
|
|
20818
|
+
parseInputNumberValue,
|
|
20483
20819
|
parseInputValue,
|
|
20484
20820
|
parseMarkdownHeight,
|
|
20485
20821
|
parsePaneSize,
|