@a-drowned-fish/rox-v 1.0.1 → 1.0.3

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 (40) hide show
  1. package/README.md +142 -86
  2. package/dist/es/components.js +6 -2
  3. package/dist/es/index.js +7 -5
  4. package/dist/es/input-otp/index.js +1 -0
  5. package/dist/es/input-otp/input-otp.js +1 -1
  6. package/dist/es/input-otp/input-otp.vue_vue_type_script_setup_true_lang.js +56 -30
  7. package/dist/es/input-otp/style.css +1 -1
  8. package/dist/es/input-otp/style.css.js +0 -0
  9. package/dist/es/popup/index.js +7 -0
  10. package/dist/es/popup/popup.js +7 -0
  11. package/dist/es/popup/popup.vue_vue_type_script_setup_true_lang.js +51 -0
  12. package/dist/es/popup/style.css +1 -0
  13. package/dist/es/popup/style.css.js +0 -0
  14. package/dist/es/style.css.js +0 -0
  15. package/dist/index.js +1 -1
  16. package/dist/lib/components.js +1 -1
  17. package/dist/lib/index.js +1 -1
  18. package/dist/lib/input-otp/index.js +1 -1
  19. package/dist/lib/input-otp/input-otp.js +1 -1
  20. package/dist/lib/input-otp/input-otp.vue_vue_type_script_setup_true_lang.js +1 -1
  21. package/dist/lib/input-otp/style.css +1 -1
  22. package/dist/lib/input-otp/style.css.js +0 -0
  23. package/dist/lib/popup/index.js +1 -0
  24. package/dist/lib/popup/popup.js +1 -0
  25. package/dist/lib/popup/popup.vue_vue_type_script_setup_true_lang.js +1 -0
  26. package/dist/lib/popup/style.css +1 -0
  27. package/dist/lib/popup/style.css.js +0 -0
  28. package/dist/lib/style.css.js +0 -0
  29. package/dist/style.css +1 -1
  30. package/dist/types/components/components.d.ts +2 -0
  31. package/dist/types/components/input-otp/style.css.d.ts +1 -0
  32. package/dist/types/components/popup/index.d.ts +5 -0
  33. package/dist/types/components/popup/popup.vue.d.ts +33 -0
  34. package/dist/types/components/popup/style.css.d.ts +1 -0
  35. package/dist/types/components/popup/types.d.ts +8 -0
  36. package/dist/types/components/style.css.d.ts +1 -0
  37. package/package.json +4 -9
  38. package/dist/resolver/index.cjs.js +0 -1
  39. package/dist/resolver/index.js +0 -20
  40. package/dist/resolver/resolver.d.ts +0 -15
package/README.md CHANGED
@@ -19,99 +19,22 @@ pnpm add @a-drowned-fish/rox-v
19
19
  ```ts
20
20
  import { createApp } from "vue";
21
21
  import RoxV from "@a-drowned-fish/rox-v";
22
- import "@a-drowned-fish/rox-v/dist/es/style.css"; // 如果需要样式
22
+ import "@a-drowned-fish/rox-v/dist/style.css"; // 如果需要样式
23
23
 
24
24
  const app = createApp(App);
25
25
  app.use(RoxV);
26
26
  ```
27
27
 
28
- ### 2. 按需引入(配合 unplugin-vue-components
29
-
30
- 安装依赖:
31
-
32
- ```bash
33
- npm install unplugin-vue-components -D
34
- ```
35
-
36
- 在 Vite 配置中使用:
37
-
38
- ```ts
39
- // vite.config.ts
40
- import { defineConfig } from "vite";
41
- import vue from "@vitejs/plugin-vue";
42
- import Components from "unplugin-vue-components/vite";
43
- import { RoxVResolver } from "@a-drowned-fish/rox-v/resolver";
44
-
45
- export default defineConfig({
46
- plugins: [
47
- vue(),
48
- Components({
49
- resolvers: [RoxVResolver()], // 默认会自动引入样式
50
- }),
51
- ],
52
- });
53
- ```
54
-
55
- 然后在模板中直接使用组件,无需手动导入:
28
+ ### 2. 按需引入(无需手动引入css
56
29
 
57
30
  ```vue
58
31
  <template>
59
32
  <Button>点击我</Button>
60
33
  <InputOtp />
61
34
  </template>
62
- ```
63
-
64
- **注意**:Resolver 默认会自动引入每个组件的样式文件。如果不需要自动引入样式,可以配置 `importStyle: false`:
65
-
66
- ```ts
67
- Components({
68
- resolvers: [RoxVResolver({ importStyle: false })],
69
- });
70
- ```
71
-
72
- ### 3. 手动按需引入
73
-
74
- ```ts
35
+ <script setup lang="ts">
75
36
  import { Button, InputOtp } from "@a-drowned-fish/rox-v";
76
- ```
77
-
78
- ## Resolver 选项
79
-
80
- `RoxVResolver` 接受一个可选的配置对象:
81
-
82
- ```ts
83
- interface RoxVResolverOptions {
84
- /**
85
- * 使用 CommonJS 构建 (lib) 而不是 ES 模块 (es)
86
- * @default false
87
- */
88
- cjs?: boolean;
89
-
90
- /**
91
- * 自动引入组件样式
92
- * @default true
93
- */
94
- importStyle?: boolean;
95
- }
96
- ```
97
-
98
- 示例:
99
-
100
- ```ts
101
- // 使用 CommonJS 构建
102
- Components({
103
- resolvers: [RoxVResolver({ cjs: true })],
104
- });
105
-
106
- // 禁用自动引入样式
107
- Components({
108
- resolvers: [RoxVResolver({ importStyle: false })],
109
- });
110
-
111
- // 同时配置多个选项
112
- Components({
113
- resolvers: [RoxVResolver({ cjs: true, importStyle: true })],
114
- });
37
+ </script>
115
38
  ```
116
39
 
117
40
  ## 可用组件
