@hashicorp/design-system-components 4.20.2 → 4.21.0
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/advanced-table/index.d.ts +15 -16
- package/declarations/components/hds/advanced-table/models/column.d.ts +38 -0
- package/declarations/components/hds/advanced-table/models/row.d.ts +2 -0
- package/declarations/components/hds/advanced-table/models/table.d.ts +15 -7
- package/declarations/components/hds/advanced-table/th-context-menu.d.ts +34 -0
- package/declarations/components/hds/advanced-table/th-resize-handle.d.ts +42 -0
- package/declarations/components/hds/advanced-table/th-sort.d.ts +13 -0
- package/declarations/components/hds/advanced-table/th.d.ts +24 -12
- package/declarations/components/hds/advanced-table/types.d.ts +2 -0
- package/declarations/components/hds/app-header/home-link.d.ts +5 -2
- package/declarations/components/hds/form/file-input/base.d.ts +4 -0
- package/declarations/components/hds/form/footer/index.d.ts +23 -0
- package/declarations/components/hds/form/header/description.d.ts +13 -0
- package/declarations/components/hds/form/header/index.d.ts +25 -0
- package/declarations/components/hds/form/header/title.d.ts +26 -0
- package/declarations/components/hds/form/index.d.ts +50 -0
- package/declarations/components/hds/form/key-value-inputs/add-row-button.d.ts +17 -0
- package/declarations/components/hds/form/key-value-inputs/delete-row-button.d.ts +23 -0
- package/declarations/components/hds/form/key-value-inputs/field.d.ts +54 -0
- package/declarations/components/hds/form/key-value-inputs/generic.d.ts +18 -0
- package/declarations/components/hds/form/key-value-inputs/index.d.ts +60 -0
- package/declarations/components/hds/form/label/index.d.ts +1 -0
- package/declarations/components/hds/form/legend/index.d.ts +2 -1
- package/declarations/components/hds/form/masked-input/base.d.ts +1 -0
- package/declarations/components/hds/form/section/header.d.ts +20 -0
- package/declarations/components/hds/form/section/index.d.ts +32 -0
- package/declarations/components/hds/form/section/multi-field-group/index.d.ts +18 -0
- package/declarations/components/hds/form/section/multi-field-group/item.d.ts +17 -0
- package/declarations/components/hds/form/select/base.d.ts +2 -0
- package/declarations/components/hds/form/separator/index.d.ts +14 -0
- package/declarations/components/hds/form/text-input/base.d.ts +2 -0
- package/declarations/components/hds/form/textarea/base.d.ts +2 -0
- package/declarations/components/hds/form/types.d.ts +24 -0
- package/declarations/components/hds/icon/index.d.ts +1 -1
- package/declarations/components/hds/layout/grid/index.d.ts +1 -0
- package/declarations/components/hds/stepper/task/indicator.d.ts +1 -1
- package/declarations/components.d.ts +16 -0
- package/declarations/template-registry.d.ts +51 -0
- package/declarations/utils/hds-aria-described-by.d.ts +3 -1
- package/dist/_app_/components/hds/advanced-table/models/column.js +1 -0
- package/dist/_app_/components/hds/advanced-table/th-context-menu.js +1 -0
- package/dist/_app_/components/hds/advanced-table/th-resize-handle.js +1 -0
- package/dist/_app_/components/hds/form/footer/index.js +1 -0
- package/dist/_app_/components/hds/form/header/description.js +1 -0
- package/dist/_app_/components/hds/form/header/index.js +1 -0
- package/dist/_app_/components/hds/form/header/title.js +1 -0
- package/dist/_app_/components/hds/form/index.js +1 -0
- package/dist/_app_/components/hds/form/key-value-inputs/add-row-button.js +1 -0
- package/dist/_app_/components/hds/form/key-value-inputs/delete-row-button.js +1 -0
- package/dist/_app_/components/hds/form/key-value-inputs/field.js +1 -0
- package/dist/_app_/components/hds/form/key-value-inputs/generic.js +1 -0
- package/dist/_app_/components/hds/form/key-value-inputs/index.js +1 -0
- package/dist/_app_/components/hds/form/section/header.js +1 -0
- package/dist/_app_/components/hds/form/section/index.js +1 -0
- package/dist/_app_/components/hds/form/section/multi-field-group/index.js +1 -0
- package/dist/_app_/components/hds/form/section/multi-field-group/item.js +1 -0
- package/dist/_app_/components/hds/form/separator/index.js +1 -0
- package/dist/components/hds/advanced-table/index.js +74 -78
- package/dist/components/hds/advanced-table/index.js.map +1 -1
- package/dist/components/hds/advanced-table/models/column.js +204 -0
- package/dist/components/hds/advanced-table/models/column.js.map +1 -0
- package/dist/components/hds/advanced-table/models/row.js.map +1 -1
- package/dist/components/hds/advanced-table/models/table.js +118 -7
- package/dist/components/hds/advanced-table/models/table.js.map +1 -1
- package/dist/components/hds/advanced-table/th-context-menu.js +65 -0
- package/dist/components/hds/advanced-table/th-context-menu.js.map +1 -0
- package/dist/components/hds/advanced-table/th-resize-handle.js +202 -0
- package/dist/components/hds/advanced-table/th-resize-handle.js.map +1 -0
- package/dist/components/hds/advanced-table/th-sort.js +16 -1
- package/dist/components/hds/advanced-table/th-sort.js.map +1 -1
- package/dist/components/hds/advanced-table/th.js +16 -2
- package/dist/components/hds/advanced-table/th.js.map +1 -1
- package/dist/components/hds/advanced-table/types.js.map +1 -1
- package/dist/components/hds/app-header/home-link.js +15 -5
- package/dist/components/hds/app-header/home-link.js.map +1 -1
- package/dist/components/hds/form/file-input/base.js +1 -1
- package/dist/components/hds/form/file-input/base.js.map +1 -1
- package/dist/components/hds/form/footer/index.js +26 -0
- package/dist/components/hds/form/footer/index.js.map +1 -0
- package/dist/components/hds/form/header/description.js +16 -0
- package/dist/components/hds/form/header/description.js.map +1 -0
- package/dist/components/hds/form/header/index.js +26 -0
- package/dist/components/hds/form/header/index.js.map +1 -0
- package/dist/components/hds/form/header/title.js +33 -0
- package/dist/components/hds/form/header/title.js.map +1 -0
- package/dist/components/hds/form/index.js +35 -0
- package/dist/components/hds/form/index.js.map +1 -0
- package/dist/components/hds/form/key-value-inputs/add-row-button.js +32 -0
- package/dist/components/hds/form/key-value-inputs/add-row-button.js.map +1 -0
- package/dist/components/hds/form/key-value-inputs/delete-row-button.js +49 -0
- package/dist/components/hds/form/key-value-inputs/delete-row-button.js.map +1 -0
- package/dist/components/hds/form/key-value-inputs/field.js +63 -0
- package/dist/components/hds/form/key-value-inputs/field.js.map +1 -0
- package/dist/components/hds/form/key-value-inputs/generic.js +28 -0
- package/dist/components/hds/form/key-value-inputs/generic.js.map +1 -0
- package/dist/components/hds/form/key-value-inputs/index.js +124 -0
- package/dist/components/hds/form/key-value-inputs/index.js.map +1 -0
- package/dist/components/hds/form/label/index.js +1 -1
- package/dist/components/hds/form/label/index.js.map +1 -1
- package/dist/components/hds/form/legend/index.js +1 -1
- package/dist/components/hds/form/legend/index.js.map +1 -1
- package/dist/components/hds/form/masked-input/base.js +1 -1
- package/dist/components/hds/form/masked-input/base.js.map +1 -1
- package/dist/components/hds/form/section/header.js +16 -0
- package/dist/components/hds/form/section/header.js.map +1 -0
- package/dist/components/hds/form/section/index.js +26 -0
- package/dist/components/hds/form/section/index.js.map +1 -0
- package/dist/components/hds/form/section/multi-field-group/index.js +16 -0
- package/dist/components/hds/form/section/multi-field-group/index.js.map +1 -0
- package/dist/components/hds/form/section/multi-field-group/item.js +24 -0
- package/dist/components/hds/form/section/multi-field-group/item.js.map +1 -0
- package/dist/components/hds/form/select/base.js +1 -1
- package/dist/components/hds/form/select/base.js.map +1 -1
- package/dist/components/hds/form/separator/index.js +26 -0
- package/dist/components/hds/form/separator/index.js.map +1 -0
- package/dist/components/hds/form/text-input/base.js +1 -1
- package/dist/components/hds/form/text-input/base.js.map +1 -1
- package/dist/components/hds/form/textarea/base.js +1 -1
- package/dist/components/hds/form/textarea/base.js.map +1 -1
- package/dist/components/hds/form/types.js +27 -0
- package/dist/components/hds/form/types.js.map +1 -0
- package/dist/components/hds/layout/grid/index.js +18 -0
- package/dist/components/hds/layout/grid/index.js.map +1 -1
- package/dist/components/hds/table/index.js +1 -1
- package/dist/components.js +16 -0
- package/dist/components.js.map +1 -1
- package/dist/styles/@hashicorp/design-system-components.css +299 -3
- package/dist/styles/@hashicorp/design-system-components.scss +2 -10
- package/dist/styles/components/advanced-table.scss +96 -2
- package/dist/styles/components/app-header.scss +4 -4
- package/dist/styles/components/form/index.scss +2 -0
- package/dist/styles/components/form/key-value-inputs.scss +134 -0
- package/dist/styles/components/form/layout.scss +81 -0
- package/dist/styles/components/form/super-select.scss +15 -0
- package/dist/styles/components/layout/grid.scss +1 -1
- package/dist/styles/mixins/_screen-reader-only.scss +17 -0
- package/dist/utils/hds-aria-described-by.js.map +1 -1
- package/package.json +22 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import TemplateOnlyComponent from '@ember/component/template-only';
|
|
2
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
|
+
import { setComponentTemplate } from '@ember/component';
|
|
4
|
+
|
|
5
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<div class=\"hds-form__section-header\" ...attributes>\n {{yield\n (hash Title=(component \"hds/form/header/title\" size=\"300\") Description=(component \"hds/form/header/description\"))\n }}\n</div>");
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (c) HashiCorp, Inc.
|
|
9
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const HdsFormSectionHeader = TemplateOnlyComponent();
|
|
13
|
+
var header = setComponentTemplate(TEMPLATE, HdsFormSectionHeader);
|
|
14
|
+
|
|
15
|
+
export { header as default };
|
|
16
|
+
//# sourceMappingURL=header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.js","sources":["../../../../../src/components/hds/form/section/header.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport TemplateOnlyComponent from '@ember/component/template-only';\n\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\nimport type HdsFormHeaderTitleComponent from '../header/title.ts';\nimport type { HdsFormHeaderDescriptionSignature } from '../header/description.ts';\n\nexport interface HdsFormSectionHeaderSignature {\n Blocks: {\n default: [\n {\n Title?: WithBoundArgs<typeof HdsFormHeaderTitleComponent, 'size'>;\n Description?: ComponentLike<HdsFormHeaderDescriptionSignature>;\n },\n ];\n };\n Element: HTMLDivElement;\n}\nconst HdsFormSectionHeader =\n TemplateOnlyComponent<HdsFormSectionHeaderSignature>();\n\nexport default HdsFormSectionHeader;\n"],"names":["HdsFormSectionHeader","TemplateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AAmBA,MAAMA,oBAAoB,GACxBC,qBAAqB,EAAiC;AAExD,aAAAC,oBAAA,CAAAC,QAAA,EAAeH,oBAAoB,CAAA;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
|
+
import { setComponentTemplate } from '@ember/component';
|
|
4
|
+
|
|
5
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n{{! IMPORTANT: we need to add \"squishies\" here (~) because otherwise the whitespace added by Ember causes the empty element to still occupy space - See https://handlebarsjs.com/guide/expressions.html#whitespace-control }}\n<div class={{this.classNames}} ...attributes>\n {{~yield\n (hash\n Header=(component \"hds/form/section/header\")\n HeaderTitle=(component \"hds/form/header/title\" size=\"300\")\n HeaderDescription=(component \"hds/form/header/description\")\n MultiFieldGroup=(component \"hds/form/section/multi-field-group\")\n MultiFieldGroupItem=(component \"hds/form/section/multi-field-group/item\")\n )\n ~}}\n</div>");
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (c) HashiCorp, Inc.
|
|
9
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
class HdsFormSection extends Component {
|
|
13
|
+
get classNames() {
|
|
14
|
+
const classes = ['hds-form__section'];
|
|
15
|
+
|
|
16
|
+
// add a class based on the @isFullWidth argument
|
|
17
|
+
if (this.args.isFullWidth) {
|
|
18
|
+
classes.push('hds-form-content--is-full-width');
|
|
19
|
+
}
|
|
20
|
+
return classes.join(' ');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
setComponentTemplate(TEMPLATE, HdsFormSection);
|
|
24
|
+
|
|
25
|
+
export { HdsFormSection as default };
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/section/index.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\nimport type { HdsFormSectionHeaderSignature } from './header.ts';\nimport type HdsFormHeaderTitleComponent from '../header/title.ts';\nimport type { HdsFormHeaderDescriptionSignature } from '../header/description.ts';\nimport type { HdsFormSectionMultiFieldGroupSignature } from './multi-field-group/index.ts';\nimport type { HdsFormSectionMultiFieldGroupItemSignature } from './multi-field-group/item.ts';\n\nexport interface HdsFormSectionSignature {\n Args: {\n isFullWidth?: boolean;\n };\n Blocks: {\n default: [\n {\n Section?: ComponentLike<HdsFormSectionSignature>; // for nested sections\n Header?: ComponentLike<HdsFormSectionHeaderSignature>;\n HeaderTitle?: WithBoundArgs<typeof HdsFormHeaderTitleComponent, 'size'>;\n HeaderDescription?: ComponentLike<HdsFormHeaderDescriptionSignature>;\n MultiFieldGroup?: ComponentLike<HdsFormSectionMultiFieldGroupSignature>;\n MultiFieldGroupItem?: ComponentLike<HdsFormSectionMultiFieldGroupItemSignature>;\n },\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsFormSection extends Component<HdsFormSectionSignature> {\n get classNames(): string {\n const classes = ['hds-form__section'];\n\n // add a class based on the @isFullWidth argument\n if (this.args.isFullWidth) {\n classes.push('hds-form-content--is-full-width');\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["HdsFormSection","Component","classNames","classes","args","isFullWidth","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AA8Be,MAAMA,cAAc,SAASC,SAAS,CAA0B;EAC7E,IAAIC,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,mBAAmB,CAAC;;AAErC;AACA,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,WAAW,EAAE;AACzBF,MAAAA,OAAO,CAACG,IAAI,CAAC,iCAAiC,CAAC;AACjD;AAEA,IAAA,OAAOH,OAAO,CAACI,IAAI,CAAC,GAAG,CAAC;AAC1B;AACF;AAACC,oBAAA,CAAAC,QAAA,EAXoBT,cAAc,CAAA;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import TemplateOnlyComponent from '@ember/component/template-only';
|
|
2
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
|
+
import { setComponentTemplate } from '@ember/component';
|
|
4
|
+
|
|
5
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n\n<div class=\"hds-form__section-multi-field-group\" ...attributes>{{yield\n (hash Item=(component \"hds/form/section/multi-field-group/item\"))\n }}</div>");
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (c) HashiCorp, Inc.
|
|
9
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const HdsFormSectionMultiFieldGroup = TemplateOnlyComponent();
|
|
13
|
+
var index = setComponentTemplate(TEMPLATE, HdsFormSectionMultiFieldGroup);
|
|
14
|
+
|
|
15
|
+
export { index as default };
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/components/hds/form/section/multi-field-group/index.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport TemplateOnlyComponent from '@ember/component/template-only';\n\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormSectionMultiFieldGroupItemSignature } from './item.ts';\n\nexport interface HdsFormSectionMultiFieldGroupSignature {\n Blocks: {\n default: [\n {\n Item?: ComponentLike<HdsFormSectionMultiFieldGroupItemSignature>;\n },\n ];\n };\n Element: HTMLDivElement;\n}\n\nconst HdsFormSectionMultiFieldGroup =\n TemplateOnlyComponent<HdsFormSectionMultiFieldGroupSignature>();\n\nexport default HdsFormSectionMultiFieldGroup;\n"],"names":["HdsFormSectionMultiFieldGroup","TemplateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AAkBA,MAAMA,6BAA6B,GACjCC,qBAAqB,EAA0C;AAEjE,YAAAC,oBAAA,CAAAC,QAAA,EAAeH,6BAA6B,CAAA;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
|
+
import { setComponentTemplate } from '@ember/component';
|
|
4
|
+
|
|
5
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n\n<div class=\"hds-form__section-multi-field-group-item\" {{style this.widthStyle}} ...attributes>{{yield}}</div>");
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (c) HashiCorp, Inc.
|
|
9
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
class HdsFormSectionMultiFieldGroupItem extends Component {
|
|
13
|
+
get widthStyle() {
|
|
14
|
+
const widthStyle = {};
|
|
15
|
+
if (this.args.width) {
|
|
16
|
+
widthStyle['--hds-form-section-multi-field-group-item-width'] = this.args.width;
|
|
17
|
+
}
|
|
18
|
+
return widthStyle;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
setComponentTemplate(TEMPLATE, HdsFormSectionMultiFieldGroupItem);
|
|
22
|
+
|
|
23
|
+
export { HdsFormSectionMultiFieldGroupItem as default };
|
|
24
|
+
//# sourceMappingURL=item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.js","sources":["../../../../../../src/components/hds/form/section/multi-field-group/item.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nexport interface HdsFormSectionMultiFieldGroupItemSignature {\n Args: {\n width?: string;\n };\n Blocks: {\n default: [];\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsFormSectionMultiFieldGroupItem extends Component<HdsFormSectionMultiFieldGroupItemSignature> {\n get widthStyle(): Record<string, string> {\n const widthStyle: { [key: string]: string } = {};\n\n if (this.args.width) {\n widthStyle['--hds-form-section-multi-field-group-item-width'] =\n this.args.width;\n }\n return widthStyle;\n }\n}\n"],"names":["HdsFormSectionMultiFieldGroupItem","Component","widthStyle","args","width","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AAce,MAAMA,iCAAiC,SAASC,SAAS,CAA6C;EACnH,IAAIC,UAAUA,GAA2B;IACvC,MAAMA,UAAqC,GAAG,EAAE;AAEhD,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,KAAK,EAAE;MACnBF,UAAU,CAAC,iDAAiD,CAAC,GAC3D,IAAI,CAACC,IAAI,CAACC,KAAK;AACnB;AACA,IAAA,OAAOF,UAAU;AACnB;AACF;AAACG,oBAAA,CAAAC,QAAA,EAVoBN,iCAAiC,CAAA;;;;"}
|
|
@@ -2,7 +2,7 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
3
|
import { setComponentTemplate } from '@ember/component';
|
|
4
4
|
|
|
5
|
-
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<select class={{this.classNames}} {{style width=@width}} ...attributes>\n {{yield (hash Options=(component \"hds/yield\"))}}\n</select>");
|
|
5
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<select class={{this.classNames}} {{style width=@width}} id={{@id}} aria-describedby={{@ariaDescribedBy}} ...attributes>\n {{yield (hash Options=(component \"hds/yield\"))}}\n</select>");
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Copyright (c) HashiCorp, Inc.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/select/base.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsYieldSignature } from '../../yield';\n\nexport interface HdsFormSelectBaseSignature {\n Args: {\n isInvalid?: boolean;\n width?: string;\n };\n Blocks: {\n default: [\n {\n Options?: ComponentLike<HdsYieldSignature>;\n },\n ];\n };\n Element: HTMLSelectElement;\n}\n\nexport default class HdsFormSelectBase extends Component<HdsFormSelectBaseSignature> {\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-form-select'];\n\n // add typographic classes\n classes.push('hds-typography-body-200', 'hds-font-weight-regular');\n\n // add a class based on the @isInvalid argument\n if (this.args.isInvalid) {\n classes.push(`hds-form-select--is-invalid`);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["HdsFormSelectBase","Component","classNames","classes","push","args","isInvalid","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/select/base.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsYieldSignature } from '../../yield';\n\nexport interface HdsFormSelectBaseSignature {\n Args: {\n isInvalid?: boolean;\n width?: string;\n id?: string;\n ariaDescribedBy?: string;\n };\n Blocks: {\n default: [\n {\n Options?: ComponentLike<HdsYieldSignature>;\n },\n ];\n };\n Element: HTMLSelectElement;\n}\n\nexport default class HdsFormSelectBase extends Component<HdsFormSelectBaseSignature> {\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-form-select'];\n\n // add typographic classes\n classes.push('hds-typography-body-200', 'hds-font-weight-regular');\n\n // add a class based on the @isInvalid argument\n if (this.args.isInvalid) {\n classes.push(`hds-form-select--is-invalid`);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["HdsFormSelectBase","Component","classNames","classes","push","args","isInvalid","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AAuBe,MAAMA,iBAAiB,SAASC,SAAS,CAA6B;AACnF;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,iBAAiB,CAAC;;AAEnC;AACAA,IAAAA,OAAO,CAACC,IAAI,CAAC,yBAAyB,EAAE,yBAAyB,CAAC;;AAElE;AACA,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,SAAS,EAAE;AACvBH,MAAAA,OAAO,CAACC,IAAI,CAAC,CAAA,2BAAA,CAA6B,CAAC;AAC7C;AAEA,IAAA,OAAOD,OAAO,CAACI,IAAI,CAAC,GAAG,CAAC;AAC1B;AACF;AAACC,oBAAA,CAAAC,QAAA,EAnBoBT,iBAAiB,CAAA;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
|
+
import { setComponentTemplate } from '@ember/component';
|
|
4
|
+
|
|
5
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n\n<Hds::Separator class={{this.classNames}} @spacing=\"0\" ...attributes />");
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (c) HashiCorp, Inc.
|
|
9
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
class HdsFormSeparator extends Component {
|
|
13
|
+
get classNames() {
|
|
14
|
+
const classes = ['hds-form__separator'];
|
|
15
|
+
|
|
16
|
+
// add a class based on the @isFullWidth argument
|
|
17
|
+
if (this.args.isFullWidth) {
|
|
18
|
+
classes.push('hds-form-content--is-full-width');
|
|
19
|
+
}
|
|
20
|
+
return classes.join(' ');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
setComponentTemplate(TEMPLATE, HdsFormSeparator);
|
|
24
|
+
|
|
25
|
+
export { HdsFormSeparator as default };
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/separator/index.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nexport interface HdsFormSeparatorSignature {\n Args: {\n isFullWidth?: boolean;\n };\n Element: HTMLElement;\n}\n\nexport default class HdsFormSeparator extends Component<HdsFormSeparatorSignature> {\n get classNames(): string {\n const classes = ['hds-form__separator'];\n\n // add a class based on the @isFullWidth argument\n if (this.args.isFullWidth) {\n classes.push('hds-form-content--is-full-width');\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["HdsFormSeparator","Component","classNames","classes","args","isFullWidth","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AAWe,MAAMA,gBAAgB,SAASC,SAAS,CAA4B;EACjF,IAAIC,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,qBAAqB,CAAC;;AAEvC;AACA,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,WAAW,EAAE;AACzBF,MAAAA,OAAO,CAACG,IAAI,CAAC,iCAAiC,CAAC;AACjD;AAEA,IAAA,OAAOH,OAAO,CAACI,IAAI,CAAC,GAAG,CAAC;AAC1B;AACF;AAACC,oBAAA,CAAAC,QAAA,EAXoBT,gBAAgB,CAAA;;;;"}
|
|
@@ -4,7 +4,7 @@ import { HdsFormTextInputTypeValues } from './types.js';
|
|
|
4
4
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
5
5
|
import { setComponentTemplate } from '@ember/component';
|
|
6
6
|
|
|
7
|
-
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<input
|
|
7
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<input\n class={{this.classNames}}\n {{style width=@width}}\n id={{@id}}\n aria-describedby={{@ariaDescribedBy}}\n ...attributes\n value={{@value}}\n type={{this.type}}\n/>");
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Copyright (c) HashiCorp, Inc.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/text-input/base.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\n\nimport { HdsFormTextInputTypeValues } from './types.ts';\nimport type { HdsFormTextInputTypes } from './types.ts';\n\n// notice: we don't support all the possible HTML types, only a subset\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input\nexport const DEFAULT_TYPE = HdsFormTextInputTypeValues.Text;\nexport const TYPES: string[] = Object.values(HdsFormTextInputTypeValues);\n\nexport interface HdsFormTextInputBaseSignature {\n Args: {\n hasVisibilityToggle?: boolean;\n isInvalid?: boolean;\n isLoading?: boolean;\n type?: HdsFormTextInputTypes;\n value?: string;\n width?: string;\n };\n Element: HTMLInputElement;\n}\n\nexport default class HdsFormTextInputBase extends Component<HdsFormTextInputBaseSignature> {\n /**\n * Sets the type of input\n *\n * @param type\n * @type {string}\n * @default 'text'\n */\n get type(): HdsFormTextInputTypes {\n const { type = DEFAULT_TYPE } = this.args;\n\n assert(\n `@type for \"Hds::Form::TextInput\" must be one of the following: ${TYPES.join(\n ', '\n )}; received: ${type}`,\n TYPES.includes(type)\n );\n\n return type;\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-form-text-input'];\n\n // add typographic classes\n classes.push('hds-typography-body-200', 'hds-font-weight-regular');\n\n // add a class based on the @isInvalid argument\n if (this.args.isInvalid) {\n classes.push(`hds-form-text-input--is-invalid`);\n }\n\n // add a class based on the @hasVisibilityToggle argument\n if (this.args.hasVisibilityToggle) {\n classes.push(`hds-form-text-input--has-visibility-toggle`);\n }\n\n // add a class based on the @isLoading argument\n if (this.args.isLoading) {\n classes.push(`hds-form-text-input--is-loading`);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["DEFAULT_TYPE","HdsFormTextInputTypeValues","Text","TYPES","Object","values","HdsFormTextInputBase","Component","type","args","assert","join","includes","classNames","classes","push","isInvalid","hasVisibilityToggle","isLoading","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;;AAQA;AACA;AACaA,MAAAA,YAAY,GAAGC,0BAA0B,CAACC;AAChD,MAAMC,KAAe,GAAGC,MAAM,CAACC,MAAM,CAACJ,0BAA0B;
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/text-input/base.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\n\nimport { HdsFormTextInputTypeValues } from './types.ts';\nimport type { HdsFormTextInputTypes } from './types.ts';\n\n// notice: we don't support all the possible HTML types, only a subset\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input\nexport const DEFAULT_TYPE = HdsFormTextInputTypeValues.Text;\nexport const TYPES: string[] = Object.values(HdsFormTextInputTypeValues);\n\nexport interface HdsFormTextInputBaseSignature {\n Args: {\n hasVisibilityToggle?: boolean;\n isInvalid?: boolean;\n isLoading?: boolean;\n type?: HdsFormTextInputTypes;\n value?: string;\n width?: string;\n id?: string;\n ariaDescribedBy?: string;\n };\n Element: HTMLInputElement;\n}\n\nexport default class HdsFormTextInputBase extends Component<HdsFormTextInputBaseSignature> {\n /**\n * Sets the type of input\n *\n * @param type\n * @type {string}\n * @default 'text'\n */\n get type(): HdsFormTextInputTypes {\n const { type = DEFAULT_TYPE } = this.args;\n\n assert(\n `@type for \"Hds::Form::TextInput\" must be one of the following: ${TYPES.join(\n ', '\n )}; received: ${type}`,\n TYPES.includes(type)\n );\n\n return type;\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-form-text-input'];\n\n // add typographic classes\n classes.push('hds-typography-body-200', 'hds-font-weight-regular');\n\n // add a class based on the @isInvalid argument\n if (this.args.isInvalid) {\n classes.push(`hds-form-text-input--is-invalid`);\n }\n\n // add a class based on the @hasVisibilityToggle argument\n if (this.args.hasVisibilityToggle) {\n classes.push(`hds-form-text-input--has-visibility-toggle`);\n }\n\n // add a class based on the @isLoading argument\n if (this.args.isLoading) {\n classes.push(`hds-form-text-input--is-loading`);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["DEFAULT_TYPE","HdsFormTextInputTypeValues","Text","TYPES","Object","values","HdsFormTextInputBase","Component","type","args","assert","join","includes","classNames","classes","push","isInvalid","hasVisibilityToggle","isLoading","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;;AAQA;AACA;AACaA,MAAAA,YAAY,GAAGC,0BAA0B,CAACC;AAChD,MAAMC,KAAe,GAAGC,MAAM,CAACC,MAAM,CAACJ,0BAA0B;AAgBxD,MAAMK,oBAAoB,SAASC,SAAS,CAAgC;AACzF;AACF;AACA;AACA;AACA;AACA;AACA;EACE,IAAIC,IAAIA,GAA0B;IAChC,MAAM;AAAEA,MAAAA,IAAI,GAAGR;KAAc,GAAG,IAAI,CAACS,IAAI;AAEzCC,IAAAA,MAAM,CACJ,CAAkEP,+DAAAA,EAAAA,KAAK,CAACQ,IAAI,CAC1E,IACF,CAAC,CAAA,YAAA,EAAeH,IAAI,CAAA,CAAE,EACtBL,KAAK,CAACS,QAAQ,CAACJ,IAAI,CACrB,CAAC;AAED,IAAA,OAAOA,IAAI;AACb;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIK,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,qBAAqB,CAAC;;AAEvC;AACAA,IAAAA,OAAO,CAACC,IAAI,CAAC,yBAAyB,EAAE,yBAAyB,CAAC;;AAElE;AACA,IAAA,IAAI,IAAI,CAACN,IAAI,CAACO,SAAS,EAAE;AACvBF,MAAAA,OAAO,CAACC,IAAI,CAAC,CAAA,+BAAA,CAAiC,CAAC;AACjD;;AAEA;AACA,IAAA,IAAI,IAAI,CAACN,IAAI,CAACQ,mBAAmB,EAAE;AACjCH,MAAAA,OAAO,CAACC,IAAI,CAAC,CAAA,0CAAA,CAA4C,CAAC;AAC5D;;AAEA;AACA,IAAA,IAAI,IAAI,CAACN,IAAI,CAACS,SAAS,EAAE;AACvBJ,MAAAA,OAAO,CAACC,IAAI,CAAC,CAAA,+BAAA,CAAiC,CAAC;AACjD;AAEA,IAAA,OAAOD,OAAO,CAACH,IAAI,CAAC,GAAG,CAAC;AAC1B;AACF;AAACQ,oBAAA,CAAAC,QAAA,EAjDoBd,oBAAoB,CAAA;;;;"}
|
|
@@ -2,7 +2,7 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
3
|
import { setComponentTemplate } from '@ember/component';
|
|
4
4
|
|
|
5
|
-
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n{{! Notice: this is not the native HTML <textarea> but the Ember component <Textarea> }}\n<Textarea
|
|
5
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n{{! Notice: this is not the native HTML <textarea> but the Ember component <Textarea> }}\n<Textarea\n class={{this.classNames}}\n {{style width=@width height=@height}}\n rows=\"4\"\n id={{@id}}\n aria-describedby={{@ariaDescribedBy}}\n ...attributes\n @value={{@value}}\n/>");
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Copyright (c) HashiCorp, Inc.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/textarea/base.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nexport interface HdsFormTextareaBaseSignature {\n Args: {\n isInvalid?: boolean;\n value?: string;\n width?: string;\n height?: string;\n };\n Element: HTMLElement;\n}\n\nexport default class HdsFormTextareaBase extends Component<HdsFormTextareaBaseSignature> {\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-form-textarea'];\n\n // add typographic classes\n classes.push('hds-typography-body-200', 'hds-font-weight-regular');\n\n // add a class based on the @isInvalid argument\n if (this.args.isInvalid) {\n classes.push(`hds-form-textarea--is-invalid`);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["HdsFormTextareaBase","Component","classNames","classes","push","args","isInvalid","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/textarea/base.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nexport interface HdsFormTextareaBaseSignature {\n Args: {\n isInvalid?: boolean;\n value?: string;\n width?: string;\n height?: string;\n id?: string;\n ariaDescribedBy?: string;\n };\n Element: HTMLElement;\n}\n\nexport default class HdsFormTextareaBase extends Component<HdsFormTextareaBaseSignature> {\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-form-textarea'];\n\n // add typographic classes\n classes.push('hds-typography-body-200', 'hds-font-weight-regular');\n\n // add a class based on the @isInvalid argument\n if (this.args.isInvalid) {\n classes.push(`hds-form-textarea--is-invalid`);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["HdsFormTextareaBase","Component","classNames","classes","push","args","isInvalid","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AAgBe,MAAMA,mBAAmB,SAASC,SAAS,CAA+B;AACvF;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,mBAAmB,CAAC;;AAErC;AACAA,IAAAA,OAAO,CAACC,IAAI,CAAC,yBAAyB,EAAE,yBAAyB,CAAC;;AAElE;AACA,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,SAAS,EAAE;AACvBH,MAAAA,OAAO,CAACC,IAAI,CAAC,CAAA,6BAAA,CAA+B,CAAC;AAC/C;AAEA,IAAA,OAAOD,OAAO,CAACI,IAAI,CAAC,GAAG,CAAC;AAC1B;AACF;AAACC,oBAAA,CAAAC,QAAA,EAnBoBT,mBAAmB,CAAA;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
let HdsFormTagValues = /*#__PURE__*/function (HdsFormTagValues) {
|
|
7
|
+
HdsFormTagValues["Form"] = "form";
|
|
8
|
+
HdsFormTagValues["Div"] = "div";
|
|
9
|
+
return HdsFormTagValues;
|
|
10
|
+
}({});
|
|
11
|
+
let HdsFormHeaderTitleTagValues = /*#__PURE__*/function (HdsFormHeaderTitleTagValues) {
|
|
12
|
+
HdsFormHeaderTitleTagValues["Div"] = "div";
|
|
13
|
+
HdsFormHeaderTitleTagValues["H1"] = "h1";
|
|
14
|
+
HdsFormHeaderTitleTagValues["H2"] = "h2";
|
|
15
|
+
HdsFormHeaderTitleTagValues["H3"] = "h3";
|
|
16
|
+
HdsFormHeaderTitleTagValues["H4"] = "h4";
|
|
17
|
+
HdsFormHeaderTitleTagValues["H5"] = "h5";
|
|
18
|
+
HdsFormHeaderTitleTagValues["H6"] = "h6";
|
|
19
|
+
return HdsFormHeaderTitleTagValues;
|
|
20
|
+
}({});
|
|
21
|
+
var types = {
|
|
22
|
+
HdsFormTagValues,
|
|
23
|
+
HdsFormHeaderTitleTagValues
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { HdsFormHeaderTitleTagValues, HdsFormTagValues, types as default };
|
|
27
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../src/components/hds/form/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nexport enum HdsFormTagValues {\n Form = 'form',\n Div = 'div',\n}\nexport type HdsFormTags = `${HdsFormTagValues}`;\n\nexport enum HdsFormHeaderTitleTagValues {\n Div = 'div',\n H1 = 'h1',\n H2 = 'h2',\n H3 = 'h3',\n H4 = 'h4',\n H5 = 'h5',\n H6 = 'h6',\n}\nexport type HdsFormHeaderTitleTags = `${HdsFormHeaderTitleTagValues}`;\n\nexport default {\n HdsFormTagValues,\n HdsFormHeaderTitleTagValues,\n};\n"],"names":["HdsFormTagValues","HdsFormHeaderTitleTagValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAEYA,IAAAA,gBAAgB,0BAAhBA,gBAAgB,EAAA;EAAhBA,gBAAgB,CAAA,MAAA,CAAA,GAAA,MAAA;EAAhBA,gBAAgB,CAAA,KAAA,CAAA,GAAA,KAAA;AAAA,EAAA,OAAhBA,gBAAgB;AAAA,CAAA,CAAA,EAAA;AAMhBC,IAAAA,2BAA2B,0BAA3BA,2BAA2B,EAAA;EAA3BA,2BAA2B,CAAA,KAAA,CAAA,GAAA,KAAA;EAA3BA,2BAA2B,CAAA,IAAA,CAAA,GAAA,IAAA;EAA3BA,2BAA2B,CAAA,IAAA,CAAA,GAAA,IAAA;EAA3BA,2BAA2B,CAAA,IAAA,CAAA,GAAA,IAAA;EAA3BA,2BAA2B,CAAA,IAAA,CAAA,GAAA,IAAA;EAA3BA,2BAA2B,CAAA,IAAA,CAAA,GAAA,IAAA;EAA3BA,2BAA2B,CAAA,IAAA,CAAA,GAAA,IAAA;AAAA,EAAA,OAA3BA,2BAA2B;AAAA,CAAA,CAAA,EAAA;AAWvC,YAAe;EACbD,gBAAgB;AAChBC,EAAAA;AACF,CAAC;;;;"}
|
|
@@ -39,10 +39,28 @@ class HdsLayoutGrid extends Component {
|
|
|
39
39
|
return undefined;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
+
|
|
43
|
+
/*
|
|
44
|
+
LOGIC:
|
|
45
|
+
If columnMinWidth is passed in:
|
|
46
|
+
1) we set --hds-layout-grid-column-min-width to the passed in value
|
|
47
|
+
2) We use the fallback value of "auto-fit" for --hds-layout-grid-column-fill-type (reults in a more fluid layout)
|
|
48
|
+
If columnWidth is passed in:
|
|
49
|
+
1) we set --hds-layout-grid-column-min-width to the passed in value
|
|
50
|
+
2) we set --hds-layout-grid-column-fill-type to "auto-fill" (results in a more fixed layout)
|
|
51
|
+
If both columnMinWidth & columnWidth are passed in:
|
|
52
|
+
1) We throw an error, as it doesn't make sense in the context of a CSS grid layout (too complex to determine which to use & desired behavior)
|
|
53
|
+
*/
|
|
42
54
|
get inlineStyles() {
|
|
43
55
|
const inlineStyles = {};
|
|
56
|
+
|
|
57
|
+
// if both columnMinWidth and columnWidth are passed in, we throw an error
|
|
58
|
+
assert(`@columnMinWidth and @columnWidth for "Hds::Layout::Grid" cannot be used together`, !(this.args.columnMinWidth && this.args.columnWidth));
|
|
44
59
|
if (this.args.columnMinWidth) {
|
|
45
60
|
inlineStyles['--hds-layout-grid-column-min-width'] = this.args.columnMinWidth;
|
|
61
|
+
} else if (this.args.columnWidth) {
|
|
62
|
+
inlineStyles['--hds-layout-grid-column-min-width'] = this.args.columnWidth;
|
|
63
|
+
inlineStyles['--hds-layout-grid-column-fill-type'] = 'auto-fill';
|
|
46
64
|
}
|
|
47
65
|
return inlineStyles;
|
|
48
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/layout/grid/index.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\n\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsLayoutGridItemSignature } from '../grid/item.ts';\n\nimport { HdsLayoutGridAlignValues, HdsLayoutGridGapValues } from './types.ts';\n\nimport type {\n HdsLayoutGridAligns,\n HdsLayoutGridGaps,\n AvailableTagNames,\n AvailableElements,\n} from './types.ts';\n\nexport const ALIGNS: string[] = Object.values(HdsLayoutGridAlignValues);\nexport const GAPS: string[] = Object.values(HdsLayoutGridGapValues);\n\nexport interface HdsLayoutGridSignature {\n Args: {\n tag?: AvailableTagNames;\n columnMinWidth?: string;\n align?: HdsLayoutGridAligns;\n gap?: HdsLayoutGridGaps | [HdsLayoutGridGaps, HdsLayoutGridGaps];\n };\n Blocks: {\n default: [\n {\n Item?: ComponentLike<HdsLayoutGridItemSignature>;\n },\n ];\n };\n Element: AvailableElements;\n}\n\nexport default class HdsLayoutGrid extends Component<HdsLayoutGridSignature> {\n get componentTag(): AvailableTagNames {\n return this.args.tag ?? 'div';\n }\n\n get align(): HdsLayoutGridAligns | undefined {\n const { align } = this.args;\n\n if (align) {\n assert(\n `@align for \"Hds::Layout::Grid\" must be one of the following: ${ALIGNS.join(\n ', '\n )}; received: ${align}`,\n ALIGNS.includes(align)\n );\n }\n\n return align;\n }\n\n get gap():\n | [HdsLayoutGridGaps]\n | [HdsLayoutGridGaps, HdsLayoutGridGaps]\n | undefined {\n const { gap } = this.args;\n\n if (gap) {\n assert(\n `@gap for \"Hds::Layout::Grid\" must be a single value or an array of two values of one of the following: ${GAPS.join(\n ', '\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n )}; received: ${gap}`,\n (!Array.isArray(gap) && GAPS.includes(gap)) ||\n (Array.isArray(gap) &&\n gap.length === 2 &&\n GAPS.includes(gap[0]) &&\n GAPS.includes(gap[1]))\n );\n return Array.isArray(gap) ? gap : [gap];\n } else {\n return undefined;\n }\n }\n\n get inlineStyles(): Record<string, unknown> {\n const inlineStyles: {\n '--hds-layout-grid-column-min-width'?: string;\n } = {};\n\n if (this.args.columnMinWidth) {\n inlineStyles['--hds-layout-grid-column-min-width'] =\n this.args.columnMinWidth;\n }\n return inlineStyles;\n }\n\n get classNames(): string {\n const classes = ['hds-layout-grid'];\n\n // add a class based on the @align argument\n if (this.align) {\n classes.push(`hds-layout-grid--align-items-${this.align}`);\n }\n\n // add a class based on the @gap argument\n if (this.gap) {\n if (this.gap.length === 2) {\n classes.push(`hds-layout-grid--row-gap-${this.gap[0]}`);\n classes.push(`hds-layout-grid--column-gap-${this.gap[1]}`);\n } else if (this.gap.length === 1) {\n classes.push(`hds-layout-grid--row-gap-${this.gap[0]}`);\n classes.push(`hds-layout-grid--column-gap-${this.gap[0]}`);\n }\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ALIGNS","Object","values","HdsLayoutGridAlignValues","GAPS","HdsLayoutGridGapValues","HdsLayoutGrid","Component","componentTag","args","tag","align","assert","join","includes","gap","Array","isArray","length","undefined","inlineStyles","columnMinWidth","classNames","classes","push","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;;AAiBO,MAAMA,MAAgB,GAAGC,MAAM,CAACC,MAAM,CAACC,wBAAwB;AAC/D,MAAMC,IAAc,GAAGH,MAAM,CAACC,MAAM,CAACG,sBAAsB;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/layout/grid/index.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\n\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsLayoutGridItemSignature } from '../grid/item.ts';\n\nimport { HdsLayoutGridAlignValues, HdsLayoutGridGapValues } from './types.ts';\n\nimport type {\n HdsLayoutGridAligns,\n HdsLayoutGridGaps,\n AvailableTagNames,\n AvailableElements,\n} from './types.ts';\n\nexport const ALIGNS: string[] = Object.values(HdsLayoutGridAlignValues);\nexport const GAPS: string[] = Object.values(HdsLayoutGridGapValues);\n\nexport interface HdsLayoutGridSignature {\n Args: {\n tag?: AvailableTagNames;\n columnMinWidth?: string;\n columnWidth?: string;\n align?: HdsLayoutGridAligns;\n gap?: HdsLayoutGridGaps | [HdsLayoutGridGaps, HdsLayoutGridGaps];\n };\n Blocks: {\n default: [\n {\n Item?: ComponentLike<HdsLayoutGridItemSignature>;\n },\n ];\n };\n Element: AvailableElements;\n}\n\nexport default class HdsLayoutGrid extends Component<HdsLayoutGridSignature> {\n get componentTag(): AvailableTagNames {\n return this.args.tag ?? 'div';\n }\n\n get align(): HdsLayoutGridAligns | undefined {\n const { align } = this.args;\n\n if (align) {\n assert(\n `@align for \"Hds::Layout::Grid\" must be one of the following: ${ALIGNS.join(\n ', '\n )}; received: ${align}`,\n ALIGNS.includes(align)\n );\n }\n\n return align;\n }\n\n get gap():\n | [HdsLayoutGridGaps]\n | [HdsLayoutGridGaps, HdsLayoutGridGaps]\n | undefined {\n const { gap } = this.args;\n\n if (gap) {\n assert(\n `@gap for \"Hds::Layout::Grid\" must be a single value or an array of two values of one of the following: ${GAPS.join(\n ', '\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n )}; received: ${gap}`,\n (!Array.isArray(gap) && GAPS.includes(gap)) ||\n (Array.isArray(gap) &&\n gap.length === 2 &&\n GAPS.includes(gap[0]) &&\n GAPS.includes(gap[1]))\n );\n return Array.isArray(gap) ? gap : [gap];\n } else {\n return undefined;\n }\n }\n\n /*\n LOGIC:\n\n If columnMinWidth is passed in:\n 1) we set --hds-layout-grid-column-min-width to the passed in value\n 2) We use the fallback value of \"auto-fit\" for --hds-layout-grid-column-fill-type (reults in a more fluid layout)\n\n If columnWidth is passed in:\n 1) we set --hds-layout-grid-column-min-width to the passed in value\n 2) we set --hds-layout-grid-column-fill-type to \"auto-fill\" (results in a more fixed layout)\n\n If both columnMinWidth & columnWidth are passed in:\n 1) We throw an error, as it doesn't make sense in the context of a CSS grid layout (too complex to determine which to use & desired behavior)\n */\n get inlineStyles(): Record<string, unknown> {\n const inlineStyles: {\n '--hds-layout-grid-column-min-width'?: string;\n '--hds-layout-grid-column-fill-type'?: string;\n } = {};\n\n // if both columnMinWidth and columnWidth are passed in, we throw an error\n assert(\n `@columnMinWidth and @columnWidth for \"Hds::Layout::Grid\" cannot be used together`,\n !(this.args.columnMinWidth && this.args.columnWidth)\n );\n\n if (this.args.columnMinWidth) {\n inlineStyles['--hds-layout-grid-column-min-width'] =\n this.args.columnMinWidth;\n } else if (this.args.columnWidth) {\n inlineStyles['--hds-layout-grid-column-min-width'] =\n this.args.columnWidth;\n inlineStyles['--hds-layout-grid-column-fill-type'] = 'auto-fill';\n }\n\n return inlineStyles;\n }\n\n get classNames(): string {\n const classes = ['hds-layout-grid'];\n\n // add a class based on the @align argument\n if (this.align) {\n classes.push(`hds-layout-grid--align-items-${this.align}`);\n }\n\n // add a class based on the @gap argument\n if (this.gap) {\n if (this.gap.length === 2) {\n classes.push(`hds-layout-grid--row-gap-${this.gap[0]}`);\n classes.push(`hds-layout-grid--column-gap-${this.gap[1]}`);\n } else if (this.gap.length === 1) {\n classes.push(`hds-layout-grid--row-gap-${this.gap[0]}`);\n classes.push(`hds-layout-grid--column-gap-${this.gap[0]}`);\n }\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ALIGNS","Object","values","HdsLayoutGridAlignValues","GAPS","HdsLayoutGridGapValues","HdsLayoutGrid","Component","componentTag","args","tag","align","assert","join","includes","gap","Array","isArray","length","undefined","inlineStyles","columnMinWidth","columnWidth","classNames","classes","push","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;;AAiBO,MAAMA,MAAgB,GAAGC,MAAM,CAACC,MAAM,CAACC,wBAAwB;AAC/D,MAAMC,IAAc,GAAGH,MAAM,CAACC,MAAM,CAACG,sBAAsB;AAoBnD,MAAMC,aAAa,SAASC,SAAS,CAAyB;EAC3E,IAAIC,YAAYA,GAAsB;AACpC,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,GAAG,IAAI,KAAK;AAC/B;EAEA,IAAIC,KAAKA,GAAoC;IAC3C,MAAM;AAAEA,MAAAA;KAAO,GAAG,IAAI,CAACF,IAAI;AAE3B,IAAA,IAAIE,KAAK,EAAE;AACTC,MAAAA,MAAM,CACJ,CAAgEZ,6DAAAA,EAAAA,MAAM,CAACa,IAAI,CACzE,IACF,CAAC,CAAA,YAAA,EAAeF,KAAK,CAAA,CAAE,EACvBX,MAAM,CAACc,QAAQ,CAACH,KAAK,CACvB,CAAC;AACH;AAEA,IAAA,OAAOA,KAAK;AACd;EAEA,IAAII,GAAGA,GAGO;IACZ,MAAM;AAAEA,MAAAA;KAAK,GAAG,IAAI,CAACN,IAAI;AAEzB,IAAA,IAAIM,GAAG,EAAE;AACPH,MAAAA,MAAM,CACJ,CAAA,uGAAA,EAA0GR,IAAI,CAACS,IAAI,CACjH;AACA;OACD,CAAA,YAAA,EAAeE,GAAG,CAAE,CAAA,EACpB,CAACC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,IAAIX,IAAI,CAACU,QAAQ,CAACC,GAAG,CAAC,IACvCC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,IACjBA,GAAG,CAACG,MAAM,KAAK,CAAC,IAChBd,IAAI,CAACU,QAAQ,CAACC,GAAG,CAAC,CAAC,CAAC,CAAC,IACrBX,IAAI,CAACU,QAAQ,CAACC,GAAG,CAAC,CAAC,CAAC,CAC1B,CAAC;MACD,OAAOC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,GAAGA,GAAG,GAAG,CAACA,GAAG,CAAC;AACzC,KAAC,MAAM;AACL,MAAA,OAAOI,SAAS;AAClB;AACF;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAIE,IAAIC,YAAYA,GAA4B;IAC1C,MAAMA,YAGL,GAAG,EAAE;;AAEN;AACAR,IAAAA,MAAM,CACJ,CAAkF,gFAAA,CAAA,EAClF,EAAE,IAAI,CAACH,IAAI,CAACY,cAAc,IAAI,IAAI,CAACZ,IAAI,CAACa,WAAW,CACrD,CAAC;AAED,IAAA,IAAI,IAAI,CAACb,IAAI,CAACY,cAAc,EAAE;MAC5BD,YAAY,CAAC,oCAAoC,CAAC,GAChD,IAAI,CAACX,IAAI,CAACY,cAAc;AAC5B,KAAC,MAAM,IAAI,IAAI,CAACZ,IAAI,CAACa,WAAW,EAAE;MAChCF,YAAY,CAAC,oCAAoC,CAAC,GAChD,IAAI,CAACX,IAAI,CAACa,WAAW;AACvBF,MAAAA,YAAY,CAAC,oCAAoC,CAAC,GAAG,WAAW;AAClE;AAEA,IAAA,OAAOA,YAAY;AACrB;EAEA,IAAIG,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,iBAAiB,CAAC;;AAEnC;IACA,IAAI,IAAI,CAACb,KAAK,EAAE;MACda,OAAO,CAACC,IAAI,CAAC,CAAA,6BAAA,EAAgC,IAAI,CAACd,KAAK,EAAE,CAAC;AAC5D;;AAEA;IACA,IAAI,IAAI,CAACI,GAAG,EAAE;AACZ,MAAA,IAAI,IAAI,CAACA,GAAG,CAACG,MAAM,KAAK,CAAC,EAAE;QACzBM,OAAO,CAACC,IAAI,CAAC,CAA4B,yBAAA,EAAA,IAAI,CAACV,GAAG,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC;QACvDS,OAAO,CAACC,IAAI,CAAC,CAA+B,4BAAA,EAAA,IAAI,CAACV,GAAG,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC;OAC3D,MAAM,IAAI,IAAI,CAACA,GAAG,CAACG,MAAM,KAAK,CAAC,EAAE;QAChCM,OAAO,CAACC,IAAI,CAAC,CAA4B,yBAAA,EAAA,IAAI,CAACV,GAAG,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC;QACvDS,OAAO,CAACC,IAAI,CAAC,CAA+B,4BAAA,EAAA,IAAI,CAACV,GAAG,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC;AAC5D;AACF;AAEA,IAAA,OAAOS,OAAO,CAACX,IAAI,CAAC,GAAG,CAAC;AAC1B;AACF;AAACa,oBAAA,CAAAC,QAAA,EAvGoBrB,aAAa,CAAA;;;;"}
|
|
@@ -7,7 +7,7 @@ import { precompileTemplate } from '@ember/template-compilation';
|
|
|
7
7
|
import { g, i, n } from 'decorator-transforms/runtime';
|
|
8
8
|
import { setComponentTemplate } from '@ember/component';
|
|
9
9
|
|
|
10
|
-
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n\n<table class={{this.classNames}} ...attributes>\n {{#if @columns}}\n <caption class=\"sr-only\" aria-live=\"polite\">{{@caption}} {{this.sortedMessageText}}</caption>\n {{else if @caption}}\n <caption class=\"sr-only\">{{@caption}}</caption>\n {{/if}}\n\n <thead class=\"hds-table__thead\">\n {{#if @columns}}\n <Hds::Table::Tr\n @selectionScope=\"col\"\n @onClickSortBySelected={{if @selectableColumnKey (fn this.setSortBy @selectableColumnKey)}}\n @sortBySelectedOrder={{if (eq this.sortBy @selectableColumnKey) this.sortOrder}}\n @isSelectable={{@isSelectable}}\n @onSelectionChange={{this.onSelectionAllChange}}\n @didInsert={{this.didInsertSelectAllCheckbox}}\n @willDestroy={{this.willDestroySelectAllCheckbox}}\n @selectionAriaLabelSuffix=\"all rows\"\n >\n {{#each @columns as |column|}}\n {{#if column.isSortable}}\n <Hds::Table::ThSort\n @sortOrder={{if (eq column.key this.sortBy) this.sortOrder}}\n @onClickSort={{fn this.setSortBy column.key}}\n @align={{column.align}}\n @width={{column.width}}\n @tooltip={{column.tooltip}}\n >\n {{column.label}}\n </Hds::Table::ThSort>\n {{else}}\n <Hds::Table::Th\n @align={{column.align}}\n @width={{column.width}}\n @tooltip={{column.tooltip}}\n @isVisuallyHidden={{column.isVisuallyHidden}}\n >{{column.label}}</Hds::Table::Th>\n {{/if}}\n {{/each}}\n </Hds::Table::Tr>\n {{else}}\n {{yield\n (hash\n Tr=(component\n \"hds/table/tr\"\n selectionScope=\"col\"\n isSelectable=@isSelectable\n onSelectionChange=this.onSelectionAllChange\n didInsert=this.didInsertSelectAllCheckbox\n willDestroy=this.willDestroySelectAllCheckbox\n selectionAriaLabelSuffix=\"all rows\"\n onClickSortBySelected=(if @selectableColumnKey (fn this.setSortBy @selectableColumnKey))\n sortBySelectedOrder=(if (eq this.sortBy @selectableColumnKey) this.sortOrder)\n )\n Th=(component \"hds/table/th\")\n ThSort=(component \"hds/table/th-sort\")\n sortBy=this.sortBy\n sortOrder=this.sortOrder\n setSortBy=this.setSortBy\n )\n to=\"head\"\n }}\n {{/if}}\n </thead>\n\n <tbody class=\"hds-table__tbody\">\n {{#if @columns}}\n {{! ----------------------------------------------------------------------------------------\n IMPORTANT: we loop on the `model` array and for each record\n we yield the Tr/Td/Th elements _and_ the record itself as `data`\n this means the consumer will *have to* use the `data` key to access it in their template\n -------------------------------------------------------------------------------------------- }}\n {{#each (sort-by this.getSortCriteria @model) key=this.identityKey as |record index|}}\n {{yield\n (hash\n Tr=(component\n \"hds/table/tr\"\n selectionScope=\"row\"\n isSelectable=@isSelectable\n onSelectionChange=this.onSelectionRowChange\n didInsert=this.didInsertRowCheckbox\n willDestroy=this.willDestroyRowCheckbox\n selectionAriaLabelSuffix=@selectionAriaLabelSuffix\n )\n Th=(component \"hds/table/th\" scope=\"row\")\n Td=(component \"hds/table/td\" align=@align)\n data=record\n rowIndex=index\n )\n to=\"body\"\n }}\n {{/each}}\n {{else}}\n {{yield\n (hash\n Tr=(component\n \"hds/table/tr\"\n selectionScope=\"row\"\n isSelectable=@isSelectable\n onSelectionChange=this.onSelectionRowChange\n didInsert=this.didInsertRowCheckbox\n willDestroy=this.willDestroyRowCheckbox\n selectionAriaLabelSuffix=@selectionAriaLabelSuffix\n )\n Th=(component \"hds/table/th\" scope=\"row\")\n Td=(component \"hds/table/td\" align=@align)\n sortBy=this.sortBy\n sortOrder=this.sortOrder\n )\n to=\"body\"\n }}\n {{/if}}\n </tbody>\n</table>");
|
|
10
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n\n<table class={{this.classNames}} ...attributes>\n {{#if @columns}}\n <caption class=\"sr-only\" aria-live=\"polite\">{{@caption}} {{this.sortedMessageText}}</caption>\n {{else if @caption}}\n <caption class=\"sr-only\">{{@caption}}</caption>\n {{/if}}\n\n <thead class=\"hds-table__thead\">\n {{#if @columns}}\n <Hds::Table::Tr\n @selectionScope=\"col\"\n @onClickSortBySelected={{if @selectableColumnKey (fn this.setSortBy @selectableColumnKey)}}\n @sortBySelectedOrder={{if (eq this.sortBy @selectableColumnKey) this.sortOrder}}\n @isSelectable={{@isSelectable}}\n @onSelectionChange={{this.onSelectionAllChange}}\n @didInsert={{this.didInsertSelectAllCheckbox}}\n @willDestroy={{this.willDestroySelectAllCheckbox}}\n @selectionAriaLabelSuffix=\"all rows\"\n >\n {{#each @columns as |column|}}\n {{#if column.isSortable}}\n <Hds::Table::ThSort\n @sortOrder={{if (eq column.key this.sortBy) this.sortOrder}}\n @onClickSort={{fn this.setSortBy column.key}}\n @align={{column.align}}\n @width={{column.width}}\n @tooltip={{column.tooltip}}\n >\n {{column.label}}\n </Hds::Table::ThSort>\n {{else}}\n <Hds::Table::Th\n @align={{column.align}}\n @width={{column.width}}\n @tooltip={{column.tooltip}}\n @isVisuallyHidden={{column.isVisuallyHidden}}\n >{{column.label}}</Hds::Table::Th>\n {{/if}}\n {{/each}}\n </Hds::Table::Tr>\n {{else}}\n {{yield\n (hash\n Tr=(component\n \"hds/table/tr\"\n selectionScope=\"col\"\n isSelectable=@isSelectable\n onSelectionChange=this.onSelectionAllChange\n didInsert=this.didInsertSelectAllCheckbox\n willDestroy=this.willDestroySelectAllCheckbox\n selectionAriaLabelSuffix=\"all rows\"\n onClickSortBySelected=(if @selectableColumnKey (fn this.setSortBy @selectableColumnKey))\n sortBySelectedOrder=(if (eq this.sortBy @selectableColumnKey) this.sortOrder)\n )\n Th=(component \"hds/table/th\")\n ThSort=(component \"hds/table/th-sort\")\n sortBy=this.sortBy\n sortOrder=this.sortOrder\n setSortBy=this.setSortBy\n )\n to=\"head\"\n }}\n {{/if}}\n </thead>\n\n <tbody class=\"hds-table__tbody\">\n {{#if @columns}}\n {{! ----------------------------------------------------------------------------------------\n IMPORTANT: we loop on the `model` array and for each record\n we yield the Tr/Td/Th elements _and_ the record itself as `data`\n this means the consumer will *have to* use the `data` key to access it in their template\n -------------------------------------------------------------------------------------------- }}\n {{! @glint-expect-error: [HDS-4380](https://hashicorp.atlassian.net/browse/HDS-4380) }}\n {{#each (sort-by this.getSortCriteria @model) key=this.identityKey as |record index|}}\n {{yield\n (hash\n Tr=(component\n \"hds/table/tr\"\n selectionScope=\"row\"\n isSelectable=@isSelectable\n onSelectionChange=this.onSelectionRowChange\n didInsert=this.didInsertRowCheckbox\n willDestroy=this.willDestroyRowCheckbox\n selectionAriaLabelSuffix=@selectionAriaLabelSuffix\n )\n Th=(component \"hds/table/th\" scope=\"row\")\n Td=(component \"hds/table/td\" align=@align)\n data=record\n rowIndex=index\n )\n to=\"body\"\n }}\n {{/each}}\n {{else}}\n {{yield\n (hash\n Tr=(component\n \"hds/table/tr\"\n selectionScope=\"row\"\n isSelectable=@isSelectable\n onSelectionChange=this.onSelectionRowChange\n didInsert=this.didInsertRowCheckbox\n willDestroy=this.willDestroyRowCheckbox\n selectionAriaLabelSuffix=@selectionAriaLabelSuffix\n )\n Th=(component \"hds/table/th\" scope=\"row\")\n Td=(component \"hds/table/td\" align=@align)\n sortBy=this.sortBy\n sortOrder=this.sortOrder\n )\n to=\"body\"\n }}\n {{/if}}\n </tbody>\n</table>");
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Copyright (c) HashiCorp, Inc.
|
package/dist/components.js
CHANGED
|
@@ -85,6 +85,17 @@ export { HdsDropdownToggleButtonColorValues, HdsDropdownToggleButtonSizeValues,
|
|
|
85
85
|
export { HdsDropdownPositionToPlacementValues, HdsDropdownPositionValues } from './components/hds/dropdown/types.js';
|
|
86
86
|
export { default as HdsFlyout } from './components/hds/flyout/index.js';
|
|
87
87
|
export { HdsFlyoutSizesValues } from './components/hds/flyout/types.js';
|
|
88
|
+
export { default as HdsForm } from './components/hds/form/index.js';
|
|
89
|
+
export { default as HdsFormFooter } from './components/hds/form/footer/index.js';
|
|
90
|
+
export { default as HdsFormHeader } from './components/hds/form/header/index.js';
|
|
91
|
+
export { default as HdsFormHeaderTitle } from './components/hds/form/header/title.js';
|
|
92
|
+
export { default as HdsFormHeaderDescription } from './components/hds/form/header/description.js';
|
|
93
|
+
export { default as HdsFormSection } from './components/hds/form/section/index.js';
|
|
94
|
+
export { default as HdsFormSectionHeader } from './components/hds/form/section/header.js';
|
|
95
|
+
export { default as HdsFormSectionMultiFieldGroup } from './components/hds/form/section/multi-field-group/index.js';
|
|
96
|
+
export { default as HdsFormSectionMultiFieldGroupItem } from './components/hds/form/section/multi-field-group/item.js';
|
|
97
|
+
export { default as HdsFormSeparator } from './components/hds/form/separator/index.js';
|
|
98
|
+
export { HdsFormHeaderTitleTagValues, HdsFormTagValues } from './components/hds/form/types.js';
|
|
88
99
|
export { default as HdsFormCharacterCount } from './components/hds/form/character-count/index.js';
|
|
89
100
|
export { default as HdsFormError } from './components/hds/form/error/index.js';
|
|
90
101
|
export { default as HdsFormErrorMessage } from './components/hds/form/error/message.js';
|
|
@@ -102,6 +113,11 @@ export { default as HdsFormCheckboxField } from './components/hds/form/checkbox/
|
|
|
102
113
|
export { default as HdsFormCheckboxGroup } from './components/hds/form/checkbox/group.js';
|
|
103
114
|
export { default as HdsFormFileInputBase } from './components/hds/form/file-input/base.js';
|
|
104
115
|
export { default as HdsFormFileInputField } from './components/hds/form/file-input/field.js';
|
|
116
|
+
export { default as HdsFormKeyValueInputs } from './components/hds/form/key-value-inputs/index.js';
|
|
117
|
+
export { default as HdsFormKeyValueInputsAddRowButton } from './components/hds/form/key-value-inputs/add-row-button.js';
|
|
118
|
+
export { default as HdsFormKeyValueInputsDeleteRowButton } from './components/hds/form/key-value-inputs/delete-row-button.js';
|
|
119
|
+
export { default as HdsFormKeyValueInputsField } from './components/hds/form/key-value-inputs/field.js';
|
|
120
|
+
export { default as HdsFormKeyValueInputsGeneric } from './components/hds/form/key-value-inputs/generic.js';
|
|
105
121
|
export { default as HdsFormMaskedInputBase } from './components/hds/form/masked-input/base.js';
|
|
106
122
|
export { default as HdsFormMaskedInputField } from './components/hds/form/masked-input/field.js';
|
|
107
123
|
export { default as HdsFormRadioBase } from './components/hds/form/radio/base.js';
|
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|