@hashicorp/design-system-components 4.12.0 → 4.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/components/hds/accordion/index.d.ts +1 -2
- package/declarations/components/hds/accordion/index.d.ts.map +1 -1
- package/declarations/components/hds/accordion/item/button.d.ts +1 -2
- package/declarations/components/hds/accordion/item/button.d.ts.map +1 -1
- package/declarations/components/hds/alert/index.d.ts +1 -28
- package/declarations/components/hds/alert/index.d.ts.map +1 -1
- package/declarations/components/hds/app-footer/status-link.d.ts +1 -1
- package/declarations/components/hds/button-set/index.d.ts +1 -1
- package/declarations/components/hds/button-set/index.d.ts.map +1 -1
- package/declarations/components/hds/code-block/index.d.ts +1 -0
- package/declarations/components/hds/code-block/index.d.ts.map +1 -1
- package/declarations/components/hds/dropdown/index.d.ts +1 -1
- package/declarations/components/hds/dropdown/index.d.ts.map +1 -1
- package/declarations/components/hds/dropdown/list-item/interactive.d.ts +3 -0
- package/declarations/components/hds/dropdown/list-item/interactive.d.ts.map +1 -1
- package/declarations/components/hds/dropdown/toggle/chevron.d.ts +1 -1
- package/declarations/components/hds/dropdown/toggle/chevron.d.ts.map +1 -1
- package/declarations/components/hds/flyout/body.d.ts +2 -1
- package/declarations/components/hds/flyout/body.d.ts.map +1 -1
- package/declarations/components/hds/flyout/description.d.ts +3 -3
- package/declarations/components/hds/flyout/description.d.ts.map +1 -1
- package/declarations/components/hds/flyout/footer.d.ts +1 -2
- package/declarations/components/hds/flyout/footer.d.ts.map +1 -1
- package/declarations/components/hds/flyout/index.d.ts +1 -1
- package/declarations/components/hds/flyout/index.d.ts.map +1 -1
- package/declarations/components/hds/form/character-count/index.d.ts +1 -2
- package/declarations/components/hds/form/character-count/index.d.ts.map +1 -1
- package/declarations/components/hds/form/checkbox/group.d.ts +1 -1
- package/declarations/components/hds/form/checkbox/group.d.ts.map +1 -1
- package/declarations/components/hds/form/file-input/base.d.ts +1 -1
- package/declarations/components/hds/form/file-input/base.d.ts.map +1 -1
- package/declarations/components/hds/form/file-input/field.d.ts +1 -1
- package/declarations/components/hds/form/file-input/field.d.ts.map +1 -1
- package/declarations/components/hds/form/masked-input/field.d.ts +1 -1
- package/declarations/components/hds/form/masked-input/field.d.ts.map +1 -1
- package/declarations/components/hds/form/radio/group.d.ts +1 -1
- package/declarations/components/hds/form/radio/group.d.ts.map +1 -1
- package/declarations/components/hds/form/radio-card/group.d.ts +1 -1
- package/declarations/components/hds/form/radio-card/group.d.ts.map +1 -1
- package/declarations/components/hds/form/select/field.d.ts +1 -1
- package/declarations/components/hds/form/select/field.d.ts.map +1 -1
- package/declarations/components/hds/form/super-select/after-options.d.ts +1 -1
- package/declarations/components/hds/form/super-select/after-options.d.ts.map +1 -1
- package/declarations/components/hds/form/super-select/multiple/base.d.ts.map +1 -1
- package/declarations/components/hds/form/super-select/multiple/field.d.ts +1 -2
- package/declarations/components/hds/form/super-select/multiple/field.d.ts.map +1 -1
- package/declarations/components/hds/form/super-select/option-group.d.ts +1 -2
- package/declarations/components/hds/form/super-select/option-group.d.ts.map +1 -1
- package/declarations/components/hds/form/super-select/placeholder.d.ts +1 -1
- package/declarations/components/hds/form/super-select/placeholder.d.ts.map +1 -1
- package/declarations/components/hds/form/super-select/single/field.d.ts +1 -2
- package/declarations/components/hds/form/super-select/single/field.d.ts.map +1 -1
- package/declarations/components/hds/form/text-input/field.d.ts +1 -2
- package/declarations/components/hds/form/text-input/field.d.ts.map +1 -1
- package/declarations/components/hds/form/textarea/field.d.ts +1 -1
- package/declarations/components/hds/form/textarea/field.d.ts.map +1 -1
- package/declarations/components/hds/form/toggle/base.d.ts +1 -1
- package/declarations/components/hds/form/toggle/base.d.ts.map +1 -1
- package/declarations/components/hds/form/toggle/group.d.ts +1 -1
- package/declarations/components/hds/form/toggle/group.d.ts.map +1 -1
- package/declarations/components/hds/modal/body.d.ts +2 -1
- package/declarations/components/hds/modal/body.d.ts.map +1 -1
- package/declarations/components/hds/modal/index.d.ts +2 -25
- package/declarations/components/hds/modal/index.d.ts.map +1 -1
- package/declarations/components/hds/page-header/index.d.ts +1 -1
- package/declarations/components/hds/page-header/index.d.ts.map +1 -1
- package/declarations/components/hds/pagination/compact/index.d.ts +1 -1
- package/declarations/components/hds/pagination/compact/index.d.ts.map +1 -1
- package/declarations/components/hds/pagination/info/index.d.ts +1 -2
- package/declarations/components/hds/pagination/info/index.d.ts.map +1 -1
- package/declarations/components/hds/pagination/nav/arrow.d.ts +1 -1
- package/declarations/components/hds/pagination/nav/arrow.d.ts.map +1 -1
- package/declarations/components/hds/pagination/nav/number.d.ts +1 -1
- package/declarations/components/hds/pagination/nav/number.d.ts.map +1 -1
- package/declarations/components/hds/pagination/size-selector/index.d.ts +1 -2
- package/declarations/components/hds/pagination/size-selector/index.d.ts.map +1 -1
- package/declarations/components/hds/reveal/index.d.ts +1 -2
- package/declarations/components/hds/reveal/index.d.ts.map +1 -1
- package/declarations/components/hds/rich-tooltip/index.d.ts +1 -2
- package/declarations/components/hds/rich-tooltip/index.d.ts.map +1 -1
- package/declarations/components/hds/segmented-group/index.d.ts +1 -1
- package/declarations/components/hds/segmented-group/index.d.ts.map +1 -1
- package/declarations/components/hds/separator/index.d.ts +1 -2
- package/declarations/components/hds/separator/index.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/header/home-link.d.ts +1 -2
- package/declarations/components/hds/side-nav/header/home-link.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/header/icon-button.d.ts +1 -2
- package/declarations/components/hds/side-nav/header/icon-button.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/header/index.d.ts +1 -1
- package/declarations/components/hds/side-nav/header/index.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/index.d.ts +1 -2
- package/declarations/components/hds/side-nav/index.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/portal/index.d.ts +1 -1
- package/declarations/components/hds/side-nav/portal/index.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/portal/target.d.ts +2 -3
- package/declarations/components/hds/side-nav/portal/target.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/toggle-button.d.ts +1 -1
- package/declarations/components/hds/side-nav/toggle-button.d.ts.map +1 -1
- package/declarations/components/hds/stepper/step/indicator.d.ts +1 -2
- package/declarations/components/hds/stepper/step/indicator.d.ts.map +1 -1
- package/declarations/components/hds/stepper/task/indicator.d.ts +2 -3
- package/declarations/components/hds/stepper/task/indicator.d.ts.map +1 -1
- package/declarations/components/hds/tabs/index.d.ts +1 -2
- package/declarations/components/hds/tabs/index.d.ts.map +1 -1
- package/declarations/components/hds/tag/index.d.ts +1 -2
- package/declarations/components/hds/tag/index.d.ts.map +1 -1
- package/declarations/modifiers/hds-anchored-position.d.ts +9 -0
- package/declarations/modifiers/hds-anchored-position.d.ts.map +1 -1
- package/declarations/modifiers/hds-register-event.d.ts +9 -0
- package/declarations/modifiers/hds-register-event.d.ts.map +1 -1
- package/dist/components/hds/accordion/index.js.map +1 -1
- package/dist/components/hds/accordion/item/button.js.map +1 -1
- package/dist/components/hds/alert/index.js +11 -33
- package/dist/components/hds/alert/index.js.map +1 -1
- package/dist/components/hds/button-set/index.js.map +1 -1
- package/dist/components/hds/code-block/index.js +2 -2
- package/dist/components/hds/code-block/index.js.map +1 -1
- package/dist/components/hds/dropdown/index.js +1 -1
- package/dist/components/hds/dropdown/index.js.map +1 -1
- package/dist/components/hds/dropdown/list-item/interactive.js.map +1 -1
- package/dist/components/hds/dropdown/toggle/chevron.js.map +1 -1
- package/dist/components/hds/flyout/body.js +2 -2
- package/dist/components/hds/flyout/body.js.map +1 -1
- package/dist/components/hds/flyout/description.js +2 -2
- package/dist/components/hds/flyout/description.js.map +1 -1
- package/dist/components/hds/flyout/footer.js.map +1 -1
- package/dist/components/hds/flyout/index.js +8 -0
- package/dist/components/hds/flyout/index.js.map +1 -1
- package/dist/components/hds/form/character-count/index.js.map +1 -1
- package/dist/components/hds/form/checkbox/group.js.map +1 -1
- package/dist/components/hds/form/file-input/base.js.map +1 -1
- package/dist/components/hds/form/file-input/field.js.map +1 -1
- package/dist/components/hds/form/masked-input/field.js.map +1 -1
- package/dist/components/hds/form/radio/group.js.map +1 -1
- package/dist/components/hds/form/radio-card/group.js.map +1 -1
- package/dist/components/hds/form/select/field.js.map +1 -1
- package/dist/components/hds/form/super-select/after-options.js.map +1 -1
- package/dist/components/hds/form/super-select/multiple/base.js +1 -1
- package/dist/components/hds/form/super-select/multiple/base.js.map +1 -1
- package/dist/components/hds/form/super-select/multiple/field.js.map +1 -1
- package/dist/components/hds/form/super-select/option-group.js.map +1 -1
- package/dist/components/hds/form/super-select/placeholder.js.map +1 -1
- package/dist/components/hds/form/super-select/single/field.js.map +1 -1
- package/dist/components/hds/form/text-input/field.js.map +1 -1
- package/dist/components/hds/form/textarea/field.js.map +1 -1
- package/dist/components/hds/form/toggle/base.js.map +1 -1
- package/dist/components/hds/form/toggle/group.js.map +1 -1
- package/dist/components/hds/modal/body.js +2 -2
- package/dist/components/hds/modal/body.js.map +1 -1
- package/dist/components/hds/modal/index.js +12 -36
- package/dist/components/hds/modal/index.js.map +1 -1
- package/dist/components/hds/page-header/index.js.map +1 -1
- package/dist/components/hds/pagination/compact/index.js.map +1 -1
- package/dist/components/hds/pagination/info/index.js.map +1 -1
- package/dist/components/hds/pagination/nav/arrow.js.map +1 -1
- package/dist/components/hds/pagination/nav/number.js.map +1 -1
- package/dist/components/hds/pagination/size-selector/index.js.map +1 -1
- package/dist/components/hds/reveal/index.js.map +1 -1
- package/dist/components/hds/rich-tooltip/index.js.map +1 -1
- package/dist/components/hds/segmented-group/index.js.map +1 -1
- package/dist/components/hds/separator/index.js.map +1 -1
- package/dist/components/hds/side-nav/header/home-link.js.map +1 -1
- package/dist/components/hds/side-nav/header/icon-button.js.map +1 -1
- package/dist/components/hds/side-nav/header/index.js.map +1 -1
- package/dist/components/hds/side-nav/index.js.map +1 -1
- package/dist/components/hds/side-nav/portal/index.js.map +1 -1
- package/dist/components/hds/side-nav/portal/target.js.map +1 -1
- package/dist/components/hds/side-nav/toggle-button.js.map +1 -1
- package/dist/components/hds/stepper/step/indicator.js.map +1 -1
- package/dist/components/hds/stepper/task/indicator.js.map +1 -1
- package/dist/components/hds/tabs/index.js.map +1 -1
- package/dist/components/hds/tag/index.js.map +1 -1
- package/dist/components/hds/toast/index.js +1 -1
- package/dist/components/hds/toast/index.js.map +1 -1
- package/dist/components/hds/tooltip-button/index.js.map +1 -1
- package/dist/modifiers/hds-anchored-position.js.map +1 -1
- package/dist/modifiers/hds-register-event.js.map +1 -1
- package/dist/styles/@hashicorp/design-system-components.css +18 -4
- package/dist/styles/components/dropdown.scss +16 -8
- package/dist/styles/components/form/super-select.scss +17 -3
- package/package.json +6 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sources":["../../../../../../src/components/hds/form/super-select/multiple/field.hbs","../../../../../../src/components/hds/form/super-select/multiple/field.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"vertical\\\"\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @isRequired={{@isRequired}}\\n @isOptional={{@isOptional}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because is controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n {{! Important: if an argument is added in base.hbs, it must also be added/processed here }}\\n <Hds::Form::SuperSelect::Multiple::Base\\n @afterOptionsComponent={{@afterOptionsComponent}}\\n @afterOptionsContent={{@afterOptionsContent}}\\n @ariaDescribedBy={{F.ariaDescribedBy}}\\n @ariaInvalid={{@ariaInvalid}}\\n @ariaLabel={{@ariaLabel}}\\n @ariaLabelledBy={{(concat this.idPrefix F.id)}}\\n @beforeOptionsComponent={{@beforeOptionsComponent}}\\n @disabled={{@disabled}}\\n @dropdownClass={{@dropdownClass}}\\n @dropdownMaxWidth={{@dropdownMaxWidth}}\\n @extra={{@extra}}\\n @groupComponent={{@groupComponent}}\\n @horizontalPosition={{@horizontalPosition}}\\n @initiallyOpened={{@initiallyOpened}}\\n @labelText={{@labelText}}\\n @loadingMessage={{@loadingMessage}}\\n @matcher={{@matcher}}\\n @matchTriggerWidth={{@matchTriggerWidth}}\\n @noMatchesMessage={{@noMatchesMessage}}\\n @onBlur={{@onBlur}}\\n @onChange={{@onChange}}\\n @onClose={{@onClose}}\\n @onFocus={{@onFocus}}\\n @onInput={{@onInput}}\\n @onKeydown={{@onKeydown}}\\n @onOpen={{@onOpen}}\\n @options={{@options}}\\n @optionsComponent={{@optionsComponent}}\\n @placeholder={{@placeholder}}\\n @placeholderComponent={{@placeholderComponent}}\\n @preventScroll={{@preventScroll}}\\n @registerAPI={{@registerAPI}}\\n @renderInPlace={{true}}\\n @resultCountMessage={{@resultCountMessage}}\\n @scrollTo={{@scrollTo}}\\n @search={{@search}}\\n @searchEnabled={{@searchEnabled}}\\n @searchField={{@searchField}}\\n @searchMessage={{@searchMessage}}\\n @searchPlaceholder={{@searchPlaceholder}}\\n @selected={{@selected}}\\n @selectedItemComponent={{@selectedItemComponent}}\\n @showAfterOptions={{@showAfterOptions}}\\n @tabindex={{@tabindex}}\\n @triggerClass={{@triggerClass}}\\n @triggerComponent={{@triggerComponent}}\\n @triggerId={{F.id}}\\n @triggerRole={{@triggerRole}}\\n @typeAheadOptionMatcher={{@typeAheadOptionMatcher}}\\n @verticalPosition={{@verticalPosition}}\\n @isInvalid={{@isInvalid}}\\n ...attributes\\n as |options select|\\n >\\n {{yield (hash options=options select=select Options=(component \\\"hds/yield\\\" options=options select=select))}}\\n </Hds::Form::SuperSelect::Multiple::Base>\\n </F.Control>\\n</Hds::Form::Field>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { ID_PREFIX } from '../../label/index.ts';\n\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormErrorSignature } from '../../error/index.ts';\nimport type { HdsFormFieldSignature } from '../../field/index.ts';\nimport type { HdsFormHelperTextSignature } from '../../helper-text/index.ts';\nimport type { HdsFormLabelSignature } from '../../label';\nimport type { HdsFormSuperSelectMultipleBaseSignature } from './base.ts';\nimport type { Select as PowerSelect } from 'ember-power-select/components/power-select';\nimport type { HdsYieldSignature } from '../../../yield/index.ts';\n\
|
|
1
|
+
{"version":3,"file":"field.js","sources":["../../../../../../src/components/hds/form/super-select/multiple/field.hbs","../../../../../../src/components/hds/form/super-select/multiple/field.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"vertical\\\"\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @isRequired={{@isRequired}}\\n @isOptional={{@isOptional}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because is controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n {{! Important: if an argument is added in base.hbs, it must also be added/processed here }}\\n <Hds::Form::SuperSelect::Multiple::Base\\n @afterOptionsComponent={{@afterOptionsComponent}}\\n @afterOptionsContent={{@afterOptionsContent}}\\n @ariaDescribedBy={{F.ariaDescribedBy}}\\n @ariaInvalid={{@ariaInvalid}}\\n @ariaLabel={{@ariaLabel}}\\n @ariaLabelledBy={{(concat this.idPrefix F.id)}}\\n @beforeOptionsComponent={{@beforeOptionsComponent}}\\n @disabled={{@disabled}}\\n @dropdownClass={{@dropdownClass}}\\n @dropdownMaxWidth={{@dropdownMaxWidth}}\\n @extra={{@extra}}\\n @groupComponent={{@groupComponent}}\\n @horizontalPosition={{@horizontalPosition}}\\n @initiallyOpened={{@initiallyOpened}}\\n @labelText={{@labelText}}\\n @loadingMessage={{@loadingMessage}}\\n @matcher={{@matcher}}\\n @matchTriggerWidth={{@matchTriggerWidth}}\\n @noMatchesMessage={{@noMatchesMessage}}\\n @onBlur={{@onBlur}}\\n @onChange={{@onChange}}\\n @onClose={{@onClose}}\\n @onFocus={{@onFocus}}\\n @onInput={{@onInput}}\\n @onKeydown={{@onKeydown}}\\n @onOpen={{@onOpen}}\\n @options={{@options}}\\n @optionsComponent={{@optionsComponent}}\\n @placeholder={{@placeholder}}\\n @placeholderComponent={{@placeholderComponent}}\\n @preventScroll={{@preventScroll}}\\n @registerAPI={{@registerAPI}}\\n @renderInPlace={{true}}\\n @resultCountMessage={{@resultCountMessage}}\\n @scrollTo={{@scrollTo}}\\n @search={{@search}}\\n @searchEnabled={{@searchEnabled}}\\n @searchField={{@searchField}}\\n @searchMessage={{@searchMessage}}\\n @searchPlaceholder={{@searchPlaceholder}}\\n @selected={{@selected}}\\n @selectedItemComponent={{@selectedItemComponent}}\\n @showAfterOptions={{@showAfterOptions}}\\n @tabindex={{@tabindex}}\\n @triggerClass={{@triggerClass}}\\n @triggerComponent={{@triggerComponent}}\\n @triggerId={{F.id}}\\n @triggerRole={{@triggerRole}}\\n @typeAheadOptionMatcher={{@typeAheadOptionMatcher}}\\n @verticalPosition={{@verticalPosition}}\\n @isInvalid={{@isInvalid}}\\n ...attributes\\n as |options select|\\n >\\n {{yield (hash options=options select=select Options=(component \\\"hds/yield\\\" options=options select=select))}}\\n </Hds::Form::SuperSelect::Multiple::Base>\\n </F.Control>\\n</Hds::Form::Field>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { ID_PREFIX } from '../../label/index.ts';\n\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormErrorSignature } from '../../error/index.ts';\nimport type { HdsFormFieldSignature } from '../../field/index.ts';\nimport type { HdsFormHelperTextSignature } from '../../helper-text/index.ts';\nimport type { HdsFormLabelSignature } from '../../label';\nimport type { HdsFormSuperSelectMultipleBaseSignature } from './base.ts';\nimport type { Select as PowerSelect } from 'ember-power-select/components/power-select';\nimport type { HdsYieldSignature } from '../../../yield/index.ts';\n\nexport interface HdsFormSuperSelectMultipleFieldSignature {\n Args: HdsFormSuperSelectMultipleBaseSignature['Args'] &\n HdsFormFieldSignature['Args'];\n Blocks: {\n default: [\n {\n Label?: ComponentLike<HdsFormLabelSignature>;\n HelperText?: ComponentLike<HdsFormHelperTextSignature>;\n Error?: ComponentLike<HdsFormErrorSignature>;\n Options?: ComponentLike<HdsYieldSignature>;\n options?: unknown;\n select?: PowerSelect;\n },\n ];\n };\n Element: HdsFormFieldSignature['Element'];\n}\n\nexport default class HdsFormSuperSelectMultipleField extends Component<HdsFormSuperSelectMultipleFieldSignature> {\n get idPrefix(): string {\n return ID_PREFIX;\n }\n}\n"],"names":["HdsFormSuperSelectMultipleField","Component","idPrefix","ID_PREFIX","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAe,kBAAkB,CAAC,k2FAAk2F;;ACDp4F;AACA;AACA;AACA;;AAgCe,MAAMA,+BAA+B,SAASC,SAAS,CAA2C;EAC/G,IAAIC,QAAQA,GAAW;AACrB,IAAA,OAAOC,SAAS,CAAA;AAClB,GAAA;AACF,CAAA;AAACC,oBAAA,CAAAC,QAAA,EAJoBL,+BAA+B,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"option-group.js","sources":["../../../../../src/components/hds/form/super-select/option-group.hbs","../../../../../src/components/hds/form/super-select/option-group.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<li class=\\\"hds-form-super-select__option-group\\\" role=\\\"group\\\" aria-labelledby={{this.groupTitleId}}>\\n <Hds::Text::Body\\n @tag=\\\"div\\\"\\n @size=\\\"100\\\"\\n @weight=\\\"semibold\\\"\\n class=\\\"hds-form-super-select__option-group-title\\\"\\n id={{this.groupTitleId}}\\n >\\n {{@group.groupName}}\\n </Hds::Text::Body>\\n {{yield}}\\n</li>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { guidFor } from '@ember/object/internals';\n\
|
|
1
|
+
{"version":3,"file":"option-group.js","sources":["../../../../../src/components/hds/form/super-select/option-group.hbs","../../../../../src/components/hds/form/super-select/option-group.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<li class=\\\"hds-form-super-select__option-group\\\" role=\\\"group\\\" aria-labelledby={{this.groupTitleId}}>\\n <Hds::Text::Body\\n @tag=\\\"div\\\"\\n @size=\\\"100\\\"\\n @weight=\\\"semibold\\\"\\n class=\\\"hds-form-super-select__option-group-title\\\"\\n id={{this.groupTitleId}}\\n >\\n {{@group.groupName}}\\n </Hds::Text::Body>\\n {{yield}}\\n</li>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { guidFor } from '@ember/object/internals';\n\nexport interface HdsFormSuperSelectOptionGroupSignature {\n Args: {\n group: {\n groupName?: string;\n };\n };\n Blocks: {\n default: [];\n };\n}\n\nexport default class HdsFormSuperSelectOptionGroup extends Component<HdsFormSuperSelectOptionGroupSignature> {\n /**\n * Generates a unique ID for the group title\n * @return {string}\n */\n groupTitleId = 'group-title-' + guidFor(this);\n}\n"],"names":["HdsFormSuperSelectOptionGroup","Component","constructor","args","_defineProperty","guidFor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;AACA,eAAe,kBAAkB,CAAC,0aAA0a;;ACkB7b,MAAMA,6BAA6B,SAASC,SAAS,CAAyC;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAC3G;AACF;AACA;AACA;AAHEC,IAAAA,eAAA,uBAIe,cAAc,GAAGC,OAAO,CAAC,IAAI,CAAC,CAAA,CAAA;AAAA,GAAA;AAC/C,CAAA;AAACC,oBAAA,CAAAC,QAAA,EANoBP,6BAA6B,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placeholder.js","sources":["../../../../../src/components/hds/form/super-select/placeholder.hbs","../../../../../src/components/hds/form/super-select/placeholder.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body @tag=\\\"span\\\" @size=\\\"200\\\" class=\\\"ember-power-select-placeholder\\\">{{@placeholder}}</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\
|
|
1
|
+
{"version":3,"file":"placeholder.js","sources":["../../../../../src/components/hds/form/super-select/placeholder.hbs","../../../../../src/components/hds/form/super-select/placeholder.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body @tag=\\\"span\\\" @size=\\\"200\\\" class=\\\"ember-power-select-placeholder\\\">{{@placeholder}}</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\nexport interface HdsFormSuperSelectPlaceholderSignature {\n Args: {\n placeholder?: string;\n };\n}\n\nconst HdsFormSuperSelectPlaceholder =\n templateOnlyComponent<HdsFormSuperSelectPlaceholderSignature>();\n\nexport default HdsFormSuperSelectPlaceholder;\n"],"names":["HdsFormSuperSelectPlaceholder","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,wMAAwM;;ACD1O;AACA;AACA;AACA;;AAUA,MAAMA,6BAA6B,GACjCC,qBAAqB,EAA0C,CAAA;AAEjE,kBAAAC,oBAAA,CAAAC,QAAA,EAAeH,6BAA6B,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sources":["../../../../../../src/components/hds/form/super-select/single/field.hbs","../../../../../../src/components/hds/form/super-select/single/field.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"vertical\\\"\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @isRequired={{@isRequired}}\\n @isOptional={{@isOptional}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because is controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n {{! Important: if an argument is added in base.hbs, it must also be added/processed here }}\\n <Hds::Form::SuperSelect::Single::Base\\n @afterOptionsComponent={{@afterOptionsComponent}}\\n @afterOptionsContent={{@afterOptionsContent}}\\n @ariaDescribedBy={{F.ariaDescribedBy}}\\n @ariaInvalid={{@ariaInvalid}}\\n @ariaLabel={{@ariaLabel}}\\n @ariaLabelledBy={{(concat this.idPrefix F.id)}}\\n @beforeOptionsComponent={{@beforeOptionsComponent}}\\n @closeOnSelect={{@closeOnSelect}}\\n @disabled={{@disabled}}\\n @dropdownClass={{@dropdownClass}}\\n @dropdownMaxWidth={{@dropdownMaxWidth}}\\n @extra={{@extra}}\\n @groupComponent={{@groupComponent}}\\n @horizontalPosition={{@horizontalPosition}}\\n @initiallyOpened={{@initiallyOpened}}\\n @labelText={{@labelText}}\\n @loadingMessage={{@loadingMessage}}\\n @matcher={{@matcher}}\\n @matchTriggerWidth={{@matchTriggerWidth}}\\n @noMatchesMessage={{@noMatchesMessage}}\\n @onBlur={{@onBlur}}\\n @onChange={{@onChange}}\\n @onClose={{@onClose}}\\n @onFocus={{@onFocus}}\\n @onInput={{@onInput}}\\n @onKeydown={{@onKeydown}}\\n @onOpen={{@onOpen}}\\n @options={{@options}}\\n @optionsComponent={{@optionsComponent}}\\n @placeholder={{@placeholder}}\\n @placeholderComponent={{@placeholderComponent}}\\n @preventScroll={{@preventScroll}}\\n @registerAPI={{@registerAPI}}\\n @renderInPlace={{true}}\\n @resultCountMessage={{@resultCountMessage}}\\n @scrollTo={{@scrollTo}}\\n @search={{@search}}\\n @searchEnabled={{@searchEnabled}}\\n @searchField={{@searchField}}\\n @searchMessage={{@searchMessage}}\\n @searchPlaceholder={{@searchPlaceholder}}\\n @selected={{@selected}}\\n @selectedItemComponent={{@selectedItemComponent}}\\n @showAfterOptions={{@showAfterOptions}}\\n @tabindex={{@tabindex}}\\n @triggerClass={{@triggerClass}}\\n @triggerComponent={{@triggerComponent}}\\n @triggerId={{F.id}}\\n @triggerRole={{@triggerRole}}\\n @typeAheadOptionMatcher={{@typeAheadOptionMatcher}}\\n @verticalPosition={{@verticalPosition}}\\n @isInvalid={{@isInvalid}}\\n ...attributes\\n as |options select|\\n >\\n {{yield (hash options=options select=select Options=(component \\\"hds/yield\\\" options=options select=select))}}\\n </Hds::Form::SuperSelect::Single::Base>\\n </F.Control>\\n</Hds::Form::Field>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { ID_PREFIX } from '../../label/index.ts';\n\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormErrorSignature } from '../../error/index.ts';\nimport type { HdsFormFieldSignature } from '../../field/index.ts';\nimport type { HdsFormHelperTextSignature } from '../../helper-text/index.ts';\nimport type { HdsFormLabelSignature } from '../../label';\nimport type { HdsFormSuperSelectSingleBaseSignature } from './base.ts';\nimport type { Select as PowerSelect } from 'ember-power-select/components/power-select';\nimport type { HdsYieldSignature } from '../../../yield/index.ts';\n\
|
|
1
|
+
{"version":3,"file":"field.js","sources":["../../../../../../src/components/hds/form/super-select/single/field.hbs","../../../../../../src/components/hds/form/super-select/single/field.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"vertical\\\"\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @isRequired={{@isRequired}}\\n @isOptional={{@isOptional}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because is controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n {{! Important: if an argument is added in base.hbs, it must also be added/processed here }}\\n <Hds::Form::SuperSelect::Single::Base\\n @afterOptionsComponent={{@afterOptionsComponent}}\\n @afterOptionsContent={{@afterOptionsContent}}\\n @ariaDescribedBy={{F.ariaDescribedBy}}\\n @ariaInvalid={{@ariaInvalid}}\\n @ariaLabel={{@ariaLabel}}\\n @ariaLabelledBy={{(concat this.idPrefix F.id)}}\\n @beforeOptionsComponent={{@beforeOptionsComponent}}\\n @closeOnSelect={{@closeOnSelect}}\\n @disabled={{@disabled}}\\n @dropdownClass={{@dropdownClass}}\\n @dropdownMaxWidth={{@dropdownMaxWidth}}\\n @extra={{@extra}}\\n @groupComponent={{@groupComponent}}\\n @horizontalPosition={{@horizontalPosition}}\\n @initiallyOpened={{@initiallyOpened}}\\n @labelText={{@labelText}}\\n @loadingMessage={{@loadingMessage}}\\n @matcher={{@matcher}}\\n @matchTriggerWidth={{@matchTriggerWidth}}\\n @noMatchesMessage={{@noMatchesMessage}}\\n @onBlur={{@onBlur}}\\n @onChange={{@onChange}}\\n @onClose={{@onClose}}\\n @onFocus={{@onFocus}}\\n @onInput={{@onInput}}\\n @onKeydown={{@onKeydown}}\\n @onOpen={{@onOpen}}\\n @options={{@options}}\\n @optionsComponent={{@optionsComponent}}\\n @placeholder={{@placeholder}}\\n @placeholderComponent={{@placeholderComponent}}\\n @preventScroll={{@preventScroll}}\\n @registerAPI={{@registerAPI}}\\n @renderInPlace={{true}}\\n @resultCountMessage={{@resultCountMessage}}\\n @scrollTo={{@scrollTo}}\\n @search={{@search}}\\n @searchEnabled={{@searchEnabled}}\\n @searchField={{@searchField}}\\n @searchMessage={{@searchMessage}}\\n @searchPlaceholder={{@searchPlaceholder}}\\n @selected={{@selected}}\\n @selectedItemComponent={{@selectedItemComponent}}\\n @showAfterOptions={{@showAfterOptions}}\\n @tabindex={{@tabindex}}\\n @triggerClass={{@triggerClass}}\\n @triggerComponent={{@triggerComponent}}\\n @triggerId={{F.id}}\\n @triggerRole={{@triggerRole}}\\n @typeAheadOptionMatcher={{@typeAheadOptionMatcher}}\\n @verticalPosition={{@verticalPosition}}\\n @isInvalid={{@isInvalid}}\\n ...attributes\\n as |options select|\\n >\\n {{yield (hash options=options select=select Options=(component \\\"hds/yield\\\" options=options select=select))}}\\n </Hds::Form::SuperSelect::Single::Base>\\n </F.Control>\\n</Hds::Form::Field>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { ID_PREFIX } from '../../label/index.ts';\n\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormErrorSignature } from '../../error/index.ts';\nimport type { HdsFormFieldSignature } from '../../field/index.ts';\nimport type { HdsFormHelperTextSignature } from '../../helper-text/index.ts';\nimport type { HdsFormLabelSignature } from '../../label';\nimport type { HdsFormSuperSelectSingleBaseSignature } from './base.ts';\nimport type { Select as PowerSelect } from 'ember-power-select/components/power-select';\nimport type { HdsYieldSignature } from '../../../yield/index.ts';\n\nexport interface HdsFormSuperSelectSingleFieldSignature {\n Args: HdsFormSuperSelectSingleBaseSignature['Args'] &\n HdsFormFieldSignature['Args'];\n Blocks: {\n default: [\n {\n Label?: ComponentLike<HdsFormLabelSignature>;\n HelperText?: ComponentLike<HdsFormHelperTextSignature>;\n Error?: ComponentLike<HdsFormErrorSignature>;\n Options?: ComponentLike<HdsYieldSignature>;\n options?: unknown;\n select?: PowerSelect;\n },\n ];\n };\n Element: HdsFormFieldSignature['Element'];\n}\n\nexport default class HdsFormSuperSelectSingleField extends Component<HdsFormSuperSelectSingleFieldSignature> {\n get idPrefix(): string {\n return ID_PREFIX;\n }\n}\n"],"names":["HdsFormSuperSelectSingleField","Component","idPrefix","ID_PREFIX","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAe,kBAAkB,CAAC,u4FAAu4F;;ACDz6F;AACA;AACA;AACA;;AAgCe,MAAMA,6BAA6B,SAASC,SAAS,CAAyC;EAC3G,IAAIC,QAAQA,GAAW;AACrB,IAAA,OAAOC,SAAS,CAAA;AAClB,GAAA;AACF,CAAA;AAACC,oBAAA,CAAAC,QAAA,EAJoBL,6BAA6B,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sources":["../../../../../src/components/hds/form/text-input/field.hbs","../../../../../src/components/hds/form/text-input/field.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"vertical\\\"\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @isRequired={{@isRequired}}\\n @isOptional={{@isOptional}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because is controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\\n {{#if F.CharacterCount}}\\n {{yield (hash CharacterCount=(component F.CharacterCount value=@value))}}\\n {{/if}}\\n <F.Control>\\n <div class=\\\"hds-form-text-input__wrapper\\\" {{style width=@width}}>\\n <Hds::Form::TextInput::Base\\n @type={{this.type}}\\n @value={{@value}}\\n @isInvalid={{@isInvalid}}\\n @isLoading={{@isLoading}}\\n @hasVisibilityToggle={{this.showVisibilityToggle}}\\n required={{@isRequired}}\\n ...attributes\\n id={{F.id}}\\n aria-describedby={{F.ariaDescribedBy}}\\n />\\n {{#if this.showVisibilityToggle}}\\n <Hds::Form::VisibilityToggle\\n @isVisible={{this.isPasswordMasked}}\\n @ariaLabel={{this.visibilityToggleAriaLabel}}\\n @ariaMessageText={{this.visibilityToggleAriaMessageText}}\\n aria-controls={{F.id}}\\n class=\\\"hds-form-text-input__visibility-toggle\\\"\\n {{on \\\"click\\\" this.onClickTogglePasswordReadability}}\\n />\\n {{/if}}\\n </div>\\n </F.Control>\\n</Hds::Form::Field>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\nimport type { HdsFormFieldSignature } from '../field';\nimport type { HdsFormTextInputBaseSignature } from './base';\nimport type { HdsFormErrorSignature } from '../error';\nimport type { HdsFormHelperTextSignature } from '../helper-text';\nimport type { HdsFormLabelSignature } from '../label';\nimport type { HdsFormVisibilityToggleSignature } from '../visibility-toggle';\nimport HdsFormCharacterCountComponent from '../character-count/index.ts';\n\
|
|
1
|
+
{"version":3,"file":"field.js","sources":["../../../../../src/components/hds/form/text-input/field.hbs","../../../../../src/components/hds/form/text-input/field.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"vertical\\\"\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @isRequired={{@isRequired}}\\n @isOptional={{@isOptional}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because is controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\\n {{#if F.CharacterCount}}\\n {{yield (hash CharacterCount=(component F.CharacterCount value=@value))}}\\n {{/if}}\\n <F.Control>\\n <div class=\\\"hds-form-text-input__wrapper\\\" {{style width=@width}}>\\n <Hds::Form::TextInput::Base\\n @type={{this.type}}\\n @value={{@value}}\\n @isInvalid={{@isInvalid}}\\n @isLoading={{@isLoading}}\\n @hasVisibilityToggle={{this.showVisibilityToggle}}\\n required={{@isRequired}}\\n ...attributes\\n id={{F.id}}\\n aria-describedby={{F.ariaDescribedBy}}\\n />\\n {{#if this.showVisibilityToggle}}\\n <Hds::Form::VisibilityToggle\\n @isVisible={{this.isPasswordMasked}}\\n @ariaLabel={{this.visibilityToggleAriaLabel}}\\n @ariaMessageText={{this.visibilityToggleAriaMessageText}}\\n aria-controls={{F.id}}\\n class=\\\"hds-form-text-input__visibility-toggle\\\"\\n {{on \\\"click\\\" this.onClickTogglePasswordReadability}}\\n />\\n {{/if}}\\n </div>\\n </F.Control>\\n</Hds::Form::Field>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\nimport type { HdsFormFieldSignature } from '../field';\nimport type { HdsFormTextInputBaseSignature } from './base';\nimport type { HdsFormErrorSignature } from '../error';\nimport type { HdsFormHelperTextSignature } from '../helper-text';\nimport type { HdsFormLabelSignature } from '../label';\nimport type { HdsFormVisibilityToggleSignature } from '../visibility-toggle';\nimport HdsFormCharacterCountComponent from '../character-count/index.ts';\n\nexport interface HdsFormTextInputFieldSignature {\n Args: Omit<HdsFormFieldSignature['Args'], 'contextualClass' | 'layout'> &\n HdsFormTextInputBaseSignature['Args'] & {\n visibilityToggleAriaLabel?: HdsFormVisibilityToggleSignature['Args']['ariaLabel'];\n visibilityToggleAriaMessageText?: HdsFormVisibilityToggleSignature['Args']['ariaMessageText'];\n };\n Blocks: {\n default: [\n {\n Label?: ComponentLike<HdsFormLabelSignature>;\n HelperText?: ComponentLike<HdsFormHelperTextSignature>;\n Error?: ComponentLike<HdsFormErrorSignature>;\n CharacterCount?: WithBoundArgs<\n typeof HdsFormCharacterCountComponent,\n 'value'\n >;\n },\n ];\n };\n Element: HdsFormFieldSignature['Element'];\n}\n\nexport default class HdsFormTextInputField extends Component<HdsFormTextInputFieldSignature> {\n @tracked isPasswordMasked = true;\n @tracked hasVisibilityToggle = this.args.hasVisibilityToggle ?? true;\n @tracked type = this.args.type ?? 'text';\n\n /**\n * @param showVisibilityToggle\n * @type {boolean}\n * @default false\n */\n get showVisibilityToggle(): boolean {\n return this.args.type === 'password' && this.hasVisibilityToggle;\n }\n\n /**\n * @param visibilityToggleAriaLabel\n * @type {string}\n * @default 'Show password'\n */\n get visibilityToggleAriaLabel(): string | undefined {\n if (this.args.visibilityToggleAriaLabel) {\n return this.args.visibilityToggleAriaLabel;\n } else if (this.isPasswordMasked) {\n return 'Show password';\n } else {\n return 'Hide password';\n }\n }\n\n /**\n * @param visibilityToggleAriaMessageText\n * @type {string}\n * @default 'Password is now hidden'\n */\n get visibilityToggleAriaMessageText(): string | undefined {\n if (this.args.visibilityToggleAriaMessageText) {\n return this.args.visibilityToggleAriaMessageText;\n } else if (this.isPasswordMasked) {\n return 'Password is hidden';\n } else {\n return 'Password is visible';\n }\n }\n\n @action\n onClickTogglePasswordReadability(): void {\n this.isPasswordMasked = !this.isPasswordMasked;\n this.type = this.isPasswordMasked ? 'password' : 'text';\n }\n}\n"],"names":["HdsFormTextInputField","_class","Component","constructor","args","_initializerDefineProperty","_descriptor","_descriptor2","_descriptor3","showVisibilityToggle","type","hasVisibilityToggle","visibilityToggleAriaLabel","isPasswordMasked","visibilityToggleAriaMessageText","onClickTogglePasswordReadability","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AACA,eAAe,kBAAkB,CAAC,0+CAA0+C;;;ACuCv/CA,IAAAA,qBAAqB,IAAAC,MAAA,GAA3B,MAAMD,qBAAqB,SAASE,SAAS,CAAiC;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,0BAAA,2BAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAAD,IAAAA,0BAAA,8BAAAE,YAAA,EAAA,IAAA,CAAA,CAAA;AAAAF,IAAAA,0BAAA,eAAAG,YAAA,EAAA,IAAA,CAAA,CAAA;AAAA,GAAA;AAK3F;AACF;AACA;AACA;AACA;EACE,IAAIC,oBAAoBA,GAAY;IAClC,OAAO,IAAI,CAACL,IAAI,CAACM,IAAI,KAAK,UAAU,IAAI,IAAI,CAACC,mBAAmB,CAAA;AAClE,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,yBAAyBA,GAAuB;AAClD,IAAA,IAAI,IAAI,CAACR,IAAI,CAACQ,yBAAyB,EAAE;AACvC,MAAA,OAAO,IAAI,CAACR,IAAI,CAACQ,yBAAyB,CAAA;AAC5C,KAAC,MAAM,IAAI,IAAI,CAACC,gBAAgB,EAAE;AAChC,MAAA,OAAO,eAAe,CAAA;AACxB,KAAC,MAAM;AACL,MAAA,OAAO,eAAe,CAAA;AACxB,KAAA;AACF,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,+BAA+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A,IAAA,OAAQ,IAAI,CAAClB,IAAI,CAACM,IAAI,IAAI,MAAM,CAAA;AAAA,GAAA;AAAA,CAAAM,CAAAA,EAAAA,yBAAA,CAAAf,MAAA,CAAAgB,SAAA,EAyCvCM,kCAAAA,EAAAA,CAAAA,MAAM,GAAAC,MAAA,CAAAC,wBAAA,CAAAxB,MAAA,CAAAgB,SAAA,EAAA,kCAAA,CAAA,EAAAhB,MAAA,CAAAgB,SAAA,IAAAhB,MAAA,EAAA;AA5CiCyB,oBAAA,CAAAC,QAAA,EAArB3B,qBAAqB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sources":["../../../../../src/components/hds/form/textarea/field.hbs","../../../../../src/components/hds/form/textarea/field.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"vertical\\\"\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @isRequired={{@isRequired}}\\n @isOptional={{@isOptional}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because is controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\\n {{#if F.CharacterCount}}\\n {{yield (hash CharacterCount=(component F.CharacterCount value=@value))}}\\n {{/if}}\\n <F.Control>\\n <Hds::Form::Textarea::Base\\n @value={{@value}}\\n @isInvalid={{@isInvalid}}\\n @width={{@width}}\\n @height={{@height}}\\n required={{@isRequired}}\\n ...attributes\\n id={{F.id}}\\n aria-describedby={{F.ariaDescribedBy}}\\n />\\n </F.Control>\\n</Hds::Form::Field>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\nimport type { HdsFormFieldSignature } from '../field';\nimport type { HdsFormTextareaBaseSignature } from './base';\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\nimport type { HdsFormErrorSignature } from '../error';\nimport type { HdsFormHelperTextSignature } from '../helper-text';\nimport type { HdsFormLabelSignature } from '../label';\nimport type HdsFormCharacterCountComponent from '../character-count';\n\
|
|
1
|
+
{"version":3,"file":"field.js","sources":["../../../../../src/components/hds/form/textarea/field.hbs","../../../../../src/components/hds/form/textarea/field.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"vertical\\\"\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @isRequired={{@isRequired}}\\n @isOptional={{@isOptional}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because is controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\\n {{#if F.CharacterCount}}\\n {{yield (hash CharacterCount=(component F.CharacterCount value=@value))}}\\n {{/if}}\\n <F.Control>\\n <Hds::Form::Textarea::Base\\n @value={{@value}}\\n @isInvalid={{@isInvalid}}\\n @width={{@width}}\\n @height={{@height}}\\n required={{@isRequired}}\\n ...attributes\\n id={{F.id}}\\n aria-describedby={{F.ariaDescribedBy}}\\n />\\n </F.Control>\\n</Hds::Form::Field>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\nimport type { HdsFormFieldSignature } from '../field';\nimport type { HdsFormTextareaBaseSignature } from './base';\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\nimport type { HdsFormErrorSignature } from '../error';\nimport type { HdsFormHelperTextSignature } from '../helper-text';\nimport type { HdsFormLabelSignature } from '../label';\nimport type HdsFormCharacterCountComponent from '../character-count';\n\nexport interface HdsFormTextareaFieldSignature {\n Args: Omit<HdsFormFieldSignature['Args'], 'contextualClass' | 'layout'> &\n HdsFormTextareaBaseSignature['Args'];\n Blocks: {\n default: [\n {\n Label?: ComponentLike<HdsFormLabelSignature>;\n HelperText?: ComponentLike<HdsFormHelperTextSignature>;\n Error?: ComponentLike<HdsFormErrorSignature>;\n CharacterCount?: WithBoundArgs<\n typeof HdsFormCharacterCountComponent,\n 'value'\n >;\n },\n ];\n };\n Element: HdsFormFieldSignature['Element'];\n}\n\nconst HdsFormTextareaField =\n templateOnlyComponent<HdsFormTextareaFieldSignature>();\n\nexport default HdsFormTextareaField;\n"],"names":["HdsFormTextareaField","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,o4BAAo4B;;ACDt6B;AACA;AACA;AACA;;AA+BA,MAAMA,oBAAoB,GACxBC,qBAAqB,EAAiC,CAAA;AAExD,YAAAC,oBAAA,CAAAC,QAAA,EAAeH,oBAAoB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/toggle/base.hbs","../../../../../src/components/hds/form/toggle/base.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class=\\\"hds-form-toggle\\\">\\n <input class=\\\"hds-form-toggle__control\\\" type=\\\"checkbox\\\" ...attributes value={{@value}} role=\\\"switch\\\" />\\n <div class=\\\"hds-form-toggle__facade\\\"></div>\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/toggle/base.hbs","../../../../../src/components/hds/form/toggle/base.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class=\\\"hds-form-toggle\\\">\\n <input class=\\\"hds-form-toggle__control\\\" type=\\\"checkbox\\\" ...attributes value={{@value}} role=\\\"switch\\\" />\\n <div class=\\\"hds-form-toggle__facade\\\"></div>\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\nexport interface HdsFormToggleBaseSignature {\n Args: {\n value?: string;\n };\n Element: HTMLInputElement;\n}\n\nconst HdsFormToggleBase = templateOnlyComponent<HdsFormToggleBaseSignature>();\n\nexport default HdsFormToggleBase;\n"],"names":["HdsFormToggleBase","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,yRAAyR;;ACD3T;AACA;AACA;AACA;;AAWA,MAAMA,iBAAiB,GAAGC,qBAAqB,EAA8B,CAAA;AAE7E,WAAAC,oBAAA,CAAAC,QAAA,EAAeH,iBAAiB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.js","sources":["../../../../../src/components/hds/form/toggle/group.hbs","../../../../../src/components/hds/form/toggle/group.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Fieldset @layout={{@layout}} @isRequired={{@isRequired}} @isOptional={{@isOptional}} ...attributes as |F|>\\n {{! Notice: the order of the elements is not relevant here, because it\\'s controlled at \\\"Hds::Form::Fieldset\\\" component level }}\\n {{yield (hash Legend=F.Legend HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n {{yield\\n (hash\\n ToggleField=(component\\n \\\"hds/form/toggle/field\\\"\\n contextualClass=\\\"hds-form-group__control-field\\\"\\n isRequired=@isRequired\\n extraAriaDescribedBy=F.ariaDescribedBy\\n )\\n )\\n }}\\n </F.Control>\\n</Hds::Form::Fieldset>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\nimport type { HdsFormFieldsetSignature } from '../fieldset';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormLegendSignature } from '../legend';\nimport type { HdsFormHelperTextSignature } from '../helper-text';\nimport type { HdsFormToggleFieldSignature } from './field';\nimport type { HdsFormErrorSignature } from '../error';\n\
|
|
1
|
+
{"version":3,"file":"group.js","sources":["../../../../../src/components/hds/form/toggle/group.hbs","../../../../../src/components/hds/form/toggle/group.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Fieldset @layout={{@layout}} @isRequired={{@isRequired}} @isOptional={{@isOptional}} ...attributes as |F|>\\n {{! Notice: the order of the elements is not relevant here, because it\\'s controlled at \\\"Hds::Form::Fieldset\\\" component level }}\\n {{yield (hash Legend=F.Legend HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n {{yield\\n (hash\\n ToggleField=(component\\n \\\"hds/form/toggle/field\\\"\\n contextualClass=\\\"hds-form-group__control-field\\\"\\n isRequired=@isRequired\\n extraAriaDescribedBy=F.ariaDescribedBy\\n )\\n )\\n }}\\n </F.Control>\\n</Hds::Form::Fieldset>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\nimport type { HdsFormFieldsetSignature } from '../fieldset';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormLegendSignature } from '../legend';\nimport type { HdsFormHelperTextSignature } from '../helper-text';\nimport type { HdsFormToggleFieldSignature } from './field';\nimport type { HdsFormErrorSignature } from '../error';\n\nexport interface HdsFormToggleGroupSignature {\n Args: HdsFormFieldsetSignature['Args'] & {\n name?: string;\n };\n Blocks: {\n default: [\n {\n Legend?: ComponentLike<HdsFormLegendSignature>;\n HelperText?: ComponentLike<HdsFormHelperTextSignature>;\n ToggleField?: ComponentLike<HdsFormToggleFieldSignature>;\n Error?: ComponentLike<HdsFormErrorSignature>;\n },\n ];\n };\n Element: HdsFormFieldsetSignature['Element'];\n}\n\nconst HdsFormToggleGroup = templateOnlyComponent<HdsFormToggleGroupSignature>();\n\nexport default HdsFormToggleGroup;\n"],"names":["HdsFormToggleGroup","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,ytBAAytB;;ACD3vB;AACA;AACA;AACA;;AA2BA,MAAMA,kBAAkB,GAAGC,qBAAqB,EAA+B,CAAA;AAE/E,YAAAC,oBAAA,CAAAC,QAAA,EAAeH,kBAAkB,CAAA;;;;"}
|
|
@@ -11,8 +11,8 @@ var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
class HdsModalBody extends Component {
|
|
14
|
-
constructor(owner) {
|
|
15
|
-
super(owner,
|
|
14
|
+
constructor(owner, args) {
|
|
15
|
+
super(owner, args);
|
|
16
16
|
deprecate('The `Hds::Modal::Body` sub-component is now deprecated and will be removed in the next major version of `@hashicorp/design-system-components`. Use `Hds::DialogPrimitive::Body` as one-to-one replacement.', false, {
|
|
17
17
|
id: 'hds.components.modal.body',
|
|
18
18
|
until: '5.0.0',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","sources":["../../../../src/components/hds/modal/body.hbs","../../../../src/components/hds/modal/body.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{!\\n THIS SUBCOMPONENT IS NOW DEPRECATED\\n}}\\n<div class=\\\"hds-modal__body\\\" ...attributes>\\n {{yield}}\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { deprecate } from '@ember/debug';\n\nexport interface HdsModalBodySignature {\n Blocks: {\n default: [];\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsModalBody extends Component<HdsModalBodySignature> {\n constructor(owner: unknown) {\n super(owner,
|
|
1
|
+
{"version":3,"file":"body.js","sources":["../../../../src/components/hds/modal/body.hbs","../../../../src/components/hds/modal/body.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{!\\n THIS SUBCOMPONENT IS NOW DEPRECATED\\n}}\\n<div class=\\\"hds-modal__body\\\" ...attributes>\\n {{yield}}\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { deprecate } from '@ember/debug';\n\nexport interface HdsModalBodySignature {\n // when component has no args, but constructor still needs to be defined, use `never`\n // see: https://github.com/hashicorp/design-system/pull/2511/files/f2146e5243d0431892a62d2fbf2889f1cbd3e525#r1815255004\n Args: never;\n Blocks: {\n default: [];\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsModalBody extends Component<HdsModalBodySignature> {\n constructor(owner: unknown, args: HdsModalBodySignature['Args']) {\n super(owner, args);\n\n deprecate(\n 'The `Hds::Modal::Body` sub-component is now deprecated and will be removed in the next major version of `@hashicorp/design-system-components`. Use `Hds::DialogPrimitive::Body` as one-to-one replacement.',\n false,\n {\n id: 'hds.components.modal.body',\n until: '5.0.0',\n url: 'https://helios.hashicorp.design/components/flyout?tab=version%20history#460',\n for: '@hashicorp/design-system-components',\n since: {\n enabled: '4.6.0',\n },\n }\n );\n }\n}\n"],"names":["HdsModalBody","Component","constructor","owner","args","deprecate","id","until","url","for","since","enabled","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAe,kBAAkB,CAAC,kMAAkM;;ACDpO;AACA;AACA;AACA;;AAee,MAAMA,YAAY,SAASC,SAAS,CAAwB;AACzEC,EAAAA,WAAWA,CAACC,KAAc,EAAEC,IAAmC,EAAE;AAC/D,IAAA,KAAK,CAACD,KAAK,EAAEC,IAAI,CAAC,CAAA;AAElBC,IAAAA,SAAS,CACP,4MAA4M,EAC5M,KAAK,EACL;AACEC,MAAAA,EAAE,EAAE,2BAA2B;AAC/BC,MAAAA,KAAK,EAAE,OAAO;AACdC,MAAAA,GAAG,EAAE,6EAA6E;AAClFC,MAAAA,GAAG,EAAE,qCAAqC;AAC1CC,MAAAA,KAAK,EAAE;AACLC,QAAAA,OAAO,EAAE,OAAA;AACX,OAAA;AACF,KACF,CAAC,CAAA;AACH,GAAA;AACF,CAAA;AAACC,oBAAA,CAAAC,QAAA,EAlBoBb,YAAY,CAAA;;;;"}
|
|
@@ -14,7 +14,7 @@ import { setComponentTemplate } from '@ember/component';
|
|
|
14
14
|
|
|
15
15
|
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<Hds::DialogPrimitive::Wrapper\n class={{this.classNames}}\n ...attributes\n aria-labelledby={{this.id}}\n {{did-insert this.didInsert}}\n {{will-destroy this.willDestroyNode}}\n {{! @glint-expect-error - https://github.com/josemarluedke/ember-focus-trap/issues/86 }}\n {{focus-trap isActive=this.isOpen focusTrapOptions=(hash onDeactivate=this.onDismiss clickOutsideDeactivates=true)}}\n>\n <:header>\n {{yield\n (hash\n Header=(component\n \"hds/dialog-primitive/header\"\n id=this.id\n onDismiss=this.onDismiss\n contextualClassPrefix=\"hds-modal\"\n titleTag=\"h1\"\n )\n )\n }}\n </:header>\n <:body>\n {{yield (hash Body=(component \"hds/dialog-primitive/body\" contextualClass=\"hds-modal__body\"))}}\n </:body>\n <:footer>\n {{yield\n (hash\n Footer=(component \"hds/dialog-primitive/footer\" onDismiss=this.onDismiss contextualClass=\"hds-modal__footer\")\n )\n }}\n </:footer>\n</Hds::DialogPrimitive::Wrapper>\n\n{{#if this.isOpen}}\n <Hds::DialogPrimitive::Overlay @contextualClass=\"hds-modal__overlay\" />\n{{/if}}");
|
|
16
16
|
|
|
17
|
-
var _class, _descriptor
|
|
17
|
+
var _class, _descriptor;
|
|
18
18
|
const waiter = buildWaiter('@hashicorp/design-system-components:modal');
|
|
19
19
|
const DEFAULT_SIZE = HdsModalSizeValues.Medium;
|
|
20
20
|
const DEFAULT_COLOR = HdsModalColorValues.Neutral;
|
|
@@ -24,19 +24,13 @@ let HdsModal = (_class = class HdsModal extends Component {
|
|
|
24
24
|
constructor(...args) {
|
|
25
25
|
super(...args);
|
|
26
26
|
_initializerDefineProperty(this, "isOpen", _descriptor, this);
|
|
27
|
-
_initializerDefineProperty(this, "isDismissDisabled", _descriptor2, this);
|
|
28
27
|
_defineProperty(this, "element", void 0);
|
|
29
28
|
_defineProperty(this, "body", void 0);
|
|
30
29
|
_defineProperty(this, "bodyInitialOverflowValue", '');
|
|
31
30
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*
|
|
36
|
-
* @param size
|
|
37
|
-
* @type {string}
|
|
38
|
-
* @default 'medium'
|
|
39
|
-
*/
|
|
31
|
+
get isDismissDisabled() {
|
|
32
|
+
return this.args.isDismissDisabled ?? false;
|
|
33
|
+
}
|
|
40
34
|
get size() {
|
|
41
35
|
const {
|
|
42
36
|
size = DEFAULT_SIZE
|
|
@@ -44,15 +38,6 @@ let HdsModal = (_class = class HdsModal extends Component {
|
|
|
44
38
|
assert(`@size for "Hds::Modal" must be one of the following: ${SIZES.join(', ')}; received: ${size}`, SIZES.includes(size));
|
|
45
39
|
return size;
|
|
46
40
|
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Sets the color of the modal dialog
|
|
50
|
-
* Accepted values: neutral, warning, critical
|
|
51
|
-
*
|
|
52
|
-
* @param color
|
|
53
|
-
* @type {string}
|
|
54
|
-
* @default 'neutral'
|
|
55
|
-
*/
|
|
56
41
|
get color() {
|
|
57
42
|
const {
|
|
58
43
|
color = DEFAULT_COLOR
|
|
@@ -60,19 +45,9 @@ let HdsModal = (_class = class HdsModal extends Component {
|
|
|
60
45
|
assert(`@color for "Hds::Modal" must be one of the following: ${COLORS.join(', ')}; received: ${color}`, COLORS.includes(color));
|
|
61
46
|
return color;
|
|
62
47
|
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Calculates the unique ID to assign to the title
|
|
66
|
-
*/
|
|
67
48
|
get id() {
|
|
68
49
|
return getElementId(this);
|
|
69
50
|
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Get the class names to apply to the component.
|
|
73
|
-
* @method classNames
|
|
74
|
-
* @return {string} The "class" attribute to apply to the component.
|
|
75
|
-
*/
|
|
76
51
|
get classNames() {
|
|
77
52
|
const classes = ['hds-modal'];
|
|
78
53
|
|
|
@@ -163,6 +138,14 @@ let HdsModal = (_class = class HdsModal extends Component {
|
|
|
163
138
|
this.body.style.setProperty('overflow', this.bodyInitialOverflowValue);
|
|
164
139
|
}
|
|
165
140
|
}
|
|
141
|
+
|
|
142
|
+
// Return focus to a specific element (if provided)
|
|
143
|
+
if (this.args.returnFocusTo) {
|
|
144
|
+
const initiator = document.getElementById(this.args.returnFocusTo);
|
|
145
|
+
if (initiator) {
|
|
146
|
+
initiator.focus();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
166
149
|
}
|
|
167
150
|
}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "isOpen", [tracked], {
|
|
168
151
|
configurable: true,
|
|
@@ -171,13 +154,6 @@ let HdsModal = (_class = class HdsModal extends Component {
|
|
|
171
154
|
initializer: function () {
|
|
172
155
|
return false;
|
|
173
156
|
}
|
|
174
|
-
}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "isDismissDisabled", [tracked], {
|
|
175
|
-
configurable: true,
|
|
176
|
-
enumerable: true,
|
|
177
|
-
writable: true,
|
|
178
|
-
initializer: function () {
|
|
179
|
-
return this.args.isDismissDisabled ?? false;
|
|
180
|
-
}
|
|
181
157
|
}), _applyDecoratedDescriptor(_class.prototype, "registerOnCloseCallback", [action], Object.getOwnPropertyDescriptor(_class.prototype, "registerOnCloseCallback"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "didInsert", [action], Object.getOwnPropertyDescriptor(_class.prototype, "didInsert"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "willDestroyNode", [action], Object.getOwnPropertyDescriptor(_class.prototype, "willDestroyNode"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "open", [action], Object.getOwnPropertyDescriptor(_class.prototype, "open"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onDismiss", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onDismiss"), _class.prototype)), _class);
|
|
182
158
|
setComponentTemplate(TEMPLATE, HdsModal);
|
|
183
159
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/hds/modal/index.hbs","../../../../src/components/hds/modal/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::DialogPrimitive::Wrapper\\n class={{this.classNames}}\\n ...attributes\\n aria-labelledby={{this.id}}\\n {{did-insert this.didInsert}}\\n {{will-destroy this.willDestroyNode}}\\n {{! @glint-expect-error - https://github.com/josemarluedke/ember-focus-trap/issues/86 }}\\n {{focus-trap isActive=this.isOpen focusTrapOptions=(hash onDeactivate=this.onDismiss clickOutsideDeactivates=true)}}\\n>\\n <:header>\\n {{yield\\n (hash\\n Header=(component\\n \\\"hds/dialog-primitive/header\\\"\\n id=this.id\\n onDismiss=this.onDismiss\\n contextualClassPrefix=\\\"hds-modal\\\"\\n titleTag=\\\"h1\\\"\\n )\\n )\\n }}\\n </:header>\\n <:body>\\n {{yield (hash Body=(component \\\"hds/dialog-primitive/body\\\" contextualClass=\\\"hds-modal__body\\\"))}}\\n </:body>\\n <:footer>\\n {{yield\\n (hash\\n Footer=(component \\\"hds/dialog-primitive/footer\\\" onDismiss=this.onDismiss contextualClass=\\\"hds-modal__footer\\\")\\n )\\n }}\\n </:footer>\\n</Hds::DialogPrimitive::Wrapper>\\n\\n{{#if this.isOpen}}\\n <Hds::DialogPrimitive::Overlay @contextualClass=\\\"hds-modal__overlay\\\" />\\n{{/if}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\nimport { getElementId } from '../../../utils/hds-get-element-id.ts';\nimport { buildWaiter } from '@ember/test-waiters';\n\nimport type { WithBoundArgs } from '@glint/template';\nimport type { HdsModalSizes, HdsModalColors } from './types.ts';\n\nimport HdsDialogPrimitiveHeaderComponent from '../dialog-primitive/header.ts';\nimport HdsDialogPrimitiveBodyComponent from '../dialog-primitive/body.ts';\nimport HdsDialogPrimitiveFooterComponent from '../dialog-primitive/footer.ts';\nimport { HdsModalSizeValues, HdsModalColorValues } from './types.ts';\n\nconst waiter = buildWaiter('@hashicorp/design-system-components:modal');\n\nexport const DEFAULT_SIZE = HdsModalSizeValues.Medium;\nexport const DEFAULT_COLOR = HdsModalColorValues.Neutral;\n\nexport const SIZES: string[] = Object.values(HdsModalSizeValues);\nexport const COLORS: string[] = Object.values(HdsModalColorValues);\n\nexport interface HdsModalSignature {\n Args: {\n isDismissDisabled?: boolean;\n size?: HdsModalSizes;\n color?: HdsModalColors;\n onOpen?: () => void;\n onClose?: (event: Event) => void;\n };\n Blocks: {\n default: [\n {\n Header?: WithBoundArgs<\n typeof HdsDialogPrimitiveHeaderComponent,\n 'id' | 'onDismiss' | 'contextualClassPrefix'\n >;\n Body?: WithBoundArgs<\n typeof HdsDialogPrimitiveBodyComponent,\n 'contextualClass'\n >;\n Footer?: WithBoundArgs<\n typeof HdsDialogPrimitiveFooterComponent,\n 'onDismiss' | 'contextualClass'\n >;\n },\n ];\n };\n Element: HTMLDialogElement;\n}\n\nexport default class HdsModal extends Component<HdsModalSignature> {\n @tracked isOpen = false;\n @tracked isDismissDisabled = this.args.isDismissDisabled ?? false;\n element!: HTMLDialogElement;\n body!: HTMLElement;\n bodyInitialOverflowValue = '';\n\n /**\n * Sets the size of the modal dialog\n * Accepted values: small, medium, large\n *\n * @param size\n * @type {string}\n * @default 'medium'\n */\n get size(): HdsModalSizes {\n const { size = DEFAULT_SIZE } = this.args;\n\n assert(\n `@size for \"Hds::Modal\" must be one of the following: ${SIZES.join(\n ', '\n )}; received: ${size}`,\n SIZES.includes(size)\n );\n\n return size;\n }\n\n /**\n * Sets the color of the modal dialog\n * Accepted values: neutral, warning, critical\n *\n * @param color\n * @type {string}\n * @default 'neutral'\n */\n get color(): HdsModalColors {\n const { color = DEFAULT_COLOR } = this.args;\n\n assert(\n `@color for \"Hds::Modal\" must be one of the following: ${COLORS.join(\n ', '\n )}; received: ${color}`,\n COLORS.includes(color)\n );\n\n return color;\n }\n\n /**\n * Calculates the unique ID to assign to the title\n */\n get id(): string {\n return getElementId(this);\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-modal'];\n\n // add a class based on the @size argument\n classes.push(`hds-modal--size-${this.size}`);\n\n // add a class based on the @color argument\n classes.push(`hds-modal--color-${this.color}`);\n\n return classes.join(' ');\n }\n\n @action registerOnCloseCallback(event: Event): void {\n if (\n !this.isDismissDisabled &&\n this.args.onClose &&\n typeof this.args.onClose === 'function'\n ) {\n this.args.onClose(event);\n }\n\n // If the dismissal of the modal is disabled, we keep the modal open/visible otherwise we mark it as closed\n if (this.isDismissDisabled) {\n // If, in a chain of events, the element is not attached to the DOM, the `showModal` would fail\n // so we add this safeguard condition that checks for the `<dialog>` to have a parent\n if (this.element.parentElement) {\n // As there is no way to `preventDefault` on `close` events, we call the `showModal` function\n // preserving the state of the modal dialog\n this.element.showModal();\n }\n } else {\n this.isOpen = false;\n }\n }\n\n @action\n didInsert(element: HTMLDialogElement): void {\n // Store references of `<dialog>` and `<body>` elements\n this.element = element;\n this.body = document.body;\n\n if (this.body) {\n // Store the initial `overflow` value of `<body>` so we can reset to it\n this.bodyInitialOverflowValue =\n this.body.style.getPropertyValue('overflow');\n }\n\n // Register \"onClose\" callback function to be called when a native 'close' event is dispatched\n this.element.addEventListener('close', this.registerOnCloseCallback, true);\n\n // If the modal dialog is not already open\n if (!this.element.open) {\n this.open();\n }\n }\n\n @action\n willDestroyNode(): void {\n if (this.element) {\n this.element.removeEventListener(\n 'close',\n this.registerOnCloseCallback,\n true\n );\n }\n }\n\n @action\n open(): void {\n // Make modal dialog visible using the native `showModal` method\n this.element.showModal();\n this.isOpen = true;\n\n // Prevent page from scrolling when the dialog is open\n if (this.body) this.body.style.setProperty('overflow', 'hidden');\n\n // Call \"onOpen\" callback function\n if (this.args.onOpen && typeof this.args.onOpen === 'function') {\n this.args.onOpen();\n }\n }\n\n @action\n async onDismiss(): Promise<void> {\n // allow ember test helpers to be aware of when the `close` event fires\n // when using `click` or other helpers from '@ember/test-helpers'\n // Notice: this code will get stripped out in production builds (DEBUG evaluates to `true` in dev/test builds, but `false` in prod builds)\n if (this.element.open) {\n const token = waiter.beginAsync();\n const listener = () => {\n waiter.endAsync(token);\n this.element.removeEventListener('close', listener);\n };\n this.element.addEventListener('close', listener);\n }\n\n // Make modal dialog invisible using the native `close` method\n this.element.close();\n\n // Reset page `overflow` property\n if (this.body) {\n this.body.style.removeProperty('overflow');\n if (this.bodyInitialOverflowValue === '') {\n if (this.body.style.length === 0) {\n this.body.removeAttribute('style');\n }\n } else {\n this.body.style.setProperty('overflow', this.bodyInitialOverflowValue);\n }\n }\n }\n}\n"],"names":["waiter","buildWaiter","DEFAULT_SIZE","HdsModalSizeValues","Medium","DEFAULT_COLOR","HdsModalColorValues","Neutral","SIZES","Object","values","COLORS","HdsModal","_class","Component","constructor","args","_initializerDefineProperty","_descriptor","_descriptor2","_defineProperty","size","assert","join","includes","color","id","getElementId","classNames","classes","push","registerOnCloseCallback","event","isDismissDisabled","onClose","element","parentElement","showModal","isOpen","didInsert","body","document","bodyInitialOverflowValue","style","getPropertyValue","addEventListener","open","willDestroyNode","removeEventListener","setProperty","onOpen","onDismiss","token","beginAsync","listener","endAsync","close","removeProperty","length","removeAttribute","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;;;;;;AACA,eAAe,kBAAkB,CAAC,usCAAusC;;;ACmBzuC,MAAMA,MAAM,GAAGC,WAAW,CAAC,2CAA2C,CAAC,CAAA;AAE1DC,MAAAA,YAAY,GAAGC,kBAAkB,CAACC,OAAM;AACxCC,MAAAA,aAAa,GAAGC,mBAAmB,CAACC,QAAO;AAEjD,MAAMC,KAAe,GAAGC,MAAM,CAACC,MAAM,CAACP,kBAAkB,EAAC;AACzD,MAAMQ,MAAgB,GAAGF,MAAM,CAACC,MAAM,CAACJ,mBAAmB,EAAC;AA+B7CM,IAAAA,QAAQ,IAAAC,MAAA,GAAd,MAAMD,QAAQ,SAASE,SAAS,CAAoB;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,0BAAA,iBAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAAD,IAAAA,0BAAA,4BAAAE,YAAA,EAAA,IAAA,CAAA,CAAA;IAAAC,eAAA,CAAA,IAAA,EAAA,SAAA,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AA,MAAM,GAAA1D,MAAA,CAAA2D,wBAAA,CAAAvD,MAAA,CAAAgD,SAAA,EAAAhD,WAAAA,CAAAA,EAAAA,MAAA,CAAAgD,SAAA,CAAA,EAAAD,yBAAA,CAAA/C,MAAA,CAAAgD,SAAA,EAAA,iBAAA,EAAA,CAqBNM,MAAM,CAAA,EAAA1D,MAAA,CAAA2D,wBAAA,CAAAvD,MAAA,CAAAgD,SAAA,EAAA,iBAAA,CAAA,EAAAhD,MAAA,CAAAgD,SAAA,CAAAD,EAAAA,yBAAA,CAAA/C,MAAA,CAAAgD,SAAA,EAAA,MAAA,EAAA,CAWNM,MAAM,CAAA1D,EAAAA,MAAA,CAAA2D,wBAAA,CAAAvD,MAAA,CAAAgD,SAAA,EAAA,MAAA,CAAA,EAAAhD,MAAA,CAAAgD,SAAA,GAAAD,yBAAA,CAAA/C,MAAA,CAAAgD,SAAA,EAeNM,WAAAA,EAAAA,CAAAA,MAAM,CAAA1D,EAAAA,MAAA,CAAA2D,wBAAA,CAAAvD,MAAA,CAAAgD,SAAA,gBAAAhD,MAAA,CAAAgD,SAAA,CAAA,GAAAhD,MAAA,EAAA;AA/IoBwD,oBAAA,CAAAC,QAAA,EAAR1D,QAAQ,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/hds/modal/index.hbs","../../../../src/components/hds/modal/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::DialogPrimitive::Wrapper\\n class={{this.classNames}}\\n ...attributes\\n aria-labelledby={{this.id}}\\n {{did-insert this.didInsert}}\\n {{will-destroy this.willDestroyNode}}\\n {{! @glint-expect-error - https://github.com/josemarluedke/ember-focus-trap/issues/86 }}\\n {{focus-trap isActive=this.isOpen focusTrapOptions=(hash onDeactivate=this.onDismiss clickOutsideDeactivates=true)}}\\n>\\n <:header>\\n {{yield\\n (hash\\n Header=(component\\n \\\"hds/dialog-primitive/header\\\"\\n id=this.id\\n onDismiss=this.onDismiss\\n contextualClassPrefix=\\\"hds-modal\\\"\\n titleTag=\\\"h1\\\"\\n )\\n )\\n }}\\n </:header>\\n <:body>\\n {{yield (hash Body=(component \\\"hds/dialog-primitive/body\\\" contextualClass=\\\"hds-modal__body\\\"))}}\\n </:body>\\n <:footer>\\n {{yield\\n (hash\\n Footer=(component \\\"hds/dialog-primitive/footer\\\" onDismiss=this.onDismiss contextualClass=\\\"hds-modal__footer\\\")\\n )\\n }}\\n </:footer>\\n</Hds::DialogPrimitive::Wrapper>\\n\\n{{#if this.isOpen}}\\n <Hds::DialogPrimitive::Overlay @contextualClass=\\\"hds-modal__overlay\\\" />\\n{{/if}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\nimport { getElementId } from '../../../utils/hds-get-element-id.ts';\nimport { buildWaiter } from '@ember/test-waiters';\n\nimport type { WithBoundArgs } from '@glint/template';\nimport type { HdsModalSizes, HdsModalColors } from './types.ts';\n\nimport HdsDialogPrimitiveHeaderComponent from '../dialog-primitive/header.ts';\nimport HdsDialogPrimitiveBodyComponent from '../dialog-primitive/body.ts';\nimport HdsDialogPrimitiveFooterComponent from '../dialog-primitive/footer.ts';\nimport { HdsModalSizeValues, HdsModalColorValues } from './types.ts';\n\nconst waiter = buildWaiter('@hashicorp/design-system-components:modal');\n\nexport const DEFAULT_SIZE = HdsModalSizeValues.Medium;\nexport const DEFAULT_COLOR = HdsModalColorValues.Neutral;\n\nexport const SIZES: string[] = Object.values(HdsModalSizeValues);\nexport const COLORS: string[] = Object.values(HdsModalColorValues);\n\nexport interface HdsModalSignature {\n Args: {\n isDismissDisabled?: boolean;\n size?: HdsModalSizes;\n color?: HdsModalColors;\n returnFocusTo?: string;\n onOpen?: () => void;\n onClose?: (event: Event) => void;\n };\n Blocks: {\n default: [\n {\n Header?: WithBoundArgs<\n typeof HdsDialogPrimitiveHeaderComponent,\n 'id' | 'onDismiss' | 'contextualClassPrefix'\n >;\n Body?: WithBoundArgs<\n typeof HdsDialogPrimitiveBodyComponent,\n 'contextualClass'\n >;\n Footer?: WithBoundArgs<\n typeof HdsDialogPrimitiveFooterComponent,\n 'onDismiss' | 'contextualClass'\n >;\n },\n ];\n };\n Element: HTMLDialogElement;\n}\n\nexport default class HdsModal extends Component<HdsModalSignature> {\n @tracked isOpen = false;\n element!: HTMLDialogElement;\n body!: HTMLElement;\n bodyInitialOverflowValue = '';\n\n get isDismissDisabled(): boolean {\n return this.args.isDismissDisabled ?? false;\n }\n\n get size(): HdsModalSizes {\n const { size = DEFAULT_SIZE } = this.args;\n\n assert(\n `@size for \"Hds::Modal\" must be one of the following: ${SIZES.join(\n ', '\n )}; received: ${size}`,\n SIZES.includes(size)\n );\n\n return size;\n }\n\n get color(): HdsModalColors {\n const { color = DEFAULT_COLOR } = this.args;\n\n assert(\n `@color for \"Hds::Modal\" must be one of the following: ${COLORS.join(\n ', '\n )}; received: ${color}`,\n COLORS.includes(color)\n );\n\n return color;\n }\n\n get id(): string {\n return getElementId(this);\n }\n\n get classNames(): string {\n const classes = ['hds-modal'];\n\n // add a class based on the @size argument\n classes.push(`hds-modal--size-${this.size}`);\n\n // add a class based on the @color argument\n classes.push(`hds-modal--color-${this.color}`);\n\n return classes.join(' ');\n }\n\n @action registerOnCloseCallback(event: Event): void {\n if (\n !this.isDismissDisabled &&\n this.args.onClose &&\n typeof this.args.onClose === 'function'\n ) {\n this.args.onClose(event);\n }\n\n // If the dismissal of the modal is disabled, we keep the modal open/visible otherwise we mark it as closed\n if (this.isDismissDisabled) {\n // If, in a chain of events, the element is not attached to the DOM, the `showModal` would fail\n // so we add this safeguard condition that checks for the `<dialog>` to have a parent\n if (this.element.parentElement) {\n // As there is no way to `preventDefault` on `close` events, we call the `showModal` function\n // preserving the state of the modal dialog\n this.element.showModal();\n }\n } else {\n this.isOpen = false;\n }\n }\n\n @action\n didInsert(element: HTMLDialogElement): void {\n // Store references of `<dialog>` and `<body>` elements\n this.element = element;\n this.body = document.body;\n\n if (this.body) {\n // Store the initial `overflow` value of `<body>` so we can reset to it\n this.bodyInitialOverflowValue =\n this.body.style.getPropertyValue('overflow');\n }\n\n // Register \"onClose\" callback function to be called when a native 'close' event is dispatched\n this.element.addEventListener('close', this.registerOnCloseCallback, true);\n\n // If the modal dialog is not already open\n if (!this.element.open) {\n this.open();\n }\n }\n\n @action\n willDestroyNode(): void {\n if (this.element) {\n this.element.removeEventListener(\n 'close',\n this.registerOnCloseCallback,\n true\n );\n }\n }\n\n @action\n open(): void {\n // Make modal dialog visible using the native `showModal` method\n this.element.showModal();\n this.isOpen = true;\n\n // Prevent page from scrolling when the dialog is open\n if (this.body) this.body.style.setProperty('overflow', 'hidden');\n\n // Call \"onOpen\" callback function\n if (this.args.onOpen && typeof this.args.onOpen === 'function') {\n this.args.onOpen();\n }\n }\n\n @action\n async onDismiss(): Promise<void> {\n // allow ember test helpers to be aware of when the `close` event fires\n // when using `click` or other helpers from '@ember/test-helpers'\n // Notice: this code will get stripped out in production builds (DEBUG evaluates to `true` in dev/test builds, but `false` in prod builds)\n if (this.element.open) {\n const token = waiter.beginAsync();\n const listener = () => {\n waiter.endAsync(token);\n this.element.removeEventListener('close', listener);\n };\n this.element.addEventListener('close', listener);\n }\n\n // Make modal dialog invisible using the native `close` method\n this.element.close();\n\n // Reset page `overflow` property\n if (this.body) {\n this.body.style.removeProperty('overflow');\n if (this.bodyInitialOverflowValue === '') {\n if (this.body.style.length === 0) {\n this.body.removeAttribute('style');\n }\n } else {\n this.body.style.setProperty('overflow', this.bodyInitialOverflowValue);\n }\n }\n\n // Return focus to a specific element (if provided)\n if (this.args.returnFocusTo) {\n const initiator = document.getElementById(this.args.returnFocusTo);\n if (initiator) {\n initiator.focus();\n }\n }\n }\n}\n"],"names":["waiter","buildWaiter","DEFAULT_SIZE","HdsModalSizeValues","Medium","DEFAULT_COLOR","HdsModalColorValues","Neutral","SIZES","Object","values","COLORS","HdsModal","_class","Component","constructor","args","_initializerDefineProperty","_descriptor","_defineProperty","isDismissDisabled","size","assert","join","includes","color","id","getElementId","classNames","classes","push","registerOnCloseCallback","event","onClose","element","parentElement","showModal","isOpen","didInsert","body","document","bodyInitialOverflowValue","style","getPropertyValue","addEventListener","open","willDestroyNode","removeEventListener","setProperty","onOpen","onDismiss","token","beginAsync","listener","endAsync","close","removeProperty","length","removeAttribute","returnFocusTo","initiator","getElementById","focus","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;;;;;;AACA,eAAe,kBAAkB,CAAC,usCAAusC;;;ACmBzuC,MAAMA,MAAM,GAAGC,WAAW,CAAC,2CAA2C,CAAC,CAAA;AAE1DC,MAAAA,YAAY,GAAGC,kBAAkB,CAACC,OAAM;AACxCC,MAAAA,aAAa,GAAGC,mBAAmB,CAACC,QAAO;AAEjD,MAAMC,KAAe,GAAGC,MAAM,CAACC,MAAM,CAACP,kBAAkB,EAAC;AACzD,MAAMQ,MAAgB,GAAGF,MAAM,CAACC,MAAM,CAACJ,mBAAmB,EAAC;AAgC7CM,IAAAA,QAAQ,IAAAC,MAAA,GAAd,MAAMD,QAAQ,SAASE,SAAS,CAAoB;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,0BAAA,iBAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;IAAAC,eAAA,CAAA,IAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAAAA,IAAAA,eAAA,mCAItC,EAA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AA,iBAAA,EAAA,CAqBNM,MAAM,CAAA,EAAA7D,MAAA,CAAA8D,wBAAA,CAAA1D,MAAA,CAAAmD,SAAA,EAAA,iBAAA,CAAA,EAAAnD,MAAA,CAAAmD,SAAA,CAAAD,EAAAA,yBAAA,CAAAlD,MAAA,CAAAmD,SAAA,EAAA,MAAA,EAAA,CAWNM,MAAM,CAAA7D,EAAAA,MAAA,CAAA8D,wBAAA,CAAA1D,MAAA,CAAAmD,SAAA,EAAA,MAAA,CAAA,EAAAnD,MAAA,CAAAmD,SAAA,GAAAD,yBAAA,CAAAlD,MAAA,CAAAmD,SAAA,EAeNM,WAAAA,EAAAA,CAAAA,MAAM,CAAA7D,EAAAA,MAAA,CAAA8D,wBAAA,CAAA1D,MAAA,CAAAmD,SAAA,gBAAAnD,MAAA,CAAAmD,SAAA,CAAA,GAAAnD,MAAA,EAAA;AA1HoB2D,oBAAA,CAAAC,QAAA,EAAR7D,QAAQ,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/hds/page-header/index.hbs","../../../../src/components/hds/page-header/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<header class=\\\"hds-page-header\\\" ...attributes>\\n {{yield (hash Breadcrumb=(component \\\"hds/yield\\\"))}}\\n <div class=\\\"hds-page-header__body\\\">\\n {{yield (hash IconTile=(component \\\"hds/icon-tile\\\" size=\\\"medium\\\"))}}\\n <div class=\\\"hds-page-header__main\\\">\\n <div class=\\\"hds-page-header__content\\\">\\n <div class=\\\"hds-page-header__title-wrapper\\\">\\n {{yield (hash Title=(component \\\"hds/page-header/title\\\"))}}\\n {{yield (hash Badges=(component \\\"hds/page-header/badges\\\"))}}\\n </div>\\n <div class=\\\"hds-page-header__metadata\\\">\\n {{yield\\n (hash\\n Subtitle=(component \\\"hds/page-header/subtitle\\\")\\n Description=(component \\\"hds/page-header/description\\\")\\n Generic=(component \\\"hds/yield\\\")\\n )\\n }}\\n </div>\\n </div>\\n {{yield (hash Actions=(component \\\"hds/page-header/actions\\\"))}}\\n </div>\\n </div>\\n</header>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport TemplateOnlyComponent from '@ember/component/template-only';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsIconTileSignature } from '../icon-tile';\nimport type { HdsYieldSignature } from '../yield';\nimport type { HdsPageHeaderActionsSignature } from './actions';\nimport type { HdsPageHeaderBadgesSignature } from './badges';\nimport type { HdsPageHeaderDescriptionSignature } from './description';\nimport type { HdsPageHeaderTitleSignature } from './title';\nimport type { HdsPageHeaderSubtitleSignature } from './subtitle';\n\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/hds/page-header/index.hbs","../../../../src/components/hds/page-header/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<header class=\\\"hds-page-header\\\" ...attributes>\\n {{yield (hash Breadcrumb=(component \\\"hds/yield\\\"))}}\\n <div class=\\\"hds-page-header__body\\\">\\n {{yield (hash IconTile=(component \\\"hds/icon-tile\\\" size=\\\"medium\\\"))}}\\n <div class=\\\"hds-page-header__main\\\">\\n <div class=\\\"hds-page-header__content\\\">\\n <div class=\\\"hds-page-header__title-wrapper\\\">\\n {{yield (hash Title=(component \\\"hds/page-header/title\\\"))}}\\n {{yield (hash Badges=(component \\\"hds/page-header/badges\\\"))}}\\n </div>\\n <div class=\\\"hds-page-header__metadata\\\">\\n {{yield\\n (hash\\n Subtitle=(component \\\"hds/page-header/subtitle\\\")\\n Description=(component \\\"hds/page-header/description\\\")\\n Generic=(component \\\"hds/yield\\\")\\n )\\n }}\\n </div>\\n </div>\\n {{yield (hash Actions=(component \\\"hds/page-header/actions\\\"))}}\\n </div>\\n </div>\\n</header>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport TemplateOnlyComponent from '@ember/component/template-only';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsIconTileSignature } from '../icon-tile';\nimport type { HdsYieldSignature } from '../yield';\nimport type { HdsPageHeaderActionsSignature } from './actions';\nimport type { HdsPageHeaderBadgesSignature } from './badges';\nimport type { HdsPageHeaderDescriptionSignature } from './description';\nimport type { HdsPageHeaderTitleSignature } from './title';\nimport type { HdsPageHeaderSubtitleSignature } from './subtitle';\n\nexport interface HdsPageHeaderSignature {\n Blocks: {\n default: [\n {\n Actions?: ComponentLike<HdsPageHeaderActionsSignature>;\n Badges?: ComponentLike<HdsPageHeaderBadgesSignature>;\n Breadcrumb?: ComponentLike<HdsYieldSignature>;\n Description?: ComponentLike<HdsPageHeaderDescriptionSignature>;\n Generic?: ComponentLike<HdsYieldSignature>;\n IconTile?: ComponentLike<HdsIconTileSignature>;\n Subtitle?: ComponentLike<HdsPageHeaderSubtitleSignature>;\n Title?: ComponentLike<HdsPageHeaderTitleSignature>;\n },\n ];\n };\n Element: HTMLElement;\n}\n\nconst HdsPageHeader = TemplateOnlyComponent<HdsPageHeaderSignature>();\n\nexport default HdsPageHeader;\n"],"names":["HdsPageHeader","TemplateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,0hCAA0hC;;ACD5jC;AACA;AACA;AACA;;AA8BA,MAAMA,aAAa,GAAGC,qBAAqB,EAA0B,CAAA;AAErE,YAAAC,oBAAA,CAAAC,QAAA,EAAeH,aAAa,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/pagination/compact/index.hbs","../../../../../src/components/hds/pagination/compact/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class=\\\"hds-pagination\\\" ...attributes>\\n <nav class=\\\"hds-pagination-nav\\\" aria-label={{this.ariaLabel}}>\\n <Hds::Pagination::Nav::Arrow\\n @direction=\\\"prev\\\"\\n @showLabel={{this.showLabels}}\\n @route={{this.routing.route}}\\n @query={{this.routing.queryPrev}}\\n @model={{this.routing.model}}\\n @models={{this.routing.models}}\\n @replace={{this.routing.replace}}\\n @onClick={{this.onPageChange}}\\n @disabled={{@isDisabledPrev}}\\n />\\n <Hds::Pagination::Nav::Arrow\\n @direction=\\\"next\\\"\\n @showLabel={{this.showLabels}}\\n @route={{this.routing.route}}\\n @query={{this.routing.queryNext}}\\n @model={{this.routing.model}}\\n @models={{this.routing.models}}\\n @replace={{this.routing.replace}}\\n @onClick={{this.onPageChange}}\\n @disabled={{@isDisabledNext}}\\n />\\n </nav>\\n\\n {{#if this.showSizeSelector}}\\n <Hds::Pagination::SizeSelector\\n @pageSizes={{this.pageSizes}}\\n @label={{@sizeSelectorLabel}}\\n @selectedSize={{this.currentPageSize}}\\n @onChange={{this.onPageSizeChange}}\\n />\\n {{/if}}\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\nimport { HdsPaginationDirectionValues } from '../types.ts';\n\nimport type {\n HdsPaginationRoutingProps,\n HdsPaginationDirections,\n} from '../types';\nimport type { HdsInteractiveSignature } from '../../interactive';\n\ntype HdsInteractiveQuery = HdsInteractiveSignature['Args']['query'];\n\ntype HdsPaginationCompactRoutingQueryProps = HdsPaginationRoutingProps & {\n queryNext?: HdsInteractiveQuery;\n queryPrev?: HdsInteractiveQuery;\n};\n\ntype HdsPaginationQueryFunction = (\n page: HdsPaginationDirections,\n pageSize?: number\n) => HdsInteractiveQuery;\n\ninterface HdsPaginationCompactArgs extends HdsPaginationRoutingProps {\n ariaLabel?: string;\n showLabels?: boolean;\n isDisabledPrev?: boolean;\n isDisabledNext?: boolean;\n showSizeSelector?: boolean;\n sizeSelectorLabel?: string;\n pageSizes?: number[];\n currentPageSize?: number;\n queryFunction?: HdsPaginationQueryFunction;\n onPageChange?: (page: HdsPaginationDirections) => void;\n onPageSizeChange?: (pageSize: number) => void;\n}\n\ninterface HdsPaginationCompactArgsControlledBase\n extends HdsPaginationCompactArgs {\n queryFunction: HdsPaginationQueryFunction;\n}\n\ninterface HdsPaginationCompactArgsControlledWithModel\n extends HdsPaginationCompactArgsControlledBase {\n model: string | number;\n}\n\ninterface HdsPaginationCompactArgsControlledWithModels\n extends HdsPaginationCompactArgsControlledBase {\n models: Array<string | number>;\n}\ninterface HdsPaginationCompactArgsControlledWithRoute\n extends HdsPaginationCompactArgsControlledBase {\n route: string;\n}\n\ntype HdsPaginationCompactArgsControlled =\n | HdsPaginationCompactArgsControlledWithModel\n | HdsPaginationCompactArgsControlledWithModels\n | HdsPaginationCompactArgsControlledWithRoute;\n\ninterface HdsPaginationCompactArgsUncontrolled\n extends HdsPaginationCompactArgs {\n queryFunction?: undefined;\n}\n\ninterface HdsPaginationCompactSignature {\n Args:\n | HdsPaginationCompactArgsControlled\n | HdsPaginationCompactArgsUncontrolled;\n Element: HTMLDivElement;\n}\n\n// for context about the decision to use these values, see:\n// https://hashicorp.slack.com/archives/C03A0N1QK8S/p1673546329082759\nexport const DEFAULT_PAGE_SIZES = [10, 30, 50];\nexport default class HdsPaginationCompact extends Component<HdsPaginationCompactSignature> {\n // This private variable is used to differentiate between\n // \"uncontrolled\" component (where the state is handled internally) and\n // \"controlled\" component (where the state is handled externally, by the consumer's code).\n // In the first case, the variable stores the internal state of the component at any moment,\n // and its value is updated internally according to the user's interaction with the component.\n // In the second case, the variable stores *only* the initial state of the component (coming from the arguments)\n // at rendering time, but from that moment on it's not updated anymore, no matter what interaction the user\n // has with the component (the state is controlled externally, eg. via query parameters)\n @tracked _currentPageSize = this.args.currentPageSize ?? this.pageSizes[0];\n @tracked isControlled;\n\n showLabels = this.args.showLabels ?? true; // if the labels for the \"prev/next\" controls are visible\n showSizeSelector = this.args.showSizeSelector ?? false; // if the \"size selector\" block is visible\n\n constructor(owner: unknown, args: HdsPaginationCompactSignature['Args']) {\n super(owner, args);\n\n const { queryFunction } = this.args;\n\n // This component works in two different ways, depending if we need to support\n // routing through links (`LinkTo`) for the \"navigation controls\", or not.\n // If there's no routing then the component behaves as \"uncontrolled\"\n // (the state updates are handled by its internal logic).\n // If instead the component needs to update the routing (and we infer this via the \"query\" arguments)\n // then the component behaves as \"controlled\", where the state is\n // initialized and updated using the arguments passed to it.\n\n if (queryFunction === undefined) {\n this.isControlled = false;\n } else {\n assert(\n '@model, @models, or @route for \"Hds::Pagination::Compact\" must be provided when using the `@queryFunction` argument',\n this.args.model !== undefined ||\n this.args.models !== undefined ||\n this.args.route !== undefined\n );\n assert(\n '@queryFunction for \"Hds::Pagination::Compact\" must be a function',\n typeof queryFunction === 'function'\n );\n this.isControlled = true;\n }\n }\n\n get ariaLabel(): string {\n return this.args.ariaLabel ?? 'Pagination';\n }\n\n // This very specific `get/set` pattern is used to handle the two different use cases of the component\n // being \"controlled\" (when it has routing, meaning it needs to support pagination controls as links/`LinkTo`)\n // vs being \"uncontrolled\" (see comments above for details).\n //\n // If it has routing (and so it's \"controlled\"), than the value (\"state\") of the `currentPageSize` variable\n // is *always* determined by the controller via arguments (most of the times, connected to query parameters in the URL).\n // For this reason the \"get\" method always returns the value from the `args`,\n // while the \"set\" method never updates the private internal state (_variable).\n //\n // If instead it doesn't have routing (and so it's \"uncontrolled\") than the value (\"state\") of the `currentPageSize` variables\n // is *always* determined by the component's internal logic (and updated according to the user interaction with it).\n // For this reason the \"get\" and \"set\" methods always read from or write to the private internal state (_variable).\n\n get currentPageSize(): number | undefined {\n if (this.isControlled) {\n return this.args.currentPageSize;\n } else {\n return this._currentPageSize;\n }\n }\n set currentPageSize(value) {\n if (this.isControlled) {\n // noop\n } else {\n this._currentPageSize = value;\n }\n }\n\n get pageSizes(): number[] {\n const { pageSizes = DEFAULT_PAGE_SIZES } = this.args;\n\n assert(\n `pageSizes argument must be an array. Received: ${pageSizes}`,\n Array.isArray(pageSizes) === true && pageSizes.length > 0\n );\n\n return pageSizes;\n }\n\n buildQueryParamsObject(\n page: HdsPaginationDirections,\n pageSize?: number\n ): HdsInteractiveQuery {\n if (this.isControlled) {\n // if the component is controlled, we can assert that the queryFunction is defined\n return this.args.queryFunction!(page, pageSize);\n } else {\n return {};\n }\n }\n\n get routing(): HdsPaginationCompactRoutingQueryProps {\n const routing: HdsPaginationCompactRoutingQueryProps = {\n route: this.args.route ?? undefined,\n model: this.args.model ?? undefined,\n models: this.args.models ?? undefined,\n replace: this.args.replace ?? undefined,\n };\n\n // the \"query\" is dynamic and needs to be calculated\n if (this.isControlled) {\n routing.queryPrev = this.buildQueryParamsObject(\n HdsPaginationDirectionValues.Prev,\n this.currentPageSize\n );\n routing.queryNext = this.buildQueryParamsObject(\n HdsPaginationDirectionValues.Next,\n this.currentPageSize\n );\n } else {\n routing.queryPrev = undefined;\n routing.queryNext = undefined;\n }\n\n return routing;\n }\n\n @action\n onPageChange(newPage: HdsPaginationDirections): void {\n const { onPageChange } = this.args;\n\n if (typeof onPageChange === 'function') {\n onPageChange(newPage);\n }\n }\n\n @action\n onPageSizeChange(newPageSize: number): void {\n const { onPageSizeChange } = this.args;\n\n // invoke the callback function\n if (typeof onPageSizeChange === 'function') {\n onPageSizeChange(newPageSize);\n }\n }\n}\n"],"names":["DEFAULT_PAGE_SIZES","HdsPaginationCompact","_class","Component","constructor","owner","args","_initializerDefineProperty","_descriptor","_descriptor2","_defineProperty","showLabels","showSizeSelector","queryFunction","undefined","isControlled","assert","model","models","route","ariaLabel","currentPageSize","_currentPageSize","value","pageSizes","Array","isArray","length","buildQueryParamsObject","page","pageSize","routing","replace","queryPrev","HdsPaginationDirectionValues","Prev","queryNext","Next","onPageChange","newPage","onPageSizeChange","newPageSize","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;AACA,eAAe,kBAAkB,CAAC,isCAAisC;;;AC8EnuC;AACA;AACO,MAAMA,kBAAkB,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC;AACzBC,IAAAA,oBAAoB,IAAAC,MAAA,GAA1B,MAAMD,oBAAoB,SAASE,SAAS,CAAgC;AAajC;;AAExDC,EAAAA,WAAWA,CAACC,KAAc,EAAEC,IAA2C,EAAE;AACvE,IAAA,KAAK,CAACD,KAAK,EAAEC,IAAI,CAAC,CAAA;AAfpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAAC,IAAAA,0BAAA,2BAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAAD,IAAAA,0BAAA,uBAAAE,YAAA,EAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,eAAA,qBAIa,IAAI,CAACJ,IAAI,CAACK,UAAU,IAAI,IAAI,CAAA,CAAA;AAAE;AAAAD,IAAAA,eAAA,2BACxB,IAAI,CAACJ,IAAI,CAACM,gBAAgB,IAAI,KAAK,CAAA,CAAA;IAKpD,MAAM;AAAEC,MAAAA,aAAAA;KAAe,GAAG,IAAI,CAACP,IAAI,CAAA;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;;IAEA,IAAIO,aAAa,KAAKC,SAAS,EAAE;MAC/B,IAAI,CAACC,YAAY,GAAG,KAAK,CAAA;AAC3B,KAAC,MAAM;MACLC,MAAM,CACJ,qHAAqH,EACrH,IAAI,CAACV,IAAI,CAACW,KAAK,KAAKH,SAAS,IAC3B,IAAI,CAACR,IAAI,CAACY,MAAM,KAAKJ,SAAS,IAC9B,IAAI,CAACR,IAAI,CAACa,KAAK,KAAKL,SACxB,CAAC,CAAA;AACDE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AW,CAAC,CAAA;AAC/B,KAAA;AACF,GAAA;AACF,CAAC,GAAAjC,WAAA,GAAAkC,yBAAA,CAAAxC,MAAA,CAAAyC,SAAA,EAAA,kBAAA,EAAA,CAvIEC,OAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;AAAAC,EAAAA,WAAA,cAAA;IAAA,OAAoB,IAAI,CAAC1C,IAAI,CAACe,eAAe,IAAI,IAAI,CAACG,SAAS,CAAC,CAAC,CAAC,CAAA;AAAA,GAAA;AAAA,CAAAf,CAAAA,EAAAA,YAAA,GAAAiC,yBAAA,CAAAxC,MAAA,CAAAyC,SAAA,mBACzEC,OAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;EAAAC,WAAA,EAAA,IAAA;AAAA,CAAA,CAAA,EAAAN,yBAAA,CAAAxC,MAAA,CAAAyC,SAAA,EAAA,cAAA,EAAA,CAoHPM,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAjD,MAAA,CAAAyC,SAAA,EAAAzC,cAAAA,CAAAA,EAAAA,MAAA,CAAAyC,SAAA,CAAA,EAAAD,yBAAA,CAAAxC,MAAA,CAAAyC,SAAA,uBASNM,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAjD,MAAA,CAAAyC,SAAA,EAAA,kBAAA,CAAA,EAAAzC,MAAA,CAAAyC,SAAA,IAAAzC,MAAA,EAAA;AAvIgCkD,oBAAA,CAAAC,QAAA,EAApBpD,oBAAoB,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/pagination/compact/index.hbs","../../../../../src/components/hds/pagination/compact/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class=\\\"hds-pagination\\\" ...attributes>\\n <nav class=\\\"hds-pagination-nav\\\" aria-label={{this.ariaLabel}}>\\n <Hds::Pagination::Nav::Arrow\\n @direction=\\\"prev\\\"\\n @showLabel={{this.showLabels}}\\n @route={{this.routing.route}}\\n @query={{this.routing.queryPrev}}\\n @model={{this.routing.model}}\\n @models={{this.routing.models}}\\n @replace={{this.routing.replace}}\\n @onClick={{this.onPageChange}}\\n @disabled={{@isDisabledPrev}}\\n />\\n <Hds::Pagination::Nav::Arrow\\n @direction=\\\"next\\\"\\n @showLabel={{this.showLabels}}\\n @route={{this.routing.route}}\\n @query={{this.routing.queryNext}}\\n @model={{this.routing.model}}\\n @models={{this.routing.models}}\\n @replace={{this.routing.replace}}\\n @onClick={{this.onPageChange}}\\n @disabled={{@isDisabledNext}}\\n />\\n </nav>\\n\\n {{#if this.showSizeSelector}}\\n <Hds::Pagination::SizeSelector\\n @pageSizes={{this.pageSizes}}\\n @label={{@sizeSelectorLabel}}\\n @selectedSize={{this.currentPageSize}}\\n @onChange={{this.onPageSizeChange}}\\n />\\n {{/if}}\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\nimport { HdsPaginationDirectionValues } from '../types.ts';\n\nimport type {\n HdsPaginationRoutingProps,\n HdsPaginationDirections,\n} from '../types';\nimport type { HdsInteractiveSignature } from '../../interactive';\n\ntype HdsInteractiveQuery = HdsInteractiveSignature['Args']['query'];\n\ntype HdsPaginationCompactRoutingQueryProps = HdsPaginationRoutingProps & {\n queryNext?: HdsInteractiveQuery;\n queryPrev?: HdsInteractiveQuery;\n};\n\ntype HdsPaginationQueryFunction = (\n page: HdsPaginationDirections,\n pageSize?: number\n) => HdsInteractiveQuery;\n\ninterface HdsPaginationCompactArgs extends HdsPaginationRoutingProps {\n ariaLabel?: string;\n showLabels?: boolean;\n isDisabledPrev?: boolean;\n isDisabledNext?: boolean;\n showSizeSelector?: boolean;\n sizeSelectorLabel?: string;\n pageSizes?: number[];\n currentPageSize?: number;\n queryFunction?: HdsPaginationQueryFunction;\n onPageChange?: (page: HdsPaginationDirections) => void;\n onPageSizeChange?: (pageSize: number) => void;\n}\n\ninterface HdsPaginationCompactArgsControlledBase\n extends HdsPaginationCompactArgs {\n queryFunction: HdsPaginationQueryFunction;\n}\n\ninterface HdsPaginationCompactArgsControlledWithModel\n extends HdsPaginationCompactArgsControlledBase {\n model: string | number;\n}\n\ninterface HdsPaginationCompactArgsControlledWithModels\n extends HdsPaginationCompactArgsControlledBase {\n models: Array<string | number>;\n}\ninterface HdsPaginationCompactArgsControlledWithRoute\n extends HdsPaginationCompactArgsControlledBase {\n route: string;\n}\n\ntype HdsPaginationCompactArgsControlled =\n | HdsPaginationCompactArgsControlledWithModel\n | HdsPaginationCompactArgsControlledWithModels\n | HdsPaginationCompactArgsControlledWithRoute;\n\ninterface HdsPaginationCompactArgsUncontrolled\n extends HdsPaginationCompactArgs {\n queryFunction?: undefined;\n}\n\nexport interface HdsPaginationCompactSignature {\n Args:\n | HdsPaginationCompactArgsControlled\n | HdsPaginationCompactArgsUncontrolled;\n Element: HTMLDivElement;\n}\n\n// for context about the decision to use these values, see:\n// https://hashicorp.slack.com/archives/C03A0N1QK8S/p1673546329082759\nexport const DEFAULT_PAGE_SIZES = [10, 30, 50];\nexport default class HdsPaginationCompact extends Component<HdsPaginationCompactSignature> {\n // This private variable is used to differentiate between\n // \"uncontrolled\" component (where the state is handled internally) and\n // \"controlled\" component (where the state is handled externally, by the consumer's code).\n // In the first case, the variable stores the internal state of the component at any moment,\n // and its value is updated internally according to the user's interaction with the component.\n // In the second case, the variable stores *only* the initial state of the component (coming from the arguments)\n // at rendering time, but from that moment on it's not updated anymore, no matter what interaction the user\n // has with the component (the state is controlled externally, eg. via query parameters)\n @tracked _currentPageSize = this.args.currentPageSize ?? this.pageSizes[0];\n @tracked isControlled;\n\n showLabels = this.args.showLabels ?? true; // if the labels for the \"prev/next\" controls are visible\n showSizeSelector = this.args.showSizeSelector ?? false; // if the \"size selector\" block is visible\n\n constructor(owner: unknown, args: HdsPaginationCompactSignature['Args']) {\n super(owner, args);\n\n const { queryFunction } = this.args;\n\n // This component works in two different ways, depending if we need to support\n // routing through links (`LinkTo`) for the \"navigation controls\", or not.\n // If there's no routing then the component behaves as \"uncontrolled\"\n // (the state updates are handled by its internal logic).\n // If instead the component needs to update the routing (and we infer this via the \"query\" arguments)\n // then the component behaves as \"controlled\", where the state is\n // initialized and updated using the arguments passed to it.\n\n if (queryFunction === undefined) {\n this.isControlled = false;\n } else {\n assert(\n '@model, @models, or @route for \"Hds::Pagination::Compact\" must be provided when using the `@queryFunction` argument',\n this.args.model !== undefined ||\n this.args.models !== undefined ||\n this.args.route !== undefined\n );\n assert(\n '@queryFunction for \"Hds::Pagination::Compact\" must be a function',\n typeof queryFunction === 'function'\n );\n this.isControlled = true;\n }\n }\n\n get ariaLabel(): string {\n return this.args.ariaLabel ?? 'Pagination';\n }\n\n // This very specific `get/set` pattern is used to handle the two different use cases of the component\n // being \"controlled\" (when it has routing, meaning it needs to support pagination controls as links/`LinkTo`)\n // vs being \"uncontrolled\" (see comments above for details).\n //\n // If it has routing (and so it's \"controlled\"), than the value (\"state\") of the `currentPageSize` variable\n // is *always* determined by the controller via arguments (most of the times, connected to query parameters in the URL).\n // For this reason the \"get\" method always returns the value from the `args`,\n // while the \"set\" method never updates the private internal state (_variable).\n //\n // If instead it doesn't have routing (and so it's \"uncontrolled\") than the value (\"state\") of the `currentPageSize` variables\n // is *always* determined by the component's internal logic (and updated according to the user interaction with it).\n // For this reason the \"get\" and \"set\" methods always read from or write to the private internal state (_variable).\n\n get currentPageSize(): number | undefined {\n if (this.isControlled) {\n return this.args.currentPageSize;\n } else {\n return this._currentPageSize;\n }\n }\n set currentPageSize(value) {\n if (this.isControlled) {\n // noop\n } else {\n this._currentPageSize = value;\n }\n }\n\n get pageSizes(): number[] {\n const { pageSizes = DEFAULT_PAGE_SIZES } = this.args;\n\n assert(\n `pageSizes argument must be an array. Received: ${pageSizes}`,\n Array.isArray(pageSizes) === true && pageSizes.length > 0\n );\n\n return pageSizes;\n }\n\n buildQueryParamsObject(\n page: HdsPaginationDirections,\n pageSize?: number\n ): HdsInteractiveQuery {\n if (this.isControlled) {\n // if the component is controlled, we can assert that the queryFunction is defined\n return this.args.queryFunction!(page, pageSize);\n } else {\n return {};\n }\n }\n\n get routing(): HdsPaginationCompactRoutingQueryProps {\n const routing: HdsPaginationCompactRoutingQueryProps = {\n route: this.args.route ?? undefined,\n model: this.args.model ?? undefined,\n models: this.args.models ?? undefined,\n replace: this.args.replace ?? undefined,\n };\n\n // the \"query\" is dynamic and needs to be calculated\n if (this.isControlled) {\n routing.queryPrev = this.buildQueryParamsObject(\n HdsPaginationDirectionValues.Prev,\n this.currentPageSize\n );\n routing.queryNext = this.buildQueryParamsObject(\n HdsPaginationDirectionValues.Next,\n this.currentPageSize\n );\n } else {\n routing.queryPrev = undefined;\n routing.queryNext = undefined;\n }\n\n return routing;\n }\n\n @action\n onPageChange(newPage: HdsPaginationDirections): void {\n const { onPageChange } = this.args;\n\n if (typeof onPageChange === 'function') {\n onPageChange(newPage);\n }\n }\n\n @action\n onPageSizeChange(newPageSize: number): void {\n const { onPageSizeChange } = this.args;\n\n // invoke the callback function\n if (typeof onPageSizeChange === 'function') {\n onPageSizeChange(newPageSize);\n }\n }\n}\n"],"names":["DEFAULT_PAGE_SIZES","HdsPaginationCompact","_class","Component","constructor","owner","args","_initializerDefineProperty","_descriptor","_descriptor2","_defineProperty","showLabels","showSizeSelector","queryFunction","undefined","isControlled","assert","model","models","route","ariaLabel","currentPageSize","_currentPageSize","value","pageSizes","Array","isArray","length","buildQueryParamsObject","page","pageSize","routing","replace","queryPrev","HdsPaginationDirectionValues","Prev","queryNext","Next","onPageChange","newPage","onPageSizeChange","newPageSize","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;AACA,eAAe,kBAAkB,CAAC,isCAAisC;;;AC8EnuC;AACA;AACO,MAAMA,kBAAkB,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC;AACzBC,IAAAA,oBAAoB,IAAAC,MAAA,GAA1B,MAAMD,oBAAoB,SAASE,SAAS,CAAgC;AAajC;;AAExDC,EAAAA,WAAWA,CAACC,KAAc,EAAEC,IAA2C,EAAE;AACvE,IAAA,KAAK,CAACD,KAAK,EAAEC,IAAI,CAAC,CAAA;AAfpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAAC,IAAAA,0BAAA,2BAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAAD,IAAAA,0BAAA,uBAAAE,YAAA,EAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,eAAA,qBAIa,IAAI,CAACJ,IAAI,CAACK,UAAU,IAAI,IAAI,CAAA,CAAA;AAAE;AAAAD,IAAAA,eAAA,2BACxB,IAAI,CAACJ,IAAI,CAACM,gBAAgB,IAAI,KAAK,CAAA,CAAA;IAKpD,MAAM;AAAEC,MAAAA,aAAAA;KAAe,GAAG,IAAI,CAACP,IAAI,CAAA;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;;IAEA,IAAIO,aAAa,KAAKC,SAAS,EAAE;MAC/B,IAAI,CAACC,YAAY,GAAG,KAAK,CAAA;AAC3B,KAAC,MAAM;MACLC,MAAM,CACJ,qHAAqH,EACrH,IAAI,CAACV,IAAI,CAACW,KAAK,KAAKH,SAAS,IAC3B,IAAI,CAACR,IAAI,CAACY,MAAM,KAAKJ,SAAS,IAC9B,IAAI,CAACR,IAAI,CAACa,KAAK,KAAKL,SACxB,CAAC,CAAA;AACDE,MAAAA,MAAM,CACJ,kEAAkE,EAClE,OAAOH,aAAa,KAAK,UAC3B,C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A,GAAAkC,yBAAA,CAAAxC,MAAA,CAAAyC,SAAA,EAAA,kBAAA,EAAA,CAvIEC,OAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;AAAAC,EAAAA,WAAA,cAAA;IAAA,OAAoB,IAAI,CAAC1C,IAAI,CAACe,eAAe,IAAI,IAAI,CAACG,SAAS,CAAC,CAAC,CAAC,CAAA;AAAA,GAAA;AAAA,CAAAf,CAAAA,EAAAA,YAAA,GAAAiC,yBAAA,CAAAxC,MAAA,CAAAyC,SAAA,mBACzEC,OAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;EAAAC,WAAA,EAAA,IAAA;AAAA,CAAA,CAAA,EAAAN,yBAAA,CAAAxC,MAAA,CAAAyC,SAAA,EAAA,cAAA,EAAA,CAoHPM,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAjD,MAAA,CAAAyC,SAAA,EAAAzC,cAAAA,CAAAA,EAAAA,MAAA,CAAAyC,SAAA,CAAA,EAAAD,yBAAA,CAAAxC,MAAA,CAAAyC,SAAA,uBASNM,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAjD,MAAA,CAAAyC,SAAA,EAAA,kBAAA,CAAA,EAAAzC,MAAA,CAAAyC,SAAA,IAAAzC,MAAA,EAAA;AAvIgCkD,oBAAA,CAAAC,QAAA,EAApBpD,oBAAoB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/pagination/info/index.hbs","../../../../../src/components/hds/pagination/info/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body class=\\\"hds-pagination-info\\\" @tag=\\\"div\\\" @size=\\\"100\\\" @weight=\\\"medium\\\" ...attributes>\\n {{@itemsRangeStart}}–{{@itemsRangeEnd}}\\n {{#if this.showTotalItems}}\\n of\\n {{@totalItems}}\\n {{/if}}\\n</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { HdsPaginationNumberedSignature } from '../numbered/index';\nimport type { HdsTextBodySignature } from '../../text/body';\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/pagination/info/index.hbs","../../../../../src/components/hds/pagination/info/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body class=\\\"hds-pagination-info\\\" @tag=\\\"div\\\" @size=\\\"100\\\" @weight=\\\"medium\\\" ...attributes>\\n {{@itemsRangeStart}}–{{@itemsRangeEnd}}\\n {{#if this.showTotalItems}}\\n of\\n {{@totalItems}}\\n {{/if}}\\n</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { HdsPaginationNumberedSignature } from '../numbered/index';\nimport type { HdsTextBodySignature } from '../../text/body';\nexport interface HdsPaginationInfoSignature {\n Args: {\n itemsRangeStart: number;\n itemsRangeEnd: number;\n showTotalItems?: HdsPaginationNumberedSignature['Args']['showTotalItems'];\n totalItems: HdsPaginationNumberedSignature['Args']['totalItems'];\n };\n Element: HdsTextBodySignature['Element'];\n}\n\nexport default class HdsPaginationInfo extends Component<HdsPaginationInfoSignature> {\n get showTotalItems(): boolean {\n return this.args.showTotalItems ?? true;\n }\n}\n"],"names":["HdsPaginationInfo","Component","showTotalItems","args","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,iUAAiU;;ACDnW;AACA;AACA;AACA;;AAee,MAAMA,iBAAiB,SAASC,SAAS,CAA6B;EACnF,IAAIC,cAAcA,GAAY;AAC5B,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,cAAc,IAAI,IAAI,CAAA;AACzC,GAAA;AACF,CAAA;AAACE,oBAAA,CAAAC,QAAA,EAJoBL,iBAAiB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow.js","sources":["../../../../../src/components/hds/pagination/nav/arrow.hbs","../../../../../src/components/hds/pagination/nav/arrow.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{#if @disabled}}\\n <Hds::Interactive class={{this.classNames}} aria-label={{this.content.ariaLabel}} disabled={{true}} ...attributes>\\n <Hds::Icon @name={{this.content.icon}} />\\n {{#if this.showLabel}}\\n <Hds::Text::Body\\n class=\\\"hds-pagination-nav__arrow-label\\\"\\n @tag=\\\"span\\\"\\n @size=\\\"100\\\"\\n @weight=\\\"medium\\\"\\n aria-hidden=\\\"true\\\"\\n >\\n {{this.content.label}}\\n </Hds::Text::Body>\\n {{/if}}\\n </Hds::Interactive>\\n{{else}}\\n <Hds::Interactive\\n class={{this.classNames}}\\n @route={{@route}}\\n @query={{hds-link-to-query @query}}\\n @models={{hds-link-to-models @model @models}}\\n @replace={{@replace}}\\n {{on \\\"click\\\" this.onClick}}\\n aria-label={{this.content.ariaLabel}}\\n ...attributes\\n >\\n <Hds::Icon @name={{this.content.icon}} />\\n {{#if this.showLabel}}\\n <Hds::Text::Body\\n class=\\\"hds-pagination-nav__arrow-label\\\"\\n @tag=\\\"span\\\"\\n @size=\\\"100\\\"\\n @weight=\\\"medium\\\"\\n aria-hidden=\\\"true\\\"\\n >\\n {{this.content.label}}\\n </Hds::Text::Body>\\n {{/if}}\\n </Hds::Interactive>\\n{{/if}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\nimport {\n HdsPaginationDirectionValues,\n HdsPaginationDirectionAriaLabelValues,\n HdsPaginationDirectionLabelValues,\n} from '../types.ts';\n\nimport type { HdsIconSignature } from '../../icon/index.ts';\nimport type { HdsInteractiveSignature } from '../../interactive';\nimport type {\n HdsPaginationDirections,\n HdsPaginationDirectionAriaLabels,\n HdsPaginationDirectionLabels,\n} from '../types';\n\ninterface HdsPaginationControlArrowContent {\n label: HdsPaginationDirectionLabels;\n icon: HdsIconSignature['Args']['name'];\n ariaLabel: HdsPaginationDirectionAriaLabels;\n}\n\ninterface HdsPaginationControlArrowArgs {\n direction: HdsPaginationDirections;\n disabled?: boolean;\n showLabel?: boolean;\n onClick?: (direction: HdsPaginationDirections) => void;\n}\n\
|
|
1
|
+
{"version":3,"file":"arrow.js","sources":["../../../../../src/components/hds/pagination/nav/arrow.hbs","../../../../../src/components/hds/pagination/nav/arrow.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{#if @disabled}}\\n <Hds::Interactive class={{this.classNames}} aria-label={{this.content.ariaLabel}} disabled={{true}} ...attributes>\\n <Hds::Icon @name={{this.content.icon}} />\\n {{#if this.showLabel}}\\n <Hds::Text::Body\\n class=\\\"hds-pagination-nav__arrow-label\\\"\\n @tag=\\\"span\\\"\\n @size=\\\"100\\\"\\n @weight=\\\"medium\\\"\\n aria-hidden=\\\"true\\\"\\n >\\n {{this.content.label}}\\n </Hds::Text::Body>\\n {{/if}}\\n </Hds::Interactive>\\n{{else}}\\n <Hds::Interactive\\n class={{this.classNames}}\\n @route={{@route}}\\n @query={{hds-link-to-query @query}}\\n @models={{hds-link-to-models @model @models}}\\n @replace={{@replace}}\\n {{on \\\"click\\\" this.onClick}}\\n aria-label={{this.content.ariaLabel}}\\n ...attributes\\n >\\n <Hds::Icon @name={{this.content.icon}} />\\n {{#if this.showLabel}}\\n <Hds::Text::Body\\n class=\\\"hds-pagination-nav__arrow-label\\\"\\n @tag=\\\"span\\\"\\n @size=\\\"100\\\"\\n @weight=\\\"medium\\\"\\n aria-hidden=\\\"true\\\"\\n >\\n {{this.content.label}}\\n </Hds::Text::Body>\\n {{/if}}\\n </Hds::Interactive>\\n{{/if}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\nimport {\n HdsPaginationDirectionValues,\n HdsPaginationDirectionAriaLabelValues,\n HdsPaginationDirectionLabelValues,\n} from '../types.ts';\n\nimport type { HdsIconSignature } from '../../icon/index.ts';\nimport type { HdsInteractiveSignature } from '../../interactive';\nimport type {\n HdsPaginationDirections,\n HdsPaginationDirectionAriaLabels,\n HdsPaginationDirectionLabels,\n} from '../types';\n\ninterface HdsPaginationControlArrowContent {\n label: HdsPaginationDirectionLabels;\n icon: HdsIconSignature['Args']['name'];\n ariaLabel: HdsPaginationDirectionAriaLabels;\n}\n\ninterface HdsPaginationControlArrowArgs {\n direction: HdsPaginationDirections;\n disabled?: boolean;\n showLabel?: boolean;\n onClick?: (direction: HdsPaginationDirections) => void;\n}\n\nexport interface HdsPaginationControlArrowSignature {\n Args: HdsPaginationControlArrowArgs & HdsInteractiveSignature['Args'];\n Element: HdsInteractiveSignature['Element'];\n}\n\nexport const DIRECTIONS: HdsPaginationDirections[] = [\n HdsPaginationDirectionValues.Prev,\n HdsPaginationDirectionValues.Next,\n];\n\nexport default class HdsPaginationControlArrow extends Component<HdsPaginationControlArrowSignature> {\n get content(): HdsPaginationControlArrowContent {\n const { direction } = this.args;\n\n assert(\n `@direction for \"Pagination::Nav::Arrow\" must be one of the following: ${DIRECTIONS.join(\n ', '\n )}; received: ${direction}`,\n DIRECTIONS.includes(direction)\n );\n\n const hdsPaginationNavArrowContentDirectionMap: Record<\n HdsPaginationDirections,\n HdsPaginationControlArrowContent\n > = {\n [HdsPaginationDirectionValues.Prev]: {\n label: HdsPaginationDirectionLabelValues.Prev,\n icon: 'chevron-left',\n ariaLabel: HdsPaginationDirectionAriaLabelValues.Prev,\n },\n [HdsPaginationDirectionValues.Next]: {\n label: HdsPaginationDirectionLabelValues.Next,\n icon: 'chevron-right',\n ariaLabel: HdsPaginationDirectionAriaLabelValues.Next,\n },\n };\n\n return hdsPaginationNavArrowContentDirectionMap[direction];\n }\n\n get showLabel(): boolean {\n const { showLabel = true } = this.args;\n\n return showLabel;\n }\n\n get classNames(): string {\n const classes = [\n 'hds-pagination-nav__control',\n 'hds-pagination-nav__arrow',\n `hds-pagination-nav__arrow--direction-${this.args.direction}`,\n ];\n\n return classes.join(' ');\n }\n\n @action\n onClick(): void {\n const { onClick } = this.args;\n\n if (typeof onClick === 'function') {\n onClick(this.args.direction);\n }\n }\n}\n"],"names":["DIRECTIONS","HdsPaginationDirectionValues","Prev","Next","HdsPaginationControlArrow","_class","Component","content","direction","args","assert","join","includes","hdsPaginationNavArrowContentDirectionMap","label","HdsPaginationDirectionLabelValues","icon","ariaLabel","HdsPaginationDirectionAriaLabelValues","showLabel","classNames","classes","onClick","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AACA,eAAe,kBAAkB,CAAC,4tCAA4tC;;;ACsCvvC,MAAMA,UAAqC,GAAG,CACnDC,4BAA4B,CAACC,IAAI,EACjCD,4BAA4B,CAACE,IAAI,EAClC;AAEoBC,IAAAA,yBAAyB,IAAAC,MAAA,GAA/B,MAAMD,yBAAyB,SAASE,SAAS,CAAqC;EACnG,IAAIC,OAAOA,GAAqC;IAC9C,MAAM;AAAEC,MAAAA,SAAAA;KAAW,GAAG,IAAI,CAACC,IA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C9B,KAAA;AACF,GAAA;AACF,CAAC,GAAAe,yBAAA,CAAAlB,MAAA,CAAAmB,SAAA,EAAA,SAAA,EAAA,CAREC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAtB,MAAA,CAAAmB,SAAA,cAAAnB,MAAA,CAAAmB,SAAA,CAAA,GAAAnB,MAAA,EAAA;AA9CqCuB,oBAAA,CAAAC,QAAA,EAAzBzB,yBAAyB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","sources":["../../../../../src/components/hds/pagination/nav/number.hbs","../../../../../src/components/hds/pagination/nav/number.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Interactive\\n class={{this.classNames}}\\n @route={{@route}}\\n @query={{hds-link-to-query @query}}\\n @models={{hds-link-to-models @model @models}}\\n @replace={{@replace}}\\n {{on \\\"click\\\" this.onClick}}\\n ...attributes\\n aria-current={{if @isSelected \\\"page\\\" null}}\\n>\\n <Hds::Text::Body @tag=\\\"span\\\" @size=\\\"100\\\" @weight=\\\"medium\\\"><span class=\\\"sr-only\\\">page\\n </span>{{this.page}}</Hds::Text::Body>\\n</Hds::Interactive>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\n\nimport type { HdsInteractiveSignature } from '../../interactive';\n\ninterface HdsPaginationNavNumberArgs {\n page: number;\n onClick: (page: number) => void;\n isSelected: boolean;\n}\n\
|
|
1
|
+
{"version":3,"file":"number.js","sources":["../../../../../src/components/hds/pagination/nav/number.hbs","../../../../../src/components/hds/pagination/nav/number.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Interactive\\n class={{this.classNames}}\\n @route={{@route}}\\n @query={{hds-link-to-query @query}}\\n @models={{hds-link-to-models @model @models}}\\n @replace={{@replace}}\\n {{on \\\"click\\\" this.onClick}}\\n ...attributes\\n aria-current={{if @isSelected \\\"page\\\" null}}\\n>\\n <Hds::Text::Body @tag=\\\"span\\\" @size=\\\"100\\\" @weight=\\\"medium\\\"><span class=\\\"sr-only\\\">page\\n </span>{{this.page}}</Hds::Text::Body>\\n</Hds::Interactive>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\n\nimport type { HdsInteractiveSignature } from '../../interactive';\n\ninterface HdsPaginationNavNumberArgs {\n page: number;\n onClick: (page: number) => void;\n isSelected: boolean;\n}\n\nexport interface HdsPaginationNavNumberSignature {\n Args: HdsPaginationNavNumberArgs & HdsInteractiveSignature['Args'];\n Element: HdsInteractiveSignature['Element'];\n}\n\nexport default class HdsPaginationControlNumber extends Component<HdsPaginationNavNumberSignature> {\n get page(): number {\n const { page } = this.args;\n\n assert(\n '@page for \"Pagination::Nav::Number\" must have a valid value',\n page !== undefined\n );\n\n return page;\n }\n\n get classNames(): string {\n const classes = [\n 'hds-pagination-nav__control',\n 'hds-pagination-nav__number',\n ];\n\n if (this.args.isSelected) {\n classes.push(`hds-pagination-nav__number--is-selected`);\n }\n\n return classes.join(' ');\n }\n\n @action\n onClick(): void {\n const { onClick } = this.args;\n\n if (typeof onClick === 'function') {\n onClick(this.args.page);\n }\n }\n}\n"],"names":["HdsPaginationControlNumber","_class","Component","page","args","assert","undefined","classNames","classes","isSelected","push","join","onClick","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;AACA,eAAe,kBAAkB,CAAC,2gBAA2gB;;;ACoBxhBA,IAAAA,0BAA0B,IAAAC,MAAA,GAAhC,MAAMD,0BAA0B,SAASE,SAAS,CAAkC;EACjG,IAAIC,IAAIA,GAAW;IACjB,MAAM;AAAEA,MAAAA,IAAAA;KAAM,GAAG,IAAI,CAACC,IAAI,CAAA;AAE1BC,IAAAA,MAAM,CACJ,6DAA6D,EAC7DF,IAAI,KAAKG,SACX,CAAC,CAAA;AAED,IAAA,OAAOH,IAAI,CAAA;AACb,GAAA;EAEA,IAAII,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CACd,6BAA6B,EAC7B,4BAA4B,CAC7B,CAAA;AAED,IAAA,IAAI,IAAI,CAACJ,IAAI,CAACK,UAAU,EAAE;AACxBD,MAAAA,OAAO,CAACE,IAAI,CAAC,CAAA,uCAAA,CAAyC,CAAC,CAAA;AACzD,KAAA;AAEA,IAAA,OAAOF,OAAO,CAACG,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;AAGAC,EAAAA,OAAOA,GAAS;IACd,MAAM;AAAEA,MAAAA,OAAAA;KAAS,GAAG,IAAI,CAACR,IAAI,CAAA;AAE7B,IAAA,IAAI,OAAOQ,OAAO,KAAK,UAAU,EAAE;AACjCA,MAAAA,OAAO,CAAC,IAAI,CAACR,IAAI,CAACD,IAAI,CAAC,CAAA;AACzB,KAAA;AACF,GAAA;AACF,CAAC,GAAAU,yBAAA,CAAAZ,MAAA,CAAAa,SAAA,EAAA,SAAA,EAAA,CAREC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAhB,MAAA,CAAAa,SAAA,cAAAb,MAAA,CAAAa,SAAA,CAAA,GAAAb,MAAA,EAAA;AAzBsCiB,oBAAA,CAAAC,QAAA,EAA1BnB,0BAA0B,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/pagination/size-selector/index.hbs","../../../../../src/components/hds/pagination/size-selector/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class=\\\"hds-pagination-size-selector\\\" ...attributes>\\n <label class=\\\"hds-typography-body-100 hds-font-weight-medium\\\" for={{this.SizeSelectorId}}>\\n {{this.label}}\\n </label>\\n <Hds::Form::Select::Base id={{this.SizeSelectorId}} {{on \\\"change\\\" this.onChange}} as |S|>\\n <S.Options>\\n {{#each this.pageSizes as |size|}}\\n <option value={{size}} selected={{if (eq size this.selectedSize) true null}}>{{size}}</option>\\n {{/each}}\\n </S.Options>\\n </Hds::Form::Select::Base>\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { guidFor } from '@ember/object/internals';\nimport { action } from '@ember/object';\n\nimport type { HdsFormSelectBaseSignature } from '../../form/select/base';\n\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/pagination/size-selector/index.hbs","../../../../../src/components/hds/pagination/size-selector/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class=\\\"hds-pagination-size-selector\\\" ...attributes>\\n <label class=\\\"hds-typography-body-100 hds-font-weight-medium\\\" for={{this.SizeSelectorId}}>\\n {{this.label}}\\n </label>\\n <Hds::Form::Select::Base id={{this.SizeSelectorId}} {{on \\\"change\\\" this.onChange}} as |S|>\\n <S.Options>\\n {{#each this.pageSizes as |size|}}\\n <option value={{size}} selected={{if (eq size this.selectedSize) true null}}>{{size}}</option>\\n {{/each}}\\n </S.Options>\\n </Hds::Form::Select::Base>\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { guidFor } from '@ember/object/internals';\nimport { action } from '@ember/object';\n\nimport type { HdsFormSelectBaseSignature } from '../../form/select/base';\n\nexport interface HdsPaginationSizeSelectorSignature {\n Args: {\n pageSizes: number[];\n label?: string;\n selectedSize?: number;\n onChange?: (size: number) => void;\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsPaginationSizeSelector extends Component<HdsPaginationSizeSelectorSignature> {\n SizeSelectorId = 'pagination-size-selector-' + guidFor(this);\n\n get pageSizes(): number[] {\n const { pageSizes } = this.args;\n\n assert(\n '@pageSizes for \"Pagination::SizeSelector\" must be defined',\n pageSizes !== undefined\n );\n\n return pageSizes;\n }\n\n get selectedSize(): number | undefined {\n const { selectedSize } = this.args;\n\n assert(\n `@selectedSize for \"Pagination::SizeSelector\" must one of the @pageSizes provided (${this.pageSizes.join(\n ','\n )}), received ${selectedSize}`,\n selectedSize === undefined || this.pageSizes.includes(selectedSize)\n );\n\n return selectedSize;\n }\n\n get label(): string {\n const { label = 'Items per page' } = this.args;\n\n return label;\n }\n\n @action\n onChange(e: Event): void {\n const { onChange } = this.args;\n\n const target = e.target as HdsFormSelectBaseSignature['Element'];\n\n if (typeof onChange === 'function') {\n onChange(parseInt(target.value));\n }\n }\n}\n"],"names":["HdsPaginationSizeSelector","_class","Component","constructor","args","_defineProperty","guidFor","pageSizes","assert","undefined","selectedSize","join","includes","label","onChange","e","target","parseInt","value","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AACA,eAAe,kBAAkB,CAAC,qlBAAqlB;;;ACqBlmBA,IAAAA,yBAAyB,IAAAC,MAAA,GAA/B,MAAMD,yBAAyB,SAASE,SAAS,CAAqC;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,eAAA,yBAClF,2BAA2B,GAAGC,OAAO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