@lemon-fe/components 1.1.5-alpha.1 → 1.2.0-alpha.0
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/es/base-table/index.js +10 -3
- package/es/base-table/locale/en_US.d.ts +3 -0
- package/es/base-table/locale/en_US.js +5 -0
- package/es/base-table/locale/locale.d.ts +4 -0
- package/es/base-table/locale/locale.js +1 -0
- package/es/base-table/locale/zh_CN.d.ts +3 -0
- package/es/base-table/locale/zh_CN.js +5 -0
- package/es/color-picker/index.js +6 -2
- package/es/color-picker/locale/en_US.d.ts +3 -0
- package/es/color-picker/locale/en_US.js +4 -0
- package/es/color-picker/locale/locale.d.ts +3 -0
- package/es/color-picker/locale/locale.js +1 -0
- package/es/color-picker/locale/zh_CN.d.ts +3 -0
- package/es/color-picker/locale/zh_CN.js +4 -0
- package/es/data-grid/cell-editors/text.js +11 -2
- package/es/data-grid/components/custom-panel/field-modal.js +17 -9
- package/es/data-grid/components/custom-panel/index.js +11 -7
- package/es/data-grid/components/custom-panel/item.js +6 -2
- package/es/data-grid/components/search.js +8 -4
- package/es/data-grid/components/selected.js +9 -2
- package/es/data-grid/hooks.d.ts +4 -4
- package/es/data-grid/index.d.ts +44 -27
- package/es/data-grid/index.js +157 -145
- package/es/data-grid/locale/en_US.d.ts +3 -0
- package/es/data-grid/locale/en_US.js +55 -0
- package/es/data-grid/locale/locale.d.ts +35 -0
- package/es/data-grid/locale/locale.js +1 -0
- package/es/data-grid/locale/zh_CN.d.ts +3 -0
- package/es/data-grid/locale/zh_CN.js +55 -0
- package/es/data-grid/renderer/actions.js +11 -1
- package/es/data-grid/typings.d.ts +2 -2
- package/es/duration-picker/index.d.ts +1 -0
- package/es/duration-picker/index.js +80 -52
- package/es/duration-picker/locale/en_US.d.ts +3 -0
- package/es/duration-picker/locale/en_US.js +11 -0
- package/es/duration-picker/locale/locale.d.ts +10 -0
- package/es/duration-picker/locale/locale.js +1 -0
- package/es/duration-picker/locale/zh_CN.d.ts +3 -0
- package/es/duration-picker/locale/zh_CN.js +11 -0
- package/es/filter/index.js +84 -66
- package/es/filter/index.less +5 -0
- package/es/filter/locale/en_US.d.ts +3 -0
- package/es/filter/locale/en_US.js +22 -0
- package/es/filter/locale/locale.d.ts +22 -0
- package/es/filter/locale/locale.js +1 -0
- package/es/filter/locale/zh_CN.d.ts +3 -0
- package/es/filter/locale/zh_CN.js +22 -0
- package/es/index.d.ts +6 -1
- package/es/index.js +6 -2
- package/es/locale/en_US.d.ts +3 -0
- package/es/locale/en_US.js +32 -0
- package/es/locale/locale.d.ts +29 -0
- package/es/locale/locale.js +7 -0
- package/es/locale/zh_CN.d.ts +3 -0
- package/es/locale/zh_CN.js +65 -0
- package/es/locale-receiver.d.ts +4 -0
- package/es/locale-receiver.js +20 -0
- package/es/select-panel/index.js +15 -4
- package/es/select-panel/locale/en_US.d.ts +3 -0
- package/es/select-panel/locale/en_US.js +5 -0
- package/es/select-panel/locale/locale.d.ts +4 -0
- package/es/select-panel/locale/locale.js +1 -0
- package/es/select-panel/locale/zh_CN.d.ts +3 -0
- package/es/select-panel/locale/zh_CN.js +5 -0
- package/es/select-view/index.js +10 -4
- package/es/select-view/locale/en_US.d.ts +3 -0
- package/es/select-view/locale/en_US.js +6 -0
- package/es/select-view/locale/locale.d.ts +5 -0
- package/es/select-view/locale/locale.js +1 -0
- package/es/select-view/locale/zh_CN.d.ts +3 -0
- package/es/select-view/locale/zh_CN.js +6 -0
- package/es/sider-tree/index.d.ts +1 -1
- package/es/sider-tree/index.js +6 -2
- package/es/sider-tree/locale/en_US.d.ts +3 -0
- package/es/sider-tree/locale/en_US.js +5 -0
- package/es/sider-tree/locale/locale.d.ts +4 -0
- package/es/sider-tree/locale/locale.js +1 -0
- package/es/sider-tree/locale/zh_CN.d.ts +3 -0
- package/es/sider-tree/locale/zh_CN.js +5 -0
- package/es/sider-tree/tree-node-title.js +6 -2
- package/package.json +2 -2
package/es/filter/index.less
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var locale = {
|
|
2
|
+
savePlanText: 'Save plan',
|
|
3
|
+
planNameText: 'Plan name',
|
|
4
|
+
removePlanText: 'Remove plan',
|
|
5
|
+
planLimitText: 'The total number of query schemes cannot exceed 6',
|
|
6
|
+
lableDateText: 'Date',
|
|
7
|
+
defaultTitleText: 'Default',
|
|
8
|
+
noDefaultRemoveText: 'Can not delete default one',
|
|
9
|
+
autoPlaceholderText: 'Please ${action} ${label}',
|
|
10
|
+
searchText: 'Search',
|
|
11
|
+
selectText: 'Select',
|
|
12
|
+
inputText: 'Input',
|
|
13
|
+
searchOptionText: 'Search Option',
|
|
14
|
+
advanceSearchText: 'Advance search',
|
|
15
|
+
collapseSearchText: 'Collapse search',
|
|
16
|
+
resetText: 'Reset',
|
|
17
|
+
deleteModal: {
|
|
18
|
+
titleText: 'Info',
|
|
19
|
+
confirmDeleteText: 'Are you sure delete ${title} ?'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export default locale;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface FilterLocale extends Record<string, any> {
|
|
2
|
+
savePlanText: string;
|
|
3
|
+
removePlanText: string;
|
|
4
|
+
planNameText: string;
|
|
5
|
+
planLimitText: string;
|
|
6
|
+
lableDateText: string;
|
|
7
|
+
defaultTitleText: string;
|
|
8
|
+
noDefaultRemoveText: string;
|
|
9
|
+
autoPlaceholderText: string;
|
|
10
|
+
searchText: string;
|
|
11
|
+
searchOptionText: string;
|
|
12
|
+
selectText: string;
|
|
13
|
+
inputText: string;
|
|
14
|
+
advanceSearchText: string;
|
|
15
|
+
collapseSearchText: string;
|
|
16
|
+
resetText: string;
|
|
17
|
+
deleteModal: {
|
|
18
|
+
titleText: string;
|
|
19
|
+
confirmDeleteText: string;
|
|
20
|
+
};
|
|
21
|
+
[property: string]: any;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var locale = {
|
|
2
|
+
savePlanText: '保存方案',
|
|
3
|
+
planNameText: '方案名称',
|
|
4
|
+
removePlanText: '删除方案',
|
|
5
|
+
planLimitText: '查询方案总数不可超过6个',
|
|
6
|
+
lableDateText: '日期',
|
|
7
|
+
defaultTitleText: '默认',
|
|
8
|
+
noDefaultRemoveText: '不允许删除默认',
|
|
9
|
+
autoPlaceholderText: '请${action}${label}',
|
|
10
|
+
searchText: '搜索',
|
|
11
|
+
selectText: '选择',
|
|
12
|
+
inputText: '输入',
|
|
13
|
+
searchOptionText: '搜索选项',
|
|
14
|
+
advanceSearchText: '高级搜索',
|
|
15
|
+
collapseSearchText: '收起搜索',
|
|
16
|
+
resetText: '重置',
|
|
17
|
+
deleteModal: {
|
|
18
|
+
titleText: '提示',
|
|
19
|
+
confirmDeleteText: '确定删除${title}?'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export default locale;
|
package/es/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export { default as TabBar } from './tab-bar';
|
|
|
29
29
|
export { default as SymbolIcon } from './symbol-icon';
|
|
30
30
|
export { default as Dropdown } from './dropdown';
|
|
31
31
|
export { default as SelectView } from './select-view';
|
|
32
|
-
export { default as DataGrid } from './data-grid';
|
|
32
|
+
export { default as DataGrid, DataGridRef } from './data-grid';
|
|
33
33
|
export * from './data-grid/typings';
|
|
34
34
|
export * from './data-grid/hooks';
|
|
35
35
|
export { default as TipMark } from './tip-mark';
|
|
@@ -42,3 +42,8 @@ export { default as InputCompact } from './input-compact';
|
|
|
42
42
|
export { default as SelectPanel } from './select-panel';
|
|
43
43
|
export * from './component-configure';
|
|
44
44
|
export { default as EmptyImage } from './empty-image';
|
|
45
|
+
export type { Locale } from './locale/locale';
|
|
46
|
+
export { useLocaleReceiver } from './locale-receiver';
|
|
47
|
+
export { parseLocalTemplate } from './locale/locale';
|
|
48
|
+
export { default as zhCN } from './locale/zh_CN';
|
|
49
|
+
export { default as enUS } from './locale/en_US';
|
package/es/index.js
CHANGED
|
@@ -21,7 +21,7 @@ export { default as TabBar } from "./tab-bar";
|
|
|
21
21
|
export { default as SymbolIcon } from "./symbol-icon";
|
|
22
22
|
export { default as Dropdown } from "./dropdown";
|
|
23
23
|
export { default as SelectView } from "./select-view";
|
|
24
|
-
export { default as DataGrid } from "./data-grid";
|
|
24
|
+
export { default as DataGrid, DataGridRef } from "./data-grid";
|
|
25
25
|
export * from "./data-grid/typings";
|
|
26
26
|
export * from "./data-grid/hooks";
|
|
27
27
|
export { default as TipMark } from "./tip-mark";
|
|
@@ -33,4 +33,8 @@ export { default as InputNumber } from "./input-number";
|
|
|
33
33
|
export { default as InputCompact } from "./input-compact";
|
|
34
34
|
export { default as SelectPanel } from "./select-panel";
|
|
35
35
|
export * from "./component-configure";
|
|
36
|
-
export { default as EmptyImage } from "./empty-image";
|
|
36
|
+
export { default as EmptyImage } from "./empty-image";
|
|
37
|
+
export { useLocaleReceiver } from "./locale-receiver";
|
|
38
|
+
export { parseLocalTemplate } from "./locale/locale";
|
|
39
|
+
export { default as zhCN } from "./locale/zh_CN";
|
|
40
|
+
export { default as enUS } from "./locale/en_US";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import antEnUS from 'antd/lib/locale/en_US';
|
|
8
|
+
import { default as BaseTable } from "../base-table/locale/en_US";
|
|
9
|
+
import { default as ColorPickerLocale } from "../color-picker/locale/en_US";
|
|
10
|
+
import { default as DataGridLocale } from "../data-grid/locale/en_US";
|
|
11
|
+
import { default as DurationPickerLocale } from "../duration-picker/locale/en_US";
|
|
12
|
+
import { default as Filter } from "../filter/locale/en_US";
|
|
13
|
+
import { default as SelectPanelLocale } from "../select-panel/locale/en_US";
|
|
14
|
+
import { default as SelectViewLocale } from "../select-view/locale/en_US";
|
|
15
|
+
import { default as SiderTreeLocale } from "../sider-tree/locale/en_US";
|
|
16
|
+
var enUS = _objectSpread(_objectSpread({}, antEnUS), {}, {
|
|
17
|
+
Common: {
|
|
18
|
+
backText: 'Back'
|
|
19
|
+
},
|
|
20
|
+
Filter: Filter,
|
|
21
|
+
BaseTable: BaseTable,
|
|
22
|
+
ColorPicker: ColorPickerLocale,
|
|
23
|
+
DataGrid: DataGridLocale,
|
|
24
|
+
SiderTree: SiderTreeLocale,
|
|
25
|
+
SelectView: SelectViewLocale,
|
|
26
|
+
SelectPanel: SelectPanelLocale,
|
|
27
|
+
DurationPicker: DurationPickerLocale,
|
|
28
|
+
UseBatchOperator: {},
|
|
29
|
+
BasicLayout: {},
|
|
30
|
+
MicroLayout: {}
|
|
31
|
+
});
|
|
32
|
+
export default enUS;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Locale as antLocale } from 'antd/lib/locale-provider';
|
|
2
|
+
import type { BaseTableLocale } from '../base-table/locale/locale';
|
|
3
|
+
import type { ColorPickerLocale } from '../color-picker/locale/locale';
|
|
4
|
+
import type { DataGridLocale } from '../data-grid/locale/locale';
|
|
5
|
+
import type { DurationPickerLocale } from '../duration-picker/locale/locale';
|
|
6
|
+
import type { FilterLocale } from '../filter/locale/locale';
|
|
7
|
+
import type { SelectPanelLocale } from '../select-panel/locale/locale';
|
|
8
|
+
import type { SelectViewLocale } from '../select-view/locale/locale';
|
|
9
|
+
import type { SiderTreeLocale } from '../sider-tree/locale/locale';
|
|
10
|
+
/** 常见的一些语言提示 */
|
|
11
|
+
export interface CommonLocale {
|
|
12
|
+
backText: string;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export interface Locale extends antLocale {
|
|
16
|
+
Common: CommonLocale;
|
|
17
|
+
Filter: FilterLocale;
|
|
18
|
+
BaseTable: BaseTableLocale;
|
|
19
|
+
ColorPicker: ColorPickerLocale;
|
|
20
|
+
DataGrid: DataGridLocale;
|
|
21
|
+
SiderTree: SiderTreeLocale;
|
|
22
|
+
SelectView: SelectViewLocale;
|
|
23
|
+
SelectPanel: SelectPanelLocale;
|
|
24
|
+
DurationPicker: DurationPickerLocale;
|
|
25
|
+
UseBatchOperator: Record<string, any>;
|
|
26
|
+
BasicLayout: Record<string, any>;
|
|
27
|
+
MicroLayout: Record<string, any>;
|
|
28
|
+
}
|
|
29
|
+
export declare function parseLocalTemplate(template: string, context: Record<string | number, any>): string;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import antZhCN from 'antd/es/locale/zh_CN';
|
|
8
|
+
import { default as BaseTable } from "../base-table/locale/zh_CN";
|
|
9
|
+
import { default as ColorPickerLocale } from "../color-picker/locale/zh_CN";
|
|
10
|
+
import { default as DataGridLocale } from "../data-grid/locale/zh_CN";
|
|
11
|
+
import { default as DurationPickerLocale } from "../duration-picker/locale/zh_CN";
|
|
12
|
+
import { default as Filter } from "../filter/locale/zh_CN";
|
|
13
|
+
import { default as SelectPanelLocale } from "../select-panel/locale/zh_CN";
|
|
14
|
+
import { default as SelectViewLocale } from "../select-view/locale/zh_CN";
|
|
15
|
+
import { default as SiderTreeLocale } from "../sider-tree/locale/zh_CN";
|
|
16
|
+
var zhCN = _objectSpread(_objectSpread({}, antZhCN), {}, {
|
|
17
|
+
Common: {
|
|
18
|
+
backText: '返回'
|
|
19
|
+
},
|
|
20
|
+
Filter: Filter,
|
|
21
|
+
BaseTable: BaseTable,
|
|
22
|
+
ColorPicker: ColorPickerLocale,
|
|
23
|
+
DataGrid: DataGridLocale,
|
|
24
|
+
DurationPicker: DurationPickerLocale,
|
|
25
|
+
SiderTree: SiderTreeLocale,
|
|
26
|
+
SelectView: SelectViewLocale,
|
|
27
|
+
SelectPanel: SelectPanelLocale,
|
|
28
|
+
UseBatchOperator: {
|
|
29
|
+
continueText: '继续',
|
|
30
|
+
oprationSuccessText: '操作成功',
|
|
31
|
+
indexText: '编号',
|
|
32
|
+
detailsText: '明细',
|
|
33
|
+
resumeExecText: '继续执行',
|
|
34
|
+
startExecText: '开始执行',
|
|
35
|
+
suspendExecText: '暂停执行',
|
|
36
|
+
resultStateText: '处理状态',
|
|
37
|
+
pendingStateText: '待处理',
|
|
38
|
+
progressStateText: '进行中'
|
|
39
|
+
},
|
|
40
|
+
BasicLayout: {
|
|
41
|
+
tabModal: {
|
|
42
|
+
infoText: '提示',
|
|
43
|
+
contentText: '当前打开页签已达10个, 为不影响浏览器性能, 已为您关闭最早打开的页签',
|
|
44
|
+
okText: '我知道啦',
|
|
45
|
+
cancelText: '今日不再提醒'
|
|
46
|
+
},
|
|
47
|
+
menu: {
|
|
48
|
+
noFavoriteText: '暂无收藏',
|
|
49
|
+
managementText: '功能管理',
|
|
50
|
+
favotireText: '收藏',
|
|
51
|
+
noWantMenuText: '没有找到想要的功能?',
|
|
52
|
+
viewAllText: '查看全部'
|
|
53
|
+
},
|
|
54
|
+
refreshButton: {
|
|
55
|
+
refreshCurrText: '刷新当前页',
|
|
56
|
+
closeOthersText: '关闭其他页',
|
|
57
|
+
closeAllText: '关闭全部页'
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
MicroLayout: {
|
|
61
|
+
pageExceptionText: '页面异常',
|
|
62
|
+
reloadPageText: '重新加载'
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export default zhCN;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Locale } from './locale/locale';
|
|
2
|
+
export { default as LocaleProvide } from 'antd/lib/locale-provider';
|
|
3
|
+
export declare type LemonLocaleComponentName = Exclude<keyof Locale, 'locale'>;
|
|
4
|
+
export declare const useLocaleReceiver: <C extends LemonLocaleComponentName = LemonLocaleComponentName>(componentName: C, defaultLocale?: Locale[C] | (() => Locale[C]) | undefined) => [Locale[C]];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { ConfigProvider } from 'antd';
|
|
8
|
+
import { useContext, useMemo } from 'react';
|
|
9
|
+
import localDefaultData from "./locale/zh_CN";
|
|
10
|
+
export { default as LocaleProvide } from 'antd/lib/locale-provider';
|
|
11
|
+
export var useLocaleReceiver = function useLocaleReceiver(componentName, defaultLocale) {
|
|
12
|
+
var antLocale = useContext(ConfigProvider.ConfigContext).locale;
|
|
13
|
+
var getLocale = useMemo(function () {
|
|
14
|
+
var _antLocale$componentN;
|
|
15
|
+
var locale = defaultLocale || localDefaultData[componentName];
|
|
16
|
+
var localeFromContext = (_antLocale$componentN = antLocale === null || antLocale === void 0 ? void 0 : antLocale[componentName]) !== null && _antLocale$componentN !== void 0 ? _antLocale$componentN : {};
|
|
17
|
+
return _objectSpread(_objectSpread({}, typeof locale === 'function' ? locale() : locale), localeFromContext || {});
|
|
18
|
+
}, [componentName, defaultLocale, antLocale]);
|
|
19
|
+
return [getLocale];
|
|
20
|
+
};
|
package/es/select-panel/index.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
2
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
3
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
4
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import { Spin, Typography } from 'antd';
|
|
7
12
|
import React from 'react';
|
|
13
|
+
import { useLocaleReceiver } from "../locale-receiver";
|
|
14
|
+
import { parseLocalTemplate } from "../locale/locale";
|
|
8
15
|
import { prefixClassName } from "../utils";
|
|
9
|
-
import { Spin, Typography } from 'antd';
|
|
10
16
|
import classNames from 'classnames';
|
|
11
17
|
import { get } from 'lodash';
|
|
12
18
|
var emptyValue = [];
|
|
@@ -22,6 +28,9 @@ export default function SelectPanel(props) {
|
|
|
22
28
|
className = props.className,
|
|
23
29
|
disabled = props.disabled;
|
|
24
30
|
var prefix = prefixClassName('select-panel');
|
|
31
|
+
var _useLocaleReceiver = useLocaleReceiver('SelectPanel'),
|
|
32
|
+
_useLocaleReceiver2 = _slicedToArray(_useLocaleReceiver, 1),
|
|
33
|
+
SelectPanelLocale = _useLocaleReceiver2[0];
|
|
25
34
|
return /*#__PURE__*/React.createElement("div", {
|
|
26
35
|
className: classNames(prefix(), className),
|
|
27
36
|
style: style
|
|
@@ -35,12 +44,14 @@ export default function SelectPanel(props) {
|
|
|
35
44
|
className: prefix('right')
|
|
36
45
|
}, /*#__PURE__*/React.createElement("div", {
|
|
37
46
|
className: prefix('right-header')
|
|
38
|
-
}, /*#__PURE__*/React.createElement("span", null,
|
|
47
|
+
}, /*#__PURE__*/React.createElement("span", null, parseLocalTemplate(SelectPanelLocale.selectedDataText, {
|
|
48
|
+
length: value.length
|
|
49
|
+
})), !disabled && /*#__PURE__*/React.createElement(Typography.Link, {
|
|
39
50
|
disabled: value.length === 0,
|
|
40
51
|
onClick: function onClick() {
|
|
41
52
|
onChange === null || onChange === void 0 || onChange(emptyValue);
|
|
42
53
|
}
|
|
43
|
-
},
|
|
54
|
+
}, SelectPanelLocale.clearText)), /*#__PURE__*/React.createElement("div", {
|
|
44
55
|
className: prefix('right-body')
|
|
45
56
|
}, value.map(function (item, idx) {
|
|
46
57
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/select-view/index.js
CHANGED
|
@@ -19,6 +19,8 @@ import { Form, Spin, Tabs } from 'antd';
|
|
|
19
19
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
20
20
|
import DataGrid from "../data-grid";
|
|
21
21
|
import Filter from "../filter";
|
|
22
|
+
import { useLocaleReceiver } from "../locale-receiver";
|
|
23
|
+
import { parseLocalTemplate } from "../locale/locale";
|
|
22
24
|
import { mergeProp, prefixClassName } from "../utils";
|
|
23
25
|
import { get } from 'lodash';
|
|
24
26
|
export default function SelectView(props) {
|
|
@@ -180,8 +182,10 @@ export default function SelectView(props) {
|
|
|
180
182
|
}].concat(_toConsumableArray(selectedColumns));
|
|
181
183
|
return result;
|
|
182
184
|
}, [selectedColumns, readOnly]);
|
|
185
|
+
var _useLocaleReceiver = useLocaleReceiver('SelectView'),
|
|
186
|
+
_useLocaleReceiver2 = _slicedToArray(_useLocaleReceiver, 1),
|
|
187
|
+
SelectViewLocale = _useLocaleReceiver2[0];
|
|
183
188
|
var content;
|
|
184
|
-
console.log(cParams);
|
|
185
189
|
var renderList = function renderList() {
|
|
186
190
|
return /*#__PURE__*/React.createElement("div", {
|
|
187
191
|
className: prefix('layout')
|
|
@@ -254,11 +258,13 @@ export default function SelectView(props) {
|
|
|
254
258
|
content = /*#__PURE__*/React.createElement(Tabs, {
|
|
255
259
|
items: [{
|
|
256
260
|
key: 'list',
|
|
257
|
-
label:
|
|
261
|
+
label: SelectViewLocale.listText,
|
|
258
262
|
children: renderList()
|
|
259
263
|
}, {
|
|
260
264
|
key: 'selected',
|
|
261
|
-
label:
|
|
265
|
+
label: parseLocalTemplate(SelectViewLocale.selectedDataText, {
|
|
266
|
+
length: data.length
|
|
267
|
+
}),
|
|
262
268
|
children: renderSelected()
|
|
263
269
|
}],
|
|
264
270
|
tabBarGutter: 20,
|
|
@@ -266,7 +272,7 @@ export default function SelectView(props) {
|
|
|
266
272
|
tabBarExtraContent: {
|
|
267
273
|
right: tabFlag === 'selected' && !readOnly ? /*#__PURE__*/React.createElement("a", {
|
|
268
274
|
onClick: handleClear
|
|
269
|
-
},
|
|
275
|
+
}, SelectViewLocale.clearText) : null
|
|
270
276
|
}
|
|
271
277
|
});
|
|
272
278
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/sider-tree/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type TabsProps, type TreeProps } from 'antd';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
import type { TreeData, OperationType } from './typings';
|
|
3
|
-
import { type TabsProps, type TreeProps } from 'antd';
|
|
4
4
|
interface Props<KeyType> extends Omit<TreeProps, 'onSelect' | 'selectedKeys' | 'defaultSelectedKeys' | 'defaultExpandAll' | 'defaultExpandedKeys' | 'prefixCls' | 'height'> {
|
|
5
5
|
data?: TreeData<KeyType>[];
|
|
6
6
|
showSearch?: boolean;
|
package/es/sider-tree/index.js
CHANGED
|
@@ -13,14 +13,15 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
13
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
14
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
15
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
16
|
+
import { Input, Tabs, Tree } from 'antd';
|
|
16
17
|
import React, { useMemo, useState } from 'react';
|
|
17
18
|
import { PREFIX_CLS } from "../constants";
|
|
18
19
|
import EmptyImage from "../empty-image";
|
|
19
20
|
import Icons from "../icons";
|
|
21
|
+
import { useLocaleReceiver } from "../locale-receiver";
|
|
20
22
|
import { mapChildren, prefixClassName } from "../utils";
|
|
21
23
|
import TreeNodeTitle from "./tree-node-title";
|
|
22
24
|
import { useDebounce } from '@lemon-fe/hooks';
|
|
23
|
-
import { Input, Tabs, Tree } from 'antd';
|
|
24
25
|
import ResizeObserver from 'rc-resize-observer';
|
|
25
26
|
function SiderTreeTabs(props) {
|
|
26
27
|
var tabs = props.tabs,
|
|
@@ -61,6 +62,9 @@ export default function SiderTree(props) {
|
|
|
61
62
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
62
63
|
height = _useState4[0],
|
|
63
64
|
setHeight = _useState4[1];
|
|
65
|
+
var _useLocaleReceiver = useLocaleReceiver('SiderTree'),
|
|
66
|
+
_useLocaleReceiver2 = _slicedToArray(_useLocaleReceiver, 1),
|
|
67
|
+
SiderTreeLocale = _useLocaleReceiver2[0];
|
|
64
68
|
var tree = useMemo(function () {
|
|
65
69
|
var list = mData;
|
|
66
70
|
if (keywords) {
|
|
@@ -119,7 +123,7 @@ export default function SiderTree(props) {
|
|
|
119
123
|
}
|
|
120
124
|
var bodyContent = tree.length <= 0 ? /*#__PURE__*/React.createElement("div", {
|
|
121
125
|
className: prefix('empty')
|
|
122
|
-
}, /*#__PURE__*/React.createElement(EmptyImage, null), /*#__PURE__*/React.createElement("div", null,
|
|
126
|
+
}, /*#__PURE__*/React.createElement(EmptyImage, null), /*#__PURE__*/React.createElement("div", null, SiderTreeLocale.noDataText)) : /*#__PURE__*/React.createElement(Tree, _extends({
|
|
123
127
|
treeData: tree,
|
|
124
128
|
itemHeight: 28,
|
|
125
129
|
showLine: true,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,8 +8,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
9
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
12
11
|
import { Popover } from 'antd';
|
|
12
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
13
|
+
import { useLocaleReceiver } from "../locale-receiver";
|
|
13
14
|
import classNames from 'classnames';
|
|
14
15
|
export default function TreeNodeTitle(props) {
|
|
15
16
|
var _operation$others;
|
|
@@ -25,6 +26,9 @@ export default function TreeNodeTitle(props) {
|
|
|
25
26
|
visible = _useState4[0],
|
|
26
27
|
setVisible = _useState4[1];
|
|
27
28
|
var trigger = useRef(null);
|
|
29
|
+
var _useLocaleReceiver = useLocaleReceiver('SiderTree'),
|
|
30
|
+
_useLocaleReceiver2 = _slicedToArray(_useLocaleReceiver, 1),
|
|
31
|
+
SiderTreeLocale = _useLocaleReceiver2[0];
|
|
28
32
|
useEffect(function () {
|
|
29
33
|
var _trigger$current, _title, _title2;
|
|
30
34
|
var handler = function handler() {
|
|
@@ -73,7 +77,7 @@ export default function TreeNodeTitle(props) {
|
|
|
73
77
|
onClick: function onClick() {
|
|
74
78
|
return operation.onAdd(item);
|
|
75
79
|
}
|
|
76
|
-
},
|
|
80
|
+
}, SiderTreeLocale.addText)) : null, others),
|
|
77
81
|
onOpenChange: setVisible
|
|
78
82
|
}, /*#__PURE__*/React.createElement("div", {
|
|
79
83
|
className: classNames("".concat(prefixCls, "-title-operators-item"), _defineProperty({}, "".concat(prefixCls, "-title-operators-item-active"), visible)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-alpha.0",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"registry": "https://registry.npmjs.org"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "15c27e2871447d2c85cd946a38e9e6b70d079ca4"
|
|
66
66
|
}
|