@masterteam/forms 0.0.54 → 0.0.55

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/assets/forms.css CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
2
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-600:oklch(57.7% .245 27.325);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-gray-200:oklch(92.8% .006 264.531);--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.\@container{container-type:inline-size}.absolute{position:absolute}.relative{position:relative}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-5{top:calc(var(--spacing) * 5)}.right-0{right:calc(var(--spacing) * 0)}.right-1\/2{right:50%}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.z-10{z-index:10}.col-span-6{grid-column:span 6/span 6}.col-span-12{grid-column:span 12/span 12}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-0\.5{height:calc(var(--spacing) * .5)}.h-10{height:calc(var(--spacing) * 10)}.w-10{width:calc(var(--spacing) * 10)}.w-full{width:100%}.max-w-\[8rem\]{max-width:8rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[36rem\]{min-width:36rem}.flex-1{flex:1}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-gray-200{border-color:var(--color-gray-200)}.border-primary{border-color:var(--p-primary-color)}@supports (color:color-mix(in lab, red, red)){.border-primary{border-color:color-mix(in srgb, var(--p-primary-color) calc(100% * 1), transparent)}}.border-surface-200{border-color:var(--p-surface-200)}@supports (color:color-mix(in lab, red, red)){.border-surface-200{border-color:color-mix(in srgb, var(--p-surface-200) calc(100% * 1), transparent)}}.border-surface-300{border-color:var(--p-surface-300)}@supports (color:color-mix(in lab, red, red)){.border-surface-300{border-color:color-mix(in srgb, var(--p-surface-300) calc(100% * 1), transparent)}}.bg-primary{background-color:var(--p-primary-color)}@supports (color:color-mix(in lab, red, red)){.bg-primary{background-color:color-mix(in srgb, var(--p-primary-color) calc(100% * 1), transparent)}}.bg-surface-50{background-color:var(--p-surface-50)}@supports (color:color-mix(in lab, red, red)){.bg-surface-50{background-color:color-mix(in srgb, var(--p-surface-50) calc(100% * 1), transparent)}}.bg-surface-300{background-color:var(--p-surface-300)}@supports (color:color-mix(in lab, red, red)){.bg-surface-300{background-color:color-mix(in srgb, var(--p-surface-300) calc(100% * 1), transparent)}}.bg-white{background-color:var(--color-white)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-2{padding-block:calc(var(--spacing) * 2)}.ps-5{padding-inline-start:calc(var(--spacing) * 5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-color{color:var(--p-text-color)}.text-muted-color{color:var(--p-text-muted-color)}.text-primary{color:var(--p-primary-color)}@supports (color:color-mix(in lab, red, red)){.text-primary{color:color-mix(in srgb, var(--p-primary-color) calc(100% * 1), transparent)}}.text-red-600{color:var(--color-red-600)}.text-surface-0{color:var(--p-surface-0)}@supports (color:color-mix(in lab, red, red)){.text-surface-0{color:color-mix(in srgb, var(--p-surface-0) calc(100% * 1), transparent)}}.text-surface-500{color:var(--p-surface-500)}@supports (color:color-mix(in lab, red, red)){.text-surface-500{color:color-mix(in srgb, var(--p-surface-500) calc(100% * 1), transparent)}}.text-surface-700{color:var(--p-surface-700)}@supports (color:color-mix(in lab, red, red)){.text-surface-700{color:color-mix(in srgb, var(--p-surface-700) calc(100% * 1), transparent)}}.ring-4{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-primary\/10{--tw-ring-color:var(--p-primary-color)}@supports (color:color-mix(in lab, red, red)){.ring-primary\/10{--tw-ring-color:color-mix(in oklab, color-mix(in srgb, var(--p-primary-color) calc(100% * 1), transparent) 10%, transparent)}}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}}@keyframes enter{0%{opacity:var(--p-enter-opacity,1);transform:translate3d(var(--p-enter-translate-x,0), var(--p-enter-translate-y,0), 0) scale3d(var(--p-enter-scale,1), var(--p-enter-scale,1), var(--p-enter-scale,1)) rotate(var(--p-enter-rotate,0))}}@keyframes leave{to{opacity:var(--p-leave-opacity,1);transform:translate3d(var(--p-leave-translate-x,0), var(--p-leave-translate-y,0), 0) scale3d(var(--p-leave-scale,1), var(--p-leave-scale,1), var(--p-leave-scale,1)) rotate(var(--p-leave-rotate,0))}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-600:oklch(57.7% .245 27.325);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-gray-200:oklch(92.8% .006 264.531);--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.\@container{container-type:inline-size}.absolute{position:absolute}.relative{position:relative}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-5{top:calc(var(--spacing) * 5)}.right-0{right:calc(var(--spacing) * 0)}.right-1\/2{right:50%}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.z-10{z-index:10}.col-span-6{grid-column:span 6/span 6}.col-span-12{grid-column:span 12/span 12}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-0\.5{height:calc(var(--spacing) * .5)}.h-10{height:calc(var(--spacing) * 10)}.w-10{width:calc(var(--spacing) * 10)}.w-full{width:100%}.max-w-\[8rem\]{max-width:8rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[36rem\]{min-width:36rem}.flex-1{flex:1}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}.overflow-x-auto{overflow-x:auto}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-gray-200{border-color:var(--color-gray-200)}.border-primary{border-color:var(--p-primary-color)}@supports (color:color-mix(in lab, red, red)){.border-primary{border-color:color-mix(in srgb, var(--p-primary-color) calc(100% * 1), transparent)}}.border-surface-200{border-color:var(--p-surface-200)}@supports (color:color-mix(in lab, red, red)){.border-surface-200{border-color:color-mix(in srgb, var(--p-surface-200) calc(100% * 1), transparent)}}.border-surface-300{border-color:var(--p-surface-300)}@supports (color:color-mix(in lab, red, red)){.border-surface-300{border-color:color-mix(in srgb, var(--p-surface-300) calc(100% * 1), transparent)}}.bg-primary{background-color:var(--p-primary-color)}@supports (color:color-mix(in lab, red, red)){.bg-primary{background-color:color-mix(in srgb, var(--p-primary-color) calc(100% * 1), transparent)}}.bg-surface-50{background-color:var(--p-surface-50)}@supports (color:color-mix(in lab, red, red)){.bg-surface-50{background-color:color-mix(in srgb, var(--p-surface-50) calc(100% * 1), transparent)}}.bg-surface-300{background-color:var(--p-surface-300)}@supports (color:color-mix(in lab, red, red)){.bg-surface-300{background-color:color-mix(in srgb, var(--p-surface-300) calc(100% * 1), transparent)}}.bg-white{background-color:var(--color-white)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.ps-5{padding-inline-start:calc(var(--spacing) * 5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-color{color:var(--p-text-color)}.text-muted-color{color:var(--p-text-muted-color)}.text-primary{color:var(--p-primary-color)}@supports (color:color-mix(in lab, red, red)){.text-primary{color:color-mix(in srgb, var(--p-primary-color) calc(100% * 1), transparent)}}.text-red-600{color:var(--color-red-600)}.text-surface-0{color:var(--p-surface-0)}@supports (color:color-mix(in lab, red, red)){.text-surface-0{color:color-mix(in srgb, var(--p-surface-0) calc(100% * 1), transparent)}}.text-surface-500{color:var(--p-surface-500)}@supports (color:color-mix(in lab, red, red)){.text-surface-500{color:color-mix(in srgb, var(--p-surface-500) calc(100% * 1), transparent)}}.text-surface-700{color:var(--p-surface-700)}@supports (color:color-mix(in lab, red, red)){.text-surface-700{color:color-mix(in srgb, var(--p-surface-700) calc(100% * 1), transparent)}}.ring-4{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-primary\/10{--tw-ring-color:var(--p-primary-color)}@supports (color:color-mix(in lab, red, red)){.ring-primary\/10{--tw-ring-color:color-mix(in oklab, color-mix(in srgb, var(--p-primary-color) calc(100% * 1), transparent) 10%, transparent)}}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}}@keyframes enter{0%{opacity:var(--p-enter-opacity,1);transform:translate3d(var(--p-enter-translate-x,0), var(--p-enter-translate-y,0), 0) scale3d(var(--p-enter-scale,1), var(--p-enter-scale,1), var(--p-enter-scale,1)) rotate(var(--p-enter-rotate,0))}}@keyframes leave{to{opacity:var(--p-leave-opacity,1);transform:translate3d(var(--p-leave-translate-x,0), var(--p-leave-translate-y,0), 0) scale3d(var(--p-leave-scale,1), var(--p-leave-scale,1), var(--p-leave-scale,1)) rotate(var(--p-leave-rotate,0))}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}
@@ -5,6 +5,7 @@ import { FormControl, ReactiveFormsModule } from '@angular/forms';
5
5
  import * as i1 from '@angular/common';
6
6
  import { CommonModule } from '@angular/common';
7
7
  import { Skeleton } from 'primeng/skeleton';
8
+ import { Button } from '@masterteam/components/button';
8
9
  import { EntitiesPreview } from '@masterteam/components/entities';
9
10
  import { Tabs } from '@masterteam/components/tabs';
10
11
  import { DynamicForm } from '@masterteam/forms/dynamic-form';
@@ -148,7 +149,7 @@ const WIDTH_TO_ENTITY_SIZE = {
148
149
  * @param mode 'create' or 'edit' — filters hidden fields accordingly
149
150
  * @param lookups Available lookup definitions for resolving Lookup/LookupMultiSelect options
150
151
  */
151
- function mapToDynamicFormConfig(config, lang = 'en', mode = 'create', lookups = [], context = null) {
152
+ function mapToDynamicFormConfig(config, lang = 'en', mode = 'create', lookups = [], context = null, readonly = false) {
152
153
  const validationRules = mapValidationRules(config, lang);
153
154
  return {
154
155
  sections: config.sections
@@ -172,7 +173,7 @@ function mapToDynamicFormConfig(config, lang = 'en', mode = 'create', lookups =
172
173
  type: 'header',
173
174
  columns: 12,
174
175
  order: section.order,
175
- fields: visibleFields.map((field) => mapFieldToConfig(field, lang, lookups, context)),
176
+ fields: visibleFields.map((field) => mapFieldToConfig(field, lang, lookups, context, readonly)),
176
177
  };
177
178
  })
178
179
  .filter((section) => section.fields.length > 0),
@@ -238,23 +239,29 @@ function mapFormValueToSubmitFields(formValue, loadResponse) {
238
239
  })
239
240
  .filter((value) => !!value);
240
241
  }
241
- function getPreviewOnlyFieldKeys(config, mode = 'create') {
242
+ function getPreviewOnlyFieldKeys(config, mode = 'create', readonly = false) {
242
243
  return config.sections.flatMap((section) => (section.fields ?? [])
243
- .filter((field) => isFieldVisible(field, mode) && isPreviewOnlyField(field))
244
+ .filter((field) => isFieldVisible(field, mode) && isPreviewOnlyField(field, readonly))
244
245
  .map((field) => field.propertyKey));
245
246
  }
246
- function mapPreviewFieldsToEntities(config, values, mode = 'create') {
247
+ function mapPreviewFieldsToEntities(config, values, mode = 'create', readonly = false) {
248
+ return mapPreviewSectionsToEntities(config, values, 'en', mode, readonly).flatMap((section) => section.entities);
249
+ }
250
+ function mapPreviewSectionsToEntities(config, values, lang = 'en', mode = 'create', readonly = false) {
247
251
  const resolvedValues = mapValuesToFormValue(values, config);
248
252
  return config.sections
249
253
  .slice()
250
254
  .sort((a, b) => a.order - b.order)
251
- .flatMap((section) => (section.fields ?? [])
252
- .filter((field) => isFieldVisible(field, mode) && isPreviewOnlyField(field))
253
- .sort((a, b) => a.order - b.order)
254
- .flatMap((field) => {
255
- const property = field.propertyMetadata;
256
- return [
257
- {
255
+ .map((section) => ({
256
+ key: section.id,
257
+ label: section.name[lang] ?? section.name.en ?? '',
258
+ order: section.order,
259
+ entities: (section.fields ?? [])
260
+ .filter((field) => isFieldVisible(field, mode) && isPreviewOnlyField(field, readonly))
261
+ .sort((a, b) => a.order - b.order)
262
+ .map((field) => {
263
+ const property = field.propertyMetadata;
264
+ return {
258
265
  ...property,
259
266
  name: property.name?.display,
260
267
  key: property.key ?? field.propertyKey,
@@ -264,9 +271,10 @@ function mapPreviewFieldsToEntities(config, values, mode = 'create') {
264
271
  ...property.configuration,
265
272
  size: WIDTH_TO_ENTITY_SIZE[field.width] ?? 24,
266
273
  },
267
- },
268
- ];
269
- }));
274
+ };
275
+ }),
276
+ }))
277
+ .filter((section) => section.entities.length > 0);
270
278
  }
271
279
  // ============================================================================
272
280
  // Internal Helpers
@@ -278,8 +286,8 @@ function isFieldVisible(field, mode) {
278
286
  return !field.hiddenInCreation;
279
287
  return !field.hiddenInEditForm;
280
288
  }
281
- function isPreviewOnlyField(field) {
282
- return field.isWrite === false && field.isRead !== false;
289
+ function isPreviewOnlyField(field, readonly = false) {
290
+ return field.isRead !== false && (readonly || field.isWrite === false);
283
291
  }
284
292
  function isCalculatedField(field) {
285
293
  return field.propertyMetadata?.isCalculated === true;
@@ -292,7 +300,7 @@ function resolveFieldMeta(field) {
292
300
  viewType: property?.viewType ?? 'Text',
293
301
  };
294
302
  }
295
- function mapFieldToConfig(field, lang, lookups, context) {
303
+ function mapFieldToConfig(field, lang, lookups, context, readonly = false) {
296
304
  const { property: prop, viewType } = resolveFieldMeta(field);
297
305
  const label = prop?.name?.display ??
298
306
  field.propertyKey;
@@ -305,7 +313,7 @@ function mapFieldToConfig(field, lang, lookups, context) {
305
313
  placeholder: label,
306
314
  required: field.isRequired ?? false,
307
315
  disabled: isCalculatedField(field),
308
- readonly: field.isWrite === false,
316
+ readonly: readonly || field.isWrite === false,
309
317
  validators: field.isRequired
310
318
  ? [ValidatorConfig.required(`${label} is required`)]
311
319
  : [],
@@ -762,7 +770,7 @@ class ClientForm {
762
770
  const config = this.state.formConfiguration();
763
771
  if (!config)
764
772
  return null;
765
- return mapToDynamicFormConfig(config, this.lang(), this.formMode(), this.lookups(), this.state.context());
773
+ return mapToDynamicFormConfig(config, this.lang(), this.formMode(), this.lookups(), this.state.context(), this.readonly());
766
774
  }, ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
767
775
  initialValues = computed(() => {
768
776
  return mapValuesToFormValue(this.state.formValues(), this.state.formConfiguration());
@@ -775,18 +783,23 @@ class ClientForm {
775
783
  return [];
776
784
  return [
777
785
  ...new Set([
778
- ...getPreviewOnlyFieldKeys(config, this.formMode()),
786
+ ...getPreviewOnlyFieldKeys(config, this.formMode(), this.readonly()),
779
787
  ...this.ignoredFieldKeys(),
780
788
  ]),
781
789
  ];
782
790
  }, ...(ngDevMode ? [{ debugName: "previewFieldKeys" }] : []));
783
- previewEntities = computed(() => {
791
+ previewEntitySections = computed(() => {
784
792
  const config = this.state.formConfiguration();
785
793
  if (!config)
786
794
  return [];
787
795
  const ignoredFieldKeys = new Set(this.ignoredFieldKeys());
788
- return mapPreviewFieldsToEntities(config, this.state.formValues(), this.formMode()).filter((entity) => !entity.key || !ignoredFieldKeys.has(entity.key));
789
- }, ...(ngDevMode ? [{ debugName: "previewEntities" }] : []));
796
+ return mapPreviewSectionsToEntities(config, this.state.formValues(), this.lang(), this.formMode(), this.readonly())
797
+ .map((section) => ({
798
+ ...section,
799
+ entities: section.entities.filter((entity) => !entity.key || !ignoredFieldKeys.has(entity.key)),
800
+ }))
801
+ .filter((section) => section.entities.length > 0);
802
+ }, ...(ngDevMode ? [{ debugName: "previewEntitySections" }] : []));
790
803
  editableFormConfig = computed(() => {
791
804
  const config = this.formConfig();
792
805
  if (!config)
@@ -1197,18 +1210,19 @@ class ClientForm {
1197
1210
  return 'upcoming';
1198
1211
  }
1199
1212
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClientForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
1200
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: ClientForm, isStandalone: true, selector: "mt-client-form", inputs: { moduleKey: { classPropertyName: "moduleKey", publicName: "moduleKey", isSignal: true, isRequired: true, transformFunction: null }, operationKey: { classPropertyName: "operationKey", publicName: "operationKey", isSignal: true, isRequired: true, transformFunction: null }, moduleId: { classPropertyName: "moduleId", publicName: "moduleId", isSignal: true, isRequired: false, transformFunction: null }, levelId: { classPropertyName: "levelId", publicName: "levelId", isSignal: true, isRequired: false, transformFunction: null }, levelDataId: { classPropertyName: "levelDataId", publicName: "levelDataId", isSignal: true, isRequired: false, transformFunction: null }, moduleDataId: { classPropertyName: "moduleDataId", publicName: "moduleDataId", isSignal: true, isRequired: false, transformFunction: null }, requestSchemaId: { classPropertyName: "requestSchemaId", publicName: "requestSchemaId", isSignal: true, isRequired: false, transformFunction: null }, draftProcessId: { classPropertyName: "draftProcessId", publicName: "draftProcessId", isSignal: true, isRequired: false, transformFunction: null }, preview: { classPropertyName: "preview", publicName: "preview", isSignal: true, isRequired: false, transformFunction: null }, returnUrl: { classPropertyName: "returnUrl", publicName: "returnUrl", isSignal: true, isRequired: false, transformFunction: null }, submitRequestMapper: { classPropertyName: "submitRequestMapper", publicName: "submitRequestMapper", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, autoLoad: { classPropertyName: "autoLoad", publicName: "autoLoad", isSignal: true, isRequired: false, transformFunction: null }, formMode: { classPropertyName: "formMode", publicName: "formMode", isSignal: true, isRequired: false, transformFunction: null }, renderMode: { classPropertyName: "renderMode", publicName: "renderMode", isSignal: true, isRequired: false, transformFunction: null }, showInternalStepActions: { classPropertyName: "showInternalStepActions", publicName: "showInternalStepActions", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, ignoredFieldKeys: { classPropertyName: "ignoredFieldKeys", publicName: "ignoredFieldKeys", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loaded: "loaded", submitted: "submitted", errored: "errored", modeDetected: "modeDetected", formSourceDetected: "formSourceDetected", footerStateChanged: "footerStateChanged" }, providers: [ClientFormStateService], ngImport: i0, template: "<!-- Client Form Template - render only; step navigation buttons are optional -->\r\n\r\n<!-- Loading State -->\r\n@if (state.loading()) {\r\n <div class=\"flex flex-col gap-6\">\r\n <!-- Section header skeleton -->\r\n <div class=\"flex flex-col gap-4\">\r\n <p-skeleton width=\"30%\" height=\"1.5rem\" />\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"40%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"40%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-12 flex flex-col gap-2\">\r\n <p-skeleton width=\"25%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"35%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"45%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Second section skeleton -->\r\n <div class=\"flex flex-col gap-4\">\r\n <p-skeleton width=\"25%\" height=\"1.5rem\" />\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"35%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"50%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-12 flex flex-col gap-2\">\r\n <p-skeleton width=\"30%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"5rem\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n\r\n<!-- Loaded State -->\r\n@if (state.isLoaded() && !state.loading()) {\r\n <div class=\"flex flex-col gap-4\">\r\n @if (previewEntities().length > 0) {\r\n <mt-entities-preview [entities]=\"previewEntities()\" />\r\n }\r\n\r\n <!-- Dynamic Form -->\r\n @if (state.requiresForm() && editableFormConfig(); as config) {\r\n @if (hasEditableFormSections()) {\r\n <div class=\"flex flex-col gap-4\">\r\n @if (runtimeErrors().length > 0 || runtimeWarnings().length > 0) {\r\n <div class=\"rounded-lg border border-surface-200 p-4 bg-surface-50\">\r\n @if (runtimeErrors().length > 0) {\r\n <div class=\"mb-3\">\r\n <h4 class=\"text-sm font-semibold text-red-600 mb-2\">\r\n Validation Errors\r\n </h4>\r\n <ul class=\"list-disc ps-5 text-sm text-red-600 space-y-1\">\r\n @for (\r\n msg of runtimeErrors();\r\n track msg.ruleId || msg.fieldKey || msg.message\r\n ) {\r\n <li>{{ msg.message }}</li>\r\n }\r\n </ul>\r\n </div>\r\n }\r\n\r\n @if (runtimeWarnings().length > 0) {\r\n <div>\r\n <h4 class=\"text-sm font-semibold text-amber-600 mb-2\">\r\n Validation Warnings\r\n </h4>\r\n <ul class=\"list-disc ps-5 text-sm text-amber-700 space-y-1\">\r\n @for (\r\n msg of runtimeWarnings();\r\n track msg.ruleId || msg.fieldKey || msg.message\r\n ) {\r\n <li>{{ msg.message }}</li>\r\n }\r\n </ul>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (stepsEnabled()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"overflow-x-auto pb-2\">\r\n <div class=\"flex min-w-[36rem] items-start\">\r\n @for (\r\n step of stepTimeline();\r\n track step.key;\r\n let first = $first;\r\n let last = $last\r\n ) {\r\n <div\r\n class=\"relative flex min-w-[8rem] flex-1 justify-center\"\r\n >\r\n @if (!rtl() && !first) {\r\n <span\r\n class=\"absolute top-5 left-0 right-1/2 h-0.5\"\r\n [ngClass]=\"\r\n step.beforeLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (!rtl() && !last) {\r\n <span\r\n class=\"absolute top-5 left-1/2 right-0 h-0.5\"\r\n [ngClass]=\"\r\n step.afterLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (rtl() && !last) {\r\n <span\r\n class=\"absolute top-5 left-0 right-1/2 h-0.5\"\r\n [ngClass]=\"\r\n step.afterLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (rtl() && !first) {\r\n <span\r\n class=\"absolute top-5 left-1/2 right-0 h-0.5\"\r\n [ngClass]=\"\r\n step.beforeLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n\r\n <button\r\n type=\"button\"\r\n class=\"relative z-10 flex w-full flex-col items-center gap-3 px-2 text-center focus-visible:outline-none\"\r\n [attr.aria-pressed]=\"step.selected\"\r\n [attr.aria-current]=\"\r\n step.state === 'current' ? 'step' : null\r\n \"\r\n [attr.title]=\"step.label\"\r\n (click)=\"onStepChange(step.value)\"\r\n >\r\n <span\r\n class=\"flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border text-sm font-semibold transition-all duration-200\"\r\n [ngClass]=\"{\r\n 'border-primary bg-primary text-surface-0 ring-4 ring-primary/10':\r\n step.state === 'completed' ||\r\n step.state === 'current',\r\n\r\n 'border-surface-300 bg-white text-surface-500':\r\n step.state === 'upcoming',\r\n }\"\r\n >\r\n {{ step.value }}\r\n </span>\r\n <span\r\n class=\"max-w-[8rem] text-center text-sm leading-5 transition-colors duration-200\"\r\n [ngClass]=\"{\r\n 'font-semibold text-primary':\r\n step.selected || step.state === 'current',\r\n 'font-medium text-surface-700':\r\n step.state === 'completed' && !step.selected,\r\n 'font-medium text-surface-500':\r\n step.state === 'upcoming',\r\n }\"\r\n dir=\"auto\"\r\n >\r\n {{ step.label }}\r\n </span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (showInternalStepActions()) {\r\n <div class=\"flex justify-between gap-2\">\r\n <button\r\n type=\"button\"\r\n class=\"px-3 py-2 rounded border border-surface-300 text-sm\"\r\n [disabled]=\"currentStep() === 1\"\r\n (click)=\"goToPreviousStep()\"\r\n >\r\n Previous\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"px-3 py-2 rounded border border-surface-300 text-sm\"\r\n [disabled]=\"currentStep() === stepSections().length\"\r\n (click)=\"goToNextStep()\"\r\n >\r\n Next\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (tabsEnabled()) {\r\n <mt-tabs\r\n [active]=\"currentStep()\"\r\n (activeChange)=\"onStepChange($event)\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n fluid\r\n />\r\n }\r\n <mt-dynamic-form\r\n [formConfig]=\"config\"\r\n [formControl]=\"formControl\"\r\n [visibleSectionKeys]=\"visibleSectionKeys()\"\r\n [forcedHiddenFieldKeys]=\"effectiveForcedHiddenFieldKeys()\"\r\n [preserveForcedHiddenValues]=\"true\"\r\n (runtimeMessagesChange)=\"onRuntimeMessagesChange($event)\"\r\n />\r\n </div>\r\n }\r\n } @else if (previewEntities().length === 0) {\r\n <div\r\n class=\"flex items-center justify-center p-6 rounded-lg bg-surface-50 border border-surface-200 border-dashed\"\r\n >\r\n <p class=\"text-sm text-muted-color\">\r\n No form required for this operation.\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: EntitiesPreview, selector: "mt-entities-preview", inputs: ["entities"] }, { kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys"], outputs: ["runtimeMessagesChange"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "size", "fluid", "disabled"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
1213
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: ClientForm, isStandalone: true, selector: "mt-client-form", inputs: { moduleKey: { classPropertyName: "moduleKey", publicName: "moduleKey", isSignal: true, isRequired: true, transformFunction: null }, operationKey: { classPropertyName: "operationKey", publicName: "operationKey", isSignal: true, isRequired: true, transformFunction: null }, moduleId: { classPropertyName: "moduleId", publicName: "moduleId", isSignal: true, isRequired: false, transformFunction: null }, levelId: { classPropertyName: "levelId", publicName: "levelId", isSignal: true, isRequired: false, transformFunction: null }, levelDataId: { classPropertyName: "levelDataId", publicName: "levelDataId", isSignal: true, isRequired: false, transformFunction: null }, moduleDataId: { classPropertyName: "moduleDataId", publicName: "moduleDataId", isSignal: true, isRequired: false, transformFunction: null }, requestSchemaId: { classPropertyName: "requestSchemaId", publicName: "requestSchemaId", isSignal: true, isRequired: false, transformFunction: null }, draftProcessId: { classPropertyName: "draftProcessId", publicName: "draftProcessId", isSignal: true, isRequired: false, transformFunction: null }, preview: { classPropertyName: "preview", publicName: "preview", isSignal: true, isRequired: false, transformFunction: null }, returnUrl: { classPropertyName: "returnUrl", publicName: "returnUrl", isSignal: true, isRequired: false, transformFunction: null }, submitRequestMapper: { classPropertyName: "submitRequestMapper", publicName: "submitRequestMapper", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, autoLoad: { classPropertyName: "autoLoad", publicName: "autoLoad", isSignal: true, isRequired: false, transformFunction: null }, formMode: { classPropertyName: "formMode", publicName: "formMode", isSignal: true, isRequired: false, transformFunction: null }, renderMode: { classPropertyName: "renderMode", publicName: "renderMode", isSignal: true, isRequired: false, transformFunction: null }, showInternalStepActions: { classPropertyName: "showInternalStepActions", publicName: "showInternalStepActions", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, ignoredFieldKeys: { classPropertyName: "ignoredFieldKeys", publicName: "ignoredFieldKeys", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loaded: "loaded", submitted: "submitted", errored: "errored", modeDetected: "modeDetected", formSourceDetected: "formSourceDetected", footerStateChanged: "footerStateChanged" }, providers: [ClientFormStateService], ngImport: i0, template: "<!-- Client Form Template - render only; step navigation buttons are optional -->\r\n\r\n<!-- Loading State -->\r\n@if (state.loading()) {\r\n <div class=\"flex flex-col gap-6\">\r\n <!-- Section header skeleton -->\r\n <div class=\"flex flex-col gap-4\">\r\n <p-skeleton width=\"30%\" height=\"1.5rem\" />\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"40%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"40%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-12 flex flex-col gap-2\">\r\n <p-skeleton width=\"25%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"35%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"45%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Second section skeleton -->\r\n <div class=\"flex flex-col gap-4\">\r\n <p-skeleton width=\"25%\" height=\"1.5rem\" />\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"35%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"50%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-12 flex flex-col gap-2\">\r\n <p-skeleton width=\"30%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"5rem\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n\r\n<!-- Loaded State -->\r\n@if (state.isLoaded() && !state.loading()) {\r\n <div class=\"flex flex-col gap-4\">\n @if (previewEntitySections().length > 0) {\n <div class=\"flex flex-col gap-6\">\n @for (section of previewEntitySections(); track section.key) {\n <div class=\"flex flex-col gap-4\">\n @if (section.label) {\n <h3\n class=\"text-lg font-semibold text-color border-b-2 border-gray-200 pb-2 mb-3\"\n >\n {{ section.label }}\n </h3>\n }\n <mt-entities-preview [entities]=\"section.entities\" />\n </div>\n }\n </div>\n }\n\r\n <!-- Dynamic Form -->\r\n @if (state.requiresForm() && editableFormConfig(); as config) {\r\n @if (hasEditableFormSections()) {\r\n <div class=\"flex flex-col gap-4\">\r\n @if (runtimeErrors().length > 0 || runtimeWarnings().length > 0) {\r\n <div class=\"rounded-lg border border-surface-200 p-4 bg-surface-50\">\r\n @if (runtimeErrors().length > 0) {\r\n <div class=\"mb-3\">\r\n <h4 class=\"text-sm font-semibold text-red-600 mb-2\">\r\n Validation Errors\r\n </h4>\r\n <ul class=\"list-disc ps-5 text-sm text-red-600 space-y-1\">\r\n @for (\r\n msg of runtimeErrors();\r\n track msg.ruleId || msg.fieldKey || msg.message\r\n ) {\r\n <li>{{ msg.message }}</li>\r\n }\r\n </ul>\r\n </div>\r\n }\r\n\r\n @if (runtimeWarnings().length > 0) {\r\n <div>\r\n <h4 class=\"text-sm font-semibold text-amber-600 mb-2\">\r\n Validation Warnings\r\n </h4>\r\n <ul class=\"list-disc ps-5 text-sm text-amber-700 space-y-1\">\r\n @for (\r\n msg of runtimeWarnings();\r\n track msg.ruleId || msg.fieldKey || msg.message\r\n ) {\r\n <li>{{ msg.message }}</li>\r\n }\r\n </ul>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (stepsEnabled()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"overflow-x-auto pb-2\">\r\n <div class=\"flex min-w-[36rem] items-start\">\r\n @for (\r\n step of stepTimeline();\r\n track step.key;\r\n let first = $first;\r\n let last = $last\r\n ) {\r\n <div\r\n class=\"relative flex min-w-[8rem] flex-1 justify-center\"\r\n >\r\n @if (!rtl() && !first) {\r\n <span\r\n class=\"absolute top-5 left-0 right-1/2 h-0.5\"\r\n [ngClass]=\"\r\n step.beforeLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (!rtl() && !last) {\r\n <span\r\n class=\"absolute top-5 left-1/2 right-0 h-0.5\"\r\n [ngClass]=\"\r\n step.afterLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (rtl() && !last) {\r\n <span\r\n class=\"absolute top-5 left-0 right-1/2 h-0.5\"\r\n [ngClass]=\"\r\n step.afterLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (rtl() && !first) {\r\n <span\r\n class=\"absolute top-5 left-1/2 right-0 h-0.5\"\r\n [ngClass]=\"\r\n step.beforeLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n\r\n <button\r\n type=\"button\"\r\n class=\"relative z-10 flex w-full flex-col items-center gap-3 px-2 text-center focus-visible:outline-none\"\r\n [attr.aria-pressed]=\"step.selected\"\r\n [attr.aria-current]=\"\r\n step.state === 'current' ? 'step' : null\r\n \"\r\n [attr.title]=\"step.label\"\r\n (click)=\"onStepChange(step.value)\"\r\n >\r\n <span\r\n class=\"flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border text-sm font-semibold transition-all duration-200\"\r\n [ngClass]=\"{\r\n 'border-primary bg-primary text-surface-0 ring-4 ring-primary/10':\r\n step.state === 'completed' ||\r\n step.state === 'current',\r\n\r\n 'border-surface-300 bg-white text-surface-500':\r\n step.state === 'upcoming',\r\n }\"\r\n >\r\n {{ step.value }}\r\n </span>\r\n <span\r\n class=\"max-w-[8rem] text-center text-sm leading-5 transition-colors duration-200\"\r\n [ngClass]=\"{\r\n 'font-semibold text-primary':\r\n step.selected || step.state === 'current',\r\n 'font-medium text-surface-700':\r\n step.state === 'completed' && !step.selected,\r\n 'font-medium text-surface-500':\r\n step.state === 'upcoming',\r\n }\"\r\n dir=\"auto\"\r\n >\r\n {{ step.label }}\r\n </span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (showInternalStepActions()) {\n <div class=\"flex justify-between gap-2\">\n <mt-button\n label=\"Previous\"\n severity=\"secondary\"\n variant=\"outlined\"\n [disabled]=\"currentStep() === 1\"\n (onClick)=\"goToPreviousStep()\"\n />\n <mt-button\n label=\"Next\"\n severity=\"primary\"\n variant=\"outlined\"\n [disabled]=\"currentStep() === stepSections().length\"\n (onClick)=\"goToNextStep()\"\n />\n </div>\n }\n </div>\n }\r\n\r\n @if (tabsEnabled()) {\r\n <mt-tabs\r\n [active]=\"currentStep()\"\r\n (activeChange)=\"onStepChange($event)\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n fluid\r\n />\r\n }\r\n <mt-dynamic-form\r\n [formConfig]=\"config\"\r\n [formControl]=\"formControl\"\r\n [visibleSectionKeys]=\"visibleSectionKeys()\"\r\n [forcedHiddenFieldKeys]=\"effectiveForcedHiddenFieldKeys()\"\r\n [preserveForcedHiddenValues]=\"true\"\r\n (runtimeMessagesChange)=\"onRuntimeMessagesChange($event)\"\r\n />\r\n </div>\r\n }\r\n } @else if (previewEntitySections().length === 0) {\n <div\n class=\"flex items-center justify-center p-6 rounded-lg bg-surface-50 border border-surface-200 border-dashed\"\n >\n <p class=\"text-sm text-muted-color\">\r\n No form required for this operation.\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: EntitiesPreview, selector: "mt-entities-preview", inputs: ["entities"] }, { kind: "component", type: DynamicForm, selector: "mt-dynamic-form", inputs: ["formConfig", "forcedHiddenFieldKeys", "preserveForcedHiddenValues", "visibleSectionKeys"], outputs: ["runtimeMessagesChange"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "size", "fluid", "disabled"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
1201
1214
  }
1202
1215
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClientForm, decorators: [{
1203
1216
  type: Component,
1204
1217
  args: [{ selector: 'mt-client-form', standalone: true, imports: [
1205
1218
  CommonModule,
1206
1219
  ReactiveFormsModule,
1220
+ Button,
1207
1221
  EntitiesPreview,
1208
1222
  DynamicForm,
1209
1223
  Tabs,
1210
1224
  Skeleton,
1211
- ], providers: [ClientFormStateService], template: "<!-- Client Form Template - render only; step navigation buttons are optional -->\r\n\r\n<!-- Loading State -->\r\n@if (state.loading()) {\r\n <div class=\"flex flex-col gap-6\">\r\n <!-- Section header skeleton -->\r\n <div class=\"flex flex-col gap-4\">\r\n <p-skeleton width=\"30%\" height=\"1.5rem\" />\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"40%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"40%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-12 flex flex-col gap-2\">\r\n <p-skeleton width=\"25%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"35%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"45%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Second section skeleton -->\r\n <div class=\"flex flex-col gap-4\">\r\n <p-skeleton width=\"25%\" height=\"1.5rem\" />\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"35%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"50%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-12 flex flex-col gap-2\">\r\n <p-skeleton width=\"30%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"5rem\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n\r\n<!-- Loaded State -->\r\n@if (state.isLoaded() && !state.loading()) {\r\n <div class=\"flex flex-col gap-4\">\r\n @if (previewEntities().length > 0) {\r\n <mt-entities-preview [entities]=\"previewEntities()\" />\r\n }\r\n\r\n <!-- Dynamic Form -->\r\n @if (state.requiresForm() && editableFormConfig(); as config) {\r\n @if (hasEditableFormSections()) {\r\n <div class=\"flex flex-col gap-4\">\r\n @if (runtimeErrors().length > 0 || runtimeWarnings().length > 0) {\r\n <div class=\"rounded-lg border border-surface-200 p-4 bg-surface-50\">\r\n @if (runtimeErrors().length > 0) {\r\n <div class=\"mb-3\">\r\n <h4 class=\"text-sm font-semibold text-red-600 mb-2\">\r\n Validation Errors\r\n </h4>\r\n <ul class=\"list-disc ps-5 text-sm text-red-600 space-y-1\">\r\n @for (\r\n msg of runtimeErrors();\r\n track msg.ruleId || msg.fieldKey || msg.message\r\n ) {\r\n <li>{{ msg.message }}</li>\r\n }\r\n </ul>\r\n </div>\r\n }\r\n\r\n @if (runtimeWarnings().length > 0) {\r\n <div>\r\n <h4 class=\"text-sm font-semibold text-amber-600 mb-2\">\r\n Validation Warnings\r\n </h4>\r\n <ul class=\"list-disc ps-5 text-sm text-amber-700 space-y-1\">\r\n @for (\r\n msg of runtimeWarnings();\r\n track msg.ruleId || msg.fieldKey || msg.message\r\n ) {\r\n <li>{{ msg.message }}</li>\r\n }\r\n </ul>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (stepsEnabled()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"overflow-x-auto pb-2\">\r\n <div class=\"flex min-w-[36rem] items-start\">\r\n @for (\r\n step of stepTimeline();\r\n track step.key;\r\n let first = $first;\r\n let last = $last\r\n ) {\r\n <div\r\n class=\"relative flex min-w-[8rem] flex-1 justify-center\"\r\n >\r\n @if (!rtl() && !first) {\r\n <span\r\n class=\"absolute top-5 left-0 right-1/2 h-0.5\"\r\n [ngClass]=\"\r\n step.beforeLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (!rtl() && !last) {\r\n <span\r\n class=\"absolute top-5 left-1/2 right-0 h-0.5\"\r\n [ngClass]=\"\r\n step.afterLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (rtl() && !last) {\r\n <span\r\n class=\"absolute top-5 left-0 right-1/2 h-0.5\"\r\n [ngClass]=\"\r\n step.afterLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (rtl() && !first) {\r\n <span\r\n class=\"absolute top-5 left-1/2 right-0 h-0.5\"\r\n [ngClass]=\"\r\n step.beforeLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n\r\n <button\r\n type=\"button\"\r\n class=\"relative z-10 flex w-full flex-col items-center gap-3 px-2 text-center focus-visible:outline-none\"\r\n [attr.aria-pressed]=\"step.selected\"\r\n [attr.aria-current]=\"\r\n step.state === 'current' ? 'step' : null\r\n \"\r\n [attr.title]=\"step.label\"\r\n (click)=\"onStepChange(step.value)\"\r\n >\r\n <span\r\n class=\"flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border text-sm font-semibold transition-all duration-200\"\r\n [ngClass]=\"{\r\n 'border-primary bg-primary text-surface-0 ring-4 ring-primary/10':\r\n step.state === 'completed' ||\r\n step.state === 'current',\r\n\r\n 'border-surface-300 bg-white text-surface-500':\r\n step.state === 'upcoming',\r\n }\"\r\n >\r\n {{ step.value }}\r\n </span>\r\n <span\r\n class=\"max-w-[8rem] text-center text-sm leading-5 transition-colors duration-200\"\r\n [ngClass]=\"{\r\n 'font-semibold text-primary':\r\n step.selected || step.state === 'current',\r\n 'font-medium text-surface-700':\r\n step.state === 'completed' && !step.selected,\r\n 'font-medium text-surface-500':\r\n step.state === 'upcoming',\r\n }\"\r\n dir=\"auto\"\r\n >\r\n {{ step.label }}\r\n </span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (showInternalStepActions()) {\r\n <div class=\"flex justify-between gap-2\">\r\n <button\r\n type=\"button\"\r\n class=\"px-3 py-2 rounded border border-surface-300 text-sm\"\r\n [disabled]=\"currentStep() === 1\"\r\n (click)=\"goToPreviousStep()\"\r\n >\r\n Previous\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"px-3 py-2 rounded border border-surface-300 text-sm\"\r\n [disabled]=\"currentStep() === stepSections().length\"\r\n (click)=\"goToNextStep()\"\r\n >\r\n Next\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (tabsEnabled()) {\r\n <mt-tabs\r\n [active]=\"currentStep()\"\r\n (activeChange)=\"onStepChange($event)\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n fluid\r\n />\r\n }\r\n <mt-dynamic-form\r\n [formConfig]=\"config\"\r\n [formControl]=\"formControl\"\r\n [visibleSectionKeys]=\"visibleSectionKeys()\"\r\n [forcedHiddenFieldKeys]=\"effectiveForcedHiddenFieldKeys()\"\r\n [preserveForcedHiddenValues]=\"true\"\r\n (runtimeMessagesChange)=\"onRuntimeMessagesChange($event)\"\r\n />\r\n </div>\r\n }\r\n } @else if (previewEntities().length === 0) {\r\n <div\r\n class=\"flex items-center justify-center p-6 rounded-lg bg-surface-50 border border-surface-200 border-dashed\"\r\n >\r\n <p class=\"text-sm text-muted-color\">\r\n No form required for this operation.\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{display:block}\n"] }]
1225
+ ], providers: [ClientFormStateService], template: "<!-- Client Form Template - render only; step navigation buttons are optional -->\r\n\r\n<!-- Loading State -->\r\n@if (state.loading()) {\r\n <div class=\"flex flex-col gap-6\">\r\n <!-- Section header skeleton -->\r\n <div class=\"flex flex-col gap-4\">\r\n <p-skeleton width=\"30%\" height=\"1.5rem\" />\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"40%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"40%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-12 flex flex-col gap-2\">\r\n <p-skeleton width=\"25%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"35%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"45%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Second section skeleton -->\r\n <div class=\"flex flex-col gap-4\">\r\n <p-skeleton width=\"25%\" height=\"1.5rem\" />\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"35%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"50%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-12 flex flex-col gap-2\">\r\n <p-skeleton width=\"30%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"5rem\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n\r\n<!-- Loaded State -->\r\n@if (state.isLoaded() && !state.loading()) {\r\n <div class=\"flex flex-col gap-4\">\n @if (previewEntitySections().length > 0) {\n <div class=\"flex flex-col gap-6\">\n @for (section of previewEntitySections(); track section.key) {\n <div class=\"flex flex-col gap-4\">\n @if (section.label) {\n <h3\n class=\"text-lg font-semibold text-color border-b-2 border-gray-200 pb-2 mb-3\"\n >\n {{ section.label }}\n </h3>\n }\n <mt-entities-preview [entities]=\"section.entities\" />\n </div>\n }\n </div>\n }\n\r\n <!-- Dynamic Form -->\r\n @if (state.requiresForm() && editableFormConfig(); as config) {\r\n @if (hasEditableFormSections()) {\r\n <div class=\"flex flex-col gap-4\">\r\n @if (runtimeErrors().length > 0 || runtimeWarnings().length > 0) {\r\n <div class=\"rounded-lg border border-surface-200 p-4 bg-surface-50\">\r\n @if (runtimeErrors().length > 0) {\r\n <div class=\"mb-3\">\r\n <h4 class=\"text-sm font-semibold text-red-600 mb-2\">\r\n Validation Errors\r\n </h4>\r\n <ul class=\"list-disc ps-5 text-sm text-red-600 space-y-1\">\r\n @for (\r\n msg of runtimeErrors();\r\n track msg.ruleId || msg.fieldKey || msg.message\r\n ) {\r\n <li>{{ msg.message }}</li>\r\n }\r\n </ul>\r\n </div>\r\n }\r\n\r\n @if (runtimeWarnings().length > 0) {\r\n <div>\r\n <h4 class=\"text-sm font-semibold text-amber-600 mb-2\">\r\n Validation Warnings\r\n </h4>\r\n <ul class=\"list-disc ps-5 text-sm text-amber-700 space-y-1\">\r\n @for (\r\n msg of runtimeWarnings();\r\n track msg.ruleId || msg.fieldKey || msg.message\r\n ) {\r\n <li>{{ msg.message }}</li>\r\n }\r\n </ul>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (stepsEnabled()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"overflow-x-auto pb-2\">\r\n <div class=\"flex min-w-[36rem] items-start\">\r\n @for (\r\n step of stepTimeline();\r\n track step.key;\r\n let first = $first;\r\n let last = $last\r\n ) {\r\n <div\r\n class=\"relative flex min-w-[8rem] flex-1 justify-center\"\r\n >\r\n @if (!rtl() && !first) {\r\n <span\r\n class=\"absolute top-5 left-0 right-1/2 h-0.5\"\r\n [ngClass]=\"\r\n step.beforeLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (!rtl() && !last) {\r\n <span\r\n class=\"absolute top-5 left-1/2 right-0 h-0.5\"\r\n [ngClass]=\"\r\n step.afterLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (rtl() && !last) {\r\n <span\r\n class=\"absolute top-5 left-0 right-1/2 h-0.5\"\r\n [ngClass]=\"\r\n step.afterLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (rtl() && !first) {\r\n <span\r\n class=\"absolute top-5 left-1/2 right-0 h-0.5\"\r\n [ngClass]=\"\r\n step.beforeLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n\r\n <button\r\n type=\"button\"\r\n class=\"relative z-10 flex w-full flex-col items-center gap-3 px-2 text-center focus-visible:outline-none\"\r\n [attr.aria-pressed]=\"step.selected\"\r\n [attr.aria-current]=\"\r\n step.state === 'current' ? 'step' : null\r\n \"\r\n [attr.title]=\"step.label\"\r\n (click)=\"onStepChange(step.value)\"\r\n >\r\n <span\r\n class=\"flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border text-sm font-semibold transition-all duration-200\"\r\n [ngClass]=\"{\r\n 'border-primary bg-primary text-surface-0 ring-4 ring-primary/10':\r\n step.state === 'completed' ||\r\n step.state === 'current',\r\n\r\n 'border-surface-300 bg-white text-surface-500':\r\n step.state === 'upcoming',\r\n }\"\r\n >\r\n {{ step.value }}\r\n </span>\r\n <span\r\n class=\"max-w-[8rem] text-center text-sm leading-5 transition-colors duration-200\"\r\n [ngClass]=\"{\r\n 'font-semibold text-primary':\r\n step.selected || step.state === 'current',\r\n 'font-medium text-surface-700':\r\n step.state === 'completed' && !step.selected,\r\n 'font-medium text-surface-500':\r\n step.state === 'upcoming',\r\n }\"\r\n dir=\"auto\"\r\n >\r\n {{ step.label }}\r\n </span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (showInternalStepActions()) {\n <div class=\"flex justify-between gap-2\">\n <mt-button\n label=\"Previous\"\n severity=\"secondary\"\n variant=\"outlined\"\n [disabled]=\"currentStep() === 1\"\n (onClick)=\"goToPreviousStep()\"\n />\n <mt-button\n label=\"Next\"\n severity=\"primary\"\n variant=\"outlined\"\n [disabled]=\"currentStep() === stepSections().length\"\n (onClick)=\"goToNextStep()\"\n />\n </div>\n }\n </div>\n }\r\n\r\n @if (tabsEnabled()) {\r\n <mt-tabs\r\n [active]=\"currentStep()\"\r\n (activeChange)=\"onStepChange($event)\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n fluid\r\n />\r\n }\r\n <mt-dynamic-form\r\n [formConfig]=\"config\"\r\n [formControl]=\"formControl\"\r\n [visibleSectionKeys]=\"visibleSectionKeys()\"\r\n [forcedHiddenFieldKeys]=\"effectiveForcedHiddenFieldKeys()\"\r\n [preserveForcedHiddenValues]=\"true\"\r\n (runtimeMessagesChange)=\"onRuntimeMessagesChange($event)\"\r\n />\r\n </div>\r\n }\r\n } @else if (previewEntitySections().length === 0) {\n <div\n class=\"flex items-center justify-center p-6 rounded-lg bg-surface-50 border border-surface-200 border-dashed\"\n >\n <p class=\"text-sm text-muted-color\">\r\n No form required for this operation.\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{display:block}\n"] }]
1212
1226
  }], ctorParameters: () => [], propDecorators: { moduleKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "moduleKey", required: true }] }], operationKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "operationKey", required: true }] }], moduleId: [{ type: i0.Input, args: [{ isSignal: true, alias: "moduleId", required: false }] }], levelId: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelId", required: false }] }], levelDataId: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelDataId", required: false }] }], moduleDataId: [{ type: i0.Input, args: [{ isSignal: true, alias: "moduleDataId", required: false }] }], requestSchemaId: [{ type: i0.Input, args: [{ isSignal: true, alias: "requestSchemaId", required: false }] }], draftProcessId: [{ type: i0.Input, args: [{ isSignal: true, alias: "draftProcessId", required: false }] }], preview: [{ type: i0.Input, args: [{ isSignal: true, alias: "preview", required: false }] }], returnUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "returnUrl", required: false }] }], submitRequestMapper: [{ type: i0.Input, args: [{ isSignal: true, alias: "submitRequestMapper", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], autoLoad: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoLoad", required: false }] }], formMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "formMode", required: false }] }], renderMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "renderMode", required: false }] }], showInternalStepActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "showInternalStepActions", required: false }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], ignoredFieldKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "ignoredFieldKeys", required: false }] }], loaded: [{ type: i0.Output, args: ["loaded"] }], submitted: [{ type: i0.Output, args: ["submitted"] }], errored: [{ type: i0.Output, args: ["errored"] }], modeDetected: [{ type: i0.Output, args: ["modeDetected"] }], formSourceDetected: [{ type: i0.Output, args: ["formSourceDetected"] }], footerStateChanged: [{ type: i0.Output, args: ["footerStateChanged"] }] } });
1213
1227
 
1214
1228
  // ============================================================================
@@ -1229,5 +1243,5 @@ function isFormRequiredInterception(response) {
1229
1243
  * Generated bundle index. Do not edit.
1230
1244
  */
1231
1245
 
1232
- export { ClientForm, ClientFormApiService, ClientFormStateService, getPreviewOnlyFieldKeys, isFormRequiredInterception, mapFormValueToSubmitFields, mapPreviewFieldsToEntities, mapToDynamicFormConfig, mapValuesToFormValue };
1246
+ export { ClientForm, ClientFormApiService, ClientFormStateService, getPreviewOnlyFieldKeys, isFormRequiredInterception, mapFormValueToSubmitFields, mapPreviewFieldsToEntities, mapPreviewSectionsToEntities, mapToDynamicFormConfig, mapValuesToFormValue };
1233
1247
  //# sourceMappingURL=masterteam-forms-client-form.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"masterteam-forms-client-form.mjs","sources":["../../../../packages/masterteam/forms/client-form/services/client-form-api.service.ts","../../../../packages/masterteam/forms/client-form/services/client-form-state.service.ts","../../../../packages/masterteam/forms/client-form/utils/form-config-mapper.ts","../../../../packages/masterteam/forms/client-form/client-form.ts","../../../../packages/masterteam/forms/client-form/client-form.html","../../../../packages/masterteam/forms/client-form/models/client-form.model.ts","../../../../packages/masterteam/forms/client-form/public-api.ts","../../../../packages/masterteam/forms/client-form/masterteam-forms-client-form.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport type {\r\n Response,\r\n ProcessFormLoadRequest,\r\n ProcessFormLoadResponse,\r\n ProcessFormSubmitRequest,\r\n ProcessFormSubmitResponse,\r\n} from '../models/client-form.model';\r\n\r\n/**\r\n * Stateless HTTP service for process-forms runtime APIs.\r\n * Root-provided — safe to share across multiple ClientForm instances.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class ClientFormApiService {\r\n private readonly http = inject(HttpClient);\r\n\r\n /**\r\n * Load form configuration and values for a given operation context.\r\n * Backend determines mode (Approval vs Direct) based on published schema.\r\n */\r\n load(\r\n request: ProcessFormLoadRequest,\r\n ): Observable<Response<ProcessFormLoadResponse>> {\r\n return this.http.post<Response<ProcessFormLoadResponse>>(\r\n 'process-form-load',\r\n request,\r\n );\r\n }\r\n\r\n /**\r\n * Submit form values. Result depends on mode:\r\n * - Approval → status: 'PendingApproval'\r\n * - Direct → status: 'Executed'\r\n */\r\n submit(\r\n request: ProcessFormSubmitRequest,\r\n ): Observable<Response<ProcessFormSubmitResponse>> {\r\n return this.http.post<Response<ProcessFormSubmitResponse>>(\r\n 'process-submit',\r\n request,\r\n );\r\n }\r\n}\r\n","import { Injectable, signal, computed } from '@angular/core';\r\n\r\nimport type {\r\n ProcessFormLoadResponse,\r\n ProcessFormSubmitResponse,\r\n ProcessFormValue,\r\n ProcessFormContext,\r\n ProcessFormMode,\r\n ProcessFormSource,\r\n ClientFormConfiguration,\r\n} from '../models/client-form.model';\r\n\r\n/**\r\n * Per-instance signal-based state for ClientForm.\r\n *\r\n * NOT providedIn root — each ClientForm component provides its own instance\r\n * via `providers: [ClientFormStateService]`, enabling multiple independent\r\n * forms on the same page.\r\n */\r\n@Injectable()\r\nexport class ClientFormStateService {\r\n // ============================================================================\r\n // Core State Signals\r\n // ============================================================================\r\n\r\n readonly loading = signal(false);\r\n readonly submitting = signal(false);\r\n readonly error = signal<string | null>(null);\r\n readonly submitError = signal<string | null>(null);\r\n readonly loadResponse = signal<ProcessFormLoadResponse | null>(null);\r\n readonly submitResponse = signal<ProcessFormSubmitResponse | null>(null);\r\n\r\n // ============================================================================\r\n // Derived Computeds — Load Response\r\n // ============================================================================\r\n\r\n readonly isLoaded = computed(() => !!this.loadResponse());\r\n\r\n readonly mode = computed<ProcessFormMode | null>(\r\n () => this.loadResponse()?.mode ?? null,\r\n );\r\n\r\n readonly isApproval = computed(() => this.mode() === 'Approval');\r\n readonly isDirect = computed(() => this.mode() === 'Direct');\r\n\r\n readonly formSource = computed<ProcessFormSource | null>(\r\n () => this.loadResponse()?.formSource ?? null,\r\n );\r\n\r\n readonly requiresForm = computed(\r\n () => this.loadResponse()?.requiresForm ?? false,\r\n );\r\n\r\n readonly formConfiguration = computed<ClientFormConfiguration | null>(\r\n () => this.loadResponse()?.formConfiguration ?? null,\r\n );\r\n\r\n readonly values = computed<ProcessFormValue[]>(\r\n () => this.loadResponse()?.values ?? [],\r\n );\r\n\r\n readonly context = computed<ProcessFormContext | null>(\r\n () => this.loadResponse()?.context ?? null,\r\n );\r\n\r\n readonly stepName = computed<string | null>(\r\n () => this.loadResponse()?.stepName ?? null,\r\n );\r\n\r\n readonly requestSchemaId = computed<number | null>(\r\n () => this.loadResponse()?.requestSchemaId ?? null,\r\n );\r\n\r\n readonly requestId = computed<number | null>(\r\n () => this.loadResponse()?.requestId ?? null,\r\n );\r\n\r\n readonly stepId = computed<number | null>(\r\n () => this.loadResponse()?.stepId ?? null,\r\n );\r\n\r\n readonly stepSchemaId = computed<number | null>(\r\n () => this.loadResponse()?.stepSchemaId ?? null,\r\n );\r\n\r\n // ============================================================================\r\n // Derived Computeds — Value Categories\r\n // ============================================================================\r\n\r\n /** Process virtual fields (Request_Date, Step_Name, etc.) — read-only display */\r\n readonly virtualFields = computed<ProcessFormValue[]>(() =>\r\n this.values().filter((v) => v.metadata?.source === 'ProcessVirtual'),\r\n );\r\n\r\n /** Editable form values (non-virtual) */\r\n readonly formValues = computed<ProcessFormValue[]>(() =>\r\n this.values().filter((v) => v.metadata?.source !== 'ProcessVirtual'),\r\n );\r\n\r\n // ============================================================================\r\n // Derived Computeds — Submit Response\r\n // ============================================================================\r\n\r\n readonly isSubmitted = computed(() => !!this.submitResponse());\r\n\r\n readonly submitStatus = computed(() => this.submitResponse()?.status ?? null);\r\n\r\n readonly isPendingApproval = computed(\r\n () => this.submitStatus() === 'PendingApproval',\r\n );\r\n\r\n readonly isExecuted = computed(() => this.submitStatus() === 'Executed');\r\n\r\n // ============================================================================\r\n // State Mutations\r\n // ============================================================================\r\n\r\n setLoadResponse(response: ProcessFormLoadResponse): void {\r\n this.loadResponse.set(response);\r\n this.error.set(null);\r\n }\r\n\r\n setSubmitResponse(response: ProcessFormSubmitResponse): void {\r\n this.submitResponse.set(response);\r\n this.submitError.set(null);\r\n }\r\n\r\n setError(message: string): void {\r\n this.error.set(message);\r\n this.loading.set(false);\r\n }\r\n\r\n setSubmitError(message: string): void {\r\n this.submitError.set(message);\r\n this.submitting.set(false);\r\n }\r\n\r\n reset(): void {\r\n this.loading.set(false);\r\n this.submitting.set(false);\r\n this.error.set(null);\r\n this.submitError.set(null);\r\n this.loadResponse.set(null);\r\n this.submitResponse.set(null);\r\n }\r\n}\r\n","import type {\r\n DynamicFormConfig,\r\n DynamicFieldConfig,\r\n FormulaValidationRuleConfig,\r\n} from '@masterteam/components';\r\nimport type { EntityData, EntitySize } from '@masterteam/components/entities';\r\nimport {\r\n REQUEST_CONTEXT,\r\n ValidatorConfig,\r\n TextFieldConfig,\r\n EditorFieldConfig,\r\n SelectFieldConfig,\r\n MultiSelectFieldConfig,\r\n DateFieldConfig,\r\n NumberFieldConfig,\r\n SliderFieldConfig,\r\n ToggleFieldConfig,\r\n UserSearchFieldConfig,\r\n UploadFileFieldConfig,\r\n LookupMatrixFieldConfig,\r\n SchemaConnectionFieldConfig,\r\n SchedulePredecessorFieldConfig,\r\n} from '@masterteam/components';\r\nimport { HttpContext } from '@angular/common/http';\r\n\r\nimport type {\r\n ClientFormConfiguration,\r\n ClientFormField,\r\n ClientPropertyItem,\r\n ClientLookup,\r\n ProcessFormValue,\r\n ProcessFormLoadResponse,\r\n ProcessFormSubmitField,\r\n ProcessFormContext,\r\n} from '../models/client-form.model';\r\n\r\n// ============================================================================\r\n// Constants\r\n// ============================================================================\r\n\r\nconst WIDTH_TO_COLSPAN: Record<string, number> = {\r\n '25': 3,\r\n '50': 6,\r\n '100': 12,\r\n};\r\n\r\nconst WIDTH_TO_ENTITY_SIZE: Record<string, EntitySize> = {\r\n '25': 6,\r\n '50': 12,\r\n '100': 24,\r\n};\r\n\r\n// ============================================================================\r\n// Public Mapper Functions\r\n// ============================================================================\r\n\r\n/**\r\n * Convert a runtime FormConfiguration into a DynamicFormConfig\r\n * that can be passed directly to `<mt-dynamic-form>`.\r\n *\r\n * @param config The form configuration from the load API\r\n * @param lang Current UI language ('en' | 'ar')\r\n * @param mode 'create' or 'edit' — filters hidden fields accordingly\r\n * @param lookups Available lookup definitions for resolving Lookup/LookupMultiSelect options\r\n */\r\nexport function mapToDynamicFormConfig(\r\n config: ClientFormConfiguration,\r\n lang: 'en' | 'ar' = 'en',\r\n mode: 'create' | 'edit' = 'create',\r\n lookups: ClientLookup[] = [],\r\n context: ProcessFormContext | null = null,\r\n): DynamicFormConfig {\r\n const validationRules = mapValidationRules(config, lang);\r\n\r\n return {\r\n sections: config.sections\r\n .slice()\r\n .sort((a, b) => a.order - b.order)\r\n .map((section) => {\r\n const sectionName = section.name[lang] ?? section.name['en'] ?? '';\r\n\r\n const visibleFields = section.fields\r\n .filter((field) => {\r\n // isRead=false → completely hidden\r\n if (field.isWrite !== true && field.isRead === false) return false;\r\n if (mode === 'create') return !field.hiddenInCreation;\r\n return !field.hiddenInEditForm;\r\n })\r\n .sort((a, b) => a.order - b.order);\r\n\r\n return {\r\n key: section.id,\r\n label: sectionName,\r\n type: 'header' as const,\r\n columns: 12,\r\n order: section.order,\r\n fields: visibleFields.map((field) =>\r\n mapFieldToConfig(field, lang, lookups, context),\r\n ),\r\n };\r\n })\r\n .filter((section) => section.fields.length > 0),\r\n validationRules,\r\n };\r\n}\r\n\r\n/**\r\n * Convert API property values into a flat key-value object\r\n * suitable for `formControl.patchValue()`.\r\n *\r\n * Only includes non-virtual (editable) values.\r\n */\r\nexport function mapValuesToFormValue(\r\n values: ProcessFormValue[],\r\n config?: ClientFormConfiguration | null,\r\n): Record<string, any> {\r\n const result: Record<string, any> = {};\r\n const fieldMap = config ? buildFieldValueMap(config) : null;\r\n\r\n for (const v of values) {\r\n if (v.metadata?.source === 'ProcessVirtual') continue;\r\n\r\n const targetFieldKey =\r\n resolveValueTargetKey(v, fieldMap) ?? v.propertyKey ?? null;\r\n if (!targetFieldKey) continue;\r\n\r\n result[targetFieldKey] = resolveLoadedFieldValue(v);\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Convert the current form value back into the submit payload format.\r\n *\r\n * Uses form configuration metadata (same source used to render fields)\r\n * to map `requestPropertyId` and `viewType`.\r\n */\r\nexport function mapFormValueToSubmitFields(\r\n formValue: Record<string, any>,\r\n loadResponse: ProcessFormLoadResponse,\r\n): ProcessFormSubmitField[] {\r\n const metadataByKey = new Map<\r\n string,\r\n { propertyId?: number; viewType?: string }\r\n >();\r\n\r\n for (const section of loadResponse.formConfiguration?.sections ?? []) {\r\n for (const field of section.fields ?? []) {\r\n const { propertyId, viewType } = resolveFieldMeta(field);\r\n metadataByKey.set(field.propertyKey, {\r\n propertyId,\r\n viewType,\r\n });\r\n }\r\n }\r\n\r\n return Object.entries(formValue)\r\n .filter(([propertyKey, value]) => {\r\n if (value === undefined || value === null) return false;\r\n return metadataByKey.get(propertyKey)?.viewType !== 'LookupMatrix';\r\n })\r\n .map(([propertyKey, value]) => {\r\n const meta = metadataByKey.get(propertyKey);\r\n const normalizedValue = normalizeSubmitValue(value, meta?.viewType);\r\n if (normalizedValue === undefined || normalizedValue === null) {\r\n return null;\r\n }\r\n\r\n const submitField: ProcessFormSubmitField = {\r\n propertyKey,\r\n value: normalizedValue,\r\n };\r\n\r\n if (meta?.propertyId) {\r\n submitField.requestPropertyId = meta.propertyId;\r\n }\r\n\r\n return submitField;\r\n })\r\n .filter((value): value is ProcessFormSubmitField => !!value);\r\n}\r\n\r\nexport function getPreviewOnlyFieldKeys(\r\n config: ClientFormConfiguration,\r\n mode: 'create' | 'edit' = 'create',\r\n): string[] {\r\n return config.sections.flatMap((section) =>\r\n (section.fields ?? [])\r\n .filter(\r\n (field) => isFieldVisible(field, mode) && isPreviewOnlyField(field),\r\n )\r\n .map((field) => field.propertyKey),\r\n );\r\n}\r\n\r\nexport function mapPreviewFieldsToEntities(\r\n config: ClientFormConfiguration,\r\n values: ProcessFormValue[],\r\n mode: 'create' | 'edit' = 'create',\r\n): EntityData[] {\r\n const resolvedValues = mapValuesToFormValue(values, config);\r\n\r\n return config.sections\r\n .slice()\r\n .sort((a, b) => a.order - b.order)\r\n .flatMap((section) =>\r\n (section.fields ?? [])\r\n .filter(\r\n (field) => isFieldVisible(field, mode) && isPreviewOnlyField(field),\r\n )\r\n .sort((a, b) => a.order - b.order)\r\n .flatMap((field) => {\r\n const property = field.propertyMetadata;\r\n\r\n return [\r\n {\r\n ...(property as EntityData),\r\n name: (property.name as any)?.display,\r\n key: property.key ?? field.propertyKey,\r\n value: resolvedValues[field.propertyKey],\r\n order: section.order * 1000 + field.order,\r\n configuration: {\r\n ...(property.configuration as Record<string, unknown>),\r\n size: WIDTH_TO_ENTITY_SIZE[field.width] ?? 24,\r\n },\r\n } satisfies EntityData,\r\n ];\r\n }),\r\n );\r\n}\r\n\r\n// ============================================================================\r\n// Internal Helpers\r\n// ============================================================================\r\n\r\nfunction isFieldVisible(\r\n field: ClientFormField,\r\n mode: 'create' | 'edit',\r\n): boolean {\r\n if (field.isWrite !== true && field.isRead === false) return false;\r\n if (mode === 'create') return !field.hiddenInCreation;\r\n return !field.hiddenInEditForm;\r\n}\r\n\r\nfunction isPreviewOnlyField(field: ClientFormField): boolean {\r\n return field.isWrite === false && field.isRead !== false;\r\n}\r\n\r\nfunction isCalculatedField(field: ClientFormField): boolean {\r\n return field.propertyMetadata?.isCalculated === true;\r\n}\r\n\r\nfunction resolveFieldMeta(field: ClientFormField): {\r\n property: ClientPropertyItem;\r\n propertyId?: number;\r\n viewType: string;\r\n} {\r\n const property = field.propertyMetadata;\r\n return {\r\n property,\r\n propertyId: property?.propertyId,\r\n viewType: property?.viewType ?? 'Text',\r\n };\r\n}\r\n\r\nfunction mapFieldToConfig(\r\n field: ClientFormField,\r\n lang: 'en' | 'ar',\r\n lookups: ClientLookup[],\r\n context: ProcessFormContext | null,\r\n): DynamicFieldConfig {\r\n const { property: prop, viewType } = resolveFieldMeta(field);\r\n const label =\r\n (prop?.name as { display?: string } | undefined)?.display ??\r\n field.propertyKey;\r\n const colSpan = WIDTH_TO_COLSPAN[field.width] ?? 12;\r\n\r\n const base = {\r\n key: field.propertyKey,\r\n label,\r\n colSpan,\r\n order: field.order,\r\n placeholder: label,\r\n required: field.isRequired ?? false,\r\n disabled: isCalculatedField(field),\r\n readonly: field.isWrite === false,\r\n validators: field.isRequired\r\n ? [ValidatorConfig.required(`${label} is required`)]\r\n : [],\r\n formulaCondition: buildFormulaCondition(field),\r\n };\r\n\r\n switch (viewType) {\r\n // ── Text-like ──────────────────────────────────────────────\r\n case 'Text':\r\n case 'EditableListView':\r\n case 'LookupLog':\r\n return new TextFieldConfig(base);\r\n\r\n case 'LongText':\r\n return new EditorFieldConfig(base);\r\n\r\n // ── Numeric ───────────────────────────────────────────────\r\n case 'Number':\r\n return new NumberFieldConfig(base);\r\n\r\n case 'Currency':\r\n return new NumberFieldConfig({\r\n ...base,\r\n useGrouping: true,\r\n });\r\n\r\n case 'Percentage':\r\n return new SliderFieldConfig({\r\n ...base,\r\n min: 0,\r\n max: 100,\r\n unit: '%',\r\n });\r\n\r\n // ── Date / Time ───────────────────────────────────────────\r\n case 'Date':\r\n return new DateFieldConfig({ ...base, showTime: false });\r\n\r\n case 'DateTime':\r\n return new DateFieldConfig({ ...base, showTime: true });\r\n\r\n case 'Time':\r\n return new DateFieldConfig({ ...base, showTime: true });\r\n\r\n // ── Boolean ───────────────────────────────────────────────\r\n case 'Checkbox':\r\n return new ToggleFieldConfig(base);\r\n\r\n // ── File ──────────────────────────────────────────────────\r\n case 'Attachment':\r\n return new UploadFileFieldConfig(base);\r\n\r\n // ── User Search ───────────────────────────────────────────\r\n case 'User':\r\n return new UserSearchFieldConfig({\r\n ...base,\r\n apiUrl: 'Identity/users',\r\n context: new HttpContext().set(REQUEST_CONTEXT, {\r\n useBaseUrl: false,\r\n }),\r\n });\r\n\r\n // ── Lookup (single select) ────────────────────────────────\r\n case 'Lookup': {\r\n const items = resolveLookupOptions(prop, lookups);\r\n return new SelectFieldConfig({\r\n ...base,\r\n options: items,\r\n optionLabel: 'label',\r\n optionValue: 'value',\r\n filter: items.length > 10,\r\n showClear: !(field.isRequired ?? false),\r\n });\r\n }\r\n\r\n // ── Lookup (multi select) ─────────────────────────────────\r\n case 'LookupMultiSelect': {\r\n const items = resolveLookupOptions(prop, lookups);\r\n return new MultiSelectFieldConfig({\r\n ...base,\r\n options: items,\r\n optionLabel: 'label',\r\n optionValue: 'value',\r\n filter: items.length > 10,\r\n display: 'chip',\r\n });\r\n }\r\n\r\n // ── Other select-based types ──────────────────────────────\r\n case 'Status':\r\n case 'InternalModule':\r\n case 'DynamicList':\r\n case 'API':\r\n case 'Location': {\r\n const options = extractOptionsFromProperty(prop);\r\n return new SelectFieldConfig({\r\n ...base,\r\n options: options ?? [],\r\n optionLabel: 'label',\r\n optionValue: 'value',\r\n });\r\n }\r\n\r\n case 'LookupMatrix':\r\n return buildLookupMatrixFieldConfig(base, prop, lookups);\r\n\r\n // ── Connection (level-to-level) ─────────────────────────\r\n case 'Connection': {\r\n const connectionConfig = prop?.configuration ?? {};\r\n return new SchemaConnectionFieldConfig({\r\n ...base,\r\n configuration: connectionConfig,\r\n });\r\n }\r\n case 'Predecessor':\r\n return new SchedulePredecessorFieldConfig({\r\n ...base,\r\n configuration: prop?.configuration ?? null,\r\n runtimeContext: context\r\n ? {\r\n levelId: context.levelId,\r\n levelDataId: context.levelDataId,\r\n moduleDataId: context.moduleDataId,\r\n }\r\n : null,\r\n });\r\n\r\n // ── Fallback ──────────────────────────────────────────────\r\n default:\r\n return new TextFieldConfig(base);\r\n }\r\n}\r\n\r\nfunction buildFormulaCondition(\r\n field: ClientFormField,\r\n): { formulaTokens: string; formulaText?: string; mode?: 'auto' } | undefined {\r\n if (!field.showConditionalDisplayFormula) return undefined;\r\n const formulaTokens = (field.conditionalDisplayFormula ?? '').trim();\r\n if (!formulaTokens) return undefined;\r\n\r\n return {\r\n formulaTokens,\r\n formulaText: field.conditionalDisplayFormula ?? '',\r\n mode: 'auto',\r\n };\r\n}\r\n\r\nfunction mapValidationRules(\r\n config: ClientFormConfiguration,\r\n lang: 'en' | 'ar',\r\n): FormulaValidationRuleConfig[] {\r\n return (config.validations ?? []).map((rule) => ({\r\n id: rule.id,\r\n formulaTokens: rule.formulaTokens,\r\n formulaText: rule.formulaText,\r\n message:\r\n rule.message?.[lang] ??\r\n rule.message?.en ??\r\n rule.message?.ar ??\r\n 'Validation rule failed',\r\n severity: rule.severity,\r\n enabled: rule.enabled,\r\n }));\r\n}\r\n\r\n/**\r\n * Resolve lookup items for Lookup / LookupMultiSelect viewTypes.\r\n *\r\n * Reads `configuration.lookup` (the lookup ID) from the property metadata,\r\n * finds the matching lookup definition, and maps its items to select options.\r\n */\r\nfunction resolveLookupOptions(\r\n prop: ClientPropertyItem | undefined,\r\n lookups: ClientLookup[],\r\n): ResolvedLookupOption[] {\r\n return resolveLookupOptionsById(\r\n coerceLookupId(prop?.configuration?.['lookup']),\r\n lookups,\r\n );\r\n}\r\n\r\n/**\r\n * Fallback option extractor for non-lookup select types\r\n * (Status, InternalModule, DynamicList, API, etc.).\r\n */\r\nfunction extractOptionsFromProperty(\r\n property: ClientPropertyItem | undefined,\r\n): { label: string; value: any }[] | null {\r\n if (!property?.configuration) return null;\r\n\r\n const config = property.configuration;\r\n\r\n if (Array.isArray(config['options'])) {\r\n return config['options'] as { label: string; value: any }[];\r\n }\r\n\r\n if (Array.isArray(config['items'])) {\r\n return (config['items'] as any[]).map((item) => ({\r\n label:\r\n typeof item.name === 'string'\r\n ? item.name\r\n : (item.name?.['en'] ?? item.label ?? String(item.value)),\r\n value: item.id ?? item.value ?? item.key,\r\n }));\r\n }\r\n\r\n return null;\r\n}\r\n\r\ntype ResolvedLookupOption = {\r\n id?: number | string;\r\n key?: string;\r\n label: string;\r\n value: any;\r\n color?: string | null;\r\n description?: string;\r\n};\r\n\r\nfunction resolveLookupOptionsById(\r\n lookupId: number | null,\r\n lookups: ClientLookup[],\r\n): ResolvedLookupOption[] {\r\n if (!lookupId || !lookups.length) return [];\r\n\r\n const lookup = lookups.find((item) => item.id === lookupId);\r\n if (!lookup) return [];\r\n\r\n return lookup.items\r\n .slice()\r\n .sort((a, b) => a.order - b.order)\r\n .map((item) => ({\r\n id: item.id,\r\n key: item.key,\r\n label: item.name?.display ?? item.name?.en ?? item.key,\r\n value: item.key,\r\n color: item.color ?? null,\r\n description:\r\n item.description?.display ?? item.description?.en ?? undefined,\r\n }));\r\n}\r\n\r\nfunction resolveLookupNameById(\r\n lookupId: number | null,\r\n lookups: ClientLookup[],\r\n): string {\r\n if (!lookupId) return '';\r\n\r\n const lookup = lookups.find((item) => item.id === lookupId);\r\n return lookup?.name?.display ?? lookup?.name?.en ?? lookup?.key ?? '';\r\n}\r\n\r\nfunction buildLookupMatrixFieldConfig(\r\n base: {\r\n key: string;\r\n label: string;\r\n colSpan: number;\r\n order: number;\r\n placeholder: string;\r\n required: boolean;\r\n disabled: boolean;\r\n readonly: boolean;\r\n validators: ValidatorConfig[];\r\n formulaCondition:\r\n | { formulaTokens: string; formulaText?: string; mode?: 'auto' }\r\n | undefined;\r\n },\r\n prop: ClientPropertyItem | undefined,\r\n lookups: ClientLookup[],\r\n): LookupMatrixFieldConfig {\r\n const configuration = (prop?.configuration ?? {}) as Record<string, unknown>;\r\n const xLookupId = coerceLookupId(configuration['xlookupSource']);\r\n const yLookupId = coerceLookupId(configuration['ylookupSource']);\r\n const zLookupId = coerceLookupId(configuration['zlookupId']);\r\n\r\n const xOptions = resolveLookupOptionsById(xLookupId, lookups);\r\n const yOptions = resolveLookupOptionsById(yLookupId, lookups);\r\n const zOptions = resolveLookupOptionsById(zLookupId, lookups);\r\n const zOptionsById = new Map(\r\n zOptions\r\n .filter((item) => item.id != null)\r\n .map((item) => [String(item.id), item] as const),\r\n );\r\n\r\n const rawCells = Array.isArray(configuration['lookupsMatrix'])\r\n ? (configuration['lookupsMatrix'] as Array<Record<string, unknown>>)\r\n : [];\r\n\r\n return new LookupMatrixFieldConfig({\r\n ...base,\r\n required: false,\r\n xFieldKey: String(configuration['xPropertyLookupKey'] ?? ''),\r\n yFieldKey: String(configuration['yPropertyLookupKey'] ?? ''),\r\n xAxisLabel: resolveLookupNameById(xLookupId, lookups),\r\n yAxisLabel: resolveLookupNameById(yLookupId, lookups),\r\n xOptions,\r\n yOptions,\r\n cells: rawCells.map((cell) => {\r\n const zOption = zOptionsById.get(String(cell['value'] ?? ''));\r\n\r\n return {\r\n row: Number(cell['row'] ?? 0),\r\n column: Number(cell['column'] ?? 0),\r\n xLookupItemId: String(cell['xValue'] ?? ''),\r\n yLookupItemId: String(cell['yValue'] ?? ''),\r\n zLookupItemId: cell['value'] == null ? null : String(cell['value']),\r\n label: zOption?.label ?? String(cell['value'] ?? ''),\r\n color: zOption?.color ?? null,\r\n };\r\n }),\r\n });\r\n}\r\n\r\nfunction coerceLookupId(value: unknown): number | null {\r\n if (typeof value === 'number' && Number.isFinite(value)) {\r\n return value;\r\n }\r\n\r\n if (typeof value === 'string' && value.trim() !== '') {\r\n const parsed = Number(value);\r\n return Number.isFinite(parsed) ? parsed : null;\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction normalizeSubmitValue(value: any, viewType?: string): any {\r\n switch (viewType) {\r\n case 'User':\r\n if (value && typeof value === 'object' && !Array.isArray(value)) {\r\n return value['id'] ?? value;\r\n }\r\n return value;\r\n\r\n default:\r\n return value;\r\n }\r\n}\r\n\r\nfunction resolveLoadedFieldValue(value: ProcessFormValue): any {\r\n const resolvedValue =\r\n value.metadata?.viewType === 'User'\r\n ? value.value\r\n : (value.rawValue ?? value.value);\r\n\r\n switch (value.metadata?.viewType) {\r\n case 'Date':\r\n case 'DateTime':\r\n case 'Time':\r\n return coerceToDate(resolvedValue);\r\n\r\n default:\r\n return resolvedValue;\r\n }\r\n}\r\n\r\nfunction coerceToDate(value: any): any {\r\n if (value === null || value === undefined || value === '') {\r\n return value;\r\n }\r\n\r\n if (value instanceof Date) {\r\n return value;\r\n }\r\n\r\n const coerced = new Date(value);\r\n return Number.isNaN(coerced.getTime()) ? value : coerced;\r\n}\r\n\r\ntype FieldValueMeta = {\r\n key: string;\r\n propertyId?: number;\r\n};\r\n\r\ntype FieldValueMap = {\r\n fieldsByKey: Map<string, FieldValueMeta>;\r\n propertyIdToKey: Map<number, string>;\r\n aliasToKey: Map<string, string>;\r\n};\r\n\r\nfunction buildFieldValueMap(config: ClientFormConfiguration): FieldValueMap {\r\n const fieldsByKey = new Map<string, FieldValueMeta>();\r\n const propertyIdCandidates = new Map<number, Set<string>>();\r\n const aliasCandidates = new Map<string, Set<string>>();\r\n\r\n for (const section of config.sections ?? []) {\r\n for (const field of section.fields ?? []) {\r\n const { propertyId } = resolveFieldMeta(field);\r\n const fieldMeta: FieldValueMeta = {\r\n key: field.propertyKey,\r\n propertyId,\r\n };\r\n\r\n fieldsByKey.set(field.propertyKey, fieldMeta);\r\n\r\n if (propertyId != null) {\r\n if (!propertyIdCandidates.has(propertyId)) {\r\n propertyIdCandidates.set(propertyId, new Set<string>());\r\n }\r\n propertyIdCandidates.get(propertyId)!.add(field.propertyKey);\r\n }\r\n\r\n const aliases = new Set<string>([\r\n field.propertyKey,\r\n stripTemplatePrefix(field.propertyKey),\r\n ]);\r\n\r\n const property = field.propertyMetadata;\r\n if (property?.key) {\r\n aliases.add(property.key);\r\n aliases.add(stripTemplatePrefix(property.key));\r\n }\r\n\r\n aliases.forEach((alias) => {\r\n if (!alias) return;\r\n if (!aliasCandidates.has(alias)) {\r\n aliasCandidates.set(alias, new Set<string>());\r\n }\r\n aliasCandidates.get(alias)!.add(field.propertyKey);\r\n });\r\n }\r\n }\r\n\r\n const propertyIdToKey = new Map<number, string>();\r\n propertyIdCandidates.forEach((keys, propertyId) => {\r\n if (keys.size !== 1) return;\r\n propertyIdToKey.set(propertyId, [...keys][0]);\r\n });\r\n\r\n const aliasToKey = new Map<string, string>();\r\n aliasCandidates.forEach((keys, alias) => {\r\n if (keys.size !== 1) return;\r\n aliasToKey.set(alias, [...keys][0]);\r\n });\r\n\r\n return {\r\n fieldsByKey,\r\n propertyIdToKey,\r\n aliasToKey,\r\n };\r\n}\r\n\r\nfunction resolveValueTargetKey(\r\n value: ProcessFormValue,\r\n fieldMap: FieldValueMap | null,\r\n): string | null {\r\n if (!fieldMap) {\r\n return value.propertyKey ?? null;\r\n }\r\n\r\n const exactCandidates = [value.propertyKey, value.metadata?.key].filter(\r\n (candidate): candidate is string => !!candidate,\r\n );\r\n\r\n for (const candidate of exactCandidates) {\r\n if (fieldMap.fieldsByKey.has(candidate)) {\r\n return candidate;\r\n }\r\n }\r\n\r\n const propertyId = value.metadata?.propertyId;\r\n if (propertyId != null && fieldMap.propertyIdToKey.has(propertyId)) {\r\n return fieldMap.propertyIdToKey.get(propertyId)!;\r\n }\r\n\r\n const aliasCandidates = exactCandidates.flatMap((candidate) => [\r\n candidate,\r\n stripTemplatePrefix(candidate),\r\n ]);\r\n\r\n for (const candidate of aliasCandidates) {\r\n if (!candidate) continue;\r\n if (fieldMap.aliasToKey.has(candidate)) {\r\n return fieldMap.aliasToKey.get(candidate)!;\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction stripTemplatePrefix(value: string): string {\r\n return value.replace(/^template_\\d+_/, '');\r\n}\r\n","import {\r\n Component,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n untracked,\r\n OnDestroy,\r\n} from '@angular/core';\r\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\r\nimport { CommonModule } from '@angular/common';\r\nimport { Subscription } from 'rxjs';\r\nimport { Skeleton } from 'primeng/skeleton';\r\n\r\nimport { EntitiesPreview } from '@masterteam/components/entities';\r\nimport { Tabs, type OptionItem } from '@masterteam/components/tabs';\r\nimport { DynamicForm } from '@masterteam/forms/dynamic-form';\r\nimport type {\r\n DynamicFormConfig,\r\n FormulaRuntimeMessage,\r\n} from '@masterteam/components';\r\n\r\nimport { ClientFormApiService } from './services/client-form-api.service';\r\nimport { ClientFormStateService } from './services/client-form-state.service';\r\nimport {\r\n getPreviewOnlyFieldKeys,\r\n mapPreviewFieldsToEntities,\r\n mapToDynamicFormConfig,\r\n mapValuesToFormValue,\r\n mapFormValueToSubmitFields,\r\n} from './utils/form-config-mapper';\r\n\r\nimport type {\r\n ClientFormFooterState,\r\n ClientFormResolvedRenderMode,\r\n ProcessFormLoadRequest,\r\n ProcessFormLoadResponse,\r\n ProcessFormSubmitRequest,\r\n ProcessFormSubmitResponse,\r\n ProcessFormSubmitField,\r\n ProcessFormMode,\r\n ProcessFormSource,\r\n ProcessFormValue,\r\n ClientLookup,\r\n ClientFormSubmitRequestMapper,\r\n} from './models/client-form.model';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\n\r\ntype StepTimelineState = 'completed' | 'current' | 'upcoming';\r\n\r\ninterface StepTimelineItem {\r\n key: string;\r\n label: string;\r\n value: number;\r\n state: StepTimelineState;\r\n selected: boolean;\r\n beforeLineActive: boolean;\r\n afterLineActive: boolean;\r\n}\r\n\r\n/**\r\n * Client Form — Runtime process form component.\r\n *\r\n * Self-contained, signal-based (no NGXS). Each instance manages its own state\r\n * via a component-scoped `ClientFormStateService`.\r\n *\r\n * Submit and reset actions stay external. Step navigation buttons are optional\r\n * and can be hidden with `showInternalStepActions`.\r\n *\r\n * Parent can control actions via `viewChild()`:\r\n *\r\n * ```html\r\n * <mt-client-form #processForm [moduleKey]=\"'Risk'\" [operationKey]=\"'CloseRisk'\" />\r\n * <button (click)=\"processForm.load()\">Load</button>\r\n * <button (click)=\"processForm.submit()\">Submit</button>\r\n * ```\r\n *\r\n * Or programmatically:\r\n * ```typescript\r\n * readonly processForm = viewChild.required(ClientForm);\r\n * this.processForm().load();\r\n * this.processForm().submit();\r\n * ```\r\n */\r\n@Component({\r\n selector: 'mt-client-form',\r\n standalone: true,\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n EntitiesPreview,\r\n DynamicForm,\r\n Tabs,\r\n Skeleton,\r\n ],\r\n providers: [ClientFormStateService],\r\n templateUrl: './client-form.html',\r\n styleUrls: ['./client-form.scss'],\r\n})\r\nexport class ClientForm implements OnDestroy {\r\n private readonly api = inject(ClientFormApiService);\r\n protected readonly state = inject(ClientFormStateService);\r\n\r\n private loadSub?: Subscription;\r\n private submitSub?: Subscription;\r\n private readonly hasStartedLoad = signal(false);\r\n readonly runtimeMessages = signal<FormulaRuntimeMessage[]>([]);\r\n private readonly translocoService = inject(TranslocoService);\r\n\r\n // ============================================================================\r\n // Public State Signals (for parent access via viewChild)\r\n // ============================================================================\r\n\r\n readonly submitting = computed(() => this.state.submitting());\r\n readonly submitError = computed(() => this.state.submitError());\r\n readonly isSubmitted = computed(() => this.state.isSubmitted());\r\n readonly isPendingApproval = computed(() => this.state.isPendingApproval());\r\n readonly isExecuted = computed(() => this.state.isExecuted());\r\n readonly isLoaded = computed(() => this.state.isLoaded());\r\n readonly loading = computed(() => this.state.loading());\r\n readonly runtimeErrors = computed(() =>\r\n this.runtimeMessages().filter((msg) => msg.severity === 'error'),\r\n );\r\n readonly runtimeWarnings = computed(() =>\r\n this.runtimeMessages().filter((msg) => msg.severity === 'warning'),\r\n );\r\n readonly currentStep = signal(1);\r\n\r\n // ============================================================================\r\n // Inputs — Required Context\r\n // ============================================================================\r\n\r\n readonly moduleKey = input.required<string>();\r\n readonly operationKey = input.required<string>();\r\n\r\n // ============================================================================\r\n // Inputs — Optional Context\r\n // ============================================================================\r\n\r\n readonly moduleId = input<number | string>();\r\n readonly levelId = input<number | string>();\r\n readonly levelDataId = input<number | string>();\r\n readonly moduleDataId = input<number | string>();\r\n readonly requestSchemaId = input<number>();\r\n readonly draftProcessId = input<number>();\r\n readonly preview = input(false);\r\n readonly returnUrl = input<string>();\r\n readonly submitRequestMapper = input<ClientFormSubmitRequestMapper | null>(\r\n null,\r\n );\r\n\r\n // ============================================================================\r\n // Inputs — UI Configuration\r\n // ============================================================================\r\n\r\n readonly readonly = input(false);\r\n readonly autoLoad = input(true);\r\n readonly formMode = input<'create' | 'edit'>('create');\r\n readonly renderMode = input<'form' | 'steps' | 'tabs' | undefined>();\r\n // Hide the built-in previous/next buttons when step actions are rendered by the parent.\r\n readonly showInternalStepActions = input<boolean>(true);\r\n readonly lang = signal(this.translocoService.getActiveLang() as 'en' | 'ar');\r\n readonly lookups = input<ClientLookup[]>([]);\r\n readonly ignoredFieldKeys = input<string[]>([]);\r\n readonly rtl = computed(() => this.lang() === 'ar');\r\n\r\n // ============================================================================\r\n // Outputs\r\n // ============================================================================\r\n\r\n readonly loaded = output<ProcessFormLoadResponse>();\r\n readonly submitted = output<ProcessFormSubmitResponse>();\r\n readonly errored = output<string>();\r\n readonly modeDetected = output<ProcessFormMode>();\r\n readonly formSourceDetected = output<ProcessFormSource>();\r\n readonly footerStateChanged = output<ClientFormFooterState>();\r\n\r\n // ============================================================================\r\n // Internal Form Control\r\n // ============================================================================\r\n\r\n readonly formControl = new FormControl<Record<string, any>>({});\r\n\r\n // ============================================================================\r\n // Computed — Dynamic Form Config\r\n // ============================================================================\r\n\r\n readonly formConfig = computed<DynamicFormConfig | null>(() => {\r\n const config = this.state.formConfiguration();\r\n if (!config) return null;\r\n return mapToDynamicFormConfig(\r\n config,\r\n this.lang(),\r\n this.formMode(),\r\n this.lookups(),\r\n this.state.context(),\r\n );\r\n });\r\n\r\n readonly initialValues = computed<Record<string, any>>(() => {\r\n return mapValuesToFormValue(\r\n this.state.formValues(),\r\n this.state.formConfiguration(),\r\n );\r\n });\r\n\r\n readonly virtualFields = computed<ProcessFormValue[]>(() =>\r\n this.state.virtualFields(),\r\n );\r\n\r\n readonly hasVirtualFields = computed(() => this.virtualFields().length > 0);\r\n readonly previewFieldKeys = computed(() => {\r\n const config = this.state.formConfiguration();\r\n if (!config) return [];\r\n return [\r\n ...new Set([\r\n ...getPreviewOnlyFieldKeys(config, this.formMode()),\r\n ...this.ignoredFieldKeys(),\r\n ]),\r\n ];\r\n });\r\n readonly previewEntities = computed(() => {\r\n const config = this.state.formConfiguration();\r\n if (!config) return [];\r\n const ignoredFieldKeys = new Set(this.ignoredFieldKeys());\r\n return mapPreviewFieldsToEntities(\r\n config,\r\n this.state.formValues(),\r\n this.formMode(),\r\n ).filter((entity) => !entity.key || !ignoredFieldKeys.has(entity.key));\r\n });\r\n readonly editableFormConfig = computed<DynamicFormConfig | null>(() => {\r\n const config = this.formConfig();\r\n if (!config) return null;\r\n\r\n const previewFieldKeys = new Set(this.previewFieldKeys());\r\n\r\n return {\r\n ...config,\r\n sections: config.sections\r\n .map((section) => ({\r\n ...section,\r\n fields: section.fields.filter(\r\n (field) => !field.key || !previewFieldKeys.has(field.key),\r\n ),\r\n }))\r\n .filter((section) =>\r\n section.fields.some((field) => field.type !== 'spacer'),\r\n ),\r\n };\r\n });\r\n readonly stepSections = computed(\r\n () => this.editableFormConfig()?.sections ?? [],\r\n );\r\n readonly hasEditableFormSections = computed(\r\n () => this.stepSections().length > 0,\r\n );\r\n readonly effectiveRenderMode = computed<'form' | 'steps' | 'tabs'>(() => {\r\n const explicitRenderMode = this.renderMode();\r\n if (explicitRenderMode) return explicitRenderMode;\r\n\r\n const configRenderMode = this.state.formConfiguration()?.renderMode;\r\n if (configRenderMode === 'steps' || configRenderMode === 'tabs') {\r\n return configRenderMode;\r\n }\r\n\r\n return 'form';\r\n });\r\n readonly stepsEnabled = computed(\r\n () =>\r\n this.effectiveRenderMode() === 'steps' && this.stepSections().length > 1,\r\n );\r\n readonly tabsEnabled = computed(\r\n () =>\r\n this.effectiveRenderMode() === 'tabs' && this.stepSections().length > 1,\r\n );\r\n readonly sectionNavigationEnabled = computed(\r\n () => this.stepsEnabled() || this.tabsEnabled(),\r\n );\r\n readonly tabOptions = computed<OptionItem[]>(() =>\r\n this.stepSections().map((section, index) => ({\r\n label: section.label || `Tab ${index + 1}`,\r\n value: index + 1,\r\n })),\r\n );\r\n readonly stepTimeline = computed<StepTimelineItem[]>(() => {\r\n const sections = this.stepSections();\r\n const currentStep = this.currentStep();\r\n\r\n return sections.map((section, index) => {\r\n const value = index + 1;\r\n const state = this.resolveStepTimelineState(value, currentStep);\r\n\r\n return {\r\n key: section.key || `section-${index}`,\r\n label: section.label || `Step ${value}`,\r\n value,\r\n state,\r\n selected: value === currentStep,\r\n beforeLineActive: index > 0 && value <= currentStep,\r\n afterLineActive: index < sections.length - 1 && value < currentStep,\r\n };\r\n });\r\n });\r\n readonly visibleSectionKeys = computed(() => {\r\n if (!this.sectionNavigationEnabled()) return null;\r\n\r\n const currentIndex = this.currentStep() - 1;\r\n const activeSection = this.stepSections()[currentIndex];\r\n\r\n if (!activeSection) return null;\r\n\r\n return [activeSection.key || `section-${currentIndex}`];\r\n });\r\n readonly forcedHiddenFieldKeys = computed(() => {\r\n if (!this.sectionNavigationEnabled()) return [];\r\n\r\n const sections = this.stepSections();\r\n const currentIndex = this.currentStep() - 1;\r\n const hiddenFieldKeys = new Set<string>();\r\n\r\n sections.forEach((section, index) => {\r\n if (index === currentIndex) return;\r\n section.fields\r\n .map((field) => field.key)\r\n .filter((key): key is string => !!key)\r\n .forEach((key) => hiddenFieldKeys.add(key));\r\n });\r\n\r\n return [...hiddenFieldKeys];\r\n });\r\n readonly effectiveForcedHiddenFieldKeys = computed(() => {\r\n return [\r\n ...new Set([...this.forcedHiddenFieldKeys(), ...this.ignoredFieldKeys()]),\r\n ];\r\n });\r\n readonly footerLoading = computed(() => {\r\n return (\r\n this.state.loading() ||\r\n (this.autoLoad() &&\r\n !this.hasStartedLoad() &&\r\n !this.state.isLoaded() &&\r\n !this.state.error())\r\n );\r\n });\r\n readonly footerState = computed<ClientFormFooterState>(() => {\r\n const loading = this.footerLoading();\r\n const isLoaded = this.state.isLoaded();\r\n const renderMode = this.effectiveRenderMode();\r\n const stepNavigationEnabled = this.stepsEnabled();\r\n const sectionNavigationEnabled = this.sectionNavigationEnabled();\r\n const currentStep = this.currentStep();\r\n const stepCount = this.stepSections().length;\r\n const canGoToPreviousStep = stepNavigationEnabled && currentStep > 1;\r\n const canGoToNextStep = stepNavigationEnabled && currentStep < stepCount;\r\n\r\n return {\r\n loading,\r\n isLoaded,\r\n renderMode,\r\n actionMode: loading\r\n ? 'loading'\r\n : stepNavigationEnabled\r\n ? 'steps'\r\n : 'submit',\r\n stepNavigationEnabled,\r\n sectionNavigationEnabled,\r\n currentStep,\r\n stepCount,\r\n canGoToPreviousStep,\r\n canGoToNextStep,\r\n showPreviousStep: stepNavigationEnabled,\r\n showNextStep: stepNavigationEnabled && canGoToNextStep,\r\n showSubmit:\r\n isLoaded && !loading && (!stepNavigationEnabled || !canGoToNextStep),\r\n };\r\n });\r\n\r\n // ============================================================================\r\n // Effects\r\n // ============================================================================\r\n\r\n constructor() {\r\n // Auto-load when inputs are ready\r\n effect(() => {\r\n const autoLoad = this.autoLoad();\r\n const moduleKey = this.moduleKey();\r\n const operationKey = this.operationKey();\r\n\r\n if (autoLoad && moduleKey && operationKey) {\r\n untracked(() => this.load());\r\n }\r\n });\r\n\r\n // Patch form values after load\r\n effect(() => {\r\n const values = this.initialValues();\r\n const isLoaded = this.state.isLoaded();\r\n\r\n if (isLoaded && Object.keys(values).length > 0) {\r\n untracked(() => {\r\n this.formControl.patchValue(values, { emitEvent: false });\r\n });\r\n }\r\n });\r\n\r\n effect(() => {\r\n const count = this.stepSections().length;\r\n const current = this.currentStep();\r\n\r\n if (count === 0) {\r\n if (current !== 1) this.currentStep.set(1);\r\n return;\r\n }\r\n\r\n if (current < 1 || current > count) {\r\n this.currentStep.set(1);\r\n }\r\n });\r\n\r\n effect(() => {\r\n const footerState = this.footerState();\r\n\r\n untracked(() => {\r\n this.footerStateChanged.emit(footerState);\r\n });\r\n });\r\n }\r\n\r\n // ============================================================================\r\n // Public API (accessed via viewChild)\r\n // ============================================================================\r\n\r\n /**\r\n * Load form configuration from the API.\r\n * Builds request from current input values.\r\n */\r\n load(): void {\r\n if (this.state.loading()) return;\r\n\r\n this.loadSub?.unsubscribe();\r\n this.hasStartedLoad.set(true);\r\n this.runtimeMessages.set([]);\r\n this.state.loading.set(true);\r\n this.state.error.set(null);\r\n this.state.submitResponse.set(null);\r\n\r\n const request = this.buildLoadRequest();\r\n\r\n this.loadSub = this.api.load(request).subscribe({\r\n next: (response) => {\r\n this.state.loading.set(false);\r\n\r\n if (response.data) {\r\n this.state.setLoadResponse(response.data);\r\n this.loaded.emit(response.data);\r\n\r\n if (response.data.mode) {\r\n this.modeDetected.emit(response.data.mode);\r\n }\r\n\r\n if (response.data.formSource) {\r\n this.formSourceDetected.emit(response.data.formSource);\r\n }\r\n } else {\r\n const msg = response.message ?? 'Failed to load form';\r\n this.state.setError(msg);\r\n this.errored.emit(msg);\r\n }\r\n },\r\n error: (err) => {\r\n const msg =\r\n err?.error?.message ?? err?.message ?? 'Failed to load form';\r\n this.state.setError(msg);\r\n this.errored.emit(msg);\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Submit the current form values.\r\n * Builds submit request from form value + load context.\r\n */\r\n submit(): void {\r\n if (this.state.submitting()) return;\r\n const loadResponse = this.state.loadResponse();\r\n if (!loadResponse) {\r\n const msg = 'Form must be loaded before submit';\r\n this.state.submitError.set(msg);\r\n this.errored.emit(msg);\r\n return;\r\n }\r\n\r\n this.submitSub?.unsubscribe();\r\n this.state.submitting.set(true);\r\n this.state.submitError.set(null);\r\n\r\n const request = this.buildSubmitRequest(loadResponse);\r\n\r\n this.submitSub = this.api.submit(request).subscribe({\r\n next: (response) => {\r\n this.state.submitting.set(false);\r\n\r\n if (response.data) {\r\n this.state.setSubmitResponse(response.data);\r\n this.submitted.emit(response.data);\r\n } else {\r\n const msg = response.message ?? 'Failed to submit form';\r\n this.state.setSubmitError(msg);\r\n this.errored.emit(msg);\r\n }\r\n },\r\n error: (err) => {\r\n const msg =\r\n err?.error?.message ?? err?.message ?? 'Failed to submit form';\r\n this.state.setSubmitError(msg);\r\n this.errored.emit(msg);\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Get the current form value as a flat key-value object.\r\n */\r\n getFormValue(): Record<string, any> {\r\n return this.formControl.value ?? {};\r\n }\r\n\r\n /**\r\n * Get the current form value mapped to submit payload format.\r\n */\r\n getSubmitFields(): ProcessFormSubmitField[] {\r\n const loadResponse = this.state.loadResponse();\r\n if (!loadResponse) return [];\r\n return mapFormValueToSubmitFields(this.getFormValue(), loadResponse);\r\n }\r\n\r\n /**\r\n * Backward-compatible alias for consumers still using the previous helper name.\r\n */\r\n getSubmitValues(): ProcessFormSubmitField[] {\r\n return this.getSubmitFields();\r\n }\r\n\r\n /**\r\n * Check whether the current form state is valid.\r\n */\r\n isValid(): boolean {\r\n return this.formControl.valid;\r\n }\r\n\r\n /**\r\n * Reset the component to its initial state.\r\n */\r\n reset(): void {\r\n this.loadSub?.unsubscribe();\r\n this.submitSub?.unsubscribe();\r\n this.formControl.reset({});\r\n this.runtimeMessages.set([]);\r\n this.state.reset();\r\n }\r\n\r\n onRuntimeMessagesChange(messages: FormulaRuntimeMessage[]): void {\r\n this.runtimeMessages.set(messages ?? []);\r\n }\r\n\r\n onStepChange(value: number): void {\r\n const count = this.stepSections().length;\r\n if (value < 1 || value > count) return;\r\n this.currentStep.set(value);\r\n }\r\n\r\n goToPreviousStep(): void {\r\n this.onStepChange(this.currentStep() - 1);\r\n }\r\n\r\n goToNextStep(): void {\r\n this.onStepChange(this.currentStep() + 1);\r\n }\r\n\r\n canGoToPreviousStep(): boolean {\r\n return this.stepsEnabled() && this.currentStep() > 1;\r\n }\r\n\r\n canGoToNextStep(): boolean {\r\n return (\r\n this.stepsEnabled() && this.currentStep() < this.stepSections().length\r\n );\r\n }\r\n\r\n getCurrentStep(): number {\r\n return this.currentStep();\r\n }\r\n\r\n getStepCount(): number {\r\n return this.stepSections().length;\r\n }\r\n\r\n isStepNavigationEnabled(): boolean {\r\n return this.stepsEnabled();\r\n }\r\n\r\n isSectionNavigationEnabled(): boolean {\r\n return this.sectionNavigationEnabled();\r\n }\r\n\r\n isFooterLoading(): boolean {\r\n return this.footerState().loading;\r\n }\r\n\r\n getResolvedRenderMode(): ClientFormResolvedRenderMode {\r\n return this.footerState().renderMode;\r\n }\r\n\r\n getFooterState(): ClientFormFooterState {\r\n return this.footerState();\r\n }\r\n\r\n // ============================================================================\r\n // Lifecycle\r\n // ============================================================================\r\n\r\n ngOnDestroy(): void {\r\n this.loadSub?.unsubscribe();\r\n this.submitSub?.unsubscribe();\r\n }\r\n\r\n // ============================================================================\r\n // Private Helpers\r\n // ============================================================================\r\n\r\n private buildLoadRequest(): ProcessFormLoadRequest {\r\n const req: ProcessFormLoadRequest = {\r\n moduleKey: this.moduleKey(),\r\n operationKey: this.operationKey(),\r\n };\r\n\r\n const moduleId = this.moduleId();\r\n const levelId = this.levelId();\r\n const levelDataId = this.levelDataId();\r\n const moduleDataId = this.moduleDataId();\r\n const requestSchemaId = this.requestSchemaId();\r\n const draftProcessId = this.draftProcessId();\r\n const preview = this.preview();\r\n\r\n if (moduleId != null) req.moduleId = moduleId;\r\n if (levelId != null) req.levelId = levelId;\r\n if (levelDataId != null) req.levelDataId = levelDataId;\r\n if (moduleDataId != null) req.moduleDataId = moduleDataId;\r\n if (requestSchemaId != null) req.requestSchemaId = requestSchemaId;\r\n if (draftProcessId != null) req.draftProcessId = draftProcessId;\r\n if (preview) req.preview = preview;\r\n\r\n return req;\r\n }\r\n\r\n private buildSubmitRequest(\r\n loadResponse: ProcessFormLoadResponse,\r\n ): ProcessFormSubmitRequest {\r\n const context = this.state.context();\r\n const formValue = this.getFormValue();\r\n const fields: ProcessFormSubmitField[] = mapFormValueToSubmitFields(\r\n formValue,\r\n loadResponse,\r\n );\r\n\r\n const req: ProcessFormSubmitRequest = {\r\n moduleKey: this.moduleKey() ?? context?.moduleKey,\r\n operationKey: this.operationKey() ?? context?.operationKey,\r\n fields,\r\n };\r\n\r\n const moduleId = context?.moduleId ?? this.moduleId();\r\n const levelId = context?.levelId ?? this.levelId();\r\n const levelDataId = context?.levelDataId ?? this.levelDataId();\r\n const moduleDataId = context?.moduleDataId ?? this.moduleDataId();\r\n const requestSchemaId = context?.requestSchemaId ?? this.requestSchemaId();\r\n const recordId =\r\n moduleDataId ??\r\n (req.moduleKey === 'LevelData' && req.operationKey !== 'Create'\r\n ? levelDataId\r\n : undefined);\r\n const returnUrl = this.returnUrl();\r\n\r\n if (moduleId != null) req.moduleId = moduleId;\r\n if (levelId != null) req.levelId = levelId;\r\n if (levelDataId != null) req.levelDataId = levelDataId;\r\n if (moduleDataId != null) req.moduleDataId = moduleDataId;\r\n if (recordId != null) req.recordId = recordId;\r\n if (requestSchemaId != null) req.requestSchemaId = requestSchemaId;\r\n if (returnUrl) req.returnUrl = returnUrl;\r\n\r\n const submitRequestMapper = this.submitRequestMapper();\r\n if (!submitRequestMapper) {\r\n return req;\r\n }\r\n\r\n return submitRequestMapper(req, {\r\n formValue,\r\n loadResponse,\r\n });\r\n }\r\n\r\n private resolveStepTimelineState(\r\n stepValue: number,\r\n currentStep: number,\r\n ): StepTimelineState {\r\n if (stepValue < currentStep) {\r\n return 'completed';\r\n }\r\n\r\n if (stepValue === currentStep) {\r\n return 'current';\r\n }\r\n\r\n return 'upcoming';\r\n }\r\n}\r\n","<!-- Client Form Template - render only; step navigation buttons are optional -->\r\n\r\n<!-- Loading State -->\r\n@if (state.loading()) {\r\n <div class=\"flex flex-col gap-6\">\r\n <!-- Section header skeleton -->\r\n <div class=\"flex flex-col gap-4\">\r\n <p-skeleton width=\"30%\" height=\"1.5rem\" />\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"40%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"40%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-12 flex flex-col gap-2\">\r\n <p-skeleton width=\"25%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"35%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"45%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Second section skeleton -->\r\n <div class=\"flex flex-col gap-4\">\r\n <p-skeleton width=\"25%\" height=\"1.5rem\" />\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"35%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"50%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-12 flex flex-col gap-2\">\r\n <p-skeleton width=\"30%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"5rem\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n\r\n<!-- Loaded State -->\r\n@if (state.isLoaded() && !state.loading()) {\r\n <div class=\"flex flex-col gap-4\">\r\n @if (previewEntities().length > 0) {\r\n <mt-entities-preview [entities]=\"previewEntities()\" />\r\n }\r\n\r\n <!-- Dynamic Form -->\r\n @if (state.requiresForm() && editableFormConfig(); as config) {\r\n @if (hasEditableFormSections()) {\r\n <div class=\"flex flex-col gap-4\">\r\n @if (runtimeErrors().length > 0 || runtimeWarnings().length > 0) {\r\n <div class=\"rounded-lg border border-surface-200 p-4 bg-surface-50\">\r\n @if (runtimeErrors().length > 0) {\r\n <div class=\"mb-3\">\r\n <h4 class=\"text-sm font-semibold text-red-600 mb-2\">\r\n Validation Errors\r\n </h4>\r\n <ul class=\"list-disc ps-5 text-sm text-red-600 space-y-1\">\r\n @for (\r\n msg of runtimeErrors();\r\n track msg.ruleId || msg.fieldKey || msg.message\r\n ) {\r\n <li>{{ msg.message }}</li>\r\n }\r\n </ul>\r\n </div>\r\n }\r\n\r\n @if (runtimeWarnings().length > 0) {\r\n <div>\r\n <h4 class=\"text-sm font-semibold text-amber-600 mb-2\">\r\n Validation Warnings\r\n </h4>\r\n <ul class=\"list-disc ps-5 text-sm text-amber-700 space-y-1\">\r\n @for (\r\n msg of runtimeWarnings();\r\n track msg.ruleId || msg.fieldKey || msg.message\r\n ) {\r\n <li>{{ msg.message }}</li>\r\n }\r\n </ul>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (stepsEnabled()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"overflow-x-auto pb-2\">\r\n <div class=\"flex min-w-[36rem] items-start\">\r\n @for (\r\n step of stepTimeline();\r\n track step.key;\r\n let first = $first;\r\n let last = $last\r\n ) {\r\n <div\r\n class=\"relative flex min-w-[8rem] flex-1 justify-center\"\r\n >\r\n @if (!rtl() && !first) {\r\n <span\r\n class=\"absolute top-5 left-0 right-1/2 h-0.5\"\r\n [ngClass]=\"\r\n step.beforeLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (!rtl() && !last) {\r\n <span\r\n class=\"absolute top-5 left-1/2 right-0 h-0.5\"\r\n [ngClass]=\"\r\n step.afterLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (rtl() && !last) {\r\n <span\r\n class=\"absolute top-5 left-0 right-1/2 h-0.5\"\r\n [ngClass]=\"\r\n step.afterLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (rtl() && !first) {\r\n <span\r\n class=\"absolute top-5 left-1/2 right-0 h-0.5\"\r\n [ngClass]=\"\r\n step.beforeLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n\r\n <button\r\n type=\"button\"\r\n class=\"relative z-10 flex w-full flex-col items-center gap-3 px-2 text-center focus-visible:outline-none\"\r\n [attr.aria-pressed]=\"step.selected\"\r\n [attr.aria-current]=\"\r\n step.state === 'current' ? 'step' : null\r\n \"\r\n [attr.title]=\"step.label\"\r\n (click)=\"onStepChange(step.value)\"\r\n >\r\n <span\r\n class=\"flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border text-sm font-semibold transition-all duration-200\"\r\n [ngClass]=\"{\r\n 'border-primary bg-primary text-surface-0 ring-4 ring-primary/10':\r\n step.state === 'completed' ||\r\n step.state === 'current',\r\n\r\n 'border-surface-300 bg-white text-surface-500':\r\n step.state === 'upcoming',\r\n }\"\r\n >\r\n {{ step.value }}\r\n </span>\r\n <span\r\n class=\"max-w-[8rem] text-center text-sm leading-5 transition-colors duration-200\"\r\n [ngClass]=\"{\r\n 'font-semibold text-primary':\r\n step.selected || step.state === 'current',\r\n 'font-medium text-surface-700':\r\n step.state === 'completed' && !step.selected,\r\n 'font-medium text-surface-500':\r\n step.state === 'upcoming',\r\n }\"\r\n dir=\"auto\"\r\n >\r\n {{ step.label }}\r\n </span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (showInternalStepActions()) {\r\n <div class=\"flex justify-between gap-2\">\r\n <button\r\n type=\"button\"\r\n class=\"px-3 py-2 rounded border border-surface-300 text-sm\"\r\n [disabled]=\"currentStep() === 1\"\r\n (click)=\"goToPreviousStep()\"\r\n >\r\n Previous\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"px-3 py-2 rounded border border-surface-300 text-sm\"\r\n [disabled]=\"currentStep() === stepSections().length\"\r\n (click)=\"goToNextStep()\"\r\n >\r\n Next\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (tabsEnabled()) {\r\n <mt-tabs\r\n [active]=\"currentStep()\"\r\n (activeChange)=\"onStepChange($event)\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n fluid\r\n />\r\n }\r\n <mt-dynamic-form\r\n [formConfig]=\"config\"\r\n [formControl]=\"formControl\"\r\n [visibleSectionKeys]=\"visibleSectionKeys()\"\r\n [forcedHiddenFieldKeys]=\"effectiveForcedHiddenFieldKeys()\"\r\n [preserveForcedHiddenValues]=\"true\"\r\n (runtimeMessagesChange)=\"onRuntimeMessagesChange($event)\"\r\n />\r\n </div>\r\n }\r\n } @else if (previewEntities().length === 0) {\r\n <div\r\n class=\"flex items-center justify-center p-6 rounded-lg bg-surface-50 border border-surface-200 border-dashed\"\r\n >\r\n <p class=\"text-sm text-muted-color\">\r\n No form required for this operation.\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n}\r\n","// ============================================================================\r\n// API Response Wrapper\r\n// ============================================================================\r\n\r\nexport interface Response<T> {\r\n endpoint: string;\r\n status: number;\r\n code: number;\r\n locale: string;\r\n message?: string | null;\r\n errors?: any | null;\r\n data: T;\r\n cacheSession?: string;\r\n}\r\n\r\n// ============================================================================\r\n// Process Form Mode\r\n// ============================================================================\r\n\r\nexport type ProcessFormMode = 'Approval' | 'Direct';\r\nexport type ProcessFormSubmitStatus = 'PendingApproval' | 'Executed';\r\nexport type OperationType = 'FormOperation' | 'ActionOperation';\r\nexport type ProcessFormSource = 'Step' | 'None';\r\nexport type ClientFormResolvedRenderMode = 'form' | 'steps' | 'tabs';\r\nexport type ClientFormFooterActionMode = 'loading' | 'steps' | 'submit';\r\n\r\nexport interface ClientFormFooterState {\r\n loading: boolean;\r\n isLoaded: boolean;\r\n renderMode: ClientFormResolvedRenderMode;\r\n actionMode: ClientFormFooterActionMode;\r\n stepNavigationEnabled: boolean;\r\n sectionNavigationEnabled: boolean;\r\n currentStep: number;\r\n stepCount: number;\r\n canGoToPreviousStep: boolean;\r\n canGoToNextStep: boolean;\r\n showPreviousStep: boolean;\r\n showNextStep: boolean;\r\n showSubmit: boolean;\r\n}\r\n\r\n// ============================================================================\r\n// Load Request / Response\r\n// ============================================================================\r\n\r\nexport interface ProcessFormLoadRequest {\r\n moduleKey: string;\r\n operationKey: string;\r\n moduleId?: number | string;\r\n levelId?: number | string;\r\n levelDataId?: number | string;\r\n moduleDataId?: number | string;\r\n requestSchemaId?: number;\r\n draftProcessId?: number;\r\n preview?: boolean;\r\n}\r\n\r\nexport interface ProcessFormLoadResponse {\r\n mode: ProcessFormMode;\r\n formSource: ProcessFormSource;\r\n requiresForm: boolean;\r\n requestSchemaId: number | null;\r\n requestId: number | null;\r\n stepId: number | null;\r\n stepSchemaId: number | null;\r\n stepName: string | null;\r\n formConfiguration: ClientFormConfiguration | null;\r\n values: ProcessFormValue[];\r\n context: ProcessFormContext;\r\n}\r\n\r\n// ============================================================================\r\n// Submit Request / Response\r\n// ============================================================================\r\n\r\nexport interface ProcessFormSubmitRequest {\r\n moduleKey: string;\r\n operationKey: string;\r\n moduleId?: number | string;\r\n levelId?: number | string;\r\n levelDataId?: number | string;\r\n moduleDataId?: number | string;\r\n recordId?: number | string;\r\n requestSchemaId?: number;\r\n returnUrl?: string;\r\n fields: ProcessFormSubmitField[];\r\n}\r\n\r\nexport interface ClientFormSubmitRequestMapperContext {\r\n formValue: Record<string, any>;\r\n loadResponse: ProcessFormLoadResponse;\r\n}\r\n\r\nexport type ClientFormSubmitRequestMapper = (\r\n request: ProcessFormSubmitRequest,\r\n context: ClientFormSubmitRequestMapperContext,\r\n) => ProcessFormSubmitRequest;\r\n\r\nexport interface ProcessFormSubmitField {\r\n requestPropertyId?: number;\r\n propertyKey: string;\r\n value: any;\r\n}\r\n\r\nexport type ProcessFormSubmitValue = ProcessFormSubmitField;\r\n\r\nexport interface ProcessFormSubmitResponse {\r\n status: ProcessFormSubmitStatus;\r\n moduleKey: string;\r\n operationKey: string;\r\n recordId: number | null;\r\n levelId: number | null;\r\n levelDataId: number | null;\r\n requestSchemaId?: number | null;\r\n requestId?: number | null;\r\n resultModuleKey?: string | null;\r\n resultModuleId?: number | null;\r\n record?: ProcessFormSubmitRecord | null;\r\n}\r\n\r\nexport interface ProcessFormSubmitRecord {\r\n fields: ProcessFormSubmitRecordField[];\r\n}\r\n\r\nexport interface ProcessFormSubmitRecordField {\r\n id: number;\r\n key: string;\r\n normalizedKey: string;\r\n label: string;\r\n viewType: string;\r\n configuration: Record<string, unknown> | null;\r\n source: string;\r\n order: number;\r\n isRequired: boolean;\r\n isSystem: boolean;\r\n raw: any;\r\n value: any;\r\n display?: string | null;\r\n}\r\n\r\n// ============================================================================\r\n// Values & Context\r\n// ============================================================================\r\n\r\nexport interface ProcessFormValue {\r\n propertyKey: string;\r\n rawValue?: any;\r\n value: any;\r\n metadata?: ProcessFormValueMetadata;\r\n}\r\n\r\nexport interface ProcessFormValueMetadata {\r\n propertyId: number;\r\n key: string;\r\n viewType: string;\r\n source: string;\r\n}\r\n\r\nexport interface ProcessFormContext {\r\n moduleKey: string;\r\n operationKey: string;\r\n moduleId: number | null;\r\n levelId: number | null;\r\n levelDataId: number | null;\r\n moduleDataId: number | null;\r\n requestSchemaId: number | null;\r\n requestId: number | null;\r\n stepId: number | null;\r\n stepSchemaId: number | null;\r\n preview: boolean;\r\n}\r\n\r\n// ============================================================================\r\n// Form Configuration (runtime shape — no _pending/_deleting)\r\n// ============================================================================\r\n\r\nexport type ClientFieldWidth = '25' | '50' | '100';\r\nexport type ClientFormRenderMode = 'sections' | 'steps' | 'tabs';\r\n\r\nexport interface ClientFormConfiguration {\r\n isActive?: boolean;\r\n renderMode?: ClientFormRenderMode;\r\n sections: ClientFormSection[];\r\n validations?: ClientValidationRule[];\r\n}\r\n\r\nexport interface ClientFormSection {\r\n id: string;\r\n name: {\r\n en: string;\r\n ar: string;\r\n };\r\n order: number;\r\n fields: ClientFormField[];\r\n}\r\n\r\nexport interface ClientFormField {\r\n id: string;\r\n sectionId: string;\r\n propertyKey: string;\r\n /** Runtime property metadata returned by the API */\r\n propertyMetadata: ClientPropertyItem;\r\n width: ClientFieldWidth;\r\n order: number;\r\n hiddenInCreation?: boolean;\r\n hiddenInEditForm?: boolean;\r\n isRequired?: boolean;\r\n isRead?: boolean;\r\n isWrite?: boolean;\r\n showConditionalDisplayFormula?: boolean;\r\n conditionalDisplayFormula?: string;\r\n}\r\n\r\nexport interface ClientPropertyItem {\r\n key: string;\r\n propertyId?: number;\r\n isCalculated?: boolean;\r\n name:\r\n | string\r\n | {\r\n display?: string;\r\n en?: string;\r\n ar?: string;\r\n [k: string]: string | undefined;\r\n };\r\n viewType?: string;\r\n source?: string;\r\n configuration?: Record<string, unknown> | null;\r\n [key: string]: any;\r\n}\r\n\r\nexport interface ClientValidationRule {\r\n id: string | number;\r\n formulaTokens: string;\r\n formulaText: string;\r\n message: {\r\n en: string;\r\n ar: string;\r\n };\r\n severity: 'error' | 'warning';\r\n enabled: boolean;\r\n}\r\n\r\n// ============================================================================\r\n// Lookup Definitions (passed as input to ClientForm)\r\n// ============================================================================\r\n\r\nexport interface ClientLookup {\r\n id: number;\r\n key: string;\r\n name: { display?: string; ar?: string; en?: string };\r\n items: ClientLookupItem[];\r\n}\r\n\r\nexport interface ClientLookupItem {\r\n id: number;\r\n lookupId: number;\r\n key: string;\r\n name: { display?: string; ar?: string; en?: string };\r\n description?: { display?: string; ar?: string; en?: string };\r\n color?: string;\r\n order: number;\r\n}\r\n\r\n// ============================================================================\r\n// Legacy Command Interception\r\n// ============================================================================\r\n\r\nexport interface FormRequiredInterception {\r\n requestSchemaId: number;\r\n operationType: OperationType;\r\n status: 'FormRequired';\r\n message: string;\r\n levelId: number;\r\n levelDataId: number;\r\n moduleDataId: number;\r\n}\r\n\r\n/**\r\n * Type guard to detect a FormRequired interception response from legacy commands.\r\n * Use in HTTP interceptors to redirect to process-form runtime flow.\r\n */\r\nexport function isFormRequiredInterception(\r\n response: any,\r\n): response is FormRequiredInterception {\r\n return (\r\n response?.status === 'FormRequired' &&\r\n typeof response?.requestSchemaId === 'number'\r\n );\r\n}\r\n","// Client Form - Runtime process form component\r\nexport * from './client-form';\r\nexport * from './models/client-form.model';\r\nexport * from './services/client-form-api.service';\r\nexport * from './services/client-form-state.service';\r\nexport * from './utils/form-config-mapper';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAYA;;;AAGG;MAEU,oBAAoB,CAAA;AACd,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AAE1C;;;AAGG;AACH,IAAA,IAA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A,oBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,uBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACX,IAAI,qLACJ,QAAQ,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,OAAA,EAAA,WAAA,EAAA,cAAA,EAAA,MAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAMC,UAAU,EAAA,UAAA,EAAA,CAAA;kBAftB,SAAS;+BACE,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,eAAe;wBACf,WAAW;wBACX,IAAI;wBACJ,QAAQ;qBACT,EAAA,SAAA,EACU,CAAC,sBAAsB,CAAC,EAAA,QAAA,EAAA,kgVAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AEjGrC;AACA;AACA;AAqRA;;;AAGG;AACG,SAAU,0BAA0B,CACxC,QAAa,EAAA;AAEb,IAAA,QACE,QAAQ,EAAE,MAAM,KAAK,cAAc;AACnC,QAAA,OAAO,QAAQ,EAAE,eAAe,KAAK,QAAQ;AAEjD;;AClSA;;ACAA;;AAEG;;;;"}
1
+ {"version":3,"file":"masterteam-forms-client-form.mjs","sources":["../../../../packages/masterteam/forms/client-form/services/client-form-api.service.ts","../../../../packages/masterteam/forms/client-form/services/client-form-state.service.ts","../../../../packages/masterteam/forms/client-form/utils/form-config-mapper.ts","../../../../packages/masterteam/forms/client-form/client-form.ts","../../../../packages/masterteam/forms/client-form/client-form.html","../../../../packages/masterteam/forms/client-form/models/client-form.model.ts","../../../../packages/masterteam/forms/client-form/public-api.ts","../../../../packages/masterteam/forms/client-form/masterteam-forms-client-form.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport type {\r\n Response,\r\n ProcessFormLoadRequest,\r\n ProcessFormLoadResponse,\r\n ProcessFormSubmitRequest,\r\n ProcessFormSubmitResponse,\r\n} from '../models/client-form.model';\r\n\r\n/**\r\n * Stateless HTTP service for process-forms runtime APIs.\r\n * Root-provided — safe to share across multiple ClientForm instances.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class ClientFormApiService {\r\n private readonly http = inject(HttpClient);\r\n\r\n /**\r\n * Load form configuration and values for a given operation context.\r\n * Backend determines mode (Approval vs Direct) based on published schema.\r\n */\r\n load(\r\n request: ProcessFormLoadRequest,\r\n ): Observable<Response<ProcessFormLoadResponse>> {\r\n return this.http.post<Response<ProcessFormLoadResponse>>(\r\n 'process-form-load',\r\n request,\r\n );\r\n }\r\n\r\n /**\r\n * Submit form values. Result depends on mode:\r\n * - Approval → status: 'PendingApproval'\r\n * - Direct → status: 'Executed'\r\n */\r\n submit(\r\n request: ProcessFormSubmitRequest,\r\n ): Observable<Response<ProcessFormSubmitResponse>> {\r\n return this.http.post<Response<ProcessFormSubmitResponse>>(\r\n 'process-submit',\r\n request,\r\n );\r\n }\r\n}\r\n","import { Injectable, signal, computed } from '@angular/core';\r\n\r\nimport type {\r\n ProcessFormLoadResponse,\r\n ProcessFormSubmitResponse,\r\n ProcessFormValue,\r\n ProcessFormContext,\r\n ProcessFormMode,\r\n ProcessFormSource,\r\n ClientFormConfiguration,\r\n} from '../models/client-form.model';\r\n\r\n/**\r\n * Per-instance signal-based state for ClientForm.\r\n *\r\n * NOT providedIn root — each ClientForm component provides its own instance\r\n * via `providers: [ClientFormStateService]`, enabling multiple independent\r\n * forms on the same page.\r\n */\r\n@Injectable()\r\nexport class ClientFormStateService {\r\n // ============================================================================\r\n // Core State Signals\r\n // ============================================================================\r\n\r\n readonly loading = signal(false);\r\n readonly submitting = signal(false);\r\n readonly error = signal<string | null>(null);\r\n readonly submitError = signal<string | null>(null);\r\n readonly loadResponse = signal<ProcessFormLoadResponse | null>(null);\r\n readonly submitResponse = signal<ProcessFormSubmitResponse | null>(null);\r\n\r\n // ============================================================================\r\n // Derived Computeds — Load Response\r\n // ============================================================================\r\n\r\n readonly isLoaded = computed(() => !!this.loadResponse());\r\n\r\n readonly mode = computed<ProcessFormMode | null>(\r\n () => this.loadResponse()?.mode ?? null,\r\n );\r\n\r\n readonly isApproval = computed(() => this.mode() === 'Approval');\r\n readonly isDirect = computed(() => this.mode() === 'Direct');\r\n\r\n readonly formSource = computed<ProcessFormSource | null>(\r\n () => this.loadResponse()?.formSource ?? null,\r\n );\r\n\r\n readonly requiresForm = computed(\r\n () => this.loadResponse()?.requiresForm ?? false,\r\n );\r\n\r\n readonly formConfiguration = computed<ClientFormConfiguration | null>(\r\n () => this.loadResponse()?.formConfiguration ?? null,\r\n );\r\n\r\n readonly values = computed<ProcessFormValue[]>(\r\n () => this.loadResponse()?.values ?? [],\r\n );\r\n\r\n readonly context = computed<ProcessFormContext | null>(\r\n () => this.loadResponse()?.context ?? null,\r\n );\r\n\r\n readonly stepName = computed<string | null>(\r\n () => this.loadResponse()?.stepName ?? null,\r\n );\r\n\r\n readonly requestSchemaId = computed<number | null>(\r\n () => this.loadResponse()?.requestSchemaId ?? null,\r\n );\r\n\r\n readonly requestId = computed<number | null>(\r\n () => this.loadResponse()?.requestId ?? null,\r\n );\r\n\r\n readonly stepId = computed<number | null>(\r\n () => this.loadResponse()?.stepId ?? null,\r\n );\r\n\r\n readonly stepSchemaId = computed<number | null>(\r\n () => this.loadResponse()?.stepSchemaId ?? null,\r\n );\r\n\r\n // ============================================================================\r\n // Derived Computeds — Value Categories\r\n // ============================================================================\r\n\r\n /** Process virtual fields (Request_Date, Step_Name, etc.) — read-only display */\r\n readonly virtualFields = computed<ProcessFormValue[]>(() =>\r\n this.values().filter((v) => v.metadata?.source === 'ProcessVirtual'),\r\n );\r\n\r\n /** Editable form values (non-virtual) */\r\n readonly formValues = computed<ProcessFormValue[]>(() =>\r\n this.values().filter((v) => v.metadata?.source !== 'ProcessVirtual'),\r\n );\r\n\r\n // ============================================================================\r\n // Derived Computeds — Submit Response\r\n // ============================================================================\r\n\r\n readonly isSubmitted = computed(() => !!this.submitResponse());\r\n\r\n readonly submitStatus = computed(() => this.submitResponse()?.status ?? null);\r\n\r\n readonly isPendingApproval = computed(\r\n () => this.submitStatus() === 'PendingApproval',\r\n );\r\n\r\n readonly isExecuted = computed(() => this.submitStatus() === 'Executed');\r\n\r\n // ============================================================================\r\n // State Mutations\r\n // ============================================================================\r\n\r\n setLoadResponse(response: ProcessFormLoadResponse): void {\r\n this.loadResponse.set(response);\r\n this.error.set(null);\r\n }\r\n\r\n setSubmitResponse(response: ProcessFormSubmitResponse): void {\r\n this.submitResponse.set(response);\r\n this.submitError.set(null);\r\n }\r\n\r\n setError(message: string): void {\r\n this.error.set(message);\r\n this.loading.set(false);\r\n }\r\n\r\n setSubmitError(message: string): void {\r\n this.submitError.set(message);\r\n this.submitting.set(false);\r\n }\r\n\r\n reset(): void {\r\n this.loading.set(false);\r\n this.submitting.set(false);\r\n this.error.set(null);\r\n this.submitError.set(null);\r\n this.loadResponse.set(null);\r\n this.submitResponse.set(null);\r\n }\r\n}\r\n","import type {\r\n DynamicFormConfig,\r\n DynamicFieldConfig,\r\n FormulaValidationRuleConfig,\r\n} from '@masterteam/components';\r\nimport type { EntityData, EntitySize } from '@masterteam/components/entities';\r\nimport {\r\n REQUEST_CONTEXT,\r\n ValidatorConfig,\r\n TextFieldConfig,\r\n EditorFieldConfig,\r\n SelectFieldConfig,\r\n MultiSelectFieldConfig,\r\n DateFieldConfig,\r\n NumberFieldConfig,\r\n SliderFieldConfig,\r\n ToggleFieldConfig,\r\n UserSearchFieldConfig,\r\n UploadFileFieldConfig,\r\n LookupMatrixFieldConfig,\r\n SchemaConnectionFieldConfig,\r\n SchedulePredecessorFieldConfig,\r\n} from '@masterteam/components';\r\nimport { HttpContext } from '@angular/common/http';\r\n\r\nimport type {\r\n ClientFormConfiguration,\r\n ClientFormField,\r\n ClientPropertyItem,\r\n ClientLookup,\r\n ProcessFormValue,\r\n ProcessFormLoadResponse,\r\n ProcessFormSubmitField,\r\n ProcessFormContext,\r\n} from '../models/client-form.model';\r\n\r\n// ============================================================================\r\n// Constants\r\n// ============================================================================\r\n\r\nconst WIDTH_TO_COLSPAN: Record<string, number> = {\r\n '25': 3,\r\n '50': 6,\r\n '100': 12,\r\n};\r\n\r\nconst WIDTH_TO_ENTITY_SIZE: Record<string, EntitySize> = {\n '25': 6,\n '50': 12,\n '100': 24,\n};\n\nexport interface ClientFormPreviewSection {\n key: string;\n label: string;\n order: number;\n entities: EntityData[];\n}\n\r\n// ============================================================================\r\n// Public Mapper Functions\r\n// ============================================================================\r\n\r\n/**\r\n * Convert a runtime FormConfiguration into a DynamicFormConfig\r\n * that can be passed directly to `<mt-dynamic-form>`.\r\n *\r\n * @param config The form configuration from the load API\r\n * @param lang Current UI language ('en' | 'ar')\r\n * @param mode 'create' or 'edit' — filters hidden fields accordingly\r\n * @param lookups Available lookup definitions for resolving Lookup/LookupMultiSelect options\r\n */\r\nexport function mapToDynamicFormConfig(\n config: ClientFormConfiguration,\n lang: 'en' | 'ar' = 'en',\n mode: 'create' | 'edit' = 'create',\n lookups: ClientLookup[] = [],\n context: ProcessFormContext | null = null,\n readonly = false,\n): DynamicFormConfig {\n const validationRules = mapValidationRules(config, lang);\r\n\r\n return {\r\n sections: config.sections\r\n .slice()\r\n .sort((a, b) => a.order - b.order)\r\n .map((section) => {\r\n const sectionName = section.name[lang] ?? section.name['en'] ?? '';\r\n\r\n const visibleFields = section.fields\r\n .filter((field) => {\r\n // isRead=false → completely hidden\r\n if (field.isWrite !== true && field.isRead === false) return false;\r\n if (mode === 'create') return !field.hiddenInCreation;\r\n return !field.hiddenInEditForm;\r\n })\r\n .sort((a, b) => a.order - b.order);\n\n return {\n key: section.id,\r\n label: sectionName,\r\n type: 'header' as const,\r\n columns: 12,\r\n order: section.order,\n fields: visibleFields.map((field) =>\n mapFieldToConfig(field, lang, lookups, context, readonly),\n ),\n };\n })\n .filter((section) => section.fields.length > 0),\r\n validationRules,\r\n };\r\n}\r\n\r\n/**\r\n * Convert API property values into a flat key-value object\r\n * suitable for `formControl.patchValue()`.\r\n *\r\n * Only includes non-virtual (editable) values.\r\n */\r\nexport function mapValuesToFormValue(\r\n values: ProcessFormValue[],\r\n config?: ClientFormConfiguration | null,\r\n): Record<string, any> {\r\n const result: Record<string, any> = {};\r\n const fieldMap = config ? buildFieldValueMap(config) : null;\r\n\r\n for (const v of values) {\r\n if (v.metadata?.source === 'ProcessVirtual') continue;\r\n\r\n const targetFieldKey =\r\n resolveValueTargetKey(v, fieldMap) ?? v.propertyKey ?? null;\r\n if (!targetFieldKey) continue;\r\n\r\n result[targetFieldKey] = resolveLoadedFieldValue(v);\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Convert the current form value back into the submit payload format.\r\n *\r\n * Uses form configuration metadata (same source used to render fields)\r\n * to map `requestPropertyId` and `viewType`.\r\n */\r\nexport function mapFormValueToSubmitFields(\r\n formValue: Record<string, any>,\r\n loadResponse: ProcessFormLoadResponse,\r\n): ProcessFormSubmitField[] {\r\n const metadataByKey = new Map<\r\n string,\r\n { propertyId?: number; viewType?: string }\r\n >();\r\n\r\n for (const section of loadResponse.formConfiguration?.sections ?? []) {\r\n for (const field of section.fields ?? []) {\r\n const { propertyId, viewType } = resolveFieldMeta(field);\r\n metadataByKey.set(field.propertyKey, {\r\n propertyId,\r\n viewType,\r\n });\r\n }\r\n }\r\n\r\n return Object.entries(formValue)\r\n .filter(([propertyKey, value]) => {\r\n if (value === undefined || value === null) return false;\r\n return metadataByKey.get(propertyKey)?.viewType !== 'LookupMatrix';\r\n })\r\n .map(([propertyKey, value]) => {\r\n const meta = metadataByKey.get(propertyKey);\r\n const normalizedValue = normalizeSubmitValue(value, meta?.viewType);\r\n if (normalizedValue === undefined || normalizedValue === null) {\r\n return null;\r\n }\r\n\r\n const submitField: ProcessFormSubmitField = {\r\n propertyKey,\r\n value: normalizedValue,\r\n };\r\n\r\n if (meta?.propertyId) {\r\n submitField.requestPropertyId = meta.propertyId;\r\n }\r\n\r\n return submitField;\r\n })\r\n .filter((value): value is ProcessFormSubmitField => !!value);\r\n}\r\n\r\nexport function getPreviewOnlyFieldKeys(\n config: ClientFormConfiguration,\n mode: 'create' | 'edit' = 'create',\n readonly = false,\n): string[] {\n return config.sections.flatMap((section) =>\n (section.fields ?? [])\n .filter(\n (field) =>\n isFieldVisible(field, mode) && isPreviewOnlyField(field, readonly),\n )\n .map((field) => field.propertyKey),\n );\n}\n\nexport function mapPreviewFieldsToEntities(\n config: ClientFormConfiguration,\n values: ProcessFormValue[],\n mode: 'create' | 'edit' = 'create',\n readonly = false,\n): EntityData[] {\n return mapPreviewSectionsToEntities(\n config,\n values,\n 'en',\n mode,\n readonly,\n ).flatMap((section) => section.entities);\n}\n\nexport function mapPreviewSectionsToEntities(\n config: ClientFormConfiguration,\n values: ProcessFormValue[],\n lang: 'en' | 'ar' = 'en',\n mode: 'create' | 'edit' = 'create',\n readonly = false,\n): ClientFormPreviewSection[] {\n const resolvedValues = mapValuesToFormValue(values, config);\n\n return config.sections\n .slice()\n .sort((a, b) => a.order - b.order)\n .map((section) => ({\n key: section.id,\n label: section.name[lang] ?? section.name.en ?? '',\n order: section.order,\n entities: (section.fields ?? [])\n .filter(\n (field) =>\n isFieldVisible(field, mode) && isPreviewOnlyField(field, readonly),\n )\n .sort((a, b) => a.order - b.order)\n .map((field) => {\n const property = field.propertyMetadata;\n\n return {\n ...(property as EntityData),\n name: (property.name as any)?.display,\n key: property.key ?? field.propertyKey,\n value: resolvedValues[field.propertyKey],\n order: section.order * 1000 + field.order,\n configuration: {\n ...(property.configuration as Record<string, unknown>),\n size: WIDTH_TO_ENTITY_SIZE[field.width] ?? 24,\n },\n } satisfies EntityData;\n }),\n }))\n .filter((section) => section.entities.length > 0);\n}\n\r\n// ============================================================================\r\n// Internal Helpers\r\n// ============================================================================\r\n\r\nfunction isFieldVisible(\r\n field: ClientFormField,\r\n mode: 'create' | 'edit',\r\n): boolean {\r\n if (field.isWrite !== true && field.isRead === false) return false;\r\n if (mode === 'create') return !field.hiddenInCreation;\r\n return !field.hiddenInEditForm;\r\n}\r\n\r\nfunction isPreviewOnlyField(\n field: ClientFormField,\n readonly = false,\n): boolean {\n return field.isRead !== false && (readonly || field.isWrite === false);\n}\n\r\nfunction isCalculatedField(field: ClientFormField): boolean {\r\n return field.propertyMetadata?.isCalculated === true;\r\n}\r\n\r\nfunction resolveFieldMeta(field: ClientFormField): {\r\n property: ClientPropertyItem;\r\n propertyId?: number;\r\n viewType: string;\r\n} {\r\n const property = field.propertyMetadata;\r\n return {\r\n property,\r\n propertyId: property?.propertyId,\r\n viewType: property?.viewType ?? 'Text',\r\n };\r\n}\r\n\r\nfunction mapFieldToConfig(\n field: ClientFormField,\n lang: 'en' | 'ar',\n lookups: ClientLookup[],\n context: ProcessFormContext | null,\n readonly = false,\n): DynamicFieldConfig {\n const { property: prop, viewType } = resolveFieldMeta(field);\r\n const label =\r\n (prop?.name as { display?: string } | undefined)?.display ??\r\n field.propertyKey;\r\n const colSpan = WIDTH_TO_COLSPAN[field.width] ?? 12;\r\n\r\n const base = {\r\n key: field.propertyKey,\r\n label,\r\n colSpan,\r\n order: field.order,\n placeholder: label,\n required: field.isRequired ?? false,\n disabled: isCalculatedField(field),\n readonly: readonly || field.isWrite === false,\n validators: field.isRequired\n ? [ValidatorConfig.required(`${label} is required`)]\n : [],\n formulaCondition: buildFormulaCondition(field),\r\n };\r\n\r\n switch (viewType) {\r\n // ── Text-like ──────────────────────────────────────────────\r\n case 'Text':\r\n case 'EditableListView':\r\n case 'LookupLog':\r\n return new TextFieldConfig(base);\r\n\r\n case 'LongText':\r\n return new EditorFieldConfig(base);\r\n\r\n // ── Numeric ───────────────────────────────────────────────\r\n case 'Number':\r\n return new NumberFieldConfig(base);\r\n\r\n case 'Currency':\r\n return new NumberFieldConfig({\r\n ...base,\r\n useGrouping: true,\r\n });\r\n\r\n case 'Percentage':\r\n return new SliderFieldConfig({\r\n ...base,\r\n min: 0,\r\n max: 100,\r\n unit: '%',\r\n });\r\n\r\n // ── Date / Time ───────────────────────────────────────────\r\n case 'Date':\r\n return new DateFieldConfig({ ...base, showTime: false });\r\n\r\n case 'DateTime':\r\n return new DateFieldConfig({ ...base, showTime: true });\r\n\r\n case 'Time':\r\n return new DateFieldConfig({ ...base, showTime: true });\r\n\r\n // ── Boolean ───────────────────────────────────────────────\r\n case 'Checkbox':\r\n return new ToggleFieldConfig(base);\r\n\r\n // ── File ──────────────────────────────────────────────────\r\n case 'Attachment':\r\n return new UploadFileFieldConfig(base);\r\n\r\n // ── User Search ───────────────────────────────────────────\r\n case 'User':\r\n return new UserSearchFieldConfig({\r\n ...base,\r\n apiUrl: 'Identity/users',\r\n context: new HttpContext().set(REQUEST_CONTEXT, {\r\n useBaseUrl: false,\r\n }),\r\n });\r\n\r\n // ── Lookup (single select) ────────────────────────────────\r\n case 'Lookup': {\r\n const items = resolveLookupOptions(prop, lookups);\r\n return new SelectFieldConfig({\r\n ...base,\r\n options: items,\r\n optionLabel: 'label',\r\n optionValue: 'value',\r\n filter: items.length > 10,\r\n showClear: !(field.isRequired ?? false),\r\n });\r\n }\r\n\r\n // ── Lookup (multi select) ─────────────────────────────────\r\n case 'LookupMultiSelect': {\r\n const items = resolveLookupOptions(prop, lookups);\r\n return new MultiSelectFieldConfig({\r\n ...base,\r\n options: items,\r\n optionLabel: 'label',\r\n optionValue: 'value',\r\n filter: items.length > 10,\r\n display: 'chip',\r\n });\r\n }\r\n\r\n // ── Other select-based types ──────────────────────────────\r\n case 'Status':\r\n case 'InternalModule':\r\n case 'DynamicList':\r\n case 'API':\r\n case 'Location': {\r\n const options = extractOptionsFromProperty(prop);\r\n return new SelectFieldConfig({\r\n ...base,\r\n options: options ?? [],\r\n optionLabel: 'label',\r\n optionValue: 'value',\r\n });\r\n }\r\n\r\n case 'LookupMatrix':\r\n return buildLookupMatrixFieldConfig(base, prop, lookups);\r\n\r\n // ── Connection (level-to-level) ─────────────────────────\r\n case 'Connection': {\r\n const connectionConfig = prop?.configuration ?? {};\r\n return new SchemaConnectionFieldConfig({\r\n ...base,\r\n configuration: connectionConfig,\r\n });\r\n }\r\n case 'Predecessor':\r\n return new SchedulePredecessorFieldConfig({\r\n ...base,\r\n configuration: prop?.configuration ?? null,\r\n runtimeContext: context\r\n ? {\r\n levelId: context.levelId,\r\n levelDataId: context.levelDataId,\r\n moduleDataId: context.moduleDataId,\r\n }\r\n : null,\r\n });\r\n\r\n // ── Fallback ──────────────────────────────────────────────\r\n default:\r\n return new TextFieldConfig(base);\r\n }\r\n}\r\n\r\nfunction buildFormulaCondition(\r\n field: ClientFormField,\r\n): { formulaTokens: string; formulaText?: string; mode?: 'auto' } | undefined {\r\n if (!field.showConditionalDisplayFormula) return undefined;\r\n const formulaTokens = (field.conditionalDisplayFormula ?? '').trim();\r\n if (!formulaTokens) return undefined;\r\n\r\n return {\r\n formulaTokens,\r\n formulaText: field.conditionalDisplayFormula ?? '',\r\n mode: 'auto',\r\n };\r\n}\r\n\r\nfunction mapValidationRules(\r\n config: ClientFormConfiguration,\r\n lang: 'en' | 'ar',\r\n): FormulaValidationRuleConfig[] {\r\n return (config.validations ?? []).map((rule) => ({\r\n id: rule.id,\r\n formulaTokens: rule.formulaTokens,\r\n formulaText: rule.formulaText,\r\n message:\r\n rule.message?.[lang] ??\r\n rule.message?.en ??\r\n rule.message?.ar ??\r\n 'Validation rule failed',\r\n severity: rule.severity,\r\n enabled: rule.enabled,\r\n }));\r\n}\r\n\r\n/**\r\n * Resolve lookup items for Lookup / LookupMultiSelect viewTypes.\r\n *\r\n * Reads `configuration.lookup` (the lookup ID) from the property metadata,\r\n * finds the matching lookup definition, and maps its items to select options.\r\n */\r\nfunction resolveLookupOptions(\r\n prop: ClientPropertyItem | undefined,\r\n lookups: ClientLookup[],\r\n): ResolvedLookupOption[] {\r\n return resolveLookupOptionsById(\r\n coerceLookupId(prop?.configuration?.['lookup']),\r\n lookups,\r\n );\r\n}\r\n\r\n/**\r\n * Fallback option extractor for non-lookup select types\r\n * (Status, InternalModule, DynamicList, API, etc.).\r\n */\r\nfunction extractOptionsFromProperty(\r\n property: ClientPropertyItem | undefined,\r\n): { label: string; value: any }[] | null {\r\n if (!property?.configuration) return null;\r\n\r\n const config = property.configuration;\r\n\r\n if (Array.isArray(config['options'])) {\r\n return config['options'] as { label: string; value: any }[];\r\n }\r\n\r\n if (Array.isArray(config['items'])) {\r\n return (config['items'] as any[]).map((item) => ({\r\n label:\r\n typeof item.name === 'string'\r\n ? item.name\r\n : (item.name?.['en'] ?? item.label ?? String(item.value)),\r\n value: item.id ?? item.value ?? item.key,\r\n }));\r\n }\r\n\r\n return null;\r\n}\r\n\r\ntype ResolvedLookupOption = {\r\n id?: number | string;\r\n key?: string;\r\n label: string;\r\n value: any;\r\n color?: string | null;\r\n description?: string;\r\n};\r\n\r\nfunction resolveLookupOptionsById(\r\n lookupId: number | null,\r\n lookups: ClientLookup[],\r\n): ResolvedLookupOption[] {\r\n if (!lookupId || !lookups.length) return [];\r\n\r\n const lookup = lookups.find((item) => item.id === lookupId);\r\n if (!lookup) return [];\r\n\r\n return lookup.items\r\n .slice()\r\n .sort((a, b) => a.order - b.order)\r\n .map((item) => ({\r\n id: item.id,\r\n key: item.key,\r\n label: item.name?.display ?? item.name?.en ?? item.key,\r\n value: item.key,\r\n color: item.color ?? null,\r\n description:\r\n item.description?.display ?? item.description?.en ?? undefined,\r\n }));\r\n}\r\n\r\nfunction resolveLookupNameById(\r\n lookupId: number | null,\r\n lookups: ClientLookup[],\r\n): string {\r\n if (!lookupId) return '';\r\n\r\n const lookup = lookups.find((item) => item.id === lookupId);\r\n return lookup?.name?.display ?? lookup?.name?.en ?? lookup?.key ?? '';\r\n}\r\n\r\nfunction buildLookupMatrixFieldConfig(\r\n base: {\r\n key: string;\r\n label: string;\r\n colSpan: number;\r\n order: number;\r\n placeholder: string;\r\n required: boolean;\r\n disabled: boolean;\r\n readonly: boolean;\r\n validators: ValidatorConfig[];\r\n formulaCondition:\r\n | { formulaTokens: string; formulaText?: string; mode?: 'auto' }\r\n | undefined;\r\n },\r\n prop: ClientPropertyItem | undefined,\r\n lookups: ClientLookup[],\r\n): LookupMatrixFieldConfig {\r\n const configuration = (prop?.configuration ?? {}) as Record<string, unknown>;\r\n const xLookupId = coerceLookupId(configuration['xlookupSource']);\r\n const yLookupId = coerceLookupId(configuration['ylookupSource']);\r\n const zLookupId = coerceLookupId(configuration['zlookupId']);\r\n\r\n const xOptions = resolveLookupOptionsById(xLookupId, lookups);\r\n const yOptions = resolveLookupOptionsById(yLookupId, lookups);\r\n const zOptions = resolveLookupOptionsById(zLookupId, lookups);\r\n const zOptionsById = new Map(\r\n zOptions\r\n .filter((item) => item.id != null)\r\n .map((item) => [String(item.id), item] as const),\r\n );\r\n\r\n const rawCells = Array.isArray(configuration['lookupsMatrix'])\r\n ? (configuration['lookupsMatrix'] as Array<Record<string, unknown>>)\r\n : [];\r\n\r\n return new LookupMatrixFieldConfig({\r\n ...base,\r\n required: false,\r\n xFieldKey: String(configuration['xPropertyLookupKey'] ?? ''),\r\n yFieldKey: String(configuration['yPropertyLookupKey'] ?? ''),\r\n xAxisLabel: resolveLookupNameById(xLookupId, lookups),\r\n yAxisLabel: resolveLookupNameById(yLookupId, lookups),\r\n xOptions,\r\n yOptions,\r\n cells: rawCells.map((cell) => {\r\n const zOption = zOptionsById.get(String(cell['value'] ?? ''));\r\n\r\n return {\r\n row: Number(cell['row'] ?? 0),\r\n column: Number(cell['column'] ?? 0),\r\n xLookupItemId: String(cell['xValue'] ?? ''),\r\n yLookupItemId: String(cell['yValue'] ?? ''),\r\n zLookupItemId: cell['value'] == null ? null : String(cell['value']),\r\n label: zOption?.label ?? String(cell['value'] ?? ''),\r\n color: zOption?.color ?? null,\r\n };\r\n }),\r\n });\r\n}\r\n\r\nfunction coerceLookupId(value: unknown): number | null {\r\n if (typeof value === 'number' && Number.isFinite(value)) {\r\n return value;\r\n }\r\n\r\n if (typeof value === 'string' && value.trim() !== '') {\r\n const parsed = Number(value);\r\n return Number.isFinite(parsed) ? parsed : null;\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction normalizeSubmitValue(value: any, viewType?: string): any {\r\n switch (viewType) {\r\n case 'User':\r\n if (value && typeof value === 'object' && !Array.isArray(value)) {\r\n return value['id'] ?? value;\r\n }\r\n return value;\r\n\r\n default:\r\n return value;\r\n }\r\n}\r\n\r\nfunction resolveLoadedFieldValue(value: ProcessFormValue): any {\r\n const resolvedValue =\r\n value.metadata?.viewType === 'User'\r\n ? value.value\r\n : (value.rawValue ?? value.value);\r\n\r\n switch (value.metadata?.viewType) {\r\n case 'Date':\r\n case 'DateTime':\r\n case 'Time':\r\n return coerceToDate(resolvedValue);\r\n\r\n default:\r\n return resolvedValue;\r\n }\r\n}\r\n\r\nfunction coerceToDate(value: any): any {\r\n if (value === null || value === undefined || value === '') {\r\n return value;\r\n }\r\n\r\n if (value instanceof Date) {\r\n return value;\r\n }\r\n\r\n const coerced = new Date(value);\r\n return Number.isNaN(coerced.getTime()) ? value : coerced;\r\n}\r\n\r\ntype FieldValueMeta = {\r\n key: string;\r\n propertyId?: number;\r\n};\r\n\r\ntype FieldValueMap = {\r\n fieldsByKey: Map<string, FieldValueMeta>;\r\n propertyIdToKey: Map<number, string>;\r\n aliasToKey: Map<string, string>;\r\n};\r\n\r\nfunction buildFieldValueMap(config: ClientFormConfiguration): FieldValueMap {\r\n const fieldsByKey = new Map<string, FieldValueMeta>();\r\n const propertyIdCandidates = new Map<number, Set<string>>();\r\n const aliasCandidates = new Map<string, Set<string>>();\r\n\r\n for (const section of config.sections ?? []) {\r\n for (const field of section.fields ?? []) {\r\n const { propertyId } = resolveFieldMeta(field);\r\n const fieldMeta: FieldValueMeta = {\r\n key: field.propertyKey,\r\n propertyId,\r\n };\r\n\r\n fieldsByKey.set(field.propertyKey, fieldMeta);\r\n\r\n if (propertyId != null) {\r\n if (!propertyIdCandidates.has(propertyId)) {\r\n propertyIdCandidates.set(propertyId, new Set<string>());\r\n }\r\n propertyIdCandidates.get(propertyId)!.add(field.propertyKey);\r\n }\r\n\r\n const aliases = new Set<string>([\r\n field.propertyKey,\r\n stripTemplatePrefix(field.propertyKey),\r\n ]);\r\n\r\n const property = field.propertyMetadata;\r\n if (property?.key) {\r\n aliases.add(property.key);\r\n aliases.add(stripTemplatePrefix(property.key));\r\n }\r\n\r\n aliases.forEach((alias) => {\r\n if (!alias) return;\r\n if (!aliasCandidates.has(alias)) {\r\n aliasCandidates.set(alias, new Set<string>());\r\n }\r\n aliasCandidates.get(alias)!.add(field.propertyKey);\r\n });\r\n }\r\n }\r\n\r\n const propertyIdToKey = new Map<number, string>();\r\n propertyIdCandidates.forEach((keys, propertyId) => {\r\n if (keys.size !== 1) return;\r\n propertyIdToKey.set(propertyId, [...keys][0]);\r\n });\r\n\r\n const aliasToKey = new Map<string, string>();\r\n aliasCandidates.forEach((keys, alias) => {\r\n if (keys.size !== 1) return;\r\n aliasToKey.set(alias, [...keys][0]);\r\n });\r\n\r\n return {\r\n fieldsByKey,\r\n propertyIdToKey,\r\n aliasToKey,\r\n };\r\n}\r\n\r\nfunction resolveValueTargetKey(\r\n value: ProcessFormValue,\r\n fieldMap: FieldValueMap | null,\r\n): string | null {\r\n if (!fieldMap) {\r\n return value.propertyKey ?? null;\r\n }\r\n\r\n const exactCandidates = [value.propertyKey, value.metadata?.key].filter(\r\n (candidate): candidate is string => !!candidate,\r\n );\r\n\r\n for (const candidate of exactCandidates) {\r\n if (fieldMap.fieldsByKey.has(candidate)) {\r\n return candidate;\r\n }\r\n }\r\n\r\n const propertyId = value.metadata?.propertyId;\r\n if (propertyId != null && fieldMap.propertyIdToKey.has(propertyId)) {\r\n return fieldMap.propertyIdToKey.get(propertyId)!;\r\n }\r\n\r\n const aliasCandidates = exactCandidates.flatMap((candidate) => [\r\n candidate,\r\n stripTemplatePrefix(candidate),\r\n ]);\r\n\r\n for (const candidate of aliasCandidates) {\r\n if (!candidate) continue;\r\n if (fieldMap.aliasToKey.has(candidate)) {\r\n return fieldMap.aliasToKey.get(candidate)!;\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction stripTemplatePrefix(value: string): string {\r\n return value.replace(/^template_\\d+_/, '');\r\n}\r\n","import {\r\n Component,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n untracked,\r\n OnDestroy,\r\n} from '@angular/core';\r\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\r\nimport { CommonModule } from '@angular/common';\nimport { Subscription } from 'rxjs';\nimport { Skeleton } from 'primeng/skeleton';\n\nimport { Button } from '@masterteam/components/button';\nimport { EntitiesPreview } from '@masterteam/components/entities';\nimport { Tabs, type OptionItem } from '@masterteam/components/tabs';\nimport { DynamicForm } from '@masterteam/forms/dynamic-form';\nimport type {\r\n DynamicFormConfig,\r\n FormulaRuntimeMessage,\r\n} from '@masterteam/components';\r\n\r\nimport { ClientFormApiService } from './services/client-form-api.service';\r\nimport { ClientFormStateService } from './services/client-form-state.service';\r\nimport {\n getPreviewOnlyFieldKeys,\n mapPreviewSectionsToEntities,\n mapToDynamicFormConfig,\n mapValuesToFormValue,\n mapFormValueToSubmitFields,\n} from './utils/form-config-mapper';\n\r\nimport type {\r\n ClientFormFooterState,\r\n ClientFormResolvedRenderMode,\r\n ProcessFormLoadRequest,\r\n ProcessFormLoadResponse,\r\n ProcessFormSubmitRequest,\r\n ProcessFormSubmitResponse,\r\n ProcessFormSubmitField,\r\n ProcessFormMode,\r\n ProcessFormSource,\r\n ProcessFormValue,\r\n ClientLookup,\r\n ClientFormSubmitRequestMapper,\r\n} from './models/client-form.model';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\n\r\ntype StepTimelineState = 'completed' | 'current' | 'upcoming';\r\n\r\ninterface StepTimelineItem {\r\n key: string;\r\n label: string;\r\n value: number;\r\n state: StepTimelineState;\r\n selected: boolean;\r\n beforeLineActive: boolean;\r\n afterLineActive: boolean;\r\n}\r\n\r\n/**\r\n * Client Form — Runtime process form component.\r\n *\r\n * Self-contained, signal-based (no NGXS). Each instance manages its own state\r\n * via a component-scoped `ClientFormStateService`.\r\n *\r\n * Submit and reset actions stay external. Step navigation buttons are optional\r\n * and can be hidden with `showInternalStepActions`.\r\n *\r\n * Parent can control actions via `viewChild()`:\r\n *\r\n * ```html\r\n * <mt-client-form #processForm [moduleKey]=\"'Risk'\" [operationKey]=\"'CloseRisk'\" />\r\n * <button (click)=\"processForm.load()\">Load</button>\r\n * <button (click)=\"processForm.submit()\">Submit</button>\r\n * ```\r\n *\r\n * Or programmatically:\r\n * ```typescript\r\n * readonly processForm = viewChild.required(ClientForm);\r\n * this.processForm().load();\r\n * this.processForm().submit();\r\n * ```\r\n */\r\n@Component({\r\n selector: 'mt-client-form',\r\n standalone: true,\r\n imports: [\n CommonModule,\n ReactiveFormsModule,\n Button,\n EntitiesPreview,\n DynamicForm,\n Tabs,\n Skeleton,\r\n ],\r\n providers: [ClientFormStateService],\r\n templateUrl: './client-form.html',\r\n styleUrls: ['./client-form.scss'],\r\n})\r\nexport class ClientForm implements OnDestroy {\r\n private readonly api = inject(ClientFormApiService);\r\n protected readonly state = inject(ClientFormStateService);\r\n\r\n private loadSub?: Subscription;\r\n private submitSub?: Subscription;\r\n private readonly hasStartedLoad = signal(false);\r\n readonly runtimeMessages = signal<FormulaRuntimeMessage[]>([]);\r\n private readonly translocoService = inject(TranslocoService);\r\n\r\n // ============================================================================\r\n // Public State Signals (for parent access via viewChild)\r\n // ============================================================================\r\n\r\n readonly submitting = computed(() => this.state.submitting());\r\n readonly submitError = computed(() => this.state.submitError());\r\n readonly isSubmitted = computed(() => this.state.isSubmitted());\r\n readonly isPendingApproval = computed(() => this.state.isPendingApproval());\r\n readonly isExecuted = computed(() => this.state.isExecuted());\r\n readonly isLoaded = computed(() => this.state.isLoaded());\r\n readonly loading = computed(() => this.state.loading());\r\n readonly runtimeErrors = computed(() =>\r\n this.runtimeMessages().filter((msg) => msg.severity === 'error'),\r\n );\r\n readonly runtimeWarnings = computed(() =>\r\n this.runtimeMessages().filter((msg) => msg.severity === 'warning'),\r\n );\r\n readonly currentStep = signal(1);\r\n\r\n // ============================================================================\r\n // Inputs — Required Context\r\n // ============================================================================\r\n\r\n readonly moduleKey = input.required<string>();\r\n readonly operationKey = input.required<string>();\r\n\r\n // ============================================================================\r\n // Inputs — Optional Context\r\n // ============================================================================\r\n\r\n readonly moduleId = input<number | string>();\r\n readonly levelId = input<number | string>();\r\n readonly levelDataId = input<number | string>();\r\n readonly moduleDataId = input<number | string>();\r\n readonly requestSchemaId = input<number>();\r\n readonly draftProcessId = input<number>();\r\n readonly preview = input(false);\r\n readonly returnUrl = input<string>();\r\n readonly submitRequestMapper = input<ClientFormSubmitRequestMapper | null>(\r\n null,\r\n );\r\n\r\n // ============================================================================\r\n // Inputs — UI Configuration\r\n // ============================================================================\r\n\r\n readonly readonly = input(false);\r\n readonly autoLoad = input(true);\r\n readonly formMode = input<'create' | 'edit'>('create');\r\n readonly renderMode = input<'form' | 'steps' | 'tabs' | undefined>();\r\n // Hide the built-in previous/next buttons when step actions are rendered by the parent.\r\n readonly showInternalStepActions = input<boolean>(true);\r\n readonly lang = signal(this.translocoService.getActiveLang() as 'en' | 'ar');\r\n readonly lookups = input<ClientLookup[]>([]);\r\n readonly ignoredFieldKeys = input<string[]>([]);\r\n readonly rtl = computed(() => this.lang() === 'ar');\r\n\r\n // ============================================================================\r\n // Outputs\r\n // ============================================================================\r\n\r\n readonly loaded = output<ProcessFormLoadResponse>();\r\n readonly submitted = output<ProcessFormSubmitResponse>();\r\n readonly errored = output<string>();\r\n readonly modeDetected = output<ProcessFormMode>();\r\n readonly formSourceDetected = output<ProcessFormSource>();\r\n readonly footerStateChanged = output<ClientFormFooterState>();\r\n\r\n // ============================================================================\r\n // Internal Form Control\r\n // ============================================================================\r\n\r\n readonly formControl = new FormControl<Record<string, any>>({});\r\n\r\n // ============================================================================\r\n // Computed — Dynamic Form Config\r\n // ============================================================================\r\n\r\n readonly formConfig = computed<DynamicFormConfig | null>(() => {\r\n const config = this.state.formConfiguration();\r\n if (!config) return null;\r\n return mapToDynamicFormConfig(\n config,\n this.lang(),\n this.formMode(),\n this.lookups(),\n this.state.context(),\n this.readonly(),\n );\n });\n\r\n readonly initialValues = computed<Record<string, any>>(() => {\r\n return mapValuesToFormValue(\r\n this.state.formValues(),\r\n this.state.formConfiguration(),\r\n );\r\n });\r\n\r\n readonly virtualFields = computed<ProcessFormValue[]>(() =>\r\n this.state.virtualFields(),\r\n );\r\n\r\n readonly hasVirtualFields = computed(() => this.virtualFields().length > 0);\r\n readonly previewFieldKeys = computed(() => {\r\n const config = this.state.formConfiguration();\r\n if (!config) return [];\r\n return [\r\n ...new Set([\n ...getPreviewOnlyFieldKeys(config, this.formMode(), this.readonly()),\n ...this.ignoredFieldKeys(),\n ]),\n ];\n });\r\n readonly previewEntitySections = computed(() => {\n const config = this.state.formConfiguration();\n if (!config) return [];\n const ignoredFieldKeys = new Set(this.ignoredFieldKeys());\n return mapPreviewSectionsToEntities(\n config,\n this.state.formValues(),\n this.lang(),\n this.formMode(),\n this.readonly(),\n )\n .map((section) => ({\n ...section,\n entities: section.entities.filter(\n (entity) => !entity.key || !ignoredFieldKeys.has(entity.key),\n ),\n }))\n .filter((section) => section.entities.length > 0);\n });\n readonly editableFormConfig = computed<DynamicFormConfig | null>(() => {\r\n const config = this.formConfig();\r\n if (!config) return null;\r\n\r\n const previewFieldKeys = new Set(this.previewFieldKeys());\r\n\r\n return {\r\n ...config,\r\n sections: config.sections\r\n .map((section) => ({\r\n ...section,\r\n fields: section.fields.filter(\r\n (field) => !field.key || !previewFieldKeys.has(field.key),\r\n ),\r\n }))\r\n .filter((section) =>\r\n section.fields.some((field) => field.type !== 'spacer'),\r\n ),\r\n };\r\n });\r\n readonly stepSections = computed(\r\n () => this.editableFormConfig()?.sections ?? [],\r\n );\r\n readonly hasEditableFormSections = computed(\r\n () => this.stepSections().length > 0,\r\n );\r\n readonly effectiveRenderMode = computed<'form' | 'steps' | 'tabs'>(() => {\r\n const explicitRenderMode = this.renderMode();\r\n if (explicitRenderMode) return explicitRenderMode;\r\n\r\n const configRenderMode = this.state.formConfiguration()?.renderMode;\r\n if (configRenderMode === 'steps' || configRenderMode === 'tabs') {\r\n return configRenderMode;\r\n }\r\n\r\n return 'form';\r\n });\r\n readonly stepsEnabled = computed(\r\n () =>\r\n this.effectiveRenderMode() === 'steps' && this.stepSections().length > 1,\r\n );\r\n readonly tabsEnabled = computed(\r\n () =>\r\n this.effectiveRenderMode() === 'tabs' && this.stepSections().length > 1,\r\n );\r\n readonly sectionNavigationEnabled = computed(\r\n () => this.stepsEnabled() || this.tabsEnabled(),\r\n );\r\n readonly tabOptions = computed<OptionItem[]>(() =>\r\n this.stepSections().map((section, index) => ({\r\n label: section.label || `Tab ${index + 1}`,\r\n value: index + 1,\r\n })),\r\n );\r\n readonly stepTimeline = computed<StepTimelineItem[]>(() => {\r\n const sections = this.stepSections();\r\n const currentStep = this.currentStep();\r\n\r\n return sections.map((section, index) => {\r\n const value = index + 1;\r\n const state = this.resolveStepTimelineState(value, currentStep);\r\n\r\n return {\r\n key: section.key || `section-${index}`,\r\n label: section.label || `Step ${value}`,\r\n value,\r\n state,\r\n selected: value === currentStep,\r\n beforeLineActive: index > 0 && value <= currentStep,\r\n afterLineActive: index < sections.length - 1 && value < currentStep,\r\n };\r\n });\r\n });\r\n readonly visibleSectionKeys = computed(() => {\r\n if (!this.sectionNavigationEnabled()) return null;\r\n\r\n const currentIndex = this.currentStep() - 1;\r\n const activeSection = this.stepSections()[currentIndex];\r\n\r\n if (!activeSection) return null;\r\n\r\n return [activeSection.key || `section-${currentIndex}`];\r\n });\r\n readonly forcedHiddenFieldKeys = computed(() => {\r\n if (!this.sectionNavigationEnabled()) return [];\r\n\r\n const sections = this.stepSections();\r\n const currentIndex = this.currentStep() - 1;\r\n const hiddenFieldKeys = new Set<string>();\r\n\r\n sections.forEach((section, index) => {\r\n if (index === currentIndex) return;\r\n section.fields\r\n .map((field) => field.key)\r\n .filter((key): key is string => !!key)\r\n .forEach((key) => hiddenFieldKeys.add(key));\r\n });\r\n\r\n return [...hiddenFieldKeys];\r\n });\r\n readonly effectiveForcedHiddenFieldKeys = computed(() => {\r\n return [\r\n ...new Set([...this.forcedHiddenFieldKeys(), ...this.ignoredFieldKeys()]),\r\n ];\r\n });\r\n readonly footerLoading = computed(() => {\r\n return (\r\n this.state.loading() ||\r\n (this.autoLoad() &&\r\n !this.hasStartedLoad() &&\r\n !this.state.isLoaded() &&\r\n !this.state.error())\r\n );\r\n });\r\n readonly footerState = computed<ClientFormFooterState>(() => {\r\n const loading = this.footerLoading();\r\n const isLoaded = this.state.isLoaded();\r\n const renderMode = this.effectiveRenderMode();\r\n const stepNavigationEnabled = this.stepsEnabled();\r\n const sectionNavigationEnabled = this.sectionNavigationEnabled();\r\n const currentStep = this.currentStep();\r\n const stepCount = this.stepSections().length;\r\n const canGoToPreviousStep = stepNavigationEnabled && currentStep > 1;\r\n const canGoToNextStep = stepNavigationEnabled && currentStep < stepCount;\r\n\r\n return {\r\n loading,\r\n isLoaded,\r\n renderMode,\r\n actionMode: loading\r\n ? 'loading'\r\n : stepNavigationEnabled\r\n ? 'steps'\r\n : 'submit',\r\n stepNavigationEnabled,\r\n sectionNavigationEnabled,\r\n currentStep,\r\n stepCount,\r\n canGoToPreviousStep,\r\n canGoToNextStep,\r\n showPreviousStep: stepNavigationEnabled,\r\n showNextStep: stepNavigationEnabled && canGoToNextStep,\r\n showSubmit:\r\n isLoaded && !loading && (!stepNavigationEnabled || !canGoToNextStep),\r\n };\r\n });\r\n\r\n // ============================================================================\r\n // Effects\r\n // ============================================================================\r\n\r\n constructor() {\r\n // Auto-load when inputs are ready\r\n effect(() => {\r\n const autoLoad = this.autoLoad();\r\n const moduleKey = this.moduleKey();\r\n const operationKey = this.operationKey();\r\n\r\n if (autoLoad && moduleKey && operationKey) {\r\n untracked(() => this.load());\r\n }\r\n });\r\n\r\n // Patch form values after load\r\n effect(() => {\r\n const values = this.initialValues();\r\n const isLoaded = this.state.isLoaded();\r\n\r\n if (isLoaded && Object.keys(values).length > 0) {\r\n untracked(() => {\r\n this.formControl.patchValue(values, { emitEvent: false });\r\n });\r\n }\r\n });\r\n\r\n effect(() => {\r\n const count = this.stepSections().length;\r\n const current = this.currentStep();\r\n\r\n if (count === 0) {\r\n if (current !== 1) this.currentStep.set(1);\r\n return;\r\n }\r\n\r\n if (current < 1 || current > count) {\r\n this.currentStep.set(1);\r\n }\r\n });\r\n\r\n effect(() => {\r\n const footerState = this.footerState();\r\n\r\n untracked(() => {\r\n this.footerStateChanged.emit(footerState);\r\n });\r\n });\r\n }\r\n\r\n // ============================================================================\r\n // Public API (accessed via viewChild)\r\n // ============================================================================\r\n\r\n /**\r\n * Load form configuration from the API.\r\n * Builds request from current input values.\r\n */\r\n load(): void {\r\n if (this.state.loading()) return;\r\n\r\n this.loadSub?.unsubscribe();\r\n this.hasStartedLoad.set(true);\r\n this.runtimeMessages.set([]);\r\n this.state.loading.set(true);\r\n this.state.error.set(null);\r\n this.state.submitResponse.set(null);\r\n\r\n const request = this.buildLoadRequest();\r\n\r\n this.loadSub = this.api.load(request).subscribe({\r\n next: (response) => {\r\n this.state.loading.set(false);\r\n\r\n if (response.data) {\r\n this.state.setLoadResponse(response.data);\r\n this.loaded.emit(response.data);\r\n\r\n if (response.data.mode) {\r\n this.modeDetected.emit(response.data.mode);\r\n }\r\n\r\n if (response.data.formSource) {\r\n this.formSourceDetected.emit(response.data.formSource);\r\n }\r\n } else {\r\n const msg = response.message ?? 'Failed to load form';\r\n this.state.setError(msg);\r\n this.errored.emit(msg);\r\n }\r\n },\r\n error: (err) => {\r\n const msg =\r\n err?.error?.message ?? err?.message ?? 'Failed to load form';\r\n this.state.setError(msg);\r\n this.errored.emit(msg);\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Submit the current form values.\r\n * Builds submit request from form value + load context.\r\n */\r\n submit(): void {\r\n if (this.state.submitting()) return;\r\n const loadResponse = this.state.loadResponse();\r\n if (!loadResponse) {\r\n const msg = 'Form must be loaded before submit';\r\n this.state.submitError.set(msg);\r\n this.errored.emit(msg);\r\n return;\r\n }\r\n\r\n this.submitSub?.unsubscribe();\r\n this.state.submitting.set(true);\r\n this.state.submitError.set(null);\r\n\r\n const request = this.buildSubmitRequest(loadResponse);\r\n\r\n this.submitSub = this.api.submit(request).subscribe({\r\n next: (response) => {\r\n this.state.submitting.set(false);\r\n\r\n if (response.data) {\r\n this.state.setSubmitResponse(response.data);\r\n this.submitted.emit(response.data);\r\n } else {\r\n const msg = response.message ?? 'Failed to submit form';\r\n this.state.setSubmitError(msg);\r\n this.errored.emit(msg);\r\n }\r\n },\r\n error: (err) => {\r\n const msg =\r\n err?.error?.message ?? err?.message ?? 'Failed to submit form';\r\n this.state.setSubmitError(msg);\r\n this.errored.emit(msg);\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Get the current form value as a flat key-value object.\r\n */\r\n getFormValue(): Record<string, any> {\r\n return this.formControl.value ?? {};\r\n }\r\n\r\n /**\r\n * Get the current form value mapped to submit payload format.\r\n */\r\n getSubmitFields(): ProcessFormSubmitField[] {\r\n const loadResponse = this.state.loadResponse();\r\n if (!loadResponse) return [];\r\n return mapFormValueToSubmitFields(this.getFormValue(), loadResponse);\r\n }\r\n\r\n /**\r\n * Backward-compatible alias for consumers still using the previous helper name.\r\n */\r\n getSubmitValues(): ProcessFormSubmitField[] {\r\n return this.getSubmitFields();\r\n }\r\n\r\n /**\r\n * Check whether the current form state is valid.\r\n */\r\n isValid(): boolean {\r\n return this.formControl.valid;\r\n }\r\n\r\n /**\r\n * Reset the component to its initial state.\r\n */\r\n reset(): void {\r\n this.loadSub?.unsubscribe();\r\n this.submitSub?.unsubscribe();\r\n this.formControl.reset({});\r\n this.runtimeMessages.set([]);\r\n this.state.reset();\r\n }\r\n\r\n onRuntimeMessagesChange(messages: FormulaRuntimeMessage[]): void {\r\n this.runtimeMessages.set(messages ?? []);\r\n }\r\n\r\n onStepChange(value: number): void {\r\n const count = this.stepSections().length;\r\n if (value < 1 || value > count) return;\r\n this.currentStep.set(value);\r\n }\r\n\r\n goToPreviousStep(): void {\r\n this.onStepChange(this.currentStep() - 1);\r\n }\r\n\r\n goToNextStep(): void {\r\n this.onStepChange(this.currentStep() + 1);\r\n }\r\n\r\n canGoToPreviousStep(): boolean {\r\n return this.stepsEnabled() && this.currentStep() > 1;\r\n }\r\n\r\n canGoToNextStep(): boolean {\r\n return (\r\n this.stepsEnabled() && this.currentStep() < this.stepSections().length\r\n );\r\n }\r\n\r\n getCurrentStep(): number {\r\n return this.currentStep();\r\n }\r\n\r\n getStepCount(): number {\r\n return this.stepSections().length;\r\n }\r\n\r\n isStepNavigationEnabled(): boolean {\r\n return this.stepsEnabled();\r\n }\r\n\r\n isSectionNavigationEnabled(): boolean {\r\n return this.sectionNavigationEnabled();\r\n }\r\n\r\n isFooterLoading(): boolean {\r\n return this.footerState().loading;\r\n }\r\n\r\n getResolvedRenderMode(): ClientFormResolvedRenderMode {\r\n return this.footerState().renderMode;\r\n }\r\n\r\n getFooterState(): ClientFormFooterState {\r\n return this.footerState();\r\n }\r\n\r\n // ============================================================================\r\n // Lifecycle\r\n // ============================================================================\r\n\r\n ngOnDestroy(): void {\r\n this.loadSub?.unsubscribe();\r\n this.submitSub?.unsubscribe();\r\n }\r\n\r\n // ============================================================================\r\n // Private Helpers\r\n // ============================================================================\r\n\r\n private buildLoadRequest(): ProcessFormLoadRequest {\r\n const req: ProcessFormLoadRequest = {\r\n moduleKey: this.moduleKey(),\r\n operationKey: this.operationKey(),\r\n };\r\n\r\n const moduleId = this.moduleId();\r\n const levelId = this.levelId();\r\n const levelDataId = this.levelDataId();\r\n const moduleDataId = this.moduleDataId();\r\n const requestSchemaId = this.requestSchemaId();\r\n const draftProcessId = this.draftProcessId();\r\n const preview = this.preview();\r\n\r\n if (moduleId != null) req.moduleId = moduleId;\r\n if (levelId != null) req.levelId = levelId;\r\n if (levelDataId != null) req.levelDataId = levelDataId;\r\n if (moduleDataId != null) req.moduleDataId = moduleDataId;\r\n if (requestSchemaId != null) req.requestSchemaId = requestSchemaId;\r\n if (draftProcessId != null) req.draftProcessId = draftProcessId;\r\n if (preview) req.preview = preview;\r\n\r\n return req;\r\n }\r\n\r\n private buildSubmitRequest(\r\n loadResponse: ProcessFormLoadResponse,\r\n ): ProcessFormSubmitRequest {\r\n const context = this.state.context();\r\n const formValue = this.getFormValue();\r\n const fields: ProcessFormSubmitField[] = mapFormValueToSubmitFields(\r\n formValue,\r\n loadResponse,\r\n );\r\n\r\n const req: ProcessFormSubmitRequest = {\r\n moduleKey: this.moduleKey() ?? context?.moduleKey,\r\n operationKey: this.operationKey() ?? context?.operationKey,\r\n fields,\r\n };\r\n\r\n const moduleId = context?.moduleId ?? this.moduleId();\r\n const levelId = context?.levelId ?? this.levelId();\r\n const levelDataId = context?.levelDataId ?? this.levelDataId();\r\n const moduleDataId = context?.moduleDataId ?? this.moduleDataId();\r\n const requestSchemaId = context?.requestSchemaId ?? this.requestSchemaId();\r\n const recordId =\r\n moduleDataId ??\r\n (req.moduleKey === 'LevelData' && req.operationKey !== 'Create'\r\n ? levelDataId\r\n : undefined);\r\n const returnUrl = this.returnUrl();\r\n\r\n if (moduleId != null) req.moduleId = moduleId;\r\n if (levelId != null) req.levelId = levelId;\r\n if (levelDataId != null) req.levelDataId = levelDataId;\r\n if (moduleDataId != null) req.moduleDataId = moduleDataId;\r\n if (recordId != null) req.recordId = recordId;\r\n if (requestSchemaId != null) req.requestSchemaId = requestSchemaId;\r\n if (returnUrl) req.returnUrl = returnUrl;\r\n\r\n const submitRequestMapper = this.submitRequestMapper();\r\n if (!submitRequestMapper) {\r\n return req;\r\n }\r\n\r\n return submitRequestMapper(req, {\r\n formValue,\r\n loadResponse,\r\n });\r\n }\r\n\r\n private resolveStepTimelineState(\r\n stepValue: number,\r\n currentStep: number,\r\n ): StepTimelineState {\r\n if (stepValue < currentStep) {\r\n return 'completed';\r\n }\r\n\r\n if (stepValue === currentStep) {\r\n return 'current';\r\n }\r\n\r\n return 'upcoming';\r\n }\r\n}\r\n","<!-- Client Form Template - render only; step navigation buttons are optional -->\r\n\r\n<!-- Loading State -->\r\n@if (state.loading()) {\r\n <div class=\"flex flex-col gap-6\">\r\n <!-- Section header skeleton -->\r\n <div class=\"flex flex-col gap-4\">\r\n <p-skeleton width=\"30%\" height=\"1.5rem\" />\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"40%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"40%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-12 flex flex-col gap-2\">\r\n <p-skeleton width=\"25%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"35%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"45%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Second section skeleton -->\r\n <div class=\"flex flex-col gap-4\">\r\n <p-skeleton width=\"25%\" height=\"1.5rem\" />\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"35%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-6 flex flex-col gap-2\">\r\n <p-skeleton width=\"50%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" />\r\n </div>\r\n <div class=\"col-span-12 flex flex-col gap-2\">\r\n <p-skeleton width=\"30%\" height=\"0.875rem\" />\r\n <p-skeleton width=\"100%\" height=\"5rem\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n\r\n<!-- Loaded State -->\r\n@if (state.isLoaded() && !state.loading()) {\r\n <div class=\"flex flex-col gap-4\">\n @if (previewEntitySections().length > 0) {\n <div class=\"flex flex-col gap-6\">\n @for (section of previewEntitySections(); track section.key) {\n <div class=\"flex flex-col gap-4\">\n @if (section.label) {\n <h3\n class=\"text-lg font-semibold text-color border-b-2 border-gray-200 pb-2 mb-3\"\n >\n {{ section.label }}\n </h3>\n }\n <mt-entities-preview [entities]=\"section.entities\" />\n </div>\n }\n </div>\n }\n\r\n <!-- Dynamic Form -->\r\n @if (state.requiresForm() && editableFormConfig(); as config) {\r\n @if (hasEditableFormSections()) {\r\n <div class=\"flex flex-col gap-4\">\r\n @if (runtimeErrors().length > 0 || runtimeWarnings().length > 0) {\r\n <div class=\"rounded-lg border border-surface-200 p-4 bg-surface-50\">\r\n @if (runtimeErrors().length > 0) {\r\n <div class=\"mb-3\">\r\n <h4 class=\"text-sm font-semibold text-red-600 mb-2\">\r\n Validation Errors\r\n </h4>\r\n <ul class=\"list-disc ps-5 text-sm text-red-600 space-y-1\">\r\n @for (\r\n msg of runtimeErrors();\r\n track msg.ruleId || msg.fieldKey || msg.message\r\n ) {\r\n <li>{{ msg.message }}</li>\r\n }\r\n </ul>\r\n </div>\r\n }\r\n\r\n @if (runtimeWarnings().length > 0) {\r\n <div>\r\n <h4 class=\"text-sm font-semibold text-amber-600 mb-2\">\r\n Validation Warnings\r\n </h4>\r\n <ul class=\"list-disc ps-5 text-sm text-amber-700 space-y-1\">\r\n @for (\r\n msg of runtimeWarnings();\r\n track msg.ruleId || msg.fieldKey || msg.message\r\n ) {\r\n <li>{{ msg.message }}</li>\r\n }\r\n </ul>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (stepsEnabled()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"overflow-x-auto pb-2\">\r\n <div class=\"flex min-w-[36rem] items-start\">\r\n @for (\r\n step of stepTimeline();\r\n track step.key;\r\n let first = $first;\r\n let last = $last\r\n ) {\r\n <div\r\n class=\"relative flex min-w-[8rem] flex-1 justify-center\"\r\n >\r\n @if (!rtl() && !first) {\r\n <span\r\n class=\"absolute top-5 left-0 right-1/2 h-0.5\"\r\n [ngClass]=\"\r\n step.beforeLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (!rtl() && !last) {\r\n <span\r\n class=\"absolute top-5 left-1/2 right-0 h-0.5\"\r\n [ngClass]=\"\r\n step.afterLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (rtl() && !last) {\r\n <span\r\n class=\"absolute top-5 left-0 right-1/2 h-0.5\"\r\n [ngClass]=\"\r\n step.afterLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n @if (rtl() && !first) {\r\n <span\r\n class=\"absolute top-5 left-1/2 right-0 h-0.5\"\r\n [ngClass]=\"\r\n step.beforeLineActive\r\n ? 'bg-primary'\r\n : 'bg-surface-300'\r\n \"\r\n ></span>\r\n }\r\n\r\n <button\r\n type=\"button\"\r\n class=\"relative z-10 flex w-full flex-col items-center gap-3 px-2 text-center focus-visible:outline-none\"\r\n [attr.aria-pressed]=\"step.selected\"\r\n [attr.aria-current]=\"\r\n step.state === 'current' ? 'step' : null\r\n \"\r\n [attr.title]=\"step.label\"\r\n (click)=\"onStepChange(step.value)\"\r\n >\r\n <span\r\n class=\"flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border text-sm font-semibold transition-all duration-200\"\r\n [ngClass]=\"{\r\n 'border-primary bg-primary text-surface-0 ring-4 ring-primary/10':\r\n step.state === 'completed' ||\r\n step.state === 'current',\r\n\r\n 'border-surface-300 bg-white text-surface-500':\r\n step.state === 'upcoming',\r\n }\"\r\n >\r\n {{ step.value }}\r\n </span>\r\n <span\r\n class=\"max-w-[8rem] text-center text-sm leading-5 transition-colors duration-200\"\r\n [ngClass]=\"{\r\n 'font-semibold text-primary':\r\n step.selected || step.state === 'current',\r\n 'font-medium text-surface-700':\r\n step.state === 'completed' && !step.selected,\r\n 'font-medium text-surface-500':\r\n step.state === 'upcoming',\r\n }\"\r\n dir=\"auto\"\r\n >\r\n {{ step.label }}\r\n </span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (showInternalStepActions()) {\n <div class=\"flex justify-between gap-2\">\n <mt-button\n label=\"Previous\"\n severity=\"secondary\"\n variant=\"outlined\"\n [disabled]=\"currentStep() === 1\"\n (onClick)=\"goToPreviousStep()\"\n />\n <mt-button\n label=\"Next\"\n severity=\"primary\"\n variant=\"outlined\"\n [disabled]=\"currentStep() === stepSections().length\"\n (onClick)=\"goToNextStep()\"\n />\n </div>\n }\n </div>\n }\r\n\r\n @if (tabsEnabled()) {\r\n <mt-tabs\r\n [active]=\"currentStep()\"\r\n (activeChange)=\"onStepChange($event)\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n fluid\r\n />\r\n }\r\n <mt-dynamic-form\r\n [formConfig]=\"config\"\r\n [formControl]=\"formControl\"\r\n [visibleSectionKeys]=\"visibleSectionKeys()\"\r\n [forcedHiddenFieldKeys]=\"effectiveForcedHiddenFieldKeys()\"\r\n [preserveForcedHiddenValues]=\"true\"\r\n (runtimeMessagesChange)=\"onRuntimeMessagesChange($event)\"\r\n />\r\n </div>\r\n }\r\n } @else if (previewEntitySections().length === 0) {\n <div\n class=\"flex items-center justify-center p-6 rounded-lg bg-surface-50 border border-surface-200 border-dashed\"\n >\n <p class=\"text-sm text-muted-color\">\r\n No form required for this operation.\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n}\r\n","// ============================================================================\r\n// API Response Wrapper\r\n// ============================================================================\r\n\r\nexport interface Response<T> {\r\n endpoint: string;\r\n status: number;\r\n code: number;\r\n locale: string;\r\n message?: string | null;\r\n errors?: any | null;\r\n data: T;\r\n cacheSession?: string;\r\n}\r\n\r\n// ============================================================================\r\n// Process Form Mode\r\n// ============================================================================\r\n\r\nexport type ProcessFormMode = 'Approval' | 'Direct';\r\nexport type ProcessFormSubmitStatus = 'PendingApproval' | 'Executed';\r\nexport type OperationType = 'FormOperation' | 'ActionOperation';\r\nexport type ProcessFormSource = 'Step' | 'None';\r\nexport type ClientFormResolvedRenderMode = 'form' | 'steps' | 'tabs';\r\nexport type ClientFormFooterActionMode = 'loading' | 'steps' | 'submit';\r\n\r\nexport interface ClientFormFooterState {\r\n loading: boolean;\r\n isLoaded: boolean;\r\n renderMode: ClientFormResolvedRenderMode;\r\n actionMode: ClientFormFooterActionMode;\r\n stepNavigationEnabled: boolean;\r\n sectionNavigationEnabled: boolean;\r\n currentStep: number;\r\n stepCount: number;\r\n canGoToPreviousStep: boolean;\r\n canGoToNextStep: boolean;\r\n showPreviousStep: boolean;\r\n showNextStep: boolean;\r\n showSubmit: boolean;\r\n}\r\n\r\n// ============================================================================\r\n// Load Request / Response\r\n// ============================================================================\r\n\r\nexport interface ProcessFormLoadRequest {\r\n moduleKey: string;\r\n operationKey: string;\r\n moduleId?: number | string;\r\n levelId?: number | string;\r\n levelDataId?: number | string;\r\n moduleDataId?: number | string;\r\n requestSchemaId?: number;\r\n draftProcessId?: number;\r\n preview?: boolean;\r\n}\r\n\r\nexport interface ProcessFormLoadResponse {\r\n mode: ProcessFormMode;\r\n formSource: ProcessFormSource;\r\n requiresForm: boolean;\r\n requestSchemaId: number | null;\r\n requestId: number | null;\r\n stepId: number | null;\r\n stepSchemaId: number | null;\r\n stepName: string | null;\r\n formConfiguration: ClientFormConfiguration | null;\r\n values: ProcessFormValue[];\r\n context: ProcessFormContext;\r\n}\r\n\r\n// ============================================================================\r\n// Submit Request / Response\r\n// ============================================================================\r\n\r\nexport interface ProcessFormSubmitRequest {\r\n moduleKey: string;\r\n operationKey: string;\r\n moduleId?: number | string;\r\n levelId?: number | string;\r\n levelDataId?: number | string;\r\n moduleDataId?: number | string;\r\n recordId?: number | string;\r\n requestSchemaId?: number;\r\n returnUrl?: string;\r\n fields: ProcessFormSubmitField[];\r\n}\r\n\r\nexport interface ClientFormSubmitRequestMapperContext {\r\n formValue: Record<string, any>;\r\n loadResponse: ProcessFormLoadResponse;\r\n}\r\n\r\nexport type ClientFormSubmitRequestMapper = (\r\n request: ProcessFormSubmitRequest,\r\n context: ClientFormSubmitRequestMapperContext,\r\n) => ProcessFormSubmitRequest;\r\n\r\nexport interface ProcessFormSubmitField {\r\n requestPropertyId?: number;\r\n propertyKey: string;\r\n value: any;\r\n}\r\n\r\nexport type ProcessFormSubmitValue = ProcessFormSubmitField;\r\n\r\nexport interface ProcessFormSubmitResponse {\r\n status: ProcessFormSubmitStatus;\r\n moduleKey: string;\r\n operationKey: string;\r\n recordId: number | null;\r\n levelId: number | null;\r\n levelDataId: number | null;\r\n requestSchemaId?: number | null;\r\n requestId?: number | null;\r\n resultModuleKey?: string | null;\r\n resultModuleId?: number | null;\r\n record?: ProcessFormSubmitRecord | null;\r\n}\r\n\r\nexport interface ProcessFormSubmitRecord {\r\n fields: ProcessFormSubmitRecordField[];\r\n}\r\n\r\nexport interface ProcessFormSubmitRecordField {\r\n id: number;\r\n key: string;\r\n normalizedKey: string;\r\n label: string;\r\n viewType: string;\r\n configuration: Record<string, unknown> | null;\r\n source: string;\r\n order: number;\r\n isRequired: boolean;\r\n isSystem: boolean;\r\n raw: any;\r\n value: any;\r\n display?: string | null;\r\n}\r\n\r\n// ============================================================================\r\n// Values & Context\r\n// ============================================================================\r\n\r\nexport interface ProcessFormValue {\r\n propertyKey: string;\r\n rawValue?: any;\r\n value: any;\r\n metadata?: ProcessFormValueMetadata;\r\n}\r\n\r\nexport interface ProcessFormValueMetadata {\r\n propertyId: number;\r\n key: string;\r\n viewType: string;\r\n source: string;\r\n}\r\n\r\nexport interface ProcessFormContext {\r\n moduleKey: string;\r\n operationKey: string;\r\n moduleId: number | null;\r\n levelId: number | null;\r\n levelDataId: number | null;\r\n moduleDataId: number | null;\r\n requestSchemaId: number | null;\r\n requestId: number | null;\r\n stepId: number | null;\r\n stepSchemaId: number | null;\r\n preview: boolean;\r\n}\r\n\r\n// ============================================================================\r\n// Form Configuration (runtime shape — no _pending/_deleting)\r\n// ============================================================================\r\n\r\nexport type ClientFieldWidth = '25' | '50' | '100';\r\nexport type ClientFormRenderMode = 'sections' | 'steps' | 'tabs';\r\n\r\nexport interface ClientFormConfiguration {\r\n isActive?: boolean;\r\n renderMode?: ClientFormRenderMode;\r\n sections: ClientFormSection[];\r\n validations?: ClientValidationRule[];\r\n}\r\n\r\nexport interface ClientFormSection {\r\n id: string;\r\n name: {\r\n en: string;\r\n ar: string;\r\n };\r\n order: number;\r\n fields: ClientFormField[];\r\n}\r\n\r\nexport interface ClientFormField {\r\n id: string;\r\n sectionId: string;\r\n propertyKey: string;\r\n /** Runtime property metadata returned by the API */\r\n propertyMetadata: ClientPropertyItem;\r\n width: ClientFieldWidth;\r\n order: number;\r\n hiddenInCreation?: boolean;\r\n hiddenInEditForm?: boolean;\r\n isRequired?: boolean;\r\n isRead?: boolean;\r\n isWrite?: boolean;\r\n showConditionalDisplayFormula?: boolean;\r\n conditionalDisplayFormula?: string;\r\n}\r\n\r\nexport interface ClientPropertyItem {\r\n key: string;\r\n propertyId?: number;\r\n isCalculated?: boolean;\r\n name:\r\n | string\r\n | {\r\n display?: string;\r\n en?: string;\r\n ar?: string;\r\n [k: string]: string | undefined;\r\n };\r\n viewType?: string;\r\n source?: string;\r\n configuration?: Record<string, unknown> | null;\r\n [key: string]: any;\r\n}\r\n\r\nexport interface ClientValidationRule {\r\n id: string | number;\r\n formulaTokens: string;\r\n formulaText: string;\r\n message: {\r\n en: string;\r\n ar: string;\r\n };\r\n severity: 'error' | 'warning';\r\n enabled: boolean;\r\n}\r\n\r\n// ============================================================================\r\n// Lookup Definitions (passed as input to ClientForm)\r\n// ============================================================================\r\n\r\nexport interface ClientLookup {\r\n id: number;\r\n key: string;\r\n name: { display?: string; ar?: string; en?: string };\r\n items: ClientLookupItem[];\r\n}\r\n\r\nexport interface ClientLookupItem {\r\n id: number;\r\n lookupId: number;\r\n key: string;\r\n name: { display?: string; ar?: string; en?: string };\r\n description?: { display?: string; ar?: string; en?: string };\r\n color?: string;\r\n order: number;\r\n}\r\n\r\n// ============================================================================\r\n// Legacy Command Interception\r\n// ============================================================================\r\n\r\nexport interface FormRequiredInterception {\r\n requestSchemaId: number;\r\n operationType: OperationType;\r\n status: 'FormRequired';\r\n message: string;\r\n levelId: number;\r\n levelDataId: number;\r\n moduleDataId: number;\r\n}\r\n\r\n/**\r\n * Type guard to detect a FormRequired interception response from legacy commands.\r\n * Use in HTTP interceptors to redirect to process-form runtime flow.\r\n */\r\nexport function isFormRequiredInterception(\r\n response: any,\r\n): response is FormRequiredInterception {\r\n return (\r\n response?.status === 'FormRequired' &&\r\n typeof response?.requestSchemaId === 'number'\r\n );\r\n}\r\n","// Client Form - Runtime process form component\r\nexport * from './client-form';\r\nexport * from './models/client-form.model';\r\nexport * from './services/client-form-api.service';\r\nexport * from './services/client-form-state.service';\r\nexport * from './utils/form-config-mapper';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAYA;;;AAGG;MAEU,oBAAoB,CAAA;AACd,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AAE1C;;;AAGG;AACH,IAAA,IAAI,CACF,OAA+B,EAAA;QAE/B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CACnB,mBAAmB,EACnB,OAAO,CACR;IACH;AAEA;;;;AAIG;AACH,IAAA,MAAM,CACJ,OAAiC,EAAA;QAEjC,OAAO,IAAI,CA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BAAA,EAAA,4BAAA,EAAA,oBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,uBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACX,IAAI,qLACJ,QAAQ,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,OAAA,EAAA,WAAA,EAAA,cAAA,EAAA,MAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAMC,UAAU,EAAA,UAAA,EAAA,CAAA;kBAhBtB,SAAS;+BACE,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,MAAM;wBACN,eAAe;wBACf,WAAW;wBACX,IAAI;wBACJ,QAAQ;qBACT,EAAA,SAAA,EACU,CAAC,sBAAsB,CAAC,EAAA,QAAA,EAAA,uzVAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AEnGrC;AACA;AACA;AAqRA;;;AAGG;AACG,SAAU,0BAA0B,CACxC,QAAa,EAAA;AAEb,IAAA,QACE,QAAQ,EAAE,MAAM,KAAK,cAAc;AACnC,QAAA,OAAO,QAAQ,EAAE,eAAe,KAAK,QAAQ;AAEjD;;AClSA;;ACAA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masterteam/forms",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/forms",
6
6
  "linkDirectory": true,
@@ -17,7 +17,7 @@
17
17
  "primeng": "21.0.1",
18
18
  "@primeuix/themes": "^2.0.2",
19
19
  "rxjs": "^7.8.2",
20
- "@masterteam/components": "^0.0.112"
20
+ "@masterteam/components": "^0.0.114"
21
21
  },
22
22
  "sideEffects": false,
23
23
  "exports": {
@@ -373,7 +373,12 @@ declare class ClientForm implements OnDestroy {
373
373
  readonly virtualFields: _angular_core.Signal<ProcessFormValue[]>;
374
374
  readonly hasVirtualFields: _angular_core.Signal<boolean>;
375
375
  readonly previewFieldKeys: _angular_core.Signal<string[]>;
376
- readonly previewEntities: _angular_core.Signal<_masterteam_components_entities.EntityData[]>;
376
+ readonly previewEntitySections: _angular_core.Signal<{
377
+ entities: _masterteam_components_entities.EntityData[];
378
+ key: string;
379
+ label: string;
380
+ order: number;
381
+ }[]>;
377
382
  readonly editableFormConfig: _angular_core.Signal<DynamicFormConfig | null>;
378
383
  readonly stepSections: _angular_core.Signal<_masterteam_components.SectionConfig[]>;
379
384
  readonly hasEditableFormSections: _angular_core.Signal<boolean>;
@@ -461,6 +466,12 @@ declare class ClientFormApiService {
461
466
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClientFormApiService>;
462
467
  }
463
468
 
469
+ interface ClientFormPreviewSection {
470
+ key: string;
471
+ label: string;
472
+ order: number;
473
+ entities: EntityData[];
474
+ }
464
475
  /**
465
476
  * Convert a runtime FormConfiguration into a DynamicFormConfig
466
477
  * that can be passed directly to `<mt-dynamic-form>`.
@@ -470,7 +481,7 @@ declare class ClientFormApiService {
470
481
  * @param mode 'create' or 'edit' — filters hidden fields accordingly
471
482
  * @param lookups Available lookup definitions for resolving Lookup/LookupMultiSelect options
472
483
  */
473
- declare function mapToDynamicFormConfig(config: ClientFormConfiguration, lang?: 'en' | 'ar', mode?: 'create' | 'edit', lookups?: ClientLookup[], context?: ProcessFormContext | null): DynamicFormConfig;
484
+ declare function mapToDynamicFormConfig(config: ClientFormConfiguration, lang?: 'en' | 'ar', mode?: 'create' | 'edit', lookups?: ClientLookup[], context?: ProcessFormContext | null, readonly?: boolean): DynamicFormConfig;
474
485
  /**
475
486
  * Convert API property values into a flat key-value object
476
487
  * suitable for `formControl.patchValue()`.
@@ -485,8 +496,9 @@ declare function mapValuesToFormValue(values: ProcessFormValue[], config?: Clien
485
496
  * to map `requestPropertyId` and `viewType`.
486
497
  */
487
498
  declare function mapFormValueToSubmitFields(formValue: Record<string, any>, loadResponse: ProcessFormLoadResponse): ProcessFormSubmitField[];
488
- declare function getPreviewOnlyFieldKeys(config: ClientFormConfiguration, mode?: 'create' | 'edit'): string[];
489
- declare function mapPreviewFieldsToEntities(config: ClientFormConfiguration, values: ProcessFormValue[], mode?: 'create' | 'edit'): EntityData[];
499
+ declare function getPreviewOnlyFieldKeys(config: ClientFormConfiguration, mode?: 'create' | 'edit', readonly?: boolean): string[];
500
+ declare function mapPreviewFieldsToEntities(config: ClientFormConfiguration, values: ProcessFormValue[], mode?: 'create' | 'edit', readonly?: boolean): EntityData[];
501
+ declare function mapPreviewSectionsToEntities(config: ClientFormConfiguration, values: ProcessFormValue[], lang?: 'en' | 'ar', mode?: 'create' | 'edit', readonly?: boolean): ClientFormPreviewSection[];
490
502
 
491
- export { ClientForm, ClientFormApiService, ClientFormStateService, getPreviewOnlyFieldKeys, isFormRequiredInterception, mapFormValueToSubmitFields, mapPreviewFieldsToEntities, mapToDynamicFormConfig, mapValuesToFormValue };
492
- export type { ClientFieldWidth, ClientFormConfiguration, ClientFormField, ClientFormFooterActionMode, ClientFormFooterState, ClientFormRenderMode, ClientFormResolvedRenderMode, ClientFormSection, ClientFormSubmitRequestMapper, ClientFormSubmitRequestMapperContext, ClientLookup, ClientLookupItem, ClientPropertyItem, ClientValidationRule, FormRequiredInterception, OperationType, ProcessFormContext, ProcessFormLoadRequest, ProcessFormLoadResponse, ProcessFormMode, ProcessFormSource, ProcessFormSubmitField, ProcessFormSubmitRecord, ProcessFormSubmitRecordField, ProcessFormSubmitRequest, ProcessFormSubmitResponse, ProcessFormSubmitStatus, ProcessFormSubmitValue, ProcessFormValue, ProcessFormValueMetadata, Response };
503
+ export { ClientForm, ClientFormApiService, ClientFormStateService, getPreviewOnlyFieldKeys, isFormRequiredInterception, mapFormValueToSubmitFields, mapPreviewFieldsToEntities, mapPreviewSectionsToEntities, mapToDynamicFormConfig, mapValuesToFormValue };
504
+ export type { ClientFieldWidth, ClientFormConfiguration, ClientFormField, ClientFormFooterActionMode, ClientFormFooterState, ClientFormPreviewSection, ClientFormRenderMode, ClientFormResolvedRenderMode, ClientFormSection, ClientFormSubmitRequestMapper, ClientFormSubmitRequestMapperContext, ClientLookup, ClientLookupItem, ClientPropertyItem, ClientValidationRule, FormRequiredInterception, OperationType, ProcessFormContext, ProcessFormLoadRequest, ProcessFormLoadResponse, ProcessFormMode, ProcessFormSource, ProcessFormSubmitField, ProcessFormSubmitRecord, ProcessFormSubmitRecordField, ProcessFormSubmitRequest, ProcessFormSubmitResponse, ProcessFormSubmitStatus, ProcessFormSubmitValue, ProcessFormValue, ProcessFormValueMetadata, Response };