rappel-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/_virtual/_plugin-vue_export-helper.js +1 -0
- package/cjs/components/button/index.d.ts +33 -0
- package/cjs/components/button/index.js +1 -0
- package/cjs/components/button/src/button.d.ts +3 -0
- package/cjs/components/button/src/button.vue.js +1 -0
- package/cjs/components/button/src/button.vue2.js +1 -0
- package/cjs/components/button/src/constants.d.ts +4 -0
- package/cjs/components/button/src/constants.js +1 -0
- package/cjs/components/button/src/types.d.ts +16 -0
- package/cjs/components/button/style/css.d.ts +0 -0
- package/cjs/components/button/style/index.d.ts +0 -0
- package/cjs/components/colors/index.d.ts +7 -0
- package/cjs/components/colors/index.js +1 -0
- package/cjs/components/colors/src/colors.vue.js +1 -0
- package/cjs/components/colors/src/colors.vue2.js +1 -0
- package/cjs/components/colors/src/neutral-color.css +1 -0
- package/cjs/components/colors/src/neutral-color.vue.js +1 -0
- package/cjs/components/colors/src/neutral-color.vue2.js +1 -0
- package/cjs/components/colors/src/primary-color.css +1 -0
- package/cjs/components/colors/src/primary-color.vue.js +1 -0
- package/cjs/components/colors/src/primary-color.vue2.js +1 -0
- package/cjs/components/colors/src/secondary-color.css +1 -0
- package/cjs/components/colors/src/secondary-color.vue.js +1 -0
- package/cjs/components/colors/src/secondary-color.vue2.js +1 -0
- package/cjs/components/index.d.ts +4 -0
- package/cjs/components/index.js +1 -0
- package/cjs/components/input/index.d.ts +25 -0
- package/cjs/components/input/index.js +1 -0
- package/cjs/components/input/src/input.vue.js +1 -0
- package/cjs/components/input/src/input.vue2.js +1 -0
- package/cjs/components/tabs/index.d.ts +20 -0
- package/cjs/components/tabs/index.js +1 -0
- package/cjs/components/tabs/src/tabs.vue.js +1 -0
- package/cjs/composables/index.d.ts +6 -0
- package/cjs/composables/use-namespace/index.d.ts +12 -0
- package/cjs/composables/use-namespace/index.js +1 -0
- package/cjs/composables/useDateFormat.d.ts +7 -0
- package/cjs/composables/useDateFormat.js +1 -0
- package/cjs/composables/useDraggable.d.ts +10 -0
- package/cjs/composables/useDraggable.js +1 -0
- package/cjs/composables/useOnceFn.d.ts +24 -0
- package/cjs/composables/useOnceFn.js +1 -0
- package/cjs/composables/useTimeNodes.d.ts +3 -0
- package/cjs/composables/useTimeNodes.js +1 -0
- package/cjs/composables/useWaterFallLayout.d.ts +10 -0
- package/cjs/composables/useWaterFallLayout.js +1 -0
- package/cjs/constants/index.d.ts +1 -0
- package/cjs/constants/svgLoading.d.ts +2 -0
- package/cjs/constants/svgLoading.js +36 -0
- package/cjs/directives/index.d.ts +3 -0
- package/cjs/directives/vDraggable.d.ts +2 -0
- package/cjs/directives/vDraggable.js +1 -0
- package/cjs/directives/vResizable.d.ts +14 -0
- package/cjs/directives/vResizable.js +21 -0
- package/cjs/directives/vSvgLoading.d.ts +4 -0
- package/cjs/directives/vSvgLoading.js +1 -0
- package/cjs/index.d.ts +86 -0
- package/cjs/index.js +1 -0
- package/cjs/package.json.js +1 -0
- package/cjs/purple-ui/index.d.ts +1 -0
- package/cjs/purple-ui/resolver.d.ts +2 -0
- package/cjs/purple-ui/resolver.js +1 -0
- package/cjs/theme-chalk/src/base.css +1 -0
- package/cjs/theme-chalk/src/button.css +1 -0
- package/cjs/utils/index.d.ts +2 -0
- package/cjs/utils/util.d.ts +143 -0
- package/cjs/utils/util.js +3 -0
- package/cjs/utils/vue/index.d.ts +17 -0
- package/cjs/utils/vue/index.js +1 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/components/button/index.d.ts +33 -0
- package/es/components/button/index.mjs +6 -0
- package/es/components/button/src/button.d.ts +3 -0
- package/es/components/button/src/button.vue.mjs +74 -0
- package/es/components/button/src/button.vue2.mjs +4 -0
- package/es/components/button/src/constants.d.ts +4 -0
- package/es/components/button/src/constants.mjs +5 -0
- package/es/components/button/src/types.d.ts +16 -0
- package/es/components/button/style/css.d.ts +0 -0
- package/es/components/button/style/index.d.ts +0 -0
- package/es/components/colors/index.d.ts +7 -0
- package/es/components/colors/index.mjs +16 -0
- package/es/components/colors/src/colors.vue.mjs +21 -0
- package/es/components/colors/src/colors.vue2.mjs +4 -0
- package/es/components/colors/src/neutral-color.css +1 -0
- package/es/components/colors/src/neutral-color.vue.mjs +7 -0
- package/es/components/colors/src/neutral-color.vue2.mjs +195 -0
- package/es/components/colors/src/primary-color.css +1 -0
- package/es/components/colors/src/primary-color.vue.mjs +7 -0
- package/es/components/colors/src/primary-color.vue2.mjs +33 -0
- package/es/components/colors/src/secondary-color.css +1 -0
- package/es/components/colors/src/secondary-color.vue.mjs +7 -0
- package/es/components/colors/src/secondary-color.vue2.mjs +54 -0
- package/es/components/index.d.ts +4 -0
- package/es/components/index.mjs +20 -0
- package/es/components/input/index.d.ts +25 -0
- package/es/components/input/index.mjs +6 -0
- package/es/components/input/src/input.vue.mjs +15 -0
- package/es/components/input/src/input.vue2.mjs +4 -0
- package/es/components/tabs/index.d.ts +20 -0
- package/es/components/tabs/index.mjs +6 -0
- package/es/components/tabs/src/tabs.vue.mjs +17 -0
- package/es/composables/index.d.ts +6 -0
- package/es/composables/use-namespace/index.d.ts +12 -0
- package/es/composables/use-namespace/index.mjs +21 -0
- package/es/composables/useDateFormat.d.ts +7 -0
- package/es/composables/useDateFormat.mjs +20 -0
- package/es/composables/useDraggable.d.ts +10 -0
- package/es/composables/useDraggable.mjs +55 -0
- package/es/composables/useOnceFn.d.ts +24 -0
- package/es/composables/useOnceFn.mjs +32 -0
- package/es/composables/useTimeNodes.d.ts +3 -0
- package/es/composables/useTimeNodes.mjs +24 -0
- package/es/composables/useWaterFallLayout.d.ts +10 -0
- package/es/composables/useWaterFallLayout.mjs +51 -0
- package/es/constants/index.d.ts +1 -0
- package/es/constants/svgLoading.d.ts +2 -0
- package/es/constants/svgLoading.mjs +39 -0
- package/es/directives/index.d.ts +3 -0
- package/es/directives/vDraggable.d.ts +2 -0
- package/es/directives/vDraggable.mjs +13 -0
- package/es/directives/vResizable.d.ts +14 -0
- package/es/directives/vResizable.mjs +136 -0
- package/es/directives/vSvgLoading.d.ts +4 -0
- package/es/directives/vSvgLoading.mjs +48 -0
- package/es/index.d.ts +86 -0
- package/es/index.mjs +76 -0
- package/es/package.json.mjs +4 -0
- package/es/purple-ui/index.d.ts +1 -0
- package/es/purple-ui/resolver.d.ts +2 -0
- package/es/purple-ui/resolver.mjs +18 -0
- package/es/theme-chalk/src/base.css +1 -0
- package/es/theme-chalk/src/button.css +1 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/util.d.ts +143 -0
- package/es/utils/util.mjs +151 -0
- package/es/utils/vue/index.d.ts +17 -0
- package/es/utils/vue/index.mjs +36 -0
- package/global.d.ts +7 -0
- package/package.json +65 -0
- package/theme-chalk/base.css +148 -0
- package/theme-chalk/css-vars/_button.css +35 -0
- package/theme-chalk/css-vars/_colors.css +51 -0
- package/theme-chalk/function/_button.css +35 -0
- package/theme-chalk/function/index.css +35 -0
- package/theme-chalk/index.css +560 -0
- package/theme-chalk/mixins/_button.css +35 -0
- package/theme-chalk/mixins/index.css +35 -0
- package/theme-chalk/pu-button.css +446 -0
- package/theme-chalk/root-vars.css +132 -0
- package/theme-chalk/src/base.scss +30 -0
- package/theme-chalk/src/button.scss +104 -0
- package/theme-chalk/src/common/_function.scss +46 -0
- package/theme-chalk/src/css-vars/_button.scss +47 -0
- package/theme-chalk/src/css-vars/_colors.scss +82 -0
- package/theme-chalk/src/css-vars/_namespace.scss +12 -0
- package/theme-chalk/src/function/_button.scss +2 -0
- package/theme-chalk/src/function/index.scss +155 -0
- package/theme-chalk/src/index.scss +2 -0
- package/theme-chalk/src/mixins/_button.scss +140 -0
- package/theme-chalk/src/mixins/index.scss +25 -0
- package/theme-chalk/src/root-vars.scss +13 -0
- package/umd/index.js +59 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent as m, createElementBlock as r, openBlock as s, Fragment as a, renderList as l, createElementVNode as o, normalizeStyle as n, toDisplayString as d } from "vue";
|
|
2
|
+
import { createColors as i } from "../../../utils/util.mjs";
|
|
3
|
+
const p = { class: "shades" }, y = /* @__PURE__ */ m({
|
|
4
|
+
name: "PuPrimaryColor",
|
|
5
|
+
__name: "primary-color",
|
|
6
|
+
setup(u) {
|
|
7
|
+
const c = [
|
|
8
|
+
{
|
|
9
|
+
base: "#937bff",
|
|
10
|
+
shades: i("#937bff")
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
return (_, f) => (s(), r(a, null, l(c, (e) => o("div", {
|
|
14
|
+
class: "theme-colors",
|
|
15
|
+
key: e.base
|
|
16
|
+
}, [
|
|
17
|
+
o("div", {
|
|
18
|
+
class: "base",
|
|
19
|
+
style: n({ "background-color": e.base })
|
|
20
|
+
}, d(e.base.toUpperCase()), 5),
|
|
21
|
+
o("div", p, [
|
|
22
|
+
(s(!0), r(a, null, l(e.shades, (t) => (s(), r("div", {
|
|
23
|
+
class: "shade",
|
|
24
|
+
style: n({ "background-color": t }),
|
|
25
|
+
key: t
|
|
26
|
+
}, null, 4))), 128))
|
|
27
|
+
])
|
|
28
|
+
])), 64));
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
y as default
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.status-colors[data-v-3e9bfdfb]{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem}.status-colors .panel[data-v-3e9bfdfb]{border-radius:4px;overflow:hidden;color:#fff}.status-colors .panel .base[data-v-3e9bfdfb]{color:#fff;height:6rem;box-shadow:5px 5px;padding:1rem}.status-colors .panel .shades[data-v-3e9bfdfb]{display:flex;align-items:center;flex-wrap:nowrap}.status-colors .panel .shades .shade[data-v-3e9bfdfb]{overflow:hidden;flex:1;height:3rem;padding:.2rem}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineComponent as u, createElementBlock as a, openBlock as t, Fragment as n, renderList as l, createElementVNode as s, normalizeStyle as d, toDisplayString as c } from "vue";
|
|
2
|
+
import { createColors as o } from "../../../utils/util.mjs";
|
|
3
|
+
const m = { class: "status-colors" }, p = { class: "shades" }, x = /* @__PURE__ */ u({
|
|
4
|
+
name: "PuSecondaryColor",
|
|
5
|
+
__name: "secondary-color",
|
|
6
|
+
setup(_) {
|
|
7
|
+
const i = [
|
|
8
|
+
{
|
|
9
|
+
base: "#06b56d",
|
|
10
|
+
text: "Success",
|
|
11
|
+
shades: o("#06b56d")
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
base: "#ee6979",
|
|
15
|
+
text: "Danger/Error ",
|
|
16
|
+
shades: o("#ee6979")
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
base: "#cd9a0a",
|
|
20
|
+
text: "Warning",
|
|
21
|
+
shades: o("#cd9a0a")
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
base: "#8e8e91",
|
|
25
|
+
text: "Info",
|
|
26
|
+
shades: o("#8e8e91")
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
return (b, h) => (t(), a("div", m, [
|
|
30
|
+
(t(), a(n, null, l(i, (e) => s("div", {
|
|
31
|
+
class: "panel",
|
|
32
|
+
key: e.base
|
|
33
|
+
}, [
|
|
34
|
+
s("div", {
|
|
35
|
+
class: "base",
|
|
36
|
+
style: d({ "background-color": e.base })
|
|
37
|
+
}, [
|
|
38
|
+
s("div", null, c(e.text), 1),
|
|
39
|
+
s("div", null, c(e.base.toUpperCase()), 1)
|
|
40
|
+
], 4),
|
|
41
|
+
s("div", p, [
|
|
42
|
+
(t(!0), a(n, null, l(e.shades, (r) => (t(), a("div", {
|
|
43
|
+
class: "shade",
|
|
44
|
+
style: d({ "background-color": r }),
|
|
45
|
+
key: r
|
|
46
|
+
}, null, 4))), 128))
|
|
47
|
+
])
|
|
48
|
+
])), 64))
|
|
49
|
+
]));
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
export {
|
|
53
|
+
x as default
|
|
54
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "./button/index.mjs";
|
|
2
|
+
import "./input/index.mjs";
|
|
3
|
+
import "./tabs/index.mjs";
|
|
4
|
+
import "./colors/index.mjs";
|
|
5
|
+
import { default as f } from "./button/src/button.vue.mjs";
|
|
6
|
+
import { default as m } from "./input/src/input.vue.mjs";
|
|
7
|
+
import { default as s } from "./colors/src/colors.vue.mjs";
|
|
8
|
+
import { default as P } from "./tabs/src/tabs.vue.mjs";
|
|
9
|
+
import { default as i } from "./colors/src/primary-color.vue.mjs";
|
|
10
|
+
import { default as n } from "./colors/src/secondary-color.vue.mjs";
|
|
11
|
+
import { default as b } from "./colors/src/neutral-color.vue.mjs";
|
|
12
|
+
export {
|
|
13
|
+
f as PuButton,
|
|
14
|
+
s as PuColors,
|
|
15
|
+
m as PuInput,
|
|
16
|
+
b as PuNeutralColor,
|
|
17
|
+
i as PuPrimaryColor,
|
|
18
|
+
n as PuSecondaryColor,
|
|
19
|
+
P as PuTabs
|
|
20
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as Input } from './src/input.vue';
|
|
2
|
+
export { Input as PuInput };
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
type: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
size: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
13
|
+
type: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
size: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
}>> & Readonly<{}>, {
|
|
22
|
+
size: string;
|
|
23
|
+
type: string;
|
|
24
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLInputElement>;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineComponent as t, createElementBlock as n, openBlock as p, mergeProps as r } from "vue";
|
|
2
|
+
const s = /* @__PURE__ */ t({
|
|
3
|
+
name: "PuInput",
|
|
4
|
+
__name: "input",
|
|
5
|
+
props: {
|
|
6
|
+
type: { type: String, default: "text" },
|
|
7
|
+
size: { type: String, default: "default" }
|
|
8
|
+
},
|
|
9
|
+
setup(u) {
|
|
10
|
+
return (e, a) => (p(), n("input", r({ class: "pinput" }, e.$attrs), null, 16));
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
s as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as tabs } from './src/tabs.vue';
|
|
2
|
+
export { tabs as PuTabs };
|
|
3
|
+
declare const _default: {
|
|
4
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
5
|
+
P: {};
|
|
6
|
+
B: {};
|
|
7
|
+
D: {};
|
|
8
|
+
C: {};
|
|
9
|
+
M: {};
|
|
10
|
+
Defaults: {};
|
|
11
|
+
}, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
12
|
+
__isFragment?: never;
|
|
13
|
+
__isTeleport?: never;
|
|
14
|
+
__isSuspense?: never;
|
|
15
|
+
} & import('vue').ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
16
|
+
$slots: {
|
|
17
|
+
'prev-button'?(_: {}): any;
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { resolveComponent as o, createElementBlock as n, openBlock as s, createElementVNode as r, renderSlot as c, createVNode as _ } from "vue";
|
|
2
|
+
import a from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
3
|
+
const p = {}, d = { class: "p-tabs" }, l = { class: "p-tabs__header" };
|
|
4
|
+
function m(e, i) {
|
|
5
|
+
const t = o("pu-button");
|
|
6
|
+
return s(), n("div", d, [
|
|
7
|
+
r("div", l, [
|
|
8
|
+
c(e.$slots, "prev-button", {}, () => [
|
|
9
|
+
_(t)
|
|
10
|
+
])
|
|
11
|
+
])
|
|
12
|
+
]);
|
|
13
|
+
}
|
|
14
|
+
const b = /* @__PURE__ */ a(p, [["render", m]]);
|
|
15
|
+
export {
|
|
16
|
+
b as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function useNamespace(compName: string): {
|
|
2
|
+
prefix: string;
|
|
3
|
+
statePrefix: string;
|
|
4
|
+
n: (name: string) => string;
|
|
5
|
+
ng: (name: string, groupName: string) => string;
|
|
6
|
+
nm: (name: string, modifier: string) => string;
|
|
7
|
+
ngm: (name: string, groupName: string, modifier: string) => string;
|
|
8
|
+
ns: (name: string, subName: string) => string;
|
|
9
|
+
ngs: (name: string, groupName: string, subName: string) => string;
|
|
10
|
+
cls: (name: string, groupName?: string, modifier?: string, subName?: string) => string;
|
|
11
|
+
is: (state: string, bool?: boolean | undefined | "") => string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function P(o) {
|
|
2
|
+
const t = (n, s, e, i) => {
|
|
3
|
+
let c = `pu-${n || o}`;
|
|
4
|
+
return s && (c += `-${s}`), e && (c += `--${e}`), i && (c += `__${i}`), c.toLowerCase();
|
|
5
|
+
};
|
|
6
|
+
return {
|
|
7
|
+
prefix: "pu",
|
|
8
|
+
statePrefix: "is",
|
|
9
|
+
n: (n) => t(n),
|
|
10
|
+
ng: (n, s) => t(n, s),
|
|
11
|
+
nm: (n, s) => t(n, "", s),
|
|
12
|
+
ngm: (n, s, e) => t(n, s, e),
|
|
13
|
+
ns: (n, s) => t(n, "", "", s),
|
|
14
|
+
ngs: (n, s, e) => t(n, s, "", e),
|
|
15
|
+
cls: t,
|
|
16
|
+
is: (n, s = !0) => s ? `is-${n}` : ""
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
P as useNamespace
|
|
21
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function Y(t, o) {
|
|
2
|
+
const n = t.getFullYear(), r = t.getMonth() + 1, s = t.getDate(), g = t.getHours(), S = t.getMinutes(), i = t.getSeconds(), e = {
|
|
3
|
+
YYYY: String(n),
|
|
4
|
+
YY: String(n).substring(2),
|
|
5
|
+
MM: String(r).padStart(2, "0"),
|
|
6
|
+
M: String(r),
|
|
7
|
+
DD: String(s).padStart(2, "0"),
|
|
8
|
+
D: String(s),
|
|
9
|
+
HH: String(g).padStart(2, "0"),
|
|
10
|
+
H: String(g),
|
|
11
|
+
mm: String(S).padStart(2, "0"),
|
|
12
|
+
m: String(S),
|
|
13
|
+
ss: String(i).padStart(2, "0"),
|
|
14
|
+
s: String(i)
|
|
15
|
+
};
|
|
16
|
+
return o.replace(/(YYYY|YY|MM|M|DD|D|HH|H|mm|m|ss|s)/g, (a) => e[a]);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
Y as useDateFormat
|
|
20
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function useDraggable(el: HTMLElement, options?: {
|
|
2
|
+
preventDefault?: boolean;
|
|
3
|
+
customHandler?: HTMLElement | null;
|
|
4
|
+
autoTopHandler?: boolean;
|
|
5
|
+
topHandlerHeight?: number;
|
|
6
|
+
isAllHandler?: boolean;
|
|
7
|
+
}): {
|
|
8
|
+
updatePos: () => void;
|
|
9
|
+
cleanup: () => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
function z(r, w) {
|
|
2
|
+
if (!r)
|
|
3
|
+
return { updatePos: () => {
|
|
4
|
+
}, cleanup: () => {
|
|
5
|
+
} };
|
|
6
|
+
const o = Object.assign({}, {
|
|
7
|
+
preventDefault: !0,
|
|
8
|
+
customHandler: null,
|
|
9
|
+
autoTopHandler: !1,
|
|
10
|
+
topHandlerHeight: 20,
|
|
11
|
+
isAllHandler: !0
|
|
12
|
+
}, w || {}), h = () => {
|
|
13
|
+
const e = document.createElement("div");
|
|
14
|
+
return e.style.cssText = `user-select:none;height: ${o.topHandlerHeight}px; z-index:3000;cursor: move; position: absolute; top: 0; left: 0;right:0;background-color: transparent;opacity: 1;`, e.classList.add("v-draggable-top-handler"), r.appendChild(e), e;
|
|
15
|
+
}, s = o.customHandler ? o.customHandler : o.autoTopHandler ? h() : r;
|
|
16
|
+
let d = !1, m = 0, v = 0, l = 0, c = 0, f = 0, g = 0, E = 0, L = 0;
|
|
17
|
+
const H = (e) => window.getComputedStyle(e).transform, T = (e) => {
|
|
18
|
+
const t = H(e);
|
|
19
|
+
if (t && t !== "none") {
|
|
20
|
+
const { e: n, f: D, m41: M, m42: A } = new DOMMatrix(t);
|
|
21
|
+
return {
|
|
22
|
+
x: n || M || 0,
|
|
23
|
+
y: D || A || 0
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return { x: 0, y: 0 };
|
|
27
|
+
}, i = () => {
|
|
28
|
+
const e = r.getBoundingClientRect(), { x: t, y: n } = T(r);
|
|
29
|
+
l = t, c = n, f = -e.left + t, g = -e.top + n, E = window.innerWidth - e.right + t, L = window.innerHeight - e.bottom + n;
|
|
30
|
+
}, x = (e) => {
|
|
31
|
+
const t = e.target;
|
|
32
|
+
return !t || t.isContentEditable || t.closest(
|
|
33
|
+
'input, textarea, button, select, a,[contenteditable], [contenteditable="true"]'
|
|
34
|
+
) || ["TEXTAREA", "INPUT", "BUTTON", "A", "SELECT"].includes(t?.tagName) ? !1 : !!o.isAllHandler || t === s;
|
|
35
|
+
}, u = (e) => {
|
|
36
|
+
x(e) && (d = !0, o.preventDefault && e.preventDefault(), i(), m = e.clientX - l, v = e.clientY - c, document.removeEventListener("pointermove", p), document.removeEventListener("pointerup", a), document.removeEventListener("pointercancel", a), document.addEventListener("pointermove", p), document.addEventListener("pointerup", a), document.addEventListener("pointercancel", a));
|
|
37
|
+
}, p = (e) => {
|
|
38
|
+
if (!d) return;
|
|
39
|
+
let t = e.clientX - m, n = e.clientY - v;
|
|
40
|
+
t < l ? t = Math.max(t, f) : t = Math.min(t, E), n < c ? n = Math.max(n, g) : n = Math.min(n, L), r.style.transform = `translate(${t}px, ${n}px)`, l = t, c = n;
|
|
41
|
+
}, a = () => {
|
|
42
|
+
d = !1, document.removeEventListener("pointermove", p), document.removeEventListener("pointerup", a), document.removeEventListener("pointercancel", a);
|
|
43
|
+
}, b = () => {
|
|
44
|
+
if (a(), s.removeEventListener("pointerdown", u), window.removeEventListener("resize", i), o.autoTopHandler && !o.customHandler) {
|
|
45
|
+
const e = r.querySelector(".v-draggable-top-handler");
|
|
46
|
+
e && e.remove();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
i(), s.removeEventListener("pointerdown", u), s.addEventListener("pointerdown", u), window.removeEventListener("resize", i), window.addEventListener("resize", i);
|
|
50
|
+
const y = r._cleanup = b;
|
|
51
|
+
return { updatePos: i, cleanup: y };
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
z as useDraggable
|
|
55
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 防止接口重复请求的方法<需保证方法名全局唯一>
|
|
3
|
+
* @param {Function} funcName 方法名
|
|
4
|
+
* @param {...Array<any>} funcParams 方法参数(剩余参数),原方法怎么传,这里就怎么传
|
|
5
|
+
* @description 适用于返回Promise的所有方法,支持多个方法
|
|
6
|
+
* @example
|
|
7
|
+
* 1、基本用法:
|
|
8
|
+
* import {getUserList} from "@/api/user"
|
|
9
|
+
* const res = await useOnceFn(getUserList, params, data)
|
|
10
|
+
*
|
|
11
|
+
* 2、多个方法
|
|
12
|
+
* import {getUserList} from "@/api/user"
|
|
13
|
+
* import {getOrgTree} from "@/api/org"
|
|
14
|
+
*
|
|
15
|
+
* const res1 = await useOnceFn(getUserList, params, data)
|
|
16
|
+
* const res2 = await useOnceFn(getOrgTree)
|
|
17
|
+
*
|
|
18
|
+
* 3、用于async方法
|
|
19
|
+
* async function demo(){...}
|
|
20
|
+
* const res = await useOnceFn(demo)
|
|
21
|
+
*
|
|
22
|
+
* @returns {Promise<any>}
|
|
23
|
+
*/
|
|
24
|
+
export declare function useOnceFn(funcName: Function, ...funcParams: any[]): Promise<any>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
class n {
|
|
2
|
+
res;
|
|
3
|
+
isFetching;
|
|
4
|
+
isSuccess;
|
|
5
|
+
queues;
|
|
6
|
+
constructor() {
|
|
7
|
+
this.res = null, this.isFetching = !1, this.isSuccess = !1, this.queues = [];
|
|
8
|
+
}
|
|
9
|
+
useOnceFn(e, ...s) {
|
|
10
|
+
return new Promise((c) => {
|
|
11
|
+
if (this.isSuccess) {
|
|
12
|
+
c(this.res);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
this.queues.push(c), this.isFetching || (this.isFetching = !0, Promise.resolve(e(...s)).then((u) => {
|
|
16
|
+
this.res = u, this.loopQueues(), this.isSuccess = !0;
|
|
17
|
+
}));
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
loopQueues() {
|
|
21
|
+
for (; this.queues.length > 0; )
|
|
22
|
+
this.queues.shift()?.(this.res);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const i = {};
|
|
26
|
+
function h(t, ...e) {
|
|
27
|
+
const s = t.toString().replace(/[^a-zA-Z]/g, "");
|
|
28
|
+
return i[s] || (i[s] = new n()), i[s].useOnceFn(t, ...e);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
h as useOnceFn
|
|
32
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useDateFormat as N } from "./useDateFormat.mjs";
|
|
2
|
+
import "vue";
|
|
3
|
+
function F(d = "00:00", a = "23:00", m = "02:00", h = "HH:mm") {
|
|
4
|
+
const s = (e) => {
|
|
5
|
+
const [t, n, o] = e.split(":").map(Number);
|
|
6
|
+
return [t || 0, n || 0, o || 0];
|
|
7
|
+
}, i = (e) => {
|
|
8
|
+
const [t, n, o] = s(e), u = /* @__PURE__ */ new Date();
|
|
9
|
+
return new Date(u.getFullYear(), u.getMonth() + 1, u.getDate(), t, n, o);
|
|
10
|
+
}, w = (e) => N(e, h), T = (e) => {
|
|
11
|
+
const [t, n, o] = s(m);
|
|
12
|
+
return new Date(e.getTime() + t * 36e5 + n * 6e4 + o * 1e3);
|
|
13
|
+
}, c = [], [g, p, l] = s(m);
|
|
14
|
+
if (g === 0 && p === 0 && l === 0)
|
|
15
|
+
throw new Error("时间步长不能为0");
|
|
16
|
+
let r = i(d);
|
|
17
|
+
const D = i(a);
|
|
18
|
+
for (; r <= D; )
|
|
19
|
+
c.push(w(r)), r = T(r);
|
|
20
|
+
return { timeNodes: c };
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
F as useTimeNodes
|
|
24
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export declare function useWaterFallLayout(containerRef: Ref<HTMLElement | null>, itemSelector: string): {
|
|
3
|
+
init: (isRearrange?: boolean) => void;
|
|
4
|
+
column: Ref<number, number>;
|
|
5
|
+
rowSpacing: Ref<number, number>;
|
|
6
|
+
columnSpacing: Ref<number, number>;
|
|
7
|
+
oddColumnBgColor: Ref<string, string>;
|
|
8
|
+
evenColumnBgColor: Ref<string, string>;
|
|
9
|
+
getItems: (selector?: string) => any;
|
|
10
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ref as o, watch as b, nextTick as F } from "vue";
|
|
2
|
+
function A(a, C) {
|
|
3
|
+
const n = o(3), d = o(2), u = o(2), i = o("#F5F8F8"), r = o("#FFFFFF"), x = o("top 300ms ease-in-out, left 300ms ease-in-out"), p = o(0), c = o(0), v = o(0), m = (t) => document.querySelectorAll(t || C), I = () => {
|
|
4
|
+
a.value.style.position = "relative";
|
|
5
|
+
}, W = () => {
|
|
6
|
+
I(), p.value = a.value.clientWidth;
|
|
7
|
+
}, w = () => {
|
|
8
|
+
v.value = (p.value - u.value * (n.value - 1)) / n.value;
|
|
9
|
+
}, T = (t) => {
|
|
10
|
+
const e = t % n.value;
|
|
11
|
+
return e === 0 ? 0 : e * (v.value + u.value);
|
|
12
|
+
}, f = (t) => {
|
|
13
|
+
const { style: e, offsetHeight: s } = t;
|
|
14
|
+
return parseFloat(e.top) + s + d.value;
|
|
15
|
+
}, B = (t, e) => t >= n.value ? f(e[t - n.value]) : 0, H = (t) => {
|
|
16
|
+
const e = f(t);
|
|
17
|
+
e > c.value && (c.value = e, a.value.style.height = e + "px");
|
|
18
|
+
}, h = o("is-dealed"), L = (t = !1) => {
|
|
19
|
+
const e = m(), s = m("." + h.value);
|
|
20
|
+
let g = 0;
|
|
21
|
+
s.length > 0 && (g = s.length), t && (g = 0, c.value = 0);
|
|
22
|
+
for (let l = g; l < e.length; l++)
|
|
23
|
+
e[l].style.position = "absolute", e[l].style.transition = x.value, e[l].style.width = v.value + "px", e[l].style.backgroundColor = S(l), e[l].style.left = T(l) + "px", e[l].style.top = B(l, e) + "px", e[l].classList.add(h.value), H(e[l]);
|
|
24
|
+
}, S = (t) => {
|
|
25
|
+
const e = t + 1;
|
|
26
|
+
return n.value % 2 === 0 ? e % 2 === 0 ? r.value : i.value : e % n.value !== 0 && e % n.value % 2 === 0 ? r.value : i.value;
|
|
27
|
+
}, y = (t = !1) => {
|
|
28
|
+
W(), w(), F(() => {
|
|
29
|
+
L(t);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
return b(
|
|
33
|
+
() => n.value,
|
|
34
|
+
() => {
|
|
35
|
+
F(() => {
|
|
36
|
+
y(!0);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
), {
|
|
40
|
+
init: y,
|
|
41
|
+
column: n,
|
|
42
|
+
rowSpacing: d,
|
|
43
|
+
columnSpacing: u,
|
|
44
|
+
oddColumnBgColor: i,
|
|
45
|
+
evenColumnBgColor: r,
|
|
46
|
+
getItems: m
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
A as useWaterFallLayout
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './svgLoading';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const svgLoadingContent = "<svg viewBox=\"0 0 800 800\" xmlns=\"http://www.w3.org/2000/svg\">\n<style>\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes spin2 {\n 0% {\n stroke-dasharray: 1, 800;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 200, 200;\n stroke-dashoffset: 100px;\n }\n 100% {\n stroke-dasharray: 800, 1;\n stroke-dashoffset: -800px;\n }\n}\n\n.spin2 {\n transform-origin: center;\n animation: spin2 1.5s ease-in-out infinite,\n spin 2s linear infinite;\n animation-direction: alternate;\n}\n</style>\n <circle class=\"spin2\" cx=\"400\" cy=\"400\" fill=\"none\"\n r=\"200\" stroke-width=\"40\" stroke=\"#E387FF\"\n stroke-dasharray=\"800 1400\"\n stroke-linecap=\"round\"\n />\n</svg>";
|
|
2
|
+
export { svgLoadingContent };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const s = `<svg viewBox="0 0 800 800" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<style>
|
|
3
|
+
@keyframes spin {
|
|
4
|
+
to {
|
|
5
|
+
transform: rotate(360deg);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@keyframes spin2 {
|
|
10
|
+
0% {
|
|
11
|
+
stroke-dasharray: 1, 800;
|
|
12
|
+
stroke-dashoffset: 0;
|
|
13
|
+
}
|
|
14
|
+
50% {
|
|
15
|
+
stroke-dasharray: 200, 200;
|
|
16
|
+
stroke-dashoffset: 100px;
|
|
17
|
+
}
|
|
18
|
+
100% {
|
|
19
|
+
stroke-dasharray: 800, 1;
|
|
20
|
+
stroke-dashoffset: -800px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.spin2 {
|
|
25
|
+
transform-origin: center;
|
|
26
|
+
animation: spin2 1.5s ease-in-out infinite,
|
|
27
|
+
spin 2s linear infinite;
|
|
28
|
+
animation-direction: alternate;
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
31
|
+
<circle class="spin2" cx="400" cy="400" fill="none"
|
|
32
|
+
r="200" stroke-width="40" stroke="#E387FF"
|
|
33
|
+
stroke-dasharray="800 1400"
|
|
34
|
+
stroke-linecap="round"
|
|
35
|
+
/>
|
|
36
|
+
</svg>`;
|
|
37
|
+
export {
|
|
38
|
+
s as svgLoadingContent
|
|
39
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DirectiveBinding } from 'vue';
|
|
2
|
+
interface ResizeOptions {
|
|
3
|
+
minWidth?: number;
|
|
4
|
+
minHeight?: number;
|
|
5
|
+
maxWidth?: number;
|
|
6
|
+
maxHeight?: number;
|
|
7
|
+
}
|
|
8
|
+
/** main directive */
|
|
9
|
+
declare const vResizable: {
|
|
10
|
+
mounted(el: HTMLElement, binding: DirectiveBinding): void;
|
|
11
|
+
beforeUnmount(el: HTMLElement): void;
|
|
12
|
+
};
|
|
13
|
+
declare function applyResizable(el: HTMLElement, options?: ResizeOptions): () => void;
|
|
14
|
+
export { vResizable, applyResizable };
|