@ptsecurity/mosaic 12.3.0 → 13.1.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/_theming.scss +978 -781
- package/_visual.scss +848 -692
- package/autocomplete/README.md +0 -0
- package/autocomplete/package.json +5 -5
- package/button/README.md +0 -0
- package/button/button.component.d.ts +17 -14
- package/button/button.module.d.ts +1 -1
- package/button/package.json +5 -5
- package/button-toggle/README.md +0 -0
- package/button-toggle/package.json +5 -5
- package/card/README.md +0 -0
- package/card/package.json +5 -5
- package/checkbox/README.md +1 -0
- package/checkbox/package.json +5 -5
- package/core/formatters/date/formatter.d.ts +41 -17
- package/core/formatters/date/templates/en-US.d.ts +8 -8
- package/core/formatters/date/templates/ru-RU.d.ts +8 -8
- package/core/package.json +5 -5
- package/core/pop-up/pop-up.d.ts +1 -0
- package/core/public-api.d.ts +1 -0
- package/core/version.d.ts +2 -0
- package/datepicker/README.md +0 -0
- package/datepicker/package.json +5 -5
- package/design-tokens/{tokens → legacy-2017/tokens}/components/alert.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/autocomplete.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/badge.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/button-toggle.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/button.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/card.json5 +0 -0
- package/design-tokens/legacy-2017/tokens/components/checkbox.json5 +39 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/datepicker.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/divider.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/dropdown.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/form-field.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/forms.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/input.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/link.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/list.json5 +0 -0
- package/design-tokens/legacy-2017/tokens/components/modal.json5 +79 -0
- package/design-tokens/legacy-2017/tokens/components/navbar.json5 +69 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/optgroup.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/option.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/popover.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/popup.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/progress-bar.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/progress-spinner.json5 +0 -0
- package/design-tokens/legacy-2017/tokens/components/radio.json5 +44 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/select.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/sidepanel.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/table.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/tabs.json5 +0 -0
- package/design-tokens/legacy-2017/tokens/components/tags.json5 +132 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/textarea.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/timepicker.json5 +0 -0
- package/design-tokens/legacy-2017/tokens/components/toggle.json5 +79 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/tooltip.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/components/tree.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/properties/aliases.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/properties/colors.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/properties/font.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/properties/globals.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/properties/padding.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/properties/palette.json5 +0 -0
- package/design-tokens/{tokens → legacy-2017/tokens}/properties/typography.json5 +0 -0
- package/design-tokens/legacy-2017/tokens.d.ts +7659 -0
- package/design-tokens/package.json +5 -5
- package/design-tokens/pt-2022/tokens/components/alert.json5 +83 -0
- package/design-tokens/pt-2022/tokens/components/autocomplete.json5 +11 -0
- package/design-tokens/pt-2022/tokens/components/badge.json5 +184 -0
- package/design-tokens/pt-2022/tokens/components/button-toggle.json5 +10 -0
- package/design-tokens/pt-2022/tokens/components/button.json5 +143 -0
- package/design-tokens/pt-2022/tokens/components/card.json5 +51 -0
- package/design-tokens/pt-2022/tokens/components/checkbox.json5 +39 -0
- package/design-tokens/pt-2022/tokens/components/datepicker.json5 +64 -0
- package/design-tokens/pt-2022/tokens/components/divider.json5 +8 -0
- package/design-tokens/pt-2022/tokens/components/dropdown.json5 +47 -0
- package/design-tokens/pt-2022/tokens/components/form-field.json5 +52 -0
- package/design-tokens/pt-2022/tokens/components/forms.json5 +52 -0
- package/design-tokens/pt-2022/tokens/components/input.json5 +13 -0
- package/design-tokens/pt-2022/tokens/components/link.json5 +56 -0
- package/design-tokens/pt-2022/tokens/components/list.json5 +15 -0
- package/design-tokens/pt-2022/tokens/components/modal.json5 +79 -0
- package/design-tokens/pt-2022/tokens/components/navbar.json5 +69 -0
- package/design-tokens/pt-2022/tokens/components/optgroup.json5 +10 -0
- package/design-tokens/pt-2022/tokens/components/option.json5 +12 -0
- package/design-tokens/pt-2022/tokens/components/popover.json5 +68 -0
- package/design-tokens/pt-2022/tokens/components/popup.json5 +18 -0
- package/design-tokens/pt-2022/tokens/components/progress-bar.json5 +13 -0
- package/design-tokens/pt-2022/tokens/components/progress-spinner.json5 +7 -0
- package/design-tokens/pt-2022/tokens/components/radio.json5 +44 -0
- package/design-tokens/pt-2022/tokens/components/select.json5 +25 -0
- package/design-tokens/pt-2022/tokens/components/sidepanel.json5 +30 -0
- package/design-tokens/pt-2022/tokens/components/table.json5 +15 -0
- package/design-tokens/pt-2022/tokens/components/tabs.json5 +25 -0
- package/design-tokens/pt-2022/tokens/components/tags.json5 +132 -0
- package/design-tokens/pt-2022/tokens/components/textarea.json5 +12 -0
- package/design-tokens/pt-2022/tokens/components/timepicker.json5 +7 -0
- package/design-tokens/pt-2022/tokens/components/toggle.json5 +79 -0
- package/design-tokens/pt-2022/tokens/components/tooltip.json5 +83 -0
- package/design-tokens/pt-2022/tokens/components/tree.json5 +12 -0
- package/design-tokens/pt-2022/tokens/properties/aliases.json5 +3 -0
- package/design-tokens/pt-2022/tokens/properties/colors.json5 +112 -0
- package/design-tokens/pt-2022/tokens/properties/font.json5 +15 -0
- package/design-tokens/pt-2022/tokens/properties/globals.json5 +30 -0
- package/design-tokens/pt-2022/tokens/properties/padding.json5 +3 -0
- package/design-tokens/pt-2022/tokens/properties/palette.json5 +226 -0
- package/design-tokens/pt-2022/tokens/properties/typography.json5 +140 -0
- package/design-tokens/pt-2022/tokens.d.ts +8696 -0
- package/design-tokens/public-api.d.ts +3 -1
- package/divider/README.md +0 -0
- package/divider/package.json +5 -5
- package/dropdown/package.json +5 -5
- package/esm2020/autocomplete/autocomplete-origin.directive.mjs +21 -0
- package/esm2020/autocomplete/autocomplete-trigger.directive.mjs +555 -0
- package/esm2020/autocomplete/autocomplete.component.mjs +154 -0
- package/esm2020/autocomplete/autocomplete.module.mjs +34 -0
- package/{esm2015/autocomplete/index.js → esm2020/autocomplete/index.mjs} +0 -0
- package/{esm2015/autocomplete/ptsecurity-mosaic-autocomplete.js → esm2020/autocomplete/ptsecurity-mosaic-autocomplete.mjs} +0 -0
- package/{esm2015/autocomplete/public-api.js → esm2020/autocomplete/public-api.mjs} +0 -0
- package/esm2020/button/button.component.mjs +129 -0
- package/esm2020/button/button.module.mjs +38 -0
- package/{esm2015/button/index.js → esm2020/button/index.mjs} +0 -0
- package/{esm2015/button/ptsecurity-mosaic-button.js → esm2020/button/ptsecurity-mosaic-button.mjs} +0 -0
- package/{esm2015/button/public-api.js → esm2020/button/public-api.mjs} +0 -0
- package/esm2020/button-toggle/button-toggle.component.mjs +362 -0
- package/esm2020/button-toggle/button-toggle.module.mjs +19 -0
- package/{esm2015/button-toggle/index.js → esm2020/button-toggle/index.mjs} +0 -0
- package/{esm2015/button-toggle/ptsecurity-mosaic-button-toggle.js → esm2020/button-toggle/ptsecurity-mosaic-button-toggle.mjs} +0 -0
- package/{esm2015/button-toggle/public-api.js → esm2020/button-toggle/public-api.mjs} +0 -0
- package/esm2020/card/card.component.mjs +80 -0
- package/esm2020/card/card.module.mjs +30 -0
- package/{esm2015/card/index.js → esm2020/card/index.mjs} +0 -0
- package/{esm2015/card/ptsecurity-mosaic-card.js → esm2020/card/ptsecurity-mosaic-card.mjs} +0 -0
- package/{esm2015/card/public-api.js → esm2020/card/public-api.mjs} +0 -0
- package/{esm2015/checkbox/checkbox-config.js → esm2020/checkbox/checkbox-config.mjs} +0 -0
- package/esm2020/checkbox/checkbox-module.mjs +19 -0
- package/esm2020/checkbox/checkbox-required-validator.mjs +27 -0
- package/esm2020/checkbox/checkbox.mjs +315 -0
- package/{esm2015/checkbox/index.js → esm2020/checkbox/index.mjs} +0 -0
- package/{esm2015/checkbox/ptsecurity-mosaic-checkbox.js → esm2020/checkbox/ptsecurity-mosaic-checkbox.mjs} +0 -0
- package/{esm2015/checkbox/public-api.js → esm2020/checkbox/public-api.mjs} +0 -0
- package/{esm2015/core/animation/animation.js → esm2020/core/animation/animation.mjs} +0 -0
- package/{esm2015/core/animation/fade-animations.js → esm2020/core/animation/fade-animations.mjs} +0 -0
- package/{esm2015/core/animation/index.js → esm2020/core/animation/index.mjs} +0 -0
- package/{esm2015/core/animation/select-animations.js → esm2020/core/animation/select-animations.mjs} +0 -0
- package/{esm2015/core/common-behaviors/color.js → esm2020/core/common-behaviors/color.mjs} +0 -0
- package/esm2020/core/common-behaviors/common-module.mjs +83 -0
- package/{esm2015/core/common-behaviors/constructor.js → esm2020/core/common-behaviors/constructor.mjs} +0 -0
- package/{esm2015/core/common-behaviors/disabled.js → esm2020/core/common-behaviors/disabled.mjs} +0 -0
- package/{esm2015/core/common-behaviors/error-state.js → esm2020/core/common-behaviors/error-state.mjs} +0 -0
- package/{esm2015/core/common-behaviors/index.js → esm2020/core/common-behaviors/index.mjs} +0 -0
- package/{esm2015/core/common-behaviors/tabindex.js → esm2020/core/common-behaviors/tabindex.mjs} +0 -0
- package/esm2020/core/error/error-options.mjs +26 -0
- package/esm2020/core/formatters/date/formatter.mjs +359 -0
- package/esm2020/core/formatters/date/templates/en-US.mjs +281 -0
- package/esm2020/core/formatters/date/templates/ru-RU.mjs +281 -0
- package/esm2020/core/formatters/index.mjs +20 -0
- package/esm2020/core/formatters/number/formatter.mjs +105 -0
- package/esm2020/core/forms/forms-module.mjs +24 -0
- package/esm2020/core/forms/forms.directive.mjs +66 -0
- package/{esm2015/core/forms/index.js → esm2020/core/forms/index.mjs} +0 -0
- package/esm2020/core/highlight/highlight.pipe.mjs +17 -0
- package/esm2020/core/highlight/index.mjs +19 -0
- package/{esm2015/core/index.js → esm2020/core/index.mjs} +0 -0
- package/{esm2015/core/label/label-options.js → esm2020/core/label/label-options.mjs} +0 -0
- package/esm2020/core/line/line.mjs +70 -0
- package/esm2020/core/option/action.mjs +121 -0
- package/{esm2015/core/option/index.js → esm2020/core/option/index.mjs} +0 -0
- package/esm2020/core/option/optgroup.mjs +31 -0
- package/esm2020/core/option/option-module.mjs +21 -0
- package/esm2020/core/option/option.mjs +254 -0
- package/{esm2015/core/overlay/overlay-position-map.js → esm2020/core/overlay/overlay-position-map.mjs} +0 -0
- package/{esm2015/core/pop-up/constants.js → esm2020/core/pop-up/constants.mjs} +0 -0
- package/{esm2015/core/pop-up/index.js → esm2020/core/pop-up/index.mjs} +0 -0
- package/esm2020/core/pop-up/pop-up-trigger.mjs +239 -0
- package/esm2020/core/pop-up/pop-up.mjs +94 -0
- package/{esm2015/core/ptsecurity-mosaic-core.js → esm2020/core/ptsecurity-mosaic-core.mjs} +0 -0
- package/esm2020/core/public-api.mjs +18 -0
- package/{esm2015/core/select/constants.js → esm2020/core/select/constants.mjs} +0 -0
- package/{esm2015/core/select/errors.js → esm2020/core/select/errors.mjs} +0 -0
- package/{esm2015/core/select/events.js → esm2020/core/select/events.mjs} +0 -0
- package/{esm2015/core/select/index.js → esm2020/core/select/index.mjs} +0 -0
- package/{esm2015/core/selection/constants.js → esm2020/core/selection/constants.mjs} +0 -0
- package/{esm2015/core/selection/index.js → esm2020/core/selection/index.mjs} +0 -0
- package/esm2020/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +37 -0
- package/esm2020/core/selection/pseudo-checkbox/pseudo-checkbox.module.mjs +18 -0
- package/esm2020/core/services/measure-scrollbar.service.mjs +48 -0
- package/{esm2015/core/utils/index.js → esm2020/core/utils/index.mjs} +0 -0
- package/{esm2015/core/utils/public-api.js → esm2020/core/utils/public-api.mjs} +0 -0
- package/{esm2015/core/utils/utils.js → esm2020/core/utils/utils.mjs} +0 -0
- package/{esm2015/core/validation/index.js → esm2020/core/validation/index.mjs} +0 -0
- package/{esm2015/core/validation/validation.js → esm2020/core/validation/validation.mjs} +0 -0
- package/esm2020/core/version.mjs +3 -0
- package/esm2020/datepicker/calendar-body.component.mjs +106 -0
- package/esm2020/datepicker/calendar.component.mjs +362 -0
- package/{esm2015/datepicker/datepicker-animations.js → esm2020/datepicker/datepicker-animations.mjs} +0 -0
- package/{esm2015/datepicker/datepicker-errors.js → esm2020/datepicker/datepicker-errors.mjs} +0 -0
- package/esm2020/datepicker/datepicker-input.directive.mjs +900 -0
- package/esm2020/datepicker/datepicker-intl.mjs +40 -0
- package/esm2020/datepicker/datepicker-module.mjs +107 -0
- package/esm2020/datepicker/datepicker-toggle.component.mjs +86 -0
- package/esm2020/datepicker/datepicker.component.mjs +408 -0
- package/{esm2015/datepicker/index.js → esm2020/datepicker/index.mjs} +0 -0
- package/esm2020/datepicker/month-view.component.mjs +257 -0
- package/esm2020/datepicker/multi-year-view.component.mjs +218 -0
- package/{esm2015/datepicker/ptsecurity-mosaic-datepicker.js → esm2020/datepicker/ptsecurity-mosaic-datepicker.mjs} +0 -0
- package/{esm2015/datepicker/public-api.js → esm2020/datepicker/public-api.mjs} +0 -0
- package/esm2020/datepicker/year-view.component.mjs +253 -0
- package/{esm2015/design-tokens/index.js → esm2020/design-tokens/index.mjs} +0 -0
- package/esm2020/design-tokens/legacy-2017/tokens.mjs +953 -0
- package/esm2020/design-tokens/pt-2022/tokens.mjs +1013 -0
- package/{esm2015/design-tokens/ptsecurity-mosaic-design-tokens.js → esm2020/design-tokens/ptsecurity-mosaic-design-tokens.mjs} +0 -0
- package/esm2020/design-tokens/public-api.mjs +4 -0
- package/esm2020/divider/divider.component.mjs +39 -0
- package/esm2020/divider/divider.module.mjs +18 -0
- package/{esm2015/divider/index.js → esm2020/divider/index.mjs} +0 -0
- package/{esm2015/divider/ptsecurity-mosaic-divider.js → esm2020/divider/ptsecurity-mosaic-divider.mjs} +0 -0
- package/{esm2015/divider/public-api.js → esm2020/divider/public-api.mjs} +0 -0
- package/{esm2015/dropdown/dropdown-animations.js → esm2020/dropdown/dropdown-animations.mjs} +0 -0
- package/esm2020/dropdown/dropdown-content.directive.mjs +64 -0
- package/{esm2015/dropdown/dropdown-errors.js → esm2020/dropdown/dropdown-errors.mjs} +0 -0
- package/esm2020/dropdown/dropdown-item.component.mjs +139 -0
- package/esm2020/dropdown/dropdown-trigger.directive.mjs +485 -0
- package/esm2020/dropdown/dropdown.component.mjs +292 -0
- package/esm2020/dropdown/dropdown.module.mjs +50 -0
- package/{esm2015/dropdown/dropdown.types.js → esm2020/dropdown/dropdown.types.mjs} +0 -0
- package/{esm2015/dropdown/index.js → esm2020/dropdown/index.mjs} +0 -0
- package/{esm2015/dropdown/ptsecurity-mosaic-dropdown.js → esm2020/dropdown/ptsecurity-mosaic-dropdown.mjs} +0 -0
- package/{esm2015/dropdown/public-api.js → esm2020/dropdown/public-api.mjs} +0 -0
- package/esm2020/form-field/cleaner.mjs +23 -0
- package/{esm2015/form-field/form-field-control.js → esm2020/form-field/form-field-control.mjs} +0 -0
- package/{esm2015/form-field/form-field-errors.js → esm2020/form-field/form-field-errors.mjs} +0 -0
- package/esm2020/form-field/form-field.mjs +205 -0
- package/esm2020/form-field/form-field.module.mjs +52 -0
- package/esm2020/form-field/hint.mjs +23 -0
- package/{esm2015/form-field/index.js → esm2020/form-field/index.mjs} +0 -0
- package/esm2020/form-field/prefix.mjs +13 -0
- package/{esm2015/form-field/ptsecurity-mosaic-form-field.js → esm2020/form-field/ptsecurity-mosaic-form-field.mjs} +0 -0
- package/{esm2015/form-field/public-api.js → esm2020/form-field/public-api.mjs} +0 -0
- package/esm2020/form-field/stepper.mjs +55 -0
- package/esm2020/form-field/suffix.mjs +13 -0
- package/esm2020/icon/icon.component.mjs +44 -0
- package/esm2020/icon/icon.module.mjs +38 -0
- package/{esm2015/icon/index.js → esm2020/icon/index.mjs} +0 -0
- package/{esm2015/icon/ptsecurity-mosaic-icon.js → esm2020/icon/ptsecurity-mosaic-icon.mjs} +0 -0
- package/{esm2015/icon/public-api.js → esm2020/icon/public-api.mjs} +0 -0
- package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/{esm2015/input/index.js → esm2020/input/index.mjs} +0 -0
- package/{esm2015/input/input-errors.js → esm2020/input/input-errors.mjs} +0 -0
- package/esm2020/input/input-number-validators.mjs +92 -0
- package/esm2020/input/input-number.mjs +163 -0
- package/{esm2015/input/input-value-accessor.js → esm2020/input/input-value-accessor.mjs} +0 -0
- package/esm2020/input/input.mjs +333 -0
- package/esm2020/input/input.module.mjs +23 -0
- package/{esm2015/input/ptsecurity-mosaic-input.js → esm2020/input/ptsecurity-mosaic-input.mjs} +0 -0
- package/{esm2015/input/public-api.js → esm2020/input/public-api.mjs} +0 -0
- package/{esm2015/link/index.js → esm2020/link/index.mjs} +0 -0
- package/esm2020/link/link.component.mjs +107 -0
- package/esm2020/link/link.module.mjs +26 -0
- package/{esm2015/link/ptsecurity-mosaic-link.js → esm2020/link/ptsecurity-mosaic-link.mjs} +0 -0
- package/{esm2015/link/public-api.js → esm2020/link/public-api.mjs} +0 -0
- package/{esm2015/list/index.js → esm2020/list/index.mjs} +0 -0
- package/esm2020/list/list-selection.component.mjs +687 -0
- package/esm2020/list/list.component.mjs +44 -0
- package/esm2020/list/list.module.mjs +55 -0
- package/{esm2015/list/ptsecurity-mosaic-list.js → esm2020/list/ptsecurity-mosaic-list.mjs} +0 -0
- package/{esm2015/list/public-api.js → esm2020/list/public-api.mjs} +0 -0
- package/esm2020/modal/css-unit.pipe.mjs +17 -0
- package/{esm2015/modal/index.js → esm2020/modal/index.mjs} +0 -0
- package/esm2020/modal/modal-control.service.mjs +85 -0
- package/{esm2015/modal/modal-ref.class.js → esm2020/modal/modal-ref.class.mjs} +0 -0
- package/{esm2015/modal/modal-util.js → esm2020/modal/modal-util.mjs} +0 -0
- package/esm2020/modal/modal.component.mjs +501 -0
- package/esm2020/modal/modal.directive.mjs +52 -0
- package/esm2020/modal/modal.module.mjs +72 -0
- package/esm2020/modal/modal.service.mjs +124 -0
- package/{esm2015/modal/modal.type.js → esm2020/modal/modal.type.mjs} +0 -0
- package/{esm2015/modal/ptsecurity-mosaic-modal.js → esm2020/modal/ptsecurity-mosaic-modal.mjs} +0 -0
- package/{esm2015/modal/public-api.js → esm2020/modal/public-api.mjs} +0 -0
- package/{esm2015/navbar/index.js → esm2020/navbar/index.mjs} +0 -0
- package/esm2020/navbar/navbar-item.component.mjs +583 -0
- package/esm2020/navbar/navbar.component.mjs +237 -0
- package/esm2020/navbar/navbar.module.mjs +92 -0
- package/{esm2015/navbar/ptsecurity-mosaic-navbar.js → esm2020/navbar/ptsecurity-mosaic-navbar.mjs} +0 -0
- package/{esm2015/navbar/public-api.js → esm2020/navbar/public-api.mjs} +0 -0
- package/esm2020/navbar/vertical-navbar.animation.mjs +10 -0
- package/esm2020/navbar/vertical-navbar.component.mjs +114 -0
- package/{esm2015/popover/index.js → esm2020/popover/index.mjs} +0 -0
- package/{esm2015/popover/popover-animations.js → esm2020/popover/popover-animations.mjs} +0 -0
- package/esm2020/popover/popover-confirm.component.mjs +108 -0
- package/esm2020/popover/popover.component.mjs +253 -0
- package/esm2020/popover/popover.module.mjs +24 -0
- package/{esm2015/popover/ptsecurity-mosaic-popover.js → esm2020/popover/ptsecurity-mosaic-popover.mjs} +0 -0
- package/{esm2015/popover/public-api.js → esm2020/popover/public-api.mjs} +0 -0
- package/{esm2015/progress-bar/index.js → esm2020/progress-bar/index.mjs} +0 -0
- package/esm2020/progress-bar/progress-bar.component.mjs +42 -0
- package/esm2020/progress-bar/progress-bar.module.mjs +30 -0
- package/{esm2015/progress-bar/ptsecurity-mosaic-progress-bar.js → esm2020/progress-bar/ptsecurity-mosaic-progress-bar.mjs} +0 -0
- package/{esm2015/progress-bar/public-api.js → esm2020/progress-bar/public-api.mjs} +0 -0
- package/{esm2015/progress-spinner/index.js → esm2020/progress-spinner/index.mjs} +0 -0
- package/esm2020/progress-spinner/progress-spinner.component.mjs +46 -0
- package/esm2020/progress-spinner/progress-spinner.module.mjs +30 -0
- package/{esm2015/progress-spinner/ptsecurity-mosaic-progress-spinner.js → esm2020/progress-spinner/ptsecurity-mosaic-progress-spinner.mjs} +0 -0
- package/{esm2015/progress-spinner/public-api.js → esm2020/progress-spinner/public-api.mjs} +0 -0
- package/{esm2015/ptsecurity-mosaic.js → esm2020/ptsecurity-mosaic.mjs} +0 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/{esm2015/radio/index.js → esm2020/radio/index.mjs} +0 -0
- package/{esm2015/radio/ptsecurity-mosaic-radio.js → esm2020/radio/ptsecurity-mosaic-radio.mjs} +0 -0
- package/{esm2015/radio/public-api.js → esm2020/radio/public-api.mjs} +0 -0
- package/esm2020/radio/radio.component.mjs +458 -0
- package/esm2020/radio/radio.module.mjs +20 -0
- package/{esm2015/select/index.js → esm2020/select/index.mjs} +0 -0
- package/{esm2015/select/ptsecurity-mosaic-select.js → esm2020/select/ptsecurity-mosaic-select.mjs} +0 -0
- package/{esm2015/select/public-api.js → esm2020/select/public-api.mjs} +0 -0
- package/esm2020/select/select.component.mjs +1110 -0
- package/esm2020/select/select.module.mjs +64 -0
- package/{esm2015/sidebar/index.js → esm2020/sidebar/index.mjs} +0 -0
- package/{esm2015/sidebar/ptsecurity-mosaic-sidebar.js → esm2020/sidebar/ptsecurity-mosaic-sidebar.mjs} +0 -0
- package/{esm2015/sidebar/public-api.js → esm2020/sidebar/public-api.mjs} +0 -0
- package/{esm2015/sidebar/sidebar-animations.js → esm2020/sidebar/sidebar-animations.mjs} +0 -0
- package/esm2020/sidebar/sidebar.component.mjs +146 -0
- package/esm2020/sidebar/sidebar.module.mjs +30 -0
- package/{esm2015/sidepanel/index.js → esm2020/sidepanel/index.mjs} +0 -0
- package/{esm2015/sidepanel/ptsecurity-mosaic-sidepanel.js → esm2020/sidepanel/ptsecurity-mosaic-sidepanel.mjs} +0 -0
- package/{esm2015/sidepanel/public-api.js → esm2020/sidepanel/public-api.mjs} +0 -0
- package/{esm2015/sidepanel/sidepanel-animations.js → esm2020/sidepanel/sidepanel-animations.mjs} +0 -0
- package/{esm2015/sidepanel/sidepanel-config.js → esm2020/sidepanel/sidepanel-config.mjs} +0 -0
- package/esm2020/sidepanel/sidepanel-container.component.mjs +106 -0
- package/esm2020/sidepanel/sidepanel-directives.mjs +159 -0
- package/{esm2015/sidepanel/sidepanel-ref.js → esm2020/sidepanel/sidepanel-ref.mjs} +0 -0
- package/esm2020/sidepanel/sidepanel.module.mjs +74 -0
- package/esm2020/sidepanel/sidepanel.service.mjs +167 -0
- package/{esm2015/splitter/index.js → esm2020/splitter/index.mjs} +0 -0
- package/{esm2015/splitter/ptsecurity-mosaic-splitter.js → esm2020/splitter/ptsecurity-mosaic-splitter.mjs} +0 -0
- package/{esm2015/splitter/public-api.js → esm2020/splitter/public-api.mjs} +0 -0
- package/esm2020/splitter/splitter.component.mjs +482 -0
- package/esm2020/splitter/splitter.module.mjs +40 -0
- package/{esm2015/table/index.js → esm2020/table/index.mjs} +0 -0
- package/{esm2015/table/ptsecurity-mosaic-table.js → esm2020/table/ptsecurity-mosaic-table.mjs} +0 -0
- package/{esm2015/table/public-api.js → esm2020/table/public-api.mjs} +0 -0
- package/esm2020/table/table.component.mjs +16 -0
- package/esm2020/table/table.module.mjs +30 -0
- package/{esm2015/tabs/index.js → esm2020/tabs/index.mjs} +0 -0
- package/esm2020/tabs/paginated-tab-header.mjs +479 -0
- package/{esm2015/tabs/ptsecurity-mosaic-tabs.js → esm2020/tabs/ptsecurity-mosaic-tabs.mjs} +0 -0
- package/{esm2015/tabs/public-api.js → esm2020/tabs/public-api.mjs} +0 -0
- package/esm2020/tabs/tab-body.component.mjs +178 -0
- package/esm2020/tabs/tab-content.directive.mjs +15 -0
- package/esm2020/tabs/tab-group.component.mjs +350 -0
- package/esm2020/tabs/tab-header.component.mjs +67 -0
- package/esm2020/tabs/tab-label-wrapper.directive.mjs +78 -0
- package/esm2020/tabs/tab-label.directive.mjs +17 -0
- package/{esm2015/tabs/tab-nav-bar/index.js → esm2020/tabs/tab-nav-bar/index.mjs} +0 -0
- package/esm2020/tabs/tab-nav-bar/tab-nav-bar.mjs +110 -0
- package/esm2020/tabs/tab.component.mjs +133 -0
- package/{esm2015/tabs/tabs-animations.js → esm2020/tabs/tabs-animations.mjs} +0 -0
- package/esm2020/tabs/tabs.module.mjs +104 -0
- package/{esm2015/tags/index.js → esm2020/tags/index.mjs} +0 -0
- package/{esm2015/tags/ptsecurity-mosaic-tags.js → esm2020/tags/ptsecurity-mosaic-tags.mjs} +0 -0
- package/{esm2015/tags/public-api.js → esm2020/tags/public-api.mjs} +0 -0
- package/{esm2015/tags/tag-default-options.js → esm2020/tags/tag-default-options.mjs} +0 -0
- package/esm2020/tags/tag-input.mjs +229 -0
- package/esm2020/tags/tag-list.component.mjs +722 -0
- package/{esm2015/tags/tag-text-control.js → esm2020/tags/tag-text-control.mjs} +0 -0
- package/esm2020/tags/tag.component.mjs +377 -0
- package/esm2020/tags/tag.module.mjs +56 -0
- package/{esm2015/textarea/index.js → esm2020/textarea/index.mjs} +0 -0
- package/{esm2015/textarea/ptsecurity-mosaic-textarea.js → esm2020/textarea/ptsecurity-mosaic-textarea.mjs} +0 -0
- package/{esm2015/textarea/public-api.js → esm2020/textarea/public-api.mjs} +0 -0
- package/esm2020/textarea/textarea.component.mjs +268 -0
- package/esm2020/textarea/textarea.module.mjs +21 -0
- package/{esm2015/timepicker/index.js → esm2020/timepicker/index.mjs} +0 -0
- package/{esm2015/timepicker/ptsecurity-mosaic-timepicker.js → esm2020/timepicker/ptsecurity-mosaic-timepicker.mjs} +0 -0
- package/{esm2015/timepicker/public-api.js → esm2020/timepicker/public-api.mjs} +0 -0
- package/{esm2015/timepicker/timepicker.constants.js → esm2020/timepicker/timepicker.constants.mjs} +0 -0
- package/esm2020/timepicker/timepicker.directive.mjs +653 -0
- package/esm2020/timepicker/timepicker.module.mjs +34 -0
- package/{esm2015/toggle/index.js → esm2020/toggle/index.mjs} +0 -0
- package/{esm2015/toggle/ptsecurity-mosaic-toggle.js → esm2020/toggle/ptsecurity-mosaic-toggle.mjs} +0 -0
- package/{esm2015/toggle/public-api.js → esm2020/toggle/public-api.mjs} +0 -0
- package/esm2020/toggle/toggle.component.mjs +158 -0
- package/esm2020/toggle/toggle.module.mjs +20 -0
- package/{esm2015/tooltip/index.js → esm2020/tooltip/index.mjs} +0 -0
- package/{esm2015/tooltip/ptsecurity-mosaic-tooltip.js → esm2020/tooltip/ptsecurity-mosaic-tooltip.mjs} +0 -0
- package/{esm2015/tooltip/public-api.js → esm2020/tooltip/public-api.mjs} +0 -0
- package/{esm2015/tooltip/tooltip.animations.js → esm2020/tooltip/tooltip.animations.mjs} +0 -0
- package/esm2020/tooltip/tooltip.component.mjs +294 -0
- package/esm2020/tooltip/tooltip.module.mjs +43 -0
- package/{esm2015/tree/control/base-tree-control.js → esm2020/tree/control/base-tree-control.mjs} +0 -0
- package/{esm2015/tree/control/flat-tree-control.js → esm2020/tree/control/flat-tree-control.mjs} +0 -0
- package/{esm2015/tree/control/nested-tree-control.js → esm2020/tree/control/nested-tree-control.mjs} +0 -0
- package/{esm2015/tree/control/tree-control.js → esm2020/tree/control/tree-control.mjs} +0 -0
- package/esm2020/tree/data-source/flat-data-source.mjs +162 -0
- package/{esm2015/tree/data-source/nested-data-source.js → esm2020/tree/data-source/nested-data-source.mjs} +0 -0
- package/{esm2015/tree/index.js → esm2020/tree/index.mjs} +0 -0
- package/esm2020/tree/node.mjs +31 -0
- package/esm2020/tree/outlet.mjs +15 -0
- package/esm2020/tree/padding.directive.mjs +110 -0
- package/{esm2015/tree/ptsecurity-mosaic-tree.js → esm2020/tree/ptsecurity-mosaic-tree.mjs} +0 -0
- package/{esm2015/tree/public-api.js → esm2020/tree/public-api.mjs} +0 -0
- package/esm2020/tree/toggle.mjs +80 -0
- package/esm2020/tree/tree-base.mjs +243 -0
- package/{esm2015/tree/tree-errors.js → esm2020/tree/tree-errors.mjs} +0 -0
- package/esm2020/tree/tree-option.component.mjs +234 -0
- package/esm2020/tree/tree-selection.component.mjs +533 -0
- package/esm2020/tree/tree.mjs +15 -0
- package/esm2020/tree/tree.module.mjs +53 -0
- package/{esm2015/tree-select/index.js → esm2020/tree-select/index.mjs} +0 -0
- package/{esm2015/tree-select/ptsecurity-mosaic-tree-select.js → esm2020/tree-select/ptsecurity-mosaic-tree-select.mjs} +0 -0
- package/{esm2015/tree-select/public-api.js → esm2020/tree-select/public-api.mjs} +0 -0
- package/esm2020/tree-select/tree-select.component.mjs +925 -0
- package/esm2020/tree-select/tree-select.module.mjs +47 -0
- package/fesm2015/ptsecurity-mosaic-autocomplete.mjs +756 -0
- package/fesm2015/ptsecurity-mosaic-autocomplete.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-button-toggle.mjs +385 -0
- package/fesm2015/ptsecurity-mosaic-button-toggle.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-button.mjs +170 -0
- package/fesm2015/ptsecurity-mosaic-button.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-card.mjs +113 -0
- package/fesm2015/ptsecurity-mosaic-card.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-checkbox.mjs +366 -0
- package/fesm2015/ptsecurity-mosaic-checkbox.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-core.mjs +2704 -0
- package/fesm2015/ptsecurity-mosaic-core.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-datepicker.mjs +2700 -0
- package/fesm2015/ptsecurity-mosaic-datepicker.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-design-tokens.mjs +2925 -0
- package/fesm2015/ptsecurity-mosaic-design-tokens.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-divider.mjs +61 -0
- package/fesm2015/ptsecurity-mosaic-divider.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-dropdown.mjs +1106 -0
- package/fesm2015/ptsecurity-mosaic-dropdown.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-form-field.mjs +378 -0
- package/fesm2015/ptsecurity-mosaic-form-field.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-icon.mjs +88 -0
- package/fesm2015/ptsecurity-mosaic-icon.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-input.mjs +609 -0
- package/fesm2015/ptsecurity-mosaic-input.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-link.mjs +137 -0
- package/fesm2015/ptsecurity-mosaic-link.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-list.mjs +791 -0
- package/fesm2015/ptsecurity-mosaic-list.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-modal.mjs +864 -0
- package/fesm2015/ptsecurity-mosaic-modal.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-navbar.mjs +1031 -0
- package/fesm2015/ptsecurity-mosaic-navbar.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-popover.mjs +393 -0
- package/fesm2015/ptsecurity-mosaic-popover.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-progress-bar.mjs +76 -0
- package/fesm2015/ptsecurity-mosaic-progress-bar.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs +80 -0
- package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-radio.mjs +481 -0
- package/fesm2015/ptsecurity-mosaic-radio.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-select.mjs +1175 -0
- package/fesm2015/ptsecurity-mosaic-select.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-sidebar.mjs +202 -0
- package/fesm2015/ptsecurity-mosaic-sidebar.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-sidepanel.mjs +592 -0
- package/fesm2015/ptsecurity-mosaic-sidepanel.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-splitter.mjs +526 -0
- package/fesm2015/ptsecurity-mosaic-splitter.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-table.mjs +50 -0
- package/fesm2015/ptsecurity-mosaic-table.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-tabs.mjs +1511 -0
- package/fesm2015/ptsecurity-mosaic-tabs.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-tags.mjs +1377 -0
- package/fesm2015/ptsecurity-mosaic-tags.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-textarea.mjs +293 -0
- package/fesm2015/ptsecurity-mosaic-textarea.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-timepicker.mjs +715 -0
- package/fesm2015/ptsecurity-mosaic-timepicker.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-toggle.mjs +180 -0
- package/fesm2015/ptsecurity-mosaic-toggle.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-tooltip.mjs +365 -0
- package/fesm2015/ptsecurity-mosaic-tooltip.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-tree-select.mjs +972 -0
- package/fesm2015/ptsecurity-mosaic-tree-select.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-tree.mjs +1718 -0
- package/fesm2015/ptsecurity-mosaic-tree.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic.mjs +4 -0
- package/fesm2015/ptsecurity-mosaic.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-autocomplete.mjs +752 -0
- package/fesm2020/ptsecurity-mosaic-autocomplete.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-button-toggle.mjs +383 -0
- package/fesm2020/ptsecurity-mosaic-button-toggle.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-button.mjs +170 -0
- package/fesm2020/ptsecurity-mosaic-button.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-card.mjs +113 -0
- package/fesm2020/ptsecurity-mosaic-card.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-checkbox.mjs +364 -0
- package/fesm2020/ptsecurity-mosaic-checkbox.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-core.mjs +2733 -0
- package/fesm2020/ptsecurity-mosaic-core.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-datepicker.mjs +2687 -0
- package/fesm2020/ptsecurity-mosaic-datepicker.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-design-tokens.mjs +2925 -0
- package/fesm2020/ptsecurity-mosaic-design-tokens.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-divider.mjs +61 -0
- package/fesm2020/ptsecurity-mosaic-divider.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-dropdown.mjs +1093 -0
- package/fesm2020/ptsecurity-mosaic-dropdown.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-form-field.mjs +377 -0
- package/fesm2020/ptsecurity-mosaic-form-field.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-icon.mjs +86 -0
- package/fesm2020/ptsecurity-mosaic-icon.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-input.mjs +605 -0
- package/fesm2020/ptsecurity-mosaic-input.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-link.mjs +136 -0
- package/fesm2020/ptsecurity-mosaic-link.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-list.mjs +784 -0
- package/fesm2020/ptsecurity-mosaic-list.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-modal.mjs +860 -0
- package/fesm2020/ptsecurity-mosaic-modal.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-navbar.mjs +1015 -0
- package/fesm2020/ptsecurity-mosaic-navbar.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-popover.mjs +389 -0
- package/fesm2020/ptsecurity-mosaic-popover.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-progress-bar.mjs +76 -0
- package/fesm2020/ptsecurity-mosaic-progress-bar.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-progress-spinner.mjs +80 -0
- package/fesm2020/ptsecurity-mosaic-progress-spinner.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-radio.mjs +479 -0
- package/fesm2020/ptsecurity-mosaic-radio.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-select.mjs +1173 -0
- package/fesm2020/ptsecurity-mosaic-select.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-sidebar.mjs +202 -0
- package/fesm2020/ptsecurity-mosaic-sidebar.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-sidepanel.mjs +589 -0
- package/fesm2020/ptsecurity-mosaic-sidepanel.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-splitter.mjs +526 -0
- package/fesm2020/ptsecurity-mosaic-splitter.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-table.mjs +50 -0
- package/fesm2020/ptsecurity-mosaic-table.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-tabs.mjs +1496 -0
- package/fesm2020/ptsecurity-mosaic-tabs.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-tags.mjs +1370 -0
- package/fesm2020/ptsecurity-mosaic-tags.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-textarea.mjs +291 -0
- package/fesm2020/ptsecurity-mosaic-textarea.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-timepicker.mjs +713 -0
- package/fesm2020/ptsecurity-mosaic-timepicker.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-toggle.mjs +180 -0
- package/fesm2020/ptsecurity-mosaic-toggle.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-tooltip.mjs +357 -0
- package/fesm2020/ptsecurity-mosaic-tooltip.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-tree-select.mjs +970 -0
- package/fesm2020/ptsecurity-mosaic-tree-select.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-tree.mjs +1705 -0
- package/fesm2020/ptsecurity-mosaic-tree.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic.mjs +4 -0
- package/fesm2020/ptsecurity-mosaic.mjs.map +1 -0
- package/form-field/README.md +0 -0
- package/form-field/package.json +5 -5
- package/icon/README.md +0 -0
- package/icon/package.json +5 -5
- package/input/package.json +5 -5
- package/link/README.md +0 -0
- package/link/package.json +5 -5
- package/list/README.md +0 -0
- package/list/package.json +5 -5
- package/modal/README.md +34 -0
- package/modal/modal-control.service.d.ts +1 -0
- package/modal/package.json +5 -5
- package/navbar/README.md +41 -0
- package/navbar/navbar-item.component.d.ts +123 -34
- package/navbar/navbar.component.d.ts +37 -9
- package/navbar/navbar.module.d.ts +2 -1
- package/navbar/package.json +5 -5
- package/navbar/vertical-navbar.component.d.ts +15 -26
- package/package.json +299 -14
- package/popover/README.md +32 -0
- package/popover/package.json +5 -5
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/default-theme.css +1 -1
- package/prebuilt-visual/default-visual.css +1 -1
- package/progress-bar/README.md +0 -0
- package/progress-bar/package.json +5 -5
- package/progress-spinner/README.md +0 -0
- package/progress-spinner/package.json +5 -5
- package/radio/package.json +5 -5
- package/schematics/README.md +35 -0
- package/schematics/ng-update/data/index.d.ts +1 -0
- package/schematics/ng-update/data/index.js +10 -9
- package/schematics/ng-update/data/index.js.map +1 -1
- package/schematics/ng-update/data/symbol-removal.d.ts +2 -0
- package/schematics/ng-update/data/symbol-removal.js +5 -0
- package/schematics/ng-update/data/symbol-removal.js.map +1 -0
- package/schematics/ng-update/index.js +3 -3
- package/schematics/ng-update/index.js.map +1 -1
- package/schematics/ng-update/update-9.0.0/secondary-entry-points-migration.js +1 -2
- package/schematics/ng-update/update-9.0.0/secondary-entry-points-migration.js.map +1 -1
- package/schematics/ng-update/upgrade-data.js +2 -1
- package/schematics/ng-update/upgrade-data.js.map +1 -1
- package/schematics/tsconfig.lib.json +2 -2
- package/select/README.md +0 -0
- package/select/package.json +5 -5
- package/sidebar/package.json +5 -5
- package/sidepanel/package.json +5 -5
- package/splitter/package.json +5 -5
- package/table/README.md +0 -0
- package/table/package.json +5 -5
- package/tabs/README.md +0 -0
- package/tabs/package.json +5 -5
- package/tags/README.md +0 -0
- package/tags/package.json +5 -5
- package/textarea/README.md +0 -0
- package/textarea/package.json +5 -5
- package/timepicker/README.md +0 -0
- package/timepicker/package.json +5 -5
- package/toggle/package.json +5 -5
- package/tooltip/package.json +5 -5
- package/tree/data-source/flat-data-source.d.ts +2 -2
- package/tree/package.json +5 -5
- package/tree/tree-option.component.d.ts +5 -3
- package/tree/tree-selection.component.d.ts +1 -0
- package/tree-select/README.md +0 -0
- package/tree-select/package.json +5 -5
- package/tree-select/tree-select.component.d.ts +9 -1
- package/tree-select/tree-select.module.d.ts +2 -1
- package/bundles/ptsecurity-mosaic-autocomplete.umd.js +0 -1160
- package/bundles/ptsecurity-mosaic-autocomplete.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-button-toggle.umd.js +0 -755
- package/bundles/ptsecurity-mosaic-button-toggle.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-button.umd.js +0 -533
- package/bundles/ptsecurity-mosaic-button.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-card.umd.js +0 -479
- package/bundles/ptsecurity-mosaic-card.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-checkbox.umd.js +0 -762
- package/bundles/ptsecurity-mosaic-checkbox.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-core.umd.js +0 -2841
- package/bundles/ptsecurity-mosaic-core.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-datepicker.umd.js +0 -3362
- package/bundles/ptsecurity-mosaic-datepicker.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-design-tokens.umd.js +0 -1871
- package/bundles/ptsecurity-mosaic-design-tokens.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-divider.umd.js +0 -106
- package/bundles/ptsecurity-mosaic-divider.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-dropdown.umd.js +0 -1532
- package/bundles/ptsecurity-mosaic-dropdown.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-form-field.umd.js +0 -788
- package/bundles/ptsecurity-mosaic-form-field.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-icon.umd.js +0 -450
- package/bundles/ptsecurity-mosaic-icon.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-input.umd.js +0 -1008
- package/bundles/ptsecurity-mosaic-input.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-link.umd.js +0 -515
- package/bundles/ptsecurity-mosaic-link.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-list.umd.js +0 -1251
- package/bundles/ptsecurity-mosaic-list.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-modal.umd.js +0 -1312
- package/bundles/ptsecurity-mosaic-modal.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-navbar.umd.js +0 -930
- package/bundles/ptsecurity-mosaic-navbar.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-popover.umd.js +0 -836
- package/bundles/ptsecurity-mosaic-popover.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-progress-bar.umd.js +0 -440
- package/bundles/ptsecurity-mosaic-progress-bar.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-progress-spinner.umd.js +0 -448
- package/bundles/ptsecurity-mosaic-progress-spinner.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-radio.umd.js +0 -901
- package/bundles/ptsecurity-mosaic-radio.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-select.umd.js +0 -1606
- package/bundles/ptsecurity-mosaic-select.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-sidebar.umd.js +0 -254
- package/bundles/ptsecurity-mosaic-sidebar.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-sidepanel.umd.js +0 -954
- package/bundles/ptsecurity-mosaic-sidepanel.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-splitter.umd.js +0 -635
- package/bundles/ptsecurity-mosaic-splitter.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-table.umd.js +0 -81
- package/bundles/ptsecurity-mosaic-table.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-tabs.umd.js +0 -2013
- package/bundles/ptsecurity-mosaic-tabs.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-tags.umd.js +0 -1917
- package/bundles/ptsecurity-mosaic-tags.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-textarea.umd.js +0 -664
- package/bundles/ptsecurity-mosaic-textarea.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-timepicker.umd.js +0 -821
- package/bundles/ptsecurity-mosaic-timepicker.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-toggle.umd.js +0 -557
- package/bundles/ptsecurity-mosaic-toggle.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-tooltip.umd.js +0 -777
- package/bundles/ptsecurity-mosaic-tooltip.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-tree-select.umd.js +0 -1369
- package/bundles/ptsecurity-mosaic-tree-select.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic-tree.umd.js +0 -2301
- package/bundles/ptsecurity-mosaic-tree.umd.js.map +0 -1
- package/bundles/ptsecurity-mosaic.umd.js +0 -11
- package/bundles/ptsecurity-mosaic.umd.js.map +0 -1
- package/design-tokens/tokens/components/checkbox.json5 +0 -39
- package/design-tokens/tokens/components/modal.json5 +0 -67
- package/design-tokens/tokens/components/navbar.json5 +0 -64
- package/design-tokens/tokens/components/radio.json5 +0 -45
- package/design-tokens/tokens/components/tags.json5 +0 -126
- package/design-tokens/tokens/components/toggle.json5 +0 -55
- package/design-tokens/tokens.d.ts +0 -7636
- package/esm2015/autocomplete/autocomplete-origin.directive.js +0 -21
- package/esm2015/autocomplete/autocomplete-trigger.directive.js +0 -555
- package/esm2015/autocomplete/autocomplete.component.js +0 -163
- package/esm2015/autocomplete/autocomplete.module.js +0 -34
- package/esm2015/button/button.component.js +0 -129
- package/esm2015/button/button.module.js +0 -42
- package/esm2015/button-toggle/button-toggle.component.js +0 -370
- package/esm2015/button-toggle/button-toggle.module.js +0 -19
- package/esm2015/card/card.component.js +0 -88
- package/esm2015/card/card.module.js +0 -30
- package/esm2015/checkbox/checkbox-module.js +0 -19
- package/esm2015/checkbox/checkbox-required-validator.js +0 -27
- package/esm2015/checkbox/checkbox.js +0 -325
- package/esm2015/core/common-behaviors/common-module.js +0 -83
- package/esm2015/core/error/error-options.js +0 -26
- package/esm2015/core/formatters/date/formatter.js +0 -288
- package/esm2015/core/formatters/date/templates/en-US.js +0 -280
- package/esm2015/core/formatters/date/templates/ru-RU.js +0 -280
- package/esm2015/core/formatters/index.js +0 -20
- package/esm2015/core/formatters/number/formatter.js +0 -99
- package/esm2015/core/forms/forms-module.js +0 -24
- package/esm2015/core/forms/forms.directive.js +0 -66
- package/esm2015/core/highlight/highlight.pipe.js +0 -17
- package/esm2015/core/highlight/index.js +0 -19
- package/esm2015/core/line/line.js +0 -70
- package/esm2015/core/option/action.js +0 -131
- package/esm2015/core/option/optgroup.js +0 -40
- package/esm2015/core/option/option-module.js +0 -21
- package/esm2015/core/option/option.js +0 -262
- package/esm2015/core/pop-up/pop-up-trigger.js +0 -239
- package/esm2015/core/pop-up/pop-up.js +0 -87
- package/esm2015/core/public-api.js +0 -17
- package/esm2015/core/selection/pseudo-checkbox/pseudo-checkbox.js +0 -45
- package/esm2015/core/selection/pseudo-checkbox/pseudo-checkbox.module.js +0 -18
- package/esm2015/core/services/measure-scrollbar.service.js +0 -48
- package/esm2015/datepicker/calendar-body.component.js +0 -114
- package/esm2015/datepicker/calendar.component.js +0 -377
- package/esm2015/datepicker/datepicker-input.directive.js +0 -892
- package/esm2015/datepicker/datepicker-intl.js +0 -40
- package/esm2015/datepicker/datepicker-module.js +0 -107
- package/esm2015/datepicker/datepicker-toggle.component.js +0 -94
- package/esm2015/datepicker/datepicker.component.js +0 -418
- package/esm2015/datepicker/month-view.component.js +0 -263
- package/esm2015/datepicker/multi-year-view.component.js +0 -224
- package/esm2015/datepicker/year-view.component.js +0 -259
- package/esm2015/design-tokens/public-api.js +0 -2
- package/esm2015/design-tokens/tokens.js +0 -930
- package/esm2015/divider/divider.component.js +0 -46
- package/esm2015/divider/divider.module.js +0 -18
- package/esm2015/dropdown/dropdown-content.directive.js +0 -66
- package/esm2015/dropdown/dropdown-item.component.js +0 -149
- package/esm2015/dropdown/dropdown-trigger.directive.js +0 -486
- package/esm2015/dropdown/dropdown.component.js +0 -302
- package/esm2015/dropdown/dropdown.module.js +0 -50
- package/esm2015/form-field/cleaner.js +0 -23
- package/esm2015/form-field/form-field.js +0 -224
- package/esm2015/form-field/form-field.module.js +0 -52
- package/esm2015/form-field/hint.js +0 -23
- package/esm2015/form-field/prefix.js +0 -13
- package/esm2015/form-field/stepper.js +0 -55
- package/esm2015/form-field/suffix.js +0 -13
- package/esm2015/icon/icon.component.js +0 -51
- package/esm2015/icon/icon.module.js +0 -38
- package/esm2015/input/input-number-validators.js +0 -92
- package/esm2015/input/input-number.js +0 -163
- package/esm2015/input/input.js +0 -333
- package/esm2015/input/input.module.js +0 -23
- package/esm2015/link/link.component.js +0 -108
- package/esm2015/link/link.module.js +0 -26
- package/esm2015/list/list-selection.component.js +0 -711
- package/esm2015/list/list.component.js +0 -58
- package/esm2015/list/list.module.js +0 -55
- package/esm2015/modal/css-unit.pipe.js +0 -17
- package/esm2015/modal/modal-control.service.js +0 -63
- package/esm2015/modal/modal.component.js +0 -508
- package/esm2015/modal/modal.directive.js +0 -52
- package/esm2015/modal/modal.module.js +0 -72
- package/esm2015/modal/modal.service.js +0 -124
- package/esm2015/navbar/navbar-item.component.js +0 -209
- package/esm2015/navbar/navbar.component.js +0 -118
- package/esm2015/navbar/navbar.module.js +0 -76
- package/esm2015/navbar/vertical-navbar.animation.js +0 -10
- package/esm2015/navbar/vertical-navbar.component.js +0 -140
- package/esm2015/popover/popover-confirm.component.js +0 -116
- package/esm2015/popover/popover.component.js +0 -262
- package/esm2015/popover/popover.module.js +0 -24
- package/esm2015/progress-bar/progress-bar.component.js +0 -50
- package/esm2015/progress-bar/progress-bar.module.js +0 -30
- package/esm2015/progress-spinner/progress-spinner.component.js +0 -54
- package/esm2015/progress-spinner/progress-spinner.module.js +0 -30
- package/esm2015/radio/radio.component.js +0 -467
- package/esm2015/radio/radio.module.js +0 -20
- package/esm2015/select/select.component.js +0 -1122
- package/esm2015/select/select.module.js +0 -64
- package/esm2015/sidebar/sidebar.component.js +0 -155
- package/esm2015/sidebar/sidebar.module.js +0 -30
- package/esm2015/sidepanel/sidepanel-container.component.js +0 -114
- package/esm2015/sidepanel/sidepanel-directives.js +0 -159
- package/esm2015/sidepanel/sidepanel.module.js +0 -74
- package/esm2015/sidepanel/sidepanel.service.js +0 -164
- package/esm2015/splitter/splitter.component.js +0 -489
- package/esm2015/splitter/splitter.module.js +0 -40
- package/esm2015/table/table.component.js +0 -16
- package/esm2015/table/table.module.js +0 -30
- package/esm2015/tabs/paginated-tab-header.js +0 -482
- package/esm2015/tabs/tab-body.component.js +0 -186
- package/esm2015/tabs/tab-content.directive.js +0 -15
- package/esm2015/tabs/tab-group.component.js +0 -359
- package/esm2015/tabs/tab-header.component.js +0 -76
- package/esm2015/tabs/tab-label-wrapper.directive.js +0 -78
- package/esm2015/tabs/tab-label.directive.js +0 -17
- package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +0 -118
- package/esm2015/tabs/tab.component.js +0 -133
- package/esm2015/tabs/tabs.module.js +0 -104
- package/esm2015/tags/tag-input.js +0 -229
- package/esm2015/tags/tag-list.component.js +0 -732
- package/esm2015/tags/tag.component.js +0 -386
- package/esm2015/tags/tag.module.js +0 -56
- package/esm2015/textarea/textarea.component.js +0 -268
- package/esm2015/textarea/textarea.module.js +0 -21
- package/esm2015/timepicker/timepicker.directive.js +0 -653
- package/esm2015/timepicker/timepicker.module.js +0 -34
- package/esm2015/toggle/toggle.component.js +0 -169
- package/esm2015/toggle/toggle.module.js +0 -20
- package/esm2015/tooltip/tooltip.component.js +0 -299
- package/esm2015/tooltip/tooltip.module.js +0 -43
- package/esm2015/tree/data-source/flat-data-source.js +0 -162
- package/esm2015/tree/node.js +0 -31
- package/esm2015/tree/outlet.js +0 -15
- package/esm2015/tree/padding.directive.js +0 -111
- package/esm2015/tree/toggle.js +0 -89
- package/esm2015/tree/tree-base.js +0 -243
- package/esm2015/tree/tree-option.component.js +0 -238
- package/esm2015/tree/tree-selection.component.js +0 -541
- package/esm2015/tree/tree.js +0 -23
- package/esm2015/tree/tree.module.js +0 -53
- package/esm2015/tree-select/tree-select.component.js +0 -901
- package/esm2015/tree-select/tree-select.module.js +0 -43
- package/fesm2015/ptsecurity-mosaic-autocomplete.js +0 -761
- package/fesm2015/ptsecurity-mosaic-autocomplete.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-button-toggle.js +0 -391
- package/fesm2015/ptsecurity-mosaic-button-toggle.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-button.js +0 -174
- package/fesm2015/ptsecurity-mosaic-button.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-card.js +0 -121
- package/fesm2015/ptsecurity-mosaic-card.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-checkbox.js +0 -374
- package/fesm2015/ptsecurity-mosaic-checkbox.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-core.js +0 -2680
- package/fesm2015/ptsecurity-mosaic-core.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-datepicker.js +0 -2738
- package/fesm2015/ptsecurity-mosaic-datepicker.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-design-tokens.js +0 -936
- package/fesm2015/ptsecurity-mosaic-design-tokens.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-divider.js +0 -68
- package/fesm2015/ptsecurity-mosaic-divider.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-dropdown.js +0 -1116
- package/fesm2015/ptsecurity-mosaic-dropdown.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-form-field.js +0 -396
- package/fesm2015/ptsecurity-mosaic-form-field.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-icon.js +0 -93
- package/fesm2015/ptsecurity-mosaic-icon.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-input.js +0 -605
- package/fesm2015/ptsecurity-mosaic-input.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-link.js +0 -137
- package/fesm2015/ptsecurity-mosaic-link.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-list.js +0 -822
- package/fesm2015/ptsecurity-mosaic-list.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-modal.js +0 -845
- package/fesm2015/ptsecurity-mosaic-modal.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-navbar.js +0 -539
- package/fesm2015/ptsecurity-mosaic-navbar.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-popover.js +0 -406
- package/fesm2015/ptsecurity-mosaic-popover.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-progress-bar.js +0 -84
- package/fesm2015/ptsecurity-mosaic-progress-bar.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-progress-spinner.js +0 -88
- package/fesm2015/ptsecurity-mosaic-progress-spinner.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-radio.js +0 -488
- package/fesm2015/ptsecurity-mosaic-radio.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-select.js +0 -1185
- package/fesm2015/ptsecurity-mosaic-select.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-sidebar.js +0 -211
- package/fesm2015/ptsecurity-mosaic-sidebar.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-sidepanel.js +0 -594
- package/fesm2015/ptsecurity-mosaic-sidepanel.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-splitter.js +0 -533
- package/fesm2015/ptsecurity-mosaic-splitter.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-table.js +0 -50
- package/fesm2015/ptsecurity-mosaic-table.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-tabs.js +0 -1533
- package/fesm2015/ptsecurity-mosaic-tabs.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-tags.js +0 -1389
- package/fesm2015/ptsecurity-mosaic-tags.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-textarea.js +0 -291
- package/fesm2015/ptsecurity-mosaic-textarea.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-timepicker.js +0 -713
- package/fesm2015/ptsecurity-mosaic-timepicker.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-toggle.js +0 -191
- package/fesm2015/ptsecurity-mosaic-toggle.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-tooltip.js +0 -362
- package/fesm2015/ptsecurity-mosaic-tooltip.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-tree-select.js +0 -943
- package/fesm2015/ptsecurity-mosaic-tree-select.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic-tree.js +0 -1735
- package/fesm2015/ptsecurity-mosaic-tree.js.map +0 -1
- package/fesm2015/ptsecurity-mosaic.js +0 -4
- package/fesm2015/ptsecurity-mosaic.js.map +0 -1
|
@@ -0,0 +1,2704 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Version, InjectionToken, isDevMode, NgModule, Optional, Inject, Directive, Injectable, Pipe, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, EventEmitter, Output, ContentChild, ContentChildren, TemplateRef } from '@angular/core';
|
|
3
|
+
import * as i2$1 from '@angular/cdk/bidi';
|
|
4
|
+
import { BidiModule } from '@angular/cdk/bidi';
|
|
5
|
+
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
7
|
+
import MessageFormat from '@messageformat/core';
|
|
8
|
+
import * as i1 from '@ptsecurity/cdk/datetime';
|
|
9
|
+
import { MC_DATE_LOCALE } from '@ptsecurity/cdk/datetime';
|
|
10
|
+
import { RequiredValidator } from '@angular/forms';
|
|
11
|
+
import * as i2 from '@angular/common';
|
|
12
|
+
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
13
|
+
import * as i1$2 from '@angular/cdk/overlay';
|
|
14
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
15
|
+
import { trigger, state, style, transition, animate, group } from '@angular/animations';
|
|
16
|
+
import { ENTER, SPACE, TAB, ESCAPE } from '@ptsecurity/cdk/keycodes';
|
|
17
|
+
import { takeUntil, distinctUntilChanged, delay } from 'rxjs/operators';
|
|
18
|
+
import * as i1$1 from '@angular/cdk/a11y';
|
|
19
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
20
|
+
|
|
21
|
+
const VERSION = new Version('{{VERSION}}');
|
|
22
|
+
|
|
23
|
+
function isBoolean(val) { return typeof val === 'boolean'; }
|
|
24
|
+
function toBoolean(value) {
|
|
25
|
+
return value != null && `${value}` !== 'false';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Injection token that configures whether the Mosaic sanity checks are enabled.
|
|
29
|
+
const MC_SANITY_CHECKS = new InjectionToken('mc-sanity-checks', {
|
|
30
|
+
providedIn: 'root',
|
|
31
|
+
factory: mcSanityChecksFactory
|
|
32
|
+
});
|
|
33
|
+
function mcSanityChecksFactory() {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Module that captures anything that should be loaded and/or run for *all* Mosaic
|
|
38
|
+
* components. This includes Bidi, etc.
|
|
39
|
+
*
|
|
40
|
+
* This module should be imported to each top-level component module (e.g., McTabsModule).
|
|
41
|
+
*/
|
|
42
|
+
class McCommonModule {
|
|
43
|
+
constructor(_sanityChecksEnabled) {
|
|
44
|
+
this._sanityChecksEnabled = _sanityChecksEnabled;
|
|
45
|
+
// Whether we've done the global sanity checks (e.g. a theme is loaded, there is a doctype).
|
|
46
|
+
this.hasDoneGlobalChecks = false;
|
|
47
|
+
// Reference to the global `document` object.
|
|
48
|
+
// tslint:disable-next-line: orthodox-getter-and-setter
|
|
49
|
+
this._document = typeof document === 'object' && document ? document : null;
|
|
50
|
+
// Reference to the global 'window' object.
|
|
51
|
+
// tslint:disable-next-line: orthodox-getter-and-setter
|
|
52
|
+
this._window = typeof window === 'object' && window ? window : null;
|
|
53
|
+
if (this.areChecksEnabled() && !this.hasDoneGlobalChecks) {
|
|
54
|
+
this.checkDoctypeIsDefined();
|
|
55
|
+
this.checkThemeIsPresent();
|
|
56
|
+
this.hasDoneGlobalChecks = true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Whether any sanity checks are enabled
|
|
60
|
+
areChecksEnabled() {
|
|
61
|
+
return this._sanityChecksEnabled && isDevMode() && !this.isTestEnv();
|
|
62
|
+
}
|
|
63
|
+
// Whether the code is running in tests.
|
|
64
|
+
isTestEnv() {
|
|
65
|
+
// tslint:disable-next-line
|
|
66
|
+
return this._window && (this._window['__karma__'] || this._window['jasmine']);
|
|
67
|
+
}
|
|
68
|
+
checkDoctypeIsDefined() {
|
|
69
|
+
if (this._document && !this._document.doctype) {
|
|
70
|
+
console.warn('Current document does not have a doctype. This may cause ' +
|
|
71
|
+
'some Mosaic components not to behave as expected.');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
checkThemeIsPresent() {
|
|
75
|
+
if (this._document && typeof getComputedStyle === 'function') {
|
|
76
|
+
const testElement = this._document.createElement('div');
|
|
77
|
+
testElement.classList.add('mc-theme-loaded-marker');
|
|
78
|
+
this._document.body.appendChild(testElement);
|
|
79
|
+
const computedStyle = getComputedStyle(testElement);
|
|
80
|
+
// In some situations, the computed style of the test element can be null. For example in
|
|
81
|
+
// Firefox, the computed style is null if an application is running inside of a hidden iframe.
|
|
82
|
+
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=548397
|
|
83
|
+
if (computedStyle && computedStyle.display !== 'none') {
|
|
84
|
+
console.warn('Could not find Mosaic core theme. Most Mosaic ' +
|
|
85
|
+
'components may not work as expected. For more info refer ' +
|
|
86
|
+
'to the theming guide: link there');
|
|
87
|
+
}
|
|
88
|
+
this._document.body.removeChild(testElement);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** @nocollapse */ /** @nocollapse */ McCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McCommonModule, deps: [{ token: MC_SANITY_CHECKS, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
93
|
+
/** @nocollapse */ /** @nocollapse */ McCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McCommonModule, imports: [BidiModule], exports: [BidiModule] });
|
|
94
|
+
/** @nocollapse */ /** @nocollapse */ McCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McCommonModule, imports: [[BidiModule], BidiModule] });
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McCommonModule, decorators: [{
|
|
96
|
+
type: NgModule,
|
|
97
|
+
args: [{
|
|
98
|
+
imports: [BidiModule],
|
|
99
|
+
exports: [BidiModule]
|
|
100
|
+
}]
|
|
101
|
+
}], ctorParameters: function () {
|
|
102
|
+
return [{ type: undefined, decorators: [{
|
|
103
|
+
type: Optional
|
|
104
|
+
}, {
|
|
105
|
+
type: Inject,
|
|
106
|
+
args: [MC_SANITY_CHECKS]
|
|
107
|
+
}] }];
|
|
108
|
+
} });
|
|
109
|
+
|
|
110
|
+
function mixinDisabled(base) {
|
|
111
|
+
return class extends base {
|
|
112
|
+
constructor(...args) {
|
|
113
|
+
// tslint:disable-next-line
|
|
114
|
+
super(...args);
|
|
115
|
+
this._disabled = false;
|
|
116
|
+
}
|
|
117
|
+
get disabled() {
|
|
118
|
+
return this._disabled;
|
|
119
|
+
}
|
|
120
|
+
set disabled(value) {
|
|
121
|
+
this._disabled = coerceBooleanProperty(value);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
var ThemePalette;
|
|
127
|
+
(function (ThemePalette) {
|
|
128
|
+
ThemePalette["Primary"] = "primary";
|
|
129
|
+
ThemePalette["Second"] = "second";
|
|
130
|
+
ThemePalette["Error"] = "error";
|
|
131
|
+
ThemePalette["Default"] = "second";
|
|
132
|
+
ThemePalette["Empty"] = "";
|
|
133
|
+
})(ThemePalette || (ThemePalette = {}));
|
|
134
|
+
function mixinColor(base, defaultColor = ThemePalette.Default) {
|
|
135
|
+
return class extends base {
|
|
136
|
+
constructor(...args) {
|
|
137
|
+
super(...args);
|
|
138
|
+
this.color = defaultColor;
|
|
139
|
+
}
|
|
140
|
+
get color() { return this._color; }
|
|
141
|
+
set color(value) {
|
|
142
|
+
const colorPalette = value || defaultColor;
|
|
143
|
+
if (colorPalette !== this._color) {
|
|
144
|
+
if (this._color) {
|
|
145
|
+
this._elementRef.nativeElement.classList.remove(`mc-${this._color}`);
|
|
146
|
+
}
|
|
147
|
+
if (colorPalette) {
|
|
148
|
+
this._elementRef.nativeElement.classList.add(`mc-${colorPalette}`);
|
|
149
|
+
}
|
|
150
|
+
this._color = colorPalette;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function mixinTabIndex(base, defaultTabIndex = 0) {
|
|
157
|
+
return class extends base {
|
|
158
|
+
constructor(...args) {
|
|
159
|
+
super(...args);
|
|
160
|
+
this.defaultTabIndex = defaultTabIndex;
|
|
161
|
+
this._tabIndex = defaultTabIndex;
|
|
162
|
+
}
|
|
163
|
+
get tabIndex() {
|
|
164
|
+
return this.disabled ? -1 : this._tabIndex;
|
|
165
|
+
}
|
|
166
|
+
set tabIndex(value) {
|
|
167
|
+
// If the specified tabIndex value is null or undefined, fall back to the default value.
|
|
168
|
+
this._tabIndex = value != null ? coerceNumberProperty(value) : this.defaultTabIndex;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Mixin to augment a directive with updateErrorState method.
|
|
175
|
+
* For component with `errorState` and need to update `errorState`.
|
|
176
|
+
*/
|
|
177
|
+
function mixinErrorState(base) {
|
|
178
|
+
return class extends base {
|
|
179
|
+
constructor(...args) {
|
|
180
|
+
super(...args);
|
|
181
|
+
/** Whether the component is in an error state. */
|
|
182
|
+
this.errorState = false;
|
|
183
|
+
/**
|
|
184
|
+
* Stream that emits whenever the state of the input changes such that the wrapping
|
|
185
|
+
* `MatFormField` needs to run change detection.
|
|
186
|
+
*/
|
|
187
|
+
this.stateChanges = new Subject();
|
|
188
|
+
}
|
|
189
|
+
updateErrorState() {
|
|
190
|
+
const oldState = this.errorState;
|
|
191
|
+
const parent = this.parentFormGroup || this.parentForm;
|
|
192
|
+
const matcher = this.errorStateMatcher || this.defaultErrorStateMatcher;
|
|
193
|
+
const control = this.ngControl ? this.ngControl.control : null;
|
|
194
|
+
const newState = matcher.isErrorState(control, parent);
|
|
195
|
+
if (newState !== oldState) {
|
|
196
|
+
this.errorState = newState;
|
|
197
|
+
this.stateChanges.next();
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Shared directive to count lines inside a text area, such as a list item.
|
|
205
|
+
* Line elements can be extracted with a @ContentChildren(McLine) query, then
|
|
206
|
+
* counted by checking the query list's length.
|
|
207
|
+
*/
|
|
208
|
+
class McLine {
|
|
209
|
+
}
|
|
210
|
+
/** @nocollapse */ /** @nocollapse */ McLine.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McLine, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
211
|
+
/** @nocollapse */ /** @nocollapse */ McLine.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.0", type: McLine, selector: "[mc-line], [mcLine]", host: { classAttribute: "mc-line" }, ngImport: i0 });
|
|
212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McLine, decorators: [{
|
|
213
|
+
type: Directive,
|
|
214
|
+
args: [{
|
|
215
|
+
selector: '[mc-line], [mcLine]',
|
|
216
|
+
host: { class: 'mc-line' }
|
|
217
|
+
}]
|
|
218
|
+
}] });
|
|
219
|
+
/**
|
|
220
|
+
* Helper that takes a query list of lines and sets the correct class on the host.
|
|
221
|
+
* @docs-private
|
|
222
|
+
*/
|
|
223
|
+
class McLineSetter {
|
|
224
|
+
constructor(_lines, _element) {
|
|
225
|
+
this._lines = _lines;
|
|
226
|
+
this._element = _element;
|
|
227
|
+
this.setLineClass(this._lines.length);
|
|
228
|
+
this._lines.changes.subscribe(() => {
|
|
229
|
+
this.setLineClass(this._lines.length);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
setLineClass(count) {
|
|
233
|
+
const minLineClassNumber = 2;
|
|
234
|
+
const maxLineClassNumber = 3;
|
|
235
|
+
this.resetClasses();
|
|
236
|
+
if (count === minLineClassNumber || count === maxLineClassNumber) {
|
|
237
|
+
this.setClass(`mc-${count}-line`, true);
|
|
238
|
+
}
|
|
239
|
+
else if (count > maxLineClassNumber) {
|
|
240
|
+
this.setClass(`mc-multi-line`, true);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
resetClasses() {
|
|
244
|
+
this.setClass('mc-2-line', false);
|
|
245
|
+
this.setClass('mc-3-line', false);
|
|
246
|
+
this.setClass('mc-multi-line', false);
|
|
247
|
+
}
|
|
248
|
+
setClass(className, isAdd) {
|
|
249
|
+
if (isAdd) {
|
|
250
|
+
this._element.nativeElement.classList.add(className);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
this._element.nativeElement.classList.remove(className);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
class McLineModule {
|
|
258
|
+
}
|
|
259
|
+
/** @nocollapse */ /** @nocollapse */ McLineModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McLineModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
260
|
+
/** @nocollapse */ /** @nocollapse */ McLineModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McLineModule, declarations: [McLine], exports: [McLine] });
|
|
261
|
+
/** @nocollapse */ /** @nocollapse */ McLineModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McLineModule, imports: [[]] });
|
|
262
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McLineModule, decorators: [{
|
|
263
|
+
type: NgModule,
|
|
264
|
+
args: [{
|
|
265
|
+
imports: [],
|
|
266
|
+
exports: [McLine],
|
|
267
|
+
declarations: [McLine]
|
|
268
|
+
}]
|
|
269
|
+
}] });
|
|
270
|
+
|
|
271
|
+
/** Error state matcher that matches when a control is invalid and dirty. */
|
|
272
|
+
class ShowOnDirtyErrorStateMatcher {
|
|
273
|
+
isErrorState(control, form) {
|
|
274
|
+
return !!(control && control.invalid && (control.dirty || (form && form.submitted)));
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/** @nocollapse */ /** @nocollapse */ ShowOnDirtyErrorStateMatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ShowOnDirtyErrorStateMatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
278
|
+
/** @nocollapse */ /** @nocollapse */ ShowOnDirtyErrorStateMatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ShowOnDirtyErrorStateMatcher });
|
|
279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ShowOnDirtyErrorStateMatcher, decorators: [{
|
|
280
|
+
type: Injectable
|
|
281
|
+
}] });
|
|
282
|
+
/** Provider that defines how form controls behave with regards to displaying error messages. */
|
|
283
|
+
class ErrorStateMatcher {
|
|
284
|
+
isErrorState(control, form) {
|
|
285
|
+
return !!(control && control.invalid && (control.touched || (form && form.submitted)));
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/** @nocollapse */ /** @nocollapse */ ErrorStateMatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ErrorStateMatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
289
|
+
/** @nocollapse */ /** @nocollapse */ ErrorStateMatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ErrorStateMatcher, providedIn: 'root' });
|
|
290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ErrorStateMatcher, decorators: [{
|
|
291
|
+
type: Injectable,
|
|
292
|
+
args: [{ providedIn: 'root' }]
|
|
293
|
+
}] });
|
|
294
|
+
|
|
295
|
+
const SECONDS_TEMPLATE$1 = `{
|
|
296
|
+
SHOW_MILLISECONDS,
|
|
297
|
+
select,
|
|
298
|
+
yes{:{SECONDS}{MILLISECONDS}}
|
|
299
|
+
other{{
|
|
300
|
+
SHOW_SECONDS,
|
|
301
|
+
select,
|
|
302
|
+
yes{:{SECONDS}}
|
|
303
|
+
other{}
|
|
304
|
+
}}
|
|
305
|
+
}`;
|
|
306
|
+
const enUS = {
|
|
307
|
+
relativeTemplates: {
|
|
308
|
+
short: {
|
|
309
|
+
BEFORE_YESTERDAY: `{CURRENT_YEAR, select, yes{{SHORT_DATE}, {TIME}} other{{SHORT_DATE}, {YEAR}}}${SECONDS_TEMPLATE$1}`,
|
|
310
|
+
YESTERDAY: `Yesterday, {TIME}${SECONDS_TEMPLATE$1}`,
|
|
311
|
+
TODAY: `Today, {TIME}${SECONDS_TEMPLATE$1}`,
|
|
312
|
+
TOMORROW: `Tomorrow, {TIME}${SECONDS_TEMPLATE$1}`,
|
|
313
|
+
AFTER_TOMORROW: `{CURRENT_YEAR, select, yes{{SHORT_DATE}, {TIME}} other{{SHORT_DATE}, {YEAR}}}${SECONDS_TEMPLATE$1}`
|
|
314
|
+
},
|
|
315
|
+
long: {
|
|
316
|
+
BEFORE_YESTERDAY: `{CURRENT_YEAR, select, yes{{DATE}, {TIME}} other{{DATE}, {YEAR}}}${SECONDS_TEMPLATE$1}`,
|
|
317
|
+
YESTERDAY: `Yesterday, {TIME}${SECONDS_TEMPLATE$1}`,
|
|
318
|
+
TODAY: `Today, {TIME}${SECONDS_TEMPLATE$1}`,
|
|
319
|
+
TOMORROW: `Tomorrow, {TIME}${SECONDS_TEMPLATE$1}`,
|
|
320
|
+
AFTER_TOMORROW: `{CURRENT_YEAR, select, yes{{DATE}, {TIME}} other{{DATE}, {YEAR}}}${SECONDS_TEMPLATE$1}`
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
absoluteTemplates: {
|
|
324
|
+
short: {
|
|
325
|
+
DATE: '{CURRENT_YEAR, select, yes{{SHORT_DATE}} other{{SHORT_DATE}, {YEAR}}}',
|
|
326
|
+
DATETIME: `{
|
|
327
|
+
CURRENT_YEAR,
|
|
328
|
+
select,
|
|
329
|
+
yes{{SHORT_DATE}, {TIME}}
|
|
330
|
+
other{{SHORT_DATE}, {YEAR}, {TIME}}
|
|
331
|
+
}${SECONDS_TEMPLATE$1}`
|
|
332
|
+
},
|
|
333
|
+
long: {
|
|
334
|
+
DATE: '{CURRENT_YEAR, select, yes{{DATE}} other{{DATE}, {YEAR}}}',
|
|
335
|
+
DATETIME: `{
|
|
336
|
+
CURRENT_YEAR,
|
|
337
|
+
select,
|
|
338
|
+
yes{{DATE}, {TIME}}
|
|
339
|
+
other{{DATE}, {YEAR}, {TIME}}
|
|
340
|
+
}${SECONDS_TEMPLATE$1}`
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
rangeTemplates: {
|
|
344
|
+
closedRange: {
|
|
345
|
+
short: {
|
|
346
|
+
START_DATE: '{CURRENT_YEAR, select, yes{{SHORT_DATE}} other{{SHORT_DATE}, {YEAR}}}',
|
|
347
|
+
END_DATE: `{
|
|
348
|
+
SAME_MONTH,
|
|
349
|
+
select,
|
|
350
|
+
yes{{DAY}}
|
|
351
|
+
other{{
|
|
352
|
+
CURRENT_YEAR,
|
|
353
|
+
select,
|
|
354
|
+
yes{{SHORT_DATE}}
|
|
355
|
+
other{{SHORT_DATE}, {YEAR}}
|
|
356
|
+
}}
|
|
357
|
+
}`,
|
|
358
|
+
DATE: `{
|
|
359
|
+
SAME_MONTH,
|
|
360
|
+
select,
|
|
361
|
+
yes{{START_DATE}{DASH}{END_DATE}}
|
|
362
|
+
other{{START_DATE}{LONG_DASH}{END_DATE}}
|
|
363
|
+
}`,
|
|
364
|
+
START_DATETIME: `{
|
|
365
|
+
SAME_DAY,
|
|
366
|
+
select,
|
|
367
|
+
yes{{TIME}}
|
|
368
|
+
other{{
|
|
369
|
+
CURRENT_YEAR,
|
|
370
|
+
select,
|
|
371
|
+
yes{{SHORT_DATE}, {TIME}}
|
|
372
|
+
other{{SHORT_DATE}, {YEAR}, {TIME}}
|
|
373
|
+
}}
|
|
374
|
+
}${SECONDS_TEMPLATE$1}`,
|
|
375
|
+
END_DATETIME: `{
|
|
376
|
+
SAME_DAY,
|
|
377
|
+
select,
|
|
378
|
+
yes{{
|
|
379
|
+
CURRENT_YEAR,
|
|
380
|
+
select,
|
|
381
|
+
yes{{TIME}${SECONDS_TEMPLATE$1}, {SHORT_DATE}}
|
|
382
|
+
other{{TIME}${SECONDS_TEMPLATE$1}, {SHORT_DATE}, {YEAR}}
|
|
383
|
+
}}
|
|
384
|
+
other{{
|
|
385
|
+
CURRENT_YEAR,
|
|
386
|
+
select,
|
|
387
|
+
yes{{SHORT_DATE}, {TIME}}
|
|
388
|
+
other{{SHORT_DATE}, {YEAR}, {TIME}}
|
|
389
|
+
}${SECONDS_TEMPLATE$1}}
|
|
390
|
+
}`,
|
|
391
|
+
DATETIME: `{
|
|
392
|
+
SAME_DAY,
|
|
393
|
+
select,
|
|
394
|
+
yes{{START_DATETIME}{DASH}{END_DATETIME}}
|
|
395
|
+
other{{START_DATETIME}{LONG_DASH}{END_DATETIME}}
|
|
396
|
+
}`
|
|
397
|
+
},
|
|
398
|
+
middle: {
|
|
399
|
+
START_DATE: `{
|
|
400
|
+
SAME_MONTH,
|
|
401
|
+
select,
|
|
402
|
+
yes{{DAY}}
|
|
403
|
+
other{{
|
|
404
|
+
CURRENT_YEAR,
|
|
405
|
+
select,
|
|
406
|
+
yes{{DATE}}
|
|
407
|
+
other{{DATE}, {YEAR}}
|
|
408
|
+
}}
|
|
409
|
+
}`,
|
|
410
|
+
END_DATE: '{CURRENT_YEAR, select, yes{{DATE}} other{{DATE}, {YEAR}}}',
|
|
411
|
+
DATE: `{
|
|
412
|
+
SAME_MONTH,
|
|
413
|
+
select,
|
|
414
|
+
yes{{START_DATE}{DASH}{END_DATE}}
|
|
415
|
+
other{{START_DATE}{LONG_DASH}{END_DATE}}
|
|
416
|
+
}`,
|
|
417
|
+
START_DATETIME: `{
|
|
418
|
+
SAME_DAY,
|
|
419
|
+
select,
|
|
420
|
+
yes{{TIME}}
|
|
421
|
+
other{{
|
|
422
|
+
CURRENT_YEAR,
|
|
423
|
+
select,
|
|
424
|
+
yes{{DATE}, {TIME}}
|
|
425
|
+
other{{DATE}, {YEAR}, {TIME}}
|
|
426
|
+
}}
|
|
427
|
+
}${SECONDS_TEMPLATE$1}`,
|
|
428
|
+
END_DATETIME: `{
|
|
429
|
+
SAME_DAY,
|
|
430
|
+
select,
|
|
431
|
+
yes{{
|
|
432
|
+
CURRENT_YEAR,
|
|
433
|
+
select,
|
|
434
|
+
yes{{TIME}${SECONDS_TEMPLATE$1}, {DATE}}
|
|
435
|
+
other{{TIME}${SECONDS_TEMPLATE$1}, {DATE}, {YEAR}}
|
|
436
|
+
}}
|
|
437
|
+
other{{
|
|
438
|
+
CURRENT_YEAR,
|
|
439
|
+
select,
|
|
440
|
+
yes{{DATE}, {TIME}}
|
|
441
|
+
other{{DATE}, {YEAR}, {TIME}}
|
|
442
|
+
}${SECONDS_TEMPLATE$1}}
|
|
443
|
+
}`,
|
|
444
|
+
DATETIME: `{
|
|
445
|
+
SAME_DAY,
|
|
446
|
+
select,
|
|
447
|
+
yes{{START_DATETIME}{DASH}{END_DATETIME}}
|
|
448
|
+
other{{START_DATETIME}{LONG_DASH}{END_DATETIME}}
|
|
449
|
+
}`
|
|
450
|
+
},
|
|
451
|
+
long: {
|
|
452
|
+
START_DATE: '{CURRENT_YEAR, select, yes{{DATE}} other{{DATE}, {YEAR}}}',
|
|
453
|
+
END_DATE: `{
|
|
454
|
+
SAME_MONTH,
|
|
455
|
+
select,
|
|
456
|
+
yes{{DAY}}
|
|
457
|
+
other{{
|
|
458
|
+
CURRENT_YEAR,
|
|
459
|
+
select,
|
|
460
|
+
yes{{DATE}}
|
|
461
|
+
other{{DATE}, {YEAR}}
|
|
462
|
+
}}
|
|
463
|
+
}`,
|
|
464
|
+
DATE: `{
|
|
465
|
+
SAME_MONTH,
|
|
466
|
+
select,
|
|
467
|
+
yes{{START_DATE}{DASH}{END_DATE}}
|
|
468
|
+
other{{START_DATE}{LONG_DASH}{END_DATE}}
|
|
469
|
+
}`,
|
|
470
|
+
START_DATETIME: `{
|
|
471
|
+
SAME_DAY,
|
|
472
|
+
select,
|
|
473
|
+
yes{{
|
|
474
|
+
CURRENT_YEAR,
|
|
475
|
+
select,
|
|
476
|
+
yes{{DATE}, from{NBSP}{TIME}}
|
|
477
|
+
other{{DATE}, {YEAR}, from{NBSP}{TIME}}
|
|
478
|
+
}}
|
|
479
|
+
other{{
|
|
480
|
+
CURRENT_YEAR,
|
|
481
|
+
select,
|
|
482
|
+
yes{{DATE}, {TIME}}
|
|
483
|
+
other{{DATE}, {YEAR}, {TIME}}
|
|
484
|
+
}}
|
|
485
|
+
}${SECONDS_TEMPLATE$1}`,
|
|
486
|
+
END_DATETIME: `{
|
|
487
|
+
SAME_DAY,
|
|
488
|
+
select,
|
|
489
|
+
yes{to{NBSP}{TIME}}
|
|
490
|
+
other{{
|
|
491
|
+
CURRENT_YEAR,
|
|
492
|
+
select,
|
|
493
|
+
yes{{DATE}, {TIME}}
|
|
494
|
+
other{{DATE}, {YEAR}, {TIME}}
|
|
495
|
+
}}
|
|
496
|
+
}${SECONDS_TEMPLATE$1}`,
|
|
497
|
+
DATETIME: `{
|
|
498
|
+
SAME_DAY,
|
|
499
|
+
select,
|
|
500
|
+
yes{{START_DATETIME} {END_DATETIME}}
|
|
501
|
+
other{From {START_DATETIME} to{NBSP}{END_DATETIME}}
|
|
502
|
+
}`
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
openedRange: {
|
|
506
|
+
short: {
|
|
507
|
+
START_DATE: `{
|
|
508
|
+
CURRENT_YEAR,
|
|
509
|
+
select,
|
|
510
|
+
yes{{SHORT_DATE}}
|
|
511
|
+
other{{SHORT_DATE} {YEAR}}
|
|
512
|
+
}`,
|
|
513
|
+
END_DATE: '{CURRENT_YEAR, select, yes{{SHORT_DATE}} other{{SHORT_DATE} {YEAR}}}',
|
|
514
|
+
DATE: `{
|
|
515
|
+
RANGE_TYPE,
|
|
516
|
+
select,
|
|
517
|
+
onlyStart{From{NBSP}{START_DATE}}
|
|
518
|
+
other{Until{NBSP}{END_DATE}}
|
|
519
|
+
}`,
|
|
520
|
+
START_DATETIME: `{
|
|
521
|
+
CURRENT_YEAR,
|
|
522
|
+
select,
|
|
523
|
+
yes{{SHORT_DATE}, {TIME}}
|
|
524
|
+
other{{SHORT_DATE} {YEAR}, {TIME}}
|
|
525
|
+
}${SECONDS_TEMPLATE$1}`,
|
|
526
|
+
END_DATETIME: `{
|
|
527
|
+
CURRENT_YEAR,
|
|
528
|
+
select,
|
|
529
|
+
yes{{SHORT_DATE}, {TIME}}
|
|
530
|
+
other{{SHORT_DATE} {YEAR}, {TIME}}
|
|
531
|
+
}${SECONDS_TEMPLATE$1}`,
|
|
532
|
+
DATETIME: `{
|
|
533
|
+
RANGE_TYPE,
|
|
534
|
+
select,
|
|
535
|
+
onlyStart{From{NBSP}{START_DATETIME}}
|
|
536
|
+
other{Until{NBSP}{END_DATETIME}}
|
|
537
|
+
}`
|
|
538
|
+
},
|
|
539
|
+
long: {
|
|
540
|
+
START_DATE: `{
|
|
541
|
+
CURRENT_YEAR,
|
|
542
|
+
select,
|
|
543
|
+
yes{{DATE}}
|
|
544
|
+
other{{DATE} {YEAR}}
|
|
545
|
+
}`,
|
|
546
|
+
END_DATE: '{CURRENT_YEAR, select, yes{{DATE}} other{{DATE} {YEAR}}}',
|
|
547
|
+
DATE: `{
|
|
548
|
+
RANGE_TYPE,
|
|
549
|
+
select,
|
|
550
|
+
onlyStart{From{NBSP}{START_DATE}}
|
|
551
|
+
other{Until{NBSP}{END_DATE}}
|
|
552
|
+
}`,
|
|
553
|
+
START_DATETIME: `{
|
|
554
|
+
CURRENT_YEAR,
|
|
555
|
+
select,
|
|
556
|
+
yes{{DATE}, {TIME}}
|
|
557
|
+
other{{DATE} {YEAR}, {TIME}}
|
|
558
|
+
}${SECONDS_TEMPLATE$1}`,
|
|
559
|
+
END_DATETIME: `{
|
|
560
|
+
CURRENT_YEAR,
|
|
561
|
+
select,
|
|
562
|
+
yes{{DATE}, {TIME}}
|
|
563
|
+
other{{DATE} {YEAR}, {TIME}}
|
|
564
|
+
}${SECONDS_TEMPLATE$1}`,
|
|
565
|
+
DATETIME: `{
|
|
566
|
+
RANGE_TYPE,
|
|
567
|
+
select,
|
|
568
|
+
onlyStart{From{NBSP}{START_DATETIME}}
|
|
569
|
+
other{Until{NBSP}{END_DATETIME}}
|
|
570
|
+
}`
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
const SECONDS_TEMPLATE = `{
|
|
577
|
+
SHOW_MILLISECONDS,
|
|
578
|
+
select,
|
|
579
|
+
yes{:{SECONDS}{MILLISECONDS}}
|
|
580
|
+
other{{
|
|
581
|
+
SHOW_SECONDS,
|
|
582
|
+
select,
|
|
583
|
+
yes{:{SECONDS}}
|
|
584
|
+
other{}
|
|
585
|
+
}}
|
|
586
|
+
}`;
|
|
587
|
+
const ruRU = {
|
|
588
|
+
relativeTemplates: {
|
|
589
|
+
short: {
|
|
590
|
+
BEFORE_YESTERDAY: `{CURRENT_YEAR, select, yes{{SHORT_DATE}, {TIME}} other{{SHORT_DATE} {YEAR}}}${SECONDS_TEMPLATE}`,
|
|
591
|
+
YESTERDAY: `Вчера, {TIME}${SECONDS_TEMPLATE}`,
|
|
592
|
+
TODAY: `Сегодня, {TIME}${SECONDS_TEMPLATE}`,
|
|
593
|
+
TOMORROW: `Завтра, {TIME}${SECONDS_TEMPLATE}`,
|
|
594
|
+
AFTER_TOMORROW: `{CURRENT_YEAR, select, yes{{SHORT_DATE}, {TIME}} other{{SHORT_DATE} {YEAR}}}${SECONDS_TEMPLATE}`
|
|
595
|
+
},
|
|
596
|
+
long: {
|
|
597
|
+
BEFORE_YESTERDAY: `{CURRENT_YEAR, select, yes{{DATE}, {TIME}} other{{DATE} {YEAR}}}${SECONDS_TEMPLATE}`,
|
|
598
|
+
YESTERDAY: `Вчера, {TIME}${SECONDS_TEMPLATE}`,
|
|
599
|
+
TODAY: `Сегодня, {TIME}${SECONDS_TEMPLATE}`,
|
|
600
|
+
TOMORROW: `Завтра, {TIME}${SECONDS_TEMPLATE}`,
|
|
601
|
+
AFTER_TOMORROW: `{CURRENT_YEAR, select, yes{{DATE}, {TIME}} other{{DATE} {YEAR}}}${SECONDS_TEMPLATE}`
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
absoluteTemplates: {
|
|
605
|
+
short: {
|
|
606
|
+
DATE: '{CURRENT_YEAR, select, yes{{SHORT_DATE}} other{{SHORT_DATE} {YEAR}}}',
|
|
607
|
+
DATETIME: `{
|
|
608
|
+
CURRENT_YEAR,
|
|
609
|
+
select,
|
|
610
|
+
yes{{SHORT_DATE}, {TIME}}
|
|
611
|
+
other{{SHORT_DATE} {YEAR}, {TIME}}
|
|
612
|
+
}${SECONDS_TEMPLATE}`
|
|
613
|
+
},
|
|
614
|
+
long: {
|
|
615
|
+
DATE: '{CURRENT_YEAR, select, yes{{DATE}} other{{DATE} {YEAR}}}',
|
|
616
|
+
DATETIME: `{
|
|
617
|
+
CURRENT_YEAR,
|
|
618
|
+
select,
|
|
619
|
+
yes{{DATE}, {TIME}}
|
|
620
|
+
other{{DATE} {YEAR}, {TIME}}
|
|
621
|
+
}${SECONDS_TEMPLATE}`
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
rangeTemplates: {
|
|
625
|
+
closedRange: {
|
|
626
|
+
short: {
|
|
627
|
+
START_DATE: `{
|
|
628
|
+
SAME_MONTH,
|
|
629
|
+
select,
|
|
630
|
+
yes{{DAY}}
|
|
631
|
+
other{{
|
|
632
|
+
CURRENT_YEAR,
|
|
633
|
+
select,
|
|
634
|
+
yes{{SHORT_DATE}}
|
|
635
|
+
other{{SHORT_DATE} {YEAR}}
|
|
636
|
+
}}
|
|
637
|
+
}`,
|
|
638
|
+
END_DATE: '{CURRENT_YEAR, select, yes{{SHORT_DATE}} other{{SHORT_DATE} {YEAR}}}',
|
|
639
|
+
DATE: `{
|
|
640
|
+
SAME_MONTH,
|
|
641
|
+
select,
|
|
642
|
+
yes{{START_DATE}{DASH}{END_DATE}}
|
|
643
|
+
other{{START_DATE}{LONG_DASH}{END_DATE}}
|
|
644
|
+
}`,
|
|
645
|
+
START_DATETIME: `{
|
|
646
|
+
SAME_DAY,
|
|
647
|
+
select,
|
|
648
|
+
yes{{TIME}}
|
|
649
|
+
other{{
|
|
650
|
+
CURRENT_YEAR,
|
|
651
|
+
select,
|
|
652
|
+
yes{{SHORT_DATE}, {TIME}}
|
|
653
|
+
other{{SHORT_DATE} {YEAR}, {TIME}}
|
|
654
|
+
}}
|
|
655
|
+
}${SECONDS_TEMPLATE}`,
|
|
656
|
+
END_DATETIME: `{
|
|
657
|
+
SAME_DAY,
|
|
658
|
+
select,
|
|
659
|
+
yes{{
|
|
660
|
+
CURRENT_YEAR,
|
|
661
|
+
select,
|
|
662
|
+
yes{{TIME}${SECONDS_TEMPLATE}, {SHORT_DATE}}
|
|
663
|
+
other{{TIME}${SECONDS_TEMPLATE}, {SHORT_DATE} {YEAR}}
|
|
664
|
+
}}
|
|
665
|
+
other{{
|
|
666
|
+
CURRENT_YEAR,
|
|
667
|
+
select,
|
|
668
|
+
yes{{SHORT_DATE}, {TIME}}
|
|
669
|
+
other{{SHORT_DATE} {YEAR}, {TIME}}
|
|
670
|
+
}${SECONDS_TEMPLATE}}
|
|
671
|
+
}`,
|
|
672
|
+
DATETIME: `{
|
|
673
|
+
SAME_DAY,
|
|
674
|
+
select,
|
|
675
|
+
yes{{START_DATETIME}{DASH}{END_DATETIME}}
|
|
676
|
+
other{{START_DATETIME}{LONG_DASH}{END_DATETIME}}
|
|
677
|
+
}`
|
|
678
|
+
},
|
|
679
|
+
middle: {
|
|
680
|
+
START_DATE: `{
|
|
681
|
+
SAME_MONTH,
|
|
682
|
+
select,
|
|
683
|
+
yes{{DAY}}
|
|
684
|
+
other{{
|
|
685
|
+
CURRENT_YEAR,
|
|
686
|
+
select,
|
|
687
|
+
yes{{DATE}}
|
|
688
|
+
other{{DATE} {YEAR}}
|
|
689
|
+
}}
|
|
690
|
+
}`,
|
|
691
|
+
END_DATE: '{CURRENT_YEAR, select, yes{{DATE}} other{{DATE} {YEAR}}}',
|
|
692
|
+
DATE: `{
|
|
693
|
+
SAME_MONTH,
|
|
694
|
+
select,
|
|
695
|
+
yes{{START_DATE}{DASH}{END_DATE}}
|
|
696
|
+
other{{START_DATE}{LONG_DASH}{END_DATE}}
|
|
697
|
+
}`,
|
|
698
|
+
START_DATETIME: `{
|
|
699
|
+
SAME_DAY,
|
|
700
|
+
select,
|
|
701
|
+
yes{{TIME}}
|
|
702
|
+
other{{
|
|
703
|
+
CURRENT_YEAR,
|
|
704
|
+
select,
|
|
705
|
+
yes{{DATE}, {TIME}}
|
|
706
|
+
other{{DATE} {YEAR}, {TIME}}
|
|
707
|
+
}}
|
|
708
|
+
}${SECONDS_TEMPLATE}`,
|
|
709
|
+
END_DATETIME: `{
|
|
710
|
+
SAME_DAY,
|
|
711
|
+
select,
|
|
712
|
+
yes{{
|
|
713
|
+
CURRENT_YEAR,
|
|
714
|
+
select,
|
|
715
|
+
yes{{TIME}${SECONDS_TEMPLATE}, {DATE}}
|
|
716
|
+
other{{TIME}${SECONDS_TEMPLATE}, {DATE} {YEAR}}
|
|
717
|
+
}}
|
|
718
|
+
other{{
|
|
719
|
+
CURRENT_YEAR,
|
|
720
|
+
select,
|
|
721
|
+
yes{{DATE}, {TIME}}
|
|
722
|
+
other{{DATE} {YEAR}, {TIME}}
|
|
723
|
+
}${SECONDS_TEMPLATE}}
|
|
724
|
+
}`,
|
|
725
|
+
DATETIME: `{
|
|
726
|
+
SAME_DAY,
|
|
727
|
+
select,
|
|
728
|
+
yes{{START_DATETIME}{DASH}{END_DATETIME}}
|
|
729
|
+
other{{START_DATETIME}{LONG_DASH}{END_DATETIME}}
|
|
730
|
+
}`
|
|
731
|
+
},
|
|
732
|
+
long: {
|
|
733
|
+
START_DATE: `{
|
|
734
|
+
SAME_MONTH,
|
|
735
|
+
select,
|
|
736
|
+
yes{{DAY}}
|
|
737
|
+
other{{
|
|
738
|
+
CURRENT_YEAR,
|
|
739
|
+
select,
|
|
740
|
+
yes{{DATE}}
|
|
741
|
+
other{{DATE} {YEAR}}
|
|
742
|
+
}}
|
|
743
|
+
}`,
|
|
744
|
+
END_DATE: '{CURRENT_YEAR, select, yes{{DATE}} other{{DATE} {YEAR}}}',
|
|
745
|
+
DATE: `{
|
|
746
|
+
SAME_MONTH,
|
|
747
|
+
select,
|
|
748
|
+
yes{{START_DATE}{DASH}{END_DATE}}
|
|
749
|
+
other{{START_DATE}{LONG_DASH}{END_DATE}}
|
|
750
|
+
}`,
|
|
751
|
+
START_DATETIME: `{
|
|
752
|
+
SAME_DAY,
|
|
753
|
+
select,
|
|
754
|
+
yes{{
|
|
755
|
+
CURRENT_YEAR,
|
|
756
|
+
select,
|
|
757
|
+
yes{{DATE}, с{NBSP}{TIME}}
|
|
758
|
+
other{{DATE} {YEAR}, с{NBSP}{TIME}}
|
|
759
|
+
}}
|
|
760
|
+
other{{
|
|
761
|
+
CURRENT_YEAR,
|
|
762
|
+
select,
|
|
763
|
+
yes{{DATE}, {TIME}}
|
|
764
|
+
other{{DATE} {YEAR}, {TIME}}
|
|
765
|
+
}}
|
|
766
|
+
}${SECONDS_TEMPLATE}`,
|
|
767
|
+
END_DATETIME: `{
|
|
768
|
+
SAME_DAY,
|
|
769
|
+
select,
|
|
770
|
+
yes{по{NBSP}{TIME}}
|
|
771
|
+
other{{
|
|
772
|
+
CURRENT_YEAR,
|
|
773
|
+
select,
|
|
774
|
+
yes{{DATE}, {TIME}}
|
|
775
|
+
other{{DATE} {YEAR}, {TIME}}
|
|
776
|
+
}}
|
|
777
|
+
}${SECONDS_TEMPLATE}`,
|
|
778
|
+
DATETIME: `{
|
|
779
|
+
SAME_DAY,
|
|
780
|
+
select,
|
|
781
|
+
yes{{START_DATETIME} {END_DATETIME}}
|
|
782
|
+
other{С{NBSP}{START_DATETIME} по{NBSP}{END_DATETIME}}
|
|
783
|
+
}`
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
openedRange: {
|
|
787
|
+
short: {
|
|
788
|
+
START_DATE: `{
|
|
789
|
+
CURRENT_YEAR,
|
|
790
|
+
select,
|
|
791
|
+
yes{{SHORT_DATE}}
|
|
792
|
+
other{{SHORT_DATE} {YEAR}}
|
|
793
|
+
}`,
|
|
794
|
+
END_DATE: '{CURRENT_YEAR, select, yes{{SHORT_DATE}} other{{SHORT_DATE} {YEAR}}}',
|
|
795
|
+
DATE: `{
|
|
796
|
+
RANGE_TYPE,
|
|
797
|
+
select,
|
|
798
|
+
onlyStart{С{NBSP}{START_DATE}}
|
|
799
|
+
other{По{NBSP}{END_DATE}}
|
|
800
|
+
}`,
|
|
801
|
+
START_DATETIME: `{
|
|
802
|
+
CURRENT_YEAR,
|
|
803
|
+
select,
|
|
804
|
+
yes{{SHORT_DATE}, {TIME}}
|
|
805
|
+
other{{SHORT_DATE} {YEAR}, {TIME}}
|
|
806
|
+
}${SECONDS_TEMPLATE}`,
|
|
807
|
+
END_DATETIME: `{
|
|
808
|
+
CURRENT_YEAR,
|
|
809
|
+
select,
|
|
810
|
+
yes{{SHORT_DATE}, {TIME}}
|
|
811
|
+
other{{SHORT_DATE} {YEAR}, {TIME}}
|
|
812
|
+
}${SECONDS_TEMPLATE}`,
|
|
813
|
+
DATETIME: `{
|
|
814
|
+
RANGE_TYPE,
|
|
815
|
+
select,
|
|
816
|
+
onlyStart{С{NBSP}{START_DATETIME}}
|
|
817
|
+
other{По{NBSP}{END_DATETIME}}
|
|
818
|
+
}`
|
|
819
|
+
},
|
|
820
|
+
long: {
|
|
821
|
+
START_DATE: `{
|
|
822
|
+
CURRENT_YEAR,
|
|
823
|
+
select,
|
|
824
|
+
yes{{DATE}}
|
|
825
|
+
other{{DATE} {YEAR}}
|
|
826
|
+
}`,
|
|
827
|
+
END_DATE: '{CURRENT_YEAR, select, yes{{DATE}} other{{DATE} {YEAR}}}',
|
|
828
|
+
DATE: `{
|
|
829
|
+
RANGE_TYPE,
|
|
830
|
+
select,
|
|
831
|
+
onlyStart{С{NBSP}{START_DATE}}
|
|
832
|
+
other{По{NBSP}{END_DATE}}
|
|
833
|
+
}`,
|
|
834
|
+
START_DATETIME: `{
|
|
835
|
+
CURRENT_YEAR,
|
|
836
|
+
select,
|
|
837
|
+
yes{{DATE}, {TIME}}
|
|
838
|
+
other{{DATE} {YEAR}, {TIME}}
|
|
839
|
+
}${SECONDS_TEMPLATE}`,
|
|
840
|
+
END_DATETIME: `{
|
|
841
|
+
CURRENT_YEAR,
|
|
842
|
+
select,
|
|
843
|
+
yes{{DATE}, {TIME}}
|
|
844
|
+
other{{DATE} {YEAR}, {TIME}}
|
|
845
|
+
}${SECONDS_TEMPLATE}`,
|
|
846
|
+
DATETIME: `{
|
|
847
|
+
RANGE_TYPE,
|
|
848
|
+
select,
|
|
849
|
+
onlyStart{С{NBSP}{START_DATETIME}}
|
|
850
|
+
other{По{NBSP}{END_DATETIME}}
|
|
851
|
+
}`
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
};
|
|
856
|
+
|
|
857
|
+
// tslint:disable:no-magic-numbers
|
|
858
|
+
class DateFormatter {
|
|
859
|
+
constructor(adapter, locale) {
|
|
860
|
+
this.adapter = adapter;
|
|
861
|
+
this.invalidDateErrorText = 'Invalid date';
|
|
862
|
+
this.config = locale === 'en' ? enUS : ruRU;
|
|
863
|
+
this.messageFormat = new MessageFormat(locale);
|
|
864
|
+
}
|
|
865
|
+
setLocale(locale) {
|
|
866
|
+
this.config = locale === 'en' ? enUS : ruRU;
|
|
867
|
+
this.adapter.setLocale(locale);
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* @param date - date
|
|
871
|
+
* @param template - template
|
|
872
|
+
* @returns relative date by template
|
|
873
|
+
*/
|
|
874
|
+
relativeDate(date, template, seconds = false, milliseconds = false) {
|
|
875
|
+
if (!this.adapter.isDateInstance(date)) {
|
|
876
|
+
throw new Error(this.invalidDateErrorText);
|
|
877
|
+
}
|
|
878
|
+
let newTemplate;
|
|
879
|
+
const templateVariables = Object.assign(Object.assign({}, this.adapter.config.variables), template.variables);
|
|
880
|
+
if (this.isBeforeYesterday(date)) {
|
|
881
|
+
newTemplate = template.BEFORE_YESTERDAY;
|
|
882
|
+
}
|
|
883
|
+
else if (this.isYesterday(date)) {
|
|
884
|
+
newTemplate = template.YESTERDAY;
|
|
885
|
+
}
|
|
886
|
+
else if (this.isToday(date)) {
|
|
887
|
+
newTemplate = template.TODAY;
|
|
888
|
+
}
|
|
889
|
+
else if (this.isTomorrow(date)) {
|
|
890
|
+
newTemplate = template.TOMORROW;
|
|
891
|
+
}
|
|
892
|
+
else if (this.isAfterTomorrow(date)) {
|
|
893
|
+
newTemplate = template.AFTER_TOMORROW;
|
|
894
|
+
}
|
|
895
|
+
const variables = this.compileVariables(date, templateVariables);
|
|
896
|
+
variables.SHOW_SECONDS = seconds ? 'yes' : 'no';
|
|
897
|
+
variables.SHOW_MILLISECONDS = milliseconds ? 'yes' : 'no';
|
|
898
|
+
return this.messageFormat.compile(newTemplate)(variables);
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* @param date - date
|
|
902
|
+
* @returns relative date in short format
|
|
903
|
+
*/
|
|
904
|
+
relativeShortDate(date) {
|
|
905
|
+
return this.relativeDate(date, this.config.relativeTemplates.short);
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* @param date - date
|
|
909
|
+
* @returns relative date in long format
|
|
910
|
+
*/
|
|
911
|
+
relativeLongDate(date) {
|
|
912
|
+
return this.relativeDate(date, this.config.relativeTemplates.long);
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* @param date - date
|
|
916
|
+
* @param options - DateTimeOptions
|
|
917
|
+
* @returns relative date in short format with time
|
|
918
|
+
*/
|
|
919
|
+
relativeShortDateTime(date, options) {
|
|
920
|
+
return this.relativeDate(date, this.config.relativeTemplates.short, options === null || options === void 0 ? void 0 : options.seconds, options === null || options === void 0 ? void 0 : options.milliseconds);
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* @param date - date
|
|
924
|
+
* @param options - DateTimeOptions
|
|
925
|
+
* @returns relative date in long format with time
|
|
926
|
+
*/
|
|
927
|
+
relativeLongDateTime(date, options) {
|
|
928
|
+
return this.relativeDate(date, this.config.relativeTemplates.long, options === null || options === void 0 ? void 0 : options.seconds, options === null || options === void 0 ? void 0 : options.milliseconds);
|
|
929
|
+
}
|
|
930
|
+
/**
|
|
931
|
+
* @param date - date
|
|
932
|
+
* @param params - parameters
|
|
933
|
+
* @param datetime - should time be shown as well
|
|
934
|
+
* @param seconds - should time with seconds be shown as well
|
|
935
|
+
* @param milliseconds - should time with milliseconds be shown as well
|
|
936
|
+
* @returns absolute date in common format
|
|
937
|
+
*/
|
|
938
|
+
absoluteDate(date, params, datetime = false, seconds = false, milliseconds = false) {
|
|
939
|
+
if (!this.adapter.isDateInstance(date)) {
|
|
940
|
+
throw new Error(this.invalidDateErrorText);
|
|
941
|
+
}
|
|
942
|
+
const variables = this.compileVariables(date, Object.assign(Object.assign({}, this.adapter.config.variables), params.variables));
|
|
943
|
+
variables.SHOW_SECONDS = seconds ? 'yes' : 'no';
|
|
944
|
+
variables.SHOW_MILLISECONDS = milliseconds ? 'yes' : 'no';
|
|
945
|
+
const template = datetime ? params.DATETIME : params.DATE;
|
|
946
|
+
return this.messageFormat.compile(template)(variables);
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* @param date - date
|
|
950
|
+
* @returns absolute date in short format
|
|
951
|
+
*/
|
|
952
|
+
absoluteShortDate(date) {
|
|
953
|
+
return this.absoluteDate(date, this.config.absoluteTemplates.short);
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* @param date - date
|
|
957
|
+
* @param options - DateTimeOptions
|
|
958
|
+
* @returns absolute date in short format with time
|
|
959
|
+
*/
|
|
960
|
+
absoluteShortDateTime(date, options) {
|
|
961
|
+
return this.absoluteDate(date, this.config.absoluteTemplates.short, true, options === null || options === void 0 ? void 0 : options.seconds, options === null || options === void 0 ? void 0 : options.milliseconds);
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* @param date - date
|
|
965
|
+
* @returns absolute date in long format
|
|
966
|
+
*/
|
|
967
|
+
absoluteLongDate(date) {
|
|
968
|
+
return this.absoluteDate(date, this.config.absoluteTemplates.long);
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* @param date - date
|
|
972
|
+
* @param options - DateTimeOptions
|
|
973
|
+
* @returns absolute date in long format with time
|
|
974
|
+
*/
|
|
975
|
+
absoluteLongDateTime(date, options) {
|
|
976
|
+
return this.absoluteDate(date, this.config.absoluteTemplates.long, true, options === null || options === void 0 ? void 0 : options.seconds, options === null || options === void 0 ? void 0 : options.milliseconds);
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* @param startDate - start date
|
|
980
|
+
* @param endDate - end date
|
|
981
|
+
* @param template - template
|
|
982
|
+
* @returns opened date
|
|
983
|
+
*/
|
|
984
|
+
openedRangeDate(startDate, endDate, template) {
|
|
985
|
+
if (!this.adapter.isDateInstance(startDate) && !this.adapter.isDateInstance(endDate)) {
|
|
986
|
+
throw new Error(this.invalidDateErrorText);
|
|
987
|
+
}
|
|
988
|
+
const variables = Object.assign(Object.assign({}, this.adapter.config.variables), template.variables);
|
|
989
|
+
let params = {};
|
|
990
|
+
if (startDate) {
|
|
991
|
+
const startDateVariables = this.compileVariables(startDate, variables);
|
|
992
|
+
params = Object.assign(Object.assign({}, variables), { START_DATE: this.messageFormat.compile(template.START_DATE)(startDateVariables), RANGE_TYPE: 'onlyStart' });
|
|
993
|
+
}
|
|
994
|
+
else if (endDate) {
|
|
995
|
+
const endDateVariables = this.compileVariables(endDate, variables);
|
|
996
|
+
params = Object.assign(Object.assign({}, variables), { END_DATE: this.messageFormat.compile(template.END_DATE)(endDateVariables), RANGE_TYPE: 'onlyEnd' });
|
|
997
|
+
}
|
|
998
|
+
return this.messageFormat.compile(template.DATE)(params);
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* @param startDate - start date
|
|
1002
|
+
* @param endDate - end date
|
|
1003
|
+
* @param template - template
|
|
1004
|
+
* @param seconds - should time with seconds be shown as well
|
|
1005
|
+
* @param milliseconds - should time with milliseconds be shown as well
|
|
1006
|
+
* @returns opened date
|
|
1007
|
+
*/
|
|
1008
|
+
openedRangeDateTime(startDate, endDate, template, seconds = false, milliseconds = false) {
|
|
1009
|
+
if (!this.adapter.isDateInstance(startDate) && !this.adapter.isDateInstance(endDate)) {
|
|
1010
|
+
throw new Error(this.invalidDateErrorText);
|
|
1011
|
+
}
|
|
1012
|
+
const variables = Object.assign(Object.assign({}, this.adapter.config.variables), template.variables);
|
|
1013
|
+
let params = {};
|
|
1014
|
+
if (startDate) {
|
|
1015
|
+
const startDateVariables = this.compileVariables(startDate, variables);
|
|
1016
|
+
startDateVariables.SHOW_SECONDS = seconds ? 'yes' : 'no';
|
|
1017
|
+
startDateVariables.SHOW_MILLISECONDS = milliseconds ? 'yes' : 'no';
|
|
1018
|
+
params = Object.assign(Object.assign({}, variables), { START_DATETIME: this.messageFormat.compile(template.START_DATETIME)(startDateVariables), RANGE_TYPE: 'onlyStart' });
|
|
1019
|
+
}
|
|
1020
|
+
else if (endDate) {
|
|
1021
|
+
const endDateVariables = this.compileVariables(endDate, variables);
|
|
1022
|
+
endDateVariables.SHOW_SECONDS = seconds ? 'yes' : 'no';
|
|
1023
|
+
endDateVariables.SHOW_MILLISECONDS = milliseconds ? 'yes' : 'no';
|
|
1024
|
+
params = Object.assign(Object.assign({}, variables), { END_DATETIME: this.messageFormat.compile(template.END_DATETIME)(endDateVariables), RANGE_TYPE: 'onlyEnd' });
|
|
1025
|
+
}
|
|
1026
|
+
return this.messageFormat.compile(template.DATETIME)(params);
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* @param startDate - start date
|
|
1030
|
+
* @param endDate - end date
|
|
1031
|
+
* @param template - template
|
|
1032
|
+
* @returns range date in template format
|
|
1033
|
+
*/
|
|
1034
|
+
rangeDate(startDate, endDate, template) {
|
|
1035
|
+
if (!this.adapter.isDateInstance(startDate) || !this.adapter.isDateInstance(endDate)) {
|
|
1036
|
+
throw new Error(this.invalidDateErrorText);
|
|
1037
|
+
}
|
|
1038
|
+
const variables = Object.assign(Object.assign({}, this.adapter.config.variables), template.variables);
|
|
1039
|
+
const sameMonth = this.hasSame(startDate, endDate, 'month');
|
|
1040
|
+
const startDateVariables = this.compileVariables(startDate, variables);
|
|
1041
|
+
startDateVariables.SAME_MONTH = sameMonth;
|
|
1042
|
+
const endDateVariables = this.compileVariables(endDate, variables);
|
|
1043
|
+
endDateVariables.SAME_MONTH = sameMonth;
|
|
1044
|
+
const bothCurrentYear = startDateVariables.CURRENT_YEAR === 'yes' && endDateVariables.CURRENT_YEAR === 'yes';
|
|
1045
|
+
startDateVariables.CURRENT_YEAR = bothCurrentYear ? 'yes' : 'no';
|
|
1046
|
+
endDateVariables.CURRENT_YEAR = bothCurrentYear ? 'yes' : 'no';
|
|
1047
|
+
const params = Object.assign(Object.assign({}, variables), { START_DATE: this.messageFormat.compile(template.START_DATE)(startDateVariables), END_DATE: this.messageFormat.compile(template.END_DATE)(endDateVariables), SAME_MONTH: sameMonth });
|
|
1048
|
+
return this.messageFormat.compile(template.DATE)(params);
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* @param startDate - start date
|
|
1052
|
+
* @param endDate - end date
|
|
1053
|
+
* @param template - template
|
|
1054
|
+
* @returns range date in template format with time
|
|
1055
|
+
*/
|
|
1056
|
+
rangeDateTime(startDate, endDate, template, seconds = false, milliseconds = false) {
|
|
1057
|
+
if (!this.adapter.isDateInstance(startDate) || !this.adapter.isDateInstance(endDate)) {
|
|
1058
|
+
throw new Error(this.invalidDateErrorText);
|
|
1059
|
+
}
|
|
1060
|
+
const variables = Object.assign(Object.assign({}, this.adapter.config.variables), template.variables);
|
|
1061
|
+
const sameMonth = this.hasSame(startDate, endDate, 'month');
|
|
1062
|
+
const sameDay = this.hasSame(startDate, endDate, 'day');
|
|
1063
|
+
const startDateVariables = this.compileVariables(startDate, variables);
|
|
1064
|
+
startDateVariables.SAME_MONTH = sameMonth;
|
|
1065
|
+
startDateVariables.SAME_DAY = sameDay;
|
|
1066
|
+
startDateVariables.SHOW_SECONDS = seconds ? 'yes' : 'no';
|
|
1067
|
+
startDateVariables.SHOW_MILLISECONDS = milliseconds ? 'yes' : 'no';
|
|
1068
|
+
const endDateVariables = this.compileVariables(endDate, variables);
|
|
1069
|
+
endDateVariables.SAME_MONTH = sameMonth;
|
|
1070
|
+
endDateVariables.SAME_DAY = sameDay;
|
|
1071
|
+
endDateVariables.SHOW_SECONDS = seconds ? 'yes' : 'no';
|
|
1072
|
+
endDateVariables.SHOW_MILLISECONDS = milliseconds ? 'yes' : 'no';
|
|
1073
|
+
const bothCurrentYear = startDateVariables.CURRENT_YEAR === 'yes' && endDateVariables.CURRENT_YEAR === 'yes';
|
|
1074
|
+
startDateVariables.CURRENT_YEAR = bothCurrentYear ? 'yes' : 'no';
|
|
1075
|
+
endDateVariables.CURRENT_YEAR = bothCurrentYear ? 'yes' : 'no';
|
|
1076
|
+
const params = Object.assign(Object.assign({}, variables), { START_DATETIME: this.messageFormat.compile(template.START_DATETIME)(startDateVariables), END_DATETIME: this.messageFormat.compile(template.END_DATETIME)(endDateVariables), SAME_MONTH: sameMonth, SAME_DAY: sameDay });
|
|
1077
|
+
return this.messageFormat.compile(template.DATETIME)(params);
|
|
1078
|
+
}
|
|
1079
|
+
/**
|
|
1080
|
+
* @param startDate - start date
|
|
1081
|
+
* @param endDate - end date
|
|
1082
|
+
* @returns range date in short format
|
|
1083
|
+
*/
|
|
1084
|
+
rangeShortDate(startDate, endDate) {
|
|
1085
|
+
const rangeTemplates = this.config.rangeTemplates;
|
|
1086
|
+
if (startDate && endDate) {
|
|
1087
|
+
return this.rangeDate(startDate, endDate, rangeTemplates.closedRange.short);
|
|
1088
|
+
}
|
|
1089
|
+
return this.openedRangeDate(startDate, endDate || null, rangeTemplates.openedRange.short);
|
|
1090
|
+
}
|
|
1091
|
+
/**
|
|
1092
|
+
* @param startDate - start date
|
|
1093
|
+
* @param endDate - end date
|
|
1094
|
+
* @param options - DateTimeOptions
|
|
1095
|
+
* @returns range date in short format with time
|
|
1096
|
+
*/
|
|
1097
|
+
rangeShortDateTime(startDate, endDate, options) {
|
|
1098
|
+
const rangeTemplates = this.config.rangeTemplates;
|
|
1099
|
+
if (startDate && endDate) {
|
|
1100
|
+
return this.rangeDateTime(startDate, endDate, rangeTemplates.closedRange.short, options === null || options === void 0 ? void 0 : options.seconds, options === null || options === void 0 ? void 0 : options.milliseconds);
|
|
1101
|
+
}
|
|
1102
|
+
return this.openedRangeDateTime(startDate, endDate || null, rangeTemplates.openedRange.short, options === null || options === void 0 ? void 0 : options.seconds, options === null || options === void 0 ? void 0 : options.milliseconds);
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* @param startDate - start date
|
|
1106
|
+
* @param endDate - end date
|
|
1107
|
+
* @returns range date in long format
|
|
1108
|
+
*/
|
|
1109
|
+
rangeLongDate(startDate, endDate) {
|
|
1110
|
+
const rangeTemplates = this.config.rangeTemplates;
|
|
1111
|
+
if (startDate && endDate) {
|
|
1112
|
+
return this.rangeDate(startDate, endDate, rangeTemplates.closedRange.long);
|
|
1113
|
+
}
|
|
1114
|
+
return this.openedRangeDate(startDate, endDate || null, rangeTemplates.openedRange.long);
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* @param startDate - start date
|
|
1118
|
+
* @param endDate - end date
|
|
1119
|
+
* @param options - DateTimeOptions
|
|
1120
|
+
* @returns range date in long format with time
|
|
1121
|
+
*/
|
|
1122
|
+
rangeLongDateTime(startDate, endDate, options) {
|
|
1123
|
+
const rangeTemplates = this.config.rangeTemplates;
|
|
1124
|
+
if (startDate && endDate) {
|
|
1125
|
+
return this.rangeDateTime(startDate, endDate, rangeTemplates.closedRange.long, options === null || options === void 0 ? void 0 : options.seconds, options === null || options === void 0 ? void 0 : options.milliseconds);
|
|
1126
|
+
}
|
|
1127
|
+
return this.openedRangeDateTime(startDate, endDate || null, rangeTemplates.openedRange.long);
|
|
1128
|
+
}
|
|
1129
|
+
/**
|
|
1130
|
+
* @param startDate - start date
|
|
1131
|
+
* @param endDate - end date
|
|
1132
|
+
* @param options - DateTimeOptions
|
|
1133
|
+
* @returns range middle date with time
|
|
1134
|
+
*/
|
|
1135
|
+
rangeMiddleDateTime(startDate, endDate, options) {
|
|
1136
|
+
return this.rangeDateTime(startDate, endDate, this.config.rangeTemplates.closedRange.middle, options === null || options === void 0 ? void 0 : options.seconds, options === null || options === void 0 ? void 0 : options.milliseconds);
|
|
1137
|
+
}
|
|
1138
|
+
compileVariables(date, variables) {
|
|
1139
|
+
const compiledVariables = {};
|
|
1140
|
+
// tslint:disable-next-line:no-for-in
|
|
1141
|
+
for (const key in variables) {
|
|
1142
|
+
if (!variables.hasOwnProperty(key)) {
|
|
1143
|
+
continue;
|
|
1144
|
+
}
|
|
1145
|
+
const value = variables[key];
|
|
1146
|
+
compiledVariables[key] = this.adapter.format(date, value);
|
|
1147
|
+
}
|
|
1148
|
+
compiledVariables.CURRENT_YEAR = this.hasSame(date, this.adapter.today(), 'year');
|
|
1149
|
+
return compiledVariables;
|
|
1150
|
+
}
|
|
1151
|
+
isBeforeYesterday(date) {
|
|
1152
|
+
return this.adapter.daysFromToday(date) <= -2;
|
|
1153
|
+
}
|
|
1154
|
+
isYesterday(date) {
|
|
1155
|
+
const interval = this.adapter.daysFromToday(date);
|
|
1156
|
+
return interval > -2 && interval <= -1;
|
|
1157
|
+
}
|
|
1158
|
+
isToday(date) {
|
|
1159
|
+
return this.adapter.daysFromToday(date) === 0;
|
|
1160
|
+
}
|
|
1161
|
+
isTomorrow(date) {
|
|
1162
|
+
const interval = this.adapter.daysFromToday(date);
|
|
1163
|
+
return interval >= 1 && interval < 2;
|
|
1164
|
+
}
|
|
1165
|
+
isAfterTomorrow(date) {
|
|
1166
|
+
return this.adapter.daysFromToday(date) >= 2;
|
|
1167
|
+
}
|
|
1168
|
+
hasSame(startDate, endDate, unit) {
|
|
1169
|
+
return this.adapter.hasSame(startDate, endDate, unit) ? 'yes' : 'no';
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
/** @nocollapse */ /** @nocollapse */ DateFormatter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DateFormatter, deps: [{ token: i1.DateAdapter }, { token: MC_DATE_LOCALE }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1173
|
+
/** @nocollapse */ /** @nocollapse */ DateFormatter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DateFormatter });
|
|
1174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DateFormatter, decorators: [{
|
|
1175
|
+
type: Injectable
|
|
1176
|
+
}], ctorParameters: function () {
|
|
1177
|
+
return [{ type: i1.DateAdapter }, { type: undefined, decorators: [{
|
|
1178
|
+
type: Inject,
|
|
1179
|
+
args: [MC_DATE_LOCALE]
|
|
1180
|
+
}] }];
|
|
1181
|
+
} });
|
|
1182
|
+
|
|
1183
|
+
/* tslint:disable:naming-convention */
|
|
1184
|
+
const MC_LOCALE_ID = new InjectionToken('McLocaleId');
|
|
1185
|
+
const DEFAULT_MC_LOCALE_ID = 'ru';
|
|
1186
|
+
function isEmpty(value) {
|
|
1187
|
+
return value == null || value === '' || value !== value;
|
|
1188
|
+
}
|
|
1189
|
+
function strToNumber(value) {
|
|
1190
|
+
if (typeof value === 'string' && !isNaN(Number(value) - parseFloat(value))) {
|
|
1191
|
+
return Number(value);
|
|
1192
|
+
}
|
|
1193
|
+
if (typeof value !== 'number') {
|
|
1194
|
+
throw new Error(`${value} is not a number`);
|
|
1195
|
+
}
|
|
1196
|
+
return value;
|
|
1197
|
+
}
|
|
1198
|
+
const NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
|
|
1199
|
+
const minIntGroupPosition = 1;
|
|
1200
|
+
const minFractionGroupPosition = 3;
|
|
1201
|
+
const maxFractionGroupPosition = 5;
|
|
1202
|
+
class ParsedDigitsInfo {
|
|
1203
|
+
}
|
|
1204
|
+
function parseDigitsInfo(digitsInfo) {
|
|
1205
|
+
const parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);
|
|
1206
|
+
if (parts === null) {
|
|
1207
|
+
throw new Error(`${digitsInfo} is not a valid digit info`);
|
|
1208
|
+
}
|
|
1209
|
+
const minIntPart = parts[minIntGroupPosition];
|
|
1210
|
+
const minFractionPart = parts[minFractionGroupPosition];
|
|
1211
|
+
const maxFractionPart = parts[maxFractionGroupPosition];
|
|
1212
|
+
const result = new ParsedDigitsInfo();
|
|
1213
|
+
if (minIntPart != null) {
|
|
1214
|
+
result.minimumIntegerDigits = parseInt(minIntPart);
|
|
1215
|
+
}
|
|
1216
|
+
if (minFractionPart != null) {
|
|
1217
|
+
result.minimumFractionDigits = parseInt(minFractionPart);
|
|
1218
|
+
}
|
|
1219
|
+
if (maxFractionPart != null) {
|
|
1220
|
+
result.maximumFractionDigits = parseInt(maxFractionPart);
|
|
1221
|
+
}
|
|
1222
|
+
else if (minFractionPart != null && result.minimumFractionDigits > result.maximumFractionDigits) {
|
|
1223
|
+
result.maximumFractionDigits = result.minimumFractionDigits;
|
|
1224
|
+
}
|
|
1225
|
+
return result;
|
|
1226
|
+
}
|
|
1227
|
+
class McDecimalPipe {
|
|
1228
|
+
constructor(_locale) {
|
|
1229
|
+
this._locale = _locale;
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* @param value The number to be formatted.
|
|
1233
|
+
* @param digitsInfo Decimal representation options, specified by a string
|
|
1234
|
+
* in the following format:<br>
|
|
1235
|
+
* <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>.
|
|
1236
|
+
* - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
|
|
1237
|
+
* Default is `1`.
|
|
1238
|
+
* - `minFractionDigits`: The minimum number of digits after the decimal point.
|
|
1239
|
+
* Default is `0`.
|
|
1240
|
+
* - `maxFractionDigits`: The maximum number of digits after the decimal point.
|
|
1241
|
+
* Default is `3`.
|
|
1242
|
+
* @param locale A locale code for the locale format rules to use.
|
|
1243
|
+
* When not supplied, uses the value of `MC_LOCALE_ID`, which is `ru` by default.
|
|
1244
|
+
*/
|
|
1245
|
+
transform(value, digitsInfo, locale) {
|
|
1246
|
+
if (isEmpty(value)) {
|
|
1247
|
+
return null;
|
|
1248
|
+
}
|
|
1249
|
+
const currentLocale = locale || this._locale || DEFAULT_MC_LOCALE_ID;
|
|
1250
|
+
let parsedDigitsInfo;
|
|
1251
|
+
if (digitsInfo) {
|
|
1252
|
+
parsedDigitsInfo = parseDigitsInfo(digitsInfo);
|
|
1253
|
+
}
|
|
1254
|
+
const options = Object.assign({ useGrouping: true, minimumIntegerDigits: 1, minimumFractionDigits: 0, maximumFractionDigits: 3 }, parsedDigitsInfo);
|
|
1255
|
+
try {
|
|
1256
|
+
const num = strToNumber(value);
|
|
1257
|
+
return Intl.NumberFormat.call(this, currentLocale, options).format(num);
|
|
1258
|
+
}
|
|
1259
|
+
catch (error) {
|
|
1260
|
+
throw Error(`InvalidPipeArgument: McDecimalPipe for pipe '${JSON.stringify(error.message)}'`);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
/** @nocollapse */ /** @nocollapse */ McDecimalPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McDecimalPipe, deps: [{ token: MC_LOCALE_ID, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1265
|
+
/** @nocollapse */ /** @nocollapse */ McDecimalPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McDecimalPipe, name: "mcNumber" });
|
|
1266
|
+
/** @nocollapse */ /** @nocollapse */ McDecimalPipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McDecimalPipe, providedIn: 'root' });
|
|
1267
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McDecimalPipe, decorators: [{
|
|
1268
|
+
type: Injectable,
|
|
1269
|
+
args: [{ providedIn: 'root' }]
|
|
1270
|
+
}, {
|
|
1271
|
+
type: Pipe,
|
|
1272
|
+
args: [{ name: 'mcNumber' }]
|
|
1273
|
+
}], ctorParameters: function () {
|
|
1274
|
+
return [{ type: undefined, decorators: [{
|
|
1275
|
+
type: Optional
|
|
1276
|
+
}, {
|
|
1277
|
+
type: Inject,
|
|
1278
|
+
args: [MC_LOCALE_ID]
|
|
1279
|
+
}] }];
|
|
1280
|
+
} });
|
|
1281
|
+
|
|
1282
|
+
class McFormattersModule {
|
|
1283
|
+
}
|
|
1284
|
+
/** @nocollapse */ /** @nocollapse */ McFormattersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McFormattersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1285
|
+
/** @nocollapse */ /** @nocollapse */ McFormattersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McFormattersModule, declarations: [McDecimalPipe], exports: [McDecimalPipe] });
|
|
1286
|
+
/** @nocollapse */ /** @nocollapse */ McFormattersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McFormattersModule, providers: [DateFormatter] });
|
|
1287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McFormattersModule, decorators: [{
|
|
1288
|
+
type: NgModule,
|
|
1289
|
+
args: [{
|
|
1290
|
+
exports: [McDecimalPipe],
|
|
1291
|
+
declarations: [McDecimalPipe],
|
|
1292
|
+
providers: [DateFormatter]
|
|
1293
|
+
}]
|
|
1294
|
+
}] });
|
|
1295
|
+
|
|
1296
|
+
const validationTooltipShowDelay = 10;
|
|
1297
|
+
const validationTooltipHideDelay = 3000;
|
|
1298
|
+
const MC_VALIDATION = new InjectionToken('McUseValidation', { factory: () => ({ useValidation: true }) });
|
|
1299
|
+
function setValidState(control, validator) {
|
|
1300
|
+
if (!control) {
|
|
1301
|
+
return;
|
|
1302
|
+
}
|
|
1303
|
+
control.clearValidators();
|
|
1304
|
+
control.updateValueAndValidity({ emitEvent: false });
|
|
1305
|
+
control.setValidators(validator);
|
|
1306
|
+
}
|
|
1307
|
+
/** This function do next:
|
|
1308
|
+
* - run validation on submitting parent form
|
|
1309
|
+
* - prevent validation in required validator if form doesn't submitted
|
|
1310
|
+
* - if control has focus validation will be prevented
|
|
1311
|
+
*/
|
|
1312
|
+
function setMosaicValidation(component) {
|
|
1313
|
+
const ngControl = component.ngControl;
|
|
1314
|
+
if (!ngControl) {
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
const parentForm = component.parentForm || component.parentFormGroup;
|
|
1318
|
+
if (parentForm) {
|
|
1319
|
+
parentForm.ngSubmit.subscribe(() => {
|
|
1320
|
+
// tslint:disable-next-line: no-unnecessary-type-assertion
|
|
1321
|
+
ngControl.control.updateValueAndValidity({ emitEvent: false });
|
|
1322
|
+
});
|
|
1323
|
+
}
|
|
1324
|
+
if (component.ngModel) {
|
|
1325
|
+
setMosaicValidationForModelControl(component, component.rawValidators, parentForm);
|
|
1326
|
+
}
|
|
1327
|
+
else if (component.formControlName || component.ngControl) {
|
|
1328
|
+
setMosaicValidationForFormControl(component, parentForm, ngControl);
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
function setMosaicValidationForModelControl(component, validators, parentForm) {
|
|
1332
|
+
if (!validators) {
|
|
1333
|
+
return;
|
|
1334
|
+
}
|
|
1335
|
+
validators.forEach((validator) => {
|
|
1336
|
+
// tslint:disable-next-line: no-unbound-method
|
|
1337
|
+
const originalValidate = validator.validate;
|
|
1338
|
+
if (validator instanceof RequiredValidator) {
|
|
1339
|
+
// changed required validation logic
|
|
1340
|
+
validator.validate = (control) => {
|
|
1341
|
+
if (parentForm && !parentForm.submitted) {
|
|
1342
|
+
return null;
|
|
1343
|
+
}
|
|
1344
|
+
return originalValidate.call(validator, control);
|
|
1345
|
+
};
|
|
1346
|
+
}
|
|
1347
|
+
else {
|
|
1348
|
+
// changed all other validation logic
|
|
1349
|
+
validator.validate = (control) => {
|
|
1350
|
+
if (component.focused) {
|
|
1351
|
+
return null;
|
|
1352
|
+
}
|
|
1353
|
+
return originalValidate.call(validator, control);
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1358
|
+
function setMosaicValidationForFormControl(component, parentForm, ngControl) {
|
|
1359
|
+
const originalValidator = ngControl.control.validator;
|
|
1360
|
+
// changed required validation logic after initialization
|
|
1361
|
+
if (ngControl.invalid && ngControl.errors.required) {
|
|
1362
|
+
Promise.resolve().then(() => setValidState(ngControl.control, originalValidator));
|
|
1363
|
+
}
|
|
1364
|
+
// check dynamic updates
|
|
1365
|
+
ngControl.statusChanges
|
|
1366
|
+
.subscribe(() => {
|
|
1367
|
+
// changed required validation logic
|
|
1368
|
+
if (ngControl.invalid && (parentForm && !parentForm.submitted) && ngControl.errors.required) {
|
|
1369
|
+
setValidState(ngControl.control, originalValidator);
|
|
1370
|
+
}
|
|
1371
|
+
// changed all other validation logic
|
|
1372
|
+
if (ngControl.invalid && component.focused) {
|
|
1373
|
+
setValidState(ngControl.control, originalValidator);
|
|
1374
|
+
}
|
|
1375
|
+
});
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
class McHighlightPipe {
|
|
1379
|
+
transform(value, args) {
|
|
1380
|
+
if (!args) {
|
|
1381
|
+
return value;
|
|
1382
|
+
}
|
|
1383
|
+
return value.replace(new RegExp(`(${args})`, 'gi'), '<mark class="mc-highlight">$1</mark>');
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
/** @nocollapse */ /** @nocollapse */ McHighlightPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McHighlightPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1387
|
+
/** @nocollapse */ /** @nocollapse */ McHighlightPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McHighlightPipe, name: "mcHighlight" });
|
|
1388
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McHighlightPipe, decorators: [{
|
|
1389
|
+
type: Pipe,
|
|
1390
|
+
args: [{ name: 'mcHighlight' }]
|
|
1391
|
+
}] });
|
|
1392
|
+
|
|
1393
|
+
class McHighlightModule {
|
|
1394
|
+
}
|
|
1395
|
+
/** @nocollapse */ /** @nocollapse */ McHighlightModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McHighlightModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1396
|
+
/** @nocollapse */ /** @nocollapse */ McHighlightModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McHighlightModule, declarations: [McHighlightPipe], imports: [CommonModule], exports: [McHighlightPipe] });
|
|
1397
|
+
/** @nocollapse */ /** @nocollapse */ McHighlightModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McHighlightModule, imports: [[CommonModule]] });
|
|
1398
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McHighlightModule, decorators: [{
|
|
1399
|
+
type: NgModule,
|
|
1400
|
+
args: [{
|
|
1401
|
+
imports: [CommonModule],
|
|
1402
|
+
exports: [McHighlightPipe],
|
|
1403
|
+
declarations: [McHighlightPipe]
|
|
1404
|
+
}]
|
|
1405
|
+
}] });
|
|
1406
|
+
|
|
1407
|
+
const selectEvents = 'selectEvents';
|
|
1408
|
+
|
|
1409
|
+
/**
|
|
1410
|
+
* Returns an exception to be thrown when attempting to change a select's `multiple` option
|
|
1411
|
+
* after initialization.
|
|
1412
|
+
* @docs-private
|
|
1413
|
+
*/
|
|
1414
|
+
function getMcSelectDynamicMultipleError() {
|
|
1415
|
+
return Error('Cannot change `multiple` mode of select after initialization.');
|
|
1416
|
+
}
|
|
1417
|
+
/**
|
|
1418
|
+
* Returns an exception to be thrown when attempting to assign a non-array value to a select
|
|
1419
|
+
* in `multiple` mode. Note that `undefined` and `null` are still valid values to allow for
|
|
1420
|
+
* resetting the value.
|
|
1421
|
+
* @docs-private
|
|
1422
|
+
*/
|
|
1423
|
+
function getMcSelectNonArrayValueError() {
|
|
1424
|
+
return Error('Value must be an array in multiple-selection mode.');
|
|
1425
|
+
}
|
|
1426
|
+
/**
|
|
1427
|
+
* Returns an exception to be thrown when assigning a non-function value to the comparator
|
|
1428
|
+
* used to determine if a value corresponds to an option. Note that whether the function
|
|
1429
|
+
* actually takes two values and returns a boolean is not checked.
|
|
1430
|
+
*/
|
|
1431
|
+
function getMcSelectNonFunctionValueError() {
|
|
1432
|
+
return Error('`compareWith` must be a function.');
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
/** The max height of the select's overlay panel */
|
|
1436
|
+
const SELECT_PANEL_MAX_HEIGHT = 224;
|
|
1437
|
+
/** The panel's padding on the x-axis */
|
|
1438
|
+
const SELECT_PANEL_PADDING_X = 1;
|
|
1439
|
+
/** The panel's x axis padding if it is indented (e.g. there is an option group). */
|
|
1440
|
+
/* tslint:disable-next-line:no-magic-numbers */
|
|
1441
|
+
const SELECT_PANEL_INDENT_PADDING_X = SELECT_PANEL_PADDING_X * 2;
|
|
1442
|
+
/**
|
|
1443
|
+
* The select panel will only "fit" inside the viewport if it is positioned at
|
|
1444
|
+
* this value or more away from the viewport boundary.
|
|
1445
|
+
*/
|
|
1446
|
+
const SELECT_PANEL_VIEWPORT_PADDING = 8;
|
|
1447
|
+
/** Injection token that determines the scroll handling while a select is open. */
|
|
1448
|
+
const MC_SELECT_SCROLL_STRATEGY = new InjectionToken('mc-select-scroll-strategy');
|
|
1449
|
+
/** @docs-private */
|
|
1450
|
+
function mcSelectScrollStrategyProviderFactory(overlay) {
|
|
1451
|
+
return () => overlay.scrollStrategies.reposition();
|
|
1452
|
+
}
|
|
1453
|
+
/** @docs-private */
|
|
1454
|
+
const MC_SELECT_SCROLL_STRATEGY_PROVIDER = {
|
|
1455
|
+
provide: MC_SELECT_SCROLL_STRATEGY,
|
|
1456
|
+
deps: [Overlay],
|
|
1457
|
+
useFactory: mcSelectScrollStrategyProviderFactory
|
|
1458
|
+
};
|
|
1459
|
+
|
|
1460
|
+
const POSITION_MAP = {
|
|
1461
|
+
top: {
|
|
1462
|
+
originX: 'center',
|
|
1463
|
+
originY: 'top',
|
|
1464
|
+
overlayX: 'center',
|
|
1465
|
+
overlayY: 'bottom'
|
|
1466
|
+
},
|
|
1467
|
+
topCenter: {
|
|
1468
|
+
originX: 'center',
|
|
1469
|
+
originY: 'top',
|
|
1470
|
+
overlayX: 'center',
|
|
1471
|
+
overlayY: 'bottom'
|
|
1472
|
+
},
|
|
1473
|
+
topLeft: {
|
|
1474
|
+
originX: 'start',
|
|
1475
|
+
originY: 'top',
|
|
1476
|
+
overlayX: 'start',
|
|
1477
|
+
overlayY: 'bottom'
|
|
1478
|
+
},
|
|
1479
|
+
topRight: {
|
|
1480
|
+
originX: 'end',
|
|
1481
|
+
originY: 'top',
|
|
1482
|
+
overlayX: 'end',
|
|
1483
|
+
overlayY: 'bottom'
|
|
1484
|
+
},
|
|
1485
|
+
right: {
|
|
1486
|
+
originX: 'end',
|
|
1487
|
+
originY: 'center',
|
|
1488
|
+
overlayX: 'start',
|
|
1489
|
+
overlayY: 'center'
|
|
1490
|
+
},
|
|
1491
|
+
rightTop: {
|
|
1492
|
+
originX: 'end',
|
|
1493
|
+
originY: 'top',
|
|
1494
|
+
overlayX: 'start',
|
|
1495
|
+
overlayY: 'top'
|
|
1496
|
+
},
|
|
1497
|
+
rightBottom: {
|
|
1498
|
+
originX: 'end',
|
|
1499
|
+
originY: 'bottom',
|
|
1500
|
+
overlayX: 'start',
|
|
1501
|
+
overlayY: 'bottom'
|
|
1502
|
+
},
|
|
1503
|
+
bottom: {
|
|
1504
|
+
originX: 'center',
|
|
1505
|
+
originY: 'bottom',
|
|
1506
|
+
overlayX: 'center',
|
|
1507
|
+
overlayY: 'top'
|
|
1508
|
+
},
|
|
1509
|
+
bottomCenter: {
|
|
1510
|
+
originX: 'center',
|
|
1511
|
+
originY: 'bottom',
|
|
1512
|
+
overlayX: 'center',
|
|
1513
|
+
overlayY: 'top'
|
|
1514
|
+
},
|
|
1515
|
+
bottomLeft: {
|
|
1516
|
+
originX: 'start',
|
|
1517
|
+
originY: 'bottom',
|
|
1518
|
+
overlayX: 'start',
|
|
1519
|
+
overlayY: 'top'
|
|
1520
|
+
},
|
|
1521
|
+
bottomRight: {
|
|
1522
|
+
originX: 'end',
|
|
1523
|
+
originY: 'bottom',
|
|
1524
|
+
overlayX: 'end',
|
|
1525
|
+
overlayY: 'top'
|
|
1526
|
+
},
|
|
1527
|
+
left: {
|
|
1528
|
+
originX: 'start',
|
|
1529
|
+
originY: 'center',
|
|
1530
|
+
overlayX: 'end',
|
|
1531
|
+
overlayY: 'center'
|
|
1532
|
+
},
|
|
1533
|
+
leftTop: {
|
|
1534
|
+
originX: 'start',
|
|
1535
|
+
originY: 'top',
|
|
1536
|
+
overlayX: 'end',
|
|
1537
|
+
overlayY: 'top'
|
|
1538
|
+
},
|
|
1539
|
+
leftBottom: {
|
|
1540
|
+
originX: 'start',
|
|
1541
|
+
originY: 'bottom',
|
|
1542
|
+
overlayX: 'end',
|
|
1543
|
+
overlayY: 'bottom'
|
|
1544
|
+
}
|
|
1545
|
+
};
|
|
1546
|
+
const EXTENDED_OVERLAY_POSITIONS = objectValues([
|
|
1547
|
+
POSITION_MAP.top,
|
|
1548
|
+
POSITION_MAP.topLeft,
|
|
1549
|
+
POSITION_MAP.topRight,
|
|
1550
|
+
POSITION_MAP.right,
|
|
1551
|
+
POSITION_MAP.rightTop,
|
|
1552
|
+
POSITION_MAP.rightBottom,
|
|
1553
|
+
POSITION_MAP.bottom,
|
|
1554
|
+
POSITION_MAP.bottomLeft,
|
|
1555
|
+
POSITION_MAP.bottomRight,
|
|
1556
|
+
POSITION_MAP.left,
|
|
1557
|
+
POSITION_MAP.leftTop,
|
|
1558
|
+
POSITION_MAP.leftBottom
|
|
1559
|
+
]);
|
|
1560
|
+
const TOP_POSITION_PRIORITY = objectValues([
|
|
1561
|
+
POSITION_MAP.top,
|
|
1562
|
+
POSITION_MAP.bottom,
|
|
1563
|
+
POSITION_MAP.rightBottom,
|
|
1564
|
+
POSITION_MAP.leftBottom,
|
|
1565
|
+
POSITION_MAP.bottomLeft,
|
|
1566
|
+
POSITION_MAP.bottomRight
|
|
1567
|
+
]);
|
|
1568
|
+
const BOTTOM_POSITION_PRIORITY = objectValues([
|
|
1569
|
+
POSITION_MAP.bottom,
|
|
1570
|
+
POSITION_MAP.top,
|
|
1571
|
+
POSITION_MAP.topLeft,
|
|
1572
|
+
POSITION_MAP.topRight,
|
|
1573
|
+
POSITION_MAP.rightBottom,
|
|
1574
|
+
POSITION_MAP.leftBottom
|
|
1575
|
+
]);
|
|
1576
|
+
const RIGHT_POSITION_PRIORITY = objectValues([
|
|
1577
|
+
POSITION_MAP.right,
|
|
1578
|
+
POSITION_MAP.left,
|
|
1579
|
+
POSITION_MAP.leftTop,
|
|
1580
|
+
POSITION_MAP.leftBottom,
|
|
1581
|
+
POSITION_MAP.top,
|
|
1582
|
+
POSITION_MAP.bottom
|
|
1583
|
+
]);
|
|
1584
|
+
const LEFT_POSITION_PRIORITY = objectValues([
|
|
1585
|
+
POSITION_MAP.left,
|
|
1586
|
+
POSITION_MAP.right,
|
|
1587
|
+
POSITION_MAP.rightTop,
|
|
1588
|
+
POSITION_MAP.rightBottom,
|
|
1589
|
+
POSITION_MAP.top,
|
|
1590
|
+
POSITION_MAP.bottom
|
|
1591
|
+
]);
|
|
1592
|
+
const RIGHT_TOP_POSITION_PRIORITY = objectValues([
|
|
1593
|
+
POSITION_MAP.rightTop,
|
|
1594
|
+
POSITION_MAP.leftTop,
|
|
1595
|
+
POSITION_MAP.left,
|
|
1596
|
+
POSITION_MAP.leftBottom,
|
|
1597
|
+
POSITION_MAP.topLeft,
|
|
1598
|
+
POSITION_MAP.bottomLeft
|
|
1599
|
+
]);
|
|
1600
|
+
const RIGHT_BOTTOM_POSITION_PRIORITY = objectValues([
|
|
1601
|
+
POSITION_MAP.rightBottom,
|
|
1602
|
+
POSITION_MAP.leftBottom,
|
|
1603
|
+
POSITION_MAP.left,
|
|
1604
|
+
POSITION_MAP.leftTop,
|
|
1605
|
+
POSITION_MAP.topLeft,
|
|
1606
|
+
POSITION_MAP.bottomLeft
|
|
1607
|
+
]);
|
|
1608
|
+
const LEFT_TOP_POSITION_PRIORITY = objectValues([
|
|
1609
|
+
POSITION_MAP.leftTop,
|
|
1610
|
+
POSITION_MAP.rightTop,
|
|
1611
|
+
POSITION_MAP.right,
|
|
1612
|
+
POSITION_MAP.rightBottom,
|
|
1613
|
+
POSITION_MAP.topRight,
|
|
1614
|
+
POSITION_MAP.bottomRight
|
|
1615
|
+
]);
|
|
1616
|
+
const LEFT_BOTTOM_POSITION_PRIORITY = objectValues([
|
|
1617
|
+
POSITION_MAP.leftBottom,
|
|
1618
|
+
POSITION_MAP.rightBottom,
|
|
1619
|
+
POSITION_MAP.right,
|
|
1620
|
+
POSITION_MAP.rightTop,
|
|
1621
|
+
POSITION_MAP.topRight,
|
|
1622
|
+
POSITION_MAP.bottomRight
|
|
1623
|
+
]);
|
|
1624
|
+
const TOP_LEFT_POSITION_PRIORITY = objectValues([
|
|
1625
|
+
POSITION_MAP.topLeft,
|
|
1626
|
+
POSITION_MAP.topRight,
|
|
1627
|
+
POSITION_MAP.bottomLeft,
|
|
1628
|
+
POSITION_MAP.bottom,
|
|
1629
|
+
POSITION_MAP.bottomRight,
|
|
1630
|
+
POSITION_MAP.leftBottom,
|
|
1631
|
+
POSITION_MAP.rightBottom
|
|
1632
|
+
]);
|
|
1633
|
+
const TOP_RIGHT_POSITION_PRIORITY = objectValues([
|
|
1634
|
+
POSITION_MAP.topRight,
|
|
1635
|
+
POSITION_MAP.topLeft,
|
|
1636
|
+
POSITION_MAP.bottomRight,
|
|
1637
|
+
POSITION_MAP.bottom,
|
|
1638
|
+
POSITION_MAP.bottomLeft,
|
|
1639
|
+
POSITION_MAP.leftBottom,
|
|
1640
|
+
POSITION_MAP.rightBottom
|
|
1641
|
+
]);
|
|
1642
|
+
const BOTTOM_RIGHT_POSITION_PRIORITY = objectValues([
|
|
1643
|
+
POSITION_MAP.bottomRight,
|
|
1644
|
+
POSITION_MAP.bottomLeft,
|
|
1645
|
+
POSITION_MAP.topRight,
|
|
1646
|
+
POSITION_MAP.top,
|
|
1647
|
+
POSITION_MAP.topLeft,
|
|
1648
|
+
POSITION_MAP.leftTop,
|
|
1649
|
+
POSITION_MAP.rightTop
|
|
1650
|
+
]);
|
|
1651
|
+
const BOTTOM_LEFT_POSITION_PRIORITY = objectValues([
|
|
1652
|
+
POSITION_MAP.bottomLeft,
|
|
1653
|
+
POSITION_MAP.bottomRight,
|
|
1654
|
+
POSITION_MAP.topLeft,
|
|
1655
|
+
POSITION_MAP.top,
|
|
1656
|
+
POSITION_MAP.topRight,
|
|
1657
|
+
POSITION_MAP.rightTop,
|
|
1658
|
+
POSITION_MAP.leftTop
|
|
1659
|
+
]);
|
|
1660
|
+
const POSITION_PRIORITY_STRATEGY = {
|
|
1661
|
+
top: TOP_POSITION_PRIORITY,
|
|
1662
|
+
topLeft: TOP_LEFT_POSITION_PRIORITY,
|
|
1663
|
+
topRight: TOP_RIGHT_POSITION_PRIORITY,
|
|
1664
|
+
bottom: BOTTOM_POSITION_PRIORITY,
|
|
1665
|
+
bottomLeft: BOTTOM_LEFT_POSITION_PRIORITY,
|
|
1666
|
+
bottomRight: BOTTOM_RIGHT_POSITION_PRIORITY,
|
|
1667
|
+
left: LEFT_POSITION_PRIORITY,
|
|
1668
|
+
leftTop: LEFT_TOP_POSITION_PRIORITY,
|
|
1669
|
+
leftBottom: LEFT_BOTTOM_POSITION_PRIORITY,
|
|
1670
|
+
right: RIGHT_POSITION_PRIORITY,
|
|
1671
|
+
rightTop: RIGHT_TOP_POSITION_PRIORITY,
|
|
1672
|
+
rightBottom: RIGHT_BOTTOM_POSITION_PRIORITY
|
|
1673
|
+
};
|
|
1674
|
+
const POSITION_TO_CSS_MAP = {
|
|
1675
|
+
top: 'top',
|
|
1676
|
+
topLeft: 'top-left',
|
|
1677
|
+
topRight: 'top-right',
|
|
1678
|
+
right: 'right',
|
|
1679
|
+
rightTop: 'right-top',
|
|
1680
|
+
rightBottom: 'right-bottom',
|
|
1681
|
+
left: 'left',
|
|
1682
|
+
leftTop: 'left-top',
|
|
1683
|
+
leftBottom: 'left-bottom',
|
|
1684
|
+
bottom: 'bottom',
|
|
1685
|
+
bottomLeft: 'bottom-left',
|
|
1686
|
+
bottomRight: 'bottom-right'
|
|
1687
|
+
};
|
|
1688
|
+
function arrayMap(array, iteratee) {
|
|
1689
|
+
let index = -1;
|
|
1690
|
+
const length = array === null ? 0 : array.length;
|
|
1691
|
+
const result = Array(length);
|
|
1692
|
+
while (++index < length) {
|
|
1693
|
+
result[index] = iteratee(array[index], index, array);
|
|
1694
|
+
}
|
|
1695
|
+
return result;
|
|
1696
|
+
}
|
|
1697
|
+
function baseValues(object, props) {
|
|
1698
|
+
return arrayMap(props, (key) => object[key]);
|
|
1699
|
+
}
|
|
1700
|
+
function objectValues(object) {
|
|
1701
|
+
return object === null ? [] : baseValues(object, Object.keys(object));
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
const fadeAnimation = trigger('fadeAnimation', [
|
|
1705
|
+
state('void', style({ opacity: 0 })),
|
|
1706
|
+
state('true', style({ opacity: 1 })),
|
|
1707
|
+
state('false', style({ opacity: 0 })),
|
|
1708
|
+
transition('* => true', animate('150ms cubic-bezier(0.0, 0.0, 0.2, 1)')),
|
|
1709
|
+
transition('* => void', animate('150ms cubic-bezier(0.4, 0.0, 1, 1)'))
|
|
1710
|
+
]);
|
|
1711
|
+
|
|
1712
|
+
var AnimationCurves;
|
|
1713
|
+
(function (AnimationCurves) {
|
|
1714
|
+
AnimationCurves["StandardCurve"] = "cubic-bezier(0.4,0.0,0.2,1)";
|
|
1715
|
+
AnimationCurves["DecelerationCurve"] = "cubic-bezier(0.0,0.0,0.2,1)";
|
|
1716
|
+
AnimationCurves["AccelerationCurve"] = "cubic-bezier(0.4,0.0,1,1)";
|
|
1717
|
+
AnimationCurves["SharpCurve"] = "cubic-bezier(0.4,0.0,0.6,1)";
|
|
1718
|
+
})(AnimationCurves || (AnimationCurves = {}));
|
|
1719
|
+
|
|
1720
|
+
/**
|
|
1721
|
+
* The following are all the animations for the mc-select component, with each
|
|
1722
|
+
* const containing the metadata for one animation.
|
|
1723
|
+
*
|
|
1724
|
+
*/
|
|
1725
|
+
const mcSelectAnimations = {
|
|
1726
|
+
/**
|
|
1727
|
+
* This animation transforms the select's overlay panel on and off the page.
|
|
1728
|
+
*
|
|
1729
|
+
* When the panel is attached to the DOM, it expands its width by the amount of padding, scales it
|
|
1730
|
+
* up to 100% on the Y axis, fades in its border, and translates slightly up and to the
|
|
1731
|
+
* side to ensure the option text correctly overlaps the trigger text.
|
|
1732
|
+
*
|
|
1733
|
+
* When the panel is removed from the DOM, it simply fades out linearly.
|
|
1734
|
+
*/
|
|
1735
|
+
transformPanel: trigger('transformPanel', [
|
|
1736
|
+
state('void', style({
|
|
1737
|
+
transform: 'scaleY(0)',
|
|
1738
|
+
minWidth: '100%',
|
|
1739
|
+
opacity: 0
|
|
1740
|
+
})),
|
|
1741
|
+
transition('void => *', group([
|
|
1742
|
+
animate('150ms cubic-bezier(0.25, 0.8, 0.25, 1)')
|
|
1743
|
+
])),
|
|
1744
|
+
transition('* => void', [
|
|
1745
|
+
animate('250ms 100ms linear', style({ opacity: 0 }))
|
|
1746
|
+
])
|
|
1747
|
+
]),
|
|
1748
|
+
/**
|
|
1749
|
+
* This animation fades in the background color and text content of the
|
|
1750
|
+
* select's options. It is time delayed to occur 100ms after the overlay
|
|
1751
|
+
* panel has transformed in.
|
|
1752
|
+
*/
|
|
1753
|
+
fadeInContent: trigger('fadeInContent', [
|
|
1754
|
+
state('showing', style({ opacity: 1 })),
|
|
1755
|
+
transition('void => showing', [
|
|
1756
|
+
style({ opacity: 0 }),
|
|
1757
|
+
animate('150ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)')
|
|
1758
|
+
])
|
|
1759
|
+
])
|
|
1760
|
+
};
|
|
1761
|
+
const transformPanel = mcSelectAnimations.transformPanel;
|
|
1762
|
+
const fadeInContent = mcSelectAnimations.fadeInContent;
|
|
1763
|
+
|
|
1764
|
+
/** InjectionToken that can be used to specify the global label options. */
|
|
1765
|
+
const MC_LABEL_GLOBAL_OPTIONS = new InjectionToken('mc-label-global-options');
|
|
1766
|
+
|
|
1767
|
+
var MultipleMode;
|
|
1768
|
+
(function (MultipleMode) {
|
|
1769
|
+
MultipleMode["CHECKBOX"] = "checkbox";
|
|
1770
|
+
MultipleMode["KEYBOARD"] = "keyboard";
|
|
1771
|
+
})(MultipleMode || (MultipleMode = {}));
|
|
1772
|
+
|
|
1773
|
+
/**
|
|
1774
|
+
* Component that shows a simplified checkbox without including any kind of "real" checkbox.
|
|
1775
|
+
* Meant to be used when the checkbox is purely decorative and a large number of them will be
|
|
1776
|
+
* included, such as for the options in a multi-select. Uses no SVGs or complex animations.
|
|
1777
|
+
* Note that theming is meant to be handled by the parent element, e.g.
|
|
1778
|
+
* `mc-primary .mc-pseudo-checkbox`.
|
|
1779
|
+
*
|
|
1780
|
+
* Note that this component will be completely invisible to screen-reader users. This is *not*
|
|
1781
|
+
* interchangeable with `<mc-checkbox>` and should *not* be used if the user would directly
|
|
1782
|
+
* interact with the checkbox. The pseudo-checkbox should only be used as an implementation detail
|
|
1783
|
+
* of more complex components that appropriately handle selected / checked state.
|
|
1784
|
+
* @docs-private
|
|
1785
|
+
*/
|
|
1786
|
+
class McPseudoCheckbox {
|
|
1787
|
+
constructor() {
|
|
1788
|
+
this.state = 'unchecked';
|
|
1789
|
+
this.disabled = false;
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
/** @nocollapse */ /** @nocollapse */ McPseudoCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McPseudoCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1793
|
+
/** @nocollapse */ /** @nocollapse */ McPseudoCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: McPseudoCheckbox, selector: "mc-pseudo-checkbox", inputs: { state: "state", disabled: "disabled" }, host: { properties: { "class.mc-indeterminate": "state === \"indeterminate\"", "class.mc-checked": "state === \"checked\"", "class.mc-disabled": "disabled" }, classAttribute: "mc-pseudo-checkbox" }, ngImport: i0, template: "<i class=\"mc-checkbox-checkmark mc mc-check_16\"></i>\n<i class=\"mc-checkbox-mixedmark mc mc-minus_16\"></i>\n", styles: [".mc-pseudo-checkbox{position:relative;display:inline-block;box-sizing:border-box;width:var(--mc-checkbox-size-width, 16px);height:var(--mc-checkbox-size-width, 16px);border-radius:3px;border-width:var(--mc-checkbox-size-border-width, 1px);border-style:solid;cursor:pointer;vertical-align:middle;flex-shrink:0}.mc-pseudo-checkbox .mc-checkbox-checkmark,.mc-pseudo-checkbox .mc-checkbox-mixedmark{display:none;position:absolute;top:calc(-1 * var(--mc-checkbox-size-border-width, 1px));left:calc(-1 * var(--mc-checkbox-size-border-width, 1px))}.mc-pseudo-checkbox.mc-pseudo-checkbox-checked,.mc-pseudo-checkbox.mc-pseudo-checkbox-indeterminate{border-color:transparent}.mc-pseudo-checkbox.mc-checked .mc-checkbox-checkmark,.mc-pseudo-checkbox.mc-indeterminate .mc-checkbox-mixedmark{display:inline-block}.mc-pseudo-checkbox.mc-disabled{cursor:default}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1794
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McPseudoCheckbox, decorators: [{
|
|
1795
|
+
type: Component,
|
|
1796
|
+
args: [{ selector: 'mc-pseudo-checkbox', host: {
|
|
1797
|
+
class: 'mc-pseudo-checkbox',
|
|
1798
|
+
'[class.mc-indeterminate]': 'state === "indeterminate"',
|
|
1799
|
+
'[class.mc-checked]': 'state === "checked"',
|
|
1800
|
+
'[class.mc-disabled]': 'disabled'
|
|
1801
|
+
}, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<i class=\"mc-checkbox-checkmark mc mc-check_16\"></i>\n<i class=\"mc-checkbox-mixedmark mc mc-minus_16\"></i>\n", styles: [".mc-pseudo-checkbox{position:relative;display:inline-block;box-sizing:border-box;width:var(--mc-checkbox-size-width, 16px);height:var(--mc-checkbox-size-width, 16px);border-radius:3px;border-width:var(--mc-checkbox-size-border-width, 1px);border-style:solid;cursor:pointer;vertical-align:middle;flex-shrink:0}.mc-pseudo-checkbox .mc-checkbox-checkmark,.mc-pseudo-checkbox .mc-checkbox-mixedmark{display:none;position:absolute;top:calc(-1 * var(--mc-checkbox-size-border-width, 1px));left:calc(-1 * var(--mc-checkbox-size-border-width, 1px))}.mc-pseudo-checkbox.mc-pseudo-checkbox-checked,.mc-pseudo-checkbox.mc-pseudo-checkbox-indeterminate{border-color:transparent}.mc-pseudo-checkbox.mc-checked .mc-checkbox-checkmark,.mc-pseudo-checkbox.mc-indeterminate .mc-checkbox-mixedmark{display:inline-block}.mc-pseudo-checkbox.mc-disabled{cursor:default}\n"] }]
|
|
1802
|
+
}], propDecorators: { state: [{
|
|
1803
|
+
type: Input
|
|
1804
|
+
}], disabled: [{
|
|
1805
|
+
type: Input
|
|
1806
|
+
}] } });
|
|
1807
|
+
|
|
1808
|
+
class McPseudoCheckboxModule {
|
|
1809
|
+
}
|
|
1810
|
+
/** @nocollapse */ /** @nocollapse */ McPseudoCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McPseudoCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1811
|
+
/** @nocollapse */ /** @nocollapse */ McPseudoCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McPseudoCheckboxModule, declarations: [McPseudoCheckbox], imports: [CommonModule], exports: [McPseudoCheckbox] });
|
|
1812
|
+
/** @nocollapse */ /** @nocollapse */ McPseudoCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McPseudoCheckboxModule, imports: [[CommonModule]] });
|
|
1813
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McPseudoCheckboxModule, decorators: [{
|
|
1814
|
+
type: NgModule,
|
|
1815
|
+
args: [{
|
|
1816
|
+
imports: [CommonModule],
|
|
1817
|
+
exports: [McPseudoCheckbox],
|
|
1818
|
+
declarations: [McPseudoCheckbox]
|
|
1819
|
+
}]
|
|
1820
|
+
}] });
|
|
1821
|
+
|
|
1822
|
+
class McMeasureScrollbarService {
|
|
1823
|
+
constructor(document) {
|
|
1824
|
+
this.document = document;
|
|
1825
|
+
this.scrollbarMeasure = {
|
|
1826
|
+
position: 'absolute',
|
|
1827
|
+
top: '-9999px',
|
|
1828
|
+
width: '50px',
|
|
1829
|
+
height: '50px',
|
|
1830
|
+
overflow: 'scroll'
|
|
1831
|
+
};
|
|
1832
|
+
this.initScrollBarWidth();
|
|
1833
|
+
}
|
|
1834
|
+
get scrollBarWidth() {
|
|
1835
|
+
if (this._scrollBarWidth) {
|
|
1836
|
+
return this._scrollBarWidth;
|
|
1837
|
+
}
|
|
1838
|
+
this.initScrollBarWidth();
|
|
1839
|
+
return this._scrollBarWidth;
|
|
1840
|
+
}
|
|
1841
|
+
initScrollBarWidth() {
|
|
1842
|
+
const scrollDiv = this.document.createElement('div');
|
|
1843
|
+
// tslint:disable-next-line
|
|
1844
|
+
for (const scrollProp in this.scrollbarMeasure) {
|
|
1845
|
+
if (this.scrollbarMeasure.hasOwnProperty(scrollProp)) {
|
|
1846
|
+
scrollDiv.style[scrollProp] = this.scrollbarMeasure[scrollProp];
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
this.document.body.appendChild(scrollDiv);
|
|
1850
|
+
const width = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
|
1851
|
+
this.document.body.removeChild(scrollDiv);
|
|
1852
|
+
this._scrollBarWidth = width;
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
/** @nocollapse */ /** @nocollapse */ McMeasureScrollbarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McMeasureScrollbarService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1856
|
+
/** @nocollapse */ /** @nocollapse */ McMeasureScrollbarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McMeasureScrollbarService, providedIn: 'root' });
|
|
1857
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McMeasureScrollbarService, decorators: [{
|
|
1858
|
+
type: Injectable,
|
|
1859
|
+
args: [{
|
|
1860
|
+
providedIn: 'root'
|
|
1861
|
+
}]
|
|
1862
|
+
}], ctorParameters: function () {
|
|
1863
|
+
return [{ type: undefined, decorators: [{
|
|
1864
|
+
type: Inject,
|
|
1865
|
+
args: [DOCUMENT]
|
|
1866
|
+
}] }];
|
|
1867
|
+
} });
|
|
1868
|
+
|
|
1869
|
+
/** @docs-private */
|
|
1870
|
+
class McOptgroupBase {
|
|
1871
|
+
}
|
|
1872
|
+
// tslint:disable-next-line: naming-convention
|
|
1873
|
+
const McOptgroupMixinBase = mixinDisabled(McOptgroupBase);
|
|
1874
|
+
let uniqueOptgroupIdCounter = 0;
|
|
1875
|
+
/**
|
|
1876
|
+
* Component that is used to group instances of `mc-option`.
|
|
1877
|
+
*/
|
|
1878
|
+
class McOptgroup extends McOptgroupMixinBase {
|
|
1879
|
+
constructor() {
|
|
1880
|
+
super(...arguments);
|
|
1881
|
+
/** Unique id for the underlying label. */
|
|
1882
|
+
this.labelId = `mc-optgroup-label-${uniqueOptgroupIdCounter++}`;
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1885
|
+
/** @nocollapse */ /** @nocollapse */ McOptgroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McOptgroup, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1886
|
+
/** @nocollapse */ /** @nocollapse */ McOptgroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: McOptgroup, selector: "mc-optgroup", inputs: { disabled: "disabled", label: "label" }, host: { properties: { "class.mc-disabled": "disabled" }, classAttribute: "mc-optgroup" }, exportAs: ["mcOptgroup"], usesInheritance: true, ngImport: i0, template: "<label class=\"mc-optgroup-label\" [id]=\"labelId\">{{ label }}</label>\n<ng-content select=\"mc-option, mc-list-option, ng-container\"></ng-content>\n", styles: [".mc-optgroup-label{padding-left:var(--mc-optgroup-size-padding-left, 17px);-webkit-user-select:none;user-select:none;cursor:default}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1887
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McOptgroup, decorators: [{
|
|
1888
|
+
type: Component,
|
|
1889
|
+
args: [{ selector: 'mc-optgroup', exportAs: 'mcOptgroup', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['disabled'], host: {
|
|
1890
|
+
class: 'mc-optgroup',
|
|
1891
|
+
'[class.mc-disabled]': 'disabled'
|
|
1892
|
+
}, template: "<label class=\"mc-optgroup-label\" [id]=\"labelId\">{{ label }}</label>\n<ng-content select=\"mc-option, mc-list-option, ng-container\"></ng-content>\n", styles: [".mc-optgroup-label{padding-left:var(--mc-optgroup-size-padding-left, 17px);-webkit-user-select:none;user-select:none;cursor:default}\n"] }]
|
|
1893
|
+
}], propDecorators: { label: [{
|
|
1894
|
+
type: Input
|
|
1895
|
+
}] } });
|
|
1896
|
+
|
|
1897
|
+
/**
|
|
1898
|
+
* Option IDs need to be unique across components, so this counter exists outside of
|
|
1899
|
+
* the component definition.
|
|
1900
|
+
*/
|
|
1901
|
+
let uniqueIdCounter = 0;
|
|
1902
|
+
/** Event object emitted by McOption when selected or deselected. */
|
|
1903
|
+
class McOptionSelectionChange {
|
|
1904
|
+
constructor(source, isUserInput = false) {
|
|
1905
|
+
this.source = source;
|
|
1906
|
+
this.isUserInput = isUserInput;
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
/**
|
|
1910
|
+
* Injection token used to provide the parent component to options.
|
|
1911
|
+
*/
|
|
1912
|
+
const MC_OPTION_PARENT_COMPONENT = new InjectionToken('MC_OPTION_PARENT_COMPONENT');
|
|
1913
|
+
/**
|
|
1914
|
+
* Single option inside of a `<mc-select>` element.
|
|
1915
|
+
*/
|
|
1916
|
+
class McOption {
|
|
1917
|
+
constructor(element, changeDetectorRef, parent, group) {
|
|
1918
|
+
this.element = element;
|
|
1919
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
1920
|
+
this.parent = parent;
|
|
1921
|
+
this.group = group;
|
|
1922
|
+
/** Event emitted when the option is selected or deselected. */
|
|
1923
|
+
// tslint:disable-next-line:no-output-on-prefix
|
|
1924
|
+
this.onSelectionChange = new EventEmitter();
|
|
1925
|
+
/** Emits when the state of the option changes and any parents have to be notified. */
|
|
1926
|
+
this.stateChanges = new Subject();
|
|
1927
|
+
this._id = `mc-option-${uniqueIdCounter++}`;
|
|
1928
|
+
this._selected = false;
|
|
1929
|
+
this._disabled = false;
|
|
1930
|
+
this._active = false;
|
|
1931
|
+
this.mostRecentViewValue = '';
|
|
1932
|
+
}
|
|
1933
|
+
get showCheckbox() {
|
|
1934
|
+
return this._showCheckbox === undefined ? this.multiple : this._showCheckbox;
|
|
1935
|
+
}
|
|
1936
|
+
set showCheckbox(value) {
|
|
1937
|
+
this._showCheckbox = coerceBooleanProperty(value);
|
|
1938
|
+
}
|
|
1939
|
+
/**
|
|
1940
|
+
* The displayed value of the option. It is necessary to show the selected option in the
|
|
1941
|
+
* select's trigger.
|
|
1942
|
+
*/
|
|
1943
|
+
get viewValue() {
|
|
1944
|
+
// TODO: Add input property alternative for node envs.
|
|
1945
|
+
return (this.getHostElement().textContent || '').trim();
|
|
1946
|
+
}
|
|
1947
|
+
/** Whether the wrapping component is in multiple selection mode. */
|
|
1948
|
+
get multiple() {
|
|
1949
|
+
return this.parent && this.parent.multiple;
|
|
1950
|
+
}
|
|
1951
|
+
get id() {
|
|
1952
|
+
return this._id;
|
|
1953
|
+
}
|
|
1954
|
+
get selected() {
|
|
1955
|
+
return this._selected;
|
|
1956
|
+
}
|
|
1957
|
+
get disabled() {
|
|
1958
|
+
return (this.group && this.group.disabled) || this._disabled;
|
|
1959
|
+
}
|
|
1960
|
+
set disabled(value) {
|
|
1961
|
+
this._disabled = coerceBooleanProperty(value);
|
|
1962
|
+
}
|
|
1963
|
+
/**
|
|
1964
|
+
* Whether or not the option is currently active and ready to be selected.
|
|
1965
|
+
* An active option displays styles as if it is focused, but the
|
|
1966
|
+
* focus is actually retained somewhere else. This comes in handy
|
|
1967
|
+
* for components like autocomplete where focus must remain on the input.
|
|
1968
|
+
*/
|
|
1969
|
+
get active() {
|
|
1970
|
+
return this._active;
|
|
1971
|
+
}
|
|
1972
|
+
ngAfterViewChecked() {
|
|
1973
|
+
// Since parent components could be using the option's label to display the selected values
|
|
1974
|
+
// (e.g. `mc-select`) and they don't have a way of knowing if the option's label has changed
|
|
1975
|
+
// we have to check for changes in the DOM ourselves and dispatch an event. These checks are
|
|
1976
|
+
// relatively cheap, however we still limit them only to selected options in order to avoid
|
|
1977
|
+
// hitting the DOM too often.
|
|
1978
|
+
if (this._selected) {
|
|
1979
|
+
const viewValue = this.viewValue;
|
|
1980
|
+
if (viewValue !== this.mostRecentViewValue) {
|
|
1981
|
+
this.mostRecentViewValue = viewValue;
|
|
1982
|
+
this.stateChanges.next();
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
ngOnDestroy() {
|
|
1987
|
+
this.stateChanges.complete();
|
|
1988
|
+
}
|
|
1989
|
+
getHeight() {
|
|
1990
|
+
// tslint:disable-next-line:naming-convention
|
|
1991
|
+
const DOMRect = this.element.nativeElement.getClientRects()[0];
|
|
1992
|
+
return DOMRect ? DOMRect.height : 0;
|
|
1993
|
+
}
|
|
1994
|
+
select() {
|
|
1995
|
+
if (!this._selected) {
|
|
1996
|
+
this._selected = true;
|
|
1997
|
+
this.changeDetectorRef.markForCheck();
|
|
1998
|
+
this.emitSelectionChangeEvent();
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
deselect() {
|
|
2002
|
+
if (this._selected) {
|
|
2003
|
+
this._selected = false;
|
|
2004
|
+
this.changeDetectorRef.markForCheck();
|
|
2005
|
+
this.emitSelectionChangeEvent();
|
|
2006
|
+
}
|
|
2007
|
+
}
|
|
2008
|
+
focus() {
|
|
2009
|
+
const element = this.getHostElement();
|
|
2010
|
+
if (typeof element.focus === 'function') {
|
|
2011
|
+
element.focus();
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
/**
|
|
2015
|
+
* This method sets display styles on the option to make it appear
|
|
2016
|
+
* active. This is used by the ActiveDescendantKeyManager so key
|
|
2017
|
+
* events will display the proper options as active on arrow key events.
|
|
2018
|
+
*/
|
|
2019
|
+
setActiveStyles() {
|
|
2020
|
+
if (!this._active) {
|
|
2021
|
+
this._active = true;
|
|
2022
|
+
this.changeDetectorRef.markForCheck();
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
/**
|
|
2026
|
+
* This method removes display styles on the option that made it appear
|
|
2027
|
+
* active. This is used by the ActiveDescendantKeyManager so key
|
|
2028
|
+
* events will display the proper options as active on arrow key events.
|
|
2029
|
+
*/
|
|
2030
|
+
setInactiveStyles() {
|
|
2031
|
+
if (this._active) {
|
|
2032
|
+
this._active = false;
|
|
2033
|
+
this.changeDetectorRef.markForCheck();
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
/** Gets the label to be used when determining whether the option should be focused. */
|
|
2037
|
+
getLabel() {
|
|
2038
|
+
return this.viewValue;
|
|
2039
|
+
}
|
|
2040
|
+
/** Ensures the option is selected when activated from the keyboard. */
|
|
2041
|
+
handleKeydown(event) {
|
|
2042
|
+
// tslint:disable-next-line
|
|
2043
|
+
if (event.keyCode === ENTER || event.keyCode === SPACE) {
|
|
2044
|
+
this.selectViaInteraction();
|
|
2045
|
+
// Prevent the page from scrolling down and form submits.
|
|
2046
|
+
event.preventDefault();
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
/**
|
|
2050
|
+
* `Selects the option while indicating the selection came from the user. Used to
|
|
2051
|
+
* determine if the select's view -> model callback should be invoked.`
|
|
2052
|
+
*/
|
|
2053
|
+
selectViaInteraction() {
|
|
2054
|
+
if (!this.disabled) {
|
|
2055
|
+
this._selected = this.multiple ? !this._selected : true;
|
|
2056
|
+
this.changeDetectorRef.markForCheck();
|
|
2057
|
+
this.emitSelectionChangeEvent(true);
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
getTabIndex() {
|
|
2061
|
+
return this.disabled ? '-1' : '0';
|
|
2062
|
+
}
|
|
2063
|
+
getHostElement() {
|
|
2064
|
+
return this.element.nativeElement;
|
|
2065
|
+
}
|
|
2066
|
+
/** Emits the selection change event. */
|
|
2067
|
+
emitSelectionChangeEvent(isUserInput = false) {
|
|
2068
|
+
this.onSelectionChange.emit(new McOptionSelectionChange(this, isUserInput));
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
/** @nocollapse */ /** @nocollapse */ McOption.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McOption, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: MC_OPTION_PARENT_COMPONENT, optional: true }, { token: McOptgroup, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
2072
|
+
/** @nocollapse */ /** @nocollapse */ McOption.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: McOption, selector: "mc-option", inputs: { value: "value", showCheckbox: "showCheckbox", disabled: "disabled" }, outputs: { onSelectionChange: "onSelectionChange" }, host: { listeners: { "click": "selectViaInteraction()", "keydown": "handleKeydown($event)" }, properties: { "attr.tabindex": "getTabIndex()", "class.mc-selected": "selected", "class.mc-option-multiple": "multiple", "class.mc-active": "active", "class.mc-disabled": "disabled", "id": "id" }, classAttribute: "mc-option" }, exportAs: ["mcOption"], ngImport: i0, template: "<mc-pseudo-checkbox\n *ngIf=\"showCheckbox\"\n [state]=\"selected ? 'checked' : 'unchecked'\"\n [disabled]=\"disabled\">\n</mc-pseudo-checkbox>\n\n<span class=\"mc-option-text\"><ng-content></ng-content></span>\n\n<div class=\"mc-option-overlay\"></div>\n", styles: [".mc-option{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;position:relative;max-width:100%;height:var(--mc-option-size-height, 32px);border:var(--mc-option-size-border-width, 2px) solid transparent;cursor:pointer;outline:none;padding-left:var(--mc-option-size-horizontal-padding, 16px);padding-right:var(--mc-option-size-horizontal-padding, 16px);-webkit-tap-highlight-color:transparent}.mc-option.mc-disabled{cursor:default}.mc-option .mc-pseudo-checkbox{margin-right:8px}.mc-option .mc-option-overlay{position:absolute;top:calc(-1 * var(--mc-option-size-border-width, 2px));left:calc(-1 * var(--mc-option-size-border-width, 2px));right:calc(-1 * var(--mc-option-size-border-width, 2px));bottom:calc(-1 * var(--mc-option-size-border-width, 2px));pointer-events:none;border-radius:inherit}.mc-option-text{display:inline-block;flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"], components: [{ type: McPseudoCheckbox, selector: "mc-pseudo-checkbox", inputs: ["state", "disabled"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2073
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McOption, decorators: [{
|
|
2074
|
+
type: Component,
|
|
2075
|
+
args: [{ selector: 'mc-option', exportAs: 'mcOption', host: {
|
|
2076
|
+
'[attr.tabindex]': 'getTabIndex()',
|
|
2077
|
+
class: 'mc-option',
|
|
2078
|
+
'[class.mc-selected]': 'selected',
|
|
2079
|
+
'[class.mc-option-multiple]': 'multiple',
|
|
2080
|
+
'[class.mc-active]': 'active',
|
|
2081
|
+
'[class.mc-disabled]': 'disabled',
|
|
2082
|
+
'[id]': 'id',
|
|
2083
|
+
'(click)': 'selectViaInteraction()',
|
|
2084
|
+
'(keydown)': 'handleKeydown($event)'
|
|
2085
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<mc-pseudo-checkbox\n *ngIf=\"showCheckbox\"\n [state]=\"selected ? 'checked' : 'unchecked'\"\n [disabled]=\"disabled\">\n</mc-pseudo-checkbox>\n\n<span class=\"mc-option-text\"><ng-content></ng-content></span>\n\n<div class=\"mc-option-overlay\"></div>\n", styles: [".mc-option{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;position:relative;max-width:100%;height:var(--mc-option-size-height, 32px);border:var(--mc-option-size-border-width, 2px) solid transparent;cursor:pointer;outline:none;padding-left:var(--mc-option-size-horizontal-padding, 16px);padding-right:var(--mc-option-size-horizontal-padding, 16px);-webkit-tap-highlight-color:transparent}.mc-option.mc-disabled{cursor:default}.mc-option .mc-pseudo-checkbox{margin-right:8px}.mc-option .mc-option-overlay{position:absolute;top:calc(-1 * var(--mc-option-size-border-width, 2px));left:calc(-1 * var(--mc-option-size-border-width, 2px));right:calc(-1 * var(--mc-option-size-border-width, 2px));bottom:calc(-1 * var(--mc-option-size-border-width, 2px));pointer-events:none;border-radius:inherit}.mc-option-text{display:inline-block;flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"] }]
|
|
2086
|
+
}], ctorParameters: function () {
|
|
2087
|
+
return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
2088
|
+
type: Optional
|
|
2089
|
+
}, {
|
|
2090
|
+
type: Inject,
|
|
2091
|
+
args: [MC_OPTION_PARENT_COMPONENT]
|
|
2092
|
+
}] }, { type: McOptgroup, decorators: [{
|
|
2093
|
+
type: Optional
|
|
2094
|
+
}] }];
|
|
2095
|
+
}, propDecorators: { value: [{
|
|
2096
|
+
type: Input
|
|
2097
|
+
}], showCheckbox: [{
|
|
2098
|
+
type: Input
|
|
2099
|
+
}], onSelectionChange: [{
|
|
2100
|
+
type: Output
|
|
2101
|
+
}], disabled: [{
|
|
2102
|
+
type: Input
|
|
2103
|
+
}] } });
|
|
2104
|
+
/**
|
|
2105
|
+
* Counts the amount of option group labels that precede the specified option.
|
|
2106
|
+
* @param optionIndex Index of the option at which to start counting.
|
|
2107
|
+
* @param options Flat list of all of the options.
|
|
2108
|
+
* @param optionGroups Flat list of all of the option groups.
|
|
2109
|
+
* @docs-private
|
|
2110
|
+
*/
|
|
2111
|
+
function countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {
|
|
2112
|
+
if (optionGroups.length) {
|
|
2113
|
+
const optionsArray = options.toArray();
|
|
2114
|
+
const groups = optionGroups.toArray();
|
|
2115
|
+
let groupCounter = 0;
|
|
2116
|
+
for (let i = 0; i < optionIndex + 1; i++) {
|
|
2117
|
+
if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {
|
|
2118
|
+
groupCounter++;
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
return groupCounter;
|
|
2122
|
+
}
|
|
2123
|
+
return 0;
|
|
2124
|
+
}
|
|
2125
|
+
/**
|
|
2126
|
+
* Determines the position to which to scroll a panel in order for an option to be into view.
|
|
2127
|
+
* @param optionIndex Index of the option to be scrolled into the view.
|
|
2128
|
+
* @param optionHeight Height of the options.
|
|
2129
|
+
* @param currentScrollPosition Current scroll position of the panel.
|
|
2130
|
+
* @param panelHeight Height of the panel.
|
|
2131
|
+
* @docs-private
|
|
2132
|
+
*/
|
|
2133
|
+
function getOptionScrollPosition(optionIndex, optionHeight, currentScrollPosition, panelHeight) {
|
|
2134
|
+
const optionOffset = optionIndex * optionHeight;
|
|
2135
|
+
if (optionOffset < currentScrollPosition) {
|
|
2136
|
+
return optionOffset;
|
|
2137
|
+
}
|
|
2138
|
+
if (optionOffset + optionHeight > currentScrollPosition + panelHeight) {
|
|
2139
|
+
return Math.max(0, optionOffset - panelHeight + optionHeight);
|
|
2140
|
+
}
|
|
2141
|
+
return currentScrollPosition;
|
|
2142
|
+
}
|
|
2143
|
+
|
|
2144
|
+
const MC_OPTION_ACTION_PARENT = new InjectionToken('MC_OPTION_ACTION_PARENT');
|
|
2145
|
+
class McOptionActionBase {
|
|
2146
|
+
}
|
|
2147
|
+
// tslint:disable-next-line:naming-convention
|
|
2148
|
+
const McOptionActionMixinBase = mixinTabIndex(mixinDisabled(McOptionActionBase));
|
|
2149
|
+
class McOptionActionComponent extends McOptionActionMixinBase {
|
|
2150
|
+
constructor(elementRef, focusMonitor, option) {
|
|
2151
|
+
super();
|
|
2152
|
+
this.elementRef = elementRef;
|
|
2153
|
+
this.focusMonitor = focusMonitor;
|
|
2154
|
+
this.option = option;
|
|
2155
|
+
this.hasFocus = false;
|
|
2156
|
+
this.destroy = new Subject();
|
|
2157
|
+
this.focusMonitor.monitor(this.elementRef.nativeElement);
|
|
2158
|
+
}
|
|
2159
|
+
get active() {
|
|
2160
|
+
var _a;
|
|
2161
|
+
return this.hasFocus || !!((_a = this.option.dropdownTrigger) === null || _a === void 0 ? void 0 : _a.opened);
|
|
2162
|
+
}
|
|
2163
|
+
ngAfterViewInit() {
|
|
2164
|
+
if (!this.option.dropdownTrigger) {
|
|
2165
|
+
return;
|
|
2166
|
+
}
|
|
2167
|
+
this.option.dropdownTrigger.restoreFocus = false;
|
|
2168
|
+
this.option.dropdownTrigger.dropdownClosed
|
|
2169
|
+
.pipe(takeUntil(this.destroy))
|
|
2170
|
+
.subscribe(() => {
|
|
2171
|
+
this.preventShowingTooltip();
|
|
2172
|
+
const destroyReason = this.option.dropdownTrigger.lastDestroyReason === 'keydown' ?
|
|
2173
|
+
'keyboard' :
|
|
2174
|
+
'program';
|
|
2175
|
+
this.focus(destroyReason);
|
|
2176
|
+
});
|
|
2177
|
+
}
|
|
2178
|
+
ngOnDestroy() {
|
|
2179
|
+
this.destroy.next();
|
|
2180
|
+
this.destroy.complete();
|
|
2181
|
+
this.focusMonitor.stopMonitoring(this.elementRef.nativeElement);
|
|
2182
|
+
}
|
|
2183
|
+
focus(origin, options) {
|
|
2184
|
+
if (this.focusMonitor && origin) {
|
|
2185
|
+
this.focusMonitor.focusVia(this.elementRef.nativeElement, origin, options);
|
|
2186
|
+
}
|
|
2187
|
+
else {
|
|
2188
|
+
this.elementRef.nativeElement.focus();
|
|
2189
|
+
}
|
|
2190
|
+
this.hasFocus = true;
|
|
2191
|
+
}
|
|
2192
|
+
onFocus($event) {
|
|
2193
|
+
$event.stopPropagation();
|
|
2194
|
+
this.hasFocus = true;
|
|
2195
|
+
}
|
|
2196
|
+
onBlur() {
|
|
2197
|
+
this.hasFocus = false;
|
|
2198
|
+
}
|
|
2199
|
+
onClick($event) {
|
|
2200
|
+
$event.stopPropagation();
|
|
2201
|
+
}
|
|
2202
|
+
onKeyDown($event) {
|
|
2203
|
+
if ([SPACE, ENTER].includes($event.keyCode) && this.option.dropdownTrigger) {
|
|
2204
|
+
this.option.dropdownTrigger.openedBy = 'keyboard';
|
|
2205
|
+
this.option.dropdownTrigger.toggle();
|
|
2206
|
+
}
|
|
2207
|
+
else if ($event.shiftKey && $event.keyCode === TAB) {
|
|
2208
|
+
this.hasFocus = false;
|
|
2209
|
+
this.option.focus();
|
|
2210
|
+
}
|
|
2211
|
+
else if ($event.keyCode === TAB) {
|
|
2212
|
+
return;
|
|
2213
|
+
}
|
|
2214
|
+
$event.preventDefault();
|
|
2215
|
+
$event.stopPropagation();
|
|
2216
|
+
}
|
|
2217
|
+
preventShowingTooltip() {
|
|
2218
|
+
if (!this.option.tooltipTrigger) {
|
|
2219
|
+
return;
|
|
2220
|
+
}
|
|
2221
|
+
this.option.tooltipTrigger.disabled = true;
|
|
2222
|
+
setTimeout(() => this.option.tooltipTrigger.disabled = false);
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
/** @nocollapse */ /** @nocollapse */ McOptionActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McOptionActionComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.FocusMonitor }, { token: MC_OPTION_ACTION_PARENT }], target: i0.ɵɵFactoryTarget.Component });
|
|
2226
|
+
/** @nocollapse */ /** @nocollapse */ McOptionActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: McOptionActionComponent, selector: "mc-option-action", inputs: { disabled: "disabled" }, host: { listeners: { "focus": "onFocus($event)", "blur": "onBlur()", "click": "onClick($event)", "keydown": "onKeyDown($event)" }, properties: { "class.mc-expanded": "false", "attr.disabled": "disabled || null", "attr.tabIndex": "-1" }, classAttribute: "mc-option-action" }, queries: [{ propertyName: "customIcon", first: true, predicate: ["customIcon"], descendants: true }], exportAs: ["mcOptionAction"], usesInheritance: true, ngImport: i0, template: `
|
|
2227
|
+
<ng-container [ngSwitch]="!!customIcon">
|
|
2228
|
+
<i class="mc mc-icon mc-ellipsis_16" *ngSwitchCase="false"></i>
|
|
2229
|
+
<ng-content select="[mc-icon]" *ngSwitchCase="true"></ng-content>
|
|
2230
|
+
</ng-container>
|
|
2231
|
+
`, isInline: true, styles: [".mc-option-action{box-sizing:unset;position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-right:-2px;width:28px;height:100%;cursor:pointer;outline:none;border:2px solid transparent;background:transparent}.mc-option-action[disabled]{cursor:default}\n"], directives: [{ type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McOptionActionComponent, decorators: [{
|
|
2233
|
+
type: Component,
|
|
2234
|
+
args: [{ selector: 'mc-option-action', exportAs: 'mcOptionAction', template: `
|
|
2235
|
+
<ng-container [ngSwitch]="!!customIcon">
|
|
2236
|
+
<i class="mc mc-icon mc-ellipsis_16" *ngSwitchCase="false"></i>
|
|
2237
|
+
<ng-content select="[mc-icon]" *ngSwitchCase="true"></ng-content>
|
|
2238
|
+
</ng-container>
|
|
2239
|
+
`, host: {
|
|
2240
|
+
class: 'mc-option-action',
|
|
2241
|
+
'[class.mc-expanded]': 'false',
|
|
2242
|
+
'[attr.disabled]': 'disabled || null',
|
|
2243
|
+
'[attr.tabIndex]': '-1',
|
|
2244
|
+
'(focus)': 'onFocus($event)',
|
|
2245
|
+
'(blur)': 'onBlur()',
|
|
2246
|
+
'(click)': 'onClick($event)',
|
|
2247
|
+
'(keydown)': 'onKeyDown($event)'
|
|
2248
|
+
}, inputs: ['disabled'], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".mc-option-action{box-sizing:unset;position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-right:-2px;width:28px;height:100%;cursor:pointer;outline:none;border:2px solid transparent;background:transparent}.mc-option-action[disabled]{cursor:default}\n"] }]
|
|
2249
|
+
}], ctorParameters: function () {
|
|
2250
|
+
return [{ type: i0.ElementRef }, { type: i1$1.FocusMonitor }, { type: undefined, decorators: [{
|
|
2251
|
+
type: Inject,
|
|
2252
|
+
args: [MC_OPTION_ACTION_PARENT]
|
|
2253
|
+
}] }];
|
|
2254
|
+
}, propDecorators: { customIcon: [{
|
|
2255
|
+
type: ContentChild,
|
|
2256
|
+
args: ['customIcon']
|
|
2257
|
+
}] } });
|
|
2258
|
+
|
|
2259
|
+
class McOptionModule {
|
|
2260
|
+
}
|
|
2261
|
+
/** @nocollapse */ /** @nocollapse */ McOptionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McOptionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2262
|
+
/** @nocollapse */ /** @nocollapse */ McOptionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McOptionModule, declarations: [McOption, McOptgroup, McOptionActionComponent], imports: [CommonModule, McPseudoCheckboxModule], exports: [McOption, McOptgroup, McOptionActionComponent] });
|
|
2263
|
+
/** @nocollapse */ /** @nocollapse */ McOptionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McOptionModule, imports: [[CommonModule, McPseudoCheckboxModule]] });
|
|
2264
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McOptionModule, decorators: [{
|
|
2265
|
+
type: NgModule,
|
|
2266
|
+
args: [{
|
|
2267
|
+
imports: [CommonModule, McPseudoCheckboxModule],
|
|
2268
|
+
declarations: [McOption, McOptgroup, McOptionActionComponent],
|
|
2269
|
+
exports: [McOption, McOptgroup, McOptionActionComponent]
|
|
2270
|
+
}]
|
|
2271
|
+
}] });
|
|
2272
|
+
|
|
2273
|
+
class McFormElement {
|
|
2274
|
+
constructor(element) {
|
|
2275
|
+
this.element = element;
|
|
2276
|
+
this.margin = false;
|
|
2277
|
+
this.isRow = false;
|
|
2278
|
+
this.isFieldSet = false;
|
|
2279
|
+
this.hasLegend = false;
|
|
2280
|
+
this.isHorizontal = false;
|
|
2281
|
+
}
|
|
2282
|
+
ngAfterContentInit() {
|
|
2283
|
+
const classList = this.element.nativeElement.classList;
|
|
2284
|
+
this.isRow = classList.contains('mc-form__row');
|
|
2285
|
+
this.isHorizontal = classList.contains('mc-horizontal');
|
|
2286
|
+
this.isFieldSet = classList.contains('mc-form__fieldset');
|
|
2287
|
+
if (this.isFieldSet && this.element.nativeElement.firstElementChild) {
|
|
2288
|
+
this.hasLegend = this.element.nativeElement.firstElementChild.classList.contains('mc-form__legend');
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
/** @nocollapse */ /** @nocollapse */ McFormElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McFormElement, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2293
|
+
/** @nocollapse */ /** @nocollapse */ McFormElement.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.0", type: McFormElement, selector: ".mc-form__row, .mc-form__fieldset, .mc-form__legend", host: { properties: { "class.mc-form-row_margin": "margin" } }, queries: [{ propertyName: "elements", predicate: McFormElement }], exportAs: ["mcFormElement"], ngImport: i0 });
|
|
2294
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McFormElement, decorators: [{
|
|
2295
|
+
type: Directive,
|
|
2296
|
+
args: [{
|
|
2297
|
+
selector: '.mc-form__row, .mc-form__fieldset, .mc-form__legend',
|
|
2298
|
+
exportAs: 'mcFormElement',
|
|
2299
|
+
host: {
|
|
2300
|
+
'[class.mc-form-row_margin]': 'margin'
|
|
2301
|
+
}
|
|
2302
|
+
}]
|
|
2303
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { elements: [{
|
|
2304
|
+
type: ContentChildren,
|
|
2305
|
+
args: [McFormElement]
|
|
2306
|
+
}] } });
|
|
2307
|
+
class McForm {
|
|
2308
|
+
ngAfterContentInit() {
|
|
2309
|
+
this.handleElements(this.elements);
|
|
2310
|
+
}
|
|
2311
|
+
handleElements(elements) {
|
|
2312
|
+
elements.forEach((element, index) => {
|
|
2313
|
+
const nextElement = elements.get(index + 1);
|
|
2314
|
+
if (element.isFieldSet && !element.isHorizontal) {
|
|
2315
|
+
this.handleElements(element.elements);
|
|
2316
|
+
}
|
|
2317
|
+
element.margin = !!(nextElement && !nextElement.hasLegend);
|
|
2318
|
+
});
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
/** @nocollapse */ /** @nocollapse */ McForm.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McForm, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2322
|
+
/** @nocollapse */ /** @nocollapse */ McForm.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.0", type: McForm, selector: ".mc-form-vertical, .mc-form-horizontal", host: { classAttribute: "mc-form" }, queries: [{ propertyName: "elements", predicate: McFormElement }], exportAs: ["mcForm"], ngImport: i0 });
|
|
2323
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McForm, decorators: [{
|
|
2324
|
+
type: Directive,
|
|
2325
|
+
args: [{
|
|
2326
|
+
selector: '.mc-form-vertical, .mc-form-horizontal',
|
|
2327
|
+
exportAs: 'mcForm',
|
|
2328
|
+
host: {
|
|
2329
|
+
class: 'mc-form'
|
|
2330
|
+
}
|
|
2331
|
+
}]
|
|
2332
|
+
}], propDecorators: { elements: [{
|
|
2333
|
+
type: ContentChildren,
|
|
2334
|
+
args: [McFormElement]
|
|
2335
|
+
}] } });
|
|
2336
|
+
|
|
2337
|
+
class McFormsModule {
|
|
2338
|
+
}
|
|
2339
|
+
/** @nocollapse */ /** @nocollapse */ McFormsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2340
|
+
/** @nocollapse */ /** @nocollapse */ McFormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McFormsModule, declarations: [McForm,
|
|
2341
|
+
McFormElement], exports: [McForm,
|
|
2342
|
+
McFormElement] });
|
|
2343
|
+
/** @nocollapse */ /** @nocollapse */ McFormsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McFormsModule });
|
|
2344
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McFormsModule, decorators: [{
|
|
2345
|
+
type: NgModule,
|
|
2346
|
+
args: [{
|
|
2347
|
+
exports: [
|
|
2348
|
+
McForm,
|
|
2349
|
+
McFormElement
|
|
2350
|
+
],
|
|
2351
|
+
declarations: [
|
|
2352
|
+
McForm,
|
|
2353
|
+
McFormElement
|
|
2354
|
+
]
|
|
2355
|
+
}]
|
|
2356
|
+
}] });
|
|
2357
|
+
|
|
2358
|
+
var PopUpPlacements;
|
|
2359
|
+
(function (PopUpPlacements) {
|
|
2360
|
+
PopUpPlacements["Top"] = "top";
|
|
2361
|
+
PopUpPlacements["TopLeft"] = "topLeft";
|
|
2362
|
+
PopUpPlacements["TopRight"] = "topRight";
|
|
2363
|
+
PopUpPlacements["Right"] = "right";
|
|
2364
|
+
PopUpPlacements["RightTop"] = "rightTop";
|
|
2365
|
+
PopUpPlacements["RightBottom"] = "rightBottom";
|
|
2366
|
+
PopUpPlacements["Left"] = "left";
|
|
2367
|
+
PopUpPlacements["LeftTop"] = "leftTop";
|
|
2368
|
+
PopUpPlacements["LeftBottom"] = "leftBottom";
|
|
2369
|
+
PopUpPlacements["Bottom"] = "bottom";
|
|
2370
|
+
PopUpPlacements["BottomLeft"] = "bottomLeft";
|
|
2371
|
+
PopUpPlacements["BottomRight"] = "bottomRight";
|
|
2372
|
+
})(PopUpPlacements || (PopUpPlacements = {}));
|
|
2373
|
+
var PopUpVisibility;
|
|
2374
|
+
(function (PopUpVisibility) {
|
|
2375
|
+
PopUpVisibility["Initial"] = "initial";
|
|
2376
|
+
PopUpVisibility["Visible"] = "visible";
|
|
2377
|
+
PopUpVisibility["Hidden"] = "hidden";
|
|
2378
|
+
})(PopUpVisibility || (PopUpVisibility = {}));
|
|
2379
|
+
var PopUpTriggers;
|
|
2380
|
+
(function (PopUpTriggers) {
|
|
2381
|
+
PopUpTriggers["Click"] = "click";
|
|
2382
|
+
PopUpTriggers["Focus"] = "focus";
|
|
2383
|
+
PopUpTriggers["Hover"] = "hover";
|
|
2384
|
+
})(PopUpTriggers || (PopUpTriggers = {}));
|
|
2385
|
+
var PopUpSizes;
|
|
2386
|
+
(function (PopUpSizes) {
|
|
2387
|
+
PopUpSizes["Small"] = "small";
|
|
2388
|
+
PopUpSizes["Normal"] = "normal";
|
|
2389
|
+
PopUpSizes["Large"] = "large";
|
|
2390
|
+
})(PopUpSizes || (PopUpSizes = {}));
|
|
2391
|
+
|
|
2392
|
+
// tslint:disable-next-line:naming-convention
|
|
2393
|
+
class McPopUp {
|
|
2394
|
+
constructor(changeDetectorRef) {
|
|
2395
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
2396
|
+
this.classMap = {};
|
|
2397
|
+
this.visibility = PopUpVisibility.Initial;
|
|
2398
|
+
this.visibleChange = new EventEmitter();
|
|
2399
|
+
/** Subject for notifying that the tooltip has been hidden from the view */
|
|
2400
|
+
this.onHideSubject = new Subject();
|
|
2401
|
+
this.closeOnInteraction = false;
|
|
2402
|
+
}
|
|
2403
|
+
ngOnDestroy() {
|
|
2404
|
+
clearTimeout(this.showTimeoutId);
|
|
2405
|
+
clearTimeout(this.hideTimeoutId);
|
|
2406
|
+
this.onHideSubject.complete();
|
|
2407
|
+
}
|
|
2408
|
+
isTemplateRef(value) {
|
|
2409
|
+
return value instanceof TemplateRef;
|
|
2410
|
+
}
|
|
2411
|
+
show(delay) {
|
|
2412
|
+
if (this.hideTimeoutId) {
|
|
2413
|
+
clearTimeout(this.hideTimeoutId);
|
|
2414
|
+
}
|
|
2415
|
+
this.closeOnInteraction = true;
|
|
2416
|
+
this.showTimeoutId = setTimeout(() => {
|
|
2417
|
+
this.showTimeoutId = undefined;
|
|
2418
|
+
this.visibility = PopUpVisibility.Visible;
|
|
2419
|
+
this.visibleChange.emit(true);
|
|
2420
|
+
// Mark for check so if any parent component has set the
|
|
2421
|
+
// ChangeDetectionStrategy to OnPush it will be checked anyways
|
|
2422
|
+
this.markForCheck();
|
|
2423
|
+
}, delay);
|
|
2424
|
+
}
|
|
2425
|
+
hide(delay) {
|
|
2426
|
+
if (this.showTimeoutId) {
|
|
2427
|
+
clearTimeout(this.showTimeoutId);
|
|
2428
|
+
}
|
|
2429
|
+
this.hideTimeoutId = setTimeout(() => {
|
|
2430
|
+
this.hideTimeoutId = undefined;
|
|
2431
|
+
this.visibility = PopUpVisibility.Hidden;
|
|
2432
|
+
this.visibleChange.emit(false);
|
|
2433
|
+
this.onHideSubject.next();
|
|
2434
|
+
// Mark for check so if any parent component has set the
|
|
2435
|
+
// ChangeDetectionStrategy to OnPush it will be checked anyways
|
|
2436
|
+
this.markForCheck();
|
|
2437
|
+
}, delay);
|
|
2438
|
+
}
|
|
2439
|
+
isVisible() {
|
|
2440
|
+
return this.visibility === PopUpVisibility.Visible;
|
|
2441
|
+
}
|
|
2442
|
+
updateClassMap(placement, customClass, classMap) {
|
|
2443
|
+
this.classMap = Object.assign({ [`${this.prefix}_placement-${placement}`]: true, [customClass]: !!customClass }, classMap);
|
|
2444
|
+
}
|
|
2445
|
+
/** Returns an observable that notifies when the tooltip has been hidden from view. */
|
|
2446
|
+
afterHidden() {
|
|
2447
|
+
return this.onHideSubject.asObservable();
|
|
2448
|
+
}
|
|
2449
|
+
markForCheck() {
|
|
2450
|
+
this.changeDetectorRef.markForCheck();
|
|
2451
|
+
}
|
|
2452
|
+
detectChanges() {
|
|
2453
|
+
this.changeDetectorRef.detectChanges();
|
|
2454
|
+
}
|
|
2455
|
+
animationStart() {
|
|
2456
|
+
this.closeOnInteraction = false;
|
|
2457
|
+
}
|
|
2458
|
+
animationDone({ toState }) {
|
|
2459
|
+
if (toState === PopUpVisibility.Hidden && !this.isVisible()) {
|
|
2460
|
+
this.onHideSubject.next();
|
|
2461
|
+
}
|
|
2462
|
+
if (toState === PopUpVisibility.Visible || toState === PopUpVisibility.Hidden) {
|
|
2463
|
+
this.closeOnInteraction = true;
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
handleBodyInteraction() {
|
|
2467
|
+
if (this.closeOnInteraction) {
|
|
2468
|
+
this.hide(0);
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
/** @nocollapse */ /** @nocollapse */ McPopUp.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McPopUp, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2473
|
+
/** @nocollapse */ /** @nocollapse */ McPopUp.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.0", type: McPopUp, ngImport: i0 });
|
|
2474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McPopUp, decorators: [{
|
|
2475
|
+
type: Directive
|
|
2476
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
2477
|
+
|
|
2478
|
+
// tslint:disable-next-line:naming-convention
|
|
2479
|
+
class McPopUpTrigger {
|
|
2480
|
+
constructor(overlay, elementRef, ngZone, scrollDispatcher, hostView, scrollStrategy, direction) {
|
|
2481
|
+
this.overlay = overlay;
|
|
2482
|
+
this.elementRef = elementRef;
|
|
2483
|
+
this.ngZone = ngZone;
|
|
2484
|
+
this.scrollDispatcher = scrollDispatcher;
|
|
2485
|
+
this.hostView = hostView;
|
|
2486
|
+
this.scrollStrategy = scrollStrategy;
|
|
2487
|
+
this.direction = direction;
|
|
2488
|
+
this.isOpen = false;
|
|
2489
|
+
this.enterDelay = 0;
|
|
2490
|
+
this.leaveDelay = 0;
|
|
2491
|
+
this.placement = PopUpPlacements.Top;
|
|
2492
|
+
this.placementPriority = null;
|
|
2493
|
+
this.visible = false;
|
|
2494
|
+
this.listeners = new Map();
|
|
2495
|
+
this.destroyed = new Subject();
|
|
2496
|
+
this.detach = () => {
|
|
2497
|
+
if (this.overlayRef && this.overlayRef.hasAttached()) {
|
|
2498
|
+
this.overlayRef.detach();
|
|
2499
|
+
}
|
|
2500
|
+
this.instance = null;
|
|
2501
|
+
};
|
|
2502
|
+
this.onPositionChange = ($event) => {
|
|
2503
|
+
if (!this.instance) {
|
|
2504
|
+
return;
|
|
2505
|
+
}
|
|
2506
|
+
let newPlacement = this.placement;
|
|
2507
|
+
const { originX, originY, overlayX, overlayY } = $event.connectionPair;
|
|
2508
|
+
Object.keys(this.availablePositions).some((key) => {
|
|
2509
|
+
if (originX === this.availablePositions[key].originX && originY === this.availablePositions[key].originY &&
|
|
2510
|
+
overlayX === this.availablePositions[key].overlayX && overlayY === this.availablePositions[key].overlayY) {
|
|
2511
|
+
newPlacement = key;
|
|
2512
|
+
return true;
|
|
2513
|
+
}
|
|
2514
|
+
return false;
|
|
2515
|
+
});
|
|
2516
|
+
this.placementChange.emit(newPlacement);
|
|
2517
|
+
this.updateClassMap(newPlacement);
|
|
2518
|
+
this.instance.detectChanges();
|
|
2519
|
+
};
|
|
2520
|
+
this.addEventListener = (listener, event) => {
|
|
2521
|
+
this.elementRef.nativeElement.addEventListener(event, listener);
|
|
2522
|
+
};
|
|
2523
|
+
this.removeEventListener = (listener, event) => {
|
|
2524
|
+
this.elementRef.nativeElement.removeEventListener(event, listener);
|
|
2525
|
+
};
|
|
2526
|
+
this.availablePositions = POSITION_MAP;
|
|
2527
|
+
}
|
|
2528
|
+
ngOnInit() {
|
|
2529
|
+
this.initListeners();
|
|
2530
|
+
}
|
|
2531
|
+
ngOnDestroy() {
|
|
2532
|
+
if (this.overlayRef) {
|
|
2533
|
+
this.overlayRef.dispose();
|
|
2534
|
+
}
|
|
2535
|
+
this.listeners.forEach(this.removeEventListener);
|
|
2536
|
+
this.listeners.clear();
|
|
2537
|
+
this.destroyed.next();
|
|
2538
|
+
this.destroyed.complete();
|
|
2539
|
+
}
|
|
2540
|
+
updatePlacement(value) {
|
|
2541
|
+
if (POSITION_TO_CSS_MAP[value]) {
|
|
2542
|
+
this.placement = value;
|
|
2543
|
+
this.updateClassMap();
|
|
2544
|
+
}
|
|
2545
|
+
else {
|
|
2546
|
+
this.placement = PopUpPlacements.Top;
|
|
2547
|
+
console.warn(`Unknown position: ${value}. Will used default position: ${this.placement}`);
|
|
2548
|
+
}
|
|
2549
|
+
if (this.visible) {
|
|
2550
|
+
this.updatePosition();
|
|
2551
|
+
}
|
|
2552
|
+
}
|
|
2553
|
+
updatePlacementPriority(value) {
|
|
2554
|
+
if (value && value.length > 0) {
|
|
2555
|
+
this.placementPriority = value;
|
|
2556
|
+
}
|
|
2557
|
+
else {
|
|
2558
|
+
this.placementPriority = null;
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
updateVisible(externalValue) {
|
|
2562
|
+
const value = coerceBooleanProperty(externalValue);
|
|
2563
|
+
if (this.visible !== value) {
|
|
2564
|
+
this.visible = value;
|
|
2565
|
+
if (value) {
|
|
2566
|
+
this.show();
|
|
2567
|
+
}
|
|
2568
|
+
else {
|
|
2569
|
+
this.hide();
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
handleKeydown(event) {
|
|
2574
|
+
if (this.isOpen && event.keyCode === ESCAPE) { // tslint:disable-line
|
|
2575
|
+
this.hide();
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
handleTouchend() {
|
|
2579
|
+
this.hide();
|
|
2580
|
+
}
|
|
2581
|
+
show(delay = this.enterDelay) {
|
|
2582
|
+
if (this.disabled || this.instance) {
|
|
2583
|
+
return;
|
|
2584
|
+
}
|
|
2585
|
+
this.overlayRef = this.createOverlay();
|
|
2586
|
+
this.detach();
|
|
2587
|
+
this.portal = this.portal || new ComponentPortal(this.getOverlayHandleComponentType(), this.hostView);
|
|
2588
|
+
this.instance = this.overlayRef.attach(this.portal).instance;
|
|
2589
|
+
this.instance.afterHidden()
|
|
2590
|
+
.pipe(takeUntil(this.destroyed))
|
|
2591
|
+
.subscribe(this.detach);
|
|
2592
|
+
this.updateClassMap();
|
|
2593
|
+
this.updateData();
|
|
2594
|
+
this.instance.visibleChange
|
|
2595
|
+
.pipe(takeUntil(this.destroyed), distinctUntilChanged())
|
|
2596
|
+
.subscribe((value) => {
|
|
2597
|
+
this.visible = value;
|
|
2598
|
+
this.visibleChange.emit(value);
|
|
2599
|
+
this.isOpen = value;
|
|
2600
|
+
});
|
|
2601
|
+
this.updatePosition();
|
|
2602
|
+
this.instance.show(delay);
|
|
2603
|
+
}
|
|
2604
|
+
hide(delay = this.leaveDelay) {
|
|
2605
|
+
if (this.instance) {
|
|
2606
|
+
this.instance.hide(delay);
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
/** Create the overlay config and position strategy */
|
|
2610
|
+
createOverlay() {
|
|
2611
|
+
if (this.overlayRef) {
|
|
2612
|
+
return this.overlayRef;
|
|
2613
|
+
}
|
|
2614
|
+
// Create connected position strategy that listens for scroll events to reposition.
|
|
2615
|
+
const strategy = this.overlay
|
|
2616
|
+
.position()
|
|
2617
|
+
.flexibleConnectedTo(this.elementRef)
|
|
2618
|
+
.withTransformOriginOn(this.originSelector)
|
|
2619
|
+
.withFlexibleDimensions(false)
|
|
2620
|
+
.withPositions([...EXTENDED_OVERLAY_POSITIONS])
|
|
2621
|
+
.withScrollableContainers(this.scrollDispatcher.getAncestorScrollContainers(this.elementRef));
|
|
2622
|
+
strategy.positionChanges
|
|
2623
|
+
.pipe(takeUntil(this.destroyed))
|
|
2624
|
+
.subscribe(this.onPositionChange);
|
|
2625
|
+
this.overlayRef = this.overlay.create(Object.assign(Object.assign({}, this.overlayConfig), { direction: this.direction, positionStrategy: strategy, scrollStrategy: this.scrollStrategy() }));
|
|
2626
|
+
this.closingActions()
|
|
2627
|
+
.pipe(takeUntil(this.destroyed))
|
|
2628
|
+
.pipe(delay(0))
|
|
2629
|
+
.subscribe(() => this.hide());
|
|
2630
|
+
this.overlayRef.outsidePointerEvents()
|
|
2631
|
+
.subscribe(() => this.instance.handleBodyInteraction());
|
|
2632
|
+
this.overlayRef.detachments()
|
|
2633
|
+
.pipe(takeUntil(this.destroyed))
|
|
2634
|
+
.subscribe(this.detach);
|
|
2635
|
+
return this.overlayRef;
|
|
2636
|
+
}
|
|
2637
|
+
initListeners() {
|
|
2638
|
+
this.clearListeners();
|
|
2639
|
+
if (this.trigger.includes(PopUpTriggers.Click)) {
|
|
2640
|
+
this.listeners
|
|
2641
|
+
.set('click', () => this.show())
|
|
2642
|
+
.forEach(this.addEventListener);
|
|
2643
|
+
}
|
|
2644
|
+
if (this.trigger.includes(PopUpTriggers.Hover)) {
|
|
2645
|
+
this.listeners
|
|
2646
|
+
.set('mouseenter', () => this.show())
|
|
2647
|
+
.set('mouseleave', () => this.hide())
|
|
2648
|
+
.forEach(this.addEventListener);
|
|
2649
|
+
}
|
|
2650
|
+
if (this.trigger.includes(PopUpTriggers.Focus)) {
|
|
2651
|
+
this.listeners
|
|
2652
|
+
.set('focus', () => this.show())
|
|
2653
|
+
.set('blur', () => this.hide())
|
|
2654
|
+
.forEach(this.addEventListener);
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
/** Updates the position of the current popover. */
|
|
2658
|
+
updatePosition(reapplyPosition = false) {
|
|
2659
|
+
this.overlayRef = this.createOverlay();
|
|
2660
|
+
const position = this.overlayRef.getConfig().positionStrategy
|
|
2661
|
+
.withPositions(this.getPrioritizedPositions())
|
|
2662
|
+
.withPush(true);
|
|
2663
|
+
if (reapplyPosition) {
|
|
2664
|
+
setTimeout(() => position.reapplyLastPosition());
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
getPriorityPlacementStrategy(value) {
|
|
2668
|
+
const result = [];
|
|
2669
|
+
const possiblePositions = Object.keys(this.availablePositions);
|
|
2670
|
+
if (Array.isArray(value)) {
|
|
2671
|
+
value.forEach((position) => {
|
|
2672
|
+
if (possiblePositions.includes(position)) {
|
|
2673
|
+
result.push(this.availablePositions[position]);
|
|
2674
|
+
}
|
|
2675
|
+
});
|
|
2676
|
+
}
|
|
2677
|
+
else if (possiblePositions.includes(value)) {
|
|
2678
|
+
result.push(this.availablePositions[value]);
|
|
2679
|
+
}
|
|
2680
|
+
return result;
|
|
2681
|
+
}
|
|
2682
|
+
getPrioritizedPositions() {
|
|
2683
|
+
if (this.placementPriority) {
|
|
2684
|
+
return this.getPriorityPlacementStrategy(this.placementPriority);
|
|
2685
|
+
}
|
|
2686
|
+
return POSITION_PRIORITY_STRATEGY[this.placement];
|
|
2687
|
+
}
|
|
2688
|
+
clearListeners() {
|
|
2689
|
+
this.listeners.forEach(this.removeEventListener);
|
|
2690
|
+
this.listeners.clear();
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
/** @nocollapse */ /** @nocollapse */ McPopUpTrigger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McPopUpTrigger, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
2694
|
+
/** @nocollapse */ /** @nocollapse */ McPopUpTrigger.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.0", type: McPopUpTrigger, ngImport: i0 });
|
|
2695
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: McPopUpTrigger, decorators: [{
|
|
2696
|
+
type: Directive
|
|
2697
|
+
}], ctorParameters: function () { return [{ type: i1$2.Overlay }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i1$2.ScrollDispatcher }, { type: i0.ViewContainerRef }, { type: undefined }, { type: i2$1.Directionality }]; } });
|
|
2698
|
+
|
|
2699
|
+
/**
|
|
2700
|
+
* Generated bundle index. Do not edit.
|
|
2701
|
+
*/
|
|
2702
|
+
|
|
2703
|
+
export { AnimationCurves, BOTTOM_LEFT_POSITION_PRIORITY, BOTTOM_POSITION_PRIORITY, BOTTOM_RIGHT_POSITION_PRIORITY, DEFAULT_MC_LOCALE_ID, DateFormatter, EXTENDED_OVERLAY_POSITIONS, ErrorStateMatcher, LEFT_BOTTOM_POSITION_PRIORITY, LEFT_POSITION_PRIORITY, LEFT_TOP_POSITION_PRIORITY, MC_LABEL_GLOBAL_OPTIONS, MC_LOCALE_ID, MC_OPTION_ACTION_PARENT, MC_OPTION_PARENT_COMPONENT, MC_SANITY_CHECKS, MC_SELECT_SCROLL_STRATEGY, MC_SELECT_SCROLL_STRATEGY_PROVIDER, MC_VALIDATION, McCommonModule, McDecimalPipe, McForm, McFormElement, McFormattersModule, McFormsModule, McHighlightModule, McHighlightPipe, McLine, McLineModule, McLineSetter, McMeasureScrollbarService, McOptgroup, McOptgroupBase, McOptgroupMixinBase, McOption, McOptionActionBase, McOptionActionComponent, McOptionActionMixinBase, McOptionModule, McOptionSelectionChange, McPopUp, McPopUpTrigger, McPseudoCheckbox, McPseudoCheckboxModule, MultipleMode, NUMBER_FORMAT_REGEXP, POSITION_MAP, POSITION_PRIORITY_STRATEGY, POSITION_TO_CSS_MAP, PopUpPlacements, PopUpSizes, PopUpTriggers, PopUpVisibility, RIGHT_BOTTOM_POSITION_PRIORITY, RIGHT_POSITION_PRIORITY, RIGHT_TOP_POSITION_PRIORITY, SELECT_PANEL_INDENT_PADDING_X, SELECT_PANEL_MAX_HEIGHT, SELECT_PANEL_PADDING_X, SELECT_PANEL_VIEWPORT_PADDING, ShowOnDirtyErrorStateMatcher, TOP_LEFT_POSITION_PRIORITY, TOP_POSITION_PRIORITY, TOP_RIGHT_POSITION_PRIORITY, ThemePalette, VERSION, countGroupLabelsBeforeOption, fadeAnimation, getMcSelectDynamicMultipleError, getMcSelectNonArrayValueError, getMcSelectNonFunctionValueError, getOptionScrollPosition, isBoolean, mcSelectAnimations, mcSelectScrollStrategyProviderFactory, mixinColor, mixinDisabled, mixinErrorState, mixinTabIndex, selectEvents, setMosaicValidation, setMosaicValidationForFormControl, setMosaicValidationForModelControl, toBoolean, validationTooltipHideDelay, validationTooltipShowDelay };
|
|
2704
|
+
//# sourceMappingURL=ptsecurity-mosaic-core.mjs.map
|