@hairy/vue-lib 1.47.0 → 1.50.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.
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025-PRESENT Hairyf <https://github.com/antfu>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), 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-PRESENT Hairyf <https://github.com/hairyf>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), 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,36 +1,201 @@
1
- # @hairy/vue-lib
2
-
3
- [![npm version][npm-version-src]][npm-version-href]
4
- [![npm downloads][npm-downloads-src]][npm-downloads-href]
5
- [![bundle][bundle-src]][bundle-href]
6
- [![JSDocs][jsdocs-src]][jsdocs-href]
7
- [![License][license-src]][license-href]
8
-
9
- ## Install
10
-
11
- ```
12
- ni @hairy/vue-lib
13
- ```
14
-
15
- ## CDN
16
-
17
- ```html
18
- <script src="https://unpkg.com/@hairy/vue-lib"></script>
19
- ```
20
-
21
- ## License
22
-
23
- [MIT](./LICENSE) License © [Hairyf](https://github.com/hairyf)
24
-
25
- <!-- Badges -->
26
-
27
- [npm-version-src]: https://img.shields.io/npm/v/@hairy/vue-lib?style=flat&colorA=080f12&colorB=1fa669
28
- [npm-version-href]: https://npmjs.com/package/@hairy/vue-lib
29
- [npm-downloads-src]: https://img.shields.io/npm/dm/@hairy/vue-lib?style=flat&colorA=080f12&colorB=1fa669
30
- [npm-downloads-href]: https://npmjs.com/package/@hairy/vue-lib
31
- [bundle-src]: https://img.shields.io/bundlephobia/minzip/@hairy/vue-lib?style=flat&colorA=080f12&colorB=1fa669&label=minzip
32
- [bundle-href]: https://bundlephobia.com/result?p=@hairy/vue-lib
33
- [license-src]: https://img.shields.io/github/license/hairyf/hairylib.svg?style=flat&colorA=080f12&colorB=1fa669
34
- [license-href]: https://github.com/hairyf/hairylib/blob/main/LICENSE
35
- [jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
36
- [jsdocs-href]: https://www.jsdocs.io/package/@hairy/vue-lib
1
+ # @hairy/vue-lib
2
+
3
+ <!-- automd:badges name="@hairy/vue-lib" github="hairyf/hairylib" license bundlephobia -->
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@hairy/vue-lib)](https://npmjs.com/package/@hairy/vue-lib)
6
+ [![npm downloads](https://img.shields.io/npm/dm/@hairy/vue-lib)](https://npm.chart.dev/@hairy/vue-lib)
7
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/@hairy/vue-lib)](https://bundlephobia.com/package/@hairy/vue-lib)
8
+ [![license](https://img.shields.io/github/license/hairyf/hairylib)](https://github.com/hairyf/hairylib/blob/main/LICENSE)
9
+
10
+ <!-- /automd -->
11
+
12
+ Vue 2/3 composables and helpers built on top of `vue-demi`.
13
+
14
+ ## Install
15
+
16
+ <!-- automd:pm-install name="@hairy/vue-lib" -->
17
+
18
+ ```sh
19
+ # ✨ Auto-detect
20
+ npx nypm install @hairy/vue-lib
21
+
22
+ # npm
23
+ npm install @hairy/vue-lib
24
+
25
+ # yarn
26
+ yarn add @hairy/vue-lib
27
+
28
+ # pnpm
29
+ pnpm add @hairy/vue-lib
30
+
31
+ # bun
32
+ bun install @hairy/vue-lib
33
+
34
+ # deno
35
+ deno install npm:@hairy/vue-lib
36
+ ```
37
+
38
+ <!-- /automd -->
39
+
40
+ ## API
41
+
42
+ <!-- automd:jsdocs src="./src/index.ts" -->
43
+
44
+ ### `CollapseTransition`
45
+
46
+ #### `name`
47
+
48
+ - **Type**: `string`
49
+ - **Default**: `"CollapseTransition"`
50
+
51
+ #### `setup()`
52
+
53
+ ### `ehr(component, tag?)`
54
+
55
+ Directly render the incoming function components
56
+
57
+ ### `Field`
58
+
59
+ #### `name`
60
+
61
+ - **Type**: `string`
62
+ - **Default**: `"Field"`
63
+
64
+ #### `props`
65
+
66
+ ##### `is`
67
+
68
+ ###### `default`
69
+
70
+ - **Type**: `string`
71
+ - **Default**: `""`
72
+
73
+ ###### `type`
74
+
75
+ - **Type**: `array`
76
+ - **Default**: `[null,null,null]`
77
+
78
+ #### `setup()`
79
+
80
+ ### `propertyToRef(data, prop)`
81
+
82
+ Convert the properties of an object to ref
83
+
84
+ ### `syncElementSize(fromTarget, toTarget, options)`
85
+
86
+ Synchronize the width or height of from DOM to the specified to DOM
87
+
88
+ ### `syncElementSyncScroll(fromTarget, toTarget, options)`
89
+
90
+ Synchronize scrolling between two DOM with the same scrollbar
91
+
92
+ ### `useChecked(target, checked, unchecked)`
93
+
94
+ Get the status of checked and customize the value of checked | unchecked
95
+
96
+ ### `useSelectedMultiple(array, options)`
97
+
98
+ ### `useSelectedSingle(array, options)`
99
+
100
+ ### `useServerPagination(options)`
101
+
102
+ <!-- /automd -->
103
+
104
+ ## Directory structure
105
+
106
+ <!-- automd:dir-tree imports=""maxDepth=2 -->
107
+
108
+ ```
109
+ ├── src/
110
+ │ ├── components/
111
+ │ │ ├── c-field.ts
112
+ │ │ ├── collapse-transition.ts
113
+ │ │ └── index.ts
114
+ │ ├── hooks/
115
+ │ │ ├── syncElementScroll/
116
+ │ │ │ └── index.ts
117
+ │ │ ├── syncElementSize/
118
+ │ │ │ └── index.ts
119
+ │ │ ├── useChecked/
120
+ │ │ │ └── index.ts
121
+ │ │ ├── usePaginationServer/
122
+ │ │ │ └── index.ts
123
+ │ │ ├── useSelectedMultiple/
124
+ │ │ │ └── index.ts
125
+ │ │ ├── useSelectedSingle/
126
+ │ │ │ └── index.ts
127
+ │ │ ├── utils/
128
+ │ │ │ └── extendSelected.ts
129
+ │ │ └── index.ts
130
+ │ ├── utils/
131
+ │ │ └── index.ts
132
+ │ └── index.ts
133
+ ├── test/
134
+ │ └── index.test.ts
135
+ ├── package.json
136
+ ├── README.md
137
+ └── tsdown.config.ts
138
+ ```
139
+
140
+ <!-- /automd -->
141
+
142
+ ## Source
143
+
144
+ <!-- automd:file src="./src/index.ts" code lang="ts" -->
145
+
146
+ ```ts [index.ts]
147
+ export * from './components'
148
+ export * from './hooks'
149
+ export * from './utils'
150
+ ```
151
+
152
+ <!-- /automd -->
153
+
154
+ ## Contributors
155
+
156
+ <!-- automd:contributors github="hairyf/hairylib" author="Hairyf" license="MIT" -->
157
+
158
+ Published under the [MIT](https://github.com/hairyf/hairylib/blob/main/LICENSE) license.
159
+ Made by [@Hairyf](https://github.com/Hairyf) and [community](https://github.com/hairyf/hairylib/graphs/contributors) 💛
160
+ <br><br>
161
+ <a href="https://github.com/hairyf/hairylib/graphs/contributors">
162
+ <img src="https://contrib.rocks/image?repo=hairyf/hairylib" />
163
+ </a>
164
+
165
+ <!-- /automd -->
166
+
167
+ ## License
168
+
169
+ <!-- automd:fetch url="gh:hairyf/hairylib/main/LICENSE" -->
170
+
171
+ MIT License
172
+
173
+ Copyright (c) 2025-PRESENT Hairyf <https://github.com/hairyf>
174
+
175
+ Permission is hereby granted, free of charge, to any person obtaining a copy
176
+ of this software and associated documentation files (the "Software"), to deal
177
+ in the Software without restriction, including without limitation the rights
178
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
179
+ copies of the Software, and to permit persons to whom the Software is
180
+ furnished to do so, subject to the following conditions:
181
+
182
+ The above copyright notice and this permission notice shall be included in all
183
+ copies or substantial portions of the Software.
184
+
185
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
186
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
187
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
188
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
189
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
190
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
191
+ SOFTWARE.
192
+
193
+ <!-- /automd -->
194
+
195
+ <!-- automd:with-automd -->
196
+
197
+ ---
198
+
199
+ _🤖 auto updated with [automd](https://automd.unjs.io)_
200
+
201
+ <!-- /automd -->