@@ -204,7 +127,6 @@ const handleComplete = (value: string) => {
204
127
 
205
128
  | 属性 | 说明 | 类型 | 默认值 |
206
129
  | ------------------ | -------------------------------------------- | -------- | ---------- |
207
- | modelValue | 绑定值 | `string` | `''` |
208
130
  | length | 输入框数量 | `number` | `6` |
209
131
  | itemClass | 每个输入项的自定义类名 | `string` | `''` |
210
132
  | activeItemClass | 激活状态输入项的自定义类名 | `string` | `''` |
@@ -213,10 +135,144 @@ const handleComplete = (value: string) => {
213
135
 
214
136
  #### Events
215
137
 
216
- | 事件名 | 说明 | 回调参数 |
217
- | ----------------- | ------------------------------ | ----------------- |
218
- | update:modelValue | 输入值变化时触发 | `(value: string)` |
219
- | complete | 输入完成时触发(达到指定长度) | `(value: string)` |
138
+ | 事件名 | 说明 | 回调参数 |
139
+ | -------- | ------------------------------ | ----------------- |
140
+ | complete | 输入完成时触发(达到指定长度) | `(value: string)` |
141
+
142
+ ### Popup - 弹出层组件
143
+
144
+ 一个灵活的弹出层组件,支持从不同方向滑入,带有遮罩层和过渡动画效果。
145
+
146
+ #### 基础用法
147
+
148
+ ``vue
149
+ <template>
150
+ <Button @click="show = true">打开弹窗</Button>
151
+
152
+ <Popup v-model="show">
153
+ <div class="popup-content">
154
+ <h3>标题</h3>
155
+ <p>这是弹窗内容</p>
156
+ <Button @click="show = false">关闭</Button>
157
+ </div>
158
+ </Popup>
159
+
160
+ </template>
161
+
162
+ <script setup lang="ts">
163
+ import { ref } from "vue";
164
+ import { Button, Popup } from "@a-drowned-fish/rox-v";
165
+
166
+ const show = ref(false);
167
+ </script>
168
+
169
+ <style scoped>
170
+ .popup-content {
171
+ padding: 20px;
172
+ background: white;
173
+ border-radius: 12px 12px 0 0;
174
+ }
175
+ </style>
176
+
177
+ ```
178
+
179
+ #### 不同位置
180
+
181
+ ``vue
182
+ <template>
183
+ <!-- 底部弹出(默认) -->
184
+ <Popup v-model="showBottom" position="bottom">
185
+ <div class="content">底部弹窗</div>
186
+ </Popup>
187
+
188
+ <!-- 顶部弹出 -->
189
+ <Popup v-model="showTop" position="top">
190
+ <div class="content">顶部弹窗</div>
191
+ </Popup>
192
+
193
+ <!-- 左侧弹出 -->
194
+ <Popup v-model="showLeft" position="left">
195
+ <div class="content">左侧弹窗</div>
196
+ </Popup>
197
+
198
+ <!-- 右侧弹出 -->
199
+ <Popup v-model="showRight" position="right">
200
+ <div class="content">右侧弹窗</div>
201
+ </Popup>
202
+ </template>
203
+
204
+ <script setup lang="ts">
205
+ import { ref } from "vue";
206
+ import { Popup } from "@a-drowned-fish/rox-v";
207
+
208
+ const showBottom = ref(false);
209
+ const showTop = ref(false);
210
+ const showLeft = ref(false);
211
+ const showRight = ref(false);
212
+ </script>
213
+ ```
214
+
215
+ #### 自定义遮罩层
216
+
217
+ ``vue
218
+ <template>
219
+ <Popup
220
+ v-model="show"
221
+ :bg="'rgba(0, 0, 0, 0.7)'"
222
+ :duration="500"
223
+ :mask-closable="false"
224
+ >
225
+
226
+ <div class="content">
227
+ <p>点击遮罩层不会关闭</p>
228
+ <Button @click="show = false">手动关闭</Button>
229
+ </div>
230
+ </Popup>
231
+ </template>
232
+
233
+ <script setup lang="ts">
234
+ import { ref } from "vue";
235
+ import { Popup, Button } from "@a-drowned-fish/rox-v";
236
+
237
+ const show = ref(false);
238
+ </script>
239
+
240
+ ```
241
+
242
+ #### 自定义挂载节点
243
+
244
+ ``vue
245
+ <template>
246
+ <div id="custom-container">
247
+ <Popup v-model="show" to="#custom-container">
248
+ <div class="content">挂载到指定容器</div>
249
+ </Popup>
250
+ </div>
251
+ </template>
252
+
253
+ <script setup lang="ts">
254
+ import { ref } from "vue";
255
+ import { Popup } from "@a-drowned-fish/rox-v";
256
+
257
+ const show = ref(false);
258
+ </script>
259
+ ```
260
+
261
+ #### Props
262
+
263
+ | 属性 | 说明 | 类型 | 默认值 |
264
+ | ------------ | -------------------- | ---------------------------------------- | --------------------- |
265
+ | position | 弹出位置 | `'top' \| 'bottom' \| 'left' \| 'right'` | `'bottom'` |
266
+ | bg | 遮罩层背景色 | `string` | `'rgba(0, 0, 0, .5)'` |
267
+ | duration | 动画持续时间(毫秒) | `number` | `300` |
268
+ | maskClosable | 点击遮罩层是否关闭 | `boolean` | `true` |
269
+ | to | teleport 的目标节点 | `string` | `'body'` |
270
+
271
+ #### Slots
272
+
273
+ | 插槽名 | 说明 |
274
+ | ------- | ------------ |
275
+ | default | 弹窗内容区域 |
220
276
 
221
277
  ## License
222
278
 
@@ -1,6 +1,10 @@
1
1
  import { __exportAll as e } from "./_virtual/_rolldown/runtime.js";
2
2
  import t from "./input-otp/index.js";
3
+ import n from "./popup/index.js";
3
4
  //#region components/components.ts
4
- var n = /* @__PURE__ */ e({ InputOtp: () => t });
5
+ var r = /* @__PURE__ */ e({
6
+ InputOtp: () => t,
7
+ Popup: () => n
8
+ });
5
9
  //#endregion
6
- export { n as components_exports };
10
+ export { r as components_exports };
package/dist/es/index.js CHANGED
@@ -1,9 +1,11 @@
1
1
  import e from "./input-otp/index.js";
2
- import { components_exports as t } from "./components.js";
2
+ import t from "./popup/index.js";
3
+ import { components_exports as n } from "./components.js";
4
+ import "./style.css";
3
5
  //#region components/index.ts
4
- var n = (e) => (Object.keys(t).forEach((n) => {
5
- let r = t[n];
6
+ var r = (e) => (Object.keys(n).forEach((t) => {
7
+ let r = n[t];
6
8
  r.install && e.use(r);
7
- }), e), r = { install: n };
9
+ }), e), i = { install: r };
8
10
  //#endregion
9
- export { e as InputOtp, r as default, n as install };
11
+ export { e as InputOtp, t as Popup, i as default, r as install };
@@ -1,4 +1,5 @@
1
1
  import e from "./input-otp.js";
2
+ import "./style.css";
2
3
  //#region components/input-otp/index.ts
3
4
  e.install = (t) => (e.name && t.component(e.name, e), t);
4
5
  var t = e;
@@ -2,6 +2,6 @@ import e from "./input-otp.vue_vue_type_script_setup_true_lang.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
4
  //#region components/input-otp/input-otp.vue
5
- var n = /* @__PURE__ */ t(e, [["__scopeId", "data-v-9ff7490d"]]);
5
+ var n = /* @__PURE__ */ t(e, [["__scopeId", "data-v-0e246228"]]);
6
6
  //#endregion
7
7
  export { n as default };
@@ -1,6 +1,6 @@
1
- import { Fragment as e, createElementBlock as t, createElementVNode as n, defineComponent as r, normalizeClass as i, normalizeStyle as a, openBlock as o, ref as s, renderList as c, toDisplayString as l, vModelText as u, watch as d, withDirectives as f } from "vue";
1
+ import { Fragment as e, createElementBlock as t, createElementVNode as n, defineComponent as r, nextTick as i, normalizeClass as a, normalizeStyle as o, openBlock as s, ref as c, renderList as l, toDisplayString as u, vModelText as d, watch as f, withDirectives as p } from "vue";
2
2
  //#region components/input-otp/input-otp.vue?vue&type=script&setup=true&lang.ts
3
- var p = ["maxlength"], m = /* @__PURE__ */ r({
3
+ var m = ["maxlength"], h = /* @__PURE__ */ r({
4
4
  name: "InputOtp",
5
5
  __name: "input-otp",
6
6
  props: {
@@ -12,52 +12,78 @@ var p = ["maxlength"], m = /* @__PURE__ */ r({
12
12
  hasFilledItemClass: { default: "active" }
13
13
  },
14
14
  emits: ["update:modelValue", "complete"],
15
- setup(r, { emit: m }) {
16
- let h = r, g = m, _ = s(null), v = s(h.modelValue);
17
- d(() => h.modelValue, (e) => {
18
- e !== v.value && (v.value = e);
15
+ setup(r, { emit: h }) {
16
+ let g = [
17
+ "ArrowLeft",
18
+ "ArrowRight",
19
+ "Home",
20
+ "End"
21
+ ], _ = r, v = h, y = c(null), b = c(_.modelValue);
22
+ f(() => _.modelValue, (e) => {
23
+ e !== b.value && (b.value = e);
19
24
  });
20
- function y(e) {
25
+ function x(e) {
21
26
  let t = e.target.value;
22
- t = t.replace(/\D/g, ""), t = t.slice(0, h.length), v.value = t, g("update:modelValue", t), t.length === h.length && g("complete", t);
27
+ t = t.replace(/\D/g, ""), t = t.slice(0, _.length), b.value = t, v("update:modelValue", t), t.length === _.length && v("complete", t);
23
28
  }
24
- function b() {
25
- _.value?.focus();
29
+ function S() {
30
+ i(() => {
31
+ if (y.value) {
32
+ let e = b.value.length;
33
+ y.value.setSelectionRange?.(e, e);
34
+ }
35
+ });
26
36
  }
27
- function x(e) {
28
- return e === v.value.length;
37
+ function C(e) {
38
+ let t = b.value, n = e.key;
39
+ if (n === "Backspace" || n === "Delete") {
40
+ if (e.preventDefault(), t.length > 0) {
41
+ let e = t.slice(0, -1);
42
+ b.value = e, v("update:modelValue", e), S();
43
+ }
44
+ } else g.includes(n) && e.preventDefault();
45
+ }
46
+ function w() {
47
+ y.value?.focus();
48
+ }
49
+ function T(e) {
50
+ return e === b.value.length;
29
51
  }
30
- function S(e) {
31
- return e < v.value.length;
52
+ function E(e) {
53
+ return e < b.value.length;
32
54
  }
33
- return (s, d) => (o(), t("div", {
55
+ return (i, c) => (s(), t("div", {
34
56
  class: "otp-wrapper",
35
- onClick: b
36
- }, [f(n("input", {
57
+ onClick: w
58
+ }, [p(n("input", {
37
59
  inputmode: "numeric",
38
60
  autocomplete: "one-time-code",
39
61
  ref_key: "inputRef",
40
- ref: _,
41
- "onUpdate:modelValue": d[0] ||= (e) => v.value = e,
62
+ ref: y,
63
+ "onUpdate:modelValue": c[0] ||= (e) => b.value = e,
42
64
  maxlength: r.length,
43
- onInput: y,
65
+ onInput: x,
66
+ onKeydown: C,
67
+ onFocus: S,
44
68
  style: {
45
69
  position: "absolute",
46
70
  opacity: "0",
47
- "pointer-events": "none"
71
+ "pointer-events": "none",
72
+ width: "1px",
73
+ height: "1px"
48
74
  }
49
- }, null, 40, p), [[u, v.value]]), n("div", {
75
+ }, null, 40, m), [[d, b.value]]), n("div", {
50
76
  class: "otp-box",
51
- style: a({ gap: h.gap })
52
- }, [(o(!0), t(e, null, c(r.length, (e, n) => (o(), t("div", {
77
+ style: o({ gap: _.gap })
78
+ }, [(s(!0), t(e, null, l(r.length, (e, n) => (s(), t("div", {
53
79
  key: n,
54
- class: i(["otp-item", [
55
- { [h.activeItemClass]: x(n) },
56
- { [h.hasFilledItemClass]: S(n) },
57
- h.itemClass
80
+ class: a(["otp-item", [
81
+ { [_.activeItemClass]: T(n) },
82
+ { [_.hasFilledItemClass]: E(n) },
83
+ _.itemClass
58
84
  ]])
59
- }, l(v.value[n] || ""), 3))), 128))], 4)]));
85
+ }, u(b.value[n] || ""), 3))), 128))], 4)]));
60
86
  }
61
87
  });
62
88
  //#endregion
63
- export { m as default };
89
+ export { h as default };
@@ -1 +1 @@
1
- .otp-wrapper[data-v-9ff7490d]{cursor:pointer;width:max-content;position:relative}.otp-box[data-v-9ff7490d]{display:flex}.otp-item[data-v-9ff7490d]{border-bottom:1px solid #00000029;justify-content:center;align-items:center;width:60px;height:60px;transition:all .2s;display:flex}.otp-item.active[data-v-9ff7490d]{border-bottom:1px solid #000}
1
+ .otp-wrapper[data-v-0e246228]{cursor:pointer;width:max-content;position:relative}.otp-box[data-v-0e246228]{display:flex}.otp-item[data-v-0e246228]{border-bottom:1px solid #00000029;justify-content:center;align-items:center;width:60px;height:60px;transition:all .2s;display:flex}.otp-item.active[data-v-0e246228]{border-bottom:1px solid #000}
File without changes
@@ -0,0 +1,7 @@
1
+ import e from "./popup.js";
2
+ import "./style.css";
3
+ //#region components/popup/index.ts
4
+ e.install = (t) => (e.name && t.component(e.name, e), t);
5
+ var t = e;
6
+ //#endregion
7
+ export { t as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./popup.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/popup/popup.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-00d0e4c1"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,51 @@
1
+ import { Teleport as e, Transition as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, mergeModels as c, normalizeClass as l, normalizeStyle as u, openBlock as d, renderSlot as f, useModel as p, withCtx as m, withModifiers as h } from "vue";
2
+ //#region components/popup/popup.vue?vue&type=script&setup=true&lang.ts
3
+ var g = /* @__PURE__ */ s({
4
+ name: "Popup",
5
+ __name: "popup",
6
+ props: /* @__PURE__ */ c({
7
+ to: { default: "body" },
8
+ bg: { default: "rgba(0, 0, 0, .5)" },
9
+ duration: { default: 300 },
10
+ position: { default: "bottom" },
11
+ maskClosable: {
12
+ type: Boolean,
13
+ default: !0
14
+ }
15
+ }, {
16
+ modelValue: {
17
+ type: Boolean,
18
+ default: !1
19
+ },
20
+ modelModifiers: {}
21
+ }),
22
+ emits: ["update:modelValue"],
23
+ setup(s) {
24
+ let c = [
25
+ "bottom",
26
+ "left",
27
+ "right",
28
+ "top"
29
+ ], g = p(s, "modelValue"), _ = s;
30
+ function v() {
31
+ _.maskClosable && (g.value = !1);
32
+ }
33
+ return (s, p) => (d(), n(e, { to: _.to }, [o(t, { name: "fade" }, {
34
+ default: m(() => [g.value ? (d(), i("div", {
35
+ key: 0,
36
+ style: u({
37
+ "background-color": _.bg,
38
+ "--duration": `${_.duration}ms`
39
+ }),
40
+ class: l(["popup-container", [`popup-container-${_.position}`, { "popup-container-bottom": !c.includes(_.position) }]]),
41
+ onClick: v
42
+ }, [a("div", {
43
+ class: "popup-content",
44
+ onClick: p[0] ||= h(() => {}, ["stop"])
45
+ }, [f(s.$slots, "default", {}, void 0, !0)])], 6)) : r("", !0)]),
46
+ _: 3
47
+ })], 8, ["to"]));
48
+ }
49
+ });
50
+ //#endregion
51
+ export { g as default };
@@ -0,0 +1 @@
1
+ .fade-enter-from[data-v-00d0e4c1],.fade-leave-to[data-v-00d0e4c1]{opacity:0}.popup-container[data-v-00d0e4c1]{z-index:50;transition:opacity var(--duration) ease-in-out;will-change:opacity;position:fixed;inset:0}.popup-content[data-v-00d0e4c1]{transition:transform var(--duration) ease-in-out;will-change:transform;position:absolute}.popup-container-top .popup-content[data-v-00d0e4c1]{top:0;left:0;right:0}.fade-enter-from.popup-container-top .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-top .popup-content[data-v-00d0e4c1]{transform:translateY(-100%)}.popup-container-bottom .popup-content[data-v-00d0e4c1]{bottom:0;left:0;right:0}.fade-enter-from.popup-container-bottom .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-bottom .popup-content[data-v-00d0e4c1]{transform:translateY(100%)}.popup-container-left .popup-content[data-v-00d0e4c1]{top:0;bottom:0;left:0}.fade-enter-from.popup-container-left .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-left .popup-content[data-v-00d0e4c1]{transform:translate(-100%)}.popup-container-right .popup-content[data-v-00d0e4c1]{top:0;bottom:0;right:0}.fade-enter-from.popup-container-right .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-right .popup-content[data-v-00d0e4c1]{transform:translate(100%)}
File without changes
File without changes
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`rox-v`]={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=Object.defineProperty,r=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},i=[`maxlength`],a=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({name:`InputOtp`,__name:`input-otp`,props:{modelValue:{default:``},length:{default:6},itemClass:{default:``},activeItemClass:{default:``},gap:{default:`10px`},hasFilledItemClass:{default:`active`}},emits:[`update:modelValue`,`complete`],setup(e,{emit:n}){let r=e,a=n,o=(0,t.ref)(null),s=(0,t.ref)(r.modelValue);(0,t.watch)(()=>r.modelValue,e=>{e!==s.value&&(s.value=e)});function c(e){let t=e.target.value;t=t.replace(/\D/g,``),t=t.slice(0,r.length),s.value=t,a(`update:modelValue`,t),t.length===r.length&&a(`complete`,t)}function l(){o.value?.focus()}function u(e){return e===s.value.length}function d(e){return e<s.value.length}return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`otp-wrapper`,onClick:l},[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{inputmode:`numeric`,autocomplete:`one-time-code`,ref_key:`inputRef`,ref:o,"onUpdate:modelValue":a[0]||=e=>s.value=e,maxlength:e.length,onInput:c,style:{position:`absolute`,opacity:`0`,"pointer-events":`none`}},null,40,i),[[t.vModelText,s.value]]),(0,t.createElementVNode)(`div`,{class:`otp-box`,style:(0,t.normalizeStyle)({gap:r.gap})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.length,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:(0,t.normalizeClass)([`otp-item`,[{[r.activeItemClass]:u(n)},{[r.hasFilledItemClass]:d(n)},r.itemClass]])},(0,t.toDisplayString)(s.value[n]||``),3))),128))],4)]))}}),[[`__scopeId`,`data-v-9ff7490d`]]);a.install=e=>(a.name&&e.component(a.name,a),e);var o=a,s=r({InputOtp:()=>o}),c=e=>(Object.keys(s).forEach(t=>{let n=s[t];n.install&&e.use(n)}),e),l={install:c};e.InputOtp=o,e.default=l,e.install=c});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`rox-v`]={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=Object.defineProperty,r=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},i=[`maxlength`],a=(0,t.defineComponent)({name:`InputOtp`,__name:`input-otp`,props:{modelValue:{default:``},length:{default:6},itemClass:{default:``},activeItemClass:{default:``},gap:{default:`10px`},hasFilledItemClass:{default:`active`}},emits:[`update:modelValue`,`complete`],setup(e,{emit:n}){let r=[`ArrowLeft`,`ArrowRight`,`Home`,`End`],a=e,o=n,s=(0,t.ref)(null),c=(0,t.ref)(a.modelValue);(0,t.watch)(()=>a.modelValue,e=>{e!==c.value&&(c.value=e)});function l(e){let t=e.target.value;t=t.replace(/\D/g,``),t=t.slice(0,a.length),c.value=t,o(`update:modelValue`,t),t.length===a.length&&o(`complete`,t)}function u(){(0,t.nextTick)(()=>{if(s.value){let e=c.value.length;s.value.setSelectionRange?.(e,e)}})}function d(e){let t=c.value,n=e.key;if(n===`Backspace`||n===`Delete`){if(e.preventDefault(),t.length>0){let e=t.slice(0,-1);c.value=e,o(`update:modelValue`,e),u()}}else r.includes(n)&&e.preventDefault()}function f(){s.value?.focus()}function p(e){return e===c.value.length}function m(e){return e<c.value.length}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`otp-wrapper`,onClick:f},[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{inputmode:`numeric`,autocomplete:`one-time-code`,ref_key:`inputRef`,ref:s,"onUpdate:modelValue":r[0]||=e=>c.value=e,maxlength:e.length,onInput:l,onKeydown:d,onFocus:u,style:{position:`absolute`,opacity:`0`,"pointer-events":`none`,width:`1px`,height:`1px`}},null,40,i),[[t.vModelText,c.value]]),(0,t.createElementVNode)(`div`,{class:`otp-box`,style:(0,t.normalizeStyle)({gap:a.gap})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.length,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:(0,t.normalizeClass)([`otp-item`,[{[a.activeItemClass]:p(n)},{[a.hasFilledItemClass]:m(n)},a.itemClass]])},(0,t.toDisplayString)(c.value[n]||``),3))),128))],4)]))}}),o=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},s=o(a,[[`__scopeId`,`data-v-0e246228`]]);s.install=e=>(s.name&&e.component(s.name,s),e);var c=s,l=o((0,t.defineComponent)({name:`Popup`,__name:`popup`,props:(0,t.mergeModels)({to:{default:`body`},bg:{default:`rgba(0, 0, 0, .5)`},duration:{default:300},position:{default:`bottom`},maskClosable:{type:Boolean,default:!0}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let n=[`bottom`,`left`,`right`,`top`],r=(0,t.useModel)(e,`modelValue`),i=e;function a(){i.maskClosable&&(r.value=!1)}return(e,o)=>((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:i.to},[(0,t.createVNode)(t.Transition,{name:`fade`},{default:(0,t.withCtx)(()=>[r.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,style:(0,t.normalizeStyle)({"background-color":i.bg,"--duration":`${i.duration}ms`}),class:(0,t.normalizeClass)([`popup-container`,[`popup-container-${i.position}`,{"popup-container-bottom":!n.includes(i.position)}]]),onClick:a},[(0,t.createElementVNode)(`div`,{class:`popup-content`,onClick:o[0]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.renderSlot)(e.$slots,`default`,{},void 0,!0)])],6)):(0,t.createCommentVNode)(``,!0)]),_:3})],8,[`to`]))}}),[[`__scopeId`,`data-v-00d0e4c1`]]);l.install=e=>(l.name&&e.component(l.name,l),e);var u=l,d=r({InputOtp:()=>c,Popup:()=>u}),f=e=>(Object.keys(d).forEach(t=>{let n=d[t];n.install&&e.use(n)}),e),p={install:f};e.InputOtp=c,e.Popup=u,e.default=p,e.install=f});
@@ -1 +1 @@
1
- const e=require(`./_virtual/_rolldown/runtime.js`),t=require(`./input-otp/index.js`);var n=e.__exportAll({InputOtp:()=>t.default});Object.defineProperty(exports,`components_exports`,{enumerable:!0,get:function(){return n}});
1
+ const e=require(`./_virtual/_rolldown/runtime.js`),t=require(`./input-otp/index.js`),n=require(`./popup/index.js`);var r=e.__exportAll({InputOtp:()=>t.default,Popup:()=>n.default});Object.defineProperty(exports,`components_exports`,{enumerable:!0,get:function(){return r}});
package/dist/lib/index.js CHANGED
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./input-otp/index.js`),t=require(`./components.js`);var n=e=>(Object.keys(t.components_exports).forEach(n=>{let r=t.components_exports[n];r.install&&e.use(r)}),e),r={install:n};exports.InputOtp=e.default,exports.default=r,exports.install=n;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./input-otp/index.js`),t=require(`./popup/index.js`),n=require(`./components.js`);require(`./style.css.js`);var r=e=>(Object.keys(n.components_exports).forEach(t=>{let r=n.components_exports[t];r.install&&e.use(r)}),e),i={install:r};exports.InputOtp=e.default,exports.Popup=t.default,exports.default=i,exports.install=r;
@@ -1 +1 @@
1
- const e=require(`./input-otp.js`);e.default.install=t=>(e.default.name&&t.component(e.default.name,e.default),t);var t=e.default;exports.default=t;
1
+ const e=require(`./input-otp.js`);require(`./style.css.js`),e.default.install=t=>(e.default.name&&t.component(e.default.name,e.default),t);var t=e.default;exports.default=t;
@@ -1 +1 @@
1
- const e=require(`./input-otp.vue_vue_type_script_setup_true_lang.js`);;/* empty css */var t=require(`../_virtual/_plugin-vue_export-helper.js`).default(e.default,[[`__scopeId`,`data-v-9ff7490d`]]);exports.default=t;
1
+ const e=require(`./input-otp.vue_vue_type_script_setup_true_lang.js`);;/* empty css */var t=require(`../_virtual/_plugin-vue_export-helper.js`).default(e.default,[[`__scopeId`,`data-v-0e246228`]]);exports.default=t;
@@ -1 +1 @@
1
- let e=require(`vue`);var t=[`maxlength`],n=(0,e.defineComponent)({name:`InputOtp`,__name:`input-otp`,props:{modelValue:{default:``},length:{default:6},itemClass:{default:``},activeItemClass:{default:``},gap:{default:`10px`},hasFilledItemClass:{default:`active`}},emits:[`update:modelValue`,`complete`],setup(n,{emit:r}){let i=n,a=r,o=(0,e.ref)(null),s=(0,e.ref)(i.modelValue);(0,e.watch)(()=>i.modelValue,e=>{e!==s.value&&(s.value=e)});function c(e){let t=e.target.value;t=t.replace(/\D/g,``),t=t.slice(0,i.length),s.value=t,a(`update:modelValue`,t),t.length===i.length&&a(`complete`,t)}function l(){o.value?.focus()}function u(e){return e===s.value.length}function d(e){return e<s.value.length}return(r,a)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`otp-wrapper`,onClick:l},[(0,e.withDirectives)((0,e.createElementVNode)(`input`,{inputmode:`numeric`,autocomplete:`one-time-code`,ref_key:`inputRef`,ref:o,"onUpdate:modelValue":a[0]||=e=>s.value=e,maxlength:n.length,onInput:c,style:{position:`absolute`,opacity:`0`,"pointer-events":`none`}},null,40,t),[[e.vModelText,s.value]]),(0,e.createElementVNode)(`div`,{class:`otp-box`,style:(0,e.normalizeStyle)({gap:i.gap})},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(n.length,(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:n,class:(0,e.normalizeClass)([`otp-item`,[{[i.activeItemClass]:u(n)},{[i.hasFilledItemClass]:d(n)},i.itemClass]])},(0,e.toDisplayString)(s.value[n]||``),3))),128))],4)]))}});exports.default=n;
1
+ let e=require(`vue`);var t=[`maxlength`],n=(0,e.defineComponent)({name:`InputOtp`,__name:`input-otp`,props:{modelValue:{default:``},length:{default:6},itemClass:{default:``},activeItemClass:{default:``},gap:{default:`10px`},hasFilledItemClass:{default:`active`}},emits:[`update:modelValue`,`complete`],setup(n,{emit:r}){let i=[`ArrowLeft`,`ArrowRight`,`Home`,`End`],a=n,o=r,s=(0,e.ref)(null),c=(0,e.ref)(a.modelValue);(0,e.watch)(()=>a.modelValue,e=>{e!==c.value&&(c.value=e)});function l(e){let t=e.target.value;t=t.replace(/\D/g,``),t=t.slice(0,a.length),c.value=t,o(`update:modelValue`,t),t.length===a.length&&o(`complete`,t)}function u(){(0,e.nextTick)(()=>{if(s.value){let e=c.value.length;s.value.setSelectionRange?.(e,e)}})}function d(e){let t=c.value,n=e.key;if(n===`Backspace`||n===`Delete`){if(e.preventDefault(),t.length>0){let e=t.slice(0,-1);c.value=e,o(`update:modelValue`,e),u()}}else i.includes(n)&&e.preventDefault()}function f(){s.value?.focus()}function p(e){return e===c.value.length}function m(e){return e<c.value.length}return(r,i)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`otp-wrapper`,onClick:f},[(0,e.withDirectives)((0,e.createElementVNode)(`input`,{inputmode:`numeric`,autocomplete:`one-time-code`,ref_key:`inputRef`,ref:s,"onUpdate:modelValue":i[0]||=e=>c.value=e,maxlength:n.length,onInput:l,onKeydown:d,onFocus:u,style:{position:`absolute`,opacity:`0`,"pointer-events":`none`,width:`1px`,height:`1px`}},null,40,t),[[e.vModelText,c.value]]),(0,e.createElementVNode)(`div`,{class:`otp-box`,style:(0,e.normalizeStyle)({gap:a.gap})},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(n.length,(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:n,class:(0,e.normalizeClass)([`otp-item`,[{[a.activeItemClass]:p(n)},{[a.hasFilledItemClass]:m(n)},a.itemClass]])},(0,e.toDisplayString)(c.value[n]||``),3))),128))],4)]))}});exports.default=n;
@@ -1 +1 @@
1
- .otp-wrapper[data-v-9ff7490d]{cursor:pointer;width:max-content;position:relative}.otp-box[data-v-9ff7490d]{display:flex}.otp-item[data-v-9ff7490d]{border-bottom:1px solid #00000029;justify-content:center;align-items:center;width:60px;height:60px;transition:all .2s;display:flex}.otp-item.active[data-v-9ff7490d]{border-bottom:1px solid #000}
1
+ .otp-wrapper[data-v-0e246228]{cursor:pointer;width:max-content;position:relative}.otp-box[data-v-0e246228]{display:flex}.otp-item[data-v-0e246228]{border-bottom:1px solid #00000029;justify-content:center;align-items:center;width:60px;height:60px;transition:all .2s;display:flex}.otp-item.active[data-v-0e246228]{border-bottom:1px solid #000}
File without changes
@@ -0,0 +1 @@
1
+ const e=require(`./popup.js`);require(`./style.css.js`),e.default.install=t=>(e.default.name&&t.component(e.default.name,e.default),t);var t=e.default;exports.default=t;
@@ -0,0 +1 @@
1
+ const e=require(`../_virtual/_plugin-vue_export-helper.js`),t=require(`./popup.vue_vue_type_script_setup_true_lang.js`);;/* empty css */var n=e.default(t.default,[[`__scopeId`,`data-v-00d0e4c1`]]);exports.default=n;
@@ -0,0 +1 @@
1
+ let e=require(`vue`);var t=(0,e.defineComponent)({name:`Popup`,__name:`popup`,props:(0,e.mergeModels)({to:{default:`body`},bg:{default:`rgba(0, 0, 0, .5)`},duration:{default:300},position:{default:`bottom`},maskClosable:{type:Boolean,default:!0}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(t){let n=[`bottom`,`left`,`right`,`top`],r=(0,e.useModel)(t,`modelValue`),i=t;function a(){i.maskClosable&&(r.value=!1)}return(t,o)=>((0,e.openBlock)(),(0,e.createBlock)(e.Teleport,{to:i.to},[(0,e.createVNode)(e.Transition,{name:`fade`},{default:(0,e.withCtx)(()=>[r.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,style:(0,e.normalizeStyle)({"background-color":i.bg,"--duration":`${i.duration}ms`}),class:(0,e.normalizeClass)([`popup-container`,[`popup-container-${i.position}`,{"popup-container-bottom":!n.includes(i.position)}]]),onClick:a},[(0,e.createElementVNode)(`div`,{class:`popup-content`,onClick:o[0]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.renderSlot)(t.$slots,`default`,{},void 0,!0)])],6)):(0,e.createCommentVNode)(``,!0)]),_:3})],8,[`to`]))}});exports.default=t;
@@ -0,0 +1 @@
1
+ .fade-enter-from[data-v-00d0e4c1],.fade-leave-to[data-v-00d0e4c1]{opacity:0}.popup-container[data-v-00d0e4c1]{z-index:50;transition:opacity var(--duration) ease-in-out;will-change:opacity;position:fixed;inset:0}.popup-content[data-v-00d0e4c1]{transition:transform var(--duration) ease-in-out;will-change:transform;position:absolute}.popup-container-top .popup-content[data-v-00d0e4c1]{top:0;left:0;right:0}.fade-enter-from.popup-container-top .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-top .popup-content[data-v-00d0e4c1]{transform:translateY(-100%)}.popup-container-bottom .popup-content[data-v-00d0e4c1]{bottom:0;left:0;right:0}.fade-enter-from.popup-container-bottom .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-bottom .popup-content[data-v-00d0e4c1]{transform:translateY(100%)}.popup-container-left .popup-content[data-v-00d0e4c1]{top:0;bottom:0;left:0}.fade-enter-from.popup-container-left .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-left .popup-content[data-v-00d0e4c1]{transform:translate(-100%)}.popup-container-right .popup-content[data-v-00d0e4c1]{top:0;bottom:0;right:0}.fade-enter-from.popup-container-right .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-right .popup-content[data-v-00d0e4c1]{transform:translate(100%)}
File without changes
File without changes
package/dist/style.css CHANGED
@@ -1,2 +1,2 @@
1
- .otp-wrapper[data-v-9ff7490d]{cursor:pointer;width:max-content;position:relative}.otp-box[data-v-9ff7490d]{display:flex}.otp-item[data-v-9ff7490d]{border-bottom:1px solid #00000029;justify-content:center;align-items:center;width:60px;height:60px;transition:all .2s;display:flex}.otp-item.active[data-v-9ff7490d]{border-bottom:1px solid #000}
1
+ .otp-wrapper[data-v-0e246228]{cursor:pointer;width:max-content;position:relative}.otp-box[data-v-0e246228]{display:flex}.otp-item[data-v-0e246228]{border-bottom:1px solid #00000029;justify-content:center;align-items:center;width:60px;height:60px;transition:all .2s;display:flex}.otp-item.active[data-v-0e246228]{border-bottom:1px solid #000}.fade-enter-from[data-v-00d0e4c1],.fade-leave-to[data-v-00d0e4c1]{opacity:0}.popup-container[data-v-00d0e4c1]{z-index:50;transition:opacity var(--duration) ease-in-out;will-change:opacity;position:fixed;inset:0}.popup-content[data-v-00d0e4c1]{transition:transform var(--duration) ease-in-out;will-change:transform;position:absolute}.popup-container-top .popup-content[data-v-00d0e4c1]{top:0;left:0;right:0}.fade-enter-from.popup-container-top .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-top .popup-content[data-v-00d0e4c1]{transform:translateY(-100%)}.popup-container-bottom .popup-content[data-v-00d0e4c1]{bottom:0;left:0;right:0}.fade-enter-from.popup-container-bottom .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-bottom .popup-content[data-v-00d0e4c1]{transform:translateY(100%)}.popup-container-left .popup-content[data-v-00d0e4c1]{top:0;bottom:0;left:0}.fade-enter-from.popup-container-left .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-left .popup-content[data-v-00d0e4c1]{transform:translate(-100%)}.popup-container-right .popup-content[data-v-00d0e4c1]{top:0;bottom:0;right:0}.fade-enter-from.popup-container-right .popup-content[data-v-00d0e4c1],.fade-leave-to.popup-container-right .popup-content[data-v-00d0e4c1]{transform:translate(100%)}
2
2
  /*$vite$:1*/
@@ -1,2 +1,4 @@
1
1
  export { default as InputOtp } from './input-otp';
2
2
  export type { RoxInputOtpProps } from './input-otp';
3
+ export { default as Popup } from './popup';
4
+ export type { RoxPopupProps } from './popup';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { Plugin } from 'vue';
2
+ import { default as Popup } from './popup.vue';
3
+ export * from './types';
4
+ declare const _default: typeof Popup & Plugin;
5
+ export default _default;
@@ -0,0 +1,33 @@
1
+ import { RoxPopupProps } from './types';
2
+ declare const model: import('vue').ModelRef<boolean, string, boolean, boolean>;
3
+ type __VLS_Props = RoxPopupProps;
4
+ type __VLS_PublicProps = {
5
+ modelValue?: typeof model['value'];
6
+ } & __VLS_Props;
7
+ declare function __VLS_template(): {
8
+ attrs: Partial<{}>;
9
+ slots: {
10
+ default?(_: {}): any;
11
+ };
12
+ refs: {};
13
+ rootEl: any;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
17
+ "update:modelValue": (value: boolean) => any;
18
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
19
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
20
+ }>, {
21
+ position: "top" | "bottom" | "left" | "right";
22
+ to: string | import('vue').RendererElement | null;
23
+ bg: string;
24
+ duration: number;
25
+ maskClosable: boolean;
26
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
27
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
28
+ export default _default;
29
+ type __VLS_WithTemplateSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { RendererElement } from 'vue';
2
+ export interface RoxPopupProps {
3
+ to?: string | RendererElement | null | undefined;
4
+ bg?: string;
5
+ duration?: number;
6
+ position?: "top" | "bottom" | "left" | "right";
7
+ maskClosable?: boolean;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a-drowned-fish/rox-v",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "vue ui library",
5
5
  "main": "dist/lib/index.js",
6
6
  "module": "dist/es/index.js",
@@ -22,11 +22,6 @@
22
22
  "require": "./dist/lib/index.js",
23
23
  "types": "./dist/types/components/index.d.ts"
24
24
  },
25
- "./resolver": {
26
- "import": "./dist/resolver/index.js",
27
- "require": "./dist/resolver/index.cjs.js",
28
- "types": "./dist/resolver/resolver.d.ts"
29
- },
30
25
  "./es/*": {
31
26
  "import": "./dist/es/*.js",
32
27
  "types": [
@@ -60,14 +55,14 @@
60
55
  },
61
56
  "sideEffects": [
62
57
  "dist/*",
63
- "*.css"
58
+ "*.css",
59
+ "*.css.ts"
64
60
  ],
65
61
  "publishConfig": {
66
62
  "access": "public"
67
63
  },
68
64
  "scripts": {
69
65
  "build:es": "vite build --config vite.build.config.ts",
70
- "build:lib": "vite build --config vite.umd.config.ts",
71
- "build:resolver": "vite build --config vite.resolver.config.ts"
66
+ "build:lib": "vite build --config vite.umd.config.ts"
72
67
  }
73
68
  }
@@ -1 +0,0 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});function e(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function t(t={}){let{cjs:n=!1,importStyle:r=!0}=t,i=n?`lib`:`es`;return{type:`component`,resolve:t=>{let n=e(t);return{name:`default`,from:`@a-drowned-fish/rox-v/dist/${i}/${n}/index`,sideEffects:r?`@a-drowned-fish/rox-v/dist/${i}/${n}/style.css`:void 0}}}}exports.RoxVResolver=t,exports.default=t;
@@ -1,20 +0,0 @@
1
- //#region components/resolver.ts
2
- function e(e) {
3
- return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
4
- }
5
- function t(t = {}) {
6
- let { cjs: n = !1, importStyle: r = !0 } = t, i = n ? "lib" : "es";
7
- return {
8
- type: "component",
9
- resolve: (t) => {
10
- let n = e(t);
11
- return {
12
- name: "default",
13
- from: `@a-drowned-fish/rox-v/dist/${i}/${n}/index`,
14
- sideEffects: r ? `@a-drowned-fish/rox-v/dist/${i}/${n}/style.css` : void 0
15
- };
16
- }
17
- };
18
- }
19
- //#endregion
20
- export { t as RoxVResolver, t as default };
@@ -1,15 +0,0 @@
1
- import { ComponentResolver } from 'unplugin-vue-components/types';
2
- export interface RoxVResolverOptions {
3
- /**
4
- * Use CommonJS build (lib) instead of ES modules (es)
5
- * @default false
6
- */
7
- cjs?: boolean;
8
- /**
9
- * Automatically import component styles
10
- * @default true
11
- */
12
- importStyle?: boolean;
13
- }
14
- export declare function RoxVResolver(options?: RoxVResolverOptions): ComponentResolver;
15
- export default RoxVResolver;