@3ddv/software-division-components 2.0.14 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/backoffice/datepicker/datepicker.component.css +262 -0
- package/fesm2022/3ddv-software-division-components-dvm-cart.mjs +18 -6
- package/fesm2022/3ddv-software-division-components-dvm-cart.mjs.map +1 -1
- package/fesm2022/3ddv-software-division-components-dvm-loader.mjs +18 -4
- package/fesm2022/3ddv-software-division-components-dvm-loader.mjs.map +1 -1
- package/fesm2022/3ddv-software-division-components-dvm-map-loader.mjs +26 -9
- package/fesm2022/3ddv-software-division-components-dvm-map-loader.mjs.map +1 -1
- package/fesm2022/3ddv-software-division-components-dvm-neighbors.mjs +41 -42
- package/fesm2022/3ddv-software-division-components-dvm-neighbors.mjs.map +1 -1
- package/fesm2022/3ddv-software-division-components-dvm-popover.mjs +2 -1
- package/fesm2022/3ddv-software-division-components-dvm-popover.mjs.map +1 -1
- package/fesm2022/3ddv-software-division-components-generic-button.mjs +3 -2
- package/fesm2022/3ddv-software-division-components-generic-button.mjs.map +1 -1
- package/fesm2022/3ddv-software-division-components-generic-dialog.mjs +173 -19
- package/fesm2022/3ddv-software-division-components-generic-dialog.mjs.map +1 -1
- package/fesm2022/3ddv-software-division-components-generic-icon.mjs +45 -19
- package/fesm2022/3ddv-software-division-components-generic-icon.mjs.map +1 -1
- package/fesm2022/3ddv-software-division-components-generic-select.mjs +67 -23
- package/fesm2022/3ddv-software-division-components-generic-select.mjs.map +1 -1
- package/fesm2022/3ddv-software-division-components-generic-tooltip.mjs +136 -0
- package/fesm2022/3ddv-software-division-components-generic-tooltip.mjs.map +1 -0
- package/fesm2022/3ddv-software-division-components.mjs +14 -8
- package/fesm2022/3ddv-software-division-components.mjs.map +1 -1
- package/generic/braintree/braintree.component.css +7 -0
- package/host-tailwind-layer.css +7 -0
- package/package.json +81 -6
- package/shared/themes/sdc.css +68 -0
- package/styles.css +1 -1
- package/types/3ddv-software-division-components-dvm-cart.d.ts +20 -3
- package/types/3ddv-software-division-components-dvm-loader.d.ts +12 -5
- package/types/3ddv-software-division-components-dvm-map-loader.d.ts +3 -3
- package/types/3ddv-software-division-components-dvm-neighbors.d.ts +12 -6
- package/types/3ddv-software-division-components-generic-button.d.ts +2 -1
- package/types/3ddv-software-division-components-generic-dialog.d.ts +121 -49
- package/types/3ddv-software-division-components-generic-icon.d.ts +8 -2
- package/types/3ddv-software-division-components-generic-select.d.ts +12 -5
- package/types/3ddv-software-division-components-generic-tooltip.d.ts +25 -0
- package/types/3ddv-software-division-components.d.ts +10 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3ddv-software-division-components-generic-button.mjs","sources":["../../generic/button/ui/ui-button-helm/src/lib/hlm-button.token.ts","../../generic/button/ui/ui-button-helm/src/lib/hlm-button.ts","../../generic/button/ui/ui-button-helm/src/index.ts","../../generic/button/button.component.ts","../../generic/button/button.component.html","../../generic/button/public-api.ts","../../generic/button/3ddv-software-division-components-generic-button.ts"],"sourcesContent":["import { InjectionToken, ValueProvider, inject } from '@angular/core';\nimport type { ButtonVariants } from './hlm-button';\n\nexport interface BrnButtonConfig {\n\tvariant: ButtonVariants['variant'];\n\tsize: ButtonVariants['size'];\n}\n\nconst defaultConfig: BrnButtonConfig = {\n\tvariant: 'default',\n\tsize: 'default',\n};\n\nconst BrnButtonConfigToken = new InjectionToken<BrnButtonConfig>('BrnButtonConfig');\n\nexport function provideBrnButtonConfig(config: Partial<BrnButtonConfig>): ValueProvider {\n\treturn { provide: BrnButtonConfigToken, useValue: { ...defaultConfig, ...config } };\n}\n\nexport function injectBrnButtonConfig(): BrnButtonConfig {\n\treturn inject(BrnButtonConfigToken, { optional: true }) ?? defaultConfig;\n}\n","import { Directive, computed, input, signal } from '@angular/core';\nimport { hlm } from '@spartan-ng/brain/core';\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport type { ClassValue } from 'clsx';\nimport { injectBrnButtonConfig } from './hlm-button.token';\n\nexport const buttonVariants = cva(\n 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_ng-icon]:pointer-events-none shrink-0 [&_ng-icon]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-default',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',\n destructive:\n 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',\n outline: 'border bg-background shadow-xs dark:bg-input/30 dark:border-input dark:hover:bg-input/50',\n secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>ng-icon]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>ng-icon]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>ng-icon]:px-4',\n icon: 'size-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nexport type ButtonVariants = VariantProps<typeof buttonVariants>;\n\n@Directive({\n selector: '[hlmBtn]',\n standalone: true,\n exportAs: 'hlmBtn',\n host: {\n '[class]': '_computedClass()',\n },\n})\nexport class HlmButton {\n private readonly _config = injectBrnButtonConfig();\n\n private readonly _additionalClasses = signal<ClassValue>('');\n\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n\n protected readonly _computedClass = computed(() =>\n hlm(buttonVariants({ variant: this.variant(), size: this.size() }), this.userClass(), this._additionalClasses())\n );\n\n public readonly variant = input<ButtonVariants['variant']>(this._config.variant);\n\n public readonly size = input<ButtonVariants['size']>(this._config.size);\n\n setClass(classes: string): void {\n this._additionalClasses.set(classes);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { HlmButton } from './lib/hlm-button';\nexport * from './lib/hlm-button';\nexport * from './lib/hlm-button.token';\n\n@NgModule({\n\timports: [HlmButton],\n\texports: [HlmButton],\n})\nexport class HlmButtonModule {}\n","import { Size, SIZES, ThemeClass } from '@3ddv/software-division-components/shared';\nimport { Component, computed, effect, ElementRef, HostListener, input, output, signal } from '@angular/core';\nimport { Subject, Subscription, takeUntil } from 'rxjs';\nimport { HlmButtonModule } from './ui/ui-button-helm/src';\n\nconst BUTTON_VARIANTS = {\n primary: 'primary',\n secondary: 'secondary',\n 'secondary-blue': 'secondary-blue',\n accent: 'accent',\n alternative: 'alternative',\n warning: 'warning',\n success: 'success',\n outline: 'outline',\n destructive: 'destructive',\n 'primary-light': 'primary-light',\n 'alternative-light': 'alternative-light',\n 'success-muted': 'success-muted',\n 'accent-light': 'accent-light',\n 'warning-light': 'warning-light',\n 'destructive-light': 'destructive-light',\n 'outline-white': 'outline-white',\n 'outline-alternative': 'outline-alternative',\n 'outline-accent': 'outline-accent',\n link: 'link',\n gray: 'gray',\n white: 'white',\n icon: 'icon',\n} as const;\n\ntype ButtonVariant = (typeof BUTTON_VARIANTS)[keyof typeof BUTTON_VARIANTS];\n\ntype ButtonType = 'button' | 'submit' | 'reset';\n\nexport type ButtonStyleClasses = ReturnType<(typeof ButtonComponent.prototype)['styleClass']>;\n\n/**\n * A customizable button component built on Spartan UI Button.\n *\n * This component supports various configurations and exposes all Spartan UI button functionality.\n * All HTML button attributes and events are automatically forwarded to the inner button element.\n *\n * @since 1.0.0-alpha.1\n * @updated 1.0.0-alpha.3\n */\n@Component({\n selector: 'sdc-button',\n styleUrls: ['./button.component.css'],\n templateUrl: './button.component.html',\n imports: [HlmButtonModule],\n})\nexport class ButtonComponent {\n private readonly allowedVariants = Object.values(BUTTON_VARIANTS).map(v => `variant-${v}` as const);\n private readonly allowedSizes = Object.values(SIZES).map(v => `size-${v}` as const);\n private readonly allowedCircleSizes = [\n 'size-circle-xs',\n 'size-circle-sm',\n 'size-circle-md',\n 'size-circle-lg',\n 'size-circle-xl',\n ] as const;\n private readonly allowedRadius = [\n 'radius-default',\n 'radius-sm',\n 'radius-md',\n 'radius-lg',\n 'radius-xl',\n 'radius-2xl',\n 'radius-full',\n ] as const;\n private readonly allowedBorder = ['border-0', 'border-default', 'border-2', 'border-4', 'border-8'] as const;\n\n /**\n * The current theme applied to the component.\n */\n public readonly theme = input<ThemeClass>('theme-sdc');\n\n /**\n * Predefined styles to apply to the component.\n * Can be a single class or multiple classes from different categories.\n */\n public readonly styleClass = input<\n (\n | (typeof this.allowedVariants)[number]\n | (typeof this.allowedSizes)[number]\n | (typeof this.allowedCircleSizes)[number]\n | (typeof this.allowedRadius)[number]\n | (typeof this.allowedBorder)[number]\n )[]\n >([]);\n\n // Computed signal that validates and filters the styleClass input\n private readonly _validatedStyleClass = computed(() => {\n const value = this.styleClass();\n\n if (!Array.isArray(value)) {\n console.warn('ButtonComponent: styleClass must be an array, defaulting to empty array');\n return [];\n }\n\n const validValues = value.filter(\n style =>\n this.allowedVariants.includes(style as any) ||\n this.allowedSizes.includes(style as any) ||\n this.allowedCircleSizes.includes(style as any) ||\n this.allowedRadius.includes(style as any) ||\n this.allowedBorder.includes(style as any)\n );\n\n const invalidValues = value.filter(\n style =>\n !this.allowedVariants.includes(style as any) &&\n !this.allowedSizes.includes(style as any) &&\n !this.allowedCircleSizes.includes(style as any) &&\n !this.allowedRadius.includes(style as any) &&\n !this.allowedBorder.includes(style as any)\n );\n\n if (invalidValues.length > 0) {\n throw new Error(\n `ButtonComponent: Invalid styleClass values ignored: ${invalidValues.join(', ')}. Allowed values: ${[\n ...this.allowedVariants,\n ...this.allowedSizes,\n ...this.allowedCircleSizes,\n ...this.allowedRadius,\n ...this.allowedBorder,\n ].join(', ')}`\n );\n }\n\n return validValues;\n });\n\n /**\n * Additional classes\n */\n public readonly className = input<string>('');\n\n /**\n * Button component style variant\n */\n public readonly variant = input<ButtonVariant>('primary');\n\n /**\n * Button component size variant\n */\n public readonly size = input<Size>('md');\n\n /**\n * Native button type attribute\n */\n public readonly type = input<ButtonType>('button');\n\n /**\n * Whether the component is disabled.\n */\n public readonly disabled = input<boolean>(false);\n\n /**\n * Whether to enable the ripple effect on the component.\n * Default value is false.\n */\n public readonly ripple = input<boolean>(false);\n\n /**\n * Event emitted when the component is clicked.\n */\n public readonly onClick = output<MouseEvent>();\n\n /**\n * Event emitted when the component receives focus.\n */\n public readonly onFocus = output<FocusEvent>();\n\n /**\n * Event emitted when the component loses focus.\n */\n public readonly onBlur = output<FocusEvent>();\n\n protected readonly _sizeClass = computed(() => {\n const size = SIZES[this.size()];\n\n if (!size) {\n throw new Error(`size must be one of these: ${Object.values(SIZES).join(', ')}}`);\n }\n\n return `size-${size}`;\n });\n\n protected readonly _variantClass = computed(() => {\n const variant = BUTTON_VARIANTS[this.variant()];\n\n if (!variant) {\n throw new Error(`variant must be one of these: ${Object.values(BUTTON_VARIANTS).join(', ')}}`);\n }\n\n return `variant-${variant}`;\n });\n\n /**\n * Computed class string that combines theme and user classes.\n */\n protected readonly computedClass = computed(() => {\n const themeClass = this.theme();\n const styleClass = this._validatedStyleClass();\n const sizeClass = this._sizeClass();\n const variantClass = this._variantClass();\n const className = this.className();\n return Array.from(new Set(['sdc-button', themeClass, sizeClass, variantClass, ...styleClass, className]))\n .filter(Boolean)\n .join(' ');\n });\n\n /**\n * Debounce time in milliseconds. When null, no debounce is applied.\n * Default value is null (no debounce).\n */\n public readonly debounce = input<number | null>(null);\n\n /**\n * Event emitted to notify the debounce state.\n * Returns true while the component is debounced, false when not.\n */\n public readonly isDebounced = output<boolean>();\n\n /**\n * Signal to track the current debounce state of the component.\n */\n protected readonly debounceState = signal<boolean>(false);\n\n /**\n * Subject for handling click events with debounce.\n */\n private readonly clickSubject = new Subject<MouseEvent>();\n\n /**\n * Subject for cleanup.\n */\n private readonly destroy$ = new Subject<void>();\n\n /**\n * Current subscription for debounce.\n */\n private debounceSubscription: Subscription | null = null;\n\n /**\n * Current debounce timeout.\n */\n private debounceTimeout: ReturnType<typeof setTimeout> | null = null;\n\n constructor(private elementRef: ElementRef) {\n // Set up reactive debounce handling within injection context\n effect(() => {\n const debounceTime = this.debounce();\n this.setupDebounce(debounceTime);\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.clickSubject.complete();\n if (this.debounceSubscription) {\n this.debounceSubscription.unsubscribe();\n }\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n }\n }\n\n /**\n * Sets up the debounce functionality for click events.\n */\n private setupDebounce(debounceTime: number | null): void {\n // Clear existing subscription\n if (this.debounceSubscription) {\n this.debounceSubscription.unsubscribe();\n }\n\n // Clear existing timeout\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n this.debounceTimeout = null;\n }\n\n // Set up new subscription\n this.debounceSubscription = this.clickSubject.pipe(takeUntil(this.destroy$)).subscribe((event: MouseEvent) => {\n // Clear existing timeout\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n }\n\n // Set new timeout\n this.debounceTimeout = setTimeout(() => {\n this.debounceState.set(false);\n this.isDebounced.emit(false);\n this.onClick.emit(event);\n this.debounceTimeout = null;\n }, debounceTime ?? 0);\n });\n }\n\n /**\n * Handles click events with debounce functionality.\n */\n @HostListener('click', ['$event'])\n protected onHostClick(event: MouseEvent): void {\n if (this.disabled() || this.debounceState()) event.stopImmediatePropagation();\n }\n\n protected handleClick(event: MouseEvent): void {\n if (this.disabled() || this.debounceState()) return;\n const debounceTime = this.debounce();\n\n if (debounceTime !== null && debounceTime > 0) {\n // Apply debounce\n this.debounceState.set(true);\n this.isDebounced.emit(true);\n this.clickSubject.next(event);\n } else {\n // No debounce, emit immediately\n this.onClick.emit(event);\n }\n }\n\n /**\n * Handles focus events and emits the onFocus output.\n */\n protected handleFocus(event: FocusEvent): void {\n this.onFocus.emit(event);\n }\n\n /**\n * Handles blur events and emits the onBlur output.\n */\n protected handleBlur(event: FocusEvent): void {\n this.onBlur.emit(event);\n }\n\n /**\n * Creates a ripple effect at the specified position.\n */\n protected createRipple(event: MouseEvent): void {\n if (!this.ripple()) return;\n\n const button = event.currentTarget as HTMLElement;\n const rect = button.getBoundingClientRect();\n const size = Math.max(rect.width, rect.height);\n const x = event.clientX - rect.left - size / 2;\n const y = event.clientY - rect.top - size / 2;\n\n const ripple = document.createElement('span');\n ripple.style.width = ripple.style.height = size + 'px';\n ripple.style.left = x + 'px';\n ripple.style.top = y + 'px';\n ripple.classList.add('sdc-ripple');\n\n button.appendChild(ripple);\n\n setTimeout(() => {\n ripple.remove();\n }, 600);\n }\n}\n","<button\n hlmBtn\n [class]=\"computedClass()\"\n [disabled]=\"disabled() || debounceState()\"\n (click)=\"handleClick($event); createRipple($event)\"\n (focus)=\"handleFocus($event)\"\n (blur)=\"handleBlur($event)\"\n [type]=\"type()\">\n <ng-content></ng-content>\n</button>\n","/*\n * Public API Surface of software-division-components\n */\n\nexport * from './button.component';\nexport { HlmButton, HlmButtonModule, buttonVariants, provideBrnButtonConfig } from './ui/ui-button-helm/src';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.HlmButton"],"mappings":";;;;;;;AAQA,MAAM,aAAa,GAAoB;AACtC,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,IAAI,EAAE,SAAS;CACf;AAED,MAAM,oBAAoB,GAAG,IAAI,cAAc,CAAkB,iBAAiB,CAAC;AAE7E,SAAU,sBAAsB,CAAC,MAAgC,EAAA;AACtE,IAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,EAAE,GAAG,aAAa,EAAE,GAAG,MAAM,EAAE,EAAE;AACpF;SAEgB,qBAAqB,GAAA;AACpC,IAAA,OAAO,MAAM,CAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,aAAa;AACzE;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A,EAAA,+RAAA,EAAA,MAAA,EAAA,CAAA,0oQAAA,CAAA,EAAA;;sBAgQzB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;AEjTnC;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"3ddv-software-division-components-generic-button.mjs","sources":["../../generic/button/ui/ui-button-helm/src/lib/hlm-button.token.ts","../../generic/button/ui/ui-button-helm/src/lib/hlm-button.ts","../../generic/button/ui/ui-button-helm/src/index.ts","../../generic/button/button.component.ts","../../generic/button/button.component.html","../../generic/button/public-api.ts","../../generic/button/3ddv-software-division-components-generic-button.ts"],"sourcesContent":["import { InjectionToken, ValueProvider, inject } from '@angular/core';\nimport type { ButtonVariants } from './hlm-button';\n\nexport interface BrnButtonConfig {\n\tvariant: ButtonVariants['variant'];\n\tsize: ButtonVariants['size'];\n}\n\nconst defaultConfig: BrnButtonConfig = {\n\tvariant: 'default',\n\tsize: 'default',\n};\n\nconst BrnButtonConfigToken = new InjectionToken<BrnButtonConfig>('BrnButtonConfig');\n\nexport function provideBrnButtonConfig(config: Partial<BrnButtonConfig>): ValueProvider {\n\treturn { provide: BrnButtonConfigToken, useValue: { ...defaultConfig, ...config } };\n}\n\nexport function injectBrnButtonConfig(): BrnButtonConfig {\n\treturn inject(BrnButtonConfigToken, { optional: true }) ?? defaultConfig;\n}\n","import { Directive, computed, input, signal } from '@angular/core';\nimport { hlm } from '@spartan-ng/brain/core';\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport type { ClassValue } from 'clsx';\nimport { injectBrnButtonConfig } from './hlm-button.token';\n\nexport const buttonVariants = cva(\n 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_ng-icon]:pointer-events-none shrink-0 [&_ng-icon]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-default',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',\n destructive:\n 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',\n outline: 'border bg-background shadow-xs dark:bg-input/30 dark:border-input dark:hover:bg-input/50',\n secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>ng-icon]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>ng-icon]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>ng-icon]:px-4',\n icon: 'size-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nexport type ButtonVariants = VariantProps<typeof buttonVariants>;\n\n@Directive({\n selector: '[hlmBtn]',\n standalone: true,\n exportAs: 'hlmBtn',\n host: {\n '[class]': '_computedClass()',\n },\n})\nexport class HlmButton {\n private readonly _config = injectBrnButtonConfig();\n\n private readonly _additionalClasses = signal<ClassValue>('');\n\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n\n protected readonly _computedClass = computed(() =>\n hlm(buttonVariants({ variant: this.variant(), size: this.size() }), this.userClass(), this._additionalClasses())\n );\n\n public readonly variant = input<ButtonVariants['variant']>(this._config.variant);\n\n public readonly size = input<ButtonVariants['size']>(this._config.size);\n\n setClass(classes: string): void {\n this._additionalClasses.set(classes);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { HlmButton } from './lib/hlm-button';\nexport * from './lib/hlm-button';\nexport * from './lib/hlm-button.token';\n\n@NgModule({\n\timports: [HlmButton],\n\texports: [HlmButton],\n})\nexport class HlmButtonModule {}\n","import { Size, SIZES, ThemeClass } from '@3ddv/software-division-components/shared';\nimport { Component, computed, effect, ElementRef, HostListener, input, output, signal } from '@angular/core';\nimport { Subject, Subscription, takeUntil } from 'rxjs';\nimport { HlmButtonModule } from './ui/ui-button-helm/src';\n\nconst BUTTON_VARIANTS = {\n primary: 'primary',\n secondary: 'secondary',\n 'secondary-blue': 'secondary-blue',\n accent: 'accent',\n alternative: 'alternative',\n warning: 'warning',\n success: 'success',\n outline: 'outline',\n destructive: 'destructive',\n 'primary-light': 'primary-light',\n 'alternative-light': 'alternative-light',\n 'success-muted': 'success-muted',\n 'accent-light': 'accent-light',\n 'warning-light': 'warning-light',\n 'destructive-light': 'destructive-light',\n 'outline-white': 'outline-white',\n 'outline-alternative': 'outline-alternative',\n 'outline-accent': 'outline-accent',\n link: 'link',\n gray: 'gray',\n white: 'white',\n icon: 'icon',\n glass: 'glass',\n} as const;\n\ntype ButtonVariant = (typeof BUTTON_VARIANTS)[keyof typeof BUTTON_VARIANTS];\n\ntype ButtonType = 'button' | 'submit' | 'reset';\n\nexport type ButtonStyleClasses = ReturnType<(typeof ButtonComponent.prototype)['styleClass']>;\n\n/**\n * A customizable button component built on Spartan UI Button.\n *\n * This component supports various configurations and exposes all Spartan UI button functionality.\n * All HTML button attributes and events are automatically forwarded to the inner button element.\n *\n * @since 1.0.0-alpha.1\n * @updated 1.0.0-alpha.3\n */\n@Component({\n selector: 'sdc-button',\n styleUrls: ['./button.component.css'],\n templateUrl: './button.component.html',\n imports: [HlmButtonModule],\n})\nexport class ButtonComponent {\n private readonly allowedVariants = Object.values(BUTTON_VARIANTS).map(v => `variant-${v}` as const);\n private readonly allowedSizes = Object.values(SIZES).map(v => `size-${v}` as const);\n private readonly allowedCircleSizes = [\n 'size-circle-xs',\n 'size-circle-sm',\n 'size-circle-md',\n 'size-circle-lg',\n 'size-circle-xl',\n ] as const;\n private readonly allowedRadius = [\n 'radius-default',\n 'radius-sm',\n 'radius-md',\n 'radius-lg',\n 'radius-xl',\n 'radius-2xl',\n 'radius-full',\n ] as const;\n private readonly allowedBorder = ['border-0', 'border-default', 'border-2', 'border-4', 'border-8'] as const;\n\n /**\n * The current theme applied to the component.\n */\n public readonly theme = input<ThemeClass>('theme-sdc');\n\n /**\n * Predefined styles to apply to the component.\n * Can be a single class or multiple classes from different categories.\n */\n public readonly styleClass = input<\n (\n | (typeof this.allowedVariants)[number]\n | (typeof this.allowedSizes)[number]\n | (typeof this.allowedCircleSizes)[number]\n | (typeof this.allowedRadius)[number]\n | (typeof this.allowedBorder)[number]\n )[]\n >([]);\n\n // Computed signal that validates and filters the styleClass input\n private readonly _validatedStyleClass = computed(() => {\n const value = this.styleClass();\n\n if (!Array.isArray(value)) {\n console.warn('ButtonComponent: styleClass must be an array, defaulting to empty array');\n return [];\n }\n\n const validValues = value.filter(\n style =>\n this.allowedVariants.includes(style as any) ||\n this.allowedSizes.includes(style as any) ||\n this.allowedCircleSizes.includes(style as any) ||\n this.allowedRadius.includes(style as any) ||\n this.allowedBorder.includes(style as any)\n );\n\n const invalidValues = value.filter(\n style =>\n !this.allowedVariants.includes(style as any) &&\n !this.allowedSizes.includes(style as any) &&\n !this.allowedCircleSizes.includes(style as any) &&\n !this.allowedRadius.includes(style as any) &&\n !this.allowedBorder.includes(style as any)\n );\n\n if (invalidValues.length > 0) {\n throw new Error(\n `ButtonComponent: Invalid styleClass values ignored: ${invalidValues.join(', ')}. Allowed values: ${[\n ...this.allowedVariants,\n ...this.allowedSizes,\n ...this.allowedCircleSizes,\n ...this.allowedRadius,\n ...this.allowedBorder,\n ].join(', ')}`\n );\n }\n\n return validValues;\n });\n\n /**\n * Additional classes\n */\n public readonly className = input<string>('');\n\n /**\n * Button component style variant\n */\n public readonly variant = input<ButtonVariant>('primary');\n\n /**\n * Button component size variant\n */\n public readonly size = input<Size>('md');\n\n /**\n * Native button type attribute\n */\n public readonly type = input<ButtonType>('button');\n\n /**\n * Whether the component is disabled.\n */\n public readonly disabled = input<boolean>(false);\n\n /**\n * Whether to enable the ripple effect on the component.\n * Default value is false.\n */\n public readonly ripple = input<boolean>(false);\n\n /**\n * Event emitted when the component is clicked.\n */\n public readonly onClick = output<MouseEvent>();\n\n /**\n * Event emitted when the component receives focus.\n */\n public readonly onFocus = output<FocusEvent>();\n\n /**\n * Event emitted when the component loses focus.\n */\n public readonly onBlur = output<FocusEvent>();\n\n protected readonly _sizeClass = computed(() => {\n const size = SIZES[this.size()];\n\n if (!size) {\n throw new Error(`size must be one of these: ${Object.values(SIZES).join(', ')}}`);\n }\n\n return `size-${size}`;\n });\n\n protected readonly _variantClass = computed(() => {\n const variant = BUTTON_VARIANTS[this.variant()];\n\n if (!variant) {\n throw new Error(`variant must be one of these: ${Object.values(BUTTON_VARIANTS).join(', ')}}`);\n }\n\n return `variant-${variant}`;\n });\n\n /**\n * Computed class string that combines theme and user classes.\n */\n protected readonly computedClass = computed(() => {\n const themeClass = this.theme();\n const styleClass = this._validatedStyleClass();\n const sizeClass = this._sizeClass();\n const variantClass = this._variantClass();\n const className = this.className();\n return Array.from(new Set(['sdc-button', themeClass, sizeClass, variantClass, ...styleClass, className]))\n .filter(Boolean)\n .join(' ');\n });\n\n /**\n * Debounce time in milliseconds. When null, no debounce is applied.\n * Default value is null (no debounce).\n */\n public readonly debounce = input<number | null>(null);\n\n /**\n * Event emitted to notify the debounce state.\n * Returns true while the component is debounced, false when not.\n */\n public readonly isDebounced = output<boolean>();\n\n /**\n * Signal to track the current debounce state of the component.\n */\n protected readonly debounceState = signal<boolean>(false);\n\n /**\n * Subject for handling click events with debounce.\n */\n private readonly clickSubject = new Subject<MouseEvent>();\n\n /**\n * Subject for cleanup.\n */\n private readonly destroy$ = new Subject<void>();\n\n /**\n * Current subscription for debounce.\n */\n private debounceSubscription: Subscription | null = null;\n\n /**\n * Current debounce timeout.\n */\n private debounceTimeout: ReturnType<typeof setTimeout> | null = null;\n\n constructor(private elementRef: ElementRef) {\n // Set up reactive debounce handling within injection context\n effect(() => {\n const debounceTime = this.debounce();\n this.setupDebounce(debounceTime);\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.clickSubject.complete();\n if (this.debounceSubscription) {\n this.debounceSubscription.unsubscribe();\n }\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n }\n }\n\n /**\n * Sets up the debounce functionality for click events.\n */\n private setupDebounce(debounceTime: number | null): void {\n // Clear existing subscription\n if (this.debounceSubscription) {\n this.debounceSubscription.unsubscribe();\n }\n\n // Clear existing timeout\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n this.debounceTimeout = null;\n }\n\n // Set up new subscription\n this.debounceSubscription = this.clickSubject.pipe(takeUntil(this.destroy$)).subscribe((event: MouseEvent) => {\n // Clear existing timeout\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n }\n\n // Set new timeout\n this.debounceTimeout = setTimeout(() => {\n this.debounceState.set(false);\n this.isDebounced.emit(false);\n this.onClick.emit(event);\n this.debounceTimeout = null;\n }, debounceTime ?? 0);\n });\n }\n\n /**\n * Handles click events with debounce functionality.\n */\n @HostListener('click', ['$event'])\n protected onHostClick(event: MouseEvent): void {\n if (this.disabled() || this.debounceState()) event.stopImmediatePropagation();\n }\n\n protected handleClick(event: MouseEvent): void {\n if (this.disabled() || this.debounceState()) return;\n const debounceTime = this.debounce();\n\n if (debounceTime !== null && debounceTime > 0) {\n // Apply debounce\n this.debounceState.set(true);\n this.isDebounced.emit(true);\n this.clickSubject.next(event);\n } else {\n // No debounce, emit immediately\n this.onClick.emit(event);\n }\n }\n\n /**\n * Handles focus events and emits the onFocus output.\n */\n protected handleFocus(event: FocusEvent): void {\n this.onFocus.emit(event);\n }\n\n /**\n * Handles blur events and emits the onBlur output.\n */\n protected handleBlur(event: FocusEvent): void {\n this.onBlur.emit(event);\n }\n\n /**\n * Creates a ripple effect at the specified position.\n */\n protected createRipple(event: MouseEvent): void {\n if (!this.ripple()) return;\n\n const button = event.currentTarget as HTMLElement;\n const rect = button.getBoundingClientRect();\n const size = Math.max(rect.width, rect.height);\n const x = event.clientX - rect.left - size / 2;\n const y = event.clientY - rect.top - size / 2;\n\n const ripple = document.createElement('span');\n ripple.style.width = ripple.style.height = size + 'px';\n ripple.style.left = x + 'px';\n ripple.style.top = y + 'px';\n ripple.classList.add('sdc-ripple');\n\n button.appendChild(ripple);\n\n setTimeout(() => {\n ripple.remove();\n }, 600);\n }\n}\n","<button\n hlmBtn\n [class]=\"computedClass()\"\n [disabled]=\"disabled() || debounceState()\"\n (click)=\"handleClick($event); createRipple($event)\"\n (focus)=\"handleFocus($event)\"\n (blur)=\"handleBlur($event)\"\n [type]=\"type()\">\n <ng-content></ng-content>\n</button>\n","/*\n * Public API Surface of software-division-components\n */\n\nexport * from './button.component';\nexport { HlmButton, HlmButtonModule, buttonVariants, provideBrnButtonConfig } from './ui/ui-button-helm/src';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.HlmButton"],"mappings":";;;;;;;AAQA,MAAM,aAAa,GAAoB;AACtC,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,IAAI,EAAE,SAAS;CACf;AAED,MAAM,oBAAoB,GAAG,IAAI,cAAc,CAAkB,iBAAiB,CAAC;AAE7E,SAAU,sBAAsB,CAAC,MAAgC,EAAA;AACtE,IAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,EAAE,GAAG,aAAa,EAAE,GAAG,MAAM,EAAE,EAAE;AACpF;SAEgB,qBAAqB,GAAA;AACpC,IAAA,OAAO,MAAM,CAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,aAAa;AACzE;;ACfO,MAAM,cAAc,GAAG,GAAG,CAC/B,+aAA+a,EAC/a;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,kEAAkE;AAC3E,YAAA,WAAW,EACT,6JAA6J;AAC/J,YAAA,OAAO,EAAE,0FAA0F;AACnG,YAAA,SAAS,EAAE,wEAAwE;AACnF,Y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
|
2
|
-
import { input, computed, effect, untracked, Directive, forwardRef, ViewEncapsulation, ChangeDetectionStrategy, Component, inject, ViewContainerRef, ViewChild, signal, OutputEmitterRef, Injectable, NgModule, viewChild } from '@angular/core';
|
|
2
|
+
import { input, computed, effect, untracked, Directive, forwardRef, ViewEncapsulation, ChangeDetectionStrategy, Component, inject, ViewContainerRef, ViewChild, signal, OutputEmitterRef, Injectable, NgModule, viewChild, ElementRef } from '@angular/core';
|
|
3
3
|
import * as i1 from '@spartan-ng/brain/dialog';
|
|
4
4
|
import { BrnDialog, BrnDialogOverlay, provideBrnDialogDefaultOptions, BrnDialogRef, injectBrnDialogContext, BrnDialogClose, BrnDialogDescription, BrnDialogTitle, BrnDialogService, cssClassesToArray, DEFAULT_BRN_DIALOG_OPTIONS } from '@spartan-ng/brain/dialog';
|
|
5
5
|
import { injectCustomClassSettable, hlm } from '@spartan-ng/brain/core';
|
|
@@ -99,16 +99,30 @@ class HlmDialogContent {
|
|
|
99
99
|
_outlet;
|
|
100
100
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : {}), alias: 'class' });
|
|
101
101
|
fitContent = input(false, ...(ngDevMode ? [{ debugName: "fitContent" }] : []));
|
|
102
|
+
/** When false, the panel close (X) control is not rendered. Default true. Overridden by dialog open context `$showCloseButton` when set. */
|
|
103
|
+
showCloseButton = input(true, ...(ngDevMode ? [{ debugName: "showCloseButton" }] : []));
|
|
102
104
|
projectedRef = null;
|
|
103
105
|
state = computed(() => this._dialogRef?.state() ?? 'closed', ...(ngDevMode ? [{ debugName: "state" }] : []));
|
|
104
106
|
componentInputs = computed(() => {
|
|
105
|
-
const
|
|
107
|
+
const rawContext = this._dialogContext;
|
|
108
|
+
if (rawContext == null || typeof rawContext !== 'object') {
|
|
109
|
+
return {};
|
|
110
|
+
}
|
|
111
|
+
const { $component, $dynamicComponentClass, $fitContent, $showCloseButton, close, ...rest } = rawContext;
|
|
106
112
|
return rest;
|
|
107
113
|
}, ...(ngDevMode ? [{ debugName: "componentInputs" }] : []));
|
|
108
|
-
_computedClass = computed(() => hlm('
|
|
114
|
+
_computedClass = computed(() => hlm('grid w-full relative gap-4 border-0 bg-white p-6 shadow-lg outline-none ring-0 [animation-duration:200] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[2%] data-[state=open]:slide-in-from-top-[2%] rounded-lg md:w-full', this.userClass(), this.fitContent() || this._fitContent ? '' : 'max-w-lg', this._dynamicComponentClass), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
109
115
|
component = this._dialogContext?.$component;
|
|
110
116
|
_dynamicComponentClass = this._dialogContext?.$dynamicComponentClass;
|
|
111
117
|
_fitContent = this._dialogContext?.$fitContent ?? false;
|
|
118
|
+
effectiveShowCloseButton = computed(() => {
|
|
119
|
+
const ctx = this._dialogContext;
|
|
120
|
+
const fromContext = ctx != null && typeof ctx === 'object' && '$showCloseButton' in ctx ? ctx.$showCloseButton : undefined;
|
|
121
|
+
if (typeof fromContext === 'boolean') {
|
|
122
|
+
return fromContext;
|
|
123
|
+
}
|
|
124
|
+
return this.showCloseButton();
|
|
125
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveShowCloseButton" }] : []));
|
|
112
126
|
ngAfterViewInit() {
|
|
113
127
|
if (!this.component || !this._outlet) {
|
|
114
128
|
return;
|
|
@@ -119,17 +133,19 @@ class HlmDialogContent {
|
|
|
119
133
|
}
|
|
120
134
|
}
|
|
121
135
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: HlmDialogContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
122
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.4", type: HlmDialogContent, isStandalone: true, selector: "hlm-dialog-content", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, fitContent: { classPropertyName: "fitContent", publicName: "fitContent", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()", "attr.data-state": "state()" } }, providers: [provideIcons({ lucideX })], viewQueries: [{ propertyName: "_outlet", first: true, predicate: ["outlet"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: `
|
|
136
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.4", type: HlmDialogContent, isStandalone: true, selector: "hlm-dialog-content", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, fitContent: { classPropertyName: "fitContent", publicName: "fitContent", isSignal: true, isRequired: false, transformFunction: null }, showCloseButton: { classPropertyName: "showCloseButton", publicName: "showCloseButton", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()", "attr.data-state": "state()" } }, providers: [provideIcons({ lucideX })], viewQueries: [{ propertyName: "_outlet", first: true, predicate: ["outlet"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: `
|
|
123
137
|
@if (component) {
|
|
124
138
|
<ng-container #outlet />
|
|
125
139
|
} @else {
|
|
126
140
|
<ng-content />
|
|
127
141
|
}
|
|
128
142
|
|
|
129
|
-
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
143
|
+
@if (effectiveShowCloseButton()) {
|
|
144
|
+
<button brnDialogClose class="animated-button" hlm type="button">
|
|
145
|
+
<span class="sr-only">Close</span>
|
|
146
|
+
<ng-icon hlm name="lucideX" size="sm" />
|
|
147
|
+
</button>
|
|
148
|
+
}
|
|
133
149
|
`, isInline: true, dependencies: [{ kind: "directive", type: BrnDialogClose, selector: "button[brnDialogClose]", inputs: ["delay"] }, { kind: "directive", type: HlmDialogClose, selector: "[hlmDialogClose],[brnDialogClose][hlm]", inputs: ["class"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: HlmIcon, selector: "ng-icon[hlm]", inputs: ["size", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
134
150
|
}
|
|
135
151
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: HlmDialogContent, decorators: [{
|
|
@@ -149,10 +165,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImpor
|
|
|
149
165
|
<ng-content />
|
|
150
166
|
}
|
|
151
167
|
|
|
152
|
-
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
|
|
168
|
+
@if (effectiveShowCloseButton()) {
|
|
169
|
+
<button brnDialogClose class="animated-button" hlm type="button">
|
|
170
|
+
<span class="sr-only">Close</span>
|
|
171
|
+
<ng-icon hlm name="lucideX" size="sm" />
|
|
172
|
+
</button>
|
|
173
|
+
}
|
|
156
174
|
`,
|
|
157
175
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
158
176
|
encapsulation: ViewEncapsulation.None,
|
|
@@ -160,7 +178,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImpor
|
|
|
160
178
|
}], propDecorators: { _outlet: [{
|
|
161
179
|
type: ViewChild,
|
|
162
180
|
args: ['outlet', { read: ViewContainerRef }]
|
|
163
|
-
}], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], fitContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "fitContent", required: false }] }] } });
|
|
181
|
+
}], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], fitContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "fitContent", required: false }] }], showCloseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCloseButton", required: false }] }] } });
|
|
164
182
|
|
|
165
183
|
class HlmDialogDescription {
|
|
166
184
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : {}), alias: 'class' });
|
|
@@ -232,10 +250,97 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImpor
|
|
|
232
250
|
}]
|
|
233
251
|
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
234
252
|
|
|
253
|
+
/** CSS custom properties read from `sdc-dialog` (or any host element). */
|
|
254
|
+
const SDC_DIALOG_PANE_CSS_VARS = {
|
|
255
|
+
width: '--sdc-dialog-pane-width',
|
|
256
|
+
maxWidth: '--sdc-dialog-pane-max-width',
|
|
257
|
+
height: '--sdc-dialog-pane-height',
|
|
258
|
+
maxHeight: '--sdc-dialog-pane-max-height',
|
|
259
|
+
};
|
|
260
|
+
function readOverlayPaneCssVars(host) {
|
|
261
|
+
const computed = getComputedStyle(host);
|
|
262
|
+
const read = (varName) => {
|
|
263
|
+
const raw = computed.getPropertyValue(varName).trim();
|
|
264
|
+
return raw === '' ? undefined : raw;
|
|
265
|
+
};
|
|
266
|
+
return {
|
|
267
|
+
width: read(SDC_DIALOG_PANE_CSS_VARS.width),
|
|
268
|
+
maxWidth: read(SDC_DIALOG_PANE_CSS_VARS.maxWidth),
|
|
269
|
+
height: read(SDC_DIALOG_PANE_CSS_VARS.height),
|
|
270
|
+
maxHeight: read(SDC_DIALOG_PANE_CSS_VARS.maxHeight),
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
function pickOverlayPaneFromOptions(options) {
|
|
274
|
+
if (!options) {
|
|
275
|
+
return {};
|
|
276
|
+
}
|
|
277
|
+
const size = {};
|
|
278
|
+
if (options.overlayPaneWidth !== undefined && options.overlayPaneWidth !== '') {
|
|
279
|
+
size.width = options.overlayPaneWidth;
|
|
280
|
+
}
|
|
281
|
+
if (options.overlayPaneMaxWidth !== undefined && options.overlayPaneMaxWidth !== '') {
|
|
282
|
+
size.maxWidth = options.overlayPaneMaxWidth;
|
|
283
|
+
}
|
|
284
|
+
if (options.overlayPaneHeight !== undefined && options.overlayPaneHeight !== '') {
|
|
285
|
+
size.height = options.overlayPaneHeight;
|
|
286
|
+
}
|
|
287
|
+
if (options.overlayPaneMaxHeight !== undefined && options.overlayPaneMaxHeight !== '') {
|
|
288
|
+
size.maxHeight = options.overlayPaneMaxHeight;
|
|
289
|
+
}
|
|
290
|
+
return size;
|
|
291
|
+
}
|
|
292
|
+
function mergeOverlayPaneSizes(...layers) {
|
|
293
|
+
const merged = {};
|
|
294
|
+
for (const layer of layers) {
|
|
295
|
+
for (const key of ['width', 'maxWidth', 'height', 'maxHeight']) {
|
|
296
|
+
const v = layer[key];
|
|
297
|
+
if (v !== undefined && v !== '') {
|
|
298
|
+
merged[key] = v;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return merged;
|
|
303
|
+
}
|
|
304
|
+
function overlayPaneSizeToUpdateConfig(size) {
|
|
305
|
+
const cfg = {};
|
|
306
|
+
if (size.width !== undefined) {
|
|
307
|
+
cfg.width = size.width;
|
|
308
|
+
}
|
|
309
|
+
if (size.maxWidth !== undefined) {
|
|
310
|
+
cfg.maxWidth = size.maxWidth;
|
|
311
|
+
}
|
|
312
|
+
if (size.height !== undefined) {
|
|
313
|
+
cfg.height = size.height;
|
|
314
|
+
}
|
|
315
|
+
if (size.maxHeight !== undefined) {
|
|
316
|
+
cfg.maxHeight = size.maxHeight;
|
|
317
|
+
}
|
|
318
|
+
return cfg;
|
|
319
|
+
}
|
|
320
|
+
|
|
235
321
|
class HlmDialogService {
|
|
236
322
|
ref = signal(null, ...(ngDevMode ? [{ debugName: "ref" }] : []));
|
|
237
323
|
component = signal(null, ...(ngDevMode ? [{ debugName: "component" }] : []));
|
|
324
|
+
/**
|
|
325
|
+
* Host element of `sdc-dialog`; used to read `--sdc-dialog-pane-*` CSS variables on each `open()`.
|
|
326
|
+
* Registered by `DialogComponent`; expect a single dialog host per app.
|
|
327
|
+
*/
|
|
328
|
+
hostElement = signal(null, ...(ngDevMode ? [{ debugName: "hostElement" }] : []));
|
|
329
|
+
/**
|
|
330
|
+
* Default overlay pane size from `sdc-dialog` inputs. Overridden per `open()` and by CSS vars
|
|
331
|
+
* when defined on the host (merge order: CSS vars → this signal → `open()` options).
|
|
332
|
+
*/
|
|
333
|
+
defaultOverlayPaneSize = signal({}, ...(ngDevMode ? [{ debugName: "defaultOverlayPaneSize" }] : []));
|
|
238
334
|
_brnDialogService = inject(BrnDialogService);
|
|
335
|
+
/**
|
|
336
|
+
* Clears host registration when the active `sdc-dialog` is destroyed (single-host apps).
|
|
337
|
+
*/
|
|
338
|
+
releaseHostIfMatch(host) {
|
|
339
|
+
if (this.hostElement() === host) {
|
|
340
|
+
this.hostElement.set(null);
|
|
341
|
+
this.defaultOverlayPaneSize.set({});
|
|
342
|
+
}
|
|
343
|
+
}
|
|
239
344
|
open(component, options) {
|
|
240
345
|
if (options) {
|
|
241
346
|
options.panelClass = 'dialog-overlay-margin';
|
|
@@ -243,24 +348,41 @@ class HlmDialogService {
|
|
|
243
348
|
else {
|
|
244
349
|
options = { panelClass: 'dialog-overlay-margin' };
|
|
245
350
|
}
|
|
351
|
+
const baseContext = typeof options?.context === 'object' && options?.context !== null ? options.context : {};
|
|
352
|
+
const showCloseFromContext = baseContext &&
|
|
353
|
+
typeof baseContext === 'object' &&
|
|
354
|
+
'$showCloseButton' in baseContext &&
|
|
355
|
+
typeof baseContext.$showCloseButton === 'boolean'
|
|
356
|
+
? baseContext.$showCloseButton
|
|
357
|
+
: undefined;
|
|
358
|
+
const resolvedShowCloseButton = options?.showCloseButton !== undefined ? options.showCloseButton : (showCloseFromContext ?? true);
|
|
246
359
|
const mergedOptions = {
|
|
247
360
|
...DEFAULT_BRN_DIALOG_OPTIONS,
|
|
248
361
|
...options,
|
|
249
362
|
backdropClass: cssClassesToArray(`${hlmDialogOverlayClass} ${options?.backdropClass ?? ''} dialog-container`),
|
|
250
363
|
context: {
|
|
251
|
-
...
|
|
364
|
+
...baseContext,
|
|
252
365
|
$component: component,
|
|
253
366
|
$dynamicComponentClass: options?.contentClass,
|
|
254
367
|
$fitContent: options?.fitContent,
|
|
368
|
+
$showCloseButton: resolvedShowCloseButton,
|
|
255
369
|
},
|
|
256
370
|
};
|
|
257
371
|
const reference = this._brnDialogService.open(HlmDialogContent, undefined, mergedOptions.context, mergedOptions);
|
|
258
372
|
this.ref.set(reference);
|
|
259
373
|
const cdkRef = reference._cdkDialogRef;
|
|
374
|
+
const host = this.hostElement();
|
|
375
|
+
const fromCss = host ? readOverlayPaneCssVars(host) : {};
|
|
376
|
+
const fromInputs = this.defaultOverlayPaneSize();
|
|
377
|
+
const fromOpen = pickOverlayPaneFromOptions(options);
|
|
378
|
+
const resolvedPane = mergeOverlayPaneSizes(fromCss, fromInputs, fromOpen);
|
|
379
|
+
const updateCfg = overlayPaneSizeToUpdateConfig(resolvedPane);
|
|
380
|
+
if (Object.keys(updateCfg).length > 0) {
|
|
381
|
+
cdkRef?.overlayRef?.updateSize(updateCfg);
|
|
382
|
+
}
|
|
260
383
|
cdkRef?.componentRef?.changeDetectorRef?.detectChanges();
|
|
261
384
|
const contentInstance = cdkRef?.componentRef?.instance;
|
|
262
385
|
const instance = contentInstance?.projectedRef?.instance;
|
|
263
|
-
// We only expose the component outputs here
|
|
264
386
|
let outputs = null;
|
|
265
387
|
if (instance) {
|
|
266
388
|
const result = {};
|
|
@@ -315,19 +437,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImpor
|
|
|
315
437
|
class DialogComponent {
|
|
316
438
|
dialogService = inject(HlmDialogService);
|
|
317
439
|
dialogComponent = viewChild(BrnDialog, ...(ngDevMode ? [{ debugName: "dialogComponent" }] : []));
|
|
440
|
+
hostEl = inject(ElementRef);
|
|
318
441
|
fitContent = input(false, ...(ngDevMode ? [{ debugName: "fitContent" }] : []));
|
|
442
|
+
showCloseButton = input(true, ...(ngDevMode ? [{ debugName: "showCloseButton" }] : []));
|
|
443
|
+
/**
|
|
444
|
+
* Default CDK overlay pane width (e.g. `800px`). Merge order: CSS vars on `sdc-dialog` → these inputs →
|
|
445
|
+
* `DialogService.open({ overlayPaneWidth, ... })` (strongest).
|
|
446
|
+
*/
|
|
447
|
+
overlayPaneWidth = input(undefined, ...(ngDevMode ? [{ debugName: "overlayPaneWidth" }] : []));
|
|
448
|
+
overlayPaneMaxWidth = input(undefined, ...(ngDevMode ? [{ debugName: "overlayPaneMaxWidth" }] : []));
|
|
449
|
+
overlayPaneHeight = input(undefined, ...(ngDevMode ? [{ debugName: "overlayPaneHeight" }] : []));
|
|
450
|
+
overlayPaneMaxHeight = input(undefined, ...(ngDevMode ? [{ debugName: "overlayPaneMaxHeight" }] : []));
|
|
319
451
|
constructor() {
|
|
320
452
|
effect(() => {
|
|
321
453
|
this.dialogService.component.set(this.dialogComponent() ?? null);
|
|
454
|
+
this.dialogService.hostElement.set(this.hostEl.nativeElement);
|
|
455
|
+
const size = {};
|
|
456
|
+
const w = this.overlayPaneWidth();
|
|
457
|
+
const maxW = this.overlayPaneMaxWidth();
|
|
458
|
+
const h = this.overlayPaneHeight();
|
|
459
|
+
const maxH = this.overlayPaneMaxHeight();
|
|
460
|
+
if (w !== undefined && w !== '') {
|
|
461
|
+
size.width = w;
|
|
462
|
+
}
|
|
463
|
+
if (maxW !== undefined && maxW !== '') {
|
|
464
|
+
size.maxWidth = maxW;
|
|
465
|
+
}
|
|
466
|
+
if (h !== undefined && h !== '') {
|
|
467
|
+
size.height = h;
|
|
468
|
+
}
|
|
469
|
+
if (maxH !== undefined && maxH !== '') {
|
|
470
|
+
size.maxHeight = maxH;
|
|
471
|
+
}
|
|
472
|
+
this.dialogService.defaultOverlayPaneSize.set(size);
|
|
322
473
|
});
|
|
323
474
|
}
|
|
475
|
+
ngOnDestroy() {
|
|
476
|
+
this.dialogService.releaseHostIfMatch(this.hostEl.nativeElement);
|
|
477
|
+
}
|
|
324
478
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
325
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.4", type: DialogComponent, isStandalone: true, selector: "sdc-dialog", inputs: { fitContent: { classPropertyName: "fitContent", publicName: "fitContent", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "dialogComponent", first: true, predicate: BrnDialog, descendants: true, isSignal: true }], ngImport: i0, template: "<hlm-dialog #dialogRef>\n <hlm-dialog-content
|
|
479
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.4", type: DialogComponent, isStandalone: true, selector: "sdc-dialog", inputs: { fitContent: { classPropertyName: "fitContent", publicName: "fitContent", isSignal: true, isRequired: false, transformFunction: null }, showCloseButton: { classPropertyName: "showCloseButton", publicName: "showCloseButton", isSignal: true, isRequired: false, transformFunction: null }, overlayPaneWidth: { classPropertyName: "overlayPaneWidth", publicName: "overlayPaneWidth", isSignal: true, isRequired: false, transformFunction: null }, overlayPaneMaxWidth: { classPropertyName: "overlayPaneMaxWidth", publicName: "overlayPaneMaxWidth", isSignal: true, isRequired: false, transformFunction: null }, overlayPaneHeight: { classPropertyName: "overlayPaneHeight", publicName: "overlayPaneHeight", isSignal: true, isRequired: false, transformFunction: null }, overlayPaneMaxHeight: { classPropertyName: "overlayPaneMaxHeight", publicName: "overlayPaneMaxHeight", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "dialogComponent", first: true, predicate: BrnDialog, descendants: true, isSignal: true }], ngImport: i0, template: "<hlm-dialog #dialogRef>\n <hlm-dialog-content\n *hlmDialogContent=\"let ctx\"\n [fitContent]=\"fitContent()\"\n [showCloseButton]=\"showCloseButton()\"\n class=\"dialog-content\" />\n</hlm-dialog>\n", dependencies: [{ kind: "component", type: HlmDialogContent, selector: "hlm-dialog-content", inputs: ["class", "fitContent", "showCloseButton"] }, { kind: "component", type: HlmDialog, selector: "hlm-dialog", exportAs: ["hlmDialog"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
326
480
|
}
|
|
327
481
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: DialogComponent, decorators: [{
|
|
328
482
|
type: Component,
|
|
329
|
-
args: [{ selector: 'sdc-dialog', imports: [HlmDialogContent, HlmDialog], changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-dialog #dialogRef>\n <hlm-dialog-content
|
|
330
|
-
}], ctorParameters: () => [], propDecorators: { dialogComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => BrnDialog), { isSignal: true }] }], fitContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "fitContent", required: false }] }] } });
|
|
483
|
+
args: [{ selector: 'sdc-dialog', imports: [HlmDialogContent, HlmDialog], changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-dialog #dialogRef>\n <hlm-dialog-content\n *hlmDialogContent=\"let ctx\"\n [fitContent]=\"fitContent()\"\n [showCloseButton]=\"showCloseButton()\"\n class=\"dialog-content\" />\n</hlm-dialog>\n" }]
|
|
484
|
+
}], ctorParameters: () => [], propDecorators: { dialogComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => BrnDialog), { isSignal: true }] }], fitContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "fitContent", required: false }] }], showCloseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCloseButton", required: false }] }], overlayPaneWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayPaneWidth", required: false }] }], overlayPaneMaxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayPaneMaxWidth", required: false }] }], overlayPaneHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayPaneHeight", required: false }] }], overlayPaneMaxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayPaneMaxHeight", required: false }] }] } });
|
|
331
485
|
|
|
332
486
|
/*
|
|
333
487
|
* Public API Surface of software-division-components
|
|
@@ -337,5 +491,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImpor
|
|
|
337
491
|
* Generated bundle index. Do not edit.
|
|
338
492
|
*/
|
|
339
493
|
|
|
340
|
-
export { DialogComponent, HlmDialogService as DialogService, HlmDialog, HlmDialogClose, HlmDialogContent, HlmDialogDescription, HlmDialogFooter, HlmDialogHeader, HlmDialogImports, HlmDialogModule, HlmDialogOverlay, HlmDialogService, HlmDialogTitle, hlmDialogOverlayClass };
|
|
494
|
+
export { DialogComponent, HlmDialogService as DialogService, HlmDialog, HlmDialogClose, HlmDialogContent, HlmDialogDescription, HlmDialogFooter, HlmDialogHeader, HlmDialogImports, HlmDialogModule, HlmDialogOverlay, HlmDialogService, HlmDialogTitle, SDC_DIALOG_PANE_CSS_VARS, hlmDialogOverlayClass, mergeOverlayPaneSizes, overlayPaneSizeToUpdateConfig, pickOverlayPaneFromOptions, readOverlayPaneCssVars };
|
|
341
495
|
//# sourceMappingURL=3ddv-software-division-components-generic-dialog.mjs.map
|