diff --git a/package.json b/package.json index 8c16e505e5..a489db88ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vxe-table", - "version": "4.9.33", + "version": "4.9.34", "description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、拖拽排序,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...", "scripts": { "update": "npm install --legacy-peer-deps", @@ -28,7 +28,7 @@ "style": "lib/style.css", "typings": "types/index.d.ts", "dependencies": { - "vxe-pc-ui": "^4.3.40" + "vxe-pc-ui": "^4.3.42" }, "devDependencies": { "@types/resize-observer-browser": "^0.1.11", diff --git a/packages/locale/lang/ar-EG.ts b/packages/locale/lang/ar-EG.ts index 11e8d16069..cfb4d98aed 100644 --- a/packages/locale/lang/ar-EG.ts +++ b/packages/locale/lang/ar-EG.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: '表单名称', defFormTitle: '未命名的表单', @@ -525,6 +530,10 @@ export default { cell: '单元格', value: '值' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(空值)', reError: '无效的正则表达式', recordCount: '已找到 {0} 个单元格', diff --git a/packages/locale/lang/de-DE.ts b/packages/locale/lang/de-DE.ts index 4455cad519..3fdabc9831 100644 --- a/packages/locale/lang/de-DE.ts +++ b/packages/locale/lang/de-DE.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: '表单名称', defFormTitle: '未命名的表单', @@ -525,6 +530,10 @@ export default { cell: '单元格', value: '值' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(空值)', reError: '无效的正则表达式', recordCount: '已找到 {0} 个单元格', diff --git a/packages/locale/lang/en-US.ts b/packages/locale/lang/en-US.ts index 92807b3db2..7b1da5bddb 100644 --- a/packages/locale/lang/en-US.ts +++ b/packages/locale/lang/en-US.ts @@ -333,6 +333,11 @@ export default { empty: { defText: 'No Data' }, + colorPicker: { + clear: 'Clear', + confirm: 'Confirm', + copySuccess: 'Copied to clipboard: {0}' + }, formDesign: { formName: 'Form name', defFormTitle: 'Unnamed form', @@ -525,6 +530,10 @@ export default { cell: 'Cell', value: 'Value' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(Empty)', reError: 'Invalid regular expression', recordCount: 'Found {0} cells', diff --git a/packages/locale/lang/es-ES.ts b/packages/locale/lang/es-ES.ts index 537eac91cb..76f3cab798 100644 --- a/packages/locale/lang/es-ES.ts +++ b/packages/locale/lang/es-ES.ts @@ -333,6 +333,11 @@ export default { empty: { defText: 'No Data' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: 'Form name', defFormTitle: 'Unnamed form', @@ -529,6 +534,10 @@ export default { cell: '单元格', value: '值' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(空值)', reError: '无效的正则表达式', recordCount: '已找到 {0} 个单元格', diff --git a/packages/locale/lang/fr-FR.ts b/packages/locale/lang/fr-FR.ts index 80bf8f5a8e..fd1ac7c3f3 100644 --- a/packages/locale/lang/fr-FR.ts +++ b/packages/locale/lang/fr-FR.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: '表单名称', defFormTitle: '未命名的表单', @@ -525,6 +530,10 @@ export default { cell: '单元格', value: '值' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(空值)', reError: '无效的正则表达式', recordCount: '已找到 {0} 个单元格', diff --git a/packages/locale/lang/hu-HU.ts b/packages/locale/lang/hu-HU.ts index 3f174f21ad..273702fb12 100644 --- a/packages/locale/lang/hu-HU.ts +++ b/packages/locale/lang/hu-HU.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: 'forma neve', defFormTitle: 'névtelen forma', @@ -525,6 +530,10 @@ export default { cell: 'sejt', value: 'érték' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(null érték)', reError: 'Érvénytelen reguláris kifejezés', recordCount: '{0} cella található', diff --git a/packages/locale/lang/hy-AM.ts b/packages/locale/lang/hy-AM.ts index 1bb6cfa28c..91e219430e 100644 --- a/packages/locale/lang/hy-AM.ts +++ b/packages/locale/lang/hy-AM.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: '表单名称', defFormTitle: '未命名的表单', @@ -525,6 +530,10 @@ export default { cell: '单元格', value: '值' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(空值)', reError: '无效的正则表达式', recordCount: '已找到 {0} 个单元格', diff --git a/packages/locale/lang/ja-JP.ts b/packages/locale/lang/ja-JP.ts index 0adea061c5..f026b1c842 100644 --- a/packages/locale/lang/ja-JP.ts +++ b/packages/locale/lang/ja-JP.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: 'Form name', defFormTitle: 'Unnamed form', @@ -525,6 +530,10 @@ export default { cell: 'セル', value: '値' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(空白)', reError: '無効な正規表現', recordCount: '{0} 個のセルが見つかりました', diff --git a/packages/locale/lang/ko-KR.ts b/packages/locale/lang/ko-KR.ts index 7c47908985..391c898d0a 100644 --- a/packages/locale/lang/ko-KR.ts +++ b/packages/locale/lang/ko-KR.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: '表单名称', defFormTitle: '未命名的表单', @@ -525,6 +530,10 @@ export default { cell: '单元格', value: '值' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(空值)', reError: '无效的正则表达式', recordCount: '已找到 {0} 个单元格', diff --git a/packages/locale/lang/nb-NO.ts b/packages/locale/lang/nb-NO.ts index 5cc1973a47..e19ecc9177 100644 --- a/packages/locale/lang/nb-NO.ts +++ b/packages/locale/lang/nb-NO.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: '表单名称', defFormTitle: '未命名的表单', @@ -525,6 +530,10 @@ export default { cell: '单元格', value: '值' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(空值)', reError: '无效的正则表达式', recordCount: '已找到 {0} 个单元格', diff --git a/packages/locale/lang/pt-BR.ts b/packages/locale/lang/pt-BR.ts index 898156331e..1ee4e93049 100644 --- a/packages/locale/lang/pt-BR.ts +++ b/packages/locale/lang/pt-BR.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: 'Form name', defFormTitle: 'Unnamed form', @@ -525,6 +530,10 @@ export default { cell: '单元格', value: '值' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(空值)', reError: '无效的正则表达式', recordCount: '已找到 {0} 个单元格', diff --git a/packages/locale/lang/ru-RU.ts b/packages/locale/lang/ru-RU.ts index b3be15e6bb..8ac14c7396 100644 --- a/packages/locale/lang/ru-RU.ts +++ b/packages/locale/lang/ru-RU.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: 'имя формы', defFormTitle: 'безымянная форма', @@ -525,6 +530,10 @@ export default { cell: 'клетка', value: 'ценить' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(нулевое значение)', reError: 'Недопустимое регулярное выражение', recordCount: 'Найдено {0} ячеек', diff --git a/packages/locale/lang/ug-CN.ts b/packages/locale/lang/ug-CN.ts index 5d87937fd4..72dd2c1b8b 100644 --- a/packages/locale/lang/ug-CN.ts +++ b/packages/locale/lang/ug-CN.ts @@ -333,6 +333,11 @@ export default { empty: { defText: 'ھازىرچە ئۇچۇر يوق' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: 'جەدۋەل ئىسمى', defFormTitle: 'نام قويۇلمىغان جەدىۋەل', @@ -525,6 +530,10 @@ export default { cell: 'تاق كاتاكچە', value: 'قىممىتى' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(قۇرۇق)', reError: 'ئۈنۇمسىز لوگىكىلىق شەرىت', recordCount: 'تىپىلغىنى {0} دانە ئۇچۇر', diff --git a/packages/locale/lang/uk-UA.ts b/packages/locale/lang/uk-UA.ts index 8f63cb5534..983beb0cea 100644 --- a/packages/locale/lang/uk-UA.ts +++ b/packages/locale/lang/uk-UA.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: '表单名称', defFormTitle: '未命名的表单', @@ -525,6 +530,10 @@ export default { cell: '单元格', value: '值' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(空值)', reError: '无效的正则表达式', recordCount: '已找到 {0} 个单元格', diff --git a/packages/locale/lang/vi-VN.ts b/packages/locale/lang/vi-VN.ts index 8f63cb5534..983beb0cea 100644 --- a/packages/locale/lang/vi-VN.ts +++ b/packages/locale/lang/vi-VN.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: '表单名称', defFormTitle: '未命名的表单', @@ -525,6 +530,10 @@ export default { cell: '单元格', value: '值' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(空值)', reError: '无效的正则表达式', recordCount: '已找到 {0} 个单元格', diff --git a/packages/locale/lang/zh-CHT.ts b/packages/locale/lang/zh-CHT.ts index b1c448b3fb..d7b2c3b241 100644 --- a/packages/locale/lang/zh-CHT.ts +++ b/packages/locale/lang/zh-CHT.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: '表單名稱', defFormTitle: '未命名的表單', @@ -525,6 +530,10 @@ export default { cell: '單元格', value: '值' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(空值)', reError: '無效的正規表示式', recordCount: '已找到 {0} 個單元格', diff --git a/packages/locale/lang/zh-CN.ts b/packages/locale/lang/zh-CN.ts index babc48d5a3..cdb658dbef 100644 --- a/packages/locale/lang/zh-CN.ts +++ b/packages/locale/lang/zh-CN.ts @@ -333,6 +333,11 @@ export default { empty: { defText: '暂无数据' }, + colorPicker: { + clear: '清除', + confirm: '确认', + copySuccess: '已复制到剪贴板:{0}' + }, formDesign: { formName: '表单名称', defFormTitle: '未命名的表单', @@ -525,6 +530,10 @@ export default { cell: '单元格', value: '值' }, + body: { + row: '行:{0}', + col: '列:{0}' + }, empty: '(空值)', reError: '无效的正则表达式', recordCount: '已找到 {0} 个单元格', diff --git a/packages/table/render/index.ts b/packages/table/render/index.ts index a928d97f6c..9af8c8192e 100644 --- a/packages/table/render/index.ts +++ b/packages/table/render/index.ts @@ -448,7 +448,7 @@ function defaultSelectEditRender (renderOpts: any, params: any) { ] } -function defaultTreeSelectEditRender (renderOpts: any, params: any) { +function defaultTableOrTreeSelectEditRender (renderOpts: any, params: any) { const { row, column } = params const { options, optionProps } = renderOpts const cellValue = getCellValue(row, column) @@ -716,7 +716,7 @@ renderer.mixin({ }, VxeTreeSelect: { tableAutoFocus: 'input', - renderTableEdit: defaultTreeSelectEditRender, + renderTableEdit: defaultTableOrTreeSelectEditRender, renderTableCell (renderOpts, params) { return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params)) }, @@ -724,15 +724,53 @@ renderer.mixin({ }, VxeTableSelect: { tableAutoFocus: 'input', - renderTableEdit: defaultTreeSelectEditRender, + renderTableEdit: defaultTableOrTreeSelectEditRender, renderTableCell (renderOpts, params) { return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params)) }, tableExportMethod: handleExportTreeSelectMethod }, + VxeColorPicker: { + tableAutoFocus: 'input', + renderTableEdit (renderOpts: any, params: any) { + const { row, column } = params + const { options } = renderOpts + const cellValue = getCellValue(row, column) + return [ + h(getDefaultComponent(renderOpts), { + ...getCellEditProps(renderOpts, params, cellValue, { colors: options }), + ...getEditOns(renderOpts, params) + }) + ] + }, + renderTableCell (renderOpts, params) { + const { row, column } = params + const cellValue = XEUtils.get(row, column.field) + return h('span', { + class: 'vxe-color-picker--readonly' + }, [ + h('div', { + class: 'vxe-color-picker--readonly-color', + style: { + backgroundColor: cellValue + } + }) + ]) + } + }, VxeIconPicker: { tableAutoFocus: 'input', - renderTableEdit: defaultEditRender, + renderTableEdit (renderOpts: any, params: any) { + const { row, column } = params + const { options } = renderOpts + const cellValue = getCellValue(row, column) + return [ + h(getDefaultComponent(renderOpts), { + ...getCellEditProps(renderOpts, params, cellValue, { icons: options }), + ...getEditOns(renderOpts, params) + }) + ] + }, renderTableCell (renderOpts, params) { const { row, column } = params const cellValue = XEUtils.get(row, column.field)