@masmarino/gabarit 4.0.0 → 4.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/button/README.md +11 -4
- package/fesm2022/masmarino-gabarit-accordion.mjs +6 -6
- package/fesm2022/masmarino-gabarit-alert.mjs +5 -5
- package/fesm2022/masmarino-gabarit-alert.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-app-shell.mjs +8 -8
- package/fesm2022/masmarino-gabarit-app-shell.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-auth-activate.mjs +3 -3
- package/fesm2022/masmarino-gabarit-auth-login.mjs +3 -3
- package/fesm2022/masmarino-gabarit-auth-register.mjs +5 -5
- package/fesm2022/masmarino-gabarit-auth-register.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-auth-reset-password.mjs +3 -3
- package/fesm2022/masmarino-gabarit-auth.mjs +12 -12
- package/fesm2022/masmarino-gabarit-autocomplete.mjs +5 -5
- package/fesm2022/masmarino-gabarit-autocomplete.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-avatar-group.mjs +5 -5
- package/fesm2022/masmarino-gabarit-avatar-group.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-avatar.mjs +3 -3
- package/fesm2022/masmarino-gabarit-badge.mjs +7 -7
- package/fesm2022/masmarino-gabarit-badge.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-bar-chart.mjs +6 -6
- package/fesm2022/masmarino-gabarit-breadcrumb.mjs +3 -3
- package/fesm2022/masmarino-gabarit-button.mjs +5 -5
- package/fesm2022/masmarino-gabarit-button.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-card.mjs +13 -13
- package/fesm2022/masmarino-gabarit-card.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-chart.mjs +27 -27
- package/fesm2022/masmarino-gabarit-chart.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-checkbox-group.mjs +3 -3
- package/fesm2022/masmarino-gabarit-checkbox.mjs +7 -7
- package/fesm2022/masmarino-gabarit-checkbox.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-command-palette.mjs +10 -10
- package/fesm2022/masmarino-gabarit-command-palette.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-confirm-danger-modal.mjs +3 -3
- package/fesm2022/masmarino-gabarit-copy-button.mjs +3 -3
- package/fesm2022/masmarino-gabarit-copy-field.mjs +5 -5
- package/fesm2022/masmarino-gabarit-copy-field.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-date-picker.mjs +10 -10
- package/fesm2022/masmarino-gabarit-date-picker.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-description-list.mjs +3 -3
- package/fesm2022/masmarino-gabarit-dimension-card.mjs +3 -3
- package/fesm2022/masmarino-gabarit-disclosure.mjs +5 -5
- package/fesm2022/masmarino-gabarit-disclosure.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-divider.mjs +3 -3
- package/fesm2022/masmarino-gabarit-docs.mjs +31 -31
- package/fesm2022/masmarino-gabarit-docs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-drawer.mjs +5 -5
- package/fesm2022/masmarino-gabarit-drawer.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-empty-state.mjs +3 -3
- package/fesm2022/masmarino-gabarit-file-upload.mjs +5 -5
- package/fesm2022/masmarino-gabarit-file-upload.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-format.mjs +9 -9
- package/fesm2022/masmarino-gabarit-funnel-chart.mjs +3 -3
- package/fesm2022/masmarino-gabarit-gauge-bar.mjs +3 -3
- package/fesm2022/masmarino-gabarit-git-field.mjs +3 -3
- package/fesm2022/masmarino-gabarit-icon-marker.mjs +3 -3
- package/fesm2022/masmarino-gabarit-icon.mjs +6 -6
- package/fesm2022/masmarino-gabarit-input.mjs +5 -5
- package/fesm2022/masmarino-gabarit-input.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-job-graph.mjs +5 -5
- package/fesm2022/masmarino-gabarit-job-graph.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-job-status.mjs +3 -3
- package/fesm2022/masmarino-gabarit-line-chart.mjs +6 -6
- package/fesm2022/masmarino-gabarit-list-card.mjs +3 -3
- package/fesm2022/masmarino-gabarit-list-row.mjs +5 -5
- package/fesm2022/masmarino-gabarit-list-row.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs +5 -5
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-menu.mjs +11 -11
- package/fesm2022/masmarino-gabarit-menu.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs +13 -13
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs +5 -5
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-modal.mjs +5 -5
- package/fesm2022/masmarino-gabarit-modal.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs +8 -8
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-notification-dot.mjs +3 -3
- package/fesm2022/masmarino-gabarit-page-header.mjs +3 -3
- package/fesm2022/masmarino-gabarit-page-layout.mjs +3 -3
- package/fesm2022/masmarino-gabarit-pagination.mjs +5 -5
- package/fesm2022/masmarino-gabarit-pagination.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-panel.mjs +3 -3
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs +5 -5
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-pie-chart.mjs +3 -3
- package/fesm2022/masmarino-gabarit-popover.mjs +5 -5
- package/fesm2022/masmarino-gabarit-popover.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-radio-group.mjs +3 -3
- package/fesm2022/masmarino-gabarit-save-status.mjs +3 -3
- package/fesm2022/masmarino-gabarit-search-bar.mjs +5 -5
- package/fesm2022/masmarino-gabarit-search-bar.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-secret-reveal.mjs +5 -5
- package/fesm2022/masmarino-gabarit-secret-reveal.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-segmented-control.mjs +50 -8
- package/fesm2022/masmarino-gabarit-segmented-control.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-select.mjs +5 -5
- package/fesm2022/masmarino-gabarit-select.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-skeleton-list.mjs +5 -5
- package/fesm2022/masmarino-gabarit-skeleton-list.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-skeleton.mjs +5 -5
- package/fesm2022/masmarino-gabarit-skeleton.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-slider.mjs +5 -5
- package/fesm2022/masmarino-gabarit-slider.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-sparkline.mjs +5 -5
- package/fesm2022/masmarino-gabarit-sparkline.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-spinner.mjs +3 -3
- package/fesm2022/masmarino-gabarit-stat-grid.mjs +3 -3
- package/fesm2022/masmarino-gabarit-stat-tile.mjs +8 -8
- package/fesm2022/masmarino-gabarit-stat-tile.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-stepper.mjs +5 -5
- package/fesm2022/masmarino-gabarit-stepper.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-switch.mjs +5 -5
- package/fesm2022/masmarino-gabarit-switch.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-table.mjs +3 -3
- package/fesm2022/masmarino-gabarit-tabs.mjs +60 -11
- package/fesm2022/masmarino-gabarit-tabs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tag-input.mjs +5 -5
- package/fesm2022/masmarino-gabarit-tag-input.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tag.mjs +5 -5
- package/fesm2022/masmarino-gabarit-tag.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-textarea.mjs +5 -5
- package/fesm2022/masmarino-gabarit-textarea.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-timeline-chart.mjs +6 -6
- package/fesm2022/masmarino-gabarit-toaster.mjs +6 -6
- package/fesm2022/masmarino-gabarit-tooltip.mjs +5 -5
- package/fesm2022/masmarino-gabarit-tooltip.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tree.mjs +5 -5
- package/fesm2022/masmarino-gabarit-tree.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-user-chip.mjs +3 -3
- package/fesm2022/masmarino-gabarit.mjs +1 -1
- package/fesm2022/masmarino-gabarit.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/tokens/_glass.scss +140 -0
- package/src/lib/tokens/_grounds.scss +70 -0
- package/src/lib/tokens/_themes.scss +22 -4
- package/src/lib/tokens/_utilities.scss +54 -4
- package/types/masmarino-gabarit-button.d.ts +1 -1
- package/types/masmarino-gabarit-segmented-control.d.ts +14 -0
- package/types/masmarino-gabarit-tabs.d.ts +14 -0
- package/types/masmarino-gabarit.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masmarino-gabarit-sparkline.mjs","names":[],"sources":["../../../projects/gabarit/sparkline/sparkline.ts","../../../projects/gabarit/sparkline/sparkline.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, signal } from '@angular/core'\nimport { ChartEmpty } from '@masmarino/gabarit/chart'\nimport { ChartTable } from '@masmarino/gabarit/chart'\nimport { formatNumber } from '@masmarino/gabarit/format'\nimport { linePath } from '@masmarino/gabarit/chart'\nimport { linearScale } from '@masmarino/gabarit/chart'\nimport { nearestIndex } from '@masmarino/gabarit/chart'\n\nconst MARGIN = 4\n\n@Component({\n selector: 'gbt-sparkline',\n standalone: true,\n imports: [ChartEmpty, ChartTable],\n templateUrl: './sparkline.html',\n styleUrl: './sparkline.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Sparkline {\n values = input.required<number[]>()\n tableCaption = input.required<string>()\n xColumn = input.required<string>()\n yColumn = input.required<string>()\n locale = input.required<string>()\n emptyMessage = input.required<string>()\n width = input(80)\n height = input(24)\n\n protected readonly activeIndex = signal<number | null>(null)\n\n protected readonly viewBox = computed(() => `0 0 ${this.width()} ${this.height()}`)\n\n protected readonly columns = computed(() => [this.xColumn(), this.yColumn()])\n\n protected readonly tableRows = computed<(string | number)[][]>(() =>\n this.values().map((value, index) => [\n formatNumber(index + 1, this.locale()),\n formatNumber(value, this.locale()),\n ]),\n )\n\n private readonly scales = computed(() => {\n const values = this.values()\n const min = Math.min(...values)\n const max = Math.max(...values)\n return {\n x: linearScale([0, Math.max(values.length - 1, 0)], [MARGIN, this.width() - MARGIN]),\n y: linearScale([min, max], [this.height() - MARGIN, MARGIN]),\n }\n })\n\n protected readonly path = computed(() => {\n const values = this.values()\n if (values.length === 0) return null\n const { x, y } = this.scales()\n return linePath(values.map((value, index) => ({ x: x.map(index), y: y.map(value) })))\n })\n\n protected readonly positions = computed<number[]>(() => {\n const { x } = this.scales()\n return this.values().map((_, index) => x.map(index))\n })\n\n protected readonly dot = computed<{ x: number; y: number } | null>(() => {\n const index = this.activeIndex()\n if (index === null) return null\n const value = this.values()[index]\n if (value === undefined) return null\n const { x, y } = this.scales()\n return { x: x.map(index), y: y.map(value) }\n })\n\n protected readonly tooltip = computed<string | null>(() => {\n const index = this.activeIndex()\n if (index === null) return null\n const value = this.values()[index]\n if (value === undefined) return null\n return `${this.xColumn()} ${formatNumber(index + 1, this.locale())} — ${this.yColumn()} ${formatNumber(value, this.locale())}`\n })\n\n protected onPointerMove(event: PointerEvent | MouseEvent): void {\n const positions = this.positions()\n if (positions.length === 0) return\n const rect = (event.currentTarget as Element).getBoundingClientRect()\n this.activeIndex.set(nearestIndex(positions, event.clientX - rect.left))\n }\n\n protected onPointerLeave(event: PointerEvent | MouseEvent): void {\n const target = event.currentTarget as Element\n if (target.ownerDocument.activeElement === target) return\n this.activeIndex.set(null)\n }\n\n protected onBlur(): void {\n this.activeIndex.set(null)\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const lastIndex = this.values().length - 1\n if (lastIndex < 0) return\n const current = this.activeIndex()\n switch (event.key) {\n case 'ArrowRight':\n this.activeIndex.set(current === null ? 0 : Math.min(lastIndex, current + 1))\n break\n case 'ArrowLeft':\n this.activeIndex.set(current === null ? lastIndex : Math.max(0, current - 1))\n break\n case 'Home':\n this.activeIndex.set(0)\n break\n case 'End':\n this.activeIndex.set(lastIndex)\n break\n case 'Escape':\n this.activeIndex.set(null)\n break\n default:\n return\n }\n event.preventDefault()\n }\n}\n","@if (path(); as d) {\n <div class=\"gbt-sparkline\" role=\"status\" aria-live=\"polite\">\n <svg\n class=\"gbt-sparkline__svg\"\n [attr.viewBox]=\"viewBox()\"\n [attr.width]=\"width()\"\n [attr.height]=\"height()\"\n tabindex=\"0\"\n role=\"group\"\n [attr.aria-label]=\"tableCaption()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n >\n <path class=\"gbt-sparkline__line\" [attr.d]=\"d\" />\n @if (dot(); as p) {\n <circle class=\"gbt-sparkline__dot\" [attr.cx]=\"p.x\" [attr.cy]=\"p.y\" r=\"3\" />\n }\n </svg>\n @if (tooltip(); as text) {\n <span class=\"gbt-sparkline__tooltip\">{{ text }}</span>\n }\n </div>\n <gbt-chart-table [caption]=\"tableCaption()\" [columns]=\"columns()\" [rows]=\"tableRows()\" />\n} @else {\n <gbt-chart-empty [message]=\"emptyMessage()\" />\n}\n"],"mappings":";;;;AAQA,MAAM,SAAS;AAUf,IAAa,YAAb,MAAa,UAAS;CACpB,SAAS,MAAM,SAAoB,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACnC,eAAe,MAAM,SAAkB,GAAA,Y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MAAM,eAAc;CACtB;CAvGW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAS,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAT,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAS,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,cAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,cAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,UAAA;EAAA,UClBtB;EA4BA,QAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"masmarino-gabarit-sparkline.mjs","names":[],"sources":["../../../projects/gabarit/sparkline/sparkline.ts","../../../projects/gabarit/sparkline/sparkline.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, signal } from '@angular/core'\nimport { ChartEmpty } from '@masmarino/gabarit/chart'\nimport { ChartTable } from '@masmarino/gabarit/chart'\nimport { formatNumber } from '@masmarino/gabarit/format'\nimport { linePath } from '@masmarino/gabarit/chart'\nimport { linearScale } from '@masmarino/gabarit/chart'\nimport { nearestIndex } from '@masmarino/gabarit/chart'\n\nconst MARGIN = 4\n\n@Component({\n selector: 'gbt-sparkline',\n standalone: true,\n imports: [ChartEmpty, ChartTable],\n templateUrl: './sparkline.html',\n styleUrl: './sparkline.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Sparkline {\n values = input.required<number[]>()\n tableCaption = input.required<string>()\n xColumn = input.required<string>()\n yColumn = input.required<string>()\n locale = input.required<string>()\n emptyMessage = input.required<string>()\n width = input(80)\n height = input(24)\n\n protected readonly activeIndex = signal<number | null>(null)\n\n protected readonly viewBox = computed(() => `0 0 ${this.width()} ${this.height()}`)\n\n protected readonly columns = computed(() => [this.xColumn(), this.yColumn()])\n\n protected readonly tableRows = computed<(string | number)[][]>(() =>\n this.values().map((value, index) => [\n formatNumber(index + 1, this.locale()),\n formatNumber(value, this.locale()),\n ]),\n )\n\n private readonly scales = computed(() => {\n const values = this.values()\n const min = Math.min(...values)\n const max = Math.max(...values)\n return {\n x: linearScale([0, Math.max(values.length - 1, 0)], [MARGIN, this.width() - MARGIN]),\n y: linearScale([min, max], [this.height() - MARGIN, MARGIN]),\n }\n })\n\n protected readonly path = computed(() => {\n const values = this.values()\n if (values.length === 0) return null\n const { x, y } = this.scales()\n return linePath(values.map((value, index) => ({ x: x.map(index), y: y.map(value) })))\n })\n\n protected readonly positions = computed<number[]>(() => {\n const { x } = this.scales()\n return this.values().map((_, index) => x.map(index))\n })\n\n protected readonly dot = computed<{ x: number; y: number } | null>(() => {\n const index = this.activeIndex()\n if (index === null) return null\n const value = this.values()[index]\n if (value === undefined) return null\n const { x, y } = this.scales()\n return { x: x.map(index), y: y.map(value) }\n })\n\n protected readonly tooltip = computed<string | null>(() => {\n const index = this.activeIndex()\n if (index === null) return null\n const value = this.values()[index]\n if (value === undefined) return null\n return `${this.xColumn()} ${formatNumber(index + 1, this.locale())} — ${this.yColumn()} ${formatNumber(value, this.locale())}`\n })\n\n protected onPointerMove(event: PointerEvent | MouseEvent): void {\n const positions = this.positions()\n if (positions.length === 0) return\n const rect = (event.currentTarget as Element).getBoundingClientRect()\n this.activeIndex.set(nearestIndex(positions, event.clientX - rect.left))\n }\n\n protected onPointerLeave(event: PointerEvent | MouseEvent): void {\n const target = event.currentTarget as Element\n if (target.ownerDocument.activeElement === target) return\n this.activeIndex.set(null)\n }\n\n protected onBlur(): void {\n this.activeIndex.set(null)\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const lastIndex = this.values().length - 1\n if (lastIndex < 0) return\n const current = this.activeIndex()\n switch (event.key) {\n case 'ArrowRight':\n this.activeIndex.set(current === null ? 0 : Math.min(lastIndex, current + 1))\n break\n case 'ArrowLeft':\n this.activeIndex.set(current === null ? lastIndex : Math.max(0, current - 1))\n break\n case 'Home':\n this.activeIndex.set(0)\n break\n case 'End':\n this.activeIndex.set(lastIndex)\n break\n case 'Escape':\n this.activeIndex.set(null)\n break\n default:\n return\n }\n event.preventDefault()\n }\n}\n","@if (path(); as d) {\n <div class=\"gbt-sparkline\" role=\"status\" aria-live=\"polite\">\n <svg\n class=\"gbt-sparkline__svg\"\n [attr.viewBox]=\"viewBox()\"\n [attr.width]=\"width()\"\n [attr.height]=\"height()\"\n tabindex=\"0\"\n role=\"group\"\n [attr.aria-label]=\"tableCaption()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n >\n <path class=\"gbt-sparkline__line\" [attr.d]=\"d\" />\n @if (dot(); as p) {\n <circle class=\"gbt-sparkline__dot\" [attr.cx]=\"p.x\" [attr.cy]=\"p.y\" r=\"3\" />\n }\n </svg>\n @if (tooltip(); as text) {\n <span class=\"gbt-sparkline__tooltip\">{{ text }}</span>\n }\n </div>\n <gbt-chart-table [caption]=\"tableCaption()\" [columns]=\"columns()\" [rows]=\"tableRows()\" />\n} @else {\n <gbt-ch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QAAA,CAAA,WAAA,aAAA;GAAA,SAAA,CAAA,QAAA;EAAA,GAAA;GAAA,MAAA;GAAA,MAAE;GAAU,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;GAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAKrB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAS,YAAA,CAAA;EARrB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAe,YACb;GAAI,SACP,CAAC,YAAY,UAAU;GAAC,iBAGhB,wBAAwB;GAAM,UAAA;GAAA,QAAA,CAAA,yvDAAA;EAAA,CAAA"}
|
|
@@ -5,7 +5,7 @@ var Spinner = class Spinner {
|
|
|
5
5
|
label = input("Loading…", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
6
6
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
7
7
|
minVersion: "12.0.0",
|
|
8
|
-
version: "22.2.
|
|
8
|
+
version: "22.2.6",
|
|
9
9
|
ngImport: i0,
|
|
10
10
|
type: Spinner,
|
|
11
11
|
deps: [],
|
|
@@ -13,7 +13,7 @@ var Spinner = class Spinner {
|
|
|
13
13
|
});
|
|
14
14
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
15
15
|
minVersion: "17.1.0",
|
|
16
|
-
version: "22.2.
|
|
16
|
+
version: "22.2.6",
|
|
17
17
|
type: Spinner,
|
|
18
18
|
isStandalone: true,
|
|
19
19
|
selector: "gbt-spinner",
|
|
@@ -45,7 +45,7 @@ var Spinner = class Spinner {
|
|
|
45
45
|
};
|
|
46
46
|
i0.ɵɵngDeclareClassMetadata({
|
|
47
47
|
minVersion: "12.0.0",
|
|
48
|
-
version: "22.2.
|
|
48
|
+
version: "22.2.6",
|
|
49
49
|
ngImport: i0,
|
|
50
50
|
type: Spinner,
|
|
51
51
|
decorators: [{
|
|
@@ -10,7 +10,7 @@ var StatGrid = class StatGrid {
|
|
|
10
10
|
placeholders = computed(() => Array.from({ length: Math.max(0, Math.round(this.loadingCount())) }, (_, i) => i), ...ngDevMode ? [{ debugName: "placeholders" }] : /* istanbul ignore next */ []);
|
|
11
11
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
12
12
|
minVersion: "12.0.0",
|
|
13
|
-
version: "22.2.
|
|
13
|
+
version: "22.2.6",
|
|
14
14
|
ngImport: i0,
|
|
15
15
|
type: StatGrid,
|
|
16
16
|
deps: [],
|
|
@@ -18,7 +18,7 @@ var StatGrid = class StatGrid {
|
|
|
18
18
|
});
|
|
19
19
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
20
20
|
minVersion: "17.0.0",
|
|
21
|
-
version: "22.2.
|
|
21
|
+
version: "22.2.6",
|
|
22
22
|
type: StatGrid,
|
|
23
23
|
isStandalone: true,
|
|
24
24
|
selector: "gbt-stat-grid",
|
|
@@ -77,7 +77,7 @@ var StatGrid = class StatGrid {
|
|
|
77
77
|
};
|
|
78
78
|
i0.ɵɵngDeclareClassMetadata({
|
|
79
79
|
minVersion: "12.0.0",
|
|
80
|
-
version: "22.2.
|
|
80
|
+
version: "22.2.6",
|
|
81
81
|
ngImport: i0,
|
|
82
82
|
type: StatGrid,
|
|
83
83
|
decorators: [{
|
|
@@ -6,7 +6,7 @@ import { StatGrid } from "@masmarino/gabarit/stat-grid";
|
|
|
6
6
|
var StatTileLink = class StatTileLink {
|
|
7
7
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
8
8
|
minVersion: "12.0.0",
|
|
9
|
-
version: "22.2.
|
|
9
|
+
version: "22.2.6",
|
|
10
10
|
ngImport: i0,
|
|
11
11
|
type: StatTileLink,
|
|
12
12
|
deps: [],
|
|
@@ -14,7 +14,7 @@ var StatTileLink = class StatTileLink {
|
|
|
14
14
|
});
|
|
15
15
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
16
16
|
minVersion: "14.0.0",
|
|
17
|
-
version: "22.2.
|
|
17
|
+
version: "22.2.6",
|
|
18
18
|
type: StatTileLink,
|
|
19
19
|
isStandalone: true,
|
|
20
20
|
selector: "a[gbtStatTileLink]",
|
|
@@ -22,13 +22,13 @@ var StatTileLink = class StatTileLink {
|
|
|
22
22
|
ngImport: i0,
|
|
23
23
|
template: "<ng-content />",
|
|
24
24
|
isInline: true,
|
|
25
|
-
styles: [":host{color:inherit;text-decoration:none}:host:hover{text-decoration:underline;text-underline-offset:.2em}:host:focus-visible{outline:none}:host:after{content:\"\";position:absolute;inset:0;border-radius:var(--
|
|
25
|
+
styles: [":host{color:inherit;text-decoration:none}:host:hover{text-decoration:underline;text-underline-offset:.2em}:host:focus-visible{outline:none}:host:after{content:\"\";position:absolute;inset:0;border-radius:var(--gbt-radius-glass)}:host:focus-visible:after{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}\n"],
|
|
26
26
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
i0.ɵɵngDeclareClassMetadata({
|
|
30
30
|
minVersion: "12.0.0",
|
|
31
|
-
version: "22.2.
|
|
31
|
+
version: "22.2.6",
|
|
32
32
|
ngImport: i0,
|
|
33
33
|
type: StatTileLink,
|
|
34
34
|
decorators: [{
|
|
@@ -39,7 +39,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
39
39
|
template: "<ng-content />",
|
|
40
40
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
41
|
host: { class: "gbt-stat-tile__link" },
|
|
42
|
-
styles: [":host{color:inherit;text-decoration:none}:host:hover{text-decoration:underline;text-underline-offset:.2em}:host:focus-visible{outline:none}:host:after{content:\"\";position:absolute;inset:0;border-radius:var(--
|
|
42
|
+
styles: [":host{color:inherit;text-decoration:none}:host:hover{text-decoration:underline;text-underline-offset:.2em}:host:focus-visible{outline:none}:host:after{content:\"\";position:absolute;inset:0;border-radius:var(--gbt-radius-glass)}:host:focus-visible:after{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}\n"]
|
|
43
43
|
}]
|
|
44
44
|
}]
|
|
45
45
|
});
|
|
@@ -67,7 +67,7 @@ var StatTile = class StatTile {
|
|
|
67
67
|
}
|
|
68
68
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
69
69
|
minVersion: "12.0.0",
|
|
70
|
-
version: "22.2.
|
|
70
|
+
version: "22.2.6",
|
|
71
71
|
ngImport: i0,
|
|
72
72
|
type: StatTile,
|
|
73
73
|
deps: [],
|
|
@@ -75,7 +75,7 @@ var StatTile = class StatTile {
|
|
|
75
75
|
});
|
|
76
76
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
77
77
|
minVersion: "17.0.0",
|
|
78
|
-
version: "22.2.
|
|
78
|
+
version: "22.2.6",
|
|
79
79
|
type: StatTile,
|
|
80
80
|
isStandalone: true,
|
|
81
81
|
selector: "gbt-stat-tile",
|
|
@@ -197,7 +197,7 @@ var StatTile = class StatTile {
|
|
|
197
197
|
};
|
|
198
198
|
i0.ɵɵngDeclareClassMetadata({
|
|
199
199
|
minVersion: "12.0.0",
|
|
200
|
-
version: "22.2.
|
|
200
|
+
version: "22.2.6",
|
|
201
201
|
ngImport: i0,
|
|
202
202
|
type: StatTile,
|
|
203
203
|
decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masmarino-gabarit-stat-tile.mjs","names":[],"sources":["../../../projects/gabarit/stat-tile/stat-tile-link.ts","../../../projects/gabarit/stat-tile/stat-tile.ts","../../../projects/gabarit/stat-tile/stat-tile.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core'\n\n@Component({\n selector: 'a[gbtStatTileLink]',\n standalone: true,\n template: '<ng-content />',\n styleUrl: './stat-tile-link.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'gbt-stat-tile__link' },\n})\nexport class StatTileLink {}\n","import {\n ChangeDetectionStrategy,\n Component,\n booleanAttribute,\n contentChild,\n inject,\n input,\n} from '@angular/core'\nimport { Icon } from '@masmarino/gabarit/icon'\nimport { IconMarker, IconMarkerTone } from '@masmarino/gabarit/icon-marker'\nimport { StatGrid } from '@masmarino/gabarit/stat-grid'\nimport { StatTileLink } from './stat-tile-link'\n\nexport type StatTileTrend = 'up' | 'down' | 'flat'\nexport type StatTileTrendTone = 'neutral' | 'success' | 'error'\n\n@Component({\n selector: 'gbt-stat-tile',\n standalone: true,\n imports: [Icon, IconMarker, StatTileLink],\n templateUrl: './stat-tile.html',\n styleUrl: './stat-tile.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.role]': 'grid ? \"listitem\" : null',\n '[attr.data-link]': 'linked() ? \"\" : null',\n '[attr.data-muted]': 'muted() ? \"\" : null',\n },\n})\nexport class StatTile {\n label = input('')\n value = input.required<string | number>()\n icon = input<string | null>(null)\n iconTone = input<IconMarkerTone>('info')\n hint = input<string | null>(null)\n trend = input<StatTileTrend | null>(null)\n trendLabel = input<string | null>(null)\n trendTone = input<StatTileTrendTone>('neutral')\n href = input<string | null>(null)\n muted = input(false, { transform: booleanAttribute })\n\n private readonly link = contentChild(StatTileLink)\n protected readonly grid = inject(StatGrid, { optional: true })\n\n protected linked(): boolean {\n return !!this.href() || !!this.link()\n }\n\n protected hasLink(): boolean {\n return !!this.link()\n }\n}\n","<div class=\"gbt-stat-tile\">\n <span class=\"gbt-stat-tile__label\">\n <ng-content select=\"a[gbtStatTileLink]\" />\n @if (!hasLink()) {\n @if (href(); as target) {\n <a gbtStatTileLink [attr.href]=\"target\">{{ label() }}</a>\n } @else {\n {{ label() }}\n }\n }\n </span>\n @if (icon(); as name) {\n <gbt-icon-marker\n class=\"gbt-stat-tile__icon\"\n [icon]=\"name\"\n [tone]=\"muted() ? 'neutral' : iconTone()\"\n shape=\"tile\"\n />\n }\n <span class=\"gbt-stat-tile__value\">{{ value() }}</span>\n @if (hint() || trendLabel()) {\n <span class=\"gbt-stat-tile__meta\">\n @if (trendLabel(); as text) {\n <span\n class=\"gbt-stat-tile__trend\"\n [attr.data-trend]=\"trend()\"\n [attr.data-tone]=\"trendTone()\"\n >\n @if (trend() === 'up') {\n <gbt-icon name=\"arrow-up\" />\n } @else if (trend() === 'down') {\n <gbt-icon name=\"arrow-down\" />\n }\n {{ text }}\n </span>\n }\n @if (hint(); as text) {\n <span class=\"gbt-stat-tile__hint\">{{ text }}</span>\n }\n </span>\n }\n</div>\n"],"mappings":";;;;;AAUA,IAAa,eAAb,MAAa,aAAY;CAAZ,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAY,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAZ,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAY,cAAA;EAAA,UAAA;EAAA,MAAA,EAAA,gBAAA,sBAAA;EAAA,UAAA;EAAA,UALb;EAAgB,UAAA;EAAA,QAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"masmarino-gabarit-stat-tile.mjs","names":[],"sources":["../../../projects/gabarit/stat-tile/stat-tile-link.ts","../../../projects/gabarit/stat-tile/stat-tile.ts","../../../projects/gabarit/stat-tile/stat-tile.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core'\n\n@Component({\n selector: 'a[gbtStatTileLink]',\n standalone: true,\n template: '<ng-content />',\n styleUrl: './stat-tile-link.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'gbt-stat-tile__link' },\n})\nexport class StatTileLink {}\n","import {\n ChangeDetectionStrategy,\n Component,\n booleanAttribute,\n contentChild,\n inject,\n input,\n} from '@angular/core'\nimport { Icon } from '@masmarino/gabarit/icon'\nimport { IconMarker, IconMarkerTone } from '@masmarino/gabarit/icon-marker'\nimport { StatGrid } from '@masmarino/gabarit/stat-grid'\nimport { StatTileLink } from './stat-tile-link'\n\nexport type StatTileTrend = 'up' | 'down' | 'flat'\nexport type StatTileTrendTone = 'neutral' | 'success' | 'error'\n\n@Component({\n selector: 'gbt-stat-tile',\n standalone: true,\n imports: [Icon, IconMarker, StatTileLink],\n templateUrl: './stat-tile.html',\n styleUrl: './stat-tile.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.role]': 'grid ? \"listitem\" : null',\n '[attr.data-link]': 'linked() ? \"\" : null',\n '[attr.data-muted]': 'muted() ? \"\" : null',\n },\n})\nexport class StatTile {\n label = input('')\n value = input.required<string | number>()\n icon = input<string | null>(null)\n iconTone = input<IconMarkerTone>('info')\n hint = input<string | null>(null)\n trend = input<StatTileTrend | null>(null)\n trendLabel = input<string | null>(null)\n trendTone = input<StatTileTrendTone>('neutral')\n href = input<string | null>(null)\n muted = input(false, { transform: booleanAttribute })\n\n private readonly link = contentChild(StatTileLink)\n protected readonly grid = inject(StatGrid, { optional: true })\n\n protected linked(): boolean {\n return !!this.href() || !!this.link()\n }\n\n protected hasLink(): boolean {\n return !!this.link()\n }\n}\n","<div class=\"gbt-stat-tile\">\n <span class=\"gbt-stat-tile__label\">\n <ng-content select=\"a[gbtStatTileLink]\" />\n @if (!hasLink()) {\n @if (href(); as target) {\n <a gbtStatTileLink [attr.href]=\"target\">{{ label() }}</a>\n } @else {\n {{ label() }}\n }\n }\n </span>\n @if (icon(); as name) {\n <gbt-icon-marker\n class=\"gbt-stat-tile__icon\"\n [icon]=\"name\"\n [tone]=\"muted() ? 'neutral' : iconTone()\"\n shape=\"tile\"\n />\n }\n <span class=\"gbt-stat-tile__value\">{{ value() }}</span>\n @if (hint() || trendLabel()) {\n <span class=\"gbt-stat-tile__meta\">\n @if (trendLabel(); as text) {\n <span\n class=\"gbt-stat-tile__trend\"\n [attr.data-trend]=\"trend()\"\n [attr.data-tone]=\"trendTone()\"\n >\n @if (trend() === 'up') {\n <gbt-icon name=\"arrow-up\" />\n } @else if (trend() === 'down') {\n <gbt-icon name=\"arrow-down\" />\n }\n {{ text }}\n </span>\n }\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A;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,YAAY,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -30,7 +30,7 @@ var Stepper = class Stepper {
|
|
|
30
30
|
}
|
|
31
31
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
32
32
|
minVersion: "12.0.0",
|
|
33
|
-
version: "22.2.
|
|
33
|
+
version: "22.2.6",
|
|
34
34
|
ngImport: i0,
|
|
35
35
|
type: Stepper,
|
|
36
36
|
deps: [],
|
|
@@ -38,7 +38,7 @@ var Stepper = class Stepper {
|
|
|
38
38
|
});
|
|
39
39
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
40
40
|
minVersion: "17.0.0",
|
|
41
|
-
version: "22.2.
|
|
41
|
+
version: "22.2.6",
|
|
42
42
|
type: Stepper,
|
|
43
43
|
isStandalone: true,
|
|
44
44
|
selector: "gbt-stepper",
|
|
@@ -106,7 +106,7 @@ var Stepper = class Stepper {
|
|
|
106
106
|
},
|
|
107
107
|
ngImport: i0,
|
|
108
108
|
template: "<ng-template #content let-index=\"index\" let-step=\"step\">\n <span class=\"gbt-stepper__indicator\">\n @switch (statusOf(index)) {\n @case ('completed') {\n <gbt-icon name=\"check\" aria-hidden=\"true\" />\n }\n @case ('error') {\n <gbt-icon name=\"alert-triangle\" aria-hidden=\"true\" />\n }\n @default {\n {{ index + 1 }}\n }\n }\n </span>\n <span class=\"gbt-stepper__label\">\n {{ step.label }}\n @if (statusOf(index) === 'completed') {\n <span class=\"sr-only\"> — {{ completedLabel() }}</span>\n } @else if (statusOf(index) === 'error') {\n <span class=\"sr-only\"> — {{ errorLabel() }}</span>\n }\n @if (isSelected(index)) {\n <span class=\"sr-only\"> — {{ selectedLabel() }}</span>\n }\n </span>\n</ng-template>\n\n<ol class=\"gbt-stepper\" [attr.data-orientation]=\"orientation()\">\n @for (step of steps(); track $index) {\n <li\n class=\"gbt-stepper__step\"\n [attr.data-status]=\"statusOf($index)\"\n [attr.data-selected]=\"isSelected($index) ? '' : null\"\n [attr.aria-current]=\"statusOf($index) === 'current' ? 'step' : null\"\n >\n @if (interactive()) {\n <button type=\"button\" class=\"gbt-stepper__button\" (click)=\"select($index)\">\n <ng-container *ngTemplateOutlet=\"content; context: { index: $index, step: step }\" />\n </button>\n } @else {\n <ng-container *ngTemplateOutlet=\"content; context: { index: $index, step: step }\" />\n }\n </li>\n }\n</ol>\n",
|
|
109
|
-
styles: [".gbt-stepper{display:flex;margin:0;padding:0;list-style:none}.gbt-stepper[data-orientation=horizontal]{flex-direction:row}.gbt-stepper[data-orientation=vertical]{flex-direction:column;gap:.5rem}.gbt-stepper__step{position:relative;display:flex;flex:1;align-items:center;gap:.5rem}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__step{flex-direction:column}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__step:not(:first-child):before{content:\"\";position:absolute;top:15px;right:calc(50% + 16px);left:calc(-50% + 16px);height:2px;background:var(--border-color)}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__step[data-status=completed]:not(:first-child):before{background:var(--primary)}.gbt-stepper[data-orientation=vertical] .gbt-stepper__step{flex:none;flex-direction:row}.gbt-stepper[data-orientation=vertical] .gbt-stepper__step:not(:last-child):before{content:\"\";position:absolute;top:32px;bottom:-8px;left:15px;width:2px;background:var(--border-color)}.gbt-stepper[data-orientation=vertical] .gbt-stepper__step[data-status=completed]:not(:last-child):before{background:var(--primary)}.gbt-stepper__indicator{position:relative;z-index:1;box-sizing:border-box;display:flex;flex-shrink:0;align-items:center;justify-content:center;width:32px;height:32px;background:var(--bg-principal);border:2px solid var(--border-color);border-radius:50%;color:var(--text-secondary);font-size:13px;font-weight:600}.gbt-stepper__step[data-status=current] .gbt-stepper__indicator{border-color:var(--primary);color:var(--primary)}.gbt-stepper__step[data-status=completed] .gbt-stepper__indicator{background:var(--primary);border-color:var(--primary);color:var(--text-on-primary)}.gbt-stepper__step[data-status=error] .gbt-stepper__indicator{border-color:var(--color-error-text);color:var(--color-error-text)}.gbt-stepper__label{font-size:13px;font-weight:600;color:var(--text-secondary);text-align:center}.gbt-stepper[data-orientation=vertical] .gbt-stepper__label{text-align:left}.gbt-stepper__step[data-status=current] .gbt-stepper__label{color:var(--text-primary)}.gbt-stepper__step[data-status=error] .gbt-stepper__label{color:var(--color-error-text)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.gbt-stepper__button{display:flex;align-items:center;gap:.5rem;padding:0;background:none;border:0;border-radius:
|
|
109
|
+
styles: [".gbt-stepper{display:flex;margin:0;padding:0;list-style:none}.gbt-stepper[data-orientation=horizontal]{flex-direction:row}.gbt-stepper[data-orientation=vertical]{flex-direction:column;gap:.5rem}.gbt-stepper__step{position:relative;display:flex;flex:1;align-items:center;gap:.5rem}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__step{flex-direction:column}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__step:not(:first-child):before{content:\"\";position:absolute;top:15px;right:calc(50% + 16px);left:calc(-50% + 16px);height:2px;background:var(--border-color)}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__step[data-status=completed]:not(:first-child):before{background:var(--primary)}.gbt-stepper[data-orientation=vertical] .gbt-stepper__step{flex:none;flex-direction:row}.gbt-stepper[data-orientation=vertical] .gbt-stepper__step:not(:last-child):before{content:\"\";position:absolute;top:32px;bottom:-8px;left:15px;width:2px;background:var(--border-color)}.gbt-stepper[data-orientation=vertical] .gbt-stepper__step[data-status=completed]:not(:last-child):before{background:var(--primary)}.gbt-stepper__indicator{position:relative;z-index:1;box-sizing:border-box;display:flex;flex-shrink:0;align-items:center;justify-content:center;width:32px;height:32px;background:var(--bg-principal);border:2px solid var(--border-color);border-radius:50%;color:var(--text-secondary);font-size:13px;font-weight:600}.gbt-stepper__step[data-status=current] .gbt-stepper__indicator{border-color:var(--primary);color:var(--primary)}.gbt-stepper__step[data-status=completed] .gbt-stepper__indicator{background:var(--primary);border-color:var(--primary);color:var(--text-on-primary)}.gbt-stepper__step[data-status=error] .gbt-stepper__indicator{border-color:var(--color-error-text);color:var(--color-error-text)}.gbt-stepper__label{font-size:13px;font-weight:600;color:var(--text-secondary);text-align:center}.gbt-stepper[data-orientation=vertical] .gbt-stepper__label{text-align:left}.gbt-stepper__step[data-status=current] .gbt-stepper__label{color:var(--text-primary)}.gbt-stepper__step[data-status=error] .gbt-stepper__label{color:var(--color-error-text)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.gbt-stepper__button{display:flex;align-items:center;gap:.5rem;padding:0;background:none;border:0;border-radius:var(--site-border-radius);font:inherit;color:inherit;cursor:pointer}.gbt-stepper__button:hover .gbt-stepper__label{text-decoration:underline;text-underline-offset:4px}.gbt-stepper__button:active{opacity:.7}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__button{flex-direction:column}.gbt-stepper[data-orientation=vertical] .gbt-stepper__button{flex-direction:row}.gbt-stepper__button:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:4px}.gbt-stepper__step[data-selected] .gbt-stepper__indicator{box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 30%,transparent)}.gbt-stepper__step[data-selected] .gbt-stepper__label{text-decoration:underline;text-underline-offset:4px}\n"],
|
|
110
110
|
dependencies: [{
|
|
111
111
|
kind: "component",
|
|
112
112
|
type: Icon,
|
|
@@ -127,7 +127,7 @@ var Stepper = class Stepper {
|
|
|
127
127
|
};
|
|
128
128
|
i0.ɵɵngDeclareClassMetadata({
|
|
129
129
|
minVersion: "12.0.0",
|
|
130
|
-
version: "22.2.
|
|
130
|
+
version: "22.2.6",
|
|
131
131
|
ngImport: i0,
|
|
132
132
|
type: Stepper,
|
|
133
133
|
decorators: [{
|
|
@@ -138,7 +138,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
138
138
|
imports: [Icon, NgTemplateOutlet],
|
|
139
139
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
140
140
|
template: "<ng-template #content let-index=\"index\" let-step=\"step\">\n <span class=\"gbt-stepper__indicator\">\n @switch (statusOf(index)) {\n @case ('completed') {\n <gbt-icon name=\"check\" aria-hidden=\"true\" />\n }\n @case ('error') {\n <gbt-icon name=\"alert-triangle\" aria-hidden=\"true\" />\n }\n @default {\n {{ index + 1 }}\n }\n }\n </span>\n <span class=\"gbt-stepper__label\">\n {{ step.label }}\n @if (statusOf(index) === 'completed') {\n <span class=\"sr-only\"> — {{ completedLabel() }}</span>\n } @else if (statusOf(index) === 'error') {\n <span class=\"sr-only\"> — {{ errorLabel() }}</span>\n }\n @if (isSelected(index)) {\n <span class=\"sr-only\"> — {{ selectedLabel() }}</span>\n }\n </span>\n</ng-template>\n\n<ol class=\"gbt-stepper\" [attr.data-orientation]=\"orientation()\">\n @for (step of steps(); track $index) {\n <li\n class=\"gbt-stepper__step\"\n [attr.data-status]=\"statusOf($index)\"\n [attr.data-selected]=\"isSelected($index) ? '' : null\"\n [attr.aria-current]=\"statusOf($index) === 'current' ? 'step' : null\"\n >\n @if (interactive()) {\n <button type=\"button\" class=\"gbt-stepper__button\" (click)=\"select($index)\">\n <ng-container *ngTemplateOutlet=\"content; context: { index: $index, step: step }\" />\n </button>\n } @else {\n <ng-container *ngTemplateOutlet=\"content; context: { index: $index, step: step }\" />\n }\n </li>\n }\n</ol>\n",
|
|
141
|
-
styles: [".gbt-stepper{display:flex;margin:0;padding:0;list-style:none}.gbt-stepper[data-orientation=horizontal]{flex-direction:row}.gbt-stepper[data-orientation=vertical]{flex-direction:column;gap:.5rem}.gbt-stepper__step{position:relative;display:flex;flex:1;align-items:center;gap:.5rem}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__step{flex-direction:column}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__step:not(:first-child):before{content:\"\";position:absolute;top:15px;right:calc(50% + 16px);left:calc(-50% + 16px);height:2px;background:var(--border-color)}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__step[data-status=completed]:not(:first-child):before{background:var(--primary)}.gbt-stepper[data-orientation=vertical] .gbt-stepper__step{flex:none;flex-direction:row}.gbt-stepper[data-orientation=vertical] .gbt-stepper__step:not(:last-child):before{content:\"\";position:absolute;top:32px;bottom:-8px;left:15px;width:2px;background:var(--border-color)}.gbt-stepper[data-orientation=vertical] .gbt-stepper__step[data-status=completed]:not(:last-child):before{background:var(--primary)}.gbt-stepper__indicator{position:relative;z-index:1;box-sizing:border-box;display:flex;flex-shrink:0;align-items:center;justify-content:center;width:32px;height:32px;background:var(--bg-principal);border:2px solid var(--border-color);border-radius:50%;color:var(--text-secondary);font-size:13px;font-weight:600}.gbt-stepper__step[data-status=current] .gbt-stepper__indicator{border-color:var(--primary);color:var(--primary)}.gbt-stepper__step[data-status=completed] .gbt-stepper__indicator{background:var(--primary);border-color:var(--primary);color:var(--text-on-primary)}.gbt-stepper__step[data-status=error] .gbt-stepper__indicator{border-color:var(--color-error-text);color:var(--color-error-text)}.gbt-stepper__label{font-size:13px;font-weight:600;color:var(--text-secondary);text-align:center}.gbt-stepper[data-orientation=vertical] .gbt-stepper__label{text-align:left}.gbt-stepper__step[data-status=current] .gbt-stepper__label{color:var(--text-primary)}.gbt-stepper__step[data-status=error] .gbt-stepper__label{color:var(--color-error-text)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.gbt-stepper__button{display:flex;align-items:center;gap:.5rem;padding:0;background:none;border:0;border-radius:
|
|
141
|
+
styles: [".gbt-stepper{display:flex;margin:0;padding:0;list-style:none}.gbt-stepper[data-orientation=horizontal]{flex-direction:row}.gbt-stepper[data-orientation=vertical]{flex-direction:column;gap:.5rem}.gbt-stepper__step{position:relative;display:flex;flex:1;align-items:center;gap:.5rem}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__step{flex-direction:column}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__step:not(:first-child):before{content:\"\";position:absolute;top:15px;right:calc(50% + 16px);left:calc(-50% + 16px);height:2px;background:var(--border-color)}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__step[data-status=completed]:not(:first-child):before{background:var(--primary)}.gbt-stepper[data-orientation=vertical] .gbt-stepper__step{flex:none;flex-direction:row}.gbt-stepper[data-orientation=vertical] .gbt-stepper__step:not(:last-child):before{content:\"\";position:absolute;top:32px;bottom:-8px;left:15px;width:2px;background:var(--border-color)}.gbt-stepper[data-orientation=vertical] .gbt-stepper__step[data-status=completed]:not(:last-child):before{background:var(--primary)}.gbt-stepper__indicator{position:relative;z-index:1;box-sizing:border-box;display:flex;flex-shrink:0;align-items:center;justify-content:center;width:32px;height:32px;background:var(--bg-principal);border:2px solid var(--border-color);border-radius:50%;color:var(--text-secondary);font-size:13px;font-weight:600}.gbt-stepper__step[data-status=current] .gbt-stepper__indicator{border-color:var(--primary);color:var(--primary)}.gbt-stepper__step[data-status=completed] .gbt-stepper__indicator{background:var(--primary);border-color:var(--primary);color:var(--text-on-primary)}.gbt-stepper__step[data-status=error] .gbt-stepper__indicator{border-color:var(--color-error-text);color:var(--color-error-text)}.gbt-stepper__label{font-size:13px;font-weight:600;color:var(--text-secondary);text-align:center}.gbt-stepper[data-orientation=vertical] .gbt-stepper__label{text-align:left}.gbt-stepper__step[data-status=current] .gbt-stepper__label{color:var(--text-primary)}.gbt-stepper__step[data-status=error] .gbt-stepper__label{color:var(--color-error-text)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.gbt-stepper__button{display:flex;align-items:center;gap:.5rem;padding:0;background:none;border:0;border-radius:var(--site-border-radius);font:inherit;color:inherit;cursor:pointer}.gbt-stepper__button:hover .gbt-stepper__label{text-decoration:underline;text-underline-offset:4px}.gbt-stepper__button:active{opacity:.7}.gbt-stepper[data-orientation=horizontal] .gbt-stepper__button{flex-direction:column}.gbt-stepper[data-orientation=vertical] .gbt-stepper__button{flex-direction:row}.gbt-stepper__button:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:4px}.gbt-stepper__step[data-selected] .gbt-stepper__indicator{box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 30%,transparent)}.gbt-stepper__step[data-selected] .gbt-stepper__label{text-decoration:underline;text-underline-offset:4px}\n"]
|
|
142
142
|
}]
|
|
143
143
|
}],
|
|
144
144
|
propDecorators: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masmarino-gabarit-stepper.mjs","names":[],"sources":["../../../projects/gabarit/stepper/stepper.ts","../../../projects/gabarit/stepper/stepper.html"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common'\nimport { ChangeDetectionStrategy, Component, booleanAttribute, input, model } from '@angular/core'\nimport { Icon } from '@masmarino/gabarit/icon'\n\nexport type StepperStatus = 'upcoming' | 'current' | 'completed' | 'error'\nexport type StepperOrientation = 'horizontal' | 'vertical'\n\nexport interface StepperStep {\n label: string\n hasError?: boolean\n}\n\n@Component({\n selector: 'gbt-stepper',\n standalone: true,\n imports: [Icon, NgTemplateOutlet],\n templateUrl: './stepper.html',\n styleUrl: './stepper.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Stepper {\n steps = input.required<StepperStep[]>()\n activeIndex = model(0)\n orientation = input<StepperOrientation>('horizontal')\n completedLabel = input<string>('Completed')\n errorLabel = input<string>('Error')\n interactive = input(false, { transform: booleanAttribute })\n selectedIndex = model<number | null>(null)\n selectedLabel = input<string>('Selected')\n\n protected select(index: number): void {\n this.selectedIndex.set(index)\n }\n\n protected isSelected(index: number): boolean {\n return this.interactive() && this.selectedIndex() === index\n }\n\n protected statusOf(index: number): StepperStatus {\n const step = this.steps()[index]\n const active = this.activeIndex()\n if (step.hasError && index <= active) {\n return 'error'\n }\n if (index < active) {\n return 'completed'\n }\n if (index === active) {\n return 'current'\n }\n return 'upcoming'\n }\n}\n","<ng-template #content let-index=\"index\" let-step=\"step\">\n <span class=\"gbt-stepper__indicator\">\n @switch (statusOf(index)) {\n @case ('completed') {\n <gbt-icon name=\"check\" aria-hidden=\"true\" />\n }\n @case ('error') {\n <gbt-icon name=\"alert-triangle\" aria-hidden=\"true\" />\n }\n @default {\n {{ index + 1 }}\n }\n }\n </span>\n <span class=\"gbt-stepper__label\">\n {{ step.label }}\n @if (statusOf(index) === 'completed') {\n <span class=\"sr-only\"> — {{ completedLabel() }}</span>\n } @else if (statusOf(index) === 'error') {\n <span class=\"sr-only\"> — {{ errorLabel() }}</span>\n }\n @if (isSelected(index)) {\n <span class=\"sr-only\"> — {{ selectedLabel() }}</span>\n }\n </span>\n</ng-template>\n\n<ol class=\"gbt-stepper\" [attr.data-orientation]=\"orientation()\">\n @for (step of steps(); track $index) {\n <li\n class=\"gbt-stepper__step\"\n [attr.data-status]=\"statusOf($index)\"\n [attr.data-selected]=\"isSelected($index) ? '' : null\"\n [attr.aria-current]=\"statusOf($index) === 'current' ? 'step' : null\"\n >\n @if (interactive()) {\n <button type=\"button\" class=\"gbt-stepper__button\" (click)=\"select($index)\">\n <ng-container *ngTemplateOutlet=\"content; context: { index: $index, step: step }\" />\n </button>\n } @else {\n <ng-container *ngTemplateOutlet=\"content; context: { index: $index, step: step }\" />\n }\n </li>\n }\n</ol>\n"],"mappings":";;;;AAoBA,IAAa,UAAb,MAAa,QAAO;CAClB,QAAQ,MAAM,SAAyB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACvC,cAAc,MAAM,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CACtB,cAAc,MAA0B,cAAa,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CACrD,iBAAiB,MAAc,aAAY,GAAA,YAAA,CAAA,EAAA,WAAA,i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;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,YAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,aAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,eAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,eAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA;GAAA,aAAA;GAAA,eAAA;EAAA;EAAA,UAAA;EAAA,UCpBpB;EA6CA,QAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"masmarino-gabarit-stepper.mjs","names":[],"sources":["../../../projects/gabarit/stepper/stepper.ts","../../../projects/gabarit/stepper/stepper.html"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common'\nimport { ChangeDetectionStrategy, Component, booleanAttribute, input, model } from '@angular/core'\nimport { Icon } from '@masmarino/gabarit/icon'\n\nexport type StepperStatus = 'upcoming' | 'current' | 'completed' | 'error'\nexport type StepperOrientation = 'horizontal' | 'vertical'\n\nexport interface StepperStep {\n label: string\n hasError?: boolean\n}\n\n@Component({\n selector: 'gbt-stepper',\n standalone: true,\n imports: [Icon, NgTemplateOutlet],\n templateUrl: './stepper.html',\n styleUrl: './stepper.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Stepper {\n steps = input.required<StepperStep[]>()\n activeIndex = model(0)\n orientation = input<StepperOrientation>('horizontal')\n completedLabel = input<string>('Completed')\n errorLabel = input<string>('Error')\n interactive = input(false, { transform: booleanAttribute })\n selectedIndex = model<number | null>(null)\n selectedLabel = input<string>('Selected')\n\n protected select(index: number): void {\n this.selectedIndex.set(index)\n }\n\n protected isSelected(index: number): boolean {\n return this.interactive() && this.selectedIndex() === index\n }\n\n protected statusOf(index: number): StepperStatus {\n const step = this.steps()[index]\n const active = this.activeIndex()\n if (step.hasError && index <= active) {\n return 'error'\n }\n if (index < active) {\n return 'completed'\n }\n if (index === active) {\n return 'current'\n }\n return 'upcoming'\n }\n}\n","<ng-template #content let-index=\"index\" let-step=\"step\">\n <span class=\"gbt-stepper__indicator\">\n @switch (statusOf(index)) {\n @case ('completed') {\n <gbt-icon name=\"check\" aria-hidden=\"true\" />\n }\n @case ('error') {\n <gbt-icon name=\"alert-triangle\" aria-hidden=\"true\" />\n }\n @default {\n {{ index + 1 }}\n }\n }\n </span>\n <span class=\"gbt-stepper__label\">\n {{ step.label }}\n @if (statusOf(index) === 'completed') {\n <span class=\"sr-only\"> — {{ completedLabel() }}</span>\n } @else if (statusOf(index) === 'error') {\n <span class=\"sr-only\"> — {{ errorLabel() }}</span>\n }\n @if (isSelected(index)) {\n <span class=\"sr-only\"> — {{ selectedLabel() }}</span>\n }\n </span>\n</ng-template>\n\n<ol class=\"gbt-stepper\" [attr.data-orientation]=\"orientation()\">\n @for (step of steps(); track $index) {\n <li\n class=\"gbt-stepper__step\"\n [attr.data-status]=\"statusOf($index)\"\n [attr.data-selected]=\"isSelected($index) ? '' : null\"\n [attr.aria-current]=\"statusOf($index) === 'current' ? 'step' : null\"\n >\n @if (interactive()) {\n <button type=\"button\" class=\"gbt-stepper__button\" (click)=\"select($index)\">\n <ng-container *ngTemplateOutlet=\"content; context: { index: $index, step: step }\" />\n </button>\n } @else {\n <ng-container *ngTemplateOutlet=\"content; context: { index: $index, step: step }\" />\n }\n </li>\n }\n</ol>\n"],"mappings":";;;;AAoBA,IAAa,UAAb,MAAa,QAAO;CAClB,QAAQ,MAAM,SAAyB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACvC,cAAc,MAAM,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CACtB,cAAc,MAA0B,c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
|
+
version: "22.2.6",
|
|
40
40
|
ngImport: i0,
|
|
41
41
|
type: Switch,
|
|
42
42
|
deps: [],
|
|
@@ -44,7 +44,7 @@ var Switch = class Switch {
|
|
|
44
44
|
});
|
|
45
45
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
46
46
|
minVersion: "17.0.0",
|
|
47
|
-
version: "22.2.
|
|
47
|
+
version: "22.2.6",
|
|
48
48
|
type: Switch,
|
|
49
49
|
isStandalone: true,
|
|
50
50
|
selector: "gbt-switch",
|
|
@@ -86,13 +86,13 @@ var Switch = class Switch {
|
|
|
86
86
|
}],
|
|
87
87
|
ngImport: i0,
|
|
88
88
|
template: "<label class=\"gbt-switch\" [class.gbt-switch--disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"gbt-switch__input\"\n [id]=\"id()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-describedby]=\"hint() ? hintId() : null\"\n (change)=\"onToggle($event)\"\n />\n <span class=\"gbt-switch__track\">\n <span class=\"gbt-switch__thumb\"></span>\n </span>\n <span>{{ label() }}</span>\n</label>\n@if (hint()) {\n <p [id]=\"hintId()\" class=\"gbt-switch__hint\">{{ hint() }}</p>\n}\n",
|
|
89
|
-
styles: [":host(.gbt-switch-host--hint){display:block}.gbt-switch{position:relative;display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--text-primary);cursor:pointer}.gbt-switch:before{content:\"\";position:absolute;inset:50% auto auto 50%;width:max(100%,24px);height:max(100%,24px);transform:translate(-50%,-50%)}.gbt-switch--disabled{cursor:not-allowed;opacity:.5}.gbt-switch__input{position:absolute;width:2.25rem;height:1.25rem;margin:0;opacity:0;cursor:inherit}.gbt-switch__track{position:relative;display:inline-flex;flex-shrink:0;align-items:center;width:2.25rem;height:1.25rem;background:var(--border-color);border-radius:999px;box-shadow:var(--gbt-depth-hollow);transition:background .15s ease,box-shadow .15s ease}.gbt-switch:not(.gbt-switch--disabled):hover .gbt-switch__track{background:var(--text-discret)}.gbt-switch__input:checked+.gbt-switch__track{background:var(--accent);box-shadow:var(--gbt-depth-hollow),var(--gbt-glow)}.gbt-switch:not(.gbt-switch--disabled):hover .gbt-switch__input:checked+.gbt-switch__track{background:var(--accent);box-shadow:var(--gbt-depth-hollow),var(--gbt-glow-hover)}.gbt-switch__input:focus-visible+.gbt-switch__track{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-switch__thumb{position:absolute;top:.125rem;left:.125rem;width:1rem;height:1rem;background:var(--gbt-knob);border-radius:
|
|
89
|
+
styles: [":host(.gbt-switch-host--hint){display:block}.gbt-switch{position:relative;display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--text-primary);cursor:pointer}.gbt-switch:before{content:\"\";position:absolute;inset:50% auto auto 50%;width:max(100%,24px);height:max(100%,24px);transform:translate(-50%,-50%)}.gbt-switch--disabled{cursor:not-allowed;opacity:.5}.gbt-switch__input{position:absolute;width:2.25rem;height:1.25rem;margin:0;opacity:0;cursor:inherit}.gbt-switch__track{position:relative;display:inline-flex;flex-shrink:0;align-items:center;width:2.25rem;height:1.25rem;background:var(--border-color);border-radius:999px;box-shadow:var(--gbt-depth-hollow);transition:background .15s ease,box-shadow .15s ease}.gbt-switch:not(.gbt-switch--disabled):hover .gbt-switch__track{background:var(--text-discret)}.gbt-switch__input:checked+.gbt-switch__track{background:var(--accent);box-shadow:var(--gbt-depth-hollow),var(--gbt-glow)}.gbt-switch:not(.gbt-switch--disabled):hover .gbt-switch__input:checked+.gbt-switch__track{background:var(--accent);box-shadow:var(--gbt-depth-hollow),var(--gbt-glow-hover)}.gbt-switch__input:focus-visible+.gbt-switch__track{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-switch__thumb{position:absolute;top:.125rem;left:.125rem;width:1rem;height:1rem;background:var(--gbt-knob);border-radius:999px;box-shadow:var(--gbt-depth-knob);transition:transform .15s ease,width .15s ease,scale .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),background .15s ease}.gbt-switch:not(.gbt-switch--disabled):active .gbt-switch__thumb{background:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24),var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid)}@media(prefers-reduced-motion:no-preference){.gbt-switch:not(.gbt-switch--disabled):active .gbt-switch__thumb{scale:1.04}}@media(prefers-reduced-transparency:reduce){.gbt-switch:not(.gbt-switch--disabled):active .gbt-switch__thumb{background:var(--gbt-knob);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-reduced-motion:no-preference){.gbt-switch:not(.gbt-switch--disabled):active .gbt-switch__thumb{width:1.1875rem}.gbt-switch:not(.gbt-switch--disabled):active .gbt-switch__input:checked~.gbt-switch__track .gbt-switch__thumb{transform:translate(.8125rem)}}.gbt-switch__input:checked~.gbt-switch__track .gbt-switch__thumb{transform:translate(1rem)}.gbt-switch__hint{margin:.125rem 0 0;padding-left:2.75rem;font-size:.75rem;line-height:1.4;color:var(--text-secondary)}@media(prefers-reduced-motion:reduce){.gbt-switch__track,.gbt-switch__thumb{transition:none}}\n"],
|
|
90
90
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
91
91
|
});
|
|
92
92
|
};
|
|
93
93
|
i0.ɵɵngDeclareClassMetadata({
|
|
94
94
|
minVersion: "12.0.0",
|
|
95
|
-
version: "22.2.
|
|
95
|
+
version: "22.2.6",
|
|
96
96
|
ngImport: i0,
|
|
97
97
|
type: Switch,
|
|
98
98
|
decorators: [{
|
|
@@ -108,7 +108,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
108
108
|
multi: true
|
|
109
109
|
}],
|
|
110
110
|
template: "<label class=\"gbt-switch\" [class.gbt-switch--disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"gbt-switch__input\"\n [id]=\"id()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-describedby]=\"hint() ? hintId() : null\"\n (change)=\"onToggle($event)\"\n />\n <span class=\"gbt-switch__track\">\n <span class=\"gbt-switch__thumb\"></span>\n </span>\n <span>{{ label() }}</span>\n</label>\n@if (hint()) {\n <p [id]=\"hintId()\" class=\"gbt-switch__hint\">{{ hint() }}</p>\n}\n",
|
|
111
|
-
styles: [":host(.gbt-switch-host--hint){display:block}.gbt-switch{position:relative;display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--text-primary);cursor:pointer}.gbt-switch:before{content:\"\";position:absolute;inset:50% auto auto 50%;width:max(100%,24px);height:max(100%,24px);transform:translate(-50%,-50%)}.gbt-switch--disabled{cursor:not-allowed;opacity:.5}.gbt-switch__input{position:absolute;width:2.25rem;height:1.25rem;margin:0;opacity:0;cursor:inherit}.gbt-switch__track{position:relative;display:inline-flex;flex-shrink:0;align-items:center;width:2.25rem;height:1.25rem;background:var(--border-color);border-radius:999px;box-shadow:var(--gbt-depth-hollow);transition:background .15s ease,box-shadow .15s ease}.gbt-switch:not(.gbt-switch--disabled):hover .gbt-switch__track{background:var(--text-discret)}.gbt-switch__input:checked+.gbt-switch__track{background:var(--accent);box-shadow:var(--gbt-depth-hollow),var(--gbt-glow)}.gbt-switch:not(.gbt-switch--disabled):hover .gbt-switch__input:checked+.gbt-switch__track{background:var(--accent);box-shadow:var(--gbt-depth-hollow),var(--gbt-glow-hover)}.gbt-switch__input:focus-visible+.gbt-switch__track{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-switch__thumb{position:absolute;top:.125rem;left:.125rem;width:1rem;height:1rem;background:var(--gbt-knob);border-radius:
|
|
111
|
+
styles: [":host(.gbt-switch-host--hint){display:block}.gbt-switch{position:relative;display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--text-primary);cursor:pointer}.gbt-switch:before{content:\"\";position:absolute;inset:50% auto auto 50%;width:max(100%,24px);height:max(100%,24px);transform:translate(-50%,-50%)}.gbt-switch--disabled{cursor:not-allowed;opacity:.5}.gbt-switch__input{position:absolute;width:2.25rem;height:1.25rem;margin:0;opacity:0;cursor:inherit}.gbt-switch__track{position:relative;display:inline-flex;flex-shrink:0;align-items:center;width:2.25rem;height:1.25rem;background:var(--border-color);border-radius:999px;box-shadow:var(--gbt-depth-hollow);transition:background .15s ease,box-shadow .15s ease}.gbt-switch:not(.gbt-switch--disabled):hover .gbt-switch__track{background:var(--text-discret)}.gbt-switch__input:checked+.gbt-switch__track{background:var(--accent);box-shadow:var(--gbt-depth-hollow),var(--gbt-glow)}.gbt-switch:not(.gbt-switch--disabled):hover .gbt-switch__input:checked+.gbt-switch__track{background:var(--accent);box-shadow:var(--gbt-depth-hollow),var(--gbt-glow-hover)}.gbt-switch__input:focus-visible+.gbt-switch__track{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-switch__thumb{position:absolute;top:.125rem;left:.125rem;width:1rem;height:1rem;background:var(--gbt-knob);border-radius:999px;box-shadow:var(--gbt-depth-knob);transition:transform .15s ease,width .15s ease,scale .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),background .15s ease}.gbt-switch:not(.gbt-switch--disabled):active .gbt-switch__thumb{background:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24),var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid)}@media(prefers-reduced-motion:no-preference){.gbt-switch:not(.gbt-switch--disabled):active .gbt-switch__thumb{scale:1.04}}@media(prefers-reduced-transparency:reduce){.gbt-switch:not(.gbt-switch--disabled):active .gbt-switch__thumb{background:var(--gbt-knob);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-reduced-motion:no-preference){.gbt-switch:not(.gbt-switch--disabled):active .gbt-switch__thumb{width:1.1875rem}.gbt-switch:not(.gbt-switch--disabled):active .gbt-switch__input:checked~.gbt-switch__track .gbt-switch__thumb{transform:translate(.8125rem)}}.gbt-switch__input:checked~.gbt-switch__track .gbt-switch__thumb{transform:translate(1rem)}.gbt-switch__hint{margin:.125rem 0 0;padding-left:2.75rem;font-size:.75rem;line-height:1.4;color:var(--text-secondary)}@media(prefers-reduced-motion:reduce){.gbt-switch__track,.gbt-switch__thumb{transition:none}}\n"]
|
|
112
112
|
}]
|
|
113
113
|
}],
|
|
114
114
|
propDecorators: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masmarino-gabarit-switch.mjs","names":[],"sources":["../../../projects/gabarit/switch/switch.ts","../../../projects/gabarit/switch/switch.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n signal,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nlet nextSwitchId = 0\n\n@Component({\n selector: 'gbt-switch',\n standalone: true,\n templateUrl: './switch.html',\n styleUrl: './switch.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.gbt-switch-host--hint]': '!!hint()',\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Switch),\n multi: true,\n },\n ],\n})\nexport class Switch implements ControlValueAccessor {\n id = input<string>(`gbt-switch-${++nextSwitchId}`)\n label = input<string>('')\n disabled = input(false, { transform: booleanAttribute })\n hint = input<string>('')\n\n protected readonly hintId = computed(() => `${this.id()}-hint`)\n protected readonly checked = signal(false)\n\n private readonly formDisabled = signal(false)\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled())\n\n private onChange: (value: boolean) => void = () => {}\n private onTouched: () => void = () => {}\n\n writeValue(value: boolean): void {\n this.checked.set(!!value)\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled)\n }\n\n protected onToggle(event: Event): void {\n const value = (event.target as HTMLInputElement).checked\n this.checked.set(value)\n this.onChange(value)\n this.onTouched()\n }\n}\n","<label class=\"gbt-switch\" [class.gbt-switch--disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"gbt-switch__input\"\n [id]=\"id()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-describedby]=\"hint() ? hintId() : null\"\n (change)=\"onToggle($event)\"\n />\n <span class=\"gbt-switch__track\">\n <span class=\"gbt-switch__thumb\"></span>\n </span>\n <span>{{ label() }}</span>\n</label>\n@if (hint()) {\n <p [id]=\"hintId()\" class=\"gbt-switch__hint\">{{ hint() }}</p>\n}\n"],"mappings":";;;AAWA,IAAI,eAAe;AAmBnB,IAAa,SAAb,MAAa,OAAM;CACjB,KAAK,MAAc,cAAc,EAAE,gBAAe,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAClD,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACrD,OAAO,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAEL,SAAS,eAAe,GAAG,KAAK,GAAE,EAAE,QAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC5C,UAAU,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAEzB,eAAe,OAAO,OAAM,GAAA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AM;GACpC,OAAO;EACR,CACF;EAAA,UAAA;EAAA,UC5BH;EAmBA,QAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"masmarino-gabarit-switch.mjs","names":[],"sources":["../../../projects/gabarit/switch/switch.ts","../../../projects/gabarit/switch/switch.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n signal,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nlet nextSwitchId = 0\n\n@Component({\n selector: 'gbt-switch',\n standalone: true,\n templateUrl: './switch.html',\n styleUrl: './switch.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.gbt-switch-host--hint]': '!!hint()',\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Switch),\n multi: true,\n },\n ],\n})\nexport class Switch implements ControlValueAccessor {\n id = input<string>(`gbt-switch-${++nextSwitchId}`)\n label = input<string>('')\n disabled = input(false, { transform: booleanAttribute })\n hint = input<string>('')\n\n protected readonly hintId = computed(() => `${this.id()}-hint`)\n protected readonly checked = signal(false)\n\n private readonly formDisabled = signal(false)\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled())\n\n private onChange: (value: boolean) => void = () => {}\n private onTouched: () => void = () => {}\n\n writeValue(value: boolean): void {\n this.checked.set(!!value)\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled)\n }\n\n protected onToggle(event: Event): void {\n const value = (event.target as HTMLInputElement).checked\n this.checked.set(value)\n this.onChange(value)\n this.onTouched()\n }\n}\n","<label class=\"gbt-switch\" [class.gbt-switch--disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"gbt-switch__input\"\n [id]=\"id()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-describedby]=\"hint() ? hintId() : null\"\n (change)=\"onToggle($event)\"\n />\n <span class=\"gbt-switch__track\">\n <span class=\"gbt-switch__thumb\"></span>\n </span>\n <span>{{ label() }}</span>\n</label>\n@if (hint()) {\n <p [id]=\"hintId()\" class=\"gbt-switch__hint\">{{ hint() }}</p>\n}\n"],"mappings":";;;AAWA,IAAI,eAAe;AAmBnB,IAAa,SAAb,MAAa,OAAM;CACjB,KAAK,MAAc,cAAc,EAAE,gBAAe,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAClD,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACrD,OAAO,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAEL,SAAS,eAAe,GAAG,KAAK,GAAE,EAAE,QAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC5C,UAAU,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAEzB,eAAe,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAC1B,aAAa,eAAe,KAAK,SAAQ,KAAM,KAAK,aAAY,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAE9E,iBAA0C,CAAE;CAC5C,kBAA6B,CAAE;CAEvC,WAAW,OAAc;EACvB,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK;CAC1B;CAEA,iBAAiB,IAA4B;EAC3C,KAAK,WAAW;CAClB;CAEA,kBA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AAa,iBAAgB,MAAO;IACpC,OAAO;GACR,CACF;GAAA,UAAA;GAAA,QAAA,CAAA,qtFAAA;EAAA,CAAA"}
|
|
@@ -57,7 +57,7 @@ var Table = class Table {
|
|
|
57
57
|
}
|
|
58
58
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
59
59
|
minVersion: "12.0.0",
|
|
60
|
-
version: "22.2.
|
|
60
|
+
version: "22.2.6",
|
|
61
61
|
ngImport: i0,
|
|
62
62
|
type: Table,
|
|
63
63
|
deps: [],
|
|
@@ -65,7 +65,7 @@ var Table = class Table {
|
|
|
65
65
|
});
|
|
66
66
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
67
67
|
minVersion: "17.0.0",
|
|
68
|
-
version: "22.2.
|
|
68
|
+
version: "22.2.6",
|
|
69
69
|
type: Table,
|
|
70
70
|
isStandalone: true,
|
|
71
71
|
selector: "gbt-table",
|
|
@@ -132,7 +132,7 @@ var Table = class Table {
|
|
|
132
132
|
};
|
|
133
133
|
i0.ɵɵngDeclareClassMetadata({
|
|
134
134
|
minVersion: "12.0.0",
|
|
135
|
-
version: "22.2.
|
|
135
|
+
version: "22.2.6",
|
|
136
136
|
ngImport: i0,
|
|
137
137
|
type: Table,
|
|
138
138
|
decorators: [{
|