hisonvue 1.0.0 → 1.0.2

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.
Files changed (125) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +248 -248
  3. package/dist/{HAccordion-ll-4cIAw.mjs → HAccordion-DXNoziwY.mjs} +14 -14
  4. package/dist/{HAccordion-CPtgQUK0.js → HAccordion-FatqOgy2.js} +1 -1
  5. package/dist/{HBaggie-D_7mEiuV.mjs → HBaggie-C4qcuGl9.mjs} +2 -2
  6. package/dist/{HBaggie-D6omQoFh.js → HBaggie-DWSes7QC.js} +1 -1
  7. package/dist/{HBanner-Io4SdGGs.js → HBanner-D2IVlykU.js} +1 -1
  8. package/dist/{HBanner-DmcMOFqS.mjs → HBanner-DNOhDRli.mjs} +46 -46
  9. package/dist/{HButton-DAVuDmOQ.js → HButton-D3aVYVY3.js} +1 -1
  10. package/dist/{HButton-DAriO81x.mjs → HButton-Dhyb_Apz.mjs} +2 -2
  11. package/dist/HCalendar-BB0XyvZV.js +2 -0
  12. package/dist/{HCalendar-w18iIB90.mjs → HCalendar-Bv1mZ6DG.mjs} +7 -7
  13. package/dist/{HCaption-6CbSqRA7.js → HCaption-2Wpf8L9R.js} +1 -1
  14. package/dist/{HCaption-DwsXHDNK.mjs → HCaption-BKJlg7ZH.mjs} +1 -1
  15. package/dist/{HChart-C86JXUyW.js → HChart-BEe_bo5V.js} +1 -1
  16. package/dist/{HChart-CcArHFr0.mjs → HChart-H5M0gQB0.mjs} +1 -1
  17. package/dist/{HDrawer-DG1O42iF.mjs → HDrawer-BYrUd-eA.mjs} +47 -47
  18. package/dist/HDrawer-CWkLJyMS.js +1 -0
  19. package/dist/{HDropdown-D4RAGmjE.js → HDropdown-DTaeDC5I.js} +1 -1
  20. package/dist/{HDropdown-Bs7AfefJ.mjs → HDropdown-Dpba4jMR.mjs} +13 -13
  21. package/dist/{HFileset-CuPR6Hwf.js → HFileset-CWDMfYdY.js} +1 -1
  22. package/dist/{HFileset-BGuP9O4l.mjs → HFileset-Qo0JIgMJ.mjs} +1 -1
  23. package/dist/{HGap-DzGrfWVt.mjs → HGap-B5lrnzJ6.mjs} +1 -1
  24. package/dist/{HGap-BPAdnOQz.js → HGap-Bcl_WYxa.js} +1 -1
  25. package/dist/{HGrid-BiIhVCv_.mjs → HGrid-59dIVp9V.mjs} +1 -1
  26. package/dist/{HGrid-C3EV_pgM.js → HGrid-f8xHSk9C.js} +1 -1
  27. package/dist/{HImagebox-t_UdFjQO.js → HImagebox-DIYXXh95.js} +1 -1
  28. package/dist/{HImagebox-D_DKeCrO.mjs → HImagebox-G-LvB26S.mjs} +1 -1
  29. package/dist/{HInput-BEyJqYkD.mjs → HInput-C9rOBXqc.mjs} +1 -1
  30. package/dist/{HInput-DMGLY473.js → HInput-PgalO88P.js} +1 -1
  31. package/dist/{HInputGroup-D37WTYoI.mjs → HInputGroup-BaK14hkQ.mjs} +1 -1
  32. package/dist/{HInputGroup-Dcfr23sZ.js → HInputGroup-XryXR-6k.js} +1 -1
  33. package/dist/{HLabel-Dm48mSwn.js → HLabel-CbQeG2R3.js} +1 -1
  34. package/dist/{HLabel-B2FOqSiS.mjs → HLabel-jbc0_u5J.mjs} +2 -2
  35. package/dist/{HLayout-C1e4BZ_K.js → HLayout-CUwfApcb.js} +1 -1
  36. package/dist/{HLayout-BbCEm_aO.mjs → HLayout-DmTQQmLs.mjs} +2 -2
  37. package/dist/{HList-eNXmMf27.js → HList-DCupvbju.js} +1 -1
  38. package/dist/{HList-CAeYb-hz.mjs → HList-rD5kL7cI.mjs} +2 -2
  39. package/dist/{HModal-BDBEEpKm.mjs → HModal-XDNcukop.mjs} +1 -1
  40. package/dist/{HModal-GODLq3wH.js → HModal-eniLW2gp.js} +1 -1
  41. package/dist/{HNote-CWnUjt3_.mjs → HNote-BA3umb5e.mjs} +1 -1
  42. package/dist/{HNote-D_Xwu9oL.js → HNote-DzeszCEe.js} +1 -1
  43. package/dist/{HPagination-Db_L9wv-.js → HPagination-BS4l4xGP.js} +1 -1
  44. package/dist/{HPagination-e5e2a5GS.mjs → HPagination-CgufEtL4.mjs} +15 -15
  45. package/dist/{HParagraph-BRuSeOMU.js → HParagraph-DPFx64UD.js} +1 -1
  46. package/dist/{HParagraph-DYuB-qjY.mjs → HParagraph-hCHZmj-4.mjs} +1 -1
  47. package/dist/{HPopup-Brp1FVpm.mjs → HPopup-BfPYzBy6.mjs} +1 -1
  48. package/dist/{HPopup-ChkoI3xm.js → HPopup-NBwn8RA4.js} +1 -1
  49. package/dist/{HSpinner-DOq2k5kT.mjs → HSpinner-1UQgVEve.mjs} +6 -6
  50. package/dist/{HSpinner-DDtU9PL_.js → HSpinner-CMsmFVOv.js} +1 -1
  51. package/dist/{HTable-GCDP5O_J.mjs → HTable-BUIKSXIR.mjs} +1 -1
  52. package/dist/{HTable-DGFnzD4u.js → HTable-Dweedemn.js} +1 -1
  53. package/dist/ar.es-C08a05mp.mjs +57 -0
  54. package/dist/{bg.es-BJ7fu6yy.mjs → bg.es-BxUPtB2r.mjs} +15 -15
  55. package/dist/bn.es-J9yOJsGH.mjs +57 -0
  56. package/dist/{bs.es-yMnaKmdi.mjs → bs.es-Fq6ZEbY-.mjs} +13 -13
  57. package/dist/{ca.es-DIhlxmQc.mjs → ca.es-Bu3i72ow.mjs} +21 -21
  58. package/dist/{cs.es-BN8oxRXQ.mjs → cs.es-CeLWs7BX.mjs} +19 -19
  59. package/dist/da.es-BkbgeF4x.mjs +57 -0
  60. package/dist/{de.es-glb8GeJh.mjs → de.es-Dxj10D7g.mjs} +15 -15
  61. package/dist/{drag-and-drop.es-Ckzp6XEn.mjs → drag-and-drop.es-CoYQRahm.mjs} +1 -1
  62. package/dist/drag-and-drop.es-DWn92Mem.js +5 -0
  63. package/dist/{el.es-_bBZf22h.mjs → el.es-BcvYhsc8.mjs} +23 -23
  64. package/dist/{en.es-CV9nmQGr.mjs → en.es-stDfj1fG.mjs} +11 -11
  65. package/dist/es.es-DJ9hC3M1.mjs +57 -0
  66. package/dist/{et.es-CjvQAzNF.mjs → et.es-Bh__rR0h.mjs} +20 -20
  67. package/dist/fa.es-CyoM_QAj.mjs +57 -0
  68. package/dist/{he.es-nF4GFhjH.mjs → he.es-Bytj24fj.mjs} +21 -21
  69. package/dist/hisonvue.cjs.js +1 -1
  70. package/dist/hisonvue.css +1 -1
  71. package/dist/hisonvue.d.ts +9 -9
  72. package/dist/hisonvue.es.js +2 -2
  73. package/dist/{hr.es-QFfz660j.mjs → hr.es-DjKclO4X.mjs} +15 -15
  74. package/dist/{hu.es-Ck2rE01V.mjs → hu.es-CgiNeVVu.mjs} +21 -21
  75. package/dist/index-CKU70ocu.js +153 -0
  76. package/dist/{index-DUh7pai4.mjs → index-p1EBArRP.mjs} +889 -889
  77. package/dist/is.es-yRheRWhc.mjs +57 -0
  78. package/dist/ja.es-CALG6dhe.mjs +57 -0
  79. package/dist/{ka.es-x9QJo_dl.mjs → ka.es-6dlQBWDo.mjs} +20 -20
  80. package/dist/ko.es-BU6TVPXM.mjs +57 -0
  81. package/dist/mn.es-CY_Brq9B.mjs +57 -0
  82. package/dist/{nl.es-bB1qWR_S.mjs → nl.es-CN5JXXxr.mjs} +15 -15
  83. package/dist/no.es-BZkgoly8.mjs +57 -0
  84. package/dist/{pl.es-Dzct23w9.mjs → pl.es-BJ9nIcgc.mjs} +21 -21
  85. package/dist/pt-br.es-DEhn4BON.mjs +57 -0
  86. package/dist/pt-pt.es-DEhn4BON.mjs +57 -0
  87. package/dist/ro.es-CsOras9g.mjs +57 -0
  88. package/dist/{ru.es-Bv9UvrBe.mjs → ru.es-CPzb0Fst.mjs} +23 -23
  89. package/dist/{setButtonCssEvent-B9WTs2X7.js → setButtonCssEvent-BoBQS2-T.js} +1 -1
  90. package/dist/{setButtonCssEvent-dBs1GcAh.mjs → setButtonCssEvent-CB-7jMmJ.mjs} +1 -1
  91. package/dist/sk.es-D6YtHvSy.mjs +57 -0
  92. package/dist/{sl.es-DeIGgZbR.mjs → sl.es-D0fiCGIm.mjs} +16 -16
  93. package/dist/{sq.es-CQJJrZHv.mjs → sq.es-a8QTS1Hv.mjs} +17 -17
  94. package/dist/{sr.es-CKS0AkiW.mjs → sr.es-CIc0WPBO.mjs} +13 -13
  95. package/dist/sv.es-DFVxHUOu.mjs +57 -0
  96. package/dist/tr.es-CXIKJ2UV.mjs +57 -0
  97. package/dist/{uk.es-CiR4NnbN.mjs → uk.es-BvUxN5ag.mjs} +23 -23
  98. package/dist/{vi.es-DFDi5l7p.mjs → vi.es-C0AyhgP1.mjs} +26 -26
  99. package/dist/zh-cn.es-AODwJ7q7.mjs +67 -0
  100. package/dist/zh-hk.es-Bdbs8ke2.mjs +67 -0
  101. package/nuxt/module.mjs +39 -39
  102. package/nuxt/plugin.mjs +21 -21
  103. package/package.json +53 -53
  104. package/dist/HCalendar-DKwGatUk.js +0 -2
  105. package/dist/HDrawer-U5VC_okK.js +0 -1
  106. package/dist/ar.es-XxSuE68c.mjs +0 -57
  107. package/dist/bn.es-CYlBkxc5.mjs +0 -57
  108. package/dist/da.es-DJB5lAli.mjs +0 -57
  109. package/dist/drag-and-drop.es-4ttM1tRs.js +0 -5
  110. package/dist/es.es-CZjcWK54.mjs +0 -57
  111. package/dist/fa.es-DykeFwDA.mjs +0 -57
  112. package/dist/index-BmKMHsSZ.js +0 -153
  113. package/dist/is.es-bzprHvXI.mjs +0 -57
  114. package/dist/ja.es-BaiGjqZ6.mjs +0 -57
  115. package/dist/ko.es-6c447eTS.mjs +0 -57
  116. package/dist/mn.es-BLQRG1uu.mjs +0 -57
  117. package/dist/no.es-CWDVXpTf.mjs +0 -57
  118. package/dist/pt-br.es-BeBuiitI.mjs +0 -57
  119. package/dist/pt-pt.es-BeBuiitI.mjs +0 -57
  120. package/dist/ro.es-DfMVJ30M.mjs +0 -57
  121. package/dist/sk.es-CUOTpLuL.mjs +0 -57
  122. package/dist/sv.es-ChHQRrAe.mjs +0 -57
  123. package/dist/tr.es-B3v90gVv.mjs +0 -57
  124. package/dist/zh-cn.es-9cbEAuAi.mjs +0 -67
  125. package/dist/zh-hk.es-z0tio4jE.mjs +0 -67
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 hisondev
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files hisonvue, to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 hisondev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files hisonvue, to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,248 +1,248 @@
1
- # HisonVue
2
-
3
- A **Vue 3 UI component library** designed for enterprise-grade apps.
4
- Built on top of [**hisonjs**](https://github.com/hisondev/hisonjs), it bridges **frontend components** and **backend-ready data utilities** into one unified ecosystem.
5
-
6
- ## ✨ About
7
-
8
- **HisonVue** provides a comprehensive set of UI components with **runtime APIs**, **global theming**, and **SSR compatibility**. It extends the capabilities of [hisonjs](https://www.npmjs.com/package/hisonjs), meaning you not only get visual components but also access to data modeling, API-link communication, utilities, and security features.
9
-
10
- * Written in **TypeScript** with full IntelliSense support
11
- * Works with **Vue CLI, Vite, Nuxt 3 (SSR)** out of the box
12
- * Tree-shakable and modular imports
13
- * CSS variables & responsive class system (`hison-col-*`, `hison-size-*`, `hison-color-*`)
14
- * Runtime control for every component via `hison.component.getXxx(id)`
15
- * Extends `hisonjs` → brings **utils, data models, API-link, shield security**
16
-
17
- ---
18
-
19
- ## 📦 Installation
20
-
21
- ```bash
22
- npm install hisonvue
23
- ```
24
-
25
- Import the global CSS once:
26
-
27
- ```ts
28
- import 'hisonvue/style.css'
29
- ```
30
-
31
- ---
32
-
33
- ## 🚀 Usage
34
-
35
- ### 1️⃣ Global registration (Vue 3 / Vite / Vue CLI)
36
-
37
- ```ts
38
- import { createApp } from 'vue'
39
- import App from './App.vue'
40
- import { hisonvue, getDefaultHisonConfig, Size, type HisonConfig } from 'hisonvue'
41
- import 'hisonvue/style.css'
42
-
43
- const app = createApp(App)
44
-
45
- // Customize global configuration
46
- const hisonConfig: HisonConfig = getDefaultHisonConfig()
47
- hisonConfig.componentStyle.primaryColor = '#123456'
48
- hisonConfig.componentStyle.size = Size.s
49
-
50
- app.use(hisonvue, hisonConfig)
51
- app.mount('#app')
52
- ```
53
-
54
- ✅ Once registered globally, you can use any component:
55
-
56
- ```vue
57
- <HButton id="b1" text="Click" class="hison-color-primary" />
58
- <HLayout class="hison-col-12">
59
- <HLabel text="Hello World" />
60
- </HLayout>
61
- ```
62
-
63
- ---
64
-
65
- ### 2️⃣ Nuxt 3 integration (SSR-ready)
66
-
67
- HisonVue ships with an SSR-safe wrapper (`createSSRClientOnly`). For Nuxt, register via plugin:
68
-
69
- **`/plugins/hisonvue.client.ts`**
70
-
71
- ```ts
72
- import { defineNuxtPlugin } from '#app'
73
- import { hisonvue, getDefaultHisonConfig, Size, type HisonConfig } from 'hisonvue'
74
- import 'hisonvue/style.css'
75
-
76
- export default defineNuxtPlugin((nuxtApp) => {
77
- const config: HisonConfig = getDefaultHisonConfig()
78
- config.componentStyle.primaryColor = '#165DFF'
79
- config.componentStyle.size = Size.m
80
- config.componentStyle.invertColor = false
81
-
82
- nuxtApp.vueApp.use(hisonvue, config)
83
- })
84
- ```
85
-
86
- ✅ Components are globally available in SSR without hydration errors.
87
-
88
- ---
89
-
90
- ### 3️⃣ Runtime control with `hison.component`
91
-
92
- Every component is registered with a unique `id`. Use that to access methods:
93
-
94
- ```vue
95
- <HButton id="b1" text="Left" class="hison-color-primary" />
96
- <HButton id="b2" text="Right" class="hison-color-warning" />
97
- ```
98
-
99
- ```ts
100
- import { hison } from 'hisonvue'
101
-
102
- // Toggle border
103
- const b1 = hison.component.getButton('b1')!
104
- b1.setBorder(!b1.isBorder())
105
-
106
- // Open a modal
107
- const modal = hison.component.getModal('modal01')
108
- modal?.open()
109
- modal?.setCaption('Hello Modal')
110
- ```
111
-
112
- ---
113
-
114
- ### 4️⃣ Global theming with `hison.style`
115
-
116
- Change theme dynamically at runtime:
117
-
118
- ```ts
119
- hison.style.setPrimaryColor('#009688')
120
- hison.style.setSize(Size.l)
121
- hison.style.setInvertColor(true)
122
-
123
- console.log(hison.style.getPrimaryHoverColor())
124
- ```
125
-
126
- ---
127
-
128
- ### 5️⃣ CSS Event Hooks (`hison.cssEvent`)
129
-
130
- Attach global before/after hooks for Button/Input/Textbox events:
131
-
132
- ```ts
133
- hison.cssEvent.setButtonOnBefoerClick((e) => {
134
- console.log('before click', e)
135
- return true // false cancels the click
136
- })
137
-
138
- hison.cssEvent.setButtonOnAfterClick((e) => {
139
- console.log('after click', e)
140
- })
141
- ```
142
-
143
- ⚠️ Note: `Befoer` is intentionally spelled this way in the API — use as-is.
144
-
145
- ---
146
-
147
- ## 📚 Available Components
148
-
149
- HisonVue provides **20+ UI components**:
150
-
151
- * **Layout**: `HLayout`, `HGap`, `HModal`, `HPopup`, `HBanner`, `HAccordion`
152
- * **Form**: `HInput`, `HInputGroup`, `HFileset`, `HImagebox`, `HDropdown`
153
- * **UI Elements**: `HButton`, `HLabel`, `HList`, `HParagraph`, `HBaggie`, `HCaption`
154
- * **Data Views**: `HGrid` (via vanillagrid2), `HTable`, `HNote` (via vanillanote2), `HChart` (via Chart.js), `HCalendar` (via vue-cal)
155
- * **Feedback**: `HSpinner`, `HPagination`, `HDrawer`
156
-
157
- Each component exposes a **typed methods object** via `hison.component.getXxx(id)`.
158
-
159
- ---
160
-
161
- ## ⚙️ Global Configuration (`HisonConfig`)
162
-
163
- `getDefaultHisonConfig()` returns a fully typed configuration object you can customize.
164
-
165
- * **UtilsConfig** → date/time/number formatting defaults
166
- * **ShieldConfig** → security: block devtools, restrict IPs, freeze objects
167
- * **DataConfig** → control how values are copied into `DataModel`
168
- * **LinkConfig** → API-link defaults, before/after hooks
169
- * **ComponentStyle** → global theme (colors, sizes, fonts)
170
- * **Component** → external libs (vanillanote2, vanillagrid2, chart.js)
171
- * **Event.cssEvent** → global CSS hooks
172
-
173
- Example:
174
-
175
- ```ts
176
- const cfg = getDefaultHisonConfig()
177
- cfg.componentStyle.primaryColor = '#222'
178
- cfg.componentStyle.size = Size.s
179
- cfg.link.timeout = 15000
180
- cfg.shield.isPossibleOpenDevTool = false
181
- ```
182
-
183
- ---
184
-
185
- ## 🔗 Extended Hison Interface
186
-
187
- HisonVue exports a singleton `hison` that **extends** `hisonjs.Hison`:
188
-
189
- ✅ All **hisonjs** features:
190
-
191
- * `utils` (string/date/number helpers)
192
- * `data` (DataWrapper, DataModel)
193
- * `link` (API communication with Spring backend)
194
- * `shield` (security: devtool blocking, freeze, URL/IP restrictions)
195
-
196
- ➕ Additional Vue features:
197
-
198
- * `component.getXxx(id)` → runtime control of every Vue component
199
- * `style.setXxx/getXxx` → global theming API
200
- * `cssEvent.setXxx` → global before/after hooks for UI events
201
- * File upload defaults: `setMaxFilesetSize`, `setMaxFilesetTotalSize`
202
-
203
- This makes **hisonvue** a **fullstack bridge** between Vue frontend and Spring backend.
204
-
205
- ---
206
-
207
- ## ✅ Example Fullstack Flow
208
-
209
- ```ts
210
- import { hison } from 'hisonvue'
211
-
212
- // Build request
213
- define const req = new hison.data.DataWrapper({ userId: 1 })
214
-
215
- // Send to Spring backend via api-link
216
- const api = new hison.link.ApiPost("UserService.getUser")
217
- const resp = await api.call(req)
218
-
219
- // Update UI
220
- const btn = hison.component.getButton('saveBtn')
221
- btn?.setDisable(true)
222
-
223
- const note = hison.component.getNote('editor')
224
- note?.setNoteData(resp.data)
225
- ```
226
-
227
- ---
228
-
229
- ## 🛠 Build & Test (Contributors)
230
-
231
- ```bash
232
- git clone https://github.com/hisondev/hisonvue.git
233
- cd hisonvue
234
- npm install
235
-
236
- # Build library
237
- npm run build
238
-
239
- # Run playgrounds
240
- cd playground && npm run dev
241
- cd ../playground-nuxt && npm run dev
242
- ```
243
-
244
- ---
245
-
246
- ## 📄 License
247
-
248
- MIT © hisondev
1
+ # HisonVue
2
+
3
+ A **Vue 3 UI component library** designed for enterprise-grade apps.
4
+ Built on top of [**hisonjs**](https://github.com/hisondev/hisonjs), it bridges **frontend components** and **backend-ready data utilities** into one unified ecosystem.
5
+
6
+ ## ✨ About
7
+
8
+ **HisonVue** provides a comprehensive set of UI components with **runtime APIs**, **global theming**, and **SSR compatibility**. It extends the capabilities of [hisonjs](https://www.npmjs.com/package/hisonjs), meaning you not only get visual components but also access to data modeling, API-link communication, utilities, and security features.
9
+
10
+ * Written in **TypeScript** with full IntelliSense support
11
+ * Works with **Vue CLI, Vite, Nuxt 3 (SSR)** out of the box
12
+ * Tree-shakable and modular imports
13
+ * CSS variables & responsive class system (`hison-col-*`, `hison-size-*`, `hison-color-*`)
14
+ * Runtime control for every component via `hison.component.getXxx(id)`
15
+ * Extends `hisonjs` → brings **utils, data models, API-link, shield security**
16
+
17
+ ---
18
+
19
+ ## 📦 Installation
20
+
21
+ ```bash
22
+ npm install hisonvue
23
+ ```
24
+
25
+ Import the global CSS once:
26
+
27
+ ```ts
28
+ import 'hisonvue/style.css'
29
+ ```
30
+
31
+ ---
32
+
33
+ ## 🚀 Usage
34
+
35
+ ### 1️⃣ Global registration (Vue 3 / Vite / Vue CLI)
36
+
37
+ ```ts
38
+ import { createApp } from 'vue'
39
+ import App from './App.vue'
40
+ import { hisonvue, getDefaultHisonConfig, Size, type HisonConfig } from 'hisonvue'
41
+ import 'hisonvue/style.css'
42
+
43
+ const app = createApp(App)
44
+
45
+ // Customize global configuration
46
+ const hisonConfig: HisonConfig = getDefaultHisonConfig()
47
+ hisonConfig.componentStyle.primaryColor = '#123456'
48
+ hisonConfig.componentStyle.size = Size.s
49
+
50
+ app.use(hisonvue, hisonConfig)
51
+ app.mount('#app')
52
+ ```
53
+
54
+ ✅ Once registered globally, you can use any component:
55
+
56
+ ```vue
57
+ <HButton id="b1" text="Click" class="hison-color-primary" />
58
+ <HLayout class="hison-col-12">
59
+ <HLabel text="Hello World" />
60
+ </HLayout>
61
+ ```
62
+
63
+ ---
64
+
65
+ ### 2️⃣ Nuxt 3 integration (SSR-ready)
66
+
67
+ HisonVue ships with an SSR-safe wrapper (`createSSRClientOnly`). For Nuxt, register via plugin:
68
+
69
+ **`/plugins/hisonvue.client.ts`**
70
+
71
+ ```ts
72
+ import { defineNuxtPlugin } from '#app'
73
+ import { hisonvue, getDefaultHisonConfig, Size, type HisonConfig } from 'hisonvue'
74
+ import 'hisonvue/style.css'
75
+
76
+ export default defineNuxtPlugin((nuxtApp) => {
77
+ const config: HisonConfig = getDefaultHisonConfig()
78
+ config.componentStyle.primaryColor = '#165DFF'
79
+ config.componentStyle.size = Size.m
80
+ config.componentStyle.invertColor = false
81
+
82
+ nuxtApp.vueApp.use(hisonvue, config)
83
+ })
84
+ ```
85
+
86
+ ✅ Components are globally available in SSR without hydration errors.
87
+
88
+ ---
89
+
90
+ ### 3️⃣ Runtime control with `hison.component`
91
+
92
+ Every component is registered with a unique `id`. Use that to access methods:
93
+
94
+ ```vue
95
+ <HButton id="b1" text="Left" class="hison-color-primary" />
96
+ <HButton id="b2" text="Right" class="hison-color-warning" />
97
+ ```
98
+
99
+ ```ts
100
+ import { hison } from 'hisonvue'
101
+
102
+ // Toggle border
103
+ const b1 = hison.component.getButton('b1')!
104
+ b1.setBorder(!b1.isBorder())
105
+
106
+ // Open a modal
107
+ const modal = hison.component.getModal('modal01')
108
+ modal?.open()
109
+ modal?.setCaption('Hello Modal')
110
+ ```
111
+
112
+ ---
113
+
114
+ ### 4️⃣ Global theming with `hison.style`
115
+
116
+ Change theme dynamically at runtime:
117
+
118
+ ```ts
119
+ hison.style.setPrimaryColor('#009688')
120
+ hison.style.setSize(Size.l)
121
+ hison.style.setInvertColor(true)
122
+
123
+ console.log(hison.style.getPrimaryHoverColor())
124
+ ```
125
+
126
+ ---
127
+
128
+ ### 5️⃣ CSS Event Hooks (`hison.cssEvent`)
129
+
130
+ Attach global before/after hooks for Button/Input/Textbox events:
131
+
132
+ ```ts
133
+ hison.cssEvent.setButtonOnBefoerClick((e) => {
134
+ console.log('before click', e)
135
+ return true // false cancels the click
136
+ })
137
+
138
+ hison.cssEvent.setButtonOnAfterClick((e) => {
139
+ console.log('after click', e)
140
+ })
141
+ ```
142
+
143
+ ⚠️ Note: `Befoer` is intentionally spelled this way in the API — use as-is.
144
+
145
+ ---
146
+
147
+ ## 📚 Available Components
148
+
149
+ HisonVue provides **20+ UI components**:
150
+
151
+ * **Layout**: `HLayout`, `HGap`, `HModal`, `HPopup`, `HBanner`, `HAccordion`
152
+ * **Form**: `HInput`, `HInputGroup`, `HFileset`, `HImagebox`, `HDropdown`
153
+ * **UI Elements**: `HButton`, `HLabel`, `HList`, `HParagraph`, `HBaggie`, `HCaption`
154
+ * **Data Views**: `HGrid` (via vanillagrid2), `HTable`, `HNote` (via vanillanote2), `HChart` (via Chart.js), `HCalendar` (via vue-cal)
155
+ * **Feedback**: `HSpinner`, `HPagination`, `HDrawer`
156
+
157
+ Each component exposes a **typed methods object** via `hison.component.getXxx(id)`.
158
+
159
+ ---
160
+
161
+ ## ⚙️ Global Configuration (`HisonConfig`)
162
+
163
+ `getDefaultHisonConfig()` returns a fully typed configuration object you can customize.
164
+
165
+ * **UtilsConfig** → date/time/number formatting defaults
166
+ * **ShieldConfig** → security: block devtools, restrict IPs, freeze objects
167
+ * **DataConfig** → control how values are copied into `DataModel`
168
+ * **LinkConfig** → API-link defaults, before/after hooks
169
+ * **ComponentStyle** → global theme (colors, sizes, fonts)
170
+ * **Component** → external libs (vanillanote2, vanillagrid2, chart.js)
171
+ * **Event.cssEvent** → global CSS hooks
172
+
173
+ Example:
174
+
175
+ ```ts
176
+ const cfg = getDefaultHisonConfig()
177
+ cfg.componentStyle.primaryColor = '#222'
178
+ cfg.componentStyle.size = Size.s
179
+ cfg.link.timeout = 15000
180
+ cfg.shield.isPossibleOpenDevTool = false
181
+ ```
182
+
183
+ ---
184
+
185
+ ## 🔗 Extended Hison Interface
186
+
187
+ HisonVue exports a singleton `hison` that **extends** `hisonjs.Hison`:
188
+
189
+ ✅ All **hisonjs** features:
190
+
191
+ * `utils` (string/date/number helpers)
192
+ * `data` (DataWrapper, DataModel)
193
+ * `link` (API communication with Spring backend)
194
+ * `shield` (security: devtool blocking, freeze, URL/IP restrictions)
195
+
196
+ ➕ Additional Vue features:
197
+
198
+ * `component.getXxx(id)` → runtime control of every Vue component
199
+ * `style.setXxx/getXxx` → global theming API
200
+ * `cssEvent.setXxx` → global before/after hooks for UI events
201
+ * File upload defaults: `setMaxFilesetSize`, `setMaxFilesetTotalSize`
202
+
203
+ This makes **hisonvue** a **fullstack bridge** between Vue frontend and Spring backend.
204
+
205
+ ---
206
+
207
+ ## ✅ Example Fullstack Flow
208
+
209
+ ```ts
210
+ import { hison } from 'hisonvue'
211
+
212
+ // Build request
213
+ define const req = new hison.data.DataWrapper({ userId: 1 })
214
+
215
+ // Send to Spring backend via api-link
216
+ const api = new hison.link.ApiPost("UserService.getUser")
217
+ const resp = await api.call(req)
218
+
219
+ // Update UI
220
+ const btn = hison.component.getButton('saveBtn')
221
+ btn?.setDisable(true)
222
+
223
+ const note = hison.component.getNote('editor')
224
+ note?.setNoteData(resp.data)
225
+ ```
226
+
227
+ ---
228
+
229
+ ## 🛠 Build & Test (Contributors)
230
+
231
+ ```bash
232
+ git clone https://github.com/hisondev/hisonvue.git
233
+ cd hisonvue
234
+ npm install
235
+
236
+ # Build library
237
+ npm run build
238
+
239
+ # Run playgrounds
240
+ cd playground && npm run dev
241
+ cd ../playground-nuxt && npm run dev
242
+ ```
243
+
244
+ ---
245
+
246
+ ## 📄 License
247
+
248
+ MIT © hisondev
@@ -1,6 +1,6 @@
1
- import { defineComponent as M, ref as o, computed as T, onMounted as K, onBeforeUnmount as G, watch as i, nextTick as P, createElementBlock as X, openBlock as J, normalizeClass as w, createElementVNode as c, normalizeStyle as N, withKeys as D, withModifiers as H, renderSlot as L, createTextVNode as Q, toDisplayString as W } from "vue";
2
- import { T as Y, g as Z, u as _, e as ee, t as te, a as ne, b as q, h as f, r as le, c as oe, d as ie } from "./index-DUh7pai4.mjs";
3
- import { a as ae, r as se } from "./setButtonCssEvent-dBs1GcAh.mjs";
1
+ import { defineComponent as M, ref as o, computed as T, onMounted as K, onBeforeUnmount as G, watch as i, nextTick as P, createElementBlock as X, openBlock as J, normalizeClass as w, createElementVNode as c, normalizeStyle as N, withKeys as D, withModifiers as H, renderSlot as E, createTextVNode as Q, toDisplayString as W } from "vue";
2
+ import { T as Y, g as Z, u as _, e as ee, t as te, a as ne, b as q, h as f, r as le, c as oe, d as ie } from "./index-p1EBArRP.mjs";
3
+ import { a as ae, r as se } from "./setButtonCssEvent-CB-7jMmJ.mjs";
4
4
  import { _ as re } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
5
5
  const ue = {
6
6
  /**
@@ -93,7 +93,7 @@ const ue = {
93
93
  setup(t, { emit: l }) {
94
94
  const a = t.id || Z(), C = `haccordion:${a}`, s = o(null), O = o(null), r = _(), g = o(!!t.visible), m = o(t.title ?? ""), u = o(!!t.defaultOpen), y = o(t.textAlign ?? "left"), p = o(t.animate ?? !0), b = o(t.duration ?? 500), h = o(t.easing ?? "ease"), S = o(
95
95
  t.tabIndex !== null && t.tabIndex !== "" ? Number(t.tabIndex) : null
96
- ), F = T(() => g.value ? "" : "hison-display-none"), d = o([]), B = () => {
96
+ ), F = T(() => g.value ? "" : "hison-display-none"), d = o([]), L = () => {
97
97
  d.value = ee(te(t.class) || "", r.value), ne(d.value, "col") === -1 && d.value.push("hison-col-12"), q(d.value, "size", f.componentStyle.size), q(d.value, "color", "primary");
98
98
  }, V = T(() => ({
99
99
  "--hacc-duration": `${b.value}ms`,
@@ -105,12 +105,12 @@ const ue = {
105
105
  if (!u.value) return;
106
106
  const n = document.activeElement, x = O.value;
107
107
  x && n && x.contains(n) && ((R = s.value) == null || R.focus()), u.value = !1, l("close", e ?? null, v.value);
108
- }, E = (e) => u.value ? A(e) : I(e), U = (e) => {
109
- l("toggle", e, v.value), E(e);
108
+ }, B = (e) => u.value ? A(e) : I(e), U = (e) => {
109
+ l("toggle", e, v.value), B(e);
110
110
  }, v = o(null), $ = () => {
111
111
  f.component.accordionList[a] && f.component.accordionList[a].isHisonvueComponent && console.warn(`[Hisonvue] The accordion ID is at risk of being duplicated. ${a}`), le(C, () => {
112
112
  k(), P($);
113
- }), s.value && ae(s.value), B(), v.value = {
113
+ }), s.value && ae(s.value), L(), v.value = {
114
114
  isHisonvueComponent: !0,
115
115
  getId: () => a,
116
116
  getType: () => "accordion",
@@ -121,7 +121,7 @@ const ue = {
121
121
  isOpen: () => u.value,
122
122
  open: I,
123
123
  close: A,
124
- toggle: E,
124
+ toggle: B,
125
125
  getTitle: () => m.value,
126
126
  setTitle: (e) => {
127
127
  m.value = e ?? "";
@@ -158,7 +158,7 @@ const ue = {
158
158
  ie(C), s.value && se(s.value), (e = f.component) != null && e.accordionList && delete f.component.accordionList[a];
159
159
  };
160
160
  return K($), G(k), i(r, (e) => {
161
- B(), l("responsive-change", e);
161
+ L(), l("responsive-change", e);
162
162
  }), i(() => t.visible, (e) => {
163
163
  e !== g.value && (g.value = !!e);
164
164
  }), i(() => t.title, (e) => {
@@ -177,7 +177,7 @@ const ue = {
177
177
  }), i(() => t.tabIndex, (e) => {
178
178
  const n = e === null || e === "" ? null : Number(e);
179
179
  n !== S.value && (S.value = n);
180
- }), i(() => t.class, () => B()), {
180
+ }), i(() => t.class, () => L()), {
181
181
  headerRef: s,
182
182
  contentRef: O,
183
183
  props: t,
@@ -193,7 +193,7 @@ const ue = {
193
193
  onToggleClick: U,
194
194
  open: I,
195
195
  close: A,
196
- toggle: E
196
+ toggle: B
197
197
  };
198
198
  }
199
199
  }), de = ["aria-expanded", "tabindex"], ve = { class: "hison-accordion-toggle" }, fe = ["inert"], ge = { class: "hison-accordion-panel" }, me = { class: "hison-accordion-panel-inner" };
@@ -230,12 +230,12 @@ function ye(t, l, a, C, s, O) {
230
230
  class: "hison-accordion-title",
231
231
  style: N([t.titleInlineStyle])
232
232
  }, [
233
- L(t.$slots, "title", {}, () => [
233
+ E(t.$slots, "title", {}, () => [
234
234
  Q(W(t.title), 1)
235
235
  ])
236
236
  ], 4),
237
237
  c("div", ve, [
238
- L(t.$slots, "toggle", {}, () => [
238
+ E(t.$slots, "toggle", {}, () => [
239
239
  l[3] || (l[3] = c("span", { class: "hison-dropdown-caret" }, "▾", -1))
240
240
  ])
241
241
  ])
@@ -249,7 +249,7 @@ function ye(t, l, a, C, s, O) {
249
249
  }, [
250
250
  c("div", ge, [
251
251
  c("div", me, [
252
- L(t.$slots, "default")
252
+ E(t.$slots, "default")
253
253
  ])
254
254
  ])
255
255
  ], 12, fe)
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),l=require("./index-BmKMHsSZ.js"),V=require("./setButtonCssEvent-B9WTs2X7.js"),q=require("./_plugin-vue_export-helper-BHFhmbuH.js"),z={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},headerStyle:{type:[String,Object,Array],required:!1},contentStyle:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},defaultOpen:{type:Boolean,default:!1},title:{type:String,default:""},textAlign:{type:String,default:"left",validator:n=>l.TEXT_ALIGN_VALUES.includes(n)},animate:{type:Boolean,default:!0},duration:{type:Number,default:220,validator:n=>Number.isFinite(n)&&n>=0},easing:{type:String,default:"ease"},tabIndex:{type:[Number,String],default:null,validator:n=>n===null||n===""||!isNaN(+n)&&isFinite(+n)}},R=t.defineComponent({name:"HAccordion",props:z,inheritAttrs:!1,emits:["mounted","responsive-change","open","close","toggle"],setup(n,{emit:i}){const a=n.id||l.getUUID(),b=`haccordion:${a}`,s=t.ref(null),N=t.ref(null),r=l.useDevice(),v=t.ref(!!n.visible),f=t.ref(n.title??""),u=t.ref(!!n.defaultOpen),g=t.ref(n.textAlign??"left"),m=t.ref(n.animate??!0),h=t.ref(n.duration??500),y=t.ref(n.easing??"ease"),p=t.ref(n.tabIndex!==null&&n.tabIndex!==""?Number(n.tabIndex):null),B=t.computed(()=>v.value?"":"hison-display-none"),c=t.ref([]),E=()=>{c.value=l.extractResponsiveClasses(l.toClassString(n.class)||"",r.value),l.getIndexSpecificClassNameFromClassList(c.value,"col")===-1&&c.value.push("hison-col-12"),l.addComponentNameToClass(c.value,"size",l.hisonCloser.componentStyle.size),l.addComponentNameToClass(c.value,"color","primary")},L=t.computed(()=>({"--hacc-duration":`${h.value}ms`,"--hacc-easing":y.value})),x=t.computed(()=>({})),$=t.computed(()=>({textAlign:g.value})),C=e=>{u.value||(u.value,u.value=!0,i("open",e??null,d.value))},S=e=>{var O;if(!u.value)return;const o=document.activeElement,A=N.value;A&&o&&A.contains(o)&&((O=s.value)==null||O.focus()),u.value=!1,i("close",e??null,d.value)},I=e=>u.value?S(e):C(e),k=e=>{i("toggle",e,d.value),I(e)},d=t.ref(null),T=()=>{l.hisonCloser.component.accordionList[a]&&l.hisonCloser.component.accordionList[a].isHisonvueComponent&&console.warn(`[Hisonvue] The accordion ID is at risk of being duplicated. ${a}`),l.registerReloadable(b,()=>{w(),t.nextTick(T)}),s.value&&V.addButtonCssEvent(s.value),E(),d.value={isHisonvueComponent:!0,getId:()=>a,getType:()=>"accordion",isVisible:()=>v.value,setVisible:e=>{v.value=!!e},isOpen:()=>u.value,open:C,close:S,toggle:I,getTitle:()=>f.value,setTitle:e=>{f.value=e??""},getTextAlign:()=>g.value,setTextAlign:e=>{(e==="left"||e==="center"||e==="right")&&(g.value=e)},getAnimate:()=>m.value,setAnimate:e=>{m.value=!!e},getDuration:()=>h.value,setDuration:e=>{const o=Number(e);Number.isFinite(o)&&o>=0&&(h.value=o)},getEasing:()=>y.value,setEasing:e=>{typeof e=="string"&&(y.value=e)},getTabIndex:()=>p.value,setTabIndex:e=>{p.value=e!=null?Number(e):null},focus:()=>{var e;(e=s.value)==null||e.focus()},reload:()=>l.reloadHisonComponent(b)},l.hisonCloser.component.accordionList[a]=d.value,i("mounted",d.value)},w=()=>{var e;l.unregisterReloadable(b),s.value&&V.removeButtonCssEvent(s.value),(e=l.hisonCloser.component)!=null&&e.accordionList&&delete l.hisonCloser.component.accordionList[a]};return t.onMounted(T),t.onBeforeUnmount(w),t.watch(r,e=>{E(),i("responsive-change",e)}),t.watch(()=>n.visible,e=>{e!==v.value&&(v.value=!!e)}),t.watch(()=>n.title,e=>{const o=e??"";o!==f.value&&(f.value=o)}),t.watch(()=>n.defaultOpen,e=>e?C(null):S(null)),t.watch(()=>n.textAlign,e=>{(e==="left"||e==="center"||e==="right")&&e!==g.value&&(g.value=e)}),t.watch(()=>n.animate,e=>{const o=!!e;o!==m.value&&(m.value=o)}),t.watch(()=>n.duration,e=>{const o=Number(e);Number.isFinite(o)&&o>=0&&o!==h.value&&(h.value=o)}),t.watch(()=>n.easing,e=>{typeof e=="string"&&e!==y.value&&(y.value=e)}),t.watch(()=>n.tabIndex,e=>{const o=e===null||e===""?null:Number(e);o!==p.value&&(p.value=o)}),t.watch(()=>n.class,()=>E()),{headerRef:s,contentRef:N,props:n,visibleClass:B,responsiveClassList:c,isOpen:u,title:f,headerBoxStyle:x,titleInlineStyle:$,rootInlineStyle:L,animate:m,tabIndex:p,onToggleClick:k,open:C,close:S,toggle:I}}}),H=["aria-expanded","tabindex"],D={class:"hison-accordion-toggle"},j=["inert"],F={class:"hison-accordion-panel"},M={class:"hison-accordion-panel-inner"};function U(n,i,a,b,s,N){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-wrapper",...n.responsiveClassList,n.visibleClass])},[t.createElementVNode("div",{class:t.normalizeClass(["hison-accordion",n.isOpen?"hison-open":"",n.animate?"":"hison-no-anim"]),style:t.normalizeStyle([n.rootInlineStyle,n.props.style])},[t.createElementVNode("div",{ref:"headerRef",class:"hison-accordion-header",style:t.normalizeStyle([n.headerBoxStyle,n.props.headerStyle]),role:"button","aria-expanded":n.isOpen?"true":"false",tabindex:n.tabIndex??void 0,onClick:i[0]||(i[0]=r=>n.onToggleClick(r)),onKeydown:[i[1]||(i[1]=t.withKeys(t.withModifiers(r=>n.onToggleClick(r),["prevent"]),["enter"])),i[2]||(i[2]=t.withKeys(t.withModifiers(r=>n.onToggleClick(r),["prevent"]),["space"]))]},[t.createElementVNode("div",{class:"hison-accordion-title",style:t.normalizeStyle([n.titleInlineStyle])},[t.renderSlot(n.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(n.title),1)])],4),t.createElementVNode("div",D,[t.renderSlot(n.$slots,"toggle",{},()=>[i[3]||(i[3]=t.createElementVNode("span",{class:"hison-dropdown-caret"},"▾",-1))])])],44,H),t.createElementVNode("div",{ref:"contentRef",class:"hison-accordion-content",style:t.normalizeStyle(n.props.contentStyle),role:"region",inert:!n.isOpen||void 0},[t.createElementVNode("div",F,[t.createElementVNode("div",M,[t.renderSlot(n.$slots,"default")])])],12,j)],6)],2)}const K=q._export_sfc(R,[["render",U]]);exports.default=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),l=require("./index-CKU70ocu.js"),V=require("./setButtonCssEvent-BoBQS2-T.js"),q=require("./_plugin-vue_export-helper-BHFhmbuH.js"),z={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},headerStyle:{type:[String,Object,Array],required:!1},contentStyle:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},defaultOpen:{type:Boolean,default:!1},title:{type:String,default:""},textAlign:{type:String,default:"left",validator:n=>l.TEXT_ALIGN_VALUES.includes(n)},animate:{type:Boolean,default:!0},duration:{type:Number,default:220,validator:n=>Number.isFinite(n)&&n>=0},easing:{type:String,default:"ease"},tabIndex:{type:[Number,String],default:null,validator:n=>n===null||n===""||!isNaN(+n)&&isFinite(+n)}},R=t.defineComponent({name:"HAccordion",props:z,inheritAttrs:!1,emits:["mounted","responsive-change","open","close","toggle"],setup(n,{emit:i}){const a=n.id||l.getUUID(),b=`haccordion:${a}`,s=t.ref(null),N=t.ref(null),r=l.useDevice(),v=t.ref(!!n.visible),f=t.ref(n.title??""),u=t.ref(!!n.defaultOpen),g=t.ref(n.textAlign??"left"),m=t.ref(n.animate??!0),h=t.ref(n.duration??500),y=t.ref(n.easing??"ease"),p=t.ref(n.tabIndex!==null&&n.tabIndex!==""?Number(n.tabIndex):null),B=t.computed(()=>v.value?"":"hison-display-none"),c=t.ref([]),I=()=>{c.value=l.extractResponsiveClasses(l.toClassString(n.class)||"",r.value),l.getIndexSpecificClassNameFromClassList(c.value,"col")===-1&&c.value.push("hison-col-12"),l.addComponentNameToClass(c.value,"size",l.hisonCloser.componentStyle.size),l.addComponentNameToClass(c.value,"color","primary")},L=t.computed(()=>({"--hacc-duration":`${h.value}ms`,"--hacc-easing":y.value})),x=t.computed(()=>({})),$=t.computed(()=>({textAlign:g.value})),C=e=>{u.value||(u.value,u.value=!0,i("open",e??null,d.value))},S=e=>{var O;if(!u.value)return;const o=document.activeElement,E=N.value;E&&o&&E.contains(o)&&((O=s.value)==null||O.focus()),u.value=!1,i("close",e??null,d.value)},T=e=>u.value?S(e):C(e),k=e=>{i("toggle",e,d.value),T(e)},d=t.ref(null),w=()=>{l.hisonCloser.component.accordionList[a]&&l.hisonCloser.component.accordionList[a].isHisonvueComponent&&console.warn(`[Hisonvue] The accordion ID is at risk of being duplicated. ${a}`),l.registerReloadable(b,()=>{A(),t.nextTick(w)}),s.value&&V.addButtonCssEvent(s.value),I(),d.value={isHisonvueComponent:!0,getId:()=>a,getType:()=>"accordion",isVisible:()=>v.value,setVisible:e=>{v.value=!!e},isOpen:()=>u.value,open:C,close:S,toggle:T,getTitle:()=>f.value,setTitle:e=>{f.value=e??""},getTextAlign:()=>g.value,setTextAlign:e=>{(e==="left"||e==="center"||e==="right")&&(g.value=e)},getAnimate:()=>m.value,setAnimate:e=>{m.value=!!e},getDuration:()=>h.value,setDuration:e=>{const o=Number(e);Number.isFinite(o)&&o>=0&&(h.value=o)},getEasing:()=>y.value,setEasing:e=>{typeof e=="string"&&(y.value=e)},getTabIndex:()=>p.value,setTabIndex:e=>{p.value=e!=null?Number(e):null},focus:()=>{var e;(e=s.value)==null||e.focus()},reload:()=>l.reloadHisonComponent(b)},l.hisonCloser.component.accordionList[a]=d.value,i("mounted",d.value)},A=()=>{var e;l.unregisterReloadable(b),s.value&&V.removeButtonCssEvent(s.value),(e=l.hisonCloser.component)!=null&&e.accordionList&&delete l.hisonCloser.component.accordionList[a]};return t.onMounted(w),t.onBeforeUnmount(A),t.watch(r,e=>{I(),i("responsive-change",e)}),t.watch(()=>n.visible,e=>{e!==v.value&&(v.value=!!e)}),t.watch(()=>n.title,e=>{const o=e??"";o!==f.value&&(f.value=o)}),t.watch(()=>n.defaultOpen,e=>e?C(null):S(null)),t.watch(()=>n.textAlign,e=>{(e==="left"||e==="center"||e==="right")&&e!==g.value&&(g.value=e)}),t.watch(()=>n.animate,e=>{const o=!!e;o!==m.value&&(m.value=o)}),t.watch(()=>n.duration,e=>{const o=Number(e);Number.isFinite(o)&&o>=0&&o!==h.value&&(h.value=o)}),t.watch(()=>n.easing,e=>{typeof e=="string"&&e!==y.value&&(y.value=e)}),t.watch(()=>n.tabIndex,e=>{const o=e===null||e===""?null:Number(e);o!==p.value&&(p.value=o)}),t.watch(()=>n.class,()=>I()),{headerRef:s,contentRef:N,props:n,visibleClass:B,responsiveClassList:c,isOpen:u,title:f,headerBoxStyle:x,titleInlineStyle:$,rootInlineStyle:L,animate:m,tabIndex:p,onToggleClick:k,open:C,close:S,toggle:T}}}),H=["aria-expanded","tabindex"],D={class:"hison-accordion-toggle"},j=["inert"],F={class:"hison-accordion-panel"},M={class:"hison-accordion-panel-inner"};function U(n,i,a,b,s,N){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-wrapper",...n.responsiveClassList,n.visibleClass])},[t.createElementVNode("div",{class:t.normalizeClass(["hison-accordion",n.isOpen?"hison-open":"",n.animate?"":"hison-no-anim"]),style:t.normalizeStyle([n.rootInlineStyle,n.props.style])},[t.createElementVNode("div",{ref:"headerRef",class:"hison-accordion-header",style:t.normalizeStyle([n.headerBoxStyle,n.props.headerStyle]),role:"button","aria-expanded":n.isOpen?"true":"false",tabindex:n.tabIndex??void 0,onClick:i[0]||(i[0]=r=>n.onToggleClick(r)),onKeydown:[i[1]||(i[1]=t.withKeys(t.withModifiers(r=>n.onToggleClick(r),["prevent"]),["enter"])),i[2]||(i[2]=t.withKeys(t.withModifiers(r=>n.onToggleClick(r),["prevent"]),["space"]))]},[t.createElementVNode("div",{class:"hison-accordion-title",style:t.normalizeStyle([n.titleInlineStyle])},[t.renderSlot(n.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(n.title),1)])],4),t.createElementVNode("div",D,[t.renderSlot(n.$slots,"toggle",{},()=>[i[3]||(i[3]=t.createElementVNode("span",{class:"hison-dropdown-caret"},"▾",-1))])])],44,H),t.createElementVNode("div",{ref:"contentRef",class:"hison-accordion-content",style:t.normalizeStyle(n.props.contentStyle),role:"region",inert:!n.isOpen||void 0},[t.createElementVNode("div",F,[t.createElementVNode("div",M,[t.renderSlot(n.$slots,"default")])])],12,j)],6)],2)}const K=q._export_sfc(R,[["render",U]]);exports.default=K;