@expcat/tigercat-vue 2.0.0-preview.1 → 2.0.0-preview.3
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-Z7QUWBFR.mjs → chunk-22NIOTDQ.mjs} +1 -1
- package/dist/{chunk-QD5ZCKPR.mjs → chunk-2XCXK3NQ.mjs} +1 -1
- package/dist/{chunk-KRWKO2JQ.mjs → chunk-342DH5CF.mjs} +1 -1
- package/dist/{chunk-JCGWN7WV.mjs → chunk-36TZA5BH.mjs} +1 -1
- package/dist/{chunk-NYWIBDO6.mjs → chunk-3KITFMBJ.mjs} +1 -1
- package/dist/{chunk-B47QLHVW.mjs → chunk-3NQUEQJT.mjs} +4 -4
- package/dist/{chunk-W7X5ZHJ3.mjs → chunk-3WQIYF4T.mjs} +4 -4
- package/dist/{chunk-YSKG5FSX.mjs → chunk-42P6ZQ3J.mjs} +1 -1
- package/dist/{chunk-V5ZEPAWV.mjs → chunk-4BO6JNA6.mjs} +1 -1
- package/dist/{chunk-GL63FRI4.mjs → chunk-4SLYX5GK.mjs} +1 -1
- package/dist/{chunk-Z4SG7REU.mjs → chunk-5E4LINDO.mjs} +5 -3
- package/dist/{chunk-FHJ3R57L.mjs → chunk-5KPO3EDM.mjs} +5 -2
- package/dist/{chunk-CF4GX6BD.mjs → chunk-5RIHHZF6.mjs} +12 -4
- package/dist/{chunk-6FV2OMB7.mjs → chunk-6LORRRRB.mjs} +1 -1
- package/dist/{chunk-CW5TEG7N.mjs → chunk-7CPMXNLK.mjs} +1 -1
- package/dist/{chunk-EQDCFOWR.mjs → chunk-7FWNN6PO.mjs} +75 -22
- package/dist/{chunk-4IZUJJUO.mjs → chunk-7JT5ZIHC.mjs} +1 -1
- package/dist/{chunk-6G5FEZLT.mjs → chunk-7XENCCN5.mjs} +3 -3
- package/dist/{chunk-KR3D2JOA.mjs → chunk-AWCXUDIL.mjs} +3 -3
- package/dist/{chunk-GTFAC625.mjs → chunk-BGGHSTMP.mjs} +1 -1
- package/dist/{chunk-DOVBKVTB.mjs → chunk-CFH5T3V2.mjs} +3 -3
- package/dist/{chunk-IQNZ4UEA.mjs → chunk-D4APFWWS.mjs} +1 -1
- package/dist/{chunk-7LCUVR63.mjs → chunk-DCMRB3HR.mjs} +15 -4
- package/dist/{chunk-WYJ5WOT2.mjs → chunk-DWK5GUMB.mjs} +9 -3
- package/dist/{chunk-EVIZXEB2.mjs → chunk-E6EZHSGY.mjs} +1 -1
- package/dist/{chunk-2YPPXZ4I.mjs → chunk-EGIMTTZA.mjs} +1 -1
- package/dist/{chunk-4ZKSTL5P.mjs → chunk-EGIQPUEL.mjs} +1 -1
- package/dist/{chunk-UQK22ZMC.mjs → chunk-EWUHEW6W.mjs} +75 -22
- package/dist/{chunk-VFUBOKGT.mjs → chunk-F2IWAV3T.mjs} +1 -1
- package/dist/{chunk-HIXWZVE5.mjs → chunk-FSJRNEZK.mjs} +23 -8
- package/dist/{chunk-MJRFB6ZA.mjs → chunk-GDK5LNP3.mjs} +7 -7
- package/dist/{chunk-Z4NJJ7NI.mjs → chunk-GWFVBG22.mjs} +5 -2
- package/dist/{chunk-GMIKUE67.mjs → chunk-H2SX7D23.mjs} +1 -1
- package/dist/{chunk-FAQL7HFW.mjs → chunk-HAUG3OP5.mjs} +1 -1
- package/dist/{chunk-ODDPVS27.mjs → chunk-IDUEWMWN.mjs} +1 -1
- package/dist/{chunk-GAEO66NY.mjs → chunk-IMFHJEUX.mjs} +1 -1
- package/dist/{chunk-GZWZP5AL.mjs → chunk-JHFM6IFO.mjs} +28 -6
- package/dist/{chunk-V5ANPH5R.mjs → chunk-JL3CN4UK.mjs} +1 -1
- package/dist/{chunk-RTZUIWCN.mjs → chunk-JQSIWPNM.mjs} +1 -1
- package/dist/{chunk-RAO7ZJWR.mjs → chunk-JVQPU4M2.mjs} +5 -2
- package/dist/{chunk-BGO2ILHM.mjs → chunk-JZCETBUV.mjs} +16 -3
- package/dist/{chunk-G7MOTNJO.mjs → chunk-KFJIZED5.mjs} +1 -1
- package/dist/{chunk-YJSWHGAR.mjs → chunk-LFENEILY.mjs} +9 -3
- package/dist/{chunk-JMVALNIO.mjs → chunk-LOC5B4YM.mjs} +17 -14
- package/dist/{chunk-36WSYHJU.mjs → chunk-LPZBXTJ6.mjs} +1 -1
- package/dist/{chunk-O4F75KHL.mjs → chunk-MAKOSWR6.mjs} +1 -1
- package/dist/{chunk-FDKJOVXG.mjs → chunk-MNSVJBNH.mjs} +1 -1
- package/dist/{chunk-E7NE5HEC.mjs → chunk-NEEGXKJW.mjs} +1 -1
- package/dist/{chunk-JPCMI3A4.mjs → chunk-NGAA73CV.mjs} +1 -1
- package/dist/{chunk-AZXS4QWC.mjs → chunk-NNC75I7F.mjs} +1 -1
- package/dist/{chunk-6WF3336O.mjs → chunk-O6BN5R6J.mjs} +1 -1
- package/dist/{chunk-YZATP4VF.mjs → chunk-OHPXOLNB.mjs} +12 -3
- package/dist/{chunk-WBT3WSRE.mjs → chunk-OHR7IUBQ.mjs} +14 -2
- package/dist/chunk-P2LZ2MR5.mjs +6 -0
- package/dist/{chunk-7BU4TW5A.mjs → chunk-P5FDKBXG.mjs} +1 -1
- package/dist/{chunk-2QWGVJW6.mjs → chunk-PQBKN2NH.mjs} +24 -10
- package/dist/{chunk-LOX2KCML.mjs → chunk-PYRKFQ6J.mjs} +3 -3
- package/dist/{chunk-BJV62I73.mjs → chunk-QFG452MD.mjs} +2 -2
- package/dist/{chunk-E2GQSWHK.mjs → chunk-QMECRLHW.mjs} +21 -2
- package/dist/{chunk-UD4FNMJN.mjs → chunk-RANRYFUI.mjs} +23 -6
- package/dist/{chunk-FT2HWF7P.mjs → chunk-RSM6FOWX.mjs} +1 -1
- package/dist/{chunk-GHG2MCLM.mjs → chunk-SJ7W5I5H.mjs} +1 -1
- package/dist/{chunk-WLHOWOAY.mjs → chunk-SJINC5NF.mjs} +1 -1
- package/dist/{chunk-PLUABMUD.mjs → chunk-SWCK7TM7.mjs} +1 -1
- package/dist/chunk-TGXBCKOU.mjs +35 -0
- package/dist/{chunk-EYR27UIE.mjs → chunk-U6OGGZBY.mjs} +25 -2
- package/dist/{chunk-DMQLA35L.mjs → chunk-U75YXWSA.mjs} +1 -1
- package/dist/{chunk-R6WFL6NI.mjs → chunk-UOJOJBEU.mjs} +18 -0
- package/dist/{chunk-IGT4QB7O.mjs → chunk-UUWTKCMY.mjs} +1 -1
- package/dist/{chunk-HLPSHCXO.mjs → chunk-V443QIJM.mjs} +5 -1
- package/dist/{chunk-TM73IWEY.mjs → chunk-XH63C62K.mjs} +1 -1
- package/dist/{chunk-DZFM7H3M.mjs → chunk-XLNK3Z2P.mjs} +26 -5
- package/dist/{chunk-4QCJUILG.mjs → chunk-ZFJNCAZX.mjs} +5 -2
- package/dist/{chunk-XZYFVOOS.mjs → chunk-ZFTRR3KW.mjs} +1 -1
- package/dist/components/ActivityFeed.mjs +8 -7
- package/dist/components/AreaChart.d.mts +21 -2
- package/dist/components/AreaChart.mjs +2 -2
- package/dist/components/AutoComplete.d.mts +1 -1
- package/dist/components/AutoComplete.mjs +3 -2
- package/dist/components/Avatar.mjs +4 -2
- package/dist/components/AvatarGroup.d.mts +25 -1
- package/dist/components/AvatarGroup.mjs +3 -1
- package/dist/components/Badge.mjs +3 -2
- package/dist/components/BarChart.d.mts +21 -2
- package/dist/components/BarChart.mjs +2 -2
- package/dist/components/Calendar.mjs +3 -2
- package/dist/components/Carousel.d.mts +21 -1
- package/dist/components/Carousel.mjs +3 -1
- package/dist/components/Cascader.d.mts +1 -1
- package/dist/components/Cascader.mjs +3 -2
- package/dist/components/ChartLegend.d.mts +10 -0
- package/dist/components/ChartLegend.mjs +1 -1
- package/dist/components/ChatWindow.d.mts +1 -1
- package/dist/components/ChatWindow.mjs +8 -6
- package/dist/components/CodeEditor.d.mts +1 -1
- package/dist/components/ColorPicker.mjs +1 -1
- package/dist/components/CommentThread.mjs +6 -5
- package/dist/components/ConfigProvider.mjs +2 -1
- package/dist/components/CronEditor.d.mts +23 -5
- package/dist/components/CronEditor.mjs +3 -1
- package/dist/components/CropUpload.mjs +5 -4
- package/dist/components/DataTableWithToolbar.mjs +8 -6
- package/dist/components/DatePicker.d.mts +1 -1
- package/dist/components/DatePicker.mjs +3 -2
- package/dist/components/DonutChart.mjs +3 -3
- package/dist/components/Drawer.mjs +3 -2
- package/dist/components/Empty.mjs +3 -2
- package/dist/components/FileManager.mjs +3 -2
- package/dist/components/Form.mjs +3 -2
- package/dist/components/FormItem.mjs +5 -3
- package/dist/components/FormItemContext.d.mts +11 -0
- package/dist/components/FormItemContext.mjs +6 -0
- package/dist/components/FormWizard.mjs +3 -2
- package/dist/components/FunnelChart.mjs +2 -2
- package/dist/components/Image.mjs +4 -3
- package/dist/components/ImageAnnotation.mjs +3 -2
- package/dist/components/ImageCropper.mjs +3 -2
- package/dist/components/ImageGroup.mjs +4 -3
- package/dist/components/ImagePreview.mjs +3 -2
- package/dist/components/ImageViewer.mjs +3 -2
- package/dist/components/InfiniteScroll.mjs +3 -2
- package/dist/components/Input.d.mts +1 -1
- package/dist/components/Input.mjs +2 -1
- package/dist/components/InputNumber.d.mts +20 -0
- package/dist/components/InputNumber.mjs +1 -1
- package/dist/components/Kanban.mjs +4 -3
- package/dist/components/LineChart.d.mts +21 -2
- package/dist/components/LineChart.mjs +2 -2
- package/dist/components/List.mjs +3 -2
- package/dist/components/Loading.mjs +3 -2
- package/dist/components/MarkdownEditor.d.mts +22 -2
- package/dist/components/MarkdownEditor.mjs +3 -1
- package/dist/components/Mentions.d.mts +1 -1
- package/dist/components/Menu.d.mts +1 -1
- package/dist/components/Message.mjs +14 -1
- package/dist/components/MessageContainer.mjs +1 -1
- package/dist/components/MessageRoot.mjs +1 -1
- package/dist/components/Modal.mjs +3 -2
- package/dist/components/Notification.mjs +14 -1
- package/dist/components/NotificationCenter.mjs +6 -5
- package/dist/components/NotificationContainer.mjs +1 -1
- package/dist/components/NotificationRoot.mjs +1 -1
- package/dist/components/NumberKeyboard.mjs +3 -2
- package/dist/components/Pagination.mjs +3 -2
- package/dist/components/PieChart.mjs +2 -2
- package/dist/components/PrintLayout.mjs +1 -1
- package/dist/components/QRCode.mjs +3 -2
- package/dist/components/RadarChart.mjs +2 -2
- package/dist/components/Rate.d.mts +19 -1
- package/dist/components/Rate.mjs +3 -1
- package/dist/components/RichTextEditor.d.mts +22 -2
- package/dist/components/RichTextEditor.mjs +3 -1
- package/dist/components/ScatterChart.d.mts +30 -1
- package/dist/components/ScatterChart.mjs +4 -2
- package/dist/components/Select.d.mts +18 -2
- package/dist/components/Select.mjs +3 -2
- package/dist/components/Signature.mjs +3 -2
- package/dist/components/Spotlight.d.mts +1 -1
- package/dist/components/Spotlight.mjs +3 -2
- package/dist/components/Stepper.d.mts +18 -0
- package/dist/components/Stepper.mjs +1 -1
- package/dist/components/SunburstChart.mjs +2 -2
- package/dist/components/Table.mjs +5 -4
- package/dist/components/Tabs.d.mts +20 -1
- package/dist/components/Tabs.mjs +3 -1
- package/dist/components/Tag.mjs +3 -2
- package/dist/components/TaskBoard.mjs +3 -2
- package/dist/components/Textarea.d.mts +1 -1
- package/dist/components/TimePicker.d.mts +1 -1
- package/dist/components/TimePicker.mjs +3 -2
- package/dist/components/Timeline.mjs +3 -2
- package/dist/components/Tour.mjs +3 -2
- package/dist/components/Transfer.d.mts +16 -7
- package/dist/components/Transfer.mjs +3 -2
- package/dist/components/Tree.mjs +3 -2
- package/dist/components/TreeMapChart.mjs +2 -2
- package/dist/components/TreeSelect.d.mts +1 -1
- package/dist/components/TreeSelect.mjs +3 -2
- package/dist/components/Upload.mjs +3 -2
- package/dist/components/VirtualTable.mjs +3 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +32 -0
- package/package.json +2 -2
- /package/dist/{chunk-4RKBXGHQ.mjs → chunk-GSB4MNEX.mjs} +0 -0
- /package/dist/{chunk-ESBUNMIG.mjs → chunk-Q3PELK37.mjs} +0 -0
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
rgbToHex,
|
|
11
11
|
rgbToHsv,
|
|
12
12
|
hsvToRgb,
|
|
13
|
-
|
|
13
|
+
formatColorString,
|
|
14
|
+
parseColorInput,
|
|
14
15
|
classNames,
|
|
15
16
|
coerceClassValue
|
|
16
17
|
} from "@expcat/tigercat-core";
|
|
@@ -27,18 +28,26 @@ var ColorPicker = defineComponent({
|
|
|
27
28
|
emits: ["update:modelValue", "change"],
|
|
28
29
|
setup(props, { emit, attrs }) {
|
|
29
30
|
const isOpen = ref(false);
|
|
31
|
+
const alpha = ref(1);
|
|
30
32
|
const containerRef = ref(null);
|
|
31
|
-
const
|
|
32
|
-
const hsv = computed(() =>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
const rgb = computed(() => hexToRgb(props.modelValue));
|
|
34
|
+
const hsv = computed(() => rgbToHsv(rgb.value.r, rgb.value.g, rgb.value.b));
|
|
35
|
+
const displayValue = computed(
|
|
36
|
+
() => formatColorString(
|
|
37
|
+
rgb.value.r,
|
|
38
|
+
rgb.value.g,
|
|
39
|
+
rgb.value.b,
|
|
40
|
+
props.format,
|
|
41
|
+
props.showAlpha ? alpha.value : void 0
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
const swatchColor = computed(
|
|
45
|
+
() => props.showAlpha ? `rgba(${rgb.value.r}, ${rgb.value.g}, ${rgb.value.b}, ${alpha.value})` : props.modelValue
|
|
41
46
|
);
|
|
47
|
+
const inputValue = ref(displayValue.value);
|
|
48
|
+
watch(displayValue, (v) => {
|
|
49
|
+
inputValue.value = v;
|
|
50
|
+
});
|
|
42
51
|
function togglePanel() {
|
|
43
52
|
if (props.disabled) return;
|
|
44
53
|
isOpen.value = !isOpen.value;
|
|
@@ -46,6 +55,18 @@ var ColorPicker = defineComponent({
|
|
|
46
55
|
function closePanel() {
|
|
47
56
|
isOpen.value = false;
|
|
48
57
|
}
|
|
58
|
+
function handleTriggerKeydown(e) {
|
|
59
|
+
if (props.disabled) return;
|
|
60
|
+
if (e.key === "Enter" || e.key === " " || e.key === "Spacebar") {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
isOpen.value = !isOpen.value;
|
|
63
|
+
} else if (e.key === "Escape" && isOpen.value) {
|
|
64
|
+
isOpen.value = false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function handleAlphaChange(e) {
|
|
68
|
+
alpha.value = Number(e.target.value) / 100;
|
|
69
|
+
}
|
|
49
70
|
function handleHueChange(e) {
|
|
50
71
|
const hue = Number(e.target.value);
|
|
51
72
|
const { r, g, b } = hsvToRgb(hue, hsv.value.s, hsv.value.v);
|
|
@@ -56,8 +77,8 @@ var ColorPicker = defineComponent({
|
|
|
56
77
|
function handleInputChange(e) {
|
|
57
78
|
const val = e.target.value;
|
|
58
79
|
inputValue.value = val;
|
|
59
|
-
|
|
60
|
-
|
|
80
|
+
const hex = parseColorInput(val);
|
|
81
|
+
if (hex) {
|
|
61
82
|
emit("update:modelValue", hex);
|
|
62
83
|
emit("change", hex);
|
|
63
84
|
}
|
|
@@ -66,6 +87,12 @@ var ColorPicker = defineComponent({
|
|
|
66
87
|
emit("update:modelValue", color);
|
|
67
88
|
emit("change", color);
|
|
68
89
|
}
|
|
90
|
+
function handlePresetKeydown(e, color) {
|
|
91
|
+
if (e.key === "Enter" || e.key === " " || e.key === "Spacebar") {
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
handlePresetClick(color);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
69
96
|
function handleClickOutside(e) {
|
|
70
97
|
if (containerRef.value && !containerRef.value.contains(e.target)) {
|
|
71
98
|
closePanel();
|
|
@@ -88,11 +115,15 @@ var ColorPicker = defineComponent({
|
|
|
88
115
|
// Color trigger swatch
|
|
89
116
|
h("div", {
|
|
90
117
|
class: getColorPickerTriggerClasses(props.size, props.disabled),
|
|
91
|
-
style: { backgroundColor:
|
|
118
|
+
style: { backgroundColor: swatchColor.value },
|
|
92
119
|
role: "button",
|
|
93
120
|
"aria-label": "Pick color",
|
|
94
|
-
|
|
95
|
-
|
|
121
|
+
"aria-haspopup": "dialog",
|
|
122
|
+
"aria-expanded": isOpen.value,
|
|
123
|
+
"aria-disabled": props.disabled || void 0,
|
|
124
|
+
tabindex: props.disabled ? -1 : 0,
|
|
125
|
+
onClick: togglePanel,
|
|
126
|
+
onKeydown: handleTriggerKeydown
|
|
96
127
|
}),
|
|
97
128
|
// Panel
|
|
98
129
|
isOpen.value ? h("div", { class: colorPickerPanelClasses }, [
|
|
@@ -113,12 +144,31 @@ var ColorPicker = defineComponent({
|
|
|
113
144
|
onInput: handleHueChange
|
|
114
145
|
})
|
|
115
146
|
]),
|
|
116
|
-
//
|
|
117
|
-
h("div", { class: "mb-2" }, [
|
|
147
|
+
// Alpha slider
|
|
148
|
+
props.showAlpha ? h("div", { class: "mb-2" }, [
|
|
118
149
|
h(
|
|
119
150
|
"label",
|
|
120
151
|
{ class: "block text-xs text-[var(--tiger-text-muted,#6b7280)] mb-1" },
|
|
121
|
-
"
|
|
152
|
+
"Alpha"
|
|
153
|
+
),
|
|
154
|
+
h("input", {
|
|
155
|
+
type: "range",
|
|
156
|
+
min: 0,
|
|
157
|
+
max: 100,
|
|
158
|
+
value: Math.round(alpha.value * 100),
|
|
159
|
+
class: "w-full h-2 rounded-full cursor-pointer accent-[var(--tiger-primary,#2563eb)]",
|
|
160
|
+
"aria-label": "Alpha",
|
|
161
|
+
onInput: handleAlphaChange
|
|
162
|
+
})
|
|
163
|
+
]) : null,
|
|
164
|
+
// Color value input (rendered in the selected format)
|
|
165
|
+
h("div", { class: "mb-2" }, [
|
|
166
|
+
h(
|
|
167
|
+
"label",
|
|
168
|
+
{
|
|
169
|
+
class: "block text-xs text-[var(--tiger-text-muted,#6b7280)] mb-1 uppercase"
|
|
170
|
+
},
|
|
171
|
+
props.format
|
|
122
172
|
),
|
|
123
173
|
h("input", {
|
|
124
174
|
type: "text",
|
|
@@ -132,13 +182,13 @@ var ColorPicker = defineComponent({
|
|
|
132
182
|
h("div", { class: "flex items-center gap-2 mb-2" }, [
|
|
133
183
|
h("div", {
|
|
134
184
|
class: "w-8 h-8 rounded border border-[var(--tiger-border,#d1d5db)]",
|
|
135
|
-
style: { backgroundColor:
|
|
185
|
+
style: { backgroundColor: swatchColor.value },
|
|
136
186
|
"aria-label": "Color preview"
|
|
137
187
|
}),
|
|
138
188
|
h(
|
|
139
189
|
"span",
|
|
140
190
|
{ class: "text-xs font-mono text-[var(--tiger-text,#111827)]" },
|
|
141
|
-
|
|
191
|
+
displayValue.value
|
|
142
192
|
)
|
|
143
193
|
]),
|
|
144
194
|
// Presets
|
|
@@ -148,8 +198,11 @@ var ColorPicker = defineComponent({
|
|
|
148
198
|
key: color,
|
|
149
199
|
class: colorPickerPresetClasses,
|
|
150
200
|
style: { backgroundColor: color },
|
|
201
|
+
role: "button",
|
|
202
|
+
tabindex: 0,
|
|
151
203
|
"aria-label": `Select ${color}`,
|
|
152
|
-
onClick: () => handlePresetClick(color)
|
|
204
|
+
onClick: () => handlePresetClick(color),
|
|
205
|
+
onKeydown: (e) => handlePresetKeydown(e, color)
|
|
153
206
|
})
|
|
154
207
|
)
|
|
155
208
|
]) : null
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTigerConfig
|
|
3
|
+
} from "./chunk-UOJOJBEU.mjs";
|
|
4
|
+
|
|
1
5
|
// src/components/MarkdownEditor.ts
|
|
2
6
|
import { defineComponent, h, ref, computed, nextTick } from "vue";
|
|
3
7
|
import {
|
|
@@ -17,9 +21,10 @@ import {
|
|
|
17
21
|
markdownEditorToolbarClasses,
|
|
18
22
|
markdownEditorToolbarGroupClasses,
|
|
19
23
|
markdownEditorToolbarSeparatorClasses,
|
|
20
|
-
markdownModeLabels,
|
|
21
24
|
parseMarkdownHeight,
|
|
22
|
-
renderMarkdownToHtml
|
|
25
|
+
renderMarkdownToHtml,
|
|
26
|
+
mergeTigerLocale,
|
|
27
|
+
getMarkdownEditorLabels
|
|
23
28
|
} from "@expcat/tigercat-core";
|
|
24
29
|
var modes = ["edit", "split", "preview"];
|
|
25
30
|
var MarkdownEditor = defineComponent({
|
|
@@ -51,6 +56,8 @@ var MarkdownEditor = defineComponent({
|
|
|
51
56
|
type: Object,
|
|
52
57
|
default: void 0
|
|
53
58
|
},
|
|
59
|
+
locale: { type: Object, default: void 0 },
|
|
60
|
+
labels: { type: Object, default: void 0 },
|
|
54
61
|
className: { type: String, default: void 0 },
|
|
55
62
|
style: {
|
|
56
63
|
type: Object,
|
|
@@ -59,6 +66,7 @@ var MarkdownEditor = defineComponent({
|
|
|
59
66
|
},
|
|
60
67
|
emits: ["update:value", "change", "update:mode", "mode-change"],
|
|
61
68
|
setup(props, { emit, attrs }) {
|
|
69
|
+
const config = useTigerConfig();
|
|
62
70
|
const internalValue = ref(props.defaultValue || "");
|
|
63
71
|
const internalMode = ref(props.defaultMode);
|
|
64
72
|
const textareaRef = ref(null);
|
|
@@ -76,6 +84,13 @@ var MarkdownEditor = defineComponent({
|
|
|
76
84
|
const showPreview = computed(
|
|
77
85
|
() => currentMode.value === "preview" || currentMode.value === "split"
|
|
78
86
|
);
|
|
87
|
+
const mergedLocale = computed(() => mergeTigerLocale(config.value.locale, props.locale));
|
|
88
|
+
const labels = computed(() => getMarkdownEditorLabels(mergedLocale.value, props.labels));
|
|
89
|
+
const modeLabels = computed(() => ({
|
|
90
|
+
edit: labels.value.editModeLabel,
|
|
91
|
+
split: labels.value.splitModeLabel,
|
|
92
|
+
preview: labels.value.previewModeLabel
|
|
93
|
+
}));
|
|
79
94
|
const containerClasses = computed(
|
|
80
95
|
() => classNames(
|
|
81
96
|
getMarkdownContainerClasses(props.disabled, props.className),
|
|
@@ -147,7 +162,7 @@ var MarkdownEditor = defineComponent({
|
|
|
147
162
|
{
|
|
148
163
|
class: markdownEditorToolbarGroupClasses,
|
|
149
164
|
role: "toolbar",
|
|
150
|
-
"aria-label":
|
|
165
|
+
"aria-label": labels.value.formattingToolbarAriaLabel
|
|
151
166
|
},
|
|
152
167
|
toolbarItems.value.map((item, index) => {
|
|
153
168
|
if (isMarkdownToolbarSeparator(item)) {
|
|
@@ -178,7 +193,7 @@ var MarkdownEditor = defineComponent({
|
|
|
178
193
|
{
|
|
179
194
|
class: markdownEditorToolbarGroupClasses,
|
|
180
195
|
role: "toolbar",
|
|
181
|
-
"aria-label":
|
|
196
|
+
"aria-label": labels.value.modeToolbarAriaLabel
|
|
182
197
|
},
|
|
183
198
|
modes.map(
|
|
184
199
|
(item) => h(
|
|
@@ -187,12 +202,12 @@ var MarkdownEditor = defineComponent({
|
|
|
187
202
|
key: item,
|
|
188
203
|
type: "button",
|
|
189
204
|
class: getMarkdownToolbarButtonClasses(currentMode.value === item),
|
|
190
|
-
"aria-label":
|
|
205
|
+
"aria-label": modeLabels.value[item],
|
|
191
206
|
"aria-pressed": currentMode.value === item,
|
|
192
207
|
disabled: props.disabled,
|
|
193
208
|
onClick: () => commitMode(item)
|
|
194
209
|
},
|
|
195
|
-
|
|
210
|
+
modeLabels.value[item]
|
|
196
211
|
)
|
|
197
212
|
)
|
|
198
213
|
) : null
|
|
@@ -207,7 +222,7 @@ var MarkdownEditor = defineComponent({
|
|
|
207
222
|
readonly: props.readOnly || props.disabled,
|
|
208
223
|
disabled: props.disabled,
|
|
209
224
|
spellcheck: true,
|
|
210
|
-
"aria-label":
|
|
225
|
+
"aria-label": labels.value.editorAriaLabel,
|
|
211
226
|
"aria-multiline": true
|
|
212
227
|
}) : null;
|
|
213
228
|
const previewNode = showPreview.value ? h(
|
|
@@ -219,7 +234,7 @@ var MarkdownEditor = defineComponent({
|
|
|
219
234
|
!currentValue.value ? markdownEditorEmptyPreviewClasses : void 0
|
|
220
235
|
),
|
|
221
236
|
role: "region",
|
|
222
|
-
"aria-label":
|
|
237
|
+
"aria-label": labels.value.previewAriaLabel,
|
|
223
238
|
...currentValue.value ? { innerHTML: previewHtml.value } : {}
|
|
224
239
|
},
|
|
225
240
|
currentValue.value ? void 0 : props.placeholder
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-2TNZ4JNT.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useTigerConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UOJOJBEU.mjs";
|
|
7
7
|
|
|
8
8
|
// src/components/DatePicker.ts
|
|
9
9
|
import { defineComponent, computed, ref, nextTick, h, watch, onBeforeUnmount } from "vue";
|
|
@@ -276,9 +276,6 @@ var DatePicker = defineComponent({
|
|
|
276
276
|
if (startText && endText) return `${startText} - ${endText}`;
|
|
277
277
|
return startText ? `${startText} - ` : ` - ${endText}`;
|
|
278
278
|
});
|
|
279
|
-
const placeholderText = computed(
|
|
280
|
-
() => props.placeholder ?? (props.range ? "Select date range" : "Select date")
|
|
281
|
-
);
|
|
282
279
|
const showClearButton = computed(() => {
|
|
283
280
|
if (!props.clearable || props.disabled || props.readonly) return false;
|
|
284
281
|
if (!isRangeMode.value) return selectedDate.value !== null;
|
|
@@ -293,6 +290,9 @@ var DatePicker = defineComponent({
|
|
|
293
290
|
const previousMonthIcon = computed(() => isRtl.value ? ChevronRightIcon : ChevronLeftIcon);
|
|
294
291
|
const nextMonthIcon = computed(() => isRtl.value ? ChevronLeftIcon : ChevronRightIcon);
|
|
295
292
|
const labels = computed(() => getDatePickerLabels(mergedLocale.value, props.labels));
|
|
293
|
+
const placeholderText = computed(
|
|
294
|
+
() => props.placeholder ?? (props.range ? labels.value.rangePlaceholder : labels.value.placeholder)
|
|
295
|
+
);
|
|
296
296
|
const mobileDate = computed(() => {
|
|
297
297
|
if (!isRangeMode.value) return selectedDate.value ?? normalizeDate(/* @__PURE__ */ new Date());
|
|
298
298
|
const [start, end] = selectedRange.value;
|
|
@@ -656,7 +656,7 @@ var DatePicker = defineComponent({
|
|
|
656
656
|
{
|
|
657
657
|
class: datePickerMobileWheelSelectClasses,
|
|
658
658
|
value: mobileDate.value.getFullYear(),
|
|
659
|
-
"aria-label":
|
|
659
|
+
"aria-label": labels.value.year,
|
|
660
660
|
onChange: (event) => updateMobileDate("year", Number(event.target.value))
|
|
661
661
|
},
|
|
662
662
|
mobileYears.value.map((year) => h("option", { value: year }, year))
|
|
@@ -666,7 +666,7 @@ var DatePicker = defineComponent({
|
|
|
666
666
|
{
|
|
667
667
|
class: datePickerMobileWheelSelectClasses,
|
|
668
668
|
value: mobileDate.value.getMonth(),
|
|
669
|
-
"aria-label":
|
|
669
|
+
"aria-label": labels.value.month,
|
|
670
670
|
onChange: (event) => updateMobileDate("month", Number(event.target.value))
|
|
671
671
|
},
|
|
672
672
|
Array.from(
|
|
@@ -679,7 +679,7 @@ var DatePicker = defineComponent({
|
|
|
679
679
|
{
|
|
680
680
|
class: datePickerMobileWheelSelectClasses,
|
|
681
681
|
value: mobileDate.value.getDate(),
|
|
682
|
-
"aria-label":
|
|
682
|
+
"aria-label": labels.value.day,
|
|
683
683
|
onChange: (event) => updateMobileDate("day", Number(event.target.value))
|
|
684
684
|
},
|
|
685
685
|
mobileDays.value.map((day) => h("option", { value: day }, day))
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-MI6TL3CQ.mjs";
|
|
16
16
|
import {
|
|
17
17
|
ChartLegend
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-V443QIJM.mjs";
|
|
19
19
|
import {
|
|
20
20
|
ChartSeries
|
|
21
21
|
} from "./chunk-2ZUEXCVJ.mjs";
|
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
resolveSeriesData,
|
|
41
41
|
defaultSeriesXYTooltipFormatter
|
|
42
42
|
} from "@expcat/tigercat-core";
|
|
43
|
+
var DEFAULT_CARTESIAN_PADDING = { top: 24, right: 24, bottom: 52, left: 52 };
|
|
43
44
|
var LineChart = defineComponent({
|
|
44
45
|
name: "TigerLineChart",
|
|
45
46
|
props: {
|
|
@@ -53,8 +54,9 @@ var LineChart = defineComponent({
|
|
|
53
54
|
},
|
|
54
55
|
padding: {
|
|
55
56
|
type: [Number, Object],
|
|
56
|
-
default:
|
|
57
|
+
default: () => DEFAULT_CARTESIAN_PADDING
|
|
57
58
|
},
|
|
59
|
+
responsive: { type: Boolean, default: false },
|
|
58
60
|
data: {
|
|
59
61
|
type: Array
|
|
60
62
|
},
|
|
@@ -415,6 +417,7 @@ var LineChart = defineComponent({
|
|
|
415
417
|
width: props.width,
|
|
416
418
|
height: props.height,
|
|
417
419
|
padding: props.padding,
|
|
420
|
+
responsive: props.responsive,
|
|
418
421
|
title: props.title,
|
|
419
422
|
desc: props.desc,
|
|
420
423
|
className: classNames(props.className)
|
|
@@ -130,7 +130,7 @@ var NotificationContainer = /* @__PURE__ */ defineComponent({
|
|
|
130
130
|
e.stopPropagation();
|
|
131
131
|
props.onClose?.(notification.id);
|
|
132
132
|
},
|
|
133
|
-
"aria-label": NOTIFICATION_CLOSE_ARIA_LABEL,
|
|
133
|
+
"aria-label": notification.closeAriaLabel ?? NOTIFICATION_CLOSE_ARIA_LABEL,
|
|
134
134
|
type: "button"
|
|
135
135
|
},
|
|
136
136
|
createStatusIcon(notificationCloseIconPath, notificationCloseIconClasses, {
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTigerConfig
|
|
3
|
+
} from "./chunk-UOJOJBEU.mjs";
|
|
4
|
+
|
|
1
5
|
// src/components/AvatarGroup.ts
|
|
2
|
-
import { defineComponent, h, provide, reactive, watch } from "vue";
|
|
6
|
+
import { computed, defineComponent, h, provide, reactive, watch } from "vue";
|
|
3
7
|
import {
|
|
4
8
|
coerceClassValue,
|
|
5
9
|
getAvatarGroupClasses,
|
|
6
10
|
getAvatarGroupItemClasses,
|
|
11
|
+
getAvatarGroupLabels,
|
|
7
12
|
getAvatarGroupOverflowClasses,
|
|
8
13
|
getAvatarGroupOverflowLabel,
|
|
9
14
|
getAvatarGroupOverflowText,
|
|
10
|
-
getVisibleGroupItems
|
|
15
|
+
getVisibleGroupItems,
|
|
16
|
+
mergeTigerLocale
|
|
11
17
|
} from "@expcat/tigercat-core";
|
|
12
18
|
var AVATAR_GROUP_INJECTION_KEY = /* @__PURE__ */ Symbol("TigerAvatarGroup");
|
|
13
19
|
var AvatarGroup = defineComponent({
|
|
@@ -25,9 +31,22 @@ var AvatarGroup = defineComponent({
|
|
|
25
31
|
className: {
|
|
26
32
|
type: String,
|
|
27
33
|
default: void 0
|
|
34
|
+
},
|
|
35
|
+
/** Locale overrides merged on top of ConfigProvider locale */
|
|
36
|
+
locale: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default: void 0
|
|
39
|
+
},
|
|
40
|
+
/** Text/aria label overrides */
|
|
41
|
+
labels: {
|
|
42
|
+
type: Object,
|
|
43
|
+
default: void 0
|
|
28
44
|
}
|
|
29
45
|
},
|
|
30
46
|
setup(props, { slots, attrs }) {
|
|
47
|
+
const config = useTigerConfig();
|
|
48
|
+
const mergedLocale = computed(() => mergeTigerLocale(config.value.locale, props.locale));
|
|
49
|
+
const labels = computed(() => getAvatarGroupLabels(mergedLocale.value, props.labels));
|
|
31
50
|
const groupContext = reactive({
|
|
32
51
|
size: props.size,
|
|
33
52
|
itemClass: getAvatarGroupItemClasses()
|
|
@@ -50,10 +69,10 @@ var AvatarGroup = defineComponent({
|
|
|
50
69
|
return h(
|
|
51
70
|
"div",
|
|
52
71
|
{
|
|
53
|
-
...attrs,
|
|
54
|
-
class: getAvatarGroupClasses(props.className, coerceClassValue(attrsClass)),
|
|
55
72
|
role: "group",
|
|
56
|
-
"aria-label":
|
|
73
|
+
"aria-label": labels.value.ariaLabel,
|
|
74
|
+
...attrs,
|
|
75
|
+
class: getAvatarGroupClasses(props.className, coerceClassValue(attrsClass))
|
|
57
76
|
},
|
|
58
77
|
[
|
|
59
78
|
...visibleItems,
|
|
@@ -61,7 +80,10 @@ var AvatarGroup = defineComponent({
|
|
|
61
80
|
"span",
|
|
62
81
|
{
|
|
63
82
|
class: getAvatarGroupOverflowClasses(props.size ?? "md"),
|
|
64
|
-
"aria-label": getAvatarGroupOverflowLabel(
|
|
83
|
+
"aria-label": getAvatarGroupOverflowLabel(
|
|
84
|
+
overflowCount,
|
|
85
|
+
labels.value.overflowAriaLabel
|
|
86
|
+
)
|
|
65
87
|
},
|
|
66
88
|
getAvatarGroupOverflowText(overflowCount)
|
|
67
89
|
) : null
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-MI6TL3CQ.mjs";
|
|
16
16
|
import {
|
|
17
17
|
ChartLegend
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-V443QIJM.mjs";
|
|
19
19
|
import {
|
|
20
20
|
ChartSeries
|
|
21
21
|
} from "./chunk-2ZUEXCVJ.mjs";
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
resolveSeriesData,
|
|
42
42
|
defaultSeriesXYTooltipFormatter
|
|
43
43
|
} from "@expcat/tigercat-core";
|
|
44
|
+
var DEFAULT_CARTESIAN_PADDING = { top: 24, right: 24, bottom: 52, left: 52 };
|
|
44
45
|
var AreaChart = defineComponent({
|
|
45
46
|
name: "TigerAreaChart",
|
|
46
47
|
props: {
|
|
@@ -54,8 +55,9 @@ var AreaChart = defineComponent({
|
|
|
54
55
|
},
|
|
55
56
|
padding: {
|
|
56
57
|
type: [Number, Object],
|
|
57
|
-
default:
|
|
58
|
+
default: () => DEFAULT_CARTESIAN_PADDING
|
|
58
59
|
},
|
|
60
|
+
responsive: { type: Boolean, default: false },
|
|
59
61
|
data: {
|
|
60
62
|
type: Array
|
|
61
63
|
},
|
|
@@ -449,6 +451,7 @@ var AreaChart = defineComponent({
|
|
|
449
451
|
width: props.width,
|
|
450
452
|
height: props.height,
|
|
451
453
|
padding: props.padding,
|
|
454
|
+
responsive: props.responsive,
|
|
452
455
|
title: props.title,
|
|
453
456
|
desc: props.desc,
|
|
454
457
|
className: classNames(props.className)
|
|
@@ -15,10 +15,13 @@ import {
|
|
|
15
15
|
} from "./chunk-MI6TL3CQ.mjs";
|
|
16
16
|
import {
|
|
17
17
|
ChartLegend
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-V443QIJM.mjs";
|
|
19
19
|
import {
|
|
20
20
|
ChartSeries
|
|
21
21
|
} from "./chunk-2ZUEXCVJ.mjs";
|
|
22
|
+
import {
|
|
23
|
+
useTigerConfig
|
|
24
|
+
} from "./chunk-UOJOJBEU.mjs";
|
|
22
25
|
|
|
23
26
|
// src/components/ScatterChart.ts
|
|
24
27
|
import { defineComponent, computed, h, onMounted, ref, useId } from "vue";
|
|
@@ -37,7 +40,9 @@ import {
|
|
|
37
40
|
SCATTER_ENTRANCE_CLASS,
|
|
38
41
|
resolveChartPalette,
|
|
39
42
|
buildChartLegendItems,
|
|
40
|
-
resolveChartTooltipContent
|
|
43
|
+
resolveChartTooltipContent,
|
|
44
|
+
mergeTigerLocale,
|
|
45
|
+
getChartLabels
|
|
41
46
|
} from "@expcat/tigercat-core";
|
|
42
47
|
var ScatterChart = defineComponent({
|
|
43
48
|
name: "TigerScatterChart",
|
|
@@ -48,6 +53,7 @@ var ScatterChart = defineComponent({
|
|
|
48
53
|
type: [Number, Object],
|
|
49
54
|
default: 24
|
|
50
55
|
},
|
|
56
|
+
responsive: { type: Boolean, default: false },
|
|
51
57
|
data: {
|
|
52
58
|
type: Array,
|
|
53
59
|
required: true
|
|
@@ -123,12 +129,17 @@ var ScatterChart = defineComponent({
|
|
|
123
129
|
colors: { type: Array },
|
|
124
130
|
title: { type: String },
|
|
125
131
|
desc: { type: String },
|
|
132
|
+
locale: { type: Object, default: void 0 },
|
|
133
|
+
labels: { type: Object, default: void 0 },
|
|
126
134
|
className: { type: String }
|
|
127
135
|
},
|
|
128
136
|
emits: ["update:hoveredIndex", "update:selectedIndex", "point-click", "point-hover"],
|
|
129
137
|
setup(props, { emit }) {
|
|
138
|
+
const config = useTigerConfig();
|
|
130
139
|
const gradientPrefix = getStableChartGradientPrefix("scatter", useId());
|
|
131
140
|
const mounted = ref(false);
|
|
141
|
+
const mergedLocale = computed(() => mergeTigerLocale(config.value.locale, props.locale));
|
|
142
|
+
const labels = computed(() => getChartLabels(mergedLocale.value, props.labels));
|
|
132
143
|
onMounted(() => {
|
|
133
144
|
if (props.animated) mounted.value = true;
|
|
134
145
|
});
|
|
@@ -238,6 +249,7 @@ var ScatterChart = defineComponent({
|
|
|
238
249
|
width: props.width,
|
|
239
250
|
height: props.height,
|
|
240
251
|
padding: props.padding,
|
|
252
|
+
responsive: props.responsive,
|
|
241
253
|
title: props.title,
|
|
242
254
|
desc: props.desc,
|
|
243
255
|
className: classNames(props.className)
|
|
@@ -301,7 +313,7 @@ var ScatterChart = defineComponent({
|
|
|
301
313
|
style: styleStr || void 0,
|
|
302
314
|
tabindex: props.selectable ? 0 : void 0,
|
|
303
315
|
role: props.selectable ? "button" : "img",
|
|
304
|
-
"aria-label": point.datum.label ??
|
|
316
|
+
"aria-label": point.datum.label ?? labels.value.pointAriaLabel.replace("{index}", String(index + 1)).replace("{x}", String(point.datum.x)).replace("{y}", String(point.datum.y)),
|
|
305
317
|
"data-point-index": index,
|
|
306
318
|
onMouseenter: (e) => handleMouseEnter(index, e),
|
|
307
319
|
onMousemove: handleMouseMove,
|
|
@@ -346,6 +358,7 @@ var ScatterChart = defineComponent({
|
|
|
346
358
|
position: props.legendPosition,
|
|
347
359
|
markerSize: props.legendMarkerSize,
|
|
348
360
|
gap: props.legendGap,
|
|
361
|
+
ariaLabel: labels.value.legendAriaLabel,
|
|
349
362
|
interactive: props.hoverable || props.selectable,
|
|
350
363
|
onItemClick: handleLegendClick,
|
|
351
364
|
onItemHover: handleLegendHover,
|