@vrojs/base 0.0.1 → 0.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.
- package/dist/index.d.ts +6 -0
- package/dist/index.js +37 -0
- package/dist/style/css.js +4 -0
- package/dist/style/index.css +1 -0
- package/dist/style/index.d.ts +0 -0
- package/dist/style/index.js +4 -0
- package/dist/types/Arrayable.d.ts +1 -0
- package/dist/types/Arrayable.js +1 -0
- package/dist/types/DeepPartial.d.ts +3 -0
- package/dist/types/DeepPartial.js +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +1 -0
- package/dist/utils/ComponentManager.d.ts +18 -0
- package/dist/utils/ComponentManager.js +21 -0
- package/dist/utils/format.d.ts +5 -0
- package/dist/utils/format.js +14 -0
- package/dist/utils/getSlotEntries.d.ts +5 -0
- package/dist/utils/getSlotEntries.js +4 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.js +21 -0
- package/dist/utils/mountComponent.d.ts +5 -0
- package/dist/utils/mountComponent.js +12 -0
- package/dist/utils/parseType.d.ts +1 -0
- package/dist/utils/parseType.js +4 -0
- package/dist/utils/props.d.ts +2 -0
- package/dist/utils/props.js +5 -0
- package/dist/utils/renderComponent.d.ts +5 -0
- package/dist/utils/renderComponent.js +17 -0
- package/dist/utils/showComponent.d.ts +6 -0
- package/dist/utils/showComponent.js +17 -0
- package/dist/utils/withInstall.d.ts +3 -0
- package/dist/utils/withInstall.js +6 -0
- package/dist/vro-aspect-ratio/index.d.ts +46 -0
- package/dist/vro-aspect-ratio/index.js +11 -0
- package/dist/vro-aspect-ratio/style/css.d.ts +0 -0
- package/dist/vro-aspect-ratio/style/css.js +4 -0
- package/dist/vro-aspect-ratio/style/index.css +1 -0
- package/dist/vro-aspect-ratio/style/index.d.ts +0 -0
- package/dist/vro-aspect-ratio/style/index.js +4 -0
- package/dist/vro-aspect-ratio/types.d.ts +13 -0
- package/dist/vro-aspect-ratio/types.js +14 -0
- package/dist/vro-aspect-ratio/vro-aspect-ratio.vue.d.ts +29 -0
- package/dist/vro-aspect-ratio/vro-aspect-ratio.vue.js +25 -0
- package/dist/vro-aspect-ratio/vro-aspect-ratio.vue2.js +4 -0
- package/dist/vro-input/index.d.ts +90 -0
- package/dist/vro-input/index.js +11 -0
- package/dist/vro-input/style/css.d.ts +0 -0
- package/dist/vro-input/style/css.js +3 -0
- package/dist/vro-input/style/index.d.ts +0 -0
- package/dist/vro-input/style/index.js +3 -0
- package/dist/vro-input/types.d.ts +95 -0
- package/{src/vro-input/types.ts → dist/vro-input/types.js} +17 -30
- package/dist/vro-input/vro-input.vue.d.ts +83 -0
- package/dist/vro-input/vro-input.vue.js +62 -0
- package/dist/vro-input/vro-input.vue2.js +4 -0
- package/dist/vro-loading/index.d.ts +91 -0
- package/dist/vro-loading/index.js +11 -0
- package/dist/vro-loading/style/css.d.ts +0 -0
- package/dist/vro-loading/style/css.js +4 -0
- package/dist/vro-loading/style/index.css +1 -0
- package/dist/vro-loading/style/index.d.ts +0 -0
- package/dist/vro-loading/style/index.js +4 -0
- package/dist/vro-loading/types.d.ts +33 -0
- package/dist/vro-loading/types.js +33 -0
- package/dist/vro-loading/vro-loading.vue.d.ts +56 -0
- package/dist/vro-loading/vro-loading.vue.js +50 -0
- package/dist/vro-loading/vro-loading.vue2.js +4 -0
- package/dist/vro-vnr/index.d.ts +25 -0
- package/dist/vro-vnr/index.js +11 -0
- package/dist/vro-vnr/style/css.d.ts +0 -0
- package/dist/vro-vnr/style/css.js +3 -0
- package/dist/vro-vnr/style/index.d.ts +0 -0
- package/dist/vro-vnr/style/index.js +3 -0
- package/dist/vro-vnr/types.d.ts +8 -0
- package/dist/vro-vnr/types.js +9 -0
- package/dist/vro-vnr/vro-vnr.vue.d.ts +18 -0
- package/dist/vro-vnr/vro-vnr.vue.js +12 -0
- package/dist/vro-vnr/vro-vnr.vue2.js +4 -0
- package/package.json +16 -10
- package/src/index.ts +0 -8
- package/src/style/base.scss +0 -2
- package/src/style/css.ts +0 -2
- package/src/style/index.scss +0 -7
- package/src/style/index.ts +0 -1
- package/src/types/Arrayable.ts +0 -1
- package/src/types/DeepPartial.ts +0 -3
- package/src/types/index.ts +0 -2
- package/src/utils/ComponentManager.ts +0 -39
- package/src/utils/format.ts +0 -31
- package/src/utils/index.ts +0 -8
- package/src/utils/mountComponent.ts +0 -16
- package/src/utils/parseType.ts +0 -6
- package/src/utils/props.ts +0 -3
- package/src/utils/renderComponent.ts +0 -24
- package/src/utils/showComponent.ts +0 -24
- package/src/utils/withInstall.ts +0 -10
- package/src/vro-aspect-ratio/README.md +0 -55
- package/src/vro-aspect-ratio/index.ts +0 -15
- package/src/vro-aspect-ratio/style/css.ts +0 -2
- package/src/vro-aspect-ratio/style/index.scss +0 -16
- package/src/vro-aspect-ratio/style/index.ts +0 -1
- package/src/vro-aspect-ratio/types.ts +0 -15
- package/src/vro-aspect-ratio/vro-aspect-ratio.vue +0 -23
- package/src/vro-input/README.md +0 -95
- package/src/vro-input/index.ts +0 -15
- package/src/vro-input/style/css.ts +0 -2
- package/src/vro-input/style/index.ts +0 -1
- package/src/vro-input/vro-input.vue +0 -122
- package/src/vro-loading/README.md +0 -77
- package/src/vro-loading/index.ts +0 -15
- package/src/vro-loading/style/css.ts +0 -2
- package/src/vro-loading/style/index.scss +0 -119
- package/src/vro-loading/style/index.ts +0 -1
- package/src/vro-loading/types.ts +0 -39
- package/src/vro-loading/vro-loading.vue +0 -39
- package/src/vro-vnr/README.md +0 -46
- package/src/vro-vnr/index.ts +0 -15
- package/src/vro-vnr/style/css.ts +0 -2
- package/src/vro-vnr/style/index.ts +0 -1
- package/src/vro-vnr/types.ts +0 -10
- package/src/vro-vnr/vro-vnr.vue +0 -13
- /package/{src/vro-input/style/index.scss → dist/style/base.css} +0 -0
- /package/{src/vro-vnr/style/index.scss → dist/style/css.d.ts} +0 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ComponentManager as e } from "./utils/ComponentManager.js";
|
|
2
|
+
import { parseDecimalString as t, parseNumberString as m } from "./utils/format.js";
|
|
3
|
+
import { getSlotEntries as f } from "./utils/getSlotEntries.js";
|
|
4
|
+
import { mountComponent as s } from "./utils/mountComponent.js";
|
|
5
|
+
import { parseType as i } from "./utils/parseType.js";
|
|
6
|
+
import { definePropType as V } from "./utils/props.js";
|
|
7
|
+
import { renderComponent as d } from "./utils/renderComponent.js";
|
|
8
|
+
import { showComponent as u } from "./utils/showComponent.js";
|
|
9
|
+
import { withInstall as C } from "./utils/withInstall.js";
|
|
10
|
+
import { VroAspectRatio as I } from "./vro-aspect-ratio/index.js";
|
|
11
|
+
import { VroInput as h } from "./vro-input/index.js";
|
|
12
|
+
import { VroLoading as y } from "./vro-loading/index.js";
|
|
13
|
+
import { VroVnr as L } from "./vro-vnr/index.js";
|
|
14
|
+
import { vroAspectRatioProps as T } from "./vro-aspect-ratio/types.js";
|
|
15
|
+
import { vroInputProps as D } from "./vro-input/types.js";
|
|
16
|
+
import { vroLoadingProps as M } from "./vro-loading/types.js";
|
|
17
|
+
import { vroVnrProps as j } from "./vro-vnr/types.js";
|
|
18
|
+
export {
|
|
19
|
+
e as ComponentManager,
|
|
20
|
+
I as VroAspectRatio,
|
|
21
|
+
h as VroInput,
|
|
22
|
+
y as VroLoading,
|
|
23
|
+
L as VroVnr,
|
|
24
|
+
V as definePropType,
|
|
25
|
+
f as getSlotEntries,
|
|
26
|
+
s as mountComponent,
|
|
27
|
+
t as parseDecimalString,
|
|
28
|
+
m as parseNumberString,
|
|
29
|
+
i as parseType,
|
|
30
|
+
d as renderComponent,
|
|
31
|
+
u as showComponent,
|
|
32
|
+
T as vroAspectRatioProps,
|
|
33
|
+
D as vroInputProps,
|
|
34
|
+
M as vroLoadingProps,
|
|
35
|
+
j as vroVnrProps,
|
|
36
|
+
C as withInstall
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.vro-aspect-ratio{position:relative}.vro-aspect-ratio-inner{position:relative;width:100%}.vro-aspect-ratio-content{position:absolute;top:0;left:0;width:100%;height:100%}.vro-loading{--vro-loading-size: 32px;--vro-loading-color: currentColor;display:inline-flex;align-items:center;justify-content:center;color:var(--vro-loading-color);line-height:1;vertical-align:middle}.vro-loading__circular{width:var(--vro-loading-size);height:var(--vro-loading-size);animation:vro-loading-rotate 1.6s linear infinite}.vro-loading__circular circle{stroke:currentColor;stroke-width:4;stroke-linecap:round;stroke-dasharray:90,150;stroke-dashoffset:0;animation:vro-loading-circular 1.6s ease-in-out infinite}.vro-loading__spinner{position:relative;width:var(--vro-loading-size);height:var(--vro-loading-size);animation:vro-loading-fade 1.2s linear infinite}.vro-loading__spinner i{position:absolute;left:50%;top:0;width:2px;height:28%;background:currentColor;border-radius:999px;transform-origin:center calc(var(--vro-loading-size) / 2)}.vro-loading__spinner i:nth-child(1){opacity:calc(1 / 12);transform:translate(-50%) rotate(0)}.vro-loading__spinner i:nth-child(2){opacity:calc(2 / 12);transform:translate(-50%) rotate(30deg)}.vro-loading__spinner i:nth-child(3){opacity:.25;transform:translate(-50%) rotate(60deg)}.vro-loading__spinner i:nth-child(4){opacity:calc(4 / 12);transform:translate(-50%) rotate(90deg)}.vro-loading__spinner i:nth-child(5){opacity:calc(5 / 12);transform:translate(-50%) rotate(120deg)}.vro-loading__spinner i:nth-child(6){opacity:.5;transform:translate(-50%) rotate(150deg)}.vro-loading__spinner i:nth-child(7){opacity:calc(7 / 12);transform:translate(-50%) rotate(180deg)}.vro-loading__spinner i:nth-child(8){opacity:calc(8 / 12);transform:translate(-50%) rotate(210deg)}.vro-loading__spinner i:nth-child(9){opacity:.75;transform:translate(-50%) rotate(240deg)}.vro-loading__spinner i:nth-child(10){opacity:calc(10 / 12);transform:translate(-50%) rotate(270deg)}.vro-loading__spinner i:nth-child(11){opacity:calc(11 / 12);transform:translate(-50%) rotate(300deg)}.vro-loading__spinner i:nth-child(12){opacity:1;transform:translate(-50%) rotate(330deg)}.vro-loading__dots{display:inline-flex;align-items:center;justify-content:center;gap:calc(var(--vro-loading-size) * .12);width:var(--vro-loading-size);height:var(--vro-loading-size)}.vro-loading__dots i{width:calc(var(--vro-loading-size) * .18);height:calc(var(--vro-loading-size) * .18);background:currentColor;border-radius:50%;animation:vro-loading-dot 1s ease-in-out infinite}.vro-loading__dots i:nth-child(2){animation-delay:.15s}.vro-loading__dots i:nth-child(3){animation-delay:.3s}@keyframes vro-loading-rotate{to{transform:rotate(360deg)}}@keyframes vro-loading-circular{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40}to{stroke-dasharray:90,150;stroke-dashoffset:-120}}@keyframes vro-loading-fade{to{transform:rotate(360deg)}}@keyframes vro-loading-dot{0%,80%,to{opacity:.35;transform:scale(.72)}40%{opacity:1;transform:scale(1)}}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Arrayable<T> = T | T[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type Constructor = abstract new (...args: any) => any;
|
|
2
|
+
export type InstanceTypeProps<T extends Constructor> = InstanceType<T>['$props'];
|
|
3
|
+
export type ComponentManagerMapValue<T extends Constructor = any> = {
|
|
4
|
+
is: T;
|
|
5
|
+
props: InstanceTypeProps<T>;
|
|
6
|
+
} | {
|
|
7
|
+
is: string;
|
|
8
|
+
props: Record<string, any>;
|
|
9
|
+
};
|
|
10
|
+
export declare class ComponentManager {
|
|
11
|
+
map: Record<string, ComponentManagerMapValue>;
|
|
12
|
+
add(name: string, props?: Record<string, any>): ComponentManager;
|
|
13
|
+
add<T extends Constructor>(name: string, is: T, props?: InstanceTypeProps<T>): ComponentManager;
|
|
14
|
+
get(name: string): ComponentManagerMapValue<any>;
|
|
15
|
+
del(name: string): void;
|
|
16
|
+
clear(): void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isFunction as r } from "@daysnap/utils";
|
|
2
|
+
class o {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.map = {};
|
|
5
|
+
}
|
|
6
|
+
add(t, p, s) {
|
|
7
|
+
return r(p.setup) ? this.map[t] = { is: p, props: s ?? {} } : this.map[t] = { is: t, props: p ?? {} }, this;
|
|
8
|
+
}
|
|
9
|
+
get(t) {
|
|
10
|
+
return this.map[t];
|
|
11
|
+
}
|
|
12
|
+
del(t) {
|
|
13
|
+
delete this.map[t];
|
|
14
|
+
}
|
|
15
|
+
clear() {
|
|
16
|
+
this.map = {};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
o as ComponentManager
|
|
21
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function n(t) {
|
|
2
|
+
return t.replace(/[^\d]/g, "");
|
|
3
|
+
}
|
|
4
|
+
function c(t, r = {}) {
|
|
5
|
+
const { precision: e = 0, allowNegativeNumber: s = !0 } = r, i = new RegExp(
|
|
6
|
+
`^${s ? "-?" : ""}(0|[1-9]\\d*)?${+e == 0 ? "" : `(\\.?\\d{0,${e}})?`}`,
|
|
7
|
+
"g"
|
|
8
|
+
);
|
|
9
|
+
return t = t.match(i)?.[0] ?? "", t.startsWith("-00") ? t = "-0" : t.startsWith("-.") ? t = "-" : t.startsWith(".") ? t = "" : t.startsWith("0") && !t.startsWith("0.") && t.length > 1 && (t = `${+t}`), t;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
c as parseDecimalString,
|
|
13
|
+
n as parseNumberString
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './ComponentManager';
|
|
2
|
+
export * from './format';
|
|
3
|
+
export * from './getSlotEntries';
|
|
4
|
+
export * from './mountComponent';
|
|
5
|
+
export * from './parseType';
|
|
6
|
+
export * from './props';
|
|
7
|
+
export * from './renderComponent';
|
|
8
|
+
export * from './showComponent';
|
|
9
|
+
export * from './withInstall';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentManager as e } from "./ComponentManager.js";
|
|
2
|
+
import { parseDecimalString as p, parseNumberString as m } from "./format.js";
|
|
3
|
+
import { getSlotEntries as f } from "./getSlotEntries.js";
|
|
4
|
+
import { mountComponent as a } from "./mountComponent.js";
|
|
5
|
+
import { parseType as s } from "./parseType.js";
|
|
6
|
+
import { definePropType as l } from "./props.js";
|
|
7
|
+
import { renderComponent as S } from "./renderComponent.js";
|
|
8
|
+
import { showComponent as h } from "./showComponent.js";
|
|
9
|
+
import { withInstall as w } from "./withInstall.js";
|
|
10
|
+
export {
|
|
11
|
+
e as ComponentManager,
|
|
12
|
+
l as definePropType,
|
|
13
|
+
f as getSlotEntries,
|
|
14
|
+
a as mountComponent,
|
|
15
|
+
p as parseDecimalString,
|
|
16
|
+
m as parseNumberString,
|
|
17
|
+
s as parseType,
|
|
18
|
+
S as renderComponent,
|
|
19
|
+
h as showComponent,
|
|
20
|
+
w as withInstall
|
|
21
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createApp as d } from "vue";
|
|
2
|
+
function c(n, e) {
|
|
3
|
+
const o = document.createElement("div");
|
|
4
|
+
document.body.appendChild(o);
|
|
5
|
+
const t = d(n, e);
|
|
6
|
+
return t.mount(o), { instance: t, destroy: () => {
|
|
7
|
+
t.unmount(), document.body.removeChild(o);
|
|
8
|
+
} };
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
c as mountComponent
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseType: (value: any) => any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createVNode as m, render as o } from "vue";
|
|
2
|
+
function i(t, d = {}, r = null) {
|
|
3
|
+
const e = document.createElement("div");
|
|
4
|
+
document.body.appendChild(e);
|
|
5
|
+
const n = m(t, d);
|
|
6
|
+
n.appContext = r, o(n, e);
|
|
7
|
+
const c = () => {
|
|
8
|
+
o(null, e), document.body.removeChild(e);
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
instance: n.component,
|
|
12
|
+
destroy: c
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
i as renderComponent
|
|
17
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AppContext, Component } from 'vue';
|
|
2
|
+
export declare function showComponent<T extends Component, P = T extends {
|
|
3
|
+
new (): {
|
|
4
|
+
$props: infer Props;
|
|
5
|
+
};
|
|
6
|
+
} ? Props : Record<string, any>>(component: T, props: Partial<P>, appContext?: AppContext | null): Promise<any>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { renderComponent as w } from "./renderComponent.js";
|
|
2
|
+
function i(n, o, e = null) {
|
|
3
|
+
return new Promise((t, r) => {
|
|
4
|
+
const { destroy: c, instance: s } = w(
|
|
5
|
+
n,
|
|
6
|
+
{
|
|
7
|
+
...o,
|
|
8
|
+
onClosed: () => c()
|
|
9
|
+
},
|
|
10
|
+
e ?? n._context ?? window.app?._context ?? window._app?._context
|
|
11
|
+
);
|
|
12
|
+
s.exposed.show(o).then(t).catch(r);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
i as showComponent
|
|
17
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export declare const VroAspectRatio: import('..').WithInstall<{
|
|
3
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
4
|
+
ratio: {
|
|
5
|
+
type: NumberConstructor;
|
|
6
|
+
default: number;
|
|
7
|
+
};
|
|
8
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
9
|
+
ratio: number;
|
|
10
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
11
|
+
P: {};
|
|
12
|
+
B: {};
|
|
13
|
+
D: {};
|
|
14
|
+
C: {};
|
|
15
|
+
M: {};
|
|
16
|
+
Defaults: {};
|
|
17
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
18
|
+
ratio: {
|
|
19
|
+
type: NumberConstructor;
|
|
20
|
+
default: number;
|
|
21
|
+
};
|
|
22
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
23
|
+
ratio: number;
|
|
24
|
+
}>;
|
|
25
|
+
__isFragment?: never;
|
|
26
|
+
__isTeleport?: never;
|
|
27
|
+
__isSuspense?: never;
|
|
28
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
29
|
+
ratio: {
|
|
30
|
+
type: NumberConstructor;
|
|
31
|
+
default: number;
|
|
32
|
+
};
|
|
33
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
34
|
+
ratio: number;
|
|
35
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
36
|
+
$slots: {
|
|
37
|
+
default?(_: {}): any;
|
|
38
|
+
};
|
|
39
|
+
})>;
|
|
40
|
+
export default VroAspectRatio;
|
|
41
|
+
export type VroAspectRatioInstance = InstanceType<typeof VroAspectRatio>;
|
|
42
|
+
declare module 'vue' {
|
|
43
|
+
interface GlobalComponents {
|
|
44
|
+
VroAspectRatio: typeof VroAspectRatio;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "@daysnap/utils";
|
|
2
|
+
import "vue";
|
|
3
|
+
import { withInstall as o } from "../utils/withInstall.js";
|
|
4
|
+
import t from "./vro-aspect-ratio.vue.js";
|
|
5
|
+
import { vroAspectRatioProps as f } from "./types.js";
|
|
6
|
+
const s = o(t);
|
|
7
|
+
export {
|
|
8
|
+
s as VroAspectRatio,
|
|
9
|
+
s as default,
|
|
10
|
+
f as vroAspectRatioProps
|
|
11
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vro-aspect-ratio{position:relative}.vro-aspect-ratio-inner{position:relative;width:100%}.vro-aspect-ratio-content{position:absolute;top:0;left:0;width:100%;height:100%}
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
export declare const vroAspectRatioProps: {
|
|
3
|
+
/**
|
|
4
|
+
* 宽高比,等价于 width / height
|
|
5
|
+
*
|
|
6
|
+
* @default 1
|
|
7
|
+
*/
|
|
8
|
+
ratio: {
|
|
9
|
+
type: NumberConstructor;
|
|
10
|
+
default: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type VroAspectRatioProps = ExtractPropTypes<typeof vroAspectRatioProps>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: HTMLDivElement;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
11
|
+
ratio: {
|
|
12
|
+
type: NumberConstructor;
|
|
13
|
+
default: number;
|
|
14
|
+
};
|
|
15
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
16
|
+
ratio: {
|
|
17
|
+
type: NumberConstructor;
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
}>> & Readonly<{}>, {
|
|
21
|
+
ratio: number;
|
|
22
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
23
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineComponent as a, computed as n, createElementBlock as c, openBlock as i, createElementVNode as e, normalizeStyle as p, renderSlot as l } from "vue";
|
|
2
|
+
import { vroAspectRatioProps as d } from "./types.js";
|
|
3
|
+
const m = { class: "vro-aspect-ratio" }, v = { class: "vro-aspect-ratio-content" }, h = /* @__PURE__ */ a({
|
|
4
|
+
name: "VroAspectRatio",
|
|
5
|
+
__name: "vro-aspect-ratio",
|
|
6
|
+
props: d,
|
|
7
|
+
setup(t) {
|
|
8
|
+
const o = t, r = n(() => ({
|
|
9
|
+
paddingTop: `${100 / o.ratio}%`
|
|
10
|
+
}));
|
|
11
|
+
return (s, _) => (i(), c("div", m, [
|
|
12
|
+
e("div", {
|
|
13
|
+
class: "vro-aspect-ratio-inner",
|
|
14
|
+
style: p(r.value)
|
|
15
|
+
}, [
|
|
16
|
+
e("div", v, [
|
|
17
|
+
l(s.$slots, "default")
|
|
18
|
+
])
|
|
19
|
+
], 4)
|
|
20
|
+
]));
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
h as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export declare const VroInput: import('..').WithInstall<import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
3
|
+
type: {
|
|
4
|
+
type: import('vue').PropType<import('vue').InputTypeHTMLAttribute | "decimal">;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: import('vue').PropType<string | number | null | undefined>;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
max: {
|
|
12
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
13
|
+
default: number;
|
|
14
|
+
};
|
|
15
|
+
min: {
|
|
16
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
autoFix: BooleanConstructor;
|
|
20
|
+
maxlength: (NumberConstructor | StringConstructor)[];
|
|
21
|
+
placeholder: StringConstructor;
|
|
22
|
+
disabled: BooleanConstructor;
|
|
23
|
+
precision: {
|
|
24
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
25
|
+
default: number;
|
|
26
|
+
};
|
|
27
|
+
formatter: import('vue').PropType<(value: string, preValue: string) => string>;
|
|
28
|
+
id: StringConstructor;
|
|
29
|
+
name: StringConstructor;
|
|
30
|
+
readonly: BooleanConstructor;
|
|
31
|
+
inputmode: import('vue').PropType<"search" | "text" | "email" | "tel" | "url" | "decimal" | "none" | "numeric" | undefined>;
|
|
32
|
+
}>, {
|
|
33
|
+
input: HTMLInputElement;
|
|
34
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
35
|
+
input: (value: InputEvent) => any;
|
|
36
|
+
blur: (value: FocusEvent) => any;
|
|
37
|
+
"update:modelValue": (value: string) => any;
|
|
38
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
39
|
+
type: {
|
|
40
|
+
type: import('vue').PropType<import('vue').InputTypeHTMLAttribute | "decimal">;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
modelValue: {
|
|
44
|
+
type: import('vue').PropType<string | number | null | undefined>;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
max: {
|
|
48
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
49
|
+
default: number;
|
|
50
|
+
};
|
|
51
|
+
min: {
|
|
52
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
53
|
+
default: number;
|
|
54
|
+
};
|
|
55
|
+
autoFix: BooleanConstructor;
|
|
56
|
+
maxlength: (NumberConstructor | StringConstructor)[];
|
|
57
|
+
placeholder: StringConstructor;
|
|
58
|
+
disabled: BooleanConstructor;
|
|
59
|
+
precision: {
|
|
60
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
61
|
+
default: number;
|
|
62
|
+
};
|
|
63
|
+
formatter: import('vue').PropType<(value: string, preValue: string) => string>;
|
|
64
|
+
id: StringConstructor;
|
|
65
|
+
name: StringConstructor;
|
|
66
|
+
readonly: BooleanConstructor;
|
|
67
|
+
inputmode: import('vue').PropType<"search" | "text" | "email" | "tel" | "url" | "decimal" | "none" | "numeric" | undefined>;
|
|
68
|
+
}>> & Readonly<{
|
|
69
|
+
onInput?: ((value: InputEvent) => any) | undefined;
|
|
70
|
+
onBlur?: ((value: FocusEvent) => any) | undefined;
|
|
71
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
72
|
+
}>, {
|
|
73
|
+
precision: string | number;
|
|
74
|
+
type: import('vue').InputTypeHTMLAttribute | "decimal";
|
|
75
|
+
disabled: boolean;
|
|
76
|
+
modelValue: string | number | null | undefined;
|
|
77
|
+
max: string | number;
|
|
78
|
+
min: string | number;
|
|
79
|
+
autoFix: boolean;
|
|
80
|
+
readonly: boolean;
|
|
81
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
82
|
+
inputRef: HTMLInputElement;
|
|
83
|
+
}, HTMLInputElement>>;
|
|
84
|
+
export default VroInput;
|
|
85
|
+
export type VroInputInstance = InstanceType<typeof VroInput>;
|
|
86
|
+
declare module 'vue' {
|
|
87
|
+
interface GlobalComponents {
|
|
88
|
+
VroInput: typeof VroInput;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "@daysnap/utils";
|
|
2
|
+
import "vue";
|
|
3
|
+
import { withInstall as o } from "../utils/withInstall.js";
|
|
4
|
+
import r from "./vro-input.vue.js";
|
|
5
|
+
import { vroInputProps as a } from "./types.js";
|
|
6
|
+
const f = o(r);
|
|
7
|
+
export {
|
|
8
|
+
f as VroInput,
|
|
9
|
+
f as default,
|
|
10
|
+
a as vroInputProps
|
|
11
|
+
};
|
|
File without changes
|
|
File without changes
|