litos-ui 0.10.0 → 0.11.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/base.d.ts +4 -0
- package/lib/base.js +13 -7
- package/lib/button/index.d.ts +1 -0
- package/lib/button/index.js +2 -2
- package/lib/dialog/dialog_container.d.ts +28 -0
- package/lib/dialog/dialog_container.js +100 -0
- package/lib/dialog/index.d.ts +30 -0
- package/lib/dialog/index.js +86 -0
- package/lib/icon/close.d.ts +5 -0
- package/lib/icon/close.js +10 -0
- package/lib/index.d.ts +16 -2
- package/lib/index.js +98 -85
- package/lib/input/index.d.ts +1 -0
- package/lib/input/index.js +2 -1
- package/lib/list/index.d.ts +1 -1
- package/lib/litos-ui.css +1 -1
- package/lib/loading/index.d.ts +40 -0
- package/lib/loading/index.js +135 -0
- package/lib/radio/index.js +1 -1
- package/lib/utils/index.d.ts +0 -5
- package/lib/utils/index.js +56 -63
- package/package.json +71 -72
- package/styles/dialog.css +56 -0
- package/styles/loading.css +100 -0
- package/styles/reset.css +10 -0
- package/lib/litos-ui.min.js +0 -1
package/lib/list/index.d.ts
CHANGED
package/lib/litos-ui.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
html,body{height:100%}body{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent;margin:0;font-size:14px;line-height:1.6}img{vertical-align:top}ul,ol{margin:0;padding:0;list-style:none}div{box-sizing:border-box}a{color:#4998f6;cursor:pointer;text-decoration:none;transition:color .3s}a:hover{color:#5ba2f7}a:active{color:#64a7f7}p{color:#333;margin:5px 0;font-size:16px;line-height:1.4}l-button:not([text])+l-button{margin-left:10px}.l-message{color:var(--l-primary-color,#722ed1);z-index:1000;background:#f0faff;border:1px solid #d4eeff;border-radius:5px;align-items:center;padding:10px;font-size:14px;transition:opacity .3s,transform .3s,top .3s;display:flex;position:fixed;top:20px;left:50%;transform:translate(-50%)}.l-message .l-message-icon{margin-right:5px}.l-message.l-message-success{color:var(--l-success-color,#52c41a);background:#edfff3;border-color:#bbf2cf}.l-message.l-message-error{color:var(--l-error-color,#f5222d);background:#ffefe6;border-color:#ffcfb8}.l-message.l-message-warn{color:var(--l-warn-color,#f90);background:#fff9e6;border-color:#ffe7a3}.l-message-container{align-items:center;display:flex}.l-message-fade-enter-from,.l-message-fade-leave-to{opacity:0;transform:translate(-50%,-100%)}@media screen and (max-width:768px){.l-message{width:90%}}@keyframes l-rotate-frame{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.l-rotate-anim{animation:1.5s linear infinite l-rotate-frame}:host{--l-btn-text-color:#fff;--l-btn-hover-text-color:var(--l-btn-text-color);--l-btn-active-text-color:var(--l-btn-text-color);--l-btn-border-color:var(--l-primary-color,#722ed1);--l-btn-background:var(--l-btn-border-color);--l-btn-hover-border-color:var(--l-primary-color-light1,#9254de);--l-btn-hover-background:var(--l-btn-hover-border-color);--l-btn-active-border-color:var(--l-primary-color-dark1,#531dab);--l-btn-active-background:var(--l-btn-active-border-color);--l-btn-disabled-color:#c9c9c9;--l-btn-disabled-background:#fbfbfb;--l-btn-disabled-border-color:#e6e6e6;width:auto;display:inline-block}.l-btn{cursor:pointer;box-sizing:border-box;vertical-align:middle;width:100%;height:var(--l-form-edit-height,32px);color:var(--l-btn-text-color);background:var(--l-btn-background);border:1px solid var(--l-btn-border-color);border-radius:3px;outline:none;justify-content:center;align-items:center;gap:5px;padding:0 15px;font-size:14px;line-height:1;transition:border-color .3s,background-color .3s,color .3s;display:inline-flex;position:relative}.l-btn:hover{border-color:var(--l-btn-hover-border-color,var(--l-btn-hover-background));color:var(--l-btn-hover-text-color);background:var(--l-btn-hover-background)}.l-btn:active{border-color:var(--l-btn-active-border-color,var(--l-btn-active-background));color:var(--l-btn-active-text-color);background:var(--l-btn-active-background)}.l-btn-normal{--l-btn-text-color:auto;--l-btn-background:transparent;--l-btn-border-color:#d9d9d9;--l-btn-hover-text-color:var(--l-primary-color-light1,#9254de);--l-btn-active-text-color:var(--l-primary-color-dark1,#531dab);--l-btn-hover-background:#fff;--l-btn-active-background:#fff;--l-btn-hover-border-color:var(--l-btn-hover-text-color);--l-btn-active-border-color:var(--l-btn-active-text-color)}.l-btn-primary{--l-btn-background:var(--l-primary-color,#722ed1);--l-btn-hover-background:var(--l-primary-color-light1,#9254de);--l-btn-active-background:var(--l-primary-color-dark1,#531dab)}.l-btn:not(.l-btn-loading):disabled{border-color:var(--l-btn-disabled-border-color);background:var(--l-btn-disabled-background);color:var(--l-btn-disabled-color);cursor:not-allowed;opacity:1}.l-btn-text{--l-btn-background:transparent;--l-btn-border-color:transparent;--l-btn-hover-border-color:transparent;--l-btn-active-border-color:transparent;--l-btn-disabled-background:transparent;--l-btn-disabled-border-color:transparent;--l-btn-hover-background:transparent;--l-btn-active-background:transparent;height:auto;padding:5px}.l-btn-primary.l-btn-text{--l-btn-text-color:var(--l-primary-color,#722ed1);--l-btn-hover-text-color:var(--l-primary-color-light1,#9254de);--l-btn-active-text-color:var(--l-primary-color-dark1,#531dab)}.l-btn-ghost{--l-btn-text-color:var(--l-btn-border-color);--l-btn-background:transparent;--l-btn-hover-background:transparent;--l-btn-active-background:transparent;--l-btn-hover-text-color:var(--l-btn-hover-border-color);--l-btn-active-text-color:var(--l-btn-active-border-color)}.l-btn-round{border-radius:calc(var(--l-form-edit-height,32px)/2)}.l-btn-circle{width:var(--l-form-edit-height,32px);border-radius:50%;padding:0}.l-btn-block{width:100%}.l-btn:not(.l-btn-text)+.l-btn{margin-left:10px}html.dark .l-btn:disabled{--l-btn-disabled-background:#ffffff14;--l-btn-disabled-color:#ffffff4d;--l-btn-disabled-border-color:#ffffff4d}.l-icon{fill:currentColor;vertical-align:middle;width:1em;height:1em;display:inline-block}.l-input{box-sizing:border-box;width:100%;max-width:100%;height:var(--l-form-edit-height,32px);border:1px solid var(--l-border-color,#dedede);text-align:inherit;vertical-align:middle;border-radius:3px;outline:none;padding:0 5px;transition:border-color .3s}.l-input.is-error{--l-border-color:var(--nt-error-color,#ed3f13)}.l-input:not(.is-error):focus{border-color:var(--l-primary-color,#722ed1)}.l-input:disabled{cursor:not-allowed;background:var(--l-disabled-color,#f5f7fa)}:host{display:block}.l-form{grid-template-columns:var(--l-form-label-width,auto)1fr;row-gap:20px;display:grid}.l-form-inline{flex-flow:wrap;gap:20px;display:flex}.l-form.l-form-inline{--l-form-item-display:flex}.l-form.l-form--left{--l-form-label-align:left}.l-form.l-form--top{--l-form-item-display:grid;--l-form-label-align:left;--l-form-label-empty-display:none;grid-template-columns:1fr}:host{align-items:center;display:flex}.l-radio{--l-radio-size:16px;--l-radio-label-color:#333;--l-radio-disabled-color:#e6e6e6;--l-radio-disabled-label-color:var(--l-disabled-color,#c0c4cc);--l-radio-checked-color:var(--l-primary-color,#722ed1);--l-radio-item-margin:10px;cursor:pointer;align-items:center;display:inline-flex;position:relative}.l-radio__label{margin-left:5px;transition:color .3s ease-in-out}.l-radio__input{z-index:-1;opacity:0;width:0;height:0;position:absolute}.l-radio__inner{width:var(--l-radio-size);height:var(--l-radio-size);box-sizing:border-box;border:1px solid #dcddd9;border-radius:50%;justify-content:center;align-items:center;transition:border-color .3s ease-in-out;display:flex}.l-radio__inner:before{content:"";background-color:#0000;border-radius:50%;width:60%;height:60%;transition:background-color .3s ease-in-out;display:block}.l-radio.is-checked .l-radio__inner{border-color:var(--l-primary-color,#722ed1)}.l-radio.is-checked .l-radio__inner:before{background-color:var(--l-primary-color,#722ed1)}.l-radio.is-checked .l-radio__label{color:var(--l-primary-color,#722ed1)}.l-radio--disabled{cursor:not-allowed}.l-radio--disabledd .l-radio__inner{border-color:var(--l-radio-disabled-color)}.l-radio--disabled .l-radio__label{color:var(--l-radio-disabled-label-color)}.l-radio:not(:first-child){margin-left:var(--l-radio-item-margin)}.l-radio--button .l-radio__label{height:var(--l-form-edit-height,32px);border:1px solid #c0c4cc;border-left-width:0;justify-content:center;align-items:center;margin-left:0;padding:0 15px;display:inline-flex}.l-radio--button:not(:first-of-type){margin-left:0}.l-radio--button:first-of-type .l-radio__label{border-left-width:1px;border-top-left-radius:3px;border-bottom-left-radius:3px}.l-radio--button:last-of-type .l-radio__label{border-top-right-radius:3px;border-bottom-right-radius:3px}.is-checked.l-radio--button .l-radio__label{background-color:var(--l-radio-checked-color);color:#fff;border-color:var(--l-radio-checked-color)}:host{-webkit-overflow-scrolling:touch;height:100%;display:block;position:relative;overflow:auto}.l-list-loadmore{color:#999;justify-content:center;align-items:center;padding:10px;display:flex}.l-list-icon{margin-right:10px;font-size:24px;transform:rotate(80deg)}.l-polygon{--l-polygen-size:10px;--l-polygen-width:var(--l-polygen-size);--l-polygen-height:var(--l-polygen-size);--l-polygen-background:#666;width:var(--l-polygen-width);height:var(--l-polygen-height);background:var(--l-polygen-background);transition:background .3s ease-in-out;display:inline-block}.l-polygon-triangle-top{clip-path:polygon(calc(var(--l-polygen-width)/2)0,var(--l-polygen-width)var(--l-polygen-height),0 var(--l-polygen-height))}.l-polygon-triangle-top-left{clip-path:polygon(0 0,var(--l-polygen-width)0,0 var(--l-polygen-height))}.l-polygon-triangle-top-right{clip-path:polygon(0 0,var(--l-polygen-width)0,var(--l-polygen-width)var(--l-polygen-height))}.l-polygon-triangle-right{clip-path:polygon(0 0,var(--l-polygen-width)calc(var(--l-polygen-height)/2),0 var(--l-polygen-height))}.l-polygon-triangle-left{clip-path:polygon(var(--l-polygen-width)0,var(--l-polygen-width)var(--l-polygen-height),0 calc(var(--l-polygen-height)/2))}.l-polygon-triangle-bottom{clip-path:polygon(0 0,var(--l-polygen-width)0,calc(var(--l-polygen-width)/2)var(--l-polygen-height))}.l-polygon-triangle-bottom-left{clip-path:polygon(0 0,0 var(--l-polygen-height),var(--l-polygen-width)var(--l-polygen-height))}.l-polygon-triangle-bottom-right{clip-path:polygon(var(--l-polygen-width)0,var(--l-polygen-width)var(--l-polygen-height),0 var(--l-polygen-height))}:host{--l-switch-height:22px;--l-switch-width:40px;box-sizing:border-box;width:auto;width:var(--l-switch-width);height:var(--l-switch-height);border-radius:calc(var(--l-switch-height)/2);cursor:pointer;vertical-align:middle;background-color:#dcdfe6;border:1px solid #c2c2c2;justify-content:flex-start;align-items:center;padding:2px;transition:all .3s ease-in-out;display:inline-flex;position:relative}:host(:hover),:host(.l-switch--checked):hover{border-color:var(--l-primary-color,#722ed1)}:host(.l-switch--checked){background-color:var(--l-primary-color,#722ed1);border-color:var(--l-primary-color,#722ed1)}.l-switch-action{width:calc(var(--l-switch-height) - 6px);box-sizing:border-box;background-color:#fff;border-radius:50%;justify-content:center;align-items:center;padding:2px;font-size:12px;transition:all .3s ease-in-out;display:flex;position:absolute;top:2px;bottom:2px;left:2px}.l-switch-text{color:#fff;padding-left:calc(var(--l-switch-width) - 20px);transition:padding-left .3s ease-in-out}:host(.l-switch--checked) .l-switch-action{left:calc(var(--l-switch-width) - var(--l-switch-height) + 3px)}:host(.l-switch--checked) .l-switch-text{padding-left:5px}:host{--l-input-width:60px;--l-tabbar-hover-color:var(--l-primary-color-light1,#9254de);--l-tabbar-active-color:var(--l-primary-color,#722ed1);--l-tabbar-item-gap:0;--l-tabbar-height:38px;height:var(--l-tabbar-height);background-color:#fff;display:block;position:relative;overflow:hidden}.l-tabbar-wrapper{align-items:stretch;gap:var(--l-tabbar-item-gap);flex-wrap:nowrap;height:100%;display:flex}.l-tabbar-item{color:#666;cursor:pointer;justify-content:center;align-items:center;transition:all .3s ease-in-out;display:inline-flex}.l-tabbar-item:hover{color:var(--l-tabbar-hover-color)}.l-tabbar-item.active{color:var(--l-tabbar-active-color)}.l-tabbar-item-icon{justify-content:center;align-items:center;margin-bottom:5px;font-size:18px;display:flex}.l-tabbar-item-icon.only{margin-bottom:0;font-size:24px}:host(.l-tabbar--nav){--l-tabbar-height:50px;width:100%}:host(.l-tabbar--nav) .l-tabbar-item{flex-direction:column;flex-grow:1;justify-content:center;align-items:center;font-size:12px;line-height:1;display:inline-flex}:host(.l-tabbar--bar){--l-tabbar-bar-vertical-padding:10px;--l-tabbar-item-gap:30px;--l-tabbar-line-color:var(--l-primary-color,#722ed1);white-space:nowrap;overflow:auto}.l-tabbar--bar-line{background-color:var(--l-tabbar-line-color);border-radius:1px;width:32px;height:2px;transition:all .3s ease-in-out;position:absolute;bottom:0;left:0}:host(.l-tabbar--card){--l-tabbar-card-border-color:#f5f7fa;--l-tabbar-line-color:#fff;--l-tabbar-item-gap:0;--l-tabbar-card-border-radius:5px}.l-tabbar-card-border{background-color:var(--l-tabbar-card-border-color);height:1px;position:absolute;bottom:0;left:0;right:0}:host(.l-tabbar--card) .l-tabbar-item{background:#f5f7fa;border:1px solid #f0f0f0;padding:0 15px}:host(.l-tabbar--card) .l-tabbar-item:first-child{border-top-left-radius:var(--l-tabbar-card-border-radius)}:host(.l-tabbar--card) .l-tabbar-item:last-child{border-top-right-radius:var(--l-tabbar-card-border-radius)}:host(.l-tabbar-gap) .l-tabbar-item{border-top-left-radius:var(--l-tabbar-card-border-radius);border-top-right-radius:var(--l-tabbar-card-border-radius)}:host(.l-tabbar--card) .l-tabbar-item.active{background:#fff}:host{width:auto;display:inline-flex}.l-theme-btn::part(default){--l-btn-background:transparent;--l-btn-hover-background:transparent;--l-btn-text-color:#9ca3af;--l-btn-hover-text-color:#666;width:var(--l-form-edit-height,32px);padding:0;font-size:18px}.l-theme-switch.l-switch--checked{background-color:#65757129;border-color:#3c3f44}.l-theme-switch.l-switch--checked::part(action){color:#fff;background-color:#000}html.dark .l-theme-btn{--l-btn-hover-text-color:#fff}:host{width:max-content;position:relative}.l-popover--content{--l-popover-border-color:#e4e4e4;--l-popover-color:#666;--l-popover-box-shadow:0 4px 8px #0000001f;--l-popover-background:#fff;--l-popover-arrow-size:8px;--l-popover-offset:10px;width:max-content;box-shadow:var(--l-popover-box-shadow);background:var(--l-popover-background);border:1px solid var(--l-popover-border-color);z-index:30;color:var(--l-popover-color);box-sizing:border-box;border-radius:4px;padding:10px;position:absolute}.l-popover-tooltip{--l-popover-color:#fff;--l-popover-box-shadow:4px 4px 8px #0000004d;--l-popover-background:#383838;--l-popover-arrow-size:6px;border-radius:5px;padding:8px;font-size:12px;line-height:1}.l-popover--arrow{width:var(--l-popover-arrow-size,8px);height:var(--l-popover-arrow-size,8px);z-index:-1;position:absolute}.l-popover--arrow:before{content:"";width:var(--l-popover-arrow-size,8px);height:var(--l-popover-arrow-size,8px);background-color:var(--l-popover-background);border-style:solid;border-width:1px;position:absolute;transform:rotate(45deg)}.l-popover-top,.l-popover-top-start,.l-popover-top-end{bottom:calc(100% + var(--l-popover-offset,10px))}.l-popover-bottom,.l-popover-bottom-start,.l-popover-bottom-end{top:calc(100% + var(--l-popover-offset,10px))}.l-popover-top-start,.l-popover-bottom-start{left:0}.l-popover-top-end,.l-popover-bottom-end{right:0}.l-popover-bottom,.l-popover-top{left:50%;transform:translate(-50%)}.l-popover-left-start,.l-popover-left,.l-popover-left-end{right:calc(100% + var(--l-popover-offset,10px))}.l-popover-left-start,.l-popover-right-start{top:0}.l-popover-left-end,.l-popover-right-end{bottom:0}.l-popover-left,.l-popover-right{top:50%;transform:translateY(-50%)}.l-popover-right-start,.l-popover-right,.l-popover-right-end{left:calc(100% + var(--l-popover-offset,10px))}.l-popover-top .l-popover--arrow,.l-popover-bottom .l-popover--arrow{margin-left:-4px;left:50%}.l-popover-top .l-popover--arrow:before,.l-popover-top-start .l-popover--arrow:before,.l-popover-top-end .l-popover--arrow:before{border-color:transparent var(--l-popover-border-color)var(--l-popover-border-color)transparent}.l-popover-bottom .l-popover--arrow:before,.l-popover-bottom-start .l-popover--arrow:before,.l-popover-bottom-end .l-popover--arrow:before{border-color:var(--l-popover-border-color)transparent transparent var(--l-popover-border-color)}.l-popover-top .l-popover--arrow,.l-popover-top-start .l-popover--arrow,.l-popover-top-end .l-popover--arrow{bottom:calc((var(--l-popover-arrow-size,8px)/-2) + 1px)}.l-popover-top-start .l-popover--arrow,.l-popover-bottom-start .l-popover--arrow{left:10px}.l-popover-top-end .l-popover--arrow,.l-popover-bottom-end .l-popover--arrow{right:10px}.l-popover-bottom .l-popover--arrow,.l-popover-bottom-start .l-popover--arrow,.l-popover-bottom-end .l-popover--arrow{top:calc((var(--l-popover-arrow-size,8px)/-2) - 1px)}.l-popover-left .l-popover--arrow,.l-popover-left-start .l-popover--arrow,.l-popover-left-end .l-popover--arrow{margin-top:-4px;right:-4px}.l-popover-left-start .l-popover--arrow:before,.l-popover-left .l-popover--arrow:before,.l-popover-left-end .l-popover--arrow:before{border-color:var(--l-popover-border-color)var(--l-popover-border-color)transparent transparent}.l-popover-right .l-popover--arrow,.l-popover-right-start .l-popover--arrow,.l-popover-right-end .l-popover--arrow{margin-top:-4px;left:-4px}.l-popover-right-start .l-popover--arrow:before,.l-popover-right .l-popover--arrow:before,.l-popover-right-end .l-popover--arrow:before{border-color:transparent transparent var(--l-popover-border-color)var(--l-popover-border-color)}.l-popover-left .l-popover--arrow,.l-popover-right .l-popover--arrow{top:50%}.l-popover-left-start .l-popover--arrow,.l-popover-right-start .l-popover--arrow{top:10px}.l-popover-left-end .l-popover--arrow,.l-popover-right-end .l-popover--arrow{bottom:10px}.l-popover-popconfirm{min-width:200px}.l-popconfirm-container{align-items:center;display:flex}.l-popconfirm-icon-wrapper{color:var(--nt-warn-color,#f90);margin-right:10px;display:inline-flex}.l-popconfirm-footer{justify-content:flex-end;align-items:center;gap:5px;margin-top:7px;display:flex}.l-popconfirm-footer l-button::part(default){height:24px;padding:0 6px;font-size:13px}:host{--l-checkbox-size:16px;--l-checkbox-label-color:#333;--l-checkbox-checked-color:var(--l-primary-color,#722ed1);--l-checkbox-disabled-color:#e6e6e6;--l-checkbox-disabled-label-color:#c0c4cc;--l-checkbox-item-margin:10px;align-items:center;display:inline-flex}.l-checkbox{cursor:pointer;align-items:center;display:inline-flex}.l-checkbox__input{opacity:0;z-index:-1;width:0;height:0;position:absolute}.l-checkbox__label{color:var(--l-checkbox-label-color);margin-left:5px;line-height:1;transition:color .3s ease-in-out}.l-checkbox__inner{width:var(--l-checkbox-size);height:var(--l-checkbox-size);box-sizing:border-box;border:1px solid #dcddd9;border-radius:3px;justify-content:center;align-items:center;transition:all .3s ease-in-out;display:flex;position:relative}.l-checkbox__inner:after{content:"";width:calc(var(--l-checkbox-size)*.6);height:calc(var(--l-checkbox-size)*.3);border-top:none;border-bottom:1px solid #0000;border-left:1px solid #0000;border-right:none;margin-top:-3px;transition:border-color .2s ease-in-out;display:block;transform:rotate(-45deg)}.l-checkbox--indeterminate .l-checkbox__inner{background-color:var(--l-checkbox-checked-color)}.l-checkbox--indeterminate .l-checkbox__inner:before{content:"";width:calc(var(--l-checkbox-size)*.4);border:none;border-bottom:1px solid #fff;height:1px;display:block;position:absolute}.l-checkbox:hover .l-checkbox__inner{border-color:var(--l-checkbox-checked-color)}.l-checkbox__input:checked+.l-checkbox__inner{background-color:var(--l-checkbox-checked-color)}.l-checkbox__input:checked+.l-checkbox__inner:after{border-color:#fff}.l-checkbox__input:checked~.l-checkbox__label{color:var(--l-checkbox-checked-color)}.l-checkbox--disabled{--l-checkbox-checked-color:var(--l-checkbox-disabled-color);cursor:not-allowed}.l-checkbox--disabled .l-checkbox__inner{border-color:var(--l-checkbox-disabled-color)}.l-checkbox--disabled .l-checkbox__inner:after{border-color:#0000}.l-checkbox--disabled .l-checkbox__label{color:var(--l-checkbox-disabled-label-color)}.l-checkbox+.l-checkbox{margin-left:var(--l-checkbox-item-margin)}.l-checkbox--button .l-checkbox__label{height:var(--l-form-edit-height,32px);border:1px solid #c0c4cc;border-left-width:0;justify-content:center;align-items:center;margin-left:0;padding:0 15px;display:inline-flex}.l-checkbox--button:first-child .l-checkbox__label{border-left-width:1px;border-top-left-radius:3px;border-bottom-left-radius:3px}.l-checkbox--button:last-child .l-checkbox__label{border-top-right-radius:3px;border-bottom-right-radius:3px}.l-checkbox--button .l-checkbox__input:checked~.l-checkbox__label{background-color:var(--l-checkbox-checked-color);color:#fff;border-top-color:var(--l-checkbox-checked-color);border-bottom-color:var(--l-checkbox-checked-color);border-right-color:#fff}:host{--l-input-width:180px;width:var(--l-input-width,180px);height:var(--l-form-edit-height,32px);display:inline-block;position:relative}.l-md-input__inner{box-sizing:border-box;background:0 0;border:0 solid silver;border-bottom-width:1px;outline:none;width:100%;height:100%;transition:border-color .3s}.l-md-input__inner:focus{border-color:var(--l-primary-color,#722ed1)}:host(.l-has-value) .l-md-input__label,.l-md-input__inner:focus+.l-md-input__label{font-size:12px;transform:translateY(-150%)}.l-md-input__inner:focus+.l-md-input__label{color:var(--nt-primary-color,#722ed1)}.l-md-input__label{color:#8c8c8c;cursor:text;align-items:center;font-size:13px;line-height:1;transition:color .3s,transform .3s;display:flex;position:absolute;top:50%;bottom:0;left:0;transform:translateY(-50%)}:host(.l-md-input-outline){--l-input-label-background:#fff}:host(.l-md-input-outline) .l-md-input__inner{border-width:1px;border-radius:4px;padding:0 10px}:host(.l-md-input-outline) .l-md-input__label{left:10px}:host(.l-md-input-outline) .l-md-input__inner:focus{border-width:2px}:host(.l-md-input-outline) .l-md-input__inner:focus+.l-md-input__label,:host(.l-md-input-outline.l-has-value) .l-md-input__label{background-color:#fff;padding-left:4px;padding-right:4px}
|
|
1
|
+
:host{display:inline-flex}.l-icon{width:1em;height:1em;fill:currentColor;vertical-align:middle;display:inline-block}:host{display:inline-flex;width:auto}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type LoadingInstanceParams = {
|
|
2
|
+
/** 是否全屏显示, 默认: true */
|
|
3
|
+
fullscreen?: boolean;
|
|
4
|
+
/** 全屏显示时,是否隐藏滚动条; 默认: true */
|
|
5
|
+
lock?: boolean;
|
|
6
|
+
/** 是否为条形, 默认: false */
|
|
7
|
+
bar?: boolean;
|
|
8
|
+
/** 进度条挂载容器 */
|
|
9
|
+
to?: string | HTMLElement | null;
|
|
10
|
+
/** 显示的文本; 默认: 加载中…… */
|
|
11
|
+
text?: string;
|
|
12
|
+
/** 进度背景色 */
|
|
13
|
+
background?: string;
|
|
14
|
+
};
|
|
15
|
+
declare class LoadingInstance {
|
|
16
|
+
/** 加载容器 */
|
|
17
|
+
el: HTMLElement;
|
|
18
|
+
option: Required<Omit<LoadingInstanceParams, "to">>;
|
|
19
|
+
constructor(option?: LoadingInstanceParams);
|
|
20
|
+
/** 显示进度条 */
|
|
21
|
+
show(): void;
|
|
22
|
+
/** 隐藏进度条 */
|
|
23
|
+
hide(): void;
|
|
24
|
+
}
|
|
25
|
+
declare const _default: {
|
|
26
|
+
/** 创建并显示进度条 */
|
|
27
|
+
create(option?: LoadingInstanceParams): LoadingInstance;
|
|
28
|
+
/** 根据指令参数初始化进度条 */
|
|
29
|
+
init(id?: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* 关闭加载中的元素
|
|
32
|
+
*
|
|
33
|
+
* 此函数用于关闭页面上带有特定 l-loading 属性的元素,只关闭与该 id 匹配的元素
|
|
34
|
+
* 否则,将关闭所有带有 l-loading 属性的元素
|
|
35
|
+
*
|
|
36
|
+
* @param id 可选参数,指定特定的加载元素 l-loading 对应的值,如果提供,则只关闭匹配该 id 的元素
|
|
37
|
+
*/
|
|
38
|
+
close(id?: string): void;
|
|
39
|
+
};
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { $ as d, iterate as u, hasClass as h, $one as m, addClass as r, $$ as c } from "ph-utils/dom";
|
|
2
|
+
function f(t, e) {
|
|
3
|
+
if (h(t, "l-loading")) return;
|
|
4
|
+
let l;
|
|
5
|
+
if (e.fullscreen && (l = m("#l-loading-mask"), l != null))
|
|
6
|
+
return;
|
|
7
|
+
r(t, "l-loading"), l = c("div", { class: "l-loading-mask" }), e.background && (l.style.backgroundColor = e.background);
|
|
8
|
+
const n = c("div", { class: "l-loading-spinner" });
|
|
9
|
+
if (e.bar)
|
|
10
|
+
r(l, "l-loading-bar");
|
|
11
|
+
else {
|
|
12
|
+
const s = document.createElementNS(
|
|
13
|
+
"http://www.w3.org/2000/svg",
|
|
14
|
+
"svg"
|
|
15
|
+
);
|
|
16
|
+
s.setAttribute("viewBox", "0 0 50 50"), s.classList.add("circle");
|
|
17
|
+
const a = document.createElementNS(
|
|
18
|
+
"http://www.w3.org/2000/svg",
|
|
19
|
+
"circle"
|
|
20
|
+
);
|
|
21
|
+
if (a.classList.add("path"), a.setAttribute("cx", "25"), a.setAttribute("cy", "25"), a.setAttribute("r", "23"), a.setAttribute("fill", "none"), s.appendChild(a), n.appendChild(s), e.text) {
|
|
22
|
+
const i = c("p", {
|
|
23
|
+
class: "l-loading-text",
|
|
24
|
+
textContent: e.text
|
|
25
|
+
});
|
|
26
|
+
n.appendChild(i);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (e.fullscreen) {
|
|
30
|
+
const s = ["l-loading-fullscreen"];
|
|
31
|
+
e.lock && s.push("l-loading-lock"), t.classList.add(...s), l.id = "l-loading-mask";
|
|
32
|
+
}
|
|
33
|
+
l.appendChild(n), t.appendChild(l), setTimeout(() => {
|
|
34
|
+
e.bar ? r(l, "l-loading-bar--start") : l.style.opacity = "1";
|
|
35
|
+
}, 10);
|
|
36
|
+
}
|
|
37
|
+
function b(t, e) {
|
|
38
|
+
const l = e.fullscreen ? "#" : ".", n = d(`${l}l-loading-mask`, t);
|
|
39
|
+
u(n, (s) => {
|
|
40
|
+
function a() {
|
|
41
|
+
const g = ["l-loading-bar--start", "l-loading-bar--finish"];
|
|
42
|
+
t.tagName === "BODY" && g.push(
|
|
43
|
+
"l-loading",
|
|
44
|
+
"l-loading-fullscreen",
|
|
45
|
+
"l-loading-lock"
|
|
46
|
+
), t.classList.remove(...g), s != null && t.contains(s) && (t.removeChild(s), s = void 0);
|
|
47
|
+
}
|
|
48
|
+
let i = -1;
|
|
49
|
+
s.addEventListener(
|
|
50
|
+
"transitionend",
|
|
51
|
+
() => {
|
|
52
|
+
cancelAnimationFrame(i), i = requestAnimationFrame(() => {
|
|
53
|
+
a();
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
{ once: !0 }
|
|
57
|
+
), e.bar ? t.classList.add("l-loading-bar--finish") : s.style.opacity = "0", setTimeout(() => {
|
|
58
|
+
a();
|
|
59
|
+
}, 500);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
class p {
|
|
63
|
+
/** 加载容器 */
|
|
64
|
+
el;
|
|
65
|
+
option;
|
|
66
|
+
constructor(e) {
|
|
67
|
+
this.option = {
|
|
68
|
+
fullscreen: !0,
|
|
69
|
+
lock: !0,
|
|
70
|
+
bar: !1,
|
|
71
|
+
text: "加载中……",
|
|
72
|
+
background: "",
|
|
73
|
+
...e
|
|
74
|
+
};
|
|
75
|
+
const l = (e || {}).to;
|
|
76
|
+
let n = null;
|
|
77
|
+
l != null && (typeof l == "string" ? n = document.querySelector(l) : n = l), (n == null || this.option.fullscreen) && (n = document.body), this.el = n, this.show();
|
|
78
|
+
}
|
|
79
|
+
/** 显示进度条 */
|
|
80
|
+
show() {
|
|
81
|
+
f(this.el, this.option);
|
|
82
|
+
}
|
|
83
|
+
/** 隐藏进度条 */
|
|
84
|
+
hide() {
|
|
85
|
+
b(this.el, this.option);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function o(t) {
|
|
89
|
+
const e = t.getAttribute("l-loading-text"), l = t.getAttribute("l-loading-lock");
|
|
90
|
+
return {
|
|
91
|
+
background: t.getAttribute("l-loading-background"),
|
|
92
|
+
text: e ? e === "0" || e === "false" ? void 0 : e : "加载中……",
|
|
93
|
+
fullscreen: t.hasAttribute("l-loading-fullscreen"),
|
|
94
|
+
lock: !(l === "0" || l === "false"),
|
|
95
|
+
bar: t.hasAttribute("l-loading-bar")
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const x = {
|
|
99
|
+
/** 创建并显示进度条 */
|
|
100
|
+
create(t) {
|
|
101
|
+
return new p(t);
|
|
102
|
+
},
|
|
103
|
+
/** 根据指令参数初始化进度条 */
|
|
104
|
+
init(t) {
|
|
105
|
+
const e = t ? `[l-loading="${t}"]` : "[l-loading]", l = d(e);
|
|
106
|
+
u(l, (n) => {
|
|
107
|
+
const s = o(n);
|
|
108
|
+
f(
|
|
109
|
+
s.fullscreen ? document.body : n,
|
|
110
|
+
o(n)
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* 关闭加载中的元素
|
|
116
|
+
*
|
|
117
|
+
* 此函数用于关闭页面上带有特定 l-loading 属性的元素,只关闭与该 id 匹配的元素
|
|
118
|
+
* 否则,将关闭所有带有 l-loading 属性的元素
|
|
119
|
+
*
|
|
120
|
+
* @param id 可选参数,指定特定的加载元素 l-loading 对应的值,如果提供,则只关闭匹配该 id 的元素
|
|
121
|
+
*/
|
|
122
|
+
close(t) {
|
|
123
|
+
const e = t ? `[l-loading="${t}"]` : "[l-loading]", l = d(e);
|
|
124
|
+
u(l, (n) => {
|
|
125
|
+
const s = o(n);
|
|
126
|
+
b(
|
|
127
|
+
s.fullscreen ? document.body : n,
|
|
128
|
+
o(n)
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
export {
|
|
134
|
+
x as default
|
|
135
|
+
};
|
package/lib/radio/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { initAttr as $,
|
|
1
|
+
import { initAttr as $, parseAttrValue as x, tagAttr as s } from "../utils/index.js";
|
|
2
2
|
import y from "../form/form_inner.js";
|
|
3
3
|
import { $one as a, hasClass as u, addClass as n, $ as c, iterate as h, getAttr as C, removeClass as b, formatClass as A, on as E, off as I } from "ph-utils/dom";
|
|
4
4
|
import { random as p } from "ph-utils";
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { isBlank as N } from "ph-utils";
|
|
2
|
-
import {
|
|
3
|
-
let E = -1
|
|
4
|
-
|
|
5
|
-
prefix: "l"
|
|
6
|
-
};
|
|
7
|
-
function H(t) {
|
|
8
|
-
y = { ...y, ...t };
|
|
9
|
-
}
|
|
10
|
-
function _(t, r) {
|
|
2
|
+
import { $ as x, iterate as $, transition as y } from "ph-utils/dom";
|
|
3
|
+
let E = -1;
|
|
4
|
+
function H(t, r) {
|
|
11
5
|
const e = Array.isArray(t) ? t : [t];
|
|
12
6
|
for (const i of e) {
|
|
13
|
-
const
|
|
14
|
-
customElements.get(
|
|
7
|
+
const s = r || i.tabName || `l-${i.baseName}`;
|
|
8
|
+
customElements.get(s) || customElements.define(s, i);
|
|
15
9
|
}
|
|
16
10
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
11
|
+
function _() {
|
|
12
|
+
return `l-${++E}`;
|
|
19
13
|
}
|
|
20
14
|
function I(t, r, e) {
|
|
21
15
|
if (t == null) return r;
|
|
@@ -28,95 +22,95 @@ function I(t, r, e) {
|
|
|
28
22
|
return t;
|
|
29
23
|
}
|
|
30
24
|
}
|
|
31
|
-
function
|
|
25
|
+
function k(t) {
|
|
32
26
|
const r = t.attributes;
|
|
33
27
|
for (const e of r) {
|
|
34
|
-
const { name: i, value:
|
|
28
|
+
const { name: i, value: s } = e;
|
|
35
29
|
if (i.startsWith("data-") || i.startsWith("aria-") || i.startsWith("_") || i.startsWith("$") || ["id", "class", "style"].includes(i))
|
|
36
30
|
continue;
|
|
37
|
-
const
|
|
38
|
-
(t._ignoreInitAttrs || []).includes(
|
|
31
|
+
const n = i.split("-").map((d, h) => h === 0 ? d : d[0].toUpperCase() + d.slice(1)).join(""), u = I(s, t[n], i), f = Object.getOwnPropertyNames(t);
|
|
32
|
+
(t._ignoreInitAttrs || []).includes(n) || (i === "value" ? (t[n] = u, t._resetValue = u) : f.includes(n) && (t[n] = u));
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
35
|
function W(t, r) {
|
|
42
36
|
let e = " ";
|
|
43
37
|
return r === !0 ? e = ` ${t}` : typeof r == "string" && !N(r) && (e = ` ${t}="${r}"`), e;
|
|
44
38
|
}
|
|
45
|
-
function
|
|
39
|
+
function C(t) {
|
|
46
40
|
return t.map((e) => W(e[0], e[1])).join("");
|
|
47
41
|
}
|
|
48
|
-
function
|
|
42
|
+
function V(t, r) {
|
|
49
43
|
for (const e of r) {
|
|
50
|
-
const i = e[1],
|
|
51
|
-
i === !0 ? t.setAttribute(
|
|
44
|
+
const i = e[1], s = e[0];
|
|
45
|
+
i === !0 ? t.setAttribute(s, "") : typeof i == "string" && !N(i) && t.setAttribute(s, i);
|
|
52
46
|
}
|
|
53
47
|
}
|
|
54
|
-
function
|
|
48
|
+
function B() {
|
|
55
49
|
let t;
|
|
56
50
|
const r = {
|
|
57
51
|
attributes: !0,
|
|
58
52
|
attributeFilter: ["l-transition-emit"]
|
|
59
|
-
}, e = (
|
|
60
|
-
for (let
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
63
|
-
c === "show" ? (
|
|
64
|
-
h === "remove" ?
|
|
53
|
+
}, e = (n) => {
|
|
54
|
+
for (let u of n)
|
|
55
|
+
if (u.type === "attributes" && u.attributeName) {
|
|
56
|
+
const f = u.target, c = f.getAttribute(u.attributeName) || "show", d = f.getAttribute("l-transition") || "l", h = f.getAttribute("l-transition-method") || "hide";
|
|
57
|
+
c === "show" ? (f.style.removeProperty("display"), y(f, d, "enter")) : y(f, d, "leave", () => {
|
|
58
|
+
h === "remove" ? f.remove() : f.style.display = "none";
|
|
65
59
|
});
|
|
66
60
|
}
|
|
67
61
|
};
|
|
68
|
-
function i(
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
62
|
+
function i(n) {
|
|
63
|
+
n && n.length > 0 && (t == null && (t = new MutationObserver(e)), $(n, (u) => {
|
|
64
|
+
const f = u.getAttribute("l-transition");
|
|
65
|
+
f && (y(u, f, "enter"), t.observe(u, r));
|
|
72
66
|
}));
|
|
73
67
|
}
|
|
74
|
-
function n
|
|
75
|
-
|
|
68
|
+
function s(n) {
|
|
69
|
+
n == null && (n = x("[l-transition]"), i(n));
|
|
76
70
|
}
|
|
77
71
|
function o() {
|
|
78
72
|
t && (t.disconnect(), t = void 0);
|
|
79
73
|
}
|
|
80
|
-
return { destroy: o, add: i, init:
|
|
74
|
+
return { destroy: o, add: i, init: s };
|
|
81
75
|
}
|
|
82
|
-
function
|
|
76
|
+
function m(t, r, e, i, s = 10) {
|
|
83
77
|
let o = 0;
|
|
84
|
-
return e === "top" ? o = r.height +
|
|
78
|
+
return e === "top" ? o = r.height + s : e === "bottom" ? o = -(t.height + s) : (e === "left" || e === "right") && (i === "" ? o = r.height / 2 - t.height / 2 : i === "end" && (o = r.height - t.height)), o;
|
|
85
79
|
}
|
|
86
|
-
function
|
|
80
|
+
function w(t, r, e, i, s = 10) {
|
|
87
81
|
let o = 0;
|
|
88
|
-
return e === "left" ? o = r.width +
|
|
82
|
+
return e === "left" ? o = r.width + s : e === "right" ? o = -(t.width + s) : (e === "top" || e === "bottom") && (i === "" ? o = r.width / 2 - t.width / 2 : i === "end" && (o = r.width - t.width)), o;
|
|
89
83
|
}
|
|
90
|
-
function
|
|
91
|
-
const d = window.innerHeight + o - 10, h = window.innerWidth +
|
|
92
|
-
let a = t.top + o -
|
|
93
|
-
a + r.height > d && (e === "left" || e === "right" ? i = "end" : e = "top",
|
|
84
|
+
function F(t, r, e, i, s, o, n, u, f = 10, c = "absolute") {
|
|
85
|
+
const d = window.innerHeight + o - 10, h = window.innerWidth + s - 10;
|
|
86
|
+
let a = t.top + o - u;
|
|
87
|
+
a + r.height > d && (e === "left" || e === "right" ? i = "end" : e = "top", u = m(
|
|
94
88
|
t,
|
|
95
89
|
r,
|
|
96
90
|
e,
|
|
97
91
|
i,
|
|
98
|
-
|
|
99
|
-
), a = t.top + o -
|
|
100
|
-
let b = t.left +
|
|
101
|
-
return b + r.width > h && (e === "top" || e === "bottom" ? i = "end" : e = "left",
|
|
92
|
+
f
|
|
93
|
+
), a = t.top + o - u), a < o && (e === "left" || e === "right" ? i = "start" : e = "bottom");
|
|
94
|
+
let b = t.left + s - n;
|
|
95
|
+
return b + r.width > h && (e === "top" || e === "bottom" ? i = "end" : e = "left", n = w(
|
|
102
96
|
t,
|
|
103
97
|
r,
|
|
104
98
|
e,
|
|
105
99
|
i,
|
|
106
|
-
|
|
107
|
-
), b = t.left +
|
|
100
|
+
f
|
|
101
|
+
), b = t.left + s - n), b < s && (e === "top" || e === "bottom" ? i = "start" : e = "right"), c === "fixed" && (u = m(
|
|
108
102
|
t,
|
|
109
103
|
r,
|
|
110
104
|
e,
|
|
111
105
|
i,
|
|
112
|
-
|
|
113
|
-
),
|
|
106
|
+
f
|
|
107
|
+
), n = w(
|
|
114
108
|
t,
|
|
115
109
|
r,
|
|
116
110
|
e,
|
|
117
111
|
i,
|
|
118
|
-
|
|
119
|
-
), b = t.left +
|
|
112
|
+
f
|
|
113
|
+
), b = t.left + s - n, a = t.top + o - u), {
|
|
120
114
|
x: b,
|
|
121
115
|
y: a,
|
|
122
116
|
mainAlign: e,
|
|
@@ -124,16 +118,15 @@ function U(t, r, e, i, n, o, s, f, u = 10, c = "absolute") {
|
|
|
124
118
|
};
|
|
125
119
|
}
|
|
126
120
|
export {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
V as initAttr,
|
|
121
|
+
B as createTransition,
|
|
122
|
+
w as getPopoverOffsetX,
|
|
123
|
+
m as getPopoverOffsetY,
|
|
124
|
+
F as impactDetect,
|
|
125
|
+
k as initAttr,
|
|
133
126
|
I as parseAttrValue,
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
H as regist,
|
|
128
|
+
V as setAttrs,
|
|
136
129
|
W as tagAttr,
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
C as tagAttrs,
|
|
131
|
+
_ as useId
|
|
139
132
|
};
|
package/package.json
CHANGED
|
@@ -1,72 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "litos-ui",
|
|
3
|
-
"description": "基于 Web Component 的 UI 组件库",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
},
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "litos-ui",
|
|
3
|
+
"description": "基于 Web Component 的 UI 组件库",
|
|
4
|
+
"version": "0.11.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@eslint/js": "^9.22.0",
|
|
8
|
+
"@eslint/markdown": "^6.3.0",
|
|
9
|
+
"@types/node": "^22.13.10",
|
|
10
|
+
"eslint": "^9.22.0",
|
|
11
|
+
"globals": "^16.0.0",
|
|
12
|
+
"less": "^4.2.2",
|
|
13
|
+
"lightningcss": "^1.29.3",
|
|
14
|
+
"prettier": "^3.5.3",
|
|
15
|
+
"typescript": "^5.8.2",
|
|
16
|
+
"typescript-eslint": "^8.26.1",
|
|
17
|
+
"vite": "^6.2.2",
|
|
18
|
+
"vite-plugin-dts": "^4.5.3",
|
|
19
|
+
"vitepress": "^1.6.3"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"lib",
|
|
23
|
+
"styles"
|
|
24
|
+
],
|
|
25
|
+
"main": "./lib/index.js",
|
|
26
|
+
"module": "./lib/index.js",
|
|
27
|
+
"types": "./lib/index.d.ts",
|
|
28
|
+
"jsdelivr": "./lib/litos-ui.min.js",
|
|
29
|
+
"unpkg": "./lib/litos-ui.min.js",
|
|
30
|
+
"exports": {
|
|
31
|
+
"./styles/*": "./styles/*",
|
|
32
|
+
"./lib/*": "./lib/*",
|
|
33
|
+
".": {
|
|
34
|
+
"import": "./lib/index.js",
|
|
35
|
+
"types": "./lib/index.d.ts",
|
|
36
|
+
"require": "./lib/index.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/DvShu/litos-ui.git"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"litos-ui",
|
|
45
|
+
"web component",
|
|
46
|
+
"ui framework",
|
|
47
|
+
"component library"
|
|
48
|
+
],
|
|
49
|
+
"homepage": "https://dvshu.github.io/litos-ui/",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/DvShu/litos-ui/issues"
|
|
52
|
+
},
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"ph-utils": "^0.15.0",
|
|
56
|
+
"shiki": "^3.2.1"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"dev": "vite dev",
|
|
60
|
+
"build": "vite build",
|
|
61
|
+
"docs:dev": "vitepress dev docs",
|
|
62
|
+
"docs:build": "vitepress build docs",
|
|
63
|
+
"docs:preview": "vitepress preview docs",
|
|
64
|
+
"inspect:eslint": "eslint --inspect-config",
|
|
65
|
+
"new_version": "node scripts/version.js",
|
|
66
|
+
"create": "node scripts/index.js create",
|
|
67
|
+
"dts:build": "tsc -p tsconfig.build.json && node scripts/dts.js",
|
|
68
|
+
"lib:build": "pnpm build && pnpm dts:build",
|
|
69
|
+
"vp": "scripts/publish.sh"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.l-dialog {
|
|
2
|
+
--l-dialog-translate: translate3d(0, 80px, 0);
|
|
3
|
+
--l-dialog-width: 30%;
|
|
4
|
+
transform: scale3d(0, 0, 0);
|
|
5
|
+
border: none;
|
|
6
|
+
outline: none;
|
|
7
|
+
opacity: 0;
|
|
8
|
+
width: var(--l-dialog-width);
|
|
9
|
+
margin: 0 auto;
|
|
10
|
+
transition:
|
|
11
|
+
transform 0.3s,
|
|
12
|
+
opacity 0.3s;
|
|
13
|
+
max-width: 100%;
|
|
14
|
+
background-color: transparent;
|
|
15
|
+
}
|
|
16
|
+
.l-dialog-close-outside {
|
|
17
|
+
--l-dialog-translate: translate3d(5px, 90px, 0);
|
|
18
|
+
}
|
|
19
|
+
.l-dialog--vertical-middle {
|
|
20
|
+
--l-dialog-translate: translate3d(0, 0, 0);
|
|
21
|
+
margin: auto;
|
|
22
|
+
}
|
|
23
|
+
.l-dialog-close-outside.l-dialog--vertical-middle {
|
|
24
|
+
--l-dialog-translate: translate3d(5px, 0, 0);
|
|
25
|
+
}
|
|
26
|
+
.l-dialog--vertical-bottom {
|
|
27
|
+
--l-dialog-translate: translate3d(0, -100%, 0);
|
|
28
|
+
top: 100%;
|
|
29
|
+
border-bottom-left-radius: 0;
|
|
30
|
+
border-bottom-right-radius: 0;
|
|
31
|
+
}
|
|
32
|
+
.l-dialog-close-outside.l-dialog--vertical-bottom {
|
|
33
|
+
--l-dialog-translate: translate3d(5px, -100%, 0);
|
|
34
|
+
}
|
|
35
|
+
.l-dialog::backdrop {
|
|
36
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
37
|
+
opacity: 0;
|
|
38
|
+
transition: opacity 0.3s;
|
|
39
|
+
}
|
|
40
|
+
.l-dialog--open {
|
|
41
|
+
transform: scale3d(1, 1, 1) var(--l-dialog-translate);
|
|
42
|
+
opacity: 1;
|
|
43
|
+
}
|
|
44
|
+
.l-dialog--open::backdrop {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
}
|
|
47
|
+
.l-body--dialog-open {
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media screen and (max-width: 768px) {
|
|
52
|
+
.l-dialog {
|
|
53
|
+
width: 80%;
|
|
54
|
+
max-width: 300px;
|
|
55
|
+
}
|
|
56
|
+
}
|