@energinet/watt 2.0.7 → 2.0.9
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/fesm2022/energinet-watt-badge.mjs.map +1 -1
- package/fesm2022/energinet-watt-breadcrumbs.mjs.map +1 -1
- package/fesm2022/energinet-watt-button.mjs.map +1 -1
- package/fesm2022/energinet-watt-card.mjs.map +1 -1
- package/fesm2022/energinet-watt-checkbox.mjs.map +1 -1
- package/fesm2022/energinet-watt-chip.mjs.map +1 -1
- package/fesm2022/energinet-watt-code.mjs.map +1 -1
- package/fesm2022/energinet-watt-core-breakpoints.mjs.map +1 -1
- package/fesm2022/energinet-watt-core-color.mjs.map +1 -1
- package/fesm2022/energinet-watt-core-date.mjs.map +1 -1
- package/fesm2022/energinet-watt-data.mjs.map +1 -1
- package/fesm2022/energinet-watt-datetime-field.mjs.map +1 -1
- package/fesm2022/energinet-watt-description-list.mjs.map +1 -1
- package/fesm2022/energinet-watt-drawer.mjs.map +1 -1
- package/fesm2022/energinet-watt-dropdown.mjs.map +1 -1
- package/fesm2022/energinet-watt-dropzone.mjs.map +1 -1
- package/fesm2022/energinet-watt-empty-state.mjs.map +1 -1
- package/fesm2022/energinet-watt-expandable-card.mjs.map +1 -1
- package/fesm2022/energinet-watt-expansion.mjs.map +1 -1
- package/fesm2022/energinet-watt-field.mjs.map +1 -1
- package/fesm2022/energinet-watt-icon-flags.mjs.map +1 -1
- package/fesm2022/energinet-watt-icon.mjs.map +1 -1
- package/fesm2022/energinet-watt-modal.mjs.map +1 -1
- package/fesm2022/energinet-watt-paginator.mjs.map +1 -1
- package/fesm2022/energinet-watt-phone-field.mjs.map +1 -1
- package/fesm2022/energinet-watt-picker-__shared.mjs.map +1 -1
- package/fesm2022/energinet-watt-picker-datepicker.mjs.map +1 -1
- package/fesm2022/energinet-watt-picker-timepicker.mjs.map +1 -1
- package/fesm2022/energinet-watt-progress-tracker.mjs.map +1 -1
- package/fesm2022/energinet-watt-radio.mjs.map +1 -1
- package/fesm2022/energinet-watt-search.mjs.map +1 -1
- package/fesm2022/energinet-watt-segmented-buttons.mjs.map +1 -1
- package/fesm2022/energinet-watt-shell.mjs.map +1 -1
- package/fesm2022/energinet-watt-slide-toggle.mjs.map +1 -1
- package/fesm2022/energinet-watt-spinner.mjs.map +1 -1
- package/fesm2022/energinet-watt-stepper.mjs.map +1 -1
- package/fesm2022/energinet-watt-table.mjs.map +1 -1
- package/fesm2022/energinet-watt-tabs.mjs.map +1 -1
- package/fesm2022/energinet-watt-text-field.mjs.map +1 -1
- package/fesm2022/energinet-watt-textarea-field.mjs.map +1 -1
- package/fesm2022/energinet-watt-toast.mjs.map +1 -1
- package/fesm2022/energinet-watt-tooltip.mjs.map +1 -1
- package/fesm2022/energinet-watt-utils-css.mjs.map +1 -1
- package/fesm2022/energinet-watt-utils-resize-observer.mjs.map +1 -1
- package/fesm2022/energinet-watt-validation-message.mjs.map +1 -1
- package/fesm2022/energinet-watt-validators.mjs +9 -0
- package/fesm2022/energinet-watt-validators.mjs.map +1 -1
- package/fesm2022/energinet-watt-vater.mjs.map +1 -1
- package/fesm2022/energinet-watt-year-field.mjs.map +1 -1
- package/fesm2022/energinet-watt-yearmonth-field.mjs.map +1 -1
- package/package.json +1 -1
- package/validators/watt-range.validators.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-empty-state.mjs","sources":["../../../libs/watt/package/empty-state/icons/explore.ts","../../../libs/watt/package/empty-state/icons/no-results.ts","../../../libs/watt/package/empty-state/icons/power.ts","../../../libs/watt/package/empty-state/watt-empty-state.component.ts","../../../libs/watt/package/empty-state/index.ts","../../../libs/watt/package/empty-state/energinet-watt-empty-state.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-empty-state-explore',\n template: `\n <svg viewBox=\"0 0 96 98\" fill=\"none\">\n <path\n fill=\"currentColor\"\n d=\"M59.4473 60.5798c-.2445.1864-.503.3517-.7317.5628a34.937 34.937 0 0 1-17.0602 8.5072 34.4744 34.4744 0 0 1-7.8055.591A35.139 35.139 0 0 1 1.4442 45.2255 33.1081 33.1081 0 0 1 .081 37.7788c-.663-10.7585 2.7613-20.015 10.3769-27.6464C15.4248 5.141 21.4574 2.0226 28.3747.656a33.4635 33.4635 0 0 1 7.6807-.6366c8.9962.3324 16.8105 3.5474 23.3356 9.7612 5.25 4.9932 8.5899 11.098 10.1007 18.1842a33.6296 33.6296 0 0 1 .6719 9.1457c-.5417 8.6262-3.7896 16.0818-9.7437 22.3665a6.0972 6.0972 0 0 0-.4045.5276l-.5681.5752Zm9.2494-25.4269c0-18.5657-15.0358-33.5928-33.5928-33.607C16.7263 1.5303 1.511 16.4255 1.511 35.1548c.0158 18.7803 15.2593 33.417 33.2921 33.57 18.3794.1583 33.8514-14.6806 33.8866-33.5718h.007Z\"\n />\n <path\n fill=\"currentColor\"\n d=\"m59.4473 60.5797.5751-.5751c.2515-.1882.2586-.1935.4714.0211.5822.5909 1.159 1.1871 1.7377 1.7816l15.7447 16.1809 16.4183 16.8703c.4414.4537.8794.9058 1.3243 1.3595.1073.1108.2094.2251.2885.3096l-1.043 1.1203-35.7861-36.7587.2691-.3095ZM60.4444 35.8792h-1.4897c-.1196-6.3316-2.3199-11.8331-6.8083-16.3286-4.4884-4.4954-9.9864-6.7045-16.3427-6.8364v-1.4475c12.563-.3887 24.755 10.4508 24.6407 24.6125Z\"\n />\n </svg>\n `,\n})\nexport class WattEmptyStateExploreComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-empty-state-no-results',\n template: `\n <svg viewBox=\"0 0 128 128\" fill=\"none\">\n <path\n fill=\"currentColor\"\n fill-rule=\"evenodd\"\n d=\"M64 116c28.719 0 52-23.281 52-52S92.719 12 64 12 12 35.281 12 64s23.281 52 52 52Zm0 2c29.823 0 54-24.177 54-54S93.823 10 64 10 10 34.177 10 64s24.177 54 54 54Z\"\n clip-rule=\"evenodd\"\n />\n <path\n fill=\"currentColor\"\n fill-rule=\"evenodd\"\n d=\"M63.91 65.91 42 87.82l-1.414-1.414 21.91-21.91L40 42l1.414-1.414L63.91 63.082l22.496-22.497L87.82 42 65.325 64.496l21.91 21.91-1.413 1.414-21.91-21.91Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n `,\n})\nexport class WattEmptyStateNoResultsComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-empty-state-power',\n template: `\n <svg viewBox=\"0 0 96 116\" fill=\"none\">\n <path\n fill=\"currentColor\"\n d=\"M48.9 89.88v25.914c-.606.042-1.213.042-1.818 0v-25.91c-.507-.042-.963-.083-1.422-.117-5.211-.394-9.989-2.067-14.383-4.875-4.834-3.091-8.642-7.183-11.614-12.07a42.881 42.881 0 0 1-5.505-14.54 46.448 46.448 0 0 1-.788-8.755V38.27c-.24 0-.446-.027-.655-.027H0v-1.8h24.536c.01-.268.027-.479.027-.69v-30.8a4.936 4.936 0 0 1 9.87-.145v31.527c.403.125 26.458.152 27.06.032 0-.23.03-.476.03-.72V5.198c-.02-.717.1-1.432.352-2.105a4.944 4.944 0 0 1 9.437.922c.07.427.104.86.098 1.294V36.424c1.204.033 2.363 0 3.522.014 1.16.015 2.335 0 3.5 0h17.51c.058.595.062 1.194.01 1.789h-13.32c-.018.252-.05.459-.05.667 0 3.335-.01 6.67 0 10.005a49.34 49.34 0 0 1-.36 6.683c-1.251 9.34-4.857 17.585-11.488 24.388-4.212 4.32-9.242 7.369-15.123 8.916a30.233 30.233 0 0 1-6.253.95c-.137.004-.267.025-.459.044ZM15.216 47.344c-.018.105-.03.211-.036.317-.044 3.204.08 6.393.626 9.56a42.105 42.105 0 0 0 4.123 12.363c2.538 4.873 5.911 9.058 10.316 12.373 5.013 3.773 10.63 5.876 16.932 6.082a27.722 27.722 0 0 0 9.688-1.421c5.11-1.69 9.443-4.586 13.118-8.494 4.552-4.832 7.55-10.527 9.286-16.905a43.867 43.867 0 0 0 1.334-7.567c.181-2.012.173-4.025.169-6.045a2.075 2.075 0 0 0-.03-.24c-.374-.104-64.866-.133-65.526-.023Zm.035-9.071c-.12.585-.098 6.787.023 7.166.063.014.126.023.19.027H80.46c.07-.002.14-.01.209-.025a.122.122 0 0 0 .04-.027l.039-.04v-7.101H15.252Zm17.37-1.876V5.317a6.539 6.539 0 0 0-.031-.698A2.989 2.989 0 0 0 30.7 2.084a2.956 2.956 0 0 0-3.15.446c-.833.653-1.181 1.543-1.181 2.585v30.592c0 .227.02.454.033.71l6.22-.02Zm36.96.027V4.73a3.127 3.127 0 0 0-6.235.273v31.433c2.105.005 4.148.009 6.24-.002l-.005-.01Z\"\n />\n </svg>\n `,\n})\nexport class WattEmptyStatePowerComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { WattIcon, WattIconComponent, WattIconSize } from '@energinet/watt/icon';\nimport { WattEmptyStateExploreComponent } from './icons/explore';\nimport { WattEmptyStateNoResultsComponent } from './icons/no-results';\nimport { WattEmptyStatePowerComponent } from './icons/power';\n\n/**\n * Usage:\n * `import { WattEmptyStateComponent } from '@energinet-datahub/watt/empty-state';`\n */\n@Component({\n selector: 'watt-empty-state',\n encapsulation: ViewEncapsulation.None,\n imports: [\n WattEmptyStateExploreComponent,\n WattEmptyStateNoResultsComponent,\n WattEmptyStatePowerComponent,\n WattIconComponent,\n ],\n styles: `\n @use '@energinet-datahub/watt/utils' as watt;\n\n watt-empty-state {\n display: block;\n text-align: center;\n color: var(--watt-color-primary-dark);\n\n h3,\n h5,\n p {\n margin: 0;\n white-space: pre-wrap;\n }\n\n watt-button {\n display: block;\n margin-top: var(--watt-space-m);\n\n &:first-of-type {\n margin-top: var(--watt-space-l);\n }\n }\n }\n `,\n template: `\n @let name = icon();\n @switch (name) {\n @case ('custom-explore') {\n <watt-icon [size]=\"iconSize()\" class=\"watt-space-stack-l\">\n <watt-empty-state-explore />\n </watt-icon>\n }\n @case ('custom-no-results') {\n <watt-icon [size]=\"iconSize()\" class=\"watt-space-stack-l\">\n <watt-empty-state-no-results />\n </watt-icon>\n }\n @case ('custom-power') {\n <watt-icon [size]=\"iconSize()\" class=\"watt-space-stack-l\">\n <watt-empty-state-power />\n </watt-icon>\n }\n @default {\n <watt-icon [name]=\"name\" [size]=\"iconSize()\" class=\"watt-space-stack-l\" />\n }\n }\n\n @if (size() === 'large') {\n <h3>{{ title() }}</h3>\n } @else {\n <h5>{{ title() }}</h5>\n }\n\n @if (useHTML()) {\n <div [class.watt-text-s]=\"size() === 'small'\" [innerHTML]=\"message()\"></div>\n } @else {\n <p [class.watt-text-s]=\"size() === 'small'\">{{ message() }}</p>\n }\n\n <ng-content />\n `,\n})\nexport class WattEmptyStateComponent {\n icon = input<WattIcon | 'custom-power' | 'custom-explore' | 'custom-no-results'>();\n size = input<'small' | 'large'>('large');\n title = input('');\n message = input('');\n useHTML = input(false);\n iconSize = computed<WattIconSize>(() => (this.size() === 'small' ? 'xl' : 'xxl'));\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattEmptyStateComponent } from './watt-empty-state.component';\nexport { WattEmptyStateExploreComponent } from './icons/explore';\nexport { WattEmptyStateNoResultsComponent } from './icons/no-results';\nexport { WattEmptyStatePowerComponent } from './icons/power';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAkBa,8BAA8B,CAAA;uGAA9B,8BAA8B,EAAA,IAAA,EAAA,EAAA,E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C5B,iBAAiB,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAiER,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAxEnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EACb,aAAA,EAAA,iBAAiB,CAAC,IAAI,EAC5B,OAAA,EAAA;wBACP,8BAA8B;wBAC9B,gCAAgC;wBAChC,4BAA4B;wBAC5B,iBAAiB;qBAClB,EA0BS,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,sXAAA,CAAA,EAAA;;;AClGH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-empty-state.mjs","sources":["../../../libs/watt/package/empty-state/icons/explore.ts","../../../libs/watt/package/empty-state/icons/no-results.ts","../../../libs/watt/package/empty-state/icons/power.ts","../../../libs/watt/package/empty-state/watt-empty-state.component.ts","../../../libs/watt/package/empty-state/index.ts","../../../libs/watt/package/empty-state/energinet-watt-empty-state.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-empty-state-explore',\n template: `\n <svg viewBox=\"0 0 96 98\" fill=\"none\">\n <path\n fill=\"currentColor\"\n d=\"M59.4473 60.5798c-.2445.1864-.503.3517-.7317.5628a34.937 34.937 0 0 1-17.0602 8.5072 34.4744 34.4744 0 0 1-7.8055.591A35.139 35.139 0 0 1 1.4442 45.2255 33.1081 33.1081 0 0 1 .081 37.7788c-.663-10.7585 2.7613-20.015 10.3769-27.6464C15.4248 5.141 21.4574 2.0226 28.3747.656a33.4635 33.4635 0 0 1 7.6807-.6366c8.9962.3324 16.8105 3.5474 23.3356 9.7612 5.25 4.9932 8.5899 11.098 10.1007 18.1842a33.6296 33.6296 0 0 1 .6719 9.1457c-.5417 8.6262-3.7896 16.0818-9.7437 22.3665a6.0972 6.0972 0 0 0-.4045.5276l-.5681.5752Zm9.2494-25.4269c0-18.5657-15.0358-33.5928-33.5928-33.607C16.7263 1.5303 1.511 16.4255 1.511 35.1548c.0158 18.7803 15.2593 33.417 33.2921 33.57 18.3794.1583 33.8514-14.6806 33.8866-33.5718h.007Z\"\n />\n <path\n fill=\"currentColor\"\n d=\"m59.4473 60.5797.5751-.5751c.2515-.1882.2586-.1935.4714.0211.5822.5909 1.159 1.1871 1.7377 1.7816l15.7447 16.1809 16.4183 16.8703c.4414.4537.8794.9058 1.3243 1.3595.1073.1108.2094.2251.2885.3096l-1.043 1.1203-35.7861-36.7587.2691-.3095ZM60.4444 35.8792h-1.4897c-.1196-6.3316-2.3199-11.8331-6.8083-16.3286-4.4884-4.4954-9.9864-6.7045-16.3427-6.8364v-1.4475c12.563-.3887 24.755 10.4508 24.6407 24.6125Z\"\n />\n </svg>\n `,\n})\nexport class WattEmptyStateExploreComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-empty-state-no-results',\n template: `\n <svg viewBox=\"0 0 128 128\" fill=\"none\">\n <path\n fill=\"currentColor\"\n fill-rule=\"evenodd\"\n d=\"M64 116c28.719 0 52-23.281 52-52S92.719 12 64 12 12 35.281 12 64s23.281 52 52 52Zm0 2c29.823 0 54-24.177 54-54S93.823 10 64 10 10 34.177 10 64s24.177 54 54 54Z\"\n clip-rule=\"evenodd\"\n />\n <path\n fill=\"currentColor\"\n fill-rule=\"evenodd\"\n d=\"M63.91 65.91 42 87.82l-1.414-1.414 21.91-21.91L40 42l1.414-1.414L63.91 63.082l22.496-22.497L87.82 42 65.325 64.496l21.91 21.91-1.413 1.414-21.91-21.91Z\"\n clip-rule=\"evenodd\"\n />\n </svg>\n `,\n})\nexport class WattEmptyStateNoResultsComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-empty-state-power',\n template: `\n <svg viewBox=\"0 0 96 116\" fill=\"none\">\n <path\n fill=\"currentColor\"\n d=\"M48.9 89.88v25.914c-.606.042-1.213.042-1.818 0v-25.91c-.507-.042-.963-.083-1.422-.117-5.211-.394-9.989-2.067-14.383-4.875-4.834-3.091-8.642-7.183-11.614-12.07a42.881 42.881 0 0 1-5.505-14.54 46.448 46.448 0 0 1-.788-8.755V38.27c-.24 0-.446-.027-.655-.027H0v-1.8h24.536c.01-.268.027-.479.027-.69v-30.8a4.936 4.936 0 0 1 9.87-.145v31.527c.403.125 26.458.152 27.06.032 0-.23.03-.476.03-.72V5.198c-.02-.717.1-1.432.352-2.105a4.944 4.944 0 0 1 9.437.922c.07.427.104.86.098 1.294V36.424c1.204.033 2.363 0 3.522.014 1.16.015 2.335 0 3.5 0h17.51c.058.595.062 1.194.01 1.789h-13.32c-.018.252-.05.459-.05.667 0 3.335-.01 6.67 0 10.005a49.34 49.34 0 0 1-.36 6.683c-1.251 9.34-4.857 17.585-11.488 24.388-4.212 4.32-9.242 7.369-15.123 8.916a30.233 30.233 0 0 1-6.253.95c-.137.004-.267.025-.459.044ZM15.216 47.344c-.018.105-.03.211-.036.317-.044 3.204.08 6.393.626 9.56a42.105 42.105 0 0 0 4.123 12.363c2.538 4.873 5.911 9.058 10.316 12.373 5.013 3.773 10.63 5.876 16.932 6.082a27.722 27.722 0 0 0 9.688-1.421c5.11-1.69 9.443-4.586 13.118-8.494 4.552-4.832 7.55-10.527 9.286-16.905a43.867 43.867 0 0 0 1.334-7.567c.181-2.012.173-4.025.169-6.045a2.075 2.075 0 0 0-.03-.24c-.374-.104-64.866-.133-65.526-.023Zm.035-9.071c-.12.585-.098 6.787.023 7.166.063.014.126.023.19.027H80.46c.07-.002.14-.01.209-.025a.122.122 0 0 0 .04-.027l.039-.04v-7.101H15.252Zm17.37-1.876V5.317a6.539 6.539 0 0 0-.031-.698A2.989 2.989 0 0 0 30.7 2.084a2.956 2.956 0 0 0-3.15.446c-.833.653-1.181 1.543-1.181 2.585v30.592c0 .227.02.454.033.71l6.22-.02Zm36.96.027V4.73a3.127 3.127 0 0 0-6.235.273v31.433c2.105.005 4.148.009 6.24-.002l-.005-.01Z\"\n />\n </svg>\n `,\n})\nexport class WattEmptyStatePowerComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { WattIcon, WattIconComponent, WattIconSize } from '@energinet/watt/icon';\nimport { WattEmptyStateExploreComponent } from './icons/explore';\nimport { WattEmptyStateNoResultsComponent } from './icons/no-results';\nimport { WattEmptyStatePowerComponent } from './icons/power';\n\n/**\n * Usage:\n * `import { WattEmptyStateComponent } from '@energinet-datahub/watt/empty-state';`\n */\n@Component({\n selector: 'watt-empty-state',\n encapsulation: ViewEncapsulation.None,\n imports: [\n WattEmptyStateExploreComponent,\n WattEmptyStateNoResultsComponent,\n WattEmptyStatePowerComponent,\n WattIconComponent,\n ],\n styles: `\n @use '@energinet-datahub/watt/utils' as watt;\n\n watt-empty-state {\n display: block;\n text-align: center;\n color: var(--watt-color-primary-dark);\n\n h3,\n h5,\n p {\n margin: 0;\n white-space: pre-wrap;\n }\n\n watt-button {\n display: block;\n margin-top: var(--watt-space-m);\n\n &:first-of-type {\n margin-top: var(--watt-space-l);\n }\n }\n }\n `,\n template: `\n @let name = icon();\n @switch (name) {\n @case ('custom-explore') {\n <watt-icon [size]=\"iconSize()\" class=\"watt-space-stack-l\">\n <watt-empty-state-explore />\n </watt-icon>\n }\n @case ('custom-no-results') {\n <watt-icon [size]=\"iconSize()\" class=\"watt-space-stack-l\">\n <watt-empty-state-no-results />\n </watt-icon>\n }\n @case ('custom-power') {\n <watt-icon [size]=\"iconSize()\" class=\"watt-space-stack-l\">\n <watt-empty-state-power />\n </watt-icon>\n }\n @default {\n <watt-icon [name]=\"name\" [size]=\"iconSize()\" class=\"watt-space-stack-l\" />\n }\n }\n\n @if (size() === 'large') {\n <h3>{{ title() }}</h3>\n } @else {\n <h5>{{ title() }}</h5>\n }\n\n @if (useHTML()) {\n <div [class.watt-text-s]=\"size() === 'small'\" [innerHTML]=\"message()\"></div>\n } @else {\n <p [class.watt-text-s]=\"size() === 'small'\">{{ message() }}</p>\n }\n\n <ng-content />\n `,\n})\nexport class WattEmptyStateComponent {\n icon = input<WattIcon | 'custom-power' | 'custom-explore' | 'custom-no-results'>();\n size = input<'small' | 'large'>('large');\n title = input('');\n message = input('');\n useHTML = input(false);\n iconSize = computed<WattIconSize>(() => (this.size() === 'small' ? 'xl' : 'xxl'));\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattEmptyStateComponent } from './watt-empty-state.component';\nexport { WattEmptyStateExploreComponent } from './icons/explore';\nexport { WattEmptyStateNoResultsComponent } from './icons/no-results';\nexport { WattEmptyStatePowerComponent } from './icons/power';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAkBa,8BAA8B,CAAA;uGAA9B,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA9B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,8BAA8B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EA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EnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,aAAA,EACb,iBAAiB,CAAC,IAAI,EAAA,OAAA,EAC5B;wBACP,8BAA8B;wBAC9B,gCAAgC;wBAChC,4BAA4B;wBAC5B,iBAAiB;qBAClB,EAAA,QAAA,EA0BS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,sXAAA,CAAA,EAAA;;;AClGH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-expandable-card.mjs","sources":["../../../libs/watt/package/expandable-card/watt-expandable-card.component.ts","../../../libs/watt/package/expandable-card/index.ts","../../../libs/watt/package/expandable-card/energinet-watt-expandable-card.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n Directive,\n TemplateRef,\n ViewEncapsulation,\n inject,\n input,\n contentChild,\n} from '@angular/core';\nimport { MatAccordionTogglePosition, MatExpansionModule } from '@angular/material/expansion';\n\n@Directive({\n selector: '[wattExpandableCardContent]',\n})\nexport class WattExpandableCardContentDirective {\n templateRef = inject(TemplateRef);\n}\n\n/**\n * Usage:\n * `import { WATT_EXPANDABLE_CARD_COMPONENTS } from '@energinet-datahub/watt/expandable-card';`\n */\n@Component({\n imports: [NgTemplateOutlet, MatExpansionModule],\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-expandable-card',\n styleUrl: './watt-expandable-card.component.scss',\n template: `\n <mat-expansion-panel\n [togglePosition]=\"togglePosition()\"\n [expanded]=\"expanded()\"\n class=\"watt-expandable-card watt-{{ variant() }}\"\n [class.watt-expandable-card__parent]=\"containsNestedCard()\"\n >\n <mat-expansion-panel-header>\n <mat-panel-title>\n <ng-content select=\"watt-badge\" />\n <ng-content select=\"watt-expandable-card-title\" />\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <ng-content />\n\n @let _cardContent = cardContent();\n\n @if (_cardContent) {\n <ng-template matExpansionPanelContent>\n <ng-container *ngTemplateOutlet=\"_cardContent.templateRef\" />\n </ng-template>\n }\n </mat-expansion-panel>\n `,\n})\nexport class WattExpandableCardComponent {\n /**\n * @ignore\n */\n cardContent = contentChild(WattExpandableCardContentDirective);\n\n /**\n * @ignore\n */\n containsNestedCard = contentChild(WattExpandableCardComponent);\n\n /** Whether the card is expanded. */\n expanded = input(false);\n\n /** The position of the expansion indicator. */\n togglePosition = input<MatAccordionTogglePosition>('after');\n\n /** Whether the card is elevated or has solid border */\n variant = input<'solid' | 'elevation'>('elevation');\n}\n\n@Component({\n selector: 'watt-expandable-card-title',\n template: `<ng-content />`,\n})\nexport class WattExpandableCardTitleComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n WattExpandableCardComponent,\n WattExpandableCardTitleComponent,\n WattExpandableCardContentDirective,\n} from './watt-expandable-card.component';\n\nconst WATT_EXPANDABLE_CARD_COMPONENTS = [\n WattExpandableCardComponent,\n WattExpandableCardTitleComponent,\n WattExpandableCardContentDirective,\n] as const;\n\nexport {\n WattExpandableCardComponent,\n WattExpandableCardTitleComponent,\n WattExpandableCardContentDirective,\n WATT_EXPANDABLE_CARD_COMPONENTS,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAgBa,kCAAkC,CAAA;AAC7C,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;uGADtB,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAlC,kCAAkC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,6BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAlC,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAH9C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,6BAA6B;AACxC,iBAAA;;AAKD;;;AAGG;MAgCU,2BAA2B,CAAA;AACtC;;AAEG;AACH,IAAA,WAAW,GAAG,YAAY,CAAC,kCAAkC,CAAC;AAE9D;;AAEG;AACH,IAAA,kBAAkB,GAAG,YAAY,CAAC,2BAA2B,CAAC;;AAG9D,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;;AAGvB,IAAA,cAAc,GAAG,KAAK,CAA6B,OAAO,CAAC;;AAG3D,IAAA,OAAO,GAAG,KAAK,CAAwB,WAAW,CAAC;uGAlBxC,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA3B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,2BAA2B,
|
|
1
|
+
{"version":3,"file":"energinet-watt-expandable-card.mjs","sources":["../../../libs/watt/package/expandable-card/watt-expandable-card.component.ts","../../../libs/watt/package/expandable-card/index.ts","../../../libs/watt/package/expandable-card/energinet-watt-expandable-card.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n Directive,\n TemplateRef,\n ViewEncapsulation,\n inject,\n input,\n contentChild,\n} from '@angular/core';\nimport { MatAccordionTogglePosition, MatExpansionModule } from '@angular/material/expansion';\n\n@Directive({\n selector: '[wattExpandableCardContent]',\n})\nexport class WattExpandableCardContentDirective {\n templateRef = inject(TemplateRef);\n}\n\n/**\n * Usage:\n * `import { WATT_EXPANDABLE_CARD_COMPONENTS } from '@energinet-datahub/watt/expandable-card';`\n */\n@Component({\n imports: [NgTemplateOutlet, MatExpansionModule],\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-expandable-card',\n styleUrl: './watt-expandable-card.component.scss',\n template: `\n <mat-expansion-panel\n [togglePosition]=\"togglePosition()\"\n [expanded]=\"expanded()\"\n class=\"watt-expandable-card watt-{{ variant() }}\"\n [class.watt-expandable-card__parent]=\"containsNestedCard()\"\n >\n <mat-expansion-panel-header>\n <mat-panel-title>\n <ng-content select=\"watt-badge\" />\n <ng-content select=\"watt-expandable-card-title\" />\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <ng-content />\n\n @let _cardContent = cardContent();\n\n @if (_cardContent) {\n <ng-template matExpansionPanelContent>\n <ng-container *ngTemplateOutlet=\"_cardContent.templateRef\" />\n </ng-template>\n }\n </mat-expansion-panel>\n `,\n})\nexport class WattExpandableCardComponent {\n /**\n * @ignore\n */\n cardContent = contentChild(WattExpandableCardContentDirective);\n\n /**\n * @ignore\n */\n containsNestedCard = contentChild(WattExpandableCardComponent);\n\n /** Whether the card is expanded. */\n expanded = input(false);\n\n /** The position of the expansion indicator. */\n togglePosition = input<MatAccordionTogglePosition>('after');\n\n /** Whether the card is elevated or has solid border */\n variant = input<'solid' | 'elevation'>('elevation');\n}\n\n@Component({\n selector: 'watt-expandable-card-title',\n template: `<ng-content />`,\n})\nexport class WattExpandableCardTitleComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n WattExpandableCardComponent,\n WattExpandableCardTitleComponent,\n WattExpandableCardContentDirective,\n} from './watt-expandable-card.component';\n\nconst WATT_EXPANDABLE_CARD_COMPONENTS = [\n WattExpandableCardComponent,\n WattExpandableCardTitleComponent,\n WattExpandableCardContentDirective,\n] as const;\n\nexport {\n WattExpandableCardComponent,\n WattExpandableCardTitleComponent,\n WattExpandableCardContentDirective,\n WATT_EXPANDABLE_CARD_COMPONENTS,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAgBa,kCAAkC,CAAA;AAC7C,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;uGADtB,kCAAkC,EAAA,IAAA,E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,wBAAA,EAAA,QAAA,EAAA,uCAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FA8BnC,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBA/BvC,SAAS;8BACC,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAC3B,sBAAsB,EAAA,QAAA,EAEtB;;;;;;;;;;;;;;;;;;;;;;;;AAwBT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,48DAAA,CAAA,EAAA;;MA2BU,gCAAgC,CAAA;uGAAhC,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAhC,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gCAAgC,sFAFjC,CAAA,cAAA,CAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEf,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAJ5C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,4BAA4B;AACtC,oBAAA,QAAQ,EAAE,CAAA,cAAA,CAAgB;AAC3B,iBAAA;;;AChGD;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAOA,MAAM,+BAA+B,GAAG;IACtC,2BAA2B;IAC3B,gCAAgC;IAChC,kCAAkC;;;AC3BpC;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-expansion.mjs","sources":["../../../libs/watt/package/expansion/expansion.component.ts","../../../libs/watt/package/expansion/expansion.component.html","../../../libs/watt/package/expansion/index.ts","../../../libs/watt/package/expansion/energinet-watt-expansion.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, Input, ViewEncapsulation } from '@angular/core';\nimport { MatExpansionPanel, MatExpansionModule } from '@angular/material/expansion';\nimport { WattButtonComponent } from '@energinet/watt/button';\n\n/**\n * Usage:\n * `import { WattExpansionComponent } from '@energinet-datahub/watt/expansion';`\n */\n@Component({\n selector: 'watt-expansion',\n styleUrls: ['./expansion.component.scss'],\n templateUrl: './expansion.component.html',\n encapsulation: ViewEncapsulation.None,\n imports: [MatExpansionModule, WattButtonComponent],\n})\nexport class WattExpansionComponent {\n @Input() openLabel = '';\n @Input() closeLabel = '';\n @Input() expanded = false;\n\n /**\n * @ignore\n * @param matExpansionPanel\n */\n onClose(matExpansionPanel: MatExpansionPanel) {\n matExpansionPanel.close();\n }\n}\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<mat-expansion-panel hideToggle #expansion=\"matExpansionPanel\" [expanded]=\"expanded\">\n <mat-expansion-panel-header>\n <watt-button icon=\"plus\" aria-hidden=\"true\">{{ openLabel }}</watt-button>\n </mat-expansion-panel-header>\n\n <ng-content />\n\n <mat-action-row>\n <watt-button icon=\"minus\" (click)=\"onClose(expansion)\">{{ closeLabel }}</watt-button>\n </mat-action-row>\n</mat-expansion-panel>\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattExpansionComponent } from './expansion.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAKA;;;AAGG;MAQU,sBAAsB,CAAA;IACxB,SAAS,GAAG,EAAE;IACd,UAAU,GAAG,EAAE;IACf,QAAQ,GAAG,KAAK;AAEzB;;;AAGG;AACH,IAAA,OAAO,CAAC,iBAAoC,EAAA;QAC1C,iBAAiB,CAAC,KAAK,EAAE;;uGAVhB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,
|
|
1
|
+
{"version":3,"file":"energinet-watt-expansion.mjs","sources":["../../../libs/watt/package/expansion/expansion.component.ts","../../../libs/watt/package/expansion/expansion.component.html","../../../libs/watt/package/expansion/index.ts","../../../libs/watt/package/expansion/energinet-watt-expansion.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, Input, ViewEncapsulation } from '@angular/core';\nimport { MatExpansionPanel, MatExpansionModule } from '@angular/material/expansion';\nimport { WattButtonComponent } from '@energinet/watt/button';\n\n/**\n * Usage:\n * `import { WattExpansionComponent } from '@energinet-datahub/watt/expansion';`\n */\n@Component({\n selector: 'watt-expansion',\n styleUrls: ['./expansion.component.scss'],\n templateUrl: './expansion.component.html',\n encapsulation: ViewEncapsulation.None,\n imports: [MatExpansionModule, WattButtonComponent],\n})\nexport class WattExpansionComponent {\n @Input() openLabel = '';\n @Input() closeLabel = '';\n @Input() expanded = false;\n\n /**\n * @ignore\n * @param matExpansionPanel\n */\n onClose(matExpansionPanel: MatExpansionPanel) {\n matExpansionPanel.close();\n }\n}\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<mat-expansion-panel hideToggle #expansion=\"matExpansionPanel\" [expanded]=\"expanded\">\n <mat-expansion-panel-header>\n <watt-button icon=\"plus\" aria-hidden=\"true\">{{ openLabel }}</watt-button>\n </mat-expansion-panel-header>\n\n <ng-content />\n\n <mat-action-row>\n <watt-button icon=\"minus\" (click)=\"onClose(expansion)\">{{ closeLabel }}</watt-button>\n </mat-action-row>\n</mat-expansion-panel>\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattExpansionComponent } from './expansion.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAKA;;;AAGG;MAQU,sBAAsB,CAAA;IACxB,SAAS,GAAG,EAAE;IACd,UAAU,GAAG,EAAE;IACf,QAAQ,GAAG,KAAK;AAEzB;;;AAGG;AACH,IAAA,OAAO,CAAC,iBAAoC,EAAA;QAC1C,iBAAiB,CAAC,KAAK,EAAE;;uGAVhB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECjCnC,ggCA2BA,EAAA,MAAA,EAAA,CAAA,y1BAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDIY,kBAAkB,6dAAE,mBAAmB,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,SAAA,EAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAEtC,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAPlC,SAAS;+BACE,gBAAgB,EAAA,aAAA,EAGX,iBAAiB,CAAC,IAAI,WAC5B,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,EAAA,QAAA,EAAA,ggCAAA,EAAA,MAAA,EAAA,CAAA,y1BAAA,CAAA,EAAA;8BAGzC,SAAS,EAAA,CAAA;sBAAjB;gBACQ,UAAU,EAAA,CAAA;sBAAlB;gBACQ,QAAQ,EAAA,CAAA;sBAAhB;;;AEpCH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-field.mjs","sources":["../../../libs/watt/package/field/watt-field-intl.service.ts","../../../libs/watt/package/field/watt-field-error.component.ts","../../../libs/watt/package/field/watt-field.component.ts","../../../libs/watt/package/field/watt-field-hint.component.ts","../../../libs/watt/package/field/index.ts","../../../libs/watt/package/field/energinet-watt-field.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattFieldIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n required = 'Field is required';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-error',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-error {\n color: var(--watt-color-state-danger);\n }\n `,\n ],\n})\nexport class WattFieldErrorComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { FormControl, ValidationErrors, Validators } from '@angular/forms';\nimport { filter, map, startWith, switchMap, tap } from 'rxjs/operators';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattTooltipDirective } from '@energinet/watt/tooltip';\nimport { VaterFlexComponent, VaterUtilityDirective } from '@energinet/watt/vater';\nimport { WattRangeValidators } from '@energinet/watt/validators';\n\nimport { WattFieldIntlService } from './watt-field-intl.service';\nimport { WattFieldErrorComponent } from './watt-field-error.component';\nimport { NgTemplateOutlet } from '@angular/common';\n\n@Component({\n selector: 'watt-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n NgTemplateOutlet,\n WattIconComponent,\n WattTooltipDirective,\n WattFieldErrorComponent,\n VaterFlexComponent,\n VaterUtilityDirective,\n ],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n @if (chipMode()) {\n <span class=\"watt-label\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </span>\n } @else {\n <label [attr.for]=\"id()\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </label>\n }\n\n <ng-template #template>\n @if (label()) {\n <span class=\"label\" [class.required]=\"isRequired()\">\n {{ label() }}\n @if (tooltip(); as tooltip) {\n <watt-icon name=\"info\" wattTooltipPosition=\"top\" [wattTooltip]=\"tooltip\" />\n }\n </span>\n }\n <vater-flex direction=\"row\" gap=\"s\" alignment=\"center\">\n <div\n vater\n fill=\"horizontal\"\n #wrapper\n class=\"watt-field-wrapper\"\n [class.watt-field--has-placeholder]=\"!!placeholder()\"\n [style.anchor-name]=\"anchorName()\"\n >\n @if (placeholder()) {\n <div class=\"watt-field-placeholder\" aria-hidden=\"true\">\n <span class=\"watt-field-ghost\">{{ ghost() }}</span>\n <span class=\"watt-field-filler\">{{ filler() }}</span>\n </div>\n }\n <ng-content />\n </div>\n <ng-content select=\"watt-field-descriptor\" />\n </vater-flex>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </ng-template>\n `,\n host: {\n '[class.watt-field--chip]': 'chipMode()',\n '[class.watt-field--unlabelled]': 'unlabelled()',\n '[class.watt-field--disabled]': 'control()?.disabled',\n },\n})\nexport class WattFieldComponent {\n intl = inject(WattFieldIntlService);\n elementRef = inject<ElementRef>(ElementRef);\n\n control = input<FormControl | null>(null);\n label = input<string>();\n id = input<string>();\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n\n value = signal('');\n filler = computed(() => this.placeholder().slice(this.value().length));\n ghost = computed(() => this.value().slice(0, this.placeholder().length));\n\n unlabelled = computed(() => !this.label());\n\n errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n\n // Used for text fields with autocomplete\n wrapper = viewChild<ElementRef>('wrapper');\n\n constructor() {\n const control$ = toObservable(this.control).pipe(filter((control) => control !== null));\n\n // Track value in order to update ghost and filler\n const value$ = control$.pipe(\n switchMap((control) =>\n control.valueChanges.pipe(\n startWith(control.value),\n map((value) => (value === null || value === undefined ? '' : value.toString())),\n tap((value) => this.value.set(value))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Track status in order to update required state and show errors\n const status$ = control$.pipe(\n switchMap((control) =>\n control.statusChanges.pipe(\n startWith(control.status),\n tap(() => this.isRequired.set(this.isRequiredControl(control))),\n tap(() => this.errors.set(control.errors))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Subscribe for side effects\n value$.subscribe();\n status$.subscribe();\n }\n\n isRequiredControl(control: FormControl) {\n const validators = [Validators.required, WattRangeValidators.required];\n return validators.some((validator) => control.hasValidator(validator));\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-field-hint',\n styles: [\n `\n :host {\n color: var(--watt-color-neutral-grey-700);\n }\n `,\n ],\n template: `<ng-content />`,\n})\nexport class WattFieldHintComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattFieldComponent } from './watt-field.component';\nexport { WattFieldErrorComponent } from './watt-field-error.component';\nexport { WattFieldHintComponent } from './watt-field-hint.component';\nexport { WattFieldIntlService } from './watt-field-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,oBAAoB,CAAA;AACtB,IAAA,OAAO,GAAkB,IAAI,OAAO,EAAQ;IACrD,QAAQ,GAAG,mBAAmB;uGAFnB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAApB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACrBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAea,uBAAuB,CAAA;uGAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAvB,IAAA,OAAA,IAAA,GAAA,EAA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CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,2EAFvB,CAAgB,cAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA,CAAA;;2FAEf,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,YAQjB,CAAgB,cAAA,CAAA,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA;;;AC7B5B;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-field.mjs","sources":["../../../libs/watt/package/field/watt-field-intl.service.ts","../../../libs/watt/package/field/watt-field-error.component.ts","../../../libs/watt/package/field/watt-field.component.ts","../../../libs/watt/package/field/watt-field-hint.component.ts","../../../libs/watt/package/field/index.ts","../../../libs/watt/package/field/energinet-watt-field.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattFieldIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n required = 'Field is required';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-error',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-error {\n color: var(--watt-color-state-danger);\n }\n `,\n ],\n})\nexport class WattFieldErrorComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { FormControl, ValidationErrors, Validators } from '@angular/forms';\nimport { filter, map, startWith, switchMap, tap } from 'rxjs/operators';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattTooltipDirective } from '@energinet/watt/tooltip';\nimport { VaterFlexComponent, VaterUtilityDirective } from '@energinet/watt/vater';\nimport { WattRangeValidators } from '@energinet/watt/validators';\n\nimport { WattFieldIntlService } from './watt-field-intl.service';\nimport { WattFieldErrorComponent } from './watt-field-error.component';\nimport { NgTemplateOutlet } from '@angular/common';\n\n@Component({\n selector: 'watt-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n NgTemplateOutlet,\n WattIconComponent,\n WattTooltipDirective,\n WattFieldErrorComponent,\n VaterFlexComponent,\n VaterUtilityDirective,\n ],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n @if (chipMode()) {\n <span class=\"watt-label\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </span>\n } @else {\n <label [attr.for]=\"id()\">\n <ng-container *ngTemplateOutlet=\"template\" />\n </label>\n }\n\n <ng-template #template>\n @if (label()) {\n <span class=\"label\" [class.required]=\"isRequired()\">\n {{ label() }}\n @if (tooltip(); as tooltip) {\n <watt-icon name=\"info\" wattTooltipPosition=\"top\" [wattTooltip]=\"tooltip\" />\n }\n </span>\n }\n <vater-flex direction=\"row\" gap=\"s\" alignment=\"center\">\n <div\n vater\n fill=\"horizontal\"\n #wrapper\n class=\"watt-field-wrapper\"\n [class.watt-field--has-placeholder]=\"!!placeholder()\"\n [style.anchor-name]=\"anchorName()\"\n >\n @if (placeholder()) {\n <div class=\"watt-field-placeholder\" aria-hidden=\"true\">\n <span class=\"watt-field-ghost\">{{ ghost() }}</span>\n <span class=\"watt-field-filler\">{{ filler() }}</span>\n </div>\n }\n <ng-content />\n </div>\n <ng-content select=\"watt-field-descriptor\" />\n </vater-flex>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </ng-template>\n `,\n host: {\n '[class.watt-field--chip]': 'chipMode()',\n '[class.watt-field--unlabelled]': 'unlabelled()',\n '[class.watt-field--disabled]': 'control()?.disabled',\n },\n})\nexport class WattFieldComponent {\n intl = inject(WattFieldIntlService);\n elementRef = inject<ElementRef>(ElementRef);\n\n control = input<FormControl | null>(null);\n label = input<string>();\n id = input<string>();\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n\n value = signal('');\n filler = computed(() => this.placeholder().slice(this.value().length));\n ghost = computed(() => this.value().slice(0, this.placeholder().length));\n\n unlabelled = computed(() => !this.label());\n\n errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n\n // Used for text fields with autocomplete\n wrapper = viewChild<ElementRef>('wrapper');\n\n constructor() {\n const control$ = toObservable(this.control).pipe(filter((control) => control !== null));\n\n // Track value in order to update ghost and filler\n const value$ = control$.pipe(\n switchMap((control) =>\n control.valueChanges.pipe(\n startWith(control.value),\n map((value) => (value === null || value === undefined ? '' : value.toString())),\n tap((value) => this.value.set(value))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Track status in order to update required state and show errors\n const status$ = control$.pipe(\n switchMap((control) =>\n control.statusChanges.pipe(\n startWith(control.status),\n tap(() => this.isRequired.set(this.isRequiredControl(control))),\n tap(() => this.errors.set(control.errors))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Subscribe for side effects\n value$.subscribe();\n status$.subscribe();\n }\n\n isRequiredControl(control: FormControl) {\n const validators = [Validators.required, WattRangeValidators.required];\n return validators.some((validator) => control.hasValidator(validator));\n }\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-field-hint',\n styles: [\n `\n :host {\n color: var(--watt-color-neutral-grey-700);\n }\n `,\n ],\n template: `<ng-content />`,\n})\nexport class WattFieldHintComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattFieldComponent } from './watt-field.component';\nexport { WattFieldErrorComponent } from './watt-field-error.component';\nexport { WattFieldHintComponent } from './watt-field-hint.component';\nexport { WattFieldIntlService } from './watt-field-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,oBAAoB,CAAA;AACtB,IAAA,OAAO,GAAkB,IAAI,OAAO,EAAQ;IACrD,QAAQ,GAAG,mBAAmB;uGAFnB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAApB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACrBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAea,uBAAuB,CAAA;uGAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAvB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAA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,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,2EAFvB,CAAA,cAAA,CAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA,CAAA;;2FAEf,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,YAQjB,CAAA,cAAA,CAAgB,EAAA,MAAA,EAAA,CAAA,mDAAA,CAAA,EAAA;;;AC7B5B;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-icon-flags.mjs","sources":["../../../libs/watt/package/icon/flags/watt-flag-dk.ts","../../../libs/watt/package/icon/flags/watt-flag-fi.ts","../../../libs/watt/package/icon/flags/watt-flag-de.ts","../../../libs/watt/package/icon/flags/watt-flag-no.ts","../../../libs/watt/package/icon/flags/watt-flag-pl.ts","../../../libs/watt/package/icon/flags/watt-flag-se.ts","../../../libs/watt/package/icon/flags/watt-flag-nl.ts","../../../libs/watt/package/icon/flags/watt-flag-ch.ts","../../../libs/watt/package/icon/flags/watt-flag.ts","../../../libs/watt/package/icon/flags/index.ts","../../../libs/watt/package/icon/flags/energinet-watt-icon-flags.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-dk',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#c8102e\" d=\"M0 0h640.1v480H0z\" />\n <path fill=\"#fff\" d=\"M205.7 0h68.6v480h-68.6z\" />\n <path fill=\"#fff\" d=\"M0 205.7h640.1v68.6H0z\" />\n </svg>\n `,\n})\nexport class WattFlagDenmarkComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-fi',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#fff\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#002f6c\" d=\"M0 174.5h640v131H0z\" />\n <path fill=\"#002f6c\" d=\"M175.5 0h130.9v480h-131z\" />\n </svg>\n `,\n})\nexport class WattFlagFinlandComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-de',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#ffce00\" d=\"M0 320h640v160H0z\" />\n <path fill=\"#000001\" d=\"M0 0h640v160H0z\" />\n <path fill=\"red\" d=\"M0 160h640v160H0z\" />\n </svg>\n `,\n})\nexport class WattFlagGermanyComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-no',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#ed2939\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#fff\" d=\"M180 0h120v480H180z\" />\n <path fill=\"#fff\" d=\"M0 180h640v120H0z\" />\n <path fill=\"#002664\" d=\"M210 0h60v480h-60z\" />\n <path fill=\"#002664\" d=\"M0 210h640v60H0z\" />\n </svg>\n `,\n})\nexport class WattFlagNorwayComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-pl',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <g fill-rule=\"evenodd\">\n <path fill=\"#fff\" d=\"M640 480H0V0h640z\" />\n <path fill=\"#dc143c\" d=\"M640 480H0V240h640z\" />\n </g>\n </svg>\n `,\n})\nexport class WattFlagPolandComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-se',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#005293\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#fecb00\" d=\"M176 0v192H0v96h176v192h96V288h368v-96H272V0z\" />\n </svg>\n `,\n})\nexport class WattFlagSwedenComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-nl',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#21468b\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#fff\" d=\"M0 160h640v160H0z\" />\n <path fill=\"#ae1c28\" d=\"M0 320h640v160H0z\" />\n </svg>\n `,\n})\nexport class WattFlagNetherlandsComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-ch',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <g fill=\"#ff0000\">\n <path d=\"M0 0h640v480H0z\" />\n </g>\n <g fill=\"#ffffff\">\n <path d=\"M170 195h300v90H170z\" />\n <path d=\"M275 90h90v300h-90z\" />\n </g>\n </svg>\n `,\n})\nexport class WattFlagSwitzerlandComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, input } from '@angular/core';\nimport { CountryCode } from 'libphonenumber-js';\n\nimport { WattIconComponent, WattIconSize } from '@energinet/watt/icon';\n\nimport { WattFlagDenmarkComponent } from './watt-flag-dk';\nimport { WattFlagFinlandComponent } from './watt-flag-fi';\nimport { WattFlagGermanyComponent } from './watt-flag-de';\nimport { WattFlagNorwayComponent } from './watt-flag-no';\nimport { WattFlagPolandComponent } from './watt-flag-pl';\nimport { WattFlagSwedenComponent } from './watt-flag-se';\nimport { WattFlagNetherlandsComponent } from './watt-flag-nl';\nimport { WattFlagSwitzerlandComponent } from './watt-flag-ch';\n\n@Component({\n selector: 'watt-flag',\n imports: [\n WattFlagDenmarkComponent,\n WattFlagFinlandComponent,\n WattFlagGermanyComponent,\n WattFlagNorwayComponent,\n WattFlagPolandComponent,\n WattFlagSwedenComponent,\n WattFlagNetherlandsComponent,\n WattFlagSwitzerlandComponent,\n WattIconComponent,\n ],\n template: `\n <watt-icon [size]=\"size()\" [label]=\"label()\">\n @switch (country()) {\n @case ('DK') {\n <watt-flag-dk />\n }\n @case ('DE') {\n <watt-flag-de />\n }\n @case ('FI') {\n <watt-flag-fi />\n }\n @case ('NO') {\n <watt-flag-no />\n }\n @case ('PL') {\n <watt-flag-pl />\n }\n @case ('SE') {\n <watt-flag-se />\n }\n @case ('NL') {\n <watt-flag-nl />\n }\n @case ('CH') {\n <watt-flag-ch />\n }\n }\n </watt-icon>\n `,\n})\nexport class WattFlagComponent {\n /** Country code of the flag. */\n country = input.required<CountryCode>();\n\n /** Accessible label for the icon. */\n label = input<string>();\n\n /** Size of the icon. */\n size = input<WattIconSize>('m');\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattFlagComponent } from './watt-flag';\nexport { WattFlagDenmarkComponent } from './watt-flag-dk';\nexport { WattFlagFinlandComponent } from './watt-flag-fi';\nexport { WattFlagGermanyComponent } from './watt-flag-de';\nexport { WattFlagNorwayComponent } from './watt-flag-no';\nexport { WattFlagPolandComponent } from './watt-flag-pl';\nexport { WattFlagSwedenComponent } from './watt-flag-se';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAaa,wBAAwB,CAAA;uGAAxB,wBAAwB,EAAA,IA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AA,EAAA,cAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,wBAAwB,yDACxB,uBAAuB,EAAA,QAAA,EAAA,cAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACvB,uBAAuB,EAAA,QAAA,EAAA,cAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACvB,uBAAuB,EACvB,QAAA,EAAA,cAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,4BAA4B,EAC5B,QAAA,EAAA,cAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,4BAA4B,yDAC5B,iBAAiB,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAiCR,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBA5C7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,OAAO,EAAE;wBACP,wBAAwB;wBACxB,wBAAwB;wBACxB,wBAAwB;wBACxB,uBAAuB;wBACvB,uBAAuB;wBACvB,uBAAuB;wBACvB,4BAA4B;wBAC5B,4BAA4B;wBAC5B,iBAAiB;AAClB,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BT,EAAA,CAAA;AACF,iBAAA;;;AC3ED;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-icon-flags.mjs","sources":["../../../libs/watt/package/icon/flags/watt-flag-dk.ts","../../../libs/watt/package/icon/flags/watt-flag-fi.ts","../../../libs/watt/package/icon/flags/watt-flag-de.ts","../../../libs/watt/package/icon/flags/watt-flag-no.ts","../../../libs/watt/package/icon/flags/watt-flag-pl.ts","../../../libs/watt/package/icon/flags/watt-flag-se.ts","../../../libs/watt/package/icon/flags/watt-flag-nl.ts","../../../libs/watt/package/icon/flags/watt-flag-ch.ts","../../../libs/watt/package/icon/flags/watt-flag.ts","../../../libs/watt/package/icon/flags/index.ts","../../../libs/watt/package/icon/flags/energinet-watt-icon-flags.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-dk',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#c8102e\" d=\"M0 0h640.1v480H0z\" />\n <path fill=\"#fff\" d=\"M205.7 0h68.6v480h-68.6z\" />\n <path fill=\"#fff\" d=\"M0 205.7h640.1v68.6H0z\" />\n </svg>\n `,\n})\nexport class WattFlagDenmarkComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-fi',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#fff\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#002f6c\" d=\"M0 174.5h640v131H0z\" />\n <path fill=\"#002f6c\" d=\"M175.5 0h130.9v480h-131z\" />\n </svg>\n `,\n})\nexport class WattFlagFinlandComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-de',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#ffce00\" d=\"M0 320h640v160H0z\" />\n <path fill=\"#000001\" d=\"M0 0h640v160H0z\" />\n <path fill=\"red\" d=\"M0 160h640v160H0z\" />\n </svg>\n `,\n})\nexport class WattFlagGermanyComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-no',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#ed2939\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#fff\" d=\"M180 0h120v480H180z\" />\n <path fill=\"#fff\" d=\"M0 180h640v120H0z\" />\n <path fill=\"#002664\" d=\"M210 0h60v480h-60z\" />\n <path fill=\"#002664\" d=\"M0 210h640v60H0z\" />\n </svg>\n `,\n})\nexport class WattFlagNorwayComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-pl',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <g fill-rule=\"evenodd\">\n <path fill=\"#fff\" d=\"M640 480H0V0h640z\" />\n <path fill=\"#dc143c\" d=\"M640 480H0V240h640z\" />\n </g>\n </svg>\n `,\n})\nexport class WattFlagPolandComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-se',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#005293\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#fecb00\" d=\"M176 0v192H0v96h176v192h96V288h368v-96H272V0z\" />\n </svg>\n `,\n})\nexport class WattFlagSwedenComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-nl',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <path fill=\"#21468b\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#fff\" d=\"M0 160h640v160H0z\" />\n <path fill=\"#ae1c28\" d=\"M0 320h640v160H0z\" />\n </svg>\n `,\n})\nexport class WattFlagNetherlandsComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-flag-ch',\n template: `\n <svg viewBox=\"0 0 640 480\">\n <g fill=\"#ff0000\">\n <path d=\"M0 0h640v480H0z\" />\n </g>\n <g fill=\"#ffffff\">\n <path d=\"M170 195h300v90H170z\" />\n <path d=\"M275 90h90v300h-90z\" />\n </g>\n </svg>\n `,\n})\nexport class WattFlagSwitzerlandComponent {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Component, input } from '@angular/core';\nimport { CountryCode } from 'libphonenumber-js';\n\nimport { WattIconComponent, WattIconSize } from '@energinet/watt/icon';\n\nimport { WattFlagDenmarkComponent } from './watt-flag-dk';\nimport { WattFlagFinlandComponent } from './watt-flag-fi';\nimport { WattFlagGermanyComponent } from './watt-flag-de';\nimport { WattFlagNorwayComponent } from './watt-flag-no';\nimport { WattFlagPolandComponent } from './watt-flag-pl';\nimport { WattFlagSwedenComponent } from './watt-flag-se';\nimport { WattFlagNetherlandsComponent } from './watt-flag-nl';\nimport { WattFlagSwitzerlandComponent } from './watt-flag-ch';\n\n@Component({\n selector: 'watt-flag',\n imports: [\n WattFlagDenmarkComponent,\n WattFlagFinlandComponent,\n WattFlagGermanyComponent,\n WattFlagNorwayComponent,\n WattFlagPolandComponent,\n WattFlagSwedenComponent,\n WattFlagNetherlandsComponent,\n WattFlagSwitzerlandComponent,\n WattIconComponent,\n ],\n template: `\n <watt-icon [size]=\"size()\" [label]=\"label()\">\n @switch (country()) {\n @case ('DK') {\n <watt-flag-dk />\n }\n @case ('DE') {\n <watt-flag-de />\n }\n @case ('FI') {\n <watt-flag-fi />\n }\n @case ('NO') {\n <watt-flag-no />\n }\n @case ('PL') {\n <watt-flag-pl />\n }\n @case ('SE') {\n <watt-flag-se />\n }\n @case ('NL') {\n <watt-flag-nl />\n }\n @case ('CH') {\n <watt-flag-ch />\n }\n }\n </watt-icon>\n `,\n})\nexport class WattFlagComponent {\n /** Country code of the flag. */\n country = input.required<CountryCode>();\n\n /** Accessible label for the icon. */\n label = input<string>();\n\n /** Size of the icon. */\n size = input<WattIconSize>('m');\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattFlagComponent } from './watt-flag';\nexport { WattFlagDenmarkComponent } from './watt-flag-dk';\nexport { WattFlagFinlandComponent } from './watt-flag-fi';\nexport { WattFlagGermanyComponent } from './watt-flag-de';\nexport { WattFlagNorwayComponent } from './watt-flag-no';\nexport { WattFlagPolandComponent } from './watt-flag-pl';\nexport { WattFlagSwedenComponent } from './watt-flag-se';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAaa,wBAAwB,CAAA;uGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EARzB;;;;;;AAMT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEU,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAVpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE;;;;;;AAMT,EAAA,CAAA;AACF,iBAAA;;;AC7BD;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAaa,wBAAwB,CAAA;uGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAA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AAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,OAAO,EAAE;wBACP,wBAAwB;wBACxB,wBAAwB;wBACxB,wBAAwB;wBACxB,uBAAuB;wBACvB,uBAAuB;wBACvB,uBAAuB;wBACvB,4BAA4B;wBAC5B,4BAA4B;wBAC5B,iBAAiB;AAClB,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BT,EAAA,CAAA;AACF,iBAAA;;;AC3ED;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-icon.mjs","sources":["../../../libs/watt/package/icon/icons.ts","../../../libs/watt/package/icon/icon.component.ts","../../../libs/watt/package/icon/index.ts","../../../libs/watt/package/icon/energinet-watt-icon.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport const WattIconMap = {\n search: 'search',\n filter: 'filter_list',\n plus: 'add',\n minus: 'remove',\n edit: 'edit',\n redo: 'redo',\n undo: 'undo',\n remove: 'delete',\n removeForever: 'delete_forever',\n close: 'close',\n cancel: 'cancel',\n checkmark: 'check',\n user: 'account_circle',\n settings: 'settings',\n contentCopy: 'content_copy',\n date: 'calendar_today',\n time: 'schedule',\n email: 'email',\n markEmailUnread: 'mark_email_unread',\n link: 'link',\n openInNew: 'open_in_new',\n monetization: 'monetization_on',\n payments: 'payments',\n forwardMessage: 'forward_to_inbox',\n menu: 'menu',\n moreVertical: 'more_vert',\n logout: 'logout',\n login: 'lock_open',\n help: 'help',\n alternateEmail: 'alternate_email',\n refresh: 'refresh',\n language: 'language',\n pendingActions: 'pending_actions',\n toggleOn: 'toggle_on',\n toggleOff: 'toggle_off',\n personCheck: 'person_check',\n // Navigation\n left: 'navigate_before',\n right: 'navigate_next',\n up: 'expand_less',\n down: 'expand_more',\n arrowDropDown: 'arrow_drop_down',\n arrowRightAlt: 'arrow_right_alt',\n arrowLeftAlt: 'arrow_left_alt',\n // Alerts\n danger: 'dangerous',\n warning: 'report_problem',\n success: 'check_circle',\n info: 'info',\n feedback: 'feedback',\n // Files\n save: 'save_alt',\n upload: 'cloud_upload',\n download: 'cloud_download',\n fileDownload: 'download',\n print: 'print',\n preview: 'preview',\n // Other\n power: 'power',\n location: 'location_on',\n smartDisplay: 'smart_display',\n windmill: 'energy',\n solarPower: 'solar_power',\n priorityHigh: 'priority_high',\n notifications: 'notifications',\n notificationsUnread: 'notifications_unread',\n horizontalRule: 'horizontal_rule',\n wrongLocation: 'wrong_location',\n heatPump: 'heat_pump',\n inventory: 'inventory',\n globe: 'globe',\n calculate: 'calculate',\n bar_chart_4_bars: 'bar_chart_4_bars',\n view_list: 'view_list',\n view_stream: 'view_stream',\n construction: 'construction',\n};\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n} from '@angular/core';\nimport { MatIcon } from '@angular/material/icon';\nimport { WattIconMap } from './icons';\n\nexport type WattIcon = keyof typeof WattIconMap;\nexport type WattIconSize = 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\nexport type WattIconState = 'default' | 'success' | 'danger' | 'warning' | 'info';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classNames()' },\n imports: [MatIcon],\n selector: 'watt-icon',\n styleUrls: ['./icon.component.scss'],\n template: `\n @if (icon()) {\n <mat-icon aria-hidden=\"false\" [attr.aria-label]=\"label()\" fontSet=\"material-symbols-sharp\">\n {{ icon() }}\n </mat-icon>\n } @else {\n <div class=\"watt-custom-icon\">\n <ng-content />\n </div>\n }\n `,\n})\nexport class WattIconComponent {\n /** Name of an icon within the font set. */\n name = input<WattIcon>();\n\n /** Accessible label for the icon. */\n label = input<string>();\n\n /** Size of the icon. */\n size = input<WattIconSize>('m');\n\n /** Color the icon to match a chosen state. */\n state = input<WattIconState>();\n\n icon = computed(() => {\n const name = this.name();\n if (!name) return null;\n return WattIconMap[name];\n });\n\n computedState = computed(() => {\n const name = this.name();\n const state = this.state();\n if (state) return state;\n switch (name) {\n case 'success':\n case 'danger':\n case 'warning':\n case 'info':\n return name;\n default:\n return 'default';\n }\n });\n\n classNames = computed(() => `icon-size-${this.size()} icon-state-${this.computedState()}`);\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattIconComponent, WattIcon, WattIconSize, WattIconState } from './icon.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"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AAO,CAAC,EAAA,QAAA,EACR,WAAW,EAEX,QAAA,EAAA;;;;;;;;;;AAUT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,kiEAAA,CAAA,EAAA;;;ACjDH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-icon.mjs","sources":["../../../libs/watt/package/icon/icons.ts","../../../libs/watt/package/icon/icon.component.ts","../../../libs/watt/package/icon/index.ts","../../../libs/watt/package/icon/energinet-watt-icon.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport const WattIconMap = {\n search: 'search',\n filter: 'filter_list',\n plus: 'add',\n minus: 'remove',\n edit: 'edit',\n redo: 'redo',\n undo: 'undo',\n remove: 'delete',\n removeForever: 'delete_forever',\n close: 'close',\n cancel: 'cancel',\n checkmark: 'check',\n user: 'account_circle',\n settings: 'settings',\n contentCopy: 'content_copy',\n date: 'calendar_today',\n time: 'schedule',\n email: 'email',\n markEmailUnread: 'mark_email_unread',\n link: 'link',\n openInNew: 'open_in_new',\n monetization: 'monetization_on',\n payments: 'payments',\n forwardMessage: 'forward_to_inbox',\n menu: 'menu',\n moreVertical: 'more_vert',\n logout: 'logout',\n login: 'lock_open',\n help: 'help',\n alternateEmail: 'alternate_email',\n refresh: 'refresh',\n language: 'language',\n pendingActions: 'pending_actions',\n toggleOn: 'toggle_on',\n toggleOff: 'toggle_off',\n personCheck: 'person_check',\n // Navigation\n left: 'navigate_before',\n right: 'navigate_next',\n up: 'expand_less',\n down: 'expand_more',\n arrowDropDown: 'arrow_drop_down',\n arrowRightAlt: 'arrow_right_alt',\n arrowLeftAlt: 'arrow_left_alt',\n // Alerts\n danger: 'dangerous',\n warning: 'report_problem',\n success: 'check_circle',\n info: 'info',\n feedback: 'feedback',\n // Files\n save: 'save_alt',\n upload: 'cloud_upload',\n download: 'cloud_download',\n fileDownload: 'download',\n print: 'print',\n preview: 'preview',\n // Other\n power: 'power',\n location: 'location_on',\n smartDisplay: 'smart_display',\n windmill: 'energy',\n solarPower: 'solar_power',\n priorityHigh: 'priority_high',\n notifications: 'notifications',\n notificationsUnread: 'notifications_unread',\n horizontalRule: 'horizontal_rule',\n wrongLocation: 'wrong_location',\n heatPump: 'heat_pump',\n inventory: 'inventory',\n globe: 'globe',\n calculate: 'calculate',\n bar_chart_4_bars: 'bar_chart_4_bars',\n view_list: 'view_list',\n view_stream: 'view_stream',\n construction: 'construction',\n};\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n} from '@angular/core';\nimport { MatIcon } from '@angular/material/icon';\nimport { WattIconMap } from './icons';\n\nexport type WattIcon = keyof typeof WattIconMap;\nexport type WattIconSize = 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\nexport type WattIconState = 'default' | 'success' | 'danger' | 'warning' | 'info';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classNames()' },\n imports: [MatIcon],\n selector: 'watt-icon',\n styleUrls: ['./icon.component.scss'],\n template: `\n @if (icon()) {\n <mat-icon aria-hidden=\"false\" [attr.aria-label]=\"label()\" fontSet=\"material-symbols-sharp\">\n {{ icon() }}\n </mat-icon>\n } @else {\n <div class=\"watt-custom-icon\">\n <ng-content />\n </div>\n }\n `,\n})\nexport class WattIconComponent {\n /** Name of an icon within the font set. */\n name = input<WattIcon>();\n\n /** Accessible label for the icon. */\n label = input<string>();\n\n /** Size of the icon. */\n size = input<WattIconSize>('m');\n\n /** Color the icon to match a chosen state. */\n state = input<WattIconState>();\n\n icon = computed(() => {\n const name = this.name();\n if (!name) return null;\n return WattIconMap[name];\n });\n\n computedState = computed(() => {\n const name = this.name();\n const state = this.state();\n if (state) return state;\n switch (name) {\n case 'success':\n case 'danger':\n case 'warning':\n case 'info':\n return name;\n default:\n return 'default';\n }\n });\n\n classNames = computed(() => `icon-size-${this.size()} icon-state-${this.computedState()}`);\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattIconComponent, WattIcon, WattIconSize, WattIconState } from './icon.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AACO,MAAM,WAAW,GAAG;AACzB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,MAAM,EAAE,aAAa;AACrB,IAAA,IAAI,EAAE,KAAK;AACX,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,IAAI,EAAE,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
1
|
-
{"version":3,"file":"energinet-watt-modal.mjs","sources":["../../../libs/watt/package/modal/watt-modal.service.ts","../../../libs/watt/package/modal/watt-modal.component.ts","../../../libs/watt/package/modal/watt-modal.component.html","../../../libs/watt/package/modal/index.ts","../../../libs/watt/package/modal/energinet-watt-modal.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { ComponentType } from '@angular/cdk/portal';\nimport { EventEmitter, Injectable, Injector, NgModule, TemplateRef, inject } from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialog,\n MatDialogModule,\n MatDialogRef,\n} from '@angular/material/dialog';\nimport { map, take } from 'rxjs';\n\nexport interface WattModalConfig<T> {\n templateRef?: TemplateRef<unknown>;\n component?: ComponentType<WattTypedModal<T>>;\n data?: T;\n disableClose?: boolean;\n onClosed?: EventEmitter<boolean> | ((result: boolean) => void);\n minHeight?: string;\n panelClass?: string[];\n injector?: Injector;\n restoreFocus?: boolean;\n}\n\nexport abstract class WattTypedModal<T = void> {\n protected modalData: T = inject(MAT_DIALOG_DATA);\n protected dialogRef: MatDialogRef<WattTypedModal<T>> = inject(MatDialogRef);\n}\n\n@Injectable()\nexport class WattModalService {\n private readonly dialog = inject(MatDialog);\n private matDialogRef: MatDialogRef<unknown> | undefined;\n\n /**\n * Opens the modal. Subsequent calls are ignored while the modal is opened.\n * @ignore\n */\n open = <T>(config: WattModalConfig<T>) => {\n const template = config.templateRef ?? config.component;\n\n if (!template) return;\n\n this.matDialogRef = this.openModal(template, config);\n\n this.matDialogRef\n .afterClosed()\n .pipe(map(Boolean), take(1))\n .subscribe((result) => {\n if (config?.onClosed instanceof EventEmitter) {\n config?.onClosed.emit(result);\n } else {\n config?.onClosed?.(result);\n }\n });\n\n if (config.minHeight) this.setMinHeight(config.minHeight);\n };\n\n /**\n * Opens the modal using the provided template and configuration.\n */\n private openModal<T>(\n template: TemplateRef<unknown> | ComponentType<WattTypedModal<T>>,\n config: WattModalConfig<T>\n ): MatDialogRef<unknown> {\n return this.dialog.open(template, {\n autoFocus: 'dialog',\n panelClass: [\n 'watt-modal-panel',\n ...(config.component ? ['watt-modal-panel--component'] : []),\n ...(config.panelClass ?? []),\n ],\n disableClose: config.disableClose ?? false,\n data: config.data,\n maxWidth: 'none',\n injector: config.injector,\n restoreFocus: config.restoreFocus === false ? false : true,\n });\n }\n\n /**\n * Closes the modal with `true` for acceptance or `false` for rejection.\n * @ignore\n */\n close(result: boolean) {\n this.matDialogRef?.close(result);\n }\n\n private setMinHeight(minHeight: string) {\n setTimeout(() => {\n document\n ?.getElementById(this.matDialogRef?.id ?? '')\n ?.querySelector('.watt-modal')\n ?.setAttribute('style', `--watt-modal-min-height: ${minHeight}`);\n });\n }\n}\n\n@NgModule({\n imports: [MatDialogModule],\n providers: [WattModalService],\n})\nexport class WattModalModule {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n afterRenderEffect,\n booleanAttribute,\n inject,\n input,\n} from '@angular/core';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { MatDialogRef } from '@angular/material/dialog';\n\nimport { WattResizeObserverDirective } from '@energinet/watt/utils/resize-observer';\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\n\nimport { WattModalModule, WattModalService } from './watt-modal.service';\nimport { WattIcon, WattIconComponent } from '@energinet/watt/icon';\n\nexport type WattModalSize = 'small' | 'medium' | 'large';\n\n/**\n * Component for representing a binary decision in the form of\n * a modal window that appears in front of the entire content.\n *\n * Usage:\n * `import { WATT_MODAL } from '@energinet-datahub/watt/modal';`\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-modal',\n styleUrls: ['./watt-modal.component.scss'],\n templateUrl: './watt-modal.component.html',\n imports: [\n NgClass,\n NgTemplateOutlet,\n WattResizeObserverDirective,\n WattButtonComponent,\n WattSpinnerComponent,\n WattModalModule,\n WattIconComponent,\n ],\n})\nexport class WattModalComponent {\n private modalService = inject(WattModalService);\n protected dialogRef = inject<MatDialogRef<unknown>>(MatDialogRef, { optional: true });\n /** Title to stay fixed to top of modal. */\n @Input() title = '';\n\n @Input() size: WattModalSize = 'medium';\n\n /** Whether the modal should show a loading state. */\n @Input() loading = false;\n\n /** Whether the modal should show a loading text for the loading state. */\n @Input() loadingMessage = '';\n\n /** Disable ESC, close button and backdrop click as methods of closing. */\n @Input() disableClose = false;\n\n /** Whether to show the close button */\n @Input() hideCloseButton = false;\n\n /** Disable ESC, backdrop click as methods of closing. */\n @Input() disableEscAndBackdropClose = false;\n\n /** The aria-label for the close button. */\n @Input() closeLabel = 'Close';\n\n /** Classes added to the modal panel */\n @Input() panelClass: string[] = [];\n\n @Input() minHeight = '147px';\n\n /** Whether the dialog should restore focus to the previously-focused element, after it's closed. */\n @Input() restoreFocus = true;\n\n /** Icon displayed next to the modal title. */\n @Input() titleIcon?: WattIcon;\n\n /** Whether the modal should open automatically when rendered. */\n autoOpen = input(false, { transform: booleanAttribute });\n\n /**\n * When modal is closed, emits `true` if it was \"accepted\",\n * otherwise emits `false`.\n * @ignore\n */\n @Output() closed = new EventEmitter<boolean>();\n\n /** @ignore */\n @ViewChild('modal') modal!: TemplateRef<Element>;\n\n /** @ignore */\n scrollable = false;\n\n constructor() {\n afterRenderEffect(() => {\n if (this.autoOpen()) {\n this.open();\n }\n });\n }\n\n /**\n * Opens the modal. Subsequent calls are ignored while the modal is opened.\n * @ignore\n */\n open() {\n this.modalService.open({\n disableClose: this.disableEscAndBackdropClose || this.disableClose,\n templateRef: this.modal,\n onClosed: this.closed,\n minHeight: this.minHeight,\n panelClass: this.panelClass,\n restoreFocus: this.restoreFocus,\n });\n }\n\n /**\n * Closes the modal with `true` for acceptance or `false` for rejection.\n * @ignore\n */\n close(result: boolean) {\n this.modalService.close(result); // inline modal\n this.dialogRef?.close(result); // injected modal\n }\n\n /**\n * Called when the modal content element changes size.\n * @ignore\n */\n onResize(event: ResizeObserverEntry) {\n this.scrollable = event.target.scrollHeight > event.target.clientHeight;\n }\n}\n\n/**\n * Component for projecting buttons (actions) to the bottom of the modal.\n */\n@Component({\n selector: 'watt-modal-actions',\n template: '<ng-content />',\n})\nexport class WattModalActionsComponent {}\n\nexport const WATT_MODAL = [WattModalComponent, WattModalActionsComponent];\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<ng-template #modal>\n <div class=\"watt-modal\" [ngClass]=\"'watt-modal--' + size\">\n @if (!disableClose && !hideCloseButton) {\n <watt-button\n variant=\"icon\"\n icon=\"close\"\n class=\"watt-modal-close\"\n [attr.aria-label]=\"closeLabel\"\n (click)=\"close(false)\"\n />\n }\n @if (title && loading === false) {\n <h2 class=\"watt-modal-title\" [ngClass]=\"{ 'watt-modal-title-icon': titleIcon }\">\n @if (titleIcon) {\n <watt-icon [name]=\"titleIcon\" [size]=\"'l'\" />\n }\n {{ title }}\n </h2>\n }\n <div\n wattResizeObserver\n class=\"watt-modal-content\"\n [class.watt-modal-scrollable]=\"scrollable\"\n (resize)=\"onResize($event)\"\n >\n <ng-content />\n </div>\n <ng-content select=\"watt-modal-actions\" />\n\n @if (loading) {\n <div class=\"watt-modal__spinner\">\n <div>\n <watt-spinner />\n <p>{{ loadingMessage }}</p>\n </div>\n </div>\n }\n </div>\n</ng-template>\n\n@if (dialogRef) {\n <ng-template [ngTemplateOutlet]=\"modal\" />\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattModalComponent, WattModalActionsComponent, WATT_MODAL } from './watt-modal.component';\nexport { WattModalService, WattModalConfig, WattTypedModal } from './watt-modal.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAwCsB,cAAc,CAAA;AACxB,IAAA,SAAS,GAAM,MAAM,CAAC,eAAe,CAAC;AACtC,IAAA,SAAS,GAAoC,MAAM,CAAC,YAAY,CAAC;AAC5E;MAGY,gBAAgB,CAAA;AACV,IAAA,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AACnC,IAAA,YAAY;AAEpB;;;AA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B,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEf,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAJrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,QAAQ,EAAE,gBAAgB;AAC3B,iBAAA;;MAGY,UAAU,GAAG,CAAC,kBAAkB,EAAE,yBAAyB;;AE1KxE;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-modal.mjs","sources":["../../../libs/watt/package/modal/watt-modal.service.ts","../../../libs/watt/package/modal/watt-modal.component.ts","../../../libs/watt/package/modal/watt-modal.component.html","../../../libs/watt/package/modal/index.ts","../../../libs/watt/package/modal/energinet-watt-modal.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { ComponentType } from '@angular/cdk/portal';\nimport { EventEmitter, Injectable, Injector, NgModule, TemplateRef, inject } from '@angular/core';\nimport {\n MAT_DIALOG_DATA,\n MatDialog,\n MatDialogModule,\n MatDialogRef,\n} from '@angular/material/dialog';\nimport { map, take } from 'rxjs';\n\nexport interface WattModalConfig<T> {\n templateRef?: TemplateRef<unknown>;\n component?: ComponentType<WattTypedModal<T>>;\n data?: T;\n disableClose?: boolean;\n onClosed?: EventEmitter<boolean> | ((result: boolean) => void);\n minHeight?: string;\n panelClass?: string[];\n injector?: Injector;\n restoreFocus?: boolean;\n}\n\nexport abstract class WattTypedModal<T = void> {\n protected modalData: T = inject(MAT_DIALOG_DATA);\n protected dialogRef: MatDialogRef<WattTypedModal<T>> = inject(MatDialogRef);\n}\n\n@Injectable()\nexport class WattModalService {\n private readonly dialog = inject(MatDialog);\n private matDialogRef: MatDialogRef<unknown> | undefined;\n\n /**\n * Opens the modal. Subsequent calls are ignored while the modal is opened.\n * @ignore\n */\n open = <T>(config: WattModalConfig<T>) => {\n const template = config.templateRef ?? config.component;\n\n if (!template) return;\n\n this.matDialogRef = this.openModal(template, config);\n\n this.matDialogRef\n .afterClosed()\n .pipe(map(Boolean), take(1))\n .subscribe((result) => {\n if (config?.onClosed instanceof EventEmitter) {\n config?.onClosed.emit(result);\n } else {\n config?.onClosed?.(result);\n }\n });\n\n if (config.minHeight) this.setMinHeight(config.minHeight);\n };\n\n /**\n * Opens the modal using the provided template and configuration.\n */\n private openModal<T>(\n template: TemplateRef<unknown> | ComponentType<WattTypedModal<T>>,\n config: WattModalConfig<T>\n ): MatDialogRef<unknown> {\n return this.dialog.open(template, {\n autoFocus: 'dialog',\n panelClass: [\n 'watt-modal-panel',\n ...(config.component ? ['watt-modal-panel--component'] : []),\n ...(config.panelClass ?? []),\n ],\n disableClose: config.disableClose ?? false,\n data: config.data,\n maxWidth: 'none',\n injector: config.injector,\n restoreFocus: config.restoreFocus === false ? false : true,\n });\n }\n\n /**\n * Closes the modal with `true` for acceptance or `false` for rejection.\n * @ignore\n */\n close(result: boolean) {\n this.matDialogRef?.close(result);\n }\n\n private setMinHeight(minHeight: string) {\n setTimeout(() => {\n document\n ?.getElementById(this.matDialogRef?.id ?? '')\n ?.querySelector('.watt-modal')\n ?.setAttribute('style', `--watt-modal-min-height: ${minHeight}`);\n });\n }\n}\n\n@NgModule({\n imports: [MatDialogModule],\n providers: [WattModalService],\n})\nexport class WattModalModule {}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n afterRenderEffect,\n booleanAttribute,\n inject,\n input,\n} from '@angular/core';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { MatDialogRef } from '@angular/material/dialog';\n\nimport { WattResizeObserverDirective } from '@energinet/watt/utils/resize-observer';\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\n\nimport { WattModalModule, WattModalService } from './watt-modal.service';\nimport { WattIcon, WattIconComponent } from '@energinet/watt/icon';\n\nexport type WattModalSize = 'small' | 'medium' | 'large';\n\n/**\n * Component for representing a binary decision in the form of\n * a modal window that appears in front of the entire content.\n *\n * Usage:\n * `import { WATT_MODAL } from '@energinet-datahub/watt/modal';`\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-modal',\n styleUrls: ['./watt-modal.component.scss'],\n templateUrl: './watt-modal.component.html',\n imports: [\n NgClass,\n NgTemplateOutlet,\n WattResizeObserverDirective,\n WattButtonComponent,\n WattSpinnerComponent,\n WattModalModule,\n WattIconComponent,\n ],\n})\nexport class WattModalComponent {\n private modalService = inject(WattModalService);\n protected dialogRef = inject<MatDialogRef<unknown>>(MatDialogRef, { optional: true });\n /** Title to stay fixed to top of modal. */\n @Input() title = '';\n\n @Input() size: WattModalSize = 'medium';\n\n /** Whether the modal should show a loading state. */\n @Input() loading = false;\n\n /** Whether the modal should show a loading text for the loading state. */\n @Input() loadingMessage = '';\n\n /** Disable ESC, close button and backdrop click as methods of closing. */\n @Input() disableClose = false;\n\n /** Whether to show the close button */\n @Input() hideCloseButton = false;\n\n /** Disable ESC, backdrop click as methods of closing. */\n @Input() disableEscAndBackdropClose = false;\n\n /** The aria-label for the close button. */\n @Input() closeLabel = 'Close';\n\n /** Classes added to the modal panel */\n @Input() panelClass: string[] = [];\n\n @Input() minHeight = '147px';\n\n /** Whether the dialog should restore focus to the previously-focused element, after it's closed. */\n @Input() restoreFocus = true;\n\n /** Icon displayed next to the modal title. */\n @Input() titleIcon?: WattIcon;\n\n /** Whether the modal should open automatically when rendered. */\n autoOpen = input(false, { transform: booleanAttribute });\n\n /**\n * When modal is closed, emits `true` if it was \"accepted\",\n * otherwise emits `false`.\n * @ignore\n */\n @Output() closed = new EventEmitter<boolean>();\n\n /** @ignore */\n @ViewChild('modal') modal!: TemplateRef<Element>;\n\n /** @ignore */\n scrollable = false;\n\n constructor() {\n afterRenderEffect(() => {\n if (this.autoOpen()) {\n this.open();\n }\n });\n }\n\n /**\n * Opens the modal. Subsequent calls are ignored while the modal is opened.\n * @ignore\n */\n open() {\n this.modalService.open({\n disableClose: this.disableEscAndBackdropClose || this.disableClose,\n templateRef: this.modal,\n onClosed: this.closed,\n minHeight: this.minHeight,\n panelClass: this.panelClass,\n restoreFocus: this.restoreFocus,\n });\n }\n\n /**\n * Closes the modal with `true` for acceptance or `false` for rejection.\n * @ignore\n */\n close(result: boolean) {\n this.modalService.close(result); // inline modal\n this.dialogRef?.close(result); // injected modal\n }\n\n /**\n * Called when the modal content element changes size.\n * @ignore\n */\n onResize(event: ResizeObserverEntry) {\n this.scrollable = event.target.scrollHeight > event.target.clientHeight;\n }\n}\n\n/**\n * Component for projecting buttons (actions) to the bottom of the modal.\n */\n@Component({\n selector: 'watt-modal-actions',\n template: '<ng-content />',\n})\nexport class WattModalActionsComponent {}\n\nexport const WATT_MODAL = [WattModalComponent, WattModalActionsComponent];\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<ng-template #modal>\n <div class=\"watt-modal\" [ngClass]=\"'watt-modal--' + size\">\n @if (!disableClose && !hideCloseButton) {\n <watt-button\n variant=\"icon\"\n icon=\"close\"\n class=\"watt-modal-close\"\n [attr.aria-label]=\"closeLabel\"\n (click)=\"close(false)\"\n />\n }\n @if (title && loading === false) {\n <h2 class=\"watt-modal-title\" [ngClass]=\"{ 'watt-modal-title-icon': titleIcon }\">\n @if (titleIcon) {\n <watt-icon [name]=\"titleIcon\" [size]=\"'l'\" />\n }\n {{ title }}\n </h2>\n }\n <div\n wattResizeObserver\n class=\"watt-modal-content\"\n [class.watt-modal-scrollable]=\"scrollable\"\n (resize)=\"onResize($event)\"\n >\n <ng-content />\n </div>\n <ng-content select=\"watt-modal-actions\" />\n\n @if (loading) {\n <div class=\"watt-modal__spinner\">\n <div>\n <watt-spinner />\n <p>{{ loadingMessage }}</p>\n </div>\n </div>\n }\n </div>\n</ng-template>\n\n@if (dialogRef) {\n <ng-template [ngTemplateOutlet]=\"modal\" />\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattModalComponent, WattModalActionsComponent, WATT_MODAL } from './watt-modal.component';\nexport { WattModalService, WattModalConfig, WattTypedModal } from './watt-modal.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAwCsB,cAAc,CAAA;AACxB,IAAA,SAAS,GAAM,MAAM,CAAC,eAAe,CAAC;AACtC,IAAA,SAAS,GAAoC,MAAM,CAAC,YAAY,CAAC;AAC5E;MAGY,gBAAgB,CAAA;AACV,IAAA,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AACnC,IAAA,YAAY;AAEpB;;;AAGG;AACH,IAAA,IAAI,GAAG,CAAI,MAA0B,KAAI;QACvC,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,SAAS;AAEvD,QAAA,IAAI,CAAC,QAAQ;YAAE;QAEf,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;AAEpD,QAAA,IAAI,CAAC;AACF,aAAA,WAAW;aACX,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC1B,aAAA,SAAS,CAAC,CAAC,MAAM,KAAI;AACpB,YAAA,IAAI,MAAM,EAAE,QAAQ,YAAY,YAAY,EAAE;AAC5C,gBAAA,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;;iBACxB;AACL,gBAAA,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;;AAE9B,SAAC,CAAC;QAEJ,IAAI,MAAM,CAAC,SAAS;AAAE,YAAA,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC;AAC3D,KAAC;AAED;;AAEG;IACK,SAAS,CACf,QAAiE,EACjE,MAA0B,EAAA;AAE1B,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE;AAChC,YAAA,SAAS,EAAE,QAAQ;AACnB,YAAA,UAAU,EAAE;gBACV,kBAAkB;AAClB,gBAAA,IAA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Af;gBAGmB,KAAK,EAAA,CAAA;sBAAxB,SAAS;uBAAC,OAAO;;AA8CpB;;AAEG;MAKU,yBAAyB,CAAA;uGAAzB,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,8EAF1B,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEf,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAJrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,QAAQ,EAAE,gBAAgB;AAC3B,iBAAA;;MAGY,UAAU,GAAG,CAAC,kBAAkB,EAAE,yBAAyB;;AE1KxE;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-paginator.mjs","sources":["../../../libs/watt/package/paginator/watt-paginator-intl.service.ts","../../../libs/watt/package/paginator/watt-paginator.component.ts","../../../libs/watt/package/paginator/index.ts","../../../libs/watt/package/paginator/energinet-watt-paginator.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattPaginatorIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n description = 'Select page';\n itemsPerPage = 'Results per page';\n nextPage = 'Next page';\n previousPage = 'Previous page';\n firstPage = 'First page';\n lastPage = 'Last page';\n of = 'of';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n OnInit,\n ViewEncapsulation,\n viewChild,\n input,\n effect,\n output,\n computed,\n} from '@angular/core';\nimport {\n MatPaginator,\n MatPaginatorIntl,\n MatPaginatorModule,\n PageEvent,\n} from '@angular/material/paginator';\n\nimport { IWattTableDataSource } from '@energinet/watt/table';\nimport { WattPaginatorIntlService } from './watt-paginator-intl.service';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { map, startWith } from 'rxjs';\n\n/**\n * Usage:\n * `import { WattPaginatorComponent } from '@energinet-datahub/watt/paginator';`\n */\n@Component({\n imports: [MatPaginatorModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-paginator',\n styleUrls: ['./watt-paginator.component.scss'],\n template: `\n <mat-paginator\n class=\"watt-paginator\"\n (page)=\"changed.emit($event)\"\n [length]=\"length()\"\n [pageSize]=\"pageSize()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [pageIndex]=\"pageIndex()\"\n [showFirstLastButtons]=\"true\"\n [attr.aria-label]=\"description()\"\n />\n `,\n})\nexport class WattPaginatorComponent<T> implements OnInit {\n private intl = inject(WattPaginatorIntlService);\n private matPaginatorIntl = inject(MatPaginatorIntl);\n\n length = input(0);\n pageSizeOptions = input([50, 100, 150, 200, 250]);\n pageSize = input(50);\n pageIndex = input(0);\n for = input<IWattTableDataSource<T>>();\n changed = output<PageEvent>();\n instance = viewChild.required(MatPaginator);\n\n changes = toSignal(\n this.intl.changes.pipe(\n // Signals use referential equality to determine if a value has changed.\n // Therefore it is not possible to just map to the intl service directly\n // as the intl service relies on mutation for updating values.\n map(() => ({ ...this.intl })),\n startWith(this.intl)\n ),\n { requireSync: true }\n );\n\n description = computed(() => this.changes().description);\n\n updateDataSource = effect(() => {\n const dataSource = this.for();\n const instance = this.instance();\n if (!dataSource) return;\n dataSource.paginator = instance;\n });\n\n updateLabels = effect(() => {\n const changes = this.changes();\n this.matPaginatorIntl.itemsPerPageLabel = changes.itemsPerPage;\n this.matPaginatorIntl.nextPageLabel = changes.nextPage;\n this.matPaginatorIntl.previousPageLabel = changes.previousPage;\n this.matPaginatorIntl.firstPageLabel = changes.firstPage;\n this.matPaginatorIntl.lastPageLabel = changes.lastPage;\n this.matPaginatorIntl.changes.next();\n });\n\n ngOnInit() {\n this.matPaginatorIntl.getRangeLabel = this.getRangeLabel;\n }\n\n private getRangeLabel = (page: number, pageSize: number, length: number) => {\n if (length == 0 || pageSize == 0) {\n return `0 ${this.intl.of} ${length}`;\n }\n\n length = Math.max(length, 0);\n\n const startIndex = page * pageSize;\n\n // If the start index exceeds the list length, do not try and fix the end index to the end.\n const endIndex =\n startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;\n\n return `${startIndex + 1} – ${endIndex} ${this.intl.of} ${length}`;\n };\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattPaginatorComponent } from './watt-paginator.component';\nexport { WattPaginatorIntlService } from './watt-paginator-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,wBAAwB,CAAA;AAC1B,IAAA,OAAO,GAAkB,IAAI,OAAO,EAAQ;IACrD,WAAW,GAAG,aAAa;IAC3B,YAAY,GAAG,kBAAkB;IACjC,QAAQ,GAAG,WAAW;IACtB,YAAY,GAAG,eAAe;IAC9B,SAAS,GAAG,YAAY;IACxB,QAAQ,GAAG,WAAW;IACtB,EAAE,GAAG,IAAI;uGARE,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cADX,MAAM,EAAA,CAAA;;2FACnB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACrBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAyBA;;;AAGG;MAoBU,sBAAsB,CAAA;AACzB,IAAA,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC;AACvC,IAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAEnD,IAAA,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;AACjB,IAAA,eAAe,GAAG,KAAK,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACj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,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAkBjB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAnBlC,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAC,kBAAkB,CAAC,EACZ,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAChC,aAAA,EAAA,iBAAiB,CAAC,IAAI,EAC3B,QAAA,EAAA,gBAAgB,EAEhB,QAAA,EAAA;;;;;;;;;;;AAWT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,oiEAAA,CAAA,EAAA;;;AC/DH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-paginator.mjs","sources":["../../../libs/watt/package/paginator/watt-paginator-intl.service.ts","../../../libs/watt/package/paginator/watt-paginator.component.ts","../../../libs/watt/package/paginator/index.ts","../../../libs/watt/package/paginator/energinet-watt-paginator.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattPaginatorIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n description = 'Select page';\n itemsPerPage = 'Results per page';\n nextPage = 'Next page';\n previousPage = 'Previous page';\n firstPage = 'First page';\n lastPage = 'Last page';\n of = 'of';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n OnInit,\n ViewEncapsulation,\n viewChild,\n input,\n effect,\n output,\n computed,\n} from '@angular/core';\nimport {\n MatPaginator,\n MatPaginatorIntl,\n MatPaginatorModule,\n PageEvent,\n} from '@angular/material/paginator';\n\nimport { IWattTableDataSource } from '@energinet/watt/table';\nimport { WattPaginatorIntlService } from './watt-paginator-intl.service';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { map, startWith } from 'rxjs';\n\n/**\n * Usage:\n * `import { WattPaginatorComponent } from '@energinet-datahub/watt/paginator';`\n */\n@Component({\n imports: [MatPaginatorModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'watt-paginator',\n styleUrls: ['./watt-paginator.component.scss'],\n template: `\n <mat-paginator\n class=\"watt-paginator\"\n (page)=\"changed.emit($event)\"\n [length]=\"length()\"\n [pageSize]=\"pageSize()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [pageIndex]=\"pageIndex()\"\n [showFirstLastButtons]=\"true\"\n [attr.aria-label]=\"description()\"\n />\n `,\n})\nexport class WattPaginatorComponent<T> implements OnInit {\n private intl = inject(WattPaginatorIntlService);\n private matPaginatorIntl = inject(MatPaginatorIntl);\n\n length = input(0);\n pageSizeOptions = input([50, 100, 150, 200, 250]);\n pageSize = input(50);\n pageIndex = input(0);\n for = input<IWattTableDataSource<T>>();\n changed = output<PageEvent>();\n instance = viewChild.required(MatPaginator);\n\n changes = toSignal(\n this.intl.changes.pipe(\n // Signals use referential equality to determine if a value has changed.\n // Therefore it is not possible to just map to the intl service directly\n // as the intl service relies on mutation for updating values.\n map(() => ({ ...this.intl })),\n startWith(this.intl)\n ),\n { requireSync: true }\n );\n\n description = computed(() => this.changes().description);\n\n updateDataSource = effect(() => {\n const dataSource = this.for();\n const instance = this.instance();\n if (!dataSource) return;\n dataSource.paginator = instance;\n });\n\n updateLabels = effect(() => {\n const changes = this.changes();\n this.matPaginatorIntl.itemsPerPageLabel = changes.itemsPerPage;\n this.matPaginatorIntl.nextPageLabel = changes.nextPage;\n this.matPaginatorIntl.previousPageLabel = changes.previousPage;\n this.matPaginatorIntl.firstPageLabel = changes.firstPage;\n this.matPaginatorIntl.lastPageLabel = changes.lastPage;\n this.matPaginatorIntl.changes.next();\n });\n\n ngOnInit() {\n this.matPaginatorIntl.getRangeLabel = this.getRangeLabel;\n }\n\n private getRangeLabel = (page: number, pageSize: number, length: number) => {\n if (length == 0 || pageSize == 0) {\n return `0 ${this.intl.of} ${length}`;\n }\n\n length = Math.max(length, 0);\n\n const startIndex = page * pageSize;\n\n // If the start index exceeds the list length, do not try and fix the end index to the end.\n const endIndex =\n startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;\n\n return `${startIndex + 1} – ${endIndex} ${this.intl.of} ${length}`;\n };\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattPaginatorComponent } from './watt-paginator.component';\nexport { WattPaginatorIntlService } from './watt-paginator-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\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