cisse-vue-ui 0.1.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/README.md +15 -0
- package/dist/BadgeType.vue_vue_type_script_setup_true_lang-CJb63H1I.cjs +145 -0
- package/dist/BadgeType.vue_vue_type_script_setup_true_lang-CJb63H1I.cjs.map +1 -0
- package/dist/BadgeType.vue_vue_type_script_setup_true_lang-CnB5eNEM.js +146 -0
- package/dist/BadgeType.vue_vue_type_script_setup_true_lang-CnB5eNEM.js.map +1 -0
- package/dist/NotificationList.vue_vue_type_script_setup_true_lang-B2hjbMm4.js +351 -0
- package/dist/NotificationList.vue_vue_type_script_setup_true_lang-B2hjbMm4.js.map +1 -0
- package/dist/NotificationList.vue_vue_type_script_setup_true_lang-Ci3zIvrv.cjs +350 -0
- package/dist/NotificationList.vue_vue_type_script_setup_true_lang-Ci3zIvrv.cjs.map +1 -0
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-Be73hShP.cjs +234 -0
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-Be73hShP.cjs.map +1 -0
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-DjT2qdcp.js +235 -0
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-DjT2qdcp.js.map +1 -0
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-BHskhVhK.js +540 -0
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-BHskhVhK.js.map +1 -0
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-CojbKn7E.cjs +539 -0
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-CojbKn7E.cjs.map +1 -0
- package/dist/components/core/AutocompleteComponent.vue.d.ts +19 -0
- package/dist/components/core/CardComponent.vue.d.ts +24 -0
- package/dist/components/core/MenuItem.vue.d.ts +6 -0
- package/dist/components/core/StatusBadge.vue.d.ts +21 -0
- package/dist/components/core/TableAction.vue.d.ts +8 -0
- package/dist/components/core/TableComponent.vue.d.ts +40 -0
- package/dist/components/core/index.cjs +11 -0
- package/dist/components/core/index.cjs.map +1 -0
- package/dist/components/core/index.d.ts +6 -0
- package/dist/components/core/index.js +11 -0
- package/dist/components/core/index.js.map +1 -0
- package/dist/components/feedback/LoadingSpinner.vue.d.ts +7 -0
- package/dist/components/feedback/Modal.vue.d.ts +32 -0
- package/dist/components/feedback/NotificationComponent.vue.d.ts +12 -0
- package/dist/components/feedback/NotificationList.vue.d.ts +12 -0
- package/dist/components/feedback/PaginationControls.vue.d.ts +21 -0
- package/dist/components/feedback/index.cjs +9 -0
- package/dist/components/feedback/index.cjs.map +1 -0
- package/dist/components/feedback/index.d.ts +5 -0
- package/dist/components/feedback/index.js +9 -0
- package/dist/components/feedback/index.js.map +1 -0
- package/dist/components/form/FormGroup.vue.d.ts +30 -0
- package/dist/components/form/FormHelp.vue.d.ts +21 -0
- package/dist/components/form/FormInput.vue.d.ts +13 -0
- package/dist/components/form/FormLabel.vue.d.ts +21 -0
- package/dist/components/form/FormSelect.vue.d.ts +26 -0
- package/dist/components/form/SearchInput.vue.d.ts +12 -0
- package/dist/components/form/index.cjs +10 -0
- package/dist/components/form/index.cjs.map +1 -0
- package/dist/components/form/index.d.ts +6 -0
- package/dist/components/form/index.js +10 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/index.cjs +29 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +29 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/type/BadgeType.vue.d.ts +11 -0
- package/dist/components/type/BooleanType.vue.d.ts +11 -0
- package/dist/components/type/DateType.vue.d.ts +10 -0
- package/dist/components/type/NumberType.vue.d.ts +9 -0
- package/dist/components/type/TextType.vue.d.ts +8 -0
- package/dist/components/type/index.cjs +9 -0
- package/dist/components/type/index.cjs.map +1 -0
- package/dist/components/type/index.d.ts +5 -0
- package/dist/components/type/index.js +9 -0
- package/dist/components/type/index.js.map +1 -0
- package/dist/composables/index.cjs +7 -0
- package/dist/composables/index.cjs.map +1 -0
- package/dist/composables/index.d.ts +3 -0
- package/dist/composables/index.js +7 -0
- package/dist/composables/index.js.map +1 -0
- package/dist/composables/useDarkMode.d.ts +14 -0
- package/dist/composables/useExportCSV.d.ts +10 -0
- package/dist/composables/useNotifications.d.ts +27 -0
- package/dist/index-BoCtJCg0.cjs +32 -0
- package/dist/index-BoCtJCg0.cjs.map +1 -0
- package/dist/index-CGhDI10m.js +33 -0
- package/dist/index-CGhDI10m.js.map +1 -0
- package/dist/index.cjs +49 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +24 -0
- package/dist/types/components.d.ts +18 -0
- package/dist/types/form.d.ts +27 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/notification.d.ts +12 -0
- package/dist/types/property.d.ts +34 -0
- package/dist/useExportCSV-B9o9lJ3D.js +130 -0
- package/dist/useExportCSV-B9o9lJ3D.js.map +1 -0
- package/dist/useExportCSV-BPC_hd25.cjs +129 -0
- package/dist/useExportCSV-BPC_hd25.cjs.map +1 -0
- package/package.json +131 -0
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# vue-tailwind-ui
|
|
2
|
+
|
|
3
|
+
To install dependencies:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
bun install
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
To run:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun run index.ts
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This project was created using `bun init` in bun v1.2.4. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const vue = require("vue");
|
|
3
|
+
const vue$1 = require("@iconify/vue");
|
|
4
|
+
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
5
|
+
__name: "TextType",
|
|
6
|
+
props: {
|
|
7
|
+
value: {}
|
|
8
|
+
},
|
|
9
|
+
setup(__props) {
|
|
10
|
+
return (_ctx, _cache) => {
|
|
11
|
+
return vue.openBlock(), vue.createElementBlock("span", null, vue.toDisplayString(__props.value ?? ""), 1);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
16
|
+
__name: "NumberType",
|
|
17
|
+
props: {
|
|
18
|
+
value: {},
|
|
19
|
+
locale: { default: "en-US" }
|
|
20
|
+
},
|
|
21
|
+
setup(__props) {
|
|
22
|
+
const formattedValue = () => {
|
|
23
|
+
if (__props.value === null || __props.value === void 0) return "";
|
|
24
|
+
const num = Number(__props.value);
|
|
25
|
+
return isNaN(num) ? String(__props.value) : num.toLocaleString(__props.locale);
|
|
26
|
+
};
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
return vue.openBlock(), vue.createElementBlock("span", null, vue.toDisplayString(formattedValue()), 1);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
33
|
+
__name: "DateType",
|
|
34
|
+
props: {
|
|
35
|
+
value: {},
|
|
36
|
+
format: { default: "date" },
|
|
37
|
+
locale: { default: "en-US" }
|
|
38
|
+
},
|
|
39
|
+
setup(__props) {
|
|
40
|
+
const formattedValue = () => {
|
|
41
|
+
if (!__props.value) return "";
|
|
42
|
+
try {
|
|
43
|
+
const date = new Date(String(__props.value));
|
|
44
|
+
if (isNaN(date.getTime())) return String(__props.value);
|
|
45
|
+
switch (__props.format) {
|
|
46
|
+
case "datetime":
|
|
47
|
+
return date.toLocaleString(__props.locale);
|
|
48
|
+
case "time":
|
|
49
|
+
return date.toLocaleTimeString(__props.locale);
|
|
50
|
+
default:
|
|
51
|
+
return date.toLocaleDateString(__props.locale);
|
|
52
|
+
}
|
|
53
|
+
} catch {
|
|
54
|
+
return "";
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return (_ctx, _cache) => {
|
|
58
|
+
return vue.openBlock(), vue.createElementBlock("span", null, vue.toDisplayString(formattedValue()), 1);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const _hoisted_1 = { key: 1 };
|
|
63
|
+
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
64
|
+
__name: "BooleanType",
|
|
65
|
+
props: {
|
|
66
|
+
value: {},
|
|
67
|
+
display: { default: "text" },
|
|
68
|
+
trueLabel: { default: "Yes" },
|
|
69
|
+
falseLabel: { default: "No" }
|
|
70
|
+
},
|
|
71
|
+
setup(__props) {
|
|
72
|
+
const boolValue = Boolean(__props.value);
|
|
73
|
+
const label = boolValue ? __props.trueLabel : __props.falseLabel;
|
|
74
|
+
const icon = boolValue ? "lucide:check-circle" : "lucide:x-circle";
|
|
75
|
+
const colorClass = boolValue ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400";
|
|
76
|
+
return (_ctx, _cache) => {
|
|
77
|
+
return vue.openBlock(), vue.createElementBlock("span", {
|
|
78
|
+
class: vue.normalizeClass([vue.unref(colorClass), "inline-flex items-center gap-1"])
|
|
79
|
+
}, [
|
|
80
|
+
__props.display === "icon" || __props.display === "both" ? (vue.openBlock(), vue.createBlock(vue.unref(vue$1.Icon), {
|
|
81
|
+
key: 0,
|
|
82
|
+
icon: vue.unref(icon),
|
|
83
|
+
class: "h-4 w-4"
|
|
84
|
+
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
85
|
+
__props.display === "text" || __props.display === "both" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, vue.toDisplayString(vue.unref(label)), 1)) : vue.createCommentVNode("", true)
|
|
86
|
+
], 2);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
91
|
+
__name: "StatusBadge",
|
|
92
|
+
props: {
|
|
93
|
+
variant: { default: "default" }
|
|
94
|
+
},
|
|
95
|
+
setup(__props) {
|
|
96
|
+
const variantClasses = {
|
|
97
|
+
default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200",
|
|
98
|
+
success: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",
|
|
99
|
+
error: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400",
|
|
100
|
+
warning: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400",
|
|
101
|
+
info: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",
|
|
102
|
+
blue: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",
|
|
103
|
+
orange: "bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400",
|
|
104
|
+
green: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",
|
|
105
|
+
red: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400",
|
|
106
|
+
yellow: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400",
|
|
107
|
+
purple: "bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400",
|
|
108
|
+
pink: "bg-pink-100 text-pink-800 dark:bg-pink-900/30 dark:text-pink-400",
|
|
109
|
+
gray: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200"
|
|
110
|
+
};
|
|
111
|
+
return (_ctx, _cache) => {
|
|
112
|
+
return vue.openBlock(), vue.createElementBlock("span", {
|
|
113
|
+
class: vue.normalizeClass([variantClasses[__props.variant], "inline-flex rounded-full px-2 py-1 text-xs font-semibold"])
|
|
114
|
+
}, [
|
|
115
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
116
|
+
], 2);
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
121
|
+
__name: "BadgeType",
|
|
122
|
+
props: {
|
|
123
|
+
value: {},
|
|
124
|
+
variant: { default: "default" },
|
|
125
|
+
formatter: { type: Function }
|
|
126
|
+
},
|
|
127
|
+
setup(__props) {
|
|
128
|
+
const displayValue = __props.formatter ? __props.formatter(__props.value) : String(__props.value ?? "");
|
|
129
|
+
return (_ctx, _cache) => {
|
|
130
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$1, { variant: __props.variant }, {
|
|
131
|
+
default: vue.withCtx(() => [
|
|
132
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(displayValue)), 1)
|
|
133
|
+
]),
|
|
134
|
+
_: 1
|
|
135
|
+
}, 8, ["variant"]);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
exports._sfc_main = _sfc_main$1;
|
|
140
|
+
exports._sfc_main$1 = _sfc_main$5;
|
|
141
|
+
exports._sfc_main$2 = _sfc_main$4;
|
|
142
|
+
exports._sfc_main$3 = _sfc_main$3;
|
|
143
|
+
exports._sfc_main$4 = _sfc_main$2;
|
|
144
|
+
exports._sfc_main$5 = _sfc_main;
|
|
145
|
+
//# sourceMappingURL=BadgeType.vue_vue_type_script_setup_true_lang-CJb63H1I.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadgeType.vue_vue_type_script_setup_true_lang-CJb63H1I.cjs","sources":["../src/components/type/TextType.vue","../src/components/type/NumberType.vue","../src/components/type/DateType.vue","../src/components/type/BooleanType.vue","../src/components/core/StatusBadge.vue","../src/components/type/BadgeType.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n/**\n * Text type component - default text rendering\n */\ndefineProps<{\n value: unknown\n}>()\n</script>\n\n<template>\n <span>{{ value ?? '' }}</span>\n</template>\n","<script lang=\"ts\" setup>\n/**\n * Number type component - formatted number display\n */\nconst { value, locale = 'en-US' } = defineProps<{\n value: unknown\n locale?: string\n}>()\n\nconst formattedValue = () => {\n if (value === null || value === undefined) return ''\n const num = Number(value)\n return isNaN(num) ? String(value) : num.toLocaleString(locale)\n}\n</script>\n\n<template>\n <span>{{ formattedValue() }}</span>\n</template>\n","<script lang=\"ts\" setup>\n/**\n * Date type component - formatted date display\n */\nconst { value, format = 'date', locale = 'en-US' } = defineProps<{\n value: unknown\n format?: 'date' | 'datetime' | 'time'\n locale?: string\n}>()\n\nconst formattedValue = () => {\n if (!value) return ''\n\n try {\n const date = new Date(String(value))\n if (isNaN(date.getTime())) return String(value)\n\n switch (format) {\n case 'datetime':\n return date.toLocaleString(locale)\n case 'time':\n return date.toLocaleTimeString(locale)\n default:\n return date.toLocaleDateString(locale)\n }\n } catch {\n return ''\n }\n}\n</script>\n\n<template>\n <span>{{ formattedValue() }}</span>\n</template>\n","<script lang=\"ts\" setup>\nimport { Icon } from '@iconify/vue'\n\n/**\n * Boolean type component - displays boolean as Yes/No with icons\n */\nconst {\n value,\n display = 'text',\n trueLabel = 'Yes',\n falseLabel = 'No',\n} = defineProps<{\n value: unknown\n display?: 'text' | 'icon' | 'both'\n trueLabel?: string\n falseLabel?: string\n}>()\n\nconst boolValue = Boolean(value)\nconst label = boolValue ? trueLabel : falseLabel\nconst icon = boolValue ? 'lucide:check-circle' : 'lucide:x-circle'\nconst colorClass = boolValue\n ? 'text-green-600 dark:text-green-400'\n : 'text-red-600 dark:text-red-400'\n</script>\n\n<template>\n <span :class=\"colorClass\" class=\"inline-flex items-center gap-1\">\n <Icon v-if=\"display === 'icon' || display === 'both'\" :icon=\"icon\" class=\"h-4 w-4\" />\n <span v-if=\"display === 'text' || display === 'both'\">{{ label }}</span>\n </span>\n</template>\n","<script lang=\"ts\" setup>\nimport type { StatusBadgeVariant } from '@/types'\n\nconst { variant = 'default' } = defineProps<{\n variant?: StatusBadgeVariant\n}>()\n\nconst variantClasses: Record<StatusBadgeVariant, string> = {\n default: 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200',\n success: 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400',\n error: 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400',\n warning: 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400',\n info: 'bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400',\n blue: 'bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400',\n orange: 'bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400',\n green: 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400',\n red: 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400',\n yellow: 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400',\n purple: 'bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400',\n pink: 'bg-pink-100 text-pink-800 dark:bg-pink-900/30 dark:text-pink-400',\n gray: 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200',\n}\n</script>\n\n<template>\n <span\n :class=\"variantClasses[variant]\"\n class=\"inline-flex rounded-full px-2 py-1 text-xs font-semibold\"\n >\n <slot />\n </span>\n</template>\n","<script lang=\"ts\" setup>\nimport StatusBadge from '@/components/core/StatusBadge.vue'\nimport type { StatusBadgeVariant } from '@/types'\n\n/**\n * Badge type component - displays value as a badge\n */\nconst { value, variant = 'default', formatter } = defineProps<{\n value: unknown\n variant?: StatusBadgeVariant\n formatter?: (value: unknown) => string\n}>()\n\nconst displayValue = formatter ? formatter(value) : String(value ?? '')\n</script>\n\n<template>\n <StatusBadge :variant=\"variant\">\n {{ displayValue }}\n </StatusBadge>\n</template>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_createBlock","Icon","_renderSlot","StatusBadge"],"mappings":";;;;;;;;;;AAUE,aAAAA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zCC,IAAAA,YAAqFD,IAAAA,MAAAE,MAAAA,IAAA,GAAA;AAAA;UAA9B,MAAMF,IAAAA,MAAA,IAAA;AAAA,UAAM,OAAM;AAAA,QAAA;QAC7D,QAAA,sBAAsB,QAAA,YAAO,UAAzCH,IAAAA,UAAA,GAAAC,uBAAwE,wCAAfE,IAAAA,MAAA,KAAA,CAAK,GAAA,CAAA;;;;;;;;;;;ACtBlE,UAAM,iBAAqD;AAAA,MACzD,SAAS;AAAA,MACT,SAAS;AAAA,MACT,OAAO;AAAA,MACP,SAAS;AAAA,MACT,MAAM;AAAA,MACN,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,MAAM;AAAA,IAAA;;8BAKNF,IAAAA,mBAKO,QAAA;AAAA,QAJJ,OAAKC,IAAAA,eAAA,CAAE,eAAe,QAAA,OAAO,GACxB,0DAA0D,CAAA;AAAA,MAAA;QAEhEI,eAAQ,KAAA,QAAA,SAAA;AAAA,MAAA;;;;;;;;;;;;AChBZ,UAAM,eAAe,QAAA,YAAY,QAAA,UAAU,QAAA,KAAK,IAAI,OAAO,QAAA,SAAS,EAAE;;8BAIpEF,gBAEcG,aAAA,EAFA,SAAS,QAAA,WAAO;AAAA,6BAC5B,MAAkB;AAAA,kDAAfJ,IAAAA,MAAA,YAAA,CAAY,GAAA,CAAA;AAAA,QAAA;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, toDisplayString, normalizeClass, unref, createBlock, createCommentVNode, renderSlot, withCtx, createTextVNode } from "vue";
|
|
2
|
+
import { Icon } from "@iconify/vue";
|
|
3
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "TextType",
|
|
5
|
+
props: {
|
|
6
|
+
value: {}
|
|
7
|
+
},
|
|
8
|
+
setup(__props) {
|
|
9
|
+
return (_ctx, _cache) => {
|
|
10
|
+
return openBlock(), createElementBlock("span", null, toDisplayString(__props.value ?? ""), 1);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
15
|
+
__name: "NumberType",
|
|
16
|
+
props: {
|
|
17
|
+
value: {},
|
|
18
|
+
locale: { default: "en-US" }
|
|
19
|
+
},
|
|
20
|
+
setup(__props) {
|
|
21
|
+
const formattedValue = () => {
|
|
22
|
+
if (__props.value === null || __props.value === void 0) return "";
|
|
23
|
+
const num = Number(__props.value);
|
|
24
|
+
return isNaN(num) ? String(__props.value) : num.toLocaleString(__props.locale);
|
|
25
|
+
};
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
return openBlock(), createElementBlock("span", null, toDisplayString(formattedValue()), 1);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
32
|
+
__name: "DateType",
|
|
33
|
+
props: {
|
|
34
|
+
value: {},
|
|
35
|
+
format: { default: "date" },
|
|
36
|
+
locale: { default: "en-US" }
|
|
37
|
+
},
|
|
38
|
+
setup(__props) {
|
|
39
|
+
const formattedValue = () => {
|
|
40
|
+
if (!__props.value) return "";
|
|
41
|
+
try {
|
|
42
|
+
const date = new Date(String(__props.value));
|
|
43
|
+
if (isNaN(date.getTime())) return String(__props.value);
|
|
44
|
+
switch (__props.format) {
|
|
45
|
+
case "datetime":
|
|
46
|
+
return date.toLocaleString(__props.locale);
|
|
47
|
+
case "time":
|
|
48
|
+
return date.toLocaleTimeString(__props.locale);
|
|
49
|
+
default:
|
|
50
|
+
return date.toLocaleDateString(__props.locale);
|
|
51
|
+
}
|
|
52
|
+
} catch {
|
|
53
|
+
return "";
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return (_ctx, _cache) => {
|
|
57
|
+
return openBlock(), createElementBlock("span", null, toDisplayString(formattedValue()), 1);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const _hoisted_1 = { key: 1 };
|
|
62
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
63
|
+
__name: "BooleanType",
|
|
64
|
+
props: {
|
|
65
|
+
value: {},
|
|
66
|
+
display: { default: "text" },
|
|
67
|
+
trueLabel: { default: "Yes" },
|
|
68
|
+
falseLabel: { default: "No" }
|
|
69
|
+
},
|
|
70
|
+
setup(__props) {
|
|
71
|
+
const boolValue = Boolean(__props.value);
|
|
72
|
+
const label = boolValue ? __props.trueLabel : __props.falseLabel;
|
|
73
|
+
const icon = boolValue ? "lucide:check-circle" : "lucide:x-circle";
|
|
74
|
+
const colorClass = boolValue ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400";
|
|
75
|
+
return (_ctx, _cache) => {
|
|
76
|
+
return openBlock(), createElementBlock("span", {
|
|
77
|
+
class: normalizeClass([unref(colorClass), "inline-flex items-center gap-1"])
|
|
78
|
+
}, [
|
|
79
|
+
__props.display === "icon" || __props.display === "both" ? (openBlock(), createBlock(unref(Icon), {
|
|
80
|
+
key: 0,
|
|
81
|
+
icon: unref(icon),
|
|
82
|
+
class: "h-4 w-4"
|
|
83
|
+
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
84
|
+
__props.display === "text" || __props.display === "both" ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(unref(label)), 1)) : createCommentVNode("", true)
|
|
85
|
+
], 2);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
90
|
+
__name: "StatusBadge",
|
|
91
|
+
props: {
|
|
92
|
+
variant: { default: "default" }
|
|
93
|
+
},
|
|
94
|
+
setup(__props) {
|
|
95
|
+
const variantClasses = {
|
|
96
|
+
default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200",
|
|
97
|
+
success: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",
|
|
98
|
+
error: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400",
|
|
99
|
+
warning: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400",
|
|
100
|
+
info: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",
|
|
101
|
+
blue: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",
|
|
102
|
+
orange: "bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400",
|
|
103
|
+
green: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",
|
|
104
|
+
red: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400",
|
|
105
|
+
yellow: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400",
|
|
106
|
+
purple: "bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400",
|
|
107
|
+
pink: "bg-pink-100 text-pink-800 dark:bg-pink-900/30 dark:text-pink-400",
|
|
108
|
+
gray: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200"
|
|
109
|
+
};
|
|
110
|
+
return (_ctx, _cache) => {
|
|
111
|
+
return openBlock(), createElementBlock("span", {
|
|
112
|
+
class: normalizeClass([variantClasses[__props.variant], "inline-flex rounded-full px-2 py-1 text-xs font-semibold"])
|
|
113
|
+
}, [
|
|
114
|
+
renderSlot(_ctx.$slots, "default")
|
|
115
|
+
], 2);
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
120
|
+
__name: "BadgeType",
|
|
121
|
+
props: {
|
|
122
|
+
value: {},
|
|
123
|
+
variant: { default: "default" },
|
|
124
|
+
formatter: { type: Function }
|
|
125
|
+
},
|
|
126
|
+
setup(__props) {
|
|
127
|
+
const displayValue = __props.formatter ? __props.formatter(__props.value) : String(__props.value ?? "");
|
|
128
|
+
return (_ctx, _cache) => {
|
|
129
|
+
return openBlock(), createBlock(_sfc_main$1, { variant: __props.variant }, {
|
|
130
|
+
default: withCtx(() => [
|
|
131
|
+
createTextVNode(toDisplayString(unref(displayValue)), 1)
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
}, 8, ["variant"]);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
export {
|
|
139
|
+
_sfc_main$1 as _,
|
|
140
|
+
_sfc_main$5 as a,
|
|
141
|
+
_sfc_main$4 as b,
|
|
142
|
+
_sfc_main$3 as c,
|
|
143
|
+
_sfc_main$2 as d,
|
|
144
|
+
_sfc_main as e
|
|
145
|
+
};
|
|
146
|
+
//# sourceMappingURL=BadgeType.vue_vue_type_script_setup_true_lang-CnB5eNEM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadgeType.vue_vue_type_script_setup_true_lang-CnB5eNEM.js","sources":["../src/components/type/TextType.vue","../src/components/type/NumberType.vue","../src/components/type/DateType.vue","../src/components/type/BooleanType.vue","../src/components/core/StatusBadge.vue","../src/components/type/BadgeType.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n/**\n * Text type component - default text rendering\n */\ndefineProps<{\n value: unknown\n}>()\n</script>\n\n<template>\n <span>{{ value ?? '' }}</span>\n</template>\n","<script lang=\"ts\" setup>\n/**\n * Number type component - formatted number display\n */\nconst { value, locale = 'en-US' } = defineProps<{\n value: unknown\n locale?: string\n}>()\n\nconst formattedValue = () => {\n if (value === null || value === undefined) return ''\n const num = Number(value)\n return isNaN(num) ? String(value) : num.toLocaleString(locale)\n}\n</script>\n\n<template>\n <span>{{ formattedValue() }}</span>\n</template>\n","<script lang=\"ts\" setup>\n/**\n * Date type component - formatted date display\n */\nconst { value, format = 'date', locale = 'en-US' } = defineProps<{\n value: unknown\n format?: 'date' | 'datetime' | 'time'\n locale?: string\n}>()\n\nconst formattedValue = () => {\n if (!value) return ''\n\n try {\n const date = new Date(String(value))\n if (isNaN(date.getTime())) return String(value)\n\n switch (format) {\n case 'datetime':\n return date.toLocaleString(locale)\n case 'time':\n return date.toLocaleTimeString(locale)\n default:\n return date.toLocaleDateString(locale)\n }\n } catch {\n return ''\n }\n}\n</script>\n\n<template>\n <span>{{ formattedValue() }}</span>\n</template>\n","<script lang=\"ts\" setup>\nimport { Icon } from '@iconify/vue'\n\n/**\n * Boolean type component - displays boolean as Yes/No with icons\n */\nconst {\n value,\n display = 'text',\n trueLabel = 'Yes',\n falseLabel = 'No',\n} = defineProps<{\n value: unknown\n display?: 'text' | 'icon' | 'both'\n trueLabel?: string\n falseLabel?: string\n}>()\n\nconst boolValue = Boolean(value)\nconst label = boolValue ? trueLabel : falseLabel\nconst icon = boolValue ? 'lucide:check-circle' : 'lucide:x-circle'\nconst colorClass = boolValue\n ? 'text-green-600 dark:text-green-400'\n : 'text-red-600 dark:text-red-400'\n</script>\n\n<template>\n <span :class=\"colorClass\" class=\"inline-flex items-center gap-1\">\n <Icon v-if=\"display === 'icon' || display === 'both'\" :icon=\"icon\" class=\"h-4 w-4\" />\n <span v-if=\"display === 'text' || display === 'both'\">{{ label }}</span>\n </span>\n</template>\n","<script lang=\"ts\" setup>\nimport type { StatusBadgeVariant } from '@/types'\n\nconst { variant = 'default' } = defineProps<{\n variant?: StatusBadgeVariant\n}>()\n\nconst variantClasses: Record<StatusBadgeVariant, string> = {\n default: 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200',\n success: 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400',\n error: 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400',\n warning: 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400',\n info: 'bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400',\n blue: 'bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400',\n orange: 'bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400',\n green: 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400',\n red: 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400',\n yellow: 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400',\n purple: 'bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400',\n pink: 'bg-pink-100 text-pink-800 dark:bg-pink-900/30 dark:text-pink-400',\n gray: 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200',\n}\n</script>\n\n<template>\n <span\n :class=\"variantClasses[variant]\"\n class=\"inline-flex rounded-full px-2 py-1 text-xs font-semibold\"\n >\n <slot />\n </span>\n</template>\n","<script lang=\"ts\" setup>\nimport StatusBadge from '@/components/core/StatusBadge.vue'\nimport type { StatusBadgeVariant } from '@/types'\n\n/**\n * Badge type component - displays value as a badge\n */\nconst { value, variant = 'default', formatter } = defineProps<{\n value: unknown\n variant?: StatusBadgeVariant\n formatter?: (value: unknown) => string\n}>()\n\nconst displayValue = formatter ? formatter(value) : String(value ?? '')\n</script>\n\n<template>\n <StatusBadge :variant=\"variant\">\n {{ displayValue }}\n </StatusBadge>\n</template>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_createBlock","_renderSlot","StatusBadge"],"mappings":";;;;;;;;;AAUE,aAAAA,UAAA,GAAAC,mBAA8B,8BAArB,QAAA,SAAK,EAAA,GAAA,CAAA;AAAA;;;;;;;;;;ACDhB,UAAM,iBAAiB,MAAM;AAC3B,UAAI,QAAA,UAAU,QAAQ,QAAA,UAAU,OAAW,QAAO;AAClD,YAAM,MAAM,OAAO,QAAA,KAAK;AACxB,aAAO,MAAM,GAAG,IAAI,OAAO,QAAA,KAAK,IAAI,IAAI,eAAe,QAAA,MAAM;AAAA,IAC/D;;AAIE,aAAAD,UAAA,GAAAC,mBAAmC,8BAA1B,gBAAc,GAAA,CAAA;AAAA;;;;;;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