@toolmain/components 1.0.0 → 1.1.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/dist/index.d.ts +14 -2
- package/dist/index.js +10 -11
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ComponentOptionsMixin } from 'vue';
|
|
2
2
|
import { ComponentProvideOptions } from 'vue';
|
|
3
|
-
import
|
|
3
|
+
import type * as CSS_2 from 'csstype';
|
|
4
4
|
import { DefineComponent } from 'vue';
|
|
5
|
-
import { FixedArray } from '@toolmain/shared';
|
|
6
5
|
import type { MaybeRef } from 'vue';
|
|
7
6
|
import { PublicProps } from 'vue';
|
|
8
7
|
|
|
@@ -68,6 +67,12 @@ declare type AnimateDir = "left" | "top" | "bottom" | "right" | "self" | "center
|
|
|
68
67
|
y?: number;
|
|
69
68
|
};
|
|
70
69
|
|
|
70
|
+
declare type ArrMutKeys = "splice" | "push" | "pop" | "shift" | "unshift";
|
|
71
|
+
|
|
72
|
+
declare interface CSSProperties extends CSS_2.Properties<string | number>, CSS_2.PropertiesHyphen<string | number> {
|
|
73
|
+
[v: `--${string}`]: string | number | undefined;
|
|
74
|
+
}
|
|
75
|
+
|
|
71
76
|
declare type Dir = "horizontal" | "vertical" | "any";
|
|
72
77
|
|
|
73
78
|
declare interface DragAttr {
|
|
@@ -91,6 +96,13 @@ declare interface DragAttr {
|
|
|
91
96
|
height: number | InitType;
|
|
92
97
|
}
|
|
93
98
|
|
|
99
|
+
/**
|
|
100
|
+
* 定长数组类型
|
|
101
|
+
*/
|
|
102
|
+
declare type FixedArray<T, L extends number> = Pick<T[], Exclude<keyof T[], ArrMutKeys>> & {
|
|
103
|
+
readonly length: L;
|
|
104
|
+
};
|
|
105
|
+
|
|
94
106
|
declare type InitType = "auto" | "inherit" | "initial" | "unset";
|
|
95
107
|
|
|
96
108
|
declare interface MoveHook {
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}[top~="0"]{top:0}.hidden{display:none}.flex{display:flex}.flex-shrink{flex-shrink:1}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.resize,[resize=""]{resize:both}.px,[px=""]{padding-left:1rem;padding-right:1rem}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.comp-affix .comp-affix-inner[data-v-4c40ccd8]{transition:box-shadow .3s;border-radius:1rem}.comp-affix .comp-affix-inner.fix[data-v-4c40ccd8]{position:fixed;box-shadow:var(--el-box-shadow);background-color:var(--el-card-bg-color)}.p-t[data-v-cb7f9cc6],.p-r[data-v-cb7f9cc6],.p-b[data-v-cb7f9cc6],.p-l[data-v-cb7f9cc6],.p-lt[data-v-cb7f9cc6],.p-rt[data-v-cb7f9cc6],.p-lb[data-v-cb7f9cc6],.p-rb[data-v-cb7f9cc6]{z-index:var(--61c40759);position:absolute}.p-b[data-v-cb7f9cc6],.p-t[data-v-cb7f9cc6],.p-r[data-v-cb7f9cc6],.p-l[data-v-cb7f9cc6]{background-color:transparent;border-radius:4px}.p-b[data-v-cb7f9cc6],.p-t[data-v-cb7f9cc6]{height:4px;left:4px;right:4px}.p-r[data-v-cb7f9cc6],.p-l[data-v-cb7f9cc6]{width:4px;top:4px;bottom:4px}.p-lt[data-v-cb7f9cc6],.p-rt[data-v-cb7f9cc6],.p-lb[data-v-cb7f9cc6],.p-rb[data-v-cb7f9cc6]{width:0;height:0}.p-b[data-v-cb7f9cc6]{bottom:0;cursor:ns-resize}.p-t[data-v-cb7f9cc6]{top:0;cursor:ns-resize}.p-r[data-v-cb7f9cc6]{right:0;cursor:ew-resize}.p-l[data-v-cb7f9cc6]{left:0;cursor:ew-resize}.p-lt[data-v-cb7f9cc6]{left:0;top:0;cursor:nwse-resize;border-top:.4rem solid transparent;border-left:.4rem solid transparent;border-right:.4rem solid transparent;border-bottom:.4rem solid transparent}.p-rt[data-v-cb7f9cc6]{right:0;top:0;cursor:nesw-resize;border-top:.4rem solid transparent;border-left:.4rem solid transparent;border-right:.4rem solid transparent;border-bottom:.4rem solid transparent}.p-lb[data-v-cb7f9cc6]{left:0;bottom:0;cursor:nesw-resize;border-top:.4rem solid transparent;border-left:.4rem solid transparent;border-right:.4rem solid transparent;border-bottom:.4rem solid transparent}.p-rb[data-v-cb7f9cc6]{right:0;bottom:0;cursor:nwse-resize;border-top:.4rem solid transparent;border-left:.4rem solid transparent;border-right:.4rem solid transparent;border-bottom:.4rem solid transparent}.dragContainer[data-v-d123b73c]{display:flex;flex-direction:column;transform-origin:0 0}.dragContainer>.dragHeader[data-v-d123b73c]{flex-shrink:0;display:flex}.dragContainer>.scaleContent[data-v-d123b73c]{flex:1;overflow:hidden;position:relative;display:flex}.dragMask[data-v-d123b73c]{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:100}')),document.head.appendChild(r)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
2
|
import { defineComponent as be, useTemplateRef as te, shallowRef as ee, computed as $, reactive as Ae, onMounted as De, onBeforeUnmount as Me, createElementBlock as Q, openBlock as j, normalizeStyle as J, normalizeClass as pe, createElementVNode as Oe, renderSlot as we, useCssVars as ze, createCommentVNode as re, Fragment as Be, renderList as $e, withDirectives as Ve, vShow as We, unref as Pe, ref as Te, toValue as ye, watch as q, toRef as oe, createBlock as Ce, Teleport as Ue } from "vue";
|
|
3
|
-
import { px as X, z as je, getStyleValue as Se, isBoolean as ke, isNumber as G, toNumber as w,
|
|
4
|
-
import { useElementBounding as le, useIntersectionObserver as _e, useThrottleFn as
|
|
5
|
-
import { useEvent as ue, useFlip as Je } from "@toolmain/libs";
|
|
3
|
+
import { px as X, useEvent as ue, z as je, getStyleValue as Se, isBoolean as ke, isNumber as G, toNumber as w, useFlip as Ge, merge as Ke } from "@toolmain/shared";
|
|
4
|
+
import { useElementBounding as le, useIntersectionObserver as _e, useThrottleFn as qe, useDebounceFn as Je } from "@vueuse/core";
|
|
6
5
|
const ae = 2, Qe = /* @__PURE__ */ be({
|
|
7
6
|
__name: "index",
|
|
8
7
|
props: {
|
|
@@ -95,7 +94,7 @@ const ae = 2, Qe = /* @__PURE__ */ be({
|
|
|
95
94
|
function I() {
|
|
96
95
|
h.value = s.value?.firstElementChild, e.target && (d.value = document.querySelector(e.target)), A();
|
|
97
96
|
}
|
|
98
|
-
const D =
|
|
97
|
+
const D = qe(g, 250, !0);
|
|
99
98
|
return De(() => {
|
|
100
99
|
I(), window.addEventListener("resize", D);
|
|
101
100
|
}), Me(() => {
|
|
@@ -124,7 +123,7 @@ const ae = 2, Qe = /* @__PURE__ */ be({
|
|
|
124
123
|
for (const [s, h] of l)
|
|
125
124
|
c[s] = h;
|
|
126
125
|
return c;
|
|
127
|
-
},
|
|
126
|
+
}, ft = /* @__PURE__ */ Ee(Qe, [["__scopeId", "data-v-4c40ccd8"]]);
|
|
128
127
|
function Re() {
|
|
129
128
|
return {
|
|
130
129
|
x: 0,
|
|
@@ -379,7 +378,7 @@ function Ye(e) {
|
|
|
379
378
|
};
|
|
380
379
|
}
|
|
381
380
|
function it(e, l, c, s, h, d, i) {
|
|
382
|
-
const { setNormal: R, setTranslate: T, setPrevTranslate: y } = Xe(s), { get: S, set: a } = Ye(h), x = Te(ye(S("position"))), n =
|
|
381
|
+
const { setNormal: R, setTranslate: T, setPrevTranslate: y } = Xe(s), { get: S, set: a } = Ye(h), x = Te(ye(S("position"))), n = Je(
|
|
383
382
|
async () => {
|
|
384
383
|
e.value.autoStick && (typeof e.value.autoStick == "boolean" ? await c.value?.autoStick(!0) : await c.value?.stickTo(e.value.autoStick, !0));
|
|
385
384
|
},
|
|
@@ -432,7 +431,7 @@ var He = /* @__PURE__ */ ((e) => (e.NORMAL = "NORMAL", e.HIDDEN = "HIDDEN", e))(
|
|
|
432
431
|
const rt = (e) => {
|
|
433
432
|
const { getTranslate: l, setTranslate: c, setScale: s, setPrevTranslate: h, getScale: d } = Xe(e.dragOffset);
|
|
434
433
|
let i = e.parent;
|
|
435
|
-
const R =
|
|
434
|
+
const R = Ge(), T = ue(), y = Te(
|
|
436
435
|
"NORMAL"
|
|
437
436
|
/* NORMAL */
|
|
438
437
|
), S = {
|
|
@@ -467,7 +466,7 @@ const rt = (e) => {
|
|
|
467
466
|
function o(t, f) {
|
|
468
467
|
const r = { x: 0, y: 0, w: 0, h: 0 };
|
|
469
468
|
if (!e.targetEle.value) return r;
|
|
470
|
-
const v =
|
|
469
|
+
const v = Ke(
|
|
471
470
|
{
|
|
472
471
|
x: (W, U, Fe, Ne) => U,
|
|
473
472
|
y: (W, U, Fe, Ne) => U,
|
|
@@ -873,8 +872,8 @@ const ot = (e) => {
|
|
|
873
872
|
], 8, ["disabled"]))
|
|
874
873
|
], 4));
|
|
875
874
|
}
|
|
876
|
-
}),
|
|
875
|
+
}), vt = /* @__PURE__ */ Ee(st, [["__scopeId", "data-v-d123b73c"]]);
|
|
877
876
|
export {
|
|
878
|
-
|
|
879
|
-
|
|
877
|
+
ft as Affix,
|
|
878
|
+
vt as ScalePanel
|
|
880
879
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolmain/components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"vue": "^3.5.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@toolmain/shared": "^1.
|
|
34
|
-
"@toolmain/libs": "^1.
|
|
33
|
+
"@toolmain/shared": "^1.1.0",
|
|
34
|
+
"@toolmain/libs": "^1.1.0"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "vue-tsc -p tsconfig.json --declaration --emitDeclarationOnly && vite build && api-extractor run"
|