@ember-eui/core 12.0.1 → 12.0.2
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/declarations/components/common.d.ts +1 -1
- package/declarations/components/common.d.ts.map +1 -1
- package/declarations/components/eui-accordion.d.ts.map +1 -1
- package/declarations/components/eui-badge.d.ts.map +1 -1
- package/declarations/components/eui-button-group-button.d.ts.map +1 -1
- package/declarations/components/eui-combo-box.d.ts +1 -1
- package/declarations/components/eui-combo-box.d.ts.map +1 -1
- package/declarations/components/eui-described-form-group.d.ts +2 -0
- package/declarations/components/eui-described-form-group.d.ts.map +1 -1
- package/declarations/components/eui-dual-range.d.ts.map +1 -1
- package/declarations/components/eui-header-section-item-button.d.ts.map +1 -1
- package/declarations/components/eui-list-group-item.d.ts.map +1 -1
- package/declarations/components/eui-loading-content.d.ts.map +1 -1
- package/declarations/components/eui-markdown-editor.d.ts.map +1 -1
- package/declarations/components/eui-markdown-format.d.ts.map +1 -1
- package/declarations/components/eui-notification-event-messages.d.ts.map +1 -1
- package/declarations/components/eui-page-header-content.d.ts.map +1 -1
- package/declarations/components/eui-popover.d.ts.map +1 -1
- package/declarations/components/eui-range.d.ts.map +1 -1
- package/declarations/components/eui-super-date-picker/utils/date-utils.d.ts +1 -0
- package/declarations/components/eui-super-date-picker/utils/date-utils.d.ts.map +1 -1
- package/declarations/components/eui-super-date-picker/utils/index.d.ts +1 -0
- package/declarations/components/eui-super-date-picker/utils/index.d.ts.map +1 -1
- package/declarations/components/eui-super-date-picker/utils/pretty-duration.d.ts +1 -0
- package/declarations/components/eui-super-date-picker/utils/pretty-duration.d.ts.map +1 -1
- package/declarations/components/eui-super-date-picker/utils/quick-select.d.ts +1 -0
- package/declarations/components/eui-super-date-picker/utils/quick-select.d.ts.map +1 -1
- package/declarations/components/eui-super-date-picker/utils/time-options.d.ts +1 -0
- package/declarations/components/eui-super-date-picker/utils/time-options.d.ts.map +1 -1
- package/declarations/components/eui-tabbed-content.d.ts.map +1 -1
- package/declarations/utils/common.d.ts +42 -0
- package/declarations/utils/common.d.ts.map +1 -0
- package/dist/_rollupPluginBabelHelpers-9wjJaosZ.js +63 -0
- package/dist/_rollupPluginBabelHelpers-9wjJaosZ.js.map +1 -0
- package/dist/components/common.js +1 -19
- package/dist/components/common.js.map +1 -1
- package/dist/components/eui-accordion.js +9 -9
- package/dist/components/eui-accordion.js.map +1 -1
- package/dist/components/eui-auto-sizer.js +2 -2
- package/dist/components/eui-auto-sizer.js.map +1 -1
- package/dist/components/eui-badge.js +1 -1
- package/dist/components/eui-badge.js.map +1 -1
- package/dist/components/eui-bottom-bar.js +1 -1
- package/dist/components/eui-bottom-bar.js.map +1 -1
- package/dist/components/eui-breadcrumbs.js +2 -2
- package/dist/components/eui-breadcrumbs.js.map +1 -1
- package/dist/components/eui-button-group-button.js +7 -3
- package/dist/components/eui-button-group-button.js.map +1 -1
- package/dist/components/eui-card-select.js +1 -1
- package/dist/components/eui-card-select.js.map +1 -1
- package/dist/components/eui-card.js +2 -2
- package/dist/components/eui-card.js.map +1 -1
- package/dist/components/eui-checkbox.js +1 -1
- package/dist/components/eui-checkbox.js.map +1 -1
- package/dist/components/eui-code-block.js +7 -7
- package/dist/components/eui-code-block.js.map +1 -1
- package/dist/components/eui-code.js +2 -2
- package/dist/components/eui-code.js.map +1 -1
- package/dist/components/eui-collapsible-nav.js +1 -1
- package/dist/components/eui-collapsible-nav.js.map +1 -1
- package/dist/components/eui-combo-box/create-option.js +1 -1
- package/dist/components/eui-combo-box/create-option.js.map +1 -1
- package/dist/components/eui-combo-box/options.js +1 -1
- package/dist/components/eui-combo-box/options.js.map +1 -1
- package/dist/components/eui-combo-box/trigger.js +1 -1
- package/dist/components/eui-combo-box/trigger.js.map +1 -1
- package/dist/components/eui-combo-box-pill.js +1 -1
- package/dist/components/eui-combo-box-pill.js.map +1 -1
- package/dist/components/eui-combo-box.js +9 -11
- package/dist/components/eui-combo-box.js.map +1 -1
- package/dist/components/eui-context-menu-item.js +1 -1
- package/dist/components/eui-context-menu-item.js.map +1 -1
- package/dist/components/eui-copy.js +1 -1
- package/dist/components/eui-copy.js.map +1 -1
- package/dist/components/eui-described-form-group.js +1 -1
- package/dist/components/eui-described-form-group.js.map +1 -1
- package/dist/components/eui-dual-range.js +17 -17
- package/dist/components/eui-dual-range.js.map +1 -1
- package/dist/components/eui-field-number.js +1 -1
- package/dist/components/eui-field-number.js.map +1 -1
- package/dist/components/eui-field-password.js +1 -1
- package/dist/components/eui-field-password.js.map +1 -1
- package/dist/components/eui-field-search.js +3 -3
- package/dist/components/eui-field-search.js.map +1 -1
- package/dist/components/eui-field-text.js +1 -1
- package/dist/components/eui-field-text.js.map +1 -1
- package/dist/components/eui-file-picker.js +6 -6
- package/dist/components/eui-file-picker.js.map +1 -1
- package/dist/components/eui-flyout.js +2 -2
- package/dist/components/eui-flyout.js.map +1 -1
- package/dist/components/eui-global-toast-list.js +4 -4
- package/dist/components/eui-global-toast-list.js.map +1 -1
- package/dist/components/eui-header-links.js +1 -1
- package/dist/components/eui-header-links.js.map +1 -1
- package/dist/components/eui-header-section-item-button.js +3 -3
- package/dist/components/eui-header-section-item-button.js.map +1 -1
- package/dist/components/eui-i18n.js +1 -1
- package/dist/components/eui-i18n.js.map +1 -1
- package/dist/components/eui-icon.js +2 -2
- package/dist/components/eui-icon.js.map +1 -1
- package/dist/components/eui-image.js +2 -2
- package/dist/components/eui-image.js.map +1 -1
- package/dist/components/eui-inner-text.js +2 -2
- package/dist/components/eui-inner-text.js.map +1 -1
- package/dist/components/eui-input-popover.js +9 -9
- package/dist/components/eui-input-popover.js.map +1 -1
- package/dist/components/eui-list-group-item.js +1 -4
- package/dist/components/eui-list-group-item.js.map +1 -1
- package/dist/components/eui-loading-content.js +17 -5
- package/dist/components/eui-loading-content.js.map +1 -1
- package/dist/components/eui-markdown-editor-footer.js +2 -2
- package/dist/components/eui-markdown-editor-footer.js.map +1 -1
- package/dist/components/eui-markdown-editor.js +16 -16
- package/dist/components/eui-markdown-editor.js.map +1 -1
- package/dist/components/eui-markdown-format.js +1 -1
- package/dist/components/eui-markdown-format.js.map +1 -1
- package/dist/components/eui-modal.js +1 -1
- package/dist/components/eui-modal.js.map +1 -1
- package/dist/components/eui-notification-event-messages.js +4 -2
- package/dist/components/eui-notification-event-messages.js.map +1 -1
- package/dist/components/eui-notification-event-meta.js +2 -2
- package/dist/components/eui-notification-event-meta.js.map +1 -1
- package/dist/components/eui-notification-event.js +1 -1
- package/dist/components/eui-notification-event.js.map +1 -1
- package/dist/components/eui-overlay-mask.js +1 -1
- package/dist/components/eui-overlay-mask.js.map +1 -1
- package/dist/components/eui-page-header-content.js +4 -4
- package/dist/components/eui-page-header-content.js.map +1 -1
- package/dist/components/eui-page-template.js +3 -3
- package/dist/components/eui-page-template.js.map +1 -1
- package/dist/components/eui-popover.js +22 -22
- package/dist/components/eui-popover.js.map +1 -1
- package/dist/components/eui-portal.js +1 -1
- package/dist/components/eui-portal.js.map +1 -1
- package/dist/components/eui-radio.js +1 -1
- package/dist/components/eui-radio.js.map +1 -1
- package/dist/components/eui-range-ticks.js +1 -1
- package/dist/components/eui-range-ticks.js.map +1 -1
- package/dist/components/eui-range-track.js +1 -1
- package/dist/components/eui-range-track.js.map +1 -1
- package/dist/components/eui-range.js +15 -15
- package/dist/components/eui-range.js.map +1 -1
- package/dist/components/eui-select.js +1 -1
- package/dist/components/eui-select.js.map +1 -1
- package/dist/components/eui-show-for.js +1 -1
- package/dist/components/eui-show-for.js.map +1 -1
- package/dist/components/eui-side-nav-item.js +1 -1
- package/dist/components/eui-side-nav-item.js.map +1 -1
- package/dist/components/eui-side-nav.js +1 -1
- package/dist/components/eui-side-nav.js.map +1 -1
- package/dist/components/eui-step-horizontal.js +1 -1
- package/dist/components/eui-step-horizontal.js.map +1 -1
- package/dist/components/eui-super-date-picker/date-popover/absolute-tab.js +3 -3
- package/dist/components/eui-super-date-picker/date-popover/absolute-tab.js.map +1 -1
- package/dist/components/eui-super-date-picker/date-popover/datetime-picker.js +8 -8
- package/dist/components/eui-super-date-picker/date-popover/datetime-picker.js.map +1 -1
- package/dist/components/eui-super-date-picker/date-popover/eui-date-popover-button.js +2 -2
- package/dist/components/eui-super-date-picker/date-popover/eui-date-popover-button.js.map +1 -1
- package/dist/components/eui-super-date-picker/date-popover/eui-date-popover-content.js +2 -2
- package/dist/components/eui-super-date-picker/date-popover/eui-date-popover-content.js.map +1 -1
- package/dist/components/eui-super-date-picker/date-popover/relative-tab.js +4 -4
- package/dist/components/eui-super-date-picker/date-popover/relative-tab.js.map +1 -1
- package/dist/components/eui-super-date-picker/eui-quick-select-popover/eui-quick-select.js +4 -4
- package/dist/components/eui-super-date-picker/eui-quick-select-popover/eui-quick-select.js.map +1 -1
- package/dist/components/eui-super-date-picker/eui-quick-select-popover.js +2 -2
- package/dist/components/eui-super-date-picker/eui-quick-select-popover.js.map +1 -1
- package/dist/components/eui-super-date-picker/utils/date-utils.js +1 -1
- package/dist/components/eui-super-date-picker/utils/date-utils.js.map +1 -1
- package/dist/components/eui-super-date-picker/utils/index.js +1 -1
- package/dist/components/eui-super-date-picker/utils/index.js.map +1 -1
- package/dist/components/eui-super-date-picker/utils/pretty-duration.js +1 -1
- package/dist/components/eui-super-date-picker/utils/pretty-duration.js.map +1 -1
- package/dist/components/eui-super-date-picker/utils/quick-select.js +1 -1
- package/dist/components/eui-super-date-picker/utils/quick-select.js.map +1 -1
- package/dist/components/eui-super-date-picker/utils/time-options.js +1 -1
- package/dist/components/eui-super-date-picker/utils/time-options.js.map +1 -1
- package/dist/components/eui-super-date-picker.js +13 -13
- package/dist/components/eui-super-date-picker.js.map +1 -1
- package/dist/components/eui-tabbed-content.js +4 -4
- package/dist/components/eui-tabbed-content.js.map +1 -1
- package/dist/components/eui-text-area.js +1 -1
- package/dist/components/eui-text-area.js.map +1 -1
- package/dist/components/eui-tool-tip.js +9 -9
- package/dist/components/eui-tool-tip.js.map +1 -1
- package/dist/helpers/get-eui-config.js +1 -1
- package/dist/helpers/get-eui-config.js.map +1 -1
- package/dist/helpers/use-state.js +1 -1
- package/dist/helpers/use-state.js.map +1 -1
- package/dist/services/eui-config.js +1 -1
- package/dist/services/eui-config.js.map +1 -1
- package/dist/services/eui-toaster.js +1 -1
- package/dist/services/eui-toaster.js.map +1 -1
- package/package.json +9 -123
- package/dist/_app_/utils/accesibility/accessible-click-keys.js +0 -1
- package/dist/_app_/utils/accesibility/cascading-menu-keys.js +0 -1
- package/dist/_app_/utils/accesibility/combo-box-keys.js +0 -1
- package/dist/_app_/utils/accesibility/index.js +0 -1
- package/dist/_app_/utils/breakpoint.js +0 -1
- package/dist/_app_/utils/browser/browser.js +0 -1
- package/dist/_app_/utils/browser/index.js +0 -1
- package/dist/_app_/utils/code/utils.js +0 -1
- package/dist/_app_/utils/color/color_palette.js +0 -1
- package/dist/_app_/utils/color/eui_palettes.js +0 -1
- package/dist/_app_/utils/color/index.js +0 -1
- package/dist/_app_/utils/copy-to-clipboard.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-accordion.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-avatar.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-badge-group.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-badge.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-beta-badge.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-bottom-bar.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-button-empty.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-button-group-button.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-button-group.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-button-icon.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-button.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-call-out.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-card-select.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-card.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-code-block.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-collapsible-nav-group.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-comment-event.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-comment-timeline-icon.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-context-menu-item.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-described-form-group.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-description-list.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-empty-prompt.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-file-picker.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-flex-grid.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-flex-group.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-flex-item.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-flyout.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-form-control-layout-clear-button.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-form-row.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-global-toast-list.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-header-links.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-header-section-item.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-header-section.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-header.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-health.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-horizontal-rule.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-icon.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-image.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-link.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-list-group-item.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-list-group.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-loading-spinner.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-modal.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-notification-badge.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-page-body.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-page-content-body.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-page-content.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-page-header.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-page-side-bar.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-page.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-panel.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-popover-footer.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-popover-title.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-popover.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-progress-data.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-progress.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-range-highlight.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-range-input.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-range-levels.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-selectable-list-item.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-spacer.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-stat.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-step-number.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-tabs.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-text-align.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-text-area.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-text-color.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-text.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-title.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-toast.js +0 -1
- package/dist/_app_/utils/css-mappings/eui-tool-tip.js +0 -1
- package/dist/_app_/utils/css-mappings/index.js +0 -1
- package/dist/_app_/utils/detect-element-resize.js +0 -1
- package/dist/_app_/utils/index.js +0 -1
- package/dist/_app_/utils/keys.js +0 -1
- package/dist/_app_/utils/markdown/markdown-actions.js +0 -1
- package/dist/_app_/utils/markdown/markdown-modes.js +0 -1
- package/dist/_app_/utils/markdown/markdown-types.js +0 -1
- package/dist/_app_/utils/markdown/plugins/markdown-add-components/index.js +0 -1
- package/dist/_app_/utils/markdown/plugins/markdown-add-components/processor.js +0 -1
- package/dist/_app_/utils/markdown/plugins/markdown-checkbox/index.js +0 -1
- package/dist/_app_/utils/markdown/plugins/markdown-checkbox/parser.js +0 -1
- package/dist/_app_/utils/markdown/plugins/markdown-default-plugins/index.js +0 -1
- package/dist/_app_/utils/markdown/plugins/markdown-default-plugins/parsing-plugins.js +0 -1
- package/dist/_app_/utils/markdown/plugins/markdown-default-plugins/plugins.js +0 -1
- package/dist/_app_/utils/markdown/plugins/markdown-default-plugins/processing-plugins.js +0 -1
- package/dist/_app_/utils/markdown/plugins/markdown-default-plugins/ui-plugins.js +0 -1
- package/dist/_app_/utils/markdown/plugins/markdown-tooltip/index.js +0 -1
- package/dist/_app_/utils/markdown/plugins/markdown-tooltip/parser.js +0 -1
- package/dist/_app_/utils/markdown/plugins/markdown-tooltip/plugin.js +0 -1
- package/dist/_app_/utils/markdown/plugins/to-dom.js +0 -1
- package/dist/_app_/utils/markdown/remark/remark-prismjs.js +0 -1
- package/dist/_app_/utils/maybe-unwrap-proxy.js +0 -1
- package/dist/_app_/utils/number/index.js +0 -1
- package/dist/_app_/utils/number/number.js +0 -1
- package/dist/_app_/utils/popover/index.js +0 -1
- package/dist/_app_/utils/popover/types.js +0 -1
- package/dist/_app_/utils/predicate/common_predicates.js +0 -1
- package/dist/_app_/utils/predicate/index.js +0 -1
- package/dist/_app_/utils/predicate/lodash_predicates.js +0 -1
- package/dist/_app_/utils/range/index.js +0 -1
- package/dist/_app_/utils/timer.js +0 -1
- package/dist/_app_/utils/transition.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-i18n.js","sources":["../../src/components/eui-i18n.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { array } from '@ember/helper';\nimport { inject as service } from '@ember/service';\nimport { ensureSafeComponent } from '@embroider/util';\n\nimport { notEq } from 'ember-truth-helpers';\n\nimport typeOf from '../helpers/type-of.ts';\nimport Render from './eui-i18n/render.gts';\n\nimport type EuiI18n from '../services/eui-i18n';\nimport type { WithBoundArgs } from '@glint/template';\n\ninterface Args {\n tokens?: string[];\n defaults?: string[];\n token?: string;\n default?: string;\n values?: { [key: string]: any };\n i18n?: { mapping: { [key: string]: any }; renderComponent?: typeof Render };\n}\n\nexport interface EuiI18nSignature {\n Args: Args;\n Blocks: {\n default: [WithBoundArgs<typeof Render, 'token'>];\n };\n}\n\nexport default class EuiI18nComponent extends Component<EuiI18nSignature> {\n @service declare euiI18n: EuiI18n;\n\n get lookupToken() {\n const lookupToken = this.euiI18n._lookupToken;\n\n return lookupToken({\n token: this.args.token!,\n i18nMapping: this.args.i18n?.mapping,\n valueDefault: this.args.default!,\n values: this.args.values\n });\n }\n\n get customComponent(): typeof Render | undefined {\n if (!this.args.i18n?.renderComponent) return undefined;\n\n return ensureSafeComponent(this.args.i18n?.renderComponent, this);\n }\n\n <template>\n {{#let this.lookupToken as |result|}}\n {{#if this.customComponent}}\n {{#each\n (if (notEq (typeOf result) \"array\") (array result) result)\n as |token|\n }}\n {{yield (component this.customComponent token=token)}}\n {{/each}}\n {{else}}\n {{#each\n (if (notEq (typeOf result) \"array\") (array result) result)\n as |token|\n }}\n {{yield (component Render token=token)}}\n {{/each}}\n {{/if}}\n {{/let}}\n </template>\n}\n"],"names":["EuiI18nComponent","Component","g","prototype","service","i","void 0","lookupToken","euiI18n","_lookupToken","token","args","i18nMapping","i18n","mapping","valueDefault","default","values","customComponent","renderComponent","undefined","ensureSafeComponent","setComponentTemplate","precompileTemplate","strictMode","scope","notEq","typeOf","array","Render"],"mappings":";;;;;;;;;;;AA6Be,MAAMA,yBAAyBC,SAAU,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,SAAA,EAAA,CACrDC,MAAA,CAAA,CAAA;AAAA;AAAA,EAAA,QAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,SAAA,CAAA,EAAAC,
|
|
1
|
+
{"version":3,"file":"eui-i18n.js","sources":["../../src/components/eui-i18n.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { array } from '@ember/helper';\nimport { inject as service } from '@ember/service';\nimport { ensureSafeComponent } from '@embroider/util';\n\nimport { notEq } from 'ember-truth-helpers';\n\nimport typeOf from '../helpers/type-of.ts';\nimport Render from './eui-i18n/render.gts';\n\nimport type EuiI18n from '../services/eui-i18n';\nimport type { WithBoundArgs } from '@glint/template';\n\ninterface Args {\n tokens?: string[];\n defaults?: string[];\n token?: string;\n default?: string;\n values?: { [key: string]: any };\n i18n?: { mapping: { [key: string]: any }; renderComponent?: typeof Render };\n}\n\nexport interface EuiI18nSignature {\n Args: Args;\n Blocks: {\n default: [WithBoundArgs<typeof Render, 'token'>];\n };\n}\n\nexport default class EuiI18nComponent extends Component<EuiI18nSignature> {\n @service declare euiI18n: EuiI18n;\n\n get lookupToken() {\n const lookupToken = this.euiI18n._lookupToken;\n\n return lookupToken({\n token: this.args.token!,\n i18nMapping: this.args.i18n?.mapping,\n valueDefault: this.args.default!,\n values: this.args.values\n });\n }\n\n get customComponent(): typeof Render | undefined {\n if (!this.args.i18n?.renderComponent) return undefined;\n\n return ensureSafeComponent(this.args.i18n?.renderComponent, this);\n }\n\n <template>\n {{#let this.lookupToken as |result|}}\n {{#if this.customComponent}}\n {{#each\n (if (notEq (typeOf result) \"array\") (array result) result)\n as |token|\n }}\n {{yield (component this.customComponent token=token)}}\n {{/each}}\n {{else}}\n {{#each\n (if (notEq (typeOf result) \"array\") (array result) result)\n as |token|\n }}\n {{yield (component Render token=token)}}\n {{/each}}\n {{/if}}\n {{/let}}\n </template>\n}\n"],"names":["EuiI18nComponent","Component","g","prototype","service","i","void 0","lookupToken","euiI18n","_lookupToken","token","args","i18nMapping","i18n","mapping","valueDefault","default","values","customComponent","renderComponent","undefined","ensureSafeComponent","setComponentTemplate","precompileTemplate","strictMode","scope","notEq","typeOf","array","Render"],"mappings":";;;;;;;;;;;AA6Be,MAAMA,yBAAyBC,SAAU,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,SAAA,EAAA,CACrDC,MAAA,CAAA,CAAA;AAAA;AAAA,EAAA,QAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,SAAA,CAAA,EAAAC,MAAA;EAED,IAAIC,WAAcA,GAAA;AAChB,IAAA,MAAMA,WAAc,GAAA,IAAI,CAACC,OAAO,CAACC,YAAY;AAE7C,IAAA,OAAOF,WAAY,CAAA;AACjBG,MAAAA,KAAA,EAAO,IAAI,CAACC,IAAI,CAACD,KAAK;AACtBE,MAAAA,WAAA,EAAa,IAAI,CAACD,IAAI,CAACE,IAAI,EAAEC,OAAA;AAC7BC,MAAAA,YAAA,EAAc,IAAI,CAACJ,IAAI,CAACK,OAAO;AAC/BC,MAAAA,MAAA,EAAQ,IAAI,CAACN,IAAI,CAACM;AACpB,KAAA,CAAA;AACF;EAEA,IAAIC,eAAAA,GAA6C;IAC/C,IAAI,CAAC,IAAI,CAACP,IAAI,CAACE,IAAI,EAAEM,iBAAiB,OAAOC,SAAA;IAE7C,OAAOC,mBAAA,CAAoB,IAAI,CAACV,IAAI,CAACE,IAAI,EAAEM,iBAAiB,IAAI,CAAA;AAClE;AAEA,EAAA;IAAAG,oBAAA,CAAAC,kBAAA,CAkBA,odAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,KAAA;QAAAC,MAAA;QAAAC,KAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -26,11 +26,11 @@ class EuiIcon extends Component {
|
|
|
26
26
|
static {
|
|
27
27
|
g(this.prototype, "euiConfig", [inject]);
|
|
28
28
|
}
|
|
29
|
-
#euiConfig = (i(this, "euiConfig"),
|
|
29
|
+
#euiConfig = (i(this, "euiConfig"), void 0);
|
|
30
30
|
static {
|
|
31
31
|
g(this.prototype, "size", [argOrDefaultDecorator('m')]);
|
|
32
32
|
}
|
|
33
|
-
#size = (i(this, "size"),
|
|
33
|
+
#size = (i(this, "size"), void 0);
|
|
34
34
|
get useImage() {
|
|
35
35
|
const {
|
|
36
36
|
type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-icon.js","sources":["../../src/components/eui-icon.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { guidFor } from '@ember/object/internals';\nimport { inject as service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\n\nimport svgJar from 'ember-svg-jar/helpers/svg-jar';\nimport { and, not } from 'ember-truth-helpers';\n\nimport { argOrDefaultDecorator } from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport {\n colorToClassMap,\n typeToPathMap\n} from '../utils/css-mappings/eui-icon.ts';\nimport { keysOf } from './common.ts';\n\nimport type EuiConfigService from '../services/eui-config';\nimport type { sizeToClassNameMap } from '../utils/css-mappings/eui-icon.ts';\nimport type { CommonArgs } from './common.ts';\nimport type { ComponentLike } from '@glint/template';\n\nexport const TYPES = keysOf(typeToPathMap);\n\nexport type EuiIconType = keyof typeof typeToPathMap;\n\nexport type IconType = EuiIconType | string | ComponentLike;\n\nexport const COLORS: NamedColor[] = keysOf(colorToClassMap);\n\ntype NamedColor = keyof typeof colorToClassMap;\n\nfunction isNamedColor(name: NamedColor | string): name is NamedColor {\n return Object.prototype.hasOwnProperty.call(colorToClassMap, name);\n}\n\n// We accept arbitrary color strings, which are impossible to type.\ntype IconColor = string | NamedColor;\n\nexport type IconSize = keyof typeof sizeToClassNameMap;\n\nexport type EuiIconArgs = CommonArgs & {\n /**\n * `Enum` is any of the named icons listed in the docs, `string` is usually a URL to an SVG file, and `elementType` is any Ember Icon SVG component\n */\n type: IconType;\n\n /**\n * One of EUI's color palette or a valid CSS color value https://developer.mozilla.org/en-US/docs/Web/CSS/color_value.\n * Note that coloring only works if your SVG is removed of fill attributes.\n */\n color?: IconColor;\n /**\n * Note that every size other than `original` assumes the provided SVG sits on a square viewbox.\n */\n size?: IconSize;\n\n /**\n * If the type is not a named eui icon, render as Svg, not as img.\n */\n useSvg?: boolean;\n\n /**\n * Descriptive title for naming the icon based on its use\n */\n title?: string;\n /**\n * A unique identifier for the title element\n */\n titleId?: string;\n\n tabIndex?: unknown;\n\n /**\n * Its value should be one or more element IDs\n */\n 'aria-labelledby'?: string;\n\n /**\n * Callback when the icon has been loaded & rendered\n */\n onIconLoad?: () => void;\n\n /**\n * When you want to render a component instead of an SVG\n */\n useComponent?: boolean;\n\n /**\n * Classes to pass to the icon\n */\n iconClasses?: string;\n};\n\nexport interface EuiIconSignature {\n Element: HTMLImageElement | Element;\n Args: EuiIconArgs;\n}\n\nfunction isEuiIconType(x: EuiIconArgs['type']): x is EuiIconType {\n return (\n typeof x === 'string' &&\n Object.prototype.hasOwnProperty.call(typeToPathMap, x)\n );\n}\n\nexport default class EuiIcon extends Component<EuiIconSignature> {\n @service declare euiConfig: EuiConfigService;\n\n @argOrDefaultDecorator('m') size!: IconSize;\n\n get useImage(): boolean {\n const { type } = this.args;\n\n return typeof type === 'string' && !isEuiIconType(type) && !this.useSvg;\n }\n\n get useSvg(): boolean {\n return (\n this.args.useSvg ??\n (this.euiConfig.getConfig('euiIcon.useSvg') as boolean) ??\n false\n );\n }\n\n get icon(): IconType | ComponentLike | undefined {\n const { type } = this.args;\n\n if (type === null) {\n return undefined;\n }\n\n //We should probably find a better way to always\n if (isEuiIconType(type)) {\n return this.getEuiIconSvgPath(type);\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n return undefined;\n }\n\n get emptyIcon(): string {\n return this.getEuiIconSvgPath('empty');\n }\n\n getEuiIconSvgPath(type: EuiIconType): string {\n return typeToPathMap[type];\n }\n\n get isAppIcon(): string | boolean {\n const { type } = this.args;\n\n return (\n type &&\n typeof type === 'string' &&\n (/.+App$/.test(type) || /.+Job$/.test(type) || type === 'dataVisualizer')\n );\n }\n\n get appIconHasColor() {\n return this.args.color && this.args.color !== 'default';\n }\n\n get focusable(): string {\n const { tabIndex } = this.args;\n\n return tabIndex == null || tabIndex === -1 ? 'false' : 'true';\n }\n\n get optionalCustomStyles(): ReturnType<typeof htmlSafe> | string {\n const { color } = this.args;\n\n if (color && typeof color === 'string') {\n if (!isNamedColor(color)) {\n return htmlSafe(`fill: ${color}`);\n }\n }\n\n return '';\n }\n\n get optionalColorClass(): NamedColor | string {\n const { color } = this.args;\n\n if (color && typeof color === 'string') {\n if (isNamedColor(color)) {\n return colorToClassMap[color];\n } else {\n return 'euiIcon--customColor';\n }\n }\n\n return '';\n }\n\n // If it's an empty icon, or if there is no aria-label, aria-labelledby, or title it gets aria-hidden true\n get isAriaHidden(): boolean {\n const { icon } = this;\n\n return (\n icon === 'empty' ||\n !(this.args['aria-label'], this.args['aria-labelledby'], this.args.title)\n );\n }\n\n get titleId(): string | undefined {\n const { title } = this.args;\n let titleId;\n\n // If no aria-label or aria-labelledby is provided but there's a title, a titleId is generated\n // The svg aria-labelledby attribute gets this titleId\n // The svg title element gets this titleId as an id\n if (!this.args['aria-label'] && !this.args['aria-labelledby'] && title) {\n titleId = guidFor({});\n }\n\n return titleId;\n }\n\n get iconAsString(): string | undefined {\n if (this.icon) {\n return this.icon as any as string;\n }\n\n return undefined;\n }\n\n <template>\n {{#if @useComponent}}\n {{!@glint-expect-error}}\n {{#let (component @type) as |IconComponent|}}\n {{!template-lint-disable}}\n <IconComponent\n class={{classNames\n @iconClasses\n this.optionalColorClass\n (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\")\n componentName=\"EuiIcon\"\n size=this.size\n }}\n role=\"image\"\n aria-hidden={{if this.isAriaHidden \"true\"}}\n aria-label={{if @aria-label @aria-label this.titleId}}\n aria-labelledby={{if @aria-labelledby @aria-labelledby this.titleId}}\n {{! @glint-expect-error }}\n tabindex={{@tabIndex}}\n style={{this.optionalCustomStyles}}\n color={{@color}}\n ...attributes\n />\n {{/let}}\n {{else}}\n {{#if this.useImage}}\n <img\n {{! @glint-expect-error }}\n src={{this.icon}}\n class={{classNames\n @iconClasses\n this.optionalColorClass\n (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\")\n componentName=\"EuiIcon\"\n size=this.size\n }}\n color={{@color}}\n alt={{if @title @title}}\n {{! @glint-expect-error }}\n tabIndex={{@tabIndex}}\n ...attributes\n />\n {{else}}\n {{#if this.iconAsString}}\n {{svgJar\n this.iconAsString\n class=(classNames\n @iconClasses\n this.optionalColorClass\n (if\n (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\"\n )\n componentName=\"EuiIcon\"\n size=this.size\n )\n color=@color\n role=\"image\"\n aria-hidden=(if this.isAriaHidden \"true\")\n aria-label=(if @aria-label @aria-label this.titleId)\n aria-labelledby=(if @aria-labelledby @aria-labelledby this.titleId)\n tabindex=@tabIndex\n style=this.optionalCustomStyles\n }}\n {{/if}}\n {{/if}}\n {{/if}}\n </template>\n}\n"],"names":["TYPES","keysOf","typeToPathMap","COLORS","colorToClassMap","isNamedColor","name","Object","prototype","hasOwnProperty","call","isEuiIconType","x","EuiIcon","Component","g","service","i","void 0","argOrDefaultDecorator","useImage","type","args","useSvg","euiConfig","getConfig","icon","undefined","getEuiIconSvgPath","emptyIcon","isAppIcon","test","appIconHasColor","color","focusable","tabIndex","optionalCustomStyles","htmlSafe","optionalColorClass","isAriaHidden","title","titleId","guidFor","iconAsString","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","and","not","svgJar"],"mappings":";;;;;;;;;;;;;;MAqBaA,KAAQ,GAAAC,MAAA,CAAOC,aAAe;MAM9BC,MAAuB,GAAAF,MAAA,CAAOG,eAAiB;AAI5D,SAASC,YAAaA,CAAAC,IAAyB,EAAW;EACxD,OAAOC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACN,eAAiB,EAAAE,IAAA,CAAA;AAC/D;AAEA;;AA+DA,S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Aa4B,KAAQ,CAAA,EAAA;QACvB,OAAO7B,eAAe,CAAC6B,KAAM,CAAA;AAC/B,OAAO,MAAA;AACL,QAAA,OAAO,sBAAA;AACT;AACF;AAEA,IAAA,OAAO,EAAA;AACT;AAEA;EACA,IAAIM,YAAAA,GAAwB;IAC1B,MAAM;AAAEb,MAAAA;AAAM,KAAA,GAAG,IAAI;IAErB,OACEA,SAAS,OACT,IAAA,EAAE,IAAI,CAACJ,IAAI,CAAC,YAAa,CAAA,EAAE,IAAI,CAACA,IAAI,CAAC,iBAAkB,CAAA,EAAE,IAAI,CAACA,IAAI,CAACkB,KAAK,CAC1E;AACF;EAEA,IAAIC,OAAWA,GAAmB;IAChC,MAAM;AAAED,MAAAA;KAAO,GAAG,IAAI,CAAClB,IAAI;AAC3B,IAAA,IAAImB,OAAA;AAEJ;AACA;AACA;AACA,IAAA,IAAI,CAAC,IAAI,CAACnB,IAAI,CAAC,YAAa,CAAA,IAAI,CAAC,IAAI,CAACA,IAAI,CAAC,iBAAA,CAAkB,IAAIkB,KAAO,EAAA;AACtEC,MAAAA,OAAA,GAAUC,QAAQ,EAAC,CAAA;AACrB;AAEA,IAAA,OAAOD,OAAA;AACT;EAEA,IAAIE,YAAgBA,GAAmB;IACrC,IAAI,IAAI,CAACjB,IAAI,EAAE;MACb,OAAO,IAAI,CAACA,IAAI;AAClB;AAEA,IAAA,OAAOC,SAAA;AACT;AAEA,EAAA;IAAAiB,oBAAA,CAAAC,kBAAA,CAkEA,glDAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,UAAA;QAAAC,GAAA;QAAAC,GAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
1
|
+
{"version":3,"file":"eui-icon.js","sources":["../../src/components/eui-icon.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { guidFor } from '@ember/object/internals';\nimport { inject as service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\n\nimport svgJar from 'ember-svg-jar/helpers/svg-jar';\nimport { and, not } from 'ember-truth-helpers';\n\nimport { argOrDefaultDecorator } from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport {\n colorToClassMap,\n typeToPathMap\n} from '../utils/css-mappings/eui-icon.ts';\nimport { keysOf } from './common.ts';\n\nimport type EuiConfigService from '../services/eui-config';\nimport type { sizeToClassNameMap } from '../utils/css-mappings/eui-icon.ts';\nimport type { CommonArgs } from './common.ts';\nimport type { ComponentLike } from '@glint/template';\n\nexport const TYPES = keysOf(typeToPathMap);\n\nexport type EuiIconType = keyof typeof typeToPathMap;\n\nexport type IconType = EuiIconType | string | ComponentLike;\n\nexport const COLORS: NamedColor[] = keysOf(colorToClassMap);\n\ntype NamedColor = keyof typeof colorToClassMap;\n\nfunction isNamedColor(name: NamedColor | string): name is NamedColor {\n return Object.prototype.hasOwnProperty.call(colorToClassMap, name);\n}\n\n// We accept arbitrary color strings, which are impossible to type.\ntype IconColor = string | NamedColor;\n\nexport type IconSize = keyof typeof sizeToClassNameMap;\n\nexport type EuiIconArgs = CommonArgs & {\n /**\n * `Enum` is any of the named icons listed in the docs, `string` is usually a URL to an SVG file, and `elementType` is any Ember Icon SVG component\n */\n type: IconType;\n\n /**\n * One of EUI's color palette or a valid CSS color value https://developer.mozilla.org/en-US/docs/Web/CSS/color_value.\n * Note that coloring only works if your SVG is removed of fill attributes.\n */\n color?: IconColor;\n /**\n * Note that every size other than `original` assumes the provided SVG sits on a square viewbox.\n */\n size?: IconSize;\n\n /**\n * If the type is not a named eui icon, render as Svg, not as img.\n */\n useSvg?: boolean;\n\n /**\n * Descriptive title for naming the icon based on its use\n */\n title?: string;\n /**\n * A unique identifier for the title element\n */\n titleId?: string;\n\n tabIndex?: unknown;\n\n /**\n * Its value should be one or more element IDs\n */\n 'aria-labelledby'?: string;\n\n /**\n * Callback when the icon has been loaded & rendered\n */\n onIconLoad?: () => void;\n\n /**\n * When you want to render a component instead of an SVG\n */\n useComponent?: boolean;\n\n /**\n * Classes to pass to the icon\n */\n iconClasses?: string;\n};\n\nexport interface EuiIconSignature {\n Element: HTMLImageElement | Element;\n Args: EuiIconArgs;\n}\n\nfunction isEuiIconType(x: EuiIconArgs['type']): x is EuiIconType {\n return (\n typeof x === 'string' &&\n Object.prototype.hasOwnProperty.call(typeToPathMap, x)\n );\n}\n\nexport default class EuiIcon extends Component<EuiIconSignature> {\n @service declare euiConfig: EuiConfigService;\n\n @argOrDefaultDecorator('m') size!: IconSize;\n\n get useImage(): boolean {\n const { type } = this.args;\n\n return typeof type === 'string' && !isEuiIconType(type) && !this.useSvg;\n }\n\n get useSvg(): boolean {\n return (\n this.args.useSvg ??\n (this.euiConfig.getConfig('euiIcon.useSvg') as boolean) ??\n false\n );\n }\n\n get icon(): IconType | ComponentLike | undefined {\n const { type } = this.args;\n\n if (type === null) {\n return undefined;\n }\n\n //We should probably find a better way to always\n if (isEuiIconType(type)) {\n return this.getEuiIconSvgPath(type);\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n return undefined;\n }\n\n get emptyIcon(): string {\n return this.getEuiIconSvgPath('empty');\n }\n\n getEuiIconSvgPath(type: EuiIconType): string {\n return typeToPathMap[type];\n }\n\n get isAppIcon(): string | boolean {\n const { type } = this.args;\n\n return (\n type &&\n typeof type === 'string' &&\n (/.+App$/.test(type) || /.+Job$/.test(type) || type === 'dataVisualizer')\n );\n }\n\n get appIconHasColor() {\n return this.args.color && this.args.color !== 'default';\n }\n\n get focusable(): string {\n const { tabIndex } = this.args;\n\n return tabIndex == null || tabIndex === -1 ? 'false' : 'true';\n }\n\n get optionalCustomStyles(): ReturnType<typeof htmlSafe> | string {\n const { color } = this.args;\n\n if (color && typeof color === 'string') {\n if (!isNamedColor(color)) {\n return htmlSafe(`fill: ${color}`);\n }\n }\n\n return '';\n }\n\n get optionalColorClass(): NamedColor | string {\n const { color } = this.args;\n\n if (color && typeof color === 'string') {\n if (isNamedColor(color)) {\n return colorToClassMap[color];\n } else {\n return 'euiIcon--customColor';\n }\n }\n\n return '';\n }\n\n // If it's an empty icon, or if there is no aria-label, aria-labelledby, or title it gets aria-hidden true\n get isAriaHidden(): boolean {\n const { icon } = this;\n\n return (\n icon === 'empty' ||\n !(this.args['aria-label'], this.args['aria-labelledby'], this.args.title)\n );\n }\n\n get titleId(): string | undefined {\n const { title } = this.args;\n let titleId;\n\n // If no aria-label or aria-labelledby is provided but there's a title, a titleId is generated\n // The svg aria-labelledby attribute gets this titleId\n // The svg title element gets this titleId as an id\n if (!this.args['aria-label'] && !this.args['aria-labelledby'] && title) {\n titleId = guidFor({});\n }\n\n return titleId;\n }\n\n get iconAsString(): string | undefined {\n if (this.icon) {\n return this.icon as any as string;\n }\n\n return undefined;\n }\n\n <template>\n {{#if @useComponent}}\n {{!@glint-expect-error}}\n {{#let (component @type) as |IconComponent|}}\n {{!template-lint-disable}}\n <IconComponent\n class={{classNames\n @iconClasses\n this.optionalColorClass\n (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\")\n componentName=\"EuiIcon\"\n size=this.size\n }}\n role=\"image\"\n aria-hidden={{if this.isAriaHidden \"true\"}}\n aria-label={{if @aria-label @aria-label this.titleId}}\n aria-labelledby={{if @aria-labelledby @aria-labelledby this.titleId}}\n {{! @glint-expect-error }}\n tabindex={{@tabIndex}}\n style={{this.optionalCustomStyles}}\n color={{@color}}\n ...attributes\n />\n {{/let}}\n {{else}}\n {{#if this.useImage}}\n <img\n {{! @glint-expect-error }}\n src={{this.icon}}\n class={{classNames\n @iconClasses\n this.optionalColorClass\n (if (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\")\n componentName=\"EuiIcon\"\n size=this.size\n }}\n color={{@color}}\n alt={{if @title @title}}\n {{! @glint-expect-error }}\n tabIndex={{@tabIndex}}\n ...attributes\n />\n {{else}}\n {{#if this.iconAsString}}\n {{svgJar\n this.iconAsString\n class=(classNames\n @iconClasses\n this.optionalColorClass\n (if\n (and this.isAppIcon (not this.appIconHasColor)) \"euiIcon--app\"\n )\n componentName=\"EuiIcon\"\n size=this.size\n )\n color=@color\n role=\"image\"\n aria-hidden=(if this.isAriaHidden \"true\")\n aria-label=(if @aria-label @aria-label this.titleId)\n aria-labelledby=(if @aria-labelledby @aria-labelledby this.titleId)\n tabindex=@tabIndex\n style=this.optionalCustomStyles\n }}\n {{/if}}\n {{/if}}\n {{/if}}\n </template>\n}\n"],"names":["TYPES","keysOf","typeToPathMap","COLORS","colorToClassMap","isNamedColor","name","Object","prototype","hasOwnProperty","call","isEuiIconType","x","EuiIcon","Component","g","service","i","void 0","argOrDefaultDecorator","useImage","type","args","useSvg","euiConfig","getConfig","icon","undefined","getEuiIconSvgPath","emptyIcon","isAppIcon","test","appIconHasColor","color","focusable","tabIndex","optionalCustomStyles","htmlSafe","optionalColorClass","isAriaHidden","title","titleId","guidFor","iconAsString","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","and","not","svgJar"],"mappings":";;;;;;;;;;;;;;MAqBaA,KAAQ,GAAAC,MAAA,CAAOC,aAAe;MAM9BC,MAAuB,GAAAF,MAAA,CAAOG,eAAiB;AAI5D,SAASC,YAAaA,CAAAC,IAAyB,EAAW;EACxD,OAAOC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACN,eAAiB,EAAAE,IAAA,CAAA;AAC/D;AAEA;;AA+DA,SAASK,aAAcA,CAAAC,CAAsB,EAAQ;AACnD,EAAA,OACE,OAAOA,CAAM,KAAA,QAAA,IACbL,MAAO,CAAAC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACR,aAAA,EAAeU,CACtD,CAAA;AACF;AAEe,MAAMC,gBAAgBC,SAAU,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAP,SAAA,EAAA,WAAA,EAAA,CAC5CQ,MAAA,CAAA,CAAA;AAAA;AAAA,EAAA,UAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,WAAA,CA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AAI,CAACA,IAAI,CAACkB,KAAK,CAC1E;AACF;EAEA,IAAIC,OAAWA,GAAmB;IAChC,MAAM;AAAED,MAAAA;KAAO,GAAG,IAAI,CAAClB,IAAI;AAC3B,IAAA,IAAImB,OAAA;AAEJ;AACA;AACA;AACA,IAAA,IAAI,CAAC,IAAI,CAACnB,IAAI,CAAC,YAAa,CAAA,IAAI,CAAC,IAAI,CAACA,IAAI,CAAC,iBAAA,CAAkB,IAAIkB,KAAO,EAAA;AACtEC,MAAAA,OAAA,GAAUC,QAAQ,EAAC,CAAA;AACrB;AAEA,IAAA,OAAOD,OAAA;AACT;EAEA,IAAIE,YAAgBA,GAAmB;IACrC,IAAI,IAAI,CAACjB,IAAI,EAAE;MACb,OAAO,IAAI,CAACA,IAAI;AAClB;AAEA,IAAA,OAAOC,SAAA;AACT;AAEA,EAAA;IAAAiB,oBAAA,CAAAC,kBAAA,CAkEA,glDAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,UAAA;QAAAC,GAAA;QAAAC,GAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -22,11 +22,11 @@ class EuiImage extends Component {
|
|
|
22
22
|
return false;
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
#isFullscreen = (i(this, "isFullscreen"),
|
|
25
|
+
#isFullscreen = (i(this, "isFullscreen"), void 0);
|
|
26
26
|
static {
|
|
27
27
|
g(this.prototype, "size", [argOrDefaultDecorator('original')]);
|
|
28
28
|
}
|
|
29
|
-
#size = (i(this, "size"),
|
|
29
|
+
#size = (i(this, "size"), void 0);
|
|
30
30
|
get sizeClass() {
|
|
31
31
|
return sizeMapping[this.size];
|
|
32
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-image.js","sources":["../../src/components/eui-image.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\nimport { htmlSafe } from '@ember/template';\n\nimport { focusTrap } from 'ember-focus-trap';\nimport onKey from 'ember-keyboard/modifiers/on-key';\nimport { eq, notEq, or } from 'ember-truth-helpers';\n\nimport { argOrDefaultDecorator } from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport { sizeMapping } from '../utils/css-mappings/eui-image.ts';\nimport EuiIcon from './eui-icon.gts';\nimport EuiOverlayMask from './eui-overlay-mask.gts';\n\ntype EuiImageSize = keyof typeof sizeMapping;\n\ntype ImageSize = EuiImageSize | number;\n\ntype FullScreenIconColor = 'light' | 'dark';\n\ntype ImageArgs = {\n /**\n * Separate from the caption is a title on the alt tag itself.\n * This one is required for accessibility.\n */\n alt: string;\n\n /*\n Determines the size of the image itself, can be a number or a string\n Default: 'm'\n */\n size?: ImageSize | number | string;\n\n /**\n * Changes the color of the icon that floats above the image when it can be clicked to fullscreen.\n * The default value of `light` is fine unless your image has a white background, in which case you should change it to `dark`.\n */\n fullScreenIconColor?: FullScreenIconColor;\n\n url: string;\n\n /**\n * Provides the visible caption to the image\n */\n caption?: string;\n /**\n * When set to `true` (default) will apply a slight shadow to the image\n */\n hasShadow?: boolean;\n /**\n * When set to `true` will make the image clickable to a larger version\n */\n allowFullScreen?: boolean;\n\n /**\n * When set to `true` will make the image clickable to a larger version\n */\n float?: 'left' | 'right' | 'none';\n\n /**\n * When set to `true` will make the image clickable to a larger version\n */\n margin?: 'none' | 's' | 'm' | 'l' | 'xl';\n\n /**\n * When set to `true` will make the image clickable to a larger version\n */\n ariaLabel?: string;\n\n src?: string;\n};\n\nexport interface EuiImageSignature {\n Element: HTMLElement;\n Args: ImageArgs;\n Blocks: {\n default: [];\n };\n}\n\nexport default class EuiImage extends Component<ImageArgs> {\n @tracked isFullscreen = false;\n @argOrDefaultDecorator('original') size!: ImageArgs['size'];\n\n get sizeClass(): string | undefined {\n return sizeMapping[this.size as EuiImageSize];\n }\n\n get sizeStyle(): ReturnType<typeof htmlSafe> | string {\n const size = this.args.size;\n\n if (\n (typeof size === 'string' || typeof size === 'number') &&\n !this.sizeClass\n ) {\n return htmlSafe(\n `max-height:${this.args.size}px; max-width:${this.args.size}px; width:auto;`\n );\n }\n\n return '';\n }\n\n @action\n toggleFullscreen(e: Event): void {\n e.stopPropagation();\n e.preventDefault();\n this.isFullscreen = !this.isFullscreen;\n }\n\n get sizeString() {\n if (typeof this.args.size === 'string') {\n return this.args.size;\n }\n }\n\n <template>\n {{#if @allowFullScreen}}\n <figure\n class={{classNames\n \"euiImage--allowFullScreen\"\n (unless (eq @hasShadow false) \"euiImage--hasShadow\")\n float=@float\n margin=@margin\n componentName=\"EuiImage\"\n size=this.sizeString\n }}\n {{!@glint-expect-error}}\n ...attributes\n >\n\n <button\n class=\"euiImage__button\"\n type=\"button\"\n aria-label={{@ariaLabel}}\n {{on \"click\" this.toggleFullscreen}}\n >\n <img\n src={{or @src @url}}\n class=\"euiImage__img\"\n style={{this.sizeStyle}}\n alt={{@alt}}\n />\n <EuiIcon\n @iconClasses=\"euiImage__icon\"\n @type=\"fullScreen\"\n @color={{if (notEq @fullScreenIconColor \"dark\") \"ghost\"}}\n />\n </button>\n\n {{#if @caption}}\n <figcaption class=\"euiImage__caption\">\n {{@caption}}\n </figcaption>\n {{/if}}\n </figure>\n\n {{else}}\n\n <figure\n class={{classNames\n (unless (eq @hasShadow false) \"euiImage--hasShadow\")\n float=@float\n margin=@margin\n componentName=\"EuiImage\"\n size=this.sizeString\n }}\n {{!@glint-expect-error}}\n ...attributes\n >\n\n <img\n src={{or @src @url}}\n class=\"euiImage__img\"\n style={{this.sizeStyle}}\n alt={{@alt}}\n />\n\n {{#if @caption}}\n <figcaption class=\"euiImage__caption\">\n {{@caption}}\n </figcaption>\n {{/if}}\n </figure>\n\n {{/if}}\n\n {{#if this.isFullscreen}}\n <EuiOverlayMask\n @headerZindexLocation=\"above\"\n @onClick={{this.toggleFullscreen}}\n >\n <figure\n class=\"euiImage euiImage-isFullScreen\"\n {{focusTrap focusTrapOptions=(hash clickOutsideDeactivates=true)}}\n >\n <button\n class=\"euiImage__button\"\n type=\"button\"\n {{on \"click\" this.toggleFullscreen}}\n {{onKey \"Escape\" this.toggleFullscreen}}\n >\n <img\n class=\"euiImage-isFullScreen__img\"\n src={{or @src @url}}\n alt={{@alt}}\n />\n </button>\n <figcaption class=\"euiImage__caption\">\n {{@caption}}\n </figcaption>\n </figure>\n <EuiIcon\n @iconClasses=\"euiImage-isFullScreenCloseIcon\"\n @type=\"cross\"\n @color={{if (notEq @fullScreenIconColor \"dark\") \"ghost\"}}\n />\n </EuiOverlayMask>\n {{/if}}\n </template>\n}\n"],"names":["EuiImage","Component","g","prototype","tracked","i","void 0","argOrDefaultDecorator","sizeClass","sizeMapping","size","sizeStyle","args","htmlSafe","toggleFullscreen","e","stopPropagation","preventDefault","isFullscreen","n","action","sizeString","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","eq","on","or","EuiIcon","notEq","EuiOverlayMask","focusTrap","hash","onKey"],"mappings":";;;;;;;;;;;;;;;;;;AAmFe,MAAMA,iBAAiBC,SAAU,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,cAAA,EAAA,CAC7CC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAuB,KAAM;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,aAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,cAAA,CAAA,EAAAC,
|
|
1
|
+
{"version":3,"file":"eui-image.js","sources":["../../src/components/eui-image.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\nimport { htmlSafe } from '@ember/template';\n\nimport { focusTrap } from 'ember-focus-trap';\nimport onKey from 'ember-keyboard/modifiers/on-key';\nimport { eq, notEq, or } from 'ember-truth-helpers';\n\nimport { argOrDefaultDecorator } from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport { sizeMapping } from '../utils/css-mappings/eui-image.ts';\nimport EuiIcon from './eui-icon.gts';\nimport EuiOverlayMask from './eui-overlay-mask.gts';\n\ntype EuiImageSize = keyof typeof sizeMapping;\n\ntype ImageSize = EuiImageSize | number;\n\ntype FullScreenIconColor = 'light' | 'dark';\n\ntype ImageArgs = {\n /**\n * Separate from the caption is a title on the alt tag itself.\n * This one is required for accessibility.\n */\n alt: string;\n\n /*\n Determines the size of the image itself, can be a number or a string\n Default: 'm'\n */\n size?: ImageSize | number | string;\n\n /**\n * Changes the color of the icon that floats above the image when it can be clicked to fullscreen.\n * The default value of `light` is fine unless your image has a white background, in which case you should change it to `dark`.\n */\n fullScreenIconColor?: FullScreenIconColor;\n\n url: string;\n\n /**\n * Provides the visible caption to the image\n */\n caption?: string;\n /**\n * When set to `true` (default) will apply a slight shadow to the image\n */\n hasShadow?: boolean;\n /**\n * When set to `true` will make the image clickable to a larger version\n */\n allowFullScreen?: boolean;\n\n /**\n * When set to `true` will make the image clickable to a larger version\n */\n float?: 'left' | 'right' | 'none';\n\n /**\n * When set to `true` will make the image clickable to a larger version\n */\n margin?: 'none' | 's' | 'm' | 'l' | 'xl';\n\n /**\n * When set to `true` will make the image clickable to a larger version\n */\n ariaLabel?: string;\n\n src?: string;\n};\n\nexport interface EuiImageSignature {\n Element: HTMLElement;\n Args: ImageArgs;\n Blocks: {\n default: [];\n };\n}\n\nexport default class EuiImage extends Component<ImageArgs> {\n @tracked isFullscreen = false;\n @argOrDefaultDecorator('original') size!: ImageArgs['size'];\n\n get sizeClass(): string | undefined {\n return sizeMapping[this.size as EuiImageSize];\n }\n\n get sizeStyle(): ReturnType<typeof htmlSafe> | string {\n const size = this.args.size;\n\n if (\n (typeof size === 'string' || typeof size === 'number') &&\n !this.sizeClass\n ) {\n return htmlSafe(\n `max-height:${this.args.size}px; max-width:${this.args.size}px; width:auto;`\n );\n }\n\n return '';\n }\n\n @action\n toggleFullscreen(e: Event): void {\n e.stopPropagation();\n e.preventDefault();\n this.isFullscreen = !this.isFullscreen;\n }\n\n get sizeString() {\n if (typeof this.args.size === 'string') {\n return this.args.size;\n }\n }\n\n <template>\n {{#if @allowFullScreen}}\n <figure\n class={{classNames\n \"euiImage--allowFullScreen\"\n (unless (eq @hasShadow false) \"euiImage--hasShadow\")\n float=@float\n margin=@margin\n componentName=\"EuiImage\"\n size=this.sizeString\n }}\n {{!@glint-expect-error}}\n ...attributes\n >\n\n <button\n class=\"euiImage__button\"\n type=\"button\"\n aria-label={{@ariaLabel}}\n {{on \"click\" this.toggleFullscreen}}\n >\n <img\n src={{or @src @url}}\n class=\"euiImage__img\"\n style={{this.sizeStyle}}\n alt={{@alt}}\n />\n <EuiIcon\n @iconClasses=\"euiImage__icon\"\n @type=\"fullScreen\"\n @color={{if (notEq @fullScreenIconColor \"dark\") \"ghost\"}}\n />\n </button>\n\n {{#if @caption}}\n <figcaption class=\"euiImage__caption\">\n {{@caption}}\n </figcaption>\n {{/if}}\n </figure>\n\n {{else}}\n\n <figure\n class={{classNames\n (unless (eq @hasShadow false) \"euiImage--hasShadow\")\n float=@float\n margin=@margin\n componentName=\"EuiImage\"\n size=this.sizeString\n }}\n {{!@glint-expect-error}}\n ...attributes\n >\n\n <img\n src={{or @src @url}}\n class=\"euiImage__img\"\n style={{this.sizeStyle}}\n alt={{@alt}}\n />\n\n {{#if @caption}}\n <figcaption class=\"euiImage__caption\">\n {{@caption}}\n </figcaption>\n {{/if}}\n </figure>\n\n {{/if}}\n\n {{#if this.isFullscreen}}\n <EuiOverlayMask\n @headerZindexLocation=\"above\"\n @onClick={{this.toggleFullscreen}}\n >\n <figure\n class=\"euiImage euiImage-isFullScreen\"\n {{focusTrap focusTrapOptions=(hash clickOutsideDeactivates=true)}}\n >\n <button\n class=\"euiImage__button\"\n type=\"button\"\n {{on \"click\" this.toggleFullscreen}}\n {{onKey \"Escape\" this.toggleFullscreen}}\n >\n <img\n class=\"euiImage-isFullScreen__img\"\n src={{or @src @url}}\n alt={{@alt}}\n />\n </button>\n <figcaption class=\"euiImage__caption\">\n {{@caption}}\n </figcaption>\n </figure>\n <EuiIcon\n @iconClasses=\"euiImage-isFullScreenCloseIcon\"\n @type=\"cross\"\n @color={{if (notEq @fullScreenIconColor \"dark\") \"ghost\"}}\n />\n </EuiOverlayMask>\n {{/if}}\n </template>\n}\n"],"names":["EuiImage","Component","g","prototype","tracked","i","void 0","argOrDefaultDecorator","sizeClass","sizeMapping","size","sizeStyle","args","htmlSafe","toggleFullscreen","e","stopPropagation","preventDefault","isFullscreen","n","action","sizeString","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","eq","on","or","EuiIcon","notEq","EuiOverlayMask","focusTrap","hash","onKey"],"mappings":";;;;;;;;;;;;;;;;;;AAmFe,MAAMA,iBAAiBC,SAAU,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,cAAA,EAAA,CAC7CC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAuB,KAAM;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,aAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,cAAA,CAAA,EAAAC,MAAA;AAAA,EAAA;AAAAJ,IAAAA,CAAA,MAAAC,SAAA,EAAA,MAAA,EAAA,CAC7BI,qBAAsB,CAAA,UAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,KAAA,IAAAF,CAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAAAC,MAAA;EAEvB,IAAIE,SAAaA,GAAmB;AAClC,IAAA,OAAOC,WAAW,CAAC,IAAI,CAACC,IAAI,CAAiB;AAC/C;EAEA,IAAIC,SAAaA,GAAqC;AACpD,IAAA,MAAMD,IAAO,GAAA,IAAI,CAACE,IAAI,CAACF,IAAI;AAE3B,IAAA,IACE,CAAC,OAAOA,IAAS,KAAA,QAAA,IAAY,OAAOA,IAAA,KAAS,QAAQ,KACrD,CAAC,IAAI,CAACF,SAAS,EACf;AACA,MAAA,OAAOK,SACL,CAAc,WAAA,EAAA,IAAI,CAACD,IAAI,CAACF,IAAI,CAAA,cAAA,EAAiB,IAAI,CAACE,IAAI,CAACF,IAAI,iBAAiB,CAAA;AAEhF;AAEA,IAAA,OAAO,EAAA;AACT;EAGAI,gBAAAA,CAAiBC,CAAQ,EAAQ;IAC/BA,CAAA,CAAEC,eAAe,EAAA;IACjBD,CAAA,CAAEE,cAAc,EAAA;AAChB,IAAA,IAAI,CAACC,YAAY,GAAG,CAAC,IAAI,CAACA,YAAY;AACxC;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAhB,SAAA,EAAA,kBAAA,EAAA,CALCiB,MAAA,CAAA,CAAA;AAAA;EAOD,IAAIC,UAAaA,GAAA;IACf,IAAI,OAAO,IAAI,CAACT,IAAI,CAACF,IAAI,KAAK,QAAU,EAAA;AACtC,MAAA,OAAO,IAAI,CAACE,IAAI,CAACF,IAAI;AACvB;AACF;AAEA,EAAA;IAAAY,oBAAA,CAAAC,kBAAA,CAuGA,2mEAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,UAAA;QAAAC,EAAA;QAAAC,EAAA;QAAAC,EAAA;QAAAC,OAAA;QAAAC,KAAA;wBAAAC,uBAAA;QAAAC,SAAA;QAAAC,IAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -11,13 +11,13 @@ class EuiImage extends Component {
|
|
|
11
11
|
return null;
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
#ref = (i(this, "ref"),
|
|
14
|
+
#ref = (i(this, "ref"), void 0);
|
|
15
15
|
static {
|
|
16
16
|
g(this.prototype, "innerText", [tracked], function () {
|
|
17
17
|
return '';
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
#innerText = (i(this, "innerText"),
|
|
20
|
+
#innerText = (i(this, "innerText"), void 0);
|
|
21
21
|
observer = null;
|
|
22
22
|
get innerTextFallback() {
|
|
23
23
|
return this.args.fallback ?? '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-inner-text.js","sources":["../../src/components/eui-inner-text.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\n\nexport interface EuiInnerTextSignature {\n Args: {\n fallback?: string;\n };\n\n Blocks: {\n default: [(ref: HTMLElement) => void, string];\n };\n}\n\nexport default class EuiImage extends Component<EuiInnerTextSignature> {\n @tracked ref: HTMLElement | null = null;\n @tracked innerText = '';\n observer: MutationObserver | null = null;\n\n get innerTextFallback() {\n return this.args.fallback ?? '';\n }\n\n setupObserver() {\n this.observer?.disconnect();\n this.observer = new MutationObserver((mutationsList) => {\n if (mutationsList.length) this.updateInnerText(this.ref);\n });\n\n if (this.ref) {\n this.updateInnerText(this.ref);\n this.observer.observe(this.ref, {\n characterData: true,\n subtree: true,\n childList: true\n });\n }\n }\n\n updateInnerText(node: HTMLElement | null) {\n if (!node) return;\n this.setInnerText(\n // Check for `innerText` implementation rather than a simple OR check\n // because in real cases the result of `innerText` could correctly be `null`\n // while the result of `textContent` could correctly be non-`null` due to\n // differing reliance on browser layout calculations.\n // We prefer the result of `innerText`, if available.\n 'innerText' in node\n ? node.innerText\n : (node as HTMLElement).textContent || this.innerTextFallback\n );\n }\n\n setInnerText(text: string) {\n this.innerText = text;\n }\n\n @action\n setRef(ref: HTMLElement): void {\n this.ref = ref;\n this.setupObserver();\n }\n\n willDestroy(): void {\n super.willDestroy();\n this.observer?.disconnect();\n }\n\n <template>\n {{yield this.setRef this.innerText}}\n </template>\n}\n"],"names":["EuiImage","Component","g","prototype","tracked","i","void 0","observer","innerTextFallback","args","fallback","setupObserver","disconnect","MutationObserver","mutationsList","length","updateInnerText","ref","observe","characterData","subtree","childList","node","setInnerText","innerText","textContent","text","setRef","n","action","willDestroy","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;;AAee,MAAMA,iBAAiBC,SAAU,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,KAAA,EAAA,CAC7CC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAkC,IAAK;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,IAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,KAAA,CAAA,EAAAC,
|
|
1
|
+
{"version":3,"file":"eui-inner-text.js","sources":["../../src/components/eui-inner-text.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\n\nexport interface EuiInnerTextSignature {\n Args: {\n fallback?: string;\n };\n\n Blocks: {\n default: [(ref: HTMLElement) => void, string];\n };\n}\n\nexport default class EuiImage extends Component<EuiInnerTextSignature> {\n @tracked ref: HTMLElement | null = null;\n @tracked innerText = '';\n observer: MutationObserver | null = null;\n\n get innerTextFallback() {\n return this.args.fallback ?? '';\n }\n\n setupObserver() {\n this.observer?.disconnect();\n this.observer = new MutationObserver((mutationsList) => {\n if (mutationsList.length) this.updateInnerText(this.ref);\n });\n\n if (this.ref) {\n this.updateInnerText(this.ref);\n this.observer.observe(this.ref, {\n characterData: true,\n subtree: true,\n childList: true\n });\n }\n }\n\n updateInnerText(node: HTMLElement | null) {\n if (!node) return;\n this.setInnerText(\n // Check for `innerText` implementation rather than a simple OR check\n // because in real cases the result of `innerText` could correctly be `null`\n // while the result of `textContent` could correctly be non-`null` due to\n // differing reliance on browser layout calculations.\n // We prefer the result of `innerText`, if available.\n 'innerText' in node\n ? node.innerText\n : (node as HTMLElement).textContent || this.innerTextFallback\n );\n }\n\n setInnerText(text: string) {\n this.innerText = text;\n }\n\n @action\n setRef(ref: HTMLElement): void {\n this.ref = ref;\n this.setupObserver();\n }\n\n willDestroy(): void {\n super.willDestroy();\n this.observer?.disconnect();\n }\n\n <template>\n {{yield this.setRef this.innerText}}\n </template>\n}\n"],"names":["EuiImage","Component","g","prototype","tracked","i","void 0","observer","innerTextFallback","args","fallback","setupObserver","disconnect","MutationObserver","mutationsList","length","updateInnerText","ref","observe","characterData","subtree","childList","node","setInnerText","innerText","textContent","text","setRef","n","action","willDestroy","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;;AAee,MAAMA,iBAAiBC,SAAU,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,KAAA,EAAA,CAC7CC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAkC,IAAK;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,IAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,KAAA,CAAA,EAAAC,MAAA;AAAA,EAAA;IAAAJ,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CACvCC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAoB,EAAG;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,UAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAAC,MAAA;AACxBC,EAAAA,QAAU,GAA0B,IAAK;EAEzC,IAAIC,iBAAoBA,GAAA;AACtB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,QAAQ,IAAI,EAAA;AAC/B;AAEAC,EAAAA,aAAgBA,GAAA;AACd,IAAA,IAAI,CAACJ,QAAQ,EAAEK,UAAA,EAAA;AACf,IAAA,IAAI,CAACL,QAAQ,GAAG,IAAIM,iBAAkBC,aAAA,IAAA;MACpC,IAAIA,aAAA,CAAcC,MAAM,EAAE,IAAI,CAACC,eAAe,CAAC,IAAI,CAACC,GAAG,CAAA;AACzD,KAAA,CAAA;IAEA,IAAI,IAAI,CAACA,GAAG,EAAE;AACZ,MAAA,IAAI,CAACD,eAAe,CAAC,IAAI,CAACC,GAAG,CAAA;MAC7B,IAAI,CAACV,QAAQ,CAACW,OAAO,CAAC,IAAI,CAACD,GAAG,EAAE;AAC9BE,QAAAA,aAAe,EAAA,IAAA;AACfC,QAAAA,OAAS,EAAA,IAAA;AACTC,QAAAA,SAAW,EAAA;AACb,OAAA,CAAA;AACF;AACF;EAEAL,eAAgBA,CAAAM,IAAwB,EAAE;IACxC,IAAI,CAACA,IAAM,EAAA;AACX,IAAA,IAAI,CAACC,YAAY;AACf;AACA;AACA;AACA;AACA;AACA,IAAA,WAAA,IAAeD,IACX,GAAAA,IAAA,CAAKE,SAAS,GACbF,IAAA,CAAqBG,WAAW,IAAI,IAAI,CAACjB,iBAAiB,CAAA;AAEnE;EAEAe,YAAaA,CAAAG,IAAY,EAAE;IACzB,IAAI,CAACF,SAAS,GAAGE,IAAA;AACnB;EAGAC,MAAAA,CAAOV,GAAgB,EAAQ;IAC7B,IAAI,CAACA,GAAG,GAAGA,GAAA;IACX,IAAI,CAACN,aAAa,EAAA;AACpB;AAAA,EAAA;IAAAiB,CAAA,CAAA,IAAA,CAAAzB,SAAA,EAAA,QAAA,EAAA,CAJC0B,MAAA,CAAA,CAAA;AAAA;AAMDC,EAAAA,WAAAA,GAAoB;IAClB,KAAK,CAACA,WAAA,EAAA;AACN,IAAA,IAAI,CAACvB,QAAQ,EAAEK,UAAA,EAAA;AACjB;AAEA,EAAA;IAAAmB,oBAAA,CAAAC,kBAAA,CAEA,gDAAA,EAAA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -19,43 +19,43 @@ class EuiInputPopoverComponent extends Component {
|
|
|
19
19
|
static {
|
|
20
20
|
g(this.prototype, "anchorPosition", [argOrDefaultDecorator('downLeft')]);
|
|
21
21
|
}
|
|
22
|
-
#anchorPosition = (i(this, "anchorPosition"),
|
|
22
|
+
#anchorPosition = (i(this, "anchorPosition"), void 0); // Defaults
|
|
23
23
|
static {
|
|
24
24
|
g(this.prototype, "attachToAnchor", [argOrDefaultDecorator(true)]);
|
|
25
25
|
}
|
|
26
|
-
#attachToAnchor = (i(this, "attachToAnchor"),
|
|
26
|
+
#attachToAnchor = (i(this, "attachToAnchor"), void 0);
|
|
27
27
|
static {
|
|
28
28
|
g(this.prototype, "display", [argOrDefaultDecorator('block')]);
|
|
29
29
|
}
|
|
30
|
-
#display = (i(this, "display"),
|
|
30
|
+
#display = (i(this, "display"), void 0);
|
|
31
31
|
static {
|
|
32
32
|
g(this.prototype, "panelPaddingSize", [argOrDefaultDecorator('s')]);
|
|
33
33
|
}
|
|
34
|
-
#panelPaddingSize = (i(this, "panelPaddingSize"),
|
|
34
|
+
#panelPaddingSize = (i(this, "panelPaddingSize"), void 0);
|
|
35
35
|
static {
|
|
36
36
|
g(this.prototype, "fullWidth", [argOrDefaultDecorator(false)]);
|
|
37
37
|
}
|
|
38
|
-
#fullWidth = (i(this, "fullWidth"),
|
|
38
|
+
#fullWidth = (i(this, "fullWidth"), void 0);
|
|
39
39
|
static {
|
|
40
40
|
g(this.prototype, "disableFocusTrap", [argOrDefaultDecorator(false)]);
|
|
41
41
|
}
|
|
42
|
-
#disableFocusTrap = (i(this, "disableFocusTrap"),
|
|
42
|
+
#disableFocusTrap = (i(this, "disableFocusTrap"), void 0);
|
|
43
43
|
static {
|
|
44
44
|
g(this.prototype, "panel", [tracked], function () {
|
|
45
45
|
return null;
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
#panel = (i(this, "panel"),
|
|
48
|
+
#panel = (i(this, "panel"), void 0); //State
|
|
49
49
|
static {
|
|
50
50
|
g(this.prototype, "input", [tracked], function () {
|
|
51
51
|
return null;
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
#input = (i(this, "input"),
|
|
54
|
+
#input = (i(this, "input"), void 0);
|
|
55
55
|
static {
|
|
56
56
|
g(this.prototype, "inputWidth", [tracked]);
|
|
57
57
|
}
|
|
58
|
-
#inputWidth = (i(this, "inputWidth"),
|
|
58
|
+
#inputWidth = (i(this, "inputWidth"), void 0);
|
|
59
59
|
///
|
|
60
60
|
didInsertPanel(panel) {
|
|
61
61
|
this.panel = panel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-input-popover.js","sources":["../../src/components/eui-input-popover.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { concat } from '@ember/helper';\nimport { hash } from '@ember/helper';\nimport { action } from '@ember/object';\n\nimport { focusTrap } from 'ember-focus-trap';\nimport onKey from 'ember-keyboard/modifiers/on-key';\nimport { not } from 'ember-truth-helpers';\nimport { tabbable } from 'tabbable';\n\nimport randomId from '../-private/random-id.ts';\nimport { argOrDefaultDecorator } from '../helpers/arg-or-default.ts';\nimport resizeObserver from '../modifiers/resize-observer.ts';\nimport { cascadingMenuKeys } from '../utils/accesibility/index.ts';\nimport EuiPopover from './eui-popover.gts';\n\nimport type { EuiPopoverArgs } from './eui-popover';\n\nexport interface EuiInputPopoverArgs\n extends Omit<EuiPopoverArgs, 'button' | 'buttonRef'> {\n disableFocusTrap?: boolean;\n fullWidth?: boolean;\n input?: EuiPopoverArgs['button'];\n inputRef?: EuiPopoverArgs['buttonRef'];\n onPanelResize?: (width?: number) => void;\n}\n\nexport interface EuiInputPopoverSignature {\n Element: HTMLElement;\n Args: EuiInputPopoverArgs;\n Blocks: {\n default: [\n {\n closePopover: () => void;\n isOpen: boolean;\n },\n {\n input: HTMLElement;\n content: HTMLElement;\n }\n ];\n input: [];\n content: [];\n };\n}\n\nexport default class EuiInputPopoverComponent extends Component<EuiInputPopoverSignature> {\n // Defaults\n @argOrDefaultDecorator('downLeft') anchorPosition!: EuiPopoverArgs['anchorPosition'];\n @argOrDefaultDecorator(true) attachToAnchor!: boolean;\n @argOrDefaultDecorator('block') display!: EuiPopoverArgs['display'];\n @argOrDefaultDecorator('s') panelPaddingSize!: EuiPopoverArgs['panelPaddingSize'];\n @argOrDefaultDecorator(false) fullWidth!: boolean;\n @argOrDefaultDecorator(false) disableFocusTrap!: boolean;\n\n //State\n @tracked panel: HTMLElement | null = null;\n @tracked input: HTMLElement | null = null;\n @tracked inputWidth!: number;\n ///\n\n @action\n didInsertPanel(panel: HTMLElement | null): void {\n this.panel = panel;\n this.setPanelWidth();\n }\n\n @action\n didInsertInput(input: HTMLElement): void {\n this.input = input;\n this.onResize();\n }\n\n @action\n setPanelWidth(width?: number): void {\n const { panel, inputWidth } = this;\n const newWidth = width || inputWidth;\n\n if (panel && !!newWidth) {\n panel.style.width = `${newWidth}px`;\n this.args.onPanelResize?.(newWidth);\n }\n }\n\n @action\n onResize(): void {\n const { input } = this;\n\n if (input) {\n const width = input.getBoundingClientRect().width;\n\n this.inputWidth = width;\n this.setPanelWidth(width);\n }\n }\n\n @action\n onKeyDown(event: KeyboardEvent): void {\n const { panel } = this;\n\n if (panel && event.key === cascadingMenuKeys.TAB) {\n const tabbableItems = tabbable(panel).filter(\n (el: HTMLElement | SVGElement) => {\n return (\n Array.from(el.attributes)\n .map((el) => el.name)\n .indexOf('data-focus-guard') < 0\n );\n }\n );\n\n if (\n this.args.disableFocusTrap ||\n (tabbableItems.length &&\n tabbableItems[tabbableItems.length - 1] === document.activeElement)\n ) {\n this.args.closePopover?.();\n }\n }\n }\n\n <template>\n {{#let (randomId) as |id|}}\n <EuiPopover\n class=\"euiInputPopover\n {{if this.fullWidth 'euiInputPopover--fullWidth'}}\"\n @ownFocus={{false}}\n @buttonRef={{this.didInsertInput}}\n @panelRef={{this.didInsertPanel}}\n @anchorPosition={{this.anchorPosition}}\n @panelPaddingSize={{this.panelPaddingSize}}\n @attachToAnchor={{this.attachToAnchor}}\n @display={{this.display}}\n @closePopover={{@closePopover}}\n @isOpen={{@isOpen}}\n ...attributes\n >\n <:button>\n <div {{resizeObserver onResize=this.onResize}}>\n {{yield to=\"input\"}}\n </div>\n </:button>\n <:content>\n <div\n id={{id}}\n {{onKey \"_all\" this.onKeyDown}}\n {{focusTrap\n isActive=(not this.disableFocusTrap)\n focusTrapOptions=(hash\n clickOutsideDeactivates=true\n returnFocusOnDeactivate=false\n fallbackFocus=(concat \"#\" id)\n )\n }}\n >\n {{yield to=\"content\"}}\n </div>\n </:content>\n </EuiPopover>\n {{/let}}\n </template>\n}\n"],"names":["EuiInputPopoverComponent","Component","g","prototype","argOrDefaultDecorator","i","void 0","tracked","didInsertPanel","panel","setPanelWidth","n","action","didInsertInput","input","onResize","width","inputWidth","newWidth","style","args","onPanelResize","getBoundingClientRect","onKeyDown","event","key","cascadingMenuKeys","TAB","tabbableItems","tabbable","filter","el","Array","from","attributes","map","name","indexOf","disableFocusTrap","length","document","activeElement","closePopover","setComponentTemplate","precompileTemplate","strictMode","scope","randomId","EuiPopover","resizeObserver","onKey","focusTrap","not","hash","concat"],"mappings":";;;;;;;;;;;;;;;;;AA+Ce,MAAMA,iCAAiCC,SAAU,CAAA;AAAA,EAAA;AAAAC,IAAAA,CAAA,MAAAC,SAAA,EAAA,gBAAA,EAAA,CAE7DC,qBAAsB,CAAA,UAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,eAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,gBAAA,CAAA,EAAAC,
|
|
1
|
+
{"version":3,"file":"eui-input-popover.js","sources":["../../src/components/eui-input-popover.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { concat } from '@ember/helper';\nimport { hash } from '@ember/helper';\nimport { action } from '@ember/object';\n\nimport { focusTrap } from 'ember-focus-trap';\nimport onKey from 'ember-keyboard/modifiers/on-key';\nimport { not } from 'ember-truth-helpers';\nimport { tabbable } from 'tabbable';\n\nimport randomId from '../-private/random-id.ts';\nimport { argOrDefaultDecorator } from '../helpers/arg-or-default.ts';\nimport resizeObserver from '../modifiers/resize-observer.ts';\nimport { cascadingMenuKeys } from '../utils/accesibility/index.ts';\nimport EuiPopover from './eui-popover.gts';\n\nimport type { EuiPopoverArgs } from './eui-popover';\n\nexport interface EuiInputPopoverArgs\n extends Omit<EuiPopoverArgs, 'button' | 'buttonRef'> {\n disableFocusTrap?: boolean;\n fullWidth?: boolean;\n input?: EuiPopoverArgs['button'];\n inputRef?: EuiPopoverArgs['buttonRef'];\n onPanelResize?: (width?: number) => void;\n}\n\nexport interface EuiInputPopoverSignature {\n Element: HTMLElement;\n Args: EuiInputPopoverArgs;\n Blocks: {\n default: [\n {\n closePopover: () => void;\n isOpen: boolean;\n },\n {\n input: HTMLElement;\n content: HTMLElement;\n }\n ];\n input: [];\n content: [];\n };\n}\n\nexport default class EuiInputPopoverComponent extends Component<EuiInputPopoverSignature> {\n // Defaults\n @argOrDefaultDecorator('downLeft') anchorPosition!: EuiPopoverArgs['anchorPosition'];\n @argOrDefaultDecorator(true) attachToAnchor!: boolean;\n @argOrDefaultDecorator('block') display!: EuiPopoverArgs['display'];\n @argOrDefaultDecorator('s') panelPaddingSize!: EuiPopoverArgs['panelPaddingSize'];\n @argOrDefaultDecorator(false) fullWidth!: boolean;\n @argOrDefaultDecorator(false) disableFocusTrap!: boolean;\n\n //State\n @tracked panel: HTMLElement | null = null;\n @tracked input: HTMLElement | null = null;\n @tracked inputWidth!: number;\n ///\n\n @action\n didInsertPanel(panel: HTMLElement | null): void {\n this.panel = panel;\n this.setPanelWidth();\n }\n\n @action\n didInsertInput(input: HTMLElement): void {\n this.input = input;\n this.onResize();\n }\n\n @action\n setPanelWidth(width?: number): void {\n const { panel, inputWidth } = this;\n const newWidth = width || inputWidth;\n\n if (panel && !!newWidth) {\n panel.style.width = `${newWidth}px`;\n this.args.onPanelResize?.(newWidth);\n }\n }\n\n @action\n onResize(): void {\n const { input } = this;\n\n if (input) {\n const width = input.getBoundingClientRect().width;\n\n this.inputWidth = width;\n this.setPanelWidth(width);\n }\n }\n\n @action\n onKeyDown(event: KeyboardEvent): void {\n const { panel } = this;\n\n if (panel && event.key === cascadingMenuKeys.TAB) {\n const tabbableItems = tabbable(panel).filter(\n (el: HTMLElement | SVGElement) => {\n return (\n Array.from(el.attributes)\n .map((el) => el.name)\n .indexOf('data-focus-guard') < 0\n );\n }\n );\n\n if (\n this.args.disableFocusTrap ||\n (tabbableItems.length &&\n tabbableItems[tabbableItems.length - 1] === document.activeElement)\n ) {\n this.args.closePopover?.();\n }\n }\n }\n\n <template>\n {{#let (randomId) as |id|}}\n <EuiPopover\n class=\"euiInputPopover\n {{if this.fullWidth 'euiInputPopover--fullWidth'}}\"\n @ownFocus={{false}}\n @buttonRef={{this.didInsertInput}}\n @panelRef={{this.didInsertPanel}}\n @anchorPosition={{this.anchorPosition}}\n @panelPaddingSize={{this.panelPaddingSize}}\n @attachToAnchor={{this.attachToAnchor}}\n @display={{this.display}}\n @closePopover={{@closePopover}}\n @isOpen={{@isOpen}}\n ...attributes\n >\n <:button>\n <div {{resizeObserver onResize=this.onResize}}>\n {{yield to=\"input\"}}\n </div>\n </:button>\n <:content>\n <div\n id={{id}}\n {{onKey \"_all\" this.onKeyDown}}\n {{focusTrap\n isActive=(not this.disableFocusTrap)\n focusTrapOptions=(hash\n clickOutsideDeactivates=true\n returnFocusOnDeactivate=false\n fallbackFocus=(concat \"#\" id)\n )\n }}\n >\n {{yield to=\"content\"}}\n </div>\n </:content>\n </EuiPopover>\n {{/let}}\n </template>\n}\n"],"names":["EuiInputPopoverComponent","Component","g","prototype","argOrDefaultDecorator","i","void 0","tracked","didInsertPanel","panel","setPanelWidth","n","action","didInsertInput","input","onResize","width","inputWidth","newWidth","style","args","onPanelResize","getBoundingClientRect","onKeyDown","event","key","cascadingMenuKeys","TAB","tabbableItems","tabbable","filter","el","Array","from","attributes","map","name","indexOf","disableFocusTrap","length","document","activeElement","closePopover","setComponentTemplate","precompileTemplate","strictMode","scope","randomId","EuiPopover","resizeObserver","onKey","focusTrap","not","hash","concat"],"mappings":";;;;;;;;;;;;;;;;;AA+Ce,MAAMA,iCAAiCC,SAAU,CAAA;AAAA,EAAA;AAAAC,IAAAA,CAAA,MAAAC,SAAA,EAAA,gBAAA,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MAAA,CAAA,CAAA;AAAA;AAyBD,EAAA;IAAA+B,oBAAA,CAAAC,kBAAA,CAuCA,q8BAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,QAAA;oBAAAC,mBAAA;wBAAAC,cAAA;QAAAC,KAAA;QAAAC,SAAA;QAAAC,GAAA;QAAAC,IAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { on } from '@ember/modifier';
|
|
2
2
|
import { EnsureSafeComponentHelper } from '@embroider/util';
|
|
3
|
-
import optional from 'ember-composable-helpers/helpers/optional';
|
|
4
|
-
import 'ember-composable-helpers/helpers/queue';
|
|
5
|
-
import 'ember-element-helper';
|
|
6
|
-
import 'ember-set-helper/helpers/set';
|
|
3
|
+
import optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';
|
|
7
4
|
import { eq, not, and, or } from 'ember-truth-helpers';
|
|
8
5
|
import argOrDefault from '../helpers/arg-or-default.js';
|
|
9
6
|
import classNames from '../helpers/class-names.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-list-group-item.js","sources":["../../src/components/eui-list-group-item.gts"],"sourcesContent":["import { on } from '@ember/modifier';\nimport { EnsureSafeComponentHelper } from '@embroider/util';\n\nimport optional from 'ember-composable-helpers/helpers/optional';\nimport
|
|
1
|
+
{"version":3,"file":"eui-list-group-item.js","sources":["../../src/components/eui-list-group-item.gts"],"sourcesContent":["import { on } from '@ember/modifier';\nimport { EnsureSafeComponentHelper } from '@embroider/util';\n\nimport optional from '@nullvoxpopuli/ember-composable-helpers/helpers/optional';\nimport { and, eq, not, or } from 'ember-truth-helpers';\n\nimport argOrDefault from '../helpers/arg-or-default.ts';\nimport classNames from '../helpers/class-names.ts';\nimport EuiIcon from './eui-icon.gts';\n\nimport type {\n colorMapping,\n sizeMapping\n} from '../utils/css-mappings/eui-list-group-item.ts';\nimport type { EuiIconSignature } from './eui-icon';\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\nimport type { ComponentLike } from '@glint/template';\n\nexport interface EuiListGroupItemSignature {\n Element:\n | HTMLLIElement\n | HTMLAnchorElement\n | HTMLButtonElement\n | HTMLSpanElement;\n Args: {\n href?: string;\n target?: string;\n onClick?: (event: MouseEvent) => void;\n label?: string;\n iconType?: EuiIconSignature['Args']['type'];\n isActive?: boolean;\n isDisabled?: boolean;\n wrapText?: boolean;\n extraAction?: ComponentLike;\n size?: keyof typeof sizeMapping;\n color?: keyof typeof colorMapping;\n };\n Blocks: {\n default: [];\n };\n}\n\nconst EuiListGroupItem: TemplateOnlyComponent<EuiListGroupItemSignature> =\n <template>\n <li\n class={{classNames\n (if (or @href @onClick) \"euiListGroupItem-isClickable\")\n (if @isActive \"euiListGroupItem-isActive\")\n (if @isDisabled \"euiListGroupItem-isDisabled\")\n (if @wrapText \"euiListGroupItem-wrapText\")\n componentName=\"EuiListGroupItem\"\n size=(argOrDefault @size \"m\")\n color=(argOrDefault @color \"inherit\")\n }}\n >\n {{#if (and @href (not @isDisabled))}}\n <a\n class=\"euiListGroupItem__button\"\n href={{@href}}\n target={{@target}}\n {{on \"click\" (optional @onClick)}}\n ...attributes\n >\n {{#if @iconType}}\n <EuiIcon\n @iconClasses=\"euiListGroupItem__icon\"\n @type={{@iconType}}\n />\n {{/if}}\n <span class=\"euiListGroupItem__label\">\n {{#if (has-block)}}\n {{yield}}\n {{else}}\n {{@label}}\n {{/if}}\n </span>\n </a>\n {{else if (or @onClick (and @href @isDisabled))}}\n <button\n class=\"euiListGroupItem__button\"\n type=\"button\"\n disabled={{eq @isDisabled true}}\n {{on \"click\" (optional @onClick)}}\n ...attributes\n >\n {{#if @iconType}}\n <EuiIcon\n @iconClasses=\"euiListGroupItem__icon\"\n @type={{@iconType}}\n @color=\"inherit\"\n />\n {{/if}}\n <span class=\"euiListGroupItem__label\">\n {{#if (has-block)}}\n {{yield}}\n {{else}}\n {{@label}}\n {{/if}}\n </span>\n </button>\n {{else}}\n <span class=\"euiListGroupItem__text\" ...attributes>\n {{#if @iconType}}\n <EuiIcon\n @iconClasses=\"euiListGroupItem__icon\"\n @type={{@iconType}}\n @color=\"inherit\"\n />\n {{/if}}\n <span class=\"euiListGroupItem__label\">\n {{#if (has-block)}}\n {{yield}}\n {{else}}\n {{@label}}\n {{/if}}\n </span>\n </span>\n {{/if}}\n {{#if @extraAction}}\n {{#let\n (component (EnsureSafeComponentHelper @extraAction))\n as |ExtraAction|\n }}\n <ExtraAction />\n {{/let}}\n\n {{/if}}\n </li>\n </template>;\n\nexport default EuiListGroupItem;\n"],"names":["EuiListGroupItem","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","or","argOrDefault","and","not","on","optional","EuiIcon","eq","EnsureSafeComponentHelper","templateOnly"],"mappings":";;;;;;;;;;;AA0CA,MAAMA,gBACJ,GAAAC,oBAAA,CAAAC,kBAAA,CAqFA,6iEAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,UAAA;IAAAC,EAAA;IAAAC,YAAA;IAAAC,GAAA;IAAAC,GAAA;IAAAC,EAAA;IAAAC,QAAA;IAAAC,OAAA;IAAAC,EAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
|
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
import repeat from 'ember-composable-helpers/helpers/repeat';
|
|
2
|
-
import { lt, gt } from 'ember-truth-helpers';
|
|
3
1
|
import classNames from '../helpers/class-names.js';
|
|
4
2
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
5
3
|
import { setComponentTemplate } from '@ember/component';
|
|
6
4
|
import templateOnly from '@ember/component/template-only';
|
|
7
5
|
|
|
8
|
-
const
|
|
6
|
+
const repeat = count => Array.from({
|
|
7
|
+
length: count
|
|
8
|
+
});
|
|
9
|
+
const getLength = lines => {
|
|
10
|
+
if (lines === undefined) {
|
|
11
|
+
return 1;
|
|
12
|
+
}
|
|
13
|
+
if (lines > 10) {
|
|
14
|
+
return 10;
|
|
15
|
+
} else if (lines < 1) {
|
|
16
|
+
return 1;
|
|
17
|
+
} else {
|
|
18
|
+
return lines;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const EuiLoadingContent = setComponentTemplate(precompileTemplate("\n <span class=\"euiLoadingContent\" ...attributes>\n {{#each (repeat (getLength @lines))}}\n <span class={{classNames \"euiLoadingContent__singleLine\" @singleLineClasses}}>\n <span class=\"euiLoadingContent__singleLineBackground\" />\n </span>\n {{/each}}\n </span>\n ", {
|
|
9
22
|
strictMode: true,
|
|
10
23
|
scope: () => ({
|
|
11
24
|
repeat,
|
|
12
|
-
|
|
13
|
-
lt,
|
|
25
|
+
getLength,
|
|
14
26
|
classNames
|
|
15
27
|
})
|
|
16
28
|
}), templateOnly());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-loading-content.js","sources":["../../src/components/eui-loading-content.gts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"eui-loading-content.js","sources":["../../src/components/eui-loading-content.gts"],"sourcesContent":["import classNames from '../helpers/class-names.ts';\n\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport interface EuiLoadingContentSignature {\n Element: HTMLSpanElement;\n Args: {\n lines?: number;\n singleLineClasses?: string;\n };\n Blocks: {\n default: [];\n };\n}\n\nconst repeat = (count: number) => Array.from({ length: count });\n\nconst getLength = (lines: number | undefined) => {\n if (lines === undefined) {\n return 1;\n }\n\n if (lines > 10) {\n return 10;\n } else if (lines < 1) {\n return 1;\n } else {\n return lines;\n }\n};\n\nconst EuiLoadingContent: TemplateOnlyComponent<EuiLoadingContentSignature> =\n <template>\n <span class=\"euiLoadingContent\" ...attributes>\n {{#each (repeat (getLength @lines))}}\n <span\n class={{classNames\n \"euiLoadingContent__singleLine\"\n @singleLineClasses\n }}\n >\n <span class=\"euiLoadingContent__singleLineBackground\" />\n </span>\n {{/each}}\n </span>\n </template>;\n\nexport default EuiLoadingContent;\n"],"names":["repeat","count","Array","from","length","getLength","lines","undefined","EuiLoadingContent","setComponentTemplate","precompileTemplate","strictMode","scope","classNames","templateOnly"],"mappings":";;;;;AAeA,MAAMA,SAAUC,KAAa,IAAKC,KAAA,CAAMC,IAAI,CAAC;AAAEC,EAAAA,MAAQ,EAAAH;AAAM,CAAA,CAAA;AAE7D,MAAMI,SAAY,GAACC,KAAyB,IAAA;EAC1C,IAAIA,UAAUC,SAAW,EAAA;AACvB,IAAA,OAAO,CAAA;AACT;EAEA,IAAID,QAAQ,EAAI,EAAA;AACd,IAAA,OAAO,EAAA;AACT,GAAO,MAAA,IAAIA,QAAQ,CAAG,EAAA;AACpB,IAAA,OAAO,CAAA;AACT,GAAO,MAAA;AACL,IAAA,OAAOA,KAAA;AACT;AACF,CAAA;AAEA,MAAME,iBACJ,GAAAC,oBAAA,CAAAC,kBAAA,CAaA,wTAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAZ,MAAA;IAAAK,SAAA;AAAAQ,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
|
|
@@ -26,13 +26,13 @@ class EuiMarkdownEditorFooterComponent extends Component {
|
|
|
26
26
|
return false;
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
#isPopoverOpen = (i(this, "isPopoverOpen"),
|
|
29
|
+
#isPopoverOpen = (i(this, "isPopoverOpen"), void 0);
|
|
30
30
|
static {
|
|
31
31
|
g(this.prototype, "isShowingHelp", [tracked], function () {
|
|
32
32
|
return false;
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
#isShowingHelp = (i(this, "isShowingHelp"),
|
|
35
|
+
#isShowingHelp = (i(this, "isShowingHelp"), void 0);
|
|
36
36
|
static {
|
|
37
37
|
setComponentTemplate(precompileTemplate("\n <div class=\"euiMarkdownEditorFooter\">\n <div class=\"euiMarkdownEditorFooter__actions\">\n\n {{#if @isUploadingFiles}}\n {{!-- pending implementation--}}\n <EuiButtonIcon @iconType={{component EuiLoadingSpinner}} @useComponent={{true}} {{!-- aria-label={ariaLabels.uploadingFiles} --}} />\n {{/if}}\n {{#if (and @errors @errors.length)}}\n <EuiPopover @isOpen={{this.isPopoverOpen}} @closePopover={{set this \"isPopoverOpen\" false}}>\n <:button>\n <EuiButtonEmpty @iconType=\"error\" @size=\"s\" @color=\"danger\" {{!-- aria-label={ariaLabels.showSyntaxErrors} --}} {{on \"click\" (set this \"isPopoverOpen\" (not this.isPopoverOpen))}}>\n {{@errors.length}}\n </EuiButtonEmpty>\n </:button>\n </EuiPopover>\n {{/if}}\n </div>\n <EuiButtonIcon class=\"euiMarkdownEditorFooter__help\" @iconType={{component MarkdownLogo}} @useComponent={{true}} @color=\"text\" @useSvg={{true}} {{!-- aria-label={ariaLabels.showMarkdownHelp} --}} {{on \"click\" (set this \"isShowingHelp\" (not this.isShowingHelp))}} />\n\n {{#if this.isShowingHelp}}\n\n <EuiModal @onClose={{set this \"isShowingHelp\" false}}>\n <EuiModalHeader>\n <EuiTitle>\n <h3>\n Syntax Help\n {{!-- <EuiI18n\n token=\"euiMarkdownEditorFooter.syntaxTitle\"\n default=\"Syntax help\"\n /> --}}\n </h3>\n </EuiTitle>\n </EuiModalHeader>\n <EuiModalBody>\n\n <EuiText>\n <p>The editor uses</p>\n <a href=\"https://github.github.com/gfm/\" target=\"_blank\" rel=\"noreferrer noopener\">\n Github flavored markdown\n </a>\n <p>You can also utilize these additional syntax plugins to add\n rich content to yoru text.</p>\n </EuiText>\n <EuiHorizontalRule />\n {{#each @uiPlugins as |uiPlugin|}}\n {{#if uiPlugin.helpText}}\n <EuiTitle size=\"xxs\">\n <p>\n <strong>{{uiPlugin.name}}</strong>\n </p>\n </EuiTitle>\n <EuiSpacer size=\"s\" />\n <EuiMarkdownFormat @value={{uiPlugin.helpText}} />\n <EuiSpacer size=\"l\" />\n\n {{/if}}\n {{/each}}\n </EuiModalBody>\n </EuiModal>\n\n {{/if}}\n </div>\n ", {
|
|
38
38
|
strictMode: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-markdown-editor-footer.js","sources":["../../src/components/eui-markdown-editor-footer.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\n\nimport set from 'ember-set-helper/helpers/set';\nimport { and, not } from 'ember-truth-helpers';\n\nimport MarkdownLogo from '../components/eui-markdown-editor-footer/icons/markdown-logo.gts';\nimport EuiButtonEmpty from './eui-button-empty.gts';\nimport EuiButtonIcon from './eui-button-icon.gts';\nimport EuiHorizontalRule from './eui-horizontal-rule.gts';\nimport EuiLoadingSpinner from './eui-loading-spinner.gts';\nimport EuiMarkdownFormat from './eui-markdown-format.gts';\nimport EuiModal from './eui-modal.gts';\nimport EuiModalBody from './eui-modal-body.gts';\nimport EuiModalHeader from './eui-modal-header.gts';\nimport EuiPopover from './eui-popover.gts';\nimport EuiSpacer from './eui-spacer.gts';\nimport EuiText from './eui-text.gts';\nimport EuiTitle from './eui-title.gts';\n\nexport interface EuiMarkdownEditorFooterSignature {\n Args: {\n isUploadingFiles?: boolean;\n errors?: string[];\n uiPlugins?: any[];\n };\n}\n\nexport default class EuiMarkdownEditorFooterComponent extends Component<EuiMarkdownEditorFooterSignature> {\n @tracked isPopoverOpen = false;\n @tracked isShowingHelp = false;\n\n <template>\n <div class=\"euiMarkdownEditorFooter\">\n <div class=\"euiMarkdownEditorFooter__actions\">\n\n {{#if @isUploadingFiles}}\n {{! pending implementation}}\n <EuiButtonIcon\n @iconType={{component EuiLoadingSpinner}}\n @useComponent={{true}}\n {{! aria-label={ariaLabels.uploadingFiles} }}\n />\n {{/if}}\n {{#if (and @errors @errors.length)}}\n <EuiPopover\n @isOpen={{this.isPopoverOpen}}\n @closePopover={{set this \"isPopoverOpen\" false}}\n >\n <:button>\n <EuiButtonEmpty\n @iconType=\"error\"\n @size=\"s\"\n @color=\"danger\"\n {{! aria-label={ariaLabels.showSyntaxErrors} }}\n {{on\n \"click\"\n (set this \"isPopoverOpen\" (not this.isPopoverOpen))\n }}\n >\n {{@errors.length}}\n </EuiButtonEmpty>\n </:button>\n </EuiPopover>\n {{/if}}\n </div>\n <EuiButtonIcon\n class=\"euiMarkdownEditorFooter__help\"\n @iconType={{component MarkdownLogo}}\n @useComponent={{true}}\n @color=\"text\"\n @useSvg={{true}}\n {{! aria-label={ariaLabels.showMarkdownHelp} }}\n {{on \"click\" (set this \"isShowingHelp\" (not this.isShowingHelp))}}\n />\n\n {{#if this.isShowingHelp}}\n\n <EuiModal @onClose={{set this \"isShowingHelp\" false}}>\n <EuiModalHeader>\n <EuiTitle>\n <h3>\n Syntax Help\n {{! <EuiI18n\n token=\"euiMarkdownEditorFooter.syntaxTitle\"\n default=\"Syntax help\"\n /> }}\n </h3>\n </EuiTitle>\n </EuiModalHeader>\n <EuiModalBody>\n\n <EuiText>\n <p>The editor uses</p>\n <a\n href=\"https://github.github.com/gfm/\"\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n >\n Github flavored markdown\n </a>\n <p>You can also utilize these additional syntax plugins to add\n rich content to yoru text.</p>\n </EuiText>\n <EuiHorizontalRule />\n {{#each @uiPlugins as |uiPlugin|}}\n {{#if uiPlugin.helpText}}\n <EuiTitle size=\"xxs\">\n <p>\n <strong>{{uiPlugin.name}}</strong>\n </p>\n </EuiTitle>\n <EuiSpacer size=\"s\" />\n <EuiMarkdownFormat @value={{uiPlugin.helpText}} />\n <EuiSpacer size=\"l\" />\n\n {{/if}}\n {{/each}}\n </EuiModalBody>\n </EuiModal>\n\n {{/if}}\n </div>\n </template>\n}\n"],"names":["EuiMarkdownEditorFooterComponent","Component","g","prototype","tracked","i","void 0","setComponentTemplate","precompileTemplate","strictMode","scope","EuiButtonIcon","EuiLoadingSpinner","and","EuiPopover","set","EuiButtonEmpty","on","not","MarkdownLogo","EuiModal","EuiModalHeader","EuiTitle","EuiModalBody","EuiText","EuiHorizontalRule","EuiSpacer","EuiMarkdownFormat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6Be,MAAMA,yCAAyCC,SAAU,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,eAAA,EAAA,CACrEC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAwB,KAAM;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,cAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,eAAA,CAAA,EAAAC,
|
|
1
|
+
{"version":3,"file":"eui-markdown-editor-footer.js","sources":["../../src/components/eui-markdown-editor-footer.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { on } from '@ember/modifier';\n\nimport set from 'ember-set-helper/helpers/set';\nimport { and, not } from 'ember-truth-helpers';\n\nimport MarkdownLogo from '../components/eui-markdown-editor-footer/icons/markdown-logo.gts';\nimport EuiButtonEmpty from './eui-button-empty.gts';\nimport EuiButtonIcon from './eui-button-icon.gts';\nimport EuiHorizontalRule from './eui-horizontal-rule.gts';\nimport EuiLoadingSpinner from './eui-loading-spinner.gts';\nimport EuiMarkdownFormat from './eui-markdown-format.gts';\nimport EuiModal from './eui-modal.gts';\nimport EuiModalBody from './eui-modal-body.gts';\nimport EuiModalHeader from './eui-modal-header.gts';\nimport EuiPopover from './eui-popover.gts';\nimport EuiSpacer from './eui-spacer.gts';\nimport EuiText from './eui-text.gts';\nimport EuiTitle from './eui-title.gts';\n\nexport interface EuiMarkdownEditorFooterSignature {\n Args: {\n isUploadingFiles?: boolean;\n errors?: string[];\n uiPlugins?: any[];\n };\n}\n\nexport default class EuiMarkdownEditorFooterComponent extends Component<EuiMarkdownEditorFooterSignature> {\n @tracked isPopoverOpen = false;\n @tracked isShowingHelp = false;\n\n <template>\n <div class=\"euiMarkdownEditorFooter\">\n <div class=\"euiMarkdownEditorFooter__actions\">\n\n {{#if @isUploadingFiles}}\n {{! pending implementation}}\n <EuiButtonIcon\n @iconType={{component EuiLoadingSpinner}}\n @useComponent={{true}}\n {{! aria-label={ariaLabels.uploadingFiles} }}\n />\n {{/if}}\n {{#if (and @errors @errors.length)}}\n <EuiPopover\n @isOpen={{this.isPopoverOpen}}\n @closePopover={{set this \"isPopoverOpen\" false}}\n >\n <:button>\n <EuiButtonEmpty\n @iconType=\"error\"\n @size=\"s\"\n @color=\"danger\"\n {{! aria-label={ariaLabels.showSyntaxErrors} }}\n {{on\n \"click\"\n (set this \"isPopoverOpen\" (not this.isPopoverOpen))\n }}\n >\n {{@errors.length}}\n </EuiButtonEmpty>\n </:button>\n </EuiPopover>\n {{/if}}\n </div>\n <EuiButtonIcon\n class=\"euiMarkdownEditorFooter__help\"\n @iconType={{component MarkdownLogo}}\n @useComponent={{true}}\n @color=\"text\"\n @useSvg={{true}}\n {{! aria-label={ariaLabels.showMarkdownHelp} }}\n {{on \"click\" (set this \"isShowingHelp\" (not this.isShowingHelp))}}\n />\n\n {{#if this.isShowingHelp}}\n\n <EuiModal @onClose={{set this \"isShowingHelp\" false}}>\n <EuiModalHeader>\n <EuiTitle>\n <h3>\n Syntax Help\n {{! <EuiI18n\n token=\"euiMarkdownEditorFooter.syntaxTitle\"\n default=\"Syntax help\"\n /> }}\n </h3>\n </EuiTitle>\n </EuiModalHeader>\n <EuiModalBody>\n\n <EuiText>\n <p>The editor uses</p>\n <a\n href=\"https://github.github.com/gfm/\"\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n >\n Github flavored markdown\n </a>\n <p>You can also utilize these additional syntax plugins to add\n rich content to yoru text.</p>\n </EuiText>\n <EuiHorizontalRule />\n {{#each @uiPlugins as |uiPlugin|}}\n {{#if uiPlugin.helpText}}\n <EuiTitle size=\"xxs\">\n <p>\n <strong>{{uiPlugin.name}}</strong>\n </p>\n </EuiTitle>\n <EuiSpacer size=\"s\" />\n <EuiMarkdownFormat @value={{uiPlugin.helpText}} />\n <EuiSpacer size=\"l\" />\n\n {{/if}}\n {{/each}}\n </EuiModalBody>\n </EuiModal>\n\n {{/if}}\n </div>\n </template>\n}\n"],"names":["EuiMarkdownEditorFooterComponent","Component","g","prototype","tracked","i","void 0","setComponentTemplate","precompileTemplate","strictMode","scope","EuiButtonIcon","EuiLoadingSpinner","and","EuiPopover","set","EuiButtonEmpty","on","not","MarkdownLogo","EuiModal","EuiModalHeader","EuiTitle","EuiModalBody","EuiText","EuiHorizontalRule","EuiSpacer","EuiMarkdownFormat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6Be,MAAMA,yCAAyCC,SAAU,CAAA;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,eAAA,EAAA,CACrEC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAwB,KAAM;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,cAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,eAAA,CAAA,EAAAC,MAAA;AAAA,EAAA;IAAAJ,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,eAAA,EAAA,CAC9BC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAwB,KAAM;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,cAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,eAAA,CAAA,EAAAC,MAAA;AAE/B,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CA2FA,khFAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,aAAA;QAAAC,iBAAA;QAAAC,GAAA;oBAAAC,mBAAA;QAAAC,GAAA;QAAAC,cAAA;QAAAC,EAAA;QAAAC,GAAA;QAAAC,YAAA;QAAAC,QAAA;QAAAC,cAAA;QAAAC,QAAA;QAAAC,YAAA;iBAAAC,gBAAA;QAAAC,iBAAA;QAAAC,SAAA;AAAAC,2BAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -7,7 +7,7 @@ import { guidFor } from '@ember/object/internals';
|
|
|
7
7
|
import didInsert from '@ember/render-modifiers/modifiers/did-insert';
|
|
8
8
|
import didUpdate from '@ember/render-modifiers/modifiers/did-update';
|
|
9
9
|
import { scheduleOnce } from '@ember/runloop';
|
|
10
|
-
import pick from 'ember-composable-helpers/helpers/pick';
|
|
10
|
+
import pick from '@nullvoxpopuli/ember-composable-helpers/helpers/pick';
|
|
11
11
|
import { modifier } from 'ember-modifier';
|
|
12
12
|
import set from 'ember-set-helper/helpers/set';
|
|
13
13
|
import style from 'ember-style-modifier/modifiers/style';
|
|
@@ -87,81 +87,81 @@ class EuiMarkdownEditorComponent extends Component {
|
|
|
87
87
|
static {
|
|
88
88
|
g(this.prototype, "pluginEditorPlugin", [tracked]);
|
|
89
89
|
}
|
|
90
|
-
#pluginEditorPlugin = (i(this, "pluginEditorPlugin"),
|
|
90
|
+
#pluginEditorPlugin = (i(this, "pluginEditorPlugin"), void 0);
|
|
91
91
|
static {
|
|
92
92
|
g(this.prototype, "parsingPluginList", [argOrDefaultDecorator(defaultParsingPlugins)]);
|
|
93
93
|
}
|
|
94
|
-
#parsingPluginList = (i(this, "parsingPluginList"),
|
|
94
|
+
#parsingPluginList = (i(this, "parsingPluginList"), void 0); // Defaults
|
|
95
95
|
static {
|
|
96
96
|
g(this.prototype, "height", [argOrDefaultDecorator(250)]);
|
|
97
97
|
}
|
|
98
|
-
#height = (i(this, "height"),
|
|
98
|
+
#height = (i(this, "height"), void 0);
|
|
99
99
|
static {
|
|
100
100
|
g(this.prototype, "maxHeight", [argOrDefaultDecorator(500)]);
|
|
101
101
|
}
|
|
102
|
-
#maxHeight = (i(this, "maxHeight"),
|
|
102
|
+
#maxHeight = (i(this, "maxHeight"), void 0);
|
|
103
103
|
static {
|
|
104
104
|
g(this.prototype, "autoExpandPreview", [argOrDefaultDecorator(true)]);
|
|
105
105
|
}
|
|
106
|
-
#autoExpandPreview = (i(this, "autoExpandPreview"),
|
|
106
|
+
#autoExpandPreview = (i(this, "autoExpandPreview"), void 0);
|
|
107
107
|
static {
|
|
108
108
|
g(this.prototype, "processingPluginList", [argOrDefaultDecorator(defaultProcessingPlugins)]);
|
|
109
109
|
}
|
|
110
|
-
#processingPluginList = (i(this, "processingPluginList"),
|
|
110
|
+
#processingPluginList = (i(this, "processingPluginList"), void 0);
|
|
111
111
|
static {
|
|
112
112
|
g(this.prototype, "selectedNode", [tracked], function () {
|
|
113
113
|
return null;
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
#selectedNode = (i(this, "selectedNode"),
|
|
116
|
+
#selectedNode = (i(this, "selectedNode"), void 0);
|
|
117
117
|
static {
|
|
118
118
|
g(this.prototype, "editorId", [tracked], function () {
|
|
119
119
|
return this.args.editorId ?? guidFor({});
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
-
#editorId = (i(this, "editorId"),
|
|
122
|
+
#editorId = (i(this, "editorId"), void 0);
|
|
123
123
|
static {
|
|
124
124
|
g(this.prototype, "viewMode", [tracked], function () {
|
|
125
125
|
return this.args.initialViewMode || MODE_EDITING;
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
#viewMode = (i(this, "viewMode"),
|
|
128
|
+
#viewMode = (i(this, "viewMode"), void 0);
|
|
129
129
|
static {
|
|
130
130
|
g(this.prototype, "textareaRef", [tracked], function () {
|
|
131
131
|
return null;
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
#textareaRef = (i(this, "textareaRef"),
|
|
134
|
+
#textareaRef = (i(this, "textareaRef"), void 0);
|
|
135
135
|
static {
|
|
136
136
|
g(this.prototype, "previewRef", [tracked], function () {
|
|
137
137
|
return null;
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
|
-
#previewRef = (i(this, "previewRef"),
|
|
140
|
+
#previewRef = (i(this, "previewRef"), void 0);
|
|
141
141
|
static {
|
|
142
142
|
g(this.prototype, "editorToolbarRef", [tracked], function () {
|
|
143
143
|
return null;
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
|
-
#editorToolbarRef = (i(this, "editorToolbarRef"),
|
|
146
|
+
#editorToolbarRef = (i(this, "editorToolbarRef"), void 0);
|
|
147
147
|
static {
|
|
148
148
|
g(this.prototype, "currentHeight", [tracked], function () {
|
|
149
149
|
return 250;
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
#currentHeight = (i(this, "currentHeight"),
|
|
152
|
+
#currentHeight = (i(this, "currentHeight"), void 0);
|
|
153
153
|
static {
|
|
154
154
|
g(this.prototype, "editorFooterHeight", [tracked], function () {
|
|
155
155
|
return 0;
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
#editorFooterHeight = (i(this, "editorFooterHeight"),
|
|
158
|
+
#editorFooterHeight = (i(this, "editorFooterHeight"), void 0);
|
|
159
159
|
static {
|
|
160
160
|
g(this.prototype, "editorToolbarHeight", [tracked], function () {
|
|
161
161
|
return 0;
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
-
#editorToolbarHeight = (i(this, "editorToolbarHeight"),
|
|
164
|
+
#editorToolbarHeight = (i(this, "editorToolbarHeight"), void 0);
|
|
165
165
|
markdownActions;
|
|
166
166
|
get toolbarPlugins() {
|
|
167
167
|
return [tooltipPlugin, ...(this.args.uiPlugins || [])];
|