@xxmachina/components 19.51.0 → 19.81.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/xxmachina-components-extras-flow.mjs +73 -140
- package/fesm2022/xxmachina-components-extras-flow.mjs.map +1 -1
- package/fesm2022/xxmachina-components-features-query.mjs +3 -29
- package/fesm2022/xxmachina-components-features-query.mjs.map +1 -1
- package/fesm2022/xxmachina-components-groups-query-form.mjs +0 -54
- package/fesm2022/xxmachina-components-groups-query-form.mjs.map +1 -1
- package/fesm2022/xxmachina-components-molecules-inline-edit-field.mjs +0 -1
- package/fesm2022/xxmachina-components-molecules-inline-edit-field.mjs.map +1 -1
- package/fesm2022/xxmachina-components-molecules-user-avatar-menu.mjs +96 -0
- package/fesm2022/xxmachina-components-molecules-user-avatar-menu.mjs.map +1 -0
- package/fesm2022/xxmachina-components-molecules-weekly-header.mjs +2 -2
- package/fesm2022/xxmachina-components-molecules-workspace-selector.mjs +123 -0
- package/fesm2022/xxmachina-components-molecules-workspace-selector.mjs.map +1 -0
- package/fesm2022/xxmachina-components-organisms-calendar-section.mjs +2 -2
- package/fesm2022/xxmachina-components-organisms-calendar-section.mjs.map +1 -1
- package/fesm2022/xxmachina-components-organisms-event-input-section.mjs +0 -1
- package/fesm2022/xxmachina-components-organisms-event-input-section.mjs.map +1 -1
- package/fesm2022/xxmachina-components-organisms-terminal-input-section.mjs +2 -18
- package/fesm2022/xxmachina-components-organisms-terminal-input-section.mjs.map +1 -1
- package/fesm2022/xxmachina-components-organisms-video-trimmer-section.mjs +0 -3
- package/fesm2022/xxmachina-components-organisms-video-trimmer-section.mjs.map +1 -1
- package/fesm2022/xxmachina-components-organisms-xterm.mjs +283 -261
- package/fesm2022/xxmachina-components-organisms-xterm.mjs.map +1 -1
- package/fesm2022/xxmachina-components-pages-command.mjs +3 -9
- package/fesm2022/xxmachina-components-pages-command.mjs.map +1 -1
- package/fesm2022/xxmachina-components-pages-query-v2.mjs +0 -13
- package/fesm2022/xxmachina-components-pages-query-v2.mjs.map +1 -1
- package/fesm2022/xxmachina-components-pages-query.mjs +3 -67
- package/fesm2022/xxmachina-components-pages-query.mjs.map +1 -1
- package/fesm2022/xxmachina-components-pages-thread.mjs +2 -18
- package/fesm2022/xxmachina-components-pages-thread.mjs.map +1 -1
- package/fesm2022/{xxmachina-components-routes-commands-command.routes-CSwIdXZg.mjs → xxmachina-components-routes-commands-command.routes-Ca2yVrwL.mjs} +1 -2
- package/fesm2022/xxmachina-components-routes-commands-command.routes-Ca2yVrwL.mjs.map +1 -0
- package/fesm2022/{xxmachina-components-routes-commands-pages.routes-j2xVop4W.mjs → xxmachina-components-routes-commands-pages.routes-COpFeEsz.mjs} +2 -2
- package/fesm2022/{xxmachina-components-routes-commands-pages.routes-j2xVop4W.mjs.map → xxmachina-components-routes-commands-pages.routes-COpFeEsz.mjs.map} +1 -1
- package/fesm2022/xxmachina-components-routes-commands.mjs +1 -2
- package/fesm2022/xxmachina-components-routes-commands.mjs.map +1 -1
- package/fesm2022/xxmachina-components-routes-pages.mjs +0 -1
- package/fesm2022/xxmachina-components-routes-pages.mjs.map +1 -1
- package/fesm2022/xxmachina-components-routes-queries.mjs +0 -2
- package/fesm2022/xxmachina-components-routes-queries.mjs.map +1 -1
- package/fesm2022/{xxmachina-components-routes-query-pages.routes-CxTbOJDQ.mjs → xxmachina-components-routes-query-pages.routes-BNuONo3g.mjs} +1 -5
- package/fesm2022/xxmachina-components-routes-query-pages.routes-BNuONo3g.mjs.map +1 -0
- package/fesm2022/xxmachina-components-routes-query.mjs +1 -1
- package/fesm2022/{xxmachina-components-routes-resources-pages.routes-CRXxavHb.mjs → xxmachina-components-routes-resources-pages.routes-DEu2qpeu.mjs} +2 -2
- package/fesm2022/{xxmachina-components-routes-resources-pages.routes-CRXxavHb.mjs.map → xxmachina-components-routes-resources-pages.routes-DEu2qpeu.mjs.map} +1 -1
- package/fesm2022/{xxmachina-components-routes-resources-resource.routes-CkkmqB2_.mjs → xxmachina-components-routes-resources-resource.routes-CWxi2agj.mjs} +1 -2
- package/fesm2022/xxmachina-components-routes-resources-resource.routes-CWxi2agj.mjs.map +1 -0
- package/fesm2022/xxmachina-components-routes-resources.mjs +1 -1
- package/fesm2022/xxmachina-components-routes-transformer.mjs +0 -1
- package/fesm2022/xxmachina-components-routes-transformer.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-forms-query.mjs +1 -1
- package/fesm2022/xxmachina-components-services-forms-query.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-graphql.mjs +0 -4
- package/fesm2022/xxmachina-components-services-graphql.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-json-schema.mjs +6 -12
- package/fesm2022/xxmachina-components-services-json-schema.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-query.mjs +0 -7
- package/fesm2022/xxmachina-components-services-query.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-recording.mjs +0 -13
- package/fesm2022/xxmachina-components-services-recording.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-thread.mjs +0 -2
- package/fesm2022/xxmachina-components-services-thread.mjs.map +1 -1
- package/fesm2022/xxmachina-components-services-version.mjs +171 -0
- package/fesm2022/xxmachina-components-services-version.mjs.map +1 -0
- package/fesm2022/xxmachina-components-services-workspace-switcher.mjs +9 -0
- package/fesm2022/xxmachina-components-services-workspace-switcher.mjs.map +1 -0
- package/fesm2022/xxmachina-components-templates-agent.mjs +98 -146
- package/fesm2022/xxmachina-components-templates-agent.mjs.map +1 -1
- package/fesm2022/xxmachina-components-templates-background.mjs +10 -30
- package/fesm2022/xxmachina-components-templates-background.mjs.map +1 -1
- package/fesm2022/xxmachina-components-templates-env.mjs +295 -0
- package/fesm2022/xxmachina-components-templates-env.mjs.map +1 -0
- package/fesm2022/xxmachina-components-templates-flow-nodes-issue.mjs.map +1 -1
- package/fesm2022/xxmachina-components-templates-flow.mjs +1 -1
- package/fesm2022/xxmachina-components-templates-flow.mjs.map +1 -1
- package/fesm2022/xxmachina-components-templates-machina-icon-button-menu.mjs +78 -0
- package/fesm2022/xxmachina-components-templates-machina-icon-button-menu.mjs.map +1 -0
- package/fesm2022/xxmachina-components.mjs +9 -10
- package/fesm2022/xxmachina-components.mjs.map +1 -1
- package/package.json +25 -1
- package/types/xxmachina-components-extras-flow.d.ts +8 -43
- package/types/xxmachina-components-extras-flow.d.ts.map +1 -1
- package/types/xxmachina-components-features-query.d.ts +3 -24
- package/types/xxmachina-components-features-query.d.ts.map +1 -1
- package/types/xxmachina-components-groups-query-form.d.ts +2 -2
- package/types/xxmachina-components-molecules-user-avatar-menu.d.ts +19 -0
- package/types/xxmachina-components-molecules-user-avatar-menu.d.ts.map +1 -0
- package/types/xxmachina-components-molecules-workspace-selector.d.ts +25 -0
- package/types/xxmachina-components-molecules-workspace-selector.d.ts.map +1 -0
- package/types/xxmachina-components-organisms-xterm.d.ts +130 -111
- package/types/xxmachina-components-organisms-xterm.d.ts.map +1 -1
- package/types/xxmachina-components-pages-query-v2.d.ts +0 -3
- package/types/xxmachina-components-pages-query-v2.d.ts.map +1 -1
- package/types/xxmachina-components-pages-query.d.ts +0 -19
- package/types/xxmachina-components-pages-query.d.ts.map +1 -1
- package/types/xxmachina-components-services-forms-query.d.ts +1 -1
- package/types/xxmachina-components-services-graphql.d.ts +0 -3
- package/types/xxmachina-components-services-graphql.d.ts.map +1 -1
- package/types/xxmachina-components-services-query.d.ts +0 -7
- package/types/xxmachina-components-services-query.d.ts.map +1 -1
- package/types/xxmachina-components-services-version.d.ts +32 -0
- package/types/xxmachina-components-services-version.d.ts.map +1 -0
- package/types/xxmachina-components-services-workspace-switcher.d.ts +17 -0
- package/types/xxmachina-components-services-workspace-switcher.d.ts.map +1 -0
- package/types/xxmachina-components-templates-agent.d.ts +2 -1
- package/types/xxmachina-components-templates-agent.d.ts.map +1 -1
- package/types/xxmachina-components-templates-env.d.ts +43 -0
- package/types/xxmachina-components-templates-env.d.ts.map +1 -0
- package/types/xxmachina-components-templates-flow-nodes-issue.d.ts +0 -2
- package/types/xxmachina-components-templates-flow-nodes-issue.d.ts.map +1 -1
- package/types/xxmachina-components-templates-machina-icon-button-menu.d.ts +18 -0
- package/types/xxmachina-components-templates-machina-icon-button-menu.d.ts.map +1 -0
- package/types/xxmachina-components.d.ts +2 -0
- package/types/xxmachina-components.d.ts.map +1 -1
- package/fesm2022/xxmachina-components-routes-commands-command.routes-CSwIdXZg.mjs.map +0 -1
- package/fesm2022/xxmachina-components-routes-query-pages.routes-CxTbOJDQ.mjs.map +0 -1
- package/fesm2022/xxmachina-components-routes-resources-resource.routes-CkkmqB2_.mjs.map +0 -1
|
@@ -42,61 +42,7 @@ class QueryFormGroup extends NgAtomicComponent {
|
|
|
42
42
|
headersExtensions = computed(() => [json()], ...(ngDevMode ? [{ debugName: "headersExtensions" }] : []));
|
|
43
43
|
http = inject(HttpClient);
|
|
44
44
|
libFile = toSignal(this.http.get('https://unpkg.com/typescript@latest/lib/lib.es5.d.ts', { responseType: 'text' }));
|
|
45
|
-
// readonly tsLinter = () => {
|
|
46
|
-
// return linter(view => {
|
|
47
|
-
// const diagnostics: Diagnostic[] = [];
|
|
48
|
-
// if (!this.libFile()) return diagnostics;
|
|
49
|
-
// const code = view.state.doc.toString();
|
|
50
|
-
// const fileName = 'file.ts';
|
|
51
|
-
// const libFileName = 'lib.es5.d.ts';
|
|
52
|
-
// const compilerOptions: ts.CompilerOptions = {
|
|
53
|
-
// noEmit: true,
|
|
54
|
-
// lib: ['lib.es5.d.ts'],
|
|
55
|
-
// strict: true,
|
|
56
|
-
// };
|
|
57
|
-
// const host: ts.CompilerHost = {
|
|
58
|
-
// getSourceFile: (name) => {
|
|
59
|
-
// console.debug('[QueryFormGroup] getSourceFile:', name);
|
|
60
|
-
// if (name === fileName) {
|
|
61
|
-
// return ts.createSourceFile(name, code, ts.ScriptTarget.Latest, true);
|
|
62
|
-
// }
|
|
63
|
-
// if (name === libFileName) {
|
|
64
|
-
// console.debug('[QueryFormGroup] libSourceFile:', this.libFile());
|
|
65
|
-
// return ts.createSourceFile(name, this.libFile(), ts.ScriptTarget.Latest, true);
|
|
66
|
-
// }
|
|
67
|
-
// return undefined;
|
|
68
|
-
// },
|
|
69
|
-
// writeFile: () => {},
|
|
70
|
-
// getDefaultLibFileName: () => libFileName,
|
|
71
|
-
// getCurrentDirectory: () => '',
|
|
72
|
-
// getCanonicalFileName: filename => filename,
|
|
73
|
-
// useCaseSensitiveFileNames: () => true,
|
|
74
|
-
// fileExists: name => name === fileName || name === libFileName,
|
|
75
|
-
// readFile: () => '',
|
|
76
|
-
// getNewLine: () => '\n',
|
|
77
|
-
// };
|
|
78
|
-
// const program = ts.createProgram([fileName], compilerOptions, host);
|
|
79
|
-
// const tsDiagnostics = ts.getPreEmitDiagnostics(program);
|
|
80
|
-
// tsDiagnostics.forEach(diag => {
|
|
81
|
-
// if (
|
|
82
|
-
// diag.file &&
|
|
83
|
-
// diag.file.fileName === fileName && // ← これを追加
|
|
84
|
-
// diag.start !== undefined &&
|
|
85
|
-
// diag.length !== undefined
|
|
86
|
-
// ) {
|
|
87
|
-
// diagnostics.push({
|
|
88
|
-
// from: diag.start,
|
|
89
|
-
// to: diag.start + diag.length,
|
|
90
|
-
// message: ts.flattenDiagnosticMessageText(diag.messageText, '\n'),
|
|
91
|
-
// severity: 'error',
|
|
92
|
-
// });
|
|
93
|
-
// }
|
|
94
|
-
// });
|
|
95
|
-
// return diagnostics;
|
|
96
|
-
// });
|
|
97
|
-
// };
|
|
98
45
|
transformerExtensions = computed(() => [
|
|
99
|
-
// this.tsLinter(),
|
|
100
46
|
javascript({ typescript: true })
|
|
101
47
|
], ...(ngDevMode ? [{ debugName: "transformerExtensions" }] : []));
|
|
102
48
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: QueryFormGroup, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xxmachina-components-groups-query-form.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/groups/query-form/query-form.group.ts","../../../../../packages/@xxmachina/components/src/lib/groups/query-form/xxmachina-components-groups-query-form.ts"],"sourcesContent":["import { Component, inject, computed, input, ChangeDetectionStrategy } from '@angular/core';\nimport { Extension } from '@codemirror/state';\nimport { buildClientSchema } from 'graphql';\nimport { EditorComponent } from \"@ng-atomic/components/extras/editor\";\nimport { _computed, NgAtomicComponent } from '@ng-atomic/core';\nimport { TextInputSectionOrganism } from '@ng-atomic/components/organisms/text-input-section';\nimport { TabsFrame } from '@ng-atomic/components/frames/tabs';\nimport { json } from '@codemirror/lang-json';\nimport { javascript } from '@codemirror/lang-javascript';\nimport { Resource } from '@xxmachina/common/domain/models';\nimport { graphql } from 'cm6-graphql';\nimport { QueryFeature, QueryGraphqlSchemaFeature } from '@xxmachina/components/features/query';\nimport { injectAll } from '@ng-atomic/common/stores/entities';\nimport { HttpClient } from '@angular/common/http';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { derivedAsync } from 'ngxtension/derived-async';\nimport { getValue$ } from '@ng-atomic/common/utils';\n\n@Component({\n selector: 'groups-query-form',\n imports: [\n EditorComponent,\n TextInputSectionOrganism,\n TabsFrame,\n ],\n template: `\n <organisms-text-input-section\n [label]=\"'GraphQL Endpoint'\"\n [control]=\"form().get(['graphql', 'endpoint'])\"\n [placeholder]=\"'http://localhost:4200/api/graphql'\"\n [autoComplete]=\"endpointAutoCompleteOptions()\"\n [hint]=\"'スキーマ取得完了'\"\n />\n <frames-tabs [labels]=\"['Query(GQL)', 'Variables(JSON)', 'Headers(JSON)', 'Transformer(TS)']\">\n <ng-template #tab>\n <extras-editor\n [content]=\"form().get(['graphql', 'query']).value\"\n (contentChange)=\"form().get(['graphql', 'query']).setValue($event)\"\n [extensions]=\"queryExtensions()\"\n [keyActions]=\"keyActions()\"\n (action)=\"dispatch($event)\"\n />\n </ng-template>\n <ng-template #tab>\n <extras-editor\n [content]=\"form().get(['graphql', 'variablesJson']).value\"\n (contentChange)=\"form().get(['graphql', 'variablesJson']).setValue($event)\"\n [extensions]=\"variablesExtensions()\"\n [keyActions]=\"keyActions()\"\n (action)=\"dispatch($event)\"\n />\n </ng-template>\n <ng-template #tab>\n <extras-editor\n [content]=\"form().get(['graphql', 'headersJson']).value\"\n (contentChange)=\"form().get(['graphql', 'headersJson']).setValue($event)\"\n [extensions]=\"headersExtensions()\"\n [keyActions]=\"keyActions()\"\n (action)=\"dispatch($event)\"\n />\n </ng-template>\n <ng-template #tab>\n <extras-editor\n [content]=\"form().get(['graphql', 'transformerTs']).value\"\n (contentChange)=\"form().get(['graphql', 'transformerTs']).setValue($event)\"\n [extensions]=\"transformerExtensions()\"\n [keyActions]=\"keyActions()\"\n (action)=\"dispatch($event)\"\n />\n </ng-template>\n </frames-tabs>\n `,\n styles: `\n :host {\n display: flex;\n flex-direction: column;\n padding-top: 24px;\n box-sizing: border-box;\n height: 100%;\n\n frames-tabs {\n height: 100%;\n\n extras-editor {\n height: 100%;\n }\n }\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class QueryFormGroup extends NgAtomicComponent {\n readonly #feature = inject(QueryFeature);\n readonly form = input(this.#feature.form);\n readonly formValue = derivedAsync(() => getValue$(this.form()));\n protected readonly graphqlSchemaFeature = inject(QueryGraphqlSchemaFeature);\n protected readonly keyActions = input([\n { key: 'Ctrl-Enter', actionId: QueryFeature.ActionId.クエリの実行 },\n { key: 'Cmd-Enter', actionId: QueryFeature.ActionId.クエリの実行 },\n { key: 'Cmd-s', actionId: QueryFeature.ActionId.クエリの更新 },\n ]);\n protected readonly resources = injectAll(Resource);\n\n readonly endpointAutoCompleteOptions = computed(() => {\n const query = this.formValue();\n return this.resources()\n .filter(resource => resource.type === 'graphql')\n .map(resource => resource.graphql!.url)\n .filter(url => url.startsWith(query!.graphql!.endpoint!));\n });\n readonly queryExtensions = computed<Extension[]>(() => {\n const schema = this.graphqlSchemaFeature.graphqlSchema();\n return schema ? [graphql(buildClientSchema(schema))] : [];\n });\n readonly variablesExtensions = computed<Extension[]>(() => [json()]);\n readonly headersExtensions = computed<Extension[]>(() => [json()]);\n\n readonly http = inject(HttpClient);\n readonly libFile = toSignal(\n this.http.get('https://unpkg.com/typescript@latest/lib/lib.es5.d.ts', { responseType: 'text' })\n );\n \n // readonly tsLinter = () => {\n // return linter(view => {\n // const diagnostics: Diagnostic[] = [];\n \n // if (!this.libFile()) return diagnostics;\n \n // const code = view.state.doc.toString();\n // const fileName = 'file.ts';\n // const libFileName = 'lib.es5.d.ts';\n \n // const compilerOptions: ts.CompilerOptions = {\n // noEmit: true,\n // lib: ['lib.es5.d.ts'],\n // strict: true,\n // };\n \n // const host: ts.CompilerHost = {\n // getSourceFile: (name) => {\n // console.debug('[QueryFormGroup] getSourceFile:', name);\n // if (name === fileName) {\n // return ts.createSourceFile(name, code, ts.ScriptTarget.Latest, true);\n // }\n // if (name === libFileName) {\n // console.debug('[QueryFormGroup] libSourceFile:', this.libFile());\n // return ts.createSourceFile(name, this.libFile(), ts.ScriptTarget.Latest, true);\n // }\n // return undefined;\n // },\n // writeFile: () => {},\n // getDefaultLibFileName: () => libFileName,\n // getCurrentDirectory: () => '',\n // getCanonicalFileName: filename => filename,\n // useCaseSensitiveFileNames: () => true,\n // fileExists: name => name === fileName || name === libFileName,\n // readFile: () => '',\n // getNewLine: () => '\\n',\n // };\n \n // const program = ts.createProgram([fileName], compilerOptions, host);\n // const tsDiagnostics = ts.getPreEmitDiagnostics(program);\n \n // tsDiagnostics.forEach(diag => {\n // if (\n // diag.file &&\n // diag.file.fileName === fileName && // ← これを追加\n // diag.start !== undefined &&\n // diag.length !== undefined\n // ) {\n // diagnostics.push({\n // from: diag.start,\n // to: diag.start + diag.length,\n // message: ts.flattenDiagnosticMessageText(diag.messageText, '\\n'),\n // severity: 'error',\n // });\n // }\n // });\n \n // return diagnostics;\n // });\n // };\n\n readonly transformerExtensions = computed<Extension[]>(() => [\n // this.tsLin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,SAAS;qBACV,EAAA,QAAA,EACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CT,EAAA,eAAA,EAkBgB,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,0KAAA,CAAA,EAAA;;;ACzFjD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"xxmachina-components-groups-query-form.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/groups/query-form/query-form.group.ts","../../../../../packages/@xxmachina/components/src/lib/groups/query-form/xxmachina-components-groups-query-form.ts"],"sourcesContent":["import { Component, inject, computed, input, ChangeDetectionStrategy } from '@angular/core';\nimport { Extension } from '@codemirror/state';\nimport { buildClientSchema } from 'graphql';\nimport { EditorComponent } from \"@ng-atomic/components/extras/editor\";\nimport { _computed, NgAtomicComponent } from '@ng-atomic/core';\nimport { TextInputSectionOrganism } from '@ng-atomic/components/organisms/text-input-section';\nimport { TabsFrame } from '@ng-atomic/components/frames/tabs';\nimport { json } from '@codemirror/lang-json';\nimport { javascript } from '@codemirror/lang-javascript';\nimport { Resource } from '@xxmachina/common/domain/models';\nimport { graphql } from 'cm6-graphql';\nimport { QueryFeature, QueryGraphqlSchemaFeature } from '@xxmachina/components/features/query';\nimport { injectAll } from '@ng-atomic/common/stores/entities';\nimport { HttpClient } from '@angular/common/http';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { derivedAsync } from 'ngxtension/derived-async';\nimport { getValue$ } from '@ng-atomic/common/utils';\n\n@Component({\n selector: 'groups-query-form',\n imports: [\n EditorComponent,\n TextInputSectionOrganism,\n TabsFrame,\n ],\n template: `\n <organisms-text-input-section\n [label]=\"'GraphQL Endpoint'\"\n [control]=\"form().get(['graphql', 'endpoint'])\"\n [placeholder]=\"'http://localhost:4200/api/graphql'\"\n [autoComplete]=\"endpointAutoCompleteOptions()\"\n [hint]=\"'スキーマ取得完了'\"\n />\n <frames-tabs [labels]=\"['Query(GQL)', 'Variables(JSON)', 'Headers(JSON)', 'Transformer(TS)']\">\n <ng-template #tab>\n <extras-editor\n [content]=\"form().get(['graphql', 'query']).value\"\n (contentChange)=\"form().get(['graphql', 'query']).setValue($event)\"\n [extensions]=\"queryExtensions()\"\n [keyActions]=\"keyActions()\"\n (action)=\"dispatch($event)\"\n />\n </ng-template>\n <ng-template #tab>\n <extras-editor\n [content]=\"form().get(['graphql', 'variablesJson']).value\"\n (contentChange)=\"form().get(['graphql', 'variablesJson']).setValue($event)\"\n [extensions]=\"variablesExtensions()\"\n [keyActions]=\"keyActions()\"\n (action)=\"dispatch($event)\"\n />\n </ng-template>\n <ng-template #tab>\n <extras-editor\n [content]=\"form().get(['graphql', 'headersJson']).value\"\n (contentChange)=\"form().get(['graphql', 'headersJson']).setValue($event)\"\n [extensions]=\"headersExtensions()\"\n [keyActions]=\"keyActions()\"\n (action)=\"dispatch($event)\"\n />\n </ng-template>\n <ng-template #tab>\n <extras-editor\n [content]=\"form().get(['graphql', 'transformerTs']).value\"\n (contentChange)=\"form().get(['graphql', 'transformerTs']).setValue($event)\"\n [extensions]=\"transformerExtensions()\"\n [keyActions]=\"keyActions()\"\n (action)=\"dispatch($event)\"\n />\n </ng-template>\n </frames-tabs>\n `,\n styles: `\n :host {\n display: flex;\n flex-direction: column;\n padding-top: 24px;\n box-sizing: border-box;\n height: 100%;\n\n frames-tabs {\n height: 100%;\n\n extras-editor {\n height: 100%;\n }\n }\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class QueryFormGroup extends NgAtomicComponent {\n readonly #feature = inject(QueryFeature);\n readonly form = input(this.#feature.form);\n readonly formValue = derivedAsync(() => getValue$(this.form()));\n protected readonly graphqlSchemaFeature = inject(QueryGraphqlSchemaFeature);\n protected readonly keyActions = input([\n { key: 'Ctrl-Enter', actionId: QueryFeature.ActionId.クエリの実行 },\n { key: 'Cmd-Enter', actionId: QueryFeature.ActionId.クエリの実行 },\n { key: 'Cmd-s', actionId: QueryFeature.ActionId.クエリの更新 },\n ]);\n protected readonly resources = injectAll(Resource);\n\n readonly endpointAutoCompleteOptions = computed(() => {\n const query = this.formValue();\n return this.resources()\n .filter(resource => resource.type === 'graphql')\n .map(resource => resource.graphql!.url)\n .filter(url => url.startsWith(query!.graphql!.endpoint!));\n });\n readonly queryExtensions = computed<Extension[]>(() => {\n const schema = this.graphqlSchemaFeature.graphqlSchema();\n return schema ? [graphql(buildClientSchema(schema))] : [];\n });\n readonly variablesExtensions = computed<Extension[]>(() => [json()]);\n readonly headersExtensions = computed<Extension[]>(() => [json()]);\n\n readonly http = inject(HttpClient);\n readonly libFile = toSignal(\n this.http.get('https://unpkg.com/typescript@latest/lib/lib.es5.d.ts', { responseType: 'text' })\n );\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n readonly transformerExtensions = computed<Extension[]>(() => [\n \n javascript({typescript: true})\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA2FM,MAAO,cAAe,SAAQ,iBAAiB,CAAA;AAC1C,IAAA,QAAQ,GAAG,MAAM,CAAC,YAAY,CAAC;IAC/B,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC;AAChC,IAAA,SAAS,GAAG,YAAY,CAAC,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AAC5C,IAAA,oBAAoB,GAAG,MAAM,CAAC,yBAAyB,CAAC;IACxD,UAAU,GAAG,KAAK,CAAC;QACpC,EAAE,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,MAAM,EAAE;QA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AA,IAAA,EAAA,WAAA,EAAA,IAAA,EAlDC,eAAe,EAAA,QAAA,EAAA,eAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACf,wBAAwB,EAAA,QAAA,EAAA,8BAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACxB,SAAS,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,QAAA,CAAA,EAAA,OAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAoEA,cAAc,EAAA,UAAA,EAAA,CAAA;kBAzE1B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EAAA,OAAA,EACpB;wBACP,eAAe;wBACf,wBAAwB;wBACxB,SAAS;qBACV,EAAA,QAAA,EACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CT,EAAA,eAAA,EAkBgB,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,0KAAA,CAAA,EAAA;;;ACzFjD;;AAEG;;;;"}
|
|
@@ -31,7 +31,6 @@ class InlineEditFieldMolecule extends NgAtomicComponent {
|
|
|
31
31
|
inputEl = viewChild('inputEl', ...(ngDevMode ? [{ debugName: "inputEl" }] : []));
|
|
32
32
|
constructor() {
|
|
33
33
|
super();
|
|
34
|
-
// 編集モード開始時に入力欄にフォーカス
|
|
35
34
|
effect(() => {
|
|
36
35
|
if (this.isEditing() && this.inputEl()) {
|
|
37
36
|
setTimeout(() => this.inputEl()?.nativeElement.focus(), 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xxmachina-components-molecules-inline-edit-field.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/molecules/inline-edit-field/inline-edit-field.molecule.ts","../../../../../packages/@xxmachina/components/src/lib/molecules/inline-edit-field/xxmachina-components-molecules-inline-edit-field.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Directive, ElementRef, effect, inject, input, signal, viewChild } from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { InjectableComponent, NgAtomicComponent, TokenizedType } from '@ng-atomic/core';\n\nenum ActionId {\n VALUE_COMMIT = '[@xxmachina/molecules/inline-edit-field] value commit',\n}\n\n@TokenizedType()\n@Directive({ standalone: true, selector: 'molecules-inline-edit-field' })\nexport class InlineEditFieldMoleculeStore extends InjectableComponent {\n static readonly ActionId = ActionId;\n readonly control = input.required<FormControl<string>>();\n readonly displayValue = input.required<string>();\n}\n\n@Component({\n selector: 'molecules-inline-edit-field',\n standalone: true,\n imports: [ReactiveFormsModule],\n template: `\n @if (isEditing()) {\n <input\n class=\"edit-input\"\n [formControl]=\"store.control()\"\n (blur)=\"onBlur()\"\n (keydown.enter)=\"onEnter($event)\"\n (keydown.escape)=\"onEscape($event)\"\n #inputEl\n />\n } @else {\n <span\n class=\"display-value\"\n (dblclick)=\"startEdit()\"\n >{{ store.displayValue() }}</span>\n }\n `,\n styleUrl: './inline-edit-field.molecule.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: InlineEditFieldMoleculeStore,\n inputs: ['control', 'displayValue'],\n }\n ],\n})\nexport class InlineEditFieldMolecule extends NgAtomicComponent {\n static readonly ActionId = ActionId;\n protected readonly store = inject(InlineEditFieldMoleculeStore);\n readonly isEditing = signal(false);\n private originalValue = '';\n private readonly inputEl = viewChild<ElementRef<HTMLInputElement>>('inputEl');\n\n constructor() {\n super();\n
|
|
1
|
+
{"version":3,"file":"xxmachina-components-molecules-inline-edit-field.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/molecules/inline-edit-field/inline-edit-field.molecule.ts","../../../../../packages/@xxmachina/components/src/lib/molecules/inline-edit-field/xxmachina-components-molecules-inline-edit-field.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Directive, ElementRef, effect, inject, input, signal, viewChild } from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { InjectableComponent, NgAtomicComponent, TokenizedType } from '@ng-atomic/core';\n\nenum ActionId {\n VALUE_COMMIT = '[@xxmachina/molecules/inline-edit-field] value commit',\n}\n\n@TokenizedType()\n@Directive({ standalone: true, selector: 'molecules-inline-edit-field' })\nexport class InlineEditFieldMoleculeStore extends InjectableComponent {\n static readonly ActionId = ActionId;\n readonly control = input.required<FormControl<string>>();\n readonly displayValue = input.required<string>();\n}\n\n@Component({\n selector: 'molecules-inline-edit-field',\n standalone: true,\n imports: [ReactiveFormsModule],\n template: `\n @if (isEditing()) {\n <input\n class=\"edit-input\"\n [formControl]=\"store.control()\"\n (blur)=\"onBlur()\"\n (keydown.enter)=\"onEnter($event)\"\n (keydown.escape)=\"onEscape($event)\"\n #inputEl\n />\n } @else {\n <span\n class=\"display-value\"\n (dblclick)=\"startEdit()\"\n >{{ store.displayValue() }}</span>\n }\n `,\n styleUrl: './inline-edit-field.molecule.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: InlineEditFieldMoleculeStore,\n inputs: ['control', 'displayValue'],\n }\n ],\n})\nexport class InlineEditFieldMolecule extends NgAtomicComponent {\n static readonly ActionId = ActionId;\n protected readonly store = inject(InlineEditFieldMoleculeStore);\n readonly isEditing = signal(false);\n private originalValue = '';\n private readonly inputEl = viewChild<ElementRef<HTMLInputElement>>('inputEl');\n\n constructor() {\n super();\n \n effect(() => {\n if (this.isEditing() && this.inputEl()) {\n setTimeout(() => this.inputEl()?.nativeElement.focus(), 0);\n }\n });\n }\n\n startEdit() {\n this.originalValue = this.store.control().value;\n this.isEditing.set(true);\n }\n\n onBlur() {\n this.commitValue();\n }\n\n onEnter(event: Event) {\n event.preventDefault();\n this.commitValue();\n }\n\n onEscape(event: Event) {\n event.preventDefault();\n this.store.control().setValue(this.originalValue);\n this.isEditing.set(false);\n }\n\n private commitValue() {\n const newValue = this.store.control().value;\n this.isEditing.set(false);\n\n if (newValue !== this.originalValue) {\n this.dispatch({\n id: ActionId.VALUE_COMMIT,\n payload: { value: newValue, previousValue: this.originalValue },\n });\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAIA,IAAK,QAEJ;AAFD,CAAA,UAAK,QAAQ,EAAA;AACX,IAAA,QAAA,CAAA,cAAA,CAAA,GAAA,uDAAsE;AACxE,CAAC,EAFI,QAAQ,KAAR,QAAQ,GAAA,EAAA,CAAA,CAAA;AAMN,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,mBAAmB,CAAA;AACnE,IAAA,OAAgB,QAAQ,GAAG,QAAQ;AAC1B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,kDAAuB;AAC/C,IAAA,YAAY,GAAG,KAAK,CAAC,QAAQ,uDAAU;uGAHrC,4BAA4B,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA5B,4BAA4B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,6BAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,YAAA,EAAA,EAAA,iBAAA,EAAA,cAAA,EAAA,UAAA,EAAA,cAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;AAA5B,4BAA4B,GAAA,UAAA,CAAA;AAFxC,IAAA,aAAa;AAED,CAAA,EAAA,4BAA4B,CAIxC;2FAJY,4BAA4B,EAAA,UAA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A,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FA2BlB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBA9BnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,6BAA6B,cAC3B,IAAI,EAAA,OAAA,EACP,CAAC,mBAAmB,CAAC,EAAA,QAAA,EACpB;;;;;;;;;;;;;;;;GAgBT,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,cAAA,EAC/B;AACd,wBAAA;AACE,4BAAA,SAAS,EAAE,4BAA4B;AACvC,4BAAA,MAAM,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC;AACpC;AACF,qBAAA,EAAA,MAAA,EAAA,CAAA,uXAAA,CAAA,EAAA;+FAOkE,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACnD9E;;AAEG;;;;"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, input, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/material/button';
|
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
+
import * as i2 from '@angular/material/divider';
|
|
6
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
7
|
+
import * as i3 from '@angular/material/icon';
|
|
8
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
9
|
+
import * as i4 from '@angular/material/menu';
|
|
10
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
11
|
+
import * as i5 from '@angular/material/tooltip';
|
|
12
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
13
|
+
import { NgAtomicComponent } from '@ng-atomic/core';
|
|
14
|
+
import { AuthService } from '@ng-atomic/common/services/auth';
|
|
15
|
+
import { WorkspaceSwitcherService } from '@xxmachina/components/services/workspace-switcher';
|
|
16
|
+
|
|
17
|
+
class UserAvatarMenuMolecule extends NgAtomicComponent {
|
|
18
|
+
auth = inject(AuthService);
|
|
19
|
+
switcher = inject(WorkspaceSwitcherService, { optional: true });
|
|
20
|
+
signOutAction = input.required(...(ngDevMode ? [{ debugName: "signOutAction" }] : []));
|
|
21
|
+
imgError = signal(false, ...(ngDevMode ? [{ debugName: "imgError" }] : []));
|
|
22
|
+
photoURL = computed(() => this.imgError() ? null : this.auth.auth()?.photoURL ?? null, ...(ngDevMode ? [{ debugName: "photoURL" }] : []));
|
|
23
|
+
email = computed(() => this.auth.auth()?.email ?? null, ...(ngDevMode ? [{ debugName: "email" }] : []));
|
|
24
|
+
initial = computed(() => {
|
|
25
|
+
const user = this.auth.auth();
|
|
26
|
+
const source = user?.displayName || user?.email || '?';
|
|
27
|
+
return source.charAt(0).toUpperCase();
|
|
28
|
+
}, ...(ngDevMode ? [{ debugName: "initial" }] : []));
|
|
29
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: UserAvatarMenuMolecule, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: UserAvatarMenuMolecule, isStandalone: true, selector: "molecules-user-avatar-menu", inputs: { signOutAction: { classPropertyName: "signOutAction", publicName: "signOutAction", isSignal: true, isRequired: true, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
|
|
31
|
+
<button mat-icon-button class="avatar-button" [matMenuTriggerFor]="menu" [matTooltip]="email() ?? ''">
|
|
32
|
+
@if (photoURL(); as url) {
|
|
33
|
+
<!-- crossorigin="anonymous": app は COEP: require-corp で cross-origin isolation しており、
|
|
34
|
+
lh3.googleusercontent.com は CORP header を送らないため no-cors の <img> は
|
|
35
|
+
ERR_BLOCKED_BY_RESPONSE で落ちる。CORS mode (ACAO: * を返す) なら COEP を満たす。 -->
|
|
36
|
+
<img class="avatar-image" [src]="url" alt="avatar"
|
|
37
|
+
crossorigin="anonymous" referrerpolicy="no-referrer" (error)="imgError.set(true)">
|
|
38
|
+
} @else {
|
|
39
|
+
<span class="avatar-initial">{{ initial() }}</span>
|
|
40
|
+
}
|
|
41
|
+
</button>
|
|
42
|
+
<mat-menu #menu="matMenu" xPosition="after">
|
|
43
|
+
<div class="menu-header" mat-menu-item disabled>{{ email() }}</div>
|
|
44
|
+
<mat-divider/>
|
|
45
|
+
@for (workspace of switcher?.workspaces() ?? []; track workspace.id) {
|
|
46
|
+
<button mat-menu-item class="workspace-option" (click)="switcher?.switchTo(workspace.id)">
|
|
47
|
+
<mat-icon>{{ workspace.id === switcher?.currentWorkspaceId() ? 'check' : '' }}</mat-icon>
|
|
48
|
+
{{ workspace.name }}
|
|
49
|
+
</button>
|
|
50
|
+
}
|
|
51
|
+
<mat-divider/>
|
|
52
|
+
<button mat-menu-item class="sign-out-option" (click)="dispatch(signOutAction())">
|
|
53
|
+
<mat-icon>{{ signOutAction().icon }}</mat-icon>
|
|
54
|
+
{{ signOutAction().name }}
|
|
55
|
+
</button>
|
|
56
|
+
</mat-menu>
|
|
57
|
+
`, isInline: true, styles: [":host{display:inline-flex}.avatar-button{display:inline-flex;align-items:center;justify-content:center;overflow:hidden}.avatar-image{width:28px;height:28px;border-radius:50%;object-fit:cover}.avatar-initial{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background-color:var(--primary-color, #404040);color:var(--on-primary-color, #f0f0f0);font-size:14px;font-weight:500}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
58
|
+
}
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: UserAvatarMenuMolecule, decorators: [{
|
|
60
|
+
type: Component,
|
|
61
|
+
args: [{ selector: 'molecules-user-avatar-menu', standalone: true, imports: [MatButtonModule, MatDividerModule, MatIconModule, MatMenuModule, MatTooltipModule], template: `
|
|
62
|
+
<button mat-icon-button class="avatar-button" [matMenuTriggerFor]="menu" [matTooltip]="email() ?? ''">
|
|
63
|
+
@if (photoURL(); as url) {
|
|
64
|
+
<!-- crossorigin="anonymous": app は COEP: require-corp で cross-origin isolation しており、
|
|
65
|
+
lh3.googleusercontent.com は CORP header を送らないため no-cors の <img> は
|
|
66
|
+
ERR_BLOCKED_BY_RESPONSE で落ちる。CORS mode (ACAO: * を返す) なら COEP を満たす。 -->
|
|
67
|
+
<img class="avatar-image" [src]="url" alt="avatar"
|
|
68
|
+
crossorigin="anonymous" referrerpolicy="no-referrer" (error)="imgError.set(true)">
|
|
69
|
+
} @else {
|
|
70
|
+
<span class="avatar-initial">{{ initial() }}</span>
|
|
71
|
+
}
|
|
72
|
+
</button>
|
|
73
|
+
<mat-menu #menu="matMenu" xPosition="after">
|
|
74
|
+
<div class="menu-header" mat-menu-item disabled>{{ email() }}</div>
|
|
75
|
+
<mat-divider/>
|
|
76
|
+
@for (workspace of switcher?.workspaces() ?? []; track workspace.id) {
|
|
77
|
+
<button mat-menu-item class="workspace-option" (click)="switcher?.switchTo(workspace.id)">
|
|
78
|
+
<mat-icon>{{ workspace.id === switcher?.currentWorkspaceId() ? 'check' : '' }}</mat-icon>
|
|
79
|
+
{{ workspace.name }}
|
|
80
|
+
</button>
|
|
81
|
+
}
|
|
82
|
+
<mat-divider/>
|
|
83
|
+
<button mat-menu-item class="sign-out-option" (click)="dispatch(signOutAction())">
|
|
84
|
+
<mat-icon>{{ signOutAction().icon }}</mat-icon>
|
|
85
|
+
{{ signOutAction().name }}
|
|
86
|
+
</button>
|
|
87
|
+
</mat-menu>
|
|
88
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex}.avatar-button{display:inline-flex;align-items:center;justify-content:center;overflow:hidden}.avatar-image{width:28px;height:28px;border-radius:50%;object-fit:cover}.avatar-initial{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background-color:var(--primary-color, #404040);color:var(--on-primary-color, #f0f0f0);font-size:14px;font-weight:500}\n"] }]
|
|
89
|
+
}], propDecorators: { signOutAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "signOutAction", required: true }] }] } });
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Generated bundle index. Do not edit.
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
export { UserAvatarMenuMolecule };
|
|
96
|
+
//# sourceMappingURL=xxmachina-components-molecules-user-avatar-menu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xxmachina-components-molecules-user-avatar-menu.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/molecules/user-avatar-menu/user-avatar-menu.molecule.ts","../../../../../packages/@xxmachina/components/src/lib/molecules/user-avatar-menu/xxmachina-components-molecules-user-avatar-menu.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, input, signal } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { Action, NgAtomicComponent } from '@ng-atomic/core';\nimport { AuthService } from '@ng-atomic/common/services/auth';\nimport { WorkspaceSwitcherService } from '@xxmachina/components/services/workspace-switcher';\n\n\n@Component({\n selector: 'molecules-user-avatar-menu',\n standalone: true,\n imports: [MatButtonModule, MatDividerModule, MatIconModule, MatMenuModule, MatTooltipModule],\n template: `\n <button mat-icon-button class=\"avatar-button\" [matMenuTriggerFor]=\"menu\" [matTooltip]=\"email() ?? ''\">\n @if (photoURL(); as url) {\n <!-- crossorigin=\"anonymous\": app は COEP: require-corp で cross-origin isolation しており、\n lh3.googleusercontent.com は CORP header を送らないため no-cors の <img> は\n ERR_BLOCKED_BY_RESPONSE で落ちる。CORS mode (ACAO: * を返す) なら COEP を満たす。 -->\n <img class=\"avatar-image\" [src]=\"url\" alt=\"avatar\"\n crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\" (error)=\"imgError.set(true)\">\n } @else {\n <span class=\"avatar-initial\">{{ initial() }}</span>\n }\n </button>\n <mat-menu #menu=\"matMenu\" xPosition=\"after\">\n <div class=\"menu-header\" mat-menu-item disabled>{{ email() }}</div>\n <mat-divider/>\n @for (workspace of switcher?.workspaces() ?? []; track workspace.id) {\n <button mat-menu-item class=\"workspace-option\" (click)=\"switcher?.switchTo(workspace.id)\">\n <mat-icon>{{ workspace.id === switcher?.currentWorkspaceId() ? 'check' : '' }}</mat-icon>\n {{ workspace.name }}\n </button>\n }\n <mat-divider/>\n <button mat-menu-item class=\"sign-out-option\" (click)=\"dispatch(signOutAction())\">\n <mat-icon>{{ signOutAction().icon }}</mat-icon>\n {{ signOutAction().name }}\n </button>\n </mat-menu>\n `,\n styleUrl: './user-avatar-menu.molecule.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class UserAvatarMenuMolecule extends NgAtomicComponent {\n protected readonly auth = inject(AuthService);\n protected readonly switcher = inject(WorkspaceSwitcherService, { optional: true });\n\n \n readonly signOutAction = input.required<Action>();\n\n \n protected readonly imgError = signal(false);\n\n protected readonly photoURL = computed(() =>\n this.imgError() ? null : this.auth.auth()?.photoURL ?? null);\n protected readonly email = computed(() => this.auth.auth()?.email ?? null);\n protected readonly initial = computed(() => {\n const user = this.auth.auth();\n const source = user?.displayName || user?.email || '?';\n return source.charAt(0).toUpperCase();\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA8CM,MAAO,sBAAuB,SAAQ,iBAAiB,CAAA;AACxC,IAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;IAC1B,QAAQ,GAAG,MAAM,CAAC,wBAAwB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAGzE,IAAA,aAAa,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BAAgB,CAAC,EAAA,QAAA,EAClF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BT,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,+aAAA,CAAA,EAAA;;;AC5CjD;;AAEG;;;;"}
|
|
@@ -12,7 +12,7 @@ class WeeklyHeaderMolecule {
|
|
|
12
12
|
<span>{{ day }}</span>
|
|
13
13
|
</div>
|
|
14
14
|
}
|
|
15
|
-
`, isInline: true, styles: [":host{display:block;--primary-color: #404040;--primary-color-SCOPED-IN-
|
|
15
|
+
`, isInline: true, styles: [":host{display:block;--primary-color: #404040;--primary-color-SCOPED-IN-dIjsDwRD: var(--primary-color);--secondary-color: #B0B0B0;--secondary-color-SCOPED-IN-dIjsDwRD: var(--secondary-color)}:host{display:grid;width:100%;grid-template-columns:repeat(7,1fr);background-color:var(--primary-color-SCOPED-IN-dIjsDwRD)}:host .day-container{display:flex;justify-content:center;align-items:center;color:#fff;font-weight:700;width:calc(hvar(--width) / 7)}\n"] });
|
|
16
16
|
}
|
|
17
17
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: WeeklyHeaderMolecule, decorators: [{
|
|
18
18
|
type: Component,
|
|
@@ -22,7 +22,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImpor
|
|
|
22
22
|
<span>{{ day }}</span>
|
|
23
23
|
</div>
|
|
24
24
|
}
|
|
25
|
-
`, styles: [":host{display:block;--primary-color: #404040;--primary-color-SCOPED-IN-
|
|
25
|
+
`, styles: [":host{display:block;--primary-color: #404040;--primary-color-SCOPED-IN-dIjsDwRD: var(--primary-color);--secondary-color: #B0B0B0;--secondary-color-SCOPED-IN-dIjsDwRD: var(--secondary-color)}:host{display:grid;width:100%;grid-template-columns:repeat(7,1fr);background-color:var(--primary-color-SCOPED-IN-dIjsDwRD)}:host .day-container{display:flex;justify-content:center;align-items:center;color:#fff;font-weight:700;width:calc(hvar(--width) / 7)}\n"] }]
|
|
26
26
|
}], ctorParameters: () => [] });
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, signal, viewChild, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import * as i2 from '@angular/material/autocomplete';
|
|
6
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
7
|
+
import * as i3 from '@angular/material/button';
|
|
8
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
9
|
+
import * as i4 from '@angular/material/icon';
|
|
10
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
11
|
+
import { WorkspaceSwitcherService } from '@xxmachina/components/services/workspace-switcher';
|
|
12
|
+
|
|
13
|
+
class WorkspaceSelectorMolecule {
|
|
14
|
+
switcher = inject(WorkspaceSwitcherService, { optional: true });
|
|
15
|
+
control = new FormControl('');
|
|
16
|
+
searchText = signal('', ...(ngDevMode ? [{ debugName: "searchText" }] : []));
|
|
17
|
+
isEditing = signal(false, ...(ngDevMode ? [{ debugName: "isEditing" }] : []));
|
|
18
|
+
workspaceInput = viewChild('workspaceInput', ...(ngDevMode ? [{ debugName: "workspaceInput" }] : []));
|
|
19
|
+
visible = computed(() => !!this.switcher && !!this.switcher.currentWorkspaceId(), ...(ngDevMode ? [{ debugName: "visible" }] : []));
|
|
20
|
+
filtered = computed(() => {
|
|
21
|
+
const search = this.searchText().toLowerCase();
|
|
22
|
+
const workspaces = this.switcher?.workspaces() ?? [];
|
|
23
|
+
if (!search)
|
|
24
|
+
return workspaces;
|
|
25
|
+
return workspaces.filter((w) => w.name.toLowerCase().includes(search));
|
|
26
|
+
}, ...(ngDevMode ? [{ debugName: "filtered" }] : []));
|
|
27
|
+
constructor() {
|
|
28
|
+
this.control.valueChanges.subscribe((value) => this.searchText.set(value ?? ''));
|
|
29
|
+
}
|
|
30
|
+
startEdit() {
|
|
31
|
+
this.control.setValue('');
|
|
32
|
+
this.isEditing.set(true);
|
|
33
|
+
setTimeout(() => this.workspaceInput()?.nativeElement.focus());
|
|
34
|
+
}
|
|
35
|
+
onBlur() {
|
|
36
|
+
setTimeout(() => this.isEditing.set(false), 200);
|
|
37
|
+
}
|
|
38
|
+
onEscape(event) {
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
this.isEditing.set(false);
|
|
41
|
+
}
|
|
42
|
+
onSelected(event) {
|
|
43
|
+
this.switcher?.switchTo(event.option.value);
|
|
44
|
+
this.isEditing.set(false);
|
|
45
|
+
}
|
|
46
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: WorkspaceSelectorMolecule, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
47
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: WorkspaceSelectorMolecule, isStandalone: true, selector: "molecules-workspace-selector", viewQueries: [{ propertyName: "workspaceInput", first: true, predicate: ["workspaceInput"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
48
|
+
@if (visible()) {
|
|
49
|
+
<span class="breadcrumb-separator">/</span>
|
|
50
|
+
@if (isEditing()) {
|
|
51
|
+
<div class="workspace-autocomplete-wrapper">
|
|
52
|
+
<input
|
|
53
|
+
type="text"
|
|
54
|
+
class="workspace-autocomplete-input"
|
|
55
|
+
[formControl]="control"
|
|
56
|
+
[matAutocomplete]="workspaceAuto"
|
|
57
|
+
(blur)="onBlur()"
|
|
58
|
+
(keydown.escape)="onEscape($event)"
|
|
59
|
+
placeholder="workspace"
|
|
60
|
+
#workspaceInput
|
|
61
|
+
>
|
|
62
|
+
<mat-autocomplete
|
|
63
|
+
#workspaceAuto="matAutocomplete"
|
|
64
|
+
(optionSelected)="onSelected($event)"
|
|
65
|
+
autoActiveFirstOption
|
|
66
|
+
>
|
|
67
|
+
@for (workspace of filtered(); track workspace.id) {
|
|
68
|
+
<mat-option [value]="workspace.id">{{ workspace.name }}</mat-option>
|
|
69
|
+
}
|
|
70
|
+
</mat-autocomplete>
|
|
71
|
+
</div>
|
|
72
|
+
} @else {
|
|
73
|
+
<button mat-button class="breadcrumb-link workspace-display" (click)="startEdit()">
|
|
74
|
+
{{ switcher?.currentWorkspaceName() || 'workspace' }}
|
|
75
|
+
<mat-icon iconPositionEnd>arrow_drop_down</mat-icon>
|
|
76
|
+
</button>
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`, isInline: true, styles: [":host{display:inline-flex;align-items:center}.breadcrumb-separator{color:var(--on-primary-color);padding:0 4px;font-size:14px}.breadcrumb-link.workspace-display{color:var(--on-primary-color);text-decoration:none;padding:0 8px;min-height:36px;line-height:36px;font-size:14px;transition:background-color .2s ease-in-out}.breadcrumb-link.workspace-display:hover{color:var(--on-primary-color);background-color:#ffffff1a}.breadcrumb-link.workspace-display mat-icon{margin-right:4px;font-size:18px;width:18px;height:18px;vertical-align:middle}.workspace-autocomplete-wrapper{display:inline-flex;align-items:center}.workspace-autocomplete-wrapper .workspace-autocomplete-input{background:transparent;border:none;border-bottom:1px solid rgba(255,255,255,.3);color:var(--on-primary-color);font-size:14px;padding:4px 8px;width:120px;outline:none;transition:border-bottom-color .2s ease-in-out}.workspace-autocomplete-wrapper .workspace-autocomplete-input:focus{border-bottom-color:var(--on-primary-color)}.workspace-autocomplete-wrapper .workspace-autocomplete-input::placeholder{color:#ffffff80}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
80
|
+
}
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: WorkspaceSelectorMolecule, decorators: [{
|
|
82
|
+
type: Component,
|
|
83
|
+
args: [{ selector: 'molecules-workspace-selector', standalone: true, imports: [ReactiveFormsModule, MatAutocompleteModule, MatButtonModule, MatIconModule], template: `
|
|
84
|
+
@if (visible()) {
|
|
85
|
+
<span class="breadcrumb-separator">/</span>
|
|
86
|
+
@if (isEditing()) {
|
|
87
|
+
<div class="workspace-autocomplete-wrapper">
|
|
88
|
+
<input
|
|
89
|
+
type="text"
|
|
90
|
+
class="workspace-autocomplete-input"
|
|
91
|
+
[formControl]="control"
|
|
92
|
+
[matAutocomplete]="workspaceAuto"
|
|
93
|
+
(blur)="onBlur()"
|
|
94
|
+
(keydown.escape)="onEscape($event)"
|
|
95
|
+
placeholder="workspace"
|
|
96
|
+
#workspaceInput
|
|
97
|
+
>
|
|
98
|
+
<mat-autocomplete
|
|
99
|
+
#workspaceAuto="matAutocomplete"
|
|
100
|
+
(optionSelected)="onSelected($event)"
|
|
101
|
+
autoActiveFirstOption
|
|
102
|
+
>
|
|
103
|
+
@for (workspace of filtered(); track workspace.id) {
|
|
104
|
+
<mat-option [value]="workspace.id">{{ workspace.name }}</mat-option>
|
|
105
|
+
}
|
|
106
|
+
</mat-autocomplete>
|
|
107
|
+
</div>
|
|
108
|
+
} @else {
|
|
109
|
+
<button mat-button class="breadcrumb-link workspace-display" (click)="startEdit()">
|
|
110
|
+
{{ switcher?.currentWorkspaceName() || 'workspace' }}
|
|
111
|
+
<mat-icon iconPositionEnd>arrow_drop_down</mat-icon>
|
|
112
|
+
</button>
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;align-items:center}.breadcrumb-separator{color:var(--on-primary-color);padding:0 4px;font-size:14px}.breadcrumb-link.workspace-display{color:var(--on-primary-color);text-decoration:none;padding:0 8px;min-height:36px;line-height:36px;font-size:14px;transition:background-color .2s ease-in-out}.breadcrumb-link.workspace-display:hover{color:var(--on-primary-color);background-color:#ffffff1a}.breadcrumb-link.workspace-display mat-icon{margin-right:4px;font-size:18px;width:18px;height:18px;vertical-align:middle}.workspace-autocomplete-wrapper{display:inline-flex;align-items:center}.workspace-autocomplete-wrapper .workspace-autocomplete-input{background:transparent;border:none;border-bottom:1px solid rgba(255,255,255,.3);color:var(--on-primary-color);font-size:14px;padding:4px 8px;width:120px;outline:none;transition:border-bottom-color .2s ease-in-out}.workspace-autocomplete-wrapper .workspace-autocomplete-input:focus{border-bottom-color:var(--on-primary-color)}.workspace-autocomplete-wrapper .workspace-autocomplete-input::placeholder{color:#ffffff80}\n"] }]
|
|
116
|
+
}], ctorParameters: () => [], propDecorators: { workspaceInput: [{ type: i0.ViewChild, args: ['workspaceInput', { isSignal: true }] }] } });
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Generated bundle index. Do not edit.
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
export { WorkspaceSelectorMolecule };
|
|
123
|
+
//# sourceMappingURL=xxmachina-components-molecules-workspace-selector.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xxmachina-components-molecules-workspace-selector.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/molecules/workspace-selector/workspace-selector.molecule.ts","../../../../../packages/@xxmachina/components/src/lib/molecules/workspace-selector/xxmachina-components-molecules-workspace-selector.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, computed, inject, signal, viewChild } from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { MatAutocompleteModule, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { WorkspaceSwitcherService } from '@xxmachina/components/services/workspace-switcher';\n\n\n@Component({\n selector: 'molecules-workspace-selector',\n standalone: true,\n imports: [ReactiveFormsModule, MatAutocompleteModule, MatButtonModule, MatIconModule],\n template: `\n @if (visible()) {\n <span class=\"breadcrumb-separator\">/</span>\n @if (isEditing()) {\n <div class=\"workspace-autocomplete-wrapper\">\n <input\n type=\"text\"\n class=\"workspace-autocomplete-input\"\n [formControl]=\"control\"\n [matAutocomplete]=\"workspaceAuto\"\n (blur)=\"onBlur()\"\n (keydown.escape)=\"onEscape($event)\"\n placeholder=\"workspace\"\n #workspaceInput\n >\n <mat-autocomplete\n #workspaceAuto=\"matAutocomplete\"\n (optionSelected)=\"onSelected($event)\"\n autoActiveFirstOption\n >\n @for (workspace of filtered(); track workspace.id) {\n <mat-option [value]=\"workspace.id\">{{ workspace.name }}</mat-option>\n }\n </mat-autocomplete>\n </div>\n } @else {\n <button mat-button class=\"breadcrumb-link workspace-display\" (click)=\"startEdit()\">\n {{ switcher?.currentWorkspaceName() || 'workspace' }}\n <mat-icon iconPositionEnd>arrow_drop_down</mat-icon>\n </button>\n }\n }\n `,\n styleUrl: './workspace-selector.molecule.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class WorkspaceSelectorMolecule {\n protected readonly switcher = inject(WorkspaceSwitcherService, { optional: true });\n\n protected readonly control = new FormControl('');\n private readonly searchText = signal('');\n protected readonly isEditing = signal(false);\n private readonly workspaceInput = viewChild<ElementRef<HTMLInputElement>>('workspaceInput');\n\n \n \n protected readonly visible = computed(() => !!this.switcher && !!this.switcher.currentWorkspaceId());\n\n protected readonly filtered = computed(() => {\n const search = this.searchText().toLowerCase();\n const workspaces = this.switcher?.workspaces() ?? [];\n if (!search) return workspaces;\n return workspaces.filter((w) => w.name.toLowerCase().includes(search));\n });\n\n constructor() {\n this.control.valueChanges.subscribe((value) => this.searchText.set(value ?? ''));\n }\n\n protected startEdit(): void {\n this.control.setValue('');\n this.isEditing.set(true);\n setTimeout(() => this.workspaceInput()?.nativeElement.focus());\n }\n\n protected onBlur(): void {\n setTimeout(() => this.isEditing.set(false), 200);\n }\n\n protected onEscape(event: Event): void {\n event.preventDefault();\n this.isEditing.set(false);\n }\n\n protected onSelected(event: MatAutocompleteSelectedEvent): void {\n this.switcher?.switchTo(event.option.value);\n this.isEditing.set(false);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAgDa,yBAAyB,CAAA;IACjB,QAAQ,GAAG,MAAM,CAAC,wBAAwB,EAAE,EAAE,QAAQ,E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EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,eAAe,mXAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAqCzE,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAxCrC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,8BAA8B,EAAA,UAAA,EAC5B,IAAI,EAAA,OAAA,EACP,CAAC,mBAAmB,EAAE,qBAAqB,EAAE,eAAe,EAAE,aAAa,CAAC,EAAA,QAAA,EAC3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCT,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,kkCAAA,CAAA,EAAA;sGAQ2B,gBAAgB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACtD5F;;AAEG;;;;"}
|
|
@@ -56,7 +56,7 @@ class CalendarSectionOrganism {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
</div>
|
|
59
|
-
`, isInline: true, styles: [":host{display:block;--row: 80px;--row-SCOPED-IN-
|
|
59
|
+
`, isInline: true, styles: [":host{display:block;--row: 80px;--row-SCOPED-IN-eFERcqju: var(--row);--row-num: 0;--row-num-SCOPED-IN-eFERcqju: var(--row-num);--border-color: #9E9E9E;--border-color-SCOPED-IN-eFERcqju: var(--border-color);--primary-color: #404040;--primary-color-SCOPED-IN-eFERcqju: var(--primary-color);--secondary-color: #B0B0B0;--secondary-color-SCOPED-IN-eFERcqju: var(--secondary-color)}:host{width:100%;height:auto}:host .calendar.header molecules-weekly-header{--height: 32px}:host .calendar.contents{display:grid;width:var(--width);border:1px solid var(--border-color-SCOPED-IN-eFERcqju);grid-gap:1px;grid-template-columns:repeat(7,1fr);grid-template-rows:repeat(var(--row-num-SCOPED-IN-eFERcqju),var(--row-SCOPED-IN-eFERcqju));box-sizing:border-box;background-color:var(--border-color-SCOPED-IN-eFERcqju)}:host .calendar.contents molecules-daily-cell{--width: calc((var(--width) - 8px) / 7);--height: var(--row-SCOPED-IN-eFERcqju);background-color:#fff}:host .calendar.description{display:flex;justify-content:flex-end;width:var(--width);height:32px;padding-right:16px}:host .calendar.description .description.container{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;font-size:12px}:host .calendar.description .description.container .circle{display:flex;width:20px;height:20px;justify-content:center;align-items:center;border-radius:50%;color:#fff;background:#00f}:host .calendar.description .description.container label{padding-left:4px;padding-right:8px}\n"], dependencies: [{ kind: "component", type: DailyCellMolecule, selector: "molecules-daily-cell", inputs: ["date", "schedules", "displayDate", "noSchedulesText", "toolTipText", "marked", "markingColor"] }, { kind: "component", type: WeeklyHeaderMolecule, selector: "molecules-weekly-header" }, { kind: "ngmodule", type: MatRippleModule }, { kind: "directive", type: i1.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
60
60
|
}
|
|
61
61
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: CalendarSectionOrganism, decorators: [{
|
|
62
62
|
type: Component,
|
|
@@ -90,7 +90,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImpor
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
</div>
|
|
93
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;--row: 80px;--row-SCOPED-IN-
|
|
93
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;--row: 80px;--row-SCOPED-IN-eFERcqju: var(--row);--row-num: 0;--row-num-SCOPED-IN-eFERcqju: var(--row-num);--border-color: #9E9E9E;--border-color-SCOPED-IN-eFERcqju: var(--border-color);--primary-color: #404040;--primary-color-SCOPED-IN-eFERcqju: var(--primary-color);--secondary-color: #B0B0B0;--secondary-color-SCOPED-IN-eFERcqju: var(--secondary-color)}:host{width:100%;height:auto}:host .calendar.header molecules-weekly-header{--height: 32px}:host .calendar.contents{display:grid;width:var(--width);border:1px solid var(--border-color-SCOPED-IN-eFERcqju);grid-gap:1px;grid-template-columns:repeat(7,1fr);grid-template-rows:repeat(var(--row-num-SCOPED-IN-eFERcqju),var(--row-SCOPED-IN-eFERcqju));box-sizing:border-box;background-color:var(--border-color-SCOPED-IN-eFERcqju)}:host .calendar.contents molecules-daily-cell{--width: calc((var(--width) - 8px) / 7);--height: var(--row-SCOPED-IN-eFERcqju);background-color:#fff}:host .calendar.description{display:flex;justify-content:flex-end;width:var(--width);height:32px;padding-right:16px}:host .calendar.description .description.container{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;font-size:12px}:host .calendar.description .description.container .circle{display:flex;width:20px;height:20px;justify-content:center;align-items:center;border-radius:50%;color:#fff;background:#00f}:host .calendar.description .description.container label{padding-left:4px;padding-right:8px}\n"] }]
|
|
94
94
|
}], propDecorators: { label: [{
|
|
95
95
|
type: Input
|
|
96
96
|
}], displayDays: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xxmachina-components-organisms-calendar-section.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/organisms/calendar-section/calendar-section.organism.ts","../../../../../packages/@xxmachina/components/src/lib/organisms/calendar-section/xxmachina-components-organisms-calendar-section.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, SimpleChanges, inject, OnChanges } from '@angular/core';\nimport { MatRippleModule } from '@angular/material/core';\n\nimport { CalendarDate, Schedule } from '@xxmachina/common/domain/models';\nimport { DailyCellMolecule } from '@xxmachina/components/molecules/daily-cell';\nimport { CalendarPaginatorMolecule } from '@xxmachina/components/molecules/calendar-paginator';\nimport { WeeklyHeaderMolecule } from '@xxmachina/components/molecules/weekly-header';\nimport dayjs from 'dayjs';\n\n@Component({\n standalone: true,\n imports: [\n CalendarPaginatorMolecule,\n DailyCellMolecule,\n WeeklyHeaderMolecule,\n MatRippleModule\n],\n selector: 'organisms-calendar-section',\n template: `\n <!-- <molecules-calendar-paginator\n *ngIf=\"displayPaginator\"\n [date]=\"date\"\n (dateChange)=\"dateChange.emit($event)\"\n /> -->\n <div class=\"calendar header\">\n <molecules-weekly-header/>\n </div>\n <div class=\"calendar contents\">\n @for (week of calendar; track week) {\n @for (date of week; track date) {\n <molecules-daily-cell\n [date]=\"date.date\"\n [schedules]=\"schedules\"\n [displayDate]=\"displayDays\"\n [marked]=\"isToday(date) || isEndDay(date)\"\n [markingColor]=\"isToday(date) ? '#6200EE' : isEndDay(date) ? '#B00020' : 'transparent'\"\n noSchedulesText=\"予定なし\"\n matRipple\n (click)=\"onDateClick.emit(date)\"\n ></molecules-daily-cell>\n }\n }\n </div>\n `,\n styleUrls: ['./calendar-section.organism.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CalendarSectionOrganism implements OnChanges {\n private el = inject(ElementRef);\n @Input() label = 'label';\n @Input() displayDays = true;\n @Input() readonly calendar!: CalendarDate[][];\n @Input() schedules: Schedule[] = [];\n @Input() date = dayjs()\n @Input() today = dayjs();\n @Input() displayPaginator = true;\n @Input() displayDescription = true;\n @Output() onDateClick = new EventEmitter();\n @Output() dateChange = new EventEmitter();\n\n\n isToday(date: CalendarDate): boolean {\n return !!date.date.isSame(dayjs(), 'day');\n }\n\n isEndDay(date: CalendarDate): boolean {\n return !!date.date.isSame(dayjs().add(10, 'days'), 'day');\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.calendar) {\n this.el.nativeElement.style.setProperty('--row-num', this.calendar?.length || 0);\n }\n }\n\n
|
|
1
|
+
{"version":3,"file":"xxmachina-components-organisms-calendar-section.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/organisms/calendar-section/calendar-section.organism.ts","../../../../../packages/@xxmachina/components/src/lib/organisms/calendar-section/xxmachina-components-organisms-calendar-section.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, SimpleChanges, inject, OnChanges } from '@angular/core';\nimport { MatRippleModule } from '@angular/material/core';\n\nimport { CalendarDate, Schedule } from '@xxmachina/common/domain/models';\nimport { DailyCellMolecule } from '@xxmachina/components/molecules/daily-cell';\nimport { CalendarPaginatorMolecule } from '@xxmachina/components/molecules/calendar-paginator';\nimport { WeeklyHeaderMolecule } from '@xxmachina/components/molecules/weekly-header';\nimport dayjs from 'dayjs';\n\n@Component({\n standalone: true,\n imports: [\n CalendarPaginatorMolecule,\n DailyCellMolecule,\n WeeklyHeaderMolecule,\n MatRippleModule\n],\n selector: 'organisms-calendar-section',\n template: `\n <!-- <molecules-calendar-paginator\n *ngIf=\"displayPaginator\"\n [date]=\"date\"\n (dateChange)=\"dateChange.emit($event)\"\n /> -->\n <div class=\"calendar header\">\n <molecules-weekly-header/>\n </div>\n <div class=\"calendar contents\">\n @for (week of calendar; track week) {\n @for (date of week; track date) {\n <molecules-daily-cell\n [date]=\"date.date\"\n [schedules]=\"schedules\"\n [displayDate]=\"displayDays\"\n [marked]=\"isToday(date) || isEndDay(date)\"\n [markingColor]=\"isToday(date) ? '#6200EE' : isEndDay(date) ? '#B00020' : 'transparent'\"\n noSchedulesText=\"予定なし\"\n matRipple\n (click)=\"onDateClick.emit(date)\"\n ></molecules-daily-cell>\n }\n }\n </div>\n `,\n styleUrls: ['./calendar-section.organism.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CalendarSectionOrganism implements OnChanges {\n private el = inject(ElementRef);\n @Input() label = 'label';\n @Input() displayDays = true;\n @Input() readonly calendar!: CalendarDate[][];\n @Input() schedules: Schedule[] = [];\n @Input() date = dayjs()\n @Input() today = dayjs();\n @Input() displayPaginator = true;\n @Input() displayDescription = true;\n @Output() onDateClick = new EventEmitter();\n @Output() dateChange = new EventEmitter();\n\n\n isToday(date: CalendarDate): boolean {\n return !!date.date.isSame(dayjs(), 'day');\n }\n\n isEndDay(date: CalendarDate): boolean {\n return !!date.date.isSame(dayjs().add(10, 'days'), 'day');\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.calendar) {\n this.el.nativeElement.style.setProperty('--row-num', this.calendar?.length || 0);\n }\n }\n\n \n \n \n \n \n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MA+Ca,uBAAuB,CAAA;AAC1B,IAAA,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;IACtB,KAAK,GAAG,OAAO;IACf,WAAW,GAAG,IAAI;AACT,IAAA,QAAQ;IACjB,SAAS,GAAe,EAAE;IAC1B,IAAI,GAAG,KAAK,EAAE;IACd,KAAK,GAAG,KAAK,EAAE;IACf,gBAAgB,GAAG,IAAI;IACvB,kBAAkB,GAAG,IAAI;AACxB,IAAA,WAAW,GAAG,IAAI,YAAY,EAAE;AAChC,IAAA,UAAU,GAAG,IAAI,YAAY,EAAE;AAGzC,IAAA,OAAO,CAAC,IAAkB,EAAA;AACxB,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC;IAC3C;AAEA,IAAA,QAAQ,CAAC,IAAkB,EAAA;QACzB,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC;IAC3D;AAE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,EACjB,oBAAoB,EAAA,QAAA,EAAA,yBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACpB,eAAe,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,2BAAA,EAAA,MAAA,EAAA,CAAA,gBAAA,EAAA,oBAAA,EAAA,mBAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,mBAAA,EAAA,kBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAgCN,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAtCnC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,UAAA,EAAA,IAAI,EAAA,OAAA,EACP;wBACP,yBAAyB;wBACzB,iBAAiB;wBACjB,oBAAoB;wBACpB;AACH,qBAAA,EAAA,QAAA,EACW,4BAA4B,EAAA,QAAA,EAC5B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBT,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,08CAAA,CAAA,EAAA;;sBAI9C;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;;AC1DH;;AAEG;;;;"}
|
|
@@ -48,7 +48,6 @@ class EventInputSectionOrganism extends NgAtomicComponent {
|
|
|
48
48
|
endAt: new FormControl(dayjs(), Validators.required),
|
|
49
49
|
});
|
|
50
50
|
startValue = toSignal(getValue$(this.control.get(['startAt'])));
|
|
51
|
-
// 時間を15分刻みでHH:mmの配列にする
|
|
52
51
|
startAutoComplete = signal([...Array(24 * 4).keys()].map((i) => {
|
|
53
52
|
const hour = Math.floor(i / 4);
|
|
54
53
|
const minute = (i % 4) * 15;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xxmachina-components-organisms-event-input-section.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/organisms/event-input-section/event-input-section.organism.ts","../../../../../packages/@xxmachina/components/src/lib/organisms/event-input-section/xxmachina-components-organisms-event-input-section.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input, computed, inject, signal, OnInit } from '@angular/core';\n\nimport { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';\nimport { DateInputFieldMolecule } from '@ng-atomic/components/molecules/date-input-field';\nimport { TextInputFieldMolecule } from '@ng-atomic/components/molecules/text-input-field';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { NgAtomicComponent } from '@ng-atomic/core';\nimport { DayjsDateModule, getValue$ } from '@ng-atomic/common/utils';\nimport { MAT_DATE_FORMATS } from '@angular/material/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { SmartMenuButtonAtom } from '@ng-atomic/components/atoms/menu-button';\nimport { SelectInputFieldMolecule } from '@ng-atomic/components/molecules/select-input-field';\nimport dayjs from 'dayjs';\n\nenum ActionId {\n FIX_BUTTON_CLICK = '[@xxmachina/scheduler] Fix Button Click',\n DELETE_BUTTON_CLICK = '[@xxmachina/scheduler] Delete Button Click',\n}\n\nconst MAT_DAYJS_DATE_FORMATS = {\n parse: {\n dateInput: 'YYYY/MM/DD',\n },\n display: {\n dateInput: 'YYYY/MM/DD',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\n }\n}\n\n@Component({\n selector: 'organisms-event-input-section',\n standalone: true,\n imports: [\n DateInputFieldMolecule,\n TextInputFieldMolecule,\n SelectInputFieldMolecule,\n MatButtonModule,\n MatIconModule,\n DayjsDateModule,\n SmartMenuButtonAtom\n],\n template: `\n <div>\n <molecules-date-input-field\n [label]=\"'候補日'\"\n [control]=\"form.get(['date'])\"\n [toggle]=\"false\"\n />\n <molecules-select-input-field\n [label]=\"'開始時間'\"\n [control]=\"form.get(['startAt'])\"\n [options]=\"options()\"\n />\n <molecules-select-input-field\n [label]=\"'終了時間'\"\n [control]=\"form.get(['endAt'])\"\n [options]=\"options()\"\n />\n </div>\n <atoms-menu-button [actions]=\"fixActions\" (action)=\"dispatch($event)\"/>\n <atoms-menu-button [actions]=\"actions\" (action)=\"dispatch($event)\"/>\n\n `,\n styleUrls: ['./event-input-section.organism.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: MAT_DATE_FORMATS, useValue: MAT_DAYJS_DATE_FORMATS }],\n\n})\nexport class EventInputSectionOrganism extends NgAtomicComponent implements OnInit {\n static readonly ActionId = ActionId;\n protected form = inject(FormBuilder).group({\n date: [dayjs(), Validators.required],\n startAt: ['00:00'],\n endAt: ['01:00'],\n });\n\n fixActions = [\n { id: ActionId.FIX_BUTTON_CLICK, name: '決定', icon: 'check' },\n ];\n\n actions = [\n { id: ActionId.DELETE_BUTTON_CLICK, name: '削除', icon: 'delete' },\n ];\n\n @Input() label = '';\n\n @Input()\n control = new FormGroup<{startAt: FormControl<dayjs.Dayjs>, endAt: FormControl<dayjs.Dayjs>}>({\n startAt: new FormControl(dayjs(), Validators.required) as FormControl<dayjs.Dayjs>,\n endAt: new FormControl(dayjs(), Validators.required) as FormControl<dayjs.Dayjs>,\n });\n\n readonly startValue = toSignal(getValue$(this.control.get(['startAt'])!));\n\n
|
|
1
|
+
{"version":3,"file":"xxmachina-components-organisms-event-input-section.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/organisms/event-input-section/event-input-section.organism.ts","../../../../../packages/@xxmachina/components/src/lib/organisms/event-input-section/xxmachina-components-organisms-event-input-section.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input, computed, inject, signal, OnInit } from '@angular/core';\n\nimport { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';\nimport { DateInputFieldMolecule } from '@ng-atomic/components/molecules/date-input-field';\nimport { TextInputFieldMolecule } from '@ng-atomic/components/molecules/text-input-field';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { NgAtomicComponent } from '@ng-atomic/core';\nimport { DayjsDateModule, getValue$ } from '@ng-atomic/common/utils';\nimport { MAT_DATE_FORMATS } from '@angular/material/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { SmartMenuButtonAtom } from '@ng-atomic/components/atoms/menu-button';\nimport { SelectInputFieldMolecule } from '@ng-atomic/components/molecules/select-input-field';\nimport dayjs from 'dayjs';\n\nenum ActionId {\n FIX_BUTTON_CLICK = '[@xxmachina/scheduler] Fix Button Click',\n DELETE_BUTTON_CLICK = '[@xxmachina/scheduler] Delete Button Click',\n}\n\nconst MAT_DAYJS_DATE_FORMATS = {\n parse: {\n dateInput: 'YYYY/MM/DD',\n },\n display: {\n dateInput: 'YYYY/MM/DD',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\n }\n}\n\n@Component({\n selector: 'organisms-event-input-section',\n standalone: true,\n imports: [\n DateInputFieldMolecule,\n TextInputFieldMolecule,\n SelectInputFieldMolecule,\n MatButtonModule,\n MatIconModule,\n DayjsDateModule,\n SmartMenuButtonAtom\n],\n template: `\n <div>\n <molecules-date-input-field\n [label]=\"'候補日'\"\n [control]=\"form.get(['date'])\"\n [toggle]=\"false\"\n />\n <molecules-select-input-field\n [label]=\"'開始時間'\"\n [control]=\"form.get(['startAt'])\"\n [options]=\"options()\"\n />\n <molecules-select-input-field\n [label]=\"'終了時間'\"\n [control]=\"form.get(['endAt'])\"\n [options]=\"options()\"\n />\n </div>\n <atoms-menu-button [actions]=\"fixActions\" (action)=\"dispatch($event)\"/>\n <atoms-menu-button [actions]=\"actions\" (action)=\"dispatch($event)\"/>\n\n `,\n styleUrls: ['./event-input-section.organism.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: MAT_DATE_FORMATS, useValue: MAT_DAYJS_DATE_FORMATS }],\n\n})\nexport class EventInputSectionOrganism extends NgAtomicComponent implements OnInit {\n static readonly ActionId = ActionId;\n protected form = inject(FormBuilder).group({\n date: [dayjs(), Validators.required],\n startAt: ['00:00'],\n endAt: ['01:00'],\n });\n\n fixActions = [\n { id: ActionId.FIX_BUTTON_CLICK, name: '決定', icon: 'check' },\n ];\n\n actions = [\n { id: ActionId.DELETE_BUTTON_CLICK, name: '削除', icon: 'delete' },\n ];\n\n @Input() label = '';\n\n @Input()\n control = new FormGroup<{startAt: FormControl<dayjs.Dayjs>, endAt: FormControl<dayjs.Dayjs>}>({\n startAt: new FormControl(dayjs(), Validators.required) as FormControl<dayjs.Dayjs>,\n endAt: new FormControl(dayjs(), Validators.required) as FormControl<dayjs.Dayjs>,\n });\n\n readonly startValue = toSignal(getValue$(this.control.get(['startAt'])!));\n\n \n protected startAutoComplete = signal([...Array(24 * 4).keys()].map((i) => {\n const hour = Math.floor(i / 4);\n const minute = (i % 4) * 15;\n return `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;\n }));\n\n protected options = computed(() => {\n return this.startAutoComplete().map((value) => ({value, name: value}));\n });\n\n protected endAutoComplete = signal([...Array(24 * 4).keys()].map((i) => {\n const hour = Math.floor(i / 4);\n const minute = (i % 4) * 15;\n return `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;\n }));\n\n ngOnInit(): void {\n this.form.patchValue({\n date: this.control.get(['startAt'])!.value,\n startAt: this.control.get(['startAt'])!.value.format('HH:mm'),\n endAt: this.control.get(['endAt'])!.value.format('HH:mm'),\n })\n this.form.valueChanges.subscribe(({date, startAt, endAt}) => {\n this.control.patchValue({\n startAt: dayjs(`${date!.format('YYYY-MM-DD')}T${startAt}:00`),\n endAt: dayjs(`${date!.format('YYYY-MM-DD')}T${endAt}:00`),\n });\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAeA,IAAK,QAGJ;AAHD,CAAA,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