@ctc-front/components-ui-next 0.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.cjs +1 -0
- package/dist/index.d.ts +432 -0
- package/dist/index.js +477 -0
- package/dist/style.css +2 -0
- package/package.json +71 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require("vue"),t=require("element-plus");var n=(0,e.defineComponent)({name:`Close`,__name:`close`,setup(t){return(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 1024 1024`},[(0,e.createElementVNode)(`path`,{fill:`currentColor`,d:`M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z`})]))}}),r=(0,e.defineComponent)({name:`FullScreen`,__name:`full-screen`,setup(t){return(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 1024 1024`},[(0,e.createElementVNode)(`path`,{fill:`currentColor`,d:`m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z`})]))}}),i=(0,e.defineComponent)({name:`Minus`,__name:`minus`,setup(t){return(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 1024 1024`},[(0,e.createElementVNode)(`path`,{fill:`currentColor`,d:`M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64`})]))}});function a(t,n){let r=(0,e.computed)(()=>t.fullscreen??!1);function i(){n(`update:fullscreen`,!r.value)}return{isFullscreen:r,toggleFullscreen:i}}function o(e,t,n){return Math.min(Math.max(e,t),n)}function s(t,n){let r=(0,e.ref)(!1),i=(0,e.ref)({}),a=()=>{};function s(){a(),a=()=>{}}function c(e){if(!t.resizable||e.button!==0)return;let c=e.currentTarget.closest(`.ctc-dialog`);if(!c)return;e.preventDefault(),s();let l=c.getBoundingClientRect(),u=t.minWidth??400,d=t.minHeight??240,f=Math.max(u,window.innerWidth-l.left-32),p=Math.max(d,window.innerHeight-l.top-32),m=e.clientX,h=e.clientY;function g(e){let t=Math.round(o(l.width+e.clientX-m,u,f)),a=Math.round(o(l.height+e.clientY-h,d,p));r.value=!0,i.value={height:`${a}px`,width:`${t}px`},n(`resize`,{width:t,height:a})}function _(){s()}window.addEventListener(`pointermove`,g),window.addEventListener(`pointerup`,_,{once:!0}),a=()=>{window.removeEventListener(`pointermove`,g),window.removeEventListener(`pointerup`,_)}}return(0,e.onBeforeUnmount)(s),{isResized:r,resizeStyle:i,startResize:c}}var c={class:`ctc-dialog__header-content`},l={class:`ctc-dialog__title`},u={class:`ctc-dialog__header-actions`},d=[`aria-label`,`title`],f={class:`ctc-dialog__content`},p=(0,e.defineComponent)({name:`CtcDialog`,inheritAttrs:!1,__name:`index`,props:{modelValue:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},showFullscreen:{type:Boolean,default:!1},resizable:{type:Boolean,default:!1},minWidth:{type:Number,default:400},minHeight:{type:Number,default:240},title:{type:String,default:``},width:{type:[String,Number],default:`640px`},alignCenter:Boolean,appendTo:{type:[String,Object],default:void 0},beforeClose:{type:Function,default:void 0},closeDelay:Number,closeOnClickModal:Boolean,closeOnPressEscape:Boolean,destroyOnClose:Boolean,draggable:Boolean,lockScroll:Boolean,modal:{type:Boolean,default:!0},modalClass:{type:[String,Array,Object],default:void 0},openDelay:Number,overflow:Boolean,showClose:{type:Boolean,default:!0},top:String,trapFocus:Boolean,zIndex:Number},emits:[`update:modelValue`,`update:fullscreen`,`resize`,`open`,`opened`,`close`,`closed`],setup(o,{emit:p}){let m=o,h=p,g=(0,e.useAttrs)(),_=(0,e.useSlots)(),{isFullscreen:v,toggleFullscreen:y}=a(m,h),{isResized:b,resizeStyle:x,startResize:S}=s(m,h),C=(0,e.computed)(()=>v.value?{}:x.value),w=(0,e.computed)(()=>b.value&&!v.value);function T(e){h(`update:modelValue`,e)}function E(){if(m.beforeClose){m.beforeClose(e=>{e||h(`update:modelValue`,!1)});return}h(`update:modelValue`,!1)}return(a,s)=>((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(t.ElDialog),(0,e.mergeProps)((0,e.unref)(g),{class:[`ctc-dialog`,{"ctc-dialog--resizable":o.resizable,"ctc-dialog--resized":w.value}],style:C.value,"model-value":o.modelValue,fullscreen:(0,e.unref)(v),title:o.title,width:o.width,"align-center":o.alignCenter,"append-to":o.appendTo,"before-close":o.beforeClose,"close-delay":o.closeDelay,"close-on-click-modal":o.closeOnClickModal,"close-on-press-escape":o.closeOnPressEscape,"destroy-on-close":o.destroyOnClose,draggable:o.draggable,"lock-scroll":o.lockScroll,modal:o.modal,"modal-class":o.modalClass,"open-delay":o.openDelay,overflow:o.overflow,"show-close":!1,top:o.top,"trap-focus":o.trapFocus,"z-index":o.zIndex,"header-class":`ctc-dialog__header`,"body-class":`ctc-dialog__body`,"footer-class":`ctc-dialog__footer`,"onUpdate:modelValue":T,onOpen:s[2]||=e=>h(`open`),onOpened:s[3]||=e=>h(`opened`),onClose:s[4]||=e=>h(`close`),onClosed:s[5]||=e=>h(`closed`)}),(0,e.createSlots)({header:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,c,[(0,e.renderSlot)(a.$slots,`header`,{},()=>[(0,e.createElementVNode)(`span`,l,(0,e.toDisplayString)(o.title),1)])]),(0,e.createElementVNode)(`div`,u,[o.showFullscreen?((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:0,class:`ctc-dialog__fullscreen-toggle`,type:`button`,"aria-label":(0,e.unref)(v)?`退出全屏`:`全屏显示`,title:(0,e.unref)(v)?`退出全屏`:`全屏显示`,"data-ctc-fullscreen-toggle":``,onClick:s[0]||=(...t)=>(0,e.unref)(y)&&(0,e.unref)(y)(...t)},[(0,e.createVNode)((0,e.unref)(t.ElIcon),{"aria-hidden":`true`},{default:(0,e.withCtx)(()=>[(0,e.unref)(v)?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(i),{key:0})):((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(r),{key:1}))]),_:1})],8,d)):(0,e.createCommentVNode)(``,!0),o.showClose?((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:1,class:`ctc-dialog__close`,type:`button`,"aria-label":`关闭弹窗`,title:`关闭`,"data-ctc-close":``,onClick:E},[(0,e.createVNode)((0,e.unref)(t.ElIcon),{"aria-hidden":`true`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(n))]),_:1})])):(0,e.createCommentVNode)(``,!0)])]),default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,f,[(0,e.renderSlot)(a.$slots,`default`)]),o.resizable&&!(0,e.unref)(v)?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`ctc-dialog__resize-handle`,"aria-hidden":`true`,"data-ctc-resize-handle":``,onPointerdown:s[1]||=(...t)=>(0,e.unref)(S)&&(0,e.unref)(S)(...t)},null,32)):(0,e.createCommentVNode)(``,!0)]),_:2},[(0,e.unref)(_).footer?{name:`footer`,fn:(0,e.withCtx)(()=>[(0,e.renderSlot)(a.$slots,`footer`)]),key:`0`}:void 0]),1040,[`class`,`style`,`model-value`,`fullscreen`,`title`,`width`,`align-center`,`append-to`,`before-close`,`close-delay`,`close-on-click-modal`,`close-on-press-escape`,`destroy-on-close`,`draggable`,`lock-scroll`,`modal`,`modal-class`,`open-delay`,`overflow`,`top`,`trap-focus`,`z-index`]))}}),m={class:`ctc-drawer__header-content`},h={class:`ctc-drawer__title`},g={class:`ctc-drawer__header-actions`},_=[`aria-label`,`title`],v={class:`ctc-drawer__content`},y={key:0,class:`ctc-drawer__footer`},b=(0,e.defineComponent)({name:`CtcDrawer`,inheritAttrs:!1,__name:`index`,props:{modelValue:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},showFullscreen:{type:Boolean,default:!1},title:{type:String,default:``},size:{type:[String,Number],default:`480px`},direction:{type:String,default:`rtl`},appendTo:{type:[String,Object],default:void 0},beforeClose:{type:Function,default:void 0},closeOnClickModal:Boolean,closeOnPressEscape:Boolean,destroyOnClose:Boolean,lockScroll:Boolean,modal:{type:Boolean,default:!0},modalClass:{type:[String,Array,Object],default:void 0},showClose:{type:Boolean,default:!0},zIndex:Number},emits:[`update:modelValue`,`update:fullscreen`,`open`,`opened`,`close`,`closed`],setup(o,{emit:s}){let c=o,l=s,u=(0,e.useAttrs)(),d=(0,e.useSlots)(),{isFullscreen:f,toggleFullscreen:p}=a(c,l),b=(0,e.computed)(()=>f.value?`100%`:c.size);function x(e){l(`update:modelValue`,e)}function S(){if(c.beforeClose){c.beforeClose(e=>{e||l(`update:modelValue`,!1)});return}l(`update:modelValue`,!1)}return(a,s)=>((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(t.ElDrawer),(0,e.mergeProps)((0,e.unref)(u),{class:[`ctc-drawer`,{"is-fullscreen":(0,e.unref)(f)}],"model-value":o.modelValue,"append-to":o.appendTo,"before-close":o.beforeClose,"close-on-click-modal":o.closeOnClickModal,"close-on-press-escape":o.closeOnPressEscape,"destroy-on-close":o.destroyOnClose,direction:o.direction,"lock-scroll":o.lockScroll,modal:o.modal,"modal-class":o.modalClass,"show-close":!1,size:b.value,"z-index":o.zIndex,"header-class":`ctc-drawer__header`,"body-class":`ctc-drawer__body`,"onUpdate:modelValue":x,onOpen:s[1]||=e=>l(`open`),onOpened:s[2]||=e=>l(`opened`),onClose:s[3]||=e=>l(`close`),onClosed:s[4]||=e=>l(`closed`)}),{header:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,m,[(0,e.renderSlot)(a.$slots,`header`,{},()=>[(0,e.createElementVNode)(`span`,h,(0,e.toDisplayString)(o.title),1)])]),(0,e.createElementVNode)(`div`,g,[o.showFullscreen?((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:0,class:`ctc-drawer__fullscreen-toggle`,type:`button`,"aria-label":(0,e.unref)(f)?`退出全屏`:`全屏显示`,title:(0,e.unref)(f)?`退出全屏`:`全屏显示`,"data-ctc-fullscreen-toggle":``,onClick:s[0]||=(...t)=>(0,e.unref)(p)&&(0,e.unref)(p)(...t)},[(0,e.createVNode)((0,e.unref)(t.ElIcon),{"aria-hidden":`true`},{default:(0,e.withCtx)(()=>[(0,e.unref)(f)?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(i),{key:0})):((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(r),{key:1}))]),_:1})],8,_)):(0,e.createCommentVNode)(``,!0),o.showClose?((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:1,class:`ctc-drawer__close`,type:`button`,"aria-label":`关闭抽屉`,title:`关闭`,"data-ctc-close":``,onClick:S},[(0,e.createVNode)((0,e.unref)(t.ElIcon),{"aria-hidden":`true`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(n))]),_:1})])):(0,e.createCommentVNode)(``,!0)])]),default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`ctc-drawer__layout`,{"has-footer":(0,e.unref)(d).footer}])},[(0,e.createElementVNode)(`div`,v,[(0,e.renderSlot)(a.$slots,`default`)]),(0,e.unref)(d).footer?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,y,[(0,e.renderSlot)(a.$slots,`footer`)])):(0,e.createCommentVNode)(``,!0)],2)]),_:3},16,[`class`,`model-value`,`append-to`,`before-close`,`close-on-click-modal`,`close-on-press-escape`,`destroy-on-close`,`direction`,`lock-scroll`,`modal`,`modal-class`,`size`,`z-index`]))}}),x=(0,e.defineComponent)({name:`CtcFlex`,__name:`index`,props:{direction:{default:`column`},fill:{type:Boolean,default:!1},grow:{default:1},justify:{default:`flex-start`},align:{default:`stretch`},gap:{default:0},scroll:{type:[Boolean,String],default:!1}},setup(t){let n=t,r=(0,e.computed)(()=>{let e={alignItems:n.align,flexDirection:n.direction,justifyContent:n.justify};return n.gap!==0&&n.gap!==``&&(e.gap=typeof n.gap==`number`?`${n.gap}px`:n.gap),n.fill&&(e.flex=n.grow),n.direction===`column`?e.minHeight=`0`:e.minWidth=`0`,n.scroll===`x`?(e.overflowX=`auto`,e.overflowY=`hidden`):n.scroll===`y`?(e.overflowX=`hidden`,e.overflowY=`auto`):n.scroll&&(e.overflow=`auto`),e});return(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`ctc-flex`,style:(0,e.normalizeStyle)(r.value)},[(0,e.renderSlot)(t.$slots,`default`)],4))}}),S=[p,b,x],C={install(e){S.forEach(t=>{e.component(t.name??``,t)})}};exports.CtcComponentsUi=C,exports.default=C,exports.CtcDialog=p,exports.CtcDrawer=b,exports.CtcFlex=x;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
2
|
+
import { ComponentProvideOptions } from 'vue';
|
|
3
|
+
import { DefineComponent } from 'vue';
|
|
4
|
+
import { DialogBeforeCloseFn } from 'element-plus';
|
|
5
|
+
import { DialogProps } from 'element-plus';
|
|
6
|
+
import { DrawerProps } from 'element-plus';
|
|
7
|
+
import { ExtractPropTypes } from 'vue';
|
|
8
|
+
import { Plugin as Plugin_2 } from 'vue';
|
|
9
|
+
import { PropType } from 'vue';
|
|
10
|
+
import { PublicProps } from 'vue';
|
|
11
|
+
|
|
12
|
+
declare const __VLS_component: DefineComponent<ExtractPropTypes< {
|
|
13
|
+
modelValue: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: boolean;
|
|
16
|
+
};
|
|
17
|
+
fullscreen: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
showFullscreen: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
resizable: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
minWidth: {
|
|
30
|
+
type: NumberConstructor;
|
|
31
|
+
default: number;
|
|
32
|
+
};
|
|
33
|
+
minHeight: {
|
|
34
|
+
type: NumberConstructor;
|
|
35
|
+
default: number;
|
|
36
|
+
};
|
|
37
|
+
title: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
default: string;
|
|
40
|
+
};
|
|
41
|
+
width: {
|
|
42
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
43
|
+
default: string;
|
|
44
|
+
};
|
|
45
|
+
alignCenter: BooleanConstructor;
|
|
46
|
+
appendTo: {
|
|
47
|
+
type: PropType<string | HTMLElement>;
|
|
48
|
+
default: undefined;
|
|
49
|
+
};
|
|
50
|
+
beforeClose: {
|
|
51
|
+
type: PropType<CtcDialogBeforeClose>;
|
|
52
|
+
default: undefined;
|
|
53
|
+
};
|
|
54
|
+
closeDelay: NumberConstructor;
|
|
55
|
+
closeOnClickModal: BooleanConstructor;
|
|
56
|
+
closeOnPressEscape: BooleanConstructor;
|
|
57
|
+
destroyOnClose: BooleanConstructor;
|
|
58
|
+
draggable: BooleanConstructor;
|
|
59
|
+
lockScroll: BooleanConstructor;
|
|
60
|
+
modal: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
default: boolean;
|
|
63
|
+
};
|
|
64
|
+
modalClass: {
|
|
65
|
+
type: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
66
|
+
default: undefined;
|
|
67
|
+
};
|
|
68
|
+
openDelay: NumberConstructor;
|
|
69
|
+
overflow: BooleanConstructor;
|
|
70
|
+
showClose: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: boolean;
|
|
73
|
+
};
|
|
74
|
+
top: StringConstructor;
|
|
75
|
+
trapFocus: BooleanConstructor;
|
|
76
|
+
zIndex: NumberConstructor;
|
|
77
|
+
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
78
|
+
resize: (payload: {
|
|
79
|
+
width: number;
|
|
80
|
+
height: number;
|
|
81
|
+
}) => any;
|
|
82
|
+
open: () => any;
|
|
83
|
+
close: () => any;
|
|
84
|
+
"update:fullscreen": (value: boolean) => any;
|
|
85
|
+
"update:modelValue": (value: boolean) => any;
|
|
86
|
+
opened: () => any;
|
|
87
|
+
closed: () => any;
|
|
88
|
+
}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
89
|
+
modelValue: {
|
|
90
|
+
type: BooleanConstructor;
|
|
91
|
+
default: boolean;
|
|
92
|
+
};
|
|
93
|
+
fullscreen: {
|
|
94
|
+
type: BooleanConstructor;
|
|
95
|
+
default: boolean;
|
|
96
|
+
};
|
|
97
|
+
showFullscreen: {
|
|
98
|
+
type: BooleanConstructor;
|
|
99
|
+
default: boolean;
|
|
100
|
+
};
|
|
101
|
+
resizable: {
|
|
102
|
+
type: BooleanConstructor;
|
|
103
|
+
default: boolean;
|
|
104
|
+
};
|
|
105
|
+
minWidth: {
|
|
106
|
+
type: NumberConstructor;
|
|
107
|
+
default: number;
|
|
108
|
+
};
|
|
109
|
+
minHeight: {
|
|
110
|
+
type: NumberConstructor;
|
|
111
|
+
default: number;
|
|
112
|
+
};
|
|
113
|
+
title: {
|
|
114
|
+
type: StringConstructor;
|
|
115
|
+
default: string;
|
|
116
|
+
};
|
|
117
|
+
width: {
|
|
118
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
119
|
+
default: string;
|
|
120
|
+
};
|
|
121
|
+
alignCenter: BooleanConstructor;
|
|
122
|
+
appendTo: {
|
|
123
|
+
type: PropType<string | HTMLElement>;
|
|
124
|
+
default: undefined;
|
|
125
|
+
};
|
|
126
|
+
beforeClose: {
|
|
127
|
+
type: PropType<CtcDialogBeforeClose>;
|
|
128
|
+
default: undefined;
|
|
129
|
+
};
|
|
130
|
+
closeDelay: NumberConstructor;
|
|
131
|
+
closeOnClickModal: BooleanConstructor;
|
|
132
|
+
closeOnPressEscape: BooleanConstructor;
|
|
133
|
+
destroyOnClose: BooleanConstructor;
|
|
134
|
+
draggable: BooleanConstructor;
|
|
135
|
+
lockScroll: BooleanConstructor;
|
|
136
|
+
modal: {
|
|
137
|
+
type: BooleanConstructor;
|
|
138
|
+
default: boolean;
|
|
139
|
+
};
|
|
140
|
+
modalClass: {
|
|
141
|
+
type: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
142
|
+
default: undefined;
|
|
143
|
+
};
|
|
144
|
+
openDelay: NumberConstructor;
|
|
145
|
+
overflow: BooleanConstructor;
|
|
146
|
+
showClose: {
|
|
147
|
+
type: BooleanConstructor;
|
|
148
|
+
default: boolean;
|
|
149
|
+
};
|
|
150
|
+
top: StringConstructor;
|
|
151
|
+
trapFocus: BooleanConstructor;
|
|
152
|
+
zIndex: NumberConstructor;
|
|
153
|
+
}>> & Readonly<{
|
|
154
|
+
onResize?: ((payload: {
|
|
155
|
+
width: number;
|
|
156
|
+
height: number;
|
|
157
|
+
}) => any) | undefined;
|
|
158
|
+
onOpen?: (() => any) | undefined;
|
|
159
|
+
onClose?: (() => any) | undefined;
|
|
160
|
+
"onUpdate:fullscreen"?: ((value: boolean) => any) | undefined;
|
|
161
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
162
|
+
onOpened?: (() => any) | undefined;
|
|
163
|
+
onClosed?: (() => any) | undefined;
|
|
164
|
+
}>, {
|
|
165
|
+
minHeight: number;
|
|
166
|
+
minWidth: number;
|
|
167
|
+
width: string | number;
|
|
168
|
+
overflow: boolean;
|
|
169
|
+
title: string;
|
|
170
|
+
alignCenter: boolean;
|
|
171
|
+
appendTo: string | HTMLElement;
|
|
172
|
+
beforeClose: DialogBeforeCloseFn;
|
|
173
|
+
closeOnClickModal: boolean;
|
|
174
|
+
closeOnPressEscape: boolean;
|
|
175
|
+
destroyOnClose: boolean;
|
|
176
|
+
draggable: boolean;
|
|
177
|
+
lockScroll: boolean;
|
|
178
|
+
modal: boolean;
|
|
179
|
+
modalClass: string | Record<string, any> | unknown[];
|
|
180
|
+
showClose: boolean;
|
|
181
|
+
trapFocus: boolean;
|
|
182
|
+
modelValue: boolean;
|
|
183
|
+
fullscreen: boolean;
|
|
184
|
+
resizable: boolean;
|
|
185
|
+
showFullscreen: boolean;
|
|
186
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
187
|
+
|
|
188
|
+
declare const __VLS_component_2: DefineComponent<ExtractPropTypes< {
|
|
189
|
+
modelValue: {
|
|
190
|
+
type: BooleanConstructor;
|
|
191
|
+
default: boolean;
|
|
192
|
+
};
|
|
193
|
+
fullscreen: {
|
|
194
|
+
type: BooleanConstructor;
|
|
195
|
+
default: boolean;
|
|
196
|
+
};
|
|
197
|
+
showFullscreen: {
|
|
198
|
+
type: BooleanConstructor;
|
|
199
|
+
default: boolean;
|
|
200
|
+
};
|
|
201
|
+
title: {
|
|
202
|
+
type: StringConstructor;
|
|
203
|
+
default: string;
|
|
204
|
+
};
|
|
205
|
+
size: {
|
|
206
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
207
|
+
default: string;
|
|
208
|
+
};
|
|
209
|
+
direction: {
|
|
210
|
+
type: PropType<"rtl" | "ltr" | "ttb" | "btt">;
|
|
211
|
+
default: string;
|
|
212
|
+
};
|
|
213
|
+
appendTo: {
|
|
214
|
+
type: PropType<string | HTMLElement>;
|
|
215
|
+
default: undefined;
|
|
216
|
+
};
|
|
217
|
+
beforeClose: {
|
|
218
|
+
type: PropType<CtcDialogBeforeClose>;
|
|
219
|
+
default: undefined;
|
|
220
|
+
};
|
|
221
|
+
closeOnClickModal: BooleanConstructor;
|
|
222
|
+
closeOnPressEscape: BooleanConstructor;
|
|
223
|
+
destroyOnClose: BooleanConstructor;
|
|
224
|
+
lockScroll: BooleanConstructor;
|
|
225
|
+
modal: {
|
|
226
|
+
type: BooleanConstructor;
|
|
227
|
+
default: boolean;
|
|
228
|
+
};
|
|
229
|
+
modalClass: {
|
|
230
|
+
type: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
231
|
+
default: undefined;
|
|
232
|
+
};
|
|
233
|
+
showClose: {
|
|
234
|
+
type: BooleanConstructor;
|
|
235
|
+
default: boolean;
|
|
236
|
+
};
|
|
237
|
+
zIndex: NumberConstructor;
|
|
238
|
+
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
239
|
+
open: () => any;
|
|
240
|
+
close: () => any;
|
|
241
|
+
"update:fullscreen": (value: boolean) => any;
|
|
242
|
+
"update:modelValue": (value: boolean) => any;
|
|
243
|
+
opened: () => any;
|
|
244
|
+
closed: () => any;
|
|
245
|
+
}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
246
|
+
modelValue: {
|
|
247
|
+
type: BooleanConstructor;
|
|
248
|
+
default: boolean;
|
|
249
|
+
};
|
|
250
|
+
fullscreen: {
|
|
251
|
+
type: BooleanConstructor;
|
|
252
|
+
default: boolean;
|
|
253
|
+
};
|
|
254
|
+
showFullscreen: {
|
|
255
|
+
type: BooleanConstructor;
|
|
256
|
+
default: boolean;
|
|
257
|
+
};
|
|
258
|
+
title: {
|
|
259
|
+
type: StringConstructor;
|
|
260
|
+
default: string;
|
|
261
|
+
};
|
|
262
|
+
size: {
|
|
263
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
264
|
+
default: string;
|
|
265
|
+
};
|
|
266
|
+
direction: {
|
|
267
|
+
type: PropType<"rtl" | "ltr" | "ttb" | "btt">;
|
|
268
|
+
default: string;
|
|
269
|
+
};
|
|
270
|
+
appendTo: {
|
|
271
|
+
type: PropType<string | HTMLElement>;
|
|
272
|
+
default: undefined;
|
|
273
|
+
};
|
|
274
|
+
beforeClose: {
|
|
275
|
+
type: PropType<CtcDialogBeforeClose>;
|
|
276
|
+
default: undefined;
|
|
277
|
+
};
|
|
278
|
+
closeOnClickModal: BooleanConstructor;
|
|
279
|
+
closeOnPressEscape: BooleanConstructor;
|
|
280
|
+
destroyOnClose: BooleanConstructor;
|
|
281
|
+
lockScroll: BooleanConstructor;
|
|
282
|
+
modal: {
|
|
283
|
+
type: BooleanConstructor;
|
|
284
|
+
default: boolean;
|
|
285
|
+
};
|
|
286
|
+
modalClass: {
|
|
287
|
+
type: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
288
|
+
default: undefined;
|
|
289
|
+
};
|
|
290
|
+
showClose: {
|
|
291
|
+
type: BooleanConstructor;
|
|
292
|
+
default: boolean;
|
|
293
|
+
};
|
|
294
|
+
zIndex: NumberConstructor;
|
|
295
|
+
}>> & Readonly<{
|
|
296
|
+
onOpen?: (() => any) | undefined;
|
|
297
|
+
onClose?: (() => any) | undefined;
|
|
298
|
+
"onUpdate:fullscreen"?: ((value: boolean) => any) | undefined;
|
|
299
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
300
|
+
onOpened?: (() => any) | undefined;
|
|
301
|
+
onClosed?: (() => any) | undefined;
|
|
302
|
+
}>, {
|
|
303
|
+
direction: "ltr" | "rtl" | "ttb" | "btt";
|
|
304
|
+
title: string;
|
|
305
|
+
size: string | number;
|
|
306
|
+
appendTo: string | HTMLElement;
|
|
307
|
+
beforeClose: DialogBeforeCloseFn;
|
|
308
|
+
closeOnClickModal: boolean;
|
|
309
|
+
closeOnPressEscape: boolean;
|
|
310
|
+
destroyOnClose: boolean;
|
|
311
|
+
lockScroll: boolean;
|
|
312
|
+
modal: boolean;
|
|
313
|
+
modalClass: string | Record<string, any> | unknown[];
|
|
314
|
+
showClose: boolean;
|
|
315
|
+
modelValue: boolean;
|
|
316
|
+
fullscreen: boolean;
|
|
317
|
+
showFullscreen: boolean;
|
|
318
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
319
|
+
|
|
320
|
+
declare const __VLS_component_3: DefineComponent<CtcFlexProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<CtcFlexProps> & Readonly<{}>, {
|
|
321
|
+
direction: CtcFlexDirection;
|
|
322
|
+
fill: boolean;
|
|
323
|
+
gap: number | string;
|
|
324
|
+
scroll: CtcFlexScroll;
|
|
325
|
+
justify: string;
|
|
326
|
+
grow: number | string;
|
|
327
|
+
align: string;
|
|
328
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
329
|
+
|
|
330
|
+
declare function __VLS_template(): {
|
|
331
|
+
attrs: Partial<{}>;
|
|
332
|
+
slots: {
|
|
333
|
+
header?(_: {}): any;
|
|
334
|
+
default?(_: {}): any;
|
|
335
|
+
footer?(_: {}): any;
|
|
336
|
+
};
|
|
337
|
+
refs: {};
|
|
338
|
+
rootEl: any;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
declare function __VLS_template_2(): {
|
|
342
|
+
attrs: Partial<{}>;
|
|
343
|
+
slots: {
|
|
344
|
+
header?(_: {}): any;
|
|
345
|
+
default?(_: {}): any;
|
|
346
|
+
footer?(_: {}): any;
|
|
347
|
+
};
|
|
348
|
+
refs: {};
|
|
349
|
+
rootEl: any;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
declare function __VLS_template_3(): {
|
|
353
|
+
attrs: Partial<{}>;
|
|
354
|
+
slots: {
|
|
355
|
+
default?(_: {}): any;
|
|
356
|
+
};
|
|
357
|
+
refs: {};
|
|
358
|
+
rootEl: HTMLDivElement;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
362
|
+
|
|
363
|
+
declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
|
|
364
|
+
|
|
365
|
+
declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
|
|
366
|
+
|
|
367
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
368
|
+
new (): {
|
|
369
|
+
$slots: S;
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
declare type __VLS_WithTemplateSlots_2<T, S> = T & {
|
|
374
|
+
new (): {
|
|
375
|
+
$slots: S;
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
declare type __VLS_WithTemplateSlots_3<T, S> = T & {
|
|
380
|
+
new (): {
|
|
381
|
+
$slots: S;
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
declare const CtcComponentsUi: Plugin_2;
|
|
386
|
+
export { CtcComponentsUi }
|
|
387
|
+
export default CtcComponentsUi;
|
|
388
|
+
|
|
389
|
+
export declare const CtcDialog: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
390
|
+
|
|
391
|
+
export declare type CtcDialogBeforeClose = DialogBeforeCloseFn;
|
|
392
|
+
|
|
393
|
+
export declare interface CtcDialogProps extends DialogForwardedProps {
|
|
394
|
+
modelValue?: boolean;
|
|
395
|
+
fullscreen?: boolean;
|
|
396
|
+
minHeight?: number;
|
|
397
|
+
minWidth?: number;
|
|
398
|
+
resizable?: boolean;
|
|
399
|
+
showFullscreen?: boolean;
|
|
400
|
+
title?: string;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export declare const CtcDrawer: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
|
|
404
|
+
|
|
405
|
+
export declare interface CtcDrawerProps extends DrawerForwardedProps {
|
|
406
|
+
modelValue?: boolean;
|
|
407
|
+
fullscreen?: boolean;
|
|
408
|
+
showFullscreen?: boolean;
|
|
409
|
+
title?: string;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export declare const CtcFlex: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
413
|
+
|
|
414
|
+
export declare type CtcFlexDirection = 'row' | 'column';
|
|
415
|
+
|
|
416
|
+
export declare interface CtcFlexProps {
|
|
417
|
+
direction?: CtcFlexDirection;
|
|
418
|
+
fill?: boolean;
|
|
419
|
+
grow?: number | string;
|
|
420
|
+
justify?: string;
|
|
421
|
+
align?: string;
|
|
422
|
+
gap?: number | string;
|
|
423
|
+
scroll?: CtcFlexScroll;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export declare type CtcFlexScroll = boolean | 'x' | 'y';
|
|
427
|
+
|
|
428
|
+
declare type DialogForwardedProps = Pick<DialogProps, 'alignCenter' | 'appendTo' | 'beforeClose' | 'closeDelay' | 'closeOnClickModal' | 'closeOnPressEscape' | 'destroyOnClose' | 'draggable' | 'lockScroll' | 'modal' | 'modalClass' | 'openDelay' | 'overflow' | 'showClose' | 'top' | 'trapFocus' | 'width' | 'zIndex'>;
|
|
429
|
+
|
|
430
|
+
declare type DrawerForwardedProps = Pick<DrawerProps, 'appendTo' | 'beforeClose' | 'closeOnClickModal' | 'closeOnPressEscape' | 'destroyOnClose' | 'direction' | 'lockScroll' | 'modal' | 'modalClass' | 'showClose' | 'size' | 'zIndex'>;
|
|
431
|
+
|
|
432
|
+
export { }
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createSlots as a, createVNode as o, defineComponent as s, mergeProps as c, normalizeClass as l, normalizeStyle as u, onBeforeUnmount as d, openBlock as f, ref as p, renderSlot as m, toDisplayString as h, unref as g, useAttrs as _, useSlots as v, withCtx as y } from "vue";
|
|
2
|
+
import { ElDialog as b, ElDrawer as x, ElIcon as S } from "element-plus";
|
|
3
|
+
//#region node_modules/.pnpm/@element-plus+icons-vue@2.3.2_vue@3.5.41_typescript@5.8.3_/node_modules/@element-plus/icons-vue/dist/index.js
|
|
4
|
+
var C = /* @__PURE__ */ s({
|
|
5
|
+
name: "Close",
|
|
6
|
+
__name: "close",
|
|
7
|
+
setup(e) {
|
|
8
|
+
return (e, t) => (f(), r("svg", {
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
viewBox: "0 0 1024 1024"
|
|
11
|
+
}, [i("path", {
|
|
12
|
+
fill: "currentColor",
|
|
13
|
+
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
|
|
14
|
+
})]));
|
|
15
|
+
}
|
|
16
|
+
}), w = /* @__PURE__ */ s({
|
|
17
|
+
name: "FullScreen",
|
|
18
|
+
__name: "full-screen",
|
|
19
|
+
setup(e) {
|
|
20
|
+
return (e, t) => (f(), r("svg", {
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
viewBox: "0 0 1024 1024"
|
|
23
|
+
}, [i("path", {
|
|
24
|
+
fill: "currentColor",
|
|
25
|
+
d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
|
|
26
|
+
})]));
|
|
27
|
+
}
|
|
28
|
+
}), T = /* @__PURE__ */ s({
|
|
29
|
+
name: "Minus",
|
|
30
|
+
__name: "minus",
|
|
31
|
+
setup(e) {
|
|
32
|
+
return (e, t) => (f(), r("svg", {
|
|
33
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34
|
+
viewBox: "0 0 1024 1024"
|
|
35
|
+
}, [i("path", {
|
|
36
|
+
fill: "currentColor",
|
|
37
|
+
d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"
|
|
38
|
+
})]));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/dialog/src/useFullscreen.ts
|
|
43
|
+
function E(t, n) {
|
|
44
|
+
let r = e(() => t.fullscreen ?? !1);
|
|
45
|
+
function i() {
|
|
46
|
+
n("update:fullscreen", !r.value);
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
isFullscreen: r,
|
|
50
|
+
toggleFullscreen: i
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/components/dialog/src/useResizable.ts
|
|
55
|
+
function D(e, t, n) {
|
|
56
|
+
return Math.min(Math.max(e, t), n);
|
|
57
|
+
}
|
|
58
|
+
function O(e, t) {
|
|
59
|
+
let n = p(!1), r = p({}), i = () => {};
|
|
60
|
+
function a() {
|
|
61
|
+
i(), i = () => {};
|
|
62
|
+
}
|
|
63
|
+
function o(o) {
|
|
64
|
+
if (!e.resizable || o.button !== 0) return;
|
|
65
|
+
let s = o.currentTarget.closest(".ctc-dialog");
|
|
66
|
+
if (!s) return;
|
|
67
|
+
o.preventDefault(), a();
|
|
68
|
+
let c = s.getBoundingClientRect(), l = e.minWidth ?? 400, u = e.minHeight ?? 240, d = Math.max(l, window.innerWidth - c.left - 32), f = Math.max(u, window.innerHeight - c.top - 32), p = o.clientX, m = o.clientY;
|
|
69
|
+
function h(e) {
|
|
70
|
+
let i = Math.round(D(c.width + e.clientX - p, l, d)), a = Math.round(D(c.height + e.clientY - m, u, f));
|
|
71
|
+
n.value = !0, r.value = {
|
|
72
|
+
height: `${a}px`,
|
|
73
|
+
width: `${i}px`
|
|
74
|
+
}, t("resize", {
|
|
75
|
+
width: i,
|
|
76
|
+
height: a
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function g() {
|
|
80
|
+
a();
|
|
81
|
+
}
|
|
82
|
+
window.addEventListener("pointermove", h), window.addEventListener("pointerup", g, { once: !0 }), i = () => {
|
|
83
|
+
window.removeEventListener("pointermove", h), window.removeEventListener("pointerup", g);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return d(a), {
|
|
87
|
+
isResized: n,
|
|
88
|
+
resizeStyle: r,
|
|
89
|
+
startResize: o
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/components/dialog/src/index.vue?vue&type=script&setup=true&lang.ts
|
|
94
|
+
var k = { class: "ctc-dialog__header-content" }, A = { class: "ctc-dialog__title" }, j = { class: "ctc-dialog__header-actions" }, M = ["aria-label", "title"], N = { class: "ctc-dialog__content" }, P = /* @__PURE__ */ s({
|
|
95
|
+
name: "CtcDialog",
|
|
96
|
+
inheritAttrs: !1,
|
|
97
|
+
__name: "index",
|
|
98
|
+
props: {
|
|
99
|
+
modelValue: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: !1
|
|
102
|
+
},
|
|
103
|
+
fullscreen: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: !1
|
|
106
|
+
},
|
|
107
|
+
showFullscreen: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: !1
|
|
110
|
+
},
|
|
111
|
+
resizable: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: !1
|
|
114
|
+
},
|
|
115
|
+
minWidth: {
|
|
116
|
+
type: Number,
|
|
117
|
+
default: 400
|
|
118
|
+
},
|
|
119
|
+
minHeight: {
|
|
120
|
+
type: Number,
|
|
121
|
+
default: 240
|
|
122
|
+
},
|
|
123
|
+
title: {
|
|
124
|
+
type: String,
|
|
125
|
+
default: ""
|
|
126
|
+
},
|
|
127
|
+
width: {
|
|
128
|
+
type: [String, Number],
|
|
129
|
+
default: "640px"
|
|
130
|
+
},
|
|
131
|
+
alignCenter: Boolean,
|
|
132
|
+
appendTo: {
|
|
133
|
+
type: [String, Object],
|
|
134
|
+
default: void 0
|
|
135
|
+
},
|
|
136
|
+
beforeClose: {
|
|
137
|
+
type: Function,
|
|
138
|
+
default: void 0
|
|
139
|
+
},
|
|
140
|
+
closeDelay: Number,
|
|
141
|
+
closeOnClickModal: Boolean,
|
|
142
|
+
closeOnPressEscape: Boolean,
|
|
143
|
+
destroyOnClose: Boolean,
|
|
144
|
+
draggable: Boolean,
|
|
145
|
+
lockScroll: Boolean,
|
|
146
|
+
modal: {
|
|
147
|
+
type: Boolean,
|
|
148
|
+
default: !0
|
|
149
|
+
},
|
|
150
|
+
modalClass: {
|
|
151
|
+
type: [
|
|
152
|
+
String,
|
|
153
|
+
Array,
|
|
154
|
+
Object
|
|
155
|
+
],
|
|
156
|
+
default: void 0
|
|
157
|
+
},
|
|
158
|
+
openDelay: Number,
|
|
159
|
+
overflow: Boolean,
|
|
160
|
+
showClose: {
|
|
161
|
+
type: Boolean,
|
|
162
|
+
default: !0
|
|
163
|
+
},
|
|
164
|
+
top: String,
|
|
165
|
+
trapFocus: Boolean,
|
|
166
|
+
zIndex: Number
|
|
167
|
+
},
|
|
168
|
+
emits: [
|
|
169
|
+
"update:modelValue",
|
|
170
|
+
"update:fullscreen",
|
|
171
|
+
"resize",
|
|
172
|
+
"open",
|
|
173
|
+
"opened",
|
|
174
|
+
"close",
|
|
175
|
+
"closed"
|
|
176
|
+
],
|
|
177
|
+
setup(s, { emit: l }) {
|
|
178
|
+
let u = s, d = l, p = _(), x = v(), { isFullscreen: D, toggleFullscreen: P } = E(u, d), { isResized: F, resizeStyle: I, startResize: L } = O(u, d), R = e(() => D.value ? {} : I.value), z = e(() => F.value && !D.value);
|
|
179
|
+
function B(e) {
|
|
180
|
+
d("update:modelValue", e);
|
|
181
|
+
}
|
|
182
|
+
function V() {
|
|
183
|
+
if (u.beforeClose) {
|
|
184
|
+
u.beforeClose((e) => {
|
|
185
|
+
e || d("update:modelValue", !1);
|
|
186
|
+
});
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
d("update:modelValue", !1);
|
|
190
|
+
}
|
|
191
|
+
return (e, l) => (f(), t(g(b), c(g(p), {
|
|
192
|
+
class: ["ctc-dialog", {
|
|
193
|
+
"ctc-dialog--resizable": s.resizable,
|
|
194
|
+
"ctc-dialog--resized": z.value
|
|
195
|
+
}],
|
|
196
|
+
style: R.value,
|
|
197
|
+
"model-value": s.modelValue,
|
|
198
|
+
fullscreen: g(D),
|
|
199
|
+
title: s.title,
|
|
200
|
+
width: s.width,
|
|
201
|
+
"align-center": s.alignCenter,
|
|
202
|
+
"append-to": s.appendTo,
|
|
203
|
+
"before-close": s.beforeClose,
|
|
204
|
+
"close-delay": s.closeDelay,
|
|
205
|
+
"close-on-click-modal": s.closeOnClickModal,
|
|
206
|
+
"close-on-press-escape": s.closeOnPressEscape,
|
|
207
|
+
"destroy-on-close": s.destroyOnClose,
|
|
208
|
+
draggable: s.draggable,
|
|
209
|
+
"lock-scroll": s.lockScroll,
|
|
210
|
+
modal: s.modal,
|
|
211
|
+
"modal-class": s.modalClass,
|
|
212
|
+
"open-delay": s.openDelay,
|
|
213
|
+
overflow: s.overflow,
|
|
214
|
+
"show-close": !1,
|
|
215
|
+
top: s.top,
|
|
216
|
+
"trap-focus": s.trapFocus,
|
|
217
|
+
"z-index": s.zIndex,
|
|
218
|
+
"header-class": "ctc-dialog__header",
|
|
219
|
+
"body-class": "ctc-dialog__body",
|
|
220
|
+
"footer-class": "ctc-dialog__footer",
|
|
221
|
+
"onUpdate:modelValue": B,
|
|
222
|
+
onOpen: l[2] ||= (e) => d("open"),
|
|
223
|
+
onOpened: l[3] ||= (e) => d("opened"),
|
|
224
|
+
onClose: l[4] ||= (e) => d("close"),
|
|
225
|
+
onClosed: l[5] ||= (e) => d("closed")
|
|
226
|
+
}), a({
|
|
227
|
+
header: y(() => [i("div", k, [m(e.$slots, "header", {}, () => [i("span", A, h(s.title), 1)])]), i("div", j, [s.showFullscreen ? (f(), r("button", {
|
|
228
|
+
key: 0,
|
|
229
|
+
class: "ctc-dialog__fullscreen-toggle",
|
|
230
|
+
type: "button",
|
|
231
|
+
"aria-label": g(D) ? "退出全屏" : "全屏显示",
|
|
232
|
+
title: g(D) ? "退出全屏" : "全屏显示",
|
|
233
|
+
"data-ctc-fullscreen-toggle": "",
|
|
234
|
+
onClick: l[0] ||= (...e) => g(P) && g(P)(...e)
|
|
235
|
+
}, [o(g(S), { "aria-hidden": "true" }, {
|
|
236
|
+
default: y(() => [g(D) ? (f(), t(g(T), { key: 0 })) : (f(), t(g(w), { key: 1 }))]),
|
|
237
|
+
_: 1
|
|
238
|
+
})], 8, M)) : n("", !0), s.showClose ? (f(), r("button", {
|
|
239
|
+
key: 1,
|
|
240
|
+
class: "ctc-dialog__close",
|
|
241
|
+
type: "button",
|
|
242
|
+
"aria-label": "关闭弹窗",
|
|
243
|
+
title: "关闭",
|
|
244
|
+
"data-ctc-close": "",
|
|
245
|
+
onClick: V
|
|
246
|
+
}, [o(g(S), { "aria-hidden": "true" }, {
|
|
247
|
+
default: y(() => [o(g(C))]),
|
|
248
|
+
_: 1
|
|
249
|
+
})])) : n("", !0)])]),
|
|
250
|
+
default: y(() => [i("div", N, [m(e.$slots, "default")]), s.resizable && !g(D) ? (f(), r("div", {
|
|
251
|
+
key: 0,
|
|
252
|
+
class: "ctc-dialog__resize-handle",
|
|
253
|
+
"aria-hidden": "true",
|
|
254
|
+
"data-ctc-resize-handle": "",
|
|
255
|
+
onPointerdown: l[1] ||= (...e) => g(L) && g(L)(...e)
|
|
256
|
+
}, null, 32)) : n("", !0)]),
|
|
257
|
+
_: 2
|
|
258
|
+
}, [g(x).footer ? {
|
|
259
|
+
name: "footer",
|
|
260
|
+
fn: y(() => [m(e.$slots, "footer")]),
|
|
261
|
+
key: "0"
|
|
262
|
+
} : void 0]), 1040, [
|
|
263
|
+
"class",
|
|
264
|
+
"style",
|
|
265
|
+
"model-value",
|
|
266
|
+
"fullscreen",
|
|
267
|
+
"title",
|
|
268
|
+
"width",
|
|
269
|
+
"align-center",
|
|
270
|
+
"append-to",
|
|
271
|
+
"before-close",
|
|
272
|
+
"close-delay",
|
|
273
|
+
"close-on-click-modal",
|
|
274
|
+
"close-on-press-escape",
|
|
275
|
+
"destroy-on-close",
|
|
276
|
+
"draggable",
|
|
277
|
+
"lock-scroll",
|
|
278
|
+
"modal",
|
|
279
|
+
"modal-class",
|
|
280
|
+
"open-delay",
|
|
281
|
+
"overflow",
|
|
282
|
+
"top",
|
|
283
|
+
"trap-focus",
|
|
284
|
+
"z-index"
|
|
285
|
+
]));
|
|
286
|
+
}
|
|
287
|
+
}), F = { class: "ctc-drawer__header-content" }, I = { class: "ctc-drawer__title" }, L = { class: "ctc-drawer__header-actions" }, R = ["aria-label", "title"], z = { class: "ctc-drawer__content" }, B = {
|
|
288
|
+
key: 0,
|
|
289
|
+
class: "ctc-drawer__footer"
|
|
290
|
+
}, V = /* @__PURE__ */ s({
|
|
291
|
+
name: "CtcDrawer",
|
|
292
|
+
inheritAttrs: !1,
|
|
293
|
+
__name: "index",
|
|
294
|
+
props: {
|
|
295
|
+
modelValue: {
|
|
296
|
+
type: Boolean,
|
|
297
|
+
default: !1
|
|
298
|
+
},
|
|
299
|
+
fullscreen: {
|
|
300
|
+
type: Boolean,
|
|
301
|
+
default: !1
|
|
302
|
+
},
|
|
303
|
+
showFullscreen: {
|
|
304
|
+
type: Boolean,
|
|
305
|
+
default: !1
|
|
306
|
+
},
|
|
307
|
+
title: {
|
|
308
|
+
type: String,
|
|
309
|
+
default: ""
|
|
310
|
+
},
|
|
311
|
+
size: {
|
|
312
|
+
type: [String, Number],
|
|
313
|
+
default: "480px"
|
|
314
|
+
},
|
|
315
|
+
direction: {
|
|
316
|
+
type: String,
|
|
317
|
+
default: "rtl"
|
|
318
|
+
},
|
|
319
|
+
appendTo: {
|
|
320
|
+
type: [String, Object],
|
|
321
|
+
default: void 0
|
|
322
|
+
},
|
|
323
|
+
beforeClose: {
|
|
324
|
+
type: Function,
|
|
325
|
+
default: void 0
|
|
326
|
+
},
|
|
327
|
+
closeOnClickModal: Boolean,
|
|
328
|
+
closeOnPressEscape: Boolean,
|
|
329
|
+
destroyOnClose: Boolean,
|
|
330
|
+
lockScroll: Boolean,
|
|
331
|
+
modal: {
|
|
332
|
+
type: Boolean,
|
|
333
|
+
default: !0
|
|
334
|
+
},
|
|
335
|
+
modalClass: {
|
|
336
|
+
type: [
|
|
337
|
+
String,
|
|
338
|
+
Array,
|
|
339
|
+
Object
|
|
340
|
+
],
|
|
341
|
+
default: void 0
|
|
342
|
+
},
|
|
343
|
+
showClose: {
|
|
344
|
+
type: Boolean,
|
|
345
|
+
default: !0
|
|
346
|
+
},
|
|
347
|
+
zIndex: Number
|
|
348
|
+
},
|
|
349
|
+
emits: [
|
|
350
|
+
"update:modelValue",
|
|
351
|
+
"update:fullscreen",
|
|
352
|
+
"open",
|
|
353
|
+
"opened",
|
|
354
|
+
"close",
|
|
355
|
+
"closed"
|
|
356
|
+
],
|
|
357
|
+
setup(a, { emit: s }) {
|
|
358
|
+
let u = a, d = s, p = _(), b = v(), { isFullscreen: D, toggleFullscreen: O } = E(u, d), k = e(() => D.value ? "100%" : u.size);
|
|
359
|
+
function A(e) {
|
|
360
|
+
d("update:modelValue", e);
|
|
361
|
+
}
|
|
362
|
+
function j() {
|
|
363
|
+
if (u.beforeClose) {
|
|
364
|
+
u.beforeClose((e) => {
|
|
365
|
+
e || d("update:modelValue", !1);
|
|
366
|
+
});
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
d("update:modelValue", !1);
|
|
370
|
+
}
|
|
371
|
+
return (e, s) => (f(), t(g(x), c(g(p), {
|
|
372
|
+
class: ["ctc-drawer", { "is-fullscreen": g(D) }],
|
|
373
|
+
"model-value": a.modelValue,
|
|
374
|
+
"append-to": a.appendTo,
|
|
375
|
+
"before-close": a.beforeClose,
|
|
376
|
+
"close-on-click-modal": a.closeOnClickModal,
|
|
377
|
+
"close-on-press-escape": a.closeOnPressEscape,
|
|
378
|
+
"destroy-on-close": a.destroyOnClose,
|
|
379
|
+
direction: a.direction,
|
|
380
|
+
"lock-scroll": a.lockScroll,
|
|
381
|
+
modal: a.modal,
|
|
382
|
+
"modal-class": a.modalClass,
|
|
383
|
+
"show-close": !1,
|
|
384
|
+
size: k.value,
|
|
385
|
+
"z-index": a.zIndex,
|
|
386
|
+
"header-class": "ctc-drawer__header",
|
|
387
|
+
"body-class": "ctc-drawer__body",
|
|
388
|
+
"onUpdate:modelValue": A,
|
|
389
|
+
onOpen: s[1] ||= (e) => d("open"),
|
|
390
|
+
onOpened: s[2] ||= (e) => d("opened"),
|
|
391
|
+
onClose: s[3] ||= (e) => d("close"),
|
|
392
|
+
onClosed: s[4] ||= (e) => d("closed")
|
|
393
|
+
}), {
|
|
394
|
+
header: y(() => [i("div", F, [m(e.$slots, "header", {}, () => [i("span", I, h(a.title), 1)])]), i("div", L, [a.showFullscreen ? (f(), r("button", {
|
|
395
|
+
key: 0,
|
|
396
|
+
class: "ctc-drawer__fullscreen-toggle",
|
|
397
|
+
type: "button",
|
|
398
|
+
"aria-label": g(D) ? "退出全屏" : "全屏显示",
|
|
399
|
+
title: g(D) ? "退出全屏" : "全屏显示",
|
|
400
|
+
"data-ctc-fullscreen-toggle": "",
|
|
401
|
+
onClick: s[0] ||= (...e) => g(O) && g(O)(...e)
|
|
402
|
+
}, [o(g(S), { "aria-hidden": "true" }, {
|
|
403
|
+
default: y(() => [g(D) ? (f(), t(g(T), { key: 0 })) : (f(), t(g(w), { key: 1 }))]),
|
|
404
|
+
_: 1
|
|
405
|
+
})], 8, R)) : n("", !0), a.showClose ? (f(), r("button", {
|
|
406
|
+
key: 1,
|
|
407
|
+
class: "ctc-drawer__close",
|
|
408
|
+
type: "button",
|
|
409
|
+
"aria-label": "关闭抽屉",
|
|
410
|
+
title: "关闭",
|
|
411
|
+
"data-ctc-close": "",
|
|
412
|
+
onClick: j
|
|
413
|
+
}, [o(g(S), { "aria-hidden": "true" }, {
|
|
414
|
+
default: y(() => [o(g(C))]),
|
|
415
|
+
_: 1
|
|
416
|
+
})])) : n("", !0)])]),
|
|
417
|
+
default: y(() => [i("div", { class: l(["ctc-drawer__layout", { "has-footer": g(b).footer }]) }, [i("div", z, [m(e.$slots, "default")]), g(b).footer ? (f(), r("div", B, [m(e.$slots, "footer")])) : n("", !0)], 2)]),
|
|
418
|
+
_: 3
|
|
419
|
+
}, 16, [
|
|
420
|
+
"class",
|
|
421
|
+
"model-value",
|
|
422
|
+
"append-to",
|
|
423
|
+
"before-close",
|
|
424
|
+
"close-on-click-modal",
|
|
425
|
+
"close-on-press-escape",
|
|
426
|
+
"destroy-on-close",
|
|
427
|
+
"direction",
|
|
428
|
+
"lock-scroll",
|
|
429
|
+
"modal",
|
|
430
|
+
"modal-class",
|
|
431
|
+
"size",
|
|
432
|
+
"z-index"
|
|
433
|
+
]));
|
|
434
|
+
}
|
|
435
|
+
}), H = /* @__PURE__ */ s({
|
|
436
|
+
name: "CtcFlex",
|
|
437
|
+
__name: "index",
|
|
438
|
+
props: {
|
|
439
|
+
direction: { default: "column" },
|
|
440
|
+
fill: {
|
|
441
|
+
type: Boolean,
|
|
442
|
+
default: !1
|
|
443
|
+
},
|
|
444
|
+
grow: { default: 1 },
|
|
445
|
+
justify: { default: "flex-start" },
|
|
446
|
+
align: { default: "stretch" },
|
|
447
|
+
gap: { default: 0 },
|
|
448
|
+
scroll: {
|
|
449
|
+
type: [Boolean, String],
|
|
450
|
+
default: !1
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
setup(t) {
|
|
454
|
+
let n = t, i = e(() => {
|
|
455
|
+
let e = {
|
|
456
|
+
alignItems: n.align,
|
|
457
|
+
flexDirection: n.direction,
|
|
458
|
+
justifyContent: n.justify
|
|
459
|
+
};
|
|
460
|
+
return n.gap !== 0 && n.gap !== "" && (e.gap = typeof n.gap == "number" ? `${n.gap}px` : n.gap), n.fill && (e.flex = n.grow), n.direction === "column" ? e.minHeight = "0" : e.minWidth = "0", n.scroll === "x" ? (e.overflowX = "auto", e.overflowY = "hidden") : n.scroll === "y" ? (e.overflowX = "hidden", e.overflowY = "auto") : n.scroll && (e.overflow = "auto"), e;
|
|
461
|
+
});
|
|
462
|
+
return (e, t) => (f(), r("div", {
|
|
463
|
+
class: "ctc-flex",
|
|
464
|
+
style: u(i.value)
|
|
465
|
+
}, [m(e.$slots, "default")], 4));
|
|
466
|
+
}
|
|
467
|
+
}), U = [
|
|
468
|
+
P,
|
|
469
|
+
V,
|
|
470
|
+
H
|
|
471
|
+
], W = { install(e) {
|
|
472
|
+
U.forEach((t) => {
|
|
473
|
+
e.component(t.name ?? "", t);
|
|
474
|
+
});
|
|
475
|
+
} };
|
|
476
|
+
//#endregion
|
|
477
|
+
export { W as CtcComponentsUi, W as default, P as CtcDialog, V as CtcDrawer, H as CtcFlex };
|
package/dist/style.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
:root:not(.dark):not([data-ctc-theme]):not([data-ctc-theme-mode=inherit]),[data-ctc-theme=light]{--ctc-color-primary:#1f5eff;--ctc-color-primary-hover:#356fff;--ctc-color-primary-active:#1749c6;--ctc-color-primary-light-3:#5a87ff;--ctc-color-primary-light-5:#7da4ff;--ctc-color-primary-light-7:#a5c0ff;--ctc-color-primary-light-8:#bdcfff;--ctc-color-primary-light-9:#dce7ff;--ctc-color-page:#f8f8f8;--ctc-color-surface:#fff;--ctc-color-surface-elevated:#fff;--ctc-color-fill:#f3f5f9;--ctc-color-fill-light:#f7f8fb;--ctc-color-text:#2e3544;--ctc-color-text-secondary:#667085;--ctc-color-text-placeholder:#98a2b3;--ctc-color-border:#dbdfe7;--ctc-color-border-light:#e9ecf2;--ctc-color-mask:#1118277a;--ctc-radius-small:0;--ctc-radius-base:3px;--ctc-radius-large:0;--ctc-space-2:8px;--ctc-space-3:12px;--ctc-space-4:16px;--ctc-space-5:20px;--ctc-space-6:24px;--el-color-primary:var(--ctc-color-primary);--el-color-primary-dark-2:var(--ctc-color-primary-active);--el-color-primary-light-3:var(--ctc-color-primary-light-3);--el-color-primary-light-5:var(--ctc-color-primary-light-5);--el-color-primary-light-7:var(--ctc-color-primary-light-7);--el-color-primary-light-8:var(--ctc-color-primary-light-8);--el-color-primary-light-9:var(--ctc-color-primary-light-9);--el-bg-color:var(--ctc-color-surface);--el-bg-color-page:var(--ctc-color-page);--el-bg-color-overlay:var(--ctc-color-surface-elevated);--el-fill-color:var(--ctc-color-fill);--el-fill-color-light:var(--ctc-color-fill-light);--el-text-color-primary:var(--ctc-color-text);--el-text-color-regular:var(--ctc-color-text-secondary);--el-text-color-placeholder:var(--ctc-color-text-placeholder);--el-border-color:var(--ctc-color-border);--el-border-color-light:var(--ctc-color-border-light);--el-border-radius-small:var(--ctc-radius-small);--el-border-radius-base:var(--ctc-radius-base);--el-border-radius-round:999px;--el-mask-color:var(--ctc-color-mask)}html.dark:not([data-ctc-theme=light]):not([data-ctc-theme-mode=inherit]),[data-ctc-theme=dark]:not([data-ctc-theme-mode=inherit]){--ctc-color-primary:#4d7dff;--ctc-color-primary-hover:#6993ff;--ctc-color-primary-active:#3569e8;--ctc-color-primary-light-3:#6e94ff;--ctc-color-primary-light-5:#91aeff;--ctc-color-primary-light-7:#b1c5ff;--ctc-color-primary-light-8:#c5d4ff;--ctc-color-primary-light-9:#dde7ff;--ctc-color-page:#071326;--ctc-color-surface:#0e1d33;--ctc-color-surface-elevated:#142541;--ctc-color-fill:#1a2c48;--ctc-color-fill-light:#203552;--ctc-color-text:#f2f6ff;--ctc-color-text-secondary:#b6c2d9;--ctc-color-text-placeholder:#7f90ad;--ctc-color-border:#263955;--ctc-color-border-light:#304762;--ctc-color-mask:#000612b8;--ctc-radius-small:0;--ctc-radius-base:3px;--ctc-radius-large:0;--ctc-space-2:8px;--ctc-space-3:12px;--ctc-space-4:16px;--ctc-space-5:20px;--ctc-space-6:24px;--el-color-primary:var(--ctc-color-primary);--el-color-primary-dark-2:var(--ctc-color-primary-active);--el-color-primary-light-3:var(--ctc-color-primary-light-3);--el-color-primary-light-5:var(--ctc-color-primary-light-5);--el-color-primary-light-7:var(--ctc-color-primary-light-7);--el-color-primary-light-8:var(--ctc-color-primary-light-8);--el-color-primary-light-9:var(--ctc-color-primary-light-9);--el-bg-color:var(--ctc-color-surface);--el-bg-color-page:var(--ctc-color-page);--el-bg-color-overlay:var(--ctc-color-surface-elevated);--el-fill-color:var(--ctc-color-fill);--el-fill-color-light:var(--ctc-color-fill-light);--el-text-color-primary:var(--ctc-color-text);--el-text-color-regular:var(--ctc-color-text-secondary);--el-text-color-placeholder:var(--ctc-color-text-placeholder);--el-border-color:var(--ctc-color-border);--el-border-color-light:var(--ctc-color-border-light);--el-border-radius-small:var(--ctc-radius-small);--el-border-radius-base:var(--ctc-radius-base);--el-border-radius-round:999px;--el-mask-color:var(--ctc-color-mask)}[data-ctc-theme-mode=inherit]{--ctc-color-primary:var(--el-color-primary);--ctc-color-primary-hover:var(--el-color-primary-light-3);--ctc-color-primary-active:var(--el-color-primary-dark-2);--ctc-color-page:var(--el-bg-color-page);--ctc-color-surface:var(--el-bg-color);--ctc-color-surface-elevated:var(--el-bg-color-overlay);--ctc-color-fill:var(--el-fill-color);--ctc-color-fill-light:var(--el-fill-color-light);--ctc-color-text:var(--el-text-color-primary);--ctc-color-text-secondary:var(--el-text-color-regular);--ctc-color-text-placeholder:var(--el-text-color-placeholder);--ctc-color-border:var(--el-border-color);--ctc-color-border-light:var(--el-border-color-light);--ctc-color-mask:var(--el-mask-color);--ctc-radius-small:var(--el-border-radius-small);--ctc-radius-base:var(--el-border-radius-base);--ctc-radius-large:8px;--ctc-space-2:8px;--ctc-space-3:12px;--ctc-space-4:16px;--ctc-space-5:20px;--ctc-space-6:24px}.el-overlay{--el-overlay-color-lighter:var(--ctc-color-mask)}.ctc-dialog{--el-dialog-bg-color:var(--ctc-color-surface);--el-dialog-padding-primary:0;background:var(--ctc-color-surface);border:1px solid var(--ctc-color-border-light);border-radius:var(--ctc-radius-base);position:relative;overflow:hidden;box-shadow:0 18px 48px #0f172a29}.ctc-dialog.is-fullscreen{border-radius:0}.ctc-dialog__header{background:var(--ctc-color-surface);border-bottom:1px solid var(--ctc-color-border-light);box-sizing:border-box;color:var(--ctc-color-text);align-items:center;gap:var(--ctc-space-2);height:48px;padding:0 var(--ctc-space-6);margin:0;line-height:1;display:flex}.ctc-dialog__header-content{align-items:center;gap:var(--ctc-space-2);flex:1;min-width:0;display:flex}.ctc-dialog__header-actions{align-items:center;gap:4px;display:inline-flex}.ctc-dialog__fullscreen-toggle,.ctc-dialog__close{border-radius:var(--ctc-radius-small);color:var(--ctc-color-text-secondary);cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;width:28px;height:28px;padding:0;font-size:18px;transition:background-color .2s,color .2s;display:inline-flex}.ctc-dialog__title{text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:16px;font-weight:600;overflow:hidden}.ctc-dialog__fullscreen-toggle{font-size:16px}.ctc-dialog__fullscreen-toggle:hover,.ctc-dialog__close:hover{background:var(--ctc-color-fill);color:var(--ctc-color-primary)}.ctc-dialog__close{font-size:22px;font-weight:300;line-height:1}.ctc-dialog__body{box-sizing:border-box;max-height:calc(100vh - 144px);padding:0;overflow:auto}.ctc-dialog--resized{flex-direction:column;display:flex}.ctc-dialog--resized .ctc-dialog__body{flex:1;min-height:0;max-height:none}.ctc-dialog__content{box-sizing:border-box;padding:var(--ctc-space-6)}.ctc-dialog__footer{border-top:1px solid var(--ctc-color-border-light);box-sizing:border-box;min-height:64px;padding:var(--ctc-space-4) var(--ctc-space-6);justify-content:flex-end;align-items:center;display:flex}.ctc-dialog__resize-handle{cursor:nwse-resize;touch-action:none;z-index:1;width:18px;height:18px;position:absolute;bottom:0;right:0}.ctc-dialog__resize-handle:before{background:linear-gradient(135deg, transparent 0 46%, var(--ctc-color-border) 47% 53%, transparent 54% 100%);content:"";position:absolute;inset:4px}.ctc-drawer{--el-drawer-bg-color:var(--ctc-color-surface);background:var(--ctc-color-surface);color:var(--ctc-color-text)}.ctc-drawer.is-fullscreen{width:100%;height:100%}.ctc-drawer__header{background:var(--ctc-color-surface);border-bottom:1px solid var(--ctc-color-border-light);box-sizing:border-box;color:var(--ctc-color-text);align-items:center;gap:var(--ctc-space-2);height:48px;padding:0 var(--ctc-space-6);margin:0;display:flex}.ctc-drawer__title{text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:16px;font-weight:600;overflow:hidden}.ctc-drawer__header-content{flex:1;align-items:center;min-width:0;display:flex}.ctc-drawer__header-actions{align-items:center;gap:4px;display:inline-flex}.ctc-drawer__fullscreen-toggle,.ctc-drawer__close{border-radius:var(--ctc-radius-small);color:var(--ctc-color-text-secondary);cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;width:28px;height:28px;padding:0;font-size:18px;transition:background-color .2s,color .2s;display:inline-flex}.ctc-drawer__fullscreen-toggle:hover,.ctc-drawer__close:hover{background:var(--ctc-color-fill);color:var(--ctc-color-primary)}.ctc-drawer__fullscreen-toggle{font-size:16px}.ctc-drawer__close{font-size:22px;font-weight:300;line-height:1}.ctc-drawer__body{box-sizing:border-box;padding:0;overflow:hidden}.ctc-drawer__layout{flex-direction:column;height:100%;min-height:0;display:flex}.ctc-drawer__content{box-sizing:border-box;min-height:0;padding:var(--ctc-space-6);flex:1;overflow:auto}.ctc-drawer__footer{border-top:1px solid var(--ctc-color-border-light);box-sizing:border-box;min-height:64px;padding:var(--ctc-space-4) var(--ctc-space-6);flex-shrink:0;justify-content:flex-end;align-items:center;display:flex}.ctc-flex{box-sizing:border-box;display:flex}
|
|
2
|
+
/*$vite$:1*/
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ctc-front/components-ui-next",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CTC Vue 3 + Element Plus 团队组件库",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./style.css": "./dist/style.css"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"**/*.css",
|
|
23
|
+
"**/*.scss"
|
|
24
|
+
],
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@element-plus/icons-vue": "^2.3.1",
|
|
27
|
+
"element-plus": "^2.14.1",
|
|
28
|
+
"vue": "^3.5.32"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@eslint/js": "^10.0.1",
|
|
32
|
+
"@element-plus/icons-vue": "^2.3.1",
|
|
33
|
+
"@tsconfig/node24": "^24.0.4",
|
|
34
|
+
"@types/node": "^24.12.4",
|
|
35
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
36
|
+
"@vue/test-utils": "^2.4.6",
|
|
37
|
+
"@vue/tsconfig": "^0.9.1",
|
|
38
|
+
"element-plus": "^2.14.1",
|
|
39
|
+
"eslint": "^10.2.1",
|
|
40
|
+
"eslint-plugin-vue": "^10.8.0",
|
|
41
|
+
"jsdom": "^29.0.2",
|
|
42
|
+
"jiti": "^2.6.1",
|
|
43
|
+
"prettier": "^3.6.2",
|
|
44
|
+
"sass-embedded": "^1.100.0",
|
|
45
|
+
"typescript": "~5.8.3",
|
|
46
|
+
"typescript-eslint": "^8.0.0",
|
|
47
|
+
"vite": "^8.0.8",
|
|
48
|
+
"vite-plugin-dts": "^4.5.4",
|
|
49
|
+
"vitepress": "^1.6.4",
|
|
50
|
+
"vitest": "^4.1.4",
|
|
51
|
+
"vue": "^3.5.32",
|
|
52
|
+
"vue-eslint-parser": "^10.2.0",
|
|
53
|
+
"vue-tsc": "^3.2.6"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=22.0.0 <24.0.0",
|
|
57
|
+
"pnpm": ">=11.0.0"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"preinstall": "npx only-allow pnpm",
|
|
61
|
+
"dev": "vite",
|
|
62
|
+
"build": "vite build",
|
|
63
|
+
"type-check": "vue-tsc --noEmit -p tsconfig.app.json",
|
|
64
|
+
"lint": "eslint .",
|
|
65
|
+
"format": "prettier --write .",
|
|
66
|
+
"test": "vitest run",
|
|
67
|
+
"test:watch": "vitest",
|
|
68
|
+
"docs:dev": "vitepress dev docs",
|
|
69
|
+
"docs:build": "vitepress build docs"
|
|
70
|
+
}
|
|
71
|
+
}
|