UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

1,248 lines (1,232 loc) 353 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('ng-zorro-antd/core/logger'), require('rxjs'), require('@angular/common'), require('date-fns/format'), require('date-fns/getISOWeek'), require('date-fns/parse'), require('ng-zorro-antd/core/time')) : typeof define === 'function' && define.amd ? define('ng-zorro-antd/i18n', ['exports', '@angular/core', 'ng-zorro-antd/core/logger', 'rxjs', '@angular/common', 'date-fns/format', 'date-fns/getISOWeek', 'date-fns/parse', 'ng-zorro-antd/core/time'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['ng-zorro-antd'] = global['ng-zorro-antd'] || {}, global['ng-zorro-antd'].i18n = {}), global.ng.core, global['ng-zorro-antd'].core.logger, global.rxjs, global.ng.common, global.fnsFormat, global.fnsGetISOWeek, global.fnsParse, global['ng-zorro-antd'].core.time)); }(this, (function (exports, i0, logger, rxjs, common, fnsFormat, fnsGetISOWeek, fnsParse, time) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var fnsFormat__default = /*#__PURE__*/_interopDefaultLegacy(fnsFormat); var fnsGetISOWeek__default = /*#__PURE__*/_interopDefaultLegacy(fnsGetISOWeek); var fnsParse__default = /*#__PURE__*/_interopDefaultLegacy(fnsParse); /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ var en_US = { locale: 'en', Pagination: { items_per_page: '/ page', jump_to: 'Go to', jump_to_confirm: 'confirm', page: '', prev_page: 'Previous Page', next_page: 'Next Page', prev_5: 'Previous 5 Pages', next_5: 'Next 5 Pages', prev_3: 'Previous 3 Pages', next_3: 'Next 3 Pages' }, DatePicker: { lang: { placeholder: 'Select date', yearPlaceholder: 'Select year', quarterPlaceholder: 'Select quarter', monthPlaceholder: 'Select month', weekPlaceholder: 'Select week', rangePlaceholder: ['Start date', 'End date'], rangeYearPlaceholder: ['Start year', 'End year'], rangeMonthPlaceholder: ['Start month', 'End month'], rangeWeekPlaceholder: ['Start week', 'End week'], locale: 'en_US', today: 'Today', now: 'Now', backToToday: 'Back to today', ok: 'Ok', clear: 'Clear', month: 'Month', year: 'Year', timeSelect: 'select time', dateSelect: 'select date', weekSelect: 'Choose a week', monthSelect: 'Choose a month', yearSelect: 'Choose a year', decadeSelect: 'Choose a decade', yearFormat: 'YYYY', dateFormat: 'M/D/YYYY', dayFormat: 'D', dateTimeFormat: 'M/D/YYYY HH:mm:ss', monthBeforeYear: true, previousMonth: 'Previous month (PageUp)', nextMonth: 'Next month (PageDown)', previousYear: 'Last year (Control + left)', nextYear: 'Next year (Control + right)', previousDecade: 'Last decade', nextDecade: 'Next decade', previousCentury: 'Last century', nextCentury: 'Next century' }, timePickerLocale: { placeholder: 'Select time', rangePlaceholder: ['Start time', 'End time'] } }, TimePicker: { placeholder: 'Select time', rangePlaceholder: ['Start time', 'End time'] }, Calendar: { lang: { placeholder: 'Select date', yearPlaceholder: 'Select year', quarterPlaceholder: 'Select quarter', monthPlaceholder: 'Select month', weekPlaceholder: 'Select week', rangePlaceholder: ['Start date', 'End date'], rangeYearPlaceholder: ['Start year', 'End year'], rangeMonthPlaceholder: ['Start month', 'End month'], rangeWeekPlaceholder: ['Start week', 'End week'], locale: 'en_US', today: 'Today', now: 'Now', backToToday: 'Back to today', ok: 'Ok', clear: 'Clear', month: 'Month', year: 'Year', timeSelect: 'select time', dateSelect: 'select date', weekSelect: 'Choose a week', monthSelect: 'Choose a month', yearSelect: 'Choose a year', decadeSelect: 'Choose a decade', yearFormat: 'YYYY', dateFormat: 'M/D/YYYY', dayFormat: 'D', dateTimeFormat: 'M/D/YYYY HH:mm:ss', monthBeforeYear: true, previousMonth: 'Previous month (PageUp)', nextMonth: 'Next month (PageDown)', previousYear: 'Last year (Control + left)', nextYear: 'Next year (Control + right)', previousDecade: 'Last decade', nextDecade: 'Next decade', previousCentury: 'Last century', nextCentury: 'Next century' }, timePickerLocale: { placeholder: 'Select time', rangePlaceholder: ['Start time', 'End time'] } }, global: { placeholder: 'Please select' }, Table: { filterTitle: 'Filter menu', filterConfirm: 'OK', filterReset: 'Reset', filterEmptyText: 'No filters', emptyText: 'No data', selectAll: 'Select current page', selectInvert: 'Invert current page', selectionAll: 'Select all data', sortTitle: 'Sort', expand: 'Expand row', collapse: 'Collapse row', triggerDesc: 'Click sort by descend', triggerAsc: 'Click sort by ascend', cancelSort: 'Click to cancel sort' }, Modal: { okText: 'OK', cancelText: 'Cancel', justOkText: 'OK' }, Popconfirm: { okText: 'OK', cancelText: 'Cancel' }, Transfer: { titles: ['', ''], searchPlaceholder: 'Search here', itemUnit: 'item', itemsUnit: 'items', remove: 'Remove', selectCurrent: 'Select current page', removeCurrent: 'Remove current page', selectAll: 'Select all data', removeAll: 'Remove all data', selectInvert: 'Invert current page' }, Upload: { uploading: 'Uploading...', removeFile: 'Remove file', uploadError: 'Upload error', previewFile: 'Preview file', downloadFile: 'Download file' }, Empty: { description: 'No Data' }, Icon: { icon: 'icon' }, Text: { edit: 'Edit', copy: 'Copy', copied: 'Copied', expand: 'Expand' }, PageHeader: { back: 'Back' } }; /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ var zh_CN = { locale: 'zh-cn', Pagination: { items_per_page: '条/页', jump_to: '跳至', jump_to_confirm: '确定', page: '页', prev_page: '上一页', next_page: '下一页', prev_5: '向前 5 页', next_5: '向后 5 页', prev_3: '向前 3 页', next_3: '向后 3 页' }, DatePicker: { lang: { placeholder: '请选择日期', yearPlaceholder: '请选择年份', quarterPlaceholder: '请选择季度', monthPlaceholder: '请选择月份', weekPlaceholder: '请选择周', rangePlaceholder: ['开始日期', '结束日期'], rangeYearPlaceholder: ['开始年份', '结束年份'], rangeMonthPlaceholder: ['开始月份', '结束月份'], rangeWeekPlaceholder: ['开始周', '结束周'], locale: 'zh_CN', today: '今天', now: '此刻', backToToday: '返回今天', ok: '确定', timeSelect: '选择时间', dateSelect: '选择日期', weekSelect: '选择周', clear: '清除', month: '月', year: '年', previousMonth: '上个月 (翻页上键)', nextMonth: '下个月 (翻页下键)', monthSelect: '选择月份', yearSelect: '选择年份', decadeSelect: '选择年代', yearFormat: 'YYYY年', dayFormat: 'D日', dateFormat: 'YYYY年M月D日', dateTimeFormat: 'YYYY年M月D日 HH时mm分ss秒', previousYear: '上一年 (Control键加左方向键)', nextYear: '下一年 (Control键加右方向键)', previousDecade: '上一年代', nextDecade: '下一年代', previousCentury: '上一世纪', nextCentury: '下一世纪' }, timePickerLocale: { placeholder: '请选择时间', rangePlaceholder: ['开始时间', '结束时间'] } }, TimePicker: { placeholder: '请选择时间', rangePlaceholder: ['开始时间', '结束时间'] }, Calendar: { lang: { placeholder: '请选择日期', yearPlaceholder: '请选择年份', quarterPlaceholder: '请选择季度', monthPlaceholder: '请选择月份', weekPlaceholder: '请选择周', rangePlaceholder: ['开始日期', '结束日期'], rangeYearPlaceholder: ['开始年份', '结束年份'], rangeMonthPlaceholder: ['开始月份', '结束月份'], rangeWeekPlaceholder: ['开始周', '结束周'], locale: 'zh_CN', today: '今天', now: '此刻', backToToday: '返回今天', ok: '确定', timeSelect: '选择时间', dateSelect: '选择日期', weekSelect: '选择周', clear: '清除', month: '月', year: '年', previousMonth: '上个月 (翻页上键)', nextMonth: '下个月 (翻页下键)', monthSelect: '选择月份', yearSelect: '选择年份', decadeSelect: '选择年代', yearFormat: 'YYYY年', dayFormat: 'D日', dateFormat: 'YYYY年M月D日', dateTimeFormat: 'YYYY年M月D日 HH时mm分ss秒', previousYear: '上一年 (Control键加左方向键)', nextYear: '下一年 (Control键加右方向键)', previousDecade: '上一年代', nextDecade: '下一年代', previousCentury: '上一世纪', nextCentury: '下一世纪' }, timePickerLocale: { placeholder: '请选择时间', rangePlaceholder: ['开始时间', '结束时间'] } }, global: { placeholder: '请选择' }, Table: { filterTitle: '筛选', filterConfirm: '确定', filterReset: '重置', filterEmptyText: '无筛选项', selectAll: '全选当页', selectInvert: '反选当页', selectionAll: '全选所有', sortTitle: '排序', expand: '展开行', collapse: '关闭行', triggerDesc: '点击降序', triggerAsc: '点击升序', cancelSort: '取消排序' }, Modal: { okText: '确定', cancelText: '取消', justOkText: '知道了' }, Popconfirm: { cancelText: '取消', okText: '确定' }, Transfer: { searchPlaceholder: '请输入搜索内容', itemUnit: '项', itemsUnit: '项', remove: '删除', selectCurrent: '全选当页', removeCurrent: '删除当页', selectAll: '全选所有', removeAll: '删除全部', selectInvert: '反选当页' }, Upload: { uploading: '文件上传中', removeFile: '删除文件', uploadError: '上传错误', previewFile: '预览文件', downloadFile: '下载文件' }, Empty: { description: '暂无数据' }, Icon: { icon: '图标' }, Text: { edit: '编辑', copy: '复制', copied: '复制成功', expand: '展开' }, PageHeader: { back: '返回' } }; /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ var NZ_I18N = new i0.InjectionToken('nz-i18n'); /** Locale for date operations, should import from date-fns, see example: https://github.com/date-fns/date-fns/blob/v1.30.1/src/locale/zh_cn/index.js */ var NZ_DATE_LOCALE = new i0.InjectionToken('nz-date-locale'); /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ var NzI18nService = /** @class */ (function () { function NzI18nService(locale, dateLocale) { this._change = new rxjs.BehaviorSubject(this._locale); this.setLocale(locale || zh_CN); this.setDateLocale(dateLocale || null); } Object.defineProperty(NzI18nService.prototype, "localeChange", { get: function () { return this._change.asObservable(); }, enumerable: false, configurable: true }); // [NOTE] Performance issue: this method may called by every change detections // TODO: cache more deeply paths for performance NzI18nService.prototype.translate = function (path, data) { // this._logger.debug(`[NzI18nService] Translating(${this._locale.locale}): ${path}`); var content = this._getObjectPath(this._locale, path); if (typeof content === 'string') { if (data) { Object.keys(data).forEach(function (key) { return (content = content.replace(new RegExp("%" + key + "%", 'g'), data[key])); }); } return content; } return path; }; /** * Set/Change current locale globally throughout the WHOLE application * NOTE: If called at runtime, rendered interface may not change along with the locale change, * because this do not trigger another render schedule. * * @param locale The translating letters */ NzI18nService.prototype.setLocale = function (locale) { if (this._locale && this._locale.locale === locale.locale) { return; } this._locale = locale; this._change.next(locale); }; NzI18nService.prototype.getLocale = function () { return this._locale; }; NzI18nService.prototype.getLocaleId = function () { return this._locale ? this._locale.locale : ''; }; NzI18nService.prototype.setDateLocale = function (dateLocale) { this.dateLocale = dateLocale; }; NzI18nService.prototype.getDateLocale = function () { return this.dateLocale; }; /** * Get locale data * @param path dot paths for finding exist value from locale data, eg. "a.b.c" * @param defaultValue default value if the result is not "truthy" */ NzI18nService.prototype.getLocaleData = function (path, defaultValue) { var result = path ? this._getObjectPath(this._locale, path) : this._locale; if (!result && !defaultValue) { logger.warn("Missing translations for \"" + path + "\" in language \"" + this._locale.locale + "\".\nYou can use \"NzI18nService.setLocale\" as a temporary fix.\nWelcome to submit a pull request to help us optimize the translations!\nhttps://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md"); } return result || defaultValue || this._getObjectPath(en_US, path) || {}; }; NzI18nService.prototype._getObjectPath = function (obj, path) { var res = obj; var paths = path.split('.'); var depth = paths.length; var index = 0; while (res && index < depth) { res = res[paths[index++]]; } return index === depth ? res : null; }; return NzI18nService; }()); NzI18nService.ɵprov = i0.ɵɵdefineInjectable({ factory: function NzI18nService_Factory() { return new NzI18nService(i0.ɵɵinject(NZ_I18N, 8), i0.ɵɵinject(NZ_DATE_LOCALE, 8)); }, token: NzI18nService, providedIn: "root" }); NzI18nService.decorators = [ { type: i0.Injectable, args: [{ providedIn: 'root' },] } ]; NzI18nService.ctorParameters = function () { return [ { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [NZ_I18N,] }] }, { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [NZ_DATE_LOCALE,] }] } ]; }; /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ var NzI18nPipe = /** @class */ (function () { function NzI18nPipe(_locale) { this._locale = _locale; } NzI18nPipe.prototype.transform = function (path, keyValue) { return this._locale.translate(path, keyValue); }; return NzI18nPipe; }()); NzI18nPipe.decorators = [ { type: i0.Pipe, args: [{ name: 'nzI18n' },] } ]; NzI18nPipe.ctorParameters = function () { return [ { type: NzI18nService } ]; }; /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ var NzI18nModule = /** @class */ (function () { function NzI18nModule() { } return NzI18nModule; }()); NzI18nModule.decorators = [ { type: i0.NgModule, args: [{ declarations: [NzI18nPipe], exports: [NzI18nPipe] },] } ]; /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ var NZ_DATE_CONFIG = new i0.InjectionToken('date-config'); var NZ_DATE_CONFIG_DEFAULT = { firstDayOfWeek: undefined }; function mergeDateConfig(config) { return Object.assign(Object.assign({}, NZ_DATE_CONFIG_DEFAULT), config); } /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function () { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); }; } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function () { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } var __createBinding = Object.create ? (function (o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); }) : (function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } /** @deprecated */ function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } /** @deprecated */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } function __spreadArray(to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i]; return to; } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; } ; var __setModuleDefault = Object.create ? (function (o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function (o, v) { o["default"] = v; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, privateMap) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return privateMap.get(receiver); } function __classPrivateFieldSet(receiver, privateMap, value) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to set private field on non-instance"); } privateMap.set(receiver, value); return value; } function DATE_HELPER_SERVICE_FACTORY(injector, config) { var i18n = injector.get(NzI18nService); return i18n.getDateLocale() ? new DateHelperByDateFns(i18n, config) : new DateHelperByDatePipe(i18n, config); } /** * Abstract DateHelperService(Token via Class) * Compatibility: compact for original usage by default which using DatePipe */ var DateHelperService = /** @class */ (function () { function DateHelperService(i18n, config) { this.i18n = i18n; this.config = config; this.config = mergeDateConfig(this.config); } return DateHelperService; }()); DateHelperService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DateHelperService_Factory() { return DATE_HELPER_SERVICE_FACTORY(i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(NZ_DATE_CONFIG, 8)); }, token: DateHelperService, providedIn: "root" }); DateHelperService.decorators = [ { type: i0.Injectable, args: [{ providedIn: 'root', useFactory: DATE_HELPER_SERVICE_FACTORY, deps: [i0.Injector, [new i0.Optional(), NZ_DATE_CONFIG]] },] } ]; DateHelperService.ctorParameters = function () { return [ { type: NzI18nService }, { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [NZ_DATE_CONFIG,] }] } ]; }; /** * DateHelper that handles date formats with date-fns */ var DateHelperByDateFns = /** @class */ (function (_super) { __extends(DateHelperByDateFns, _super); function DateHelperByDateFns() { return _super !== null && _super.apply(this, arguments) || this; } DateHelperByDateFns.prototype.getISOWeek = function (date) { return fnsGetISOWeek__default['default'](date); }; // Use date-fns's "weekStartsOn" to support different locale when "config.firstDayOfWeek" is null // https://github.com/date-fns/date-fns/blob/v2.0.0-alpha.27/src/locale/en-US/index.js#L23 DateHelperByDateFns.prototype.getFirstDayOfWeek = function () { var defaultWeekStartsOn; try { defaultWeekStartsOn = this.i18n.getDateLocale().options.weekStartsOn; } catch (e) { defaultWeekStartsOn = 1; } return this.config.firstDayOfWeek == null ? defaultWeekStartsOn : this.config.firstDayOfWeek; }; /** * Format a date * @see https://date-fns.org/docs/format#description * @param date Date * @param formatStr format string */ DateHelperByDateFns.prototype.format = function (date, formatStr) { return date ? fnsFormat__default['default'](date, formatStr, { locale: this.i18n.getDateLocale() }) : ''; }; DateHelperByDateFns.prototype.parseDate = function (text, formatStr) { return fnsParse__default['default'](text, formatStr, new Date(), { locale: this.i18n.getDateLocale(), weekStartsOn: this.getFirstDayOfWeek() }); }; DateHelperByDateFns.prototype.parseTime = function (text, formatStr) { return this.parseDate(text, formatStr); }; return DateHelperByDateFns; }(DateHelperService)); DateHelperByDateFns.ɵprov = i0.ɵɵdefineInjectable({ factory: function DateHelperByDateFns_Factory() { return DATE_HELPER_SERVICE_FACTORY(i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(NZ_DATE_CONFIG, 8)); }, token: DateHelperByDateFns, providedIn: "root" }); /** * DateHelper that handles date formats with angular's date-pipe * * @see https://github.com/NG-ZORRO/ng-zorro-antd/issues/2406 - DatePipe may cause non-standard week bug, see: * */ var DateHelperByDatePipe = /** @class */ (function (_super) { __extends(DateHelperByDatePipe, _super); function DateHelperByDatePipe() { return _super !== null && _super.apply(this, arguments) || this; } DateHelperByDatePipe.prototype.getISOWeek = function (date) { return +this.format(date, 'w'); }; DateHelperByDatePipe.prototype.getFirstDayOfWeek = function () { if (this.config.firstDayOfWeek === undefined) { var locale = this.i18n.getLocaleId(); return locale && ['zh-cn', 'zh-tw'].indexOf(locale.toLowerCase()) > -1 ? 1 : 0; } return this.config.firstDayOfWeek; }; DateHelperByDatePipe.prototype.format = function (date, formatStr) { return date ? common.formatDate(date, formatStr, this.i18n.getLocaleId()) : ''; }; DateHelperByDatePipe.prototype.parseDate = function (text) { return new Date(text); }; DateHelperByDatePipe.prototype.parseTime = function (text, formatStr) { var parser = new time.ɵNgTimeParser(formatStr, this.i18n.getLocaleId()); return parser.toDate(text); }; return DateHelperByDatePipe; }(DateHelperService)); DateHelperByDatePipe.ɵprov = i0.ɵɵdefineInjectable({ factory: function DateHelperByDatePipe_Factory() { return DATE_HELPER_SERVICE_FACTORY(i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(NZ_DATE_CONFIG, 8)); }, token: DateHelperByDatePipe, providedIn: "root" }); /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ var ar_EG = { locale: 'ar', Pagination: { items_per_page: '/ الصفحة', jump_to: 'الذهاب إلى', jump_to_confirm: 'تأكيد', page: '', prev_page: 'الصفحة السابقة', next_page: 'الصفحة التالية', prev_5: 'خمس صفحات سابقة', next_5: 'خمس صفحات تالية', prev_3: 'ثلاث صفحات سابقة', next_3: 'ثلاث صفحات تالية' }, DatePicker: { lang: { placeholder: 'اختيار التاريخ', rangePlaceholder: ['البداية', 'النهاية'], locale: 'ar_EG', today: 'اليوم', now: 'الأن', backToToday: 'العودة إلى اليوم', ok: 'تأكيد', clear: 'مسح', month: 'الشهر', year: 'السنة', timeSelect: 'اختيار الوقت', dateSelect: 'اختيار التاريخ', monthSelect: 'اختيار الشهر', yearSelect: 'اختيار السنة', decadeSelect: 'اختيار العقد', yearFormat: 'YYYY', dateFormat: 'M/D/YYYY', dayFormat: 'D', dateTimeFormat: 'M/D/YYYY HH:mm:ss', monthBeforeYear: true, previousMonth: 'الشهر السابق (PageUp)', nextMonth: 'الشهر التالى(PageDown)', previousYear: 'العام السابق (Control + left)', nextYear: 'العام التالى (Control + right)', previousDecade: 'العقد السابق', nextDecade: 'العقد التالى', previousCentury: 'القرن السابق', nextCentury: 'القرن التالى' }, timePickerLocale: { placeholder: 'اختيار الوقت' }, dateFormat: 'DD-MM-YYYY', monthFormat: 'MM-YYYY', dateTimeFormat: 'DD-MM-YYYY HH:mm:ss', weekFormat: 'wo-YYYY' }, TimePicker: { placeholder: 'اختيار الوقت' }, Calendar: { lang: { placeholder: 'اختيار التاريخ', rangePlaceholder: ['البداية', 'النهاية'], locale: 'ar_EG', today: 'اليوم', now: 'الأن', backToToday: 'العودة إلى اليوم', ok: 'تأكيد', clear: 'مسح', month: 'الشهر', year: 'السنة', timeSelect: 'اختيار الوقت', dateSelect: 'اختيار التاريخ', monthSelect: 'اختيار الشهر', yearSelect: 'اختيار السنة', decadeSelect: 'اختيار العقد', yearFormat: 'YYYY', dateFormat: 'M/D/YYYY', dayFormat: 'D', dateTimeFormat: 'M/D/YYYY HH:mm:ss', monthBeforeYear: true, previousMonth: 'الشهر السابق (PageUp)', nextMonth: 'الشهر التالى(PageDown)', previousYear: 'العام السابق (Control + left)', nextYear: 'العام التالى (Control + right)', previousDecade: 'العقد السابق', nextDecade: 'العقد التالى', previousCentury: 'القرن السابق', nextCentury: 'القرن التالى' }, timePickerLocale: { placeholder: 'اختيار الوقت' }, dateFormat: 'DD-MM-YYYY', monthFormat: 'MM-YYYY', dateTimeFormat: 'DD-MM-YYYY HH:mm:ss', weekFormat: 'wo-YYYY' }, global: { placeholder: 'يرجى التحديد' }, Table: { filterTitle: 'الفلاتر', filterConfirm: 'تأكيد', filterReset: 'إعادة ضبط', selectAll: 'اختيار الكل', selectInvert: 'إلغاء الاختيار', selectionAll: 'حدد جميع البيانات', sortTitle: 'رتب', expand: 'توسيع الصف', collapse: 'طي الصف', triggerDesc: 'ترتيب تنازلي', triggerAsc: 'ترتيب تصاعدي', cancelSort: 'إلغاء الترتيب' }, Modal: { okText: 'تأكيد', cancelText: 'إلغاء', justOkText: 'تأكيد' }, Popconfirm: { okText: 'تأكيد', cancelText: 'إلغاء' }, Transfer: { searchPlaceholder: 'ابحث هنا', itemUnit: 'عنصر', itemsUnit: 'عناصر' }, Upload: { uploading: 'جاري الرفع...', removeFile: 'احذف الملف', uploadError: 'مشكلة فى الرفع', previewFile: 'استعرض الملف', downloadFile: 'تحميل الملف' }, Empty: { description: 'لا توجد بيانات' }, Icon: { icon: 'أيقونة' }, Text: { edit: 'تعديل', copy: 'نسخ', copied: 'نقل', expand: 'وسع' }, PageHeader: { back: 'عودة' } }; /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ var az_AZ = { locale: 'az', Pagination: { items_per_page: '/ səhifə', jump_to: 'Get', jump_to_confirm: 'təsdiqlə', page: '', prev_page: 'Əvvəlki Səhifə', next_page: 'Növbəti Səhifə', prev_5: 'Əvvəlki 5 Səhifə', next_5: 'Növbəti 5 Səhifə', prev_3: 'Əvvəlki 3 Səhifə', next_3: 'Növbəti 3 Səhifə' }, DatePicker: { lang: { placeholder: 'Tarix seçin', rangePlaceholder: ['Başlama tarixi', 'Bitmə tarixi'], locale: 'az_AZ', today: 'Bugün', now: 'İndi', backToToday: 'Bugünə qayıt', ok: 'Təsdiq', clear: 'Təmizlə', month: 'Ay', year: 'İl', timeSelect: 'vaxtı seç', dateSelect: 'tarixi seç', weekSelect: 'Həftə seç', monthSelect: 'Ay seç', yearSelect: 'il seç', decadeSelect: 'Onillik seçin', yearFormat: 'YYYY', dateFormat: 'D.M.YYYY', dayFormat: 'D', dateTimeFormat: 'D.M.YYYY HH:mm:ss', monthBeforeYear: true, previousMonth: 'Əvvəlki ay (PageUp)', nextMonth: 'Növbəti ay (PageDown)', previousYear: 'Sonuncu il (Control + left)', nextYear: 'Növbəti il (Control + right)', previousDecade: 'Sonuncu onillik', nextDecade: 'Növbəti onillik', previousCentury: 'Sonuncu əsr', nextCentury: 'Növbəti əsr' }, timePickerLocale: { placeholder: 'Vaxtı seç' } }, TimePicker: { placeholder: 'Vaxtı seç' }, Calendar: { lang: { placeholder: 'Tarix seçin', rangePlaceholder: ['Başlama tarixi', 'Bitmə tarixi'], locale: 'az_AZ', today: 'Bugün', now: 'İndi', backToToday: 'Bugünə qayıt', ok: 'Təsdiq', clear: 'Təmizlə', month: 'Ay', year: 'İl', timeSelect: 'vaxtı seç', dateSelect: 'tarixi seç', weekSelect: 'Həftə seç', monthSelect: 'Ay seç', yearSelect: 'il seç', decadeSelect: 'Onillik seçin', yearFormat: 'YYYY', dateFormat: 'D.M.YYYY', dayFormat: 'D', dateTimeFormat: 'D.M.YYYY HH:mm:ss', monthBeforeYear: true, previousMonth: 'Əvvəlki ay (PageUp)', nextMonth: 'Növbəti ay (PageDown)', previousYear: 'Sonuncu il (Control + left)', nextYear: 'Növbəti il (Control + right)', previousDecade: 'Sonuncu onillik', nextDecade: 'Növbəti onillik', previousCentury: 'Sonuncu əsr', nextCentury: 'Növbəti əsr' }, timePickerLocale: { placeholder: 'Vaxtı seç' } }, Table: { filterTitle: 'Filter menyu', filterConfirm: 'Axtar', filterReset: 'Sıfırla', emptyText: 'Məlumat yoxdur', selectAll: 'Cari səhifəni seç', selectInvert: 'Invert current page' }, Modal: { okText: 'Bəli', cancelText: 'Ləğv et', justOkText: 'Bəli' }, Popconfirm: { okText: 'Bəli', cancelText: 'Ləğv et' }, Transfer: { titles: ['', ''], notFoundContent: 'Tapılmadı', searchPlaceholder: 'Burada axtar', itemUnit: 'item', itemsUnit: 'items' }, Select: { notFoundContent: 'Tapılmadı' }, Upload: { uploading: 'Yüklənir...', removeFile: 'Faylı sil', uploadError: 'Yükləmə xətası', previewFile: 'Fayla önbaxış' } }; /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ var bg_BG = { locale: 'bg', Pagination: { items_per_page: '/ страница', jump_to: 'Към', jump_to_confirm: 'потвърждавам', page: '', prev_page: 'Предишна страница', next_page: 'Следваща страница', prev_5: 'Предишни 5 страници', next_5: 'Следващи 5 страници', prev_3: 'Предишни 3 страници', next_3: 'Следващи 3 страници' }, DatePicker: { lang: { placeholder: 'Избор на дата', rangePlaceholder: ['Начална', 'Крайна'], locale: 'bg_BG', today: 'Днес', now: 'Сега', backToToday: 'Към днес', ok: 'Добре', clear: 'Изчистване', month: 'Месец', year: 'Година', timeSelect: 'Избор на час', dateSelect: 'Избор на дата', monthSelect: 'Избор на месец', yearSelect: 'Избор на година', decadeSelect: 'Десетилетие', yearFormat: 'YYYY', dateFormat: 'D M YYYY', dayFormat: 'D', dateTimeFormat: 'D M YYYY HH:mm:ss', monthBeforeYear: true, previousMonth: 'Предишен месец (PageUp)', nextMonth: 'Следващ месец (PageDown)', previousYear: 'Последна година (Control + left)', nextYear: 'Следваща година (Control + right)', previousDecade: 'Предишно десе