Skip to content

Commit

Permalink
chore: release 1.6.7-naruto (#2818)
Browse files Browse the repository at this point in the history
* fix(table): tree.defaultExpandAll (#2752)

* Fix0817 (#2708)

* fix: 弹窗组件如果初始默认显示, 按esc关不掉问题修复 (#2608)

* fix: 弹窗组件如果初始默认显示, 按esc关不掉问题修复 (#2608)

* fix: 弹窗组件如果初始默认显示, 按esc关不掉问题修复 (#2608)

* fix: 弹窗组件如果初始默认显示, 按esc关不掉问题修复 (#2608)

* fix: 弹窗组件如果初始默认显示, 按esc关不掉问题修复 (#2608)

* fix(checkbox): multitple checkbox-group exist at the page (#2768)

* fix(checkbox): multitple checkboxgroup

* fix(table): unique key

* feat(table): fix resetValue does not work on clear filter;

* fix(form): fix reset form error (#2760)

Co-authored-by: zhangjiancheng <zhangjiancheng@aibaoxian.com>

* feat(table): fix false value can not highlight filter icon; support filter.label (#2771)

* fix(table): support filter value which is false can highlight filter icon

* feat(table): support filter.label

* docs(table): update demove

* fix(table): title is a function

* fix: lint error

* fix(image): dulplicate preview icon (#2770)

* fix(image): dulplicate preview icon

* fix(image): fix preview url

* fix(table): lint error

* test: update snapshots

* feat(dialog): confirmLoading (#2769)

* feat(dialog): confirmLoading

* test: update snapshots

* fix(popup): clear queued open action caused by accident (#2747)

* Revert "fix(popup): clear queued open action caused by accident (#2747)" (#2775)

This reverts commit e1a1f95.

* fix: fix bundle content (#2776)

* fix: fix remove listener hook (#2777)

* fix(loading): fix loading false create instance again (#2778)

* fix(Select): fix delete exist option when delete input value (#2779)

* feat: release 1.6.5 (#2774)

* feat: release 1.6.5

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(checkbox): group dynamic (#2793)

* fix(table): multiple editable table (#2787)

* fix(table): multiple editable table

* docs(dialog): demo

* chore: release 1.6.6 (#2795)

* chore: 1.6.6

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat(treeselect): support panel content API (#2797)

* fix: useResizeObserver (#2806)

* chore: update README (#2808)

* feat(table): support group columns (#2810)

* feat(table): column controller

* test(table): update snapshots

* fix(table): props.locale

* fix: lint error

* fix: lint error

* fix(dialog): Dialog component support confirmLoading (#2814)

* fix(dialog): confirmLoading

* docs(dialog): remove docs

* feat(card): replace title span with div (#2812)

* feat(card): replace title span with div

* feat(card): replace title span with div

* chore: release 1.6.7 (#2817)

* chore: release 1.6.7

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: release 1.6.7-naruto

* chore: release 1.6.7-naruto

---------

Co-authored-by: sheepluo <yaoyanhuoyi@qq.com>
Co-authored-by: Zhanjiachun <49758402+Zhanjiachun@users.noreply.github.com>
Co-authored-by: Zz-ZzzZ <48228016+Zz-ZzzZ@users.noreply.github.com>
Co-authored-by: zhangjiancheng <zhangjiancheng@aibaoxian.com>
Co-authored-by: ikeq <ikeq@foxmail.com>
Co-authored-by: azhe <xiaosansiji@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
8 people authored Sep 22, 2023
1 parent f838d61 commit 8abf8a2
Show file tree
Hide file tree
Showing 64 changed files with 1,968 additions and 1,048 deletions.
1,323 changes: 879 additions & 444 deletions CHANGELOG.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ npm package 中提供了多种构建产物,可以阅读 [这里](https://githu

TDesign 欢迎任何愿意参与贡献的参与者。如果需要本地运行代码或参与贡献,请先阅读[参与贡献](https://github.com/Tencent/tdesign-vue/blob/develop/CONTRIBUTING.md)

# 反馈

有任何问题,建议通过 [Github issues](https://github.com/Tencent/tdesign-vue/issues) 反馈或扫码加入用户微信群。

<img src="https://oteam-tdesign-1258344706.cos.ap-guangzhou.myqcloud.com/site/doc/Vue2-IM.png" width="200" />

# 开源协议

TDesign 遵循 [MIT 协议](https://github.com/Tencent/tdesign-vue/blob/main/LICENSE)
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ TDesign also provides component libraries for other platforms and frameworks.

Contributing is welcome. Read [guidelines for contributing](https://github.com/Tencent/tdesign-vue/blob/develop/CONTRIBUTING.md) before submitting your [Pull Request](https://github.com/Tencent/tdesign-vue/pulls).

# Feedback

Create your [Github issues](https://github.com/Tencent/tdesign-vue/issues) or scan the QR code below to join our user groups

<img src="https://oteam-tdesign-1258344706.cos.ap-guangzhou.myqcloud.com/site/doc/Vue2-IM.png" width="200" />

# License

The MIT License. Please see [the license file](./LICENSE) for more information.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tdesign-vue",
"purename": "tdesign",
"version": "1.6.4-naruto",
"version": "1.6.7-naruto",
"description": "tdesign-vue",
"title": "tdesign-vue",
"keywords": [
Expand Down
8 changes: 4 additions & 4 deletions script/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const esConfig = {
// 为了保留 style/css.js
treeshake: false,
external: externalDeps.concat(externalPeerDeps),
plugins: [multiInput()].concat(getPlugins({ extractMultiCss: true })),
plugins: [multiInput()].concat(getPlugins({ env: 'production', extractMultiCss: true })),
output: {
banner,
dir: 'es/',
Expand All @@ -155,7 +155,7 @@ const esmConfig = {
// 为了保留 style/index.js
treeshake: false,
external: externalDeps.concat(externalPeerDeps),
plugins: [multiInput()].concat(getPlugins({ ignoreLess: false })),
plugins: [multiInput()].concat(getPlugins({ env: 'production', ignoreLess: false })),
output: {
banner,
dir: 'esm/',
Expand All @@ -169,7 +169,7 @@ const esmConfig = {
const libConfig = {
input: inputList.concat('!src/index-lib.ts'),
external: externalDeps.concat(externalPeerDeps),
plugins: [multiInput()].concat(getPlugins()),
plugins: [multiInput()].concat(getPlugins({ env: 'production' })),
output: {
banner,
dir: 'lib/',
Expand All @@ -183,7 +183,7 @@ const libConfig = {
const cjsConfig = {
input: inputList,
external: externalDeps.concat(externalPeerDeps),
plugins: [multiInput()].concat(getPlugins()),
plugins: [multiInput()].concat(getPlugins({ env: 'production' })),
output: {
banner,
dir: 'cjs/',
Expand Down
2 changes: 1 addition & 1 deletion src/_common
Submodule _common updated 83 files
+1 −0 docs/web/api/anchor.md
+7 −0 docs/web/api/table.en-US.md
+7 −0 docs/web/api/table.md
+7 −1 docs/web/api/tag.md
+6 −0 docs/web/api/tree-select.md
+8 −0 js/common.ts
+1 −0 js/global-config/default-config.ts
+80 −0 js/table/utils.ts
+63 −39 js/tree/tree-node.ts
+2 −1 js/watermark/generateBase64Url.ts
+5 −0 js/watermark/type.ts
+2 −2 style/mobile/components/action-sheet/v2/_index.less
+6 −5 style/mobile/components/action-sheet/v2/_var.less
+1 −1 style/mobile/components/avatar/v2/_var.less
+3 −3 style/mobile/components/button/v2/_var.less
+2 −0 style/mobile/components/calendar/v2/_index.less
+6 −5 style/mobile/components/calendar/v2/_var.less
+1 −1 style/mobile/components/cascader/v2/_index.less
+5 −4 style/mobile/components/cascader/v2/_var.less
+4 −0 style/mobile/components/cell/v2/_index.less
+6 −6 style/mobile/components/cell/v2/_var.less
+2 −2 style/mobile/components/check-tag/v2/_var.less
+1 −1 style/mobile/components/checkbox/v2/_index.less
+6 −5 style/mobile/components/checkbox/v2/_var.less
+1 −1 style/mobile/components/collapse/v2/_index.less
+4 −3 style/mobile/components/collapse/v2/_var.less
+3 −3 style/mobile/components/count-down/v2/_var.less
+3 −3 style/mobile/components/dialog/v2/_var.less
+1 −1 style/mobile/components/divider/v2/_var.less
+2 −1 style/mobile/components/drawer/v2/_index.less
+1 −1 style/mobile/components/drawer/v2/_var.less
+2 −2 style/mobile/components/dropdown-menu/v2/_var.less
+2 −2 style/mobile/components/empty/_var.less
+1 −0 style/mobile/components/footer/_index.less
+3 −2 style/mobile/components/footer/_var.less
+3 −3 style/mobile/components/form/_index.less
+8 −2 style/mobile/components/grid-item/v2/_index.less
+2 −2 style/mobile/components/grid-item/v2/_var.less
+6 −0 style/mobile/components/grid/v2/_index.less
+2 −0 style/mobile/components/grid/v2/_var.less
+2 −2 style/mobile/components/image/v2/_var.less
+1 −1 style/mobile/components/indexes-anchor/v2/_var.less
+2 −2 style/mobile/components/indexes/v2/_var.less
+6 −2 style/mobile/components/input/v2/_index.less
+6 −6 style/mobile/components/input/v2/_var.less
+1 −1 style/mobile/components/link/v2/_var.less
+1 −1 style/mobile/components/loading/_index.less
+1 −0 style/mobile/components/loading/_var.less
+1 −1 style/mobile/components/loading/v2/_index.less
+1 −0 style/mobile/components/loading/v2/_var.less
+3 −3 style/mobile/components/message/v2/_index.less
+3 −2 style/mobile/components/message/v2/_var.less
+1 −1 style/mobile/components/navbar/v2/_var.less
+2 −2 style/mobile/components/notice-bar/v2/_var.less
+1 −1 style/mobile/components/overlay/v2/_var.less
+2 −2 style/mobile/components/picker/v2/_index.less
+4 −4 style/mobile/components/picker/v2/_var.less
+2 −2 style/mobile/components/popover/_var.less
+1 −1 style/mobile/components/pull-down-refresh/v2/_var.less
+2 −2 style/mobile/components/radio/v2/_var.less
+2 −2 style/mobile/components/rate/v2/_var.less
+2 −2 style/mobile/components/result/v2/_var.less
+5 −5 style/mobile/components/search/v2/_var.less
+1 −1 style/mobile/components/side-bar/v2/_index.less
+3 −2 style/mobile/components/side-bar/v2/_var.less
+2 −2 style/mobile/components/skeleton/v2/_var.less
+2 −2 style/mobile/components/slider/v2/_index.less
+3 −2 style/mobile/components/slider/v2/_var.less
+5 −5 style/mobile/components/step-item/v2/_var.less
+2 −2 style/mobile/components/stepper/v2/_var.less
+1 −1 style/mobile/components/switch/v2/_index.less
+2 −2 style/mobile/components/switch/v2/_var.less
+1 −1 style/mobile/components/tab-bar-item/v2/_var.less
+1 −1 style/mobile/components/table/_var.less
+1 −1 style/mobile/components/tabs/v2/_index.less
+2 −2 style/mobile/components/tabs/v2/_var.less
+3 −3 style/mobile/components/tag/v2/_var.less
+5 −5 style/mobile/components/textarea/v2/_var.less
+2 −2 style/mobile/components/upload/v2/_var.less
+154 −0 style/mobile/theme/_dark.less
+1 −0 style/mobile/theme/_index.less
+42 −0 style/web/components/table/_index.less
+2 −0 style/web/components/table/_var.less
4 changes: 2 additions & 2 deletions src/auto-complete/option-list.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
ref, computed, defineComponent, PropType, h, watch, onBeforeMount,
ref, computed, defineComponent, PropType, h, watch, onBeforeUnmount,
} from 'vue';
import isFunction from 'lodash/isFunction';
import HighlightOption from './highlight-option';
Expand Down Expand Up @@ -123,7 +123,7 @@ export default defineComponent({
{ immediate: true },
);

onBeforeMount(() => {
onBeforeUnmount(() => {
removeKeyboardListener();
});

Expand Down
4 changes: 2 additions & 2 deletions src/card/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export default defineComponent({
<div class={this.headerWrapperCls}>
{this.showAvatar && <div class={this.headerAvatarCls}>{renderTNodeJSX(this, 'avatar')}</div>}
<div>
{this.showTitle && <span class={this.headerTitleCls}>{renderTNodeJSX(this, 'title')}</span>}
{this.showSubtitle && <span class={this.headerSubTitleCls}>{renderTNodeJSX(this, 'subtitle')}</span>}
{this.showTitle && <div class={this.headerTitleCls}>{renderTNodeJSX(this, 'title')}</div>}
{this.showSubtitle && <div class={this.headerSubTitleCls}>{renderTNodeJSX(this, 'subtitle')}</div>}
{this.showDescription && <p class={this.headerDescriptionCls}>{renderTNodeJSX(this, 'description')}</p>}
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/checkbox/_example/controlled.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<t-checkbox :defaultChecked="false" :onChange="onChange2">非受控属性</t-checkbox>
</t-space>
<!-- 复选框框组受控模式 -->
<t-checkbox-group :value="checked2" :options="options" :onChange="onChange2" />
<t-checkbox-group :value="checked2" :options="options" :onChange="onChange5" />
</t-space>
</template>

Expand All @@ -32,6 +32,10 @@ export default {
onChange2(value, context) {
console.log('change: ', value, context);
},
onChange5(value, context) {
this.checked2 = value;
console.log('change: ', value, context);
},
},
};
</script>
Expand Down
42 changes: 23 additions & 19 deletions src/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
defineComponent, ref, toRefs, inject, watch, onBeforeUnmount,
defineComponent, ref, toRefs, inject, watch, onBeforeUnmount, computed,
} from 'vue';
import props from './props';
import {
Expand Down Expand Up @@ -31,7 +31,8 @@ export default defineComponent({
},

setup(props) {
const checkboxStore = getCheckboxStore(props.storeKey);
const { storeKey } = toRefs(props);
const checkboxStore = computed(() => getCheckboxStore(storeKey.value));
const labelRef = ref<HTMLElement>();
const { STATUS } = useCommonClassName();
const checkboxGroupExist = ref(false);
Expand Down Expand Up @@ -64,27 +65,27 @@ export default defineComponent({
} else {
tChecked.value = parentChecked.includes(value);
}
checkboxGroupExist.value = checkboxStore.parentExist;
checkboxGroupExist.value = checkboxStore.value.parentExist;
};

watch(
[innerChecked],
[innerChecked, checkboxStore],
() => {
// CheckboxGroup does not exist, self checked works
if (!checkboxStore.parentExist) {
tChecked.value = innerChecked.value;
} else {
if (checkboxStore.value?.parentExist) {
checkboxGroupExist.value = true;
} else {
tChecked.value = innerChecked.value;
}
},
{ immediate: true },
);

watch(
[indeterminate],
([val]) => {
[indeterminate, checkboxStore],
([val, checkboxStore]) => {
// CheckboxGroup does not exist, self indeterminate works
if (!checkboxStore.parentExist) {
if (!checkboxStore?.parentExist) {
tIndeterminate.value = val;
}
},
Expand Down Expand Up @@ -113,9 +114,9 @@ export default defineComponent({
};

watch(
[disabled],
[disabled, checkboxStore],
([val]) => {
if (!checkboxStore.parentExist) {
if (!checkboxStore.value?.parentExist) {
tDisabled.value = val;
}
},
Expand All @@ -140,7 +141,7 @@ export default defineComponent({
);

const subscribeParentData = (val: string | number | boolean) => {
checkboxStore.subscribe(val, (data: ObserverListenerParams) => {
checkboxStore.value.subscribe(val, (data: ObserverListenerParams) => {
if (data.type === 'checked') {
handleParentCheckedChange(data);
} else if (data.type === 'checkbox') {
Expand All @@ -152,14 +153,17 @@ export default defineComponent({
});
};

subscribeParentData(props.checkAll ? 'CHECK_ALL' : value.value);

watch([data, label], () => {
subscribeParentData(props.checkAll ? 'CHECK_ALL' : value.value);
});
watch(
[data, label, storeKey],
() => {
if (!storeKey.value) return;
subscribeParentData(props.checkAll ? 'CHECK_ALL' : value.value);
},
{ immediate: true },
);

onBeforeUnmount(() => {
checkboxStore.unSubscribe(props.checkAll ? 'CHECK_ALL' : value.value);
checkboxStore.value?.unSubscribe(props.checkAll ? 'CHECK_ALL' : value.value);
});

const handleChange = (e: Event) => {
Expand Down
23 changes: 9 additions & 14 deletions src/checkbox/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import props from './checkbox-group-props';
import { CheckboxOptionObj, TdCheckboxProps, CheckboxGroupValue } from './type';
import { CheckboxGroupInjectionKey } from './constants';
import { usePrefixClass, useVModel, useChildComponentSlots } from '../hooks';
import { getCheckboxStore } from './store';
import { createCheckboxStore } from './store';

export default defineComponent({
name: 'TCheckboxGroup',
Expand All @@ -19,15 +19,8 @@ export default defineComponent({
setup(props) {
/** 样式 */
const COMPONENT_NAME = usePrefixClass('checkbox-group');
const date = new Date();
const storeKey = [
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
date.getUTCMilliseconds(),
].join('_');
const checkboxStore = getCheckboxStore(storeKey);

const { checkboxStore, storeKey } = createCheckboxStore();
checkboxStore.init();

const { isArray } = Array;
Expand Down Expand Up @@ -181,10 +174,12 @@ export default defineComponent({
);

watch([isCheckAll, indeterminate, options], ([isCheckAll, indeterminate]) => {
checkboxStore.updateChecked({
checked: innerValue.value,
isCheckAll,
indeterminate,
nextTick(() => {
checkboxStore.updateChecked({
checked: innerValue.value,
isCheckAll,
indeterminate,
});
});
});

Expand Down
26 changes: 23 additions & 3 deletions src/checkbox/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,29 @@ export function getChangedChecked(

const checkboxStoreInstanceMap: { [key: string]: CheckboxStore } = {};

export function getCheckboxStore(key: string) {
if (!checkboxStoreInstanceMap[key]) {
checkboxStoreInstanceMap[key] = new CheckboxStore();
export function createCheckboxStore(key?: string): { storeKey: string; checkboxStore: CheckboxStore } {
const date = new Date();
const storeKey = key
|| [
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
date.getUTCMilliseconds(),
Number((Math.random() * 10000).toFixed(2)),
].join('_');

if (checkboxStoreInstanceMap[storeKey]) {
return createCheckboxStore();
}
checkboxStoreInstanceMap[storeKey] = new CheckboxStore();

return {
storeKey,
checkboxStore: checkboxStoreInstanceMap[storeKey],
};
}

export function getCheckboxStore(key: string) {
return checkboxStoreInstanceMap[key];
}
12 changes: 9 additions & 3 deletions src/config-provider/useConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { inject, h, ref } from 'vue';
import {
inject, h, ref, computed,
} from 'vue';
import { GlobalConfigProvider, defaultGlobalConfig } from './context';

// 处理正则表达式
Expand Down Expand Up @@ -29,11 +31,15 @@ const t = function <T> (pattern: T, ...args: any[]) {
* @returns {t, global}
* useConfig('pagination')
*/
export function useConfig<T extends keyof GlobalConfigProvider>(componentName?: T) {
export function useConfig<T extends keyof GlobalConfigProvider>(
componentName: T = undefined,
componentLocale?: GlobalConfigProvider[T],
) {
const injectGlobalConfig = inject<GlobalConfigProvider>('globalConfig', null);
const mergedGlobalConfig = injectGlobalConfig || defaultGlobalConfig;

const global = ref(mergedGlobalConfig[componentName]);
// eslint-disable-next-line
const global = computed(() => Object.assign({}, mergedGlobalConfig[componentName], componentLocale));
const classPrefix = ref(mergedGlobalConfig.classPrefix);

return {
Expand Down
43 changes: 38 additions & 5 deletions src/dialog/_example/async.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<template>
<div>
<t-button @click="visible = true">异步加载类按钮</t-button>
<t-space>
<t-button @click="visible = true">异步加载类按钮</t-button>
<t-button @click="openAnotherDialog">插件函数异步加载</t-button>
</t-space>
<t-dialog
:visible.sync="visible"
header="保存"
body="保存中,请稍后"
:confirmBtn="{
content: '保存中...',
content: '保存',
theme: 'primary',
loading: true,
loading,
}"
:onConfirm="onConfirm"
:onClose="close"
Expand All @@ -20,15 +23,45 @@ export default {
data() {
return {
visible: false,
loading: false,
};
},
methods: {
close() {
this.visible = false;
},
onConfirm() {
console.log('处理中...');
this.visible = false;
this.loading = true;
const timer = setTimeout(() => {
this.loading = false;
this.visible = false;
clearTimeout(timer);
}, 500);
},
openAnotherDialog() {
const confirmDialog = this.$dialog.confirm({
header: '提交后不可再编辑会进入审批流程',
body: '是否确认提交?',
confirmBtn: {
content: '提交',
theme: 'primary',
loading: false,
},
theme: 'warning',
onConfirm: () => {
confirmDialog.update({ confirmBtn: { content: '提交中', loading: true } });
// confirmDialog.update({ confirmLoading: true });
// confirmDialog.setConfirmLoading(true);
const timer = setTimeout(() => {
confirmDialog.update({ confirmBtn: { content: '提交', loading: false } });
// confirmDialog.update({ confirmLoading: false });
// confirmDialog.setConfirmLoading(false);
confirmDialog.hide();
clearTimeout(timer);
}, 500);
},
});
},
},
};
Expand Down
Loading

0 comments on commit 8abf8a2

Please sign in to comment.