vue-devui 1.5.8 → 1.5.9
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/auto-complete/index.es.js +7 -1
- package/auto-complete/index.umd.js +7 -7
- package/auto-complete/style.css +1 -1
- package/checkbox/index.es.js +7 -1
- package/checkbox/index.umd.js +13 -13
- package/checkbox/style.css +1 -1
- package/code-review/index.es.js +254 -35
- package/code-review/index.umd.js +23 -21
- package/code-review/style.css +1 -1
- package/date-picker-pro/index.es.js +7 -1
- package/date-picker-pro/index.umd.js +8 -8
- package/date-picker-pro/style.css +1 -1
- package/dragdrop/index.es.js +158 -0
- package/dragdrop/index.umd.js +1 -0
- package/dragdrop/package.json +8 -0
- package/editor-md/style.css +1 -1
- package/form/index.es.js +7 -1
- package/form/index.umd.js +7 -7
- package/form/style.css +1 -1
- package/global.d.ts +1 -0
- package/input/index.es.js +7 -1
- package/input/index.umd.js +6 -6
- package/input/style.css +1 -1
- package/input-number/index.es.js +7 -1
- package/input-number/index.umd.js +10 -10
- package/input-number/style.css +1 -1
- package/mention/index.es.js +7 -1
- package/mention/index.umd.js +9 -9
- package/mention/style.css +1 -1
- package/modal/index.es.js +2 -1
- package/modal/index.umd.js +1 -1
- package/package.json +1 -1
- package/pagination/index.es.js +7 -1
- package/pagination/index.umd.js +7 -7
- package/pagination/style.css +1 -1
- package/radio/index.es.js +7 -1
- package/radio/index.umd.js +13 -13
- package/radio/style.css +1 -1
- package/search/index.es.js +7 -1
- package/search/index.umd.js +8 -8
- package/search/style.css +1 -1
- package/select/index.es.js +7 -1
- package/select/index.umd.js +5 -5
- package/select/style.css +1 -1
- package/splitter/index.es.js +14 -3
- package/splitter/index.umd.js +12 -12
- package/style.css +1 -1
- package/switch/index.es.js +7 -1
- package/switch/index.umd.js +14 -14
- package/switch/style.css +1 -1
- package/table/index.es.js +7 -1
- package/table/index.umd.js +5 -5
- package/table/style.css +1 -1
- package/textarea/index.es.js +7 -1
- package/textarea/index.umd.js +12 -12
- package/textarea/style.css +1 -1
- package/time-picker/index.es.js +7 -1
- package/time-picker/index.umd.js +7 -7
- package/time-picker/style.css +1 -1
- package/time-select/index.es.js +7 -1
- package/time-select/index.umd.js +5 -5
- package/time-select/style.css +1 -1
- package/tree/index.es.js +7 -1
- package/tree/index.umd.js +7 -7
- package/tree/style.css +1 -1
- package/types/code-review/src/code-review-types.d.ts +4 -0
- package/types/code-review/src/code-review.d.ts +7 -1
- package/types/code-review/src/composables/use-code-review-expand.d.ts +3 -2
- package/types/code-review/src/composables/use-code-review-fold.d.ts +6 -0
- package/types/code-review/src/composables/use-code-review.d.ts +6 -5
- package/types/code-review/src/utils.d.ts +9 -1
- package/types/dragdrop/src/const.d.ts +0 -1
- package/types/dragdrop/src/draggable-directive.d.ts +1 -18
- package/types/dragdrop/src/droppable-directive.d.ts +1 -14
- package/types/dragdrop/src/sortable-directive.d.ts +1 -15
- package/types/dragdrop/src/utils.d.ts +2 -80
- package/types/form/src/form-types.d.ts +4 -0
- package/types/form/src/form.d.ts +9 -0
- package/types/modal/src/modal-types.d.ts +1 -1
- package/types/modal/src/modal.d.ts +2 -1
- package/vue-devui.es.js +410 -220
- package/vue-devui.umd.js +66 -64
package/checkbox/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-fixed-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--devui-shadow, rgba(37, 43, 58, .24));z-index:1050}.devui-fixed-overlay--fade-enter-active,.devui-fixed-overlay--fade-leave-active{transition:opacity .1s cubic-bezier(0,0,1,1)}.devui-fixed-overlay--fade-enter-from,.devui-fixed-overlay--fade-leave-to{opacity:0}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 2px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-length-connected-overlay, 0 2px 12px 0) var(--devui-shadow, rgba(37, 43, 58, .24));z-index:1000}.devui-flexible-overlay__arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}.devui-popover__icon-wrap{width:16px;height:16px;margin-right:8px}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--success>g>path{fill:var(--devui-success, #50d4ab)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--success>g>circle,.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--success>g>polygon{fill:var(--devui-light-text, #ffffff)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--warning>g>path{fill:var(--devui-warning, #fac20a)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--warning>g>polygon{fill:var(--devui-light-text, #ffffff)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--info>g>g{fill:var(--devui-info, #5e7ce0)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--info>g>circle{fill:var(--devui-light-text, #ffffff)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--error>g>path{fill:var(--devui-danger, #f66f6a)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--error>g>circle{fill:var(--devui-light-text, #ffffff)}.devui-popover__content.devui-flexible-overlay{display:flex;flex-wrap:wrap;align-items:center;white-space:nowrap;padding:4px 12px;line-height:1.5;border-radius:var(--devui-border-radius-feedback, 4px);color:var(--devui-feedback-overlay-text, #dfe1e6);background-color:var(--devui-feedback-overlay-bg, #464d6e);font-size:var(--devui-font-size-sm, 12px)}.devui-popover__content.devui-flexible-overlay.is-icon{flex-wrap:nowrap}.devui-popover--fade-bottom-enter-from,.devui-popover--fade-bottom-leave-to,.devui-popover--fade-top-enter-from,.devui-popover--fade-top-leave-to{opacity:.8;transform:scaleY(.8)}.devui-popover--fade-bottom-enter-to,.devui-popover--fade-bottom-leave-from,.devui-popover--fade-top-enter-to,.devui-popover--fade-top-leave-from{opacity:1;transform:scaleY(1)}.devui-popover--fade-bottom-enter-active,.devui-popover--fade-top-enter-active{transition:transform .1s cubic-bezier(.16,.75,.5,1),opacity .1s cubic-bezier(.16,.75,.5,1)}.devui-popover--fade-bottom-leave-active,.devui-popover--fade-top-leave-active{transition:transform .1s cubic-bezier(.5,0,.84,.25),opacity .1s cubic-bezier(.5,0,.84,.25)}.devui-popover--fade-left-enter-from,.devui-popover--fade-left-leave-to,.devui-popover--fade-right-enter-from,.devui-popover--fade-right-leave-to{opacity:.8;transform:scaleX(.8)}.devui-popover--fade-left-enter-to,.devui-popover--fade-left-leave-from,.devui-popover--fade-right-enter-to,.devui-popover--fade-right-leave-from{opacity:1;transform:scaleX(1)}.devui-popover--fade-left-enter-active,.devui-popover--fade-right-enter-active{transition:transform .1s cubic-bezier(.16,.75,.5,1),opacity .1s cubic-bezier(.16,.75,.5,1)}.devui-popover--fade-left-leave-active,.devui-popover--fade-right-leave-active{transition:transform .1s cubic-bezier(.5,0,.84,.25),opacity .1s cubic-bezier(.5,0,.84,.25)}.devui-form__label{align-self:flex-start}.devui-form__label--vertical{padding-bottom:8px}.devui-form__label--sm{flex:0 0 80px}.devui-form__label--md{flex:0 0 100px}.devui-form__label--lg{flex:0 0 150px}.devui-form__label--start{text-align:left}.devui-form__label--center{text-align:center}.devui-form__label--end{text-align:end}.devui-form__label-span{display:inline-block;vertical-align:middle;color:var(--devui-text, #252b3a)}.devui-form__label--required:before{content:"*";color:red;display:inline-block;margin-right:8px;margin-left:-12px}.devui-form__label-help{position:relative;top:-.1em;display:inline-block;vertical-align:middle;margin-left:4px;cursor:pointer}.devui-form__control{flex:1 1 auto;position:relative;width:100%}.devui-form__control--horizontal{margin-left:16px}.devui-form__control .devui-star{color:red}.devui-form__control .devui-form__control-container{position:relative}.devui-form__control .devui-form__control-container--horizontal{display:flex;width:100%}.devui-form__control .devui-form__control-container--horizontal .devui-validate-tip{margin:0}.devui-form__control .devui-form__control-container .devui-form__feedback-icon{position:absolute;top:50%;right:0;z-index:1;width:32px;height:16px;text-align:center;visibility:visible;pointer-events:none;transform:translateY(-50%);display:flex;align-items:center;justify-content:center}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--error svg circle{fill:var(--devui-danger, #f66f6a)}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--error svg polygon{fill:var(--devui-base-bg, #ffffff)}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--success svg circle{fill:var(--devui-success, #50d4ab)}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--success svg polygon{fill:var(--devui-base-bg, #ffffff)}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--pending svg{animation:loading-keyframes 1s infinite linear}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--pending svg path{fill:var(--devui-brand, #5e7ce0)}.devui-form__control .devui-form__control-container--has-feedback{display:flex;align-items:center}.devui-form__control .devui-form__control-container--has-feedback input{padding-right:28px}.devui-form__control .devui-form__control-container--feedback-error{border:1px solid #f66f6a;border-radius:2px}.devui-form__control .devui-form__control-container--feedback-error input{background-color:#ffeeed;border-color:transparent}.devui-form__control .devui-form__control-container--feedback-error input:hover{border-color:transparent!important}.devui-form__control .devui-form__control-container--feedback-error input:focus{border-color:transparent!important}.devui-form__control .devui-form__control-container--feedback-error .devui-select-arrow{right:24px!important}.devui-form__control .devui-form__control-info{line-height:1}.devui-form__control .devui-form__control-info .error-message{display:inline-block;min-height:20px;line-height:1.5;font-size:var(--devui-font-size, 12px);color:var(--devui-danger, #f66f6a)}.devui-form__control .devui-form__control-info .devui-form__control-extra{font-size:var(--devui-font-size, 12px);color:var(--devui-aide-text, #71757f);min-height:20px;line-height:1.5;text-align:justify}@keyframes loading-keyframes{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.devui-form__item--horizontal{display:flex;align-items:center;margin-bottom:20px}.devui-form__item--vertical{display:flex;flex-direction:column;margin-bottom:20px}.devui-form__item--error{margin-bottom:0}.devui-form-operation .star{color:red}.devui-checkbox{position:relative;display:flex;display:-ms-flexbox;align-items:center;-ms-flex-align:center;height:100%;margin:0}.devui-checkbox .devui-checkbox__tick-wrap{position:absolute}.devui-checkbox .devui-checkbox__tick-wrap .devui-checkbox__tick{fill:var(--devui-light-text, #ffffff);stroke-dashoffset:50;opacity:0;transform:scale(0);transform-origin:50% 50%;transition:stroke-dashoffset .2s ease-in-out,opacity .2s ease-in-out,transform .2s ease-in-out}.devui-checkbox.active:not(.half-checked) .devui-checkbox__tick{opacity:1;stroke-dashoffset:0;transform:scale(1);transition:stroke-dashoffset .3s cubic-bezier(.755,.05,.855,.06),opacity .2s cubic-bezier(.755,.05,.855,.06)}.devui-checkbox.active:not(.disabled) .devui-checkbox__material:not(.custom-color),.devui-checkbox.half-checked:not(.disabled) .devui-checkbox__material:not(.custom-color){border-color:var(--devui-brand, #5e7ce0)}.devui-checkbox.active .devui-checkbox--bordered,.devui-checkbox.half-checked .devui-checkbox--bordered{border-color:var(--devui-brand, #5e7ce0)}.devui-checkbox.active:not(.disabled) .devui-checkbox__material{background-size:100% 100%;transition:background-size .2s ease-in-out,border-color .2s ease-in-out}.devui-checkbox.unchecked:not(.disabled) .devui-checkbox__material:not(.custom-color){background-size:0% 0%;transition:background-size .2s ease-in-out,border-color .2s ease-in-out}.devui-checkbox.unchecked:not(.disabled) .devui-checkbox__material:not(.custom-color):hover{border-color:var(--devui-icon-fill-active, #252b3a)}.devui-checkbox.unchecked:not(.disabled) .devui-checkbox__material.custom-color{background-size:0% 0%;transition:background-size .2s ease-in-out,border-color .2s ease-in-out}.devui-checkbox.half-checked .devui-checkbox__material:not(.custom-color){background-color:var(--devui-brand, #5e7ce0)}.devui-checkbox.half-checked .devui-checkbox__material:not(.custom-color)>.devui-checkbox__halfchecked-bg{opacity:1;transform:scale(.4288);transition:transform .2s cubic-bezier(.755,.05,.855,.06);background-color:var(--devui-light-text, #ffffff)}.devui-checkbox.half-checked .devui-checkbox__material.custom-color>.devui-checkbox__halfchecked-bg{opacity:1;transform:scale(.4288);transition:transform .2s cubic-bezier(.755,.05,.855,.06);background-color:var(--devui-light-text, #ffffff)}.devui-checkbox .devui-checkbox__material{text-align:initial;height:14px;width:14px;position:relative;user-select:none;border:1px solid var(--devui-line, #d7d8da);border-radius:var(--devui-border-radius, 2px);background:linear-gradient(var(--devui-brand, #5e7ce0),var(--devui-brand, #5e7ce0)) no-repeat 50%/0;margin-right:8px;vertical-align:text-bottom}.devui-checkbox .devui-checkbox__material.devui-checkbox__default-background{background-color:var(--devui-base-bg, #ffffff)}.devui-checkbox .devui-checkbox__material.devui-checkbox--no-label{margin-right:0}.devui-checkbox .devui-checkbox__material>.devui-checkbox__halfchecked-bg{display:inline-block;position:absolute;content:"";background-color:var(--devui-light-text, #ffffff);top:0;left:0;height:100%;width:100%;transform:scale(1);opacity:0}.devui-checkbox .devui-checkbox__material>svg{width:14px;height:14px}.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):focus,.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):active,.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):hover{background-color:var(--devui-icon-fill-active, #252b3a)}.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):active,.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):focus,.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):hover:active,.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):hover:focus{background-color:var(--devui-brand-active-focus, #344899)}.devui-checkbox__input{opacity:0;position:absolute;margin:0;z-index:-1;width:0;height:0;overflow:hidden;left:0;pointer-events:none}.devui-checkbox label{position:relative;font-weight:400;height:16px;line-height:16px;cursor:pointer;color:var(--devui-text, #252b3a);margin:0;display:flex;align-items:center}.devui-checkbox label.devui-checkbox--lg{display:flex;align-items:center;font-size:var(--devui-font-size-lg, 14px)}.devui-checkbox label.devui-checkbox--lg .devui-checkbox__material{width:18px;height:18px}.devui-checkbox label.devui-checkbox--lg .devui-checkbox__material>svg{width:18px;height:18px}.devui-checkbox label.devui-checkbox--lg.devui-checkbox--bordered{height:40px;padding:0 15px 0 10px}.devui-checkbox label.devui-checkbox--md{display:flex;align-items:center;font-size:var(--devui-font-size-md, 12px)}.devui-checkbox label.devui-checkbox--md .devui-checkbox__material{width:16px;height:16px}.devui-checkbox label.devui-checkbox--md .devui-checkbox__material>svg{width:16px;height:16px}.devui-checkbox label.devui-checkbox--md.devui-checkbox--bordered{height:32px;padding:0 15px 0 10px}.devui-checkbox label.devui-checkbox--sm{display:flex;align-items:center;font-size:var(--devui-font-size-sm, 12px)}.devui-checkbox label.devui-checkbox--sm .devui-checkbox__material{width:14px;height:14px}.devui-checkbox label.devui-checkbox--sm .devui-checkbox__material>svg{width:14px;height:14px}.devui-checkbox label.devui-checkbox--sm.devui-checkbox--bordered{height:24px;padding:0 15px 0 10px}.devui-checkbox label.devui-checkbox--bordered{border:1px solid var(--devui-disabled-line, #dfe1e6);border-radius:var(--devui-border-radius, 2px)}.devui-checkbox label>span{display:inline-block;box-sizing:content-box;vertical-align:top}.devui-checkbox label>span.devui-checkbox__material{flex-shrink:0}.devui-checkbox label>span.devui-checkbox__label-text{flex-shrink:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.devui-checkbox.disabled label{cursor:not-allowed;color:var(--devui-disabled-text, #cfd0d3)}.devui-checkbox.disabled .devui-checkbox__material{border-color:var(--devui-icon-fill-active-disabled, #beccfa);background-color:var(--devui-icon-fill-active-disabled, #beccfa)}.devui-checkbox.disabled.unchecked .devui-checkbox__material{border-color:var(--devui-disabled-line, #dfe1e6);background-color:var(--devui-disabled-bg, #f5f5f5)}.devui-checkbox.disabled.half-checked .devui-checkbox__material{background-color:var(--devui-disabled-bg, #f5f5f5)}.devui-checkbox.disabled.half-checked .devui-checkbox__material .devui-checkbox__halfchecked-bg{transform:scale(.4288);background-color:var(--devui-disabled-text, #cfd0d3);opacity:1}.devui-checkbox.disabled.active svg polygon{fill:var(--devui-light-text, #ffffff)}.devui-checkbox--no-animation{transition:none!important}.devui-checkbox__column-margin{height:28px;line-height:28px}.devui-checkbox__wrap .devui-checkbox label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.devui-checkbox__group{display:inline-flex;flex-wrap:wrap;justify-content:flex-start;align-items:flex-start}.devui-checkbox__group>*{margin-top:8px}.devui-checkbox__group.is-row{flex-direction:row}.devui-checkbox__group.is-row div:not(:last-child){margin-right:20px}.devui-checkbox__group.is-column{flex-direction:column}.devui-checkbox-button{display:flex;align-items:center;position:relative}.devui-checkbox-button__input{opacity:0;position:absolute;margin:0;z-index:-1;width:0;height:0;overflow:hidden;left:0;pointer-events:none}.devui-checkbox-button__content{font-size:14px;color:var(--devui-text, #252b3a);padding:10px 20px;cursor:pointer;border:1px solid var(--devui-disabled-line, #dfe1e6);display:inline-block;line-height:1;user-select:none}.devui-checkbox-button__content.devui-checkbox-button--lg{font-size:var(--devui-font-size-lg, 14px);padding:var(--devui-btn-lg-padding, 0 24px);height:40px;line-height:40px}.devui-checkbox-button__content.devui-checkbox-button--md{font-size:var(--devui-font-size-md, 12px);padding:var(--devui-btn-padding, 0 20px);height:32px;line-height:32px}.devui-checkbox-button__content.devui-checkbox-button--sm{font-size:var(--devui-font-size-sm, 12px);padding:var(--devui-btn-sm-padding, 0 16px);height:24px;line-height:24px}.devui-checkbox-button.active .devui-checkbox-button__content{color:#fff;background-color:var(--devui-brand, #5e7ce0);border-color:var(--devui-brand, #5e7ce0)}.devui-checkbox-button.active.disabled .devui-checkbox-button__content{color:#fff;background-color:var(--devui-icon-fill-active-disabled, #beccfa);border-color:var(--devui-icon-fill-active-disabled, #beccfa)}.devui-checkbox-button.disabled .devui-checkbox-button__content{cursor:not-allowed;color:var(--devui-disabled-text, #cfd0d3);background-color:#fff;border-color:var(--devui-disabled-line, #dfe1e6)}.devui-checkbox__group.is-row .devui-checkbox-button__content{border-left:none;box-shadow:-1px 0 0 0 var(--devui-disabled-line, #dfe1e6)}.devui-checkbox__group.is-row .devui-checkbox-button:first-child .devui-checkbox-button__content{border-top-left-radius:var(--devui-border-radius, 2px);border-bottom-left-radius:var(--devui-border-radius, 2px);border-left:1px solid var(--devui-disabled-line, #dfe1e6);box-shadow:none}.devui-checkbox__group.is-row .devui-checkbox-button:last-child .devui-checkbox-button__content{border-top-right-radius:var(--devui-border-radius, 2px);border-bottom-right-radius:var(--devui-border-radius, 2px)}.devui-checkbox__group.is-column .devui-checkbox-button{width:100%;margin-top:0}.devui-checkbox__group.is-column .devui-checkbox-button__content{width:100%;border-top:none;box-shadow:0 -1px 0 0 var(--devui-disabled-line, #dfe1e6)}.devui-checkbox__group.is-column .devui-checkbox-button:first-child .devui-checkbox-button__content{border-top-left-radius:var(--devui-border-radius, 2px);border-top-right-radius:var(--devui-border-radius, 2px);border-top:1px solid var(--devui-disabled-line, #dfe1e6);box-shadow:none}.devui-checkbox__group.is-column .devui-checkbox-button:last-child .devui-checkbox-button__content{border-bottom-left-radius:var(--devui-border-radius, 2px);border-bottom-right-radius:var(--devui-border-radius, 2px)}
|
|
1
|
+
.devui-fixed-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--devui-shadow, rgba(37, 43, 58, .24));z-index:1050}.devui-fixed-overlay--fade-enter-active,.devui-fixed-overlay--fade-leave-active{transition:opacity .1s cubic-bezier(0,0,1,1)}.devui-fixed-overlay--fade-enter-from,.devui-fixed-overlay--fade-leave-to{opacity:0}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 2px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-length-connected-overlay, 0 2px 12px 0) var(--devui-shadow, rgba(37, 43, 58, .24));z-index:1000}.devui-flexible-overlay__arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}.devui-popover__icon-wrap{width:16px;height:16px;margin-right:8px}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--success>g>path{fill:var(--devui-success, #50d4ab)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--success>g>circle,.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--success>g>polygon{fill:var(--devui-light-text, #ffffff)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--warning>g>path{fill:var(--devui-warning, #fac20a)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--warning>g>polygon{fill:var(--devui-light-text, #ffffff)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--info>g>g{fill:var(--devui-info, #5e7ce0)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--info>g>circle{fill:var(--devui-light-text, #ffffff)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--error>g>path{fill:var(--devui-danger, #f66f6a)}.devui-popover__icon-wrap .devui-popover__icon.devui-popover__icon--error>g>circle{fill:var(--devui-light-text, #ffffff)}.devui-popover__content.devui-flexible-overlay{display:flex;flex-wrap:wrap;align-items:center;white-space:nowrap;padding:4px 12px;line-height:1.5;border-radius:var(--devui-border-radius-feedback, 4px);color:var(--devui-feedback-overlay-text, #dfe1e6);background-color:var(--devui-feedback-overlay-bg, #464d6e);font-size:var(--devui-font-size-sm, 12px)}.devui-popover__content.devui-flexible-overlay.is-icon{flex-wrap:nowrap}.devui-popover--fade-bottom-enter-from,.devui-popover--fade-bottom-leave-to,.devui-popover--fade-top-enter-from,.devui-popover--fade-top-leave-to{opacity:.8;transform:scaleY(.8)}.devui-popover--fade-bottom-enter-to,.devui-popover--fade-bottom-leave-from,.devui-popover--fade-top-enter-to,.devui-popover--fade-top-leave-from{opacity:1;transform:scaleY(1)}.devui-popover--fade-bottom-enter-active,.devui-popover--fade-top-enter-active{transition:transform .1s cubic-bezier(.16,.75,.5,1),opacity .1s cubic-bezier(.16,.75,.5,1)}.devui-popover--fade-bottom-leave-active,.devui-popover--fade-top-leave-active{transition:transform .1s cubic-bezier(.5,0,.84,.25),opacity .1s cubic-bezier(.5,0,.84,.25)}.devui-popover--fade-left-enter-from,.devui-popover--fade-left-leave-to,.devui-popover--fade-right-enter-from,.devui-popover--fade-right-leave-to{opacity:.8;transform:scaleX(.8)}.devui-popover--fade-left-enter-to,.devui-popover--fade-left-leave-from,.devui-popover--fade-right-enter-to,.devui-popover--fade-right-leave-from{opacity:1;transform:scaleX(1)}.devui-popover--fade-left-enter-active,.devui-popover--fade-right-enter-active{transition:transform .1s cubic-bezier(.16,.75,.5,1),opacity .1s cubic-bezier(.16,.75,.5,1)}.devui-popover--fade-left-leave-active,.devui-popover--fade-right-leave-active{transition:transform .1s cubic-bezier(.5,0,.84,.25),opacity .1s cubic-bezier(.5,0,.84,.25)}.devui-form__label{align-self:flex-start}.devui-form__label--vertical{padding-bottom:8px}.devui-form__label--sm{flex:0 0 80px}.devui-form__label--md{flex:0 0 100px}.devui-form__label--lg{flex:0 0 150px}.devui-form__label--start{text-align:left}.devui-form__label--center{text-align:center}.devui-form__label--end{text-align:end}.devui-form__label-span{display:inline-block;vertical-align:middle;color:var(--devui-text, #252b3a)}.devui-form__label--required:before{content:"*";color:red;display:inline-block;margin-right:8px;margin-left:-12px}.devui-form__label--required-hide:before{display:none}.devui-form__label-help{position:relative;top:-.1em;display:inline-block;vertical-align:middle;margin-left:4px;cursor:pointer}.devui-form__control{flex:1 1 auto;position:relative;width:100%}.devui-form__control--horizontal{margin-left:16px}.devui-form__control .devui-star{color:red}.devui-form__control .devui-form__control-container{position:relative}.devui-form__control .devui-form__control-container--horizontal{display:flex;width:100%}.devui-form__control .devui-form__control-container--horizontal .devui-validate-tip{margin:0}.devui-form__control .devui-form__control-container .devui-form__feedback-icon{position:absolute;top:50%;right:0;z-index:1;width:32px;height:16px;text-align:center;visibility:visible;pointer-events:none;transform:translateY(-50%);display:flex;align-items:center;justify-content:center}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--error svg circle{fill:var(--devui-danger, #f66f6a)}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--error svg polygon{fill:var(--devui-base-bg, #ffffff)}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--success svg circle{fill:var(--devui-success, #50d4ab)}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--success svg polygon{fill:var(--devui-base-bg, #ffffff)}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--pending svg{animation:loading-keyframes 1s infinite linear}.devui-form__control .devui-form__control-container .devui-form__feedback-icon--pending svg path{fill:var(--devui-brand, #5e7ce0)}.devui-form__control .devui-form__control-container--has-feedback{display:flex;align-items:center}.devui-form__control .devui-form__control-container--has-feedback input{padding-right:28px}.devui-form__control .devui-form__control-container--feedback-error{border:1px solid #f66f6a;border-radius:2px}.devui-form__control .devui-form__control-container--feedback-error input{background-color:#ffeeed;border-color:transparent}.devui-form__control .devui-form__control-container--feedback-error input:hover{border-color:transparent!important}.devui-form__control .devui-form__control-container--feedback-error input:focus{border-color:transparent!important}.devui-form__control .devui-form__control-container--feedback-error .devui-select-arrow{right:24px!important}.devui-form__control .devui-form__control-info{line-height:1}.devui-form__control .devui-form__control-info .error-message{display:inline-block;min-height:20px;line-height:1.5;font-size:var(--devui-font-size, 12px);color:var(--devui-danger, #f66f6a)}.devui-form__control .devui-form__control-info .devui-form__control-extra{font-size:var(--devui-font-size, 12px);color:var(--devui-aide-text, #71757f);min-height:20px;line-height:1.5;text-align:justify}@keyframes loading-keyframes{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.devui-form__item--horizontal{display:flex;align-items:center;margin-bottom:20px}.devui-form__item--vertical{display:flex;flex-direction:column;margin-bottom:20px}.devui-form__item--error{margin-bottom:0}.devui-form-operation .star{color:red}.devui-checkbox{position:relative;display:flex;display:-ms-flexbox;align-items:center;-ms-flex-align:center;height:100%;margin:0}.devui-checkbox .devui-checkbox__tick-wrap{position:absolute}.devui-checkbox .devui-checkbox__tick-wrap .devui-checkbox__tick{fill:var(--devui-light-text, #ffffff);stroke-dashoffset:50;opacity:0;transform:scale(0);transform-origin:50% 50%;transition:stroke-dashoffset .2s ease-in-out,opacity .2s ease-in-out,transform .2s ease-in-out}.devui-checkbox.active:not(.half-checked) .devui-checkbox__tick{opacity:1;stroke-dashoffset:0;transform:scale(1);transition:stroke-dashoffset .3s cubic-bezier(.755,.05,.855,.06),opacity .2s cubic-bezier(.755,.05,.855,.06)}.devui-checkbox.active:not(.disabled) .devui-checkbox__material:not(.custom-color),.devui-checkbox.half-checked:not(.disabled) .devui-checkbox__material:not(.custom-color){border-color:var(--devui-brand, #5e7ce0)}.devui-checkbox.active .devui-checkbox--bordered,.devui-checkbox.half-checked .devui-checkbox--bordered{border-color:var(--devui-brand, #5e7ce0)}.devui-checkbox.active:not(.disabled) .devui-checkbox__material{background-size:100% 100%;transition:background-size .2s ease-in-out,border-color .2s ease-in-out}.devui-checkbox.unchecked:not(.disabled) .devui-checkbox__material:not(.custom-color){background-size:0% 0%;transition:background-size .2s ease-in-out,border-color .2s ease-in-out}.devui-checkbox.unchecked:not(.disabled) .devui-checkbox__material:not(.custom-color):hover{border-color:var(--devui-icon-fill-active, #252b3a)}.devui-checkbox.unchecked:not(.disabled) .devui-checkbox__material.custom-color{background-size:0% 0%;transition:background-size .2s ease-in-out,border-color .2s ease-in-out}.devui-checkbox.half-checked .devui-checkbox__material:not(.custom-color){background-color:var(--devui-brand, #5e7ce0)}.devui-checkbox.half-checked .devui-checkbox__material:not(.custom-color)>.devui-checkbox__halfchecked-bg{opacity:1;transform:scale(.4288);transition:transform .2s cubic-bezier(.755,.05,.855,.06);background-color:var(--devui-light-text, #ffffff)}.devui-checkbox.half-checked .devui-checkbox__material.custom-color>.devui-checkbox__halfchecked-bg{opacity:1;transform:scale(.4288);transition:transform .2s cubic-bezier(.755,.05,.855,.06);background-color:var(--devui-light-text, #ffffff)}.devui-checkbox .devui-checkbox__material{text-align:initial;height:14px;width:14px;position:relative;user-select:none;border:1px solid var(--devui-line, #d7d8da);border-radius:var(--devui-border-radius, 2px);background:linear-gradient(var(--devui-brand, #5e7ce0),var(--devui-brand, #5e7ce0)) no-repeat 50%/0;margin-right:8px;vertical-align:text-bottom}.devui-checkbox .devui-checkbox__material.devui-checkbox__default-background{background-color:var(--devui-base-bg, #ffffff)}.devui-checkbox .devui-checkbox__material.devui-checkbox--no-label{margin-right:0}.devui-checkbox .devui-checkbox__material>.devui-checkbox__halfchecked-bg{display:inline-block;position:absolute;content:"";background-color:var(--devui-light-text, #ffffff);top:0;left:0;height:100%;width:100%;transform:scale(1);opacity:0}.devui-checkbox .devui-checkbox__material>svg{width:14px;height:14px}.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):focus,.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):active,.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):hover{background-color:var(--devui-icon-fill-active, #252b3a)}.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):active,.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):focus,.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):hover:active,.devui-checkbox:not(.disabled).half-checked .devui-checkbox__material:not(.custom-color):hover:focus{background-color:var(--devui-brand-active-focus, #344899)}.devui-checkbox__input{opacity:0;position:absolute;margin:0;z-index:-1;width:0;height:0;overflow:hidden;left:0;pointer-events:none}.devui-checkbox label{position:relative;font-weight:400;height:16px;line-height:16px;cursor:pointer;color:var(--devui-text, #252b3a);margin:0;display:flex;align-items:center}.devui-checkbox label.devui-checkbox--lg{display:flex;align-items:center;font-size:var(--devui-font-size-lg, 14px)}.devui-checkbox label.devui-checkbox--lg .devui-checkbox__material{width:18px;height:18px}.devui-checkbox label.devui-checkbox--lg .devui-checkbox__material>svg{width:18px;height:18px}.devui-checkbox label.devui-checkbox--lg.devui-checkbox--bordered{height:40px;padding:0 15px 0 10px}.devui-checkbox label.devui-checkbox--md{display:flex;align-items:center;font-size:var(--devui-font-size-md, 12px)}.devui-checkbox label.devui-checkbox--md .devui-checkbox__material{width:16px;height:16px}.devui-checkbox label.devui-checkbox--md .devui-checkbox__material>svg{width:16px;height:16px}.devui-checkbox label.devui-checkbox--md.devui-checkbox--bordered{height:32px;padding:0 15px 0 10px}.devui-checkbox label.devui-checkbox--sm{display:flex;align-items:center;font-size:var(--devui-font-size-sm, 12px)}.devui-checkbox label.devui-checkbox--sm .devui-checkbox__material{width:14px;height:14px}.devui-checkbox label.devui-checkbox--sm .devui-checkbox__material>svg{width:14px;height:14px}.devui-checkbox label.devui-checkbox--sm.devui-checkbox--bordered{height:24px;padding:0 15px 0 10px}.devui-checkbox label.devui-checkbox--bordered{border:1px solid var(--devui-disabled-line, #dfe1e6);border-radius:var(--devui-border-radius, 2px)}.devui-checkbox label>span{display:inline-block;box-sizing:content-box;vertical-align:top}.devui-checkbox label>span.devui-checkbox__material{flex-shrink:0}.devui-checkbox label>span.devui-checkbox__label-text{flex-shrink:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.devui-checkbox.disabled label{cursor:not-allowed;color:var(--devui-disabled-text, #cfd0d3)}.devui-checkbox.disabled .devui-checkbox__material{border-color:var(--devui-icon-fill-active-disabled, #beccfa);background-color:var(--devui-icon-fill-active-disabled, #beccfa)}.devui-checkbox.disabled.unchecked .devui-checkbox__material{border-color:var(--devui-disabled-line, #dfe1e6);background-color:var(--devui-disabled-bg, #f5f5f5)}.devui-checkbox.disabled.half-checked .devui-checkbox__material{background-color:var(--devui-disabled-bg, #f5f5f5)}.devui-checkbox.disabled.half-checked .devui-checkbox__material .devui-checkbox__halfchecked-bg{transform:scale(.4288);background-color:var(--devui-disabled-text, #cfd0d3);opacity:1}.devui-checkbox.disabled.active svg polygon{fill:var(--devui-light-text, #ffffff)}.devui-checkbox--no-animation{transition:none!important}.devui-checkbox__column-margin{height:28px;line-height:28px}.devui-checkbox__wrap .devui-checkbox label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.devui-checkbox__group{display:inline-flex;flex-wrap:wrap;justify-content:flex-start;align-items:flex-start}.devui-checkbox__group>*{margin-top:8px}.devui-checkbox__group.is-row{flex-direction:row}.devui-checkbox__group.is-row div:not(:last-child){margin-right:20px}.devui-checkbox__group.is-column{flex-direction:column}.devui-checkbox-button{display:flex;align-items:center;position:relative}.devui-checkbox-button__input{opacity:0;position:absolute;margin:0;z-index:-1;width:0;height:0;overflow:hidden;left:0;pointer-events:none}.devui-checkbox-button__content{font-size:14px;color:var(--devui-text, #252b3a);padding:10px 20px;cursor:pointer;border:1px solid var(--devui-disabled-line, #dfe1e6);display:inline-block;line-height:1;user-select:none}.devui-checkbox-button__content.devui-checkbox-button--lg{font-size:var(--devui-font-size-lg, 14px);padding:var(--devui-btn-lg-padding, 0 24px);height:40px;line-height:40px}.devui-checkbox-button__content.devui-checkbox-button--md{font-size:var(--devui-font-size-md, 12px);padding:var(--devui-btn-padding, 0 20px);height:32px;line-height:32px}.devui-checkbox-button__content.devui-checkbox-button--sm{font-size:var(--devui-font-size-sm, 12px);padding:var(--devui-btn-sm-padding, 0 16px);height:24px;line-height:24px}.devui-checkbox-button.active .devui-checkbox-button__content{color:#fff;background-color:var(--devui-brand, #5e7ce0);border-color:var(--devui-brand, #5e7ce0)}.devui-checkbox-button.active.disabled .devui-checkbox-button__content{color:#fff;background-color:var(--devui-icon-fill-active-disabled, #beccfa);border-color:var(--devui-icon-fill-active-disabled, #beccfa)}.devui-checkbox-button.disabled .devui-checkbox-button__content{cursor:not-allowed;color:var(--devui-disabled-text, #cfd0d3);background-color:#fff;border-color:var(--devui-disabled-line, #dfe1e6)}.devui-checkbox__group.is-row .devui-checkbox-button__content{border-left:none;box-shadow:-1px 0 0 0 var(--devui-disabled-line, #dfe1e6)}.devui-checkbox__group.is-row .devui-checkbox-button:first-child .devui-checkbox-button__content{border-top-left-radius:var(--devui-border-radius, 2px);border-bottom-left-radius:var(--devui-border-radius, 2px);border-left:1px solid var(--devui-disabled-line, #dfe1e6);box-shadow:none}.devui-checkbox__group.is-row .devui-checkbox-button:last-child .devui-checkbox-button__content{border-top-right-radius:var(--devui-border-radius, 2px);border-bottom-right-radius:var(--devui-border-radius, 2px)}.devui-checkbox__group.is-column .devui-checkbox-button{width:100%;margin-top:0}.devui-checkbox__group.is-column .devui-checkbox-button__content{width:100%;border-top:none;box-shadow:0 -1px 0 0 var(--devui-disabled-line, #dfe1e6)}.devui-checkbox__group.is-column .devui-checkbox-button:first-child .devui-checkbox-button__content{border-top-left-radius:var(--devui-border-radius, 2px);border-top-right-radius:var(--devui-border-radius, 2px);border-top:1px solid var(--devui-disabled-line, #dfe1e6);box-shadow:none}.devui-checkbox__group.is-column .devui-checkbox-button:last-child .devui-checkbox-button__content{border-bottom-left-radius:var(--devui-border-radius, 2px);border-bottom-right-radius:var(--devui-border-radius, 2px)}
|
package/code-review/index.es.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { watch, onUnmounted, defineComponent, toRefs, createVNode, Transition, mergeProps, ref, unref, nextTick, withModifiers, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, computed, onMounted, provide, Teleport, createTextVNode
|
|
1
|
+
import { watch, onUnmounted, defineComponent, toRefs, createVNode, Transition, mergeProps, ref, unref, nextTick, withModifiers, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, computed, onMounted, provide, Teleport, createTextVNode } from "vue";
|
|
2
2
|
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
3
3
|
import Clipboard from "clipboard";
|
|
4
4
|
import * as Diff2Html from "diff2html";
|
|
5
|
+
import { Diff2HtmlUI } from "diff2html/lib/ui/js/diff2html-ui";
|
|
5
6
|
const fixedOverlayProps = {
|
|
6
7
|
modelValue: {
|
|
7
8
|
type: Boolean,
|
|
@@ -6205,6 +6206,9 @@ const codeReviewProps = {
|
|
|
6205
6206
|
expandAllThreshold: {
|
|
6206
6207
|
type: Number,
|
|
6207
6208
|
default: 50
|
|
6209
|
+
},
|
|
6210
|
+
codeLoader: {
|
|
6211
|
+
type: Function
|
|
6208
6212
|
}
|
|
6209
6213
|
};
|
|
6210
6214
|
const CodeReviewInjectionKey = Symbol("d-code-review");
|
|
@@ -6300,6 +6304,154 @@ function notEmptyNode(node) {
|
|
|
6300
6304
|
const classes = node.classList;
|
|
6301
6305
|
return !classes.contains("d2h-info") && !classes.contains("d2h-emptyplaceholder") && !classes.contains("comment-cell");
|
|
6302
6306
|
}
|
|
6307
|
+
function insertIncrementLineToPage(referenceDom, trNodes, direction) {
|
|
6308
|
+
const trNodesToBeInserted = trNodes.filter((element) => element.children[0].children.length === 2);
|
|
6309
|
+
if (direction === "up") {
|
|
6310
|
+
const nextSibling = referenceDom.nextElementSibling;
|
|
6311
|
+
trNodesToBeInserted.forEach((item) => {
|
|
6312
|
+
var _a;
|
|
6313
|
+
(_a = referenceDom.parentNode) == null ? void 0 : _a.insertBefore(item, nextSibling);
|
|
6314
|
+
});
|
|
6315
|
+
} else {
|
|
6316
|
+
trNodesToBeInserted.forEach((item) => {
|
|
6317
|
+
var _a;
|
|
6318
|
+
(_a = referenceDom.parentNode) == null ? void 0 : _a.insertBefore(item, referenceDom);
|
|
6319
|
+
});
|
|
6320
|
+
}
|
|
6321
|
+
}
|
|
6322
|
+
function ifRemoveExpandLine(expandDom, newExpandDom, direction) {
|
|
6323
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
6324
|
+
const matches = newExpandDom.children[1].innerText.trim().match(ExpandLineReg);
|
|
6325
|
+
if (!matches) {
|
|
6326
|
+
return true;
|
|
6327
|
+
}
|
|
6328
|
+
const leftLineNumber = parseInt(matches[1]);
|
|
6329
|
+
const addedLine = parseInt(matches[2]);
|
|
6330
|
+
const rightLineNumber = parseInt(matches[3]);
|
|
6331
|
+
if (direction === "up") {
|
|
6332
|
+
const prevSibling = expandDom.previousElementSibling;
|
|
6333
|
+
if (!prevSibling) {
|
|
6334
|
+
if (leftLineNumber === 1 && rightLineNumber === 1) {
|
|
6335
|
+
expandDom == null ? void 0 : expandDom.remove();
|
|
6336
|
+
return true;
|
|
6337
|
+
}
|
|
6338
|
+
} else {
|
|
6339
|
+
const prevLeftLineNumber = parseInt((_c = (_b = (_a = prevSibling.children) == null ? void 0 : _a[0].children) == null ? void 0 : _b[0]) == null ? void 0 : _c.innerText);
|
|
6340
|
+
const prevRightLineNumber = parseInt((_f = (_e = (_d = prevSibling.children) == null ? void 0 : _d[0].children) == null ? void 0 : _e[1]) == null ? void 0 : _f.innerText);
|
|
6341
|
+
if (leftLineNumber === prevLeftLineNumber + 1 && rightLineNumber === prevRightLineNumber + 1) {
|
|
6342
|
+
expandDom.remove();
|
|
6343
|
+
return true;
|
|
6344
|
+
}
|
|
6345
|
+
}
|
|
6346
|
+
} else {
|
|
6347
|
+
const nextSibling = expandDom.nextElementSibling;
|
|
6348
|
+
const nextLeftLineNumber = parseInt((_i = (_h = (_g = nextSibling == null ? void 0 : nextSibling.children) == null ? void 0 : _g[0].children) == null ? void 0 : _h[0]) == null ? void 0 : _i.innerText);
|
|
6349
|
+
const nextRightLineNumber = parseInt((_l = (_k = (_j = nextSibling == null ? void 0 : nextSibling.children) == null ? void 0 : _j[0].children) == null ? void 0 : _k[1]) == null ? void 0 : _l.innerText);
|
|
6350
|
+
if (leftLineNumber + addedLine === nextLeftLineNumber && rightLineNumber + addedLine === nextRightLineNumber) {
|
|
6351
|
+
expandDom.remove();
|
|
6352
|
+
return true;
|
|
6353
|
+
}
|
|
6354
|
+
}
|
|
6355
|
+
return false;
|
|
6356
|
+
}
|
|
6357
|
+
function updateExpandLineCount(expandDom, newExpandDom) {
|
|
6358
|
+
if (!expandDom.nextElementSibling) {
|
|
6359
|
+
return;
|
|
6360
|
+
}
|
|
6361
|
+
const curMatches = expandDom.children[1].innerText.trim().match(ExpandLineReg);
|
|
6362
|
+
const newMatches = newExpandDom.children[1].innerText.trim().match(ExpandLineReg);
|
|
6363
|
+
const newChangedNumLeft = parseInt((curMatches == null ? void 0 : curMatches[2]) || "") + parseInt((newMatches == null ? void 0 : newMatches[2]) || "");
|
|
6364
|
+
const newChangedNumRight = parseInt((curMatches == null ? void 0 : curMatches[4]) || "") + parseInt((newMatches == null ? void 0 : newMatches[4]) || "");
|
|
6365
|
+
expandDom.children[1].children[0].innerText = `@@ -${(newMatches == null ? void 0 : newMatches[1]) || 0},${newChangedNumLeft} +${(newMatches == null ? void 0 : newMatches[3]) || 0},${newChangedNumRight} @@`;
|
|
6366
|
+
}
|
|
6367
|
+
function parseDiffCode(container, code, outputFormat) {
|
|
6368
|
+
const diff2HtmlUi = new Diff2HtmlUI(container, code, {
|
|
6369
|
+
drawFileList: false,
|
|
6370
|
+
matching: "lines",
|
|
6371
|
+
outputFormat,
|
|
6372
|
+
highlight: true
|
|
6373
|
+
});
|
|
6374
|
+
diff2HtmlUi.draw();
|
|
6375
|
+
diff2HtmlUi.highlightCode();
|
|
6376
|
+
}
|
|
6377
|
+
function setLineNumberInDataset(trNode, prevL, prevR, nextL, nextR) {
|
|
6378
|
+
if (trNode) {
|
|
6379
|
+
trNode.classList.add("expand-line");
|
|
6380
|
+
trNode.dataset.prevL = String(prevL);
|
|
6381
|
+
trNode.dataset.prevR = String(prevR);
|
|
6382
|
+
trNode.dataset.nextL = String(nextL);
|
|
6383
|
+
trNode.dataset.nextR = String(nextR);
|
|
6384
|
+
}
|
|
6385
|
+
}
|
|
6386
|
+
function updateExpandUpDownButton(trNode) {
|
|
6387
|
+
trNode.children[0].children[0].remove();
|
|
6388
|
+
trNode.children[0].children[0].classList.remove("up-expand");
|
|
6389
|
+
trNode.children[0].children[0].classList.add("all-expand");
|
|
6390
|
+
trNode.children[0].children[0].innerHTML = AllExpandIcon();
|
|
6391
|
+
}
|
|
6392
|
+
function updateLineNumberInDataset(trNode, expandAllThreshold, position, updateExpandButton = false) {
|
|
6393
|
+
let nextL;
|
|
6394
|
+
let prevL;
|
|
6395
|
+
let nextR;
|
|
6396
|
+
let prevR;
|
|
6397
|
+
if (position === "top") {
|
|
6398
|
+
const nextLineNode = trNode.nextElementSibling;
|
|
6399
|
+
nextL = parseInt(nextLineNode.children[0].children[0].innerText) - 1;
|
|
6400
|
+
prevL = Math.max(nextL - expandAllThreshold + 1, 1);
|
|
6401
|
+
nextR = parseInt(nextLineNode.children[0].children[1].innerText) - 1;
|
|
6402
|
+
prevR = Math.max(nextR - expandAllThreshold + 1, 1);
|
|
6403
|
+
} else if (position === "bottom") {
|
|
6404
|
+
const prevLineNode = trNode.previousElementSibling;
|
|
6405
|
+
prevL = parseInt(prevLineNode.children[0].children[0].innerText) + 1;
|
|
6406
|
+
nextL = prevL + expandAllThreshold - 1;
|
|
6407
|
+
prevR = parseInt(prevLineNode.children[0].children[1].innerText) + 1;
|
|
6408
|
+
nextR = prevR + expandAllThreshold - 1;
|
|
6409
|
+
} else {
|
|
6410
|
+
const prevLineNode = trNode.previousElementSibling;
|
|
6411
|
+
const nextLineNode = trNode.nextElementSibling;
|
|
6412
|
+
const prevLineNumber = parseInt(prevLineNode.children[0].children[0].innerText);
|
|
6413
|
+
const nextLineNumber = parseInt(nextLineNode.children[0].children[0].innerText);
|
|
6414
|
+
prevL = prevLineNumber + 1;
|
|
6415
|
+
prevR = parseInt(prevLineNode.children[0].children[1].innerText) + 1;
|
|
6416
|
+
nextL = nextLineNumber - 1;
|
|
6417
|
+
nextR = parseInt(nextLineNode.children[0].children[1].innerText) - 1;
|
|
6418
|
+
const isExpandAll = nextLineNumber - prevLineNumber <= expandAllThreshold;
|
|
6419
|
+
if (isExpandAll && updateExpandButton) {
|
|
6420
|
+
updateExpandUpDownButton(trNode);
|
|
6421
|
+
}
|
|
6422
|
+
}
|
|
6423
|
+
setLineNumberInDataset(trNode, prevL, prevR, nextL, nextR);
|
|
6424
|
+
}
|
|
6425
|
+
function getLineNumberFormDataset(expandDom, expandAllThreshold) {
|
|
6426
|
+
var _a, _b, _c;
|
|
6427
|
+
const attrsMap = (_b = (_a = expandDom.parentElement) == null ? void 0 : _a.parentElement) == null ? void 0 : _b.dataset;
|
|
6428
|
+
const prevL = Number(attrsMap == null ? void 0 : attrsMap.prevL);
|
|
6429
|
+
const nextL = Number(attrsMap == null ? void 0 : attrsMap.nextL);
|
|
6430
|
+
const prevR = Number(attrsMap == null ? void 0 : attrsMap.prevR);
|
|
6431
|
+
const nextR = Number(attrsMap == null ? void 0 : attrsMap.nextR);
|
|
6432
|
+
let leftLineStart, leftLineEnd, rightLineStart, rightLineEnd;
|
|
6433
|
+
if (prevL && nextL && prevR && nextR) {
|
|
6434
|
+
const buttonClasses = Array.from(expandDom.classList);
|
|
6435
|
+
const direction = (_c = buttonClasses.find((item) => item.endsWith("expand"))) == null ? void 0 : _c.split("-")[0];
|
|
6436
|
+
if (direction === "up") {
|
|
6437
|
+
leftLineEnd = nextL;
|
|
6438
|
+
leftLineStart = Math.max(leftLineEnd - expandAllThreshold + 1, prevL);
|
|
6439
|
+
rightLineEnd = nextR;
|
|
6440
|
+
rightLineStart = Math.max(rightLineEnd - expandAllThreshold + 1, prevR);
|
|
6441
|
+
} else if (direction === "down") {
|
|
6442
|
+
leftLineStart = prevL;
|
|
6443
|
+
leftLineEnd = Math.min(leftLineStart + expandAllThreshold - 1, nextL);
|
|
6444
|
+
rightLineStart = prevR;
|
|
6445
|
+
rightLineEnd = Math.min(rightLineStart + expandAllThreshold - 1, nextR);
|
|
6446
|
+
} else {
|
|
6447
|
+
leftLineStart = prevL;
|
|
6448
|
+
leftLineEnd = nextL;
|
|
6449
|
+
rightLineStart = prevR;
|
|
6450
|
+
rightLineEnd = nextR;
|
|
6451
|
+
}
|
|
6452
|
+
}
|
|
6453
|
+
return [leftLineStart, leftLineEnd, rightLineStart, rightLineEnd];
|
|
6454
|
+
}
|
|
6303
6455
|
function insertNode(parent, child) {
|
|
6304
6456
|
if (parent.firstChild) {
|
|
6305
6457
|
parent.insertBefore(child, parent.firstChild);
|
|
@@ -6351,7 +6503,8 @@ function addCommentToPage(lineHost, commentDom, lineSide) {
|
|
|
6351
6503
|
(_b = lineHost.parentElement) == null ? void 0 : _b.appendChild(newLine);
|
|
6352
6504
|
}
|
|
6353
6505
|
}
|
|
6354
|
-
function useCodeReviewExpand(reviewContentRef,
|
|
6506
|
+
function useCodeReviewExpand(reviewContentRef, props) {
|
|
6507
|
+
const { outputFormat, expandAllThreshold, codeLoader } = toRefs(props);
|
|
6355
6508
|
const processSideBySide = () => {
|
|
6356
6509
|
const [leftTable, rightTable] = reviewContentRef.value.querySelectorAll("table");
|
|
6357
6510
|
const trNodes = Array.from(leftTable.querySelectorAll("tr"));
|
|
@@ -6371,7 +6524,7 @@ function useCodeReviewExpand(reviewContentRef, expandAllThreshold, outputFormat)
|
|
|
6371
6524
|
} else if (lineIndex > 0 && lineIndex < totalLines - 1 && nextLineIndex in trNodes && prevLineIndex in trNodes) {
|
|
6372
6525
|
const preLineChildren = Array.from(trNodes[prevLineIndex].children);
|
|
6373
6526
|
const nextLineChildren = Array.from(trNodes[nextLineIndex].children);
|
|
6374
|
-
const isExpandAll = parseInt(nextLineChildren[0].innerText) - parseInt(preLineChildren[0].innerText) - 1 < expandAllThreshold;
|
|
6527
|
+
const isExpandAll = parseInt(nextLineChildren[0].innerText) - parseInt(preLineChildren[0].innerText) - 1 < expandAllThreshold.value;
|
|
6375
6528
|
attachExpandUpDownButton(lineNumberBox, isExpandAll ? "all" : "updown");
|
|
6376
6529
|
}
|
|
6377
6530
|
}
|
|
@@ -6405,13 +6558,15 @@ function useCodeReviewExpand(reviewContentRef, expandAllThreshold, outputFormat)
|
|
|
6405
6558
|
const nextLineIndex = lineIndex + 1;
|
|
6406
6559
|
const prevLineIndex = lineIndex - 1;
|
|
6407
6560
|
if (lineIndex === 0 && nextLineIndex in trNodes) {
|
|
6561
|
+
updateLineNumberInDataset(trNodes[lineIndex], expandAllThreshold.value, "top");
|
|
6408
6562
|
attachExpandUpDownButton(lineNumberBox, "up");
|
|
6409
6563
|
} else if (lineIndex > 0 && lineIndex < totalLines - 1 && nextLineIndex in trNodes && prevLineIndex in trNodes) {
|
|
6410
6564
|
const prevTdNodes = Array.from(trNodes[prevLineIndex].children);
|
|
6411
6565
|
const prevLineNumber = parseInt(prevTdNodes[0].children[0].innerText);
|
|
6412
6566
|
const nextTdNodes = Array.from(trNodes[nextLineIndex].children);
|
|
6413
6567
|
const nextLineNumber = parseInt(nextTdNodes[0].children[0].innerText);
|
|
6414
|
-
|
|
6568
|
+
updateLineNumberInDataset(trNodes[lineIndex], expandAllThreshold.value, "middle");
|
|
6569
|
+
const isExpandAll = nextLineNumber - prevLineNumber <= expandAllThreshold.value;
|
|
6415
6570
|
attachExpandUpDownButton(lineNumberBox, isExpandAll ? "all" : "updown");
|
|
6416
6571
|
}
|
|
6417
6572
|
}
|
|
@@ -6419,35 +6574,93 @@ function useCodeReviewExpand(reviewContentRef, expandAllThreshold, outputFormat)
|
|
|
6419
6574
|
const loadMoreLine = trNodes[0].cloneNode(true);
|
|
6420
6575
|
loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
|
|
6421
6576
|
loadMoreLine.children[1].innerText = "";
|
|
6422
|
-
loadMoreLine.children[1].style.height = "20px";
|
|
6423
|
-
const lastTrNode = trNodes[totalLines - 1].children;
|
|
6424
|
-
const leftLineStart = parseInt(lastTrNode[0].children[0].innerText) + 1;
|
|
6425
|
-
const rightLineStart = parseInt(lastTrNode[0].children[1].innerText) + 1;
|
|
6426
|
-
if (leftLineStart && rightLineStart) {
|
|
6427
|
-
attachExpandUpDownButton(loadMoreLine.children[0], "down");
|
|
6428
|
-
}
|
|
6429
6577
|
(_a = trNodes[0].parentElement) == null ? void 0 : _a.appendChild(loadMoreLine);
|
|
6578
|
+
updateLineNumberInDataset(loadMoreLine, expandAllThreshold.value, "bottom");
|
|
6579
|
+
attachExpandUpDownButton(loadMoreLine.children[0], "down");
|
|
6580
|
+
};
|
|
6581
|
+
const insertIncrementCode = (code, direction, referenceDom) => {
|
|
6582
|
+
if (!referenceDom) {
|
|
6583
|
+
return;
|
|
6584
|
+
}
|
|
6585
|
+
if (!code) {
|
|
6586
|
+
return referenceDom == null ? void 0 : referenceDom.remove();
|
|
6587
|
+
}
|
|
6588
|
+
const prefix = "--- updated_at Jan 1, 2019, 0:0:0 AM\n+++ updated_at Jan 1, 2019, 0:0:0 AM\n";
|
|
6589
|
+
const container = document.createElement("div");
|
|
6590
|
+
parseDiffCode(container, prefix + code, outputFormat.value);
|
|
6591
|
+
const trNodes = Array.from(container.querySelectorAll("tr"));
|
|
6592
|
+
const expandLine = trNodes.find((element) => {
|
|
6593
|
+
var _a;
|
|
6594
|
+
return (_a = element.children[1]) == null ? void 0 : _a.innerText.trim().match(ExpandLineReg);
|
|
6595
|
+
});
|
|
6596
|
+
if (!expandLine) {
|
|
6597
|
+
return;
|
|
6598
|
+
}
|
|
6599
|
+
insertIncrementLineToPage(referenceDom, trNodes, direction);
|
|
6600
|
+
const removedExpandLine = ifRemoveExpandLine(referenceDom, expandLine, direction);
|
|
6601
|
+
if (removedExpandLine) {
|
|
6602
|
+
return;
|
|
6603
|
+
}
|
|
6604
|
+
updateExpandLineCount(referenceDom, expandLine);
|
|
6605
|
+
if (direction === "up") {
|
|
6606
|
+
if (!referenceDom.previousElementSibling) {
|
|
6607
|
+
updateLineNumberInDataset(referenceDom, expandAllThreshold.value, "top");
|
|
6608
|
+
} else {
|
|
6609
|
+
updateLineNumberInDataset(referenceDom, expandAllThreshold.value, "middle", true);
|
|
6610
|
+
}
|
|
6611
|
+
} else {
|
|
6612
|
+
if (referenceDom.nextElementSibling) {
|
|
6613
|
+
updateLineNumberInDataset(referenceDom, expandAllThreshold.value, "middle", true);
|
|
6614
|
+
} else {
|
|
6615
|
+
updateLineNumberInDataset(referenceDom, expandAllThreshold.value, "bottom");
|
|
6616
|
+
}
|
|
6617
|
+
}
|
|
6618
|
+
};
|
|
6619
|
+
const onExpandButtonClick = (e) => {
|
|
6620
|
+
var _a, _b;
|
|
6621
|
+
const composedPath = e.composedPath();
|
|
6622
|
+
const expandIconDom = composedPath.find((element) => {
|
|
6623
|
+
var _a2;
|
|
6624
|
+
return (_a2 = element.classList) == null ? void 0 : _a2.contains("expand-icon");
|
|
6625
|
+
});
|
|
6626
|
+
if (expandIconDom) {
|
|
6627
|
+
const expandDirection = (_a = Array.from(expandIconDom.classList).find((item) => item.endsWith("expand"))) == null ? void 0 : _a.split("-")[0];
|
|
6628
|
+
const direction = expandDirection === "up" || expandDirection === "all" ? "up" : "down";
|
|
6629
|
+
const [leftLineStart, leftLineEnd, rightLineStart, rightLineEnd] = getLineNumberFormDataset(expandIconDom, expandAllThreshold.value);
|
|
6630
|
+
(_b = codeLoader == null ? void 0 : codeLoader.value) == null ? void 0 : _b.call(codeLoader, [leftLineStart, leftLineEnd, rightLineStart, rightLineEnd], (code) => {
|
|
6631
|
+
var _a2;
|
|
6632
|
+
insertIncrementCode(code, direction, (_a2 = expandIconDom.parentElement) == null ? void 0 : _a2.parentElement);
|
|
6633
|
+
});
|
|
6634
|
+
}
|
|
6430
6635
|
};
|
|
6431
6636
|
const insertExpandButton = () => {
|
|
6432
|
-
outputFormat === "side-by-side" ? processSideBySide() : processLineByLine();
|
|
6637
|
+
outputFormat.value === "side-by-side" ? processSideBySide() : processLineByLine();
|
|
6433
6638
|
};
|
|
6434
|
-
return { insertExpandButton };
|
|
6639
|
+
return { insertExpandButton, onExpandButtonClick };
|
|
6435
6640
|
}
|
|
6436
6641
|
function useCodeReview(props, ctx) {
|
|
6437
|
-
const { diff,
|
|
6642
|
+
const { diff, outputFormat } = toRefs(props);
|
|
6438
6643
|
const renderHtml = ref("");
|
|
6439
|
-
const isFold = ref(fold.value);
|
|
6440
6644
|
const reviewContentRef = ref();
|
|
6441
|
-
const diffFile =
|
|
6442
|
-
const { insertExpandButton } = useCodeReviewExpand(reviewContentRef,
|
|
6645
|
+
const diffFile = ref([]);
|
|
6646
|
+
const { insertExpandButton, onExpandButtonClick } = useCodeReviewExpand(reviewContentRef, props);
|
|
6443
6647
|
const initDiffContent = () => {
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6648
|
+
diffFile.value = Diff2Html.parse(diff.value);
|
|
6649
|
+
nextTick(() => {
|
|
6650
|
+
parseDiffCode(reviewContentRef.value, diff.value, outputFormat.value);
|
|
6651
|
+
insertExpandButton();
|
|
6652
|
+
ctx.emit("contentRefresh", JSON.parse(JSON.stringify(diffFile.value)));
|
|
6448
6653
|
});
|
|
6449
|
-
nextTick(insertExpandButton);
|
|
6450
6654
|
};
|
|
6655
|
+
const onContentClick = (e) => {
|
|
6656
|
+
onExpandButtonClick(e);
|
|
6657
|
+
};
|
|
6658
|
+
watch(diff, initDiffContent, { immediate: true });
|
|
6659
|
+
return { renderHtml, reviewContentRef, diffFile, onContentClick };
|
|
6660
|
+
}
|
|
6661
|
+
function useCodeReviewFold(props, ctx) {
|
|
6662
|
+
const { fold } = toRefs(props);
|
|
6663
|
+
const isFold = ref(fold.value);
|
|
6451
6664
|
const toggleFold = (status) => {
|
|
6452
6665
|
if (status !== void 0) {
|
|
6453
6666
|
isFold.value = status;
|
|
@@ -6459,18 +6672,9 @@ function useCodeReview(props, ctx) {
|
|
|
6459
6672
|
isFold.value = val;
|
|
6460
6673
|
});
|
|
6461
6674
|
watch(isFold, () => {
|
|
6462
|
-
if (!isFold.value && renderHtml.value === "") {
|
|
6463
|
-
initDiffContent();
|
|
6464
|
-
}
|
|
6465
6675
|
ctx.emit("foldChange", isFold.value);
|
|
6466
6676
|
});
|
|
6467
|
-
|
|
6468
|
-
if (!isFold.value) {
|
|
6469
|
-
initDiffContent();
|
|
6470
|
-
}
|
|
6471
|
-
});
|
|
6472
|
-
provide(CodeReviewInjectionKey, { reviewContentRef, diffInfo: diffFile[0], isFold, rootCtx: ctx });
|
|
6473
|
-
return { renderHtml, isFold, reviewContentRef, toggleFold };
|
|
6677
|
+
return { isFold, toggleFold };
|
|
6474
6678
|
}
|
|
6475
6679
|
function useCodeReviewComment(reviewContentRef, ctx) {
|
|
6476
6680
|
const ns2 = useNamespace("code-review");
|
|
@@ -6550,6 +6754,10 @@ function useCodeReviewComment(reviewContentRef, ctx) {
|
|
|
6550
6754
|
nextLineHost = nextLineHost.nextElementSibling;
|
|
6551
6755
|
}
|
|
6552
6756
|
};
|
|
6757
|
+
window.addEventListener("scroll", resetLeftTop);
|
|
6758
|
+
onUnmounted(() => {
|
|
6759
|
+
window.removeEventListener("scroll", resetLeftTop);
|
|
6760
|
+
});
|
|
6553
6761
|
return {
|
|
6554
6762
|
commentLeft,
|
|
6555
6763
|
commentTop,
|
|
@@ -6566,15 +6774,19 @@ var codeReview = "";
|
|
|
6566
6774
|
var CodeReview = defineComponent({
|
|
6567
6775
|
name: "DCodeReview",
|
|
6568
6776
|
props: codeReviewProps,
|
|
6569
|
-
emits: ["foldChange", "addComment", "afterViewInit"],
|
|
6777
|
+
emits: ["foldChange", "addComment", "afterViewInit", "contentRefresh"],
|
|
6570
6778
|
setup(props, ctx) {
|
|
6571
6779
|
const ns2 = useNamespace("code-review");
|
|
6572
6780
|
const {
|
|
6573
6781
|
renderHtml,
|
|
6574
|
-
isFold,
|
|
6575
6782
|
reviewContentRef,
|
|
6576
|
-
|
|
6783
|
+
diffFile,
|
|
6784
|
+
onContentClick
|
|
6577
6785
|
} = useCodeReview(props, ctx);
|
|
6786
|
+
const {
|
|
6787
|
+
isFold,
|
|
6788
|
+
toggleFold
|
|
6789
|
+
} = useCodeReviewFold(props, ctx);
|
|
6578
6790
|
const {
|
|
6579
6791
|
commentLeft,
|
|
6580
6792
|
commentTop,
|
|
@@ -6593,6 +6805,12 @@ var CodeReview = defineComponent({
|
|
|
6593
6805
|
removeComment
|
|
6594
6806
|
});
|
|
6595
6807
|
});
|
|
6808
|
+
provide(CodeReviewInjectionKey, {
|
|
6809
|
+
reviewContentRef,
|
|
6810
|
+
diffInfo: diffFile.value[0],
|
|
6811
|
+
isFold,
|
|
6812
|
+
rootCtx: ctx
|
|
6813
|
+
});
|
|
6596
6814
|
return () => createVNode("div", {
|
|
6597
6815
|
"class": ns2.b()
|
|
6598
6816
|
}, [createVNode(CodeReviewHeader, {
|
|
@@ -6603,6 +6821,7 @@ var CodeReview = defineComponent({
|
|
|
6603
6821
|
}],
|
|
6604
6822
|
"innerHTML": renderHtml.value,
|
|
6605
6823
|
"ref": reviewContentRef,
|
|
6824
|
+
"onClick": onContentClick,
|
|
6606
6825
|
"onMouseenter": onMouseEnter,
|
|
6607
6826
|
"onMousemove": onMouseMove,
|
|
6608
6827
|
"onMouseleave": onMouseleave
|