plain-design 1.0.0-beta.52 → 1.0.0-beta.54
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/dist/plain-design.commonjs.min.js +2 -2
- package/dist/plain-design.min.js +2 -2
- package/dist/report.html +2 -2
- package/package.json +1 -1
- package/src/packages/components/PageThemeUtils/index.tsx +22 -1
- package/src/packages/entry.tsx +2 -1
- package/src/packages/i18n/lang/en-us.ts +25 -25
- package/src/packages/utils/plainDate.ts +6 -2
package/package.json
CHANGED
@@ -3,7 +3,7 @@ import {createCache} from "../../utils/createCache";
|
|
3
3
|
import {InputMode, ThemeMode, ThemeShape, ThemeSize} from "../../uses/useStyle";
|
4
4
|
import {DeepPartial} from "../../utils/type";
|
5
5
|
import {iApplicationConfiguration} from "../Application/utils/application.utils";
|
6
|
-
import {iThemeConfiguration} from "../Application/theme/theme";
|
6
|
+
import {BaseColors, iThemeConfiguration} from "../Application/theme/theme";
|
7
7
|
import {deepmerge} from "./deepmerge";
|
8
8
|
import {PlainObject} from "plain-utils/utils/event";
|
9
9
|
|
@@ -235,3 +235,24 @@ export const ThemePrimaryColors: Record<string, {
|
|
235
235
|
};
|
236
236
|
|
237
237
|
export default PageThemeUtils;
|
238
|
+
|
239
|
+
export function getPrimaryColor(primaryKey?: string | undefined): { light: string, dark: string } {
|
240
|
+
const baseColor = {
|
241
|
+
light: BaseColors.light.primary,
|
242
|
+
dark: BaseColors.dark.primary,
|
243
|
+
};
|
244
|
+
if (!primaryKey) {
|
245
|
+
return baseColor;
|
246
|
+
}
|
247
|
+
const themeConfig = ThemePrimaryColors[primaryKey]?.themeConfig;
|
248
|
+
|
249
|
+
if (!themeConfig) {return baseColor;}
|
250
|
+
|
251
|
+
return typeof themeConfig === "string" ? {
|
252
|
+
dark: themeConfig,
|
253
|
+
light: themeConfig,
|
254
|
+
} : {
|
255
|
+
dark: themeConfig.dark.base!.primary!,
|
256
|
+
light: themeConfig.light.base!.primary!
|
257
|
+
};
|
258
|
+
}
|
package/src/packages/entry.tsx
CHANGED
@@ -196,7 +196,8 @@ export type {
|
|
196
196
|
iTableOptionCacheRegistryConfig,
|
197
197
|
iTableOptionGetCacheParam
|
198
198
|
} from './components/AutoTable/use/useTableOption.cache.utils';
|
199
|
-
export {PageThemeUtils} from './components/PageThemeUtils';
|
199
|
+
export {PageThemeUtils, getPrimaryColor} from './components/PageThemeUtils';
|
200
|
+
export {BaseColors, BaseGrayColors} from './components/Application/theme/theme';
|
200
201
|
export {ThemePrimaryColors} from './components/ThemePrimaryColors';
|
201
202
|
export {ThemeEditor} from './components/ThemeEditor';
|
202
203
|
export {useReferenceTrigger} from './components/useReferenceTrigger';
|
@@ -54,31 +54,31 @@ export const EnUsLocale: tZhCnLocale = {
|
|
54
54
|
operation: 'operation',
|
55
55
|
noFilter: 'no filter',
|
56
56
|
validate: {
|
57
|
-
require: 'require',
|
58
|
-
notMatchPattern: 'not match patter',
|
59
|
-
canNotUseMinInAnyType: 'any type cannot use min validation',
|
60
|
-
canNotUseMaxInAnyType: 'any type cannot use max validation',
|
61
|
-
canNotUseLenInAnyType: 'any type cannot use len validation',
|
62
|
-
outOfRange: 'value "{value}" is out of range {range}',
|
63
|
-
pleaseEnterArrayValue: 'please enter array value',
|
64
|
-
arrayCannotUsePatternValidation: 'array cannot use pattern validation',
|
65
|
-
minimunValues: 'minimun {num} values',
|
66
|
-
maximunValues: 'maximun {num} values',
|
67
|
-
minimunCharacters: 'minimun {num} characters',
|
68
|
-
maximunCharacters: 'maximun {num} characters',
|
69
|
-
fixedValues: 'fixed {num} values',
|
70
|
-
fixedCharacters: 'fixed {num} characters',
|
71
|
-
notLessThan: 'not less than {num}',
|
72
|
-
notLargerThan: 'not larger than{num}',
|
73
|
-
minValue: 'min {num}',
|
74
|
-
maxValue: 'max {num}',
|
75
|
-
fixedLength: 'fixed length {num} characters',
|
76
|
-
pleaseEnterCorrectEmail: 'please enter correct email',
|
77
|
-
pleaseEnterCorrectIdCard: 'please enter correct idcard',
|
78
|
-
pleaseEnterNumber: 'please enter correct number',
|
79
|
-
pleaseEnterCorrectPhoneNumber: 'please enter correct phone number',
|
80
|
-
pleaseEnterCorrectQQNum: 'please enter correct qq',
|
81
|
-
valueShouldBeStringOrNumber: 'please enter correct string or number',
|
57
|
+
require: ' require',
|
58
|
+
notMatchPattern: ' not match patter',
|
59
|
+
canNotUseMinInAnyType: ' any type cannot use min validation',
|
60
|
+
canNotUseMaxInAnyType: ' any type cannot use max validation',
|
61
|
+
canNotUseLenInAnyType: ' any type cannot use len validation',
|
62
|
+
outOfRange: ' value "{value}" is out of range {range}',
|
63
|
+
pleaseEnterArrayValue: ' please enter array value',
|
64
|
+
arrayCannotUsePatternValidation: ' array cannot use pattern validation',
|
65
|
+
minimunValues: ' minimun {num} values',
|
66
|
+
maximunValues: ' maximun {num} values',
|
67
|
+
minimunCharacters: ' minimun {num} characters',
|
68
|
+
maximunCharacters: ' maximun {num} characters',
|
69
|
+
fixedValues: ' fixed {num} values',
|
70
|
+
fixedCharacters: ' fixed {num} characters',
|
71
|
+
notLessThan: ' not less than {num}',
|
72
|
+
notLargerThan: ' not larger than{num}',
|
73
|
+
minValue: ' min {num}',
|
74
|
+
maxValue: ' max {num}',
|
75
|
+
fixedLength: ' fixed length {num} characters',
|
76
|
+
pleaseEnterCorrectEmail: ' please enter correct email',
|
77
|
+
pleaseEnterCorrectIdCard: ' please enter correct idcard',
|
78
|
+
pleaseEnterNumber: ' please enter correct number',
|
79
|
+
pleaseEnterCorrectPhoneNumber: ' please enter correct phone number',
|
80
|
+
pleaseEnterCorrectQQNum: ' please enter correct qq',
|
81
|
+
valueShouldBeStringOrNumber: ' please enter correct string or number',
|
82
82
|
|
83
83
|
},
|
84
84
|
filter: {
|
@@ -192,8 +192,12 @@ const parse = (str: string | undefined | null, format: string) => {
|
|
192
192
|
* @author 韦胜健
|
193
193
|
* @date 2021/1/18 10:30
|
194
194
|
*/
|
195
|
-
const today = (displayFormat: string, valueFormat: string) => {
|
195
|
+
const today = (displayFormat: string = 'YYYY-MM-DD', valueFormat: string = 'YYYY-MM-DD') => {
|
196
196
|
return wrapDate(new Date(), { displayFormat, valueFormat });
|
197
197
|
};
|
198
198
|
|
199
|
-
|
199
|
+
const now = (displayFormat: string = 'YYYY-MM-DD HH:mm:ss', valueFormat: string = 'YYYY-MM-DD HH:mm:ss') => {
|
200
|
+
return wrapDate(new Date(), { displayFormat, valueFormat });
|
201
|
+
};
|
202
|
+
|
203
|
+
export const plainDate = Object.assign(wrapDate, { defaultDate, format, parse, today, now, DayJs });
|