@sankhyalabs/ezui 6.4.2 → 6.5.0-dev.1
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/cjs/{ApplicationUtils-c9d1205c.js → ApplicationUtils-c1310a36.js} +43 -15
- package/dist/cjs/RichToolbarHelper-ea12328f.js +33 -0
- package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
- package/dist/cjs/app-globals-701e1cea.js +14 -0
- package/dist/cjs/{constants-569271bc.js → constants-72b7e05e.js} +0 -2
- package/dist/cjs/ez-actions-button.cjs.entry.js +3 -2
- package/dist/cjs/ez-alert-list.cjs.entry.js +6 -4
- package/dist/cjs/ez-alert.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-avatar.cjs.entry.js +11 -3
- package/dist/cjs/ez-badge.cjs.entry.js +1 -1
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +97 -27
- package/dist/cjs/ez-calendar.cjs.entry.js +8 -7
- package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-chart.cjs.entry.js +5 -20
- package/dist/cjs/ez-check.cjs.entry.js +2 -2
- package/dist/cjs/ez-chip.cjs.entry.js +52 -48
- package/dist/cjs/ez-classic-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +15 -12
- package/dist/cjs/{ez-combo-box-list_3.cjs.entry.js → ez-combo-box-list_4.cjs.entry.js} +292 -6
- package/dist/cjs/ez-combo-box.cjs.entry.js +11 -8
- package/dist/cjs/ez-date-input.cjs.entry.js +6 -2
- package/dist/cjs/ez-date-time-input.cjs.entry.js +6 -2
- package/dist/cjs/ez-dialog.cjs.entry.js +9 -7
- package/dist/cjs/ez-double-list.cjs.entry.js +13 -5
- package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/ez-empty-card.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +10 -7
- package/dist/cjs/ez-filter-input.cjs.entry.js +129 -0
- package/dist/cjs/ez-form-view.cjs.entry.js +12 -4
- package/dist/cjs/ez-form.cjs.entry.js +19 -16
- package/dist/cjs/ez-grid.cjs.entry.js +919 -242
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +6 -2
- package/dist/cjs/ez-icon.cjs.entry.js +2 -2
- package/dist/cjs/ez-link-builder_6.cjs.entry.js +315 -0
- package/dist/cjs/ez-list-item.cjs.entry.js +22 -0
- package/dist/cjs/ez-list.cjs.entry.js +5 -3
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +7 -3
- package/dist/cjs/ez-modal.cjs.entry.js +6 -2
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +10 -6
- package/dist/cjs/ez-number-input.cjs.entry.js +6 -2
- package/dist/cjs/ez-popover-core.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover-plus_3.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-rich-toolbar-item.cjs.entry.js +27 -0
- package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-search-plus.cjs.entry.js +10 -8
- package/dist/cjs/ez-search-result-list.cjs.entry.js +6 -3
- package/dist/cjs/ez-search.cjs.entry.js +9 -10
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +6 -8
- package/dist/cjs/ez-skeleton.cjs.entry.js +6 -4
- package/dist/cjs/ez-sortable-list.cjs.entry.js +13 -6
- package/dist/cjs/ez-spinner.cjs.entry.js +34 -0
- package/dist/cjs/ez-split-button.cjs.entry.js +6 -5
- package/dist/cjs/ez-split-item.cjs.entry.js +7 -3
- package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
- package/dist/cjs/ez-tag.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +35 -28
- package/dist/cjs/ez-text-input.cjs.entry.js +2 -1
- package/dist/cjs/ez-tile-medium.cjs.entry.js +1 -1
- package/dist/cjs/ez-tile.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +13 -11
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/{ez-filter-input_2.cjs.entry.js → ez-tooltip.cjs.entry.js} +2 -124
- package/dist/cjs/ez-tree.cjs.entry.js +41 -2
- package/dist/cjs/ez-underface.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +18 -12
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +6 -2
- package/dist/cjs/filter-column.cjs.entry.js +9 -5
- package/dist/cjs/{index-9e5554cb.js → index-a7b0c73d.js} +28 -11
- package/dist/cjs/index-b1103222.js +3693 -0
- package/dist/cjs/loader.cjs.js +6 -2
- package/dist/cjs/purify-0bd8a150.js +1359 -0
- package/dist/cjs/{search-column-1d3c9fa5.js → search-column-f53f33f6.js} +11 -9
- package/dist/collection/collection-manifest.json +12 -1
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +5 -3
- package/dist/collection/components/ez-avatar/ez-avatar.js +26 -2
- package/dist/collection/components/ez-button/ez-button.css +292 -80
- package/dist/collection/components/ez-button/ez-button.js +226 -29
- package/dist/collection/components/ez-calendar/ez-calendar.js +7 -6
- package/dist/collection/components/ez-check/ez-check.css +1 -1
- package/dist/collection/components/ez-chip/ez-chip.css +102 -83
- package/dist/collection/components/ez-chip/ez-chip.js +158 -53
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +1 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +12 -9
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +7 -4
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +28 -8
- package/dist/collection/components/ez-date-input/ez-date-input.js +5 -1
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +5 -1
- package/dist/collection/components/ez-dialog/ez-dialog.js +8 -6
- package/dist/collection/components/ez-double-list/ez-double-list.js +12 -4
- package/dist/collection/components/ez-file-item/ez-file-item.js +9 -6
- package/dist/collection/components/ez-form/ez-form.js +5 -3
- package/dist/collection/components/ez-form-view/ez-form-view.js +2 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +5 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/RichText.tpl.js +4 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +33 -9
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +4 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js +3 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/utils/buildLocaleText.js +67 -0
- package/dist/collection/components/ez-grid/ez-grid.js +17 -37
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +7 -3
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +2 -2
- package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js +11 -7
- package/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource.js +0 -3
- package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.js +5 -1
- package/dist/collection/components/ez-icon/ez-icon.css +1371 -161
- package/dist/collection/components/ez-list/ez-list.js +4 -2
- package/dist/collection/components/ez-list-item/ez-list-item.css +61 -0
- package/dist/collection/components/ez-list-item/ez-list-item.js +78 -0
- package/dist/collection/components/ez-modal/ez-modal.js +5 -1
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +2 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +5 -1
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +9 -5
- package/dist/collection/components/ez-number-input/ez-number-input.js +5 -1
- package/dist/collection/components/ez-rich-text/ez-link-builder/ez-link-builder.css +22 -0
- package/dist/collection/components/ez-rich-text/ez-link-builder/ez-link-builder.js +135 -0
- package/dist/collection/components/ez-rich-text/ez-rich-text.css +30 -0
- package/dist/collection/components/ez-rich-text/ez-rich-text.js +575 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/RichToolbarHelper.js +27 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-arrows/ez-rich-toolbar-arrows.css +4 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-arrows/ez-rich-toolbar-arrows.js +23 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-configs/ez-rich-toolbar-configs.css +4 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-configs/ez-rich-toolbar-configs.js +23 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-item/ez-rich-toolbar-item.css +20 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-item/ez-rich-toolbar-item.js +122 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-letters/ez-rich-toolbar-letters.css +4 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-letters/ez-rich-toolbar-letters.js +23 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar.css +42 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar.js +187 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/ez-simple-image-uploader.css +70 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/ez-simple-image-uploader.js +220 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/test/resource/imageBase64.js +1 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/utils/fileToBase64.js +14 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/utils/formatBytes.js +10 -0
- package/dist/collection/components/ez-search/ez-search.js +7 -8
- package/dist/collection/components/ez-search-plus/ez-search-plus.js +8 -6
- package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.js +5 -2
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.js +5 -2
- package/dist/collection/components/ez-skeleton/ez-skeleton.constants.js +0 -1
- package/dist/collection/components/ez-skeleton/ez-skeleton.js +4 -2
- package/dist/collection/components/ez-sortable-list/ez-sortable-list.js +15 -11
- package/dist/collection/components/ez-spinner/ez-spinner.css +76 -0
- package/dist/collection/components/ez-spinner/ez-spinner.js +57 -0
- package/dist/collection/components/ez-split-button/ez-split-button.js +6 -6
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +5 -1
- package/dist/collection/components/ez-text-area/ez-text-area.css +244 -212
- package/dist/collection/components/ez-text-area/ez-text-area.js +35 -28
- package/dist/collection/components/ez-text-edit/ez-text-edit.js +5 -1
- package/dist/collection/components/ez-text-input/ez-text-input.js +1 -0
- package/dist/collection/components/ez-time-input/ez-time-input.js +12 -10
- package/dist/collection/components/ez-tooltip/ez-tooltip.js +1 -1
- package/dist/collection/components/ez-tree/ez-tree.js +49 -1
- package/dist/collection/components/ez-tree/types/Tree.js +23 -0
- package/dist/collection/components/ez-upload/ez-upload.js +18 -12
- package/dist/collection/global/app-init.js +8 -0
- package/dist/collection/setupTests.js +1 -1
- package/dist/collection/utils/ApplicationUtils.js +43 -15
- package/dist/collection/utils/constants.js +0 -1
- package/dist/collection/utils/form/FormMetadata.js +3 -1
- package/dist/collection/utils/i18n/elanguages.js +6 -0
- package/dist/collection/utils/i18n/index.js +30 -0
- package/dist/collection/utils/i18n/locales/en-us.js +287 -0
- package/dist/collection/utils/i18n/locales/es-es.js +287 -0
- package/dist/collection/utils/i18n/locales/pt-br.js +287 -0
- package/dist/collection/utils/i18n/translations.js +9 -0
- package/dist/collection/utils/index.js +1 -1
- package/dist/collection/utils/searchColumn/search-column.js +0 -2
- package/dist/collection/utils/validators/recordvalidator/RecordValidationProcessor.js +8 -2
- package/dist/custom-elements/index.d.ts +60 -0
- package/dist/custom-elements/index.js +7124 -480
- package/dist/esm/{ApplicationUtils-eaf91331.js → ApplicationUtils-bda1789e.js} +43 -15
- package/dist/esm/RichToolbarHelper-f3a149c4.js +29 -0
- package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
- package/dist/esm/app-globals-bbd79783.js +12 -0
- package/dist/esm/{constants-b036528f.js → constants-3fabe81e.js} +1 -2
- package/dist/esm/ez-actions-button.entry.js +3 -2
- package/dist/esm/ez-alert-list.entry.js +6 -4
- package/dist/esm/ez-alert.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-avatar.entry.js +11 -3
- package/dist/esm/ez-badge.entry.js +1 -1
- package/dist/esm/ez-breadcrumb.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +97 -27
- package/dist/esm/ez-calendar.entry.js +8 -7
- package/dist/esm/ez-card-item.entry.js +1 -1
- package/dist/esm/ez-chart.entry.js +3 -18
- package/dist/esm/ez-check.entry.js +2 -2
- package/dist/esm/ez-chip.entry.js +52 -48
- package/dist/esm/ez-classic-combo-box.entry.js +1 -1
- package/dist/esm/ez-classic-input.entry.js +1 -1
- package/dist/esm/ez-classic-text-area.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +15 -12
- package/dist/esm/{ez-combo-box-list_3.entry.js → ez-combo-box-list_4.entry.js} +293 -8
- package/dist/esm/ez-combo-box.entry.js +11 -8
- package/dist/esm/ez-date-input.entry.js +6 -2
- package/dist/esm/ez-date-time-input.entry.js +6 -2
- package/dist/esm/ez-dialog.entry.js +9 -7
- package/dist/esm/ez-double-list.entry.js +13 -5
- package/dist/esm/ez-dropdown.entry.js +1 -1
- package/dist/esm/ez-empty-card.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +10 -7
- package/dist/esm/ez-filter-input.entry.js +125 -0
- package/dist/esm/ez-form-view.entry.js +12 -4
- package/dist/esm/ez-form.entry.js +9 -6
- package/dist/esm/ez-grid.entry.js +902 -225
- package/dist/esm/ez-guide-navigator.entry.js +6 -2
- package/dist/esm/ez-icon.entry.js +2 -2
- package/dist/esm/ez-link-builder_6.entry.js +306 -0
- package/dist/esm/ez-list-item.entry.js +18 -0
- package/dist/esm/ez-list.entry.js +5 -3
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +7 -3
- package/dist/esm/ez-modal.entry.js +6 -2
- package/dist/esm/ez-multi-selection-list.entry.js +10 -6
- package/dist/esm/ez-number-input.entry.js +6 -2
- package/dist/esm/ez-popover-core.entry.js +1 -1
- package/dist/esm/ez-popover-plus_3.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-progress-bar.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-rich-toolbar-item.entry.js +23 -0
- package/dist/esm/ez-scroller_2.entry.js +1 -1
- package/dist/esm/ez-search-plus.entry.js +10 -8
- package/dist/esm/ez-search-result-list.entry.js +6 -3
- package/dist/esm/ez-search.entry.js +9 -10
- package/dist/esm/ez-sidebar-navigator.entry.js +6 -8
- package/dist/esm/ez-skeleton.entry.js +6 -4
- package/dist/esm/ez-sortable-list.entry.js +13 -6
- package/dist/esm/ez-spinner.entry.js +30 -0
- package/dist/esm/ez-split-button.entry.js +6 -5
- package/dist/esm/ez-split-item.entry.js +7 -3
- package/dist/esm/ez-split-panel.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-tag.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +35 -28
- package/dist/esm/ez-text-input.entry.js +2 -1
- package/dist/esm/ez-tile-medium.entry.js +1 -1
- package/dist/esm/ez-tile.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +13 -11
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/{ez-filter-input_2.entry.js → ez-tooltip.entry.js} +3 -124
- package/dist/esm/ez-tree.entry.js +41 -2
- package/dist/esm/ez-underface.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +18 -12
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +7 -3
- package/dist/esm/filter-column.entry.js +9 -5
- package/dist/esm/{index-5a720e56.js → index-baa5e267.js} +29 -11
- package/dist/esm/index-d5042cb2.js +3690 -0
- package/dist/esm/loader.js +7 -3
- package/dist/esm/purify-34e6ff6f.js +1357 -0
- package/dist/esm/{search-column-35f4ad93.js → search-column-9a00bd0b.js} +11 -7
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-01bd20e4.entry.js +1 -0
- package/dist/ezui/p-0629f64b.entry.js +1 -0
- package/dist/ezui/p-07a6c41e.entry.js +1 -0
- package/dist/ezui/p-0ab05249.entry.js +1 -0
- package/dist/ezui/p-112455b1.js +1 -0
- package/dist/ezui/p-15a5d68c.entry.js +1 -0
- package/dist/ezui/{p-81461d2f.entry.js → p-1e7a8633.entry.js} +1 -1
- package/dist/ezui/{p-6b51c9cc.entry.js → p-1f50fa05.entry.js} +1 -1
- package/dist/ezui/p-200b0745.entry.js +1 -0
- package/dist/ezui/p-20c024f7.entry.js +1 -0
- package/dist/ezui/{p-e4c7eb39.js → p-23a36bb6.js} +2 -2
- package/dist/ezui/p-25371eb3.entry.js +1 -0
- package/dist/ezui/{p-06f1b8e4.entry.js → p-288631d1.entry.js} +1 -1
- package/dist/ezui/p-2e6c767f.entry.js +1 -0
- package/dist/ezui/p-2f01f656.entry.js +1 -0
- package/dist/ezui/p-3005b0ec.entry.js +1 -0
- package/dist/ezui/p-37bd03db.entry.js +1 -0
- package/dist/ezui/{p-06ed5e57.entry.js → p-3bf7f94b.entry.js} +1 -1
- package/dist/ezui/p-3e767a74.js +1 -0
- package/dist/ezui/p-3eb7bf6f.entry.js +1 -0
- package/dist/ezui/{p-0378416a.entry.js → p-44caad9a.entry.js} +1 -1
- package/dist/ezui/{p-570cf58a.entry.js → p-48effc69.entry.js} +1 -1
- package/dist/ezui/p-4beae367.entry.js +1 -0
- package/dist/ezui/{p-4a876b8b.entry.js → p-4d30b703.entry.js} +1 -1
- package/dist/ezui/p-4fd1d098.entry.js +1 -0
- package/dist/ezui/p-53bc30a1.entry.js +1 -0
- package/dist/ezui/{p-6fc26622.entry.js → p-5ed81457.entry.js} +1 -1
- package/dist/ezui/{p-3234f883.entry.js → p-603ef267.entry.js} +1 -1
- package/dist/ezui/p-6369a0cd.entry.js +1 -0
- package/dist/ezui/p-6aa843bd.entry.js +1 -0
- package/dist/ezui/{p-0b531233.entry.js → p-6d596a5a.entry.js} +1 -1
- package/dist/ezui/p-6f77a359.entry.js +1 -0
- package/dist/ezui/p-732f7790.js +1 -0
- package/dist/ezui/p-78436126.entry.js +1 -0
- package/dist/ezui/p-79044c3e.entry.js +1 -0
- package/dist/ezui/p-7e535712.entry.js +1 -0
- package/dist/ezui/{p-5b85d3de.entry.js → p-7f792043.entry.js} +1 -1
- package/dist/ezui/{p-b7c6ce20.entry.js → p-7fe97ef5.entry.js} +1 -1
- package/dist/ezui/p-8d90530b.entry.js +1 -0
- package/dist/ezui/{p-82fa4b09.entry.js → p-8df1ca33.entry.js} +1 -1
- package/dist/ezui/p-90cece02.entry.js +1 -0
- package/dist/ezui/p-91c9d50e.entry.js +1 -0
- package/dist/ezui/{p-05e68ab3.entry.js → p-93e1c917.entry.js} +1 -1
- package/dist/ezui/p-946c1c66.entry.js +1 -0
- package/dist/ezui/{p-d3779449.entry.js → p-9b2e6438.entry.js} +1 -1
- package/dist/ezui/{p-18e71523.entry.js → p-9c5cd3b2.entry.js} +1 -1
- package/dist/ezui/p-9ce9e8b7.entry.js +309 -0
- package/dist/ezui/{p-c2b20f78.entry.js → p-9f5fa3f9.entry.js} +1 -1
- package/dist/ezui/p-a029afd0.entry.js +1 -0
- package/dist/ezui/{p-9bcfa689.entry.js → p-a3075f52.entry.js} +1 -1
- package/dist/ezui/{p-f26b97e9.entry.js → p-a3ada561.entry.js} +1 -1
- package/dist/ezui/p-a738e919.entry.js +1 -0
- package/dist/ezui/{p-dfca5946.entry.js → p-a80b1287.entry.js} +1 -1
- package/dist/ezui/p-b1e39171.entry.js +1 -0
- package/dist/ezui/p-b1e45320.js +1 -0
- package/dist/ezui/p-b21fc2d3.entry.js +1 -0
- package/dist/ezui/p-bc2f844e.entry.js +1 -0
- package/dist/ezui/{p-92748142.entry.js → p-c0d9c4f8.entry.js} +1 -1
- package/dist/ezui/p-c8067ed6.entry.js +1 -0
- package/dist/ezui/p-c84aa65f.entry.js +1 -0
- package/dist/ezui/p-ca36ac0a.entry.js +1 -0
- package/dist/ezui/p-cb46afc5.js +1 -0
- package/dist/ezui/p-d2364956.js +3 -0
- package/dist/ezui/{p-c96e536d.entry.js → p-d2645bdf.entry.js} +1 -1
- package/dist/ezui/p-d6742c1e.entry.js +1 -0
- package/dist/ezui/{p-770cf2b8.entry.js → p-d6f50207.entry.js} +1 -1
- package/dist/ezui/p-d8cc640d.entry.js +1 -0
- package/dist/ezui/p-dd0613fd.entry.js +1 -0
- package/dist/ezui/p-dee18824.entry.js +1 -0
- package/dist/ezui/p-e085c7f4.entry.js +1 -0
- package/dist/ezui/p-e33be0f9.entry.js +1 -0
- package/dist/ezui/p-e577d4fe.entry.js +1 -0
- package/dist/ezui/{p-000159dc.entry.js → p-e75c7a23.entry.js} +1 -1
- package/dist/ezui/p-e7a7c594.entry.js +1 -0
- package/dist/ezui/p-ef33aaac.js +1 -0
- package/dist/ezui/p-f8a5538b.entry.js +1 -0
- package/dist/ezui/{p-44b39e81.entry.js → p-fa6732f2.entry.js} +1 -1
- package/dist/ezui/p-fa6cff27.entry.js +1 -0
- package/dist/ezui/p-fac16755.js +1 -0
- package/dist/ezui/p-fcdc7d0b.entry.js +1 -0
- package/dist/ezui/p-feb22018.entry.js +7 -0
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +2 -1
- package/dist/types/components/ez-avatar/ez-avatar.d.ts +5 -0
- package/dist/types/components/ez-button/ez-button.d.ts +48 -2
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +2 -3
- package/dist/types/components/ez-chip/ez-chip.d.ts +32 -6
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +2 -0
- package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +2 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +6 -2
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +2 -0
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +2 -0
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +2 -2
- package/dist/types/components/ez-double-list/ez-double-list.d.ts +2 -0
- package/dist/types/components/ez-file-item/ez-file-item.d.ts +2 -0
- package/dist/types/components/ez-form/ez-form.d.ts +1 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/RichText.tpl.d.ts +2 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +5 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +2 -0
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/utils/buildLocaleText.d.ts +66 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +2 -3
- package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +2 -0
- package/dist/types/components/ez-grid/subcomponents/selection-counter.d.ts +2 -0
- package/dist/types/components/ez-grid/subcomponents/utils/selectionCounterUtils.d.ts +2 -2
- package/dist/types/components/ez-grid/utils/InMemoryFilterColumnDataSource.d.ts +0 -1
- package/dist/types/components/ez-guide-navigator/ez-guide-navigator.d.ts +2 -0
- package/dist/types/components/ez-list/ez-list.d.ts +2 -1
- package/dist/types/components/ez-list-item/ez-list-item.d.ts +9 -0
- package/dist/types/components/ez-modal/ez-modal.d.ts +2 -0
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +2 -0
- package/dist/types/components/ez-multi-selection-list/ez-multi-selection-list.d.ts +2 -0
- package/dist/types/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource.d.ts +0 -1
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +2 -0
- package/dist/types/components/ez-rich-text/ez-link-builder/ez-link-builder.d.ts +19 -0
- package/dist/types/components/ez-rich-text/ez-rich-text.d.ts +105 -0
- package/dist/types/components/ez-rich-text/ez-rich-toolbar/RichToolbarHelper.d.ts +31 -0
- package/dist/types/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-arrows/ez-rich-toolbar-arrows.d.ts +5 -0
- package/dist/types/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-configs/ez-rich-toolbar-configs.d.ts +5 -0
- package/dist/types/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-item/ez-rich-toolbar-item.d.ts +11 -0
- package/dist/types/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-letters/ez-rich-toolbar-letters.d.ts +5 -0
- package/dist/types/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar.d.ts +35 -0
- package/dist/types/components/ez-rich-text/ez-simple-image-uploader/ez-simple-image-uploader.d.ts +39 -0
- package/dist/types/components/ez-rich-text/ez-simple-image-uploader/test/resource/imageBase64.d.ts +1 -0
- package/dist/types/components/ez-rich-text/ez-simple-image-uploader/utils/fileToBase64.d.ts +1 -0
- package/dist/types/components/ez-rich-text/ez-simple-image-uploader/utils/formatBytes.d.ts +1 -0
- package/dist/types/components/ez-search/ez-search.d.ts +2 -3
- package/dist/types/components/ez-search-plus/ez-search-plus.d.ts +2 -1
- package/dist/types/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.d.ts +2 -1
- package/dist/types/components/ez-sidebar-navigator/ez-sidebar-navigator.d.ts +2 -0
- package/dist/types/components/ez-skeleton/ez-skeleton.constants.d.ts +0 -1
- package/dist/types/components/ez-skeleton/ez-skeleton.d.ts +2 -1
- package/dist/types/components/ez-sortable-list/ez-sortable-list.d.ts +2 -0
- package/dist/types/components/ez-spinner/ez-spinner.d.ts +10 -0
- package/dist/types/components/ez-split-button/ez-split-button.d.ts +2 -2
- package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +2 -0
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +6 -3
- package/dist/types/components/ez-text-edit/ez-text-edit.d.ts +2 -0
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +2 -1
- package/dist/types/components/ez-tree/ez-tree.d.ts +10 -0
- package/dist/types/components/ez-tree/types/Tree.d.ts +3 -0
- package/dist/types/components/ez-upload/ez-upload.d.ts +3 -1
- package/dist/types/components.d.ts +479 -5
- package/dist/types/global/app-init.d.ts +1 -0
- package/dist/types/utils/ApplicationUtils.d.ts +3 -1
- package/dist/types/utils/constants.d.ts +0 -1
- package/dist/types/utils/i18n/elanguages.d.ts +5 -0
- package/dist/types/utils/i18n/index.d.ts +5 -0
- package/dist/types/utils/i18n/locales/en-us.d.ts +288 -0
- package/dist/types/utils/i18n/locales/es-es.d.ts +288 -0
- package/dist/types/utils/i18n/locales/pt-br.d.ts +288 -0
- package/dist/types/utils/i18n/translations.d.ts +864 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/searchColumn/search-column.d.ts +0 -2
- package/dist/types/utils/validators/recordvalidator/RecordValidationProcessor.d.ts +1 -0
- package/package.json +11 -3
- package/react/components.d.ts +10 -0
- package/react/components.js +10 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ApplicationUtils-c9d1205c.js.gz +0 -0
- package/dist/cjs/CSSVarsUtils-f20973d1.js.gz +0 -0
- package/dist/cjs/CheckMode-ecb90b87.js.gz +0 -0
- package/dist/cjs/DialogType-2114c337.js.gz +0 -0
- package/dist/cjs/EzScrollDirection-b2c99895.js.gz +0 -0
- package/dist/cjs/FocusResolver-885f2173.js.gz +0 -0
- package/dist/cjs/FormLayout-18853e70.js.gz +0 -0
- package/dist/cjs/constants-569271bc.js.gz +0 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-alert-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-alert.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-application.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-avatar.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-badge.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-breadcrumb.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-button.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-calendar.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-card-item.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-chart.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-check.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-chip.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-classic-combo-box.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-classic-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-classic-text-area.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-collapsible-box.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-combo-box-list_3.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-date-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-date-time-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-dialog.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-double-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-dropdown.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-empty-card.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-file-item.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-filter-input_2.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-form-view.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-form.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-grid.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-guide-navigator.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-icon.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-loading-bar.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-modal-container.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-modal.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-number-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-popover-core.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-popover-plus_3.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-popover.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-popup.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-progress-bar.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-radio-button.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-scroller_2.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-search-plus.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-search-result-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-search.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-skeleton.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-sortable-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-split-button.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-split-item.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-split-panel.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tabselector.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tag.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-text-area.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-text-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tile-medium.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tile.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-time-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-toast.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tree.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-underface.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-upload.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-view-stack.cjs.entry.js.gz +0 -0
- package/dist/cjs/ezListHelper-0d3970b4.js.gz +0 -0
- package/dist/cjs/ezui.cjs.js.gz +0 -0
- package/dist/cjs/filter-column.cjs.entry.js.gz +0 -0
- package/dist/cjs/floating-ui.dom.esm-017acce4.js.gz +0 -0
- package/dist/cjs/index-9e5554cb.js.gz +0 -0
- package/dist/cjs/index.cjs.js.gz +0 -0
- package/dist/cjs/loader.cjs.js.gz +0 -0
- package/dist/cjs/search-column-1d3c9fa5.js.gz +0 -0
- package/dist/cjs/searchFormatters-b7e1ed1e.js.gz +0 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.css.gz +0 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.js.gz +0 -0
- package/dist/collection/components/ez-alert/ez-alert.css.gz +0 -0
- package/dist/collection/components/ez-alert/ez-alert.js.gz +0 -0
- package/dist/collection/components/ez-alert-list/ez-alert-list.css.gz +0 -0
- package/dist/collection/components/ez-alert-list/ez-alert-list.js.gz +0 -0
- package/dist/collection/components/ez-application/ez-application.css.gz +0 -0
- package/dist/collection/components/ez-application/ez-application.js.gz +0 -0
- package/dist/collection/components/ez-avatar/ez-avatar.css.gz +0 -0
- package/dist/collection/components/ez-avatar/ez-avatar.js.gz +0 -0
- package/dist/collection/components/ez-badge/enum/sizes.js.gz +0 -0
- package/dist/collection/components/ez-badge/ez-badge.css.gz +0 -0
- package/dist/collection/components/ez-badge/ez-badge.js.gz +0 -0
- package/dist/collection/components/ez-badge/interfaces/IPosition.js.gz +0 -0
- package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.css.gz +0 -0
- package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.js.gz +0 -0
- package/dist/collection/components/ez-breadcrumb/subcomponents/breadcrumb-item.js.gz +0 -0
- package/dist/collection/components/ez-button/ez-button.css.gz +0 -0
- package/dist/collection/components/ez-button/ez-button.js.gz +0 -0
- package/dist/collection/components/ez-calendar/ez-calendar.css.gz +0 -0
- package/dist/collection/components/ez-calendar/ez-calendar.js.gz +0 -0
- package/dist/collection/components/ez-card-item/ez-card-item.css.gz +0 -0
- package/dist/collection/components/ez-card-item/ez-card-item.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/BarChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/ColumnChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/DonutChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/LineChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/PieChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/index.js.gz +0 -0
- package/dist/collection/components/ez-chart/ez-chart.css.gz +0 -0
- package/dist/collection/components/ez-chart/ez-chart.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartAxis.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartContext.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartOptions.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartSerie.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartStrategies.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartType.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartTypeValue.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-chart/test/mock-chart.js.gz +0 -0
- package/dist/collection/components/ez-chart/types/BaseHighChartsRender.js.gz +0 -0
- package/dist/collection/components/ez-check/CheckMode.js.gz +0 -0
- package/dist/collection/components/ez-check/ez-check.css.gz +0 -0
- package/dist/collection/components/ez-check/ez-check.js.gz +0 -0
- package/dist/collection/components/ez-chip/ez-chip.css.gz +0 -0
- package/dist/collection/components/ez-chip/ez-chip.js.gz +0 -0
- package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.css.gz +0 -0
- package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.js.gz +0 -0
- package/dist/collection/components/ez-classic-combo-box/interfaces/IOption.js.gz +0 -0
- package/dist/collection/components/ez-classic-input/ez-classic-input.css.gz +0 -0
- package/dist/collection/components/ez-classic-input/ez-classic-input.js.gz +0 -0
- package/dist/collection/components/ez-classic-input/interfaces/optionsSetFocus.js.gz +0 -0
- package/dist/collection/components/ez-classic-input/utils/maskFormatter.js.gz +0 -0
- package/dist/collection/components/ez-classic-text-area/ez-classic-text-area.css.gz +0 -0
- package/dist/collection/components/ez-classic-text-area/ez-classic-text-area.js.gz +0 -0
- package/dist/collection/components/ez-classic-text-area/interfaces/optionsSetFocus.js.gz +0 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css.gz +0 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js.gz +0 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css.gz +0 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js.gz +0 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css.gz +0 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js.gz +0 -0
- package/dist/collection/components/ez-date-input/ez-date-input.css.gz +0 -0
- package/dist/collection/components/ez-date-input/ez-date-input.js.gz +0 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.css.gz +0 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js.gz +0 -0
- package/dist/collection/components/ez-dialog/DialogType.js.gz +0 -0
- package/dist/collection/components/ez-dialog/ez-dialog.css.gz +0 -0
- package/dist/collection/components/ez-dialog/ez-dialog.js.gz +0 -0
- package/dist/collection/components/ez-double-list/doubleListHelper.js.gz +0 -0
- package/dist/collection/components/ez-double-list/ez-double-list.css.gz +0 -0
- package/dist/collection/components/ez-double-list/ez-double-list.js.gz +0 -0
- package/dist/collection/components/ez-dropdown/ez-dropdown.css.gz +0 -0
- package/dist/collection/components/ez-dropdown/ez-dropdown.js.gz +0 -0
- package/dist/collection/components/ez-dropdown/structure/DropdownItem.js.gz +0 -0
- package/dist/collection/components/ez-dropdown/structure/SubmenuControl.js.gz +0 -0
- package/dist/collection/components/ez-empty-card/ez-empty-card.css.gz +0 -0
- package/dist/collection/components/ez-empty-card/ez-empty-card.js.gz +0 -0
- package/dist/collection/components/ez-file-item/ez-file-item.css.gz +0 -0
- package/dist/collection/components/ez-file-item/ez-file-item.js.gz +0 -0
- package/dist/collection/components/ez-filter-input/ez-filter-input.css.gz +0 -0
- package/dist/collection/components/ez-filter-input/ez-filter-input.js.gz +0 -0
- package/dist/collection/components/ez-form/ez-form.css.gz +0 -0
- package/dist/collection/components/ez-form/ez-form.js.gz +0 -0
- package/dist/collection/components/ez-form/store/form.slice.js.gz +0 -0
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js.gz +0 -0
- package/dist/collection/components/ez-form-view/ez-form-view.css.gz +0 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/interfaces/IFormViewField.js.gz +0 -0
- package/dist/collection/components/ez-form-view/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-form-view/structure/index.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/EzGridController.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSourceInterceptor.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/cellRendererStatus.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/selectionHeader.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/GridEditorUtils.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IEditorMetadata.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellEditor.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/SearchPlus.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/i18n/pt-BR.js +0 -75
- package/dist/collection/components/ez-grid/controller/ag-grid/i18n/pt-BR.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/mock/Server.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js.gz +0 -0
- package/dist/collection/components/ez-grid/ez-grid.css.gz +0 -0
- package/dist/collection/components/ez-grid/ez-grid.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/IColumnFilter.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/IGridMode.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/ISelection.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/ISelectionToastConfig.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-grid/subcomponents/filter-column.css.gz +0 -0
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js.gz +0 -0
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js.gz +0 -0
- package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js.gz +0 -0
- package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js.gz +0 -0
- package/dist/collection/components/ez-grid/utils/ColumnFilterManager.js.gz +0 -0
- package/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource.js.gz +0 -0
- package/dist/collection/components/ez-grid/utils/index.js.gz +0 -0
- package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.css.gz +0 -0
- package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.js.gz +0 -0
- package/dist/collection/components/ez-guide-navigator/interfaces/IGuideItem.js.gz +0 -0
- package/dist/collection/components/ez-guide-navigator/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-icon/ez-icon.css.gz +0 -0
- package/dist/collection/components/ez-icon/ez-icon.js.gz +0 -0
- package/dist/collection/components/ez-list/ez-list.css.gz +0 -0
- package/dist/collection/components/ez-list/ez-list.js.gz +0 -0
- package/dist/collection/components/ez-list/ezListHelper.js.gz +0 -0
- package/dist/collection/components/ez-loading-bar/ez-loading-bar.css.gz +0 -0
- package/dist/collection/components/ez-loading-bar/ez-loading-bar.js.gz +0 -0
- package/dist/collection/components/ez-modal/ez-modal.css.gz +0 -0
- package/dist/collection/components/ez-modal/ez-modal.js.gz +0 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.css.gz +0 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js.gz +0 -0
- package/dist/collection/components/ez-modal-container/index.js.gz +0 -0
- package/dist/collection/components/ez-modal-container/modal-action.js.gz +0 -0
- package/dist/collection/components/ez-modal-container/modal-button-status.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/interfaces/IMultiSelectionOption.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/interfaces/IStaticOptionsFetchConfig.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.css.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.js.gz +0 -0
- package/dist/collection/components/ez-number-input/ez-number-input.css.gz +0 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js.gz +0 -0
- package/dist/collection/components/ez-popover/ez-popover.css.gz +0 -0
- package/dist/collection/components/ez-popover/ez-popover.js.gz +0 -0
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.css.gz +0 -0
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js.gz +0 -0
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css.gz +0 -0
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js.gz +0 -0
- package/dist/collection/components/ez-popup/ez-popup.css.gz +0 -0
- package/dist/collection/components/ez-popup/ez-popup.js.gz +0 -0
- package/dist/collection/components/ez-progress-bar/ez-progress-bar.css.gz +0 -0
- package/dist/collection/components/ez-progress-bar/ez-progress-bar.js.gz +0 -0
- package/dist/collection/components/ez-radio-button/ez-radio-button.css.gz +0 -0
- package/dist/collection/components/ez-radio-button/ez-radio-button.js.gz +0 -0
- package/dist/collection/components/ez-scroller/EzScrollDirection.js.gz +0 -0
- package/dist/collection/components/ez-scroller/ez-scroller.css.gz +0 -0
- package/dist/collection/components/ez-scroller/ez-scroller.js.gz +0 -0
- package/dist/collection/components/ez-search/ez-search.css.gz +0 -0
- package/dist/collection/components/ez-search/ez-search.js.gz +0 -0
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.css.gz +0 -0
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.js.gz +0 -0
- package/dist/collection/components/ez-search/utils/searchFormatters.js.gz +0 -0
- package/dist/collection/components/ez-search-plus/ez-search-plus.css.gz +0 -0
- package/dist/collection/components/ez-search-plus/ez-search-plus.js.gz +0 -0
- package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.css.gz +0 -0
- package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css.gz +0 -0
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/messages/constants.js +0 -5
- package/dist/collection/components/ez-sidebar-navigator/messages/constants.js.gz +0 -0
- package/dist/collection/components/ez-skeleton/ez-skeleton.constants.js.gz +0 -0
- package/dist/collection/components/ez-skeleton/ez-skeleton.css.gz +0 -0
- package/dist/collection/components/ez-skeleton/ez-skeleton.js.gz +0 -0
- package/dist/collection/components/ez-sortable-list/ez-sortable-list.css.gz +0 -0
- package/dist/collection/components/ez-sortable-list/ez-sortable-list.js.gz +0 -0
- package/dist/collection/components/ez-split-button/ez-split-button.css.gz +0 -0
- package/dist/collection/components/ez-split-button/ez-split-button.js.gz +0 -0
- package/dist/collection/components/ez-split-button/test/dropdownItems.js.gz +0 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.css.gz +0 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.js.gz +0 -0
- package/dist/collection/components/ez-split-panel/interfaces/IPanelSizeInfo.js.gz +0 -0
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css.gz +0 -0
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js.gz +0 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.css.gz +0 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.js.gz +0 -0
- package/dist/collection/components/ez-tag/ez-tag.css.gz +0 -0
- package/dist/collection/components/ez-tag/ez-tag.js.gz +0 -0
- package/dist/collection/components/ez-text-area/ez-text-area.css.gz +0 -0
- package/dist/collection/components/ez-text-area/ez-text-area.js.gz +0 -0
- package/dist/collection/components/ez-text-edit/ez-text-edit.css.gz +0 -0
- package/dist/collection/components/ez-text-edit/ez-text-edit.js.gz +0 -0
- package/dist/collection/components/ez-text-input/ez-text-input.css.gz +0 -0
- package/dist/collection/components/ez-text-input/ez-text-input.js.gz +0 -0
- package/dist/collection/components/ez-tile/ez-tile.css.gz +0 -0
- package/dist/collection/components/ez-tile/ez-tile.js.gz +0 -0
- package/dist/collection/components/ez-tile-medium/ez-tile-medium.css.gz +0 -0
- package/dist/collection/components/ez-tile-medium/ez-tile-medium.js.gz +0 -0
- package/dist/collection/components/ez-time-input/ez-time-input.css.gz +0 -0
- package/dist/collection/components/ez-time-input/ez-time-input.js.gz +0 -0
- package/dist/collection/components/ez-toast/ez-toast.css.gz +0 -0
- package/dist/collection/components/ez-toast/ez-toast.js.gz +0 -0
- package/dist/collection/components/ez-tooltip/ez-tooltip.css.gz +0 -0
- package/dist/collection/components/ez-tooltip/ez-tooltip.js.gz +0 -0
- package/dist/collection/components/ez-tree/ez-tree.css.gz +0 -0
- package/dist/collection/components/ez-tree/ez-tree.js.gz +0 -0
- package/dist/collection/components/ez-tree/interfaces/ITree.js.gz +0 -0
- package/dist/collection/components/ez-tree/interfaces/ITreeItem.js.gz +0 -0
- package/dist/collection/components/ez-tree/interfaces/ITreeItemBadge.js.gz +0 -0
- package/dist/collection/components/ez-tree/subcomponents/DefaultIconResolver.js.gz +0 -0
- package/dist/collection/components/ez-tree/subcomponents/DefaultTooltipResolver.js.gz +0 -0
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js.gz +0 -0
- package/dist/collection/components/ez-tree/subcomponents/index.js.gz +0 -0
- package/dist/collection/components/ez-tree/types/Node.js.gz +0 -0
- package/dist/collection/components/ez-tree/types/Tree.js.gz +0 -0
- package/dist/collection/components/ez-underface/ez-underface.css.gz +0 -0
- package/dist/collection/components/ez-underface/ez-underface.js.gz +0 -0
- package/dist/collection/components/ez-upload/RemoteFile.js.gz +0 -0
- package/dist/collection/components/ez-upload/ez-upload.css.gz +0 -0
- package/dist/collection/components/ez-upload/ez-upload.js.gz +0 -0
- package/dist/collection/components/ez-view-stack/ez-view-stack.css.gz +0 -0
- package/dist/collection/components/ez-view-stack/ez-view-stack.js.gz +0 -0
- package/dist/collection/index.js.gz +0 -0
- package/dist/collection/servidor.js.gz +0 -0
- package/dist/collection/setupTests.js.gz +0 -0
- package/dist/collection/sw.js.gz +0 -0
- package/dist/collection/utils/ApplicationUtils.js.gz +0 -0
- package/dist/collection/utils/AssetsUtils.js.gz +0 -0
- package/dist/collection/utils/CSSVarsUtils.js.gz +0 -0
- package/dist/collection/utils/FocusResolver.js.gz +0 -0
- package/dist/collection/utils/ag-grid-license.js.gz +0 -0
- package/dist/collection/utils/constants.js.gz +0 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js.gz +0 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js.gz +0 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRender.js.gz +0 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js.gz +0 -0
- package/dist/collection/utils/form/DataBinder.js.gz +0 -0
- package/dist/collection/utils/form/FormMetadata.js.gz +0 -0
- package/dist/collection/utils/form/index.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/FormLayout.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/IDefaultConfig.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/IFormCardConfig.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/IFormConfig.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/IFormSheetMetadata.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/ISummaryField.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/ITabConfig.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/index.js.gz +0 -0
- package/dist/collection/utils/form/test/DataBinder.test.js.gz +0 -0
- package/dist/collection/utils/form/test/resources/metadataTest.js.gz +0 -0
- package/dist/collection/utils/index.js.gz +0 -0
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js.gz +0 -0
- package/dist/collection/utils/interfaces/IAction.js.gz +0 -0
- package/dist/collection/utils/interfaces/IFieldConfig.js.gz +0 -0
- package/dist/collection/utils/mock/ez-upload-mock.js.gz +0 -0
- package/dist/collection/utils/search/types.js.gz +0 -0
- package/dist/collection/utils/searchColumn/search-column.js.gz +0 -0
- package/dist/collection/utils/utils.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IInvalidCells.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IInvalidField.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IRecordValidator.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IValidationResult.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IValidationSource.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/RecordValidationProcessor.js.gz +0 -0
- package/dist/custom-elements/index.js.gz +0 -0
- package/dist/esm/ApplicationUtils-eaf91331.js.gz +0 -0
- package/dist/esm/CSSVarsUtils-acba92d7.js.gz +0 -0
- package/dist/esm/CheckMode-bdb2ec19.js.gz +0 -0
- package/dist/esm/DialogType-54a62731.js.gz +0 -0
- package/dist/esm/EzScrollDirection-2df26c93.js.gz +0 -0
- package/dist/esm/FocusResolver-1ccbf850.js.gz +0 -0
- package/dist/esm/FormLayout-071d324c.js.gz +0 -0
- package/dist/esm/constants-b036528f.js.gz +0 -0
- package/dist/esm/ez-actions-button.entry.js.gz +0 -0
- package/dist/esm/ez-alert-list.entry.js.gz +0 -0
- package/dist/esm/ez-alert.entry.js.gz +0 -0
- package/dist/esm/ez-application.entry.js.gz +0 -0
- package/dist/esm/ez-avatar.entry.js.gz +0 -0
- package/dist/esm/ez-badge.entry.js.gz +0 -0
- package/dist/esm/ez-breadcrumb.entry.js.gz +0 -0
- package/dist/esm/ez-button.entry.js.gz +0 -0
- package/dist/esm/ez-calendar.entry.js.gz +0 -0
- package/dist/esm/ez-card-item.entry.js.gz +0 -0
- package/dist/esm/ez-chart.entry.js.gz +0 -0
- package/dist/esm/ez-check.entry.js.gz +0 -0
- package/dist/esm/ez-chip.entry.js.gz +0 -0
- package/dist/esm/ez-classic-combo-box.entry.js.gz +0 -0
- package/dist/esm/ez-classic-input.entry.js.gz +0 -0
- package/dist/esm/ez-classic-text-area.entry.js.gz +0 -0
- package/dist/esm/ez-collapsible-box.entry.js.gz +0 -0
- package/dist/esm/ez-combo-box-list_3.entry.js.gz +0 -0
- package/dist/esm/ez-combo-box.entry.js.gz +0 -0
- package/dist/esm/ez-date-input.entry.js.gz +0 -0
- package/dist/esm/ez-date-time-input.entry.js.gz +0 -0
- package/dist/esm/ez-dialog.entry.js.gz +0 -0
- package/dist/esm/ez-double-list.entry.js.gz +0 -0
- package/dist/esm/ez-dropdown.entry.js.gz +0 -0
- package/dist/esm/ez-empty-card.entry.js.gz +0 -0
- package/dist/esm/ez-file-item.entry.js.gz +0 -0
- package/dist/esm/ez-filter-input_2.entry.js.gz +0 -0
- package/dist/esm/ez-form-view.entry.js.gz +0 -0
- package/dist/esm/ez-form.entry.js.gz +0 -0
- package/dist/esm/ez-grid.entry.js.gz +0 -0
- package/dist/esm/ez-guide-navigator.entry.js.gz +0 -0
- package/dist/esm/ez-icon.entry.js.gz +0 -0
- package/dist/esm/ez-list.entry.js.gz +0 -0
- package/dist/esm/ez-loading-bar.entry.js.gz +0 -0
- package/dist/esm/ez-modal-container.entry.js.gz +0 -0
- package/dist/esm/ez-modal.entry.js.gz +0 -0
- package/dist/esm/ez-multi-selection-list.entry.js.gz +0 -0
- package/dist/esm/ez-number-input.entry.js.gz +0 -0
- package/dist/esm/ez-popover-core.entry.js.gz +0 -0
- package/dist/esm/ez-popover-plus_3.entry.js.gz +0 -0
- package/dist/esm/ez-popover.entry.js.gz +0 -0
- package/dist/esm/ez-popup.entry.js.gz +0 -0
- package/dist/esm/ez-progress-bar.entry.js.gz +0 -0
- package/dist/esm/ez-radio-button.entry.js.gz +0 -0
- package/dist/esm/ez-scroller_2.entry.js.gz +0 -0
- package/dist/esm/ez-search-plus.entry.js.gz +0 -0
- package/dist/esm/ez-search-result-list.entry.js.gz +0 -0
- package/dist/esm/ez-search.entry.js.gz +0 -0
- package/dist/esm/ez-sidebar-navigator.entry.js.gz +0 -0
- package/dist/esm/ez-skeleton.entry.js.gz +0 -0
- package/dist/esm/ez-sortable-list.entry.js.gz +0 -0
- package/dist/esm/ez-split-button.entry.js.gz +0 -0
- package/dist/esm/ez-split-item.entry.js.gz +0 -0
- package/dist/esm/ez-split-panel.entry.js.gz +0 -0
- package/dist/esm/ez-tabselector.entry.js.gz +0 -0
- package/dist/esm/ez-tag.entry.js.gz +0 -0
- package/dist/esm/ez-text-area.entry.js.gz +0 -0
- package/dist/esm/ez-text-input.entry.js.gz +0 -0
- package/dist/esm/ez-tile-medium.entry.js.gz +0 -0
- package/dist/esm/ez-tile.entry.js.gz +0 -0
- package/dist/esm/ez-time-input.entry.js.gz +0 -0
- package/dist/esm/ez-toast.entry.js.gz +0 -0
- package/dist/esm/ez-tree.entry.js.gz +0 -0
- package/dist/esm/ez-underface.entry.js.gz +0 -0
- package/dist/esm/ez-upload.entry.js.gz +0 -0
- package/dist/esm/ez-view-stack.entry.js.gz +0 -0
- package/dist/esm/ezListHelper-00fb9b8d.js.gz +0 -0
- package/dist/esm/ezui.js.gz +0 -0
- package/dist/esm/filter-column.entry.js.gz +0 -0
- package/dist/esm/floating-ui.dom.esm-5d3da819.js.gz +0 -0
- package/dist/esm/index-5a720e56.js.gz +0 -0
- package/dist/esm/index.js.gz +0 -0
- package/dist/esm/loader.js.gz +0 -0
- package/dist/esm/polyfills/core-js.js.gz +0 -0
- package/dist/esm/polyfills/css-shim.js.gz +0 -0
- package/dist/esm/polyfills/dom.js.gz +0 -0
- package/dist/esm/polyfills/es5-html-element.js.gz +0 -0
- package/dist/esm/polyfills/index.js.gz +0 -0
- package/dist/esm/polyfills/system.js.gz +0 -0
- package/dist/esm/search-column-35f4ad93.js.gz +0 -0
- package/dist/esm/searchFormatters-8229207e.js.gz +0 -0
- package/dist/ezui/ezui.esm.js.gz +0 -0
- package/dist/ezui/index.esm.js.gz +0 -0
- package/dist/ezui/p-000159dc.entry.js.gz +0 -0
- package/dist/ezui/p-0378416a.entry.js.gz +0 -0
- package/dist/ezui/p-05e68ab3.entry.js.gz +0 -0
- package/dist/ezui/p-06ed5e57.entry.js.gz +0 -0
- package/dist/ezui/p-06f1b8e4.entry.js.gz +0 -0
- package/dist/ezui/p-0b531233.entry.js.gz +0 -0
- package/dist/ezui/p-11bfeca3.entry.js +0 -1
- package/dist/ezui/p-11bfeca3.entry.js.gz +0 -0
- package/dist/ezui/p-14d6aeb8.entry.js +0 -1
- package/dist/ezui/p-14d6aeb8.entry.js.gz +0 -0
- package/dist/ezui/p-175154a0.js +0 -1
- package/dist/ezui/p-175154a0.js.gz +0 -0
- package/dist/ezui/p-18e71523.entry.js.gz +0 -0
- package/dist/ezui/p-2187f86c.js +0 -1
- package/dist/ezui/p-2187f86c.js.gz +0 -0
- package/dist/ezui/p-220b9944.entry.js +0 -1
- package/dist/ezui/p-220b9944.entry.js.gz +0 -0
- package/dist/ezui/p-30ffb9ed.js.gz +0 -0
- package/dist/ezui/p-31d074bb.entry.js +0 -1
- package/dist/ezui/p-31d074bb.entry.js.gz +0 -0
- package/dist/ezui/p-3234f883.entry.js.gz +0 -0
- package/dist/ezui/p-348f0dfe.entry.js +0 -1
- package/dist/ezui/p-348f0dfe.entry.js.gz +0 -0
- package/dist/ezui/p-40a60148.js.gz +0 -0
- package/dist/ezui/p-41652617.entry.js +0 -1
- package/dist/ezui/p-41652617.entry.js.gz +0 -0
- package/dist/ezui/p-419bebcc.entry.js +0 -1
- package/dist/ezui/p-419bebcc.entry.js.gz +0 -0
- package/dist/ezui/p-42c19893.entry.js +0 -1
- package/dist/ezui/p-42c19893.entry.js.gz +0 -0
- package/dist/ezui/p-44b39e81.entry.js.gz +0 -0
- package/dist/ezui/p-4a876b8b.entry.js.gz +0 -0
- package/dist/ezui/p-4e66eaeb.entry.js +0 -1
- package/dist/ezui/p-4e66eaeb.entry.js.gz +0 -0
- package/dist/ezui/p-545bd5d5.entry.js +0 -7
- package/dist/ezui/p-545bd5d5.entry.js.gz +0 -0
- package/dist/ezui/p-570cf58a.entry.js.gz +0 -0
- package/dist/ezui/p-5b85d3de.entry.js.gz +0 -0
- package/dist/ezui/p-5eea9886.js +0 -1
- package/dist/ezui/p-5eea9886.js.gz +0 -0
- package/dist/ezui/p-61f5c258.entry.js +0 -1
- package/dist/ezui/p-61f5c258.entry.js.gz +0 -0
- package/dist/ezui/p-6b2cc9b8.entry.js +0 -1
- package/dist/ezui/p-6b2cc9b8.entry.js.gz +0 -0
- package/dist/ezui/p-6b51c9cc.entry.js.gz +0 -0
- package/dist/ezui/p-6ec40dec.entry.js +0 -1
- package/dist/ezui/p-6ec40dec.entry.js.gz +0 -0
- package/dist/ezui/p-6fc26622.entry.js.gz +0 -0
- package/dist/ezui/p-7567ccdd.entry.js +0 -1
- package/dist/ezui/p-7567ccdd.entry.js.gz +0 -0
- package/dist/ezui/p-770cf2b8.entry.js.gz +0 -0
- package/dist/ezui/p-7db20f8e.entry.js +0 -1
- package/dist/ezui/p-7db20f8e.entry.js.gz +0 -0
- package/dist/ezui/p-7ec3f335.entry.js +0 -1
- package/dist/ezui/p-7ec3f335.entry.js.gz +0 -0
- package/dist/ezui/p-80dfc50b.js.gz +0 -0
- package/dist/ezui/p-81461d2f.entry.js.gz +0 -0
- package/dist/ezui/p-82fa4b09.entry.js.gz +0 -0
- package/dist/ezui/p-85d7b78a.entry.js +0 -1
- package/dist/ezui/p-85d7b78a.entry.js.gz +0 -0
- package/dist/ezui/p-87f5a060.entry.js +0 -1
- package/dist/ezui/p-87f5a060.entry.js.gz +0 -0
- package/dist/ezui/p-90e91173.entry.js +0 -1
- package/dist/ezui/p-90e91173.entry.js.gz +0 -0
- package/dist/ezui/p-91ccae0c.entry.js +0 -1
- package/dist/ezui/p-91ccae0c.entry.js.gz +0 -0
- package/dist/ezui/p-926a0bde.entry.js +0 -1
- package/dist/ezui/p-926a0bde.entry.js.gz +0 -0
- package/dist/ezui/p-92748142.entry.js.gz +0 -0
- package/dist/ezui/p-97d94ef3.entry.js +0 -1
- package/dist/ezui/p-97d94ef3.entry.js.gz +0 -0
- package/dist/ezui/p-98bb8b16.js.gz +0 -0
- package/dist/ezui/p-9a1d1938.entry.js +0 -1
- package/dist/ezui/p-9a1d1938.entry.js.gz +0 -0
- package/dist/ezui/p-9bcfa689.entry.js.gz +0 -0
- package/dist/ezui/p-9e95bfeb.entry.js +0 -1
- package/dist/ezui/p-9e95bfeb.entry.js.gz +0 -0
- package/dist/ezui/p-a0e5f48e.entry.js +0 -1
- package/dist/ezui/p-a0e5f48e.entry.js.gz +0 -0
- package/dist/ezui/p-a11827ca.entry.js +0 -1
- package/dist/ezui/p-a11827ca.entry.js.gz +0 -0
- package/dist/ezui/p-a2ff2d2f.entry.js +0 -1
- package/dist/ezui/p-a2ff2d2f.entry.js.gz +0 -0
- package/dist/ezui/p-a640e0cf.entry.js +0 -309
- package/dist/ezui/p-a640e0cf.entry.js.gz +0 -0
- package/dist/ezui/p-ab574d59.js.gz +0 -0
- package/dist/ezui/p-b6b7e9a8.entry.js +0 -1
- package/dist/ezui/p-b6b7e9a8.entry.js.gz +0 -0
- package/dist/ezui/p-b7861400.entry.js +0 -1
- package/dist/ezui/p-b7861400.entry.js.gz +0 -0
- package/dist/ezui/p-b7c6ce20.entry.js.gz +0 -0
- package/dist/ezui/p-b853763b.js.gz +0 -0
- package/dist/ezui/p-c2b20f78.entry.js.gz +0 -0
- package/dist/ezui/p-c503a0f0.entry.js +0 -1
- package/dist/ezui/p-c503a0f0.entry.js.gz +0 -0
- package/dist/ezui/p-c96e536d.entry.js.gz +0 -0
- package/dist/ezui/p-d3779449.entry.js.gz +0 -0
- package/dist/ezui/p-d4d6d5fe.entry.js +0 -1
- package/dist/ezui/p-d4d6d5fe.entry.js.gz +0 -0
- package/dist/ezui/p-dc628ed3.js.gz +0 -0
- package/dist/ezui/p-ddd0bd61.entry.js +0 -1
- package/dist/ezui/p-ddd0bd61.entry.js.gz +0 -0
- package/dist/ezui/p-dfca5946.entry.js.gz +0 -0
- package/dist/ezui/p-e07e4671.js.gz +0 -0
- package/dist/ezui/p-e4ae4ddb.entry.js +0 -1
- package/dist/ezui/p-e4ae4ddb.entry.js.gz +0 -0
- package/dist/ezui/p-e4c7eb39.js.gz +0 -0
- package/dist/ezui/p-e4ead194.entry.js +0 -1
- package/dist/ezui/p-e4ead194.entry.js.gz +0 -0
- package/dist/ezui/p-e6b38ade.entry.js +0 -1
- package/dist/ezui/p-e6b38ade.entry.js.gz +0 -0
- package/dist/ezui/p-eaf48cfe.entry.js +0 -1
- package/dist/ezui/p-eaf48cfe.entry.js.gz +0 -0
- package/dist/ezui/p-ec7db713.js.gz +0 -0
- package/dist/ezui/p-ed48a632.entry.js +0 -1
- package/dist/ezui/p-ed48a632.entry.js.gz +0 -0
- package/dist/ezui/p-ee9f2178.entry.js +0 -1
- package/dist/ezui/p-ee9f2178.entry.js.gz +0 -0
- package/dist/ezui/p-f0b711a6.entry.js +0 -1
- package/dist/ezui/p-f0b711a6.entry.js.gz +0 -0
- package/dist/ezui/p-f26b97e9.entry.js.gz +0 -0
- package/dist/ezui/p-f5951db3.entry.js +0 -1
- package/dist/ezui/p-f5951db3.entry.js.gz +0 -0
- package/dist/ezui/p-fc194825.entry.js +0 -1
- package/dist/ezui/p-fc194825.entry.js.gz +0 -0
- package/dist/index.cjs.js.gz +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/types/components/ez-grid/controller/ag-grid/i18n/pt-BR.d.ts +0 -2
- package/dist/types/components/ez-sidebar-navigator/messages/constants.d.ts +0 -5
|
@@ -0,0 +1,3693 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const core = require('@sankhyalabs/core');
|
|
4
|
+
|
|
5
|
+
const isString = obj => typeof obj === 'string';
|
|
6
|
+
const defer = () => {
|
|
7
|
+
let res;
|
|
8
|
+
let rej;
|
|
9
|
+
const promise = new Promise((resolve, reject) => {
|
|
10
|
+
res = resolve;
|
|
11
|
+
rej = reject;
|
|
12
|
+
});
|
|
13
|
+
promise.resolve = res;
|
|
14
|
+
promise.reject = rej;
|
|
15
|
+
return promise;
|
|
16
|
+
};
|
|
17
|
+
const makeString = object => {
|
|
18
|
+
if (object == null) return '';
|
|
19
|
+
return '' + object;
|
|
20
|
+
};
|
|
21
|
+
const copy = (a, s, t) => {
|
|
22
|
+
a.forEach(m => {
|
|
23
|
+
if (s[m]) t[m] = s[m];
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
const lastOfPathSeparatorRegExp = /###/g;
|
|
27
|
+
const cleanKey = key => key && key.indexOf('###') > -1 ? key.replace(lastOfPathSeparatorRegExp, '.') : key;
|
|
28
|
+
const canNotTraverseDeeper = object => !object || isString(object);
|
|
29
|
+
const getLastOfPath = (object, path, Empty) => {
|
|
30
|
+
const stack = !isString(path) ? path : path.split('.');
|
|
31
|
+
let stackIndex = 0;
|
|
32
|
+
while (stackIndex < stack.length - 1) {
|
|
33
|
+
if (canNotTraverseDeeper(object)) return {};
|
|
34
|
+
const key = cleanKey(stack[stackIndex]);
|
|
35
|
+
if (!object[key] && Empty) object[key] = new Empty();
|
|
36
|
+
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
37
|
+
object = object[key];
|
|
38
|
+
} else {
|
|
39
|
+
object = {};
|
|
40
|
+
}
|
|
41
|
+
++stackIndex;
|
|
42
|
+
}
|
|
43
|
+
if (canNotTraverseDeeper(object)) return {};
|
|
44
|
+
return {
|
|
45
|
+
obj: object,
|
|
46
|
+
k: cleanKey(stack[stackIndex])
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
const setPath = (object, path, newValue) => {
|
|
50
|
+
const {
|
|
51
|
+
obj,
|
|
52
|
+
k
|
|
53
|
+
} = getLastOfPath(object, path, Object);
|
|
54
|
+
if (obj !== undefined || path.length === 1) {
|
|
55
|
+
obj[k] = newValue;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
let e = path[path.length - 1];
|
|
59
|
+
let p = path.slice(0, path.length - 1);
|
|
60
|
+
let last = getLastOfPath(object, p, Object);
|
|
61
|
+
while (last.obj === undefined && p.length) {
|
|
62
|
+
e = `${p[p.length - 1]}.${e}`;
|
|
63
|
+
p = p.slice(0, p.length - 1);
|
|
64
|
+
last = getLastOfPath(object, p, Object);
|
|
65
|
+
if (last && last.obj && typeof last.obj[`${last.k}.${e}`] !== 'undefined') {
|
|
66
|
+
last.obj = undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
last.obj[`${last.k}.${e}`] = newValue;
|
|
70
|
+
};
|
|
71
|
+
const pushPath = (object, path, newValue, concat) => {
|
|
72
|
+
const {
|
|
73
|
+
obj,
|
|
74
|
+
k
|
|
75
|
+
} = getLastOfPath(object, path, Object);
|
|
76
|
+
obj[k] = obj[k] || [];
|
|
77
|
+
obj[k].push(newValue);
|
|
78
|
+
};
|
|
79
|
+
const getPath = (object, path) => {
|
|
80
|
+
const {
|
|
81
|
+
obj,
|
|
82
|
+
k
|
|
83
|
+
} = getLastOfPath(object, path);
|
|
84
|
+
if (!obj) return undefined;
|
|
85
|
+
return obj[k];
|
|
86
|
+
};
|
|
87
|
+
const getPathWithDefaults = (data, defaultData, key) => {
|
|
88
|
+
const value = getPath(data, key);
|
|
89
|
+
if (value !== undefined) {
|
|
90
|
+
return value;
|
|
91
|
+
}
|
|
92
|
+
return getPath(defaultData, key);
|
|
93
|
+
};
|
|
94
|
+
const deepExtend = (target, source, overwrite) => {
|
|
95
|
+
for (const prop in source) {
|
|
96
|
+
if (prop !== '__proto__' && prop !== 'constructor') {
|
|
97
|
+
if (prop in target) {
|
|
98
|
+
if (isString(target[prop]) || target[prop] instanceof String || isString(source[prop]) || source[prop] instanceof String) {
|
|
99
|
+
if (overwrite) target[prop] = source[prop];
|
|
100
|
+
} else {
|
|
101
|
+
deepExtend(target[prop], source[prop], overwrite);
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
target[prop] = source[prop];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return target;
|
|
109
|
+
};
|
|
110
|
+
const regexEscape = str => str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
|
|
111
|
+
var _entityMap = {
|
|
112
|
+
'&': '&',
|
|
113
|
+
'<': '<',
|
|
114
|
+
'>': '>',
|
|
115
|
+
'"': '"',
|
|
116
|
+
"'": ''',
|
|
117
|
+
'/': '/'
|
|
118
|
+
};
|
|
119
|
+
const escape = data => {
|
|
120
|
+
if (isString(data)) {
|
|
121
|
+
return data.replace(/[&<>"'\/]/g, s => _entityMap[s]);
|
|
122
|
+
}
|
|
123
|
+
return data;
|
|
124
|
+
};
|
|
125
|
+
class RegExpCache {
|
|
126
|
+
constructor(capacity) {
|
|
127
|
+
this.capacity = capacity;
|
|
128
|
+
this.regExpMap = new Map();
|
|
129
|
+
this.regExpQueue = [];
|
|
130
|
+
}
|
|
131
|
+
getRegExp(pattern) {
|
|
132
|
+
const regExpFromCache = this.regExpMap.get(pattern);
|
|
133
|
+
if (regExpFromCache !== undefined) {
|
|
134
|
+
return regExpFromCache;
|
|
135
|
+
}
|
|
136
|
+
const regExpNew = new RegExp(pattern);
|
|
137
|
+
if (this.regExpQueue.length === this.capacity) {
|
|
138
|
+
this.regExpMap.delete(this.regExpQueue.shift());
|
|
139
|
+
}
|
|
140
|
+
this.regExpMap.set(pattern, regExpNew);
|
|
141
|
+
this.regExpQueue.push(pattern);
|
|
142
|
+
return regExpNew;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const chars = [' ', ',', '?', '!', ';'];
|
|
146
|
+
const looksLikeObjectPathRegExpCache = new RegExpCache(20);
|
|
147
|
+
const looksLikeObjectPath = (key, nsSeparator, keySeparator) => {
|
|
148
|
+
nsSeparator = nsSeparator || '';
|
|
149
|
+
keySeparator = keySeparator || '';
|
|
150
|
+
const possibleChars = chars.filter(c => nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0);
|
|
151
|
+
if (possibleChars.length === 0) return true;
|
|
152
|
+
const r = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map(c => c === '?' ? '\\?' : c).join('|')})`);
|
|
153
|
+
let matched = !r.test(key);
|
|
154
|
+
if (!matched) {
|
|
155
|
+
const ki = key.indexOf(keySeparator);
|
|
156
|
+
if (ki > 0 && !r.test(key.substring(0, ki))) {
|
|
157
|
+
matched = true;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return matched;
|
|
161
|
+
};
|
|
162
|
+
const deepFind = function (obj, path) {
|
|
163
|
+
let keySeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
|
|
164
|
+
if (!obj) return undefined;
|
|
165
|
+
if (obj[path]) return obj[path];
|
|
166
|
+
const tokens = path.split(keySeparator);
|
|
167
|
+
let current = obj;
|
|
168
|
+
for (let i = 0; i < tokens.length;) {
|
|
169
|
+
if (!current || typeof current !== 'object') {
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
172
|
+
let next;
|
|
173
|
+
let nextPath = '';
|
|
174
|
+
for (let j = i; j < tokens.length; ++j) {
|
|
175
|
+
if (j !== i) {
|
|
176
|
+
nextPath += keySeparator;
|
|
177
|
+
}
|
|
178
|
+
nextPath += tokens[j];
|
|
179
|
+
next = current[nextPath];
|
|
180
|
+
if (next !== undefined) {
|
|
181
|
+
if (['string', 'number', 'boolean'].indexOf(typeof next) > -1 && j < tokens.length - 1) {
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
i += j - i + 1;
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
current = next;
|
|
189
|
+
}
|
|
190
|
+
return current;
|
|
191
|
+
};
|
|
192
|
+
const getCleanedCode = code => code && code.replace('_', '-');
|
|
193
|
+
|
|
194
|
+
const consoleLogger = {
|
|
195
|
+
type: 'logger',
|
|
196
|
+
log(args) {
|
|
197
|
+
this.output('log', args);
|
|
198
|
+
},
|
|
199
|
+
warn(args) {
|
|
200
|
+
this.output('warn', args);
|
|
201
|
+
},
|
|
202
|
+
error(args) {
|
|
203
|
+
this.output('error', args);
|
|
204
|
+
},
|
|
205
|
+
output(type, args) {
|
|
206
|
+
if (console && console[type]) console[type].apply(console, args);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
class Logger {
|
|
210
|
+
constructor(concreteLogger) {
|
|
211
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
212
|
+
this.init(concreteLogger, options);
|
|
213
|
+
}
|
|
214
|
+
init(concreteLogger) {
|
|
215
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
216
|
+
this.prefix = options.prefix || 'i18next:';
|
|
217
|
+
this.logger = concreteLogger || consoleLogger;
|
|
218
|
+
this.options = options;
|
|
219
|
+
this.debug = options.debug;
|
|
220
|
+
}
|
|
221
|
+
log() {
|
|
222
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
223
|
+
args[_key] = arguments[_key];
|
|
224
|
+
}
|
|
225
|
+
return this.forward(args, 'log', '', true);
|
|
226
|
+
}
|
|
227
|
+
warn() {
|
|
228
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
229
|
+
args[_key2] = arguments[_key2];
|
|
230
|
+
}
|
|
231
|
+
return this.forward(args, 'warn', '', true);
|
|
232
|
+
}
|
|
233
|
+
error() {
|
|
234
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
235
|
+
args[_key3] = arguments[_key3];
|
|
236
|
+
}
|
|
237
|
+
return this.forward(args, 'error', '');
|
|
238
|
+
}
|
|
239
|
+
deprecate() {
|
|
240
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
241
|
+
args[_key4] = arguments[_key4];
|
|
242
|
+
}
|
|
243
|
+
return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);
|
|
244
|
+
}
|
|
245
|
+
forward(args, lvl, prefix, debugOnly) {
|
|
246
|
+
if (debugOnly && !this.debug) return null;
|
|
247
|
+
if (isString(args[0])) args[0] = `${prefix}${this.prefix} ${args[0]}`;
|
|
248
|
+
return this.logger[lvl](args);
|
|
249
|
+
}
|
|
250
|
+
create(moduleName) {
|
|
251
|
+
return new Logger(this.logger, {
|
|
252
|
+
...{
|
|
253
|
+
prefix: `${this.prefix}:${moduleName}:`
|
|
254
|
+
},
|
|
255
|
+
...this.options
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
clone(options) {
|
|
259
|
+
options = options || this.options;
|
|
260
|
+
options.prefix = options.prefix || this.prefix;
|
|
261
|
+
return new Logger(this.logger, options);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
var baseLogger = new Logger();
|
|
265
|
+
|
|
266
|
+
class EventEmitter {
|
|
267
|
+
constructor() {
|
|
268
|
+
this.observers = {};
|
|
269
|
+
}
|
|
270
|
+
on(events, listener) {
|
|
271
|
+
events.split(' ').forEach(event => {
|
|
272
|
+
if (!this.observers[event]) this.observers[event] = new Map();
|
|
273
|
+
const numListeners = this.observers[event].get(listener) || 0;
|
|
274
|
+
this.observers[event].set(listener, numListeners + 1);
|
|
275
|
+
});
|
|
276
|
+
return this;
|
|
277
|
+
}
|
|
278
|
+
off(event, listener) {
|
|
279
|
+
if (!this.observers[event]) return;
|
|
280
|
+
if (!listener) {
|
|
281
|
+
delete this.observers[event];
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
this.observers[event].delete(listener);
|
|
285
|
+
}
|
|
286
|
+
emit(event) {
|
|
287
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
288
|
+
args[_key - 1] = arguments[_key];
|
|
289
|
+
}
|
|
290
|
+
if (this.observers[event]) {
|
|
291
|
+
const cloned = Array.from(this.observers[event].entries());
|
|
292
|
+
cloned.forEach(_ref => {
|
|
293
|
+
let [observer, numTimesAdded] = _ref;
|
|
294
|
+
for (let i = 0; i < numTimesAdded; i++) {
|
|
295
|
+
observer(...args);
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
if (this.observers['*']) {
|
|
300
|
+
const cloned = Array.from(this.observers['*'].entries());
|
|
301
|
+
cloned.forEach(_ref2 => {
|
|
302
|
+
let [observer, numTimesAdded] = _ref2;
|
|
303
|
+
for (let i = 0; i < numTimesAdded; i++) {
|
|
304
|
+
observer.apply(observer, [event, ...args]);
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
class ResourceStore extends EventEmitter {
|
|
312
|
+
constructor(data) {
|
|
313
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
314
|
+
ns: ['translation'],
|
|
315
|
+
defaultNS: 'translation'
|
|
316
|
+
};
|
|
317
|
+
super();
|
|
318
|
+
this.data = data || {};
|
|
319
|
+
this.options = options;
|
|
320
|
+
if (this.options.keySeparator === undefined) {
|
|
321
|
+
this.options.keySeparator = '.';
|
|
322
|
+
}
|
|
323
|
+
if (this.options.ignoreJSONStructure === undefined) {
|
|
324
|
+
this.options.ignoreJSONStructure = true;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
addNamespaces(ns) {
|
|
328
|
+
if (this.options.ns.indexOf(ns) < 0) {
|
|
329
|
+
this.options.ns.push(ns);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
removeNamespaces(ns) {
|
|
333
|
+
const index = this.options.ns.indexOf(ns);
|
|
334
|
+
if (index > -1) {
|
|
335
|
+
this.options.ns.splice(index, 1);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
getResource(lng, ns, key) {
|
|
339
|
+
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
340
|
+
const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
341
|
+
const ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
342
|
+
let path;
|
|
343
|
+
if (lng.indexOf('.') > -1) {
|
|
344
|
+
path = lng.split('.');
|
|
345
|
+
} else {
|
|
346
|
+
path = [lng, ns];
|
|
347
|
+
if (key) {
|
|
348
|
+
if (Array.isArray(key)) {
|
|
349
|
+
path.push(...key);
|
|
350
|
+
} else if (isString(key) && keySeparator) {
|
|
351
|
+
path.push(...key.split(keySeparator));
|
|
352
|
+
} else {
|
|
353
|
+
path.push(key);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
const result = getPath(this.data, path);
|
|
358
|
+
if (!result && !ns && !key && lng.indexOf('.') > -1) {
|
|
359
|
+
lng = path[0];
|
|
360
|
+
ns = path[1];
|
|
361
|
+
key = path.slice(2).join('.');
|
|
362
|
+
}
|
|
363
|
+
if (result || !ignoreJSONStructure || !isString(key)) return result;
|
|
364
|
+
return deepFind(this.data && this.data[lng] && this.data[lng][ns], key, keySeparator);
|
|
365
|
+
}
|
|
366
|
+
addResource(lng, ns, key, value) {
|
|
367
|
+
let options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
|
|
368
|
+
silent: false
|
|
369
|
+
};
|
|
370
|
+
const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
371
|
+
let path = [lng, ns];
|
|
372
|
+
if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
|
|
373
|
+
if (lng.indexOf('.') > -1) {
|
|
374
|
+
path = lng.split('.');
|
|
375
|
+
value = ns;
|
|
376
|
+
ns = path[1];
|
|
377
|
+
}
|
|
378
|
+
this.addNamespaces(ns);
|
|
379
|
+
setPath(this.data, path, value);
|
|
380
|
+
if (!options.silent) this.emit('added', lng, ns, key, value);
|
|
381
|
+
}
|
|
382
|
+
addResources(lng, ns, resources) {
|
|
383
|
+
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
|
|
384
|
+
silent: false
|
|
385
|
+
};
|
|
386
|
+
for (const m in resources) {
|
|
387
|
+
if (isString(resources[m]) || Array.isArray(resources[m])) this.addResource(lng, ns, m, resources[m], {
|
|
388
|
+
silent: true
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
if (!options.silent) this.emit('added', lng, ns, resources);
|
|
392
|
+
}
|
|
393
|
+
addResourceBundle(lng, ns, resources, deep, overwrite) {
|
|
394
|
+
let options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {
|
|
395
|
+
silent: false,
|
|
396
|
+
skipCopy: false
|
|
397
|
+
};
|
|
398
|
+
let path = [lng, ns];
|
|
399
|
+
if (lng.indexOf('.') > -1) {
|
|
400
|
+
path = lng.split('.');
|
|
401
|
+
deep = resources;
|
|
402
|
+
resources = ns;
|
|
403
|
+
ns = path[1];
|
|
404
|
+
}
|
|
405
|
+
this.addNamespaces(ns);
|
|
406
|
+
let pack = getPath(this.data, path) || {};
|
|
407
|
+
if (!options.skipCopy) resources = JSON.parse(JSON.stringify(resources));
|
|
408
|
+
if (deep) {
|
|
409
|
+
deepExtend(pack, resources, overwrite);
|
|
410
|
+
} else {
|
|
411
|
+
pack = {
|
|
412
|
+
...pack,
|
|
413
|
+
...resources
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
setPath(this.data, path, pack);
|
|
417
|
+
if (!options.silent) this.emit('added', lng, ns, resources);
|
|
418
|
+
}
|
|
419
|
+
removeResourceBundle(lng, ns) {
|
|
420
|
+
if (this.hasResourceBundle(lng, ns)) {
|
|
421
|
+
delete this.data[lng][ns];
|
|
422
|
+
}
|
|
423
|
+
this.removeNamespaces(ns);
|
|
424
|
+
this.emit('removed', lng, ns);
|
|
425
|
+
}
|
|
426
|
+
hasResourceBundle(lng, ns) {
|
|
427
|
+
return this.getResource(lng, ns) !== undefined;
|
|
428
|
+
}
|
|
429
|
+
getResourceBundle(lng, ns) {
|
|
430
|
+
if (!ns) ns = this.options.defaultNS;
|
|
431
|
+
if (this.options.compatibilityAPI === 'v1') return {
|
|
432
|
+
...{},
|
|
433
|
+
...this.getResource(lng, ns)
|
|
434
|
+
};
|
|
435
|
+
return this.getResource(lng, ns);
|
|
436
|
+
}
|
|
437
|
+
getDataByLanguage(lng) {
|
|
438
|
+
return this.data[lng];
|
|
439
|
+
}
|
|
440
|
+
hasLanguageSomeTranslations(lng) {
|
|
441
|
+
const data = this.getDataByLanguage(lng);
|
|
442
|
+
const n = data && Object.keys(data) || [];
|
|
443
|
+
return !!n.find(v => data[v] && Object.keys(data[v]).length > 0);
|
|
444
|
+
}
|
|
445
|
+
toJSON() {
|
|
446
|
+
return this.data;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
var postProcessor = {
|
|
451
|
+
processors: {},
|
|
452
|
+
addPostProcessor(module) {
|
|
453
|
+
this.processors[module.name] = module;
|
|
454
|
+
},
|
|
455
|
+
handle(processors, value, key, options, translator) {
|
|
456
|
+
processors.forEach(processor => {
|
|
457
|
+
if (this.processors[processor]) value = this.processors[processor].process(value, key, options, translator);
|
|
458
|
+
});
|
|
459
|
+
return value;
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
const checkedLoadedFor = {};
|
|
464
|
+
class Translator extends EventEmitter {
|
|
465
|
+
constructor(services) {
|
|
466
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
467
|
+
super();
|
|
468
|
+
copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, this);
|
|
469
|
+
this.options = options;
|
|
470
|
+
if (this.options.keySeparator === undefined) {
|
|
471
|
+
this.options.keySeparator = '.';
|
|
472
|
+
}
|
|
473
|
+
this.logger = baseLogger.create('translator');
|
|
474
|
+
}
|
|
475
|
+
changeLanguage(lng) {
|
|
476
|
+
if (lng) this.language = lng;
|
|
477
|
+
}
|
|
478
|
+
exists(key) {
|
|
479
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
480
|
+
interpolation: {}
|
|
481
|
+
};
|
|
482
|
+
if (key === undefined || key === null) {
|
|
483
|
+
return false;
|
|
484
|
+
}
|
|
485
|
+
const resolved = this.resolve(key, options);
|
|
486
|
+
return resolved && resolved.res !== undefined;
|
|
487
|
+
}
|
|
488
|
+
extractFromKey(key, options) {
|
|
489
|
+
let nsSeparator = options.nsSeparator !== undefined ? options.nsSeparator : this.options.nsSeparator;
|
|
490
|
+
if (nsSeparator === undefined) nsSeparator = ':';
|
|
491
|
+
const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
492
|
+
let namespaces = options.ns || this.options.defaultNS || [];
|
|
493
|
+
const wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;
|
|
494
|
+
const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !options.keySeparator && !this.options.userDefinedNsSeparator && !options.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);
|
|
495
|
+
if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
|
|
496
|
+
const m = key.match(this.interpolator.nestingRegexp);
|
|
497
|
+
if (m && m.length > 0) {
|
|
498
|
+
return {
|
|
499
|
+
key,
|
|
500
|
+
namespaces: isString(namespaces) ? [namespaces] : namespaces
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
const parts = key.split(nsSeparator);
|
|
504
|
+
if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();
|
|
505
|
+
key = parts.join(keySeparator);
|
|
506
|
+
}
|
|
507
|
+
return {
|
|
508
|
+
key,
|
|
509
|
+
namespaces: isString(namespaces) ? [namespaces] : namespaces
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
translate(keys, options, lastKey) {
|
|
513
|
+
if (typeof options !== 'object' && this.options.overloadTranslationOptionHandler) {
|
|
514
|
+
options = this.options.overloadTranslationOptionHandler(arguments);
|
|
515
|
+
}
|
|
516
|
+
if (typeof options === 'object') options = {
|
|
517
|
+
...options
|
|
518
|
+
};
|
|
519
|
+
if (!options) options = {};
|
|
520
|
+
if (keys === undefined || keys === null) return '';
|
|
521
|
+
if (!Array.isArray(keys)) keys = [String(keys)];
|
|
522
|
+
const returnDetails = options.returnDetails !== undefined ? options.returnDetails : this.options.returnDetails;
|
|
523
|
+
const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
524
|
+
const {
|
|
525
|
+
key,
|
|
526
|
+
namespaces
|
|
527
|
+
} = this.extractFromKey(keys[keys.length - 1], options);
|
|
528
|
+
const namespace = namespaces[namespaces.length - 1];
|
|
529
|
+
const lng = options.lng || this.language;
|
|
530
|
+
const appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
531
|
+
if (lng && lng.toLowerCase() === 'cimode') {
|
|
532
|
+
if (appendNamespaceToCIMode) {
|
|
533
|
+
const nsSeparator = options.nsSeparator || this.options.nsSeparator;
|
|
534
|
+
if (returnDetails) {
|
|
535
|
+
return {
|
|
536
|
+
res: `${namespace}${nsSeparator}${key}`,
|
|
537
|
+
usedKey: key,
|
|
538
|
+
exactUsedKey: key,
|
|
539
|
+
usedLng: lng,
|
|
540
|
+
usedNS: namespace,
|
|
541
|
+
usedParams: this.getUsedParamsDetails(options)
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
return `${namespace}${nsSeparator}${key}`;
|
|
545
|
+
}
|
|
546
|
+
if (returnDetails) {
|
|
547
|
+
return {
|
|
548
|
+
res: key,
|
|
549
|
+
usedKey: key,
|
|
550
|
+
exactUsedKey: key,
|
|
551
|
+
usedLng: lng,
|
|
552
|
+
usedNS: namespace,
|
|
553
|
+
usedParams: this.getUsedParamsDetails(options)
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
return key;
|
|
557
|
+
}
|
|
558
|
+
const resolved = this.resolve(keys, options);
|
|
559
|
+
let res = resolved && resolved.res;
|
|
560
|
+
const resUsedKey = resolved && resolved.usedKey || key;
|
|
561
|
+
const resExactUsedKey = resolved && resolved.exactUsedKey || key;
|
|
562
|
+
const resType = Object.prototype.toString.apply(res);
|
|
563
|
+
const noObject = ['[object Number]', '[object Function]', '[object RegExp]'];
|
|
564
|
+
const joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays;
|
|
565
|
+
const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
|
|
566
|
+
const handleAsObject = !isString(res) && typeof res !== 'boolean' && typeof res !== 'number';
|
|
567
|
+
if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(isString(joinArrays) && Array.isArray(res))) {
|
|
568
|
+
if (!options.returnObjects && !this.options.returnObjects) {
|
|
569
|
+
if (!this.options.returnedObjectHandler) {
|
|
570
|
+
this.logger.warn('accessing an object - but returnObjects options is not enabled!');
|
|
571
|
+
}
|
|
572
|
+
const r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, {
|
|
573
|
+
...options,
|
|
574
|
+
ns: namespaces
|
|
575
|
+
}) : `key '${key} (${this.language})' returned an object instead of string.`;
|
|
576
|
+
if (returnDetails) {
|
|
577
|
+
resolved.res = r;
|
|
578
|
+
resolved.usedParams = this.getUsedParamsDetails(options);
|
|
579
|
+
return resolved;
|
|
580
|
+
}
|
|
581
|
+
return r;
|
|
582
|
+
}
|
|
583
|
+
if (keySeparator) {
|
|
584
|
+
const resTypeIsArray = Array.isArray(res);
|
|
585
|
+
const copy = resTypeIsArray ? [] : {};
|
|
586
|
+
const newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;
|
|
587
|
+
for (const m in res) {
|
|
588
|
+
if (Object.prototype.hasOwnProperty.call(res, m)) {
|
|
589
|
+
const deepKey = `${newKeyToUse}${keySeparator}${m}`;
|
|
590
|
+
copy[m] = this.translate(deepKey, {
|
|
591
|
+
...options,
|
|
592
|
+
...{
|
|
593
|
+
joinArrays: false,
|
|
594
|
+
ns: namespaces
|
|
595
|
+
}
|
|
596
|
+
});
|
|
597
|
+
if (copy[m] === deepKey) copy[m] = res[m];
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
res = copy;
|
|
601
|
+
}
|
|
602
|
+
} else if (handleAsObjectInI18nFormat && isString(joinArrays) && Array.isArray(res)) {
|
|
603
|
+
res = res.join(joinArrays);
|
|
604
|
+
if (res) res = this.extendTranslation(res, keys, options, lastKey);
|
|
605
|
+
} else {
|
|
606
|
+
let usedDefault = false;
|
|
607
|
+
let usedKey = false;
|
|
608
|
+
const needsPluralHandling = options.count !== undefined && !isString(options.count);
|
|
609
|
+
const hasDefaultValue = Translator.hasDefaultValue(options);
|
|
610
|
+
const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, options) : '';
|
|
611
|
+
const defaultValueSuffixOrdinalFallback = options.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, {
|
|
612
|
+
ordinal: false
|
|
613
|
+
}) : '';
|
|
614
|
+
const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && this.pluralResolver.shouldUseIntlApi();
|
|
615
|
+
const defaultValue = needsZeroSuffixLookup && options[`defaultValue${this.options.pluralSeparator}zero`] || options[`defaultValue${defaultValueSuffix}`] || options[`defaultValue${defaultValueSuffixOrdinalFallback}`] || options.defaultValue;
|
|
616
|
+
if (!this.isValidLookup(res) && hasDefaultValue) {
|
|
617
|
+
usedDefault = true;
|
|
618
|
+
res = defaultValue;
|
|
619
|
+
}
|
|
620
|
+
if (!this.isValidLookup(res)) {
|
|
621
|
+
usedKey = true;
|
|
622
|
+
res = key;
|
|
623
|
+
}
|
|
624
|
+
const missingKeyNoValueFallbackToKey = options.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;
|
|
625
|
+
const resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res;
|
|
626
|
+
const updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;
|
|
627
|
+
if (usedKey || usedDefault || updateMissing) {
|
|
628
|
+
this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? defaultValue : res);
|
|
629
|
+
if (keySeparator) {
|
|
630
|
+
const fk = this.resolve(key, {
|
|
631
|
+
...options,
|
|
632
|
+
keySeparator: false
|
|
633
|
+
});
|
|
634
|
+
if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.');
|
|
635
|
+
}
|
|
636
|
+
let lngs = [];
|
|
637
|
+
const fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language);
|
|
638
|
+
if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {
|
|
639
|
+
for (let i = 0; i < fallbackLngs.length; i++) {
|
|
640
|
+
lngs.push(fallbackLngs[i]);
|
|
641
|
+
}
|
|
642
|
+
} else if (this.options.saveMissingTo === 'all') {
|
|
643
|
+
lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language);
|
|
644
|
+
} else {
|
|
645
|
+
lngs.push(options.lng || this.language);
|
|
646
|
+
}
|
|
647
|
+
const send = (l, k, specificDefaultValue) => {
|
|
648
|
+
const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
|
|
649
|
+
if (this.options.missingKeyHandler) {
|
|
650
|
+
this.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, options);
|
|
651
|
+
} else if (this.backendConnector && this.backendConnector.saveMissing) {
|
|
652
|
+
this.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, options);
|
|
653
|
+
}
|
|
654
|
+
this.emit('missingKey', l, namespace, k, res);
|
|
655
|
+
};
|
|
656
|
+
if (this.options.saveMissing) {
|
|
657
|
+
if (this.options.saveMissingPlurals && needsPluralHandling) {
|
|
658
|
+
lngs.forEach(language => {
|
|
659
|
+
const suffixes = this.pluralResolver.getSuffixes(language, options);
|
|
660
|
+
if (needsZeroSuffixLookup && options[`defaultValue${this.options.pluralSeparator}zero`] && suffixes.indexOf(`${this.options.pluralSeparator}zero`) < 0) {
|
|
661
|
+
suffixes.push(`${this.options.pluralSeparator}zero`);
|
|
662
|
+
}
|
|
663
|
+
suffixes.forEach(suffix => {
|
|
664
|
+
send([language], key + suffix, options[`defaultValue${suffix}`] || defaultValue);
|
|
665
|
+
});
|
|
666
|
+
});
|
|
667
|
+
} else {
|
|
668
|
+
send(lngs, key, defaultValue);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
res = this.extendTranslation(res, keys, options, resolved, lastKey);
|
|
673
|
+
if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = `${namespace}:${key}`;
|
|
674
|
+
if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
|
|
675
|
+
if (this.options.compatibilityAPI !== 'v1') {
|
|
676
|
+
res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}:${key}` : key, usedDefault ? res : undefined);
|
|
677
|
+
} else {
|
|
678
|
+
res = this.options.parseMissingKeyHandler(res);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
if (returnDetails) {
|
|
683
|
+
resolved.res = res;
|
|
684
|
+
resolved.usedParams = this.getUsedParamsDetails(options);
|
|
685
|
+
return resolved;
|
|
686
|
+
}
|
|
687
|
+
return res;
|
|
688
|
+
}
|
|
689
|
+
extendTranslation(res, key, options, resolved, lastKey) {
|
|
690
|
+
var _this = this;
|
|
691
|
+
if (this.i18nFormat && this.i18nFormat.parse) {
|
|
692
|
+
res = this.i18nFormat.parse(res, {
|
|
693
|
+
...this.options.interpolation.defaultVariables,
|
|
694
|
+
...options
|
|
695
|
+
}, options.lng || this.language || resolved.usedLng, resolved.usedNS, resolved.usedKey, {
|
|
696
|
+
resolved
|
|
697
|
+
});
|
|
698
|
+
} else if (!options.skipInterpolation) {
|
|
699
|
+
if (options.interpolation) this.interpolator.init({
|
|
700
|
+
...options,
|
|
701
|
+
...{
|
|
702
|
+
interpolation: {
|
|
703
|
+
...this.options.interpolation,
|
|
704
|
+
...options.interpolation
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
const skipOnVariables = isString(res) && (options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
709
|
+
let nestBef;
|
|
710
|
+
if (skipOnVariables) {
|
|
711
|
+
const nb = res.match(this.interpolator.nestingRegexp);
|
|
712
|
+
nestBef = nb && nb.length;
|
|
713
|
+
}
|
|
714
|
+
let data = options.replace && !isString(options.replace) ? options.replace : options;
|
|
715
|
+
if (this.options.interpolation.defaultVariables) data = {
|
|
716
|
+
...this.options.interpolation.defaultVariables,
|
|
717
|
+
...data
|
|
718
|
+
};
|
|
719
|
+
res = this.interpolator.interpolate(res, data, options.lng || this.language || resolved.usedLng, options);
|
|
720
|
+
if (skipOnVariables) {
|
|
721
|
+
const na = res.match(this.interpolator.nestingRegexp);
|
|
722
|
+
const nestAft = na && na.length;
|
|
723
|
+
if (nestBef < nestAft) options.nest = false;
|
|
724
|
+
}
|
|
725
|
+
if (!options.lng && this.options.compatibilityAPI !== 'v1' && resolved && resolved.res) options.lng = this.language || resolved.usedLng;
|
|
726
|
+
if (options.nest !== false) res = this.interpolator.nest(res, function () {
|
|
727
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
728
|
+
args[_key] = arguments[_key];
|
|
729
|
+
}
|
|
730
|
+
if (lastKey && lastKey[0] === args[0] && !options.context) {
|
|
731
|
+
_this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);
|
|
732
|
+
return null;
|
|
733
|
+
}
|
|
734
|
+
return _this.translate(...args, key);
|
|
735
|
+
}, options);
|
|
736
|
+
if (options.interpolation) this.interpolator.reset();
|
|
737
|
+
}
|
|
738
|
+
const postProcess = options.postProcess || this.options.postProcess;
|
|
739
|
+
const postProcessorNames = isString(postProcess) ? [postProcess] : postProcess;
|
|
740
|
+
if (res !== undefined && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) {
|
|
741
|
+
res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {
|
|
742
|
+
i18nResolved: {
|
|
743
|
+
...resolved,
|
|
744
|
+
usedParams: this.getUsedParamsDetails(options)
|
|
745
|
+
},
|
|
746
|
+
...options
|
|
747
|
+
} : options, this);
|
|
748
|
+
}
|
|
749
|
+
return res;
|
|
750
|
+
}
|
|
751
|
+
resolve(keys) {
|
|
752
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
753
|
+
let found;
|
|
754
|
+
let usedKey;
|
|
755
|
+
let exactUsedKey;
|
|
756
|
+
let usedLng;
|
|
757
|
+
let usedNS;
|
|
758
|
+
if (isString(keys)) keys = [keys];
|
|
759
|
+
keys.forEach(k => {
|
|
760
|
+
if (this.isValidLookup(found)) return;
|
|
761
|
+
const extracted = this.extractFromKey(k, options);
|
|
762
|
+
const key = extracted.key;
|
|
763
|
+
usedKey = key;
|
|
764
|
+
let namespaces = extracted.namespaces;
|
|
765
|
+
if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);
|
|
766
|
+
const needsPluralHandling = options.count !== undefined && !isString(options.count);
|
|
767
|
+
const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && this.pluralResolver.shouldUseIntlApi();
|
|
768
|
+
const needsContextHandling = options.context !== undefined && (isString(options.context) || typeof options.context === 'number') && options.context !== '';
|
|
769
|
+
const codes = options.lngs ? options.lngs : this.languageUtils.toResolveHierarchy(options.lng || this.language, options.fallbackLng);
|
|
770
|
+
namespaces.forEach(ns => {
|
|
771
|
+
if (this.isValidLookup(found)) return;
|
|
772
|
+
usedNS = ns;
|
|
773
|
+
if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(usedNS)) {
|
|
774
|
+
checkedLoadedFor[`${codes[0]}-${ns}`] = true;
|
|
775
|
+
this.logger.warn(`key "${usedKey}" for languages "${codes.join(', ')}" won't get resolved as namespace "${usedNS}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
|
|
776
|
+
}
|
|
777
|
+
codes.forEach(code => {
|
|
778
|
+
if (this.isValidLookup(found)) return;
|
|
779
|
+
usedLng = code;
|
|
780
|
+
const finalKeys = [key];
|
|
781
|
+
if (this.i18nFormat && this.i18nFormat.addLookupKeys) {
|
|
782
|
+
this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);
|
|
783
|
+
} else {
|
|
784
|
+
let pluralSuffix;
|
|
785
|
+
if (needsPluralHandling) pluralSuffix = this.pluralResolver.getSuffix(code, options.count, options);
|
|
786
|
+
const zeroSuffix = `${this.options.pluralSeparator}zero`;
|
|
787
|
+
const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
788
|
+
if (needsPluralHandling) {
|
|
789
|
+
finalKeys.push(key + pluralSuffix);
|
|
790
|
+
if (options.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
|
|
791
|
+
finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
|
|
792
|
+
}
|
|
793
|
+
if (needsZeroSuffixLookup) {
|
|
794
|
+
finalKeys.push(key + zeroSuffix);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
if (needsContextHandling) {
|
|
798
|
+
const contextKey = `${key}${this.options.contextSeparator}${options.context}`;
|
|
799
|
+
finalKeys.push(contextKey);
|
|
800
|
+
if (needsPluralHandling) {
|
|
801
|
+
finalKeys.push(contextKey + pluralSuffix);
|
|
802
|
+
if (options.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
|
|
803
|
+
finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
|
|
804
|
+
}
|
|
805
|
+
if (needsZeroSuffixLookup) {
|
|
806
|
+
finalKeys.push(contextKey + zeroSuffix);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
let possibleKey;
|
|
812
|
+
while (possibleKey = finalKeys.pop()) {
|
|
813
|
+
if (!this.isValidLookup(found)) {
|
|
814
|
+
exactUsedKey = possibleKey;
|
|
815
|
+
found = this.getResource(code, ns, possibleKey, options);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
});
|
|
819
|
+
});
|
|
820
|
+
});
|
|
821
|
+
return {
|
|
822
|
+
res: found,
|
|
823
|
+
usedKey,
|
|
824
|
+
exactUsedKey,
|
|
825
|
+
usedLng,
|
|
826
|
+
usedNS
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
isValidLookup(res) {
|
|
830
|
+
return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');
|
|
831
|
+
}
|
|
832
|
+
getResource(code, ns, key) {
|
|
833
|
+
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
834
|
+
if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options);
|
|
835
|
+
return this.resourceStore.getResource(code, ns, key, options);
|
|
836
|
+
}
|
|
837
|
+
getUsedParamsDetails() {
|
|
838
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
839
|
+
const optionsKeys = ['defaultValue', 'ordinal', 'context', 'replace', 'lng', 'lngs', 'fallbackLng', 'ns', 'keySeparator', 'nsSeparator', 'returnObjects', 'returnDetails', 'joinArrays', 'postProcess', 'interpolation'];
|
|
840
|
+
const useOptionsReplaceForData = options.replace && !isString(options.replace);
|
|
841
|
+
let data = useOptionsReplaceForData ? options.replace : options;
|
|
842
|
+
if (useOptionsReplaceForData && typeof options.count !== 'undefined') {
|
|
843
|
+
data.count = options.count;
|
|
844
|
+
}
|
|
845
|
+
if (this.options.interpolation.defaultVariables) {
|
|
846
|
+
data = {
|
|
847
|
+
...this.options.interpolation.defaultVariables,
|
|
848
|
+
...data
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
if (!useOptionsReplaceForData) {
|
|
852
|
+
data = {
|
|
853
|
+
...data
|
|
854
|
+
};
|
|
855
|
+
for (const key of optionsKeys) {
|
|
856
|
+
delete data[key];
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
return data;
|
|
860
|
+
}
|
|
861
|
+
static hasDefaultValue(options) {
|
|
862
|
+
const prefix = 'defaultValue';
|
|
863
|
+
for (const option in options) {
|
|
864
|
+
if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && undefined !== options[option]) {
|
|
865
|
+
return true;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
return false;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
const capitalize = string => string.charAt(0).toUpperCase() + string.slice(1);
|
|
873
|
+
class LanguageUtil {
|
|
874
|
+
constructor(options) {
|
|
875
|
+
this.options = options;
|
|
876
|
+
this.supportedLngs = this.options.supportedLngs || false;
|
|
877
|
+
this.logger = baseLogger.create('languageUtils');
|
|
878
|
+
}
|
|
879
|
+
getScriptPartFromCode(code) {
|
|
880
|
+
code = getCleanedCode(code);
|
|
881
|
+
if (!code || code.indexOf('-') < 0) return null;
|
|
882
|
+
const p = code.split('-');
|
|
883
|
+
if (p.length === 2) return null;
|
|
884
|
+
p.pop();
|
|
885
|
+
if (p[p.length - 1].toLowerCase() === 'x') return null;
|
|
886
|
+
return this.formatLanguageCode(p.join('-'));
|
|
887
|
+
}
|
|
888
|
+
getLanguagePartFromCode(code) {
|
|
889
|
+
code = getCleanedCode(code);
|
|
890
|
+
if (!code || code.indexOf('-') < 0) return code;
|
|
891
|
+
const p = code.split('-');
|
|
892
|
+
return this.formatLanguageCode(p[0]);
|
|
893
|
+
}
|
|
894
|
+
formatLanguageCode(code) {
|
|
895
|
+
if (isString(code) && code.indexOf('-') > -1) {
|
|
896
|
+
if (typeof Intl !== 'undefined' && typeof Intl.getCanonicalLocales !== 'undefined') {
|
|
897
|
+
try {
|
|
898
|
+
let formattedCode = Intl.getCanonicalLocales(code)[0];
|
|
899
|
+
if (formattedCode && this.options.lowerCaseLng) {
|
|
900
|
+
formattedCode = formattedCode.toLowerCase();
|
|
901
|
+
}
|
|
902
|
+
if (formattedCode) return formattedCode;
|
|
903
|
+
} catch (e) {}
|
|
904
|
+
}
|
|
905
|
+
const specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab'];
|
|
906
|
+
let p = code.split('-');
|
|
907
|
+
if (this.options.lowerCaseLng) {
|
|
908
|
+
p = p.map(part => part.toLowerCase());
|
|
909
|
+
} else if (p.length === 2) {
|
|
910
|
+
p[0] = p[0].toLowerCase();
|
|
911
|
+
p[1] = p[1].toUpperCase();
|
|
912
|
+
if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
|
|
913
|
+
} else if (p.length === 3) {
|
|
914
|
+
p[0] = p[0].toLowerCase();
|
|
915
|
+
if (p[1].length === 2) p[1] = p[1].toUpperCase();
|
|
916
|
+
if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase();
|
|
917
|
+
if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
|
|
918
|
+
if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());
|
|
919
|
+
}
|
|
920
|
+
return p.join('-');
|
|
921
|
+
}
|
|
922
|
+
return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
|
|
923
|
+
}
|
|
924
|
+
isSupportedCode(code) {
|
|
925
|
+
if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {
|
|
926
|
+
code = this.getLanguagePartFromCode(code);
|
|
927
|
+
}
|
|
928
|
+
return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;
|
|
929
|
+
}
|
|
930
|
+
getBestMatchFromCodes(codes) {
|
|
931
|
+
if (!codes) return null;
|
|
932
|
+
let found;
|
|
933
|
+
codes.forEach(code => {
|
|
934
|
+
if (found) return;
|
|
935
|
+
const cleanedLng = this.formatLanguageCode(code);
|
|
936
|
+
if (!this.options.supportedLngs || this.isSupportedCode(cleanedLng)) found = cleanedLng;
|
|
937
|
+
});
|
|
938
|
+
if (!found && this.options.supportedLngs) {
|
|
939
|
+
codes.forEach(code => {
|
|
940
|
+
if (found) return;
|
|
941
|
+
const lngOnly = this.getLanguagePartFromCode(code);
|
|
942
|
+
if (this.isSupportedCode(lngOnly)) return found = lngOnly;
|
|
943
|
+
found = this.options.supportedLngs.find(supportedLng => {
|
|
944
|
+
if (supportedLng === lngOnly) return supportedLng;
|
|
945
|
+
if (supportedLng.indexOf('-') < 0 && lngOnly.indexOf('-') < 0) return;
|
|
946
|
+
if (supportedLng.indexOf('-') > 0 && lngOnly.indexOf('-') < 0 && supportedLng.substring(0, supportedLng.indexOf('-')) === lngOnly) return supportedLng;
|
|
947
|
+
if (supportedLng.indexOf(lngOnly) === 0 && lngOnly.length > 1) return supportedLng;
|
|
948
|
+
});
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];
|
|
952
|
+
return found;
|
|
953
|
+
}
|
|
954
|
+
getFallbackCodes(fallbacks, code) {
|
|
955
|
+
if (!fallbacks) return [];
|
|
956
|
+
if (typeof fallbacks === 'function') fallbacks = fallbacks(code);
|
|
957
|
+
if (isString(fallbacks)) fallbacks = [fallbacks];
|
|
958
|
+
if (Array.isArray(fallbacks)) return fallbacks;
|
|
959
|
+
if (!code) return fallbacks.default || [];
|
|
960
|
+
let found = fallbacks[code];
|
|
961
|
+
if (!found) found = fallbacks[this.getScriptPartFromCode(code)];
|
|
962
|
+
if (!found) found = fallbacks[this.formatLanguageCode(code)];
|
|
963
|
+
if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];
|
|
964
|
+
if (!found) found = fallbacks.default;
|
|
965
|
+
return found || [];
|
|
966
|
+
}
|
|
967
|
+
toResolveHierarchy(code, fallbackCode) {
|
|
968
|
+
const fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code);
|
|
969
|
+
const codes = [];
|
|
970
|
+
const addCode = c => {
|
|
971
|
+
if (!c) return;
|
|
972
|
+
if (this.isSupportedCode(c)) {
|
|
973
|
+
codes.push(c);
|
|
974
|
+
} else {
|
|
975
|
+
this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`);
|
|
976
|
+
}
|
|
977
|
+
};
|
|
978
|
+
if (isString(code) && (code.indexOf('-') > -1 || code.indexOf('_') > -1)) {
|
|
979
|
+
if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));
|
|
980
|
+
if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));
|
|
981
|
+
if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));
|
|
982
|
+
} else if (isString(code)) {
|
|
983
|
+
addCode(this.formatLanguageCode(code));
|
|
984
|
+
}
|
|
985
|
+
fallbackCodes.forEach(fc => {
|
|
986
|
+
if (codes.indexOf(fc) < 0) addCode(this.formatLanguageCode(fc));
|
|
987
|
+
});
|
|
988
|
+
return codes;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
let sets = [{
|
|
993
|
+
lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'pt', 'pt-BR', 'tg', 'tl', 'ti', 'tr', 'uz', 'wa'],
|
|
994
|
+
nr: [1, 2],
|
|
995
|
+
fc: 1
|
|
996
|
+
}, {
|
|
997
|
+
lngs: ['af', 'an', 'ast', 'az', 'bg', 'bn', 'ca', 'da', 'de', 'dev', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fi', 'fo', 'fur', 'fy', 'gl', 'gu', 'ha', 'hi', 'hu', 'hy', 'ia', 'it', 'kk', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt-PT', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'],
|
|
998
|
+
nr: [1, 2],
|
|
999
|
+
fc: 2
|
|
1000
|
+
}, {
|
|
1001
|
+
lngs: ['ay', 'bo', 'cgg', 'fa', 'ht', 'id', 'ja', 'jbo', 'ka', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],
|
|
1002
|
+
nr: [1],
|
|
1003
|
+
fc: 3
|
|
1004
|
+
}, {
|
|
1005
|
+
lngs: ['be', 'bs', 'cnr', 'dz', 'hr', 'ru', 'sr', 'uk'],
|
|
1006
|
+
nr: [1, 2, 5],
|
|
1007
|
+
fc: 4
|
|
1008
|
+
}, {
|
|
1009
|
+
lngs: ['ar'],
|
|
1010
|
+
nr: [0, 1, 2, 3, 11, 100],
|
|
1011
|
+
fc: 5
|
|
1012
|
+
}, {
|
|
1013
|
+
lngs: ['cs', 'sk'],
|
|
1014
|
+
nr: [1, 2, 5],
|
|
1015
|
+
fc: 6
|
|
1016
|
+
}, {
|
|
1017
|
+
lngs: ['csb', 'pl'],
|
|
1018
|
+
nr: [1, 2, 5],
|
|
1019
|
+
fc: 7
|
|
1020
|
+
}, {
|
|
1021
|
+
lngs: ['cy'],
|
|
1022
|
+
nr: [1, 2, 3, 8],
|
|
1023
|
+
fc: 8
|
|
1024
|
+
}, {
|
|
1025
|
+
lngs: ['fr'],
|
|
1026
|
+
nr: [1, 2],
|
|
1027
|
+
fc: 9
|
|
1028
|
+
}, {
|
|
1029
|
+
lngs: ['ga'],
|
|
1030
|
+
nr: [1, 2, 3, 7, 11],
|
|
1031
|
+
fc: 10
|
|
1032
|
+
}, {
|
|
1033
|
+
lngs: ['gd'],
|
|
1034
|
+
nr: [1, 2, 3, 20],
|
|
1035
|
+
fc: 11
|
|
1036
|
+
}, {
|
|
1037
|
+
lngs: ['is'],
|
|
1038
|
+
nr: [1, 2],
|
|
1039
|
+
fc: 12
|
|
1040
|
+
}, {
|
|
1041
|
+
lngs: ['jv'],
|
|
1042
|
+
nr: [0, 1],
|
|
1043
|
+
fc: 13
|
|
1044
|
+
}, {
|
|
1045
|
+
lngs: ['kw'],
|
|
1046
|
+
nr: [1, 2, 3, 4],
|
|
1047
|
+
fc: 14
|
|
1048
|
+
}, {
|
|
1049
|
+
lngs: ['lt'],
|
|
1050
|
+
nr: [1, 2, 10],
|
|
1051
|
+
fc: 15
|
|
1052
|
+
}, {
|
|
1053
|
+
lngs: ['lv'],
|
|
1054
|
+
nr: [1, 2, 0],
|
|
1055
|
+
fc: 16
|
|
1056
|
+
}, {
|
|
1057
|
+
lngs: ['mk'],
|
|
1058
|
+
nr: [1, 2],
|
|
1059
|
+
fc: 17
|
|
1060
|
+
}, {
|
|
1061
|
+
lngs: ['mnk'],
|
|
1062
|
+
nr: [0, 1, 2],
|
|
1063
|
+
fc: 18
|
|
1064
|
+
}, {
|
|
1065
|
+
lngs: ['mt'],
|
|
1066
|
+
nr: [1, 2, 11, 20],
|
|
1067
|
+
fc: 19
|
|
1068
|
+
}, {
|
|
1069
|
+
lngs: ['or'],
|
|
1070
|
+
nr: [2, 1],
|
|
1071
|
+
fc: 2
|
|
1072
|
+
}, {
|
|
1073
|
+
lngs: ['ro'],
|
|
1074
|
+
nr: [1, 2, 20],
|
|
1075
|
+
fc: 20
|
|
1076
|
+
}, {
|
|
1077
|
+
lngs: ['sl'],
|
|
1078
|
+
nr: [5, 1, 2, 3],
|
|
1079
|
+
fc: 21
|
|
1080
|
+
}, {
|
|
1081
|
+
lngs: ['he', 'iw'],
|
|
1082
|
+
nr: [1, 2, 20, 21],
|
|
1083
|
+
fc: 22
|
|
1084
|
+
}];
|
|
1085
|
+
let _rulesPluralsTypes = {
|
|
1086
|
+
1: n => Number(n > 1),
|
|
1087
|
+
2: n => Number(n != 1),
|
|
1088
|
+
3: n => 0,
|
|
1089
|
+
4: n => Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2),
|
|
1090
|
+
5: n => Number(n == 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5),
|
|
1091
|
+
6: n => Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2),
|
|
1092
|
+
7: n => Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2),
|
|
1093
|
+
8: n => Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3),
|
|
1094
|
+
9: n => Number(n >= 2),
|
|
1095
|
+
10: n => Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4),
|
|
1096
|
+
11: n => Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3),
|
|
1097
|
+
12: n => Number(n % 10 != 1 || n % 100 == 11),
|
|
1098
|
+
13: n => Number(n !== 0),
|
|
1099
|
+
14: n => Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3),
|
|
1100
|
+
15: n => Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2),
|
|
1101
|
+
16: n => Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2),
|
|
1102
|
+
17: n => Number(n == 1 || n % 10 == 1 && n % 100 != 11 ? 0 : 1),
|
|
1103
|
+
18: n => Number(n == 0 ? 0 : n == 1 ? 1 : 2),
|
|
1104
|
+
19: n => Number(n == 1 ? 0 : n == 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3),
|
|
1105
|
+
20: n => Number(n == 1 ? 0 : n == 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2),
|
|
1106
|
+
21: n => Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0),
|
|
1107
|
+
22: n => Number(n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3)
|
|
1108
|
+
};
|
|
1109
|
+
const nonIntlVersions = ['v1', 'v2', 'v3'];
|
|
1110
|
+
const intlVersions = ['v4'];
|
|
1111
|
+
const suffixesOrder = {
|
|
1112
|
+
zero: 0,
|
|
1113
|
+
one: 1,
|
|
1114
|
+
two: 2,
|
|
1115
|
+
few: 3,
|
|
1116
|
+
many: 4,
|
|
1117
|
+
other: 5
|
|
1118
|
+
};
|
|
1119
|
+
const createRules = () => {
|
|
1120
|
+
const rules = {};
|
|
1121
|
+
sets.forEach(set => {
|
|
1122
|
+
set.lngs.forEach(l => {
|
|
1123
|
+
rules[l] = {
|
|
1124
|
+
numbers: set.nr,
|
|
1125
|
+
plurals: _rulesPluralsTypes[set.fc]
|
|
1126
|
+
};
|
|
1127
|
+
});
|
|
1128
|
+
});
|
|
1129
|
+
return rules;
|
|
1130
|
+
};
|
|
1131
|
+
class PluralResolver {
|
|
1132
|
+
constructor(languageUtils) {
|
|
1133
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1134
|
+
this.languageUtils = languageUtils;
|
|
1135
|
+
this.options = options;
|
|
1136
|
+
this.logger = baseLogger.create('pluralResolver');
|
|
1137
|
+
if ((!this.options.compatibilityJSON || intlVersions.includes(this.options.compatibilityJSON)) && (typeof Intl === 'undefined' || !Intl.PluralRules)) {
|
|
1138
|
+
this.options.compatibilityJSON = 'v3';
|
|
1139
|
+
this.logger.error('Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.');
|
|
1140
|
+
}
|
|
1141
|
+
this.rules = createRules();
|
|
1142
|
+
this.pluralRulesCache = {};
|
|
1143
|
+
}
|
|
1144
|
+
addRule(lng, obj) {
|
|
1145
|
+
this.rules[lng] = obj;
|
|
1146
|
+
}
|
|
1147
|
+
clearCache() {
|
|
1148
|
+
this.pluralRulesCache = {};
|
|
1149
|
+
}
|
|
1150
|
+
getRule(code) {
|
|
1151
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1152
|
+
if (this.shouldUseIntlApi()) {
|
|
1153
|
+
const cleanedCode = getCleanedCode(code === 'dev' ? 'en' : code);
|
|
1154
|
+
const type = options.ordinal ? 'ordinal' : 'cardinal';
|
|
1155
|
+
const cacheKey = JSON.stringify({
|
|
1156
|
+
cleanedCode,
|
|
1157
|
+
type
|
|
1158
|
+
});
|
|
1159
|
+
if (cacheKey in this.pluralRulesCache) {
|
|
1160
|
+
return this.pluralRulesCache[cacheKey];
|
|
1161
|
+
}
|
|
1162
|
+
let rule;
|
|
1163
|
+
try {
|
|
1164
|
+
rule = new Intl.PluralRules(cleanedCode, {
|
|
1165
|
+
type
|
|
1166
|
+
});
|
|
1167
|
+
} catch (err) {
|
|
1168
|
+
if (!code.match(/-|_/)) return;
|
|
1169
|
+
const lngPart = this.languageUtils.getLanguagePartFromCode(code);
|
|
1170
|
+
rule = this.getRule(lngPart, options);
|
|
1171
|
+
}
|
|
1172
|
+
this.pluralRulesCache[cacheKey] = rule;
|
|
1173
|
+
return rule;
|
|
1174
|
+
}
|
|
1175
|
+
return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];
|
|
1176
|
+
}
|
|
1177
|
+
needsPlural(code) {
|
|
1178
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1179
|
+
const rule = this.getRule(code, options);
|
|
1180
|
+
if (this.shouldUseIntlApi()) {
|
|
1181
|
+
return rule && rule.resolvedOptions().pluralCategories.length > 1;
|
|
1182
|
+
}
|
|
1183
|
+
return rule && rule.numbers.length > 1;
|
|
1184
|
+
}
|
|
1185
|
+
getPluralFormsOfKey(code, key) {
|
|
1186
|
+
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1187
|
+
return this.getSuffixes(code, options).map(suffix => `${key}${suffix}`);
|
|
1188
|
+
}
|
|
1189
|
+
getSuffixes(code) {
|
|
1190
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1191
|
+
const rule = this.getRule(code, options);
|
|
1192
|
+
if (!rule) {
|
|
1193
|
+
return [];
|
|
1194
|
+
}
|
|
1195
|
+
if (this.shouldUseIntlApi()) {
|
|
1196
|
+
return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map(pluralCategory => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${pluralCategory}`);
|
|
1197
|
+
}
|
|
1198
|
+
return rule.numbers.map(number => this.getSuffix(code, number, options));
|
|
1199
|
+
}
|
|
1200
|
+
getSuffix(code, count) {
|
|
1201
|
+
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1202
|
+
const rule = this.getRule(code, options);
|
|
1203
|
+
if (rule) {
|
|
1204
|
+
if (this.shouldUseIntlApi()) {
|
|
1205
|
+
return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${rule.select(count)}`;
|
|
1206
|
+
}
|
|
1207
|
+
return this.getSuffixRetroCompatible(rule, count);
|
|
1208
|
+
}
|
|
1209
|
+
this.logger.warn(`no plural rule found for: ${code}`);
|
|
1210
|
+
return '';
|
|
1211
|
+
}
|
|
1212
|
+
getSuffixRetroCompatible(rule, count) {
|
|
1213
|
+
const idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));
|
|
1214
|
+
let suffix = rule.numbers[idx];
|
|
1215
|
+
if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
|
|
1216
|
+
if (suffix === 2) {
|
|
1217
|
+
suffix = 'plural';
|
|
1218
|
+
} else if (suffix === 1) {
|
|
1219
|
+
suffix = '';
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
const returnSuffix = () => this.options.prepend && suffix.toString() ? this.options.prepend + suffix.toString() : suffix.toString();
|
|
1223
|
+
if (this.options.compatibilityJSON === 'v1') {
|
|
1224
|
+
if (suffix === 1) return '';
|
|
1225
|
+
if (typeof suffix === 'number') return `_plural_${suffix.toString()}`;
|
|
1226
|
+
return returnSuffix();
|
|
1227
|
+
} else if (this.options.compatibilityJSON === 'v2') {
|
|
1228
|
+
return returnSuffix();
|
|
1229
|
+
} else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
|
|
1230
|
+
return returnSuffix();
|
|
1231
|
+
}
|
|
1232
|
+
return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();
|
|
1233
|
+
}
|
|
1234
|
+
shouldUseIntlApi() {
|
|
1235
|
+
return !nonIntlVersions.includes(this.options.compatibilityJSON);
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
const deepFindWithDefaults = function (data, defaultData, key) {
|
|
1240
|
+
let keySeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '.';
|
|
1241
|
+
let ignoreJSONStructure = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
1242
|
+
let path = getPathWithDefaults(data, defaultData, key);
|
|
1243
|
+
if (!path && ignoreJSONStructure && isString(key)) {
|
|
1244
|
+
path = deepFind(data, key, keySeparator);
|
|
1245
|
+
if (path === undefined) path = deepFind(defaultData, key, keySeparator);
|
|
1246
|
+
}
|
|
1247
|
+
return path;
|
|
1248
|
+
};
|
|
1249
|
+
const regexSafe = val => val.replace(/\$/g, '$$$$');
|
|
1250
|
+
class Interpolator {
|
|
1251
|
+
constructor() {
|
|
1252
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1253
|
+
this.logger = baseLogger.create('interpolator');
|
|
1254
|
+
this.options = options;
|
|
1255
|
+
this.format = options.interpolation && options.interpolation.format || (value => value);
|
|
1256
|
+
this.init(options);
|
|
1257
|
+
}
|
|
1258
|
+
init() {
|
|
1259
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1260
|
+
if (!options.interpolation) options.interpolation = {
|
|
1261
|
+
escapeValue: true
|
|
1262
|
+
};
|
|
1263
|
+
const {
|
|
1264
|
+
escape: escape$1,
|
|
1265
|
+
escapeValue,
|
|
1266
|
+
useRawValueToEscape,
|
|
1267
|
+
prefix,
|
|
1268
|
+
prefixEscaped,
|
|
1269
|
+
suffix,
|
|
1270
|
+
suffixEscaped,
|
|
1271
|
+
formatSeparator,
|
|
1272
|
+
unescapeSuffix,
|
|
1273
|
+
unescapePrefix,
|
|
1274
|
+
nestingPrefix,
|
|
1275
|
+
nestingPrefixEscaped,
|
|
1276
|
+
nestingSuffix,
|
|
1277
|
+
nestingSuffixEscaped,
|
|
1278
|
+
nestingOptionsSeparator,
|
|
1279
|
+
maxReplaces,
|
|
1280
|
+
alwaysFormat
|
|
1281
|
+
} = options.interpolation;
|
|
1282
|
+
this.escape = escape$1 !== undefined ? escape$1 : escape;
|
|
1283
|
+
this.escapeValue = escapeValue !== undefined ? escapeValue : true;
|
|
1284
|
+
this.useRawValueToEscape = useRawValueToEscape !== undefined ? useRawValueToEscape : false;
|
|
1285
|
+
this.prefix = prefix ? regexEscape(prefix) : prefixEscaped || '{{';
|
|
1286
|
+
this.suffix = suffix ? regexEscape(suffix) : suffixEscaped || '}}';
|
|
1287
|
+
this.formatSeparator = formatSeparator || ',';
|
|
1288
|
+
this.unescapePrefix = unescapeSuffix ? '' : unescapePrefix || '-';
|
|
1289
|
+
this.unescapeSuffix = this.unescapePrefix ? '' : unescapeSuffix || '';
|
|
1290
|
+
this.nestingPrefix = nestingPrefix ? regexEscape(nestingPrefix) : nestingPrefixEscaped || regexEscape('$t(');
|
|
1291
|
+
this.nestingSuffix = nestingSuffix ? regexEscape(nestingSuffix) : nestingSuffixEscaped || regexEscape(')');
|
|
1292
|
+
this.nestingOptionsSeparator = nestingOptionsSeparator || ',';
|
|
1293
|
+
this.maxReplaces = maxReplaces || 1000;
|
|
1294
|
+
this.alwaysFormat = alwaysFormat !== undefined ? alwaysFormat : false;
|
|
1295
|
+
this.resetRegExp();
|
|
1296
|
+
}
|
|
1297
|
+
reset() {
|
|
1298
|
+
if (this.options) this.init(this.options);
|
|
1299
|
+
}
|
|
1300
|
+
resetRegExp() {
|
|
1301
|
+
const getOrResetRegExp = (existingRegExp, pattern) => {
|
|
1302
|
+
if (existingRegExp && existingRegExp.source === pattern) {
|
|
1303
|
+
existingRegExp.lastIndex = 0;
|
|
1304
|
+
return existingRegExp;
|
|
1305
|
+
}
|
|
1306
|
+
return new RegExp(pattern, 'g');
|
|
1307
|
+
};
|
|
1308
|
+
this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);
|
|
1309
|
+
this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);
|
|
1310
|
+
this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
|
|
1311
|
+
}
|
|
1312
|
+
interpolate(str, data, lng, options) {
|
|
1313
|
+
let match;
|
|
1314
|
+
let value;
|
|
1315
|
+
let replaces;
|
|
1316
|
+
const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
|
|
1317
|
+
const handleFormat = key => {
|
|
1318
|
+
if (key.indexOf(this.formatSeparator) < 0) {
|
|
1319
|
+
const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
1320
|
+
return this.alwaysFormat ? this.format(path, undefined, lng, {
|
|
1321
|
+
...options,
|
|
1322
|
+
...data,
|
|
1323
|
+
interpolationkey: key
|
|
1324
|
+
}) : path;
|
|
1325
|
+
}
|
|
1326
|
+
const p = key.split(this.formatSeparator);
|
|
1327
|
+
const k = p.shift().trim();
|
|
1328
|
+
const f = p.join(this.formatSeparator).trim();
|
|
1329
|
+
return this.format(deepFindWithDefaults(data, defaultData, k, this.options.keySeparator, this.options.ignoreJSONStructure), f, lng, {
|
|
1330
|
+
...options,
|
|
1331
|
+
...data,
|
|
1332
|
+
interpolationkey: k
|
|
1333
|
+
});
|
|
1334
|
+
};
|
|
1335
|
+
this.resetRegExp();
|
|
1336
|
+
const missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler;
|
|
1337
|
+
const skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
1338
|
+
const todos = [{
|
|
1339
|
+
regex: this.regexpUnescape,
|
|
1340
|
+
safeValue: val => regexSafe(val)
|
|
1341
|
+
}, {
|
|
1342
|
+
regex: this.regexp,
|
|
1343
|
+
safeValue: val => this.escapeValue ? regexSafe(this.escape(val)) : regexSafe(val)
|
|
1344
|
+
}];
|
|
1345
|
+
todos.forEach(todo => {
|
|
1346
|
+
replaces = 0;
|
|
1347
|
+
while (match = todo.regex.exec(str)) {
|
|
1348
|
+
const matchedVar = match[1].trim();
|
|
1349
|
+
value = handleFormat(matchedVar);
|
|
1350
|
+
if (value === undefined) {
|
|
1351
|
+
if (typeof missingInterpolationHandler === 'function') {
|
|
1352
|
+
const temp = missingInterpolationHandler(str, match, options);
|
|
1353
|
+
value = isString(temp) ? temp : '';
|
|
1354
|
+
} else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {
|
|
1355
|
+
value = '';
|
|
1356
|
+
} else if (skipOnVariables) {
|
|
1357
|
+
value = match[0];
|
|
1358
|
+
continue;
|
|
1359
|
+
} else {
|
|
1360
|
+
this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`);
|
|
1361
|
+
value = '';
|
|
1362
|
+
}
|
|
1363
|
+
} else if (!isString(value) && !this.useRawValueToEscape) {
|
|
1364
|
+
value = makeString(value);
|
|
1365
|
+
}
|
|
1366
|
+
const safeValue = todo.safeValue(value);
|
|
1367
|
+
str = str.replace(match[0], safeValue);
|
|
1368
|
+
if (skipOnVariables) {
|
|
1369
|
+
todo.regex.lastIndex += value.length;
|
|
1370
|
+
todo.regex.lastIndex -= match[0].length;
|
|
1371
|
+
} else {
|
|
1372
|
+
todo.regex.lastIndex = 0;
|
|
1373
|
+
}
|
|
1374
|
+
replaces++;
|
|
1375
|
+
if (replaces >= this.maxReplaces) {
|
|
1376
|
+
break;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
});
|
|
1380
|
+
return str;
|
|
1381
|
+
}
|
|
1382
|
+
nest(str, fc) {
|
|
1383
|
+
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1384
|
+
let match;
|
|
1385
|
+
let value;
|
|
1386
|
+
let clonedOptions;
|
|
1387
|
+
const handleHasOptions = (key, inheritedOptions) => {
|
|
1388
|
+
const sep = this.nestingOptionsSeparator;
|
|
1389
|
+
if (key.indexOf(sep) < 0) return key;
|
|
1390
|
+
const c = key.split(new RegExp(`${sep}[ ]*{`));
|
|
1391
|
+
let optionsString = `{${c[1]}`;
|
|
1392
|
+
key = c[0];
|
|
1393
|
+
optionsString = this.interpolate(optionsString, clonedOptions);
|
|
1394
|
+
const matchedSingleQuotes = optionsString.match(/'/g);
|
|
1395
|
+
const matchedDoubleQuotes = optionsString.match(/"/g);
|
|
1396
|
+
if (matchedSingleQuotes && matchedSingleQuotes.length % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
|
|
1397
|
+
optionsString = optionsString.replace(/'/g, '"');
|
|
1398
|
+
}
|
|
1399
|
+
try {
|
|
1400
|
+
clonedOptions = JSON.parse(optionsString);
|
|
1401
|
+
if (inheritedOptions) clonedOptions = {
|
|
1402
|
+
...inheritedOptions,
|
|
1403
|
+
...clonedOptions
|
|
1404
|
+
};
|
|
1405
|
+
} catch (e) {
|
|
1406
|
+
this.logger.warn(`failed parsing options string in nesting for key ${key}`, e);
|
|
1407
|
+
return `${key}${sep}${optionsString}`;
|
|
1408
|
+
}
|
|
1409
|
+
if (clonedOptions.defaultValue && clonedOptions.defaultValue.indexOf(this.prefix) > -1) delete clonedOptions.defaultValue;
|
|
1410
|
+
return key;
|
|
1411
|
+
};
|
|
1412
|
+
while (match = this.nestingRegexp.exec(str)) {
|
|
1413
|
+
let formatters = [];
|
|
1414
|
+
clonedOptions = {
|
|
1415
|
+
...options
|
|
1416
|
+
};
|
|
1417
|
+
clonedOptions = clonedOptions.replace && !isString(clonedOptions.replace) ? clonedOptions.replace : clonedOptions;
|
|
1418
|
+
clonedOptions.applyPostProcessor = false;
|
|
1419
|
+
delete clonedOptions.defaultValue;
|
|
1420
|
+
let doReduce = false;
|
|
1421
|
+
if (match[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(match[1])) {
|
|
1422
|
+
const r = match[1].split(this.formatSeparator).map(elem => elem.trim());
|
|
1423
|
+
match[1] = r.shift();
|
|
1424
|
+
formatters = r;
|
|
1425
|
+
doReduce = true;
|
|
1426
|
+
}
|
|
1427
|
+
value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);
|
|
1428
|
+
if (value && match[0] === str && !isString(value)) return value;
|
|
1429
|
+
if (!isString(value)) value = makeString(value);
|
|
1430
|
+
if (!value) {
|
|
1431
|
+
this.logger.warn(`missed to resolve ${match[1]} for nesting ${str}`);
|
|
1432
|
+
value = '';
|
|
1433
|
+
}
|
|
1434
|
+
if (doReduce) {
|
|
1435
|
+
value = formatters.reduce((v, f) => this.format(v, f, options.lng, {
|
|
1436
|
+
...options,
|
|
1437
|
+
interpolationkey: match[1].trim()
|
|
1438
|
+
}), value.trim());
|
|
1439
|
+
}
|
|
1440
|
+
str = str.replace(match[0], value);
|
|
1441
|
+
this.regexp.lastIndex = 0;
|
|
1442
|
+
}
|
|
1443
|
+
return str;
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
const parseFormatStr = formatStr => {
|
|
1448
|
+
let formatName = formatStr.toLowerCase().trim();
|
|
1449
|
+
const formatOptions = {};
|
|
1450
|
+
if (formatStr.indexOf('(') > -1) {
|
|
1451
|
+
const p = formatStr.split('(');
|
|
1452
|
+
formatName = p[0].toLowerCase().trim();
|
|
1453
|
+
const optStr = p[1].substring(0, p[1].length - 1);
|
|
1454
|
+
if (formatName === 'currency' && optStr.indexOf(':') < 0) {
|
|
1455
|
+
if (!formatOptions.currency) formatOptions.currency = optStr.trim();
|
|
1456
|
+
} else if (formatName === 'relativetime' && optStr.indexOf(':') < 0) {
|
|
1457
|
+
if (!formatOptions.range) formatOptions.range = optStr.trim();
|
|
1458
|
+
} else {
|
|
1459
|
+
const opts = optStr.split(';');
|
|
1460
|
+
opts.forEach(opt => {
|
|
1461
|
+
if (opt) {
|
|
1462
|
+
const [key, ...rest] = opt.split(':');
|
|
1463
|
+
const val = rest.join(':').trim().replace(/^'+|'+$/g, '');
|
|
1464
|
+
const trimmedKey = key.trim();
|
|
1465
|
+
if (!formatOptions[trimmedKey]) formatOptions[trimmedKey] = val;
|
|
1466
|
+
if (val === 'false') formatOptions[trimmedKey] = false;
|
|
1467
|
+
if (val === 'true') formatOptions[trimmedKey] = true;
|
|
1468
|
+
if (!isNaN(val)) formatOptions[trimmedKey] = parseInt(val, 10);
|
|
1469
|
+
}
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
return {
|
|
1474
|
+
formatName,
|
|
1475
|
+
formatOptions
|
|
1476
|
+
};
|
|
1477
|
+
};
|
|
1478
|
+
const createCachedFormatter = fn => {
|
|
1479
|
+
const cache = {};
|
|
1480
|
+
return (val, lng, options) => {
|
|
1481
|
+
let optForCache = options;
|
|
1482
|
+
if (options && options.interpolationkey && options.formatParams && options.formatParams[options.interpolationkey] && options[options.interpolationkey]) {
|
|
1483
|
+
optForCache = {
|
|
1484
|
+
...optForCache,
|
|
1485
|
+
[options.interpolationkey]: undefined
|
|
1486
|
+
};
|
|
1487
|
+
}
|
|
1488
|
+
const key = lng + JSON.stringify(optForCache);
|
|
1489
|
+
let formatter = cache[key];
|
|
1490
|
+
if (!formatter) {
|
|
1491
|
+
formatter = fn(getCleanedCode(lng), options);
|
|
1492
|
+
cache[key] = formatter;
|
|
1493
|
+
}
|
|
1494
|
+
return formatter(val);
|
|
1495
|
+
};
|
|
1496
|
+
};
|
|
1497
|
+
class Formatter {
|
|
1498
|
+
constructor() {
|
|
1499
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1500
|
+
this.logger = baseLogger.create('formatter');
|
|
1501
|
+
this.options = options;
|
|
1502
|
+
this.formats = {
|
|
1503
|
+
number: createCachedFormatter((lng, opt) => {
|
|
1504
|
+
const formatter = new Intl.NumberFormat(lng, {
|
|
1505
|
+
...opt
|
|
1506
|
+
});
|
|
1507
|
+
return val => formatter.format(val);
|
|
1508
|
+
}),
|
|
1509
|
+
currency: createCachedFormatter((lng, opt) => {
|
|
1510
|
+
const formatter = new Intl.NumberFormat(lng, {
|
|
1511
|
+
...opt,
|
|
1512
|
+
style: 'currency'
|
|
1513
|
+
});
|
|
1514
|
+
return val => formatter.format(val);
|
|
1515
|
+
}),
|
|
1516
|
+
datetime: createCachedFormatter((lng, opt) => {
|
|
1517
|
+
const formatter = new Intl.DateTimeFormat(lng, {
|
|
1518
|
+
...opt
|
|
1519
|
+
});
|
|
1520
|
+
return val => formatter.format(val);
|
|
1521
|
+
}),
|
|
1522
|
+
relativetime: createCachedFormatter((lng, opt) => {
|
|
1523
|
+
const formatter = new Intl.RelativeTimeFormat(lng, {
|
|
1524
|
+
...opt
|
|
1525
|
+
});
|
|
1526
|
+
return val => formatter.format(val, opt.range || 'day');
|
|
1527
|
+
}),
|
|
1528
|
+
list: createCachedFormatter((lng, opt) => {
|
|
1529
|
+
const formatter = new Intl.ListFormat(lng, {
|
|
1530
|
+
...opt
|
|
1531
|
+
});
|
|
1532
|
+
return val => formatter.format(val);
|
|
1533
|
+
})
|
|
1534
|
+
};
|
|
1535
|
+
this.init(options);
|
|
1536
|
+
}
|
|
1537
|
+
init(services) {
|
|
1538
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
1539
|
+
interpolation: {}
|
|
1540
|
+
};
|
|
1541
|
+
this.formatSeparator = options.interpolation.formatSeparator || ',';
|
|
1542
|
+
}
|
|
1543
|
+
add(name, fc) {
|
|
1544
|
+
this.formats[name.toLowerCase().trim()] = fc;
|
|
1545
|
+
}
|
|
1546
|
+
addCached(name, fc) {
|
|
1547
|
+
this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);
|
|
1548
|
+
}
|
|
1549
|
+
format(value, format, lng) {
|
|
1550
|
+
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
1551
|
+
const formats = format.split(this.formatSeparator);
|
|
1552
|
+
if (formats.length > 1 && formats[0].indexOf('(') > 1 && formats[0].indexOf(')') < 0 && formats.find(f => f.indexOf(')') > -1)) {
|
|
1553
|
+
const lastIndex = formats.findIndex(f => f.indexOf(')') > -1);
|
|
1554
|
+
formats[0] = [formats[0], ...formats.splice(1, lastIndex)].join(this.formatSeparator);
|
|
1555
|
+
}
|
|
1556
|
+
const result = formats.reduce((mem, f) => {
|
|
1557
|
+
const {
|
|
1558
|
+
formatName,
|
|
1559
|
+
formatOptions
|
|
1560
|
+
} = parseFormatStr(f);
|
|
1561
|
+
if (this.formats[formatName]) {
|
|
1562
|
+
let formatted = mem;
|
|
1563
|
+
try {
|
|
1564
|
+
const valOptions = options && options.formatParams && options.formatParams[options.interpolationkey] || {};
|
|
1565
|
+
const l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
|
|
1566
|
+
formatted = this.formats[formatName](mem, l, {
|
|
1567
|
+
...formatOptions,
|
|
1568
|
+
...options,
|
|
1569
|
+
...valOptions
|
|
1570
|
+
});
|
|
1571
|
+
} catch (error) {
|
|
1572
|
+
this.logger.warn(error);
|
|
1573
|
+
}
|
|
1574
|
+
return formatted;
|
|
1575
|
+
} else {
|
|
1576
|
+
this.logger.warn(`there was no format function for ${formatName}`);
|
|
1577
|
+
}
|
|
1578
|
+
return mem;
|
|
1579
|
+
}, value);
|
|
1580
|
+
return result;
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
const removePending = (q, name) => {
|
|
1585
|
+
if (q.pending[name] !== undefined) {
|
|
1586
|
+
delete q.pending[name];
|
|
1587
|
+
q.pendingCount--;
|
|
1588
|
+
}
|
|
1589
|
+
};
|
|
1590
|
+
class Connector extends EventEmitter {
|
|
1591
|
+
constructor(backend, store, services) {
|
|
1592
|
+
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
1593
|
+
super();
|
|
1594
|
+
this.backend = backend;
|
|
1595
|
+
this.store = store;
|
|
1596
|
+
this.services = services;
|
|
1597
|
+
this.languageUtils = services.languageUtils;
|
|
1598
|
+
this.options = options;
|
|
1599
|
+
this.logger = baseLogger.create('backendConnector');
|
|
1600
|
+
this.waitingReads = [];
|
|
1601
|
+
this.maxParallelReads = options.maxParallelReads || 10;
|
|
1602
|
+
this.readingCalls = 0;
|
|
1603
|
+
this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5;
|
|
1604
|
+
this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;
|
|
1605
|
+
this.state = {};
|
|
1606
|
+
this.queue = [];
|
|
1607
|
+
if (this.backend && this.backend.init) {
|
|
1608
|
+
this.backend.init(services, options.backend, options);
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
queueLoad(languages, namespaces, options, callback) {
|
|
1612
|
+
const toLoad = {};
|
|
1613
|
+
const pending = {};
|
|
1614
|
+
const toLoadLanguages = {};
|
|
1615
|
+
const toLoadNamespaces = {};
|
|
1616
|
+
languages.forEach(lng => {
|
|
1617
|
+
let hasAllNamespaces = true;
|
|
1618
|
+
namespaces.forEach(ns => {
|
|
1619
|
+
const name = `${lng}|${ns}`;
|
|
1620
|
+
if (!options.reload && this.store.hasResourceBundle(lng, ns)) {
|
|
1621
|
+
this.state[name] = 2;
|
|
1622
|
+
} else if (this.state[name] < 0) ; else if (this.state[name] === 1) {
|
|
1623
|
+
if (pending[name] === undefined) pending[name] = true;
|
|
1624
|
+
} else {
|
|
1625
|
+
this.state[name] = 1;
|
|
1626
|
+
hasAllNamespaces = false;
|
|
1627
|
+
if (pending[name] === undefined) pending[name] = true;
|
|
1628
|
+
if (toLoad[name] === undefined) toLoad[name] = true;
|
|
1629
|
+
if (toLoadNamespaces[ns] === undefined) toLoadNamespaces[ns] = true;
|
|
1630
|
+
}
|
|
1631
|
+
});
|
|
1632
|
+
if (!hasAllNamespaces) toLoadLanguages[lng] = true;
|
|
1633
|
+
});
|
|
1634
|
+
if (Object.keys(toLoad).length || Object.keys(pending).length) {
|
|
1635
|
+
this.queue.push({
|
|
1636
|
+
pending,
|
|
1637
|
+
pendingCount: Object.keys(pending).length,
|
|
1638
|
+
loaded: {},
|
|
1639
|
+
errors: [],
|
|
1640
|
+
callback
|
|
1641
|
+
});
|
|
1642
|
+
}
|
|
1643
|
+
return {
|
|
1644
|
+
toLoad: Object.keys(toLoad),
|
|
1645
|
+
pending: Object.keys(pending),
|
|
1646
|
+
toLoadLanguages: Object.keys(toLoadLanguages),
|
|
1647
|
+
toLoadNamespaces: Object.keys(toLoadNamespaces)
|
|
1648
|
+
};
|
|
1649
|
+
}
|
|
1650
|
+
loaded(name, err, data) {
|
|
1651
|
+
const s = name.split('|');
|
|
1652
|
+
const lng = s[0];
|
|
1653
|
+
const ns = s[1];
|
|
1654
|
+
if (err) this.emit('failedLoading', lng, ns, err);
|
|
1655
|
+
if (!err && data) {
|
|
1656
|
+
this.store.addResourceBundle(lng, ns, data, undefined, undefined, {
|
|
1657
|
+
skipCopy: true
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1660
|
+
this.state[name] = err ? -1 : 2;
|
|
1661
|
+
if (err && data) this.state[name] = 0;
|
|
1662
|
+
const loaded = {};
|
|
1663
|
+
this.queue.forEach(q => {
|
|
1664
|
+
pushPath(q.loaded, [lng], ns);
|
|
1665
|
+
removePending(q, name);
|
|
1666
|
+
if (err) q.errors.push(err);
|
|
1667
|
+
if (q.pendingCount === 0 && !q.done) {
|
|
1668
|
+
Object.keys(q.loaded).forEach(l => {
|
|
1669
|
+
if (!loaded[l]) loaded[l] = {};
|
|
1670
|
+
const loadedKeys = q.loaded[l];
|
|
1671
|
+
if (loadedKeys.length) {
|
|
1672
|
+
loadedKeys.forEach(n => {
|
|
1673
|
+
if (loaded[l][n] === undefined) loaded[l][n] = true;
|
|
1674
|
+
});
|
|
1675
|
+
}
|
|
1676
|
+
});
|
|
1677
|
+
q.done = true;
|
|
1678
|
+
if (q.errors.length) {
|
|
1679
|
+
q.callback(q.errors);
|
|
1680
|
+
} else {
|
|
1681
|
+
q.callback();
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
});
|
|
1685
|
+
this.emit('loaded', loaded);
|
|
1686
|
+
this.queue = this.queue.filter(q => !q.done);
|
|
1687
|
+
}
|
|
1688
|
+
read(lng, ns, fcName) {
|
|
1689
|
+
let tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1690
|
+
let wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.retryTimeout;
|
|
1691
|
+
let callback = arguments.length > 5 ? arguments[5] : undefined;
|
|
1692
|
+
if (!lng.length) return callback(null, {});
|
|
1693
|
+
if (this.readingCalls >= this.maxParallelReads) {
|
|
1694
|
+
this.waitingReads.push({
|
|
1695
|
+
lng,
|
|
1696
|
+
ns,
|
|
1697
|
+
fcName,
|
|
1698
|
+
tried,
|
|
1699
|
+
wait,
|
|
1700
|
+
callback
|
|
1701
|
+
});
|
|
1702
|
+
return;
|
|
1703
|
+
}
|
|
1704
|
+
this.readingCalls++;
|
|
1705
|
+
const resolver = (err, data) => {
|
|
1706
|
+
this.readingCalls--;
|
|
1707
|
+
if (this.waitingReads.length > 0) {
|
|
1708
|
+
const next = this.waitingReads.shift();
|
|
1709
|
+
this.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);
|
|
1710
|
+
}
|
|
1711
|
+
if (err && data && tried < this.maxRetries) {
|
|
1712
|
+
setTimeout(() => {
|
|
1713
|
+
this.read.call(this, lng, ns, fcName, tried + 1, wait * 2, callback);
|
|
1714
|
+
}, wait);
|
|
1715
|
+
return;
|
|
1716
|
+
}
|
|
1717
|
+
callback(err, data);
|
|
1718
|
+
};
|
|
1719
|
+
const fc = this.backend[fcName].bind(this.backend);
|
|
1720
|
+
if (fc.length === 2) {
|
|
1721
|
+
try {
|
|
1722
|
+
const r = fc(lng, ns);
|
|
1723
|
+
if (r && typeof r.then === 'function') {
|
|
1724
|
+
r.then(data => resolver(null, data)).catch(resolver);
|
|
1725
|
+
} else {
|
|
1726
|
+
resolver(null, r);
|
|
1727
|
+
}
|
|
1728
|
+
} catch (err) {
|
|
1729
|
+
resolver(err);
|
|
1730
|
+
}
|
|
1731
|
+
return;
|
|
1732
|
+
}
|
|
1733
|
+
return fc(lng, ns, resolver);
|
|
1734
|
+
}
|
|
1735
|
+
prepareLoading(languages, namespaces) {
|
|
1736
|
+
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1737
|
+
let callback = arguments.length > 3 ? arguments[3] : undefined;
|
|
1738
|
+
if (!this.backend) {
|
|
1739
|
+
this.logger.warn('No backend was added via i18next.use. Will not load resources.');
|
|
1740
|
+
return callback && callback();
|
|
1741
|
+
}
|
|
1742
|
+
if (isString(languages)) languages = this.languageUtils.toResolveHierarchy(languages);
|
|
1743
|
+
if (isString(namespaces)) namespaces = [namespaces];
|
|
1744
|
+
const toLoad = this.queueLoad(languages, namespaces, options, callback);
|
|
1745
|
+
if (!toLoad.toLoad.length) {
|
|
1746
|
+
if (!toLoad.pending.length) callback();
|
|
1747
|
+
return null;
|
|
1748
|
+
}
|
|
1749
|
+
toLoad.toLoad.forEach(name => {
|
|
1750
|
+
this.loadOne(name);
|
|
1751
|
+
});
|
|
1752
|
+
}
|
|
1753
|
+
load(languages, namespaces, callback) {
|
|
1754
|
+
this.prepareLoading(languages, namespaces, {}, callback);
|
|
1755
|
+
}
|
|
1756
|
+
reload(languages, namespaces, callback) {
|
|
1757
|
+
this.prepareLoading(languages, namespaces, {
|
|
1758
|
+
reload: true
|
|
1759
|
+
}, callback);
|
|
1760
|
+
}
|
|
1761
|
+
loadOne(name) {
|
|
1762
|
+
let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1763
|
+
const s = name.split('|');
|
|
1764
|
+
const lng = s[0];
|
|
1765
|
+
const ns = s[1];
|
|
1766
|
+
this.read(lng, ns, 'read', undefined, undefined, (err, data) => {
|
|
1767
|
+
if (err) this.logger.warn(`${prefix}loading namespace ${ns} for language ${lng} failed`, err);
|
|
1768
|
+
if (!err && data) this.logger.log(`${prefix}loaded namespace ${ns} for language ${lng}`, data);
|
|
1769
|
+
this.loaded(name, err, data);
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1772
|
+
saveMissing(languages, namespace, key, fallbackValue, isUpdate) {
|
|
1773
|
+
let options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
1774
|
+
let clb = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : () => {};
|
|
1775
|
+
if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) {
|
|
1776
|
+
this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
|
|
1777
|
+
return;
|
|
1778
|
+
}
|
|
1779
|
+
if (key === undefined || key === null || key === '') return;
|
|
1780
|
+
if (this.backend && this.backend.create) {
|
|
1781
|
+
const opts = {
|
|
1782
|
+
...options,
|
|
1783
|
+
isUpdate
|
|
1784
|
+
};
|
|
1785
|
+
const fc = this.backend.create.bind(this.backend);
|
|
1786
|
+
if (fc.length < 6) {
|
|
1787
|
+
try {
|
|
1788
|
+
let r;
|
|
1789
|
+
if (fc.length === 5) {
|
|
1790
|
+
r = fc(languages, namespace, key, fallbackValue, opts);
|
|
1791
|
+
} else {
|
|
1792
|
+
r = fc(languages, namespace, key, fallbackValue);
|
|
1793
|
+
}
|
|
1794
|
+
if (r && typeof r.then === 'function') {
|
|
1795
|
+
r.then(data => clb(null, data)).catch(clb);
|
|
1796
|
+
} else {
|
|
1797
|
+
clb(null, r);
|
|
1798
|
+
}
|
|
1799
|
+
} catch (err) {
|
|
1800
|
+
clb(err);
|
|
1801
|
+
}
|
|
1802
|
+
} else {
|
|
1803
|
+
fc(languages, namespace, key, fallbackValue, clb, opts);
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
if (!languages || !languages[0]) return;
|
|
1807
|
+
this.store.addResource(languages[0], namespace, key, fallbackValue);
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
const get = () => ({
|
|
1812
|
+
debug: false,
|
|
1813
|
+
initImmediate: true,
|
|
1814
|
+
ns: ['translation'],
|
|
1815
|
+
defaultNS: ['translation'],
|
|
1816
|
+
fallbackLng: ['dev'],
|
|
1817
|
+
fallbackNS: false,
|
|
1818
|
+
supportedLngs: false,
|
|
1819
|
+
nonExplicitSupportedLngs: false,
|
|
1820
|
+
load: 'all',
|
|
1821
|
+
preload: false,
|
|
1822
|
+
simplifyPluralSuffix: true,
|
|
1823
|
+
keySeparator: '.',
|
|
1824
|
+
nsSeparator: ':',
|
|
1825
|
+
pluralSeparator: '_',
|
|
1826
|
+
contextSeparator: '_',
|
|
1827
|
+
partialBundledLanguages: false,
|
|
1828
|
+
saveMissing: false,
|
|
1829
|
+
updateMissing: false,
|
|
1830
|
+
saveMissingTo: 'fallback',
|
|
1831
|
+
saveMissingPlurals: true,
|
|
1832
|
+
missingKeyHandler: false,
|
|
1833
|
+
missingInterpolationHandler: false,
|
|
1834
|
+
postProcess: false,
|
|
1835
|
+
postProcessPassResolved: false,
|
|
1836
|
+
returnNull: false,
|
|
1837
|
+
returnEmptyString: true,
|
|
1838
|
+
returnObjects: false,
|
|
1839
|
+
joinArrays: false,
|
|
1840
|
+
returnedObjectHandler: false,
|
|
1841
|
+
parseMissingKeyHandler: false,
|
|
1842
|
+
appendNamespaceToMissingKey: false,
|
|
1843
|
+
appendNamespaceToCIMode: false,
|
|
1844
|
+
overloadTranslationOptionHandler: args => {
|
|
1845
|
+
let ret = {};
|
|
1846
|
+
if (typeof args[1] === 'object') ret = args[1];
|
|
1847
|
+
if (isString(args[1])) ret.defaultValue = args[1];
|
|
1848
|
+
if (isString(args[2])) ret.tDescription = args[2];
|
|
1849
|
+
if (typeof args[2] === 'object' || typeof args[3] === 'object') {
|
|
1850
|
+
const options = args[3] || args[2];
|
|
1851
|
+
Object.keys(options).forEach(key => {
|
|
1852
|
+
ret[key] = options[key];
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
return ret;
|
|
1856
|
+
},
|
|
1857
|
+
interpolation: {
|
|
1858
|
+
escapeValue: true,
|
|
1859
|
+
format: value => value,
|
|
1860
|
+
prefix: '{{',
|
|
1861
|
+
suffix: '}}',
|
|
1862
|
+
formatSeparator: ',',
|
|
1863
|
+
unescapePrefix: '-',
|
|
1864
|
+
nestingPrefix: '$t(',
|
|
1865
|
+
nestingSuffix: ')',
|
|
1866
|
+
nestingOptionsSeparator: ',',
|
|
1867
|
+
maxReplaces: 1000,
|
|
1868
|
+
skipOnVariables: true
|
|
1869
|
+
}
|
|
1870
|
+
});
|
|
1871
|
+
const transformOptions = options => {
|
|
1872
|
+
if (isString(options.ns)) options.ns = [options.ns];
|
|
1873
|
+
if (isString(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
|
|
1874
|
+
if (isString(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
|
|
1875
|
+
if (options.supportedLngs && options.supportedLngs.indexOf('cimode') < 0) {
|
|
1876
|
+
options.supportedLngs = options.supportedLngs.concat(['cimode']);
|
|
1877
|
+
}
|
|
1878
|
+
return options;
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1881
|
+
const noop = () => {};
|
|
1882
|
+
const bindMemberFunctions = inst => {
|
|
1883
|
+
const mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));
|
|
1884
|
+
mems.forEach(mem => {
|
|
1885
|
+
if (typeof inst[mem] === 'function') {
|
|
1886
|
+
inst[mem] = inst[mem].bind(inst);
|
|
1887
|
+
}
|
|
1888
|
+
});
|
|
1889
|
+
};
|
|
1890
|
+
class I18n extends EventEmitter {
|
|
1891
|
+
constructor() {
|
|
1892
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1893
|
+
let callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
1894
|
+
super();
|
|
1895
|
+
this.options = transformOptions(options);
|
|
1896
|
+
this.services = {};
|
|
1897
|
+
this.logger = baseLogger;
|
|
1898
|
+
this.modules = {
|
|
1899
|
+
external: []
|
|
1900
|
+
};
|
|
1901
|
+
bindMemberFunctions(this);
|
|
1902
|
+
if (callback && !this.isInitialized && !options.isClone) {
|
|
1903
|
+
if (!this.options.initImmediate) {
|
|
1904
|
+
this.init(options, callback);
|
|
1905
|
+
return this;
|
|
1906
|
+
}
|
|
1907
|
+
setTimeout(() => {
|
|
1908
|
+
this.init(options, callback);
|
|
1909
|
+
}, 0);
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
init() {
|
|
1913
|
+
var _this = this;
|
|
1914
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1915
|
+
let callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
1916
|
+
this.isInitializing = true;
|
|
1917
|
+
if (typeof options === 'function') {
|
|
1918
|
+
callback = options;
|
|
1919
|
+
options = {};
|
|
1920
|
+
}
|
|
1921
|
+
if (!options.defaultNS && options.defaultNS !== false && options.ns) {
|
|
1922
|
+
if (isString(options.ns)) {
|
|
1923
|
+
options.defaultNS = options.ns;
|
|
1924
|
+
} else if (options.ns.indexOf('translation') < 0) {
|
|
1925
|
+
options.defaultNS = options.ns[0];
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
const defOpts = get();
|
|
1929
|
+
this.options = {
|
|
1930
|
+
...defOpts,
|
|
1931
|
+
...this.options,
|
|
1932
|
+
...transformOptions(options)
|
|
1933
|
+
};
|
|
1934
|
+
if (this.options.compatibilityAPI !== 'v1') {
|
|
1935
|
+
this.options.interpolation = {
|
|
1936
|
+
...defOpts.interpolation,
|
|
1937
|
+
...this.options.interpolation
|
|
1938
|
+
};
|
|
1939
|
+
}
|
|
1940
|
+
if (options.keySeparator !== undefined) {
|
|
1941
|
+
this.options.userDefinedKeySeparator = options.keySeparator;
|
|
1942
|
+
}
|
|
1943
|
+
if (options.nsSeparator !== undefined) {
|
|
1944
|
+
this.options.userDefinedNsSeparator = options.nsSeparator;
|
|
1945
|
+
}
|
|
1946
|
+
const createClassOnDemand = ClassOrObject => {
|
|
1947
|
+
if (!ClassOrObject) return null;
|
|
1948
|
+
if (typeof ClassOrObject === 'function') return new ClassOrObject();
|
|
1949
|
+
return ClassOrObject;
|
|
1950
|
+
};
|
|
1951
|
+
if (!this.options.isClone) {
|
|
1952
|
+
if (this.modules.logger) {
|
|
1953
|
+
baseLogger.init(createClassOnDemand(this.modules.logger), this.options);
|
|
1954
|
+
} else {
|
|
1955
|
+
baseLogger.init(null, this.options);
|
|
1956
|
+
}
|
|
1957
|
+
let formatter;
|
|
1958
|
+
if (this.modules.formatter) {
|
|
1959
|
+
formatter = this.modules.formatter;
|
|
1960
|
+
} else if (typeof Intl !== 'undefined') {
|
|
1961
|
+
formatter = Formatter;
|
|
1962
|
+
}
|
|
1963
|
+
const lu = new LanguageUtil(this.options);
|
|
1964
|
+
this.store = new ResourceStore(this.options.resources, this.options);
|
|
1965
|
+
const s = this.services;
|
|
1966
|
+
s.logger = baseLogger;
|
|
1967
|
+
s.resourceStore = this.store;
|
|
1968
|
+
s.languageUtils = lu;
|
|
1969
|
+
s.pluralResolver = new PluralResolver(lu, {
|
|
1970
|
+
prepend: this.options.pluralSeparator,
|
|
1971
|
+
compatibilityJSON: this.options.compatibilityJSON,
|
|
1972
|
+
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1973
|
+
});
|
|
1974
|
+
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
|
|
1975
|
+
s.formatter = createClassOnDemand(formatter);
|
|
1976
|
+
s.formatter.init(s, this.options);
|
|
1977
|
+
this.options.interpolation.format = s.formatter.format.bind(s.formatter);
|
|
1978
|
+
}
|
|
1979
|
+
s.interpolator = new Interpolator(this.options);
|
|
1980
|
+
s.utils = {
|
|
1981
|
+
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1982
|
+
};
|
|
1983
|
+
s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);
|
|
1984
|
+
s.backendConnector.on('*', function (event) {
|
|
1985
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1986
|
+
args[_key - 1] = arguments[_key];
|
|
1987
|
+
}
|
|
1988
|
+
_this.emit(event, ...args);
|
|
1989
|
+
});
|
|
1990
|
+
if (this.modules.languageDetector) {
|
|
1991
|
+
s.languageDetector = createClassOnDemand(this.modules.languageDetector);
|
|
1992
|
+
if (s.languageDetector.init) s.languageDetector.init(s, this.options.detection, this.options);
|
|
1993
|
+
}
|
|
1994
|
+
if (this.modules.i18nFormat) {
|
|
1995
|
+
s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
|
|
1996
|
+
if (s.i18nFormat.init) s.i18nFormat.init(this);
|
|
1997
|
+
}
|
|
1998
|
+
this.translator = new Translator(this.services, this.options);
|
|
1999
|
+
this.translator.on('*', function (event) {
|
|
2000
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
2001
|
+
args[_key2 - 1] = arguments[_key2];
|
|
2002
|
+
}
|
|
2003
|
+
_this.emit(event, ...args);
|
|
2004
|
+
});
|
|
2005
|
+
this.modules.external.forEach(m => {
|
|
2006
|
+
if (m.init) m.init(this);
|
|
2007
|
+
});
|
|
2008
|
+
}
|
|
2009
|
+
this.format = this.options.interpolation.format;
|
|
2010
|
+
if (!callback) callback = noop;
|
|
2011
|
+
if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
2012
|
+
const codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
2013
|
+
if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];
|
|
2014
|
+
}
|
|
2015
|
+
if (!this.services.languageDetector && !this.options.lng) {
|
|
2016
|
+
this.logger.warn('init: no languageDetector is used and no lng is defined');
|
|
2017
|
+
}
|
|
2018
|
+
const storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
|
|
2019
|
+
storeApi.forEach(fcName => {
|
|
2020
|
+
this[fcName] = function () {
|
|
2021
|
+
return _this.store[fcName](...arguments);
|
|
2022
|
+
};
|
|
2023
|
+
});
|
|
2024
|
+
const storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];
|
|
2025
|
+
storeApiChained.forEach(fcName => {
|
|
2026
|
+
this[fcName] = function () {
|
|
2027
|
+
_this.store[fcName](...arguments);
|
|
2028
|
+
return _this;
|
|
2029
|
+
};
|
|
2030
|
+
});
|
|
2031
|
+
const deferred = defer();
|
|
2032
|
+
const load = () => {
|
|
2033
|
+
const finish = (err, t) => {
|
|
2034
|
+
this.isInitializing = false;
|
|
2035
|
+
if (this.isInitialized && !this.initializedStoreOnce) this.logger.warn('init: i18next is already initialized. You should call init just once!');
|
|
2036
|
+
this.isInitialized = true;
|
|
2037
|
+
if (!this.options.isClone) this.logger.log('initialized', this.options);
|
|
2038
|
+
this.emit('initialized', this.options);
|
|
2039
|
+
deferred.resolve(t);
|
|
2040
|
+
callback(err, t);
|
|
2041
|
+
};
|
|
2042
|
+
if (this.languages && this.options.compatibilityAPI !== 'v1' && !this.isInitialized) return finish(null, this.t.bind(this));
|
|
2043
|
+
this.changeLanguage(this.options.lng, finish);
|
|
2044
|
+
};
|
|
2045
|
+
if (this.options.resources || !this.options.initImmediate) {
|
|
2046
|
+
load();
|
|
2047
|
+
} else {
|
|
2048
|
+
setTimeout(load, 0);
|
|
2049
|
+
}
|
|
2050
|
+
return deferred;
|
|
2051
|
+
}
|
|
2052
|
+
loadResources(language) {
|
|
2053
|
+
let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
2054
|
+
let usedCallback = callback;
|
|
2055
|
+
const usedLng = isString(language) ? language : this.language;
|
|
2056
|
+
if (typeof language === 'function') usedCallback = language;
|
|
2057
|
+
if (!this.options.resources || this.options.partialBundledLanguages) {
|
|
2058
|
+
if (usedLng && usedLng.toLowerCase() === 'cimode' && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
|
|
2059
|
+
const toLoad = [];
|
|
2060
|
+
const append = lng => {
|
|
2061
|
+
if (!lng) return;
|
|
2062
|
+
if (lng === 'cimode') return;
|
|
2063
|
+
const lngs = this.services.languageUtils.toResolveHierarchy(lng);
|
|
2064
|
+
lngs.forEach(l => {
|
|
2065
|
+
if (l === 'cimode') return;
|
|
2066
|
+
if (toLoad.indexOf(l) < 0) toLoad.push(l);
|
|
2067
|
+
});
|
|
2068
|
+
};
|
|
2069
|
+
if (!usedLng) {
|
|
2070
|
+
const fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
2071
|
+
fallbacks.forEach(l => append(l));
|
|
2072
|
+
} else {
|
|
2073
|
+
append(usedLng);
|
|
2074
|
+
}
|
|
2075
|
+
if (this.options.preload) {
|
|
2076
|
+
this.options.preload.forEach(l => append(l));
|
|
2077
|
+
}
|
|
2078
|
+
this.services.backendConnector.load(toLoad, this.options.ns, e => {
|
|
2079
|
+
if (!e && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language);
|
|
2080
|
+
usedCallback(e);
|
|
2081
|
+
});
|
|
2082
|
+
} else {
|
|
2083
|
+
usedCallback(null);
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
reloadResources(lngs, ns, callback) {
|
|
2087
|
+
const deferred = defer();
|
|
2088
|
+
if (typeof lngs === 'function') {
|
|
2089
|
+
callback = lngs;
|
|
2090
|
+
lngs = undefined;
|
|
2091
|
+
}
|
|
2092
|
+
if (typeof ns === 'function') {
|
|
2093
|
+
callback = ns;
|
|
2094
|
+
ns = undefined;
|
|
2095
|
+
}
|
|
2096
|
+
if (!lngs) lngs = this.languages;
|
|
2097
|
+
if (!ns) ns = this.options.ns;
|
|
2098
|
+
if (!callback) callback = noop;
|
|
2099
|
+
this.services.backendConnector.reload(lngs, ns, err => {
|
|
2100
|
+
deferred.resolve();
|
|
2101
|
+
callback(err);
|
|
2102
|
+
});
|
|
2103
|
+
return deferred;
|
|
2104
|
+
}
|
|
2105
|
+
use(module) {
|
|
2106
|
+
if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');
|
|
2107
|
+
if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');
|
|
2108
|
+
if (module.type === 'backend') {
|
|
2109
|
+
this.modules.backend = module;
|
|
2110
|
+
}
|
|
2111
|
+
if (module.type === 'logger' || module.log && module.warn && module.error) {
|
|
2112
|
+
this.modules.logger = module;
|
|
2113
|
+
}
|
|
2114
|
+
if (module.type === 'languageDetector') {
|
|
2115
|
+
this.modules.languageDetector = module;
|
|
2116
|
+
}
|
|
2117
|
+
if (module.type === 'i18nFormat') {
|
|
2118
|
+
this.modules.i18nFormat = module;
|
|
2119
|
+
}
|
|
2120
|
+
if (module.type === 'postProcessor') {
|
|
2121
|
+
postProcessor.addPostProcessor(module);
|
|
2122
|
+
}
|
|
2123
|
+
if (module.type === 'formatter') {
|
|
2124
|
+
this.modules.formatter = module;
|
|
2125
|
+
}
|
|
2126
|
+
if (module.type === '3rdParty') {
|
|
2127
|
+
this.modules.external.push(module);
|
|
2128
|
+
}
|
|
2129
|
+
return this;
|
|
2130
|
+
}
|
|
2131
|
+
setResolvedLanguage(l) {
|
|
2132
|
+
if (!l || !this.languages) return;
|
|
2133
|
+
if (['cimode', 'dev'].indexOf(l) > -1) return;
|
|
2134
|
+
for (let li = 0; li < this.languages.length; li++) {
|
|
2135
|
+
const lngInLngs = this.languages[li];
|
|
2136
|
+
if (['cimode', 'dev'].indexOf(lngInLngs) > -1) continue;
|
|
2137
|
+
if (this.store.hasLanguageSomeTranslations(lngInLngs)) {
|
|
2138
|
+
this.resolvedLanguage = lngInLngs;
|
|
2139
|
+
break;
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
changeLanguage(lng, callback) {
|
|
2144
|
+
var _this2 = this;
|
|
2145
|
+
this.isLanguageChangingTo = lng;
|
|
2146
|
+
const deferred = defer();
|
|
2147
|
+
this.emit('languageChanging', lng);
|
|
2148
|
+
const setLngProps = l => {
|
|
2149
|
+
this.language = l;
|
|
2150
|
+
this.languages = this.services.languageUtils.toResolveHierarchy(l);
|
|
2151
|
+
this.resolvedLanguage = undefined;
|
|
2152
|
+
this.setResolvedLanguage(l);
|
|
2153
|
+
};
|
|
2154
|
+
const done = (err, l) => {
|
|
2155
|
+
if (l) {
|
|
2156
|
+
setLngProps(l);
|
|
2157
|
+
this.translator.changeLanguage(l);
|
|
2158
|
+
this.isLanguageChangingTo = undefined;
|
|
2159
|
+
this.emit('languageChanged', l);
|
|
2160
|
+
this.logger.log('languageChanged', l);
|
|
2161
|
+
} else {
|
|
2162
|
+
this.isLanguageChangingTo = undefined;
|
|
2163
|
+
}
|
|
2164
|
+
deferred.resolve(function () {
|
|
2165
|
+
return _this2.t(...arguments);
|
|
2166
|
+
});
|
|
2167
|
+
if (callback) callback(err, function () {
|
|
2168
|
+
return _this2.t(...arguments);
|
|
2169
|
+
});
|
|
2170
|
+
};
|
|
2171
|
+
const setLng = lngs => {
|
|
2172
|
+
if (!lng && !lngs && this.services.languageDetector) lngs = [];
|
|
2173
|
+
const l = isString(lngs) ? lngs : this.services.languageUtils.getBestMatchFromCodes(lngs);
|
|
2174
|
+
if (l) {
|
|
2175
|
+
if (!this.language) {
|
|
2176
|
+
setLngProps(l);
|
|
2177
|
+
}
|
|
2178
|
+
if (!this.translator.language) this.translator.changeLanguage(l);
|
|
2179
|
+
if (this.services.languageDetector && this.services.languageDetector.cacheUserLanguage) this.services.languageDetector.cacheUserLanguage(l);
|
|
2180
|
+
}
|
|
2181
|
+
this.loadResources(l, err => {
|
|
2182
|
+
done(err, l);
|
|
2183
|
+
});
|
|
2184
|
+
};
|
|
2185
|
+
if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {
|
|
2186
|
+
setLng(this.services.languageDetector.detect());
|
|
2187
|
+
} else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {
|
|
2188
|
+
if (this.services.languageDetector.detect.length === 0) {
|
|
2189
|
+
this.services.languageDetector.detect().then(setLng);
|
|
2190
|
+
} else {
|
|
2191
|
+
this.services.languageDetector.detect(setLng);
|
|
2192
|
+
}
|
|
2193
|
+
} else {
|
|
2194
|
+
setLng(lng);
|
|
2195
|
+
}
|
|
2196
|
+
return deferred;
|
|
2197
|
+
}
|
|
2198
|
+
getFixedT(lng, ns, keyPrefix) {
|
|
2199
|
+
var _this3 = this;
|
|
2200
|
+
const fixedT = function (key, opts) {
|
|
2201
|
+
let options;
|
|
2202
|
+
if (typeof opts !== 'object') {
|
|
2203
|
+
for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
|
|
2204
|
+
rest[_key3 - 2] = arguments[_key3];
|
|
2205
|
+
}
|
|
2206
|
+
options = _this3.options.overloadTranslationOptionHandler([key, opts].concat(rest));
|
|
2207
|
+
} else {
|
|
2208
|
+
options = {
|
|
2209
|
+
...opts
|
|
2210
|
+
};
|
|
2211
|
+
}
|
|
2212
|
+
options.lng = options.lng || fixedT.lng;
|
|
2213
|
+
options.lngs = options.lngs || fixedT.lngs;
|
|
2214
|
+
options.ns = options.ns || fixedT.ns;
|
|
2215
|
+
if (options.keyPrefix !== '') options.keyPrefix = options.keyPrefix || keyPrefix || fixedT.keyPrefix;
|
|
2216
|
+
const keySeparator = _this3.options.keySeparator || '.';
|
|
2217
|
+
let resultKey;
|
|
2218
|
+
if (options.keyPrefix && Array.isArray(key)) {
|
|
2219
|
+
resultKey = key.map(k => `${options.keyPrefix}${keySeparator}${k}`);
|
|
2220
|
+
} else {
|
|
2221
|
+
resultKey = options.keyPrefix ? `${options.keyPrefix}${keySeparator}${key}` : key;
|
|
2222
|
+
}
|
|
2223
|
+
return _this3.t(resultKey, options);
|
|
2224
|
+
};
|
|
2225
|
+
if (isString(lng)) {
|
|
2226
|
+
fixedT.lng = lng;
|
|
2227
|
+
} else {
|
|
2228
|
+
fixedT.lngs = lng;
|
|
2229
|
+
}
|
|
2230
|
+
fixedT.ns = ns;
|
|
2231
|
+
fixedT.keyPrefix = keyPrefix;
|
|
2232
|
+
return fixedT;
|
|
2233
|
+
}
|
|
2234
|
+
t() {
|
|
2235
|
+
return this.translator && this.translator.translate(...arguments);
|
|
2236
|
+
}
|
|
2237
|
+
exists() {
|
|
2238
|
+
return this.translator && this.translator.exists(...arguments);
|
|
2239
|
+
}
|
|
2240
|
+
setDefaultNamespace(ns) {
|
|
2241
|
+
this.options.defaultNS = ns;
|
|
2242
|
+
}
|
|
2243
|
+
hasLoadedNamespace(ns) {
|
|
2244
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2245
|
+
if (!this.isInitialized) {
|
|
2246
|
+
this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);
|
|
2247
|
+
return false;
|
|
2248
|
+
}
|
|
2249
|
+
if (!this.languages || !this.languages.length) {
|
|
2250
|
+
this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);
|
|
2251
|
+
return false;
|
|
2252
|
+
}
|
|
2253
|
+
const lng = options.lng || this.resolvedLanguage || this.languages[0];
|
|
2254
|
+
const fallbackLng = this.options ? this.options.fallbackLng : false;
|
|
2255
|
+
const lastLng = this.languages[this.languages.length - 1];
|
|
2256
|
+
if (lng.toLowerCase() === 'cimode') return true;
|
|
2257
|
+
const loadNotPending = (l, n) => {
|
|
2258
|
+
const loadState = this.services.backendConnector.state[`${l}|${n}`];
|
|
2259
|
+
return loadState === -1 || loadState === 0 || loadState === 2;
|
|
2260
|
+
};
|
|
2261
|
+
if (options.precheck) {
|
|
2262
|
+
const preResult = options.precheck(this, loadNotPending);
|
|
2263
|
+
if (preResult !== undefined) return preResult;
|
|
2264
|
+
}
|
|
2265
|
+
if (this.hasResourceBundle(lng, ns)) return true;
|
|
2266
|
+
if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;
|
|
2267
|
+
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
|
|
2268
|
+
return false;
|
|
2269
|
+
}
|
|
2270
|
+
loadNamespaces(ns, callback) {
|
|
2271
|
+
const deferred = defer();
|
|
2272
|
+
if (!this.options.ns) {
|
|
2273
|
+
if (callback) callback();
|
|
2274
|
+
return Promise.resolve();
|
|
2275
|
+
}
|
|
2276
|
+
if (isString(ns)) ns = [ns];
|
|
2277
|
+
ns.forEach(n => {
|
|
2278
|
+
if (this.options.ns.indexOf(n) < 0) this.options.ns.push(n);
|
|
2279
|
+
});
|
|
2280
|
+
this.loadResources(err => {
|
|
2281
|
+
deferred.resolve();
|
|
2282
|
+
if (callback) callback(err);
|
|
2283
|
+
});
|
|
2284
|
+
return deferred;
|
|
2285
|
+
}
|
|
2286
|
+
loadLanguages(lngs, callback) {
|
|
2287
|
+
const deferred = defer();
|
|
2288
|
+
if (isString(lngs)) lngs = [lngs];
|
|
2289
|
+
const preloaded = this.options.preload || [];
|
|
2290
|
+
const newLngs = lngs.filter(lng => preloaded.indexOf(lng) < 0 && this.services.languageUtils.isSupportedCode(lng));
|
|
2291
|
+
if (!newLngs.length) {
|
|
2292
|
+
if (callback) callback();
|
|
2293
|
+
return Promise.resolve();
|
|
2294
|
+
}
|
|
2295
|
+
this.options.preload = preloaded.concat(newLngs);
|
|
2296
|
+
this.loadResources(err => {
|
|
2297
|
+
deferred.resolve();
|
|
2298
|
+
if (callback) callback(err);
|
|
2299
|
+
});
|
|
2300
|
+
return deferred;
|
|
2301
|
+
}
|
|
2302
|
+
dir(lng) {
|
|
2303
|
+
if (!lng) lng = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language);
|
|
2304
|
+
if (!lng) return 'rtl';
|
|
2305
|
+
const rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb'];
|
|
2306
|
+
const languageUtils = this.services && this.services.languageUtils || new LanguageUtil(get());
|
|
2307
|
+
return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';
|
|
2308
|
+
}
|
|
2309
|
+
static createInstance() {
|
|
2310
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2311
|
+
let callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
2312
|
+
return new I18n(options, callback);
|
|
2313
|
+
}
|
|
2314
|
+
cloneInstance() {
|
|
2315
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2316
|
+
let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
2317
|
+
const forkResourceStore = options.forkResourceStore;
|
|
2318
|
+
if (forkResourceStore) delete options.forkResourceStore;
|
|
2319
|
+
const mergedOptions = {
|
|
2320
|
+
...this.options,
|
|
2321
|
+
...options,
|
|
2322
|
+
...{
|
|
2323
|
+
isClone: true
|
|
2324
|
+
}
|
|
2325
|
+
};
|
|
2326
|
+
const clone = new I18n(mergedOptions);
|
|
2327
|
+
if (options.debug !== undefined || options.prefix !== undefined) {
|
|
2328
|
+
clone.logger = clone.logger.clone(options);
|
|
2329
|
+
}
|
|
2330
|
+
const membersToCopy = ['store', 'services', 'language'];
|
|
2331
|
+
membersToCopy.forEach(m => {
|
|
2332
|
+
clone[m] = this[m];
|
|
2333
|
+
});
|
|
2334
|
+
clone.services = {
|
|
2335
|
+
...this.services
|
|
2336
|
+
};
|
|
2337
|
+
clone.services.utils = {
|
|
2338
|
+
hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
|
|
2339
|
+
};
|
|
2340
|
+
if (forkResourceStore) {
|
|
2341
|
+
clone.store = new ResourceStore(this.store.data, mergedOptions);
|
|
2342
|
+
clone.services.resourceStore = clone.store;
|
|
2343
|
+
}
|
|
2344
|
+
clone.translator = new Translator(clone.services, mergedOptions);
|
|
2345
|
+
clone.translator.on('*', function (event) {
|
|
2346
|
+
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
2347
|
+
args[_key4 - 1] = arguments[_key4];
|
|
2348
|
+
}
|
|
2349
|
+
clone.emit(event, ...args);
|
|
2350
|
+
});
|
|
2351
|
+
clone.init(mergedOptions, callback);
|
|
2352
|
+
clone.translator.options = mergedOptions;
|
|
2353
|
+
clone.translator.backendConnector.services.utils = {
|
|
2354
|
+
hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
|
|
2355
|
+
};
|
|
2356
|
+
return clone;
|
|
2357
|
+
}
|
|
2358
|
+
toJSON() {
|
|
2359
|
+
return {
|
|
2360
|
+
options: this.options,
|
|
2361
|
+
store: this.store,
|
|
2362
|
+
language: this.language,
|
|
2363
|
+
languages: this.languages,
|
|
2364
|
+
resolvedLanguage: this.resolvedLanguage
|
|
2365
|
+
};
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
const instance = I18n.createInstance();
|
|
2369
|
+
instance.createInstance = I18n.createInstance;
|
|
2370
|
+
|
|
2371
|
+
function _classCallCheck(instance, Constructor) {
|
|
2372
|
+
if (!(instance instanceof Constructor)) {
|
|
2373
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
function _typeof(o) {
|
|
2378
|
+
"@babel/helpers - typeof";
|
|
2379
|
+
|
|
2380
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
2381
|
+
return typeof o;
|
|
2382
|
+
} : function (o) {
|
|
2383
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
2384
|
+
}, _typeof(o);
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
function toPrimitive(t, r) {
|
|
2388
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
2389
|
+
var e = t[Symbol.toPrimitive];
|
|
2390
|
+
if (void 0 !== e) {
|
|
2391
|
+
var i = e.call(t, r || "default");
|
|
2392
|
+
if ("object" != _typeof(i)) return i;
|
|
2393
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2394
|
+
}
|
|
2395
|
+
return ("string" === r ? String : Number)(t);
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
function toPropertyKey(t) {
|
|
2399
|
+
var i = toPrimitive(t, "string");
|
|
2400
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
function _defineProperties(target, props) {
|
|
2404
|
+
for (var i = 0; i < props.length; i++) {
|
|
2405
|
+
var descriptor = props[i];
|
|
2406
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
2407
|
+
descriptor.configurable = true;
|
|
2408
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
2409
|
+
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
2413
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
2414
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
2415
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
2416
|
+
writable: false
|
|
2417
|
+
});
|
|
2418
|
+
return Constructor;
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
var arr = [];
|
|
2422
|
+
var each = arr.forEach;
|
|
2423
|
+
var slice = arr.slice;
|
|
2424
|
+
function defaults(obj) {
|
|
2425
|
+
each.call(slice.call(arguments, 1), function (source) {
|
|
2426
|
+
if (source) {
|
|
2427
|
+
for (var prop in source) {
|
|
2428
|
+
if (obj[prop] === undefined) obj[prop] = source[prop];
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
});
|
|
2432
|
+
return obj;
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
// eslint-disable-next-line no-control-regex
|
|
2436
|
+
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
2437
|
+
var serializeCookie = function serializeCookie(name, val, options) {
|
|
2438
|
+
var opt = options || {};
|
|
2439
|
+
opt.path = opt.path || '/';
|
|
2440
|
+
var value = encodeURIComponent(val);
|
|
2441
|
+
var str = "".concat(name, "=").concat(value);
|
|
2442
|
+
if (opt.maxAge > 0) {
|
|
2443
|
+
var maxAge = opt.maxAge - 0;
|
|
2444
|
+
if (Number.isNaN(maxAge)) throw new Error('maxAge should be a Number');
|
|
2445
|
+
str += "; Max-Age=".concat(Math.floor(maxAge));
|
|
2446
|
+
}
|
|
2447
|
+
if (opt.domain) {
|
|
2448
|
+
if (!fieldContentRegExp.test(opt.domain)) {
|
|
2449
|
+
throw new TypeError('option domain is invalid');
|
|
2450
|
+
}
|
|
2451
|
+
str += "; Domain=".concat(opt.domain);
|
|
2452
|
+
}
|
|
2453
|
+
if (opt.path) {
|
|
2454
|
+
if (!fieldContentRegExp.test(opt.path)) {
|
|
2455
|
+
throw new TypeError('option path is invalid');
|
|
2456
|
+
}
|
|
2457
|
+
str += "; Path=".concat(opt.path);
|
|
2458
|
+
}
|
|
2459
|
+
if (opt.expires) {
|
|
2460
|
+
if (typeof opt.expires.toUTCString !== 'function') {
|
|
2461
|
+
throw new TypeError('option expires is invalid');
|
|
2462
|
+
}
|
|
2463
|
+
str += "; Expires=".concat(opt.expires.toUTCString());
|
|
2464
|
+
}
|
|
2465
|
+
if (opt.httpOnly) str += '; HttpOnly';
|
|
2466
|
+
if (opt.secure) str += '; Secure';
|
|
2467
|
+
if (opt.sameSite) {
|
|
2468
|
+
var sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;
|
|
2469
|
+
switch (sameSite) {
|
|
2470
|
+
case true:
|
|
2471
|
+
str += '; SameSite=Strict';
|
|
2472
|
+
break;
|
|
2473
|
+
case 'lax':
|
|
2474
|
+
str += '; SameSite=Lax';
|
|
2475
|
+
break;
|
|
2476
|
+
case 'strict':
|
|
2477
|
+
str += '; SameSite=Strict';
|
|
2478
|
+
break;
|
|
2479
|
+
case 'none':
|
|
2480
|
+
str += '; SameSite=None';
|
|
2481
|
+
break;
|
|
2482
|
+
default:
|
|
2483
|
+
throw new TypeError('option sameSite is invalid');
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
return str;
|
|
2487
|
+
};
|
|
2488
|
+
var cookie = {
|
|
2489
|
+
create: function create(name, value, minutes, domain) {
|
|
2490
|
+
var cookieOptions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
|
|
2491
|
+
path: '/',
|
|
2492
|
+
sameSite: 'strict'
|
|
2493
|
+
};
|
|
2494
|
+
if (minutes) {
|
|
2495
|
+
cookieOptions.expires = new Date();
|
|
2496
|
+
cookieOptions.expires.setTime(cookieOptions.expires.getTime() + minutes * 60 * 1000);
|
|
2497
|
+
}
|
|
2498
|
+
if (domain) cookieOptions.domain = domain;
|
|
2499
|
+
document.cookie = serializeCookie(name, encodeURIComponent(value), cookieOptions);
|
|
2500
|
+
},
|
|
2501
|
+
read: function read(name) {
|
|
2502
|
+
var nameEQ = "".concat(name, "=");
|
|
2503
|
+
var ca = document.cookie.split(';');
|
|
2504
|
+
for (var i = 0; i < ca.length; i++) {
|
|
2505
|
+
var c = ca[i];
|
|
2506
|
+
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
2507
|
+
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
2508
|
+
}
|
|
2509
|
+
return null;
|
|
2510
|
+
},
|
|
2511
|
+
remove: function remove(name) {
|
|
2512
|
+
this.create(name, '', -1);
|
|
2513
|
+
}
|
|
2514
|
+
};
|
|
2515
|
+
var cookie$1 = {
|
|
2516
|
+
name: 'cookie',
|
|
2517
|
+
lookup: function lookup(options) {
|
|
2518
|
+
var found;
|
|
2519
|
+
if (options.lookupCookie && typeof document !== 'undefined') {
|
|
2520
|
+
var c = cookie.read(options.lookupCookie);
|
|
2521
|
+
if (c) found = c;
|
|
2522
|
+
}
|
|
2523
|
+
return found;
|
|
2524
|
+
},
|
|
2525
|
+
cacheUserLanguage: function cacheUserLanguage(lng, options) {
|
|
2526
|
+
if (options.lookupCookie && typeof document !== 'undefined') {
|
|
2527
|
+
cookie.create(options.lookupCookie, lng, options.cookieMinutes, options.cookieDomain, options.cookieOptions);
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
};
|
|
2531
|
+
|
|
2532
|
+
var querystring = {
|
|
2533
|
+
name: 'querystring',
|
|
2534
|
+
lookup: function lookup(options) {
|
|
2535
|
+
var found;
|
|
2536
|
+
if (typeof window !== 'undefined') {
|
|
2537
|
+
var search = window.location.search;
|
|
2538
|
+
if (!window.location.search && window.location.hash && window.location.hash.indexOf('?') > -1) {
|
|
2539
|
+
search = window.location.hash.substring(window.location.hash.indexOf('?'));
|
|
2540
|
+
}
|
|
2541
|
+
var query = search.substring(1);
|
|
2542
|
+
var params = query.split('&');
|
|
2543
|
+
for (var i = 0; i < params.length; i++) {
|
|
2544
|
+
var pos = params[i].indexOf('=');
|
|
2545
|
+
if (pos > 0) {
|
|
2546
|
+
var key = params[i].substring(0, pos);
|
|
2547
|
+
if (key === options.lookupQuerystring) {
|
|
2548
|
+
found = params[i].substring(pos + 1);
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
}
|
|
2553
|
+
return found;
|
|
2554
|
+
}
|
|
2555
|
+
};
|
|
2556
|
+
|
|
2557
|
+
var hasLocalStorageSupport = null;
|
|
2558
|
+
var localStorageAvailable = function localStorageAvailable() {
|
|
2559
|
+
if (hasLocalStorageSupport !== null) return hasLocalStorageSupport;
|
|
2560
|
+
try {
|
|
2561
|
+
hasLocalStorageSupport = window !== 'undefined' && window.localStorage !== null;
|
|
2562
|
+
var testKey = 'i18next.translate.boo';
|
|
2563
|
+
window.localStorage.setItem(testKey, 'foo');
|
|
2564
|
+
window.localStorage.removeItem(testKey);
|
|
2565
|
+
} catch (e) {
|
|
2566
|
+
hasLocalStorageSupport = false;
|
|
2567
|
+
}
|
|
2568
|
+
return hasLocalStorageSupport;
|
|
2569
|
+
};
|
|
2570
|
+
var localStorage = {
|
|
2571
|
+
name: 'localStorage',
|
|
2572
|
+
lookup: function lookup(options) {
|
|
2573
|
+
var found;
|
|
2574
|
+
if (options.lookupLocalStorage && localStorageAvailable()) {
|
|
2575
|
+
var lng = window.localStorage.getItem(options.lookupLocalStorage);
|
|
2576
|
+
if (lng) found = lng;
|
|
2577
|
+
}
|
|
2578
|
+
return found;
|
|
2579
|
+
},
|
|
2580
|
+
cacheUserLanguage: function cacheUserLanguage(lng, options) {
|
|
2581
|
+
if (options.lookupLocalStorage && localStorageAvailable()) {
|
|
2582
|
+
window.localStorage.setItem(options.lookupLocalStorage, lng);
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
};
|
|
2586
|
+
|
|
2587
|
+
var hasSessionStorageSupport = null;
|
|
2588
|
+
var sessionStorageAvailable = function sessionStorageAvailable() {
|
|
2589
|
+
if (hasSessionStorageSupport !== null) return hasSessionStorageSupport;
|
|
2590
|
+
try {
|
|
2591
|
+
hasSessionStorageSupport = window !== 'undefined' && window.sessionStorage !== null;
|
|
2592
|
+
var testKey = 'i18next.translate.boo';
|
|
2593
|
+
window.sessionStorage.setItem(testKey, 'foo');
|
|
2594
|
+
window.sessionStorage.removeItem(testKey);
|
|
2595
|
+
} catch (e) {
|
|
2596
|
+
hasSessionStorageSupport = false;
|
|
2597
|
+
}
|
|
2598
|
+
return hasSessionStorageSupport;
|
|
2599
|
+
};
|
|
2600
|
+
var sessionStorage = {
|
|
2601
|
+
name: 'sessionStorage',
|
|
2602
|
+
lookup: function lookup(options) {
|
|
2603
|
+
var found;
|
|
2604
|
+
if (options.lookupSessionStorage && sessionStorageAvailable()) {
|
|
2605
|
+
var lng = window.sessionStorage.getItem(options.lookupSessionStorage);
|
|
2606
|
+
if (lng) found = lng;
|
|
2607
|
+
}
|
|
2608
|
+
return found;
|
|
2609
|
+
},
|
|
2610
|
+
cacheUserLanguage: function cacheUserLanguage(lng, options) {
|
|
2611
|
+
if (options.lookupSessionStorage && sessionStorageAvailable()) {
|
|
2612
|
+
window.sessionStorage.setItem(options.lookupSessionStorage, lng);
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
};
|
|
2616
|
+
|
|
2617
|
+
var navigator$1 = {
|
|
2618
|
+
name: 'navigator',
|
|
2619
|
+
lookup: function lookup(options) {
|
|
2620
|
+
var found = [];
|
|
2621
|
+
if (typeof navigator !== 'undefined') {
|
|
2622
|
+
if (navigator.languages) {
|
|
2623
|
+
// chrome only; not an array, so can't use .push.apply instead of iterating
|
|
2624
|
+
for (var i = 0; i < navigator.languages.length; i++) {
|
|
2625
|
+
found.push(navigator.languages[i]);
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
if (navigator.userLanguage) {
|
|
2629
|
+
found.push(navigator.userLanguage);
|
|
2630
|
+
}
|
|
2631
|
+
if (navigator.language) {
|
|
2632
|
+
found.push(navigator.language);
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
return found.length > 0 ? found : undefined;
|
|
2636
|
+
}
|
|
2637
|
+
};
|
|
2638
|
+
|
|
2639
|
+
var htmlTag = {
|
|
2640
|
+
name: 'htmlTag',
|
|
2641
|
+
lookup: function lookup(options) {
|
|
2642
|
+
var found;
|
|
2643
|
+
var htmlTag = options.htmlTag || (typeof document !== 'undefined' ? document.documentElement : null);
|
|
2644
|
+
if (htmlTag && typeof htmlTag.getAttribute === 'function') {
|
|
2645
|
+
found = htmlTag.getAttribute('lang');
|
|
2646
|
+
}
|
|
2647
|
+
return found;
|
|
2648
|
+
}
|
|
2649
|
+
};
|
|
2650
|
+
|
|
2651
|
+
var path = {
|
|
2652
|
+
name: 'path',
|
|
2653
|
+
lookup: function lookup(options) {
|
|
2654
|
+
var found;
|
|
2655
|
+
if (typeof window !== 'undefined') {
|
|
2656
|
+
var language = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
|
|
2657
|
+
if (language instanceof Array) {
|
|
2658
|
+
if (typeof options.lookupFromPathIndex === 'number') {
|
|
2659
|
+
if (typeof language[options.lookupFromPathIndex] !== 'string') {
|
|
2660
|
+
return undefined;
|
|
2661
|
+
}
|
|
2662
|
+
found = language[options.lookupFromPathIndex].replace('/', '');
|
|
2663
|
+
} else {
|
|
2664
|
+
found = language[0].replace('/', '');
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
return found;
|
|
2669
|
+
}
|
|
2670
|
+
};
|
|
2671
|
+
|
|
2672
|
+
var subdomain = {
|
|
2673
|
+
name: 'subdomain',
|
|
2674
|
+
lookup: function lookup(options) {
|
|
2675
|
+
// If given get the subdomain index else 1
|
|
2676
|
+
var lookupFromSubdomainIndex = typeof options.lookupFromSubdomainIndex === 'number' ? options.lookupFromSubdomainIndex + 1 : 1;
|
|
2677
|
+
// get all matches if window.location. is existing
|
|
2678
|
+
// first item of match is the match itself and the second is the first group macht which sould be the first subdomain match
|
|
2679
|
+
// is the hostname no public domain get the or option of localhost
|
|
2680
|
+
var language = typeof window !== 'undefined' && window.location && window.location.hostname && window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
|
|
2681
|
+
|
|
2682
|
+
// if there is no match (null) return undefined
|
|
2683
|
+
if (!language) return undefined;
|
|
2684
|
+
// return the given group match
|
|
2685
|
+
return language[lookupFromSubdomainIndex];
|
|
2686
|
+
}
|
|
2687
|
+
};
|
|
2688
|
+
|
|
2689
|
+
// some environments, throws when accessing document.cookie
|
|
2690
|
+
var canCookies = false;
|
|
2691
|
+
try {
|
|
2692
|
+
canCookies = true;
|
|
2693
|
+
// eslint-disable-next-line no-empty
|
|
2694
|
+
} catch (e) {}
|
|
2695
|
+
var order = ['querystring', 'cookie', 'localStorage', 'sessionStorage', 'navigator', 'htmlTag'];
|
|
2696
|
+
if (!canCookies) order.splice(1, 1);
|
|
2697
|
+
function getDefaults() {
|
|
2698
|
+
return {
|
|
2699
|
+
order: order,
|
|
2700
|
+
lookupQuerystring: 'lng',
|
|
2701
|
+
lookupCookie: 'i18next',
|
|
2702
|
+
lookupLocalStorage: 'i18nextLng',
|
|
2703
|
+
lookupSessionStorage: 'i18nextLng',
|
|
2704
|
+
// cache user language
|
|
2705
|
+
caches: ['localStorage'],
|
|
2706
|
+
excludeCacheFor: ['cimode'],
|
|
2707
|
+
// cookieMinutes: 10,
|
|
2708
|
+
// cookieDomain: 'myDomain'
|
|
2709
|
+
|
|
2710
|
+
convertDetectedLanguage: function convertDetectedLanguage(l) {
|
|
2711
|
+
return l;
|
|
2712
|
+
}
|
|
2713
|
+
};
|
|
2714
|
+
}
|
|
2715
|
+
var Browser = /*#__PURE__*/function () {
|
|
2716
|
+
function Browser(services) {
|
|
2717
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2718
|
+
_classCallCheck(this, Browser);
|
|
2719
|
+
this.type = 'languageDetector';
|
|
2720
|
+
this.detectors = {};
|
|
2721
|
+
this.init(services, options);
|
|
2722
|
+
}
|
|
2723
|
+
return _createClass(Browser, [{
|
|
2724
|
+
key: "init",
|
|
2725
|
+
value: function init(services) {
|
|
2726
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2727
|
+
var i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2728
|
+
this.services = services || {
|
|
2729
|
+
languageUtils: {}
|
|
2730
|
+
}; // this way the language detector can be used without i18next
|
|
2731
|
+
this.options = defaults(options, this.options || {}, getDefaults());
|
|
2732
|
+
if (typeof this.options.convertDetectedLanguage === 'string' && this.options.convertDetectedLanguage.indexOf('15897') > -1) {
|
|
2733
|
+
this.options.convertDetectedLanguage = function (l) {
|
|
2734
|
+
return l.replace('-', '_');
|
|
2735
|
+
};
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
// backwards compatibility
|
|
2739
|
+
if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;
|
|
2740
|
+
this.i18nOptions = i18nOptions;
|
|
2741
|
+
this.addDetector(cookie$1);
|
|
2742
|
+
this.addDetector(querystring);
|
|
2743
|
+
this.addDetector(localStorage);
|
|
2744
|
+
this.addDetector(sessionStorage);
|
|
2745
|
+
this.addDetector(navigator$1);
|
|
2746
|
+
this.addDetector(htmlTag);
|
|
2747
|
+
this.addDetector(path);
|
|
2748
|
+
this.addDetector(subdomain);
|
|
2749
|
+
}
|
|
2750
|
+
}, {
|
|
2751
|
+
key: "addDetector",
|
|
2752
|
+
value: function addDetector(detector) {
|
|
2753
|
+
this.detectors[detector.name] = detector;
|
|
2754
|
+
return this;
|
|
2755
|
+
}
|
|
2756
|
+
}, {
|
|
2757
|
+
key: "detect",
|
|
2758
|
+
value: function detect(detectionOrder) {
|
|
2759
|
+
var _this = this;
|
|
2760
|
+
if (!detectionOrder) detectionOrder = this.options.order;
|
|
2761
|
+
var detected = [];
|
|
2762
|
+
detectionOrder.forEach(function (detectorName) {
|
|
2763
|
+
if (_this.detectors[detectorName]) {
|
|
2764
|
+
var lookup = _this.detectors[detectorName].lookup(_this.options);
|
|
2765
|
+
if (lookup && typeof lookup === 'string') lookup = [lookup];
|
|
2766
|
+
if (lookup) detected = detected.concat(lookup);
|
|
2767
|
+
}
|
|
2768
|
+
});
|
|
2769
|
+
detected = detected.map(function (d) {
|
|
2770
|
+
return _this.options.convertDetectedLanguage(d);
|
|
2771
|
+
});
|
|
2772
|
+
if (this.services.languageUtils.getBestMatchFromCodes) return detected; // new i18next v19.5.0
|
|
2773
|
+
return detected.length > 0 ? detected[0] : null; // a little backward compatibility
|
|
2774
|
+
}
|
|
2775
|
+
}, {
|
|
2776
|
+
key: "cacheUserLanguage",
|
|
2777
|
+
value: function cacheUserLanguage(lng, caches) {
|
|
2778
|
+
var _this2 = this;
|
|
2779
|
+
if (!caches) caches = this.options.caches;
|
|
2780
|
+
if (!caches) return;
|
|
2781
|
+
if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > -1) return;
|
|
2782
|
+
caches.forEach(function (cacheName) {
|
|
2783
|
+
if (_this2.detectors[cacheName]) _this2.detectors[cacheName].cacheUserLanguage(lng, _this2.options);
|
|
2784
|
+
});
|
|
2785
|
+
}
|
|
2786
|
+
}]);
|
|
2787
|
+
}();
|
|
2788
|
+
Browser.type = 'languageDetector';
|
|
2789
|
+
|
|
2790
|
+
const ptBrTranslations = {
|
|
2791
|
+
translation: {
|
|
2792
|
+
app: {
|
|
2793
|
+
collapse: "Resumir",
|
|
2794
|
+
expand: "Expandir",
|
|
2795
|
+
close: "Fechar",
|
|
2796
|
+
profile: "Perfil",
|
|
2797
|
+
warning: "Aviso",
|
|
2798
|
+
edit: "Editar",
|
|
2799
|
+
remove: "Remover",
|
|
2800
|
+
yes: "Sim",
|
|
2801
|
+
no: "Não",
|
|
2802
|
+
loading: "Carregando",
|
|
2803
|
+
apply: "Aplicar",
|
|
2804
|
+
cancel: "Cancelar",
|
|
2805
|
+
ok: "OK",
|
|
2806
|
+
alerts: "Avisos",
|
|
2807
|
+
requiredInfo: " (obrigatório) *",
|
|
2808
|
+
},
|
|
2809
|
+
"ez-upload": {
|
|
2810
|
+
enable: "Arraste e solte ou clique para adicionar arquivos",
|
|
2811
|
+
disable: "Somente leitura",
|
|
2812
|
+
replaceFileTitle: "Substituir arquivo",
|
|
2813
|
+
replaceFileMessage: "Já existe um arquivo chamado \"{{fileName}}\". Deseja substituí-lo?",
|
|
2814
|
+
maxFilesError: "A quantidade máxima de arquivos é {{maxFiles}}.",
|
|
2815
|
+
emptyFileError: "Erro de permissão: O arquivo \"{{fileName}}\" não pode ser enviado.",
|
|
2816
|
+
missingUploadUrlError: "Endereço de upload não informado.",
|
|
2817
|
+
maxFileSizeError: "O tamanho máximo dos arquivos é de {{maxSize}}.",
|
|
2818
|
+
uploadErrorTitle: "Enviando arquivo",
|
|
2819
|
+
uploadingMessage: "Há arquivos sendo enviados. Por favor aguarde a conclusão ou cancele o envio.",
|
|
2820
|
+
},
|
|
2821
|
+
"ez-calendar": {
|
|
2822
|
+
month: {
|
|
2823
|
+
0: "Janeiro",
|
|
2824
|
+
1: "Fevereiro",
|
|
2825
|
+
2: "Março",
|
|
2826
|
+
3: "Abril",
|
|
2827
|
+
4: "Maio",
|
|
2828
|
+
5: "Junho",
|
|
2829
|
+
6: "Julho",
|
|
2830
|
+
7: "Agosto",
|
|
2831
|
+
8: "Setembro",
|
|
2832
|
+
9: "Outubro",
|
|
2833
|
+
10: "Novembro",
|
|
2834
|
+
11: "Dezembro"
|
|
2835
|
+
},
|
|
2836
|
+
weekDay: {
|
|
2837
|
+
0: "D",
|
|
2838
|
+
1: "S",
|
|
2839
|
+
2: "T",
|
|
2840
|
+
3: "Q",
|
|
2841
|
+
4: "Q",
|
|
2842
|
+
5: "S",
|
|
2843
|
+
6: "S"
|
|
2844
|
+
},
|
|
2845
|
+
today: "Hoje"
|
|
2846
|
+
},
|
|
2847
|
+
"ez-collapsible-box": {
|
|
2848
|
+
confirmRemove: "Deseja realmente remover o grupo <b>{{label}}</b>?",
|
|
2849
|
+
},
|
|
2850
|
+
"ez-combo-box": {
|
|
2851
|
+
placeholder: "Selecione um item",
|
|
2852
|
+
noResults: "Nenhum resultado encontrado",
|
|
2853
|
+
},
|
|
2854
|
+
"ez-classic-combo-box": {
|
|
2855
|
+
emptyOption: "Selecione um item",
|
|
2856
|
+
noResults: "Nenhum resultado encontrado",
|
|
2857
|
+
},
|
|
2858
|
+
"ez-date-time-input": {
|
|
2859
|
+
invalidDate: "O valor digitado não é uma data e hora válida"
|
|
2860
|
+
},
|
|
2861
|
+
"ez-date-input": {
|
|
2862
|
+
invalidDate: "O valor digitado não é uma data válida"
|
|
2863
|
+
},
|
|
2864
|
+
"ez-dialog": {
|
|
2865
|
+
confirmButton: "Botão de confirmação ou OK",
|
|
2866
|
+
closeButton: "Botão de fechar ou X"
|
|
2867
|
+
},
|
|
2868
|
+
"ez-double-list": {
|
|
2869
|
+
noItemsAvailable: "Nenhum {{entity}} disponível",
|
|
2870
|
+
noItemsSelected: "Nenhum {{entity}} selecionado",
|
|
2871
|
+
moveAllTo: "Mover todos para {{list}}",
|
|
2872
|
+
moveTo: "Mover para {{list}}",
|
|
2873
|
+
moveToFirstPosition: "Mover para a primeira posição",
|
|
2874
|
+
moveUp: "Mover para cima",
|
|
2875
|
+
moveDown: "Mover para baixo",
|
|
2876
|
+
moveToLastPosition: "Mover para a última posição"
|
|
2877
|
+
},
|
|
2878
|
+
"ez-file-item": {
|
|
2879
|
+
invalidProgress: "O progresso de upload deve ser um número entre 0 e 100."
|
|
2880
|
+
},
|
|
2881
|
+
"ez-grid": {
|
|
2882
|
+
filterAppliedSuccess: "Filtro de coluna aplicado com sucesso!",
|
|
2883
|
+
cancelPagination: "Cancelar paginação",
|
|
2884
|
+
pageLabel: "Página {{currentPage}}",
|
|
2885
|
+
previousPage: "Página anterior",
|
|
2886
|
+
nextPage: "Próxima página",
|
|
2887
|
+
returnToPreviousPage: "Retorna à página anterior.",
|
|
2888
|
+
goToNextPage: "Avança para a próxima página.",
|
|
2889
|
+
remainingPageLabel: " de {{count}} ou mais",
|
|
2890
|
+
remainingTotalLabel: " de {{total}}",
|
|
2891
|
+
nextRecord: "Avança para o próximo registro.",
|
|
2892
|
+
previousRecord: "Retorna ao registro anterior.",
|
|
2893
|
+
searchColumn: "Busca por coluna.",
|
|
2894
|
+
sortAscending: "Ordenar Ascendente",
|
|
2895
|
+
sortDescending: "Ordenar Descendente",
|
|
2896
|
+
pinColumn: "Fixar coluna",
|
|
2897
|
+
unpinColumn: "Desafixar coluna",
|
|
2898
|
+
filter: "Filtrar",
|
|
2899
|
+
columnCantBeOrder: "Coluna não pode ser ordenada",
|
|
2900
|
+
filterColumnHeader: "Filtro da coluna {{columnLabel}}",
|
|
2901
|
+
clearSelection: "Limpar Seleção",
|
|
2902
|
+
page: "Página",
|
|
2903
|
+
more: "mais",
|
|
2904
|
+
to: "para",
|
|
2905
|
+
of: "de",
|
|
2906
|
+
next: "Próximo",
|
|
2907
|
+
last: "Último",
|
|
2908
|
+
first: "Primeiro",
|
|
2909
|
+
previous: "Anterior",
|
|
2910
|
+
loadingOoo: "Carregar",
|
|
2911
|
+
selectAll: "Selecionar tudo",
|
|
2912
|
+
searchOoo: "Procurar",
|
|
2913
|
+
blanks: "Vazio",
|
|
2914
|
+
filterOoo: "Filtrar",
|
|
2915
|
+
applyFilter: "Aplicar filtro",
|
|
2916
|
+
equals: "Igual",
|
|
2917
|
+
lessThan: "Menor que",
|
|
2918
|
+
greaterThan: "Maior que",
|
|
2919
|
+
contains: "Contém",
|
|
2920
|
+
startsWith: "Começa com",
|
|
2921
|
+
endsWith: "Termina com",
|
|
2922
|
+
group: "Grupo",
|
|
2923
|
+
columns: "Colunas",
|
|
2924
|
+
rowGroupColumns: "Colunas do grupo de linhas",
|
|
2925
|
+
rowGroupColumnsEmptyMessage: "Colunas do grupo de linhas vazias",
|
|
2926
|
+
valueColumns: "Valores das colunas",
|
|
2927
|
+
pivotMode: "Modo pivô",
|
|
2928
|
+
groups: "Grupos",
|
|
2929
|
+
values: "Valores",
|
|
2930
|
+
pivots: "Pivôs",
|
|
2931
|
+
valueColumnsEmptyMessage: "Valores de colunas vazias",
|
|
2932
|
+
pivotColumnsEmptyMessage: "Pivôs de colunas vazias",
|
|
2933
|
+
toolPanelButton: "Botão de painel de ferramentas",
|
|
2934
|
+
noRowsToShow: "Não há registros para mostrar.",
|
|
2935
|
+
valueAggregation: "Agregar valor",
|
|
2936
|
+
autosizeThiscolumn: "Redimensionar esta coluna",
|
|
2937
|
+
autosizeAllColumns: "Redimensionar todas colunas",
|
|
2938
|
+
groupBy: "Agrupar por",
|
|
2939
|
+
ungroupBy: "Desagrupar por",
|
|
2940
|
+
resetColumns: "Resetar colunas",
|
|
2941
|
+
expandAll: "Expandir tudo",
|
|
2942
|
+
collapseAll: "Contrair tudo",
|
|
2943
|
+
toolPanel: "Painel de ferramentas",
|
|
2944
|
+
export: "Exportar",
|
|
2945
|
+
csvExport: "Exportar para CSV",
|
|
2946
|
+
excelExport: "Exportar para Excel",
|
|
2947
|
+
pinLeft: "Fixar coluna",
|
|
2948
|
+
pinRight: "Fixar a direita",
|
|
2949
|
+
noPin: "Desfixar coluna",
|
|
2950
|
+
sum: "Soma",
|
|
2951
|
+
min: "Mínimo",
|
|
2952
|
+
max: "Máximo",
|
|
2953
|
+
none: "Nenhum",
|
|
2954
|
+
count: "Contagem",
|
|
2955
|
+
average: "Média",
|
|
2956
|
+
copy: "Copiar",
|
|
2957
|
+
copyWithHeaders: "Copiar com cabeçalho",
|
|
2958
|
+
ctrlC: "Ctrl+C",
|
|
2959
|
+
paste: "Colar",
|
|
2960
|
+
ctrlV: "Ctrl+V",
|
|
2961
|
+
labelSearchColumn: "Buscar colunas (Ctrl+F)",
|
|
2962
|
+
},
|
|
2963
|
+
"ez-guide-navigator": {
|
|
2964
|
+
searchGuide: "Buscar guia",
|
|
2965
|
+
hideMenu: "Ocultar menu",
|
|
2966
|
+
},
|
|
2967
|
+
"ez-list": {
|
|
2968
|
+
moveToGroup: "Mover para {{groupName}}",
|
|
2969
|
+
},
|
|
2970
|
+
"ez-modal": {
|
|
2971
|
+
close: "Fechar modal",
|
|
2972
|
+
},
|
|
2973
|
+
"ez-multi-selection-list": {
|
|
2974
|
+
selectAll: "Selecionar todos",
|
|
2975
|
+
search: "Buscar...",
|
|
2976
|
+
empty: "(Vazio)",
|
|
2977
|
+
initMessage: "Selecione os valores a serem filtrados através do campo de busca.",
|
|
2978
|
+
emptyResults: "Nenhum resultado encontrado.",
|
|
2979
|
+
},
|
|
2980
|
+
"ez-number-input": {
|
|
2981
|
+
invalidNumber: "O valor digitado não é um número válido",
|
|
2982
|
+
},
|
|
2983
|
+
"ez-rich-text": {
|
|
2984
|
+
listShortcut: "Aplica estilo de lista ao texto selecionado.",
|
|
2985
|
+
linkShortcut: "Abre popup de link.",
|
|
2986
|
+
imageShortcut: "Abre popup de imagem.",
|
|
2987
|
+
boldShortcut: "Aplica estilo negrito ao texto selecionado.",
|
|
2988
|
+
italicShortcut: "Aplica estilo itálico ao texto selecionado.",
|
|
2989
|
+
underlineShortcut: "Aplica estilo sublinhado ao texto selecionado.",
|
|
2990
|
+
breakLineShortcut: "Aplica quebra de linha.",
|
|
2991
|
+
undoShortcut: "Desfaz a última alteração de texto.",
|
|
2992
|
+
redoShortcut: "Refaz a última alteração de texto.",
|
|
2993
|
+
edit: "Editar",
|
|
2994
|
+
preview: "Pré-visualizar",
|
|
2995
|
+
title: {
|
|
2996
|
+
preview: 'Ctrl + P',
|
|
2997
|
+
edit: 'Ir para modo edição',
|
|
2998
|
+
undo: 'Desfazer (Ctrl + Z)',
|
|
2999
|
+
redo: 'Refazer (Ctrl + X)',
|
|
3000
|
+
link: 'Inserir link (Ctrl + K)',
|
|
3001
|
+
image: 'Inserir imagem (Ctrl + O)',
|
|
3002
|
+
list: 'Lista (Ctrl + L)',
|
|
3003
|
+
underline: 'Sublinhado (Ctrl + U)',
|
|
3004
|
+
italic: 'Itálico (Ctrl + I)',
|
|
3005
|
+
bold: 'Negrito (Ctrl + B)',
|
|
3006
|
+
}
|
|
3007
|
+
},
|
|
3008
|
+
"ez-link-builder": {
|
|
3009
|
+
addLinkTitle: "Adicionar link",
|
|
3010
|
+
addLinkSubtitle: "Insira um link no texto para abrir novas páginas.",
|
|
3011
|
+
submit: "Enviar",
|
|
3012
|
+
urlInputLabel: "Insira a URL destino",
|
|
3013
|
+
textInputLabel: "Insira o texto a ser exibido",
|
|
3014
|
+
openInNewPage: "Abrir em uma nova página.",
|
|
3015
|
+
},
|
|
3016
|
+
"ez-simple-image-uploader": {
|
|
3017
|
+
uploadTitle: "Upload de imagens",
|
|
3018
|
+
uploadSubtitle: "Envie seus arquivos preenchendo apenas 1 campo por vez.",
|
|
3019
|
+
submit: "Enviar",
|
|
3020
|
+
tooltipMessage: "O arquivo selecionado abaixo será priorizado!",
|
|
3021
|
+
urlInputLabel: "Insira a URL da imagem",
|
|
3022
|
+
orText: "OU",
|
|
3023
|
+
removeFile: "Remover arquivo",
|
|
3024
|
+
dragDropText: "Arraste e solte ou clique para adicionar arquivos",
|
|
3025
|
+
imageAlt: "Imagem",
|
|
3026
|
+
imageTooLarge: "A imagem deve ter menos de {{maxSize}}.",
|
|
3027
|
+
},
|
|
3028
|
+
"ez-search": {
|
|
3029
|
+
emptyList: "Nenhum resultado encontrado",
|
|
3030
|
+
emptySearch: "Nenhum resultado de {{field}} encontrado",
|
|
3031
|
+
},
|
|
3032
|
+
"ez-search-plus": {
|
|
3033
|
+
emptyList: "Nenhum resultado encontrado",
|
|
3034
|
+
optionLoaderNotDefined: "optionLoader não definido",
|
|
3035
|
+
defaultCodeLabel: "Cód.",
|
|
3036
|
+
},
|
|
3037
|
+
"ez-sortable-list": {
|
|
3038
|
+
emptyMessage: "Nenhum item na lista",
|
|
3039
|
+
entityLabel: "item",
|
|
3040
|
+
entityLabelPlural: "itens",
|
|
3041
|
+
total: "Total de",
|
|
3042
|
+
search: "Buscar",
|
|
3043
|
+
},
|
|
3044
|
+
"ez-split-button": {
|
|
3045
|
+
moreOptions: "Mais opções",
|
|
3046
|
+
},
|
|
3047
|
+
"ez-text-edit": {
|
|
3048
|
+
emptyFieldWarning: "Não é possível salvar um campo em branco.",
|
|
3049
|
+
},
|
|
3050
|
+
"ez-time-input": {
|
|
3051
|
+
invalidTime: "Favor inserir um horário válido.",
|
|
3052
|
+
},
|
|
3053
|
+
"ez-sidebar": {
|
|
3054
|
+
unPinMenu: "Desafixar menu",
|
|
3055
|
+
pushPinMenu: "Fixar menu",
|
|
3056
|
+
hideMenu: "Recolher menu",
|
|
3057
|
+
},
|
|
3058
|
+
"ez-form": {
|
|
3059
|
+
mainTab: "Principal",
|
|
3060
|
+
labelSearchField: "Buscar campos (Ctrl+F)",
|
|
3061
|
+
},
|
|
3062
|
+
"utils": {
|
|
3063
|
+
requiredFieldMessage: "Há pelo menos um campo obrigatório não preenchido.",
|
|
3064
|
+
requiredField: "Essa informação é obrigatória.",
|
|
3065
|
+
selectAllPage: "Selecionar apenas a página atual",
|
|
3066
|
+
loadingAllRecords: "Carregando todos os {{count}} registros",
|
|
3067
|
+
selectAllRecords: "Selecionar todos os {{total}} registros",
|
|
3068
|
+
waitForLoad: "Aguarde o carregamento para selecionar o registro de todas as páginas",
|
|
3069
|
+
allRecordsSelected: "Todos os <strong>{{selectionCount}} registros</strong> da grade estão selecionados.",
|
|
3070
|
+
selectedRecords: "Há <strong>{{selectionCount}} registro{{plural}}</strong> selecionado{{plural}} na grade.",
|
|
3071
|
+
},
|
|
3072
|
+
spinner: {
|
|
3073
|
+
loading: "Carregando..."
|
|
3074
|
+
}
|
|
3075
|
+
}
|
|
3076
|
+
};
|
|
3077
|
+
|
|
3078
|
+
const enUsTranslations = {
|
|
3079
|
+
translation: {
|
|
3080
|
+
app: {
|
|
3081
|
+
collapse: "Collapse",
|
|
3082
|
+
expand: "Expand",
|
|
3083
|
+
close: "Close",
|
|
3084
|
+
profile: "Profile",
|
|
3085
|
+
warning: "Warning",
|
|
3086
|
+
edit: "Edit",
|
|
3087
|
+
remove: "Remove",
|
|
3088
|
+
yes: "Yes",
|
|
3089
|
+
no: "No",
|
|
3090
|
+
loading: "Loading",
|
|
3091
|
+
apply: "Apply",
|
|
3092
|
+
cancel: "Cancel",
|
|
3093
|
+
ok: "OK",
|
|
3094
|
+
alerts: "Alerts",
|
|
3095
|
+
requiredInfo: " (required) *",
|
|
3096
|
+
},
|
|
3097
|
+
"ez-upload": {
|
|
3098
|
+
enable: "Drag and drop or click to add files",
|
|
3099
|
+
disable: "Read only",
|
|
3100
|
+
replaceFileTitle: "Replace file",
|
|
3101
|
+
replaceFileMessage: "A file named \"{{fileName}}\" already exists. Do you want to replace it?",
|
|
3102
|
+
maxFilesError: "The maximum number of files is {{maxFiles}}.",
|
|
3103
|
+
emptyFileError: "Permission error: The file \"{{fileName}}\" cannot be uploaded.",
|
|
3104
|
+
missingUploadUrlError: "Upload URL not provided.",
|
|
3105
|
+
maxFileSizeError: "The maximum file size is {{maxSize}}.",
|
|
3106
|
+
uploadErrorTitle: "Uploading file",
|
|
3107
|
+
uploadingMessage: "Files are being uploaded. Please wait for completion or cancel the upload."
|
|
3108
|
+
},
|
|
3109
|
+
"ez-calendar": {
|
|
3110
|
+
month: {
|
|
3111
|
+
0: "January",
|
|
3112
|
+
1: "February",
|
|
3113
|
+
2: "March",
|
|
3114
|
+
3: "April",
|
|
3115
|
+
4: "May",
|
|
3116
|
+
5: "June",
|
|
3117
|
+
6: "July",
|
|
3118
|
+
7: "August",
|
|
3119
|
+
8: "September",
|
|
3120
|
+
9: "October",
|
|
3121
|
+
10: "November",
|
|
3122
|
+
11: "December"
|
|
3123
|
+
},
|
|
3124
|
+
weekDay: {
|
|
3125
|
+
0: "S",
|
|
3126
|
+
1: "M",
|
|
3127
|
+
2: "T",
|
|
3128
|
+
3: "W",
|
|
3129
|
+
4: "T",
|
|
3130
|
+
5: "F",
|
|
3131
|
+
6: "S"
|
|
3132
|
+
},
|
|
3133
|
+
today: "Today"
|
|
3134
|
+
},
|
|
3135
|
+
"ez-collapsible-box": {
|
|
3136
|
+
confirmRemove: "Do you really want to remove the group <b>{{label}}</b>?",
|
|
3137
|
+
},
|
|
3138
|
+
"ez-combo-box": {
|
|
3139
|
+
placeholder: "Select an item",
|
|
3140
|
+
noResults: "No results found",
|
|
3141
|
+
},
|
|
3142
|
+
"ez-classic-combo-box": {
|
|
3143
|
+
emptyOption: "Select an item",
|
|
3144
|
+
noResults: "No results found",
|
|
3145
|
+
},
|
|
3146
|
+
"ez-date-time-input": {
|
|
3147
|
+
invalidDate: "The entered value is not a valid date and time"
|
|
3148
|
+
},
|
|
3149
|
+
"ez-date-input": {
|
|
3150
|
+
invalidDate: "The entered value is not a valid date"
|
|
3151
|
+
},
|
|
3152
|
+
"ez-dialog": {
|
|
3153
|
+
confirmButton: "Confirm or OK button",
|
|
3154
|
+
closeButton: "Close or X button"
|
|
3155
|
+
},
|
|
3156
|
+
"ez-double-list": {
|
|
3157
|
+
noItemsAvailable: "No {{entity}} available",
|
|
3158
|
+
noItemsSelected: "No {{entity}} selected",
|
|
3159
|
+
moveAllTo: "Move all to {{list}}",
|
|
3160
|
+
moveTo: "Move to {{list}}",
|
|
3161
|
+
moveToFirstPosition: "Move to the first position",
|
|
3162
|
+
moveUp: "Move up",
|
|
3163
|
+
moveDown: "Move down",
|
|
3164
|
+
moveToLastPosition: "Move to the last position"
|
|
3165
|
+
},
|
|
3166
|
+
"ez-file-item": {
|
|
3167
|
+
invalidProgress: "The upload progress must be a number between 0 and 100."
|
|
3168
|
+
},
|
|
3169
|
+
"ez-grid": {
|
|
3170
|
+
filterAppliedSuccess: "Column filter applied successfully!",
|
|
3171
|
+
cancelPagination: "Cancel pagination",
|
|
3172
|
+
pageLabel: "Page {{currentPage}}",
|
|
3173
|
+
previousPage: "Previous page",
|
|
3174
|
+
nextPage: "Next page",
|
|
3175
|
+
returnToPreviousPage: "Return to the previous page.",
|
|
3176
|
+
goToNextPage: "Move to the next page.",
|
|
3177
|
+
remainingPageLabel: " from {{count}} or more",
|
|
3178
|
+
remainingTotalLabel: " from {{total}}",
|
|
3179
|
+
nextRecord: "Move to the next record.",
|
|
3180
|
+
previousRecord: "Return to the previous record.",
|
|
3181
|
+
searchColumn: "Search by column.",
|
|
3182
|
+
sortAscending: "Sort Ascending",
|
|
3183
|
+
sortDescending: "Sort Descending",
|
|
3184
|
+
pinColumn: "Pin column",
|
|
3185
|
+
unpinColumn: "Unpin column",
|
|
3186
|
+
filter: "Filter",
|
|
3187
|
+
columnCantBeOrder: "Column cannot be sorted",
|
|
3188
|
+
filterColumnHeader: "Filter for column {{columnLabel}}",
|
|
3189
|
+
clearSelection: "Clear Selection",
|
|
3190
|
+
page: "Page",
|
|
3191
|
+
more: "more",
|
|
3192
|
+
to: "to",
|
|
3193
|
+
of: "of",
|
|
3194
|
+
next: "Next",
|
|
3195
|
+
last: "Last",
|
|
3196
|
+
first: "First",
|
|
3197
|
+
previous: "Previous",
|
|
3198
|
+
loadingOoo: "Loading",
|
|
3199
|
+
selectAll: "Select all",
|
|
3200
|
+
searchOoo: "Search",
|
|
3201
|
+
blanks: "Blanks",
|
|
3202
|
+
filterOoo: "Filter",
|
|
3203
|
+
applyFilter: "Apply filter",
|
|
3204
|
+
equals: "Equals",
|
|
3205
|
+
lessThan: "Less than",
|
|
3206
|
+
greaterThan: "Greater than",
|
|
3207
|
+
contains: "Contains",
|
|
3208
|
+
startsWith: "Starts with",
|
|
3209
|
+
endsWith: "Ends with",
|
|
3210
|
+
group: "Group",
|
|
3211
|
+
columns: "Columns",
|
|
3212
|
+
rowGroupColumns: "Row group columns",
|
|
3213
|
+
rowGroupColumnsEmptyMessage: "Row group columns empty",
|
|
3214
|
+
valueColumns: "Value columns",
|
|
3215
|
+
pivotMode: "Pivot mode",
|
|
3216
|
+
groups: "Groups",
|
|
3217
|
+
values: "Values",
|
|
3218
|
+
pivots: "Pivots",
|
|
3219
|
+
valueColumnsEmptyMessage: "Value columns empty",
|
|
3220
|
+
pivotColumnsEmptyMessage: "Pivot columns empty",
|
|
3221
|
+
toolPanelButton: "Tool panel button",
|
|
3222
|
+
noRowsToShow: "No rows to show.",
|
|
3223
|
+
valueAggregation: "Aggregate value",
|
|
3224
|
+
autosizeThiscolumn: "Autosize this column",
|
|
3225
|
+
autosizeAllColumns: "Autosize all columns",
|
|
3226
|
+
groupBy: "Group by",
|
|
3227
|
+
ungroupBy: "Ungroup by",
|
|
3228
|
+
resetColumns: "Reset columns",
|
|
3229
|
+
expandAll: "Expand all",
|
|
3230
|
+
collapseAll: "Collapse all",
|
|
3231
|
+
toolPanel: "Tool panel",
|
|
3232
|
+
export: "Export",
|
|
3233
|
+
csvExport: "Export to CSV",
|
|
3234
|
+
excelExport: "Export to Excel",
|
|
3235
|
+
pinLeft: "Pin left",
|
|
3236
|
+
pinRight: "Pin right",
|
|
3237
|
+
noPin: "Unpin column",
|
|
3238
|
+
sum: "Sum",
|
|
3239
|
+
min: "Min",
|
|
3240
|
+
max: "Max",
|
|
3241
|
+
none: "None",
|
|
3242
|
+
count: "Count",
|
|
3243
|
+
average: "Average",
|
|
3244
|
+
copy: "Copy",
|
|
3245
|
+
copyWithHeaders: "Copy with headers",
|
|
3246
|
+
ctrlC: "Ctrl+C",
|
|
3247
|
+
paste: "Paste",
|
|
3248
|
+
ctrlV: "Ctrl+V",
|
|
3249
|
+
labelSearchColumn: "Search columns (Ctrl+F)",
|
|
3250
|
+
},
|
|
3251
|
+
"ez-guide-navigator": {
|
|
3252
|
+
searchGuide: "Search guide",
|
|
3253
|
+
hideMenu: "Hide menu",
|
|
3254
|
+
},
|
|
3255
|
+
"ez-list": {
|
|
3256
|
+
moveToGroup: "Move to {{groupName}}",
|
|
3257
|
+
},
|
|
3258
|
+
"ez-modal": {
|
|
3259
|
+
close: "Close modal",
|
|
3260
|
+
},
|
|
3261
|
+
"ez-multi-selection-list": {
|
|
3262
|
+
selectAll: "Select all",
|
|
3263
|
+
search: "Search...",
|
|
3264
|
+
empty: "(Empty)",
|
|
3265
|
+
initMessage: "Select the values to be filtered through the search field.",
|
|
3266
|
+
emptyResults: "No results found.",
|
|
3267
|
+
},
|
|
3268
|
+
"ez-number-input": {
|
|
3269
|
+
invalidNumber: "The entered value is not a valid number",
|
|
3270
|
+
},
|
|
3271
|
+
"ez-rich-text": {
|
|
3272
|
+
listShortcut: "Applies list style to the selected text.",
|
|
3273
|
+
linkShortcut: "Opens link popup.",
|
|
3274
|
+
imageShortcut: "Opens image popup.",
|
|
3275
|
+
boldShortcut: "Applies bold style to the selected text.",
|
|
3276
|
+
italicShortcut: "Applies italic style to the selected text.",
|
|
3277
|
+
underlineShortcut: "Applies underline style to the selected text.",
|
|
3278
|
+
breakLineShortcut: "Applies line break.",
|
|
3279
|
+
undoShortcut: "Undoes the last text change.",
|
|
3280
|
+
redoShortcut: "Redoes the last text change.",
|
|
3281
|
+
edit: "Edit",
|
|
3282
|
+
preview: "Preview",
|
|
3283
|
+
title: {
|
|
3284
|
+
preview: "Ctrl + P",
|
|
3285
|
+
edit: "Switch to edit mode",
|
|
3286
|
+
undo: "Undo (Ctrl + Z)",
|
|
3287
|
+
redo: "Redo (Ctrl + X)",
|
|
3288
|
+
link: "Insert link (Ctrl + K)",
|
|
3289
|
+
image: "Insert image (Ctrl + O)",
|
|
3290
|
+
list: "List (Ctrl + L)",
|
|
3291
|
+
underline: "Underline (Ctrl + U)",
|
|
3292
|
+
italic: "Italic (Ctrl + I)",
|
|
3293
|
+
bold: "Bold (Ctrl + B)",
|
|
3294
|
+
}
|
|
3295
|
+
},
|
|
3296
|
+
"ez-link-builder": {
|
|
3297
|
+
addLinkTitle: "Add link",
|
|
3298
|
+
addLinkSubtitle: "Insert a link into the text to open new pages.",
|
|
3299
|
+
submit: "Submit",
|
|
3300
|
+
urlInputLabel: "Enter the destination URL",
|
|
3301
|
+
textInputLabel: "Enter the text to display",
|
|
3302
|
+
openInNewPage: "Open in a new page.",
|
|
3303
|
+
},
|
|
3304
|
+
"ez-simple-image-uploader": {
|
|
3305
|
+
uploadTitle: "Image Upload",
|
|
3306
|
+
uploadSubtitle: "Upload your files by filling only 1 field at a time.",
|
|
3307
|
+
submit: "Submit",
|
|
3308
|
+
tooltipMessage: "The selected file below will be prioritized!",
|
|
3309
|
+
urlInputLabel: "Enter the image URL",
|
|
3310
|
+
orText: "OR",
|
|
3311
|
+
removeFile: "Remove file",
|
|
3312
|
+
dragDropText: "Drag and drop or click to add files",
|
|
3313
|
+
imageAlt: "Image",
|
|
3314
|
+
imageTooLarge: "The image must be smaller than {{maxSize}}.",
|
|
3315
|
+
},
|
|
3316
|
+
"ez-search": {
|
|
3317
|
+
emptyList: "No results found",
|
|
3318
|
+
emptySearch: "No results for {{field}} found",
|
|
3319
|
+
},
|
|
3320
|
+
"ez-search-plus": {
|
|
3321
|
+
emptyList: "No results found",
|
|
3322
|
+
optionLoaderNotDefined: "optionLoader not defined",
|
|
3323
|
+
defaultCodeLabel: "Code",
|
|
3324
|
+
},
|
|
3325
|
+
"ez-sortable-list": {
|
|
3326
|
+
emptyMessage: "No items in the list",
|
|
3327
|
+
entityLabel: "item",
|
|
3328
|
+
entityLabelPlural: "items",
|
|
3329
|
+
total: "Total of",
|
|
3330
|
+
search: "Search",
|
|
3331
|
+
},
|
|
3332
|
+
"ez-split-button": {
|
|
3333
|
+
moreOptions: "More options",
|
|
3334
|
+
},
|
|
3335
|
+
"ez-text-edit": {
|
|
3336
|
+
emptyFieldWarning: "It is not possible to save an empty field.",
|
|
3337
|
+
},
|
|
3338
|
+
"ez-time-input": {
|
|
3339
|
+
invalidTime: "Please enter a valid time.",
|
|
3340
|
+
},
|
|
3341
|
+
"ez-sidebar": {
|
|
3342
|
+
unPinMenu: "Unpin menu",
|
|
3343
|
+
pushPinMenu: "Pin menu",
|
|
3344
|
+
hideMenu: "Hide menu",
|
|
3345
|
+
},
|
|
3346
|
+
"ez-form": {
|
|
3347
|
+
mainTab: "Main",
|
|
3348
|
+
labelSearchField: "Search fields (Ctrl+F)",
|
|
3349
|
+
},
|
|
3350
|
+
"utils": {
|
|
3351
|
+
requiredFieldMessage: "There is at least one required field not filled.",
|
|
3352
|
+
requiredField: "This information is required.",
|
|
3353
|
+
selectAllPage: "Select only the current page",
|
|
3354
|
+
loadingAllRecords: "Loading all {{count}} records",
|
|
3355
|
+
selectAllRecords: "Select all {{total}} records",
|
|
3356
|
+
waitForLoad: "Wait for loading to select records from all pages",
|
|
3357
|
+
allRecordsSelected: "All <strong>{{selectionCount}} records</strong> in the grid are selected.",
|
|
3358
|
+
selectedRecords: "There <strong>{{selectionCount}} record{{plural}}</strong> selected in the grid.",
|
|
3359
|
+
},
|
|
3360
|
+
spinner: {
|
|
3361
|
+
loading: "Loading..."
|
|
3362
|
+
}
|
|
3363
|
+
}
|
|
3364
|
+
};
|
|
3365
|
+
|
|
3366
|
+
const esEsTranslations = {
|
|
3367
|
+
translation: {
|
|
3368
|
+
app: {
|
|
3369
|
+
collapse: "Colapsar",
|
|
3370
|
+
expand: "Expandir",
|
|
3371
|
+
close: "Cerrar",
|
|
3372
|
+
profile: "Perfil",
|
|
3373
|
+
warning: "Aviso",
|
|
3374
|
+
edit: "Editar",
|
|
3375
|
+
remove: "Eliminar",
|
|
3376
|
+
yes: "Sí",
|
|
3377
|
+
no: "No",
|
|
3378
|
+
loading: "Cargando",
|
|
3379
|
+
apply: "Aplicar",
|
|
3380
|
+
cancel: "Cancelar",
|
|
3381
|
+
ok: "OK",
|
|
3382
|
+
alerts: "Avisos",
|
|
3383
|
+
requiredInfo: " (obligatorio) *",
|
|
3384
|
+
},
|
|
3385
|
+
"ez-upload": {
|
|
3386
|
+
enable: "Arrastra y suelta o haz clic para subir archivos",
|
|
3387
|
+
disable: "Solo lectura",
|
|
3388
|
+
replaceFileTitle: "Reemplazar archivo",
|
|
3389
|
+
replaceFileMessage: "Ya existe un archivo llamado \"{{fileName}}\". ¿Desea reemplazarlo?",
|
|
3390
|
+
maxFilesError: "La cantidad máxima de archivos es {{maxFiles}}.",
|
|
3391
|
+
emptyFileError: "Error de permiso: El archivo \"{{fileName}}\" no puede ser enviado.",
|
|
3392
|
+
missingUploadUrlError: "Dirección de carga no informada.",
|
|
3393
|
+
maxFileSizeError: "El tamaño máximo de los archivos es de {{maxSize}}.",
|
|
3394
|
+
uploadErrorTitle: "Subiendo archivo",
|
|
3395
|
+
uploadingMessage: "Se están subiendo archivos. Por favor, espere a que se complete o cancele la subida.",
|
|
3396
|
+
},
|
|
3397
|
+
"ez-calendar": {
|
|
3398
|
+
month: {
|
|
3399
|
+
0: "Enero",
|
|
3400
|
+
1: "Febrero",
|
|
3401
|
+
2: "Marzo",
|
|
3402
|
+
3: "Abril",
|
|
3403
|
+
4: "Mayo",
|
|
3404
|
+
5: "Junio",
|
|
3405
|
+
6: "Julio",
|
|
3406
|
+
7: "Agosto",
|
|
3407
|
+
8: "Septiembre",
|
|
3408
|
+
9: "Octubre",
|
|
3409
|
+
10: "Noviembre",
|
|
3410
|
+
11: "Diciembre"
|
|
3411
|
+
},
|
|
3412
|
+
weekDay: {
|
|
3413
|
+
0: "D",
|
|
3414
|
+
1: "L",
|
|
3415
|
+
2: "M",
|
|
3416
|
+
3: "M",
|
|
3417
|
+
4: "J",
|
|
3418
|
+
5: "V",
|
|
3419
|
+
6: "S"
|
|
3420
|
+
},
|
|
3421
|
+
today: "Hoy"
|
|
3422
|
+
},
|
|
3423
|
+
"ez-collapsible-box": {
|
|
3424
|
+
confirmRemove: "¿Realmente desea eliminar el grupo <b>{{label}}</b>?",
|
|
3425
|
+
},
|
|
3426
|
+
"ez-combo-box": {
|
|
3427
|
+
placeholder: "Seleccione un elemento",
|
|
3428
|
+
noResults: "No se encontraron resultados",
|
|
3429
|
+
},
|
|
3430
|
+
"ez-classic-combo-box": {
|
|
3431
|
+
emptyOption: "Seleccione un elemento",
|
|
3432
|
+
noResults: "No se encontraron resultados",
|
|
3433
|
+
},
|
|
3434
|
+
"ez-date-time-input": {
|
|
3435
|
+
invalidDate: "El valor ingresado no es una fecha y hora válida"
|
|
3436
|
+
},
|
|
3437
|
+
"ez-date-input": {
|
|
3438
|
+
invalidDate: "El valor ingresado no es una fecha válida"
|
|
3439
|
+
},
|
|
3440
|
+
"ez-dialog": {
|
|
3441
|
+
confirmButton: "Botón de confirmación o OK",
|
|
3442
|
+
closeButton: "Botón de cerrar o X"
|
|
3443
|
+
},
|
|
3444
|
+
"ez-double-list": {
|
|
3445
|
+
noItemsAvailable: "No hay {{entity}} disponible",
|
|
3446
|
+
noItemsSelected: "No hay {{entity}} seleccionado",
|
|
3447
|
+
moveAllTo: "Mover todos a {{list}}",
|
|
3448
|
+
moveTo: "Mover a {{list}}",
|
|
3449
|
+
moveToFirstPosition: "Mover a la primera posición",
|
|
3450
|
+
moveUp: "Mover hacia arriba",
|
|
3451
|
+
moveDown: "Mover hacia abajo",
|
|
3452
|
+
moveToLastPosition: "Mover a la última posición"
|
|
3453
|
+
},
|
|
3454
|
+
"ez-file-item": {
|
|
3455
|
+
invalidProgress: "El progreso de carga debe ser un número entre 0 y 100."
|
|
3456
|
+
},
|
|
3457
|
+
"ez-grid": {
|
|
3458
|
+
filterAppliedSuccess: "¡Filtro de columna aplicado con éxito!",
|
|
3459
|
+
cancelPagination: "Cancelar paginación",
|
|
3460
|
+
pageLabel: "Página {{currentPage}}",
|
|
3461
|
+
previousPage: "Página anterior",
|
|
3462
|
+
nextPage: "Página siguiente",
|
|
3463
|
+
returnToPreviousPage: "Volver a la página anterior.",
|
|
3464
|
+
goToNextPage: "Avanzar a la página siguiente.",
|
|
3465
|
+
remainingPageLabel: " de {{count}} o más",
|
|
3466
|
+
remainingTotalLabel: " de {{total}}",
|
|
3467
|
+
nextRecord: "Avanzar al siguiente registro.",
|
|
3468
|
+
previousRecord: "Volver al registro anterior.",
|
|
3469
|
+
searchColumn: "Buscar por columna.",
|
|
3470
|
+
sortAscending: "Ordenar Ascendente",
|
|
3471
|
+
sortDescending: "Ordenar Descendente",
|
|
3472
|
+
pinColumn: "Fijar columna",
|
|
3473
|
+
unpinColumn: "Desafijar columna",
|
|
3474
|
+
filter: "Filtrar",
|
|
3475
|
+
columnCantBeOrder: "La columna no se puede ordenar",
|
|
3476
|
+
filterColumnHeader: "Filtro de la columna {{columnLabel}}",
|
|
3477
|
+
clearSelection: "Limpiar Selección",
|
|
3478
|
+
page: "Página",
|
|
3479
|
+
more: "más",
|
|
3480
|
+
to: "a",
|
|
3481
|
+
of: "de",
|
|
3482
|
+
next: "Siguiente",
|
|
3483
|
+
last: "Último",
|
|
3484
|
+
first: "Primero",
|
|
3485
|
+
previous: "Anterior",
|
|
3486
|
+
loadingOoo: "Cargando",
|
|
3487
|
+
selectAll: "Seleccionar todo",
|
|
3488
|
+
searchOoo: "Buscar",
|
|
3489
|
+
blanks: "Vacío",
|
|
3490
|
+
filterOoo: "Filtrar",
|
|
3491
|
+
applyFilter: "Aplicar filtro",
|
|
3492
|
+
equals: "Igual",
|
|
3493
|
+
lessThan: "Menor que",
|
|
3494
|
+
greaterThan: "Mayor que",
|
|
3495
|
+
contains: "Contiene",
|
|
3496
|
+
startsWith: "Empieza con",
|
|
3497
|
+
endsWith: "Termina con",
|
|
3498
|
+
group: "Grupo",
|
|
3499
|
+
columns: "Columnas",
|
|
3500
|
+
rowGroupColumns: "Columnas del grupo de filas",
|
|
3501
|
+
rowGroupColumnsEmptyMessage: "Columnas del grupo de filas vacías",
|
|
3502
|
+
valueColumns: "Valores de las columnas",
|
|
3503
|
+
pivotMode: "Modo pivote",
|
|
3504
|
+
groups: "Grupos",
|
|
3505
|
+
values: "Valores",
|
|
3506
|
+
pivots: "Pivotes",
|
|
3507
|
+
valueColumnsEmptyMessage: "Valores de columnas vacías",
|
|
3508
|
+
pivotColumnsEmptyMessage: "Pivotes de columnas vacías",
|
|
3509
|
+
toolPanelButton: "Botón del panel de herramientas",
|
|
3510
|
+
noRowsToShow: "No hay registros para mostrar.",
|
|
3511
|
+
valueAggregation: "Agregar valor",
|
|
3512
|
+
autosizeThiscolumn: "Redimensionar esta columna",
|
|
3513
|
+
autosizeAllColumns: "Redimensionar todas las columnas",
|
|
3514
|
+
groupBy: "Agrupar por",
|
|
3515
|
+
ungroupBy: "Desagrupar por",
|
|
3516
|
+
resetColumns: "Restablecer columnas",
|
|
3517
|
+
expandAll: "Expandir todo",
|
|
3518
|
+
collapseAll: "Contraer todo",
|
|
3519
|
+
toolPanel: "Panel de herramientas",
|
|
3520
|
+
export: "Exportar",
|
|
3521
|
+
csvExport: "Exportar a CSV",
|
|
3522
|
+
excelExport: "Exportar a Excel",
|
|
3523
|
+
pinLeft: "Fijar a la izquierda",
|
|
3524
|
+
pinRight: "Fijar a la derecha",
|
|
3525
|
+
noPin: "Desfijar columna",
|
|
3526
|
+
sum: "Suma",
|
|
3527
|
+
min: "Mínimo",
|
|
3528
|
+
max: "Máximo",
|
|
3529
|
+
none: "Ninguno",
|
|
3530
|
+
count: "Conteo",
|
|
3531
|
+
average: "Promedio",
|
|
3532
|
+
copy: "Copiar",
|
|
3533
|
+
copyWithHeaders: "Copiar con encabezados",
|
|
3534
|
+
ctrlC: "Ctrl+C",
|
|
3535
|
+
paste: "Pegar",
|
|
3536
|
+
ctrlV: "Ctrl+V",
|
|
3537
|
+
labelSearchColumn: "Buscar columnas (Ctrl+F)",
|
|
3538
|
+
},
|
|
3539
|
+
"ez-guide-navigator": {
|
|
3540
|
+
searchGuide: "Buscar guía",
|
|
3541
|
+
hideMenu: "Ocultar menú",
|
|
3542
|
+
},
|
|
3543
|
+
"ez-list": {
|
|
3544
|
+
moveToGroup: "Mover a {{groupName}}",
|
|
3545
|
+
},
|
|
3546
|
+
"ez-modal": {
|
|
3547
|
+
close: "Cerrar modal",
|
|
3548
|
+
},
|
|
3549
|
+
"ez-multi-selection-list": {
|
|
3550
|
+
selectAll: "Seleccionar todos",
|
|
3551
|
+
search: "Buscar...",
|
|
3552
|
+
empty: "(Vacío)",
|
|
3553
|
+
initMessage: "Seleccione los valores a filtrar a través del campo de búsqueda.",
|
|
3554
|
+
emptyResults: "No se encontraron resultados.",
|
|
3555
|
+
},
|
|
3556
|
+
"ez-number-input": {
|
|
3557
|
+
invalidNumber: "El valor ingresado no es un número válido",
|
|
3558
|
+
},
|
|
3559
|
+
"ez-rich-text": {
|
|
3560
|
+
listShortcut: "Aplica estilo de lista al texto seleccionado.",
|
|
3561
|
+
linkShortcut: "Abre popup de enlace.",
|
|
3562
|
+
imageShortcut: "Abre popup de imagen.",
|
|
3563
|
+
boldShortcut: "Aplica estilo negrita al texto seleccionado.",
|
|
3564
|
+
italicShortcut: "Aplica estilo cursiva al texto seleccionado.",
|
|
3565
|
+
underlineShortcut: "Aplica estilo subrayado al texto seleccionado.",
|
|
3566
|
+
breakLineShortcut: "Aplica salto de línea.",
|
|
3567
|
+
undoShortcut: "Deshace el último cambio de texto.",
|
|
3568
|
+
redoShortcut: "Rehace el último cambio de texto.",
|
|
3569
|
+
edit: "Editar",
|
|
3570
|
+
preview: "Previsualizar",
|
|
3571
|
+
title: {
|
|
3572
|
+
preview: "Ctrl + P",
|
|
3573
|
+
edit: "Ir al modo de edición",
|
|
3574
|
+
undo: "Deshacer (Ctrl + Z)",
|
|
3575
|
+
redo: "Rehacer (Ctrl + X)",
|
|
3576
|
+
link: "Insertar enlace (Ctrl + K)",
|
|
3577
|
+
image: "Insertar imagen (Ctrl + O)",
|
|
3578
|
+
list: "Lista (Ctrl + L)",
|
|
3579
|
+
underline: "Subrayado (Ctrl + U)",
|
|
3580
|
+
italic: "Cursiva (Ctrl + I)",
|
|
3581
|
+
bold: "Negrita (Ctrl + B)",
|
|
3582
|
+
}
|
|
3583
|
+
},
|
|
3584
|
+
"ez-link-builder": {
|
|
3585
|
+
addLinkTitle: "Agregar enlace",
|
|
3586
|
+
addLinkSubtitle: "Inserte un enlace en el texto para abrir nuevas páginas.",
|
|
3587
|
+
submit: "Enviar",
|
|
3588
|
+
urlInputLabel: "Ingrese la URL de destino",
|
|
3589
|
+
textInputLabel: "Ingrese el texto a mostrar",
|
|
3590
|
+
openInNewPage: "Abrir en una nueva página.",
|
|
3591
|
+
},
|
|
3592
|
+
"ez-simple-image-uploader": {
|
|
3593
|
+
uploadTitle: "Subida de imágenes",
|
|
3594
|
+
uploadSubtitle: "Sube tus archivos llenando solo 1 campo a la vez.",
|
|
3595
|
+
submit: "Enviar",
|
|
3596
|
+
tooltipMessage: "¡El archivo seleccionado a continuación será priorizado!",
|
|
3597
|
+
urlInputLabel: "Ingrese la URL de la imagen",
|
|
3598
|
+
orText: "O",
|
|
3599
|
+
removeFile: "Eliminar archivo",
|
|
3600
|
+
dragDropText: "Arrastra y suelta o haz clic para agregar archivos",
|
|
3601
|
+
imageAlt: "Imagen",
|
|
3602
|
+
imageTooLarge: "La imagen debe tener menos de {{maxSize}}.",
|
|
3603
|
+
},
|
|
3604
|
+
"ez-search": {
|
|
3605
|
+
emptyList: "No se encontraron resultados",
|
|
3606
|
+
emptySearch: "No se encontraron resultados de {{field}}",
|
|
3607
|
+
},
|
|
3608
|
+
"ez-search-plus": {
|
|
3609
|
+
emptyList: "No se encontraron resultados",
|
|
3610
|
+
optionLoaderNotDefined: "optionLoader no definido",
|
|
3611
|
+
defaultCodeLabel: "Cód.",
|
|
3612
|
+
},
|
|
3613
|
+
"ez-sortable-list": {
|
|
3614
|
+
emptyMessage: "No hay elementos en la lista",
|
|
3615
|
+
entityLabel: "elemento",
|
|
3616
|
+
entityLabelPlural: "elementos",
|
|
3617
|
+
total: "Total de",
|
|
3618
|
+
search: "Buscar",
|
|
3619
|
+
},
|
|
3620
|
+
"ez-split-button": {
|
|
3621
|
+
moreOptions: "Más opciones",
|
|
3622
|
+
},
|
|
3623
|
+
"ez-text-edit": {
|
|
3624
|
+
emptyFieldWarning: "No es posible guardar un campo vacío.",
|
|
3625
|
+
},
|
|
3626
|
+
"ez-time-input": {
|
|
3627
|
+
invalidTime: "Por favor, ingrese una hora válida.",
|
|
3628
|
+
},
|
|
3629
|
+
"ez-sidebar": {
|
|
3630
|
+
unPinMenu: "Desanclar menú",
|
|
3631
|
+
pushPinMenu: "Anclar menú",
|
|
3632
|
+
hideMenu: "Ocultar menú",
|
|
3633
|
+
},
|
|
3634
|
+
"ez-form": {
|
|
3635
|
+
mainTab: "Principal",
|
|
3636
|
+
labelSearchField: "Buscar campos (Ctrl+F)",
|
|
3637
|
+
},
|
|
3638
|
+
"utils": {
|
|
3639
|
+
requiredFieldMessage: "Hay al menos un campo obligatorio sin completar.",
|
|
3640
|
+
requiredField: "Esta información es obligatoria.",
|
|
3641
|
+
selectAllPage: "Seleccionar solo la página actual",
|
|
3642
|
+
loadingAllRecords: "Cargando todos los {{count}} registros",
|
|
3643
|
+
selectAllRecords: "Seleccionar todos los {{total}} registros",
|
|
3644
|
+
waitForLoad: "Espere a que se carguen para seleccionar los registros de todas las páginas",
|
|
3645
|
+
allRecordsSelected: "Todos los <strong>{{selectionCount}} registros</strong> en la cuadrícula están seleccionados.",
|
|
3646
|
+
selectedRecords: "Hay <strong>{{selectionCount}} registro{{plural}}</strong> seleccionado{{plural}} en la cuadrícula.",
|
|
3647
|
+
},
|
|
3648
|
+
spinner: {
|
|
3649
|
+
loading: "Cargando...",
|
|
3650
|
+
}
|
|
3651
|
+
}
|
|
3652
|
+
};
|
|
3653
|
+
|
|
3654
|
+
var ELanguages;
|
|
3655
|
+
(function (ELanguages) {
|
|
3656
|
+
ELanguages["PT_BR"] = "pt_BR";
|
|
3657
|
+
ELanguages["EN_US"] = "en_US";
|
|
3658
|
+
ELanguages["ES_ES"] = "es_ES";
|
|
3659
|
+
})(ELanguages || (ELanguages = {}));
|
|
3660
|
+
|
|
3661
|
+
const translations = {
|
|
3662
|
+
[ELanguages.PT_BR]: ptBrTranslations,
|
|
3663
|
+
[ELanguages.EN_US]: enUsTranslations,
|
|
3664
|
+
[ELanguages.ES_ES]: esEsTranslations,
|
|
3665
|
+
};
|
|
3666
|
+
|
|
3667
|
+
const KEY_I18N = "__EZ_UI_I18N_INSTANCE__";
|
|
3668
|
+
function getI18n() {
|
|
3669
|
+
let i18nInstance = core.ApplicationContext.getContextValue(KEY_I18N);
|
|
3670
|
+
return i18nInstance;
|
|
3671
|
+
}
|
|
3672
|
+
const initI18n = async (forceLang) => {
|
|
3673
|
+
let i18nTFunction = getI18n();
|
|
3674
|
+
if (!i18nTFunction) {
|
|
3675
|
+
const i18nInstance = instance.createInstance();
|
|
3676
|
+
const i18nextOptions = {
|
|
3677
|
+
resources: translations,
|
|
3678
|
+
fallbackLng: ELanguages.PT_BR
|
|
3679
|
+
};
|
|
3680
|
+
await i18nInstance
|
|
3681
|
+
.use(Browser)
|
|
3682
|
+
.init(i18nextOptions);
|
|
3683
|
+
const documentLanguage = core.LangUtils.getLanguage();
|
|
3684
|
+
const lang = forceLang !== null && forceLang !== void 0 ? forceLang : documentLanguage;
|
|
3685
|
+
await i18nInstance.changeLanguage(lang);
|
|
3686
|
+
core.ApplicationContext.setContextValue(KEY_I18N, i18nInstance.t);
|
|
3687
|
+
i18nTFunction = i18nInstance.t;
|
|
3688
|
+
}
|
|
3689
|
+
return i18nTFunction;
|
|
3690
|
+
};
|
|
3691
|
+
|
|
3692
|
+
exports.getI18n = getI18n;
|
|
3693
|
+
exports.initI18n = initI18n;
|