@energinet/watt 4.2.13 → 4.2.14

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.
@@ -35,7 +35,7 @@ export class WattButtonComponent {
35
35
  // Prevents emitting a click event in Chrome/Edge/Safari when a disabled button is clicked
36
36
  // WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=89041
37
37
  // Note: This solution is preferred (in this particular case) over adding styling to the Scss file
38
- // because the presence of inline styles can be tested with Jest.
38
+ // because the presence of inline styles can be tested with Vitest.
39
39
  pointerEvents = computed(() => (this.disabled() ? 'none' : 'auto'), ...(ngDevMode ? [{ debugName: "pointerEvents" }] : []));
40
40
  /**
41
41
  * @ignore
@@ -1 +1 @@
1
- {"version":3,"file":"watt-button.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/button/watt-button.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EACL,KAAK,EACL,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAY,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;;;AAEnE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAU,CAAC;AAuC9F,MAAM,OAAO,mBAAmB;IAC9B,IAAI,GAAG,KAAK,0DAAY,CAAC;IACzB,OAAO,GAAG,KAAK,CAAoB,SAAS,mDAAC,CAAC;IAC9C,IAAI,GAAG,KAAK,CAAiB,QAAQ,gDAAC,CAAC;IACvC,IAAI,GAAG,KAAK,CAAiB,QAAQ,gDAAC,CAAC;IACvC,MAAM,GAAG,KAAK,CAAgB,IAAI,kDAAC,CAAC;IACpC,QAAQ,GAAG,KAAK,CAAC,KAAK,oDAAC,CAAC;IACxB,OAAO,GAAG,KAAK,CAAC,KAAK,mDAAC,CAAC;IAEvB,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,gBAAgB,IAAI,CAAC,OAAO,EAAE,sBAAsB,IAAI,CAAC,IAAI,EAAE,EAAE,mDAAC,CAAC;IAE5F,0FAA0F;IAC1F,4DAA4D;IAC5D,kGAAkG;IAClG,iEAAiE;IACjE,aAAa,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,yDAAC,CAAC;IAEpE;;OAEG;IACH,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,mDAAC,CAAC;wGApB7B,mBAAmB;4FAAnB,mBAAmB,kjCAvBpB;;;;;;;;;;;;;;;;;;;;;GAqBT,y/JAtBS,iBAAiB,kGAAE,oBAAoB,6FAAE,eAAe;;4FAwBvD,mBAAmB;kBAlC/B,SAAS;+BACE,aAAa,iBACR,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM,QAEzC;wBACJ,SAAS,EAAE,WAAW;wBACtB,+BAA+B,EAAE,YAAY;wBAC7C,wBAAwB,EAAE,iBAAiB;qBAC5C,WACQ,CAAC,iBAAiB,EAAE,oBAAoB,EAAE,eAAe,CAAC,YACzD;;;;;;;;;;;;;;;;;;;;;GAqBT","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 {\n input,\n computed,\n Component,\n ViewEncapsulation,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\nimport { WattIcon, WattIconComponent } from '@energinet/watt/icon';\n\nexport const WattButtonTypes = ['primary', 'secondary', 'text', 'icon', 'selection'] as const;\nexport type WattButtonVariant = (typeof WattButtonTypes)[number];\nexport type WattButtonType = 'button' | 'reset' | 'submit';\nexport type WattButtonSize = 'small' | 'medium';\n\n@Component({\n selector: 'watt-button',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n styleUrls: ['./watt-button.component.scss'],\n host: {\n '[class]': 'classes()',\n '[class.watt-button--disabled]': 'disabled()',\n '[style.pointer-events]': 'pointerEvents()',\n },\n imports: [WattIconComponent, WattSpinnerComponent, MatButtonModule],\n template: `\n <button\n mat-button\n [disableRipple]=\"true\"\n [disabled]=\"disabled()\"\n [type]=\"type()\"\n [color]=\"variant()\"\n [attr.form]=\"type() === 'submit' ? formId() : null\"\n >\n @if (loading()) {\n <watt-spinner [diameter]=\"18\" />\n }\n <div [class.content-wrapper]=\"!loading()\" [class.content-wrapper--loading]=\"loading()\">\n @if (hasIcon()) {\n <watt-icon [name]=\"icon()\" />\n }\n @if (variant() !== 'icon') {\n <ng-content />\n }\n </div>\n </button>\n `,\n})\nexport class WattButtonComponent {\n icon = input<WattIcon>();\n variant = input<WattButtonVariant>('primary');\n size = input<WattButtonSize>('medium');\n type = input<WattButtonType>('button');\n formId = input<string | null>(null);\n disabled = input(false);\n loading = input(false);\n\n classes = computed(() => `watt-button--${this.variant()} watt-button-size--${this.size()}`);\n\n // Prevents emitting a click event in Chrome/Edge/Safari when a disabled button is clicked\n // WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=89041\n // Note: This solution is preferred (in this particular case) over adding styling to the Scss file\n // because the presence of inline styles can be tested with Jest.\n pointerEvents = computed(() => (this.disabled() ? 'none' : 'auto'));\n\n /**\n * @ignore\n */\n hasIcon = computed(() => !!this.icon());\n}\n"]}
1
+ {"version":3,"file":"watt-button.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/button/watt-button.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EACL,KAAK,EACL,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAY,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;;;AAEnE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAU,CAAC;AAuC9F,MAAM,OAAO,mBAAmB;IAC9B,IAAI,GAAG,KAAK,0DAAY,CAAC;IACzB,OAAO,GAAG,KAAK,CAAoB,SAAS,mDAAC,CAAC;IAC9C,IAAI,GAAG,KAAK,CAAiB,QAAQ,gDAAC,CAAC;IACvC,IAAI,GAAG,KAAK,CAAiB,QAAQ,gDAAC,CAAC;IACvC,MAAM,GAAG,KAAK,CAAgB,IAAI,kDAAC,CAAC;IACpC,QAAQ,GAAG,KAAK,CAAC,KAAK,oDAAC,CAAC;IACxB,OAAO,GAAG,KAAK,CAAC,KAAK,mDAAC,CAAC;IAEvB,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,gBAAgB,IAAI,CAAC,OAAO,EAAE,sBAAsB,IAAI,CAAC,IAAI,EAAE,EAAE,mDAAC,CAAC;IAE5F,0FAA0F;IAC1F,4DAA4D;IAC5D,kGAAkG;IAClG,mEAAmE;IACnE,aAAa,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,yDAAC,CAAC;IAEpE;;OAEG;IACH,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,mDAAC,CAAC;wGApB7B,mBAAmB;4FAAnB,mBAAmB,kjCAvBpB;;;;;;;;;;;;;;;;;;;;;GAqBT,y/JAtBS,iBAAiB,kGAAE,oBAAoB,6FAAE,eAAe;;4FAwBvD,mBAAmB;kBAlC/B,SAAS;+BACE,aAAa,iBACR,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM,QAEzC;wBACJ,SAAS,EAAE,WAAW;wBACtB,+BAA+B,EAAE,YAAY;wBAC7C,wBAAwB,EAAE,iBAAiB;qBAC5C,WACQ,CAAC,iBAAiB,EAAE,oBAAoB,EAAE,eAAe,CAAC,YACzD;;;;;;;;;;;;;;;;;;;;;GAqBT","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 {\n input,\n computed,\n Component,\n ViewEncapsulation,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\nimport { WattIcon, WattIconComponent } from '@energinet/watt/icon';\n\nexport const WattButtonTypes = ['primary', 'secondary', 'text', 'icon', 'selection'] as const;\nexport type WattButtonVariant = (typeof WattButtonTypes)[number];\nexport type WattButtonType = 'button' | 'reset' | 'submit';\nexport type WattButtonSize = 'small' | 'medium';\n\n@Component({\n selector: 'watt-button',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n styleUrls: ['./watt-button.component.scss'],\n host: {\n '[class]': 'classes()',\n '[class.watt-button--disabled]': 'disabled()',\n '[style.pointer-events]': 'pointerEvents()',\n },\n imports: [WattIconComponent, WattSpinnerComponent, MatButtonModule],\n template: `\n <button\n mat-button\n [disableRipple]=\"true\"\n [disabled]=\"disabled()\"\n [type]=\"type()\"\n [color]=\"variant()\"\n [attr.form]=\"type() === 'submit' ? formId() : null\"\n >\n @if (loading()) {\n <watt-spinner [diameter]=\"18\" />\n }\n <div [class.content-wrapper]=\"!loading()\" [class.content-wrapper--loading]=\"loading()\">\n @if (hasIcon()) {\n <watt-icon [name]=\"icon()\" />\n }\n @if (variant() !== 'icon') {\n <ng-content />\n }\n </div>\n </button>\n `,\n})\nexport class WattButtonComponent {\n icon = input<WattIcon>();\n variant = input<WattButtonVariant>('primary');\n size = input<WattButtonSize>('medium');\n type = input<WattButtonType>('button');\n formId = input<string | null>(null);\n disabled = input(false);\n loading = input(false);\n\n classes = computed(() => `watt-button--${this.variant()} watt-button-size--${this.size()}`);\n\n // Prevents emitting a click event in Chrome/Edge/Safari when a disabled button is clicked\n // WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=89041\n // Note: This solution is preferred (in this particular case) over adding styling to the Scss file\n // because the presence of inline styles can be tested with Vitest.\n pointerEvents = computed(() => (this.disabled() ? 'none' : 'auto'));\n\n /**\n * @ignore\n */\n hasIcon = computed(() => !!this.icon());\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@energinet/watt",
4
- "version": "4.2.13",
4
+ "version": "4.2.14",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
7
7
  ".": {