geekin-devtoys 0.3.10 → 0.4.1
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/lib/{GBubble → GBranched}/index.js +1 -1
- package/lib/GBranched/index.mjs +5 -0
- package/lib/GBranched/style.css +1 -0
- package/lib/GBranched-BtF7heMk.js +1 -0
- package/lib/GBranched-vnLlYOl9.mjs +197 -0
- package/lib/GButton/index.js +1 -1
- package/lib/GButton/index.mjs +10 -10
- package/lib/GButton/style.css +1 -1
- package/lib/GCard/index.js +1 -1
- package/lib/GCard/index.mjs +1 -1
- package/lib/GDialog/index.js +1 -1
- package/lib/GDialog/index.mjs +29 -29
- package/lib/GDialog/style.css +1 -1
- package/lib/GInput/index.js +1 -1
- package/lib/GInput/index.mjs +2 -2
- package/lib/GInput/style.css +1 -1
- package/lib/GPicker/index.js +1 -0
- package/lib/GPicker/index.mjs +339 -0
- package/lib/GPicker/style.css +1 -0
- package/lib/GPie3D/index.js +1 -1
- package/lib/GPie3D/index.mjs +1 -1
- package/lib/GProgress/index.js +1 -1
- package/lib/GProgress/index.mjs +1 -1
- package/lib/GRadio/index.js +1 -0
- package/lib/GRadio/index.mjs +198 -0
- package/lib/GRadio/style.css +1 -0
- package/lib/GRadio.d.ts +1 -0
- package/lib/GRing/index.js +1 -1
- package/lib/GRing/index.mjs +1 -1
- package/lib/GScroller/index.js +1 -1
- package/lib/GScroller/index.mjs +1 -1
- package/lib/GSegment/index.js +1 -0
- package/lib/GSegment/index.mjs +364 -0
- package/lib/GSegment/style.css +1 -0
- package/lib/GSegment.d.ts +1 -0
- package/lib/GSlider/index.js +1 -0
- package/lib/GSlider/index.mjs +184 -0
- package/lib/GSlider/style.css +1 -0
- package/lib/GSlider.d.ts +1 -0
- package/lib/GSteps/index.js +1 -1
- package/lib/GSteps/index.mjs +1 -1
- package/lib/GTable/index.js +1 -1
- package/lib/GTable/index.mjs +1 -1
- package/lib/GTag/index.js +1 -1
- package/lib/GTag/index.mjs +7 -5
- package/lib/GTag/style.css +1 -0
- package/lib/GToast/index.js +1 -0
- package/lib/GToast/index.mjs +292 -0
- package/lib/GToast/style.css +1 -0
- package/lib/GToast.d.ts +1 -0
- package/lib/GTree/index.js +1 -0
- package/lib/GTree/index.mjs +295 -0
- package/lib/GTree/style.css +1 -0
- package/lib/GTree.d.ts +1 -0
- package/lib/GVideo/index.js +2 -2
- package/lib/GVideo/index.mjs +1 -1
- package/lib/components/GBranched/index.d.ts +29 -0
- package/lib/components/GBranched/types.d.ts +139 -0
- package/lib/components/GDialog/index.d.ts +3 -90
- package/lib/components/GDialog/types.d.ts +89 -0
- package/lib/components/GPicker/index.d.ts +485 -0
- package/lib/components/GRadio/index.d.ts +45 -0
- package/lib/components/GRadio/types.d.ts +94 -0
- package/lib/components/GSegment/index.d.ts +30 -0
- package/lib/components/GSegment/types.d.ts +125 -0
- package/lib/components/GSlider/index.d.ts +27 -0
- package/lib/components/GSlider/types.d.ts +88 -0
- package/lib/components/GTag/index.d.ts +4 -4
- package/lib/components/GToast/ToastCard.d.ts +9 -0
- package/lib/components/GToast/index.d.ts +7 -0
- package/lib/components/GToast/store.d.ts +45 -0
- package/lib/components/GToast/types.d.ts +112 -0
- package/lib/components/GTree/index.d.ts +83 -0
- package/lib/components/GTree/types.d.ts +53 -0
- package/lib/index/index.js +1 -1
- package/lib/index/index.mjs +70 -53
- package/lib/index/style.css +17 -5
- package/lib/index.d.ts +15 -5
- package/package.json +58 -13
- package/lib/GBubble/index.mjs +0 -5
- package/lib/GBubble/style.css +0 -1
- package/lib/GBubble-C3cM9Put.mjs +0 -216
- package/lib/GBubble-Dph0YDkU.js +0 -2
- package/lib/GInputTreeTag/index.js +0 -1
- package/lib/GInputTreeTag/index.mjs +0 -342
- package/lib/GInputTreeTag/style.css +0 -1
- package/lib/assets/GTag.css +0 -1
- package/lib/components/GBubble/index.d.ts +0 -61
- package/lib/components/GInputTreeTag/index.d.ts +0 -2177
- /package/lib/{GBubble.d.ts → GBranched.d.ts} +0 -0
- /package/lib/{GInputTreeTag.d.ts → GPicker.d.ts} +0 -0
package/lib/GDialog/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.g-dialog-pro-minimized-icon[data-v-e7d8c859]{width:78px;height:34px;padding:0 6px;border-radius:10px 18px;background:linear-gradient(90deg,rgba(106,210,255,.18) 1px,transparent 1px) 0 0/8px 8px,linear-gradient(180deg,rgba(255,255,255,.16),transparent 42%),linear-gradient(135deg,#10294c,#409eff 58%,#00d1ff);color:#f4fbff;display:flex;align-items:center;justify-content:flex-start;gap:6px;cursor:pointer;z-index:999;overflow:hidden;isolation:isolate;clip-path:polygon(9px 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%,0 9px);transition:right .3s ease,bottom .3s ease,box-shadow .18s ease,filter .18s ease}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:before{content:"";position:absolute;inset:3px;border:1px solid rgba(163,232,255,.24);clip-path:inherit;pointer-events:none}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:after{content:"";position:absolute;top:-32%;left:-38%;width:32px;height:62px;background:linear-gradient(90deg,transparent,rgba(180,244,255,.64),transparent);transform:rotate(18deg) translate(-16px);opacity:0;pointer-events:none}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:hover{filter:saturate(1.2) brightness(1.08)}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:hover:after{opacity:1;animation:g-dialog-pro-minimized-shine-e7d8c859 .62s ease}.g-dialog-pro-minimized-icon:hover .g-dialog-pro-minimized-icon__wave[data-v-e7d8c859]{opacity:1;animation:g-dialog-pro-minimized-wave-e7d8c859 1.45s ease-in-out infinite}.g-dialog-pro-minimized-icon:hover .g-dialog-pro-minimized-icon__icon[data-v-e7d8c859]{transform:scale(1.08)}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:active{box-shadow:0 0 0 1px #ffffff14 inset,0 5px 14px #0092ff3d,0 2px 6px #0003}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:focus-visible{outline:2px solid rgba(0,209,255,.72);outline-offset:3px}.g-dialog-pro-minimized-icon.is-attention[data-v-e7d8c859]{animation:g-dialog-pro-minimized-attention-e7d8c859 .58s ease both;filter:saturate(1.22) brightness(1.08)}.g-dialog-pro-minimized-icon.is-attention[data-v-e7d8c859]:after{opacity:1;animation:g-dialog-pro-minimized-shine-e7d8c859 .58s ease}.g-dialog-pro-minimized-icon.is-attention .g-dialog-pro-minimized-icon__wave[data-v-e7d8c859]{opacity:1;animation:g-dialog-pro-minimized-wave-e7d8c859 .58s ease-in-out}.g-dialog-pro-minimized-icon.is-attention .g-dialog-pro-minimized-icon__icon[data-v-e7d8c859]{animation:g-dialog-pro-minimized-icon-pop-e7d8c859 .58s ease both}.g-dialog-pro-minimized-icon__glow[data-v-e7d8c859]{position:absolute;inset:auto 8px -14px auto;width:38px;height:28px;border-radius:50%;background:#00d1ff7a;filter:blur(13px);pointer-events:none;z-index:-1}.g-dialog-pro-minimized-icon__wave[data-v-e7d8c859]{position:absolute;inset:-18px -24px;background:radial-gradient(ellipse at 22% 62%,rgba(173,243,255,.62) 0 9%,transparent 26%),radial-gradient(ellipse at 52% 78%,rgba(0,209,255,.58) 0 12%,transparent 30%),radial-gradient(ellipse at 82% 58%,rgba(67,170,255,.5) 0 10%,transparent 28%),linear-gradient(90deg,#147bff14,#00d1ff5c,#147bff14);background-size:72px 46px,86px 42px,70px 48px,100% 100%;background-position:-10px 16px,18px 20px,58px 14px,0 0;filter:blur(1px) saturate(1.25);opacity:0;pointer-events:none;transform:translate(-18px) translateY(6px) rotate(-2deg);transition:opacity .18s ease;z-index:-1}.g-dialog-pro-minimized-icon__icon[data-v-e7d8c859]{width:20px;height:20px;border:1px solid rgba(203,246,255,.32);border-radius:7px;background:linear-gradient(135deg,rgba(255,255,255,.2),transparent),#00132b2e;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:inset 0 0 10px #00d1ff3d;transition:transform .18s ease}.g-dialog-pro-minimized-icon__icon svg[data-v-e7d8c859]{width:13px;height:13px}.g-dialog-pro-minimized-icon__title[data-v-e7d8c859]{min-width:0;max-width:50px;font-size:10px;font-weight:600;line-height:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes g-dialog-pro-minimized-shine-e7d8c859{0%{transform:rotate(18deg) translate(-16px)}to{transform:rotate(18deg) translate(116px)}}@keyframes g-dialog-pro-minimized-wave-e7d8c859{0%{background-position:-18px 18px,8px 22px,54px 14px,0 0;transform:translate(-14px) translateY(7px) rotate(-3deg) scaleY(.82)}45%{background-position:18px 8px,42px 18px,88px 10px,0 0;transform:translate(0) translateY(0) rotate(1deg) scaleY(1.05)}to{background-position:58px 17px,82px 22px,126px 15px,0 0;transform:translate(14px) translateY(5px) rotate(3deg) scaleY(.9)}}@keyframes g-dialog-pro-minimized-attention-e7d8c859{0%,to{transform:translateY(0) scale(1)}18%{transform:translateY(-5px) scale(1.04)}36%{transform:translateY(0) scale(.98)}54%{transform:translateY(-3px) scale(1.02)}72%{transform:translateY(0) scale(1)}}@keyframes g-dialog-pro-minimized-icon-pop-e7d8c859{0%,to{transform:scale(1)}30%{transform:scale(1.18) rotate(-8deg)}60%{transform:scale(1.08) rotate(6deg)}}@media(prefers-reduced-motion:reduce){.g-dialog-pro-minimized-icon[data-v-e7d8c859]{animation:none;transition:right .3s ease,bottom .3s ease}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:after{display:none}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:hover,.g-dialog-pro-minimized-icon[data-v-e7d8c859]:active,.g-dialog-pro-minimized-icon.is-attention[data-v-e7d8c859]{transform:none;filter:none}.g-dialog-pro-minimized-icon__wave[data-v-e7d8c859]{animation:none!important;opacity:0}.g-dialog-pro-minimized-icon__icon[data-v-e7d8c859]{animation:none!important;transition:none}}.g-dialog-pro-header[data-v-5e0eed3b]{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:16px;padding:14px 20px;background:linear-gradient(180deg,var(--g-dialog-header-bg, rgba(248, 250, 252, .85)),transparent);position:relative}.g-dialog-pro-header .g-dialog-pro-title[data-v-5e0eed3b]{position:relative;max-width:calc(100% - 88px);margin:0;overflow:hidden;color:var(--g-text-primary, #303133);font-size:15px;font-weight:600;line-height:1.4;letter-spacing:.01em;text-overflow:ellipsis;white-space:nowrap}.g-dialog-pro-header .g-dialog-pro-operation-container[data-v-5e0eed3b]{display:flex;flex-direction:row;align-items:center;gap:8px;padding:0}.g-dialog-pro-control[data-v-5e0eed3b]{width:12px;height:12px;padding:0;border:0;border-radius:50%;cursor:pointer;flex-shrink:0;position:relative;box-shadow:inset 0 1px 1px #ffffffb3,inset 0 -1px 1px #0000001f,0 0 0 1px #00000014,0 1px 2px #0000000f;transition:transform .18s cubic-bezier(.34,1.56,.64,1),filter .18s ease,box-shadow .18s ease}.g-dialog-pro-control[data-v-5e0eed3b]:after{content:"";position:absolute;top:2px;left:2.5px;width:4px;height:4px;border-radius:50%;background:#ffffff8c;filter:blur(.5px);pointer-events:none}.g-dialog-pro-control[data-v-5e0eed3b]:hover{filter:brightness(1.06) saturate(1.1);transform:scale(1.12);box-shadow:inset 0 1px 1px #ffffffbf,inset 0 -1px 1px #0000001f,0 0 0 1px #0000001a,0 2px 4px #0000001f}.g-dialog-pro-control[data-v-5e0eed3b]:active{transform:scale(.92);filter:brightness(.96)}.g-dialog-pro-control[data-v-5e0eed3b]:focus-visible{outline:2px solid rgba(68,68,68,.32);outline-offset:3px}.g-dialog-pro-control--close[data-v-5e0eed3b]{background:linear-gradient(180deg,#ff8077,#ff5f57)}.g-dialog-pro-control--fullscreen[data-v-5e0eed3b]{background:linear-gradient(180deg,#ffd066,#ffbd2e)}.g-dialog-pro-control--minimize[data-v-5e0eed3b]{background:linear-gradient(180deg,#4be068,#28c840)}.g-dialog-pro-body[data-v-5e0eed3b]{padding:0 20px;color:var(--g-text-regular, #606266);font-size:13px;line-height:1.6;max-height:calc(85vh - 132px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--g-dialog-scrollbar, rgba(15, 23, 42, .18)) transparent}.g-dialog-pro-body[data-v-5e0eed3b]::-webkit-scrollbar{width:6px;height:6px}.g-dialog-pro-body[data-v-5e0eed3b]::-webkit-scrollbar-thumb{background-color:var(--g-dialog-scrollbar, rgba(15, 23, 42, .18));border-radius:3px}.g-dialog-pro-body[data-v-5e0eed3b]::-webkit-scrollbar-thumb:hover{background-color:var(--g-dialog-scrollbar-hover, rgba(15, 23, 42, .28))}.g-dialog-pro-body[data-v-5e0eed3b]::-webkit-scrollbar-track{background:transparent}.g-dialog-pro-footer[data-v-5e0eed3b]{padding:12px 20px;background:linear-gradient(0deg,var(--g-dialog-footer-bg, rgba(248, 250, 252, .7)),transparent);position:relative}.g-dialog-pro-actions[data-v-5e0eed3b]{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;gap:8px;padding:2px 0}@media(prefers-reduced-motion:reduce){.g-dialog-pro-control[data-v-5e0eed3b]{transition:none}}.g-dialog-pro-overlay{--g-primary: #409eff;--g-primary-light-3: #79bbff;--g-primary-light-5: #a0cfff;--g-primary-light-7: #c6e2ff;--g-primary-light-8: #d9ecff;--g-primary-light-9: #ecf5ff;--g-primary-dark-2: #337ecc;--g-success: #67c23a;--g-success-light-3: #95d475;--g-success-light-9: #f0f9eb;--g-warning: #e6a23c;--g-warning-light-3: #ebb563;--g-warning-light-9: #fdf6ec;--g-danger: #f56c6c;--g-danger-light-3: #f89898;--g-danger-light-9: #fef0f0;--g-info: #909399;--g-info-light-3: #b1b3b8;--g-info-light-9: #f4f4f5;--g-text-primary: #303133;--g-text-regular: #606266;--g-text-secondary: #909399;--g-border: #dcdfe6;--g-border-light: #e4e7ed;--g-border-lighter: #ebeef5;--g-bg-color: #ffffff;position:fixed;inset:0;z-index:2000;overflow:auto;background:var(--g-dialog-overlay-bg, rgba(15, 23, 42, .32));backdrop-filter:blur(4px) saturate(1.05);-webkit-backdrop-filter:blur(4px) saturate(1.05)}.g-dialog-pro{position:relative;margin:15vh auto 50px;width:50%;border-radius:14px;overflow:hidden;background:linear-gradient(180deg,var(--g-dialog-sheen, rgba(255, 255, 255, .6)),transparent) top/100% 64px no-repeat,var(--g-bg-color);box-shadow:0 1px 0 var(--g-dialog-inner-highlight, rgba(255, 255, 255, .6)) inset,0 0 0 1px var(--g-border-lighter, #ebeef5),0 24px 60px -12px var(--g-dialog-shadow-strong, rgba(15, 23, 42, .22)),0 8px 20px -8px var(--g-dialog-shadow-soft, rgba(15, 23, 42, .14))}.g-dialog-pro.is-fullscreen{margin:0;width:100%!important;height:100vh;border-radius:0;box-shadow:none;display:flex;flex-direction:column}.g-dialog-pro.is-fullscreen .g-dialog-pro-body{flex:1 1 auto;max-height:none;min-height:0;display:flex;flex-direction:column}.g-dialog-pro.is-fullscreen .g-dialog-pro-body>*{flex:1 1 auto;min-height:0}.g-dialog-pro-fade-enter-active{animation:g-dialog-pro-overlay-in .22s ease both}.g-dialog-pro-fade-leave-active{animation:g-dialog-pro-overlay-out .22s ease both}@keyframes g-dialog-pro-overlay-in{0%{background:#0f172a00;backdrop-filter:blur(0) saturate(1);-webkit-backdrop-filter:blur(0) saturate(1)}to{background:var(--g-dialog-overlay-bg, rgba(15, 23, 42, .32));backdrop-filter:blur(4px) saturate(1.05);-webkit-backdrop-filter:blur(4px) saturate(1.05)}}@keyframes g-dialog-pro-overlay-out{0%{background:var(--g-dialog-overlay-bg, rgba(15, 23, 42, .32));backdrop-filter:blur(4px) saturate(1.05);-webkit-backdrop-filter:blur(4px) saturate(1.05)}to{background:#0f172a00;backdrop-filter:blur(0) saturate(1);-webkit-backdrop-filter:blur(0) saturate(1)}}.g-dialog-pro-fade-enter-active .g-dialog-pro,.g-dialog-pro-fade-leave-active .g-dialog-pro{transition:transform .26s cubic-bezier(.34,1.2,.64,1),opacity .22s ease}.g-dialog-pro-fade-enter-from .g-dialog-pro,.g-dialog-pro-fade-leave-to .g-dialog-pro{transform:translateY(-12px) scale(.96);opacity:0}.g-dialog-pro-fade-leave-to .g-dialog-pro.is-leave-to-minimize,.g-dialog-pro-fade-enter-from .g-dialog-pro.is-enter-from-minimize{transform:translateY(40px) scale(.85);opacity:0}html.dark .g-dialog-pro-overlay{--g-primary: #409eff;--g-primary-light-3: #3375b9;--g-primary-light-5: #2a598a;--g-primary-light-7: #213d5b;--g-primary-light-8: #1d3043;--g-primary-light-9: #18222c;--g-primary-dark-2: #66b1ff;--g-success: #67c23a;--g-success-light-3: #4e8e2f;--g-success-light-9: #1a331a;--g-warning: #e6a23c;--g-warning-light-3: #b88230;--g-warning-light-9: #332e1a;--g-danger: #f56c6c;--g-danger-light-3: #b25252;--g-danger-light-9: #332020;--g-info: #909399;--g-info-light-3: #6b6d71;--g-info-light-9: #232324;--g-text-primary: #e5eaf3;--g-text-regular: #cfd3dc;--g-text-secondary: #a3a6ad;--g-border: #4c4d4f;--g-border-light: #414243;--g-border-lighter: #363637;--g-bg-color: #141414;--g-dialog-overlay-bg: rgba(0, 0, 0, .55)}html.dark .g-dialog-pro{--g-dialog-sheen: rgba(255, 255, 255, .04);--g-dialog-inner-highlight: rgba(255, 255, 255, .06);--g-dialog-shadow-strong: rgba(0, 0, 0, .55);--g-dialog-shadow-soft: rgba(0, 0, 0, .4);--g-dialog-header-bg: rgba(255, 255, 255, .04);--g-dialog-footer-bg: rgba(255, 255, 255, .04);--g-dialog-scrollbar: rgba(255, 255, 255, .18);--g-dialog-scrollbar-hover: rgba(255, 255, 255, .28)}html.dark .g-dialog-pro .g-dialog-pro-control{box-shadow:inset 0 1px 1px #ffffff59,inset 0 -1px 1px #00000047,0 0 0 1px #ffffff14,0 1px 2px #00000073}html.dark .g-dialog-pro .g-dialog-pro-control:hover{box-shadow:inset 0 1px 1px #fff6,inset 0 -1px 1px #00000047,0 0 0 1px #ffffff1f,0 2px 6px #00000080}html.dark .g-dialog-pro .g-dialog-pro-control:focus-visible{outline-color:#ffffff73}@media(prefers-reduced-motion:reduce){.g-dialog-pro-fade-enter-active,.g-dialog-pro-fade-leave-active{animation:none}.g-dialog-pro-fade-enter-active .g-dialog-pro,.g-dialog-pro-fade-leave-active .g-dialog-pro{transition:opacity .18s ease;transform:none}.g-dialog-pro-fade-leave-to .g-dialog-pro.is-leave-to-minimize,.g-dialog-pro-fade-enter-from .g-dialog-pro.is-enter-from-minimize{transform:none}}
|
|
1
|
+
@charset "UTF-8";.g-dialog-pro-minimized-icon[data-v-e7d8c859]{width:78px;height:34px;padding:0 6px;border-radius:10px 18px;background:linear-gradient(90deg,rgba(106,210,255,.18) 1px,transparent 1px) 0 0/8px 8px,linear-gradient(180deg,rgba(255,255,255,.16),transparent 42%),linear-gradient(135deg,#10294c,#409eff 58%,#00d1ff);color:#f4fbff;display:flex;align-items:center;justify-content:flex-start;gap:6px;cursor:pointer;z-index:999;overflow:hidden;isolation:isolate;clip-path:polygon(9px 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%,0 9px);transition:right .3s ease,bottom .3s ease,box-shadow .18s ease,filter .18s ease}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:before{content:"";position:absolute;inset:3px;border:1px solid rgba(163,232,255,.24);clip-path:inherit;pointer-events:none}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:after{content:"";position:absolute;top:-32%;left:-38%;width:32px;height:62px;background:linear-gradient(90deg,transparent,rgba(180,244,255,.64),transparent);transform:rotate(18deg) translate(-16px);opacity:0;pointer-events:none}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:hover{filter:saturate(1.2) brightness(1.08)}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:hover:after{opacity:1;animation:g-dialog-pro-minimized-shine-e7d8c859 .62s ease}.g-dialog-pro-minimized-icon:hover .g-dialog-pro-minimized-icon__wave[data-v-e7d8c859]{opacity:1;animation:g-dialog-pro-minimized-wave-e7d8c859 1.45s ease-in-out infinite}.g-dialog-pro-minimized-icon:hover .g-dialog-pro-minimized-icon__icon[data-v-e7d8c859]{transform:scale(1.08)}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:active{box-shadow:0 0 0 1px #ffffff14 inset,0 5px 14px #0092ff3d,0 2px 6px #0003}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:focus-visible{outline:2px solid rgba(0,209,255,.72);outline-offset:3px}.g-dialog-pro-minimized-icon.is-attention[data-v-e7d8c859]{animation:g-dialog-pro-minimized-attention-e7d8c859 .58s ease both;filter:saturate(1.22) brightness(1.08)}.g-dialog-pro-minimized-icon.is-attention[data-v-e7d8c859]:after{opacity:1;animation:g-dialog-pro-minimized-shine-e7d8c859 .58s ease}.g-dialog-pro-minimized-icon.is-attention .g-dialog-pro-minimized-icon__wave[data-v-e7d8c859]{opacity:1;animation:g-dialog-pro-minimized-wave-e7d8c859 .58s ease-in-out}.g-dialog-pro-minimized-icon.is-attention .g-dialog-pro-minimized-icon__icon[data-v-e7d8c859]{animation:g-dialog-pro-minimized-icon-pop-e7d8c859 .58s ease both}.g-dialog-pro-minimized-icon__glow[data-v-e7d8c859]{position:absolute;inset:auto 8px -14px auto;width:38px;height:28px;border-radius:50%;background:#00d1ff7a;filter:blur(13px);pointer-events:none;z-index:-1}.g-dialog-pro-minimized-icon__wave[data-v-e7d8c859]{position:absolute;inset:-18px -24px;background:radial-gradient(ellipse at 22% 62%,rgba(173,243,255,.62) 0 9%,transparent 26%),radial-gradient(ellipse at 52% 78%,rgba(0,209,255,.58) 0 12%,transparent 30%),radial-gradient(ellipse at 82% 58%,rgba(67,170,255,.5) 0 10%,transparent 28%),linear-gradient(90deg,#147bff14,#00d1ff5c,#147bff14);background-size:72px 46px,86px 42px,70px 48px,100% 100%;background-position:-10px 16px,18px 20px,58px 14px,0 0;filter:blur(1px) saturate(1.25);opacity:0;pointer-events:none;transform:translate(-18px) translateY(6px) rotate(-2deg);transition:opacity .18s ease;z-index:-1}.g-dialog-pro-minimized-icon__icon[data-v-e7d8c859]{width:20px;height:20px;border:1px solid rgba(203,246,255,.32);border-radius:7px;background:linear-gradient(135deg,rgba(255,255,255,.2),transparent),#00132b2e;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:inset 0 0 10px #00d1ff3d;transition:transform .18s ease}.g-dialog-pro-minimized-icon__icon svg[data-v-e7d8c859]{width:13px;height:13px}.g-dialog-pro-minimized-icon__title[data-v-e7d8c859]{min-width:0;max-width:50px;font-size:10px;font-weight:600;line-height:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes g-dialog-pro-minimized-shine-e7d8c859{0%{transform:rotate(18deg) translate(-16px)}to{transform:rotate(18deg) translate(116px)}}@keyframes g-dialog-pro-minimized-wave-e7d8c859{0%{background-position:-18px 18px,8px 22px,54px 14px,0 0;transform:translate(-14px) translateY(7px) rotate(-3deg) scaleY(.82)}45%{background-position:18px 8px,42px 18px,88px 10px,0 0;transform:translate(0) translateY(0) rotate(1deg) scaleY(1.05)}to{background-position:58px 17px,82px 22px,126px 15px,0 0;transform:translate(14px) translateY(5px) rotate(3deg) scaleY(.9)}}@keyframes g-dialog-pro-minimized-attention-e7d8c859{0%,to{transform:translateY(0) scale(1)}18%{transform:translateY(-5px) scale(1.04)}36%{transform:translateY(0) scale(.98)}54%{transform:translateY(-3px) scale(1.02)}72%{transform:translateY(0) scale(1)}}@keyframes g-dialog-pro-minimized-icon-pop-e7d8c859{0%,to{transform:scale(1)}30%{transform:scale(1.18) rotate(-8deg)}60%{transform:scale(1.08) rotate(6deg)}}@media(prefers-reduced-motion:reduce){.g-dialog-pro-minimized-icon[data-v-e7d8c859]{animation:none;transition:right .3s ease,bottom .3s ease}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:after{display:none}.g-dialog-pro-minimized-icon[data-v-e7d8c859]:hover,.g-dialog-pro-minimized-icon[data-v-e7d8c859]:active,.g-dialog-pro-minimized-icon.is-attention[data-v-e7d8c859]{transform:none;filter:none}.g-dialog-pro-minimized-icon__wave[data-v-e7d8c859]{animation:none!important;opacity:0}.g-dialog-pro-minimized-icon__icon[data-v-e7d8c859]{animation:none!important;transition:none}}.g-dialog-pro-header[data-v-7b74a42f]{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:16px;padding:14px 20px;background:linear-gradient(180deg,var(--g-dialog-header-bg, rgba(248, 250, 252, .85)),transparent);position:relative}.g-dialog-pro-header .g-dialog-pro-title[data-v-7b74a42f]{position:relative;max-width:calc(100% - 88px);margin:0;overflow:hidden;color:var(--g-text-color, rgba(0, 0, 0, .88));font-size:15px;font-weight:600;line-height:1.4;letter-spacing:.01em;text-overflow:ellipsis;white-space:nowrap}.g-dialog-pro-header .g-dialog-pro-operation-container[data-v-7b74a42f]{display:flex;flex-direction:row;align-items:center;gap:8px;padding:0}.g-dialog-pro-control[data-v-7b74a42f]{width:12px;height:12px;padding:0;border:0;border-radius:50%;cursor:pointer;flex-shrink:0;position:relative;box-shadow:inset 0 1px 1px #ffffffb3,inset 0 -1px 1px #0000001f,0 0 0 1px #00000014,0 1px 2px #0000000f;transition:transform .18s cubic-bezier(.34,1.56,.64,1),filter .18s ease,box-shadow .18s ease}.g-dialog-pro-control[data-v-7b74a42f]:after{content:"";position:absolute;top:2px;left:2.5px;width:4px;height:4px;border-radius:50%;background:#ffffff8c;filter:blur(.5px);pointer-events:none}.g-dialog-pro-control[data-v-7b74a42f]:hover{filter:brightness(1.06) saturate(1.1);transform:scale(1.12);box-shadow:inset 0 1px 1px #ffffffbf,inset 0 -1px 1px #0000001f,0 0 0 1px #0000001a,0 2px 4px #0000001f}.g-dialog-pro-control[data-v-7b74a42f]:active{transform:scale(.92);filter:brightness(.96)}.g-dialog-pro-control[data-v-7b74a42f]:focus-visible{outline:2px solid rgba(68,68,68,.32);outline-offset:3px}.g-dialog-pro-control--close[data-v-7b74a42f]{background:linear-gradient(180deg,#ff8077,#ff5f57)}.g-dialog-pro-control--fullscreen[data-v-7b74a42f]{background:linear-gradient(180deg,#ffd066,#ffbd2e)}.g-dialog-pro-control--minimize[data-v-7b74a42f]{background:linear-gradient(180deg,#4be068,#28c840)}.g-dialog-pro-body[data-v-7b74a42f]{padding:0 20px;color:var(--g-text-color, rgba(0, 0, 0, .88));font-size:13px;line-height:1.6;max-height:calc(85vh - 132px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--g-dialog-scrollbar, rgba(15, 23, 42, .18)) transparent}.g-dialog-pro-body[data-v-7b74a42f]::-webkit-scrollbar{width:6px;height:6px}.g-dialog-pro-body[data-v-7b74a42f]::-webkit-scrollbar-thumb{background-color:var(--g-dialog-scrollbar, rgba(15, 23, 42, .18));border-radius:3px}.g-dialog-pro-body[data-v-7b74a42f]::-webkit-scrollbar-thumb:hover{background-color:var(--g-dialog-scrollbar-hover, rgba(15, 23, 42, .28))}.g-dialog-pro-body[data-v-7b74a42f]::-webkit-scrollbar-track{background:transparent}.g-dialog-pro-footer[data-v-7b74a42f]{padding:12px 20px;background:linear-gradient(0deg,var(--g-dialog-footer-bg, rgba(248, 250, 252, .7)),transparent);position:relative}.g-dialog-pro-actions[data-v-7b74a42f]{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;gap:8px;padding:2px 0}@media(prefers-reduced-motion:reduce){.g-dialog-pro-control[data-v-7b74a42f]{transition:none}}.g-dialog-pro-overlay{position:fixed;inset:0;z-index:2000;overflow:auto;background:var(--g-dialog-overlay-bg, rgba(15, 23, 42, .32));backdrop-filter:blur(4px) saturate(1.05);-webkit-backdrop-filter:blur(4px) saturate(1.05)}.g-dialog-pro{position:relative;margin:15vh auto 50px;width:50%;border-radius:14px;overflow:hidden;background:linear-gradient(180deg,var(--g-dialog-sheen, rgba(255, 255, 255, .6)),transparent) top/100% 64px no-repeat,var(--g-bg-color);box-shadow:0 1px 0 var(--g-dialog-inner-highlight, rgba(255, 255, 255, .6)) inset,0 0 0 1px color-mix(in srgb,var(--g-border-color, #dcdfe3) 45%,var(--g-bg-color, #ffffff)),0 24px 60px -12px var(--g-dialog-shadow-strong, rgba(15, 23, 42, .22)),0 8px 20px -8px var(--g-dialog-shadow-soft, rgba(15, 23, 42, .14))}.g-dialog-pro.is-fullscreen{margin:0;width:100%!important;height:100vh;border-radius:0;box-shadow:none;display:flex;flex-direction:column}.g-dialog-pro.is-fullscreen .g-dialog-pro-body{flex:1 1 auto;max-height:none;min-height:0;display:flex;flex-direction:column}.g-dialog-pro.is-fullscreen .g-dialog-pro-body>*{flex:1 1 auto;min-height:0}.g-dialog-pro-fade-enter-active{animation:g-dialog-pro-overlay-in .22s ease both}.g-dialog-pro-fade-leave-active{animation:g-dialog-pro-overlay-out .22s ease both}@keyframes g-dialog-pro-overlay-in{0%{background:#0f172a00;backdrop-filter:blur(0) saturate(1);-webkit-backdrop-filter:blur(0) saturate(1)}to{background:var(--g-dialog-overlay-bg, rgba(15, 23, 42, .32));backdrop-filter:blur(4px) saturate(1.05);-webkit-backdrop-filter:blur(4px) saturate(1.05)}}@keyframes g-dialog-pro-overlay-out{0%{background:var(--g-dialog-overlay-bg, rgba(15, 23, 42, .32));backdrop-filter:blur(4px) saturate(1.05);-webkit-backdrop-filter:blur(4px) saturate(1.05)}to{background:#0f172a00;backdrop-filter:blur(0) saturate(1);-webkit-backdrop-filter:blur(0) saturate(1)}}.g-dialog-pro-fade-enter-active .g-dialog-pro,.g-dialog-pro-fade-leave-active .g-dialog-pro{transition:transform .26s cubic-bezier(.34,1.2,.64,1),opacity .22s ease}.g-dialog-pro-fade-enter-from .g-dialog-pro,.g-dialog-pro-fade-leave-to .g-dialog-pro{transform:translateY(-12px) scale(.96);opacity:0}.g-dialog-pro-fade-leave-to .g-dialog-pro.is-leave-to-minimize,.g-dialog-pro-fade-enter-from .g-dialog-pro.is-enter-from-minimize{transform:translateY(40px) scale(.85);opacity:0}html.dark .g-dialog-pro-overlay{--g-bg-color: #141414;--g-dialog-overlay-bg: rgba(0, 0, 0, .55)}html.dark .g-dialog-pro{--g-dialog-sheen: rgba(255, 255, 255, .04);--g-dialog-inner-highlight: rgba(255, 255, 255, .06);--g-dialog-shadow-strong: rgba(0, 0, 0, .55);--g-dialog-shadow-soft: rgba(0, 0, 0, .4);--g-dialog-header-bg: rgba(255, 255, 255, .04);--g-dialog-footer-bg: rgba(255, 255, 255, .04);--g-dialog-scrollbar: rgba(255, 255, 255, .18);--g-dialog-scrollbar-hover: rgba(255, 255, 255, .28)}html.dark .g-dialog-pro .g-dialog-pro-control{box-shadow:inset 0 1px 1px #ffffff59,inset 0 -1px 1px #00000047,0 0 0 1px #ffffff14,0 1px 2px #00000073}html.dark .g-dialog-pro .g-dialog-pro-control:hover{box-shadow:inset 0 1px 1px #fff6,inset 0 -1px 1px #00000047,0 0 0 1px #ffffff1f,0 2px 6px #00000080}html.dark .g-dialog-pro .g-dialog-pro-control:focus-visible{outline-color:#ffffff73}@media(prefers-reduced-motion:reduce){.g-dialog-pro-fade-enter-active,.g-dialog-pro-fade-leave-active{animation:none}.g-dialog-pro-fade-enter-active .g-dialog-pro,.g-dialog-pro-fade-leave-active .g-dialog-pro{transition:opacity .18s ease;transform:none}.g-dialog-pro-fade-leave-to .g-dialog-pro.is-leave-to-minimize,.g-dialog-pro-fade-enter-from .g-dialog-pro.is-enter-from-minimize{transform:none}}
|
package/lib/GInput/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("motion-v"),M=require("../
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("motion-v"),M=require("../GBranched-BtF7heMk.js"),P={class:"g-input__wrapper"},T={key:0,class:"g-input__prefix"},q=["type","value","disabled","readonly","maxlength"],O={key:1,class:"g-input__suffix"},D={key:0,class:"g-input__slot-suffix"},F={key:1,class:"g-input__count"},L={key:0,class:"g-input__count-max"},R=e.defineComponent({name:"GInput",inheritAttrs:!1,__name:"index",props:{modelValue:{},type:{},size:{},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},showCount:{type:Boolean},maxlength:{},block:{type:Boolean}},emits:["update:modelValue","input","change","focus","blur","clear"],setup(c,{expose:y,emit:v}){const o=c,n=v,i=e.useAttrs(),_=e.useSlots(),g=e.computed(()=>{const{class:t,style:l,...d}=i;return d}),k=e.computed(()=>["g-input",`g-input--${o.size??"middle"}`,{"is-block":o.block,"is-disabled":o.disabled,"is-readonly":o.readonly,"is-focused":p.value},i.class]),h=e.computed(()=>i.style),s=e.ref(),r=e.ref(!1),p=e.ref(!1),B=e.computed(()=>m.value||!!_.suffix||o.showCount),m=e.computed(()=>o.clearable&&!o.disabled&&!o.readonly&&r.value&&String(o.modelValue??"").length>0),f=e.computed(()=>String(o.modelValue??"").length),C={opacity:0,scale:.6},V={opacity:1,scale:1},b={opacity:0,scale:.6},x={duration:.15,ease:"easeOut"},S={opacity:0,y:4},N={opacity:1,y:0},E={opacity:0,y:-4},w={duration:.15,ease:"easeOut"},A=t=>{const l=t.target.value;n("update:modelValue",l),n("input",l)},I=t=>{n("change",t.target.value)},$=t=>{p.value=!0,n("focus",t)},z=t=>{p.value=!1,n("blur",t)},G=()=>{n("update:modelValue",""),n("input",""),n("change",""),n("clear"),s.value?.focus()};return y({focus:()=>s.value?.focus(),blur:()=>s.value?.blur(),select:()=>s.value?.select()}),(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(k.value),style:e.normalizeStyle(h.value),onMouseenter:l[0]||(l[0]=d=>r.value=!0),onMouseleave:l[1]||(l[1]=d=>r.value=!1)},[e.createElementVNode("div",P,[t.$slots.prefix?(e.openBlock(),e.createElementBlock("span",T,[e.renderSlot(t.$slots,"prefix",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({ref_key:"inputRef",ref:s,class:"g-input__inner",type:t.type,value:t.modelValue??"",disabled:t.disabled,readonly:t.readonly,maxlength:t.maxlength},g.value,{onInput:A,onChange:I,onFocus:$,onBlur:z}),null,16,q),B.value?(e.openBlock(),e.createElementBlock("span",O,[e.createVNode(e.unref(u.AnimatePresence),null,{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createBlock(e.unref(u.motion).span,{key:0,class:"g-input__clear",initial:C,animate:V,exit:b,transition:x,onClick:G})):e.createCommentVNode("",!0)]),_:1}),t.$slots.suffix?(e.openBlock(),e.createElementBlock("span",D,[e.renderSlot(t.$slots,"suffix",{},void 0,!0)])):e.createCommentVNode("",!0),t.showCount?(e.openBlock(),e.createElementBlock("span",F,[e.createVNode(e.unref(u.AnimatePresence),{mode:"popLayout"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.unref(u.motion).span,{key:f.value,class:"g-input__count-text",initial:S,animate:N,exit:E,transition:w},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value),1)]),_:1}))]),_:1}),t.maxlength!=null?(e.openBlock(),e.createElementBlock("span",L," / "+e.toDisplayString(t.maxlength),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],38))}}),a=M._export_sfc(R,[["__scopeId","data-v-d06cff18"]]);a.install=c=>{c.component(a.name,a)};exports.GInput=a;exports.default=a;
|
package/lib/GInput/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as K, useAttrs as Q, useSlots as U, computed as a, ref as y, createElementBlock as l, openBlock as n, normalizeStyle as W, normalizeClass as X, createElementVNode as b, createCommentVNode as u, renderSlot as x, mergeProps as Y, createVNode as k, unref as r, withCtx as _, createBlock as C, createTextVNode as Z, toDisplayString as V } from "vue";
|
|
2
2
|
import { AnimatePresence as B, motion as S } from "motion-v";
|
|
3
|
-
import { _ as ee } from "../
|
|
3
|
+
import { _ as ee } from "../GBranched-vnLlYOl9.mjs";
|
|
4
4
|
const te = { class: "g-input__wrapper" }, se = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "g-input__prefix"
|
|
@@ -135,7 +135,7 @@ const te = { class: "g-input__wrapper" }, se = {
|
|
|
135
135
|
])
|
|
136
136
|
], 38));
|
|
137
137
|
}
|
|
138
|
-
}), v = /* @__PURE__ */ ee(ie, [["__scopeId", "data-v-
|
|
138
|
+
}), v = /* @__PURE__ */ ee(ie, [["__scopeId", "data-v-d06cff18"]]);
|
|
139
139
|
v.install = (c) => {
|
|
140
140
|
c.component(v.name, v);
|
|
141
141
|
};
|
package/lib/GInput/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.g-input[data-v-
|
|
1
|
+
@charset "UTF-8";.g-input[data-v-d06cff18]{display:inline-flex;align-items:stretch;width:var(--g-input-width, 240px);font-size:var(--g-input-font-size, var(--g-size-middle-font-size, 14px));color:var(--g-text-color, rgba(0, 0, 0, .88))}.g-input:not(.is-disabled):hover .g-input__wrapper[data-v-d06cff18]{border-color:var(--g-primary-color, #039be5)}.g-input.is-focused:not(.is-disabled) .g-input__wrapper[data-v-d06cff18]{border-color:var(--g-primary-color, #039be5);box-shadow:0 0 0 2px color-mix(in srgb,var(--g-primary-color, #039be5) 15%,transparent)}.g-input.is-block[data-v-d06cff18]{display:flex;width:100%}.g-input.is-disabled[data-v-d06cff18]{cursor:not-allowed;color:var(--g-input-disabled-text-color, rgba(0, 0, 0, .3))}.g-input.is-disabled .g-input__wrapper[data-v-d06cff18]{background:var(--g-input-disabled-bg-color, #f2f3f5);border-color:var(--g-border-color, #dcdfe3)}.g-input.is-disabled .g-input__inner[data-v-d06cff18]{cursor:not-allowed;-webkit-text-fill-color:var(--g-input-disabled-text-color, rgba(0, 0, 0, .3))}.g-input.is-disabled .g-input__inner[data-v-d06cff18]::placeholder{color:var(--g-input-disabled-text-color, rgba(0, 0, 0, .3))}.g-input--large[data-v-d06cff18]{--g-input-height: var(--g-size-large-height, 40px);--g-input-font-size: var(--g-size-large-font-size, 16px)}.g-input--small[data-v-d06cff18]{--g-input-height: var(--g-size-small-height, 24px);--g-input-font-size: var(--g-size-small-font-size, 12px)}.g-input__wrapper[data-v-d06cff18]{position:relative;flex:1;display:inline-flex;align-items:center;gap:4px;min-width:0;height:var(--g-input-height, var(--g-size-middle-height, 32px));padding:0 8px;background:var(--g-bg-color, #ffffff);border:1px solid var(--g-border-color, #dcdfe3);border-radius:var(--g-input-radius, 6px);transition:border-color .2s cubic-bezier(.645,.045,.355,1),box-shadow .2s cubic-bezier(.645,.045,.355,1)}.g-input__inner[data-v-d06cff18]{flex:1;min-width:0;height:100%;padding:0;font:inherit;color:inherit;background:transparent;border:none;outline:none;caret-color:var(--g-primary-color, #039be5)}.g-input__inner[data-v-d06cff18]::placeholder{color:var(--g-text-placeholder-color, rgba(0, 0, 0, .35))}.g-input__prefix[data-v-d06cff18],.g-input__suffix[data-v-d06cff18]{display:inline-flex;align-items:center;gap:4px;color:var(--g-text-placeholder-color, rgba(0, 0, 0, .35))}.g-input__prefix[data-v-d06cff18] svg,.g-input__suffix[data-v-d06cff18] svg{width:1em;height:1em;display:block}.g-input__clear[data-v-d06cff18]{position:relative;flex-shrink:0;width:1em;height:1em;cursor:pointer;color:var(--g-text-placeholder-color, rgba(0, 0, 0, .35));transition:color .2s}.g-input__clear[data-v-d06cff18]:before,.g-input__clear[data-v-d06cff18]:after{content:"";position:absolute;left:50%;top:50%;width:100%;height:1px;background:currentcolor}.g-input__clear[data-v-d06cff18]:before{transform:translate(-50%,-50%) rotate(45deg)}.g-input__clear[data-v-d06cff18]:after{transform:translate(-50%,-50%) rotate(-45deg)}.g-input__clear[data-v-d06cff18]:hover{color:var(--g-text-color, rgba(0, 0, 0, .88))}.g-input__count[data-v-d06cff18]{flex-shrink:0;font-size:12px;font-variant-numeric:tabular-nums;color:var(--g-text-placeholder-color, rgba(0, 0, 0, .35))}.g-input__count-text[data-v-d06cff18]{display:inline-block}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),ve=require("../GInput/index.js"),me=require("../GTag/index.js"),be=require("../GTree/index.js"),O=require("element-plus"),E=require("motion-v"),ge=require("../GBranched-BtF7heMk.js"),he={key:0,class:"g-picker__tags"},ye=t.defineComponent({__name:"index",props:{modelValue:{default:()=>[]},data:{default:()=>[]},props:{default:()=>({})},echoProps:{},nodeKey:{default:"id"},placeholder:{default:"请输入关键字搜索"},width:{default:320},popperMaxHeight:{default:320},popperZIndex:{default:2e3},popperOffset:{default:4},defaultExpandAll:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},tagType:{default:"primary"},tagVariant:{default:"filled"},clearInputAfterSelect:{type:Boolean,default:!0},enterToAdd:{type:Boolean,default:!0},valueFormat:{default:"value"},selectable:{},filterMethod:{},duplicateMessage:{default:"该项已添加"},notFoundMessage:{default:"未找到匹配项"}},emits:["update:modelValue","change","add","remove","node-click","duplicate","not-found"],setup(x,{expose:R,emit:$}){const a=x,r=$,H=t.computed(()=>({label:a.props.label||"label",children:a.props.children||"children",disabled:a.props.disabled})),q=t.computed(()=>a.props.value||a.nodeKey||"id"),G=t.computed(()=>a.props.label||"label"),j=t.computed(()=>a.props.children||"children"),S=t.computed(()=>a.props.isLeaf),K=t.computed(()=>a.echoProps?.value||"value"),U=t.computed(()=>a.echoProps?.label||"label"),v=e=>e?e[q.value]:void 0,c=e=>e?e[G.value]:"",F=e=>e?e[j.value]:void 0,Z=e=>e?.[K.value]??e?.value,W=e=>e?.[U.value]??e?.label,d=e=>{if(!e)return!1;if(typeof a.selectable=="function")return a.selectable(e);if(S.value&&e[S.value]!==void 0)return!!e[S.value];const l=F(e);return!l||!l.length},C=t.computed(()=>{const e=new Map,l=(o=[])=>{o.forEach(n=>{d(n)&&e.set(v(n),n);const s=F(n);s?.length&&l(s)})};return l(a.data||[]),e}),i=t.computed(()=>(a.modelValue||[]).map(l=>{const o=a.valueFormat==="object"?Z(l):l,n=C.value.get(o),s=a.valueFormat==="object"?W(l):void 0;return{value:o,label:n?c(n):s??String(o??""),raw:n??(a.valueFormat==="object"?l:void 0)}})),y=e=>i.value.some(l=>l.value===e),w=t.ref(""),u=t.ref(!1),N=t.ref(null),I=t.ref(null),P=t.ref(null),p=t.ref(null),J=e=>{if(!e){p.value=null;return}p.value=e.$el??(e instanceof HTMLElement?e:null)},L=t.ref({}),m=t.ref("bottom"),Q=t.computed(()=>({opacity:0,scale:.95,y:m.value==="bottom"?-8:8})),X={opacity:1,scale:1,y:0},Y=t.computed(()=>({opacity:0,scale:.95,y:m.value==="bottom"?-8:8})),D={duration:.2,ease:"easeOut"},ee=t.computed(()=>({...L.value,transformOrigin:m.value==="bottom"?"top center":"bottom center"})),te={opacity:0,scale:.8},le={opacity:1,scale:1},oe={opacity:0,scale:.8},ae={duration:.2,ease:"easeOut"},ne=t.computed(()=>typeof a.width=="number"?`${a.width}px`:a.width),M=()=>{a.disabled||(u.value=!0)},k=()=>{if(!u.value)return;const e=P.value,l=p.value;if(!e||!l)return;const o=e.getBoundingClientRect(),n=l.offsetHeight||a.popperMaxHeight,B=window.innerHeight-o.bottom-a.popperOffset,pe=o.top-a.popperOffset,z=B>=n||B>=pe?"bottom":"top";m.value=z;const fe=z==="bottom"?o.bottom+a.popperOffset:o.top-n-a.popperOffset;L.value={position:"fixed",top:`${fe}px`,left:`${o.left}px`,width:`${o.width}px`,zIndex:String(a.popperZIndex)}};let f=null;const b=()=>{u.value&&(f&&cancelAnimationFrame(f),f=requestAnimationFrame(()=>{f=null,k()}))};let g=null;const re=()=>{typeof ResizeObserver>"u"||!p.value||(g?.disconnect(),g=new ResizeObserver(()=>b()),g.observe(p.value))},T=()=>{g?.disconnect(),g=null};t.watch(u,async e=>{if(!e){T();return}await t.nextTick(),k(),requestAnimationFrame(k),re()});const A=e=>{if(!u.value)return;const l=e.target;I.value?.contains(l)||p.value?.contains(l)||(u.value=!1)};t.onMounted(()=>{document.addEventListener("mousedown",A,!0),window.addEventListener("scroll",b,!0),window.addEventListener("resize",b)}),t.onBeforeUnmount(()=>{document.removeEventListener("mousedown",A,!0),window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b),f&&cancelAnimationFrame(f),T()});const se=e=>{u.value=!0,N.value?.filter(e),t.nextTick(k)},ie=(e,l)=>e?typeof a.filterMethod=="function"?a.filterMethod(e,l):String(c(l)??"").toLowerCase().includes(String(e).toLowerCase()):!0,ue=e=>{r("node-click",e),d(e)&&(_(e),u.value=!1)},ce=e=>a.valueFormat==="object"?{value:e.value,label:e.label,raw:e.raw}:e.value,_=e=>{const l=v(e);if(l==null||l==="")return;if(y(l)){const s={value:l,label:c(e),raw:e};r("duplicate",s),a.duplicateMessage&&O.ElMessage.warning(a.duplicateMessage);return}const o={value:l,label:c(e),raw:e},n=[...a.modelValue||[],ce(o)];r("update:modelValue",n),r("add",o),r("change",n,[...i.value,o]),a.clearInputAfterSelect&&(w.value="")},de=()=>{if(!a.enterToAdd)return;const e=(w.value||"").trim();if(!e)return;let l=null;for(const o of C.value.values())if(c(o)===e){l=o;break}if(!l){r("not-found",e),a.notFoundMessage&&O.ElMessage.warning(a.notFoundMessage);return}_(l)},V=e=>{if(e<0||e>=i.value.length)return;const l=i.value[e],o=[...a.modelValue||[]];o.splice(e,1),r("update:modelValue",o),l&&r("remove",l,e);const n=i.value.filter((s,B)=>B!==e);r("change",o,n)};return R({open:M,close:()=>u.value=!1,clear:()=>{r("update:modelValue",[]),r("change",[],[])},addByValue:e=>{const l=C.value.get(e);l&&_(l)},removeByIndex:e=>{V(e)},removeByValue:e=>{const l=i.value.findIndex(o=>o.value===e);l>-1&&V(l)},getSelectedItems:()=>i.value}),(e,l)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["g-picker",{"is-disabled":e.disabled}])},[t.createElementVNode("div",{class:"g-picker__wrap",ref_key:"wrapRef",ref:I},[t.createElementVNode("div",{class:"g-picker__input-box",ref_key:"inputBoxRef",ref:P,style:t.normalizeStyle({width:ne.value})},[t.createVNode(t.unref(ve.default),{modelValue:w.value,"onUpdate:modelValue":l[0]||(l[0]=o=>w.value=o),placeholder:e.placeholder,clearable:e.clearable,disabled:e.disabled,block:"",class:"g-picker__input",onFocus:M,onClick:M,onInput:se,onKeyup:t.withKeys(de,["enter"])},null,8,["modelValue","placeholder","clearable","disabled"])],4),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.unref(E.AnimatePresence),null,{default:t.withCtx(()=>[u.value?(t.openBlock(),t.createBlock(t.unref(E.motion).div,{key:0,ref:J,class:t.normalizeClass(["g-picker__popover",`is-${m.value}`]),style:t.normalizeStyle(ee.value),initial:Q.value,animate:X,exit:Y.value,transition:D,onMousedown:l[1]||(l[1]=t.withModifiers(()=>{},["prevent"]))},{default:t.withCtx(()=>[t.createElementVNode("div",{class:"g-picker__tree-wrap",style:t.normalizeStyle({maxHeight:e.popperMaxHeight+"px"})},[t.createVNode(t.unref(be.default),{ref_key:"treeRef",ref:N,data:e.data,props:H.value,"node-key":e.nodeKey,"filter-method":ie,"default-expand-all":e.defaultExpandAll,"highlight-current":!1,onNodeClick:ue},{default:t.withCtx(({data:o,level:n,expanded:s})=>[t.renderSlot(e.$slots,"tree-node",{data:o,node:{level:n,expanded:s},selectable:d(o),selected:y(v(o))},()=>[o?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["g-picker__node",{"is-selectable":d(o),"is-selected":d(o)&&y(v(o))}])},[t.renderSlot(e.$slots,"leaf-icon",{data:o,selectable:d(o),selected:y(v(o))},void 0,!0),t.createTextVNode(" "+t.toDisplayString(c(o)),1)],2)):t.createCommentVNode("",!0)],!0)]),_:3},8,["data","props","node-key","default-expand-all"])],4)]),_:3},8,["class","style","initial","exit"])):t.createCommentVNode("",!0)]),_:3})])),i.value.length?(t.openBlock(),t.createElementBlock("div",he,[t.renderSlot(e.$slots,"tags",{items:i.value,remove:V},()=>[t.createVNode(t.unref(E.AnimatePresence),{mode:"popLayout"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,(o,n)=>(t.openBlock(),t.createBlock(t.unref(E.motion).div,{key:o.value,layout:!0,class:"g-picker__tag-motion",initial:te,animate:le,exit:oe,transition:ae},{default:t.withCtx(()=>[t.createVNode(t.unref(me.default),{class:"g-picker__tag",type:e.tagType,variant:e.tagVariant,closable:e.closable&&!e.disabled,onClose:s=>V(n)},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"tag",{item:o,index:n},()=>[t.createTextVNode(t.toDisplayString(o.label),1)],!0)]),_:2},1032,["type","variant","closable","onClose"])]),_:2},1024))),128))]),_:3})],!0)])):t.createCommentVNode("",!0)],512)],2))}}),h=ge._export_sfc(ye,[["__scopeId","data-v-450b5b60"]]);h.install=x=>{x.component(h.name,h)};exports.GPicker=h;exports.default=h;
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { defineComponent as Le, computed as n, ref as c, watch as Se, nextTick as J, onMounted as Ae, onBeforeUnmount as Ce, createElementBlock as B, openBlock as p, normalizeClass as T, createElementVNode as O, createBlock as R, createCommentVNode as N, normalizeStyle as $, createVNode as V, unref as d, withKeys as Pe, Teleport as Te, withCtx as g, withModifiers as Oe, renderSlot as I, createTextVNode as Q, toDisplayString as X, Fragment as Re, renderList as Ne } from "vue";
|
|
2
|
+
import $e from "../GInput/index.mjs";
|
|
3
|
+
import ze from "../GTag/index.mjs";
|
|
4
|
+
import He from "../GTree/index.mjs";
|
|
5
|
+
import { ElMessage as Y } from "element-plus";
|
|
6
|
+
import { AnimatePresence as D, motion as ee } from "motion-v";
|
|
7
|
+
import { _ as Ke } from "../GBranched-vnLlYOl9.mjs";
|
|
8
|
+
const je = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "g-picker__tags"
|
|
11
|
+
}, Ge = /* @__PURE__ */ Le({
|
|
12
|
+
__name: "index",
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: { default: () => [] },
|
|
15
|
+
data: { default: () => [] },
|
|
16
|
+
props: { default: () => ({}) },
|
|
17
|
+
echoProps: {},
|
|
18
|
+
nodeKey: { default: "id" },
|
|
19
|
+
placeholder: { default: "请输入关键字搜索" },
|
|
20
|
+
width: { default: 320 },
|
|
21
|
+
popperMaxHeight: { default: 320 },
|
|
22
|
+
popperZIndex: { default: 2e3 },
|
|
23
|
+
popperOffset: { default: 4 },
|
|
24
|
+
defaultExpandAll: { type: Boolean, default: !0 },
|
|
25
|
+
disabled: { type: Boolean, default: !1 },
|
|
26
|
+
clearable: { type: Boolean, default: !0 },
|
|
27
|
+
closable: { type: Boolean, default: !0 },
|
|
28
|
+
tagType: { default: "primary" },
|
|
29
|
+
tagVariant: { default: "filled" },
|
|
30
|
+
clearInputAfterSelect: { type: Boolean, default: !0 },
|
|
31
|
+
enterToAdd: { type: Boolean, default: !0 },
|
|
32
|
+
valueFormat: { default: "value" },
|
|
33
|
+
selectable: {},
|
|
34
|
+
filterMethod: {},
|
|
35
|
+
duplicateMessage: { default: "该项已添加" },
|
|
36
|
+
notFoundMessage: { default: "未找到匹配项" }
|
|
37
|
+
},
|
|
38
|
+
emits: ["update:modelValue", "change", "add", "remove", "node-click", "duplicate", "not-found"],
|
|
39
|
+
setup(L, { expose: te, emit: le }) {
|
|
40
|
+
const o = L, r = le, oe = n(() => ({
|
|
41
|
+
label: o.props.label || "label",
|
|
42
|
+
children: o.props.children || "children",
|
|
43
|
+
disabled: o.props.disabled
|
|
44
|
+
})), ae = n(() => o.props.value || o.nodeKey || "id"), ne = n(() => o.props.label || "label"), re = n(() => o.props.children || "children"), S = n(() => o.props.isLeaf), se = n(() => o.echoProps?.value || "value"), ie = n(() => o.echoProps?.label || "label"), h = (e) => e ? e[ae.value] : void 0, f = (e) => e ? e[ne.value] : "", H = (e) => e ? e[re.value] : void 0, ue = (e) => e?.[se.value] ?? e?.value, ce = (e) => e?.[ie.value] ?? e?.label, v = (e) => {
|
|
45
|
+
if (!e) return !1;
|
|
46
|
+
if (typeof o.selectable == "function") return o.selectable(e);
|
|
47
|
+
if (S.value && e[S.value] !== void 0) return !!e[S.value];
|
|
48
|
+
const t = H(e);
|
|
49
|
+
return !t || !t.length;
|
|
50
|
+
}, A = n(() => {
|
|
51
|
+
const e = /* @__PURE__ */ new Map(), t = (l = []) => {
|
|
52
|
+
l.forEach((a) => {
|
|
53
|
+
v(a) && e.set(h(a), a);
|
|
54
|
+
const s = H(a);
|
|
55
|
+
s?.length && t(s);
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
return t(o.data || []), e;
|
|
59
|
+
}), i = n(() => (o.modelValue || []).map((t) => {
|
|
60
|
+
const l = o.valueFormat === "object" ? ue(t) : t, a = A.value.get(l), s = o.valueFormat === "object" ? ce(t) : void 0;
|
|
61
|
+
return {
|
|
62
|
+
value: l,
|
|
63
|
+
label: a ? f(a) : s ?? String(l ?? ""),
|
|
64
|
+
raw: a ?? (o.valueFormat === "object" ? t : void 0)
|
|
65
|
+
};
|
|
66
|
+
})), E = (e) => i.value.some((t) => t.value === e), F = c(""), u = c(!1), K = c(null), j = c(null), G = c(null), m = c(null), pe = (e) => {
|
|
67
|
+
if (!e) {
|
|
68
|
+
m.value = null;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
m.value = e.$el ?? (e instanceof HTMLElement ? e : null);
|
|
72
|
+
}, U = c({}), y = c("bottom"), de = n(() => ({
|
|
73
|
+
opacity: 0,
|
|
74
|
+
scale: 0.95,
|
|
75
|
+
y: y.value === "bottom" ? -8 : 8
|
|
76
|
+
})), fe = { opacity: 1, scale: 1, y: 0 }, ve = n(() => ({
|
|
77
|
+
opacity: 0,
|
|
78
|
+
scale: 0.95,
|
|
79
|
+
y: y.value === "bottom" ? -8 : 8
|
|
80
|
+
})), me = { duration: 0.2, ease: "easeOut" }, be = n(() => ({
|
|
81
|
+
...U.value,
|
|
82
|
+
transformOrigin: y.value === "bottom" ? "top center" : "bottom center"
|
|
83
|
+
})), ge = { opacity: 0, scale: 0.8 }, he = { opacity: 1, scale: 1 }, ye = { opacity: 0, scale: 0.8 }, we = { duration: 0.2, ease: "easeOut" }, ke = n(
|
|
84
|
+
() => typeof o.width == "number" ? `${o.width}px` : o.width
|
|
85
|
+
), C = () => {
|
|
86
|
+
o.disabled || (u.value = !0);
|
|
87
|
+
}, _ = () => {
|
|
88
|
+
if (!u.value) return;
|
|
89
|
+
const e = G.value, t = m.value;
|
|
90
|
+
if (!e || !t) return;
|
|
91
|
+
const l = e.getBoundingClientRect(), a = t.offsetHeight || o.popperMaxHeight, M = window.innerHeight - l.bottom - o.popperOffset, Be = l.top - o.popperOffset, W = M >= a || M >= Be ? "bottom" : "top";
|
|
92
|
+
y.value = W;
|
|
93
|
+
const Ie = W === "bottom" ? l.bottom + o.popperOffset : l.top - a - o.popperOffset;
|
|
94
|
+
U.value = {
|
|
95
|
+
position: "fixed",
|
|
96
|
+
top: `${Ie}px`,
|
|
97
|
+
left: `${l.left}px`,
|
|
98
|
+
width: `${l.width}px`,
|
|
99
|
+
zIndex: String(o.popperZIndex)
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
let b = null;
|
|
103
|
+
const w = () => {
|
|
104
|
+
u.value && (b && cancelAnimationFrame(b), b = requestAnimationFrame(() => {
|
|
105
|
+
b = null, _();
|
|
106
|
+
}));
|
|
107
|
+
};
|
|
108
|
+
let k = null;
|
|
109
|
+
const Ve = () => {
|
|
110
|
+
typeof ResizeObserver > "u" || !m.value || (k?.disconnect(), k = new ResizeObserver(() => w()), k.observe(m.value));
|
|
111
|
+
}, q = () => {
|
|
112
|
+
k?.disconnect(), k = null;
|
|
113
|
+
};
|
|
114
|
+
Se(u, async (e) => {
|
|
115
|
+
if (!e) {
|
|
116
|
+
q();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
await J(), _(), requestAnimationFrame(_), Ve();
|
|
120
|
+
});
|
|
121
|
+
const Z = (e) => {
|
|
122
|
+
if (!u.value) return;
|
|
123
|
+
const t = e.target;
|
|
124
|
+
j.value?.contains(t) || m.value?.contains(t) || (u.value = !1);
|
|
125
|
+
};
|
|
126
|
+
Ae(() => {
|
|
127
|
+
document.addEventListener("mousedown", Z, !0), window.addEventListener("scroll", w, !0), window.addEventListener("resize", w);
|
|
128
|
+
}), Ce(() => {
|
|
129
|
+
document.removeEventListener("mousedown", Z, !0), window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", w), b && cancelAnimationFrame(b), q();
|
|
130
|
+
});
|
|
131
|
+
const Ee = (e) => {
|
|
132
|
+
u.value = !0, K.value?.filter(e), J(_);
|
|
133
|
+
}, Fe = (e, t) => e ? typeof o.filterMethod == "function" ? o.filterMethod(e, t) : String(f(t) ?? "").toLowerCase().includes(String(e).toLowerCase()) : !0, _e = (e) => {
|
|
134
|
+
r("node-click", e), v(e) && (P(e), u.value = !1);
|
|
135
|
+
}, xe = (e) => o.valueFormat === "object" ? { value: e.value, label: e.label, raw: e.raw } : e.value, P = (e) => {
|
|
136
|
+
const t = h(e);
|
|
137
|
+
if (t == null || t === "") return;
|
|
138
|
+
if (E(t)) {
|
|
139
|
+
const s = { value: t, label: f(e), raw: e };
|
|
140
|
+
r("duplicate", s), o.duplicateMessage && Y.warning(o.duplicateMessage);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const l = { value: t, label: f(e), raw: e }, a = [...o.modelValue || [], xe(l)];
|
|
144
|
+
r("update:modelValue", a), r("add", l), r("change", a, [...i.value, l]), o.clearInputAfterSelect && (F.value = "");
|
|
145
|
+
}, Me = () => {
|
|
146
|
+
if (!o.enterToAdd) return;
|
|
147
|
+
const e = (F.value || "").trim();
|
|
148
|
+
if (!e) return;
|
|
149
|
+
let t = null;
|
|
150
|
+
for (const l of A.value.values())
|
|
151
|
+
if (f(l) === e) {
|
|
152
|
+
t = l;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
if (!t) {
|
|
156
|
+
r("not-found", e), o.notFoundMessage && Y.warning(o.notFoundMessage);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
P(t);
|
|
160
|
+
}, x = (e) => {
|
|
161
|
+
if (e < 0 || e >= i.value.length) return;
|
|
162
|
+
const t = i.value[e], l = [...o.modelValue || []];
|
|
163
|
+
l.splice(e, 1), r("update:modelValue", l), t && r("remove", t, e);
|
|
164
|
+
const a = i.value.filter((s, M) => M !== e);
|
|
165
|
+
r("change", l, a);
|
|
166
|
+
};
|
|
167
|
+
return te({
|
|
168
|
+
/** 主动打开下拉面板 */
|
|
169
|
+
open: C,
|
|
170
|
+
/** 主动关闭下拉面板 */
|
|
171
|
+
close: () => u.value = !1,
|
|
172
|
+
/** 清空已选 */
|
|
173
|
+
clear: () => {
|
|
174
|
+
r("update:modelValue", []), r("change", [], []);
|
|
175
|
+
},
|
|
176
|
+
/** 根据 value 直接添加 */
|
|
177
|
+
addByValue: (e) => {
|
|
178
|
+
const t = A.value.get(e);
|
|
179
|
+
t && P(t);
|
|
180
|
+
},
|
|
181
|
+
/** 根据索引移除,触发与关闭 tag 一致的事件 */
|
|
182
|
+
removeByIndex: (e) => {
|
|
183
|
+
x(e);
|
|
184
|
+
},
|
|
185
|
+
/** 根据 value 移除,触发与关闭 tag 一致的事件 */
|
|
186
|
+
removeByValue: (e) => {
|
|
187
|
+
const t = i.value.findIndex((l) => l.value === e);
|
|
188
|
+
t > -1 && x(t);
|
|
189
|
+
},
|
|
190
|
+
/** 获取当前归一化后的已选项 */
|
|
191
|
+
getSelectedItems: () => i.value
|
|
192
|
+
}), (e, t) => (p(), B("div", {
|
|
193
|
+
class: T(["g-picker", { "is-disabled": e.disabled }])
|
|
194
|
+
}, [
|
|
195
|
+
O("div", {
|
|
196
|
+
class: "g-picker__wrap",
|
|
197
|
+
ref_key: "wrapRef",
|
|
198
|
+
ref: j
|
|
199
|
+
}, [
|
|
200
|
+
O("div", {
|
|
201
|
+
class: "g-picker__input-box",
|
|
202
|
+
ref_key: "inputBoxRef",
|
|
203
|
+
ref: G,
|
|
204
|
+
style: $({ width: ke.value })
|
|
205
|
+
}, [
|
|
206
|
+
V(d($e), {
|
|
207
|
+
modelValue: F.value,
|
|
208
|
+
"onUpdate:modelValue": t[0] || (t[0] = (l) => F.value = l),
|
|
209
|
+
placeholder: e.placeholder,
|
|
210
|
+
clearable: e.clearable,
|
|
211
|
+
disabled: e.disabled,
|
|
212
|
+
block: "",
|
|
213
|
+
class: "g-picker__input",
|
|
214
|
+
onFocus: C,
|
|
215
|
+
onClick: C,
|
|
216
|
+
onInput: Ee,
|
|
217
|
+
onKeyup: Pe(Me, ["enter"])
|
|
218
|
+
}, null, 8, ["modelValue", "placeholder", "clearable", "disabled"])
|
|
219
|
+
], 4),
|
|
220
|
+
(p(), R(Te, { to: "body" }, [
|
|
221
|
+
V(d(D), null, {
|
|
222
|
+
default: g(() => [
|
|
223
|
+
u.value ? (p(), R(d(ee).div, {
|
|
224
|
+
key: 0,
|
|
225
|
+
ref: pe,
|
|
226
|
+
class: T(["g-picker__popover", `is-${y.value}`]),
|
|
227
|
+
style: $(be.value),
|
|
228
|
+
initial: de.value,
|
|
229
|
+
animate: fe,
|
|
230
|
+
exit: ve.value,
|
|
231
|
+
transition: me,
|
|
232
|
+
onMousedown: t[1] || (t[1] = Oe(() => {
|
|
233
|
+
}, ["prevent"]))
|
|
234
|
+
}, {
|
|
235
|
+
default: g(() => [
|
|
236
|
+
O("div", {
|
|
237
|
+
class: "g-picker__tree-wrap",
|
|
238
|
+
style: $({ maxHeight: e.popperMaxHeight + "px" })
|
|
239
|
+
}, [
|
|
240
|
+
V(d(He), {
|
|
241
|
+
ref_key: "treeRef",
|
|
242
|
+
ref: K,
|
|
243
|
+
data: e.data,
|
|
244
|
+
props: oe.value,
|
|
245
|
+
"node-key": e.nodeKey,
|
|
246
|
+
"filter-method": Fe,
|
|
247
|
+
"default-expand-all": e.defaultExpandAll,
|
|
248
|
+
"highlight-current": !1,
|
|
249
|
+
onNodeClick: _e
|
|
250
|
+
}, {
|
|
251
|
+
default: g(({ data: l, level: a, expanded: s }) => [
|
|
252
|
+
I(e.$slots, "tree-node", {
|
|
253
|
+
data: l,
|
|
254
|
+
node: { level: a, expanded: s },
|
|
255
|
+
selectable: v(l),
|
|
256
|
+
selected: E(h(l))
|
|
257
|
+
}, () => [
|
|
258
|
+
l ? (p(), B("span", {
|
|
259
|
+
key: 0,
|
|
260
|
+
class: T([
|
|
261
|
+
"g-picker__node",
|
|
262
|
+
{
|
|
263
|
+
"is-selectable": v(l),
|
|
264
|
+
"is-selected": v(l) && E(h(l))
|
|
265
|
+
}
|
|
266
|
+
])
|
|
267
|
+
}, [
|
|
268
|
+
I(e.$slots, "leaf-icon", {
|
|
269
|
+
data: l,
|
|
270
|
+
selectable: v(l),
|
|
271
|
+
selected: E(h(l))
|
|
272
|
+
}, void 0, !0),
|
|
273
|
+
Q(" " + X(f(l)), 1)
|
|
274
|
+
], 2)) : N("", !0)
|
|
275
|
+
], !0)
|
|
276
|
+
]),
|
|
277
|
+
_: 3
|
|
278
|
+
}, 8, ["data", "props", "node-key", "default-expand-all"])
|
|
279
|
+
], 4)
|
|
280
|
+
]),
|
|
281
|
+
_: 3
|
|
282
|
+
}, 8, ["class", "style", "initial", "exit"])) : N("", !0)
|
|
283
|
+
]),
|
|
284
|
+
_: 3
|
|
285
|
+
})
|
|
286
|
+
])),
|
|
287
|
+
i.value.length ? (p(), B("div", je, [
|
|
288
|
+
I(e.$slots, "tags", {
|
|
289
|
+
items: i.value,
|
|
290
|
+
remove: x
|
|
291
|
+
}, () => [
|
|
292
|
+
V(d(D), { mode: "popLayout" }, {
|
|
293
|
+
default: g(() => [
|
|
294
|
+
(p(!0), B(Re, null, Ne(i.value, (l, a) => (p(), R(d(ee).div, {
|
|
295
|
+
key: l.value,
|
|
296
|
+
layout: !0,
|
|
297
|
+
class: "g-picker__tag-motion",
|
|
298
|
+
initial: ge,
|
|
299
|
+
animate: he,
|
|
300
|
+
exit: ye,
|
|
301
|
+
transition: we
|
|
302
|
+
}, {
|
|
303
|
+
default: g(() => [
|
|
304
|
+
V(d(ze), {
|
|
305
|
+
class: "g-picker__tag",
|
|
306
|
+
type: e.tagType,
|
|
307
|
+
variant: e.tagVariant,
|
|
308
|
+
closable: e.closable && !e.disabled,
|
|
309
|
+
onClose: (s) => x(a)
|
|
310
|
+
}, {
|
|
311
|
+
default: g(() => [
|
|
312
|
+
I(e.$slots, "tag", {
|
|
313
|
+
item: l,
|
|
314
|
+
index: a
|
|
315
|
+
}, () => [
|
|
316
|
+
Q(X(l.label), 1)
|
|
317
|
+
], !0)
|
|
318
|
+
]),
|
|
319
|
+
_: 2
|
|
320
|
+
}, 1032, ["type", "variant", "closable", "onClose"])
|
|
321
|
+
]),
|
|
322
|
+
_: 2
|
|
323
|
+
}, 1024))), 128))
|
|
324
|
+
]),
|
|
325
|
+
_: 3
|
|
326
|
+
})
|
|
327
|
+
], !0)
|
|
328
|
+
])) : N("", !0)
|
|
329
|
+
], 512)
|
|
330
|
+
], 2));
|
|
331
|
+
}
|
|
332
|
+
}), z = /* @__PURE__ */ Ke(Ge, [["__scopeId", "data-v-450b5b60"]]);
|
|
333
|
+
z.install = (L) => {
|
|
334
|
+
L.component(z.name, z);
|
|
335
|
+
};
|
|
336
|
+
export {
|
|
337
|
+
z as GPicker,
|
|
338
|
+
z as default
|
|
339
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.g-picker[data-v-450b5b60]{width:100%}.g-picker__wrap[data-v-450b5b60]{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.g-picker__tags[data-v-450b5b60]{display:flex;flex-wrap:wrap;gap:8px;width:100%}.g-picker__tag-motion[data-v-450b5b60]{display:inline-flex}.g-picker__tag[data-v-450b5b60]{margin:0}.g-picker.is-disabled[data-v-450b5b60]{cursor:not-allowed}.g-picker__popover{box-sizing:border-box;background:var(--el-bg-color-overlay, #fff);border:1px solid var(--el-border-color-light);border-radius:4px;box-shadow:var(--el-box-shadow-light);padding:8px 0}.g-picker__popover .g-picker__tree-wrap{overflow:auto}.g-picker__popover .g-picker__node{display:inline-flex;align-items:center;gap:4px;font-size:13px}.g-picker__popover .g-picker__node.is-selectable{cursor:pointer;color:var(--el-text-color-primary)}.g-picker__popover .g-picker__node.is-selected{color:var(--el-color-primary)}
|
package/lib/GPie3D/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("vue"),pt=require("../
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("vue"),pt=require("../GBranched-BtF7heMk.js"),vt={class:"g-pie3d-tooltip__default"},gt={class:"g-pie3d-tooltip__name"},yt={class:"g-pie3d-tooltip__value"},mt=260,xt=h.defineComponent({__name:"index",props:{data:{default:()=>[]},config:{default:()=>({})},animation:{type:Boolean,default:!0}},emits:["slice-click"],setup(N,{emit:at}){const S=N,lt=at,V={alpha:55,depth:26,startAngle:0,colors:["#22d3ee","#3b82f6","#8b5cf6","#06b6d4","#0ea5e9","#a855f7","#14b8a6"],textColor:"#cbd5e1",radiusRatio:.55,hoverDistance:14,showLabel:!0,showPercent:!0,labelFontSize:12,opacity:.7,showAura:!0,glowColor:"",labelLineColor:"auto",labelLineWidth:1},a={...V,...S.config},E=h.ref(null),C=h.ref(null);let L=null,k=0,_=0,Y=1,p=0,u=0,g=0,M=0,A=[],$=S.animation?0:1,F=null,q=S.animation,I=null,X=0;const D=h.ref(-1),z=h.ref(!1),J=h.ref(0),K=h.ref(0),R=h.ref(null),O=h.ref(0),Q=t=>t*Math.PI/180,G=(t,l=0,n=0)=>({x:p+l+g*Math.cos(t),y:u+n+M*Math.sin(t)}),j=(t,l=0,n=0)=>({x:p+l+g*Math.cos(t),y:u+n+M*Math.sin(t)+a.depth}),W=()=>{if(!C.value||!E.value)return;const t=E.value,l=C.value;Y=window.devicePixelRatio||1,k=t.clientWidth,_=t.clientHeight,l.width=k*Y,l.height=_*Y,l.style.width=k+"px",l.style.height=_+"px",L=l.getContext("2d"),L&&L.setTransform(Y,0,0,Y,0,0),p=k/2,u=_/2-a.depth/2;const n=a.showLabel?60:10,s=Math.min(k,_-a.depth-n)/2*a.radiusRatio*1.6;g=Math.max(20,s),M=g*Math.cos(Q(a.alpha)),it(),q?st():U()},it=()=>{A=[];const t=S.data.reduce((n,s)=>n+(s.value||0),0);if(t<=0)return;let l=-Math.PI/2+Q(a.startAngle);S.data.forEach((n,s)=>{const i=n.value/t,d=i*Math.PI*2;A.push({data:n,index:s,color:n.color||a.colors[s%a.colors.length],startA:l,endA:l+d,midA:l+d/2,percent:i,hover:!1,hoverProgress:0}),l+=d})},st=()=>{$=0;const t=800,l=performance.now(),n=s=>{const i=Math.min(1,(s-l)/t);$=1-Math.pow(1-i,3),U(),i<1?F=requestAnimationFrame(n):(q=!1,F=null)};F=requestAnimationFrame(n)},rt=t=>1-Math.pow(1-t,3),Z=t=>{const l=X===0?16:t-X;X=t;const n=l/mt;let s=!1;for(const i of A){const d=i.hover?1:0;if(i.hoverProgress===d)continue;const v=d>i.hoverProgress?1:-1;i.hoverProgress+=v*n,(v>0&&i.hoverProgress>=d||v<0&&i.hoverProgress<=d)&&(i.hoverProgress=d),i.hoverProgress!==d&&(s=!0)}U(),s?I=requestAnimationFrame(Z):(I=null,X=0)},tt=()=>{I==null&&(X=0,I=requestAnimationFrame(Z))},T=(t,l)=>{let n=t.replace("#","");n.length===3&&(n=n.split("").map(v=>v+v).join(""));const s=parseInt(n.slice(0,2),16),i=parseInt(n.slice(2,4),16),d=parseInt(n.slice(4,6),16);return`rgba(${s},${i},${d},${l})`},U=()=>{if(!L)return;const t=L;if(t.clearRect(0,0,k,_),!A.length)return;const l=A[0]?.startA??0,n=Math.PI*2*$,s=l+n,i=A.map(e=>{const c=e.startA,f=Math.min(e.endA,s),y=f>c,x=rt(Math.max(0,Math.min(1,e.hoverProgress))),b=Math.cos(e.midA)*a.hoverDistance*x,P=Math.sin(e.midA)*a.hoverDistance*x;return{...e,startA:c,endA:f,valid:y,ox:b,oy:P,hp:x}});if(a.showAura){const e=t.createRadialGradient(p,u+a.depth,g*.1,p,u+a.depth,g*1.5);e.addColorStop(0,"rgba(6,182,212,0.15)"),e.addColorStop(.4,"rgba(59,130,246,0.08)"),e.addColorStop(.8,"rgba(139,92,246,0.03)"),e.addColorStop(1,"rgba(0,0,0,0)"),t.beginPath(),t.ellipse(p,u+a.depth,g*1.5,M*.9,0,0,Math.PI*2),t.fillStyle=e,t.fill(),t.strokeStyle="rgba(56,189,248,0.08)",t.lineWidth=1;for(let c=3;c>=1;c--){const f=g*(.3+c*.25);t.beginPath(),t.ellipse(p,u+a.depth,f,f*(M/g),0,0,Math.PI*2),t.stroke()}}const d=(e,c)=>{const f=a.glowColor||e.color,y={x:p+e.ox,y:u+e.oy},x={x:y.x,y:y.y+a.depth},b=G(c,e.ox,e.oy),P=j(c,e.ox,e.oy);t.fillStyle=T(f,a.opacity*.5),t.beginPath(),t.moveTo(y.x,y.y),t.lineTo(b.x,b.y),t.lineTo(P.x,P.y),t.lineTo(x.x,x.y),t.closePath(),t.fill(),t.strokeStyle=T(f,.8),t.lineWidth=.8,t.beginPath(),t.moveTo(b.x,b.y),t.lineTo(P.x,P.y),t.stroke()};for(const e of i)e.valid&&(Math.sin(e.startA)<=.001&&d(e,e.startA),Math.sin(e.endA)<=.001&&d(e,e.endA));const v=Math.PI/120;for(const e of i){if(!e.valid)continue;let c=e.startA;const f=a.glowColor||e.color;for(;c<e.endA;){const y=Math.min(c+v,e.endA),x=(c+y)/2;if(Math.sin(x)>0){const b=G(c,e.ox,e.oy),P=G(y,e.ox,e.oy),o=j(y,e.ox,e.oy),m=j(c,e.ox,e.oy);t.fillStyle=T(f,a.opacity*.4),t.beginPath(),t.moveTo(b.x,b.y),t.lineTo(P.x,P.y),t.lineTo(o.x,o.y),t.lineTo(m.x,m.y),t.closePath(),t.fill(),t.strokeStyle=T(f,.7),t.lineWidth=.8,t.beginPath(),t.moveTo(m.x,m.y),t.lineTo(o.x,o.y),t.stroke()}c=y}}for(const e of i)e.valid&&(Math.sin(e.startA)>.001&&d(e,e.startA),Math.sin(e.endA)>.001&&d(e,e.endA));for(const e of i){if(!e.valid)continue;const c=a.glowColor||e.color;e.hp>.01&&(t.save(),t.shadowColor=c,t.shadowBlur=12*e.hp,t.beginPath(),t.moveTo(p+e.ox,u+e.oy),t.ellipse(p+e.ox,u+e.oy,g,M,0,e.startA,e.endA),t.closePath(),t.fillStyle=T(c,.08*e.hp),t.fill(),t.restore()),t.beginPath(),t.moveTo(p+e.ox,u+e.oy),t.ellipse(p+e.ox,u+e.oy,g,M,0,e.startA,e.endA),t.closePath();const f=t.createRadialGradient(p+e.ox-g*.2,u+e.oy-M*.2,0,p+e.ox,u+e.oy,g*1.05);f.addColorStop(0,T(c,a.opacity*.95)),f.addColorStop(.6,T(c,a.opacity*.8)),f.addColorStop(1,T(c,a.opacity*.6)),t.fillStyle=f,t.fill(),t.strokeStyle=T(c,.95),t.lineWidth=.8+.6*e.hp,t.stroke()}if(a.showLabel&&$>=.999){t.font=`${a.labelFontSize}px Arial, sans-serif`,t.textBaseline="middle";const e=[],c=[],f=a.labelFontSize+6,y=14,x=4;for(const o of i){if(!o.valid)continue;const m=Math.cos(o.midA)>=0,w=p+o.ox+g*1.02*Math.cos(o.midA),r=u+o.oy+M*1.02*Math.sin(o.midA),H=u+o.oy+M*1.18*Math.sin(o.midA),dt=a.showPercent?`${o.data.name} ${(o.percent*100).toFixed(1)}%`:`${o.data.name}`,ft=!a.labelLineColor||a.labelLineColor==="auto"?a.glowColor||o.color:a.labelLineColor,ut={slice:o,text:dt,isRight:m,anchorX:w,anchorY:r,targetY:H,y:H,color:ft};(m?c:e).push(ut)}const b=o=>{if(!o.length)return;o.sort((r,H)=>r.targetY-H.targetY);const m=x+a.labelFontSize/2,w=_-x-a.labelFontSize/2;for(let r=0;r<o.length;r++)r===0?o[r].y=Math.max(m,o[r].targetY):o[r].y=Math.max(o[r].targetY,o[r-1].y+f);if(o[o.length-1].y>w){o[o.length-1].y=w;for(let r=o.length-2;r>=0;r--)o[r].y>o[r+1].y-f&&(o[r].y=o[r+1].y-f)}for(let r=0;r<o.length;r++)o[r].y<m&&(o[r].y=m)};b(e),b(c),t.lineWidth=a.labelLineWidth;const P=[...e,...c];for(const o of P){const m=t.measureText(o.text).width;let w;if(o.isRight){const r=Math.min(Math.max(o.anchorX+6,o.anchorX+Math.abs(o.targetY-o.y)*.2+6),k-x-m-y);w=r+y,t.strokeStyle=o.color,t.beginPath(),t.moveTo(o.anchorX,o.anchorY),t.lineTo(r,o.y),t.lineTo(w,o.y),t.stroke(),t.fillStyle=a.textColor,t.textAlign="left",t.fillText(o.text,w+2,o.y)}else{const r=Math.max(Math.min(o.anchorX-6,o.anchorX-Math.abs(o.targetY-o.y)*.2-6),x+m+y);w=r-y,t.strokeStyle=o.color,t.beginPath(),t.moveTo(o.anchorX,o.anchorY),t.lineTo(r,o.y),t.lineTo(w,o.y),t.stroke(),t.fillStyle=a.textColor,t.textAlign="right",t.fillText(o.text,w-2,o.y)}}}},et=(t,l)=>{for(let n=0;n<A.length;n++){const s=A[n],i=(t-p)/g,d=(l-u)/M;if(i*i+d*d>1)continue;let v=Math.atan2((l-u)/M,(t-p)/g);for(;v<s.startA;)v+=Math.PI*2;for(;v>s.startA+Math.PI*2;)v-=Math.PI*2;if(v>=s.startA&&v<=s.endA)return n}return-1},ot=t=>{const l=C.value,n=l.getBoundingClientRect(),s=n.width/(l.clientWidth||n.width)||1,i=n.height/(l.clientHeight||n.height)||1;return{mx:(t.clientX-n.left)/s,my:(t.clientY-n.top)/i}},ct=t=>{if(!C.value)return;const{mx:l,my:n}=ot(t),s=et(l,n);if(s!==D.value&&(D.value=s,A.forEach((i,d)=>i.hover=d===s),tt()),s>=0){const i=A[s];z.value=!0,R.value=i.data,O.value=i.percent;const d=E.value?.clientWidth||0,v=E.value?.clientHeight||0,e=Math.min(l+12,d-140),c=Math.min(n+12,v-60);J.value=Math.max(0,e),K.value=Math.max(0,c)}else z.value=!1,R.value=null},ht=()=>{D.value!==-1&&(D.value=-1,A.forEach(t=>t.hover=!1),tt()),z.value=!1,R.value=null},nt=t=>{if(!C.value)return;const{mx:l,my:n}=ot(t),s=et(l,n);s>=0&<("slice-click",A[s].data,s)};return h.watch(()=>S.data,()=>{Object.assign(a,V,S.config),q=S.animation,W()},{deep:!0}),h.watch(()=>S.config,()=>{Object.assign(a,V,S.config),W()},{deep:!0}),h.onMounted(()=>{W(),window.addEventListener("resize",W),C.value?.addEventListener("click",nt)}),h.onUnmounted(()=>{window.removeEventListener("resize",W),C.value?.removeEventListener("click",nt),F&&cancelAnimationFrame(F),I&&cancelAnimationFrame(I)}),(t,l)=>(h.openBlock(),h.createElementBlock("div",{class:"g-pie3d-container",ref_key:"containerRef",ref:E},[h.createElementVNode("canvas",{ref_key:"canvasRef",ref:C,onMousemove:ct,onMouseleave:ht},null,544),z.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"g-pie3d-tooltip",style:h.normalizeStyle({left:`${J.value}px`,top:`${K.value}px`})},[h.renderSlot(t.$slots,"tooltip",{data:R.value,percent:O.value},()=>[h.createElementVNode("div",vt,[h.createElementVNode("p",gt,h.toDisplayString(R.value?.name),1),h.createElementVNode("p",yt,h.toDisplayString(R.value?.value)+" ("+h.toDisplayString((O.value*100).toFixed(1))+"%) ",1)])],!0)],4)):h.createCommentVNode("",!0)],512))}}),B=pt._export_sfc(xt,[["__scopeId","data-v-d37c2ffe"]]);B.install=N=>{N.component(B.name,B)};exports.GPie3D=B;exports.default=B;
|
package/lib/GPie3D/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as xt, ref as C, watch as it, onMounted as Mt, onUnmounted as At, createElementBlock as st, openBlock as rt, createElementVNode as D, createCommentVNode as bt, normalizeStyle as Pt, renderSlot as wt, toDisplayString as J } from "vue";
|
|
2
|
-
import { _ as St } from "../
|
|
2
|
+
import { _ as St } from "../GBranched-vnLlYOl9.mjs";
|
|
3
3
|
const Tt = { class: "g-pie3d-tooltip__default" }, Ct = { class: "g-pie3d-tooltip__name" }, _t = { class: "g-pie3d-tooltip__value" }, kt = 260, It = /* @__PURE__ */ xt({
|
|
4
4
|
__name: "index",
|
|
5
5
|
props: {
|
package/lib/GProgress/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../GBranched-BtF7heMk.js"),c={class:"g-progress-bar-container"},m={class:"g-progress-info"},p=["aria-valuenow"],g={class:"g-progress-splash","aria-hidden":"true"},v=e.defineComponent({name:"GProgress",inheritAttrs:!1,__name:"index",props:{count:{default:0},height:{default:10},gradient:{default:()=>["#3b82f6","#f97316"]},textColor:{default:"#fff"},wave:{type:Boolean,default:!1},waveSpeed:{default:3},forceAnimation:{type:Boolean,default:!1}},setup(s){const r=s,l=e.computed(()=>{const t=Number(r.count);return Number.isFinite(t)?Math.min(100,Math.max(0,t)):0}),i=e.computed(()=>typeof r.height=="number"?`${r.height}px`:r.height),n=e.computed(()=>{const[t="#3b82f6",o="#f97316"]=r.gradient??[];return`linear-gradient(90deg, ${t} 0%, ${o} 100%)`});return(t,o)=>(e.openBlock(),e.createElementBlock("div",c,[e.createElementVNode("div",m,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),e.createElementVNode("div",{class:"g-progress-wrapper",style:e.normalizeStyle({height:i.value}),role:"progressbar","aria-valuenow":l.value,"aria-valuemin":"0","aria-valuemax":"100"},[e.createElementVNode("div",{class:"g-progress-bg",style:e.normalizeStyle({background:n.value})},null,4),e.createElementVNode("div",{class:e.normalizeClass(["g-progress-fill",{"is-wave":t.wave,"is-force-animation":t.forceAnimation}]),style:e.normalizeStyle({width:`${l.value}%`,background:n.value})},[t.wave?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",{class:"g-progress-sweep g-progress-sweep--front",style:e.normalizeStyle({animationDuration:`${t.waveSpeed}s`}),"aria-hidden":"true"},null,4),e.createElementVNode("div",{class:"g-progress-sweep g-progress-sweep--back",style:e.normalizeStyle({animationDuration:`${t.waveSpeed*1.6}s`}),"aria-hidden":"true"},null,4),o[0]||(o[0]=e.createElementVNode("div",{class:"g-progress-grid","aria-hidden":"true"},null,-1)),e.createElementVNode("div",{class:"g-progress-impact",style:e.normalizeStyle({animationDuration:`${t.waveSpeed}s`}),"aria-hidden":"true"},null,4),e.createElementVNode("div",g,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,d=>e.createElementVNode("span",{key:d,class:"g-progress-splash__particle",style:e.normalizeStyle({animationDuration:`${t.waveSpeed}s`})},null,4)),64))])],64)):e.createCommentVNode("",!0)],6)],12,p),e.createElementVNode("div",{class:"g-progress-count",style:e.normalizeStyle({color:t.textColor})},[e.renderSlot(t.$slots,"count",{},()=>[e.createTextVNode(e.toDisplayString(l.value)+"%",1)],!0)],4)]))}}),a=u._export_sfc(v,[["__scopeId","data-v-324fae85"]]);a.install=s=>{s.component(a.name,a)};exports.GProgress=a;exports.default=a;
|
package/lib/GProgress/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as v, computed as i, createElementBlock as l, openBlock as d, createElementVNode as s, renderSlot as g, normalizeStyle as a, normalizeClass as h, createCommentVNode as w, Fragment as c, renderList as y, createTextVNode as b, toDisplayString as $ } from "vue";
|
|
2
|
-
import { _ as S } from "../
|
|
2
|
+
import { _ as S } from "../GBranched-vnLlYOl9.mjs";
|
|
3
3
|
const _ = { class: "g-progress-bar-container" }, k = { class: "g-progress-info" }, C = ["aria-valuenow"], D = {
|
|
4
4
|
class: "g-progress-splash",
|
|
5
5
|
"aria-hidden": "true"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),r=require("motion-v"),te=require("../GBranched-BtF7heMk.js"),oe=["for"],ae=["id","aria-checked","aria-disabled","aria-label","data-on","data-held"],le=["for"],ne=.4,re=600,se=.36,ue=1.035,ie=t.defineComponent({name:"GRadio",__name:"index",props:{checked:{type:Boolean,default:void 0},defaultChecked:{type:Boolean,default:!1},size:{default:"middle"},label:{default:""},disabled:{type:Boolean,default:!1},trackColor:{default:void 0},trackOnColor:{default:void 0},thumbColor:{default:void 0},thumbOnColor:{default:void 0},width:{default:void 0},height:{default:void 0},radius:{default:void 0},ariaLabel:{default:void 0},className:{default:""},id:{default:void 0}},emits:["update:checked","change"],setup(C,{emit:L}){const T=(e,o,l)=>Math.min(l,Math.max(o,e)),x={stiffness:320,damping:40,mass:.6},z={stiffness:520,damping:34,mass:.6},P={fine:4,coarse:8},E={large:{width:48,height:24},middle:{width:40,height:20},small:{width:32,height:16}},a=C,R=L,y=r.useReducedMotion(),M=t.computed(()=>E[a.size]??E.middle),I=t.computed(()=>a.width??M.value.width),f=t.computed(()=>a.height??M.value.height),p=t.computed(()=>Math.max(3,Math.round(f.value*.11))),N=t.computed(()=>f.value-p.value*2),u=t.computed(()=>p.value),i=t.computed(()=>I.value-p.value-N.value),D=t.computed(()=>(u.value+i.value)/2),B=t.computed(()=>Math.min(a.radius??f.value/2,f.value/2)),H=t.computed(()=>Math.max(2,B.value-p.value)),O=t.computed(()=>a.checked!==void 0),V=t.ref(a.defaultChecked),d=t.computed(()=>O.value?!!a.checked:V.value),v=t.ref(!1),X=t.ref(null);let c=null,m=d.value,g=!1,$,_=null;const j=t.useId(),S=t.computed(()=>a.id??j),s=r.motionValue(d.value?i.value:u.value),q=s.on("change",e=>{(e<u.value||e>i.value)&&s.jump(T(e,u.value,i.value))}),A=r.useSpring(r.useVelocity(s),x),b=r.useSpring(1,z),G=e=>{const o=y.value?0:se;return 1+Math.min(ne,Math.abs(e)/re)*o},W=r.useTransform([A,b],([e,o])=>G(e)*o),K=r.useTransform([A,b],([e,o])=>o/G(e)),k=e=>{e!==m&&(m=e,O.value||(V.value=e),R("update:checked",e),R("change",e))};t.watch(d,e=>m=e),t.watch([d,v,u,i,y],()=>{if(v.value)return;_?.stop();const e=d.value?i.value:u.value;if(y.value){s.jump(e);return}_=r.animate(s,e,{type:"spring",stiffness:300,damping:28,mass:.9,velocity:0,restDelta:.001,restSpeed:.01})},{flush:"post"}),t.onUnmounted(()=>{_?.stop(),q(),clearTimeout($)});const Y=e=>{const o=X.value;if(!o)return 0;const l=o.getBoundingClientRect(),n=l.width/(o.offsetWidth||l.width)||1;return(e-l.left)/n},F=e=>{if(!(a.disabled||c||e.button!==0)){c={id:e.pointerId,grab:null,moved:!1,startX:e.clientX,onAtPress:m,slop:e.pointerType==="touch"?P.coarse:P.fine};try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}v.value=!0}},U=e=>{const o=c;if(!o||o.id!==e.pointerId)return;const l=Y(e.clientX);if(o.grab===null){o.grab=l-s.get();return}if(!o.moved&&Math.abs(e.clientX-o.startX)>o.slop&&(o.moved=!0),!o.moved)return;const n=T(l-o.grab,u.value,i.value);s.set(n),k(n>D.value)},w=(e,o,l)=>{const n=c;if(!(!n||n.id!==e)){c=null;try{o.releasePointerCapture(e)}catch{}l?k(n.onAtPress):n.moved||k(!m),g=!0,$=setTimeout(()=>{g=!1},0),v.value=!1}},Z=e=>{e.key==="Escape"&&c&&w(c.id,e.currentTarget,!0)},J=()=>{if(g){g=!1;return}a.disabled||k(!m)},Q=e=>{e.pointerType==="mouse"&&!a.disabled&&b.set(ue)},ee=t.computed(()=>({"--gr-w":`${I.value}px`,"--gr-h":`${f.value}px`,"--gr-inset":`${p.value}px`,"--gr-thumb":`${N.value}px`,"--gr-r":`${B.value}px`,"--gr-thumb-r":`${H.value}px`,...a.trackColor&&{"--gr-track":a.trackColor},...a.trackOnColor&&{"--gr-track-on":a.trackOnColor},...a.thumbColor&&{"--gr-thumb-color":a.thumbColor},...a.thumbOnColor&&{"--gr-thumb-on":a.thumbOnColor}}));return(e,o)=>(t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["g-radio",e.className])},[e.$slots.left?(t.openBlock(),t.createElementBlock("label",{key:0,for:S.value,class:"g-radio__label"},[t.renderSlot(e.$slots,"left",{},void 0,!0)],8,oe)):t.createCommentVNode("",!0),t.createElementVNode("button",{id:S.value,type:"button",role:"switch",class:"g-radio__button","aria-checked":d.value,"aria-disabled":e.disabled||void 0,"aria-label":e.ariaLabel,"data-on":d.value?"":void 0,"data-held":v.value?"":void 0,style:t.normalizeStyle(ee.value),onPointerdown:F,onPointermove:U,onPointerup:o[0]||(o[0]=l=>w(l.pointerId,l.currentTarget,!1)),onPointercancel:o[1]||(o[1]=l=>w(l.pointerId,l.currentTarget,!0)),onPointerenter:Q,onPointerleave:o[2]||(o[2]=l=>t.unref(b).set(1)),onKeydown:Z,onClick:J},[t.createElementVNode("span",{ref_key:"trackRef",ref:X,class:"g-radio__track"},[t.createVNode(t.unref(r.motion).span,{class:"g-radio__thumb","aria-hidden":"true",style:t.normalizeStyle({x:t.unref(s),scaleX:t.unref(W),scaleY:t.unref(K)})},null,8,["style"])],512)],44,ae),e.$slots.right||e.label?(t.openBlock(),t.createElementBlock("label",{key:1,for:S.value,class:"g-radio__label"},[t.renderSlot(e.$slots,"right",{},()=>[t.createTextVNode(t.toDisplayString(e.label),1)],!0)],8,le)):t.createCommentVNode("",!0)],2))}}),h=te._export_sfc(ie,[["__scopeId","data-v-0e16217a"]]);h.install=C=>{C.component(h.name,h)};exports.GRadio=h;exports.default=h;
|