@univerjs/ui 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/lib/cjs/index.js +29 -12
- package/lib/es/index.js +3948 -6498
- package/lib/index.css +1 -1
- package/lib/types/common/component-manager.d.ts +25 -6
- package/lib/types/components/custom-label/CustomLabel.d.ts +1 -0
- package/lib/types/components/editor/TextEditor.d.ts +8 -1
- package/lib/types/components/hooks/observable.d.ts +3 -0
- package/lib/types/components/range-selector/RangeSelector.d.ts +32 -0
- package/lib/types/controllers/shared-shortcut.controller.d.ts +5 -4
- package/lib/types/controllers/shortcut-display/shortcut-panel.controller.d.ts +2 -2
- package/lib/types/controllers/ui/ui-desktop.controller.d.ts +10 -28
- package/lib/types/controllers/ui/ui.controller.d.ts +0 -4
- package/lib/types/index.d.ts +6 -1
- package/lib/types/locale/zh-CN.d.ts +10 -0
- package/lib/types/services/editor/editor.service.d.ts +44 -17
- package/lib/types/services/popup/global-popup-manager.service.d.ts +45 -0
- package/lib/types/services/range-selector/range-selector.service.d.ts +42 -0
- package/lib/types/services/shortcut/keycode.d.ts +9 -6
- package/lib/types/views/App.d.ts +1 -0
- package/lib/types/views/components/popup/GlobalPopup.d.ts +17 -0
- package/lib/types/views/components/popup/index.d.ts +16 -0
- package/lib/types/views/hooks/active.d.ts +24 -0
- package/lib/umd/index.js +29 -12
- package/package.json +24 -19
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-ui-plugin-sheets-font-family{overflow:hidden;width:120px;font-size:var(--font-size-xs);text-overflow:ellipsis;white-space:nowrap}.univer-ui-plugin-sheets-font-family-item{font-size:var(--font-size-xs)}.univer-ui-plugin-sheets-font-size{width:28px;height:24px;font-size:var(--font-size-xs)}.univer-ui-plugin-sheets-font-size-input{height:24px;line-height:24px;background-color:transparent;border:none}.univer-ui-plugin-sheets-font-size-input input{font-size:var(--font-size-xs);background-color:transparent}.univer-menu-item-no-hover{background:none}.univer-menu-item-content{display:inline-flex;gap:var(--margin-xs);align-items:center}.univer-menu-item-selectable{position:relative;padding-left:var(--padding-xl)}.univer-menu-item-selectable-icon{position:absolute;left:0;display:inline-flex;align-items:center;font-size:var(--font-size-lg)}.univer-menu-item-more-icon{font-size:var(--font-size-sm);color:rgb(var(--text-color))}.univer-app-layout{display:flex;flex-direction:column;height:100%;background-color:rgb(var(--bg-color))}.univer-app-container{position:relative;display:flex;flex:1;flex-direction:column}.univer-app-container-header{position:relative;z-index:10;width:100%}.univer-app-container-wrapper{display:grid;grid-template-columns:1fr auto;height:100%;overflow:hidden}.univer-app-container-content{position:relative;overflow:hidden;display:grid;grid-template-rows:auto 1fr;flex:1;background-color:rgb(var(--bg-color-secondary));border-bottom:1px solid rgb(var(--border-color))}.univer-app-container-canvas{position:relative}.univer-app-container-sidebar{height:100%}.univer-toolbar-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0;font-size:var(--font-size-lg);color:rgb(var(--text-color));background-color:transparent;border:none;border-radius:var(--border-radius-base);outline:none}.univer-toolbar-btn:not([disabled]):hover{background-color:rgb(var(--grey-100))}.univer-toolbar-btn[disabled]{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-btn-active{background-color:rgb(var(--grey-100))}.univer-headerbar{user-select:none;position:relative}.univer-headerbar>.univer-header-menu{position:absolute;top:0;right:0;display:flex;box-sizing:border-box;height:100%}.univer-headerbar>.univer-header-menu>div{user-select:none;display:inline-flex;align-items:center;height:28px;margin-left:4px;padding:2px 4px;text-align:center;border-radius:4px}.univer-headerbar>.univer-header-menu>div:hover{background-color:rgb(var(--grey-300))}.univer-menubar{display:flex;gap:var(--margin-xs);align-items:center;justify-content:center;height:32px}.univer-menubar-item{cursor:pointer;display:block;padding:var(--padding-xs) var(--padding-sm);font-size:var(--font-size-xs);font-weight:400;border-radius:var(--border-radius-base);transition:all .1s ease-in-out}.univer-menubar-item:hover:not(.univer-menubar-item-active){background:rgb(var(--grey-300))}.univer-menubar-item-active{color:rgb(var(--color-white));background:rgb(var(--primary-color))}.univer-toolbar{user-select:none;position:relative;display:flex;align-items:center;box-sizing:border-box;height:32px;font-size:var(--font-size-base);color:rgb(var(--text-color));background-color:rgb(var(--bg-color-secondary));border-bottom:1px solid rgb(var(--border-color))}.univer-toolbar-container{display:flex;gap:var(--margin-xs);align-items:center;justify-content:center;box-sizing:border-box;height:100%;margin:0 auto}.univer-toolbar-more{max-width:80%}.univer-toolbar-more-container{display:grid;gap:var(--margin-xs) 0;box-sizing:border-box;padding:var(--padding-sm);background-color:rgb(var(--bg-color-secondary));border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-base)}.univer-toolbar-more-container .univer-toolbar-group{flex-wrap:wrap}.univer-toolbar-more-container .univer-toolbar-group:not(:last-child):after{content:initial}.univer-toolbar-group{display:flex;gap:var(--margin-xs);align-items:center}.univer-toolbar-group:not(:last-child,:empty):after{content:"";display:block;width:1px;height:20px;background-color:rgb(var(--border-color))}.univer-toolbar-item-select-button{cursor:pointer;position:relative;overflow:hidden;display:flex;gap:var(--margin-xs);align-items:center;height:24px;padding-right:18px;font-size:var(--font-size-lg);border-radius:var(--border-radius-base)}.univer-toolbar-item-select-button-disabled{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-item-select-button:hover,.univer-toolbar-item-select-button:hover .univer-toolbar-item-select-button-label{background-color:rgb(var(--grey-100))}.univer-toolbar-item-select-button-label{position:relative;z-index:1;display:flex;align-items:center;height:100%;padding:0 var(--padding-xs)}.univer-toolbar-item-select-button-label:hover{background-color:rgb(var(--grey-300))!important}.univer-toolbar-item-select-button-arrow{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:flex-end;box-sizing:border-box;width:100%;height:100%;padding-right:var(--padding-xs);font-size:10px;color:rgb(var(--grey-400))}.univer-toolbar-item-select-button-arrow:hover{background-color:rgb(var(--grey-300))}.univer-toolbar-item-select{cursor:pointer;position:relative;display:flex;gap:var(--margin-xs);align-items:center;height:24px;padding:0 var(--padding-xs);font-size:var(--font-size-lg);border-radius:var(--border-radius-base)}.univer-toolbar-item-select-disabled{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-item-select:hover{background-color:rgb(var(--grey-100));border-radius:var(--border-radius-base)}.univer-toolbar-item-select-arrow{display:flex;align-items:center;height:100%;font-size:10px;color:rgb(var(--grey-400))}.univer-toolbar-item-select-arrow-disabled{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-sidebar{position:relative;transform:translate(100%);box-sizing:border-box;width:0;height:100%;color:rgb(var(--text-color));transition:all .15s}.univer-sidebar.univer-sidebar-open{transform:translate(0);width:380px}.univer-sidebar-container{overflow-y:auto;display:grid;grid-template-rows:auto 1fr auto;box-sizing:border-box;width:100%;height:0;min-height:100%;margin:auto;background-color:rgb(var(--bg-color-secondary));border-bottom:1px solid rgb(var(--border-color));border-left:1px solid rgb(var(--border-color))}.univer-sidebar-header{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;height:44px;padding:var(--padding-xl) var(--padding-xl) 0;font-size:var(--font-size-lg);font-weight:500;background:rgb(var(--bg-color-secondary))}.univer-sidebar-header-close{cursor:pointer;color:rgb(var(--text-color-secondary))}.univer-sidebar-body{padding:0 var(--padding-xl)}.univer-sidebar-footer{position:sticky;bottom:0;padding:var(--padding-xl);background:rgb(var(--bg-color-secondary))}.univer-zen-zone{position:absolute;display:none}.univer-zen-zone-open{z-index:100;top:0;left:0;display:block;width:100%;height:100%;background:rgb(var(--bg-color))}.univer-zen-zone-close{display:none}.univer-notification{position:fixed;z-index:1000;display:flex;flex-direction:column;align-items:flex-end;justify-content:center;box-sizing:border-box;margin:var(--margin-xs) 0}.univer-notification-notice{display:flex;gap:var(--margin-xs);justify-content:space-between;width:280px;padding:var(--padding-lg);font-size:var(--font-size-lg);background-color:rgb(var(--color-white));border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-lg)}.univer-notification-notice-wrapper{margin:var(--margin-xs) var(--margin-base)}.univer-notification-notice-content{display:inline-flex;gap:var(--margin-xs);align-items:center;align-items:flex-start}.univer-notification-notice-close{cursor:pointer;display:flex;align-items:center;justify-content:center;width:fit-content;height:fit-content;padding:var(--padding-xs);color:rgb(var(--text-color-secondary));border-radius:var(--border-radius-base);outline:none;transition:background-color .2s}.univer-notification-notice-close:hover{background-color:rgb(var(--bg-color-hover))}.univer-notification-icon{padding:var(--padding-xs)}.univer-notification-icon-success{color:rgb(var(--success-color))}.univer-notification-icon-info{color:rgb(var(--info-color))}.univer-notification-icon-warning{color:rgb(var(--warning-color))}.univer-notification-icon-error{color:rgb(var(--error-color))}.univer-notification-content-container{display:inline-flex;flex-direction:column;gap:var(--margin-xs);align-items:flex-start;padding-top:var(--padding-xs)}.univer-notification-title{color:rgb(var(--text-color))}.univer-notification-content{color:rgb(var(--text-color-secondary))}.univer-notification-content-ellipsis{overflow:hidden;display:-webkit-box;text-overflow:ellipsis;-webkit-box-orient:vertical}.univer-notification-top,.univer-notification-topLeft,.univer-notification-topRight{top:0}.univer-notification-bottom,.univer-notification-bottomRight,.univer-notification-bottomLeft{bottom:0}.univer-notification-bottomRight,.univer-notification-topRight{right:0}.univer-notification-fade{overflow:hidden;transition:all .3s}.univer-notification-fade-appear-prepare{opacity:0}.univer-notification-fade-appear-start{transform:translate(100%);opacity:0}.univer-notification-fade-appear-active{transform:translate(0);opacity:1}.univer-notification-fade-appear,.univer-notification-fade-enter{opacity:0;animation-play-state:paused;animation-duration:.3s;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-fill-mode:both}.univer-notification-fade-leave{animation-duration:.3s;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-fill-mode:both;animation-play-state:paused}.univer-notification-fade-appear.univer-notification-fade-appear-active,.univer-notification-fade-enter.univer-notification-fade-enter-active{animation-name:univer-notification-fade-in;animation-play-state:running}.univer-notification-fade-leave.univer-notification-fade-leave-active{animation-name:univer-notification-fade-out;animation-play-state:running}@keyframes univer-notification-fade-in{0%{opacity:0}to{opacity:1}}@keyframes univer-notification-fade-out{0%{opacity:1}to{opacity:0}}.univer-global-zone{position:absolute;display:none}.univer-global-zone-open{z-index:100;top:0;left:0;display:block;width:100%;height:100%;background:rgb(var(--bg-color))}.univer-global-zone-close{display:none}.univer-shortcut-panel-group-title{height:40px;font-size:13px;font-weight:700;line-height:40px}.univer-shortcut-panel-item{display:flex;justify-content:space-between;height:40px;font-size:13px;line-height:40px}.univer-shortcut-panel-item-title{overflow:hidden;flex-grow:1;flex-shrink:1;max-width:200px;text-overflow:ellipsis;text-wrap:nowrap}.univer-shortcut-panel-item-shortcut{flex-grow:0;flex-shrink:0}.univer-shortcut-panel-item:not(:last-of-type){border-bottom:1px solid rgb(var(--grey-200))}.univer-text-editor-container{position:relative;width:100%;height:30px;user-select:none;border:1px solid rgb(var(--border-color));transition:all .15s;border-radius:var(--border-radius-base)}.univer-text-editor-container:hover,.univer-text-editor-container:active,.univer-text-editor-container-active{border:1px solid rgb(var(--primary-color))}.univer-text-editor-container-error,.univer-text-editor-container-error:hover{border:1px solid rgb(var(--error-color))}.univer-text-editor-validation-error{font-size:10px;color:rgb(var(--error-color))}
|
|
1
|
+
.univer-ui-plugin-sheets-font-family{overflow:hidden;width:120px;font-size:var(--font-size-xs);text-overflow:ellipsis;white-space:nowrap}.univer-ui-plugin-sheets-font-family-item{font-size:var(--font-size-xs)}.univer-ui-plugin-sheets-font-size{width:28px;height:24px;font-size:var(--font-size-xs)}.univer-ui-plugin-sheets-font-size-input{height:24px;line-height:24px;background-color:transparent;border:none}.univer-ui-plugin-sheets-font-size-input input{font-size:var(--font-size-xs);background-color:transparent}.univer-menu-item-no-hover{background:none}.univer-menu-item-content{display:inline-flex;gap:var(--margin-xs);align-items:center}.univer-menu-item-selectable{position:relative;padding-left:var(--padding-xl)}.univer-menu-item-selectable-icon{position:absolute;left:0;display:inline-flex;align-items:center;font-size:var(--font-size-lg)}.univer-menu-item-more-icon{font-size:var(--font-size-sm);color:rgb(var(--text-color))}.univer-app-layout{display:flex;flex-direction:column;height:100%;background-color:rgb(var(--bg-color));min-height:0}.univer-app-container{position:relative;display:flex;flex:1;flex-direction:column;min-height:0}.univer-app-container-header{position:relative;z-index:10;width:100%}.univer-app-container-wrapper{display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:100%;height:100%;overflow:hidden}.univer-app-container-content{position:relative;overflow:hidden;display:grid;grid-template-rows:auto 1fr;flex:1;background-color:rgb(var(--bg-color-secondary));border-bottom:1px solid rgb(var(--border-color))}.univer-app-container-canvas{position:relative}.univer-app-container-left-sidebar,.univer-app-container-sidebar{height:100%}.univer-toolbar-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0;font-size:var(--font-size-lg);color:rgb(var(--text-color));background-color:transparent;border:none;border-radius:var(--border-radius-base);outline:none}.univer-toolbar-btn:not([disabled]):hover{background-color:rgb(var(--grey-100))}.univer-toolbar-btn[disabled]{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-btn-active{background-color:rgb(var(--grey-100))}.univer-headerbar{user-select:none;position:relative}.univer-headerbar>.univer-header-menu{position:absolute;top:0;right:0;display:flex;box-sizing:border-box;height:100%}.univer-headerbar>.univer-header-menu>div{user-select:none;display:inline-flex;align-items:center;height:28px;margin-left:4px;padding:2px 4px;text-align:center;border-radius:4px}.univer-headerbar>.univer-header-menu>div:hover{background-color:rgb(var(--grey-300))}.univer-menubar{display:flex;gap:var(--margin-xs);align-items:center;justify-content:center;height:32px}.univer-menubar-item{cursor:pointer;display:block;padding:var(--padding-xs) var(--padding-sm);font-size:var(--font-size-xs);font-weight:400;border-radius:var(--border-radius-base);transition:all .1s ease-in-out}.univer-menubar-item:hover:not(.univer-menubar-item-active){background:rgb(var(--grey-300))}.univer-menubar-item-active{color:rgb(var(--color-white));background:rgb(var(--primary-color))}.univer-toolbar{user-select:none;position:relative;display:flex;align-items:center;box-sizing:border-box;height:32px;font-size:var(--font-size-base);color:rgb(var(--text-color));background-color:rgb(var(--bg-color-secondary));border-bottom:1px solid rgb(var(--border-color))}.univer-toolbar-container{display:flex;gap:var(--margin-xs);align-items:center;justify-content:center;box-sizing:border-box;height:100%;margin:0 auto}.univer-toolbar-more{max-width:80%}.univer-toolbar-more-container{display:grid;gap:var(--margin-xs) 0;box-sizing:border-box;padding:var(--padding-sm);background-color:rgb(var(--bg-color-secondary));border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-base)}.univer-toolbar-more-container .univer-toolbar-group{flex-wrap:wrap}.univer-toolbar-more-container .univer-toolbar-group:not(:last-child):after{content:initial}.univer-toolbar-group{display:flex;gap:var(--margin-xs);align-items:center}.univer-toolbar-group:not(:last-child,:empty):after{content:"";display:block;width:1px;height:20px;background-color:rgb(var(--border-color))}.univer-toolbar-item-select-button{cursor:pointer;position:relative;overflow:hidden;display:flex;gap:var(--margin-xs);align-items:center;height:24px;padding-right:18px;font-size:var(--font-size-lg);border-radius:var(--border-radius-base)}.univer-toolbar-item-select-button-disabled{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-item-select-button:hover,.univer-toolbar-item-select-button:hover .univer-toolbar-item-select-button-label{background-color:rgb(var(--grey-100))}.univer-toolbar-item-select-button-label{position:relative;z-index:1;display:flex;align-items:center;height:100%;padding:0 var(--padding-xs)}.univer-toolbar-item-select-button-label:hover{background-color:rgb(var(--grey-300))!important}.univer-toolbar-item-select-button-arrow{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:flex-end;box-sizing:border-box;width:100%;height:100%;padding-right:var(--padding-xs);font-size:10px;color:rgb(var(--grey-400))}.univer-toolbar-item-select-button-arrow:hover{background-color:rgb(var(--grey-300))}.univer-toolbar-item-select{cursor:pointer;position:relative;display:flex;gap:var(--margin-xs);align-items:center;height:24px;padding:0 var(--padding-xs);font-size:var(--font-size-lg);border-radius:var(--border-radius-base)}.univer-toolbar-item-select-disabled{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-item-select:hover{background-color:rgb(var(--grey-100));border-radius:var(--border-radius-base)}.univer-toolbar-item-select-arrow{display:flex;align-items:center;height:100%;font-size:10px;color:rgb(var(--grey-400))}.univer-toolbar-item-select-arrow-disabled{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-sidebar{position:relative;transform:translate(100%);box-sizing:border-box;width:0;height:100%;color:rgb(var(--text-color));transition:all .15s}.univer-sidebar.univer-sidebar-open{transform:translate(0);width:380px}.univer-sidebar-container{overflow-y:auto;display:grid;grid-template-rows:auto 1fr auto;box-sizing:border-box;width:100%;height:0;min-height:100%;margin:auto;background-color:rgb(var(--bg-color-secondary));border-bottom:1px solid rgb(var(--border-color));border-left:1px solid rgb(var(--border-color))}.univer-sidebar-header{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;height:44px;padding:var(--padding-xl) var(--padding-xl) 0;font-size:var(--font-size-lg);font-weight:500;background:rgb(var(--bg-color-secondary))}.univer-sidebar-header-close{cursor:pointer;color:rgb(var(--text-color-secondary))}.univer-sidebar-body{padding:0 var(--padding-xl)}.univer-sidebar-footer{position:sticky;bottom:0;padding:var(--padding-xl);background:rgb(var(--bg-color-secondary))}.univer-zen-zone{position:absolute;display:none}.univer-zen-zone-open{z-index:100;top:0;left:0;display:block;width:100%;height:100%;background:rgb(var(--bg-color))}.univer-zen-zone-close{display:none}.univer-notification{position:fixed;z-index:1000;display:flex;flex-direction:column;align-items:flex-end;justify-content:center;box-sizing:border-box;margin:var(--margin-xs) 0}.univer-notification-notice{display:flex;gap:var(--margin-xs);justify-content:space-between;width:280px;padding:var(--padding-lg);font-size:var(--font-size-lg);background-color:rgb(var(--color-white));border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-lg)}.univer-notification-notice-wrapper{margin:var(--margin-xs) var(--margin-base)}.univer-notification-notice-content{display:inline-flex;gap:var(--margin-xs);align-items:center;align-items:flex-start}.univer-notification-notice-close{cursor:pointer;display:flex;align-items:center;justify-content:center;width:fit-content;height:fit-content;padding:var(--padding-xs);color:rgb(var(--text-color-secondary));border-radius:var(--border-radius-base);outline:none;transition:background-color .2s}.univer-notification-notice-close:hover{background-color:rgb(var(--bg-color-hover))}.univer-notification-icon{padding:var(--padding-xs)}.univer-notification-icon-success{color:rgb(var(--success-color))}.univer-notification-icon-info{color:rgb(var(--info-color))}.univer-notification-icon-warning{color:rgb(var(--warning-color))}.univer-notification-icon-error{color:rgb(var(--error-color))}.univer-notification-content-container{display:inline-flex;flex-direction:column;gap:var(--margin-xs);align-items:flex-start;padding-top:var(--padding-xs)}.univer-notification-title{color:rgb(var(--text-color))}.univer-notification-content{color:rgb(var(--text-color-secondary))}.univer-notification-content-ellipsis{overflow:hidden;display:-webkit-box;text-overflow:ellipsis;-webkit-box-orient:vertical}.univer-notification-top,.univer-notification-topLeft,.univer-notification-topRight{top:0}.univer-notification-bottom,.univer-notification-bottomRight,.univer-notification-bottomLeft{bottom:0}.univer-notification-bottomRight,.univer-notification-topRight{right:0}.univer-notification-fade{overflow:hidden;transition:all .3s}.univer-notification-fade-appear-prepare{opacity:0}.univer-notification-fade-appear-start{transform:translate(100%);opacity:0}.univer-notification-fade-appear-active{transform:translate(0);opacity:1}.univer-notification-fade-appear,.univer-notification-fade-enter{opacity:0;animation-play-state:paused;animation-duration:.3s;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-fill-mode:both}.univer-notification-fade-leave{animation-duration:.3s;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-fill-mode:both;animation-play-state:paused}.univer-notification-fade-appear.univer-notification-fade-appear-active,.univer-notification-fade-enter.univer-notification-fade-enter-active{animation-name:univer-notification-fade-in;animation-play-state:running}.univer-notification-fade-leave.univer-notification-fade-leave-active{animation-name:univer-notification-fade-out;animation-play-state:running}@keyframes univer-notification-fade-in{0%{opacity:0}to{opacity:1}}@keyframes univer-notification-fade-out{0%{opacity:1}to{opacity:0}}.univer-global-zone{position:absolute;display:none}.univer-global-zone-open{z-index:100;top:0;left:0;display:block;width:100%;height:100%;background:rgb(var(--bg-color))}.univer-global-zone-close{display:none}.univer-shortcut-panel-group-title{height:40px;font-size:13px;font-weight:700;line-height:40px}.univer-shortcut-panel-item{display:flex;justify-content:space-between;height:40px;font-size:13px;line-height:40px}.univer-shortcut-panel-item-title{overflow:hidden;flex-grow:1;flex-shrink:1;max-width:200px;text-overflow:ellipsis;text-wrap:nowrap}.univer-shortcut-panel-item-shortcut{flex-grow:0;flex-shrink:0}.univer-shortcut-panel-item:not(:last-of-type){border-bottom:1px solid rgb(var(--grey-200))}.univer-text-editor-container{position:relative;width:100%;height:30px;user-select:none;border:1px solid rgb(var(--border-color));transition:all .15s;border-radius:var(--border-radius-base)}.univer-text-editor-container:hover,.univer-text-editor-container:active,.univer-text-editor-container-active,.univer-text-editor-container-active:hover{border:1px solid rgb(var(--hyacinth-500))}.univer-text-editor-container-error,.univer-text-editor-container-error:hover{border:1px solid rgb(var(--red-400))}.univer-text-editor-container-disabled,.univer-text-editor-container-disabled:hover{border-color:rgb(var(--grey-100))}.univer-text-editor-container-placeholder{position:absolute;top:49%;left:5px;transform:translateY(-50%);color:rgb(var(--grey-400));font-size:var(--font-size-xs);pointer-events:none}.univer-text-editor-validation-error{font-size:10px;color:rgb(var(--red-400))}.univer-range-selector{overflow:hidden;display:flex;align-items:center;justify-content:space-between;color:rgb(var(--grey-600));border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-base);width:220px;height:32px}.univer-range-selector-editor{position:relative;user-select:none;width:100%;height:100%;border:0;outline:0}.univer-range-selector-icon{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;margin-right:4px;font-size:var(--font-size-lg);color:rgb(var(--text-color));background-color:transparent;border:none;border-radius:var(--border-radius-base);outline:none}.univer-range-selector-icon:not([disabled]):hover{background-color:rgb(var(--grey-100))}.univer-range-selector-icon[disabled]{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-range-selector:hover,.univer-range-selector-active{border-color:rgb(var(--hyacinth-500))}.univer-range-selector-active .univer-range-selector-icon{color:rgb(var(--hyacinth-500))}.univer-range-selector-error{border-color:rgb(var(--red-400))}.univer-range-selector-error .univer-range-selector-icon{color:rgb(var(--red-400))}.univer-range-selector-error:hover{border-color:rgb(var(--red-400))}.univer-range-selector-disabled{border-color:rgb(var(--grey-100))}.univer-range-selector-disabled .univer-range-selector-icon{color:rgb(var(--grey-100))}.univer-range-selector-disabled:hover{border-color:rgb(var(--grey-100))}.univer-range-selector-modal{position:relative;max-height:500px;overflow:hidden;overflow-y:auto}.univer-range-selector-modal-container{display:flex;flex-direction:row;align-items:center;margin-bottom:10px}.univer-range-selector-modal-container-input{display:inline-block;width:280px}.univer-range-selector-modal-container-input-active{border-color:rgb(var(--hyacinth-500))}.univer-range-selector-modal-container-button{display:inline-block;text-align:center;width:28px}.univer-range-selector-modal-container-button:hover{cursor:pointer;color:rgb(var(--hyacinth-500))}.univer-range-selector-modal-add{position:relative;width:300px;margin-top:5px;text-align:left;color:rgb(var(--hyacinth-500));font-size:var(--font-size-xs)}.univer-range-selector-modal-add-button{display:flex;align-items:center;justify-content:center}.univer-range-selector-modal-add-button:hover{cursor:pointer;background-color:rgb(var(--hyacinth-500),.05)}
|
|
@@ -14,15 +14,34 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IDisposable } from '@wendellhu/redi';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
import type { defineComponent } from 'vue';
|
|
18
|
+
import type React from 'react';
|
|
19
|
+
type ComponentFramework = 'vue3' | 'react';
|
|
20
|
+
interface IComponentOptions {
|
|
21
|
+
framework?: ComponentFramework;
|
|
20
22
|
}
|
|
21
|
-
export
|
|
23
|
+
export interface IVue3Component {
|
|
24
|
+
framework: 'vue3';
|
|
25
|
+
component: ReturnType<typeof defineComponent>;
|
|
26
|
+
}
|
|
27
|
+
export interface IReactComponent {
|
|
28
|
+
framework: 'react';
|
|
29
|
+
component: React.ForwardRefExoticComponent<any>;
|
|
30
|
+
}
|
|
31
|
+
export type ComponentType = React.ForwardRefExoticComponent<any> | ReturnType<typeof defineComponent>;
|
|
32
|
+
export type ComponentList = Map<string, IVue3Component | IReactComponent>;
|
|
22
33
|
export declare class ComponentManager {
|
|
23
34
|
private _components;
|
|
24
35
|
constructor();
|
|
25
|
-
register(name: string, component:
|
|
26
|
-
get(name: string):
|
|
36
|
+
register(name: string, component: ComponentType, options?: IComponentOptions): IDisposable;
|
|
37
|
+
get(name: string): React.ForwardRefExoticComponent<any> | ((props: any) => React.FunctionComponentElement<{
|
|
38
|
+
component: any;
|
|
39
|
+
props: Record<string, any>;
|
|
40
|
+
}>) | undefined;
|
|
27
41
|
delete(name: string): void;
|
|
28
42
|
}
|
|
43
|
+
export declare function VueComponentWrapper(options: {
|
|
44
|
+
component: ReturnType<typeof defineComponent>;
|
|
45
|
+
props: Record<string, any>;
|
|
46
|
+
}): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
47
|
+
export {};
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/// <reference types="react" />
|
|
16
17
|
import type { Observable } from 'rxjs';
|
|
17
18
|
import type { IMenuSelectorItem } from '../../services/menu/menu';
|
|
18
19
|
export type ICustomLabelProps<T = undefined> = {
|
|
@@ -31,10 +31,17 @@ export interface ITextEditorProps {
|
|
|
31
31
|
onlyInputFormula?: boolean;
|
|
32
32
|
onlyInputRange?: boolean;
|
|
33
33
|
onlyInputContent?: boolean;
|
|
34
|
+
isSingleChoice?: boolean;
|
|
35
|
+
openForSheetUnitId?: Nullable<string>;
|
|
36
|
+
openForSheetSubUnitId?: Nullable<string>;
|
|
37
|
+
onChange?: (value: Nullable<string>) => void;
|
|
38
|
+
onActive?: (state: boolean) => void;
|
|
39
|
+
onValid?: (state: boolean) => void;
|
|
40
|
+
placeholder?: string;
|
|
34
41
|
}
|
|
35
42
|
/**
|
|
36
43
|
* The component to render toolbar item label and menu item label.
|
|
37
44
|
* @param props
|
|
38
45
|
*/
|
|
39
|
-
export declare function TextEditor(props: ITextEditorProps & MyComponentProps): JSX.Element | null;
|
|
46
|
+
export declare function TextEditor(props: ITextEditorProps & Omit<MyComponentProps, 'onChange' | 'onActive'>): JSX.Element | null;
|
|
40
47
|
export {};
|
|
@@ -14,5 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { Observable } from 'rxjs';
|
|
17
|
+
type ObservableOrFn<T> = Observable<T> | (() => Observable<T>);
|
|
17
18
|
export declare function useObservable<T>(observable: Observable<T>, defaultValue?: T): T | undefined;
|
|
18
19
|
export declare function useObservable<T>(observable: Observable<T>, defaultValue?: T, shouldHaveSyncValue?: true): T;
|
|
20
|
+
export declare function useObservable<T>(observable: ObservableOrFn<T>, defaultValue?: T, shouldHaveSyncValue?: false, deps?: any[]): T | undefined;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IUnitRange, Nullable } from '@univerjs/core';
|
|
17
|
+
import React from 'react';
|
|
18
|
+
export interface IRangeSelectorProps {
|
|
19
|
+
id: string;
|
|
20
|
+
value?: string;
|
|
21
|
+
onChange?: (ranges: IUnitRange[]) => void;
|
|
22
|
+
onActive?: (state: boolean) => void;
|
|
23
|
+
onValid?: (state: boolean) => void;
|
|
24
|
+
isSingleChoice?: boolean;
|
|
25
|
+
isReadonly?: boolean;
|
|
26
|
+
openForSheetUnitId?: Nullable<string>;
|
|
27
|
+
openForSheetSubUnitId?: Nullable<string>;
|
|
28
|
+
width?: number;
|
|
29
|
+
size?: 'mini' | 'small' | 'middle' | 'large';
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function RangeSelector(props: IRangeSelectorProps): React.JSX.Element;
|
|
@@ -18,10 +18,12 @@ import { Injector } from '@wendellhu/redi';
|
|
|
18
18
|
import { IMenuService } from '../services/menu/menu.service';
|
|
19
19
|
import type { IShortcutItem } from '../services/shortcut/shortcut.service';
|
|
20
20
|
import { IShortcutService } from '../services/shortcut/shortcut.service';
|
|
21
|
-
import { IClipboardInterfaceService } from '../services/clipboard/clipboard-interface.service';
|
|
22
21
|
export declare const CopyShortcutItem: IShortcutItem;
|
|
23
22
|
export declare const CutShortcutItem: IShortcutItem;
|
|
24
|
-
|
|
23
|
+
/**
|
|
24
|
+
* This shortcut item is just for displaying shortcut info, do not use it.
|
|
25
|
+
*/
|
|
26
|
+
export declare const OnlyDisplayPasteShortcutItem: IShortcutItem;
|
|
25
27
|
export declare const UndoShortcutItem: IShortcutItem;
|
|
26
28
|
export declare const RedoShortcutItem: IShortcutItem;
|
|
27
29
|
/**
|
|
@@ -32,8 +34,7 @@ export declare class SharedController extends Disposable {
|
|
|
32
34
|
private readonly _menuService;
|
|
33
35
|
private readonly _shortcutService;
|
|
34
36
|
private readonly _commandService;
|
|
35
|
-
|
|
36
|
-
constructor(_injector: Injector, _menuService: IMenuService, _shortcutService: IShortcutService, _commandService: ICommandService, _interfaceService: IClipboardInterfaceService);
|
|
37
|
+
constructor(_injector: Injector, _menuService: IMenuService, _shortcutService: IShortcutService, _commandService: ICommandService);
|
|
37
38
|
initialize(): void;
|
|
38
39
|
private _registerMenus;
|
|
39
40
|
private _registerCommands;
|
|
@@ -17,10 +17,10 @@ import { Disposable, ICommandService } from '@univerjs/core';
|
|
|
17
17
|
import { Injector } from '@wendellhu/redi';
|
|
18
18
|
import { ComponentManager } from '../../common/component-manager';
|
|
19
19
|
import { IMenuService } from '../../services/menu/menu.service';
|
|
20
|
+
import { IShortcutService } from '../../services/shortcut/shortcut.service';
|
|
20
21
|
/**
|
|
21
22
|
* This controller add a side panel to the application to display the shortcuts.
|
|
22
23
|
*/
|
|
23
24
|
export declare class ShortcutPanelController extends Disposable {
|
|
24
|
-
|
|
25
|
-
constructor(_injector: Injector, menuService: IMenuService, commandService: ICommandService, componentManager: ComponentManager);
|
|
25
|
+
constructor(injector: Injector, componentManager: ComponentManager, shortcutService: IShortcutService, menuService: IMenuService, commandService: ICommandService);
|
|
26
26
|
}
|
|
@@ -27,43 +27,25 @@ export declare enum DesktopUIPart {
|
|
|
27
27
|
HEADER = "header",
|
|
28
28
|
HEADER_MENU = "header-menu",
|
|
29
29
|
CONTENT = "content",
|
|
30
|
-
FOOTER = "footer"
|
|
30
|
+
FOOTER = "footer",
|
|
31
|
+
LEFT_SIDEBAR = "left-sidebar"
|
|
31
32
|
}
|
|
32
|
-
/**
|
|
33
|
-
* IDesktopUIController
|
|
34
|
-
*/
|
|
35
33
|
export interface IDesktopUIController extends IUIController {
|
|
36
34
|
componentRegistered$: Observable<void>;
|
|
37
35
|
registerComponent(part: DesktopUIPart, component: () => ComponentType): IDisposable;
|
|
38
|
-
|
|
39
|
-
registerHeaderComponent(component: () => ComponentType): IDisposable;
|
|
40
|
-
getHeaderComponents(): Set<() => ComponentType>;
|
|
41
|
-
registerContentComponent(component: () => ComponentType): IDisposable;
|
|
42
|
-
getContentComponents(): Set<() => ComponentType>;
|
|
43
|
-
registerFooterComponent(component: () => ComponentType): IDisposable;
|
|
44
|
-
getFooterComponents(): Set<() => ComponentType>;
|
|
36
|
+
getComponents(part: DesktopUIPart): Set<() => ComponentType>;
|
|
45
37
|
}
|
|
46
38
|
export declare class DesktopUIController extends Disposable implements IDesktopUIController {
|
|
47
39
|
private readonly _injector;
|
|
48
40
|
private readonly _lifecycleService;
|
|
49
41
|
private readonly _renderManagerService;
|
|
50
|
-
private readonly _layoutService
|
|
51
|
-
private
|
|
52
|
-
private
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
private _componentRegistered$;
|
|
56
|
-
componentRegistered$: Observable<void>;
|
|
57
|
-
constructor(_injector: Injector, _lifecycleService: LifecycleService, _renderManagerService: IRenderManagerService, _layoutService: ILayoutService);
|
|
42
|
+
private readonly _layoutService?;
|
|
43
|
+
private _componentsByPart;
|
|
44
|
+
private readonly _componentRegistered$;
|
|
45
|
+
readonly componentRegistered$: Observable<void>;
|
|
46
|
+
constructor(_injector: Injector, _lifecycleService: LifecycleService, _renderManagerService: IRenderManagerService, _layoutService?: ILayoutService | undefined);
|
|
58
47
|
bootstrapWorkbench(options: IWorkbenchOptions): void;
|
|
59
|
-
private _initializeEngine;
|
|
60
48
|
registerComponent(part: DesktopUIPart, component: () => React.ComponentType): IDisposable;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
registerHeaderComponent(component: () => ComponentType): IDisposable;
|
|
64
|
-
getHeaderComponents(): Set<() => ComponentType>;
|
|
65
|
-
registerContentComponent(component: () => ComponentType): IDisposable;
|
|
66
|
-
getContentComponents(): Set<() => ComponentType>;
|
|
67
|
-
registerFooterComponent(component: () => ComponentType): IDisposable;
|
|
68
|
-
getFooterComponents(): Set<() => ComponentType>;
|
|
49
|
+
getComponents(part: DesktopUIPart): Set<() => ComponentType>;
|
|
50
|
+
private _initializeEngine;
|
|
69
51
|
}
|
|
@@ -15,11 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export interface IWorkbenchOptions {
|
|
17
17
|
container?: string | HTMLElement;
|
|
18
|
-
outerLeft?: boolean;
|
|
19
|
-
innerLeft?: boolean;
|
|
20
18
|
header?: boolean;
|
|
21
|
-
infoBar?: boolean;
|
|
22
|
-
toolbar?: boolean;
|
|
23
19
|
footer?: boolean;
|
|
24
20
|
}
|
|
25
21
|
export interface IUIController {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export { getMenuHiddenObservable } from './common/menu-hidden-observable';
|
|
|
18
18
|
export * from './components';
|
|
19
19
|
export { t } from './components/hooks/locale';
|
|
20
20
|
export { useObservable } from './components/hooks/observable';
|
|
21
|
-
export { CopyShortcutItem, CutShortcutItem,
|
|
21
|
+
export { CopyShortcutItem, CutShortcutItem, RedoShortcutItem, SharedController, UndoShortcutItem, } from './controllers/shared-shortcut.controller';
|
|
22
22
|
export { IUIController } from './controllers/ui/ui.controller';
|
|
23
23
|
export { DesktopUIPart, type IDesktopUIController } from './controllers/ui/ui-desktop.controller';
|
|
24
24
|
export { enUS, zhCN } from './locale';
|
|
@@ -51,3 +51,8 @@ export { type IConfirmPartMethodOptions } from './views/components/confirm-part/
|
|
|
51
51
|
export { IEditorService, EditorService } from './services/editor/editor.service';
|
|
52
52
|
export { TextEditor } from './components/editor/TextEditor';
|
|
53
53
|
export { SetEditorResizeOperation } from './commands/operations/editor/set-editor-resize.operation';
|
|
54
|
+
export { RangeSelector } from './components/range-selector/RangeSelector';
|
|
55
|
+
export { IRangeSelectorService } from './services/range-selector/range-selector.service';
|
|
56
|
+
export { DesktopLocalStorageService } from './services/local-storage/local-storage.service';
|
|
57
|
+
export { useActiveWorkbook, useActiveWorksheet } from './views/hooks/active';
|
|
58
|
+
export { GlobalPopupManagerService, IGlobalPopupManagerService } from './services/popup/global-popup-manager.service';
|
|
@@ -49,6 +49,7 @@ declare const locale: {
|
|
|
49
49
|
cut: string;
|
|
50
50
|
copy: string;
|
|
51
51
|
paste: string;
|
|
52
|
+
'shortcut-panel': string;
|
|
52
53
|
};
|
|
53
54
|
'common-edit': string;
|
|
54
55
|
'toggle-shortcut-panel': string;
|
|
@@ -62,5 +63,14 @@ declare const locale: {
|
|
|
62
63
|
formulaError: string;
|
|
63
64
|
rangeError: string;
|
|
64
65
|
};
|
|
66
|
+
rangeSelector: {
|
|
67
|
+
title: string;
|
|
68
|
+
addAnotherRange: string;
|
|
69
|
+
buttonTooltip: string;
|
|
70
|
+
placeHolder: string;
|
|
71
|
+
confirm: string;
|
|
72
|
+
cancel: string;
|
|
73
|
+
};
|
|
74
|
+
'global-shortcut': string;
|
|
65
75
|
};
|
|
66
76
|
export default locale;
|
|
@@ -37,6 +37,9 @@ export interface IEditorConfigParam {
|
|
|
37
37
|
onlyInputFormula: boolean;
|
|
38
38
|
onlyInputRange: boolean;
|
|
39
39
|
onlyInputContent: boolean;
|
|
40
|
+
isSingleChoice: boolean;
|
|
41
|
+
openForSheetUnitId: Nullable<string>;
|
|
42
|
+
openForSheetSubUnitId: Nullable<string>;
|
|
40
43
|
}
|
|
41
44
|
export interface IEditorSetParam extends IEditorConfigParam, IEditorStateParam {
|
|
42
45
|
render: IRender;
|
|
@@ -51,15 +54,22 @@ export interface IEditorInputFormulaParam {
|
|
|
51
54
|
editorUnitId: string;
|
|
52
55
|
formulaString: string;
|
|
53
56
|
}
|
|
54
|
-
declare class Editor {
|
|
57
|
+
export declare class Editor {
|
|
55
58
|
private _param;
|
|
56
59
|
private _focus;
|
|
57
60
|
private _valueLegality;
|
|
61
|
+
private _openForSheetUnitId;
|
|
62
|
+
private _openForSheetSubUnitId;
|
|
58
63
|
constructor(_param: IEditorSetParam);
|
|
59
64
|
get documentDataModel(): DocumentDataModel;
|
|
60
65
|
get editorUnitId(): string;
|
|
61
66
|
get cancelDefaultResizeListener(): boolean | undefined;
|
|
62
67
|
get render(): IRender;
|
|
68
|
+
isSingleChoice(): boolean;
|
|
69
|
+
setOpenForSheetUnitId(unitId: Nullable<string>): void;
|
|
70
|
+
getOpenForSheetUnitId(): Nullable<string>;
|
|
71
|
+
setOpenForSheetSubUnitId(subUnitId: Nullable<string>): void;
|
|
72
|
+
getOpenForSheetSubUnitId(): Nullable<string>;
|
|
63
73
|
isValueLegality(): boolean;
|
|
64
74
|
setValueLegality(state?: boolean): void;
|
|
65
75
|
isFocus(): boolean;
|
|
@@ -74,15 +84,13 @@ declare class Editor {
|
|
|
74
84
|
isSheetEditor(): boolean;
|
|
75
85
|
getValue(): string;
|
|
76
86
|
getBody(): IDocumentBody | undefined;
|
|
77
|
-
update(param:
|
|
87
|
+
update(param: Partial<IEditorSetParam>): void;
|
|
78
88
|
verticalAlign(): void;
|
|
79
89
|
updateCanvasStyle(): void;
|
|
80
90
|
}
|
|
81
91
|
export interface IEditorService {
|
|
82
92
|
getEditor(id?: string): Readonly<Nullable<Editor>>;
|
|
83
|
-
setState(param: IEditorStateParam, id: string): void;
|
|
84
93
|
register(config: IEditorConfigParam, container: HTMLDivElement): IDisposable;
|
|
85
|
-
unRegister(editorUnitId: string): void;
|
|
86
94
|
isVisible(id: string): Nullable<boolean>;
|
|
87
95
|
inputFormula$: Observable<IEditorInputFormulaParam>;
|
|
88
96
|
setFormula(formulaString: string): void;
|
|
@@ -103,8 +111,8 @@ export interface IEditorService {
|
|
|
103
111
|
getOperationSheetSubUnitId(): Nullable<string>;
|
|
104
112
|
isEditor(editorUnitId: string): boolean;
|
|
105
113
|
isSheetEditor(editorUnitId: string): boolean;
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
closeRangePrompt$: Observable<unknown>;
|
|
115
|
+
closeRangePrompt(): void;
|
|
108
116
|
blur$: Observable<unknown>;
|
|
109
117
|
blur(): void;
|
|
110
118
|
focus$: Observable<ISuccinctTextRangeParam>;
|
|
@@ -112,12 +120,22 @@ export interface IEditorService {
|
|
|
112
120
|
setValue$: Observable<IEditorSetValueParam>;
|
|
113
121
|
valueChange$: Observable<Readonly<Editor>>;
|
|
114
122
|
setValue(val: string, editorUnitId?: string): void;
|
|
123
|
+
setValueNoRefresh(val: string, editorUnitId?: string): void;
|
|
115
124
|
setRichValue(body: IDocumentBody, editorUnitId?: string): void;
|
|
116
125
|
getFirstEditor(): Editor;
|
|
117
|
-
focusStyle$: Observable<string
|
|
118
|
-
focusStyle(editorUnitId: string): void;
|
|
126
|
+
focusStyle$: Observable<Nullable<string>>;
|
|
127
|
+
focusStyle(editorUnitId: Nullable<string>): void;
|
|
119
128
|
refreshValueChange(editorId: string): void;
|
|
120
129
|
checkValueLegality(editorId: string): boolean;
|
|
130
|
+
getValue(id: string): Nullable<string>;
|
|
131
|
+
getRichValue(id: string): Nullable<IDocumentBody>;
|
|
132
|
+
changeSpreadsheetFocusState(state: boolean): void;
|
|
133
|
+
getSpreadsheetFocusState(): boolean;
|
|
134
|
+
selectionChangingState(): boolean;
|
|
135
|
+
singleSelection$: Observable<boolean>;
|
|
136
|
+
singleSelection(state: boolean): void;
|
|
137
|
+
setFocusId(id: Nullable<string>): void;
|
|
138
|
+
getFocusId(): Nullable<string>;
|
|
121
139
|
}
|
|
122
140
|
export declare class EditorService extends Disposable implements IEditorService, IDisposable {
|
|
123
141
|
private readonly _currentUniverService;
|
|
@@ -125,6 +143,7 @@ export declare class EditorService extends Disposable implements IEditorService,
|
|
|
125
143
|
private readonly _lexerTreeBuilder;
|
|
126
144
|
private readonly _contextService;
|
|
127
145
|
private _editors;
|
|
146
|
+
private _focusEditorUnitId;
|
|
128
147
|
private readonly _state$;
|
|
129
148
|
readonly state$: Observable<Nullable<IEditorStateParam>>;
|
|
130
149
|
private _currentSheetUnitId;
|
|
@@ -133,8 +152,8 @@ export declare class EditorService extends Disposable implements IEditorService,
|
|
|
133
152
|
readonly inputFormula$: Observable<IEditorInputFormulaParam>;
|
|
134
153
|
private readonly _resize$;
|
|
135
154
|
readonly resize$: Observable<string>;
|
|
136
|
-
private readonly
|
|
137
|
-
readonly
|
|
155
|
+
private readonly _closeRangePrompt$;
|
|
156
|
+
readonly closeRangePrompt$: Observable<unknown>;
|
|
138
157
|
private readonly _blur$;
|
|
139
158
|
readonly blur$: Observable<unknown>;
|
|
140
159
|
private readonly _focus$;
|
|
@@ -144,32 +163,41 @@ export declare class EditorService extends Disposable implements IEditorService,
|
|
|
144
163
|
private readonly _valueChange$;
|
|
145
164
|
readonly valueChange$: Observable<Readonly<Editor>>;
|
|
146
165
|
private readonly _focusStyle$;
|
|
147
|
-
readonly focusStyle$: Observable<string
|
|
166
|
+
readonly focusStyle$: Observable<Nullable<string>>;
|
|
167
|
+
private readonly _singleSelection$;
|
|
168
|
+
readonly singleSelection$: Observable<boolean>;
|
|
169
|
+
private _spreadsheetFocusState;
|
|
148
170
|
constructor(_currentUniverService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _lexerTreeBuilder: LexerTreeBuilder, _contextService: IContextService);
|
|
171
|
+
setFocusId(id: Nullable<string>): void;
|
|
172
|
+
getFocusId(): Nullable<string>;
|
|
149
173
|
isEditor(editorUnitId: string): boolean;
|
|
150
174
|
isSheetEditor(editorUnitId: string): boolean;
|
|
151
|
-
|
|
175
|
+
closeRangePrompt(): void;
|
|
176
|
+
changeSpreadsheetFocusState(state: boolean): void;
|
|
177
|
+
getSpreadsheetFocusState(): boolean;
|
|
152
178
|
focusStyle(editorUnitId: string): false | undefined;
|
|
179
|
+
singleSelection(state: boolean): void;
|
|
180
|
+
selectionChangingState(): boolean;
|
|
153
181
|
blur(): void;
|
|
154
182
|
focus(editorUnitId?: string): void;
|
|
155
183
|
setFormula(formulaString: string, editorUnitId?: string): void;
|
|
156
184
|
setValue(val: string, editorUnitId?: string): void;
|
|
157
|
-
|
|
185
|
+
setValueNoRefresh(val: string, editorUnitId: string): void;
|
|
186
|
+
getValue(id: string): string | undefined;
|
|
158
187
|
setRichValue(body: IDocumentBody, editorUnitId?: string): void;
|
|
159
|
-
getRichValue(id
|
|
188
|
+
getRichValue(id: string): IDocumentBody | undefined;
|
|
160
189
|
dispose(): void;
|
|
161
190
|
getEditor(id?: string): Readonly<Nullable<Editor>>;
|
|
162
191
|
getAllEditor(): Map<string, Editor>;
|
|
163
192
|
getFirstEditor(): Editor;
|
|
164
193
|
resize(unitId: string): void;
|
|
165
|
-
setState(param: IEditorStateParam, id: string): void;
|
|
166
194
|
isVisible(id: string): boolean | undefined;
|
|
167
195
|
setOperationSheetUnitId(unitId: Nullable<string>): void;
|
|
168
196
|
getOperationSheetUnitId(): Nullable<string>;
|
|
169
197
|
setOperationSheetSubUnitId(sheetId: Nullable<string>): void;
|
|
170
198
|
getOperationSheetSubUnitId(): Nullable<string>;
|
|
171
199
|
register(config: IEditorConfigParam, container: HTMLDivElement): IDisposable;
|
|
172
|
-
|
|
200
|
+
private _unRegister;
|
|
173
201
|
refreshValueChange(editorUnitId: string): void;
|
|
174
202
|
checkValueLegality(editorUnitId: string): boolean;
|
|
175
203
|
private _refreshValueChange;
|
|
@@ -178,4 +206,3 @@ export declare class EditorService extends Disposable implements IEditorService,
|
|
|
178
206
|
private _getBlank;
|
|
179
207
|
}
|
|
180
208
|
export declare const IEditorService: import("@wendellhu/redi").IdentifierDecorator<IEditorService>;
|
|
181
|
-
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IBoundRectNoAngle } from '@univerjs/engine-render';
|
|
17
|
+
import type { Observable } from 'rxjs';
|
|
18
|
+
export interface IPopup {
|
|
19
|
+
anchorRect: IBoundRectNoAngle;
|
|
20
|
+
anchorRect$: Observable<IBoundRectNoAngle>;
|
|
21
|
+
componentKey: string;
|
|
22
|
+
onClickOutside?: (e: MouseEvent) => void;
|
|
23
|
+
unitId: string;
|
|
24
|
+
subUnitId: string;
|
|
25
|
+
direction?: 'vertical' | 'horizontal';
|
|
26
|
+
offset?: [number, number];
|
|
27
|
+
}
|
|
28
|
+
export interface IGlobalPopupManagerService {
|
|
29
|
+
addPopup(item: IPopup): string;
|
|
30
|
+
removePopup(id: string): void;
|
|
31
|
+
removeAll(): void;
|
|
32
|
+
popups$: Observable<[string, IPopup][]>;
|
|
33
|
+
get popups(): [string, IPopup][];
|
|
34
|
+
}
|
|
35
|
+
export declare const IGlobalPopupManagerService: import("@wendellhu/redi").IdentifierDecorator<IGlobalPopupManagerService>;
|
|
36
|
+
export declare class GlobalPopupManagerService implements IGlobalPopupManagerService {
|
|
37
|
+
private _popupMap;
|
|
38
|
+
private _popups$;
|
|
39
|
+
popups$: Observable<[string, IPopup][]>;
|
|
40
|
+
get popups(): [string, IPopup][];
|
|
41
|
+
private _notice;
|
|
42
|
+
addPopup(item: IPopup): string;
|
|
43
|
+
removePopup(id: string): void;
|
|
44
|
+
removeAll(): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IUnitRange, Nullable } from '@univerjs/core';
|
|
17
|
+
import { Disposable } from '@univerjs/core';
|
|
18
|
+
import type { IDisposable } from '@wendellhu/redi';
|
|
19
|
+
import type { Observable } from 'rxjs';
|
|
20
|
+
export interface IRangeSelectorRange extends IUnitRange {
|
|
21
|
+
sheetName: string;
|
|
22
|
+
}
|
|
23
|
+
export interface IRangeSelectorService {
|
|
24
|
+
selectionChange$: Observable<IRangeSelectorRange[]>;
|
|
25
|
+
selectionChange(ranges: IRangeSelectorRange[]): void;
|
|
26
|
+
setCurrentSelectorId(id: Nullable<string>): void;
|
|
27
|
+
getCurrentSelectorId(): Nullable<string>;
|
|
28
|
+
openSelector$: Observable<unknown>;
|
|
29
|
+
openSelector(): void;
|
|
30
|
+
}
|
|
31
|
+
export declare class RangeSelectorService extends Disposable implements IRangeSelectorService, IDisposable {
|
|
32
|
+
private _currentSelectorId;
|
|
33
|
+
private readonly _selectionChange$;
|
|
34
|
+
readonly selectionChange$: Observable<IRangeSelectorRange[]>;
|
|
35
|
+
private readonly _openSelector$;
|
|
36
|
+
readonly openSelector$: Observable<unknown>;
|
|
37
|
+
setCurrentSelectorId(id: Nullable<string>): void;
|
|
38
|
+
getCurrentSelectorId(): Nullable<string>;
|
|
39
|
+
selectionChange(range: IRangeSelectorRange[]): void;
|
|
40
|
+
openSelector(): void;
|
|
41
|
+
}
|
|
42
|
+
export declare const IRangeSelectorService: import("@wendellhu/redi").IdentifierDecorator<IRangeSelectorService>;
|
|
@@ -13,11 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare const KeyCodeToChar: {
|
|
17
|
-
[key: number]: string;
|
|
18
|
-
};
|
|
19
16
|
/** KeyCode that maps to browser standard keycode. */
|
|
20
|
-
export declare
|
|
17
|
+
export declare enum KeyCode {
|
|
21
18
|
UNKNOWN = 0,
|
|
22
19
|
BACKSPACE = 8,
|
|
23
20
|
TAB = 9,
|
|
@@ -81,13 +78,19 @@ export declare const enum KeyCode {
|
|
|
81
78
|
NUM_LOCK = 144,
|
|
82
79
|
SCROLL_LOCK = 145,
|
|
83
80
|
MINUS = 189,
|
|
84
|
-
EQUAL = 187
|
|
81
|
+
EQUAL = 187,
|
|
82
|
+
BACK_SLASH = 220
|
|
85
83
|
}
|
|
86
|
-
export declare const
|
|
84
|
+
export declare const KeyCodeToChar: {
|
|
85
|
+
[key: number]: string;
|
|
86
|
+
};
|
|
87
|
+
/** Define meta key numbers. */
|
|
88
|
+
export declare enum MetaKeys {
|
|
87
89
|
SHIFT = 1024,
|
|
88
90
|
/** Option key on MacOS. Alt key on other systems. */
|
|
89
91
|
ALT = 2048,
|
|
90
92
|
/** Command key on MacOS. Ctrl key on other systems. */
|
|
91
93
|
CTRL_COMMAND = 4096,
|
|
94
|
+
/** Ctrl key for MacOS. Not valid on other systems. */
|
|
92
95
|
MAC_CTRL = 8192
|
|
93
96
|
}
|
package/lib/types/views/App.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface IUniverAppProps extends IWorkbenchOptions {
|
|
|
22
22
|
contentComponents?: Set<() => ComponentType>;
|
|
23
23
|
footerComponents?: Set<() => ComponentType>;
|
|
24
24
|
headerMenuComponents?: Set<() => ComponentType>;
|
|
25
|
+
leftSidebarComponents?: Set<() => ComponentType>;
|
|
25
26
|
onRendered?: (container: HTMLElement) => void;
|
|
26
27
|
}
|
|
27
28
|
export declare function App(props: IUniverAppProps): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import React from 'react';
|
|
17
|
+
export declare function GlobalPopup(): React.JSX.Element[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export { GlobalPopup } from './GlobalPopup';
|