dynamicformdjx 0.5.0 → 0.6.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/README.md +173 -2
- package/dist/elementPlus/EleZealCard.d.ts +9 -0
- package/dist/elementPlus/EleZealTableTool.d.ts +90 -8
- package/dist/elementPlus/hooks/useZealTool.d.ts +7 -0
- package/dist/elementPlus/index.cjs +1 -1
- package/dist/elementPlus/index.d.ts +6 -4
- package/dist/elementPlus/index.mjs +473 -371
- package/dist/hooks/useTool.d.ts +1 -1
- package/dist/index-BAqRAwDC.cjs +1 -0
- package/dist/index-BQKYL550.js +213 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +493 -216
- package/dist/naiveUi/NaiZealCard.d.ts +9 -0
- package/dist/naiveUi/NaiZealTableTool.d.ts +54 -1
- package/dist/naiveUi/hooks/useZealTool.d.ts +7 -0
- package/dist/naiveUi/index.cjs +1 -1
- package/dist/naiveUi/index.d.ts +6 -4
- package/dist/naiveUi/index.mjs +432 -337
- package/dist/origin/LoadedScroll.d.ts +180 -0
- package/dist/types/index.d.ts +21 -1
- package/dist/types/slots.d.ts +8 -5
- package/dist/utils/tools.d.ts +5 -2
- package/dist/vite-env.d.ts +6 -0
- package/package.json +2 -1
- package/dist/index-BRJXkpNJ.cjs +0 -1
- package/dist/index-a2ON2stt.js +0 -180
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { ExtractPropTypes, PropType, SlotsType, VNode } from 'vue';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
|
|
3
|
+
loading: {
|
|
4
|
+
type: BooleanConstructor;
|
|
5
|
+
default: boolean;
|
|
6
|
+
};
|
|
7
|
+
isError: {
|
|
8
|
+
type: BooleanConstructor;
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
loadData: {
|
|
12
|
+
type: PropType<() => Promise<void>>;
|
|
13
|
+
required: boolean;
|
|
14
|
+
};
|
|
15
|
+
scrollNode: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
required: boolean;
|
|
18
|
+
};
|
|
19
|
+
loadingTxt: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
finishedTxt: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
errorTxt: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
finished: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
35
|
+
offset: {
|
|
36
|
+
type: NumberConstructor;
|
|
37
|
+
default: number;
|
|
38
|
+
};
|
|
39
|
+
memoryScroll: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
43
|
+
pullRefresh: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
default: boolean;
|
|
46
|
+
};
|
|
47
|
+
refreshData: {
|
|
48
|
+
type: PropType<() => Promise<void>>;
|
|
49
|
+
};
|
|
50
|
+
pullDistance: {
|
|
51
|
+
type: NumberConstructor;
|
|
52
|
+
default: number;
|
|
53
|
+
};
|
|
54
|
+
pullTxt: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
58
|
+
releaseTxt: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
62
|
+
refreshingTxt: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
supportMode: {
|
|
67
|
+
type: PropType<"pc" | "mobile" | "all">;
|
|
68
|
+
default: string;
|
|
69
|
+
};
|
|
70
|
+
refreshLoading: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: boolean;
|
|
73
|
+
};
|
|
74
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
75
|
+
'update:loading': (v: boolean) => boolean;
|
|
76
|
+
'update:isError': (v: boolean) => boolean;
|
|
77
|
+
}, string, import('vue').PublicProps, Readonly<ExtractPropTypes<{
|
|
78
|
+
loading: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
default: boolean;
|
|
81
|
+
};
|
|
82
|
+
isError: {
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
86
|
+
loadData: {
|
|
87
|
+
type: PropType<() => Promise<void>>;
|
|
88
|
+
required: boolean;
|
|
89
|
+
};
|
|
90
|
+
scrollNode: {
|
|
91
|
+
type: StringConstructor;
|
|
92
|
+
required: boolean;
|
|
93
|
+
};
|
|
94
|
+
loadingTxt: {
|
|
95
|
+
type: StringConstructor;
|
|
96
|
+
default: string;
|
|
97
|
+
};
|
|
98
|
+
finishedTxt: {
|
|
99
|
+
type: StringConstructor;
|
|
100
|
+
default: string;
|
|
101
|
+
};
|
|
102
|
+
errorTxt: {
|
|
103
|
+
type: StringConstructor;
|
|
104
|
+
default: string;
|
|
105
|
+
};
|
|
106
|
+
finished: {
|
|
107
|
+
type: BooleanConstructor;
|
|
108
|
+
default: boolean;
|
|
109
|
+
};
|
|
110
|
+
offset: {
|
|
111
|
+
type: NumberConstructor;
|
|
112
|
+
default: number;
|
|
113
|
+
};
|
|
114
|
+
memoryScroll: {
|
|
115
|
+
type: BooleanConstructor;
|
|
116
|
+
default: boolean;
|
|
117
|
+
};
|
|
118
|
+
pullRefresh: {
|
|
119
|
+
type: BooleanConstructor;
|
|
120
|
+
default: boolean;
|
|
121
|
+
};
|
|
122
|
+
refreshData: {
|
|
123
|
+
type: PropType<() => Promise<void>>;
|
|
124
|
+
};
|
|
125
|
+
pullDistance: {
|
|
126
|
+
type: NumberConstructor;
|
|
127
|
+
default: number;
|
|
128
|
+
};
|
|
129
|
+
pullTxt: {
|
|
130
|
+
type: StringConstructor;
|
|
131
|
+
default: string;
|
|
132
|
+
};
|
|
133
|
+
releaseTxt: {
|
|
134
|
+
type: StringConstructor;
|
|
135
|
+
default: string;
|
|
136
|
+
};
|
|
137
|
+
refreshingTxt: {
|
|
138
|
+
type: StringConstructor;
|
|
139
|
+
default: string;
|
|
140
|
+
};
|
|
141
|
+
supportMode: {
|
|
142
|
+
type: PropType<"pc" | "mobile" | "all">;
|
|
143
|
+
default: string;
|
|
144
|
+
};
|
|
145
|
+
refreshLoading: {
|
|
146
|
+
type: BooleanConstructor;
|
|
147
|
+
default: boolean;
|
|
148
|
+
};
|
|
149
|
+
}>> & Readonly<{
|
|
150
|
+
"onUpdate:loading"?: ((v: boolean) => any) | undefined;
|
|
151
|
+
"onUpdate:isError"?: ((v: boolean) => any) | undefined;
|
|
152
|
+
}>, {
|
|
153
|
+
loading: boolean;
|
|
154
|
+
offset: number;
|
|
155
|
+
isError: boolean;
|
|
156
|
+
loadingTxt: string;
|
|
157
|
+
finishedTxt: string;
|
|
158
|
+
errorTxt: string;
|
|
159
|
+
finished: boolean;
|
|
160
|
+
memoryScroll: boolean;
|
|
161
|
+
pullRefresh: boolean;
|
|
162
|
+
pullDistance: number;
|
|
163
|
+
pullTxt: string;
|
|
164
|
+
releaseTxt: string;
|
|
165
|
+
refreshingTxt: string;
|
|
166
|
+
supportMode: "mobile" | "pc" | "all";
|
|
167
|
+
refreshLoading: boolean;
|
|
168
|
+
}, SlotsType<{
|
|
169
|
+
default: (obj: {
|
|
170
|
+
hintHeight: number;
|
|
171
|
+
}) => VNode;
|
|
172
|
+
bottomHint: () => VNode;
|
|
173
|
+
errorTxt: () => VNode;
|
|
174
|
+
loadingTxt: () => VNode;
|
|
175
|
+
finishedTxt: () => VNode;
|
|
176
|
+
pullTxt: () => VNode;
|
|
177
|
+
releaseTxt: () => VNode;
|
|
178
|
+
refreshingTxt: () => VNode;
|
|
179
|
+
}>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
180
|
+
export default _default;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DyFormItem } from './form.ts';
|
|
2
|
-
import { VNode } from 'vue';
|
|
2
|
+
import { ComputedRef, Ref, VNode } from 'vue';
|
|
3
3
|
export type DyCFormItem = {
|
|
4
4
|
rId: string;
|
|
5
5
|
key: string;
|
|
@@ -75,6 +75,14 @@ export type ExposeType = {
|
|
|
75
75
|
onSet?: (obj?: object) => void;
|
|
76
76
|
getResult?: (t?: 'res' | 'ori') => DyCFormItem[] | object;
|
|
77
77
|
};
|
|
78
|
+
export type ExposeZealCardType = {
|
|
79
|
+
tableHeight: Ref<number>;
|
|
80
|
+
isMobile: ComputedRef<boolean>;
|
|
81
|
+
};
|
|
82
|
+
export type ZealColumnType = {
|
|
83
|
+
tableHeight: Ref<number>;
|
|
84
|
+
isMobile: Ref<boolean>;
|
|
85
|
+
};
|
|
78
86
|
export type PresetType = 'fullRow' | 'grid';
|
|
79
87
|
export type RenderType = "renderInput" | "renderSelect" | "renderPopSelect" | "renderTreeSelect" | "renderRadioGroup" | "renderRadioButtonGroup" | "renderCheckboxGroup" | "renderSwitch" | "renderDatePicker" | "renderTimePicker" | "renderCheckbox" | "renderDynamicTags" | "renderSlider" | "renderInputNumber";
|
|
80
88
|
export type ExposeDyFType = {
|
|
@@ -116,3 +124,15 @@ export type ExposeZealTSearchType = {
|
|
|
116
124
|
toggleDrawer?: (f?: boolean) => void;
|
|
117
125
|
getParams?: <T extends object>() => T;
|
|
118
126
|
};
|
|
127
|
+
export type TableBtnType = {
|
|
128
|
+
key: string;
|
|
129
|
+
title?: string;
|
|
130
|
+
onSelect?: (k: string) => void;
|
|
131
|
+
disabled?: boolean;
|
|
132
|
+
};
|
|
133
|
+
export type PullEvent = TouchEvent | PointerEvent;
|
|
134
|
+
export type ListenerItem = {
|
|
135
|
+
name: keyof HTMLElementEventMap;
|
|
136
|
+
handler: EventListener;
|
|
137
|
+
options?: AddEventListenerOptions | boolean;
|
|
138
|
+
};
|
package/dist/types/slots.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ type SizeObjType = {
|
|
|
5
5
|
height: number;
|
|
6
6
|
};
|
|
7
7
|
export type ZealCardSlots = {
|
|
8
|
-
searchForm?: () => VNode[];
|
|
9
|
-
searchBtn?: () => VNode[];
|
|
10
|
-
controlBtn?: () => VNode[];
|
|
11
|
-
toolBtn?: () => VNode[];
|
|
8
|
+
searchForm?: (size: SizeObjType) => VNode[];
|
|
9
|
+
searchBtn?: (size: SizeObjType) => VNode[];
|
|
10
|
+
controlBtn?: (size: SizeObjType) => VNode[];
|
|
11
|
+
toolBtn?: (size: SizeObjType) => VNode[];
|
|
12
12
|
default?: (obj: {
|
|
13
13
|
tableHeight: number;
|
|
14
14
|
} & SizeObjType) => VNode[];
|
|
15
|
-
rest?: () => VNode[];
|
|
15
|
+
rest?: (size: SizeObjType) => VNode[];
|
|
16
16
|
footer?: (size: SizeObjType) => VNode[];
|
|
17
17
|
header?: (size: SizeObjType) => VNode[];
|
|
18
18
|
};
|
|
@@ -34,4 +34,7 @@ export type EleZealTableSlots = {
|
|
|
34
34
|
append?: () => VNode[];
|
|
35
35
|
empty?: () => VNode[];
|
|
36
36
|
};
|
|
37
|
+
export type ZealTableBtnControlSlots = {
|
|
38
|
+
text: () => void;
|
|
39
|
+
};
|
|
37
40
|
export {};
|
package/dist/utils/tools.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValueType, DyCFormItem, DyRandomFun } from '../types';
|
|
1
|
+
import { ValueType, DyCFormItem, DyRandomFun, PullEvent } from '../types';
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
3
|
import { DyFormItem } from '../types/form';
|
|
4
4
|
declare const tranArr: (obj: ValueType, arrayFun: DyRandomFun, splitSymbol: string) => DyCFormItem[];
|
|
@@ -11,7 +11,10 @@ declare function ensureRef(v: any): Ref<any>;
|
|
|
11
11
|
declare function OmitValue<T extends DyFormItem, const K extends readonly (keyof T)[]>(f: T, extraKeys?: K): Omit<T, "value" | K[number]>;
|
|
12
12
|
declare function Debounce<T extends (...args: any[]) => void>(func: T, delay?: number): (...args: Parameters<T>) => void;
|
|
13
13
|
declare const getPadY: (el: HTMLElement | null) => number;
|
|
14
|
+
declare const getMarginY: (el: HTMLElement | null) => number;
|
|
14
15
|
declare const unwrapObj: <T extends Record<string, any>>(obj: T) => { [K in keyof T]: T[K] extends {
|
|
15
16
|
value: infer V;
|
|
16
17
|
} ? V : T[K]; };
|
|
17
|
-
|
|
18
|
+
declare function getClientY(e: PullEvent): number;
|
|
19
|
+
declare function getEventId(e: PullEvent): number | null;
|
|
20
|
+
export { tranArr, resetObj, parseValue, formatNumberInput, getDepthColor, saferRepairColor, ensureRef, OmitValue, Debounce, getPadY, getMarginY, unwrapObj, getClientY, getEventId };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dynamicformdjx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "xczcdjx",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"scripts": {
|
|
52
52
|
"dev:v3": "vite --host",
|
|
53
53
|
"build:v3": "vue-tsc -b && vite build",
|
|
54
|
+
"build:skipTsc": "vite build",
|
|
54
55
|
"preview": "vite preview",
|
|
55
56
|
"pub": "npm version patch && npm publish"
|
|
56
57
|
},
|
package/dist/index-BRJXkpNJ.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require('./index.css');const c=require("vue"),S=(t,e,n)=>Object.keys(t).map((r,s)=>{const l=t[r],f=Array.isArray(l),m=f?l.every(p=>typeof p=="number"):typeof l=="number";return{rId:e(s),key:r,value:f?l.join(n):l,isArray:f||void 0,isNumber:m||void 0}}),$=(t,e)=>t.reduce((n,r)=>(r.key.trim()&&(n[r.key]=R(r.value,r.isArray,r.isNumber,e)),n),{}),R=(t,e,n,r=",")=>{let s;return e?n?s=String(t).split(r).map(Number).filter(l=>!Number.isNaN(l)):s=String(t).split(r):n?s=parseFloat(t):s=t.toString(),s},j=(t,e,n=",")=>{const r=s=>{s=s.replace(/[^\d.-]/g,"");let l=!1;s.startsWith("-")&&(l=!0),s=s.replace(/-/g,"");const f=s.indexOf(".");return f!==-1&&(s=s.slice(0,f+1)+s.slice(f+1).replace(/\./g,"")),(l?"-":"")+s};return e?t.split(n).map(s=>r(s)).join(n):r(t)},O=t=>`hsl(${t*35%360}, 60%, 65%)`,H=(t,e)=>t[e-1]??O(e);function k(t){return c.isRef(t)?t:c.ref(t??null)}function I(t,e){const n={...t};return delete n.value,e?.forEach(r=>{r!=="value"&&delete n[r]}),n}function E(t,e=500){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{t(...r)},e)}}const g=t=>{if(!t)return 0;const e=getComputedStyle(t);return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)},V=t=>Object.fromEntries(Object.entries(t).map(([e,n])=>[e,c.unref(n)]));function z(t,e=!0){return t.map(n=>{const r=n;return r.value=k(n.value),e?c.shallowReactive(r):r})}function D(t){const e=()=>c.unref(t),n=(u,a)=>{e().forEach(o=>{const i=o.key;(!a||a.includes(i))&&(o.disabled=u)})},r=(u,a)=>{e().forEach(o=>{const i=o.key;(!a||a.includes(i))&&(o.hidden=u)})},s=(u,a)=>{const o=e().find(i=>i.key===u);o&&(c.isRef(o.value)?o.value.value=a:o.value=a)};return{setDisabled:n,setHidden:r,setValue:s,setValues:u=>{Object.entries(u).forEach(([a,o])=>{s(a,o)})},getValue:u=>{const a=e().find(o=>o.key===u);if(a){const o=a.value;return c.isRef(o)?c.toRaw(o.value):o}},getValues:u=>{const a=u&&u.length?new Set(u):null;return e().reduce((o,i)=>{const v=i.key;if(!a||a.has(v)){const h=c.isRef(i.value)?c.toRaw(i.value.value):i.value;o[v]=h}return o},{})},onReset:(u=null)=>{e().forEach(a=>{c.isRef(a.value)?a.value.value=u:a.value=u})},getItem:u=>e().find(a=>a.key===u),setItem:(u,a)=>{e().forEach(o=>{if(o.key===u){const{key:i,...v}=a;Object.assign(o,v)}})},setItems:u=>{const a=new Map(u);e().forEach(o=>{const i=a.get(o.key);if(i){const{key:v,...h}=i;Object.assign(o,h)}})},updateKeys:u=>{const a=new Map(u);e().forEach(o=>{const i=a.get(o.key);i&&(o.key=i)})}}}function M(t=756,e=500){const n=c.ref(window.innerWidth),r=c.ref(window.innerWidth),s=E(()=>{n.value=window.innerWidth,r.value=window.innerHeight},e),l=c.computed(()=>n.value<=t);return c.onMounted(()=>{window.addEventListener("resize",s)}),c.onUnmounted(()=>{window.removeEventListener("resize",s)}),{width:n,height:r,isMobile:l}}function N(t){const e=t.name==="ElCard"?"el":"n",n=c.ref(null),r=c.ref(null),s=c.ref(null),l=c.ref(0);let f=null;const m=()=>{const p=n.value,d=s.value?.$el??null;if(!p||!d)return;const y=p.clientHeight-g(p),b=r.value?.offsetHeight??0,w=d.querySelector(`.${e}-card__header`)||d.querySelector(`.${e}-card-header`),u=d.querySelector(`.${e}-card__footer`)||d.querySelector(`.${e}-card-footer`),a=w?.offsetHeight??0,o=u?.offsetHeight??0,i=d.querySelector(`.${e}-card__body`)||d.querySelector(`.${e}-card-content`),v=g(i);l.value=Math.max(0,y-b-a-o-v)};return c.onMounted(async()=>{await c.nextTick(),m(),f=new ResizeObserver(m),n.value&&f.observe(n.value),r.value&&f.observe(r.value),s.value?.$el&&f.observe(s.value.$el)}),c.onBeforeUnmount(()=>{f?.disconnect(),f=null}),{wrapRef:n,cardRef:s,restRef:r,tableHeight:l}}exports.Debounce=E;exports.OmitValue=I;exports.ensureRef=k;exports.formatNumberInput=j;exports.getDepthColor=O;exports.getPadY=g;exports.parseValue=R;exports.resetObj=$;exports.saferRepairColor=H;exports.tranArr=S;exports.unwrapObj=V;exports.useDyForm=D;exports.useObserverSize=N;exports.useReactiveForm=z;exports.useWindowSize=M;
|
package/dist/index-a2ON2stt.js
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { ref as v, isRef as m, unref as O, shallowReactive as S, toRaw as k, computed as $, onMounted as R, onUnmounted as H, nextTick as I, onBeforeUnmount as j } from "vue";
|
|
2
|
-
import './index.css';const q = (t, e, n) => Object.keys(t).map((r, o) => {
|
|
3
|
-
const i = t[r], l = Array.isArray(i), h = l ? i.every((p) => typeof p == "number") : typeof i == "number";
|
|
4
|
-
return {
|
|
5
|
-
rId: e(o),
|
|
6
|
-
key: r,
|
|
7
|
-
value: l ? i.join(n) : i,
|
|
8
|
-
isArray: l || void 0,
|
|
9
|
-
isNumber: h || void 0
|
|
10
|
-
};
|
|
11
|
-
}), A = (t, e) => t.reduce((n, r) => (r.key.trim() && (n[r.key] = V(r.value, r.isArray, r.isNumber, e)), n), {}), V = (t, e, n, r = ",") => {
|
|
12
|
-
let o;
|
|
13
|
-
return e ? n ? o = String(t).split(r).map(Number).filter((i) => !Number.isNaN(i)) : o = String(t).split(r) : n ? o = parseFloat(t) : o = t.toString(), o;
|
|
14
|
-
}, D = (t, e, n = ",") => {
|
|
15
|
-
const r = (o) => {
|
|
16
|
-
o = o.replace(/[^\d.-]/g, "");
|
|
17
|
-
let i = !1;
|
|
18
|
-
o.startsWith("-") && (i = !0), o = o.replace(/-/g, "");
|
|
19
|
-
const l = o.indexOf(".");
|
|
20
|
-
return l !== -1 && (o = o.slice(0, l + 1) + o.slice(l + 1).replace(/\./g, "")), (i ? "-" : "") + o;
|
|
21
|
-
};
|
|
22
|
-
return e ? t.split(n).map((o) => r(o)).join(n) : r(t);
|
|
23
|
-
}, z = (t) => `hsl(${t * 35 % 360}, 60%, 65%)`, _ = (t, e) => t[e - 1] ?? z(e);
|
|
24
|
-
function M(t) {
|
|
25
|
-
return m(t) ? t : v(t ?? null);
|
|
26
|
-
}
|
|
27
|
-
function x(t, e) {
|
|
28
|
-
const n = { ...t };
|
|
29
|
-
return delete n.value, e?.forEach((r) => {
|
|
30
|
-
r !== "value" && delete n[r];
|
|
31
|
-
}), n;
|
|
32
|
-
}
|
|
33
|
-
function N(t, e = 500) {
|
|
34
|
-
let n = null;
|
|
35
|
-
return function(...r) {
|
|
36
|
-
n && clearTimeout(n), n = setTimeout(() => {
|
|
37
|
-
t(...r);
|
|
38
|
-
}, e);
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
const E = (t) => {
|
|
42
|
-
if (!t) return 0;
|
|
43
|
-
const e = getComputedStyle(t);
|
|
44
|
-
return (parseFloat(e.paddingTop) || 0) + (parseFloat(e.paddingBottom) || 0);
|
|
45
|
-
}, F = (t) => Object.fromEntries(Object.entries(t).map(([e, n]) => [e, O(n)]));
|
|
46
|
-
function C(t, e = !0) {
|
|
47
|
-
return t.map((n) => {
|
|
48
|
-
const r = n;
|
|
49
|
-
return r.value = M(n.value), e ? S(r) : r;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
function T(t) {
|
|
53
|
-
const e = () => O(t), n = (c, a) => {
|
|
54
|
-
e().forEach((s) => {
|
|
55
|
-
const u = s.key;
|
|
56
|
-
(!a || a.includes(u)) && (s.disabled = c);
|
|
57
|
-
});
|
|
58
|
-
}, r = (c, a) => {
|
|
59
|
-
e().forEach((s) => {
|
|
60
|
-
const u = s.key;
|
|
61
|
-
(!a || a.includes(u)) && (s.hidden = c);
|
|
62
|
-
});
|
|
63
|
-
}, o = (c, a) => {
|
|
64
|
-
const s = e().find((u) => u.key === c);
|
|
65
|
-
s && (m(s.value) ? s.value.value = a : s.value = a);
|
|
66
|
-
};
|
|
67
|
-
return {
|
|
68
|
-
setDisabled: n,
|
|
69
|
-
setHidden: r,
|
|
70
|
-
setValue: o,
|
|
71
|
-
setValues: (c) => {
|
|
72
|
-
Object.entries(c).forEach(([a, s]) => {
|
|
73
|
-
o(a, s);
|
|
74
|
-
});
|
|
75
|
-
},
|
|
76
|
-
getValue: (c) => {
|
|
77
|
-
const a = e().find((s) => s.key === c);
|
|
78
|
-
if (a) {
|
|
79
|
-
const s = a.value;
|
|
80
|
-
return m(s) ? k(s.value) : s;
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
getValues: (c) => {
|
|
84
|
-
const a = c && c.length ? new Set(c) : null;
|
|
85
|
-
return e().reduce((s, u) => {
|
|
86
|
-
const d = u.key;
|
|
87
|
-
if (!a || a.has(d)) {
|
|
88
|
-
const g = m(u.value) ? k(u.value.value) : u.value;
|
|
89
|
-
s[d] = g;
|
|
90
|
-
}
|
|
91
|
-
return s;
|
|
92
|
-
}, {});
|
|
93
|
-
},
|
|
94
|
-
onReset: (c = null) => {
|
|
95
|
-
e().forEach((a) => {
|
|
96
|
-
m(a.value) ? a.value.value = c : a.value = c;
|
|
97
|
-
});
|
|
98
|
-
},
|
|
99
|
-
getItem: (c) => e().find((a) => a.key === c),
|
|
100
|
-
setItem: (c, a) => {
|
|
101
|
-
e().forEach((s) => {
|
|
102
|
-
if (s.key === c) {
|
|
103
|
-
const { key: u, ...d } = a;
|
|
104
|
-
Object.assign(s, d);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
},
|
|
108
|
-
setItems: (c) => {
|
|
109
|
-
const a = new Map(c);
|
|
110
|
-
e().forEach((s) => {
|
|
111
|
-
const u = a.get(s.key);
|
|
112
|
-
if (u) {
|
|
113
|
-
const { key: d, ...g } = u;
|
|
114
|
-
Object.assign(s, g);
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
},
|
|
118
|
-
updateKeys: (c) => {
|
|
119
|
-
const a = new Map(c);
|
|
120
|
-
e().forEach((s) => {
|
|
121
|
-
const u = a.get(s.key);
|
|
122
|
-
u && (s.key = u);
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
function B(t = 756, e = 500) {
|
|
128
|
-
const n = v(window.innerWidth), r = v(window.innerWidth), o = N(() => {
|
|
129
|
-
n.value = window.innerWidth, r.value = window.innerHeight;
|
|
130
|
-
}, e), i = $(() => n.value <= t);
|
|
131
|
-
return R(() => {
|
|
132
|
-
window.addEventListener("resize", o);
|
|
133
|
-
}), H(() => {
|
|
134
|
-
window.removeEventListener("resize", o);
|
|
135
|
-
}), {
|
|
136
|
-
width: n,
|
|
137
|
-
height: r,
|
|
138
|
-
isMobile: i
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
function K(t) {
|
|
142
|
-
const e = t.name === "ElCard" ? "el" : "n", n = v(null), r = v(null), o = v(null), i = v(0);
|
|
143
|
-
let l = null;
|
|
144
|
-
const h = () => {
|
|
145
|
-
const p = n.value, f = o.value?.$el ?? null;
|
|
146
|
-
if (!p || !f) return;
|
|
147
|
-
const y = p.clientHeight - E(p), b = r.value?.offsetHeight ?? 0, w = f.querySelector(`.${e}-card__header`) || f.querySelector(`.${e}-card-header`), c = f.querySelector(`.${e}-card__footer`) || f.querySelector(`.${e}-card-footer`), a = w?.offsetHeight ?? 0, s = c?.offsetHeight ?? 0, u = f.querySelector(`.${e}-card__body`) || f.querySelector(`.${e}-card-content`), d = E(u);
|
|
148
|
-
i.value = Math.max(
|
|
149
|
-
0,
|
|
150
|
-
y - b - a - s - d
|
|
151
|
-
);
|
|
152
|
-
};
|
|
153
|
-
return R(async () => {
|
|
154
|
-
await I(), h(), l = new ResizeObserver(h), n.value && l.observe(n.value), r.value && l.observe(r.value), o.value?.$el && l.observe(o.value.$el);
|
|
155
|
-
}), j(() => {
|
|
156
|
-
l?.disconnect(), l = null;
|
|
157
|
-
}), {
|
|
158
|
-
wrapRef: n,
|
|
159
|
-
cardRef: o,
|
|
160
|
-
restRef: r,
|
|
161
|
-
tableHeight: i
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
export {
|
|
165
|
-
N as D,
|
|
166
|
-
x as O,
|
|
167
|
-
T as a,
|
|
168
|
-
B as b,
|
|
169
|
-
K as c,
|
|
170
|
-
E as d,
|
|
171
|
-
M as e,
|
|
172
|
-
D as f,
|
|
173
|
-
z as g,
|
|
174
|
-
F as h,
|
|
175
|
-
V as p,
|
|
176
|
-
A as r,
|
|
177
|
-
_ as s,
|
|
178
|
-
q as t,
|
|
179
|
-
C as u
|
|
180
|
-
};
|