@hebatzy/ui 0.0.0-stage → 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 +69 -2
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +396 -0
- package/dist/index.mjs +1235 -0
- package/dist/module.cjs +37 -0
- package/dist/module.d.cts +5 -0
- package/dist/module.d.mts +5 -0
- package/dist/module.d.ts +5 -0
- package/dist/module.mjs +35 -0
- package/dist/styles.css +1 -0
- package/dist/theme.css +79 -0
- package/package.json +58 -3
package/README.md
CHANGED
|
@@ -1,3 +1,70 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @hebatzy/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared UI component library untuk semua aplikasi Heba.
|
|
4
|
+
|
|
5
|
+
## Framework Support
|
|
6
|
+
|
|
7
|
+
- Vue 3
|
|
8
|
+
- Nuxt 3
|
|
9
|
+
- Nuxt 4
|
|
10
|
+
|
|
11
|
+
## Tech Stack
|
|
12
|
+
|
|
13
|
+
- Tailwind CSS v4
|
|
14
|
+
- TypeScript
|
|
15
|
+
|
|
16
|
+
## Instalasi
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
yarn add @hebatzy/ui
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Nuxt 4
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
// nuxt.config.ts
|
|
26
|
+
export default defineNuxtConfig({
|
|
27
|
+
modules: ["@hebatzy/ui/nuxt"],
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```vue
|
|
32
|
+
<!-- app.vue -->
|
|
33
|
+
<template>
|
|
34
|
+
<NuxtLayout>
|
|
35
|
+
<NuxtPage />
|
|
36
|
+
<HebaToastContainer />
|
|
37
|
+
</NuxtLayout>
|
|
38
|
+
</template>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Vue 3
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
// main.ts
|
|
45
|
+
import { createApp } from "vue";
|
|
46
|
+
import { HebaUI } from "@hebatzy/ui";
|
|
47
|
+
import "@hebatzy/ui/styles";
|
|
48
|
+
import App from "./App.vue";
|
|
49
|
+
|
|
50
|
+
createApp(App).use(HebaUI).mount("#app");
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Komponen
|
|
54
|
+
|
|
55
|
+
| Komponen | Keterangan |
|
|
56
|
+
| -------------------- | ----------------------------------------------------------- |
|
|
57
|
+
| `HebaBadge` | Label pill, 5 variant, 3 size |
|
|
58
|
+
| `HebaButton` | Tombol, 5 variant, 3 size |
|
|
59
|
+
| `HebaInput` | Input field, v-model, slot prepend/append |
|
|
60
|
+
| `HebaModal` | Dialog modal, v-model, Teleport |
|
|
61
|
+
| `HebaSelect2` | Select ala Select2: lokal/remote, multiple, infinite scroll |
|
|
62
|
+
| `HebaToast` | Single toast item |
|
|
63
|
+
| `HebaToastContainer` | Stack container, Teleport to body |
|
|
64
|
+
|
|
65
|
+
## publish
|
|
66
|
+
|
|
67
|
+
git tag -d v0.0.3
|
|
68
|
+
git push origin :refs/tags/v0.0.3
|
|
69
|
+
git tag v0.0.3
|
|
70
|
+
git push origin v0.0.3
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),we=e.defineComponent({name:"HebaBadge",__name:"HebaBadge",props:{variant:{default:"secondary"},size:{default:"md"}},setup(o){const i={sm:"heba:px-2 heba:py-0.5 heba:text-xs",md:"heba:px-2.5 heba:py-1 heba:text-xs",lg:"heba:px-3 heba:py-1.5 heba:text-sm"},r={secondary:"heba:bg-secondary-200 heba:text-secondary-900",info:"heba:bg-info-600 heba:text-info-100",success:"heba:bg-success-600 heba:text-success-100",warning:"heba:bg-warning-800 heba:text-warning-100",danger:"heba:bg-danger-600 heba:text-danger-100"};return(n,c)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["heba:inline-flex heba:items-center heba:font-semibold heba:rounded-md",i[o.size],r[o.variant]])},[e.renderSlot(n.$slots,"default")],2))}}),Ge=["disabled"],Be=e.defineComponent({name:"HebaButton",inheritAttrs:!1,__name:"HebaButton",props:{variant:{default:"info"},size:{default:"md"},rounded:{default:"md"},disabled:{type:Boolean,default:!1}},setup(o){const i={none:"heba:rounded-none",sm:"heba:rounded-sm",md:"heba:rounded-md",lg:"heba:rounded-lg",xl:"heba:rounded-xl","2xl":"heba:rounded-2xl",full:"heba:rounded-full"},r={sm:"heba:px-2.5 heba:py-1 heba:text-xs",md:"heba:px-4 heba:py-2 heba:text-sm",lg:"heba:px-6 heba:py-3 heba:text-base"},n={info:"heba:bg-info-600 heba:text-white heba:hover:bg-info-700",secondary:"heba:bg-secondary-50 heba:text-black heba:hover:bg-secondary-200 heba:border heba:border-secondary-300",success:"heba:bg-success-600 heba:text-white heba:hover:bg-success-700",warning:"heba:bg-warning-600 heba:text-white heba:hover:bg-warning-700",danger:"heba:bg-danger-600 heba:text-white heba:hover:bg-danger-700"};return(c,u)=>(e.openBlock(),e.createElementBlock("button",e.mergeProps({class:["heba:inline-flex heba:items-center heba:justify-content-center heba:font-medium heba:cursor-pointer heba:transition-colors heba:duration-150",r[o.size],n[o.variant],i[o.rounded],{"heba:opacity-50 heba:cursor-not-allowed":o.disabled}],disabled:o.disabled},c.$attrs),[e.renderSlot(c.$slots,"default")],16,Ge))}}),Ye={class:"heba:flex heba:flex-col heba:gap-1"},Qe=["for"],Je={key:0,class:"heba:text-danger-500 heba:ml-0.5"},We={key:1,class:"heba:text-xs heba:mb-1 heba:text-secondary-500"},Xe={class:"heba:relative heba:flex heba:items-center"},Ze={key:0,class:"heba:absolute heba:left-3 heba:flex heba:items-center heba:pointer-events-none heba:text-secondary-500"},_e=["id","placeholder","disabled","readonly","rows"],ea=["id","disabled"],aa={value:"",disabled:"",hidden:""},ta=["id","type","placeholder","disabled","readonly"],oa={key:4,class:"heba:absolute heba:right-3 heba:flex heba:items-center heba:pointer-events-none heba:text-secondary-500"},la={key:5,class:"heba:absolute heba:right-3 heba:flex heba:items-center heba:pointer-events-none heba:text-secondary-500"},na={key:2,class:"heba:text-xs heba:text-danger-600"},Ee=e.defineComponent({name:"HebaInput",inheritAttrs:!1,__name:"HebaInput",props:e.mergeModels({label:{},placeholder:{},type:{default:"text"},error:{},hint:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},rows:{default:3}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const i=o,r=e.useModel(o,"modelValue"),n=e.ref(!1),c=e.useId(),u=e.computed(()=>`heba-input-${c}`),x=e.useSlots(),g=e.computed(()=>{const v=["heba:w-full heba:rounded-lg heba:border heba:bg-white heba:text-sm heba:text-secondary-900","heba:placeholder:text-secondary-400","heba:transition-colors heba:duration-150 heba:outline-none","heba:disabled:bg-secondary-100 heba:disabled:text-secondary-400 heba:disabled:cursor-not-allowed","heba:read-only:cursor-default",i.type==="textarea"?"heba:px-3 heba:py-2":"heba:px-3 heba:h-9",x.prepend?"heba:pl-9":""];return i.disabled?v.push("heba:border-secondary-200"):i.error?v.push("heba:border-danger-500 heba:focus:border-danger-500 heba:focus:ring-2 heba:focus:ring-danger-200"):v.push("heba:border-secondary-300 heba:focus:border-info-500 heba:focus:ring-2 heba:focus:ring-info-100"),v});return(v,b)=>(e.openBlock(),e.createElementBlock("div",Ye,[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:e.normalizeClass(["heba:text-sm heba:font-semibold",o.disabled?"heba:text-secondary-400":"heba:text-secondary-900",o.error?"heba:text-danger-600":""])},[e.createTextVNode(e.toDisplayString(o.label)+" ",1),o.required?(e.openBlock(),e.createElementBlock("span",Je,"*")):e.createCommentVNode("",!0)],10,Qe)):e.createCommentVNode("",!0),o.hint?(e.openBlock(),e.createElementBlock("p",We,e.toDisplayString(o.hint),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Xe,[v.$slots.prepend?(e.openBlock(),e.createElementBlock("div",Ze,[e.renderSlot(v.$slots,"prepend")])):e.createCommentVNode("",!0),o.type==="textarea"?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",e.mergeProps({key:1,id:u.value,"onUpdate:modelValue":b[0]||(b[0]=f=>r.value=f),placeholder:o.placeholder,disabled:o.disabled,readonly:o.readonly,rows:o.rows,class:g.value},v.$attrs,{onFocus:b[1]||(b[1]=f=>n.value=!0),onBlur:b[2]||(b[2]=f=>n.value=!1)}),null,16,_e)),[[e.vModelText,r.value]]):o.type==="select"?e.withDirectives((e.openBlock(),e.createElementBlock("select",e.mergeProps({key:2,id:u.value,"onUpdate:modelValue":b[3]||(b[3]=f=>r.value=f),disabled:o.disabled,class:[g.value,"heba:appearance-none heba:cursor-pointer"]},v.$attrs,{onFocus:b[4]||(b[4]=f=>n.value=!0),onBlur:b[5]||(b[5]=f=>n.value=!1)}),[e.createElementVNode("option",aa,e.toDisplayString(o.placeholder),1),e.renderSlot(v.$slots,"default")],16,ea)),[[e.vModelSelect,r.value]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({key:3,id:u.value,"onUpdate:modelValue":b[6]||(b[6]=f=>r.value=f),type:o.type,placeholder:o.placeholder,disabled:o.disabled,readonly:o.readonly,class:g.value},v.$attrs,{onFocus:b[7]||(b[7]=f=>n.value=!0),onBlur:b[8]||(b[8]=f=>n.value=!1)}),null,16,ta)),[[e.vModelDynamic,r.value]]),o.type==="select"?(e.openBlock(),e.createElementBlock("div",oa,[...b[9]||(b[9]=[e.createElementVNode("svg",{class:"heba:w-4 heba:h-4",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z","clip-rule":"evenodd"})],-1)])])):v.$slots.append?(e.openBlock(),e.createElementBlock("div",la,[e.renderSlot(v.$slots,"append")])):e.createCommentVNode("",!0)]),o.error?(e.openBlock(),e.createElementBlock("p",na,e.toDisplayString(o.error),1)):e.createCommentVNode("",!0)]))}}),sa={key:0,class:"heba:px-6 heba:pt-6 heba:pb-0"},ra={class:"heba:flex heba:justify-between heba:items-start"},ia={class:"flex heba:flex-col"},ca={class:"heba:text-sm heba:text-secondary-400"},da={class:"heba:px-6 heba:py-4 heba:text-sm heba:text-secondary-500 heba:leading-relaxed heba:flex-1"},ba={key:1,class:"heba:px-6 heba:pb-6 heba:pt-2 heba:flex heba:items-center heba:justify-end heba:gap-3"},Ve=e.defineComponent({name:"HebaModal",__name:"HebaModal",props:e.mergeModels({title:{},subtitle:{},size:{default:"md"},closeOnBackdrop:{type:Boolean,default:!0}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:e.mergeModels(["on:close"],["update:modelValue"]),setup(o,{emit:i}){const r=o,n=i,c=e.useModel(o,"modelValue"),x=`heba-modal-title-${e.useId()}`,g={sm:"heba:max-w-sm",md:"heba:max-w-md",lg:"heba:max-w-lg"};function v(){r.closeOnBackdrop&&(c.value=!1)}function b(){n("on:close"),c.value=!1}return(f,O)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{"enter-active-class":"heba:transition heba:duration-200 heba:ease-out","enter-from-class":"heba:opacity-0","enter-to-class":"heba:opacity-100","leave-active-class":"heba:transition heba:duration-150 heba:ease-in","leave-from-class":"heba:opacity-100","leave-to-class":"heba:opacity-0"},{default:e.withCtx(()=>[o.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"heba:fixed heba:inset-0 heba:z-50 heba:flex heba:items-center heba:justify-center heba:p-4",role:"dialog","aria-modal":"true","aria-labelledby":x},[e.createElementVNode("div",{class:"heba:absolute heba:inset-0 heba:bg-black/40",onMousedown:v},null,32),e.createVNode(e.Transition,{"enter-active-class":"heba:transition heba:duration-200 heba:ease-out","enter-from-class":"heba:opacity-0 heba:scale-95","enter-to-class":"heba:opacity-100 heba:scale-100","leave-active-class":"heba:transition heba:duration-150 heba:ease-in","leave-from-class":"heba:opacity-100 heba:scale-100","leave-to-class":"heba:opacity-0 heba:scale-95"},{default:e.withCtx(()=>[o.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["heba:relative heba:bg-white heba:rounded-2xl heba:shadow-xl heba:w-full heba:flex heba:flex-col",g[o.size]])},[o.title||f.$slots.header?(e.openBlock(),e.createElementBlock("div",sa,[e.renderSlot(f.$slots,"header",{},()=>[e.createElementVNode("div",ra,[e.createElementVNode("div",ia,[e.createElementVNode("h2",{id:x,class:"heba:text-lg heba:font-bold heba:text-secondary-900 heba:leading-snug"},e.toDisplayString(o.title),1),e.createElementVNode("p",ca,e.toDisplayString(o.subtitle),1)]),e.createElementVNode("button",{onClick:b,class:"heba:cursor-pointer"},[...O[0]||(O[0]=[e.createElementVNode("i",{class:"fa-solid fa-xmark"},null,-1)])])])])])):e.createCommentVNode("",!0),e.createElementVNode("div",da,[e.renderSlot(f.$slots,"default")]),f.$slots.footer?(e.openBlock(),e.createElementBlock("div",ba,[e.renderSlot(f.$slots,"footer")])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]),_:3})]))}}),ha={key:0,class:"heba:ml-0.5 heba:text-danger-500"},ua={key:1,class:"heba:text-xs heba:mb-1 heba:text-secondary-500"},fa={class:"heba:relative"},ma=["tabindex","aria-expanded","aria-labelledby","aria-disabled","aria-readonly","aria-invalid","aria-activedescendant"],va={key:0,class:"heba:truncate heba:text-secondary-400"},pa={key:0,role:"status","aria-label":"Memuat pilihan",class:"heba:h-2.5 heba:w-12 heba:animate-pulse heba:rounded heba:bg-secondary-300"},ya={key:1,class:"heba:min-w-0 heba:truncate"},ga=["aria-label","onClick"],ka={key:0,role:"status","aria-label":"Memuat pilihan",class:"heba:h-3 heba:w-28 heba:animate-pulse heba:rounded heba:bg-secondary-200"},xa={key:1,class:"heba:min-w-0 heba:truncate"},wa={key:2,class:"heba:min-w-0 heba:truncate heba:text-danger-600"},Ba={class:"heba:flex heba:shrink-0 heba:items-center heba:gap-1"},Ea={key:0,class:"heba:border-b heba:border-secondary-100 heba:p-2"},Va={class:"heba:relative heba:flex heba:items-center"},Ca=["aria-activedescendant","placeholder"],Na={key:0,class:"heba:pointer-events-none heba:absolute heba:right-2.5 heba:h-4 heba:w-4 heba:animate-spin heba:text-secondary-400",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},Ma={key:0,role:"status",class:"heba:flex heba:items-center heba:justify-center heba:gap-2 heba:text-secondary-500"},$a={key:1,role:"alert",class:"heba:flex heba:flex-col heba:items-center heba:gap-2 heba:text-danger-600"},Sa={key:2,class:"heba:text-secondary-500"},Ta=["aria-multiselectable","aria-labelledby"],za=["id","aria-selected","onMouseenter","onClick"],Ha={class:"heba:min-w-0 heba:flex-1"},Da={class:"heba:block heba:truncate"},La={key:0,class:"heba:h-4 heba:w-4 heba:shrink-0 heba:text-info-600",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Aa={key:0,role:"presentation",class:"heba:flex heba:items-center heba:gap-2 heba:px-3 heba:py-2 heba:text-xs heba:text-secondary-500"},Oa={key:1,role:"presentation",class:"heba:flex heba:items-center heba:justify-between heba:gap-2 heba:px-3 heba:py-2 heba:text-xs heba:text-danger-600"},Ia={key:2,class:"heba:text-xs heba:text-danger-600"},Ce=e.defineComponent({name:"HebaSelect2",__name:"HebaSelect2",props:{modelValue:{default:null},options:{default:()=>[]},multiple:{type:Boolean},searchable:{type:Boolean},clearable:{type:Boolean},disabled:{type:Boolean},readonly:{type:Boolean},labelKey:{default:"label"},valueKey:{default:"value"},remote:{type:Boolean},loading:{type:Boolean},debounce:{default:300},limit:{default:20},fetchOptions:{},fetchSelectedOptions:{},fallbackLabel:{},label:{},placeholder:{default:"Pilih..."},searchPlaceholder:{default:"Cari..."},emptyText:{default:"Tidak ada data"},error:{},hint:{},required:{type:Boolean}},emits:["update:modelValue","update:selected","search","load","change","clear","open","close","error"],setup(o,{expose:i,emit:r}){const n=o,c=r,u=e.useId(),x=`heba-select2-label-${u}`,g=`heba-select2-listbox-${u}`,v=e.ref(null),b=e.ref(null),f=e.ref(null),O=e.ref(null),y=e.ref(!1),de=e.ref(!1),C=e.ref(""),p=e.ref(-1),h=a=>String(a);function be(a){return typeof a=="string"&&a!==""||typeof a=="number"&&!Number.isNaN(a)}function S(a,t=n.valueKey){if(!a||typeof a!="object")return;const l=a[t];return be(l)?l:void 0}function he(a,t){const l=a[n.labelKey];return l==null||l===""?String(t):String(l)}const w=e.shallowReactive(new Map),T=e.shallowReactive(new Map),Q=new Set;let q=0;const J=e.computed(()=>{const a=new Map;for(const t of n.options){const l=S(t);l!==void 0&&!a.has(h(l))&&a.set(h(l),t)}return a});function ue(a){return J.value.get(a)??w.get(a)??null}const z=e.computed(()=>{const a=n.modelValue,t=Array.isArray(a)?a:[a],l=new Set,s=[];for(const d of t)if(!(!be(d)||l.has(h(d)))&&(l.add(h(d)),s.push(d),!n.multiple))break;return s}),Se=e.computed(()=>new Set(z.value.map(h))),I=e.computed(()=>z.value.map(a=>{const t=h(a),l=ue(t);if(l)return{key:t,value:a,option:l,label:he(l,a),status:"ready"};const s=T.get(t)??"missing";let d;return s==="loading"?d="Memuat...":s==="error"?d=`Gagal memuat (${a})`:d=n.fallbackLabel?n.fallbackLabel(a):`Tidak ditemukan (${a})`,{key:t,value:a,option:null,label:d,status:s}})),j=e.computed(()=>!n.disabled&&!n.readonly),Te=e.computed(()=>n.clearable&&j.value&&z.value.length>0),ze=e.computed(()=>I.value.some(a=>a.status==="error"));function fe(){const a=[];for(const t of z.value){const l=h(t),s=J.value.get(l);if(s){w.get(l)!==s&&w.set(l,s);continue}w.has(l)||Q.has(l)||a.push(t)}a.length&&n.fetchSelectedOptions&&He(n.fetchSelectedOptions,a)}async function He(a,t){const l=q,s=t.map(h);for(const d of s)Q.add(d),T.set(d,"loading");if(!(typeof window>"u"))try{const d=await a(n.multiple?t:t[0]);if(l!==q)return;const V=Array.isArray(d)?d:d?[d]:[];for(const B of V){const m=S(B);m!==void 0&&(w.has(h(m))||w.set(h(m),B))}for(const B of s)T.delete(B)}catch(d){if(l!==q)return;for(const V of s)T.set(V,"error");c("error",d,{type:"selected",values:t})}}function me(){const a=[...T].filter(([,t])=>t==="error").map(([t])=>t);for(const t of a)T.delete(t),Q.delete(t);fe()}const K=e.shallowRef([]),P=e.ref(!1),H=e.ref(!1),F=e.ref(!1),U=e.ref(!1),D=e.ref(!1);let W=0,X=!1,R=null,G=0,N=null,te;const ve=e.computed(()=>n.loading||D.value||P.value);function De(a,t){if(Array.isArray(a))return{data:a,more:a.length>=n.limit};const l=Array.isArray(a==null?void 0:a.data)?a.data:[];return typeof(a==null?void 0:a.hasMore)=="boolean"?{data:l,more:a.hasMore}:typeof(a==null?void 0:a.total)=="number"?{data:l,more:t*n.limit<a.total}:{data:l,more:l.length>=n.limit}}async function Y(a){const t=n.fetchOptions;if(!t)return;const l=C.value,s=++G;N==null||N.abort();const d=new AbortController;N=d,D.value=!1,U.value=!1,a===1?(P.value=!0,H.value=!1,F.value=!1):H.value=!0;try{const V=await t({search:l,page:a,limit:n.limit,signal:d.signal});if(s!==G)return;const{data:B,more:m}=De(V,a),M=new Set;if(a>1)for(const $ of K.value){const A=S($);A!==void 0&&M.add(h(A))}const k=[];for(const $ of B){const A=S($);A!==void 0&&(w.set(h(A),$),!M.has(h(A))&&(M.add(h(A)),k.push($)))}K.value=a===1?k:[...K.value,...k],W=a,X=m&&k.length>0,R=l,c("load",{search:l,page:a,options:B,hasMore:X}),e.nextTick(Oe)}catch(V){if(s!==G)return;a===1?(F.value=!0,K.value=[],R=null):U.value=!0,c("error",V,{type:"options",search:l,page:a})}finally{s===G&&(P.value=!1,H.value=!1)}}function Z(){!n.fetchOptions||!X||P.value||H.value||D.value||U.value||Y(W+1)}function oe(){Y(U.value?W+1:1)}function le(){G++,N==null||N.abort(),N=null,clearTimeout(te),D.value=!1,P.value=!1,H.value=!1}function ne(){le(),F.value=!1,U.value=!1,K.value=[],W=0,X=!1,R=null}function Le(){ne(),y.value&&Y(1)}function Ae(a){const t=a.currentTarget;t.scrollTop+t.clientHeight>=t.scrollHeight-40&&Z()}function Oe(){const a=O.value;a&&a.clientHeight>0&&a.scrollHeight<=a.clientHeight&&Z()}const E=e.computed(()=>{const a=C.value.trim().toLocaleLowerCase(),t=n.remote&&!n.fetchOptions,l=n.fetchOptions?K.value:[],s=new Set(J.value.keys());for(const m of l){const M=S(m);M!==void 0&&s.add(h(M))}const d=new Set,V=[],B=(m,M)=>{const k=S(m);if(k===void 0||d.has(h(k)))return;const $=he(m,k);M&&a&&!$.toLocaleLowerCase().includes(a)||(d.add(h(k)),V.push({key:h(k),value:k,label:$,option:m,selected:Se.value.has(h(k))}))};if(!t||!a)for(const m of I.value)m.option&&!s.has(m.key)&&B(m.option,!0);for(const m of n.options)B(m,!t);for(const m of l)B(m,!1);return V}),pe=e.computed(()=>y.value&&E.value[p.value]?`${g}-${p.value}`:void 0),Ie=e.computed(()=>n.disabled?"heba:cursor-not-allowed heba:border-secondary-200 heba:bg-secondary-100 heba:text-secondary-400":n.readonly?"heba:cursor-default heba:border-secondary-300 heba:bg-white heba:text-secondary-900":n.error?y.value?"heba:cursor-pointer heba:border-danger-500 heba:bg-white heba:text-secondary-900 heba:ring-2 heba:ring-danger-200":"heba:cursor-pointer heba:border-danger-500 heba:bg-white heba:text-secondary-900 heba:focus:ring-2 heba:focus:ring-danger-200":y.value?"heba:cursor-pointer heba:border-info-500 heba:bg-white heba:text-secondary-900 heba:ring-2 heba:ring-info-100":"heba:cursor-pointer heba:border-secondary-300 heba:bg-white heba:text-secondary-900 heba:focus:border-info-500 heba:focus:ring-2 heba:focus:ring-info-100");function je(a){let t="heba:bg-secondary-100 heba:text-secondary-700";return n.disabled?t="heba:bg-secondary-200 heba:text-secondary-500":(a.status==="missing"||a.status==="error")&&(t="heba:bg-danger-50 heba:text-danger-700"),["heba:inline-flex heba:max-w-full heba:items-center heba:gap-1 heba:rounded-md heba:px-2 heba:py-0.5 heba:text-xs heba:font-medium",t]}function _(){var a;(a=b.value)==null||a.focus()}function Ke(){const a=b.value;if(!a)return!1;const t=a.getBoundingClientRect(),l=window.innerHeight-t.bottom;return l<320&&t.top>l}function se(){if(!j.value||y.value)return;de.value=Ke(),y.value=!0;const a=E.value.findIndex(t=>t.selected);p.value=a>=0?a:E.value.length?0:-1,document.addEventListener("mousedown",re,!0),c("open"),n.fetchOptions&&R!==C.value&&Y(1),e.nextTick(()=>{var t;n.searchable&&((t=f.value)==null||t.focus()),ge()})}function L(a=!1){y.value&&(y.value=!1,document.removeEventListener("mousedown",re,!0),R===""?le():ne(),C.value="",c("close"),a&&_())}function re(a){var l;const t=a.target;t&&((l=v.value)!=null&&l.contains(t))||L()}function Pe(a){!j.value||a.button!==0||(a.preventDefault(),y.value?L(!0):(_(),se()))}function Ue(a){if(j.value){if(!y.value){["Enter"," ","ArrowDown","ArrowUp"].includes(a.key)&&(a.preventDefault(),se());return}if(a.key===" "){a.preventDefault(),ke();return}ye(a)}}function ye(a){a.key==="ArrowDown"||a.key==="ArrowUp"?(a.preventDefault(),qe(a.key==="ArrowDown"?1:-1)):a.key==="Enter"?(a.preventDefault(),ke()):a.key==="Escape"?(a.preventDefault(),a.stopPropagation(),L(!0)):a.key==="Tab"&&L()}function qe(a){const t=E.value.length;t&&(p.value=Math.min(Math.max(p.value+a,0),t-1),a>0&&p.value===t-1&&Z(),e.nextTick(ge))}function ge(){var t,l;const a=(t=O.value)==null?void 0:t.querySelectorAll('[role="option"]')[p.value];(l=a==null?void 0:a.scrollIntoView)==null||l.call(a,{block:"nearest"})}function ke(){const a=E.value[p.value];a&&xe(a)}function ee(a){c("update:modelValue",a);const l=(a===null?[]:Array.isArray(a)?a:[a]).map(s=>ue(h(s))).filter(s=>s!==null);c("change",a,n.multiple?l:l[0]??null)}function xe(a){if(w.set(a.key,a.option),n.multiple){const t=z.value;ee(a.selected?t.filter(l=>h(l)!==a.key):[...t,a.value]);return}a.selected||ee(a.value),L(!0)}function Fe(a){ee(z.value.filter(t=>h(t)!==a))}function Re(){ee(n.multiple?[]:null),c("clear")}e.watch(()=>n.valueKey,a=>{q++;const t=[...w.values()];w.clear();for(const l of t){const s=S(l,a);s!==void 0&&w.set(h(s),l)}Q.clear(),T.clear()},{flush:"sync"}),e.watch([()=>z.value.map(h).join("\0"),J],fe,{immediate:!0});let ie=[];return e.watch(()=>I.value.flatMap(a=>a.option?[a.option]:[]),a=>{a.length===ie.length&&a.every((t,l)=>t===ie[l])||(ie=a,c("update:selected",n.multiple?a:a[0]??null))},{immediate:!0}),e.watch(C,a=>{if(p.value=E.value.length?0:-1,clearTimeout(te),D.value=!1,!n.fetchOptions&&!n.remote){c("search",a);return}const t=()=>{D.value=!1,c("search",a),n.fetchOptions&&y.value&&Y(1)};y.value&&n.debounce>0?(D.value=!0,te=setTimeout(t,n.debounce)):t()}),e.watch(()=>n.fetchOptions,()=>{y.value||ne()}),e.watch(()=>E.value.length,a=>{a?(p.value<0||p.value>=a)&&(p.value=Math.min(Math.max(p.value,0),a-1)):p.value=-1}),e.watch(j,a=>{a||L()}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",re,!0),le(),q++}),i({open:se,close:()=>L(),focus:_,reload:Le,loadMore:Z,retry:oe,retrySelected:me}),(a,t)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:v,class:"heba:flex heba:flex-col heba:gap-1"},[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,id:x,class:e.normalizeClass(["heba:text-sm heba:font-semibold",o.error?"heba:text-danger-600":o.disabled?"heba:text-secondary-400":"heba:text-secondary-900"]),onClick:_},[e.createTextVNode(e.toDisplayString(o.label)+" ",1),o.required?(e.openBlock(),e.createElementBlock("span",ha,"*")):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),o.hint?(e.openBlock(),e.createElementBlock("p",ua,e.toDisplayString(o.hint),1)):e.createCommentVNode("",!0),e.createElementVNode("div",fa,[e.createElementVNode("div",{ref_key:"controlEl",ref:b,role:"combobox","aria-haspopup":"listbox",tabindex:o.disabled?-1:0,"aria-expanded":y.value,"aria-controls":g,"aria-labelledby":o.label?x:void 0,"aria-disabled":o.disabled||void 0,"aria-readonly":o.readonly||void 0,"aria-invalid":o.error?!0:void 0,"aria-activedescendant":o.searchable?void 0:pe.value,class:e.normalizeClass(["heba:flex heba:min-h-10 heba:w-full heba:items-center heba:gap-2 heba:rounded-lg heba:border heba:px-3 heba:text-sm heba:outline-none heba:transition-colors heba:duration-150",Ie.value]),onMousedown:Pe,onKeydown:Ue},[e.createElementVNode("div",{class:e.normalizeClass(["heba:flex heba:min-w-0 heba:flex-1 heba:items-center heba:py-1.5",o.multiple?"heba:flex-wrap heba:gap-1.5":""])},[I.value.length?o.multiple?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(I.value,l=>(e.openBlock(),e.createElementBlock("span",{key:l.key,class:e.normalizeClass(je(l))},[l.status==="loading"?(e.openBlock(),e.createElementBlock("span",pa)):(e.openBlock(),e.createElementBlock("span",ya,[l.option?e.renderSlot(a.$slots,"selected",{option:l.option,label:l.label,value:l.value},()=>[e.createTextVNode(e.toDisplayString(l.label),1)],void 0,0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.label),1)],64))])),j.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"heba:-mr-0.5 heba:rounded heba:p-0.5 heba:opacity-60 heba:transition-opacity heba:hover:opacity-100","aria-label":`Hapus ${l.label}`,onMousedown:t[0]||(t[0]=e.withModifiers(()=>{},["stop","prevent"])),onClick:e.withModifiers(s=>Fe(l.key),["stop"])},[...t[6]||(t[6]=[e.createElementVNode("svg",{class:"heba:h-3 heba:w-3",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})],-1)])],40,ga)):e.createCommentVNode("",!0)],2))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(I.value,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.key},[l.status==="loading"?(e.openBlock(),e.createElementBlock("span",ka)):l.option?(e.openBlock(),e.createElementBlock("span",xa,[e.renderSlot(a.$slots,"selected",{option:l.option,label:l.label,value:l.value},()=>[e.createTextVNode(e.toDisplayString(l.label),1)])])):(e.openBlock(),e.createElementBlock("span",wa,e.toDisplayString(l.label),1))],64))),128)):(e.openBlock(),e.createElementBlock("span",va,e.toDisplayString(o.placeholder),1))],2),e.createElementVNode("div",Ba,[ze.value&&!o.disabled?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"heba:rounded heba:p-0.5 heba:text-danger-500 heba:hover:bg-danger-50","aria-label":"Muat ulang pilihan",title:"Muat ulang pilihan",onMousedown:t[1]||(t[1]=e.withModifiers(()=>{},["stop","prevent"])),onClick:e.withModifiers(me,["stop"])},[...t[7]||(t[7]=[e.createElementVNode("svg",{class:"heba:h-4 heba:w-4",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0V5.36l-.31-.31A7 7 0 003.239 8.188a.75.75 0 101.448.389A5.5 5.5 0 0113.89 6.11l.311.31h-2.432a.75.75 0 000 1.5h4.243a.75.75 0 00.53-.219z","clip-rule":"evenodd"})],-1)])],32)):e.createCommentVNode("",!0),Te.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"heba:rounded heba:p-0.5 heba:text-secondary-400 heba:hover:bg-secondary-100 heba:hover:text-secondary-600","aria-label":"Kosongkan pilihan",onMousedown:t[2]||(t[2]=e.withModifiers(()=>{},["stop","prevent"])),onClick:e.withModifiers(Re,["stop"])},[...t[8]||(t[8]=[e.createElementVNode("svg",{class:"heba:h-4 heba:w-4",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})],-1)])],32)):e.createCommentVNode("",!0),o.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",{key:2,class:e.normalizeClass(["heba:h-4 heba:w-4 heba:transition-transform heba:duration-150",o.disabled?"heba:text-secondary-300":"heba:text-secondary-500",y.value?"heba:rotate-180":""]),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[...t[9]||(t[9]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z","clip-rule":"evenodd"},null,-1)])],2))])],42,ma),y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["heba:absolute heba:inset-x-0 heba:z-50 heba:overflow-hidden heba:rounded-lg heba:border heba:border-secondary-200 heba:bg-white heba:shadow-lg",de.value?"heba:bottom-full heba:mb-1":"heba:top-full heba:mt-1"])},[o.searchable?(e.openBlock(),e.createElementBlock("div",Ea,[e.createElementVNode("div",Va,[t[11]||(t[11]=e.createElementVNode("svg",{class:"heba:pointer-events-none heba:absolute heba:left-2.5 heba:h-4 heba:w-4 heba:text-secondary-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z","clip-rule":"evenodd"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchEl",ref:f,"onUpdate:modelValue":t[3]||(t[3]=l=>C.value=l),type:"text",autocomplete:"off","aria-label":"Cari opsi","aria-autocomplete":"list","aria-controls":g,"aria-activedescendant":pe.value,placeholder:o.searchPlaceholder,class:"heba:h-9 heba:w-full heba:rounded-md heba:border heba:border-secondary-300 heba:bg-white heba:pl-8 heba:pr-8 heba:text-sm heba:text-secondary-900 heba:outline-none heba:placeholder:text-secondary-400 heba:focus:border-info-500 heba:focus:ring-2 heba:focus:ring-info-100",onKeydown:ye},null,40,Ca),[[e.vModelText,C.value]]),ve.value&&E.value.length?(e.openBlock(),e.createElementBlock("svg",Na,[...t[10]||(t[10]=[e.createElementVNode("circle",{class:"heba:opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"heba:opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),E.value.length?(e.openBlock(),e.createElementBlock("ul",{key:2,id:g,ref_key:"listEl",ref:O,role:"listbox","aria-multiselectable":o.multiple||void 0,"aria-labelledby":o.label?x:void 0,class:"heba:max-h-60 heba:overflow-y-auto heba:py-1",onScrollPassive:Ae,onMousedown:t[5]||(t[5]=e.withModifiers(()=>{},["prevent"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,(l,s)=>(e.openBlock(),e.createElementBlock("li",{id:`${g}-${s}`,key:l.key,role:"option","aria-selected":l.selected,class:e.normalizeClass(["heba:flex heba:cursor-pointer heba:items-center heba:gap-2 heba:px-3 heba:py-2 heba:text-sm",s===p.value?"heba:bg-secondary-100":"",l.selected?"heba:font-medium heba:text-info-700":"heba:text-secondary-900"]),onMouseenter:d=>p.value=s,onClick:d=>xe(l)},[e.createElementVNode("span",Ha,[e.renderSlot(a.$slots,"option",{option:l.option,label:l.label,value:l.value,selected:l.selected,active:s===p.value},()=>[e.createElementVNode("span",Da,e.toDisplayString(l.label),1)])]),l.selected?(e.openBlock(),e.createElementBlock("svg",La,[...t[14]||(t[14]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0)],42,za))),128)),H.value||P.value&&!o.searchable?(e.openBlock(),e.createElementBlock("li",Aa,[t[15]||(t[15]=e.createElementVNode("svg",{class:"heba:h-3.5 heba:w-3.5 heba:animate-spin",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[e.createElementVNode("circle",{class:"heba:opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"heba:opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})],-1)),e.createTextVNode(" "+e.toDisplayString(H.value?"Memuat lebih banyak...":"Memuat..."),1)])):F.value||U.value?(e.openBlock(),e.createElementBlock("li",Oa,[t[16]||(t[16]=e.createElementVNode("span",null,"Gagal memuat data.",-1)),e.createElementVNode("button",{type:"button",class:"heba:font-semibold heba:underline-offset-2 heba:hover:underline",onClick:oe}," Coba lagi ")])):e.createCommentVNode("",!0)],40,Ta)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"heba:px-3 heba:py-6 heba:text-center heba:text-sm",onMousedown:t[4]||(t[4]=e.withModifiers(()=>{},["prevent"]))},[ve.value?(e.openBlock(),e.createElementBlock("div",Ma,[...t[12]||(t[12]=[e.createElementVNode("svg",{class:"heba:h-4 heba:w-4 heba:animate-spin",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[e.createElementVNode("circle",{class:"heba:opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"heba:opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})],-1),e.createTextVNode(" Memuat... ",-1)])])):F.value?(e.openBlock(),e.createElementBlock("div",$a,[t[13]||(t[13]=e.createElementVNode("span",null,"Gagal memuat data.",-1)),e.createElementVNode("button",{type:"button",class:"heba:rounded-md heba:border heba:border-danger-200 heba:px-3 heba:py-1 heba:text-xs heba:font-semibold heba:hover:bg-danger-50",onClick:oe}," Coba lagi ")])):(e.openBlock(),e.createElementBlock("div",Sa,[e.renderSlot(a.$slots,"empty",{search:C.value},()=>[e.createTextVNode(e.toDisplayString(o.emptyText),1)])]))],32))],2)):e.createCommentVNode("",!0)]),o.error?(e.openBlock(),e.createElementBlock("p",Ia,e.toDisplayString(o.error),1)):e.createCommentVNode("",!0)],512))}}),ja={key:0,class:"heba:flex heba:items-center heba:gap-3 heba:bg-white heba:rounded-xl heba:shadow-lg heba:overflow-hidden heba:min-w-72 heba:max-w-sm heba:pr-4 heba:py-3",role:"alert"},Ka={key:0,class:"heba:w-4 heba:h-4 heba:text-white",viewBox:"0 0 20 20",fill:"currentColor"},Pa={key:1,class:"heba:w-4 heba:h-4 heba:text-white",viewBox:"0 0 20 20",fill:"currentColor"},Ua={key:2,class:"heba:w-4 heba:h-4 heba:text-white",viewBox:"0 0 20 20",fill:"currentColor"},qa={key:3,class:"heba:w-4 heba:h-4 heba:text-white",viewBox:"0 0 20 20",fill:"currentColor"},Fa={class:"heba:text-sm heba:font-semibold heba:text-secondary-900 heba:flex-1"},ce=e.defineComponent({__name:"HebaToast",props:{message:{},variant:{default:"info"},visible:{type:Boolean,default:!0}},setup(o){const i=o,r=e.computed(()=>({success:"heba:bg-success-500",danger:"heba:bg-danger-500",warning:"heba:bg-warning-600",info:"heba:bg-info-500"})[i.variant]),n=e.computed(()=>({success:"heba:bg-success-500",danger:"heba:bg-danger-500",warning:"heba:bg-warning-600",info:"heba:bg-info-500"})[i.variant]);return(c,u)=>(e.openBlock(),e.createBlock(e.Transition,{"enter-active-class":"heba:transition heba:duration-300 heba:ease-out","enter-from-class":"heba:translate-x-full heba:opacity-0","enter-to-class":"heba:translate-x-0 heba:opacity-100","leave-active-class":"heba:transition heba:duration-200 heba:ease-in","leave-from-class":"heba:translate-x-0 heba:opacity-100","leave-to-class":"heba:translate-x-full heba:opacity-0"},{default:e.withCtx(()=>[o.visible?(e.openBlock(),e.createElementBlock("div",ja,[e.createElementVNode("div",{class:e.normalizeClass(["heba:w-1 heba:self-stretch heba:rounded-r-full heba:shrink-0",r.value])},null,2),e.createElementVNode("div",{class:e.normalizeClass(["heba:flex heba:items-center heba:justify-center heba:w-8 heba:h-8 heba:rounded-full heba:shrink-0",n.value])},[o.variant==="success"?(e.openBlock(),e.createElementBlock("svg",Ka,[...u[0]||(u[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z","clip-rule":"evenodd"},null,-1)])])):o.variant==="danger"?(e.openBlock(),e.createElementBlock("svg",Pa,[...u[1]||(u[1]=[e.createElementVNode("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"},null,-1)])])):o.variant==="warning"?(e.openBlock(),e.createElementBlock("svg",Ua,[...u[2]||(u[2]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",qa,[...u[3]||(u[3]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z","clip-rule":"evenodd"},null,-1)])]))],2),e.createElementVNode("p",Fa,e.toDisplayString(o.message),1)])):e.createCommentVNode("",!0)]),_:1}))}}),ae=Symbol.for("heba-toast");let Ra=0;function Ne(){const o=e.ref([]);function i(r,n="info",c=3e3){const u=++Ra;o.value.push({id:u,message:r,variant:n,visible:!0}),setTimeout(()=>{const x=o.value.find(g=>g.id===u);x&&(x.visible=!1),setTimeout(()=>{o.value=o.value.filter(g=>g.id!==u)},250)},c)}return{toasts:o,add:i}}const Ga={class:"heba:fixed heba:top-4 heba:right-4 heba:z-[9999] heba:flex heba:flex-col heba:gap-3 heba:pointer-events-none"},Me=e.defineComponent({__name:"HebaToastContainer",setup(o){const{toasts:i}=e.inject(ae);return(r,n)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",Ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),c=>(e.openBlock(),e.createElementBlock("div",{key:c.id,class:"heba:pointer-events-auto"},[e.createVNode(ce,{message:c.message,variant:c.variant,visible:c.visible},null,8,["message","variant","visible"])]))),128))])]))}}),Ya=Object.freeze(Object.defineProperty({__proto__:null,HebaBadge:we,HebaButton:Be,HebaInput:Ee,HebaModal:Ve,HebaSelect2:Ce,HebaToast:ce,HebaToastContainer:Me},Symbol.toStringTag,{value:"Module"}));function Qa(){const o=e.inject(ae);if(!o)throw new Error("[HebaUI] useToast() requires HebaToastContainer to be mounted and HebaUI plugin installed.");return{success:(i,r)=>o.add(i,"success",r),danger:(i,r)=>o.add(i,"danger",r),warning:(i,r)=>o.add(i,"warning",r),info:(i,r)=>o.add(i,"info",r),show:(i,r="info",n)=>o.add(i,r,n)}}const $e={install(o){for(const[r,n]of Object.entries(Ya))o.component(r,n);const i=Ne();o.provide(ae,i)}};exports.HebaBadge=we;exports.HebaButton=Be;exports.HebaInput=Ee;exports.HebaModal=Ve;exports.HebaSelect2=Ce;exports.HebaToast=ce;exports.HebaToastContainer=Me;exports.HebaUI=$e;exports.TOAST_STATE_KEY=ae;exports.createToastState=Ne;exports.default=$e;exports.useToast=Qa;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
3
|
+
import { ComponentProvideOptions } from 'vue';
|
|
4
|
+
import { DefineComponent } from 'vue';
|
|
5
|
+
import { InjectionKey } from 'vue';
|
|
6
|
+
import { PublicProps } from 'vue';
|
|
7
|
+
import { ref } from 'vue';
|
|
8
|
+
|
|
9
|
+
declare const __VLS_component: DefineComponent<TProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<TProps> & Readonly<{}>, {
|
|
10
|
+
variant: "secondary" | "info" | "success" | "warning" | "danger";
|
|
11
|
+
size: "sm" | "md" | "lg";
|
|
12
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
13
|
+
|
|
14
|
+
declare const __VLS_component_2: DefineComponent<TProps_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<TProps_2> & Readonly<{}>, {
|
|
15
|
+
variant: "info" | "secondary" | "success" | "danger" | "warning";
|
|
16
|
+
size: "sm" | "md" | "lg";
|
|
17
|
+
rounded: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "none";
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
|
|
21
|
+
declare const __VLS_component_3: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
22
|
+
"update:modelValue": (value: string | number) => any;
|
|
23
|
+
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
24
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
25
|
+
}>, {
|
|
26
|
+
type: "text" | "email" | "password" | "number" | "date" | "select" | "textarea";
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
readonly: boolean;
|
|
29
|
+
required: boolean;
|
|
30
|
+
rows: number;
|
|
31
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
|
|
33
|
+
declare const __VLS_component_4: DefineComponent<__VLS_PublicProps_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
34
|
+
"update:modelValue": (value: boolean) => any;
|
|
35
|
+
"on:close": () => any;
|
|
36
|
+
}, string, PublicProps, Readonly<__VLS_PublicProps_2> & Readonly<{
|
|
37
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
38
|
+
"onOn:close"?: (() => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
size: "sm" | "md" | "lg";
|
|
41
|
+
closeOnBackdrop: boolean;
|
|
42
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
43
|
+
|
|
44
|
+
declare const __VLS_component_5: DefineComponent<TProps_5, {
|
|
45
|
+
open: typeof openDropdown;
|
|
46
|
+
close: () => void;
|
|
47
|
+
focus: typeof focus_2;
|
|
48
|
+
reload: typeof reload;
|
|
49
|
+
loadMore: typeof loadMore;
|
|
50
|
+
retry: typeof retry;
|
|
51
|
+
retrySelected: typeof retrySelected;
|
|
52
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
53
|
+
search: (query: string) => any;
|
|
54
|
+
error: (error: unknown, context: {
|
|
55
|
+
type: "options" | "selected";
|
|
56
|
+
search?: string;
|
|
57
|
+
page?: number;
|
|
58
|
+
values?: SelectValue[];
|
|
59
|
+
}) => any;
|
|
60
|
+
"update:modelValue": (value: SelectModelValue) => any;
|
|
61
|
+
"update:selected": (selected: SelectOption | SelectOption[] | null) => any;
|
|
62
|
+
load: (payload: {
|
|
63
|
+
search: string;
|
|
64
|
+
page: number;
|
|
65
|
+
options: SelectOption[];
|
|
66
|
+
hasMore: boolean;
|
|
67
|
+
}) => any;
|
|
68
|
+
change: (value: SelectModelValue, selected: SelectOption | SelectOption[] | null) => any;
|
|
69
|
+
clear: () => any;
|
|
70
|
+
open: () => any;
|
|
71
|
+
close: () => any;
|
|
72
|
+
}, string, PublicProps, Readonly<TProps_5> & Readonly<{
|
|
73
|
+
onSearch?: ((query: string) => any) | undefined;
|
|
74
|
+
onError?: ((error: unknown, context: {
|
|
75
|
+
type: "options" | "selected";
|
|
76
|
+
search?: string;
|
|
77
|
+
page?: number;
|
|
78
|
+
values?: SelectValue[];
|
|
79
|
+
}) => any) | undefined;
|
|
80
|
+
"onUpdate:modelValue"?: ((value: SelectModelValue) => any) | undefined;
|
|
81
|
+
"onUpdate:selected"?: ((selected: SelectOption | SelectOption[] | null) => any) | undefined;
|
|
82
|
+
onLoad?: ((payload: {
|
|
83
|
+
search: string;
|
|
84
|
+
page: number;
|
|
85
|
+
options: SelectOption[];
|
|
86
|
+
hasMore: boolean;
|
|
87
|
+
}) => any) | undefined;
|
|
88
|
+
onChange?: ((value: SelectModelValue, selected: SelectOption | SelectOption[] | null) => any) | undefined;
|
|
89
|
+
onClear?: (() => any) | undefined;
|
|
90
|
+
onOpen?: (() => any) | undefined;
|
|
91
|
+
onClose?: (() => any) | undefined;
|
|
92
|
+
}>, {
|
|
93
|
+
placeholder: string;
|
|
94
|
+
modelValue: SelectModelValue;
|
|
95
|
+
options: SelectOption[];
|
|
96
|
+
labelKey: string;
|
|
97
|
+
valueKey: string;
|
|
98
|
+
debounce: number;
|
|
99
|
+
limit: number;
|
|
100
|
+
searchPlaceholder: string;
|
|
101
|
+
emptyText: string;
|
|
102
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
103
|
+
rootEl: HTMLDivElement;
|
|
104
|
+
controlEl: HTMLDivElement;
|
|
105
|
+
searchEl: HTMLInputElement;
|
|
106
|
+
listEl: HTMLUListElement;
|
|
107
|
+
}, HTMLDivElement>;
|
|
108
|
+
|
|
109
|
+
declare type __VLS_Props = TProps_3;
|
|
110
|
+
|
|
111
|
+
declare type __VLS_Props_2 = TProps_4;
|
|
112
|
+
|
|
113
|
+
declare type __VLS_Props_3 = {
|
|
114
|
+
message: string;
|
|
115
|
+
variant?: 'success' | 'danger' | 'warning' | 'info';
|
|
116
|
+
visible?: boolean;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
declare type __VLS_PublicProps = {
|
|
120
|
+
modelValue?: string | number;
|
|
121
|
+
} & __VLS_Props;
|
|
122
|
+
|
|
123
|
+
declare type __VLS_PublicProps_2 = {
|
|
124
|
+
modelValue?: boolean;
|
|
125
|
+
} & __VLS_Props_2;
|
|
126
|
+
|
|
127
|
+
declare function __VLS_template(): {
|
|
128
|
+
attrs: Partial<{}>;
|
|
129
|
+
slots: {
|
|
130
|
+
default?(_: {}): any;
|
|
131
|
+
};
|
|
132
|
+
refs: {};
|
|
133
|
+
rootEl: HTMLSpanElement;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
declare function __VLS_template_2(): {
|
|
137
|
+
attrs: Partial<{}>;
|
|
138
|
+
slots: {
|
|
139
|
+
default?(_: {}): any;
|
|
140
|
+
};
|
|
141
|
+
refs: {};
|
|
142
|
+
rootEl: any;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
declare function __VLS_template_3(): {
|
|
146
|
+
attrs: Partial<{}>;
|
|
147
|
+
slots: Readonly<{
|
|
148
|
+
default?(): unknown;
|
|
149
|
+
prepend?(): unknown;
|
|
150
|
+
append?(): unknown;
|
|
151
|
+
}> & {
|
|
152
|
+
default?(): unknown;
|
|
153
|
+
prepend?(): unknown;
|
|
154
|
+
append?(): unknown;
|
|
155
|
+
};
|
|
156
|
+
refs: {};
|
|
157
|
+
rootEl: any;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
declare function __VLS_template_4(): {
|
|
161
|
+
attrs: Partial<{}>;
|
|
162
|
+
slots: {
|
|
163
|
+
header?(_: {}): any;
|
|
164
|
+
default?(_: {}): any;
|
|
165
|
+
footer?(_: {}): any;
|
|
166
|
+
};
|
|
167
|
+
refs: {};
|
|
168
|
+
rootEl: any;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
declare function __VLS_template_5(): {
|
|
172
|
+
attrs: Partial<{}>;
|
|
173
|
+
slots: Readonly<{
|
|
174
|
+
option?(props: {
|
|
175
|
+
option: SelectOption;
|
|
176
|
+
label: string;
|
|
177
|
+
value: SelectValue;
|
|
178
|
+
selected: boolean;
|
|
179
|
+
active: boolean;
|
|
180
|
+
}): unknown;
|
|
181
|
+
selected?(props: {
|
|
182
|
+
option: SelectOption;
|
|
183
|
+
label: string;
|
|
184
|
+
value: SelectValue;
|
|
185
|
+
}): unknown;
|
|
186
|
+
empty?(props: {
|
|
187
|
+
search: string;
|
|
188
|
+
}): unknown;
|
|
189
|
+
}> & {
|
|
190
|
+
option?(props: {
|
|
191
|
+
option: SelectOption;
|
|
192
|
+
label: string;
|
|
193
|
+
value: SelectValue;
|
|
194
|
+
selected: boolean;
|
|
195
|
+
active: boolean;
|
|
196
|
+
}): unknown;
|
|
197
|
+
selected?(props: {
|
|
198
|
+
option: SelectOption;
|
|
199
|
+
label: string;
|
|
200
|
+
value: SelectValue;
|
|
201
|
+
}): unknown;
|
|
202
|
+
empty?(props: {
|
|
203
|
+
search: string;
|
|
204
|
+
}): unknown;
|
|
205
|
+
};
|
|
206
|
+
refs: {
|
|
207
|
+
rootEl: HTMLDivElement;
|
|
208
|
+
controlEl: HTMLDivElement;
|
|
209
|
+
searchEl: HTMLInputElement;
|
|
210
|
+
listEl: HTMLUListElement;
|
|
211
|
+
};
|
|
212
|
+
rootEl: HTMLDivElement;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
216
|
+
|
|
217
|
+
declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
|
|
218
|
+
|
|
219
|
+
declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
|
|
220
|
+
|
|
221
|
+
declare type __VLS_TemplateResult_4 = ReturnType<typeof __VLS_template_4>;
|
|
222
|
+
|
|
223
|
+
declare type __VLS_TemplateResult_5 = ReturnType<typeof __VLS_template_5>;
|
|
224
|
+
|
|
225
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
226
|
+
new (): {
|
|
227
|
+
$slots: S;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
declare type __VLS_WithTemplateSlots_2<T, S> = T & {
|
|
232
|
+
new (): {
|
|
233
|
+
$slots: S;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
declare type __VLS_WithTemplateSlots_3<T, S> = T & {
|
|
238
|
+
new (): {
|
|
239
|
+
$slots: S;
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
declare type __VLS_WithTemplateSlots_4<T, S> = T & {
|
|
244
|
+
new (): {
|
|
245
|
+
$slots: S;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
declare type __VLS_WithTemplateSlots_5<T, S> = T & {
|
|
250
|
+
new (): {
|
|
251
|
+
$slots: S;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
export declare function createToastState(): ToastState;
|
|
256
|
+
|
|
257
|
+
export declare type FetchOptions = (params: FetchOptionsParams) => Promise<SelectOption[] | FetchOptionsResult>;
|
|
258
|
+
|
|
259
|
+
export declare interface FetchOptionsParams {
|
|
260
|
+
search: string;
|
|
261
|
+
page: number;
|
|
262
|
+
limit: number;
|
|
263
|
+
signal?: AbortSignal;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export declare interface FetchOptionsResult {
|
|
267
|
+
data: SelectOption[];
|
|
268
|
+
hasMore?: boolean;
|
|
269
|
+
total?: number;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export declare type FetchSelectedOptions = (values: SelectValue | SelectValue[]) => Promise<SelectOption | SelectOption[] | null | undefined>;
|
|
273
|
+
|
|
274
|
+
declare function focus_2(): void;
|
|
275
|
+
|
|
276
|
+
export declare const HebaBadge: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
277
|
+
|
|
278
|
+
export declare const HebaButton: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
|
|
279
|
+
|
|
280
|
+
export declare const HebaInput: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
281
|
+
|
|
282
|
+
export declare const HebaModal: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
|
|
283
|
+
|
|
284
|
+
export declare const HebaSelect2: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, __VLS_TemplateResult_5["slots"]>;
|
|
285
|
+
|
|
286
|
+
export declare const HebaToast: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{}>, {
|
|
287
|
+
variant: "success" | "danger" | "warning" | "info";
|
|
288
|
+
visible: boolean;
|
|
289
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
290
|
+
|
|
291
|
+
export declare const HebaToastContainer: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
292
|
+
|
|
293
|
+
declare const HebaUI: {
|
|
294
|
+
install(app: App): void;
|
|
295
|
+
};
|
|
296
|
+
export { HebaUI }
|
|
297
|
+
export default HebaUI;
|
|
298
|
+
|
|
299
|
+
declare function loadMore(): void;
|
|
300
|
+
|
|
301
|
+
declare function openDropdown(): void;
|
|
302
|
+
|
|
303
|
+
declare function reload(): void;
|
|
304
|
+
|
|
305
|
+
declare function retry(): void;
|
|
306
|
+
|
|
307
|
+
declare function retrySelected(): void;
|
|
308
|
+
|
|
309
|
+
export declare type SelectedStatus = 'ready' | 'loading' | 'missing' | 'error';
|
|
310
|
+
|
|
311
|
+
export declare type SelectModelValue = SelectValue | SelectValue[] | null;
|
|
312
|
+
|
|
313
|
+
export declare type SelectOption = Record<string, any>;
|
|
314
|
+
|
|
315
|
+
export declare type SelectValue = string | number;
|
|
316
|
+
|
|
317
|
+
export declare const TOAST_STATE_KEY: InjectionKey<ToastState>;
|
|
318
|
+
|
|
319
|
+
declare interface ToastItem {
|
|
320
|
+
id: number;
|
|
321
|
+
message: string;
|
|
322
|
+
variant: 'success' | 'danger' | 'warning' | 'info';
|
|
323
|
+
visible: boolean;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
declare interface ToastState {
|
|
327
|
+
toasts: ReturnType<typeof ref<ToastItem[]>>;
|
|
328
|
+
add: (message: string, variant: ToastItem['variant'], duration?: number) => void;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
declare interface TProps {
|
|
332
|
+
variant?: "secondary" | "info" | "success" | "warning" | "danger";
|
|
333
|
+
size?: "sm" | "md" | "lg";
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
declare interface TProps_2 {
|
|
337
|
+
variant?: 'info' | 'secondary' | 'success' | 'danger' | 'warning';
|
|
338
|
+
size?: 'sm' | 'md' | 'lg';
|
|
339
|
+
rounded?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | 'none';
|
|
340
|
+
disabled?: boolean;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
declare interface TProps_3 {
|
|
344
|
+
label?: string;
|
|
345
|
+
placeholder?: string;
|
|
346
|
+
type?: "text" | "email" | "password" | "number" | "date" | "select" | "textarea";
|
|
347
|
+
error?: string;
|
|
348
|
+
hint?: string;
|
|
349
|
+
disabled?: boolean;
|
|
350
|
+
readonly?: boolean;
|
|
351
|
+
required?: boolean;
|
|
352
|
+
rows?: number;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
declare interface TProps_4 {
|
|
356
|
+
title?: string;
|
|
357
|
+
subtitle?: string;
|
|
358
|
+
size?: "sm" | "md" | "lg";
|
|
359
|
+
closeOnBackdrop?: boolean;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
declare interface TProps_5 {
|
|
363
|
+
modelValue?: SelectModelValue;
|
|
364
|
+
options?: SelectOption[];
|
|
365
|
+
multiple?: boolean;
|
|
366
|
+
searchable?: boolean;
|
|
367
|
+
clearable?: boolean;
|
|
368
|
+
disabled?: boolean;
|
|
369
|
+
readonly?: boolean;
|
|
370
|
+
labelKey?: string;
|
|
371
|
+
valueKey?: string;
|
|
372
|
+
remote?: boolean;
|
|
373
|
+
loading?: boolean;
|
|
374
|
+
debounce?: number;
|
|
375
|
+
limit?: number;
|
|
376
|
+
fetchOptions?: FetchOptions;
|
|
377
|
+
fetchSelectedOptions?: FetchSelectedOptions;
|
|
378
|
+
fallbackLabel?: (value: SelectValue) => string;
|
|
379
|
+
label?: string;
|
|
380
|
+
placeholder?: string;
|
|
381
|
+
searchPlaceholder?: string;
|
|
382
|
+
emptyText?: string;
|
|
383
|
+
error?: string;
|
|
384
|
+
hint?: string;
|
|
385
|
+
required?: boolean;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export declare function useToast(): {
|
|
389
|
+
success: (message: string, duration?: number) => void;
|
|
390
|
+
danger: (message: string, duration?: number) => void;
|
|
391
|
+
warning: (message: string, duration?: number) => void;
|
|
392
|
+
info: (message: string, duration?: number) => void;
|
|
393
|
+
show: (message: string, variant?: ToastItem["variant"], duration?: number) => void;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
export { }
|