@energinet/watt 4.4.4 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/energinet-watt-code.mjs +2 -2
- package/fesm2022/energinet-watt-code.mjs.map +1 -1
- package/fesm2022/energinet-watt-core-date.mjs +5 -0
- package/fesm2022/energinet-watt-core-date.mjs.map +1 -1
- package/fesm2022/energinet-watt-picker-datepicker.mjs +55 -2
- package/fesm2022/energinet-watt-picker-datepicker.mjs.map +1 -1
- package/package.json +1 -1
- package/types/energinet-watt-core-date.d.ts +2 -1
- package/types/energinet-watt-picker-datepicker.d.ts +15 -2
|
@@ -183,7 +183,7 @@ class WattCodeComponent {
|
|
|
183
183
|
</cdk-virtual-scroll-viewport>
|
|
184
184
|
</pre>
|
|
185
185
|
}
|
|
186
|
-
`, isInline: true, styles: ["watt-tabs watt-code pre code.watt-code-content{padding:0}watt-code{display:block;height:100%;width:100%}watt-code pre{display:flex;margin:0;padding:0;height:calc(100% - 60px);width:100
|
|
186
|
+
`, isInline: true, styles: ["watt-tabs watt-code pre code.watt-code-content{padding:0}watt-code{display:block;height:100%;width:100%}watt-code pre{display:flex;margin:0;padding:0;height:calc(100% - 60px);width:100%}watt-code pre .cdk-virtual-scroll-content-wrapper code{padding:2px 8px;line-height:20px;font-family:monospace;white-space:pre;min-width:100%;width:max-content;display:block;font-size:14px}watt-code pre .cdk-virtual-scroll-content-wrapper code.highlight{background-color:#ffeb3b4d;font-weight:700}\n"], dependencies: [{ kind: "component", type: WattSpinnerComponent, selector: "watt-spinner", inputs: ["diameter", "strokeWidth"] }, { kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]" }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: WattSearchComponent, selector: "watt-search", inputs: ["label", "debounceTime", "trim", "size"], outputs: ["search"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
187
187
|
}
|
|
188
188
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: WattCodeComponent, decorators: [{
|
|
189
189
|
type: Component,
|
|
@@ -213,7 +213,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
|
|
|
213
213
|
</cdk-virtual-scroll-viewport>
|
|
214
214
|
</pre>
|
|
215
215
|
}
|
|
216
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [WattSpinnerComponent, VaterStackComponent, ScrollingModule, WattSearchComponent], styles: ["watt-tabs watt-code pre code.watt-code-content{padding:0}watt-code{display:block;height:100%;width:100%}watt-code pre{display:flex;margin:0;padding:0;height:calc(100% - 60px);width:100
|
|
216
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [WattSpinnerComponent, VaterStackComponent, ScrollingModule, WattSearchComponent], styles: ["watt-tabs watt-code pre code.watt-code-content{padding:0}watt-code{display:block;height:100%;width:100%}watt-code pre{display:flex;margin:0;padding:0;height:calc(100% - 60px);width:100%}watt-code pre .cdk-virtual-scroll-content-wrapper code{padding:2px 8px;line-height:20px;font-family:monospace;white-space:pre;min-width:100%;width:max-content;display:block;font-size:14px}watt-code pre .cdk-virtual-scroll-content-wrapper code.highlight{background-color:#ffeb3b4d;font-weight:700}\n"] }]
|
|
217
217
|
}], ctorParameters: () => [], propDecorators: { viewport: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkVirtualScrollViewport), { isSignal: true }] }], code: [{ type: i0.Input, args: [{ isSignal: true, alias: "code", required: true }] }], language: [{ type: i0.Input, args: [{ isSignal: true, alias: "language", required: false }] }], discoveredLanguage: [{ type: i0.Output, args: ["discoveredLanguage"] }] } });
|
|
218
218
|
|
|
219
219
|
//#region License
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-code.mjs","sources":["../../../libs/watt/package/code/watt-code-intl.service.ts","../../../libs/watt/package/code/watt-code.worker.token.ts","../../../libs/watt/package/code/watt-code.component.ts","../../../libs/watt/package/code/index.ts","../../../libs/watt/package/code/energinet-watt-code.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';\n\n@Injectable({ providedIn: 'root' })\nexport class WattCodeIntlService {\n searchPlaceholder = 'Search in code';\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 { InjectionToken } from '@angular/core';\n\nexport const WATT_CODE_HIGHLIGHT_WORKER_FACTORY = new InjectionToken<(() => Worker) | null>(\n 'WattCodeHighlightWorkerFactory',\n { factory: () => null }\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 input,\n output,\n signal,\n inject,\n effect,\n computed,\n viewChild,\n Component,\n OnDestroy,\n ViewEncapsulation,\n ChangeDetectionStrategy,\n} from '@angular/core';\n\nimport { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\n\nimport { VaterStackComponent } from '@energinet/watt/vater';\nimport { WattSearchComponent } from '@energinet/watt/search';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\n\nimport { WattCodeIntlService } from './watt-code-intl.service';\nimport { WATT_CODE_HIGHLIGHT_WORKER_FACTORY } from './watt-code.worker.token';\n\n@Component({\n selector: 'watt-code',\n template: `\n @if (loading()) {\n <vater-stack fill=\"horizontal\" align=\"center\">\n <watt-spinner />\n </vater-stack>\n } @else {\n <watt-search\n size=\"m\"\n [label]=\"intl.searchPlaceholder\"\n (search)=\"searchTerm.set($event)\"\n (keyup.enter)=\"searchNext()\"\n />\n <pre>\n <cdk-virtual-scroll-viewport \n [itemSize]=\"20\" \n minBufferPx=\"500\"\n maxBufferPx=\"1000\"\n class=\"viewport\" \n style=\"height: 100%; width: 100%;\">\n <code *cdkVirtualFor=\"let item of chunks(); let i = index; trackBy: trackByFn\" \n [attr.data-index]=\"i\"\n [innerHTML]=\"item\" \n [class.highlight]=\"isLineHighlighted(i)\"></code>\n </cdk-virtual-scroll-viewport>\n </pre>\n }\n `,\n styleUrls: ['./watt-code.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WattSpinnerComponent, VaterStackComponent, ScrollingModule, WattSearchComponent],\n})\nexport class WattCodeComponent implements OnDestroy {\n private highlightWorkerFactory = inject(WATT_CODE_HIGHLIGHT_WORKER_FACTORY);\n private worker = this.highlightWorkerFactory?.();\n intl = inject(WattCodeIntlService);\n\n viewport = viewChild.required(CdkVirtualScrollViewport);\n\n code = input.required<string | null | undefined>();\n language = input<'xml' | 'json' | 'auto'>('auto');\n\n /** @ignore */\n formattedCode = signal<string>('');\n /** @ignore */\n loading = signal(false);\n\n discoveredLanguage = output<'json' | 'xml'>();\n\n // Search functionality\n searchTerm = signal('');\n matchIndices = signal<number[]>([]);\n currentMatchIndex = signal<number>(-1);\n\n chunks = computed(() => {\n const code = this.formattedCode();\n if (!code) return [''];\n const lines = code.split('\\n');\n return lines.length === 0 ? [''] : lines;\n });\n\n constructor() {\n effect(() => {\n const code = this.code();\n this.formattedCode.set('');\n\n if (!code) return;\n if (!this.worker) return;\n this.loading.set(true);\n this.worker.onmessage = (event) => {\n const { formattedData, discoveredLanguage } = event.data;\n this.formattedCode.set(formattedData);\n this.discoveredLanguage.emit(discoveredLanguage);\n this.loading.set(false);\n };\n this.worker.postMessage({ data: code, language: this.language() } as const);\n });\n\n effect(() => {\n const term = this.searchTerm();\n\n if (!term) return;\n\n const newMatchIndices = this.chunks()\n .map((chunk, index) => (chunk.toLowerCase().includes(term.toLowerCase()) ? index : -1))\n .filter((index) => index !== -1);\n\n this.matchIndices.set(newMatchIndices);\n if (newMatchIndices.length > 0 && this.currentMatchIndex() === -1) {\n this.currentMatchIndex.set(0);\n } else if (newMatchIndices.length === 0) {\n this.currentMatchIndex.set(-1);\n }\n });\n }\n\n isLineHighlighted(index: number): boolean {\n const matchIndex = this.currentMatchIndex();\n if (matchIndex === -1) return false;\n return this.matchIndices()[matchIndex] === index;\n }\n\n searchNext(): void {\n const viewport = this.viewport();\n const matches = this.matchIndices();\n if (matches.length === 0) return;\n\n let nextIndex = this.currentMatchIndex() + 1;\n if (nextIndex >= matches.length) {\n nextIndex = 0;\n }\n\n this.currentMatchIndex.set(nextIndex);\n\n const lineIndex = matches[nextIndex];\n if (lineIndex !== undefined) {\n viewport.scrollToIndex(lineIndex);\n }\n }\n\n trackByFn(index: number): number {\n return index;\n }\n\n /** @ignore */\n ngOnDestroy(): void {\n this.worker?.terminate();\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 { WattCodeComponent } from './watt-code.component';\nexport { WATT_CODE_HIGHLIGHT_WORKER_FACTORY } from './watt-code.worker.token';\nexport { WattCodeIntlService } from './watt-code-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAIa,mBAAmB,CAAA;IAC9B,iBAAiB,GAAG,gBAAgB;uGADzB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cADN,MAAM,EAAA,CAAA;;2FACnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B,UAA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../libs/watt/package/code/watt-code-intl.service.ts","../../../libs/watt/package/code/watt-code.worker.token.ts","../../../libs/watt/package/code/watt-code.component.ts","../../../libs/watt/package/code/index.ts","../../../libs/watt/package/code/energinet-watt-code.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';\n\n@Injectable({ providedIn: 'root' })\nexport class WattCodeIntlService {\n searchPlaceholder = 'Search in code';\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 { InjectionToken } from '@angular/core';\n\nexport const WATT_CODE_HIGHLIGHT_WORKER_FACTORY = new InjectionToken<(() => Worker) | null>(\n 'WattCodeHighlightWorkerFactory',\n { factory: () => null }\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 input,\n output,\n signal,\n inject,\n effect,\n computed,\n viewChild,\n Component,\n OnDestroy,\n ViewEncapsulation,\n ChangeDetectionStrategy,\n} from '@angular/core';\n\nimport { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\n\nimport { VaterStackComponent } from '@energinet/watt/vater';\nimport { WattSearchComponent } from '@energinet/watt/search';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\n\nimport { WattCodeIntlService } from './watt-code-intl.service';\nimport { WATT_CODE_HIGHLIGHT_WORKER_FACTORY } from './watt-code.worker.token';\n\n@Component({\n selector: 'watt-code',\n template: `\n @if (loading()) {\n <vater-stack fill=\"horizontal\" align=\"center\">\n <watt-spinner />\n </vater-stack>\n } @else {\n <watt-search\n size=\"m\"\n [label]=\"intl.searchPlaceholder\"\n (search)=\"searchTerm.set($event)\"\n (keyup.enter)=\"searchNext()\"\n />\n <pre>\n <cdk-virtual-scroll-viewport \n [itemSize]=\"20\" \n minBufferPx=\"500\"\n maxBufferPx=\"1000\"\n class=\"viewport\" \n style=\"height: 100%; width: 100%;\">\n <code *cdkVirtualFor=\"let item of chunks(); let i = index; trackBy: trackByFn\" \n [attr.data-index]=\"i\"\n [innerHTML]=\"item\" \n [class.highlight]=\"isLineHighlighted(i)\"></code>\n </cdk-virtual-scroll-viewport>\n </pre>\n }\n `,\n styleUrls: ['./watt-code.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WattSpinnerComponent, VaterStackComponent, ScrollingModule, WattSearchComponent],\n})\nexport class WattCodeComponent implements OnDestroy {\n private highlightWorkerFactory = inject(WATT_CODE_HIGHLIGHT_WORKER_FACTORY);\n private worker = this.highlightWorkerFactory?.();\n intl = inject(WattCodeIntlService);\n\n viewport = viewChild.required(CdkVirtualScrollViewport);\n\n code = input.required<string | null | undefined>();\n language = input<'xml' | 'json' | 'auto'>('auto');\n\n /** @ignore */\n formattedCode = signal<string>('');\n /** @ignore */\n loading = signal(false);\n\n discoveredLanguage = output<'json' | 'xml'>();\n\n // Search functionality\n searchTerm = signal('');\n matchIndices = signal<number[]>([]);\n currentMatchIndex = signal<number>(-1);\n\n chunks = computed(() => {\n const code = this.formattedCode();\n if (!code) return [''];\n const lines = code.split('\\n');\n return lines.length === 0 ? [''] : lines;\n });\n\n constructor() {\n effect(() => {\n const code = this.code();\n this.formattedCode.set('');\n\n if (!code) return;\n if (!this.worker) return;\n this.loading.set(true);\n this.worker.onmessage = (event) => {\n const { formattedData, discoveredLanguage } = event.data;\n this.formattedCode.set(formattedData);\n this.discoveredLanguage.emit(discoveredLanguage);\n this.loading.set(false);\n };\n this.worker.postMessage({ data: code, language: this.language() } as const);\n });\n\n effect(() => {\n const term = this.searchTerm();\n\n if (!term) return;\n\n const newMatchIndices = this.chunks()\n .map((chunk, index) => (chunk.toLowerCase().includes(term.toLowerCase()) ? index : -1))\n .filter((index) => index !== -1);\n\n this.matchIndices.set(newMatchIndices);\n if (newMatchIndices.length > 0 && this.currentMatchIndex() === -1) {\n this.currentMatchIndex.set(0);\n } else if (newMatchIndices.length === 0) {\n this.currentMatchIndex.set(-1);\n }\n });\n }\n\n isLineHighlighted(index: number): boolean {\n const matchIndex = this.currentMatchIndex();\n if (matchIndex === -1) return false;\n return this.matchIndices()[matchIndex] === index;\n }\n\n searchNext(): void {\n const viewport = this.viewport();\n const matches = this.matchIndices();\n if (matches.length === 0) return;\n\n let nextIndex = this.currentMatchIndex() + 1;\n if (nextIndex >= matches.length) {\n nextIndex = 0;\n }\n\n this.currentMatchIndex.set(nextIndex);\n\n const lineIndex = matches[nextIndex];\n if (lineIndex !== undefined) {\n viewport.scrollToIndex(lineIndex);\n }\n }\n\n trackByFn(index: number): number {\n return index;\n }\n\n /** @ignore */\n ngOnDestroy(): void {\n this.worker?.terminate();\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 { WattCodeComponent } from './watt-code.component';\nexport { WATT_CODE_HIGHLIGHT_WORKER_FACTORY } from './watt-code.worker.token';\nexport { WattCodeIntlService } from './watt-code-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAIa,mBAAmB,CAAA;IAC9B,iBAAiB,GAAG,gBAAgB;uGADzB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cADN,MAAM,EAAA,CAAA;;2FACnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACpBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAGO,MAAM,kCAAkC,GAAG,IAAI,cAAc,CAClE,gCAAgC,EAChC,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE;;ACtBzB;AACA;;;;;;;;;;;;;;;AAeG;AACH;MA0Da,iBAAiB,CAAA;AACpB,IAAA,sBAAsB,GAAG,MAAM,CAAC,kCAAkC,CAAC;AACnE,IAAA,MAAM,GAAG,IAAI,CAA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;AA0BT,EAAA,CAAA,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,OAAA,EAC5B,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,eAAe,EAAE,mBAAmB,CAAC,EAAA,MAAA,EAAA,CAAA,seAAA,CAAA,EAAA;oHAO5D,wBAAwB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,kBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AChFxD;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -4,6 +4,7 @@ import utc from 'dayjs/plugin/utc';
|
|
|
4
4
|
import timezone from 'dayjs/plugin/timezone';
|
|
5
5
|
import duration from 'dayjs/plugin/duration';
|
|
6
6
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
7
|
+
import updateLocale from 'dayjs/plugin/updateLocale';
|
|
7
8
|
import { NativeDateAdapter, MAT_DATE_LOCALE, DateAdapter, MAT_NATIVE_DATE_FORMATS, MAT_DATE_FORMATS } from '@angular/material/core';
|
|
8
9
|
import * as i0 from '@angular/core';
|
|
9
10
|
import { Injectable, makeEnvironmentProviders, Pipe, inject, signal, LOCALE_ID, computed } from '@angular/core';
|
|
@@ -30,6 +31,7 @@ dayjs.extend(utc);
|
|
|
30
31
|
dayjs.extend(timezone);
|
|
31
32
|
dayjs.extend(duration);
|
|
32
33
|
dayjs.extend(customParseFormat);
|
|
34
|
+
dayjs.extend(updateLocale);
|
|
33
35
|
|
|
34
36
|
//#region License
|
|
35
37
|
/**
|
|
@@ -252,6 +254,9 @@ class WattLocaleService {
|
|
|
252
254
|
await import('dayjs/locale/en');
|
|
253
255
|
}
|
|
254
256
|
dayjs.locale(locale);
|
|
257
|
+
dayjs.updateLocale(locale, {
|
|
258
|
+
weekStart: 1,
|
|
259
|
+
});
|
|
255
260
|
this.dateAdapter.setActiveLocale(locale);
|
|
256
261
|
this.locale.set(locale);
|
|
257
262
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-core-date.mjs","sources":["../../../libs/watt/package/core/date/dayjs.ts","../../../libs/watt/package/core/date/watt-date-adapter.ts","../../../libs/watt/package/core/date/watt-danish-datetime.providers.ts","../../../libs/watt/package/core/date/watt-date-range.ts","../../../libs/watt/package/core/date/watt-format-date.ts","../../../libs/watt/package/core/date/watt-date.pipe.ts","../../../libs/watt/package/core/date/watt-locale.service.ts","../../../libs/watt/package/core/date/index.ts","../../../libs/watt/package/core/date/energinet-watt-core-date.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 dayjs from 'dayjs'; // eslint-disable-line no-restricted-imports\nimport utc from 'dayjs/plugin/utc';\nimport timezone from 'dayjs/plugin/timezone';\nimport duration from 'dayjs/plugin/duration';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\n\n// Force import of plugins in generated .d.ts file by exporting their types\ntype __ngPackagrDayjsTypeScriptWorkaround =\n | typeof utc\n | typeof timezone\n | typeof duration\n | typeof customParseFormat;\n\ndayjs.extend(utc);\ndayjs.extend(timezone);\ndayjs.extend(duration);\ndayjs.extend(customParseFormat);\n\nexport { dayjs, __ngPackagrDayjsTypeScriptWorkaround };\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 { Injectable } from '@angular/core';\nimport { NativeDateAdapter } from '@angular/material/core';\n\nexport type WattSupportedLocales = 'da' | 'en';\nconst danishLocale = 'da';\n\n@Injectable()\nexport class WattDateAdapter extends NativeDateAdapter {\n setActiveLocale(language: WattSupportedLocales): void {\n this.setLocale(language === danishLocale ? danishLocale : 'en-GB');\n }\n\n /**\n * This is necessary to remove the dots from the date (ordinals) for danish locale in the calendar view.\n * due to `Intl.DateTimeFormat`\n */\n override getDateNames(): string[] {\n const dateNames = super.getDateNames();\n\n return this.locale === danishLocale\n ? dateNames.map((dateName) => dateName.replace(/\\./g, ''))\n : dateNames;\n }\n\n /**\n * Our week starts on Monday\n * @returns 0 for Sunday, 1 for Monday, etc.\n */\n override getFirstDayOfWeek(): number {\n return 1;\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 {\n DateAdapter,\n MAT_DATE_FORMATS,\n MAT_DATE_LOCALE,\n MAT_NATIVE_DATE_FORMATS,\n} from '@angular/material/core';\nimport { makeEnvironmentProviders } from '@angular/core';\n\nimport { WattDateAdapter } from './watt-date-adapter';\n\nexport const danishDatetimeProviders = makeEnvironmentProviders([\n { provide: MAT_DATE_LOCALE, useValue: 'da' },\n {\n provide: DateAdapter,\n useClass: WattDateAdapter,\n deps: [MAT_DATE_LOCALE],\n },\n { provide: MAT_DATE_FORMATS, useValue: MAT_NATIVE_DATE_FORMATS },\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 { dayjs } from './dayjs';\n\nexport interface WattRange<T> {\n start: T;\n end: T | null;\n}\n\n/**\n * This is included for legacy reasons, components should return Date objects instead of strings.\n * @deprecated Avoid using strings as dates, use Date objects instead.\n */\nexport type WattDateRange = WattRange<string>;\n\n/**\n * Checks if a given date is within a specified date range.\n */\nexport function contains(interval: WattRange<Date>, date: Date) {\n const day = dayjs(date);\n const isSameOrAfterStart = day.isSame(interval.start) || day.isAfter(interval.start);\n if (!interval.end) return isSameOrAfterStart;\n const isSameOrBeforeEnd = day.isSame(interval.end) || day.isBefore(interval.end);\n return isSameOrAfterStart && isSameOrBeforeEnd;\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 { dayjs } from './dayjs';\nimport { WattRange } from './watt-date-range';\n\nexport const formatStrings = {\n year: 'YYYY',\n monthYear: 'MMMM YYYY',\n short: 'DD-MM-YYYY',\n shortAbbr: 'DD. MMM YYYY',\n long: 'DD-MM-YYYY HH:mm',\n longAbbr: 'DD. MMM YYYY HH:mm',\n time: 'HH:mm',\n longAbbrWithSeconds: 'DD-MMM YYYY HH:mm:ss',\n};\n\nexport function wattFormatDate(\n input?: WattRange<Date> | WattRange<string> | Date | string | number | null,\n format: keyof typeof formatStrings = 'short',\n timeZone = 'Europe/Copenhagen'\n): string | null {\n if (!input) return null;\n\n if (input instanceof Date || typeof input === 'string') {\n return dayjs(input).tz(timeZone).format(formatStrings[format]);\n } else if (typeof input === 'number') {\n return dayjs(new Date(input)).tz(timeZone).format(formatStrings[format]);\n } else {\n return transformRange(input, format);\n }\n}\n\nfunction transformRange(\n input: WattRange<Date | string>,\n format: keyof typeof formatStrings\n): string | null {\n if (dayjs(input.start).isSame(dayjs(input.end), 'day') || input.end === null) {\n return wattFormatDate(input.start, format);\n } else {\n return `${wattFormatDate(input.start, format)} ― ${wattFormatDate(input.end, format)}`;\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 { Pipe, PipeTransform } from '@angular/core';\n\nimport { WattRange } from './watt-date-range';\nimport { formatStrings, wattFormatDate } from './watt-format-date';\n\n@Pipe({\n name: 'wattDate',\n})\nexport class WattDatePipe implements PipeTransform {\n /**\n * @param input WattDateRange or string in ISO 8601 format or unix timestamp number\n */\n transform(\n input?: WattRange<Date> | WattRange<string> | Date | string | number | null,\n format: keyof typeof formatStrings = 'short',\n timeZone = 'Europe/Copenhagen'\n ): string | null {\n return wattFormatDate(input, format, timeZone);\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 { computed, inject, Injectable, LOCALE_ID, signal } from '@angular/core';\nimport { DateAdapter } from '@angular/material/core';\n\nimport { WattDateAdapter, WattSupportedLocales } from './watt-date-adapter';\nimport { dayjs } from './dayjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class WattLocaleService {\n private readonly dateAdapter = inject<DateAdapter<unknown>>(DateAdapter);\n\n locale = signal(inject<WattSupportedLocales>(LOCALE_ID));\n isDanish = computed(() => this.locale() == 'da');\n isEnglish = computed(() => this.locale() == 'en');\n\n async setActiveLocale(locale: WattSupportedLocales): Promise<void> {\n if (locale === 'da') {\n await import('dayjs/locale/da');\n }\n\n if (locale === 'en') {\n await import('dayjs/locale/en');\n }\n\n dayjs.locale(locale);\n (this.dateAdapter as WattDateAdapter).setActiveLocale(locale);\n this.locale.set(locale);\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 { dayjs, __ngPackagrDayjsTypeScriptWorkaround } from './dayjs';\nexport { danishDatetimeProviders } from './watt-danish-datetime.providers';\nexport { WattDateAdapter, WattSupportedLocales } from './watt-date-adapter';\nexport { type WattRange, type WattDateRange, contains } from './watt-date-range';\nexport { WattDatePipe } from './watt-date.pipe';\nexport { wattFormatDate } from './watt-format-date';\nexport { WattLocaleService } from './watt-locale.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAcA,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;AACjB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AACtB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AACtB,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC;;AClC/B;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAKA,MAAM,YAAY,GAAG,IAAI;AAGnB,MAAO,eAAgB,SAAQ,iBAAiB,CAAA;AACpD,IAAA,eAAe,CAAC,QAA8B,EAAA;AAC5C,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,KAAK,YAAY,GAAG,YAAY,GAAG,OAAO,CAAC;IACpE;AAEA;;;AAGG;IACM,YAAY,GAAA;AACnB,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,EAAE;AAEt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YAAA,MAAM,OAAO,iBAAiB,CAAC;QACjC;AAEA,QAAA,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;AACnB,QAAA,IAAI,CAAC,WAA+B,CAAC,eAAe,CAAC,MAAM,CAAC;AAC7D,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;IACzB;uGAnBW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAjB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,cAFhB,MAAM,EAAA,CAAA;;2FAEP,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAH7B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AC1BD;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-core-date.mjs","sources":["../../../libs/watt/package/core/date/dayjs.ts","../../../libs/watt/package/core/date/watt-date-adapter.ts","../../../libs/watt/package/core/date/watt-danish-datetime.providers.ts","../../../libs/watt/package/core/date/watt-date-range.ts","../../../libs/watt/package/core/date/watt-format-date.ts","../../../libs/watt/package/core/date/watt-date.pipe.ts","../../../libs/watt/package/core/date/watt-locale.service.ts","../../../libs/watt/package/core/date/index.ts","../../../libs/watt/package/core/date/energinet-watt-core-date.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 dayjs from 'dayjs'; // eslint-disable-line no-restricted-imports\nimport utc from 'dayjs/plugin/utc';\nimport timezone from 'dayjs/plugin/timezone';\nimport duration from 'dayjs/plugin/duration';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport updateLocale from 'dayjs/plugin/updateLocale';\n\n// Force import of plugins in generated .d.ts file by exporting their types\ntype __ngPackagrDayjsTypeScriptWorkaround =\n | typeof utc\n | typeof timezone\n | typeof duration\n | typeof customParseFormat\n | typeof updateLocale;\n\ndayjs.extend(utc);\ndayjs.extend(timezone);\ndayjs.extend(duration);\ndayjs.extend(customParseFormat);\ndayjs.extend(updateLocale);\n\nexport { dayjs, __ngPackagrDayjsTypeScriptWorkaround };\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 { Injectable } from '@angular/core';\nimport { NativeDateAdapter } from '@angular/material/core';\n\nexport type WattSupportedLocales = 'da' | 'en';\nconst danishLocale = 'da';\n\n@Injectable()\nexport class WattDateAdapter extends NativeDateAdapter {\n setActiveLocale(language: WattSupportedLocales): void {\n this.setLocale(language === danishLocale ? danishLocale : 'en-GB');\n }\n\n /**\n * This is necessary to remove the dots from the date (ordinals) for danish locale in the calendar view.\n * due to `Intl.DateTimeFormat`\n */\n override getDateNames(): string[] {\n const dateNames = super.getDateNames();\n\n return this.locale === danishLocale\n ? dateNames.map((dateName) => dateName.replace(/\\./g, ''))\n : dateNames;\n }\n\n /**\n * Our week starts on Monday\n * @returns 0 for Sunday, 1 for Monday, etc.\n */\n override getFirstDayOfWeek(): number {\n return 1;\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 {\n DateAdapter,\n MAT_DATE_FORMATS,\n MAT_DATE_LOCALE,\n MAT_NATIVE_DATE_FORMATS,\n} from '@angular/material/core';\nimport { makeEnvironmentProviders } from '@angular/core';\n\nimport { WattDateAdapter } from './watt-date-adapter';\n\nexport const danishDatetimeProviders = makeEnvironmentProviders([\n { provide: MAT_DATE_LOCALE, useValue: 'da' },\n {\n provide: DateAdapter,\n useClass: WattDateAdapter,\n deps: [MAT_DATE_LOCALE],\n },\n { provide: MAT_DATE_FORMATS, useValue: MAT_NATIVE_DATE_FORMATS },\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 { dayjs } from './dayjs';\n\nexport interface WattRange<T> {\n start: T;\n end: T | null;\n}\n\n/**\n * This is included for legacy reasons, components should return Date objects instead of strings.\n * @deprecated Avoid using strings as dates, use Date objects instead.\n */\nexport type WattDateRange = WattRange<string>;\n\n/**\n * Checks if a given date is within a specified date range.\n */\nexport function contains(interval: WattRange<Date>, date: Date) {\n const day = dayjs(date);\n const isSameOrAfterStart = day.isSame(interval.start) || day.isAfter(interval.start);\n if (!interval.end) return isSameOrAfterStart;\n const isSameOrBeforeEnd = day.isSame(interval.end) || day.isBefore(interval.end);\n return isSameOrAfterStart && isSameOrBeforeEnd;\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 { dayjs } from './dayjs';\nimport { WattRange } from './watt-date-range';\n\nexport const formatStrings = {\n year: 'YYYY',\n monthYear: 'MMMM YYYY',\n short: 'DD-MM-YYYY',\n shortAbbr: 'DD. MMM YYYY',\n long: 'DD-MM-YYYY HH:mm',\n longAbbr: 'DD. MMM YYYY HH:mm',\n time: 'HH:mm',\n longAbbrWithSeconds: 'DD-MMM YYYY HH:mm:ss',\n};\n\nexport function wattFormatDate(\n input?: WattRange<Date> | WattRange<string> | Date | string | number | null,\n format: keyof typeof formatStrings = 'short',\n timeZone = 'Europe/Copenhagen'\n): string | null {\n if (!input) return null;\n\n if (input instanceof Date || typeof input === 'string') {\n return dayjs(input).tz(timeZone).format(formatStrings[format]);\n } else if (typeof input === 'number') {\n return dayjs(new Date(input)).tz(timeZone).format(formatStrings[format]);\n } else {\n return transformRange(input, format);\n }\n}\n\nfunction transformRange(\n input: WattRange<Date | string>,\n format: keyof typeof formatStrings\n): string | null {\n if (dayjs(input.start).isSame(dayjs(input.end), 'day') || input.end === null) {\n return wattFormatDate(input.start, format);\n } else {\n return `${wattFormatDate(input.start, format)} ― ${wattFormatDate(input.end, format)}`;\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 { Pipe, PipeTransform } from '@angular/core';\n\nimport { WattRange } from './watt-date-range';\nimport { formatStrings, wattFormatDate } from './watt-format-date';\n\n@Pipe({\n name: 'wattDate',\n})\nexport class WattDatePipe implements PipeTransform {\n /**\n * @param input WattDateRange or string in ISO 8601 format or unix timestamp number\n */\n transform(\n input?: WattRange<Date> | WattRange<string> | Date | string | number | null,\n format: keyof typeof formatStrings = 'short',\n timeZone = 'Europe/Copenhagen'\n ): string | null {\n return wattFormatDate(input, format, timeZone);\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 { computed, inject, Injectable, LOCALE_ID, signal } from '@angular/core';\nimport { DateAdapter } from '@angular/material/core';\n\nimport { WattDateAdapter, WattSupportedLocales } from './watt-date-adapter';\nimport { dayjs } from './dayjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class WattLocaleService {\n private readonly dateAdapter = inject<DateAdapter<unknown>>(DateAdapter);\n\n locale = signal(inject<WattSupportedLocales>(LOCALE_ID));\n isDanish = computed(() => this.locale() == 'da');\n isEnglish = computed(() => this.locale() == 'en');\n\n async setActiveLocale(locale: WattSupportedLocales): Promise<void> {\n if (locale === 'da') {\n await import('dayjs/locale/da');\n }\n\n if (locale === 'en') {\n await import('dayjs/locale/en');\n }\n\n dayjs.locale(locale);\n dayjs.updateLocale(locale, {\n weekStart: 1,\n });\n (this.dateAdapter as WattDateAdapter).setActiveLocale(locale);\n this.locale.set(locale);\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 { dayjs, __ngPackagrDayjsTypeScriptWorkaround } from './dayjs';\nexport { danishDatetimeProviders } from './watt-danish-datetime.providers';\nexport { WattDateAdapter, WattSupportedLocales } from './watt-date-adapter';\nexport { type WattRange, type WattDateRange, contains } from './watt-date-range';\nexport { WattDatePipe } from './watt-date.pipe';\nexport { wattFormatDate } from './watt-format-date';\nexport { WattLocaleService } from './watt-locale.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAgBA,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;AACjB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AACtB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AACtB,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC;AAC/B,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC;;ACrC1B;A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,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,IAAI,IAAI,+EAAC;AAChD,IAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,IAAI,IAAI,gFAAC;IAEjD,MAAM,eAAe,CAAC,MAA4B,EAAA;AAChD,QAAA,IAAI,MAAM,KAAK,IAAI,EAAE;AACnB,YAAA,MAAM,OAAO,iBAAiB,CAAC;QACjC;AAEA,QAAA,IAAI,MAAM,KAAK,IAAI,EAAE;AACnB,YAAA,MAAM,OAAO,iBAAiB,CAAC;QACjC;AAEA,QAAA,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;AACpB,QAAA,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE;AACzB,YAAA,SAAS,EAAE,CAAC;AACb,SAAA,CAAC;AACD,QAAA,IAAI,CAAC,WAA+B,CAAC,eAAe,CAAC,MAAM,CAAC;AAC7D,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;IACzB;uGAtBW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAjB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,cAFhB,MAAM,EAAA,CAAA;;2FAEP,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAH7B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AC1BD;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -5,12 +5,13 @@ import { MatInputModule } from '@angular/material/input';
|
|
|
5
5
|
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
6
6
|
import { NgControl } from '@angular/forms';
|
|
7
7
|
import * as i2 from '@angular/material/datepicker';
|
|
8
|
-
import { MatEndDate, MatStartDate, MatDateRangeInput, MatDatepickerInput, MatDateRangePicker, MatDatepickerModule } from '@angular/material/datepicker';
|
|
8
|
+
import { MatEndDate, MatStartDate, MatDateRangeInput, MatDatepickerInput, MatDateRangePicker, MatDatepickerModule, DateRange, MAT_DATE_RANGE_SELECTION_STRATEGY } from '@angular/material/datepicker';
|
|
9
9
|
import { maskitoDateOptionsGenerator, maskitoDateRangeOptionsGenerator } from '@maskito/kit';
|
|
10
10
|
import { WattLocaleService, dayjs } from '@energinet/watt/core/date';
|
|
11
11
|
import { WattFieldComponent } from '@energinet/watt/field';
|
|
12
12
|
import { WattButtonComponent } from '@energinet/watt/button';
|
|
13
13
|
import { WattPickerBase, WattPlaceholderMaskComponent } from '@energinet/watt/picker/__shared';
|
|
14
|
+
import { DateAdapter } from '@angular/material/core';
|
|
14
15
|
|
|
15
16
|
//#region License
|
|
16
17
|
/**
|
|
@@ -329,6 +330,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
|
|
|
329
330
|
args: [{ providedIn: 'root' }]
|
|
330
331
|
}] });
|
|
331
332
|
|
|
333
|
+
//#region License
|
|
334
|
+
/**
|
|
335
|
+
* @license
|
|
336
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
337
|
+
*
|
|
338
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
339
|
+
* you may not use this file except in compliance with the License.
|
|
340
|
+
* You may obtain a copy of the License at
|
|
341
|
+
*
|
|
342
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
343
|
+
*
|
|
344
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
345
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
346
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
347
|
+
* See the License for the specific language governing permissions and
|
|
348
|
+
* limitations under the License.
|
|
349
|
+
*/
|
|
350
|
+
//#endregion
|
|
351
|
+
class WattOneWeekRangeSelectionStrategy {
|
|
352
|
+
_dateAdapter = inject((DateAdapter));
|
|
353
|
+
selectionFinished(date) {
|
|
354
|
+
return this._createFullWeekRange(date);
|
|
355
|
+
}
|
|
356
|
+
createPreview(activeDate) {
|
|
357
|
+
return this._createFullWeekRange(activeDate);
|
|
358
|
+
}
|
|
359
|
+
_createFullWeekRange(date) {
|
|
360
|
+
if (date && date instanceof Date) {
|
|
361
|
+
const dayjsDate = dayjs(date);
|
|
362
|
+
const startOfWeek = dayjsDate.startOf('week');
|
|
363
|
+
const endOfWeek = dayjsDate.endOf('week');
|
|
364
|
+
const daysToStartOfWeek = startOfWeek.diff(dayjsDate, 'day');
|
|
365
|
+
const daysToEndOfWeek = endOfWeek.diff(dayjsDate, 'day');
|
|
366
|
+
const start = this._dateAdapter.addCalendarDays(date, daysToStartOfWeek);
|
|
367
|
+
const end = this._dateAdapter.addCalendarDays(date, daysToEndOfWeek);
|
|
368
|
+
return new DateRange(start, end);
|
|
369
|
+
}
|
|
370
|
+
return new DateRange(null, null);
|
|
371
|
+
}
|
|
372
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: WattOneWeekRangeSelectionStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
373
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: WattOneWeekRangeSelectionStrategy });
|
|
374
|
+
}
|
|
375
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: WattOneWeekRangeSelectionStrategy, decorators: [{
|
|
376
|
+
type: Injectable
|
|
377
|
+
}] });
|
|
378
|
+
function wattProvideOneWeekRangeSelectionStrategy() {
|
|
379
|
+
return {
|
|
380
|
+
provide: MAT_DATE_RANGE_SELECTION_STRATEGY,
|
|
381
|
+
useClass: WattOneWeekRangeSelectionStrategy,
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
|
|
332
385
|
//#region License
|
|
333
386
|
/**
|
|
334
387
|
* @license
|
|
@@ -352,5 +405,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
|
|
|
352
405
|
* Generated bundle index. Do not edit.
|
|
353
406
|
*/
|
|
354
407
|
|
|
355
|
-
export { WattDatepickerComponent, WattDatepickerIntlService, danishTimeZoneIdentifier };
|
|
408
|
+
export { WattDatepickerComponent, WattDatepickerIntlService, danishTimeZoneIdentifier, wattProvideOneWeekRangeSelectionStrategy };
|
|
356
409
|
//# sourceMappingURL=energinet-watt-picker-datepicker.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-picker-datepicker.mjs","sources":["../../../libs/watt/package/picker/datepicker/watt-datepicker.component.ts","../../../libs/watt/package/picker/datepicker/watt-datepicker.component.html","../../../libs/watt/package/picker/datepicker/watt-datepicker-intl.service.ts","../../../libs/watt/package/picker/datepicker/index.ts","../../../libs/watt/package/picker/datepicker/energinet-watt-picker-datepicker.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 {\n input,\n signal,\n effect,\n inject,\n computed,\n Component,\n viewChild,\n ElementRef,\n linkedSignal,\n AfterViewInit,\n booleanAttribute,\n ChangeDetectorRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { MatInputModule } from '@angular/material/input';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { AbstractControl, NgControl, Validator } from '@angular/forms';\n\nimport {\n MatEndDate,\n MatStartDate,\n MatDateRangeInput,\n MatDateRangePicker,\n MatDatepickerInput,\n MatDatepickerModule,\n MatCalendarCellClassFunction,\n} from '@angular/material/datepicker';\n\nimport { maskitoDateOptionsGenerator, maskitoDateRangeOptionsGenerator } from '@maskito/kit';\n\nimport {\n dayjs,\n WattRange,\n WattDateRange,\n WattLocaleService,\n WattSupportedLocales,\n} from '@energinet/watt/core/date';\n\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattButtonComponent } from '@energinet/watt/button';\n\nimport {\n WattPickerBase,\n WattPickerValue,\n WattPlaceholderMaskComponent,\n} from '@energinet/watt/picker/__shared';\n\nconst dateShortFormat = 'DD-MM-YYYY';\nexport const danishTimeZoneIdentifier = 'Europe/Copenhagen';\n\n/**\n * Usage:\n * `import { WattDatepickerComponent } from '@energinet/watt/datepicker';`\n *\n * IMPORTANT:\n * The styling is calculated based on our monospaced font.\n */\n@Component({\n selector: 'watt-datepicker',\n templateUrl: './watt-datepicker.component.html',\n styleUrls: ['./watt-datepicker.component.scss'],\n providers: [{ provide: MatFormFieldControl, useExisting: WattDatepickerComponent }],\n encapsulation: ViewEncapsulation.None,\n imports: [\n MatInputModule,\n MatDatepickerModule,\n\n WattFieldComponent,\n WattButtonComponent,\n WattPlaceholderMaskComponent,\n ],\n})\nexport class WattDatepickerComponent extends WattPickerBase implements Validator, AfterViewInit {\n protected override elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n protected override changeDetectionRef = inject(ChangeDetectorRef);\n protected override ngControl = inject(NgControl, { optional: true, self: true });\n private localeService = inject(WattLocaleService);\n\n max = input<Date>();\n min = input<Date>();\n label = input<string>('');\n rangeMonthOnlyMode = input(false);\n startAt = input<Date | null>(null);\n dateClass = input<MatCalendarCellClassFunction<Date>>(() => '');\n dateFilter = input<((date: Date | null) => boolean) | undefined>();\n canStepThroughDays = input(false, { transform: booleanAttribute });\n\n matEndDate = viewChild<MatEndDate<Date | null>>(MatEndDate);\n matStartDate = viewChild<MatStartDate<Date | null>>(MatStartDate);\n matDateRangeInput = viewChild<MatDateRangeInput<Date | null>>(MatDateRangeInput);\n matDatepickerInput = viewChild<MatDatepickerInput<Date | null>>(MatDatepickerInput);\n matDateRangePicker = viewChild<MatDateRangePicker<Date | null>>(MatDateRangePicker);\n\n actualInput = viewChild<ElementRef<HTMLInputElement>>('actualInput');\n override input = viewChild<ElementRef<HTMLInputElement>>('dateInput');\n override endInput = viewChild<ElementRef<HTMLInputElement>>('endDateInput');\n override startInput = viewChild<ElementRef<HTMLInputElement>>('startDateInput');\n\n rangeSeparator = ' - ';\n\n rangePlaceholder = signal('');\n\n inputMask = computed(() =>\n maskitoDateOptionsGenerator({\n mode: 'dd/mm/yyyy',\n separator: '-',\n max: this.max(),\n min: this.min(),\n })\n );\n\n rangeInputMask = computed(() =>\n maskitoDateRangeOptionsGenerator({\n mode: 'dd/mm/yyyy',\n dateSeparator: '-',\n max: this.max(),\n min: this.min(),\n })\n );\n\n getPlaceholderByLocale = (locale: WattSupportedLocales) =>\n locale === 'da' ? 'dd-mm-åååå' : 'dd-mm-yyyy';\n\n getRangePlaceholder(): string {\n return this.placeholder() + this.rangeSeparator + this.placeholder();\n }\n\n isPrevDayButtonDisabled = linkedSignal(() => this.isPrevDayBeforeOrEqualToMinDate());\n isNextDayButtonDisabled = linkedSignal(() => this.isNextDayAfterOrEqualToMaxDate());\n\n constructor() {\n super(`watt-datepicker-${WattDatepickerComponent.nextId++}`);\n\n effect(() => {\n const locale = this.localeService.locale();\n this.placeholder.set(this.getPlaceholderByLocale(locale));\n this.rangePlaceholder.set(this.getRangePlaceholder());\n });\n\n effect(() => {\n this.rangeMonthOnlyMode();\n this.ngControl?.control?.updateValueAndValidity();\n });\n }\n\n override ngAfterViewInit(): void {\n super.ngAfterViewInit();\n this.ngControl?.control?.addValidators(this.validate);\n }\n\n validate = ({ value }: AbstractControl<WattRange<string>>) => {\n if (!value?.end || !value?.start) return null;\n if (!this.rangeMonthOnlyMode()) return null;\n const start = dayjs(value.start);\n const end = dayjs(value.end);\n return start.isSame(start.startOf('month')) && end.isSame(start.endOf('month'))\n ? null\n : { monthOnly: true };\n };\n\n protected initSingleInput() {\n const matDatepickerInput = this.matDatepickerInput();\n if (this.initialValue && matDatepickerInput) {\n matDatepickerInput.value = this.initialValue;\n this.datepickerClosed();\n }\n }\n\n inputChanged(value: string) {\n const dateString = value.slice(0, this.placeholder().length);\n\n if (dateString.length === 0) {\n this.control?.setValue(null);\n return;\n }\n\n if (dateString.length !== this.placeholder().length) {\n return;\n }\n\n const date = this.parseDateShortFormat(dateString);\n this.control?.setValue(this.formatDateFromViewToModel(date));\n }\n\n datepickerClosed() {\n const matDatepickerInput = this.matDatepickerInput();\n const actualInput = this.actualInput();\n\n if (!actualInput) return;\n\n if (matDatepickerInput && matDatepickerInput.value) {\n this.control?.setValue(matDatepickerInput.value);\n\n actualInput.nativeElement.value = this.formatDateTimeFromModelToView(\n this.formatDateFromViewToModel(matDatepickerInput.value)\n );\n } else {\n actualInput.nativeElement.value = '';\n this.control?.setValue(null);\n }\n\n this.isPrevDayButtonDisabled.set(this.isPrevDayBeforeOrEqualToMinDate());\n this.isNextDayButtonDisabled.set(this.isNextDayAfterOrEqualToMaxDate());\n\n actualInput.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n onMonthSelected(date: Date) {\n const matDateRangePicker = this.matDateRangePicker();\n if (matDateRangePicker && this.rangeMonthOnlyMode() && date) {\n matDateRangePicker.select(dayjs(date).startOf('month').toDate());\n matDateRangePicker.select(dayjs(date).endOf('month').toDate());\n matDateRangePicker.close();\n }\n }\n\n protected initRangeInput() {\n const matStartDate = this.matStartDate();\n const matEndDate = this.matEndDate();\n\n if (this.initialValue && matStartDate && matEndDate) {\n matStartDate.value = (this.initialValue as WattDateRange).start;\n matEndDate.value = (this.initialValue as WattDateRange).end;\n this.rangePickerClosed();\n }\n }\n\n clearRangePicker() {\n const actualInput = this.actualInput();\n\n if (!actualInput) return;\n\n this.control?.setValue(null);\n actualInput.nativeElement.value = '';\n actualInput.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n rangeInputChanged(value: string) {\n const startDateString = value.slice(0, this.placeholder().length);\n\n if (startDateString.length === 0) {\n this.control?.setValue(null);\n return;\n }\n\n if (startDateString.length !== this.placeholder().length) {\n return;\n }\n\n const start = this.parseDateShortFormat(startDateString);\n const endDateString = value.slice(this.placeholder().length + this.rangeSeparator.length);\n let end = this.setEndDateToDanishTimeZone(endDateString);\n\n if (end !== null) {\n end = this.setToEndOfDay(end);\n this.control?.setValue({ start, end });\n }\n }\n\n rangePickerClosed() {\n const matDateRangeInput = this.matDateRangeInput();\n const actualInput = this.actualInput();\n\n if (!actualInput) return;\n\n if (matDateRangeInput?.value?.start && matDateRangeInput?.value?.end) {\n actualInput.nativeElement.value =\n this.formatDateTimeFromModelToView(\n this.formatDateFromViewToModel(matDateRangeInput.value?.start)\n ) +\n '-' +\n this.formatDateTimeFromModelToView(\n this.formatDateFromViewToModel(matDateRangeInput.value.end)\n );\n\n this.control?.setValue({\n start: this.formatDateFromViewToModel(matDateRangeInput.value.start),\n end: this.formatDateFromViewToModel(matDateRangeInput.value.end),\n });\n } else {\n actualInput.nativeElement.value = '';\n this.control?.setValue(null);\n }\n\n actualInput.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n protected setSingleValue(\n value: Exclude<WattPickerValue, WattDateRange>,\n input: HTMLInputElement\n ) {\n const matDatepickerInput = this.matDatepickerInput();\n if (matDatepickerInput) {\n this.setValueToInput(value, input, matDatepickerInput);\n }\n }\n\n protected setRangeValue(\n value: WattDateRange | null,\n startInput: HTMLInputElement,\n endInput: HTMLInputElement\n ) {\n const { start, end } = value ?? {};\n\n const matStartDate = this.matStartDate();\n const matEndDate = this.matEndDate();\n\n if (!matStartDate || !matEndDate) return;\n\n this.setValueToInput(start, startInput, matStartDate);\n this.setValueToInput(end, endInput, matEndDate);\n }\n\n prevDay() {\n this.changeDay(-1);\n }\n\n nextDay() {\n this.changeDay(1);\n }\n\n private changeDay(value: number) {\n const currentDate = this.matDatepickerInput()?.value;\n\n if (currentDate) {\n const newDate = dayjs(currentDate).add(value, 'day').toISOString();\n const newDateFormatted = this.formatDateTimeFromModelToView(newDate);\n\n this.inputChanged(newDateFormatted);\n this.datepickerClosed();\n }\n }\n\n private isPrevDayBeforeOrEqualToMinDate() {\n const min = this.min();\n const selectedDate = this.matDatepickerInput()?.value;\n\n if (!min || !selectedDate) return false;\n\n const isBefore = dayjs(selectedDate).isBefore(min, 'day');\n const isSame = dayjs(selectedDate).isSame(min, 'day');\n\n return isSame || isBefore;\n }\n\n private isNextDayAfterOrEqualToMaxDate() {\n const max = this.max();\n const selectedDate = this.matDatepickerInput()?.value;\n\n if (!max || !selectedDate) return false;\n\n const isAfter = dayjs(selectedDate).isAfter(max, 'day');\n const isSame = dayjs(selectedDate).isSame(max, 'day');\n\n return isSame || isAfter;\n }\n\n private parseDateShortFormat(value: string): Date {\n return dayjs(value, dateShortFormat).toDate();\n }\n\n private setValueToInput<D extends { value: Date | null }>(\n value: string | null | undefined,\n nativeInput: HTMLInputElement,\n matDateInput: D\n ): void {\n nativeInput.value = value ? this.formatDateTimeFromModelToView(value) : '';\n matDateInput.value = value ? dayjs(value).utc().toDate() : null;\n }\n\n /**\n * @ignore\n * Formats Date to full ISO 8601 format (e.g. `2022-08-31T22:00:00.000Z`)\n */\n private formatDateFromViewToModel(value: Date): string {\n return dayjs(value).utc().toISOString();\n }\n\n private formatDateTimeFromModelToView(value: string): string {\n return dayjs(value).tz(danishTimeZoneIdentifier).format(dateShortFormat);\n }\n\n private toDanishTimeZone(value: Date): Date {\n return dayjs(value.toISOString()).tz(danishTimeZoneIdentifier).toDate();\n }\n\n private setToEndOfDay(value: Date): Date {\n return dayjs(value).endOf('day').toDate();\n }\n\n private setEndDateToDanishTimeZone(value: string): Date | null {\n const dateBasedOnShortFormat = this.parseDateShortFormat(value);\n\n let maybeDateInDanishTimeZone: Date | null = null;\n\n if (dayjs(dateBasedOnShortFormat).isValid()) {\n maybeDateInDanishTimeZone = this.toDanishTimeZone(dateBasedOnShortFormat);\n }\n\n return maybeDateInDanishTimeZone;\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<watt-field [control]=\"control\" [label]=\"label()\">\n @if (range()) {\n <mat-date-range-input\n [disabled]=\"disabled()\"\n [rangePicker]=\"rangeDatepicker\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <input\n inert\n aria-label=\"start-date-input\"\n matStartDate\n #startDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n\n <input\n inert\n aria-label=\"end-date-input\"\n matEndDate\n #endDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n </mat-date-range-input>\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"rangeInputMask()\"\n [placeholder]=\"rangePlaceholder()\"\n (maskApplied)=\"rangeInputChanged($event)\"\n />\n\n <watt-button\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled()\"\n [attr.aria-pressed]=\"false\"\n (click)=\"rangeDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-date-range-picker\n [panelClass]=\"rangeMonthOnlyMode() ? 'watt-datepicker-range__panel--month-only' : ''\"\n [startView]=\"rangeMonthOnlyMode() ? 'multi-year' : 'month'\"\n [startAt]=\"startAt()\"\n (monthSelected)=\"onMonthSelected($event)\"\n (closed)=\"rangePickerClosed()\"\n #rangeDatepicker\n />\n } @else {\n <input\n inert\n matInput\n tabindex=\"-1\"\n aria-label=\"date-input\"\n #dateInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n [disabled]=\"disabled()\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n [matDatepicker]=\"singleDatepicker\"\n [matDatepickerFilter]=\"dateFilter()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"inputMask()\"\n [placeholder]=\"placeholder()\"\n (maskApplied)=\"inputChanged($event)\"\n />\n\n <watt-button\n wattSuffix\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled()\"\n (click)=\"singleDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-datepicker\n #singleDatepicker\n panelClass=\"watt-datepicker-single__panel\"\n [dateClass]=\"dateClass()\"\n [startAt]=\"startAt()\"\n (closed)=\"datepickerClosed()\"\n />\n }\n\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n <ng-content ngProjectAs=\"watt-field-warning\" select=\"watt-field-warning\" />\n</watt-field>\n\n@if (!range() && canStepThroughDays()) {\n <span\n class=\"watt-datepicker-single__step-through\"\n [class.watt-datepicker-single__has-label]=\"!!label()\"\n >\n <watt-button\n variant=\"icon\"\n icon=\"left\"\n (click)=\"prevDay()\"\n [disabled]=\"disabled() || isPrevDayButtonDisabled()\"\n />\n <watt-button\n variant=\"icon\"\n icon=\"right\"\n (click)=\"nextDay()\"\n [disabled]=\"disabled() || isNextDayButtonDisabled()\"\n />\n </span>\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 { Injectable } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class WattDatepickerIntlService {\n clear = 'Clear';\n select = 'OK';\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 { WattDatepickerComponent } from './watt-datepicker.component';\nexport { danishTimeZoneIdentifier } from './watt-datepicker.component';\nexport { WattDatepickerIntlService } from './watt-datepicker-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAkDA,MAAM,eAAe,GAAG,YAAY;AAC7B,MAAM,wBAAwB,GAAG;AAExC;;;;;;AAMG;AAgBG,MAAO,uBAAwB,SAAQ,cAAc,CAAA;AACtC,IAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,IAA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,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAE5B,aAAa,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CACV,WAAW,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CACR,cAAc,oEACZ,gBAAgB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEpHhF;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAIa,yBAAyB,CAAA;IACpC,KAAK,GAAG,OAAO;IACf,MAAM,GAAG,IAAI;uGAFF,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cADZ,MAAM,EAAA,CAAA;;2FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACpBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-picker-datepicker.mjs","sources":["../../../libs/watt/package/picker/datepicker/watt-datepicker.component.ts","../../../libs/watt/package/picker/datepicker/watt-datepicker.component.html","../../../libs/watt/package/picker/datepicker/watt-datepicker-intl.service.ts","../../../libs/watt/package/picker/datepicker/watt-one-week-selection-strategy.ts","../../../libs/watt/package/picker/datepicker/index.ts","../../../libs/watt/package/picker/datepicker/energinet-watt-picker-datepicker.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 {\n input,\n signal,\n effect,\n inject,\n computed,\n Component,\n viewChild,\n ElementRef,\n linkedSignal,\n AfterViewInit,\n booleanAttribute,\n ChangeDetectorRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { MatInputModule } from '@angular/material/input';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { AbstractControl, NgControl, Validator } from '@angular/forms';\n\nimport {\n MatEndDate,\n MatStartDate,\n MatDateRangeInput,\n MatDateRangePicker,\n MatDatepickerInput,\n MatDatepickerModule,\n MatCalendarCellClassFunction,\n} from '@angular/material/datepicker';\n\nimport { maskitoDateOptionsGenerator, maskitoDateRangeOptionsGenerator } from '@maskito/kit';\n\nimport {\n dayjs,\n WattRange,\n WattDateRange,\n WattLocaleService,\n WattSupportedLocales,\n} from '@energinet/watt/core/date';\n\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattButtonComponent } from '@energinet/watt/button';\n\nimport {\n WattPickerBase,\n WattPickerValue,\n WattPlaceholderMaskComponent,\n} from '@energinet/watt/picker/__shared';\n\nconst dateShortFormat = 'DD-MM-YYYY';\nexport const danishTimeZoneIdentifier = 'Europe/Copenhagen';\n\n/**\n * Usage:\n * `import { WattDatepickerComponent } from '@energinet/watt/datepicker';`\n *\n * IMPORTANT:\n * The styling is calculated based on our monospaced font.\n */\n@Component({\n selector: 'watt-datepicker',\n templateUrl: './watt-datepicker.component.html',\n styleUrls: ['./watt-datepicker.component.scss'],\n providers: [{ provide: MatFormFieldControl, useExisting: WattDatepickerComponent }],\n encapsulation: ViewEncapsulation.None,\n imports: [\n MatInputModule,\n MatDatepickerModule,\n\n WattFieldComponent,\n WattButtonComponent,\n WattPlaceholderMaskComponent,\n ],\n})\nexport class WattDatepickerComponent extends WattPickerBase implements Validator, AfterViewInit {\n protected override elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n protected override changeDetectionRef = inject(ChangeDetectorRef);\n protected override ngControl = inject(NgControl, { optional: true, self: true });\n private localeService = inject(WattLocaleService);\n\n max = input<Date>();\n min = input<Date>();\n label = input<string>('');\n rangeMonthOnlyMode = input(false);\n startAt = input<Date | null>(null);\n dateClass = input<MatCalendarCellClassFunction<Date>>(() => '');\n dateFilter = input<((date: Date | null) => boolean) | undefined>();\n canStepThroughDays = input(false, { transform: booleanAttribute });\n\n matEndDate = viewChild<MatEndDate<Date | null>>(MatEndDate);\n matStartDate = viewChild<MatStartDate<Date | null>>(MatStartDate);\n matDateRangeInput = viewChild<MatDateRangeInput<Date | null>>(MatDateRangeInput);\n matDatepickerInput = viewChild<MatDatepickerInput<Date | null>>(MatDatepickerInput);\n matDateRangePicker = viewChild<MatDateRangePicker<Date | null>>(MatDateRangePicker);\n\n actualInput = viewChild<ElementRef<HTMLInputElement>>('actualInput');\n override input = viewChild<ElementRef<HTMLInputElement>>('dateInput');\n override endInput = viewChild<ElementRef<HTMLInputElement>>('endDateInput');\n override startInput = viewChild<ElementRef<HTMLInputElement>>('startDateInput');\n\n rangeSeparator = ' - ';\n\n rangePlaceholder = signal('');\n\n inputMask = computed(() =>\n maskitoDateOptionsGenerator({\n mode: 'dd/mm/yyyy',\n separator: '-',\n max: this.max(),\n min: this.min(),\n })\n );\n\n rangeInputMask = computed(() =>\n maskitoDateRangeOptionsGenerator({\n mode: 'dd/mm/yyyy',\n dateSeparator: '-',\n max: this.max(),\n min: this.min(),\n })\n );\n\n getPlaceholderByLocale = (locale: WattSupportedLocales) =>\n locale === 'da' ? 'dd-mm-åååå' : 'dd-mm-yyyy';\n\n getRangePlaceholder(): string {\n return this.placeholder() + this.rangeSeparator + this.placeholder();\n }\n\n isPrevDayButtonDisabled = linkedSignal(() => this.isPrevDayBeforeOrEqualToMinDate());\n isNextDayButtonDisabled = linkedSignal(() => this.isNextDayAfterOrEqualToMaxDate());\n\n constructor() {\n super(`watt-datepicker-${WattDatepickerComponent.nextId++}`);\n\n effect(() => {\n const locale = this.localeService.locale();\n this.placeholder.set(this.getPlaceholderByLocale(locale));\n this.rangePlaceholder.set(this.getRangePlaceholder());\n });\n\n effect(() => {\n this.rangeMonthOnlyMode();\n this.ngControl?.control?.updateValueAndValidity();\n });\n }\n\n override ngAfterViewInit(): void {\n super.ngAfterViewInit();\n this.ngControl?.control?.addValidators(this.validate);\n }\n\n validate = ({ value }: AbstractControl<WattRange<string>>) => {\n if (!value?.end || !value?.start) return null;\n if (!this.rangeMonthOnlyMode()) return null;\n const start = dayjs(value.start);\n const end = dayjs(value.end);\n return start.isSame(start.startOf('month')) && end.isSame(start.endOf('month'))\n ? null\n : { monthOnly: true };\n };\n\n protected initSingleInput() {\n const matDatepickerInput = this.matDatepickerInput();\n if (this.initialValue && matDatepickerInput) {\n matDatepickerInput.value = this.initialValue;\n this.datepickerClosed();\n }\n }\n\n inputChanged(value: string) {\n const dateString = value.slice(0, this.placeholder().length);\n\n if (dateString.length === 0) {\n this.control?.setValue(null);\n return;\n }\n\n if (dateString.length !== this.placeholder().length) {\n return;\n }\n\n const date = this.parseDateShortFormat(dateString);\n this.control?.setValue(this.formatDateFromViewToModel(date));\n }\n\n datepickerClosed() {\n const matDatepickerInput = this.matDatepickerInput();\n const actualInput = this.actualInput();\n\n if (!actualInput) return;\n\n if (matDatepickerInput && matDatepickerInput.value) {\n this.control?.setValue(matDatepickerInput.value);\n\n actualInput.nativeElement.value = this.formatDateTimeFromModelToView(\n this.formatDateFromViewToModel(matDatepickerInput.value)\n );\n } else {\n actualInput.nativeElement.value = '';\n this.control?.setValue(null);\n }\n\n this.isPrevDayButtonDisabled.set(this.isPrevDayBeforeOrEqualToMinDate());\n this.isNextDayButtonDisabled.set(this.isNextDayAfterOrEqualToMaxDate());\n\n actualInput.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n onMonthSelected(date: Date) {\n const matDateRangePicker = this.matDateRangePicker();\n if (matDateRangePicker && this.rangeMonthOnlyMode() && date) {\n matDateRangePicker.select(dayjs(date).startOf('month').toDate());\n matDateRangePicker.select(dayjs(date).endOf('month').toDate());\n matDateRangePicker.close();\n }\n }\n\n protected initRangeInput() {\n const matStartDate = this.matStartDate();\n const matEndDate = this.matEndDate();\n\n if (this.initialValue && matStartDate && matEndDate) {\n matStartDate.value = (this.initialValue as WattDateRange).start;\n matEndDate.value = (this.initialValue as WattDateRange).end;\n this.rangePickerClosed();\n }\n }\n\n clearRangePicker() {\n const actualInput = this.actualInput();\n\n if (!actualInput) return;\n\n this.control?.setValue(null);\n actualInput.nativeElement.value = '';\n actualInput.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n rangeInputChanged(value: string) {\n const startDateString = value.slice(0, this.placeholder().length);\n\n if (startDateString.length === 0) {\n this.control?.setValue(null);\n return;\n }\n\n if (startDateString.length !== this.placeholder().length) {\n return;\n }\n\n const start = this.parseDateShortFormat(startDateString);\n const endDateString = value.slice(this.placeholder().length + this.rangeSeparator.length);\n let end = this.setEndDateToDanishTimeZone(endDateString);\n\n if (end !== null) {\n end = this.setToEndOfDay(end);\n this.control?.setValue({ start, end });\n }\n }\n\n rangePickerClosed() {\n const matDateRangeInput = this.matDateRangeInput();\n const actualInput = this.actualInput();\n\n if (!actualInput) return;\n\n if (matDateRangeInput?.value?.start && matDateRangeInput?.value?.end) {\n actualInput.nativeElement.value =\n this.formatDateTimeFromModelToView(\n this.formatDateFromViewToModel(matDateRangeInput.value?.start)\n ) +\n '-' +\n this.formatDateTimeFromModelToView(\n this.formatDateFromViewToModel(matDateRangeInput.value.end)\n );\n\n this.control?.setValue({\n start: this.formatDateFromViewToModel(matDateRangeInput.value.start),\n end: this.formatDateFromViewToModel(matDateRangeInput.value.end),\n });\n } else {\n actualInput.nativeElement.value = '';\n this.control?.setValue(null);\n }\n\n actualInput.nativeElement.dispatchEvent(new InputEvent('input'));\n }\n\n protected setSingleValue(\n value: Exclude<WattPickerValue, WattDateRange>,\n input: HTMLInputElement\n ) {\n const matDatepickerInput = this.matDatepickerInput();\n if (matDatepickerInput) {\n this.setValueToInput(value, input, matDatepickerInput);\n }\n }\n\n protected setRangeValue(\n value: WattDateRange | null,\n startInput: HTMLInputElement,\n endInput: HTMLInputElement\n ) {\n const { start, end } = value ?? {};\n\n const matStartDate = this.matStartDate();\n const matEndDate = this.matEndDate();\n\n if (!matStartDate || !matEndDate) return;\n\n this.setValueToInput(start, startInput, matStartDate);\n this.setValueToInput(end, endInput, matEndDate);\n }\n\n prevDay() {\n this.changeDay(-1);\n }\n\n nextDay() {\n this.changeDay(1);\n }\n\n private changeDay(value: number) {\n const currentDate = this.matDatepickerInput()?.value;\n\n if (currentDate) {\n const newDate = dayjs(currentDate).add(value, 'day').toISOString();\n const newDateFormatted = this.formatDateTimeFromModelToView(newDate);\n\n this.inputChanged(newDateFormatted);\n this.datepickerClosed();\n }\n }\n\n private isPrevDayBeforeOrEqualToMinDate() {\n const min = this.min();\n const selectedDate = this.matDatepickerInput()?.value;\n\n if (!min || !selectedDate) return false;\n\n const isBefore = dayjs(selectedDate).isBefore(min, 'day');\n const isSame = dayjs(selectedDate).isSame(min, 'day');\n\n return isSame || isBefore;\n }\n\n private isNextDayAfterOrEqualToMaxDate() {\n const max = this.max();\n const selectedDate = this.matDatepickerInput()?.value;\n\n if (!max || !selectedDate) return false;\n\n const isAfter = dayjs(selectedDate).isAfter(max, 'day');\n const isSame = dayjs(selectedDate).isSame(max, 'day');\n\n return isSame || isAfter;\n }\n\n private parseDateShortFormat(value: string): Date {\n return dayjs(value, dateShortFormat).toDate();\n }\n\n private setValueToInput<D extends { value: Date | null }>(\n value: string | null | undefined,\n nativeInput: HTMLInputElement,\n matDateInput: D\n ): void {\n nativeInput.value = value ? this.formatDateTimeFromModelToView(value) : '';\n matDateInput.value = value ? dayjs(value).utc().toDate() : null;\n }\n\n /**\n * @ignore\n * Formats Date to full ISO 8601 format (e.g. `2022-08-31T22:00:00.000Z`)\n */\n private formatDateFromViewToModel(value: Date): string {\n return dayjs(value).utc().toISOString();\n }\n\n private formatDateTimeFromModelToView(value: string): string {\n return dayjs(value).tz(danishTimeZoneIdentifier).format(dateShortFormat);\n }\n\n private toDanishTimeZone(value: Date): Date {\n return dayjs(value.toISOString()).tz(danishTimeZoneIdentifier).toDate();\n }\n\n private setToEndOfDay(value: Date): Date {\n return dayjs(value).endOf('day').toDate();\n }\n\n private setEndDateToDanishTimeZone(value: string): Date | null {\n const dateBasedOnShortFormat = this.parseDateShortFormat(value);\n\n let maybeDateInDanishTimeZone: Date | null = null;\n\n if (dayjs(dateBasedOnShortFormat).isValid()) {\n maybeDateInDanishTimeZone = this.toDanishTimeZone(dateBasedOnShortFormat);\n }\n\n return maybeDateInDanishTimeZone;\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<watt-field [control]=\"control\" [label]=\"label()\">\n @if (range()) {\n <mat-date-range-input\n [disabled]=\"disabled()\"\n [rangePicker]=\"rangeDatepicker\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n >\n <input\n inert\n aria-label=\"start-date-input\"\n matStartDate\n #startDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n\n <input\n inert\n aria-label=\"end-date-input\"\n matEndDate\n #endDateInput\n [readOnly]=\"rangeMonthOnlyMode()\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [hidden]=\"true\"\n />\n </mat-date-range-input>\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"rangeInputMask()\"\n [placeholder]=\"rangePlaceholder()\"\n (maskApplied)=\"rangeInputChanged($event)\"\n />\n\n <watt-button\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled()\"\n [attr.aria-pressed]=\"false\"\n (click)=\"rangeDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-date-range-picker\n [panelClass]=\"rangeMonthOnlyMode() ? 'watt-datepicker-range__panel--month-only' : ''\"\n [startView]=\"rangeMonthOnlyMode() ? 'multi-year' : 'month'\"\n [startAt]=\"startAt()\"\n (monthSelected)=\"onMonthSelected($event)\"\n (closed)=\"rangePickerClosed()\"\n #rangeDatepicker\n />\n } @else {\n <input\n inert\n matInput\n tabindex=\"-1\"\n aria-label=\"date-input\"\n #dateInput\n autocomplete=\"off\"\n spellcheck=\"false\"\n [disabled]=\"disabled()\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n [matDatepicker]=\"singleDatepicker\"\n [matDatepickerFilter]=\"dateFilter()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n <input #actualInput class=\"mask-input\" [disabled]=\"disabled()\" />\n <watt-placeholder-mask\n [primaryInputElement]=\"actualInput\"\n [mask]=\"inputMask()\"\n [placeholder]=\"placeholder()\"\n (maskApplied)=\"inputChanged($event)\"\n />\n\n <watt-button\n wattSuffix\n variant=\"icon\"\n icon=\"date\"\n [disabled]=\"disabled()\"\n (click)=\"singleDatepicker.open()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n />\n\n <mat-datepicker\n #singleDatepicker\n panelClass=\"watt-datepicker-single__panel\"\n [dateClass]=\"dateClass()\"\n [startAt]=\"startAt()\"\n (closed)=\"datepickerClosed()\"\n />\n }\n\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n <ng-content ngProjectAs=\"watt-field-warning\" select=\"watt-field-warning\" />\n</watt-field>\n\n@if (!range() && canStepThroughDays()) {\n <span\n class=\"watt-datepicker-single__step-through\"\n [class.watt-datepicker-single__has-label]=\"!!label()\"\n >\n <watt-button\n variant=\"icon\"\n icon=\"left\"\n (click)=\"prevDay()\"\n [disabled]=\"disabled() || isPrevDayButtonDisabled()\"\n />\n <watt-button\n variant=\"icon\"\n icon=\"right\"\n (click)=\"nextDay()\"\n [disabled]=\"disabled() || isNextDayButtonDisabled()\"\n />\n </span>\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 { Injectable } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class WattDatepickerIntlService {\n clear = 'Clear';\n select = 'OK';\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 { Injectable, inject } from '@angular/core';\nimport { DateAdapter } from '@angular/material/core';\nimport {\n MatDateRangeSelectionStrategy,\n DateRange,\n MAT_DATE_RANGE_SELECTION_STRATEGY,\n} from '@angular/material/datepicker';\n\nimport { dayjs } from '@energinet/watt/core/date';\n\n@Injectable()\nexport class WattOneWeekRangeSelectionStrategy<D> implements MatDateRangeSelectionStrategy<D> {\n private _dateAdapter = inject<DateAdapter<D>>(DateAdapter<D>);\n\n selectionFinished(date: D | null): DateRange<D> {\n return this._createFullWeekRange(date);\n }\n\n createPreview(activeDate: D | null): DateRange<D> {\n return this._createFullWeekRange(activeDate);\n }\n\n private _createFullWeekRange(date: D | null): DateRange<D> {\n if (date && date instanceof Date) {\n const dayjsDate: dayjs.Dayjs = dayjs(date);\n\n const startOfWeek = dayjsDate.startOf('week');\n const endOfWeek = dayjsDate.endOf('week');\n\n const daysToStartOfWeek = startOfWeek.diff(dayjsDate, 'day');\n const daysToEndOfWeek = endOfWeek.diff(dayjsDate, 'day');\n\n const start = this._dateAdapter.addCalendarDays(date, daysToStartOfWeek);\n const end = this._dateAdapter.addCalendarDays(date, daysToEndOfWeek);\n\n return new DateRange<D>(start, end);\n }\n\n return new DateRange<D>(null, null);\n }\n}\n\nexport function wattProvideOneWeekRangeSelectionStrategy() {\n return {\n provide: MAT_DATE_RANGE_SELECTION_STRATEGY,\n useClass: WattOneWeekRangeSelectionStrategy,\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 { WattDatepickerComponent } from './watt-datepicker.component';\nexport { danishTimeZoneIdentifier } from './watt-datepicker.component';\nexport { WattDatepickerIntlService } from './watt-datepicker-intl.service';\nexport { wattProvideOneWeekRangeSelectionStrategy } from './watt-one-week-selection-strategy';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAkDA,MAAM,eAAe,GAAG,YAAY;AAC7B,MAAM,wBAAwB,GAAG;AAExC;;;;;;AAMG;AAgBG,MAAO,uBAAwB,SAAQ,cAAc,CAAA;AACtC,IAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,IAAA,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC9C,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACxE,IAAA,aAAa,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAEjD,GAAG,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,KAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAQ;IACnB,GAAG,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,KAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAQ;AACnB,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AACzB,IAAA,kBAAkB,GAAG,KAAK,CAAC,KAAK,yFAAC;AACjC,IAAA,OAAO,GAAG,KAAK,CAAc,IAAI,8EAAC;IAClC,SAAS,GAAG,KAAK,CAAqC,MAAM,EAAE,gFAAC;IAC/D,UA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OAAO,IAAI,SAAS,CAAI,IAAI,EAAE,IAAI,CAAC;IACrC;uGA5BW,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAjC,iCAAiC,EAAA,CAAA;;2FAAjC,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAD7C;;SAgCe,wCAAwC,GAAA;IACtD,OAAO;AACL,QAAA,OAAO,EAAE,iCAAiC;AAC1C,QAAA,QAAQ,EAAE,iCAAiC;KAC5C;AACH;;ACjEA;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@ import utc from 'dayjs/plugin/utc';
|
|
|
2
2
|
import timezone from 'dayjs/plugin/timezone';
|
|
3
3
|
import duration from 'dayjs/plugin/duration';
|
|
4
4
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
5
|
+
import updateLocale from 'dayjs/plugin/updateLocale';
|
|
5
6
|
import * as i0 from '@angular/core';
|
|
6
7
|
import { PipeTransform } from '@angular/core';
|
|
7
8
|
import { NativeDateAdapter } from '@angular/material/core';
|
|
@@ -24,7 +25,7 @@ export { default as dayjs } from 'dayjs';
|
|
|
24
25
|
* limitations under the License.
|
|
25
26
|
*/
|
|
26
27
|
|
|
27
|
-
type __ngPackagrDayjsTypeScriptWorkaround = typeof utc | typeof timezone | typeof duration | typeof customParseFormat;
|
|
28
|
+
type __ngPackagrDayjsTypeScriptWorkaround = typeof utc | typeof timezone | typeof duration | typeof customParseFormat | typeof updateLocale;
|
|
28
29
|
|
|
29
30
|
declare const danishDatetimeProviders: i0.EnvironmentProviders;
|
|
30
31
|
|
|
@@ -2,7 +2,7 @@ import * as _maskito_core from '@maskito/core';
|
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
3
|
import { AfterViewInit, ElementRef, ChangeDetectorRef } from '@angular/core';
|
|
4
4
|
import { Validator, NgControl, AbstractControl } from '@angular/forms';
|
|
5
|
-
import { MatCalendarCellClassFunction, MatEndDate, MatStartDate, MatDateRangeInput, MatDatepickerInput, MatDateRangePicker } from '@angular/material/datepicker';
|
|
5
|
+
import { MatCalendarCellClassFunction, MatEndDate, MatStartDate, MatDateRangeInput, MatDatepickerInput, MatDateRangePicker, MatDateRangeSelectionStrategy, DateRange } from '@angular/material/datepicker';
|
|
6
6
|
import { WattSupportedLocales, WattRange, WattDateRange } from '@energinet/watt/core/date';
|
|
7
7
|
import { WattPickerBase, WattPickerValue } from '@energinet/watt/picker/__shared';
|
|
8
8
|
|
|
@@ -86,4 +86,17 @@ declare class WattDatepickerIntlService {
|
|
|
86
86
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<WattDatepickerIntlService>;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
declare class WattOneWeekRangeSelectionStrategy<D> implements MatDateRangeSelectionStrategy<D> {
|
|
90
|
+
private _dateAdapter;
|
|
91
|
+
selectionFinished(date: D | null): DateRange<D>;
|
|
92
|
+
createPreview(activeDate: D | null): DateRange<D>;
|
|
93
|
+
private _createFullWeekRange;
|
|
94
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WattOneWeekRangeSelectionStrategy<any>, never>;
|
|
95
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<WattOneWeekRangeSelectionStrategy<any>>;
|
|
96
|
+
}
|
|
97
|
+
declare function wattProvideOneWeekRangeSelectionStrategy(): {
|
|
98
|
+
provide: _angular_core.InjectionToken<MatDateRangeSelectionStrategy<any>>;
|
|
99
|
+
useClass: typeof WattOneWeekRangeSelectionStrategy;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export { WattDatepickerComponent, WattDatepickerIntlService, danishTimeZoneIdentifier, wattProvideOneWeekRangeSelectionStrategy };
|