From 109938673e8c4e5a0ecec1217cd3db6b74e0c59a Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 2 Aug 2022 13:09:19 +0200 Subject: [PATCH] feat(gui-v2): add `EditModeInj` and replace string key injection --- packages/nc-gui-v2/components.d.ts | 6 - .../nc-gui-v2/components/cell/Attachment.vue | 166 +-------------- .../nc-gui-v2/components/cell/Currency.vue | 34 ++-- packages/nc-gui-v2/components/cell/Email.vue | 9 +- packages/nc-gui-v2/components/cell/Float.vue | 13 +- .../nc-gui-v2/components/cell/Integer.vue | 15 +- .../components/cell/JsonEditableCell.vue | 13 +- .../nc-gui-v2/components/cell/MultiSelect.vue | 54 +---- .../components/cell/SingleSelect.vue | 35 +--- packages/nc-gui-v2/components/cell/Text.vue | 53 +++-- .../nc-gui-v2/components/cell/TextArea.vue | 31 ++- packages/nc-gui-v2/components/cell/Url.vue | 18 +- .../nc-gui-v2/components/smartsheet/Cell.vue | 191 +++--------------- .../nc-gui-v2/components/smartsheet/Grid.vue | 78 +------ packages/nc-gui-v2/context/index.ts | 1 + 15 files changed, 145 insertions(+), 572 deletions(-) diff --git a/packages/nc-gui-v2/components.d.ts b/packages/nc-gui-v2/components.d.ts index 793a7529e2..d0e6800cef 100644 --- a/packages/nc-gui-v2/components.d.ts +++ b/packages/nc-gui-v2/components.d.ts @@ -8,7 +8,6 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { AAlert: typeof import('ant-design-vue/es')['Alert'] - AAnchorLink: typeof import('ant-design-vue/es')['AnchorLink'] AAutoComplete: typeof import('ant-design-vue/es')['AutoComplete'] AButton: typeof import('ant-design-vue/es')['Button'] ACard: typeof import('ant-design-vue/es')['Card'] @@ -20,7 +19,6 @@ declare module '@vue/runtime-core' { ADivider: typeof import('ant-design-vue/es')['Divider'] ADrawer: typeof import('ant-design-vue/es')['Drawer'] ADropdown: typeof import('ant-design-vue/es')['Dropdown'] - ADropdownButton: typeof import('ant-design-vue/es')['DropdownButton'] AForm: typeof import('ant-design-vue/es')['Form'] AFormItem: typeof import('ant-design-vue/es')['FormItem'] AInput: typeof import('ant-design-vue/es')['Input'] @@ -46,20 +44,16 @@ declare module '@vue/runtime-core' { ASelect: typeof import('ant-design-vue/es')['Select'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] ASkeleton: typeof import('ant-design-vue/es')['Skeleton'] - ASpace: typeof import('ant-design-vue/es')['Space'] ASpin: typeof import('ant-design-vue/es')['Spin'] ASubMenu: typeof import('ant-design-vue/es')['SubMenu'] ASwitch: typeof import('ant-design-vue/es')['Switch'] ATable: typeof import('ant-design-vue/es')['Table'] ATableColumn: typeof import('ant-design-vue/es')['TableColumn'] - ATableColumnGroup: typeof import('ant-design-vue/es')['TableColumnGroup'] ATabPane: typeof import('ant-design-vue/es')['TabPane'] ATabs: typeof import('ant-design-vue/es')['Tabs'] - ATag: typeof import('ant-design-vue/es')['Tag'] ATextarea: typeof import('ant-design-vue/es')['Textarea'] ATimePicker: typeof import('ant-design-vue/es')['TimePicker'] ATooltip: typeof import('ant-design-vue/es')['Tooltip'] - ATypographyText: typeof import('ant-design-vue/es')['TypographyText'] ATypographyTitle: typeof import('ant-design-vue/es')['TypographyTitle'] AUploadDragger: typeof import('ant-design-vue/es')['UploadDragger'] RouterLink: typeof import('vue-router')['RouterLink'] diff --git a/packages/nc-gui-v2/components/cell/Attachment.vue b/packages/nc-gui-v2/components/cell/Attachment.vue index 52180b6cbb..fa9f20e9d5 100644 --- a/packages/nc-gui-v2/components/cell/Attachment.vue +++ b/packages/nc-gui-v2/components/cell/Attachment.vue @@ -1,8 +1,8 @@ @@ -188,151 +185,4 @@ const onFileSelection = async (e: unknown) => { .expand-icon:hover { background-color: var(--v-primary-lighten4); } - -/*.img-container { - margin: 0 -2px; -} - -.no-overflow { - overflow: hidden; -} - -.add { - transition: 0.2s background-color; - !*background-color: #666666ee;*! - border-radius: 4px; - height: 33px; - margin: 5px 2px; -} - -.add:hover { - !*background-color: #66666699;*! -} - -.thumbnail { - height: 99px; - width: 99px; - margin: 2px; - border-radius: 4px; -} - -.thumbnail img { - !*max-height: 33px;*! - max-width: 99px; -} - -.main { - min-height: 20px; - position: relative; - height: auto; -} - -.expand-icon { - margin-left: 8px; - border-radius: 2px; - !*opacity: 0;*! - transition: 0.3s background-color; -} - -.expand-icon:hover { - !*opacity: 1;*! - background-color: var(--v-primary-lighten4); -} - -.modal-thumbnail img { - height: 50px; - max-width: 100%; - border-radius: 4px; -} - -.modal-thumbnail { - position: relative; - margin: 10px 10px; -} - -.remove-icon { - position: absolute; - top: 5px; - right: 5px; -} - -.modal-thumbnail-card { - .download-icon { - position: absolute; - bottom: 5px; - right: 5px; - opacity: 0; - transition: 0.4s opacity; - } - - &:hover .download-icon { - opacity: 1; - } -} - -.image-overlay-container { - max-height: 100vh; - overflow-y: auto; - position: relative; -} - -.image-overlay-container .close-icon { - position: fixed; - top: 15px; - right: 15px; -} - -.overlay-thumbnail { - transition: 0.4s transform, 0.4s opacity; - opacity: 0.5; -} - -.overlay-thumbnail.active { - transform: scale(1.4); - opacity: 1; -} - -.overlay-thumbnail:hover { - opacity: 1; -} - -.modal-title { - text-overflow: ellipsis; - white-space: nowrap; - width: 100%; - overflow: hidden; -} - -.modal-thumbnail-card { - transition: 0.4s transform; -} - -.modal-thumbnail-card:hover { - transform: scale(1.05); -} - -.drop-overlay { - z-index: 5; - position: absolute; - width: 100%; - height: 100%; - left: 0; - right: 0; - top: 0; - bottom: 5px; - background: #aaaaaa44; - display: flex; - justify-content: center; - align-items: center; - pointer-events: none; -} - -.expand-icon { - opacity: 0; - transition: 0.4s opacity; -} - -.main:hover .expand-icon { - opacity: 1; -}*/ diff --git a/packages/nc-gui-v2/components/cell/Currency.vue b/packages/nc-gui-v2/components/cell/Currency.vue index 84db28f405..fe99200482 100644 --- a/packages/nc-gui-v2/components/cell/Currency.vue +++ b/packages/nc-gui-v2/components/cell/Currency.vue @@ -1,24 +1,22 @@ - - diff --git a/packages/nc-gui-v2/components/cell/Email.vue b/packages/nc-gui-v2/components/cell/Email.vue index f743c5d3f5..aac35dbb60 100644 --- a/packages/nc-gui-v2/components/cell/Email.vue +++ b/packages/nc-gui-v2/components/cell/Email.vue @@ -1,6 +1,7 @@