@vespera-ui/vue 0.4.0 → 0.5.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/index.cjs +137 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +112 -1
- package/dist/index.d.ts +112 -1
- package/dist/index.js +134 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1048,5 +1048,116 @@ declare const StatCard: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
1048
1048
|
spark: number[];
|
|
1049
1049
|
sparkColor: string;
|
|
1050
1050
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
1051
|
+
declare const NumberStepper: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
1052
|
+
modelValue: {
|
|
1053
|
+
type: NumberConstructor;
|
|
1054
|
+
default: number;
|
|
1055
|
+
};
|
|
1056
|
+
min: {
|
|
1057
|
+
type: NumberConstructor;
|
|
1058
|
+
default: undefined;
|
|
1059
|
+
};
|
|
1060
|
+
max: {
|
|
1061
|
+
type: NumberConstructor;
|
|
1062
|
+
default: undefined;
|
|
1063
|
+
};
|
|
1064
|
+
step: {
|
|
1065
|
+
type: NumberConstructor;
|
|
1066
|
+
default: number;
|
|
1067
|
+
};
|
|
1068
|
+
unit: {
|
|
1069
|
+
type: StringConstructor;
|
|
1070
|
+
default: undefined;
|
|
1071
|
+
};
|
|
1072
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
1073
|
+
[key: string]: any;
|
|
1074
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
1075
|
+
modelValue: {
|
|
1076
|
+
type: NumberConstructor;
|
|
1077
|
+
default: number;
|
|
1078
|
+
};
|
|
1079
|
+
min: {
|
|
1080
|
+
type: NumberConstructor;
|
|
1081
|
+
default: undefined;
|
|
1082
|
+
};
|
|
1083
|
+
max: {
|
|
1084
|
+
type: NumberConstructor;
|
|
1085
|
+
default: undefined;
|
|
1086
|
+
};
|
|
1087
|
+
step: {
|
|
1088
|
+
type: NumberConstructor;
|
|
1089
|
+
default: number;
|
|
1090
|
+
};
|
|
1091
|
+
unit: {
|
|
1092
|
+
type: StringConstructor;
|
|
1093
|
+
default: undefined;
|
|
1094
|
+
};
|
|
1095
|
+
}>> & Readonly<{
|
|
1096
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1097
|
+
}>, {
|
|
1098
|
+
modelValue: number;
|
|
1099
|
+
min: number;
|
|
1100
|
+
max: number;
|
|
1101
|
+
step: number;
|
|
1102
|
+
unit: string;
|
|
1103
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
1104
|
+
declare const CopyButton: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
1105
|
+
text: {
|
|
1106
|
+
type: StringConstructor;
|
|
1107
|
+
required: true;
|
|
1108
|
+
};
|
|
1109
|
+
label: {
|
|
1110
|
+
type: StringConstructor;
|
|
1111
|
+
default: string;
|
|
1112
|
+
};
|
|
1113
|
+
size: {
|
|
1114
|
+
type: PropType<"sm">;
|
|
1115
|
+
default: string;
|
|
1116
|
+
};
|
|
1117
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
1118
|
+
[key: string]: any;
|
|
1119
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
1120
|
+
text: {
|
|
1121
|
+
type: StringConstructor;
|
|
1122
|
+
required: true;
|
|
1123
|
+
};
|
|
1124
|
+
label: {
|
|
1125
|
+
type: StringConstructor;
|
|
1126
|
+
default: string;
|
|
1127
|
+
};
|
|
1128
|
+
size: {
|
|
1129
|
+
type: PropType<"sm">;
|
|
1130
|
+
default: string;
|
|
1131
|
+
};
|
|
1132
|
+
}>> & Readonly<{}>, {
|
|
1133
|
+
size: "sm";
|
|
1134
|
+
label: string;
|
|
1135
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
1136
|
+
declare const InlineEdit: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
1137
|
+
value: {
|
|
1138
|
+
type: StringConstructor;
|
|
1139
|
+
default: string;
|
|
1140
|
+
};
|
|
1141
|
+
placeholder: {
|
|
1142
|
+
type: StringConstructor;
|
|
1143
|
+
default: string;
|
|
1144
|
+
};
|
|
1145
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
1146
|
+
[key: string]: any;
|
|
1147
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "save"[], "save", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
1148
|
+
value: {
|
|
1149
|
+
type: StringConstructor;
|
|
1150
|
+
default: string;
|
|
1151
|
+
};
|
|
1152
|
+
placeholder: {
|
|
1153
|
+
type: StringConstructor;
|
|
1154
|
+
default: string;
|
|
1155
|
+
};
|
|
1156
|
+
}>> & Readonly<{
|
|
1157
|
+
onSave?: ((...args: any[]) => any) | undefined;
|
|
1158
|
+
}>, {
|
|
1159
|
+
value: string;
|
|
1160
|
+
placeholder: string;
|
|
1161
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
1051
1162
|
|
|
1052
|
-
export { Accordion, type AccordionItem, Alert, type AlertTone, Avatar, AvatarGroup, Badge, type BadgeTone, Banner, Breadcrumb, Button, type ButtonVariant, Card, CardHead, Checkbox, CircularProgress, DescriptionList, Divider, Donut, type DonutDatum, EmptyState, Field, IconButton, Input, Kbd, NativeSelect, Pagination, type Person, Progress, Radio, RadioGroup, Segmented, type SelectOption, Skeleton, Slider, Sparkline, Spinner, Stat, StatCard, Stepper, Switch, type TabItem, Tabs, Tag, Textarea, Timeline, type TimelineItem, smoothPath };
|
|
1163
|
+
export { Accordion, type AccordionItem, Alert, type AlertTone, Avatar, AvatarGroup, Badge, type BadgeTone, Banner, Breadcrumb, Button, type ButtonVariant, Card, CardHead, Checkbox, CircularProgress, CopyButton, DescriptionList, Divider, Donut, type DonutDatum, EmptyState, Field, IconButton, InlineEdit, Input, Kbd, NativeSelect, NumberStepper, Pagination, type Person, Progress, Radio, RadioGroup, Segmented, type SelectOption, Skeleton, Slider, Sparkline, Spinner, Stat, StatCard, Stepper, Switch, type TabItem, Tabs, Tag, Textarea, Timeline, type TimelineItem, smoothPath };
|
package/dist/index.d.ts
CHANGED
|
@@ -1048,5 +1048,116 @@ declare const StatCard: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
1048
1048
|
spark: number[];
|
|
1049
1049
|
sparkColor: string;
|
|
1050
1050
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
1051
|
+
declare const NumberStepper: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
1052
|
+
modelValue: {
|
|
1053
|
+
type: NumberConstructor;
|
|
1054
|
+
default: number;
|
|
1055
|
+
};
|
|
1056
|
+
min: {
|
|
1057
|
+
type: NumberConstructor;
|
|
1058
|
+
default: undefined;
|
|
1059
|
+
};
|
|
1060
|
+
max: {
|
|
1061
|
+
type: NumberConstructor;
|
|
1062
|
+
default: undefined;
|
|
1063
|
+
};
|
|
1064
|
+
step: {
|
|
1065
|
+
type: NumberConstructor;
|
|
1066
|
+
default: number;
|
|
1067
|
+
};
|
|
1068
|
+
unit: {
|
|
1069
|
+
type: StringConstructor;
|
|
1070
|
+
default: undefined;
|
|
1071
|
+
};
|
|
1072
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
1073
|
+
[key: string]: any;
|
|
1074
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
1075
|
+
modelValue: {
|
|
1076
|
+
type: NumberConstructor;
|
|
1077
|
+
default: number;
|
|
1078
|
+
};
|
|
1079
|
+
min: {
|
|
1080
|
+
type: NumberConstructor;
|
|
1081
|
+
default: undefined;
|
|
1082
|
+
};
|
|
1083
|
+
max: {
|
|
1084
|
+
type: NumberConstructor;
|
|
1085
|
+
default: undefined;
|
|
1086
|
+
};
|
|
1087
|
+
step: {
|
|
1088
|
+
type: NumberConstructor;
|
|
1089
|
+
default: number;
|
|
1090
|
+
};
|
|
1091
|
+
unit: {
|
|
1092
|
+
type: StringConstructor;
|
|
1093
|
+
default: undefined;
|
|
1094
|
+
};
|
|
1095
|
+
}>> & Readonly<{
|
|
1096
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1097
|
+
}>, {
|
|
1098
|
+
modelValue: number;
|
|
1099
|
+
min: number;
|
|
1100
|
+
max: number;
|
|
1101
|
+
step: number;
|
|
1102
|
+
unit: string;
|
|
1103
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
1104
|
+
declare const CopyButton: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
1105
|
+
text: {
|
|
1106
|
+
type: StringConstructor;
|
|
1107
|
+
required: true;
|
|
1108
|
+
};
|
|
1109
|
+
label: {
|
|
1110
|
+
type: StringConstructor;
|
|
1111
|
+
default: string;
|
|
1112
|
+
};
|
|
1113
|
+
size: {
|
|
1114
|
+
type: PropType<"sm">;
|
|
1115
|
+
default: string;
|
|
1116
|
+
};
|
|
1117
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
1118
|
+
[key: string]: any;
|
|
1119
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
1120
|
+
text: {
|
|
1121
|
+
type: StringConstructor;
|
|
1122
|
+
required: true;
|
|
1123
|
+
};
|
|
1124
|
+
label: {
|
|
1125
|
+
type: StringConstructor;
|
|
1126
|
+
default: string;
|
|
1127
|
+
};
|
|
1128
|
+
size: {
|
|
1129
|
+
type: PropType<"sm">;
|
|
1130
|
+
default: string;
|
|
1131
|
+
};
|
|
1132
|
+
}>> & Readonly<{}>, {
|
|
1133
|
+
size: "sm";
|
|
1134
|
+
label: string;
|
|
1135
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
1136
|
+
declare const InlineEdit: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
1137
|
+
value: {
|
|
1138
|
+
type: StringConstructor;
|
|
1139
|
+
default: string;
|
|
1140
|
+
};
|
|
1141
|
+
placeholder: {
|
|
1142
|
+
type: StringConstructor;
|
|
1143
|
+
default: string;
|
|
1144
|
+
};
|
|
1145
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
1146
|
+
[key: string]: any;
|
|
1147
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "save"[], "save", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
1148
|
+
value: {
|
|
1149
|
+
type: StringConstructor;
|
|
1150
|
+
default: string;
|
|
1151
|
+
};
|
|
1152
|
+
placeholder: {
|
|
1153
|
+
type: StringConstructor;
|
|
1154
|
+
default: string;
|
|
1155
|
+
};
|
|
1156
|
+
}>> & Readonly<{
|
|
1157
|
+
onSave?: ((...args: any[]) => any) | undefined;
|
|
1158
|
+
}>, {
|
|
1159
|
+
value: string;
|
|
1160
|
+
placeholder: string;
|
|
1161
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
1051
1162
|
|
|
1052
|
-
export { Accordion, type AccordionItem, Alert, type AlertTone, Avatar, AvatarGroup, Badge, type BadgeTone, Banner, Breadcrumb, Button, type ButtonVariant, Card, CardHead, Checkbox, CircularProgress, DescriptionList, Divider, Donut, type DonutDatum, EmptyState, Field, IconButton, Input, Kbd, NativeSelect, Pagination, type Person, Progress, Radio, RadioGroup, Segmented, type SelectOption, Skeleton, Slider, Sparkline, Spinner, Stat, StatCard, Stepper, Switch, type TabItem, Tabs, Tag, Textarea, Timeline, type TimelineItem, smoothPath };
|
|
1163
|
+
export { Accordion, type AccordionItem, Alert, type AlertTone, Avatar, AvatarGroup, Badge, type BadgeTone, Banner, Breadcrumb, Button, type ButtonVariant, Card, CardHead, Checkbox, CircularProgress, CopyButton, DescriptionList, Divider, Donut, type DonutDatum, EmptyState, Field, IconButton, InlineEdit, Input, Kbd, NativeSelect, NumberStepper, Pagination, type Person, Progress, Radio, RadioGroup, Segmented, type SelectOption, Skeleton, Slider, Sparkline, Spinner, Stat, StatCard, Stepper, Switch, type TabItem, Tabs, Tag, Textarea, Timeline, type TimelineItem, smoothPath };
|
package/dist/index.js
CHANGED
|
@@ -1208,6 +1208,137 @@ var StatCard = defineComponent({
|
|
|
1208
1208
|
);
|
|
1209
1209
|
}
|
|
1210
1210
|
});
|
|
1211
|
+
var ICON_CHECK = "M20 6L9 17l-5-5";
|
|
1212
|
+
var ICON_DOC = "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8zM14 2v6h6";
|
|
1213
|
+
var ICON_PENCIL = "M12 20h9M16.5 3.5a2.12 2.12 0 013 3L7 19l-4 1 1-4z";
|
|
1214
|
+
var NumberStepper = defineComponent({
|
|
1215
|
+
name: "VspNumberStepper",
|
|
1216
|
+
props: {
|
|
1217
|
+
modelValue: { type: Number, default: 0 },
|
|
1218
|
+
min: { type: Number, default: void 0 },
|
|
1219
|
+
max: { type: Number, default: void 0 },
|
|
1220
|
+
step: { type: Number, default: 1 },
|
|
1221
|
+
unit: { type: String, default: void 0 }
|
|
1222
|
+
},
|
|
1223
|
+
emits: ["update:modelValue"],
|
|
1224
|
+
setup(props, { emit }) {
|
|
1225
|
+
const set = (v) => {
|
|
1226
|
+
let n = v;
|
|
1227
|
+
if (props.min != null && n < props.min) n = props.min;
|
|
1228
|
+
if (props.max != null && n > props.max) n = props.max;
|
|
1229
|
+
emit("update:modelValue", n);
|
|
1230
|
+
};
|
|
1231
|
+
return () => h("div", { class: "ui-stepper" }, [
|
|
1232
|
+
h(
|
|
1233
|
+
"button",
|
|
1234
|
+
{
|
|
1235
|
+
type: "button",
|
|
1236
|
+
"aria-label": "Decrease",
|
|
1237
|
+
disabled: props.min != null && props.modelValue <= props.min,
|
|
1238
|
+
onClick: () => set(props.modelValue - props.step)
|
|
1239
|
+
},
|
|
1240
|
+
"\u2212"
|
|
1241
|
+
),
|
|
1242
|
+
h("span", { class: "val" }, [
|
|
1243
|
+
props.modelValue,
|
|
1244
|
+
props.unit ? h("i", null, props.unit) : null
|
|
1245
|
+
]),
|
|
1246
|
+
h(
|
|
1247
|
+
"button",
|
|
1248
|
+
{
|
|
1249
|
+
type: "button",
|
|
1250
|
+
"aria-label": "Increase",
|
|
1251
|
+
disabled: props.max != null && props.modelValue >= props.max,
|
|
1252
|
+
onClick: () => set(props.modelValue + props.step)
|
|
1253
|
+
},
|
|
1254
|
+
"+"
|
|
1255
|
+
)
|
|
1256
|
+
]);
|
|
1257
|
+
}
|
|
1258
|
+
});
|
|
1259
|
+
var CopyButton = defineComponent({
|
|
1260
|
+
name: "VspCopyButton",
|
|
1261
|
+
props: {
|
|
1262
|
+
text: { type: String, required: true },
|
|
1263
|
+
label: { type: String, default: "Copy" },
|
|
1264
|
+
size: { type: String, default: "sm" }
|
|
1265
|
+
},
|
|
1266
|
+
setup(props) {
|
|
1267
|
+
const done = ref(false);
|
|
1268
|
+
const copy = async () => {
|
|
1269
|
+
try {
|
|
1270
|
+
await navigator.clipboard?.writeText(props.text);
|
|
1271
|
+
} catch {
|
|
1272
|
+
}
|
|
1273
|
+
done.value = true;
|
|
1274
|
+
setTimeout(() => done.value = false, 1400);
|
|
1275
|
+
};
|
|
1276
|
+
return () => h(
|
|
1277
|
+
"button",
|
|
1278
|
+
{
|
|
1279
|
+
type: "button",
|
|
1280
|
+
class: cx("btn", "btn-ghost", props.size === "sm" && "btn-sm"),
|
|
1281
|
+
onClick: copy
|
|
1282
|
+
},
|
|
1283
|
+
[
|
|
1284
|
+
done.value ? h("span", { style: { color: "var(--success)", display: "inline-flex" } }, [
|
|
1285
|
+
svgIcon(ICON_CHECK, 15)
|
|
1286
|
+
]) : svgIcon(ICON_DOC, 15),
|
|
1287
|
+
done.value ? "Copied" : props.label
|
|
1288
|
+
]
|
|
1289
|
+
);
|
|
1290
|
+
}
|
|
1291
|
+
});
|
|
1292
|
+
var InlineEdit = defineComponent({
|
|
1293
|
+
name: "VspInlineEdit",
|
|
1294
|
+
props: {
|
|
1295
|
+
value: { type: String, default: "" },
|
|
1296
|
+
placeholder: { type: String, default: "Empty" }
|
|
1297
|
+
},
|
|
1298
|
+
emits: ["save"],
|
|
1299
|
+
setup(props, { emit }) {
|
|
1300
|
+
const editing = ref(false);
|
|
1301
|
+
const draft = ref(props.value);
|
|
1302
|
+
const commit = () => {
|
|
1303
|
+
editing.value = false;
|
|
1304
|
+
if (draft.value !== props.value) emit("save", draft.value);
|
|
1305
|
+
};
|
|
1306
|
+
return () => editing.value ? h("input", {
|
|
1307
|
+
class: "ui-input",
|
|
1308
|
+
value: draft.value,
|
|
1309
|
+
style: { height: "32px", maxWidth: "240px" },
|
|
1310
|
+
onVnodeMounted: (vn) => vn.el?.focus(),
|
|
1311
|
+
onInput: (e) => draft.value = e.target.value,
|
|
1312
|
+
onBlur: commit,
|
|
1313
|
+
onKeydown: (e) => {
|
|
1314
|
+
if (e.key === "Enter") commit();
|
|
1315
|
+
if (e.key === "Escape") {
|
|
1316
|
+
draft.value = props.value;
|
|
1317
|
+
editing.value = false;
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
}) : h(
|
|
1321
|
+
"span",
|
|
1322
|
+
{
|
|
1323
|
+
class: "ui-inline",
|
|
1324
|
+
onClick: () => {
|
|
1325
|
+
draft.value = props.value;
|
|
1326
|
+
editing.value = true;
|
|
1327
|
+
}
|
|
1328
|
+
},
|
|
1329
|
+
[
|
|
1330
|
+
h(
|
|
1331
|
+
"span",
|
|
1332
|
+
{ style: { color: props.value ? "var(--text)" : "var(--text-faint)" } },
|
|
1333
|
+
props.value || props.placeholder
|
|
1334
|
+
),
|
|
1335
|
+
h("span", { class: "pen", style: { display: "inline-flex" } }, [
|
|
1336
|
+
svgIcon(ICON_PENCIL, 14)
|
|
1337
|
+
])
|
|
1338
|
+
]
|
|
1339
|
+
);
|
|
1340
|
+
}
|
|
1341
|
+
});
|
|
1211
1342
|
export {
|
|
1212
1343
|
Accordion,
|
|
1213
1344
|
Alert,
|
|
@@ -1221,15 +1352,18 @@ export {
|
|
|
1221
1352
|
CardHead,
|
|
1222
1353
|
Checkbox,
|
|
1223
1354
|
CircularProgress,
|
|
1355
|
+
CopyButton,
|
|
1224
1356
|
DescriptionList,
|
|
1225
1357
|
Divider,
|
|
1226
1358
|
Donut,
|
|
1227
1359
|
EmptyState,
|
|
1228
1360
|
Field,
|
|
1229
1361
|
IconButton,
|
|
1362
|
+
InlineEdit,
|
|
1230
1363
|
Input,
|
|
1231
1364
|
Kbd,
|
|
1232
1365
|
NativeSelect,
|
|
1366
|
+
NumberStepper,
|
|
1233
1367
|
Pagination,
|
|
1234
1368
|
Progress,
|
|
1235
1369
|
Radio,
|