feat(@omiu/date-picker): support switching locale

This commit is contained in:
dntzhang 2021-07-20 19:08:31 +08:00
parent 23f693d5b7
commit 325b06ad66
11 changed files with 3023 additions and 3376 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@omiu/date-picker",
"version": "0.0.4",
"version": "0.0.5",
"description": "Components that select date.",
"docsExtend": {
"cnName": "日期选择器",

View File

@ -1,5 +1,5 @@
/**
* @omiu/date-picker v0.0.4 http://omijs.org
* @omiu/date-picker v0.0.5 http://omijs.org
* Front End Cross-Frameworks Framework.
* By dntzhang https://github.com/dntzhang
* Github: https://github.com/Tencent/omi
@ -3338,6 +3338,10 @@ var Popover = /** @class */ (function (_super) {
_this.isShow = false;
return _this;
}
Popover.prototype.updated = function () {
var _a = this.props, locale = _a.locale, other = __rest$1(_a, ["locale"]);
flatpickr(this.shadowRoot.querySelector('o-input'), __assign$1({ locale: locale === 'zh' ? Mandarin : null }, other));
};
Popover.prototype.installed = function () {
return __awaiter(this, void 0, Promise, function () {
var styleLoader, _a, locale, other;

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -111,6 +111,13 @@ export default class Popover extends WeElement<Props> {
}
updated() {
const { locale, ...other } = this.props
flatpickr(this.shadowRoot.querySelector('o-input'), {
locale: locale === 'zh' ? Mandarin : null,
...other
})
}
async installed(): Promise<void> {
const styleLoader = new StyleLoader(this.props.theme as FlatpickrTheme)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OMI ADMIN</title>
<script type="module" crossorigin src="./assets/index.c4d85d98.js"></script>
<script type="module" crossorigin src="./assets/index.8c21781e.js"></script>
<link rel="modulepreload" href="./assets/vendor.d05385c3.js">
<link rel="stylesheet" href="./assets/index.e4c38a11.css">
</head>

View File

@ -19,7 +19,7 @@
"@omiu/checkbox": "^0.0.9",
"@omiu/color-picker": "^0.0.4",
"@omiu/common": "^0.0.9",
"@omiu/date-picker": "^0.0.4",
"@omiu/date-picker": "^0.0.5",
"@omiu/hamburger-menu": "^0.0.5",
"@omiu/icon": "^0.0.3",
"@omiu/input": "^0.0.8",