@memberjunction/ng-core-entity-forms 6.1.4 → 6.2.0-edge.1
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/README.md +22 -0
- package/dist/lib/custom/AIAgentCategories/ai-agent-category-overview.panel.d.ts +1 -1
- package/dist/lib/custom/AIAgentCategories/ai-agent-category-overview.panel.js +2 -2
- package/dist/lib/custom/AIAgentCategories/ai-agent-category-overview.panel.js.map +1 -1
- package/dist/lib/custom/AIAgentSessions/ai-agent-session-form.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/add-action-dialog.component.d.ts +90 -16
- package/dist/lib/custom/AIAgents/add-action-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/add-action-dialog.component.js +218 -70
- package/dist/lib/custom/AIAgents/add-action-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.d.ts +80 -16
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.js +146 -46
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts +329 -27
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js +794 -262
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-management.service.d.ts +76 -0
- package/dist/lib/custom/AIAgents/ai-agent-management.service.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-management.service.js +77 -33
- package/dist/lib/custom/AIAgents/ai-agent-management.service.js.map +1 -1
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.d.ts +69 -15
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.js +182 -74
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.d.ts +105 -25
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.js +272 -112
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.d.ts +32 -6
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.js +71 -19
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.service.d.ts +10 -0
- package/dist/lib/custom/AIAgents/new-agent-dialog.service.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.service.js +27 -7
- package/dist/lib/custom/AIAgents/new-agent-dialog.service.js.map +1 -1
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.d.ts +65 -15
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.js +152 -52
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.d.ts +81 -15
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.js +145 -45
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.d.ts +71 -17
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.js +175 -67
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.d.ts +173 -27
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js +385 -93
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js.map +1 -1
- package/dist/lib/custom/AIPromptRuns/chat-message-viewer.component.d.ts +64 -4
- package/dist/lib/custom/AIPromptRuns/chat-message-viewer.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPromptRuns/chat-message-viewer.component.js +129 -29
- package/dist/lib/custom/AIPromptRuns/chat-message-viewer.component.js.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts +260 -27
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js +686 -238
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-management.service.d.ts +10 -0
- package/dist/lib/custom/AIPrompts/ai-prompt-management.service.d.ts.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-management.service.js +17 -9
- package/dist/lib/custom/AIPrompts/ai-prompt-management.service.js.map +1 -1
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.d.ts +74 -16
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.js +174 -58
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/Actions/action-execution-log-form.component.d.ts +108 -14
- package/dist/lib/custom/Actions/action-execution-log-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Actions/action-execution-log-form.component.js +258 -70
- package/dist/lib/custom/Actions/action-execution-log-form.component.js.map +1 -1
- package/dist/lib/custom/Actions/action-form.component.d.ts +198 -14
- package/dist/lib/custom/Actions/action-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Actions/action-form.component.js +387 -107
- package/dist/lib/custom/Actions/action-form.component.js.map +1 -1
- package/dist/lib/custom/BridgeProviders/bridge-provider-features.d.ts +12 -6
- package/dist/lib/custom/BridgeProviders/bridge-provider-features.d.ts.map +1 -1
- package/dist/lib/custom/BridgeProviders/bridge-provider-features.js +41 -29
- package/dist/lib/custom/BridgeProviders/bridge-provider-features.js.map +1 -1
- package/dist/lib/custom/BridgeProviders/bridge-provider-form.component.js +14 -14
- package/dist/lib/custom/BridgeProviders/bridge-provider-form.component.js.map +1 -1
- package/dist/lib/custom/Companies/company-overview.panel.d.ts +1 -1
- package/dist/lib/custom/Companies/company-overview.panel.js +2 -2
- package/dist/lib/custom/Companies/company-overview.panel.js.map +1 -1
- package/dist/lib/custom/Conversations/conversation-overview.panel.d.ts +1 -1
- package/dist/lib/custom/Conversations/conversation-overview.panel.js +2 -2
- package/dist/lib/custom/Conversations/conversation-overview.panel.js.map +1 -1
- package/dist/lib/custom/Employees/employee-overview.panel.d.ts +1 -1
- package/dist/lib/custom/Employees/employee-overview.panel.js +2 -2
- package/dist/lib/custom/Employees/employee-overview.panel.js.map +1 -1
- package/dist/lib/custom/Entities/entity-form.component.d.ts +209 -28
- package/dist/lib/custom/Entities/entity-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Entities/entity-form.component.js +494 -138
- package/dist/lib/custom/Entities/entity-form.component.js.map +1 -1
- package/dist/lib/custom/EntityActions/entityaction.form.component.d.ts +5 -1
- package/dist/lib/custom/EntityActions/entityaction.form.component.d.ts.map +1 -1
- package/dist/lib/custom/EntityActions/entityaction.form.component.js +10 -2
- package/dist/lib/custom/EntityActions/entityaction.form.component.js.map +1 -1
- package/dist/lib/custom/Files/file-form.component.d.ts +1 -1
- package/dist/lib/custom/Files/file-form.component.js +2 -2
- package/dist/lib/custom/Files/file-form.component.js.map +1 -1
- package/dist/lib/custom/Lists/list-form.component.d.ts +300 -36
- package/dist/lib/custom/Lists/list-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Lists/list-form.component.js +664 -208
- package/dist/lib/custom/Lists/list-form.component.js.map +1 -1
- package/dist/lib/custom/MLModels/ml-model-form.component.d.ts +27 -0
- package/dist/lib/custom/MLModels/ml-model-form.component.d.ts.map +1 -0
- package/dist/lib/custom/MLModels/ml-model-form.component.js +193 -0
- package/dist/lib/custom/MLModels/ml-model-form.component.js.map +1 -0
- package/dist/lib/custom/MLModels/ml-model-view-models.d.ts +75 -0
- package/dist/lib/custom/MLModels/ml-model-view-models.d.ts.map +1 -0
- package/dist/lib/custom/MLModels/ml-model-view-models.js +244 -0
- package/dist/lib/custom/MLModels/ml-model-view-models.js.map +1 -0
- package/dist/lib/custom/MLModels/ps-model-detail.component.d.ts +173 -0
- package/dist/lib/custom/MLModels/ps-model-detail.component.d.ts.map +1 -0
- package/dist/lib/custom/MLModels/ps-model-detail.component.js +883 -0
- package/dist/lib/custom/MLModels/ps-model-detail.component.js.map +1 -0
- package/dist/lib/custom/Queries/query-form.component.d.ts +201 -26
- package/dist/lib/custom/Queries/query-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Queries/query-form.component.js +429 -109
- package/dist/lib/custom/Queries/query-form.component.js.map +1 -1
- package/dist/lib/custom/Queries/query-run-dialog.component.d.ts +107 -14
- package/dist/lib/custom/Queries/query-run-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/Queries/query-run-dialog.component.js +249 -79
- package/dist/lib/custom/Queries/query-run-dialog.component.js.map +1 -1
- package/dist/lib/custom/RecordProcesses/record-process-form.component.d.ts +133 -7
- package/dist/lib/custom/RecordProcesses/record-process-form.component.d.ts.map +1 -1
- package/dist/lib/custom/RecordProcesses/record-process-form.component.js +1268 -19
- package/dist/lib/custom/RecordProcesses/record-process-form.component.js.map +1 -1
- package/dist/lib/custom/SearchScopes/searchscope-form.component.d.ts +1 -1
- package/dist/lib/custom/SearchScopes/searchscope-form.component.js +4 -4
- package/dist/lib/custom/SearchScopes/searchscope-form.component.js.map +1 -1
- package/dist/lib/custom/SessionBridges/session-bridge-form.component.js.map +1 -1
- package/dist/lib/custom/Templates/template-param-dialog.component.d.ts +77 -13
- package/dist/lib/custom/Templates/template-param-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/Templates/template-param-dialog.component.js +196 -78
- package/dist/lib/custom/Templates/template-param-dialog.component.js.map +1 -1
- package/dist/lib/custom/Templates/template-params-grid.component.d.ts +49 -7
- package/dist/lib/custom/Templates/template-params-grid.component.d.ts.map +1 -1
- package/dist/lib/custom/Templates/template-params-grid.component.js +132 -44
- package/dist/lib/custom/Templates/template-params-grid.component.js.map +1 -1
- package/dist/lib/custom/Templates/templates-form.component.d.ts +142 -17
- package/dist/lib/custom/Templates/templates-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Templates/templates-form.component.js +333 -113
- package/dist/lib/custom/Templates/templates-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/entity-link-pill.component.d.ts +24 -4
- package/dist/lib/custom/Tests/entity-link-pill.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/entity-link-pill.component.js +64 -20
- package/dist/lib/custom/Tests/entity-link-pill.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-form.component.d.ts +217 -27
- package/dist/lib/custom/Tests/test-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-form.component.js +549 -169
- package/dist/lib/custom/Tests/test-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-run-checks.d.ts +2 -0
- package/dist/lib/custom/Tests/test-run-checks.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-run-checks.js +5 -1
- package/dist/lib/custom/Tests/test-run-checks.js.map +1 -1
- package/dist/lib/custom/Tests/test-run-feedback-form.component.d.ts +2 -0
- package/dist/lib/custom/Tests/test-run-feedback-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-run-feedback-form.component.js +5 -1
- package/dist/lib/custom/Tests/test-run-feedback-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-run-form.component.d.ts +146 -18
- package/dist/lib/custom/Tests/test-run-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-run-form.component.js +362 -106
- package/dist/lib/custom/Tests/test-run-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-suite-form.component.d.ts +390 -47
- package/dist/lib/custom/Tests/test-suite-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-suite-form.component.js +1015 -343
- package/dist/lib/custom/Tests/test-suite-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-suite-run-form.component.d.ts +214 -26
- package/dist/lib/custom/Tests/test-suite-run-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-suite-run-form.component.js +535 -159
- package/dist/lib/custom/Tests/test-suite-run-form.component.js.map +1 -1
- package/dist/lib/custom/Users/user-overview.panel.d.ts +1 -1
- package/dist/lib/custom/Users/user-overview.panel.js +2 -2
- package/dist/lib/custom/Users/user-overview.panel.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.d.ts +208 -29
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.js +446 -138
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-cost.service.d.ts +6 -0
- package/dist/lib/custom/ai-agent-run/ai-agent-run-cost.service.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-cost.service.js +16 -4
- package/dist/lib/custom/ai-agent-run/ai-agent-run-cost.service.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.d.ts +50 -6
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.js +84 -12
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-detail.component.d.ts +89 -5
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-detail.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-detail.component.js +216 -70
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-detail.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-node.component.d.ts +62 -3
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-node.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-node.component.js +140 -42
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-node.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.d.ts +81 -10
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.js +165 -37
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.d.ts +121 -14
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js +287 -79
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.component.d.ts +101 -15
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.component.js +281 -97
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.model.d.ts +43 -25
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.model.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.model.js +100 -64
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.model.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/constellation.component.d.ts +14 -2
- package/dist/lib/custom/ai-agent-run/flow/constellation.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/constellation.component.js +71 -53
- package/dist/lib/custom/ai-agent-run/flow/constellation.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/flame-cascade.component.d.ts +14 -2
- package/dist/lib/custom/ai-agent-run/flow/flame-cascade.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/flame-cascade.component.js +70 -52
- package/dist/lib/custom/ai-agent-run/flow/flame-cascade.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/flow-svg.util.d.ts +8 -0
- package/dist/lib/custom/ai-agent-run/flow/flow-svg.util.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/flow-svg.util.js +22 -6
- package/dist/lib/custom/ai-agent-run/flow/flow-svg.util.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/flowchart.component.d.ts +24 -2
- package/dist/lib/custom/ai-agent-run/flow/flowchart.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/flowchart.component.js +91 -59
- package/dist/lib/custom/ai-agent-run/flow/flowchart.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/pan-zoom.d.ts +10 -2
- package/dist/lib/custom/ai-agent-run/flow/pan-zoom.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/pan-zoom.js +33 -17
- package/dist/lib/custom/ai-agent-run/flow/pan-zoom.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/run-tree-flow-projection.d.ts +2 -0
- package/dist/lib/custom/ai-agent-run/flow/run-tree-flow-projection.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/run-tree-flow-projection.js +34 -30
- package/dist/lib/custom/ai-agent-run/flow/run-tree-flow-projection.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/subway-lines.component.d.ts +14 -2
- package/dist/lib/custom/ai-agent-run/flow/subway-lines.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/subway-lines.component.js +69 -51
- package/dist/lib/custom/ai-agent-run/flow/subway-lines.component.js.map +1 -1
- package/dist/lib/custom/custom-forms.module.d.ts +32 -30
- package/dist/lib/custom/custom-forms.module.d.ts.map +1 -1
- package/dist/lib/custom/custom-forms.module.js +21 -4
- package/dist/lib/custom/custom-forms.module.js.map +1 -1
- package/dist/lib/custom/shared/entity-selector-dialog.component.d.ts +38 -12
- package/dist/lib/custom/shared/entity-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/shared/entity-selector-dialog.component.js +103 -51
- package/dist/lib/custom/shared/entity-selector-dialog.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIPrompt/mjaiprompt.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIPrompt/mjaiprompt.form.component.js +62 -26
- package/dist/lib/generated/Entities/MJAIPrompt/mjaiprompt.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIPromptRun/mjaipromptrun.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIPromptRun/mjaipromptrun.form.component.js +59 -51
- package/dist/lib/generated/Entities/MJAIPromptRun/mjaipromptrun.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIVendor/mjaivendor.form.component.js +76 -74
- package/dist/lib/generated/Entities/MJAIVendor/mjaivendor.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJCredential/mjcredential.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJCredential/mjcredential.form.component.js +33 -15
- package/dist/lib/generated/Entities/MJCredential/mjcredential.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.js +100 -82
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJEntityField/mjentityfield.form.component.js +24 -20
- package/dist/lib/generated/Entities/MJEntityField/mjentityfield.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJFeatureValue/mjfeaturevalue.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJFeatureValue/mjfeaturevalue.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJFeatureValue/mjfeaturevalue.form.component.js +122 -0
- package/dist/lib/generated/Entities/MJFeatureValue/mjfeaturevalue.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJFeatureValueCache/mjfeaturevaluecache.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJFeatureValueCache/mjfeaturevaluecache.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJFeatureValueCache/mjfeaturevaluecache.form.component.js +125 -0
- package/dist/lib/generated/Entities/MJFeatureValueCache/mjfeaturevaluecache.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJProcessRun/mjprocessrun.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJProcessRun/mjprocessrun.form.component.js +23 -5
- package/dist/lib/generated/Entities/MJProcessRun/mjprocessrun.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJProcessRunDetail/mjprocessrundetail.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJProcessRunDetail/mjprocessrundetail.form.component.js +25 -6
- package/dist/lib/generated/Entities/MJProcessRunDetail/mjprocessrundetail.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJProject/mjproject.form.component.js +27 -25
- package/dist/lib/generated/Entities/MJProject/mjproject.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJQuery/mjquery.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJQuery/mjquery.form.component.js +11 -15
- package/dist/lib/generated/Entities/MJQuery/mjquery.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJRecordProcess/mjrecordprocess.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJRecordProcess/mjrecordprocess.form.component.js +43 -7
- package/dist/lib/generated/Entities/MJRecordProcess/mjrecordprocess.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js +155 -119
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJWebSearchProvider/mjwebsearchprovider.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJWebSearchProvider/mjwebsearchprovider.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJWebSearchProvider/mjwebsearchprovider.form.component.js +78 -0
- package/dist/lib/generated/Entities/MJWebSearchProvider/mjwebsearchprovider.form.component.js.map +1 -0
- package/dist/lib/generated/generated-forms.module.d.ts +240 -237
- package/dist/lib/generated/generated-forms.module.d.ts.map +1 -1
- package/dist/lib/generated/generated-forms.module.js +11 -2
- package/dist/lib/generated/generated-forms.module.js.map +1 -1
- package/dist/lib/panels/ai-skill-sharing/ai-skill-sharing-panel.component.d.ts +5 -1
- package/dist/lib/panels/ai-skill-sharing/ai-skill-sharing-panel.component.d.ts.map +1 -1
- package/dist/lib/panels/ai-skill-sharing/ai-skill-sharing-panel.component.js +11 -3
- package/dist/lib/panels/ai-skill-sharing/ai-skill-sharing-panel.component.js.map +1 -1
- package/dist/lib/panels/content-sources/tag-pipeline-configuration.panel.d.ts +2 -0
- package/dist/lib/panels/content-sources/tag-pipeline-configuration.panel.d.ts.map +1 -1
- package/dist/lib/panels/content-sources/tag-pipeline-configuration.panel.js +16 -12
- package/dist/lib/panels/content-sources/tag-pipeline-configuration.panel.js.map +1 -1
- package/dist/lib/panels/content-sources/website-crawler-settings.panel.d.ts +1 -1
- package/dist/lib/panels/content-sources/website-crawler-settings.panel.js +2 -2
- package/dist/lib/panels/content-sources/website-crawler-settings.panel.js.map +1 -1
- package/dist/lib/panels/model-predictions/model-prediction.logic.d.ts +122 -1
- package/dist/lib/panels/model-predictions/model-prediction.logic.d.ts.map +1 -1
- package/dist/lib/panels/model-predictions/model-prediction.logic.js +236 -11
- package/dist/lib/panels/model-predictions/model-prediction.logic.js.map +1 -1
- package/dist/lib/panels/model-predictions/model-prediction.panel.d.ts +72 -13
- package/dist/lib/panels/model-predictions/model-prediction.panel.d.ts.map +1 -1
- package/dist/lib/panels/model-predictions/model-prediction.panel.js +577 -78
- package/dist/lib/panels/model-predictions/model-prediction.panel.js.map +1 -1
- package/dist/lib/shared/components/template-editor.component.d.ts +133 -14
- package/dist/lib/shared/components/template-editor.component.d.ts.map +1 -1
- package/dist/lib/shared/components/template-editor.component.js +322 -124
- package/dist/lib/shared/components/template-editor.component.js.map +1 -1
- package/dist/public-api.d.ts +4 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +4 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +43 -41
|
@@ -107,7 +107,7 @@ function TemplateSelectorDialogComponent_Conditional_21_For_2_Template(rf, ctx)
|
|
|
107
107
|
const ctx_r3 = i0.ɵɵnextContext(2);
|
|
108
108
|
i0.ɵɵclassProp("selected", ctx_r3.isTemplateSelected(template_r3));
|
|
109
109
|
i0.ɵɵadvance(2);
|
|
110
|
-
i0.ɵɵconditional(ctx_r3.config.
|
|
110
|
+
i0.ɵɵconditional(ctx_r3.config.MultiSelect ? 2 : 3);
|
|
111
111
|
i0.ɵɵadvance(5);
|
|
112
112
|
i0.ɵɵtextInterpolate(template_r3.Name);
|
|
113
113
|
i0.ɵɵadvance(2);
|
|
@@ -157,33 +157,105 @@ function TemplateSelectorDialogComponent_Conditional_25_Template(rf, ctx) { if (
|
|
|
157
157
|
* This dialog provides a searchable interface with category filtering and template preview.
|
|
158
158
|
*/
|
|
159
159
|
export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
160
|
+
/** @deprecated Use {@link Result}. */
|
|
161
|
+
get result() {
|
|
162
|
+
return this.Result;
|
|
163
|
+
}
|
|
164
|
+
/** @deprecated Use {@link Result}. */
|
|
165
|
+
set result(value) {
|
|
166
|
+
this.Result = value;
|
|
167
|
+
}
|
|
168
|
+
/** @deprecated Use {@link IsLoading$}. */
|
|
169
|
+
get isLoading$() {
|
|
170
|
+
return this.IsLoading$;
|
|
171
|
+
}
|
|
172
|
+
/** @deprecated Use {@link IsLoading$}. */
|
|
173
|
+
set isLoading$(value) {
|
|
174
|
+
this.IsLoading$ = value;
|
|
175
|
+
}
|
|
176
|
+
/** @deprecated Use {@link Templates$}. */
|
|
177
|
+
get templates$() {
|
|
178
|
+
return this.Templates$;
|
|
179
|
+
}
|
|
180
|
+
/** @deprecated Use {@link Templates$}. */
|
|
181
|
+
set templates$(value) {
|
|
182
|
+
this.Templates$ = value;
|
|
183
|
+
}
|
|
184
|
+
/** @deprecated Use {@link FilteredTemplates$}. */
|
|
185
|
+
get filteredTemplates$() {
|
|
186
|
+
return this.FilteredTemplates$;
|
|
187
|
+
}
|
|
188
|
+
/** @deprecated Use {@link FilteredTemplates$}. */
|
|
189
|
+
set filteredTemplates$(value) {
|
|
190
|
+
this.FilteredTemplates$ = value;
|
|
191
|
+
}
|
|
192
|
+
/** @deprecated Use {@link Categories$}. */
|
|
193
|
+
get categories$() {
|
|
194
|
+
return this.Categories$;
|
|
195
|
+
}
|
|
196
|
+
/** @deprecated Use {@link Categories$}. */
|
|
197
|
+
set categories$(value) {
|
|
198
|
+
this.Categories$ = value;
|
|
199
|
+
}
|
|
200
|
+
/** @deprecated Use {@link SearchControl}. */
|
|
201
|
+
get searchControl() {
|
|
202
|
+
return this.SearchControl;
|
|
203
|
+
}
|
|
204
|
+
/** @deprecated Use {@link SearchControl}. */
|
|
205
|
+
set searchControl(value) {
|
|
206
|
+
this.SearchControl = value;
|
|
207
|
+
}
|
|
208
|
+
/** @deprecated Use {@link SelectedCategory}. */
|
|
209
|
+
get selectedCategory() {
|
|
210
|
+
return this.SelectedCategory;
|
|
211
|
+
}
|
|
212
|
+
/** @deprecated Use {@link SelectedCategory}. */
|
|
213
|
+
set selectedCategory(value) {
|
|
214
|
+
this.SelectedCategory = value;
|
|
215
|
+
}
|
|
216
|
+
/** @deprecated Use {@link SelectedTemplates}. */
|
|
217
|
+
get selectedTemplates() {
|
|
218
|
+
return this.SelectedTemplates;
|
|
219
|
+
}
|
|
220
|
+
/** @deprecated Use {@link SelectedTemplates}. */
|
|
221
|
+
set selectedTemplates(value) {
|
|
222
|
+
this.SelectedTemplates = value;
|
|
223
|
+
}
|
|
224
|
+
/** @deprecated Use {@link ViewMode}. */
|
|
225
|
+
get viewMode() {
|
|
226
|
+
return this.ViewMode;
|
|
227
|
+
}
|
|
228
|
+
/** @deprecated Use {@link ViewMode}. */
|
|
229
|
+
set viewMode(value) {
|
|
230
|
+
this.ViewMode = value;
|
|
231
|
+
}
|
|
160
232
|
constructor(cdr) {
|
|
161
233
|
super();
|
|
162
234
|
this.cdr = cdr;
|
|
163
235
|
// Input configuration
|
|
164
|
-
this.config = {
|
|
236
|
+
this.config = { Title: 'Select Template' };
|
|
165
237
|
// State management
|
|
166
238
|
this.destroy$ = new Subject();
|
|
167
|
-
this.
|
|
239
|
+
this.Result = new Subject();
|
|
168
240
|
// Data and UI state
|
|
169
|
-
this.
|
|
170
|
-
this.
|
|
171
|
-
this.
|
|
172
|
-
this.
|
|
241
|
+
this.IsLoading$ = new BehaviorSubject(false);
|
|
242
|
+
this.Templates$ = new BehaviorSubject([]);
|
|
243
|
+
this.FilteredTemplates$ = new BehaviorSubject([]);
|
|
244
|
+
this.Categories$ = new BehaviorSubject([]);
|
|
173
245
|
// Search and filtering
|
|
174
|
-
this.
|
|
175
|
-
this.
|
|
176
|
-
this.
|
|
246
|
+
this.SearchControl = new FormControl('');
|
|
247
|
+
this.SelectedCategory = null;
|
|
248
|
+
this.SelectedTemplates = new Set();
|
|
177
249
|
// View mode
|
|
178
|
-
this.
|
|
250
|
+
this.ViewMode = 'list';
|
|
179
251
|
this.DialogClose = new EventEmitter();
|
|
180
252
|
}
|
|
181
253
|
ngOnInit() {
|
|
182
254
|
this.setupSearch();
|
|
183
255
|
this.loadData();
|
|
184
256
|
// Initialize selected templates if provided
|
|
185
|
-
if (this.config.
|
|
186
|
-
this.
|
|
257
|
+
if (this.config.SelectedTemplateIds) {
|
|
258
|
+
this.SelectedTemplates = new Set(this.config.SelectedTemplateIds);
|
|
187
259
|
}
|
|
188
260
|
}
|
|
189
261
|
ngOnDestroy() {
|
|
@@ -191,14 +263,14 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
191
263
|
this.destroy$.complete();
|
|
192
264
|
}
|
|
193
265
|
setupSearch() {
|
|
194
|
-
this.
|
|
266
|
+
this.SearchControl.valueChanges
|
|
195
267
|
.pipe(debounceTime(300), distinctUntilChanged(), takeUntil(this.destroy$))
|
|
196
268
|
.subscribe(searchTerm => {
|
|
197
269
|
this.filterTemplates(searchTerm || '');
|
|
198
270
|
});
|
|
199
271
|
}
|
|
200
272
|
async loadData() {
|
|
201
|
-
this.
|
|
273
|
+
this.IsLoading$.next(true);
|
|
202
274
|
try {
|
|
203
275
|
// Load both templates and categories in parallel
|
|
204
276
|
await Promise.all([
|
|
@@ -211,7 +283,7 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
211
283
|
MJNotificationService.Instance.CreateSimpleNotification('Error loading templates. Please try again.', 'error', 3000);
|
|
212
284
|
}
|
|
213
285
|
finally {
|
|
214
|
-
this.
|
|
286
|
+
this.IsLoading$.next(false);
|
|
215
287
|
}
|
|
216
288
|
}
|
|
217
289
|
async loadTemplates() {
|
|
@@ -219,11 +291,11 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
219
291
|
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
220
292
|
// Build filter
|
|
221
293
|
let filter = '';
|
|
222
|
-
if (this.config.
|
|
294
|
+
if (this.config.ShowActiveOnly !== false) {
|
|
223
295
|
filter = "IsActive = 1";
|
|
224
296
|
}
|
|
225
|
-
if (this.config.
|
|
226
|
-
filter += filter ? ` AND ${this.config.
|
|
297
|
+
if (this.config.ExtraFilter) {
|
|
298
|
+
filter += filter ? ` AND ${this.config.ExtraFilter}` : this.config.ExtraFilter;
|
|
227
299
|
}
|
|
228
300
|
const result = await rv.RunView({
|
|
229
301
|
EntityName: 'MJ: Templates',
|
|
@@ -234,8 +306,8 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
234
306
|
});
|
|
235
307
|
if (result.Success) {
|
|
236
308
|
const templates = result.Results || [];
|
|
237
|
-
this.
|
|
238
|
-
this.
|
|
309
|
+
this.Templates$.next(templates);
|
|
310
|
+
this.FilteredTemplates$.next(templates);
|
|
239
311
|
}
|
|
240
312
|
else {
|
|
241
313
|
throw new Error(result.ErrorMessage || 'Failed to load templates');
|
|
@@ -243,8 +315,8 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
243
315
|
}
|
|
244
316
|
catch (error) {
|
|
245
317
|
console.error('Error loading templates:', error);
|
|
246
|
-
this.
|
|
247
|
-
this.
|
|
318
|
+
this.Templates$.next([]);
|
|
319
|
+
this.FilteredTemplates$.next([]);
|
|
248
320
|
}
|
|
249
321
|
}
|
|
250
322
|
async loadCategories() {
|
|
@@ -259,7 +331,7 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
259
331
|
});
|
|
260
332
|
if (result.Success) {
|
|
261
333
|
const categories = result.Results || [];
|
|
262
|
-
this.
|
|
334
|
+
this.Categories$.next(categories);
|
|
263
335
|
}
|
|
264
336
|
else {
|
|
265
337
|
throw new Error(result.ErrorMessage || 'Failed to load categories');
|
|
@@ -267,11 +339,11 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
267
339
|
}
|
|
268
340
|
catch (error) {
|
|
269
341
|
console.error('Error loading categories:', error);
|
|
270
|
-
this.
|
|
342
|
+
this.Categories$.next([]);
|
|
271
343
|
}
|
|
272
344
|
}
|
|
273
345
|
filterTemplates(searchTerm) {
|
|
274
|
-
const allTemplates = this.
|
|
346
|
+
const allTemplates = this.Templates$.value;
|
|
275
347
|
let filtered = allTemplates;
|
|
276
348
|
// Apply search filter
|
|
277
349
|
if (searchTerm.trim()) {
|
|
@@ -279,48 +351,72 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
279
351
|
template.Description?.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
280
352
|
}
|
|
281
353
|
// Apply category filter
|
|
282
|
-
if (this.
|
|
283
|
-
filtered = filtered.filter(template => UUIDsEqual(template.CategoryID, this.
|
|
354
|
+
if (this.SelectedCategory) {
|
|
355
|
+
filtered = filtered.filter(template => UUIDsEqual(template.CategoryID, this.SelectedCategory));
|
|
284
356
|
}
|
|
285
|
-
this.
|
|
357
|
+
this.FilteredTemplates$.next(filtered);
|
|
286
358
|
}
|
|
287
359
|
// === Category Management ===
|
|
360
|
+
OnCategoryChange(categoryId) {
|
|
361
|
+
this.SelectedCategory = categoryId === '' ? null : categoryId;
|
|
362
|
+
this.filterTemplates(this.SearchControl.value || '');
|
|
363
|
+
}
|
|
364
|
+
/** @deprecated Use {@link OnCategoryChange}. */
|
|
288
365
|
onCategoryChange(categoryId) {
|
|
289
|
-
this.
|
|
290
|
-
this.filterTemplates(this.searchControl.value || '');
|
|
366
|
+
return this.OnCategoryChange(categoryId);
|
|
291
367
|
}
|
|
292
|
-
|
|
293
|
-
const category = this.
|
|
368
|
+
GetCategoryDisplayName(categoryId) {
|
|
369
|
+
const category = this.Categories$.value.find(c => UUIDsEqual(c.ID, categoryId));
|
|
294
370
|
return category?.Name || 'Unknown Category';
|
|
295
371
|
}
|
|
372
|
+
/** @deprecated Use {@link GetCategoryDisplayName}. */
|
|
373
|
+
getCategoryDisplayName(categoryId) {
|
|
374
|
+
return this.GetCategoryDisplayName(categoryId);
|
|
375
|
+
}
|
|
296
376
|
// === Selection Management ===
|
|
297
|
-
|
|
298
|
-
if (this.config.
|
|
299
|
-
if (this.
|
|
300
|
-
this.
|
|
377
|
+
ToggleTemplateSelection(template) {
|
|
378
|
+
if (this.config.MultiSelect) {
|
|
379
|
+
if (this.SelectedTemplates.has(template.ID)) {
|
|
380
|
+
this.SelectedTemplates.delete(template.ID);
|
|
301
381
|
}
|
|
302
382
|
else {
|
|
303
|
-
this.
|
|
383
|
+
this.SelectedTemplates.add(template.ID);
|
|
304
384
|
}
|
|
305
385
|
}
|
|
306
386
|
else {
|
|
307
387
|
// Single select - replace current selection
|
|
308
|
-
this.
|
|
309
|
-
this.
|
|
388
|
+
this.SelectedTemplates.clear();
|
|
389
|
+
this.SelectedTemplates.add(template.ID);
|
|
310
390
|
}
|
|
311
391
|
}
|
|
392
|
+
/** @deprecated Use {@link ToggleTemplateSelection}. */
|
|
393
|
+
toggleTemplateSelection(template) {
|
|
394
|
+
return this.ToggleTemplateSelection(template);
|
|
395
|
+
}
|
|
396
|
+
IsTemplateSelected(template) {
|
|
397
|
+
return this.SelectedTemplates.has(template.ID);
|
|
398
|
+
}
|
|
399
|
+
/** @deprecated Use {@link IsTemplateSelected}. */
|
|
312
400
|
isTemplateSelected(template) {
|
|
313
|
-
return this.
|
|
401
|
+
return this.IsTemplateSelected(template);
|
|
402
|
+
}
|
|
403
|
+
GetSelectedTemplateObjects() {
|
|
404
|
+
const allTemplates = this.Templates$.value;
|
|
405
|
+
return allTemplates.filter(template => this.SelectedTemplates.has(template.ID));
|
|
314
406
|
}
|
|
407
|
+
/** @deprecated Use {@link GetSelectedTemplateObjects}. */
|
|
315
408
|
getSelectedTemplateObjects() {
|
|
316
|
-
|
|
317
|
-
return allTemplates.filter(template => this.selectedTemplates.has(template.ID));
|
|
409
|
+
return this.GetSelectedTemplateObjects();
|
|
318
410
|
}
|
|
319
411
|
// === UI Helpers ===
|
|
412
|
+
ToggleViewMode() {
|
|
413
|
+
this.ViewMode = this.ViewMode === 'grid' ? 'list' : 'grid';
|
|
414
|
+
}
|
|
415
|
+
/** @deprecated Use {@link ToggleViewMode}. */
|
|
320
416
|
toggleViewMode() {
|
|
321
|
-
|
|
417
|
+
return this.ToggleViewMode();
|
|
322
418
|
}
|
|
323
|
-
|
|
419
|
+
GetTemplateStatusColor(template) {
|
|
324
420
|
if (!template.IsActive)
|
|
325
421
|
return '#6c757d';
|
|
326
422
|
if (template.DisabledAt && new Date(template.DisabledAt) <= new Date())
|
|
@@ -329,7 +425,11 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
329
425
|
return '#ffc107';
|
|
330
426
|
return '#28a745';
|
|
331
427
|
}
|
|
332
|
-
|
|
428
|
+
/** @deprecated Use {@link GetTemplateStatusColor}. */
|
|
429
|
+
getTemplateStatusColor(template) {
|
|
430
|
+
return this.GetTemplateStatusColor(template);
|
|
431
|
+
}
|
|
432
|
+
GetTemplateStatusText(template) {
|
|
333
433
|
if (!template.IsActive)
|
|
334
434
|
return 'Inactive';
|
|
335
435
|
if (template.DisabledAt && new Date(template.DisabledAt) <= new Date())
|
|
@@ -338,13 +438,21 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
338
438
|
return 'Scheduled';
|
|
339
439
|
return 'Active';
|
|
340
440
|
}
|
|
341
|
-
|
|
441
|
+
/** @deprecated Use {@link GetTemplateStatusText}. */
|
|
442
|
+
getTemplateStatusText(template) {
|
|
443
|
+
return this.GetTemplateStatusText(template);
|
|
444
|
+
}
|
|
445
|
+
GetTemplatePreview(template) {
|
|
342
446
|
if (!template.Description)
|
|
343
447
|
return 'No description available';
|
|
344
448
|
return template.Description.length > 100
|
|
345
449
|
? template.Description.substring(0, 100) + '...'
|
|
346
450
|
: template.Description;
|
|
347
451
|
}
|
|
452
|
+
/** @deprecated Use {@link GetTemplatePreview}. */
|
|
453
|
+
getTemplatePreview(template) {
|
|
454
|
+
return this.GetTemplatePreview(template);
|
|
455
|
+
}
|
|
348
456
|
formatDate(date) {
|
|
349
457
|
if (!date)
|
|
350
458
|
return '';
|
|
@@ -352,28 +460,36 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
352
460
|
return d.toLocaleDateString();
|
|
353
461
|
}
|
|
354
462
|
// === Dialog Actions ===
|
|
355
|
-
|
|
356
|
-
const selectedTemplateObjects = this.
|
|
463
|
+
SelectTemplates() {
|
|
464
|
+
const selectedTemplateObjects = this.GetSelectedTemplateObjects();
|
|
357
465
|
if (selectedTemplateObjects.length === 0) {
|
|
358
466
|
MJNotificationService.Instance.CreateSimpleNotification('Please select at least one template', 'warning', 2000);
|
|
359
467
|
return;
|
|
360
468
|
}
|
|
361
469
|
const result = {
|
|
362
|
-
|
|
470
|
+
SelectedTemplates: selectedTemplateObjects
|
|
363
471
|
};
|
|
364
|
-
this.
|
|
472
|
+
this.Result.next(result);
|
|
365
473
|
this.DialogClose.emit();
|
|
366
474
|
}
|
|
367
|
-
|
|
475
|
+
/** @deprecated Use {@link SelectTemplates}. */
|
|
476
|
+
selectTemplates() {
|
|
477
|
+
return this.SelectTemplates();
|
|
478
|
+
}
|
|
479
|
+
CreateNew() {
|
|
368
480
|
const result = {
|
|
369
|
-
|
|
481
|
+
SelectedTemplates: [],
|
|
370
482
|
createNew: true
|
|
371
483
|
};
|
|
372
|
-
this.
|
|
484
|
+
this.Result.next(result);
|
|
373
485
|
this.DialogClose.emit();
|
|
374
486
|
}
|
|
487
|
+
/** @deprecated Use {@link CreateNew}. */
|
|
488
|
+
createNew() {
|
|
489
|
+
return this.CreateNew();
|
|
490
|
+
}
|
|
375
491
|
cancel() {
|
|
376
|
-
this.
|
|
492
|
+
this.Result.next(null);
|
|
377
493
|
this.DialogClose.emit();
|
|
378
494
|
}
|
|
379
495
|
static { this.ɵfac = function TemplateSelectorDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TemplateSelectorDialogComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); }; }
|
|
@@ -414,7 +530,7 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
414
530
|
i0.ɵɵelementEnd()()()();
|
|
415
531
|
} if (rf & 2) {
|
|
416
532
|
i0.ɵɵadvance(3);
|
|
417
|
-
i0.ɵɵtextInterpolate(ctx.config.
|
|
533
|
+
i0.ɵɵtextInterpolate(ctx.config.Title);
|
|
418
534
|
i0.ɵɵadvance(3);
|
|
419
535
|
i0.ɵɵclassMap(ctx.viewMode === "list" ? "fa-solid fa-th" : "fa-solid fa-list");
|
|
420
536
|
i0.ɵɵadvance();
|
|
@@ -430,7 +546,7 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
430
546
|
i0.ɵɵadvance(2);
|
|
431
547
|
i0.ɵɵconditional(!i0.ɵɵpipeBind1(22, 15, ctx.isLoading$) ? 21 : -1);
|
|
432
548
|
i0.ɵɵadvance(4);
|
|
433
|
-
i0.ɵɵconditional(ctx.config.
|
|
549
|
+
i0.ɵɵconditional(ctx.config.ShowCreateNew ? 25 : -1);
|
|
434
550
|
i0.ɵɵadvance(3);
|
|
435
551
|
i0.ɵɵproperty("disabled", ctx.selectedTemplates.size === 0);
|
|
436
552
|
i0.ɵɵadvance(2);
|
|
@@ -439,7 +555,7 @@ export class TemplateSelectorDialogComponent extends BaseAngularComponent {
|
|
|
439
555
|
}
|
|
440
556
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TemplateSelectorDialogComponent, [{
|
|
441
557
|
type: Component,
|
|
442
|
-
args: [{ selector: 'mj-template-selector-dialog', standalone: true, imports: [CommonModule, ReactiveFormsModule], template: "<!-- Template Selector Dialog -->\n<div class=\"template-selector-dialog\">\n <!-- Header -->\n <div class=\"dialog-header\">\n <h3>{{ config.title }}</h3>\n <div class=\"header-actions\">\n <button\n mjButton\n size=\"sm\"\n (click)=\"toggleViewMode()\"\n >\n <i [class]=\"viewMode === 'list' ? 'fa-solid fa-th' : 'fa-solid fa-list'\"></i>\n {{ viewMode === 'list' ? 'Grid' : 'List' }}\n </button>\n </div>\n </div>\n\n <!-- Search and Filter Section -->\n <div class=\"search-filter-section\">\n <!-- Search Input -->\n <div class=\"search-container\">\n <input\n class=\"mj-input\"\n type=\"text\"\n [formControl]=\"searchControl\"\n placeholder=\"Search templates...\"\n />\n <i class=\"fa-solid fa-search search-icon\"></i>\n </div>\n\n <!-- Category Filter -->\n <div class=\"category-filter\">\n <select\n class=\"mj-input\"\n [value]=\"selectedCategory || ''\"\n (change)=\"onCategoryChange($any($event.target).value || null)\"\n >\n <option value=\"\">All Categories</option>\n @for (category of categories$ | async; track category.ID) {\n <option [value]=\"category.ID\">{{ category.Name }}</option>\n }\n </select>\n </div>\n </div>\n\n <!-- Loading State -->\n @if (isLoading$ | async) {\n <div class=\"loading-container\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading templates...</span>\n </div>\n }\n\n <!-- Template List/Grid -->\n @if (!(isLoading$ | async)) {\n <div class=\"templates-container\" [class.grid-mode]=\"viewMode === 'grid'\">\n @for (template of filteredTemplates$ | async; track template.ID) {\n <div \n class=\"template-item\"\n [class.selected]=\"isTemplateSelected(template)\"\n (click)=\"toggleTemplateSelection(template)\"\n >\n <!-- Selection Checkbox -->\n <div class=\"selection-indicator\">\n @if (config.multiSelect) {\n <input\n type=\"checkbox\"\n [checked]=\"isTemplateSelected(template)\"\n (change)=\"toggleTemplateSelection(template)\"\n />\n } @else {\n <input\n type=\"radio\"\n [checked]=\"isTemplateSelected(template)\"\n (change)=\"toggleTemplateSelection(template)\"\n />\n }\n </div>\n\n <!-- Template Info -->\n <div class=\"template-info\">\n <div class=\"template-header\">\n <h4 class=\"template-name\">{{ template.Name }}</h4>\n <div class=\"template-status\">\n <span \n class=\"status-badge\"\n [style.background-color]=\"getTemplateStatusColor(template)\"\n >\n {{ getTemplateStatusText(template) }}\n </span>\n </div>\n </div>\n\n <!-- Template Description -->\n @if (template.Description) {\n <div class=\"template-description\">\n {{ getTemplatePreview(template) }}\n </div>\n }\n\n <!-- Template Metadata -->\n <div class=\"template-metadata\">\n <div class=\"metadata-item\">\n <i class=\"fa-solid fa-user\"></i>\n <span>{{ template.User || 'Unknown User' }}</span>\n </div>\n \n @if (template.Category) {\n <div class=\"metadata-item\">\n <i class=\"fa-solid fa-folder\"></i>\n <span>{{ template.Category }}</span>\n </div>\n }\n \n @if (template.__mj_CreatedAt) {\n <div class=\"metadata-item\">\n <i class=\"fa-solid fa-calendar\"></i>\n <span>{{ formatDate(template.__mj_CreatedAt) }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n } @empty {\n <div class=\"no-templates\">\n <i class=\"fa-solid fa-file-alt fa-3x\"></i>\n <h4>No templates found</h4>\n <p>No templates match your current search criteria.</p>\n </div>\n }\n </div>\n }\n\n <!-- Dialog Actions -->\n <div class=\"dialog-actions\">\n <div class=\"action-buttons\">\n @if (config.showCreateNew) {\n <button\n mjButton\n variant=\"outline\"\n (click)=\"createNew()\"\n >\n <i class=\"fa-solid fa-plus\"></i>\n Create New\n </button>\n }\n \n <button\n mjButton\n (click)=\"cancel()\"\n >\n Cancel\n </button>\n \n <button\n mjButton\n variant=\"primary\"\n (click)=\"selectTemplates()\"\n [disabled]=\"selectedTemplates.size === 0\"\n >\n <i class=\"fa-solid fa-check\"></i>\n Select {{ selectedTemplates.size > 0 ? '(' + selectedTemplates.size + ')' : '' }}\n </button>\n </div>\n </div>\n</div>", styles: ["/* Template Selector Dialog Styles */\n.template-selector-dialog {\n padding: 20px;\n width: 100%;\n max-width: 800px;\n height: 600px;\n display: flex;\n flex-direction: column;\n}\n\n/* Header */\n.dialog-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 20px;\n padding-bottom: 15px;\n border-bottom: 1px solid var(--mj-border-default);\n}\n\n.dialog-header h3 {\n margin: 0;\n font-size: 1.5rem;\n color: var(--mj-text-primary);\n}\n\n.header-actions {\n display: flex;\n gap: 10px;\n}\n\n/* Search and Filter Section */\n.search-filter-section {\n display: flex;\n gap: 15px;\n margin-bottom: 20px;\n}\n\n.search-container {\n flex: 1;\n position: relative;\n}\n\n.search-icon {\n position: absolute;\n left: 10px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--mj-text-muted);\n pointer-events: none;\n}\n\n.search-container input {\n padding-left: 35px;\n width: 100%;\n}\n\n.category-filter {\n min-width: 200px;\n}\n\n.category-filter select {\n width: 100%;\n}\n\n/* Loading State */\n.loading-container {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n padding: 60px;\n font-size: 1.1rem;\n color: var(--mj-text-secondary);\n}\n\n.loading-container i {\n font-size: 1.5rem;\n color: var(--mj-brand-primary);\n}\n\n/* Templates Container */\n.templates-container {\n flex: 1;\n overflow-y: auto;\n border: 1px solid var(--mj-border-default);\n border-radius: 4px;\n background: var(--mj-bg-surface);\n padding: 10px;\n}\n\n.templates-container.grid-mode {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n gap: 15px;\n}\n\n/* Template Item */\n.template-item {\n display: flex;\n align-items: flex-start;\n gap: 12px;\n padding: 15px;\n border: 2px solid transparent;\n border-radius: 6px;\n cursor: pointer;\n transition: all 0.2s ease;\n background: var(--mj-bg-surface-card);\n margin-bottom: 8px;\n}\n\n.template-item:hover {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));\n}\n\n.template-item.selected {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));\n}\n\n.grid-mode .template-item {\n flex-direction: column;\n margin-bottom: 0;\n}\n\n.grid-mode .template-item .selection-indicator {\n align-self: flex-end;\n}\n\n/* Selection Indicator */\n.selection-indicator {\n flex-shrink: 0;\n margin-top: 2px;\n}\n\n.selection-indicator input[type=\"checkbox\"],\n.selection-indicator input[type=\"radio\"] {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}\n\n/* Template Info */\n.template-info {\n flex: 1;\n min-width: 0;\n}\n\n.template-header {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n margin-bottom: 8px;\n}\n\n.template-name {\n margin: 0;\n font-size: 1.1rem;\n font-weight: 600;\n color: var(--mj-text-primary);\n word-break: break-word;\n}\n\n.template-status {\n flex-shrink: 0;\n margin-left: 10px;\n}\n\n.status-badge {\n display: inline-block;\n padding: 2px 8px;\n border-radius: 12px;\n font-size: 0.75rem;\n font-weight: 500;\n color: var(--mj-text-inverse);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n/* Template Description */\n.template-description {\n margin-bottom: 12px;\n color: var(--mj-text-secondary);\n font-size: 0.9rem;\n line-height: 1.4;\n}\n\n/* Template Metadata */\n.template-metadata {\n display: flex;\n flex-wrap: wrap;\n gap: 15px;\n font-size: 0.85rem;\n color: var(--mj-text-muted);\n}\n\n.metadata-item {\n display: flex;\n align-items: center;\n gap: 5px;\n}\n\n.metadata-item i {\n font-size: 0.8rem;\n color: var(--mj-text-muted);\n}\n\n/* No Templates State */\n.no-templates {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 60px 20px;\n text-align: center;\n color: var(--mj-text-secondary);\n}\n\n.no-templates i {\n margin-bottom: 20px;\n color: var(--mj-text-muted);\n}\n\n.no-templates h4 {\n margin: 0 0 10px 0;\n font-size: 1.2rem;\n}\n\n.no-templates p {\n margin: 0;\n font-size: 0.9rem;\n color: var(--mj-text-muted);\n}\n\n/* Dialog Actions */\n.dialog-actions {\n margin-top: 20px;\n padding-top: 20px;\n border-top: 1px solid var(--mj-border-default);\n}\n\n.action-buttons {\n display: flex;\n justify-content: flex-end;\n gap: 10px;\n}\n\n.action-buttons button {\n min-width: 100px;\n}\n\n.action-buttons button i {\n margin-right: 5px;\n}\n\n/* Responsive Design */\n@media (max-width: 768px) {\n .template-selector-dialog {\n padding: 15px;\n height: 500px;\n }\n\n .search-filter-section {\n flex-direction: column;\n gap: 10px;\n }\n\n .category-filter {\n min-width: auto;\n }\n\n .templates-container.grid-mode {\n grid-template-columns: 1fr;\n }\n\n .template-header {\n flex-direction: column;\n align-items: flex-start;\n }\n\n .template-status {\n margin-left: 0;\n margin-top: 5px;\n }\n\n .template-metadata {\n flex-direction: column;\n gap: 8px;\n }\n\n .action-buttons {\n flex-direction: column;\n }\n\n .action-buttons button {\n min-width: auto;\n }\n}\n\n/* Scrollbar Styling */\n.templates-container::-webkit-scrollbar {\n width: 8px;\n}\n\n.templates-container::-webkit-scrollbar-track {\n background: var(--mj-bg-surface-card);\n border-radius: 4px;\n}\n\n.templates-container::-webkit-scrollbar-thumb {\n background: var(--mj-border-strong);\n border-radius: 4px;\n}\n\n.templates-container::-webkit-scrollbar-thumb:hover {\n background: var(--mj-text-muted);\n}\n"] }]
|
|
558
|
+
args: [{ selector: 'mj-template-selector-dialog', standalone: true, imports: [CommonModule, ReactiveFormsModule], template: "<!-- Template Selector Dialog -->\n<div class=\"template-selector-dialog\">\n <!-- Header -->\n <div class=\"dialog-header\">\n <h3>{{ config.Title }}</h3>\n <div class=\"header-actions\">\n <button\n mjButton\n size=\"sm\"\n (click)=\"toggleViewMode()\"\n >\n <i [class]=\"viewMode === 'list' ? 'fa-solid fa-th' : 'fa-solid fa-list'\"></i>\n {{ viewMode === 'list' ? 'Grid' : 'List' }}\n </button>\n </div>\n </div>\n\n <!-- Search and Filter Section -->\n <div class=\"search-filter-section\">\n <!-- Search Input -->\n <div class=\"search-container\">\n <input\n class=\"mj-input\"\n type=\"text\"\n [formControl]=\"searchControl\"\n placeholder=\"Search templates...\"\n />\n <i class=\"fa-solid fa-search search-icon\"></i>\n </div>\n\n <!-- Category Filter -->\n <div class=\"category-filter\">\n <select\n class=\"mj-input\"\n [value]=\"selectedCategory || ''\"\n (change)=\"onCategoryChange($any($event.target).value || null)\"\n >\n <option value=\"\">All Categories</option>\n @for (category of categories$ | async; track category.ID) {\n <option [value]=\"category.ID\">{{ category.Name }}</option>\n }\n </select>\n </div>\n </div>\n\n <!-- Loading State -->\n @if (isLoading$ | async) {\n <div class=\"loading-container\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading templates...</span>\n </div>\n }\n\n <!-- Template List/Grid -->\n @if (!(isLoading$ | async)) {\n <div class=\"templates-container\" [class.grid-mode]=\"viewMode === 'grid'\">\n @for (template of filteredTemplates$ | async; track template.ID) {\n <div \n class=\"template-item\"\n [class.selected]=\"isTemplateSelected(template)\"\n (click)=\"toggleTemplateSelection(template)\"\n >\n <!-- Selection Checkbox -->\n <div class=\"selection-indicator\">\n @if (config.MultiSelect) {\n <input\n type=\"checkbox\"\n [checked]=\"isTemplateSelected(template)\"\n (change)=\"toggleTemplateSelection(template)\"\n />\n } @else {\n <input\n type=\"radio\"\n [checked]=\"isTemplateSelected(template)\"\n (change)=\"toggleTemplateSelection(template)\"\n />\n }\n </div>\n\n <!-- Template Info -->\n <div class=\"template-info\">\n <div class=\"template-header\">\n <h4 class=\"template-name\">{{ template.Name }}</h4>\n <div class=\"template-status\">\n <span \n class=\"status-badge\"\n [style.background-color]=\"getTemplateStatusColor(template)\"\n >\n {{ getTemplateStatusText(template) }}\n </span>\n </div>\n </div>\n\n <!-- Template Description -->\n @if (template.Description) {\n <div class=\"template-description\">\n {{ getTemplatePreview(template) }}\n </div>\n }\n\n <!-- Template Metadata -->\n <div class=\"template-metadata\">\n <div class=\"metadata-item\">\n <i class=\"fa-solid fa-user\"></i>\n <span>{{ template.User || 'Unknown User' }}</span>\n </div>\n \n @if (template.Category) {\n <div class=\"metadata-item\">\n <i class=\"fa-solid fa-folder\"></i>\n <span>{{ template.Category }}</span>\n </div>\n }\n \n @if (template.__mj_CreatedAt) {\n <div class=\"metadata-item\">\n <i class=\"fa-solid fa-calendar\"></i>\n <span>{{ formatDate(template.__mj_CreatedAt) }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n } @empty {\n <div class=\"no-templates\">\n <i class=\"fa-solid fa-file-alt fa-3x\"></i>\n <h4>No templates found</h4>\n <p>No templates match your current search criteria.</p>\n </div>\n }\n </div>\n }\n\n <!-- Dialog Actions -->\n <div class=\"dialog-actions\">\n <div class=\"action-buttons\">\n @if (config.ShowCreateNew) {\n <button\n mjButton\n variant=\"outline\"\n (click)=\"createNew()\"\n >\n <i class=\"fa-solid fa-plus\"></i>\n Create New\n </button>\n }\n \n <button\n mjButton\n (click)=\"cancel()\"\n >\n Cancel\n </button>\n \n <button\n mjButton\n variant=\"primary\"\n (click)=\"selectTemplates()\"\n [disabled]=\"selectedTemplates.size === 0\"\n >\n <i class=\"fa-solid fa-check\"></i>\n Select {{ selectedTemplates.size > 0 ? '(' + selectedTemplates.size + ')' : '' }}\n </button>\n </div>\n </div>\n</div>", styles: ["/* Template Selector Dialog Styles */\n.template-selector-dialog {\n padding: 20px;\n width: 100%;\n max-width: 800px;\n height: 600px;\n display: flex;\n flex-direction: column;\n}\n\n/* Header */\n.dialog-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 20px;\n padding-bottom: 15px;\n border-bottom: 1px solid var(--mj-border-default);\n}\n\n.dialog-header h3 {\n margin: 0;\n font-size: 1.5rem;\n color: var(--mj-text-primary);\n}\n\n.header-actions {\n display: flex;\n gap: 10px;\n}\n\n/* Search and Filter Section */\n.search-filter-section {\n display: flex;\n gap: 15px;\n margin-bottom: 20px;\n}\n\n.search-container {\n flex: 1;\n position: relative;\n}\n\n.search-icon {\n position: absolute;\n left: 10px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--mj-text-muted);\n pointer-events: none;\n}\n\n.search-container input {\n padding-left: 35px;\n width: 100%;\n}\n\n.category-filter {\n min-width: 200px;\n}\n\n.category-filter select {\n width: 100%;\n}\n\n/* Loading State */\n.loading-container {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n padding: 60px;\n font-size: 1.1rem;\n color: var(--mj-text-secondary);\n}\n\n.loading-container i {\n font-size: 1.5rem;\n color: var(--mj-brand-primary);\n}\n\n/* Templates Container */\n.templates-container {\n flex: 1;\n overflow-y: auto;\n border: 1px solid var(--mj-border-default);\n border-radius: 4px;\n background: var(--mj-bg-surface);\n padding: 10px;\n}\n\n.templates-container.grid-mode {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n gap: 15px;\n}\n\n/* Template Item */\n.template-item {\n display: flex;\n align-items: flex-start;\n gap: 12px;\n padding: 15px;\n border: 2px solid transparent;\n border-radius: 6px;\n cursor: pointer;\n transition: all 0.2s ease;\n background: var(--mj-bg-surface-card);\n margin-bottom: 8px;\n}\n\n.template-item:hover {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));\n}\n\n.template-item.selected {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));\n}\n\n.grid-mode .template-item {\n flex-direction: column;\n margin-bottom: 0;\n}\n\n.grid-mode .template-item .selection-indicator {\n align-self: flex-end;\n}\n\n/* Selection Indicator */\n.selection-indicator {\n flex-shrink: 0;\n margin-top: 2px;\n}\n\n.selection-indicator input[type=\"checkbox\"],\n.selection-indicator input[type=\"radio\"] {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}\n\n/* Template Info */\n.template-info {\n flex: 1;\n min-width: 0;\n}\n\n.template-header {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n margin-bottom: 8px;\n}\n\n.template-name {\n margin: 0;\n font-size: 1.1rem;\n font-weight: 600;\n color: var(--mj-text-primary);\n word-break: break-word;\n}\n\n.template-status {\n flex-shrink: 0;\n margin-left: 10px;\n}\n\n.status-badge {\n display: inline-block;\n padding: 2px 8px;\n border-radius: 12px;\n font-size: 0.75rem;\n font-weight: 500;\n color: var(--mj-text-inverse);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n/* Template Description */\n.template-description {\n margin-bottom: 12px;\n color: var(--mj-text-secondary);\n font-size: 0.9rem;\n line-height: 1.4;\n}\n\n/* Template Metadata */\n.template-metadata {\n display: flex;\n flex-wrap: wrap;\n gap: 15px;\n font-size: 0.85rem;\n color: var(--mj-text-muted);\n}\n\n.metadata-item {\n display: flex;\n align-items: center;\n gap: 5px;\n}\n\n.metadata-item i {\n font-size: 0.8rem;\n color: var(--mj-text-muted);\n}\n\n/* No Templates State */\n.no-templates {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 60px 20px;\n text-align: center;\n color: var(--mj-text-secondary);\n}\n\n.no-templates i {\n margin-bottom: 20px;\n color: var(--mj-text-muted);\n}\n\n.no-templates h4 {\n margin: 0 0 10px 0;\n font-size: 1.2rem;\n}\n\n.no-templates p {\n margin: 0;\n font-size: 0.9rem;\n color: var(--mj-text-muted);\n}\n\n/* Dialog Actions */\n.dialog-actions {\n margin-top: 20px;\n padding-top: 20px;\n border-top: 1px solid var(--mj-border-default);\n}\n\n.action-buttons {\n display: flex;\n justify-content: flex-end;\n gap: 10px;\n}\n\n.action-buttons button {\n min-width: 100px;\n}\n\n.action-buttons button i {\n margin-right: 5px;\n}\n\n/* Responsive Design */\n@media (max-width: 768px) {\n .template-selector-dialog {\n padding: 15px;\n height: 500px;\n }\n\n .search-filter-section {\n flex-direction: column;\n gap: 10px;\n }\n\n .category-filter {\n min-width: auto;\n }\n\n .templates-container.grid-mode {\n grid-template-columns: 1fr;\n }\n\n .template-header {\n flex-direction: column;\n align-items: flex-start;\n }\n\n .template-status {\n margin-left: 0;\n margin-top: 5px;\n }\n\n .template-metadata {\n flex-direction: column;\n gap: 8px;\n }\n\n .action-buttons {\n flex-direction: column;\n }\n\n .action-buttons button {\n min-width: auto;\n }\n}\n\n/* Scrollbar Styling */\n.templates-container::-webkit-scrollbar {\n width: 8px;\n}\n\n.templates-container::-webkit-scrollbar-track {\n background: var(--mj-bg-surface-card);\n border-radius: 4px;\n}\n\n.templates-container::-webkit-scrollbar-thumb {\n background: var(--mj-border-strong);\n border-radius: 4px;\n}\n\n.templates-container::-webkit-scrollbar-thumb:hover {\n background: var(--mj-text-muted);\n}\n"] }]
|
|
443
559
|
}], () => [{ type: i0.ChangeDetectorRef }], { DialogClose: [{
|
|
444
560
|
type: Output
|
|
445
561
|
}] }); })();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-selector-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/custom/AIPrompts/template-selector-dialog.component.ts","../../../../src/lib/custom/AIPrompts/template-selector-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAwC,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;;;;;IC8B3D,kCAA8B;IAAA,YAAmB;IAAA,iBAAS;;;IAAlD,sCAAqB;IAAC,cAAmB;IAAnB,sCAAmB;;;IAQvD,+BAA+B;IAC7B,wBAA2C;IAC3C,4BAAM;IAAA,oCAAoB;IAC5B,AAD4B,iBAAO,EAC7B;;;;IAeI,iCAIE;IADA,4QAAU,2CAAiC,KAAC;IAH9C,iBAIE;;;;IAFA,gEAAwC;;;;IAI1C,iCAIE;IADA,4QAAU,2CAAiC,KAAC;IAH9C,iBAIE;;;;IAFA,gEAAwC;;;IAsB1C,+BAAkC;IAChC,YACF;IAAA,iBAAM;;;;IADJ,cACF;IADE,uEACF;;;IAWE,+BAA2B;IACzB,wBAAkC;IAClC,4BAAM;IAAA,YAAuB;IAC/B,AAD+B,iBAAO,EAChC;;;IADE,eAAuB;IAAvB,0CAAuB;;;IAK/B,+BAA2B;IACzB,wBAAoC;IACpC,4BAAM;IA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YAAA,iBAAS;YACxC,wGAEC;;YAGP,AADE,AADE,iBAAS,EACL,EACF;YAGN,oGAA0B;;YAQ1B,oGAA6B;;YAiF3B,AADF,gCAA4B,eACE;YAC1B,uGAA4B;YAW5B,mCAGC;YADC,6GAAS,YAAQ,IAAC;YAElB,yBACF;YAAA,iBAAS;YAET,mCAKC;YAFC,6GAAS,qBAAiB,IAAC;YAG3B,yBAAiC;YACjC,aACF;YAGN,AADE,AADE,AADE,iBAAS,EACL,EACF,EACF;;YAjKE,eAAkB;YAAlB,sCAAkB;YAOf,eAAqE;YAArE,8EAAqE;YACxE,cACF;YADE,0EACF;YAWE,eAA6B;YAA7B,+CAA6B;YAU7B,eAAgC;YAAhC,kDAAgC;YAIhC,eAEC;YAFD,sDAEC;YAMP,eAKC;YALD,kEAKC;YAGD,eA6EC;YA7ED,mEA6EC;YAKG,eASC;YATD,oDASC;YAaC,eAAyC;YAAzC,2DAAyC;YAGzC,eACF;YADE,oHACF;4BDzHM,YAAY,EAAE,mBAAmB;;iFAEhC,+BAA+B;cAP3C,SAAS;2BACE,6BAA6B,cAG3B,IAAI,WACP,CAAC,YAAY,EAAE,mBAAmB,CAAC;;kBAyB3C,MAAM;;kFAvBI,+BAA+B","sourcesContent":["import { Component, OnInit, OnDestroy, ChangeDetectorRef, Output, EventEmitter } from '@angular/core';\nimport { Subject, BehaviorSubject, debounceTime, distinctUntilChanged, takeUntil } from 'rxjs';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { RunView } from '@memberjunction/core';\nimport { MJTemplateEntity, MJTemplateCategoryEntity } from '@memberjunction/core-entities';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { UUIDsEqual } from '@memberjunction/global';\n\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nexport interface TemplateSelectorConfig {\n /** Title for the dialog */\n title: string;\n /** Whether to show the \"Create New\" option */\n showCreateNew?: boolean;\n /** Filter criteria for templates */\n extraFilter?: string;\n /** Allow multiple selection */\n multiSelect?: boolean;\n /** Pre-selected template IDs */\n selectedTemplateIds?: string[];\n /** Show only active templates */\n showActiveOnly?: boolean;\n}\n\nexport interface TemplateSelectorResult {\n /** Selected templates */\n selectedTemplates: MJTemplateEntity[];\n /** Whether user chose to create new */\n createNew?: boolean;\n}\n\n/**\n * Template selector dialog that allows users to search and select from existing templates.\n * This dialog provides a searchable interface with category filtering and template preview.\n */\n@Component({\n selector: 'mj-template-selector-dialog',\n templateUrl: './template-selector-dialog.component.html',\n styleUrls: ['./template-selector-dialog.component.css'],\n standalone: true,\n imports: [CommonModule, ReactiveFormsModule]\n})\nexport class TemplateSelectorDialogComponent extends BaseAngularComponent implements OnInit, OnDestroy {\n \n // Input configuration\n config: TemplateSelectorConfig = { title: 'Select Template' };\n \n // State management\n private destroy$ = new Subject<void>();\n public result = new Subject<TemplateSelectorResult | null>();\n \n // Data and UI state\n isLoading$ = new BehaviorSubject<boolean>(false);\n templates$ = new BehaviorSubject<MJTemplateEntity[]>([]);\n filteredTemplates$ = new BehaviorSubject<MJTemplateEntity[]>([]);\n categories$ = new BehaviorSubject<MJTemplateCategoryEntity[]>([]);\n \n // Search and filtering\n searchControl = new FormControl('');\n selectedCategory: string | null = null;\n selectedTemplates: Set<string> = new Set();\n \n // View mode\n viewMode: 'grid' | 'list' = 'list';\n\n @Output() DialogClose = new EventEmitter<void>();\n\n constructor(\n private cdr: ChangeDetectorRef\n ) {\n super();}\n\n ngOnInit() {\n this.setupSearch();\n this.loadData();\n \n // Initialize selected templates if provided\n if (this.config.selectedTemplateIds) {\n this.selectedTemplates = new Set(this.config.selectedTemplateIds);\n }\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n private setupSearch() {\n this.searchControl.valueChanges\n .pipe(\n debounceTime(300),\n distinctUntilChanged(),\n takeUntil(this.destroy$)\n )\n .subscribe(searchTerm => {\n this.filterTemplates(searchTerm || '');\n });\n }\n\n private async loadData() {\n this.isLoading$.next(true);\n \n try {\n // Load both templates and categories in parallel\n await Promise.all([\n this.loadTemplates(),\n this.loadCategories()\n ]);\n } catch (error) {\n console.error('Error loading template data:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error loading templates. Please try again.',\n 'error',\n 3000\n );\n } finally {\n this.isLoading$.next(false);\n }\n }\n\n private async loadTemplates() {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n \n // Build filter\n let filter = '';\n if (this.config.showActiveOnly !== false) {\n filter = \"IsActive = 1\";\n }\n if (this.config.extraFilter) {\n filter += filter ? ` AND ${this.config.extraFilter}` : this.config.extraFilter;\n }\n \n const result = await rv.RunView<MJTemplateEntity>({\n EntityName: 'MJ: Templates',\n ExtraFilter: filter,\n OrderBy: 'Name ASC',\n ResultType: 'entity_object',\n MaxRows: 1000\n });\n\n if (result.Success) {\n const templates = result.Results || [];\n this.templates$.next(templates);\n this.filteredTemplates$.next(templates);\n } else {\n throw new Error(result.ErrorMessage || 'Failed to load templates');\n }\n } catch (error) {\n console.error('Error loading templates:', error);\n this.templates$.next([]);\n this.filteredTemplates$.next([]);\n }\n }\n\n private async loadCategories() {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n \n const result = await rv.RunView<MJTemplateCategoryEntity>({\n EntityName: 'MJ: Template Categories',\n ExtraFilter: '',\n OrderBy: 'Name ASC',\n ResultType: 'entity_object',\n MaxRows: 1000\n });\n\n if (result.Success) {\n const categories = result.Results || [];\n this.categories$.next(categories);\n } else {\n throw new Error(result.ErrorMessage || 'Failed to load categories');\n }\n } catch (error) {\n console.error('Error loading categories:', error);\n this.categories$.next([]);\n }\n }\n\n private filterTemplates(searchTerm: string) {\n const allTemplates = this.templates$.value;\n let filtered = allTemplates;\n \n // Apply search filter\n if (searchTerm.trim()) {\n filtered = filtered.filter(template => \n template.Name?.toLowerCase().includes(searchTerm.toLowerCase()) ||\n template.Description?.toLowerCase().includes(searchTerm.toLowerCase())\n );\n }\n \n // Apply category filter\n if (this.selectedCategory) {\n filtered = filtered.filter(template => \n UUIDsEqual(template.CategoryID, this.selectedCategory)\n );\n }\n \n this.filteredTemplates$.next(filtered);\n }\n\n // === Category Management ===\n\n onCategoryChange(categoryId: string | null) {\n this.selectedCategory = categoryId === '' ? null : categoryId;\n this.filterTemplates(this.searchControl.value || '');\n }\n\n getCategoryDisplayName(categoryId: string): string {\n const category = this.categories$.value.find(c => UUIDsEqual(c.ID, categoryId));\n return category?.Name || 'Unknown Category';\n }\n\n // === Selection Management ===\n\n toggleTemplateSelection(template: MJTemplateEntity) {\n if (this.config.multiSelect) {\n if (this.selectedTemplates.has(template.ID)) {\n this.selectedTemplates.delete(template.ID);\n } else {\n this.selectedTemplates.add(template.ID);\n }\n } else {\n // Single select - replace current selection\n this.selectedTemplates.clear();\n this.selectedTemplates.add(template.ID);\n }\n }\n\n isTemplateSelected(template: MJTemplateEntity): boolean {\n return this.selectedTemplates.has(template.ID);\n }\n\n getSelectedTemplateObjects(): MJTemplateEntity[] {\n const allTemplates = this.templates$.value;\n return allTemplates.filter(template => this.selectedTemplates.has(template.ID));\n }\n\n // === UI Helpers ===\n\n toggleViewMode() {\n this.viewMode = this.viewMode === 'grid' ? 'list' : 'grid';\n }\n\n getTemplateStatusColor(template: MJTemplateEntity): string {\n if (!template.IsActive) return '#6c757d';\n if (template.DisabledAt && new Date(template.DisabledAt) <= new Date()) return '#dc3545';\n if (template.ActiveAt && new Date(template.ActiveAt) > new Date()) return '#ffc107';\n return '#28a745';\n }\n\n getTemplateStatusText(template: MJTemplateEntity): string {\n if (!template.IsActive) return 'Inactive';\n if (template.DisabledAt && new Date(template.DisabledAt) <= new Date()) return 'Disabled';\n if (template.ActiveAt && new Date(template.ActiveAt) > new Date()) return 'Scheduled';\n return 'Active';\n }\n\n getTemplatePreview(template: MJTemplateEntity): string {\n if (!template.Description) return 'No description available';\n return template.Description.length > 100 \n ? template.Description.substring(0, 100) + '...' \n : template.Description;\n }\n\n formatDate(date: Date | string | null): string {\n if (!date) return '';\n const d = new Date(date);\n return d.toLocaleDateString();\n }\n\n // === Dialog Actions ===\n\n selectTemplates() {\n const selectedTemplateObjects = this.getSelectedTemplateObjects();\n \n if (selectedTemplateObjects.length === 0) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Please select at least one template',\n 'warning',\n 2000\n );\n return;\n }\n\n const result: TemplateSelectorResult = {\n selectedTemplates: selectedTemplateObjects\n };\n\n this.result.next(result);\n this.DialogClose.emit();\n }\n\n createNew() {\n const result: TemplateSelectorResult = {\n selectedTemplates: [],\n createNew: true\n };\n\n this.result.next(result);\n this.DialogClose.emit();\n }\n\n cancel() {\n this.result.next(null);\n this.DialogClose.emit();\n }\n}","<!-- Template Selector Dialog -->\n<div class=\"template-selector-dialog\">\n <!-- Header -->\n <div class=\"dialog-header\">\n <h3>{{ config.title }}</h3>\n <div class=\"header-actions\">\n <button\n mjButton\n size=\"sm\"\n (click)=\"toggleViewMode()\"\n >\n <i [class]=\"viewMode === 'list' ? 'fa-solid fa-th' : 'fa-solid fa-list'\"></i>\n {{ viewMode === 'list' ? 'Grid' : 'List' }}\n </button>\n </div>\n </div>\n\n <!-- Search and Filter Section -->\n <div class=\"search-filter-section\">\n <!-- Search Input -->\n <div class=\"search-container\">\n <input\n class=\"mj-input\"\n type=\"text\"\n [formControl]=\"searchControl\"\n placeholder=\"Search templates...\"\n />\n <i class=\"fa-solid fa-search search-icon\"></i>\n </div>\n\n <!-- Category Filter -->\n <div class=\"category-filter\">\n <select\n class=\"mj-input\"\n [value]=\"selectedCategory || ''\"\n (change)=\"onCategoryChange($any($event.target).value || null)\"\n >\n <option value=\"\">All Categories</option>\n @for (category of categories$ | async; track category.ID) {\n <option [value]=\"category.ID\">{{ category.Name }}</option>\n }\n </select>\n </div>\n </div>\n\n <!-- Loading State -->\n @if (isLoading$ | async) {\n <div class=\"loading-container\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading templates...</span>\n </div>\n }\n\n <!-- Template List/Grid -->\n @if (!(isLoading$ | async)) {\n <div class=\"templates-container\" [class.grid-mode]=\"viewMode === 'grid'\">\n @for (template of filteredTemplates$ | async; track template.ID) {\n <div \n class=\"template-item\"\n [class.selected]=\"isTemplateSelected(template)\"\n (click)=\"toggleTemplateSelection(template)\"\n >\n <!-- Selection Checkbox -->\n <div class=\"selection-indicator\">\n @if (config.multiSelect) {\n <input\n type=\"checkbox\"\n [checked]=\"isTemplateSelected(template)\"\n (change)=\"toggleTemplateSelection(template)\"\n />\n } @else {\n <input\n type=\"radio\"\n [checked]=\"isTemplateSelected(template)\"\n (change)=\"toggleTemplateSelection(template)\"\n />\n }\n </div>\n\n <!-- Template Info -->\n <div class=\"template-info\">\n <div class=\"template-header\">\n <h4 class=\"template-name\">{{ template.Name }}</h4>\n <div class=\"template-status\">\n <span \n class=\"status-badge\"\n [style.background-color]=\"getTemplateStatusColor(template)\"\n >\n {{ getTemplateStatusText(template) }}\n </span>\n </div>\n </div>\n\n <!-- Template Description -->\n @if (template.Description) {\n <div class=\"template-description\">\n {{ getTemplatePreview(template) }}\n </div>\n }\n\n <!-- Template Metadata -->\n <div class=\"template-metadata\">\n <div class=\"metadata-item\">\n <i class=\"fa-solid fa-user\"></i>\n <span>{{ template.User || 'Unknown User' }}</span>\n </div>\n \n @if (template.Category) {\n <div class=\"metadata-item\">\n <i class=\"fa-solid fa-folder\"></i>\n <span>{{ template.Category }}</span>\n </div>\n }\n \n @if (template.__mj_CreatedAt) {\n <div class=\"metadata-item\">\n <i class=\"fa-solid fa-calendar\"></i>\n <span>{{ formatDate(template.__mj_CreatedAt) }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n } @empty {\n <div class=\"no-templates\">\n <i class=\"fa-solid fa-file-alt fa-3x\"></i>\n <h4>No templates found</h4>\n <p>No templates match your current search criteria.</p>\n </div>\n }\n </div>\n }\n\n <!-- Dialog Actions -->\n <div class=\"dialog-actions\">\n <div class=\"action-buttons\">\n @if (config.showCreateNew) {\n <button\n mjButton\n variant=\"outline\"\n (click)=\"createNew()\"\n >\n <i class=\"fa-solid fa-plus\"></i>\n Create New\n </button>\n }\n \n <button\n mjButton\n (click)=\"cancel()\"\n >\n Cancel\n </button>\n \n <button\n mjButton\n variant=\"primary\"\n (click)=\"selectTemplates()\"\n [disabled]=\"selectedTemplates.size === 0\"\n >\n <i class=\"fa-solid fa-check\"></i>\n Select {{ selectedTemplates.size > 0 ? '(' + selectedTemplates.size + ')' : '' }}\n </button>\n </div>\n </div>\n</div>"]}
|
|
1
|
+
{"version":3,"file":"template-selector-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/custom/AIPrompts/template-selector-dialog.component.ts","../../../../src/lib/custom/AIPrompts/template-selector-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAwC,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;;;;;IC8B3D,kCAA8B;IAAA,YAAmB;IAAA,iBAAS;;;IAAlD,sCAAqB;IAAC,cAAmB;IAAnB,sCAAmB;;;IAQvD,+BAA+B;IAC7B,wBAA2C;IAC3C,4BAAM;IAAA,oCAAoB;IAC5B,AAD4B,iBAAO,EAC7B;;;;IAeI,iCAIE;IADA,4QAAU,2CAAiC,KAAC;IAH9C,iBAIE;;;;IAFA,gEAAwC;;;;I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BAAmB;;iFAEhC,+BAA+B;cAP3C,SAAS;2BACE,6BAA6B,cAG3B,IAAI,WACP,CAAC,YAAY,EAAE,mBAAmB,CAAC;;kBA0G3C,MAAM;;kFAxGI,+BAA+B","sourcesContent":["import { Component, OnInit, OnDestroy, ChangeDetectorRef, Output, EventEmitter } from '@angular/core';\nimport { Subject, BehaviorSubject, debounceTime, distinctUntilChanged, takeUntil } from 'rxjs';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { RunView } from '@memberjunction/core';\nimport { MJTemplateEntity, MJTemplateCategoryEntity } from '@memberjunction/core-entities';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { UUIDsEqual } from '@memberjunction/global';\n\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nexport interface TemplateSelectorConfig {\n /** Title for the dialog */\n Title: string;\n /** Whether to show the \"Create New\" option */\n ShowCreateNew?: boolean;\n /** Filter criteria for templates */\n ExtraFilter?: string;\n /** Allow multiple selection */\n MultiSelect?: boolean;\n /** Pre-selected template IDs */\n SelectedTemplateIds?: string[];\n /** Show only active templates */\n ShowActiveOnly?: boolean;\n}\n\nexport interface TemplateSelectorResult {\n /** Selected templates */\n SelectedTemplates: MJTemplateEntity[];\n /** Whether user chose to create new */\n createNew?: boolean; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined\n}\n\n/**\n * Template selector dialog that allows users to search and select from existing templates.\n * This dialog provides a searchable interface with category filtering and template preview.\n */\n@Component({\n selector: 'mj-template-selector-dialog',\n templateUrl: './template-selector-dialog.component.html',\n styleUrls: ['./template-selector-dialog.component.css'],\n standalone: true,\n imports: [CommonModule, ReactiveFormsModule]\n})\nexport class TemplateSelectorDialogComponent extends BaseAngularComponent implements OnInit, OnDestroy {\n \n // Input configuration\n config: TemplateSelectorConfig = { Title: 'Select Template' };\n \n // State management\n private destroy$ = new Subject<void>();\n public Result = new Subject<TemplateSelectorResult | null>();\n\n /** @deprecated Use {@link Result}. */\n public get result() {\n return this.Result;\n }\n /** @deprecated Use {@link Result}. */\n public set result(value) {\n this.Result = value;\n }\n \n // Data and UI state\n IsLoading$ = new BehaviorSubject<boolean>(false);\n\n /** @deprecated Use {@link IsLoading$}. */\n get isLoading$() {\n return this.IsLoading$;\n }\n /** @deprecated Use {@link IsLoading$}. */\n set isLoading$(value) {\n this.IsLoading$ = value;\n }\n Templates$ = new BehaviorSubject<MJTemplateEntity[]>([]);\n\n /** @deprecated Use {@link Templates$}. */\n get templates$() {\n return this.Templates$;\n }\n /** @deprecated Use {@link Templates$}. */\n set templates$(value) {\n this.Templates$ = value;\n }\n FilteredTemplates$ = new BehaviorSubject<MJTemplateEntity[]>([]);\n\n /** @deprecated Use {@link FilteredTemplates$}. */\n get filteredTemplates$() {\n return this.FilteredTemplates$;\n }\n /** @deprecated Use {@link FilteredTemplates$}. */\n set filteredTemplates$(value) {\n this.FilteredTemplates$ = value;\n }\n Categories$ = new BehaviorSubject<MJTemplateCategoryEntity[]>([]);\n\n /** @deprecated Use {@link Categories$}. */\n get categories$() {\n return this.Categories$;\n }\n /** @deprecated Use {@link Categories$}. */\n set categories$(value) {\n this.Categories$ = value;\n }\n \n // Search and filtering\n SearchControl = new FormControl('');\n\n /** @deprecated Use {@link SearchControl}. */\n get searchControl() {\n return this.SearchControl;\n }\n /** @deprecated Use {@link SearchControl}. */\n set searchControl(value) {\n this.SearchControl = value;\n }\n SelectedCategory: string | null = null;\n\n /** @deprecated Use {@link SelectedCategory}. */\n get selectedCategory(): string | null {\n return this.SelectedCategory;\n }\n /** @deprecated Use {@link SelectedCategory}. */\n set selectedCategory(value: string | null) {\n this.SelectedCategory = value;\n }\n SelectedTemplates: Set<string> = new Set();\n\n /** @deprecated Use {@link SelectedTemplates}. */\n get selectedTemplates(): Set<string> {\n return this.SelectedTemplates;\n }\n /** @deprecated Use {@link SelectedTemplates}. */\n set selectedTemplates(value: Set<string>) {\n this.SelectedTemplates = value;\n }\n \n // View mode\n ViewMode: 'grid' | 'list' = 'list';\n\n /** @deprecated Use {@link ViewMode}. */\n get viewMode(): 'grid' | 'list' {\n return this.ViewMode;\n }\n /** @deprecated Use {@link ViewMode}. */\n set viewMode(value: 'grid' | 'list') {\n this.ViewMode = value;\n }\n\n @Output() DialogClose = new EventEmitter<void>();\n\n constructor(\n private cdr: ChangeDetectorRef\n ) {\n super();}\n\n ngOnInit() {\n this.setupSearch();\n this.loadData();\n \n // Initialize selected templates if provided\n if (this.config.SelectedTemplateIds) {\n this.SelectedTemplates = new Set(this.config.SelectedTemplateIds);\n }\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n private setupSearch() {\n this.SearchControl.valueChanges\n .pipe(\n debounceTime(300),\n distinctUntilChanged(),\n takeUntil(this.destroy$)\n )\n .subscribe(searchTerm => {\n this.filterTemplates(searchTerm || '');\n });\n }\n\n private async loadData() {\n this.IsLoading$.next(true);\n \n try {\n // Load both templates and categories in parallel\n await Promise.all([\n this.loadTemplates(),\n this.loadCategories()\n ]);\n } catch (error) {\n console.error('Error loading template data:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error loading templates. Please try again.',\n 'error',\n 3000\n );\n } finally {\n this.IsLoading$.next(false);\n }\n }\n\n private async loadTemplates() {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n \n // Build filter\n let filter = '';\n if (this.config.ShowActiveOnly !== false) {\n filter = \"IsActive = 1\";\n }\n if (this.config.ExtraFilter) {\n filter += filter ? ` AND ${this.config.ExtraFilter}` : this.config.ExtraFilter;\n }\n \n const result = await rv.RunView<MJTemplateEntity>({\n EntityName: 'MJ: Templates',\n ExtraFilter: filter,\n OrderBy: 'Name ASC',\n ResultType: 'entity_object',\n MaxRows: 1000\n });\n\n if (result.Success) {\n const templates = result.Results || [];\n this.Templates$.next(templates);\n this.FilteredTemplates$.next(templates);\n } else {\n throw new Error(result.ErrorMessage || 'Failed to load templates');\n }\n } catch (error) {\n console.error('Error loading templates:', error);\n this.Templates$.next([]);\n this.FilteredTemplates$.next([]);\n }\n }\n\n private async loadCategories() {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n \n const result = await rv.RunView<MJTemplateCategoryEntity>({\n EntityName: 'MJ: Template Categories',\n ExtraFilter: '',\n OrderBy: 'Name ASC',\n ResultType: 'entity_object',\n MaxRows: 1000\n });\n\n if (result.Success) {\n const categories = result.Results || [];\n this.Categories$.next(categories);\n } else {\n throw new Error(result.ErrorMessage || 'Failed to load categories');\n }\n } catch (error) {\n console.error('Error loading categories:', error);\n this.Categories$.next([]);\n }\n }\n\n private filterTemplates(searchTerm: string) {\n const allTemplates = this.Templates$.value;\n let filtered = allTemplates;\n \n // Apply search filter\n if (searchTerm.trim()) {\n filtered = filtered.filter(template => \n template.Name?.toLowerCase().includes(searchTerm.toLowerCase()) ||\n template.Description?.toLowerCase().includes(searchTerm.toLowerCase())\n );\n }\n \n // Apply category filter\n if (this.SelectedCategory) {\n filtered = filtered.filter(template => \n UUIDsEqual(template.CategoryID, this.SelectedCategory)\n );\n }\n \n this.FilteredTemplates$.next(filtered);\n }\n\n // === Category Management ===\n\n OnCategoryChange(categoryId: string | null) {\n this.SelectedCategory = categoryId === '' ? null : categoryId;\n this.filterTemplates(this.SearchControl.value || '');\n }\n\n /** @deprecated Use {@link OnCategoryChange}. */\n onCategoryChange(categoryId: string | null) {\n return this.OnCategoryChange(categoryId);\n }\n\n GetCategoryDisplayName(categoryId: string): string {\n const category = this.Categories$.value.find(c => UUIDsEqual(c.ID, categoryId));\n return category?.Name || 'Unknown Category';\n }\n\n /** @deprecated Use {@link GetCategoryDisplayName}. */\n getCategoryDisplayName(categoryId: string): string {\n return this.GetCategoryDisplayName(categoryId);\n }\n\n // === Selection Management ===\n\n ToggleTemplateSelection(template: MJTemplateEntity) {\n if (this.config.MultiSelect) {\n if (this.SelectedTemplates.has(template.ID)) {\n this.SelectedTemplates.delete(template.ID);\n } else {\n this.SelectedTemplates.add(template.ID);\n }\n } else {\n // Single select - replace current selection\n this.SelectedTemplates.clear();\n this.SelectedTemplates.add(template.ID);\n }\n }\n\n /** @deprecated Use {@link ToggleTemplateSelection}. */\n toggleTemplateSelection(template: MJTemplateEntity) {\n return this.ToggleTemplateSelection(template);\n }\n\n IsTemplateSelected(template: MJTemplateEntity): boolean {\n return this.SelectedTemplates.has(template.ID);\n }\n\n /** @deprecated Use {@link IsTemplateSelected}. */\n isTemplateSelected(template: MJTemplateEntity): boolean {\n return this.IsTemplateSelected(template);\n }\n\n GetSelectedTemplateObjects(): MJTemplateEntity[] {\n const allTemplates = this.Templates$.value;\n return allTemplates.filter(template => this.SelectedTemplates.has(template.ID));\n }\n\n /** @deprecated Use {@link GetSelectedTemplateObjects}. */\n getSelectedTemplateObjects(): MJTemplateEntity[] {\n return this.GetSelectedTemplateObjects();\n }\n\n // === UI Helpers ===\n\n ToggleViewMode() {\n this.ViewMode = this.ViewMode === 'grid' ? 'list' : 'grid';\n }\n\n /** @deprecated Use {@link ToggleViewMode}. */\n toggleViewMode() {\n return this.ToggleViewMode();\n }\n\n GetTemplateStatusColor(template: MJTemplateEntity): string {\n if (!template.IsActive) return '#6c757d';\n if (template.DisabledAt && new Date(template.DisabledAt) <= new Date()) return '#dc3545';\n if (template.ActiveAt && new Date(template.ActiveAt) > new Date()) return '#ffc107';\n return '#28a745';\n }\n\n /** @deprecated Use {@link GetTemplateStatusColor}. */\n getTemplateStatusColor(template: MJTemplateEntity): string {\n return this.GetTemplateStatusColor(template);\n }\n\n GetTemplateStatusText(template: MJTemplateEntity): string {\n if (!template.IsActive) return 'Inactive';\n if (template.DisabledAt && new Date(template.DisabledAt) <= new Date()) return 'Disabled';\n if (template.ActiveAt && new Date(template.ActiveAt) > new Date()) return 'Scheduled';\n return 'Active';\n }\n\n /** @deprecated Use {@link GetTemplateStatusText}. */\n getTemplateStatusText(template: MJTemplateEntity): string {\n return this.GetTemplateStatusText(template);\n }\n\n GetTemplatePreview(template: MJTemplateEntity): string {\n if (!template.Description) return 'No description available';\n return template.Description.length > 100 \n ? template.Description.substring(0, 100) + '...' \n : template.Description;\n }\n\n /** @deprecated Use {@link GetTemplatePreview}. */\n getTemplatePreview(template: MJTemplateEntity): string {\n return this.GetTemplatePreview(template);\n }\n\n formatDate(date: Date | string | null): string {\n if (!date) return '';\n const d = new Date(date);\n return d.toLocaleDateString();\n }\n\n // === Dialog Actions ===\n\n SelectTemplates() {\n const selectedTemplateObjects = this.GetSelectedTemplateObjects();\n \n if (selectedTemplateObjects.length === 0) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Please select at least one template',\n 'warning',\n 2000\n );\n return;\n }\n\n const result: TemplateSelectorResult = {\n SelectedTemplates: selectedTemplateObjects\n };\n\n this.Result.next(result);\n this.DialogClose.emit();\n }\n\n /** @deprecated Use {@link SelectTemplates}. */\n selectTemplates() {\n return this.SelectTemplates();\n }\n\n CreateNew() {\n const result: TemplateSelectorResult = {\n SelectedTemplates: [],\n createNew: true\n };\n\n this.Result.next(result);\n this.DialogClose.emit();\n }\n\n /** @deprecated Use {@link CreateNew}. */\n createNew() {\n return this.CreateNew();\n }\n\n cancel() {\n this.Result.next(null);\n this.DialogClose.emit();\n }\n}","<!-- Template Selector Dialog -->\n<div class=\"template-selector-dialog\">\n <!-- Header -->\n <div class=\"dialog-header\">\n <h3>{{ config.Title }}</h3>\n <div class=\"header-actions\">\n <button\n mjButton\n size=\"sm\"\n (click)=\"toggleViewMode()\"\n >\n <i [class]=\"viewMode === 'list' ? 'fa-solid fa-th' : 'fa-solid fa-list'\"></i>\n {{ viewMode === 'list' ? 'Grid' : 'List' }}\n </button>\n </div>\n </div>\n\n <!-- Search and Filter Section -->\n <div class=\"search-filter-section\">\n <!-- Search Input -->\n <div class=\"search-container\">\n <input\n class=\"mj-input\"\n type=\"text\"\n [formControl]=\"searchControl\"\n placeholder=\"Search templates...\"\n />\n <i class=\"fa-solid fa-search search-icon\"></i>\n </div>\n\n <!-- Category Filter -->\n <div class=\"category-filter\">\n <select\n class=\"mj-input\"\n [value]=\"selectedCategory || ''\"\n (change)=\"onCategoryChange($any($event.target).value || null)\"\n >\n <option value=\"\">All Categories</option>\n @for (category of categories$ | async; track category.ID) {\n <option [value]=\"category.ID\">{{ category.Name }}</option>\n }\n </select>\n </div>\n </div>\n\n <!-- Loading State -->\n @if (isLoading$ | async) {\n <div class=\"loading-container\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading templates...</span>\n </div>\n }\n\n <!-- Template List/Grid -->\n @if (!(isLoading$ | async)) {\n <div class=\"templates-container\" [class.grid-mode]=\"viewMode === 'grid'\">\n @for (template of filteredTemplates$ | async; track template.ID) {\n <div \n class=\"template-item\"\n [class.selected]=\"isTemplateSelected(template)\"\n (click)=\"toggleTemplateSelection(template)\"\n >\n <!-- Selection Checkbox -->\n <div class=\"selection-indicator\">\n @if (config.MultiSelect) {\n <input\n type=\"checkbox\"\n [checked]=\"isTemplateSelected(template)\"\n (change)=\"toggleTemplateSelection(template)\"\n />\n } @else {\n <input\n type=\"radio\"\n [checked]=\"isTemplateSelected(template)\"\n (change)=\"toggleTemplateSelection(template)\"\n />\n }\n </div>\n\n <!-- Template Info -->\n <div class=\"template-info\">\n <div class=\"template-header\">\n <h4 class=\"template-name\">{{ template.Name }}</h4>\n <div class=\"template-status\">\n <span \n class=\"status-badge\"\n [style.background-color]=\"getTemplateStatusColor(template)\"\n >\n {{ getTemplateStatusText(template) }}\n </span>\n </div>\n </div>\n\n <!-- Template Description -->\n @if (template.Description) {\n <div class=\"template-description\">\n {{ getTemplatePreview(template) }}\n </div>\n }\n\n <!-- Template Metadata -->\n <div class=\"template-metadata\">\n <div class=\"metadata-item\">\n <i class=\"fa-solid fa-user\"></i>\n <span>{{ template.User || 'Unknown User' }}</span>\n </div>\n \n @if (template.Category) {\n <div class=\"metadata-item\">\n <i class=\"fa-solid fa-folder\"></i>\n <span>{{ template.Category }}</span>\n </div>\n }\n \n @if (template.__mj_CreatedAt) {\n <div class=\"metadata-item\">\n <i class=\"fa-solid fa-calendar\"></i>\n <span>{{ formatDate(template.__mj_CreatedAt) }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n } @empty {\n <div class=\"no-templates\">\n <i class=\"fa-solid fa-file-alt fa-3x\"></i>\n <h4>No templates found</h4>\n <p>No templates match your current search criteria.</p>\n </div>\n }\n </div>\n }\n\n <!-- Dialog Actions -->\n <div class=\"dialog-actions\">\n <div class=\"action-buttons\">\n @if (config.ShowCreateNew) {\n <button\n mjButton\n variant=\"outline\"\n (click)=\"createNew()\"\n >\n <i class=\"fa-solid fa-plus\"></i>\n Create New\n </button>\n }\n \n <button\n mjButton\n (click)=\"cancel()\"\n >\n Cancel\n </button>\n \n <button\n mjButton\n variant=\"primary\"\n (click)=\"selectTemplates()\"\n [disabled]=\"selectedTemplates.size === 0\"\n >\n <i class=\"fa-solid fa-check\"></i>\n Select {{ selectedTemplates.size > 0 ? '(' + selectedTemplates.size + ')' : '' }}\n </button>\n </div>\n </div>\n</div>"]}
|