q2-tecton-elements 1.66.0 → 1.66.2

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.
Files changed (61) hide show
  1. package/dist/bundle-report.json +469 -468
  2. package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
  3. package/dist/cjs/q2-checkbox.cjs.entry.js.map +1 -1
  4. package/dist/cjs/q2-checkbox.entry.cjs.js.map +1 -1
  5. package/dist/cjs/q2-editable-field.cjs.entry.js +2 -2
  6. package/dist/cjs/q2-editable-field.cjs.entry.js.map +1 -1
  7. package/dist/cjs/q2-editable-field.entry.cjs.js.map +1 -1
  8. package/dist/cjs/q2-tab-container.cjs.entry.js +3 -3
  9. package/dist/cjs/q2-tab-container.cjs.entry.js.map +1 -1
  10. package/dist/cjs/q2-tab-container.entry.cjs.js.map +1 -1
  11. package/dist/cjs/q2-tag.cjs.entry.js +1 -1
  12. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
  13. package/dist/collection/collection-manifest.json +2 -2
  14. package/dist/collection/components/q2-checkbox/q2-checkbox.css +3 -3
  15. package/dist/collection/components/q2-data-table/q2-data-table.js +12 -12
  16. package/dist/collection/components/q2-editable-field/q2-editable-field.js +2 -2
  17. package/dist/collection/components/q2-editable-field/q2-editable-field.js.map +1 -1
  18. package/dist/collection/components/q2-file-picker/q2-file-picker.js +3 -3
  19. package/dist/collection/components/q2-grid/q2-grid.js +30 -30
  20. package/dist/collection/components/q2-grid-area/q2-grid-area.js +42 -42
  21. package/dist/collection/components/q2-input/q2-input.js +1 -1
  22. package/dist/collection/components/q2-option-list/q2-option-list.js +5 -5
  23. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +4 -4
  24. package/dist/collection/components/q2-tab-container/q2-tab-container.js +3 -3
  25. package/dist/collection/components/q2-tab-container/q2-tab-container.js.map +1 -1
  26. package/dist/collection/components/q2-tag/q2-tag.js +1 -1
  27. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
  28. package/dist/components/q2-checkbox2.js +1 -1
  29. package/dist/components/q2-checkbox2.js.map +1 -1
  30. package/dist/components/q2-editable-field.js +2 -2
  31. package/dist/components/q2-editable-field.js.map +1 -1
  32. package/dist/components/q2-tab-container.js +3 -3
  33. package/dist/components/q2-tab-container.js.map +1 -1
  34. package/dist/components/q2-tag.js +1 -1
  35. package/dist/components/tecton-tab-pane.js +2 -2
  36. package/dist/esm/q2-checkbox.entry.js +1 -1
  37. package/dist/esm/q2-checkbox.entry.js.map +1 -1
  38. package/dist/esm/q2-editable-field.entry.js +2 -2
  39. package/dist/esm/q2-editable-field.entry.js.map +1 -1
  40. package/dist/esm/q2-tab-container.entry.js +3 -3
  41. package/dist/esm/q2-tab-container.entry.js.map +1 -1
  42. package/dist/esm/q2-tag.entry.js +1 -1
  43. package/dist/esm/tecton-tab-pane.entry.js +2 -2
  44. package/dist/q2-tecton-elements/q2-checkbox.entry.esm.js.map +1 -1
  45. package/dist/q2-tecton-elements/q2-checkbox.entry.js +1 -1
  46. package/dist/q2-tecton-elements/q2-checkbox.entry.js.map +1 -1
  47. package/dist/q2-tecton-elements/q2-editable-field.entry.esm.js.map +1 -1
  48. package/dist/q2-tecton-elements/q2-editable-field.entry.js +2 -1
  49. package/dist/q2-tecton-elements/q2-editable-field.entry.js.map +1 -1
  50. package/dist/q2-tecton-elements/q2-tab-container.entry.esm.js.map +1 -1
  51. package/dist/q2-tecton-elements/q2-tab-container.entry.js +14 -14
  52. package/dist/q2-tecton-elements/q2-tab-container.entry.js.map +1 -1
  53. package/dist/q2-tecton-elements/q2-tag.entry.js +12 -12
  54. package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +6 -6
  55. package/package.json +72 -70
  56. /package/dist/types/{Users/kvanhouten/Documents/Work → builds/q2e/development/tecton}/tecton/packages/q2-tecton-elements/.stencil/jest.e2e-coverage.d.ts +0 -0
  57. /package/dist/types/{Users/kvanhouten/Documents/Work → builds/q2e/development/tecton}/tecton/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +0 -0
  58. /package/dist/types/{Users/kvanhouten/Documents/Work → builds/q2e/development/tecton}/tecton/packages/q2-tecton-elements/.stencil/scripts/docs-generator/index.d.ts +0 -0
  59. /package/dist/types/{Users/kvanhouten/Documents/Work → builds/q2e/development/tecton}/tecton/packages/q2-tecton-elements/.stencil/scripts/docs-generator/markdown-generator.d.ts +0 -0
  60. /package/dist/types/{Users/kvanhouten/Documents/Work → builds/q2e/development/tecton}/tecton/packages/q2-tecton-elements/.stencil/scripts/docs-generator/tag-handlers.d.ts +0 -0
  61. /package/dist/types/{Users/kvanhouten/Documents/Work → builds/q2e/development/tecton}/tecton/packages/q2-tecton-elements/.stencil/scripts/docs-generator/types.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"q2-checkbox.entry.cjs.js","sources":["src/components/q2-checkbox/q2-checkbox.scss?tag=q2-checkbox&encapsulation=shadow","src/components/q2-checkbox/q2-checkbox.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n --comp-checkbox-padding: #{var-list(\n --tct-checkbox-padding,\n unquote('#{var-list(var-prefixer(checkbox-vertical-padding), 8px)} 0')\n )};\n\n display: block;\n position: relative;\n padding: var(--comp-checkbox-padding);\n --comp-default-checkbox-margin: #{var-list(var-prefixer(checkbox-margin-top), 0px) 0\n var-list(var-prefixer(checkbox-margin-bottom), 0px)};\n margin: var-list(--tct-checkbox-margin, --comp-default-checkbox-margin);\n}\n\n.container {\n --comp-checkbox-size: #{var-list(var-prefixer(checkbox-size), 24px)};\n --comp-checkbox-default-column-gap: var(--app-scale-2x, 10px);\n --comp-checkbox-default-row-gap: 0;\n --comp-checkbox-default-gap: #{var(--comp-checkbox-default-row-gap) var(--comp-checkbox-default-column-gap)};\n --comp-checkbox-tween: #{var-list(--tct-tween-1, --app-tween-1, unquote('0.2s ease'))};\n --comp-checkbox-toggle-width: #{var-list(var-prefixer(checkbox-toggle-width), 38px)};\n\n --comp-checkbox-toggle-track-fill: #{var-list(\n --tct-checkbox-toggle-track-fill,\n --tct-checkbox-toggle-track-color,\n transparent\n )};\n --comp-checkbox-toggle-track-fill-active: #{var-list(\n --tct-checkbox-toggle-active-track-fill,\n --tct-checkbox-toggle-active-track-color,\n --tct-checkbox-toggle-active-color,\n --t-primary-l1,\n #7755af\n )};\n --comp-checkbox-toggle-track-fill-hover: #{var-list(\n --tct-checkbox-toggle-hover-track-fill,\n --tct-checkbox-toggle-hover-track-color,\n --comp-checkbox-toggle-track-fill\n )};\n --comp-checkbox-toggle-track-fill-error: #{var-list(\n --tct-checkbox-toggle-error-track-fill,\n --tct-checkbox-toggle-error-track-color,\n --comp-checkbox-toggle-track-fill\n )};\n --comp-checkbox-toggle-track-fill-error-hover: #{var-list(\n --tct-checkbox-toggle-error-hover-track-fill,\n --tct-checkbox-toggle-error-hover-track-color,\n --comp-checkbox-toggle-track-fill-error\n )};\n --comp-checkbox-toggle-track-fill-error-active: #{var-list(\n --tct-checkbox-toggle-error-active-track-fill,\n --tct-checkbox-toggle-error-active-track-color,\n --comp-checkbox-toggle-track-fill-error\n )};\n\n --comp-checkbox-toggle-error-color: #{var-list(--tct-checkbox-toggle-error-color, --comp-checkbox-error-color)};\n --comp-checkbox-toggle-color: #{var-list(--tct-checkbox-toggle-color, --t-gray-8, #808080)};\n --comp-checkbox-gap: #{var-list(var-prefixer(checkbox-gap), --comp-checkbox-default-gap)};\n --comp-checkbox-outer-stroke-color: #{var-list(\n var-prefixer(checkbox-outer-stroke-color),\n --t-a11y-gray-color-AA,\n #949494\n )};\n --comp-checkbox-outer-fill-color: #{var-list(\n var-prefixer(checkbox-outer-fill-color),\n --tct-white,\n --app-white,\n #ffffff\n )};\n --comp-checkbox-checked-fill-color: #{var-list(\n var-prefixer(checkbox-checked-outer-fill-color),\n --tct-checkbox-checked-outer-fill-color,\n --t-primary,\n #040404\n )};\n --comp-checkbox-checked-color: #{var-list(\n --tct-checkbox-checkmark-stroke-color,\n --tct-white,\n --app-white,\n #FFFFFF\n )};\n --comp-control-width: var(--comp-checkbox-size);\n --comp-checkbox-error-color: #{var-list(--tct-stoplight-error, --const-stoplight-alert, #d20a0a)};\n\n --comp-checkbox-bold-fallback-stroke-width: #{var-list(--tct-checkbox-bold-fallback-stroke-width, 0.7px)};\n --comp-checkbox-stroke-width: #{var-list(--tct-checkbox-stroke-width, unset)};\n --comp-checkbox-checked-stroke-width: #{var-list(\n --tct-checkbox-checked-stroke-width,\n --comp-checkbox-bold-fallback-stroke-width\n )};\n --comp-checkbox-hover-stroke-width: #{var-list(--tct-checkbox-hover-stroke-width, unset)};\n --comp-checkbox-focused-stroke-width: #{var-list(--tct-checkbox-focused-stroke-width, unset)};\n --comp-checkbox-checked-hover-stroke-width: #{var-list(\n --tct-checkbox-checked-hover-stroke-width,\n --comp-checkbox-bold-fallback-stroke-width\n )};\n --comp-checkbox-checked-focused-stroke-width: #{var-list(\n --tct-checkbox-checked-focused-stroke-width,\n --comp-checkbox-bold-fallback-stroke-width\n )};\n --comp-checkbox-description-stroke-width: #{var-list(\n --tct-checkbox-description-stroke-width,\n --comp-checkbox-bold-fallback-stroke-width\n )};\n --comp-checkbox-description-focused-stroke-width: #{var-list(\n --tct-checkbox-description-focused-stroke-width,\n --comp-checkbox-bold-fallback-stroke-width\n )};\n --comp-checkbox-description-hover-stroke-width: #{var-list(\n --tct-checkbox-description-hover-stroke-width,\n --comp-checkbox-bold-fallback-stroke-width\n )};\n\n :host([type='favorite']) & {\n --comp-checkbox-favorite-stroke-color: #{var-list(\n var-prefixer(checkbox-favorite-stroke-color),\n --t-a11y-gray-color-AA,\n #949494\n )};\n --comp-checkbox-favorite-fill-color: #{var-list(var-prefixer(checkbox-favorite-fill-color), #db7d24)};\n }\n\n display: grid;\n grid-template-areas:\n 'svg label'\n 'svg description';\n align-items: center;\n gap: var(--comp-checkbox-gap);\n grid-template-columns: var(--comp-control-width) calc(\n 100% - var(--comp-control-width) - var(--comp-checkbox-default-column-gap)\n );\n\n :host([hide-label]:not([hide-label='false'])) & {\n grid-template-areas: 'svg';\n grid-template-columns: var(--comp-control-width);\n }\n\n :host([type='toggle']) & {\n --comp-control-width: var(--comp-checkbox-toggle-width);\n }\n\n :host([alignment='right']) &,\n :host([type='toggle']:not([alignment])) & {\n grid-template-areas:\n 'label svg'\n 'description svg';\n grid-template-columns: calc(100% - var(--comp-control-width) - var(--comp-checkbox-default-column-gap)) var(\n --comp-control-width\n );\n }\n}\n\n.label-control {\n align-items: center;\n display: flex;\n}\n\n.label-text {\n grid-area: label;\n\n :host([description]) & {\n -webkit-text-stroke-width: var(--comp-checkbox-description-stroke-width);\n text-stroke-width: var(--comp-checkbox-description-stroke-width);\n }\n :host([checked]:not([checked='false'])) & {\n -webkit-text-stroke-width: var(--comp-checkbox-checked-stroke-width);\n text-stroke-width: var(--comp-checkbox-checked-stroke-width);\n }\n :host(:hover) & {\n -webkit-text-stroke-width: var(--comp-checkbox-hover-stroke-width);\n text-stroke-width: var(--comp-checkbox-hover-stroke-width);\n }\n :host(:focus-within) & {\n -webkit-text-stroke-width: var(--comp-checkbox-focused-stroke-width);\n text-stroke-width: var(--comp-checkbox-focused-stroke-width);\n }\n :host([description]:hover) & {\n -webkit-text-stroke-width: var(--comp-checkbox-description-hover-stroke-width);\n text-stroke-width: var(--comp-checkbox-description-hover-stroke-width);\n }\n :host([checked]:not([checked='false']):hover) & {\n -webkit-text-stroke-width: var(--comp-checkbox-checked-hover-stroke-width);\n text-stroke-width: var(--comp-checkbox-checked-hover-stroke-width);\n }\n :host([description]:focus-within) & {\n -webkit-text-stroke-width: var(--comp-checkbox-description-focused-stroke-width);\n text-stroke-width: var(--comp-checkbox-description-focused-stroke-width);\n }\n :host([checked]:not([checked='false']):focus-within) & {\n -webkit-text-stroke-width: var(--comp-checkbox-checked-focused-stroke-width);\n text-stroke-width: var(--comp-checkbox-checked-focused-stroke-width);\n }\n :host(:active) & {\n -webkit-text-stroke-width: var(--tct-checkbox-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-active-stroke-width, unset);\n }\n :host([checked]:not([checked='false']):active) & {\n -webkit-text-stroke-width: var(--tct-checkbox-checked-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-active-stroke-width, unset);\n }\n :host([has-error]:not([has-error='false']):hover) & {\n -webkit-text-stroke-width: var(--tct-checkbox-error-hover-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-error-hover-stroke-width, unset);\n }\n :host([has-error]:not([has-error='false']):focus-within) & {\n -webkit-text-stroke-width: var(--tct-checkbox-error-focused-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-error-focused-stroke-width, unset);\n }\n :host([has-error]:not([has-error='false']):active) & {\n -webkit-text-stroke-width: var(--tct-checkbox-error-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-error-active-stroke-width, unset);\n }\n :host([checked]:not([checked='false'])[has-error]:not([has-error='false']):hover) & {\n -webkit-text-stroke-width: var(--tct-checkbox-checked-error-hover-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-error-hover-stroke-width, unset);\n }\n :host([checked]:not([checked='false'])[has-error]:not([has-error='false']):focus-within) & {\n -webkit-text-stroke-width: var(--tct-checkbox-checked-error-focused-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-error-focused-stroke-width, unset);\n }\n :host([checked]:not([checked='false'])[has-error]:not([has-error='false']):active) & {\n -webkit-text-stroke-width: var(--tct-checkbox-checked-error-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-error-active-stroke-width, unset);\n }\n\n label {\n line-height: var-list(--tct-checkbox-label-line-height, 24px);\n .label-content {\n display: inline;\n font-size: var(--tct-checkbox-label-font-size, inherit);\n }\n }\n}\n\n.description-text {\n grid-area: description;\n font-weight: var-list(var-prefixer(checkbox-description-font-weight), 400);\n\n :host(:hover) & {\n font-weight: var-list(\n --tct-checkbox-hover-description-font-weight,\n var-prefixer(checkbox-description-font-weight),\n 400\n );\n }\n}\n\nlabel {\n color: var-list(--tct-checkbox-label-color);\n cursor: pointer;\n hyphens: var-list(--tct-checkbox-label-hyphens, auto);\n word-break: var-list(--tct-checkbox-label-word-break, break-word);\n word-wrap: var-list(--tct-checkbox-label-word-wrap, break-word);\n}\n\n.checkbox-icon {\n width: var(--comp-checkbox-size);\n height: var(--comp-checkbox-size);\n border-radius: var-list(\n var-prefixer(checkbox-outer-border-radius),\n --tct-border-radius-1,\n --app-border-radius-1,\n 4px\n );\n stroke: var(--comp-checkbox-outer-stroke-color);\n fill: var(--comp-checkbox-outer-fill-color);\n stroke-width: var-list(var-prefixer(checkbox-outer-stroke-width), 2);\n flex-shrink: 0;\n box-shadow: var(--tct-checkbox-box-shadow);\n\n rect {\n transition: fill var-list(--tct-checkbox-tween, --app-tween-2, unquote('0.4s ease'));\n }\n\n :host([checked]:not([checked='false']):not([type='favorite'])) & {\n stroke: var-list(\n --comp-checkbox-checked-fill-color,\n var-prefixer(checkbox-checked-outer-stroke-color),\n --comp-checkbox-outer-stroke-color\n );\n\n rect {\n fill: var(--comp-checkbox-checked-fill-color);\n }\n }\n\n :host([has-error]:not([has-error='false']):not([type='favorite'])) & {\n stroke: var-list(--tct-checkbox-error-outer-stroke-color, --comp-checkbox-error-color);\n box-shadow: var-list(--tct-checkbox-error-box-shadow, --tct-checkbox-box-shadow);\n\n rect {\n fill: var-list(--tct-checkbox-error-outer-fill-color, --comp-checkbox-outer-fill-color);\n }\n }\n\n :host([has-error]:not([has-error='false']):not([type='favorite'])[checked]:not([checked='false'])) & {\n rect {\n fill: var-list(--tct-checkbox-error-checked-outer-fill-color);\n }\n }\n\n :host([indeterminate]:not([indeterminate='false']):not([type='favorite'])) & {\n stroke: var-list(\n --comp-checkbox-checked-fill-color,\n var-prefixer(checkbox-checked-outer-stroke-color),\n --comp-checkbox-outer-stroke-color\n );\n \n rect {\n fill: var(--comp-checkbox-checked-fill-color);\n }\n }\n\n :host(:hover:not([type='favorite'])) & {\n stroke: var-list(--tct-checkbox-hover-outer-stroke-color, --comp-checkbox-outer-stroke-color);\n box-shadow: var-list(--tct-checkbox-hover-box-shadow, --tct-checkbox-box-shadow);\n rect {\n fill: var-list(--tct-checkbox-hover-outer-fill-color, --comp-checkbox-outer-fill-color);\n }\n }\n :host(:hover[has-error]:not([has-error='false']):not([type='favorite'])) & {\n stroke: var-list(\n --tct-checkbox-error-hover-outer-stroke-color,\n --tct-checkbox-error-outer-stroke-color,\n --comp-checkbox-error-color\n );\n box-shadow: var-list(\n --tct-checkbox-error-hover-box-shadow,\n --tct-checkbox-error-box-shadow,\n --tct-checkbox-hover-box-shadow,\n --tct-checkbox-box-shadow\n );\n rect {\n fill: var-list(\n --tct-checkbox-error-hover-outer-fill-color,\n --tct-checkbox-error-outer-fill-color,\n --comp-checkbox-outer-fill-color\n );\n }\n }\n\n :host(:focus-within:not([type='favorite'])) & {\n --comp-checkbox-focused-box-shadow: #{var(--const-double-focus-ring),\n var-list(--tct-global-focus, unquote('0 0 0 2px #33b4ff'))};\n\n stroke: var-list(var-prefixer(checkbox-focused-outer-stroke-color), --comp-checkbox-outer-stroke-color);\n fill: var-list(--tct-checkbox-focused-outer-fill-color, --comp-checkbox-outer-fill-color);\n box-shadow: var-list(\n --tct-checkbox-focused-box-shadow,\n --tct-checkbox-box-shadow,\n --comp-checkbox-focused-box-shadow\n );\n }\n :host(:focus-within[has-error]:not([has-error='false']):not([type='favorite'])) & {\n stroke: var-list(\n --tct-checkbox-error-focused-outer-stroke-color,\n --tct-checkbox-error-outer-stroke-color,\n --comp-checkbox-error-color\n );\n fill: var-list(\n --tct-checkbox-error-focused-outer-fill-color,\n --tct-checkbox-error-outer-fill-color,\n --comp-checkbox-outer-fill-color\n );\n box-shadow: var-list(\n --tct-checkbox-error-focused-box-shadow,\n --tct-checkbox-error-box-shadow,\n --tct-checkbox-box-shadow,\n --comp-checkbox-focused-box-shadow\n );\n }\n\n // Favorite\n :host([type='favorite']) & {\n --tct-icon-stroke-width: #{var-list(var-prefixer(checkbox-favorite-stroke-width), 1)};\n --tct-icon-stroke-primary: var(--comp-checkbox-favorite-stroke-color);\n transition:\n fill var(--comp-checkbox-tween),\n color var(--comp-checkbox-tween),\n stroke var(--comp-checkbox-tween);\n }\n\n :host(:hover[type='favorite']) & {\n --tct-icon-stroke-primary: #{var-list(\n --tct-checkbox-favorite-hover-stroke-color,\n --comp-checkbox-favorite-fill-color\n )};\n --tct-icon-stroke-width: #{var-list(var-prefixer(checkbox-favorite-hover-stroke-width), 2)};\n }\n\n :host([type='favorite']:focus-within) & {\n --tct-icon-stroke-primary: #{var-list(\n --tct-checkbox-favorite-focused-stroke-color,\n --comp-checkbox-favorite-fill-color\n )};\n --tct-icon-stroke-width: #{var-list(var-prefixer(checkbox-favorite-hover-stroke-width), 2)};\n }\n\n // Checked favorite\n :host([checked]:not([checked='false'])[type='favorite']) & {\n --tct-icon-stroke-primary: #{var-list(\n --tct-checkbox-favorite-checked-stroke-color,\n --tct-checkbox-favorite-stroke-color,\n --comp-checkbox-favorite-fill-color\n )};\n fill: var-list(--tct-checkbox-favorite-checked-fill-color, --comp-checkbox-favorite-fill-color);\n transition:\n fill var(--comp-checkbox-tween),\n color var(--comp-checkbox-tween),\n stroke var(--comp-checkbox-tween);\n }\n\n :host([checked]:not([checked='false'])[type='favorite']:hover) & {\n --tct-icon-stroke-primary: #{var-list(\n --tct-checkbox-favorite-checked-hover-stroke-color,\n --tct-checkbox-favorite-hover-stroke-color,\n --comp-checkbox-favorite-stroke-color\n )};\n --tct-icon-fill-primary: #{var-list(\n --tct-checkbox-favorite-checked-fill-color,\n --comp-checkbox-favorite-fill-color\n )};\n --tct-icon-stroke-width: #{var-list(var-prefixer(checkbox-favorite-hover-stroke-width), 2)};\n }\n\n :host([checked]:not([checked='false'])[type='favorite']:focus-within) & {\n --tct-icon-stroke-primary: #{var-list(\n --tct-checkbox-favorite-checked-focused-stroke-color,\n --tct-checkbox-favorite-focused-stroke-color,\n --comp-checkbox-favorite-stroke-color\n )};\n --tct-icon-stroke-width: #{var-list(var-prefixer(checkbox-favorite-hover-stroke-width), 2)};\n }\n\n :host([has-error]:not([has-error='false'])[type='favorite']) & {\n --tct-icon-stroke-primary: #{var-list(--tct-checkbox-favorite-error-stroke-color, --comp-checkbox-error-color)};\n }\n :host([has-error]:not([has-error='false'])[type='favorite'][checked]:not([checked='false'])) & {\n --tct-icon-stroke-primary: #{var-list(--tct-checkbox-favorite-error-stroke-color, --comp-checkbox-error-color)};\n }\n}\n\n.checkbox-fill {\n fill: none;\n stroke: var-list(--tct-checkbox-checkmark-stroke-color, --comp-checkbox-checked-color);\n stroke-width: var-list(var-prefixer(checkbox-check-stroke-width), 2.5);\n stroke-linecap: round;\n stroke-linejoin: round;\n\n :host([has-error]:not([has-error='false']):not([type='favorite'])) & {\n stroke: var(--tct-checkbox-error-checkmark-stroke-color, #d20a0a);\n stroke-width: var(--tct-checkbox-error-checkmark-stroke-width, 2.5);\n }\n}\n\n.checked-fill {\n stroke-dasharray: 16;\n stroke-dashoffset: 16;\n animation: draw-checkmark 350ms ease-out forwards;\n}\n\n@keyframes draw-checkmark {\n to {\n stroke-dashoffset: 0;\n }\n}\n\n.indeterminate-fill {\n stroke-width: var-list(var-prefixer(checkbox-indeterminate-stroke-width), 3.5);\n}\n\n.toggle-svg-container {\n height: 30px;\n width: var(--comp-checkbox-toggle-width);\n position: relative;\n text-align: initial;\n}\n\n.toggle-indicator,\n.toggle-track {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n.toggle-indicator {\n transition:\n left var(--comp-checkbox-tween),\n height var(--comp-checkbox-tween),\n width var(--comp-checkbox-tween);\n height: 16px;\n width: 16px;\n left: 4px;\n border-radius: 50%;\n}\n\n.toggle-track {\n --comp-default-track-box-shadow: inset 0 0 0 1px var(--comp-checkbox-toggle-color);\n height: 24px;\n width: 38px;\n fill: var(--comp-checkbox-toggle-track-fill);\n border-radius: var(--app-border-radius-3, 12px);\n box-shadow: var-list(--tct-checkbox-toggle-track-box-shadow, --comp-default-track-box-shadow);\n transition:\n fill var(--comp-checkbox-tween),\n box-shadow var(--comp-checkbox-tween);\n}\n\n.toggle-circle {\n mask: url(#xMask);\n fill: var(--comp-checkbox-toggle-color);\n transition: fill var(--comp-checkbox-tween);\n}\n\n.toggle-icon {\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-width: var(--tct-checkbox-toggle-icon-stroke-width, 2);\n stroke: black;\n}\n\n:host(:is(:not([checked]), [checked='false'])) {\n &:host(:is(:not([disabled]), [disabled='false']):is(:not([group-disabled]), [group-disabled='false'])) {\n :hover,\n :focus-within {\n .toggle-track {\n --comp-default-hover-track-box-shadow: inset 0 0 0 2px var(--comp-checkbox-toggle-color);\n box-shadow: var-list(\n --tct-checkbox-toggle-hover-track-box-shadow,\n --comp-default-hover-track-box-shadow\n );\n fill: var(--comp-checkbox-toggle-track-fill-hover);\n }\n .toggle-indicator {\n height: 18px;\n width: 18px;\n }\n .toggle-circle {\n fill: var-list(--tct-checkbox-toggle-hover-circle-color, --t-primary-d1, --t-gray-6, #4d4d4d);\n }\n .label-text {\n color: var(--tct-checkbox-label-hover-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-description-hover-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-description-hover-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-description-hover-stroke-width, unset);\n }\n }\n :active {\n .toggle-circle {\n fill: var(--comp-checkbox-toggle-track-fill-active);\n }\n .label-text {\n color: var(--tct-checkbox-label-active-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-description-active-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-description-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-description-active-stroke-width, unset);\n }\n }\n }\n\n &:host([has-error]:not([has-error='false'])) {\n .toggle-track {\n box-shadow: inset 0 0 0 1px var(--comp-checkbox-toggle-error-color);\n fill: var(--comp-checkbox-toggle-track-fill-error);\n }\n .toggle-circle {\n fill: var(--comp-checkbox-toggle-error-color);\n }\n\n &:host(:is(:not([disabled]), [disabled='false']):is(:not([group-disabled]), [group-disabled='false'])) {\n :hover,\n :focus-within {\n .toggle-track {\n box-shadow: inset 0 0 0 2px var(--comp-checkbox-toggle-error-color);\n fill: var(--comp-checkbox-toggle-track-fill-error-hover);\n }\n .toggle-circle {\n fill: var-list(--tct-checkbox-toggle-error-hover-color, --comp-checkbox-toggle-error-color);\n }\n .label-text {\n color: var(--tct-checkbox-label-hover-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-description-hover-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-description-hover-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-description-hover-stroke-width, unset);\n }\n }\n :active {\n .toggle-track {\n fill: var(--comp-checkbox-toggle-track-fill-error-active);\n }\n .toggle-circle {\n fill: var-list(--tct-checkbox-toggle-error-active-color, --comp-checkbox-toggle-error-color);\n }\n .label-text {\n color: var(--tct-checkbox-error-label-active-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-error-description-active-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-error-description-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-error-description-active-stroke-width, unset);\n }\n }\n }\n }\n}\n\n:host([checked]:not([checked='false'])) {\n .toggle-indicator {\n left: 18px;\n }\n\n .toggle-track {\n fill: var-list(--tct-checkbox-toggle-checked-track-color, --t-primary, #6a4a9e);\n border: none;\n }\n .toggle-circle {\n mask: url(#checkMask);\n fill: var-list(--tct-checkbox-toggle-checked-circle-color, --t-base, #ffffff);\n }\n\n &:host(:is(:not([disabled]), [disabled='false']):is(:not([group-disabled]), [group-disabled='false'])) {\n :hover,\n :focus-within {\n .toggle-track {\n fill: var-list(--tct-checkbox-toggle-checked-hover-track-color, --t-primary-d1, #5f438e);\n }\n .toggle-indicator {\n height: 18px;\n width: 18px;\n }\n .label-text {\n color: var(--tct-checkbox-checked-label-hover-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-checked-description-hover-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-checked-description-hover-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-description-hover-stroke-width, unset);\n }\n }\n\n :active {\n .toggle-track {\n fill: var-list(--tct-checkbox-toggle-checked-active-track-color, --t-primary-l1, #7755af);\n }\n .toggle-indicator {\n height: 18px;\n width: 18px;\n }\n .label-text {\n color: var(--tct-checkbox-checked-label-active-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-checked-description-active-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-checked-description-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-description-active-stroke-width, unset);\n }\n }\n }\n\n &:host([has-error]:not([has-error='false'])) {\n .toggle-track {\n fill: var-list(--tct-checkbox-toggle-checked-error-track-color, --comp-checkbox-toggle-error-color);\n }\n &:host(:is(:not([disabled]), [disabled='false']):is(:not([group-disabled]), [group-disabled='false'])) {\n :hover,\n :focus-within {\n .toggle-track {\n fill: var-list(\n --tct-checkbox-toggle-checked-error-hover-track-color,\n --comp-checkbox-toggle-error-color\n );\n }\n .label-text {\n color: var(--tct-checkbox-checked-error-label-hover-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-checked-error-description-hover-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-checked-error-description-hover-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-error-description-hover-stroke-width, unset);\n }\n }\n\n :active {\n .toggle-track {\n fill: var-list(\n --tct-checkbox-toggle-checked-error-active-track-color,\n --comp-checkbox-toggle-error-color\n );\n }\n .label-text {\n color: var(--tct-checkbox-checked-error-label-active-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-checked-error-description-active-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-checked-error-description-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-error-description-active-stroke-width, unset);\n }\n }\n }\n }\n}\n\n:host(:is([disabled]:not([disabled='false']), [group-disabled]:not([group-disabled='false']))) {\n cursor: not-allowed;\n opacity: var-list(var-prefixer(checkbox-disabled-opacity), --tct-disabled-opacity, --app-disabled-opacity, 0.4);\n label {\n cursor: not-allowed;\n }\n}\n","import { Component, ComponentInterface, Prop, Element, Listen, Watch, Event, EventEmitter, h } from '@stencil/core';\nimport { createGuid, handleAriaLabel, isEventFromElement, loc, overrideFocus } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\n\n@Component({ tag: 'q2-checkbox', shadow: true, styleUrl: 'q2-checkbox.scss' })\nexport class Q2Checkbox implements ComponentInterface {\n // #region Own Properties\n\n _id: string = `checkbox-${createGuid()}`;\n inputElement: HTMLInputElement;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n /** Determine which side of the label the checkbox will render on. */\n @Prop({ reflect: true })\n alignment: string;\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n ariaLabel: string;\n\n /** The state of the checkbox. This modifies the visual appearance of the element. */\n @Prop({ reflect: true, mutable: true })\n checked: boolean = false;\n\n /**\n * Populates a description that is displayed beneath the label.\n * @localizable\n */\n @Prop({ reflect: true })\n description: string;\n\n /** Disables the checkbox and prevents interaction. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /**\n * Used by q2-checkbox-group to disable all checkboxes in the group\n * @private\n */\n @Prop({ reflect: true })\n groupDisabled: boolean;\n\n /** Determines if the component should display in an errant state. */\n @Prop({ reflect: true })\n hasError: boolean = false;\n\n /**\n * Hide's the field's `<label>` element from view.\n *\n * @warning\n * Only use when a visible label is impractical.\n */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * Used on a parent checkbox in a checkbox group (e.g. \"Select All\") to indicate that some, but not all, checkboxes in a group are checked.\n *\n * When `true`, the \"indeterminate\" selection style is applied.\n * To apply the standard \"checked\" selection style, `checked` must be true, and `indeterminate` must be `false`.\n */\n @Prop({ reflect: true })\n indeterminate: boolean;\n\n /**\n * The visible label text for the checkbox. Appears to the right of the box for 'default' and 'favorite' checkboxes, and to the left for 'toggle' checkboxes.\n * Yielded content will be adjacent to this text.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n label: string;\n\n /** A static string used to establish a symbolic relationship between checkboxes. */\n @Prop({ reflect: true })\n name: string;\n\n /** The field is not interactive, but remains focusable. */\n @Prop({ reflect: true })\n readonly: boolean;\n\n /** The field is not interactive, but remains focusable. */\n @Prop({ reflect: true })\n slotReadonly: boolean;\n\n /** The visual style of the checkbox. This does not need to be defined for a standard checkbox. */\n @Prop({ reflect: true })\n type: 'favorite' | 'toggle';\n\n /** A static reference value for the checkbox. */\n @Prop({ reflect: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the checkbox is toggled.\n * @deprecated Use 'tctChange' instead\n * @legacyEvent\n */\n @Event()\n change: EventEmitter<{ value: string; checked: boolean }>;\n\n /**\n * Emitted when the checkbox is toggled.\n * @legacyEvent\n */\n @Event()\n tctChange: EventEmitter<{ value: string; checked: boolean }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n handleAriaLabel(this);\n }\n\n componentDidLoad(): void {\n overrideFocus(this.hostElement);\n this.hostElement.click = () => this.inputElement.click();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('change')\n defaultChangeHandler(event: CustomEvent) {\n // We use setTimeout to give an opportunity to call preventDefault\n setTimeout(() => this.handleChangeEvent(event), 0);\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.hostElement.shadowRoot.querySelector('input').focus();\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('ariaLabel')\n ariaLabelObserver() {\n handleAriaLabel(this);\n }\n\n // #endregion\n // #region Local Methods\n\n handleChangeEvent(event: CustomEvent<{ checked: boolean; value: string }>) {\n if (\n this.readonly ||\n this.disabled ||\n this.hostElement.onchange ||\n event.defaultPrevented ||\n event.target !== this.hostElement ||\n !event.detail\n ) {\n return;\n }\n this.checked = event.detail.checked;\n }\n\n onInputClick = (event: Event) => {\n event.stopPropagation();\n event.preventDefault();\n\n const isNotInteractive = this.disabled || this.readonly || this.slotReadonly;\n if (isNotInteractive) return;\n if (!(event.target instanceof HTMLInputElement)) return;\n const { value, checked } = event.target;\n\n mirrorEmit(this, ['change', 'tctChange'], {\n value,\n checked,\n });\n this.inputElement.focus();\n };\n\n // #endregion\n // #region Render Methods\n\n renderCheckboxSVG() {\n if (this.type === 'favorite') {\n return (\n <q2-icon\n type=\"star\"\n class=\"checkbox-icon\"\n />\n );\n }\n\n if (this.type === 'toggle') {\n return this.renderToggleSVG();\n }\n\n return (\n <svg\n aria-hidden=\"true\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n class=\"checkbox-icon\"\n focusable=\"false\"\n >\n <rect\n x=\"1\"\n y=\"1\"\n width=\"18\"\n height=\"18\"\n rx=\"3\"\n />\n {(this.checked || this.indeterminate) && this.renderCheckBoxSVGFill()}\n </svg>\n );\n }\n\n renderCheckBoxSVGFill() {\n if (this.indeterminate) {\n return (\n <line\n class=\"checkbox-fill indeterminate-fill\"\n x1=\"4\"\n y1=\"10\"\n x2=\"16\"\n y2=\"10\"\n />\n );\n }\n return (\n <polyline\n class=\"checkbox-fill checked-fill\"\n points=\"5 11 8.5 14.5 15 6\"\n key={`checkmark-${this.checked}`}\n />\n );\n }\n\n renderToggleSVG() {\n return (\n <div class=\"toggle-svg-container\">\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"0 0 38 24\"\n class=\"toggle-track\"\n test-id=\"toggleTrack\"\n >\n <rect\n width=\"38\"\n height=\"24\"\n rx=\"12\"\n ></rect>\n </svg>\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"0 0 18 18\"\n class=\"toggle-indicator\"\n test-id=\"toggleIndicator\"\n >\n <defs>\n {/* Mask for the X icon */}\n <mask\n id=\"xMask\"\n maskUnits=\"userSpaceOnUse\"\n >\n <rect\n width=\"18\"\n height=\"18\"\n fill=\"white\"\n ></rect>\n <line\n class=\"toggle-icon\"\n x1=\"6.5\"\n y1=\"6.5\"\n x2=\"11.5\"\n y2=\"11.5\"\n stroke=\"black\"\n stroke-width=\"2\"\n ></line>\n <line\n class=\"toggle-icon\"\n x1=\"6.5\"\n y1=\"11.5\"\n x2=\"11.5\"\n y2=\"6.5\"\n stroke=\"black\"\n stroke-width=\"2\"\n ></line>\n </mask>\n {/* Mask for the checkmark icon */}\n <mask id=\"checkMask\">\n <rect\n width=\"18\"\n height=\"18\"\n fill=\"white\"\n />\n <polyline\n class=\"toggle-icon\"\n points=\"6,8.5 8.5,11 12.5,6.5\"\n fill=\"none\"\n />\n </mask>\n </defs>\n <circle\n class=\"toggle-circle\"\n cx=\"9\"\n cy=\"9\"\n r=\"9\"\n mask=\"url(#xMask)\"\n ></circle>\n </svg>\n </div>\n );\n }\n\n render() {\n const textLabelClasses = ['label-text'];\n if (this.hideLabel) textLabelClasses.push('sr');\n return (\n <div class=\"container\">\n <input\n ref={el => (this.inputElement = el)}\n aria-describedby={this.description ? 'description' : undefined}\n aria-invalid={this.hasError === undefined ? undefined : `${this.hasError}`}\n checked={this.indeterminate || this.checked || false}\n class=\"sr\"\n disabled={!!this.disabled || !!this.groupDisabled}\n id={this._id}\n name={this.name || this._id}\n onClick={this.onInputClick}\n test-id=\"q2CheckboxInnerCheckBox\"\n type=\"checkbox\"\n value={this.value}\n />\n <label\n htmlFor={this._id}\n class=\"label-control\"\n test-id=\"checkboxButton\"\n aria-label={loc(this.label)}\n >\n {this.renderCheckboxSVG()}\n </label>\n <div class={textLabelClasses.join(' ')}>\n <label\n test-id=\"checkboxLabel\"\n htmlFor={this._id}\n aria-hidden=\"true\"\n >\n <div class=\"label-content\">\n {loc(this.label)}\n <slot />\n </div>\n </label>\n </div>\n {this.description && (\n <div\n class=\"description-text\"\n test-id=\"checkboxDescription\"\n id=\"description\"\n >\n {loc(this.description)}\n </div>\n )}\n </div>\n );\n }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,CACN,CACF,CACN,EACL,IAAI,CAAC,WAAW,KACbA,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACI,KAAK,EAAC,kBAAkB,EAChB,SAAA,EAAA,qBAAqB,EAC7B,EAAE,EAAC,aAAa,EAAA,EAEfC,WAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CACpB,CACT,CACC;;;;;;;;;;;"}
1
+ {"version":3,"file":"q2-checkbox.entry.cjs.js","sources":["src/components/q2-checkbox/q2-checkbox.scss?tag=q2-checkbox&encapsulation=shadow","src/components/q2-checkbox/q2-checkbox.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n --comp-checkbox-padding: #{var-list(\n --tct-checkbox-padding,\n unquote('#{var-list(var-prefixer(checkbox-vertical-padding), 8px)} 0')\n )};\n\n display: block;\n position: relative;\n padding: var(--comp-checkbox-padding);\n --comp-default-checkbox-margin: #{var-list(var-prefixer(checkbox-margin-top), 0px) 0\n var-list(var-prefixer(checkbox-margin-bottom), 0px)};\n margin: var-list(--tct-checkbox-margin, --comp-default-checkbox-margin);\n}\n\n.container {\n --comp-checkbox-size: #{var-list(var-prefixer(checkbox-size), 24px)};\n --comp-checkbox-default-column-gap: var(--app-scale-2x, 10px);\n --comp-checkbox-default-row-gap: 0;\n --comp-checkbox-default-gap: #{var(--comp-checkbox-default-row-gap) var(--comp-checkbox-default-column-gap)};\n --comp-checkbox-tween: #{var-list(--tct-tween-1, --app-tween-1, unquote('0.2s ease'))};\n --comp-checkbox-toggle-width: #{var-list(var-prefixer(checkbox-toggle-width), 38px)};\n\n --comp-checkbox-toggle-track-fill: #{var-list(\n --tct-checkbox-toggle-track-fill,\n --tct-checkbox-toggle-track-color,\n transparent\n )};\n --comp-checkbox-toggle-track-fill-active: #{var-list(\n --tct-checkbox-toggle-active-track-fill,\n --tct-checkbox-toggle-active-track-color,\n --tct-checkbox-toggle-active-color,\n --t-primary-l1,\n #7755af\n )};\n --comp-checkbox-toggle-track-fill-hover: #{var-list(\n --tct-checkbox-toggle-hover-track-fill,\n --tct-checkbox-toggle-hover-track-color,\n --comp-checkbox-toggle-track-fill\n )};\n --comp-checkbox-toggle-track-fill-error: #{var-list(\n --tct-checkbox-toggle-error-track-fill,\n --tct-checkbox-toggle-error-track-color,\n --comp-checkbox-toggle-track-fill\n )};\n --comp-checkbox-toggle-track-fill-error-hover: #{var-list(\n --tct-checkbox-toggle-error-hover-track-fill,\n --tct-checkbox-toggle-error-hover-track-color,\n --comp-checkbox-toggle-track-fill-error\n )};\n --comp-checkbox-toggle-track-fill-error-active: #{var-list(\n --tct-checkbox-toggle-error-active-track-fill,\n --tct-checkbox-toggle-error-active-track-color,\n --comp-checkbox-toggle-track-fill-error\n )};\n\n --comp-checkbox-toggle-error-color: #{var-list(--tct-checkbox-toggle-error-color, --comp-checkbox-error-color)};\n --comp-checkbox-toggle-color: #{var-list(--tct-checkbox-toggle-color, --t-gray-8, #808080)};\n --comp-checkbox-gap: #{var-list(var-prefixer(checkbox-gap), --comp-checkbox-default-gap)};\n --comp-checkbox-outer-stroke-color: #{var-list(\n var-prefixer(checkbox-outer-stroke-color),\n --t-a11y-gray-color-AA,\n #949494\n )};\n --comp-checkbox-outer-fill-color: #{var-list(\n var-prefixer(checkbox-outer-fill-color),\n --tct-white,\n --app-white,\n #ffffff\n )};\n --comp-checkbox-checked-fill-color: #{var-list(\n --tct-checkbox-checked-fill-color,\n --t-primary,\n #040404\n )};\n --comp-checkbox-checked-color: #{var-list(\n --tct-checkbox-checked-stroke-color,\n --tct-white,\n --app-white,\n #FFFFFF\n )};\n --comp-control-width: var(--comp-checkbox-size);\n --comp-checkbox-error-color: #{var-list(--tct-stoplight-error, --const-stoplight-alert, #d20a0a)};\n\n --comp-checkbox-bold-fallback-stroke-width: #{var-list(--tct-checkbox-bold-fallback-stroke-width, 0.7px)};\n --comp-checkbox-stroke-width: #{var-list(--tct-checkbox-stroke-width, unset)};\n --comp-checkbox-checked-stroke-width: #{var-list(\n --tct-checkbox-checked-stroke-width,\n --comp-checkbox-bold-fallback-stroke-width\n )};\n --comp-checkbox-hover-stroke-width: #{var-list(--tct-checkbox-hover-stroke-width, unset)};\n --comp-checkbox-focused-stroke-width: #{var-list(--tct-checkbox-focused-stroke-width, unset)};\n --comp-checkbox-checked-hover-stroke-width: #{var-list(\n --tct-checkbox-checked-hover-stroke-width,\n --comp-checkbox-bold-fallback-stroke-width\n )};\n --comp-checkbox-checked-focused-stroke-width: #{var-list(\n --tct-checkbox-checked-focused-stroke-width,\n --comp-checkbox-bold-fallback-stroke-width\n )};\n --comp-checkbox-description-stroke-width: #{var-list(\n --tct-checkbox-description-stroke-width,\n --comp-checkbox-bold-fallback-stroke-width\n )};\n --comp-checkbox-description-focused-stroke-width: #{var-list(\n --tct-checkbox-description-focused-stroke-width,\n --comp-checkbox-bold-fallback-stroke-width\n )};\n --comp-checkbox-description-hover-stroke-width: #{var-list(\n --tct-checkbox-description-hover-stroke-width,\n --comp-checkbox-bold-fallback-stroke-width\n )};\n\n :host([type='favorite']) & {\n --comp-checkbox-favorite-stroke-color: #{var-list(\n var-prefixer(checkbox-favorite-stroke-color),\n --t-a11y-gray-color-AA,\n #949494\n )};\n --comp-checkbox-favorite-fill-color: #{var-list(var-prefixer(checkbox-favorite-fill-color), #db7d24)};\n }\n\n display: grid;\n grid-template-areas:\n 'svg label'\n 'svg description';\n align-items: center;\n gap: var(--comp-checkbox-gap);\n grid-template-columns: var(--comp-control-width) calc(\n 100% - var(--comp-control-width) - var(--comp-checkbox-default-column-gap)\n );\n\n :host([hide-label]:not([hide-label='false'])) & {\n grid-template-areas: 'svg';\n grid-template-columns: var(--comp-control-width);\n }\n\n :host([type='toggle']) & {\n --comp-control-width: var(--comp-checkbox-toggle-width);\n }\n\n :host([alignment='right']) &,\n :host([type='toggle']:not([alignment])) & {\n grid-template-areas:\n 'label svg'\n 'description svg';\n grid-template-columns: calc(100% - var(--comp-control-width) - var(--comp-checkbox-default-column-gap)) var(\n --comp-control-width\n );\n }\n}\n\n.label-control {\n align-items: center;\n display: flex;\n}\n\n.label-text {\n grid-area: label;\n\n :host([description]) & {\n -webkit-text-stroke-width: var(--comp-checkbox-description-stroke-width);\n text-stroke-width: var(--comp-checkbox-description-stroke-width);\n }\n :host([checked]:not([checked='false'])) & {\n -webkit-text-stroke-width: var(--comp-checkbox-checked-stroke-width);\n text-stroke-width: var(--comp-checkbox-checked-stroke-width);\n }\n :host(:hover) & {\n -webkit-text-stroke-width: var(--comp-checkbox-hover-stroke-width);\n text-stroke-width: var(--comp-checkbox-hover-stroke-width);\n }\n :host(:focus-within) & {\n -webkit-text-stroke-width: var(--comp-checkbox-focused-stroke-width);\n text-stroke-width: var(--comp-checkbox-focused-stroke-width);\n }\n :host([description]:hover) & {\n -webkit-text-stroke-width: var(--comp-checkbox-description-hover-stroke-width);\n text-stroke-width: var(--comp-checkbox-description-hover-stroke-width);\n }\n :host([checked]:not([checked='false']):hover) & {\n -webkit-text-stroke-width: var(--comp-checkbox-checked-hover-stroke-width);\n text-stroke-width: var(--comp-checkbox-checked-hover-stroke-width);\n }\n :host([description]:focus-within) & {\n -webkit-text-stroke-width: var(--comp-checkbox-description-focused-stroke-width);\n text-stroke-width: var(--comp-checkbox-description-focused-stroke-width);\n }\n :host([checked]:not([checked='false']):focus-within) & {\n -webkit-text-stroke-width: var(--comp-checkbox-checked-focused-stroke-width);\n text-stroke-width: var(--comp-checkbox-checked-focused-stroke-width);\n }\n :host(:active) & {\n -webkit-text-stroke-width: var(--tct-checkbox-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-active-stroke-width, unset);\n }\n :host([checked]:not([checked='false']):active) & {\n -webkit-text-stroke-width: var(--tct-checkbox-checked-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-active-stroke-width, unset);\n }\n :host([has-error]:not([has-error='false']):hover) & {\n -webkit-text-stroke-width: var(--tct-checkbox-error-hover-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-error-hover-stroke-width, unset);\n }\n :host([has-error]:not([has-error='false']):focus-within) & {\n -webkit-text-stroke-width: var(--tct-checkbox-error-focused-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-error-focused-stroke-width, unset);\n }\n :host([has-error]:not([has-error='false']):active) & {\n -webkit-text-stroke-width: var(--tct-checkbox-error-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-error-active-stroke-width, unset);\n }\n :host([checked]:not([checked='false'])[has-error]:not([has-error='false']):hover) & {\n -webkit-text-stroke-width: var(--tct-checkbox-checked-error-hover-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-error-hover-stroke-width, unset);\n }\n :host([checked]:not([checked='false'])[has-error]:not([has-error='false']):focus-within) & {\n -webkit-text-stroke-width: var(--tct-checkbox-checked-error-focused-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-error-focused-stroke-width, unset);\n }\n :host([checked]:not([checked='false'])[has-error]:not([has-error='false']):active) & {\n -webkit-text-stroke-width: var(--tct-checkbox-checked-error-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-error-active-stroke-width, unset);\n }\n\n label {\n line-height: var-list(--tct-checkbox-label-line-height, 24px);\n .label-content {\n display: inline;\n font-size: var(--tct-checkbox-label-font-size, inherit);\n }\n }\n}\n\n.description-text {\n grid-area: description;\n font-weight: var-list(var-prefixer(checkbox-description-font-weight), 400);\n\n :host(:hover) & {\n font-weight: var-list(\n --tct-checkbox-hover-description-font-weight,\n var-prefixer(checkbox-description-font-weight),\n 400\n );\n }\n}\n\nlabel {\n color: var-list(--tct-checkbox-label-color);\n cursor: pointer;\n hyphens: var-list(--tct-checkbox-label-hyphens, auto);\n word-break: var-list(--tct-checkbox-label-word-break, break-word);\n word-wrap: var-list(--tct-checkbox-label-word-wrap, break-word);\n}\n\n.checkbox-icon {\n width: var(--comp-checkbox-size);\n height: var(--comp-checkbox-size);\n border-radius: var-list(\n var-prefixer(checkbox-outer-border-radius),\n --tct-border-radius-1,\n --app-border-radius-1,\n 4px\n );\n stroke: var(--comp-checkbox-outer-stroke-color);\n fill: var(--comp-checkbox-outer-fill-color);\n stroke-width: var-list(var-prefixer(checkbox-outer-stroke-width), 2);\n flex-shrink: 0;\n box-shadow: var(--tct-checkbox-box-shadow);\n\n rect {\n transition: fill var-list(--tct-checkbox-tween, --app-tween-2, unquote('0.4s ease'));\n }\n\n :host([checked]:not([checked='false']):not([type='favorite'])) & {\n stroke: var-list(\n --comp-checkbox-checked-fill-color,\n var-prefixer(checkbox-checked-outer-stroke-color),\n --comp-checkbox-outer-stroke-color\n );\n\n rect {\n fill: var(--comp-checkbox-checked-fill-color);\n }\n }\n\n :host([has-error]:not([has-error='false']):not([type='favorite'])) & {\n stroke: var-list(--tct-checkbox-error-outer-stroke-color, --comp-checkbox-error-color);\n box-shadow: var-list(--tct-checkbox-error-box-shadow, --tct-checkbox-box-shadow);\n\n rect {\n fill: var-list(--tct-checkbox-error-outer-fill-color, --comp-checkbox-outer-fill-color);\n }\n }\n\n :host([has-error]:not([has-error='false']):not([type='favorite'])[checked]:not([checked='false'])) & {\n rect {\n fill: var-list(--tct-checkbox-error-checked-outer-fill-color);\n }\n }\n\n :host([indeterminate]:not([indeterminate='false']):not([type='favorite'])) & {\n stroke: var-list(\n --comp-checkbox-checked-fill-color,\n var-prefixer(checkbox-checked-outer-stroke-color),\n --comp-checkbox-outer-stroke-color\n );\n\n rect {\n fill: var(--comp-checkbox-checked-fill-color);\n }\n }\n\n :host(:hover:not([type='favorite'])) & {\n stroke: var-list(--tct-checkbox-hover-outer-stroke-color, --comp-checkbox-outer-stroke-color);\n box-shadow: var-list(--tct-checkbox-hover-box-shadow, --tct-checkbox-box-shadow);\n rect {\n fill: var-list(--tct-checkbox-hover-outer-fill-color, --comp-checkbox-outer-fill-color);\n }\n }\n :host(:hover[has-error]:not([has-error='false']):not([type='favorite'])) & {\n stroke: var-list(\n --tct-checkbox-error-hover-outer-stroke-color,\n --tct-checkbox-error-outer-stroke-color,\n --comp-checkbox-error-color\n );\n box-shadow: var-list(\n --tct-checkbox-error-hover-box-shadow,\n --tct-checkbox-error-box-shadow,\n --tct-checkbox-hover-box-shadow,\n --tct-checkbox-box-shadow\n );\n rect {\n fill: var-list(\n --tct-checkbox-error-hover-outer-fill-color,\n --tct-checkbox-error-outer-fill-color,\n --comp-checkbox-outer-fill-color\n );\n }\n }\n\n :host(:focus-within:not([type='favorite'])) & {\n --comp-checkbox-focused-box-shadow: #{var(--const-double-focus-ring),\n var-list(--tct-global-focus, unquote('0 0 0 2px #33b4ff'))};\n\n stroke: var-list(var-prefixer(checkbox-focused-outer-stroke-color), --comp-checkbox-outer-stroke-color);\n fill: var-list(--tct-checkbox-focused-outer-fill-color, --comp-checkbox-outer-fill-color);\n box-shadow: var-list(\n --tct-checkbox-focused-box-shadow,\n --tct-checkbox-box-shadow,\n --comp-checkbox-focused-box-shadow\n );\n }\n :host(:focus-within[has-error]:not([has-error='false']):not([type='favorite'])) & {\n stroke: var-list(\n --tct-checkbox-error-focused-outer-stroke-color,\n --tct-checkbox-error-outer-stroke-color,\n --comp-checkbox-error-color\n );\n fill: var-list(\n --tct-checkbox-error-focused-outer-fill-color,\n --tct-checkbox-error-outer-fill-color,\n --comp-checkbox-outer-fill-color\n );\n box-shadow: var-list(\n --tct-checkbox-error-focused-box-shadow,\n --tct-checkbox-error-box-shadow,\n --tct-checkbox-box-shadow,\n --comp-checkbox-focused-box-shadow\n );\n }\n\n // Favorite\n :host([type='favorite']) & {\n --tct-icon-stroke-width: #{var-list(var-prefixer(checkbox-favorite-stroke-width), 1)};\n --tct-icon-stroke-primary: var(--comp-checkbox-favorite-stroke-color);\n transition:\n fill var(--comp-checkbox-tween),\n color var(--comp-checkbox-tween),\n stroke var(--comp-checkbox-tween);\n }\n\n :host(:hover[type='favorite']) & {\n --tct-icon-stroke-primary: #{var-list(\n --tct-checkbox-favorite-hover-stroke-color,\n --comp-checkbox-favorite-fill-color\n )};\n --tct-icon-stroke-width: #{var-list(var-prefixer(checkbox-favorite-hover-stroke-width), 2)};\n }\n\n :host([type='favorite']:focus-within) & {\n --tct-icon-stroke-primary: #{var-list(\n --tct-checkbox-favorite-focused-stroke-color,\n --comp-checkbox-favorite-fill-color\n )};\n --tct-icon-stroke-width: #{var-list(var-prefixer(checkbox-favorite-hover-stroke-width), 2)};\n }\n\n // Checked favorite\n :host([checked]:not([checked='false'])[type='favorite']) & {\n --tct-icon-stroke-primary: #{var-list(\n --tct-checkbox-favorite-checked-stroke-color,\n --tct-checkbox-favorite-stroke-color,\n --comp-checkbox-favorite-fill-color\n )};\n fill: var-list(--tct-checkbox-favorite-checked-fill-color, --comp-checkbox-favorite-fill-color);\n transition:\n fill var(--comp-checkbox-tween),\n color var(--comp-checkbox-tween),\n stroke var(--comp-checkbox-tween);\n }\n\n :host([checked]:not([checked='false'])[type='favorite']:hover) & {\n --tct-icon-stroke-primary: #{var-list(\n --tct-checkbox-favorite-checked-hover-stroke-color,\n --tct-checkbox-favorite-hover-stroke-color,\n --comp-checkbox-favorite-stroke-color\n )};\n --tct-icon-fill-primary: #{var-list(\n --tct-checkbox-favorite-checked-fill-color,\n --comp-checkbox-favorite-fill-color\n )};\n --tct-icon-stroke-width: #{var-list(var-prefixer(checkbox-favorite-hover-stroke-width), 2)};\n }\n\n :host([checked]:not([checked='false'])[type='favorite']:focus-within) & {\n --tct-icon-stroke-primary: #{var-list(\n --tct-checkbox-favorite-checked-focused-stroke-color,\n --tct-checkbox-favorite-focused-stroke-color,\n --comp-checkbox-favorite-stroke-color\n )};\n --tct-icon-stroke-width: #{var-list(var-prefixer(checkbox-favorite-hover-stroke-width), 2)};\n }\n\n :host([has-error]:not([has-error='false'])[type='favorite']) & {\n --tct-icon-stroke-primary: #{var-list(--tct-checkbox-favorite-error-stroke-color, --comp-checkbox-error-color)};\n }\n :host([has-error]:not([has-error='false'])[type='favorite'][checked]:not([checked='false'])) & {\n --tct-icon-stroke-primary: #{var-list(--tct-checkbox-favorite-error-stroke-color, --comp-checkbox-error-color)};\n }\n}\n\n.checkbox-fill {\n fill: none;\n stroke: var-list(--comp-checkbox-checked-color);\n stroke-width: var-list(var-prefixer(checkbox-check-stroke-width), 2.5);\n stroke-linecap: round;\n stroke-linejoin: round;\n\n :host([has-error]:not([has-error='false']):not([type='favorite'])) & {\n stroke: var(--tct-checkbox-error-checkmark-stroke-color, #d20a0a);\n stroke-width: var(--tct-checkbox-error-checkmark-stroke-width, 2.5);\n }\n}\n\n.checked-fill {\n stroke-dasharray: 16;\n stroke-dashoffset: 16;\n animation: draw-checkmark 350ms ease-out forwards;\n}\n\n@keyframes draw-checkmark {\n to {\n stroke-dashoffset: 0;\n }\n}\n\n.indeterminate-fill {\n stroke-width: var-list(var-prefixer(checkbox-indeterminate-stroke-width), 3.5);\n}\n\n.toggle-svg-container {\n height: 30px;\n width: var(--comp-checkbox-toggle-width);\n position: relative;\n text-align: initial;\n}\n\n.toggle-indicator,\n.toggle-track {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n.toggle-indicator {\n transition:\n left var(--comp-checkbox-tween),\n height var(--comp-checkbox-tween),\n width var(--comp-checkbox-tween);\n height: 16px;\n width: 16px;\n left: 4px;\n border-radius: 50%;\n}\n\n.toggle-track {\n --comp-default-track-box-shadow: inset 0 0 0 1px var(--comp-checkbox-toggle-color);\n height: 24px;\n width: 38px;\n fill: var(--comp-checkbox-toggle-track-fill);\n border-radius: var(--app-border-radius-3, 12px);\n box-shadow: var-list(--tct-checkbox-toggle-track-box-shadow, --comp-default-track-box-shadow);\n transition:\n fill var(--comp-checkbox-tween),\n box-shadow var(--comp-checkbox-tween);\n}\n\n.toggle-circle {\n mask: url(#xMask);\n fill: var(--comp-checkbox-toggle-color);\n transition: fill var(--comp-checkbox-tween);\n}\n\n.toggle-icon {\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-width: var(--tct-checkbox-toggle-icon-stroke-width, 2);\n stroke: black;\n}\n\n:host(:is(:not([checked]), [checked='false'])) {\n &:host(:is(:not([disabled]), [disabled='false']):is(:not([group-disabled]), [group-disabled='false'])) {\n :hover,\n :focus-within {\n .toggle-track {\n --comp-default-hover-track-box-shadow: inset 0 0 0 2px var(--comp-checkbox-toggle-color);\n box-shadow: var-list(\n --tct-checkbox-toggle-hover-track-box-shadow,\n --comp-default-hover-track-box-shadow\n );\n fill: var(--comp-checkbox-toggle-track-fill-hover);\n }\n .toggle-indicator {\n height: 18px;\n width: 18px;\n }\n .toggle-circle {\n fill: var-list(--tct-checkbox-toggle-hover-circle-color, --t-primary-d1, --t-gray-6, #4d4d4d);\n }\n .label-text {\n color: var(--tct-checkbox-label-hover-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-description-hover-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-description-hover-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-description-hover-stroke-width, unset);\n }\n }\n :active {\n .toggle-circle {\n fill: var(--comp-checkbox-toggle-track-fill-active);\n }\n .label-text {\n color: var(--tct-checkbox-label-active-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-description-active-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-description-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-description-active-stroke-width, unset);\n }\n }\n }\n\n &:host([has-error]:not([has-error='false'])) {\n .toggle-track {\n box-shadow: inset 0 0 0 1px var(--comp-checkbox-toggle-error-color);\n fill: var(--comp-checkbox-toggle-track-fill-error);\n }\n .toggle-circle {\n fill: var(--comp-checkbox-toggle-error-color);\n }\n\n &:host(:is(:not([disabled]), [disabled='false']):is(:not([group-disabled]), [group-disabled='false'])) {\n :hover,\n :focus-within {\n .toggle-track {\n box-shadow: inset 0 0 0 2px var(--comp-checkbox-toggle-error-color);\n fill: var(--comp-checkbox-toggle-track-fill-error-hover);\n }\n .toggle-circle {\n fill: var-list(--tct-checkbox-toggle-error-hover-color, --comp-checkbox-toggle-error-color);\n }\n .label-text {\n color: var(--tct-checkbox-label-hover-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-description-hover-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-description-hover-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-description-hover-stroke-width, unset);\n }\n }\n :active {\n .toggle-track {\n fill: var(--comp-checkbox-toggle-track-fill-error-active);\n }\n .toggle-circle {\n fill: var-list(--tct-checkbox-toggle-error-active-color, --comp-checkbox-toggle-error-color);\n }\n .label-text {\n color: var(--tct-checkbox-error-label-active-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-error-description-active-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-error-description-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-error-description-active-stroke-width, unset);\n }\n }\n }\n }\n}\n\n:host([checked]:not([checked='false'])) {\n .toggle-indicator {\n left: 18px;\n }\n\n .toggle-track {\n fill: var-list(--tct-checkbox-toggle-checked-track-color, --t-primary, #6a4a9e);\n border: none;\n }\n .toggle-circle {\n mask: url(#checkMask);\n fill: var-list(--tct-checkbox-toggle-checked-circle-color, --t-base, #ffffff);\n }\n\n &:host(:is(:not([disabled]), [disabled='false']):is(:not([group-disabled]), [group-disabled='false'])) {\n :hover,\n :focus-within {\n .toggle-track {\n fill: var-list(--tct-checkbox-toggle-checked-hover-track-color, --t-primary-d1, #5f438e);\n }\n .toggle-indicator {\n height: 18px;\n width: 18px;\n }\n .label-text {\n color: var(--tct-checkbox-checked-label-hover-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-checked-description-hover-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-checked-description-hover-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-description-hover-stroke-width, unset);\n }\n }\n\n :active {\n .toggle-track {\n fill: var-list(--tct-checkbox-toggle-checked-active-track-color, --t-primary-l1, #7755af);\n }\n .toggle-indicator {\n height: 18px;\n width: 18px;\n }\n .label-text {\n color: var(--tct-checkbox-checked-label-active-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-checked-description-active-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-checked-description-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-description-active-stroke-width, unset);\n }\n }\n }\n\n &:host([has-error]:not([has-error='false'])) {\n .toggle-track {\n fill: var-list(--tct-checkbox-toggle-checked-error-track-color, --comp-checkbox-toggle-error-color);\n }\n &:host(:is(:not([disabled]), [disabled='false']):is(:not([group-disabled]), [group-disabled='false'])) {\n :hover,\n :focus-within {\n .toggle-track {\n fill: var-list(\n --tct-checkbox-toggle-checked-error-hover-track-color,\n --comp-checkbox-toggle-error-color\n );\n }\n .label-text {\n color: var(--tct-checkbox-checked-error-label-hover-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-checked-error-description-hover-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-checked-error-description-hover-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-error-description-hover-stroke-width, unset);\n }\n }\n\n :active {\n .toggle-track {\n fill: var-list(\n --tct-checkbox-toggle-checked-error-active-track-color,\n --comp-checkbox-toggle-error-color\n );\n }\n .label-text {\n color: var(--tct-checkbox-checked-error-label-active-color, inherit);\n }\n .description-text {\n color: var(--tct-checkbox-checked-error-description-active-color, inherit);\n -webkit-text-stroke-width: var(--tct-checkbox-checked-error-description-active-stroke-width, unset);\n text-stroke-width: var(--tct-checkbox-checked-error-description-active-stroke-width, unset);\n }\n }\n }\n }\n}\n\n:host(:is([disabled]:not([disabled='false']), [group-disabled]:not([group-disabled='false']))) {\n cursor: not-allowed;\n opacity: var-list(var-prefixer(checkbox-disabled-opacity), --tct-disabled-opacity, --app-disabled-opacity, 0.4);\n label {\n cursor: not-allowed;\n }\n}\n","import { Component, ComponentInterface, Prop, Element, Listen, Watch, Event, EventEmitter, h } from '@stencil/core';\nimport { createGuid, handleAriaLabel, isEventFromElement, loc, overrideFocus } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\n\n@Component({ tag: 'q2-checkbox', shadow: true, styleUrl: 'q2-checkbox.scss' })\nexport class Q2Checkbox implements ComponentInterface {\n // #region Own Properties\n\n _id: string = `checkbox-${createGuid()}`;\n inputElement: HTMLInputElement;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n /** Determine which side of the label the checkbox will render on. */\n @Prop({ reflect: true })\n alignment: string;\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n ariaLabel: string;\n\n /** The state of the checkbox. This modifies the visual appearance of the element. */\n @Prop({ reflect: true, mutable: true })\n checked: boolean = false;\n\n /**\n * Populates a description that is displayed beneath the label.\n * @localizable\n */\n @Prop({ reflect: true })\n description: string;\n\n /** Disables the checkbox and prevents interaction. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /**\n * Used by q2-checkbox-group to disable all checkboxes in the group\n * @private\n */\n @Prop({ reflect: true })\n groupDisabled: boolean;\n\n /** Determines if the component should display in an errant state. */\n @Prop({ reflect: true })\n hasError: boolean = false;\n\n /**\n * Hide's the field's `<label>` element from view.\n *\n * @warning\n * Only use when a visible label is impractical.\n */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * Used on a parent checkbox in a checkbox group (e.g. \"Select All\") to indicate that some, but not all, checkboxes in a group are checked.\n *\n * When `true`, the \"indeterminate\" selection style is applied.\n * To apply the standard \"checked\" selection style, `checked` must be true, and `indeterminate` must be `false`.\n */\n @Prop({ reflect: true })\n indeterminate: boolean;\n\n /**\n * The visible label text for the checkbox. Appears to the right of the box for 'default' and 'favorite' checkboxes, and to the left for 'toggle' checkboxes.\n * Yielded content will be adjacent to this text.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n label: string;\n\n /** A static string used to establish a symbolic relationship between checkboxes. */\n @Prop({ reflect: true })\n name: string;\n\n /** The field is not interactive, but remains focusable. */\n @Prop({ reflect: true })\n readonly: boolean;\n\n /** The field is not interactive, but remains focusable. */\n @Prop({ reflect: true })\n slotReadonly: boolean;\n\n /** The visual style of the checkbox. This does not need to be defined for a standard checkbox. */\n @Prop({ reflect: true })\n type: 'favorite' | 'toggle';\n\n /** A static reference value for the checkbox. */\n @Prop({ reflect: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the checkbox is toggled.\n * @deprecated Use 'tctChange' instead\n * @legacyEvent\n */\n @Event()\n change: EventEmitter<{ value: string; checked: boolean }>;\n\n /**\n * Emitted when the checkbox is toggled.\n * @legacyEvent\n */\n @Event()\n tctChange: EventEmitter<{ value: string; checked: boolean }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n handleAriaLabel(this);\n }\n\n componentDidLoad(): void {\n overrideFocus(this.hostElement);\n this.hostElement.click = () => this.inputElement.click();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('change')\n defaultChangeHandler(event: CustomEvent) {\n // We use setTimeout to give an opportunity to call preventDefault\n setTimeout(() => this.handleChangeEvent(event), 0);\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.hostElement.shadowRoot.querySelector('input').focus();\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('ariaLabel')\n ariaLabelObserver() {\n handleAriaLabel(this);\n }\n\n // #endregion\n // #region Local Methods\n\n handleChangeEvent(event: CustomEvent<{ checked: boolean; value: string }>) {\n if (\n this.readonly ||\n this.disabled ||\n this.hostElement.onchange ||\n event.defaultPrevented ||\n event.target !== this.hostElement ||\n !event.detail\n ) {\n return;\n }\n this.checked = event.detail.checked;\n }\n\n onInputClick = (event: Event) => {\n event.stopPropagation();\n event.preventDefault();\n\n const isNotInteractive = this.disabled || this.readonly || this.slotReadonly;\n if (isNotInteractive) return;\n if (!(event.target instanceof HTMLInputElement)) return;\n const { value, checked } = event.target;\n\n mirrorEmit(this, ['change', 'tctChange'], {\n value,\n checked,\n });\n this.inputElement.focus();\n };\n\n // #endregion\n // #region Render Methods\n\n renderCheckboxSVG() {\n if (this.type === 'favorite') {\n return (\n <q2-icon\n type=\"star\"\n class=\"checkbox-icon\"\n />\n );\n }\n\n if (this.type === 'toggle') {\n return this.renderToggleSVG();\n }\n\n return (\n <svg\n aria-hidden=\"true\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n class=\"checkbox-icon\"\n focusable=\"false\"\n >\n <rect\n x=\"1\"\n y=\"1\"\n width=\"18\"\n height=\"18\"\n rx=\"3\"\n />\n {(this.checked || this.indeterminate) && this.renderCheckBoxSVGFill()}\n </svg>\n );\n }\n\n renderCheckBoxSVGFill() {\n if (this.indeterminate) {\n return (\n <line\n class=\"checkbox-fill indeterminate-fill\"\n x1=\"4\"\n y1=\"10\"\n x2=\"16\"\n y2=\"10\"\n />\n );\n }\n return (\n <polyline\n class=\"checkbox-fill checked-fill\"\n points=\"5 11 8.5 14.5 15 6\"\n key={`checkmark-${this.checked}`}\n />\n );\n }\n\n renderToggleSVG() {\n return (\n <div class=\"toggle-svg-container\">\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"0 0 38 24\"\n class=\"toggle-track\"\n test-id=\"toggleTrack\"\n >\n <rect\n width=\"38\"\n height=\"24\"\n rx=\"12\"\n ></rect>\n </svg>\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"0 0 18 18\"\n class=\"toggle-indicator\"\n test-id=\"toggleIndicator\"\n >\n <defs>\n {/* Mask for the X icon */}\n <mask\n id=\"xMask\"\n maskUnits=\"userSpaceOnUse\"\n >\n <rect\n width=\"18\"\n height=\"18\"\n fill=\"white\"\n ></rect>\n <line\n class=\"toggle-icon\"\n x1=\"6.5\"\n y1=\"6.5\"\n x2=\"11.5\"\n y2=\"11.5\"\n stroke=\"black\"\n stroke-width=\"2\"\n ></line>\n <line\n class=\"toggle-icon\"\n x1=\"6.5\"\n y1=\"11.5\"\n x2=\"11.5\"\n y2=\"6.5\"\n stroke=\"black\"\n stroke-width=\"2\"\n ></line>\n </mask>\n {/* Mask for the checkmark icon */}\n <mask id=\"checkMask\">\n <rect\n width=\"18\"\n height=\"18\"\n fill=\"white\"\n />\n <polyline\n class=\"toggle-icon\"\n points=\"6,8.5 8.5,11 12.5,6.5\"\n fill=\"none\"\n />\n </mask>\n </defs>\n <circle\n class=\"toggle-circle\"\n cx=\"9\"\n cy=\"9\"\n r=\"9\"\n mask=\"url(#xMask)\"\n ></circle>\n </svg>\n </div>\n );\n }\n\n render() {\n const textLabelClasses = ['label-text'];\n if (this.hideLabel) textLabelClasses.push('sr');\n return (\n <div class=\"container\">\n <input\n ref={el => (this.inputElement = el)}\n aria-describedby={this.description ? 'description' : undefined}\n aria-invalid={this.hasError === undefined ? undefined : `${this.hasError}`}\n checked={this.indeterminate || this.checked || false}\n class=\"sr\"\n disabled={!!this.disabled || !!this.groupDisabled}\n id={this._id}\n name={this.name || this._id}\n onClick={this.onInputClick}\n test-id=\"q2CheckboxInnerCheckBox\"\n type=\"checkbox\"\n value={this.value}\n />\n <label\n htmlFor={this._id}\n class=\"label-control\"\n test-id=\"checkboxButton\"\n aria-label={loc(this.label)}\n >\n {this.renderCheckboxSVG()}\n </label>\n <div class={textLabelClasses.join(' ')}>\n <label\n test-id=\"checkboxLabel\"\n htmlFor={this._id}\n aria-hidden=\"true\"\n >\n <div class=\"label-content\">\n {loc(this.label)}\n <slot />\n </div>\n </label>\n </div>\n {this.description && (\n <div\n class=\"description-text\"\n test-id=\"checkboxDescription\"\n id=\"description\"\n >\n {loc(this.description)}\n </div>\n )}\n </div>\n );\n }\n\n // #endregion\n}\n"],"names":["createGuid","mirrorEmit","handleAriaLabel","overrideFocus","isEventFromElement","h","loc"],"mappings":";;;;;;AAAA,MAAM,aAAa,GAAG,oj9BAAoj9B;;MCK7j9B,UAAU,GAAA,MAAA;AADvB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;AAII,QAAA,IAAA,CAAA,GAAG,GAAW,YAAYA,kBAAU,EAAE,EAAE;;AAsBxC,QAAA,IAAO,CAAA,OAA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
  return `q2-editable-field-wrapper ${this.editing ? 'editing' : ''}`;
201
201
  }
202
202
  generateEditStateDOM() {
203
- return (index.h("div", { class: this.wrapperClass, hidden: !this.editing }, index.h("q2-input", { ref: el => (this.inputElement = el), label: this.locLabel, hideLabel: this.hideLabel, value: this.value, hints: this.hasHints ? this.hints : undefined, errors: this.hasErrors ? this.errors : undefined, type: this.type, disabled: this.disabled, formatModifier: this.formatModifier, maxlength: this.maxlength, "test-id": "editableInput", onInput: e => e.stopImmediatePropagation(), onTctInput: this.inputInput, onTctChange: this.inputChange, onKeyDown: this.inputKeyDown, onClick: this.inputClick }), index.h("q2-btn", { ref: el => (this.cancelBtnElement = el), class: "cancel-edit", label: `${index$1.loc('tecton.element.editableField.cancel')} ${this.locLabel}`, "hide-label": true, "test-id": "cancelButton", onClick: e => e.stopImmediatePropagation(), onTctClick: this.cancelClick }, index.h("q2-icon", { type: "close" })), index.h("q2-btn", { ref: el => (this.saveBtnElement = el), class: "save-edit", label: `${index$1.loc('tecton.element.editableField.save')} ${this.locLabel}`, "hide-label": true, "test-id": "saveButton", onClick: e => e.stopImmediatePropagation(), onTctClick: this.saveClick }, index.h("q2-icon", { type: "checkmark" }))));
203
+ return (index.h("div", { class: this.wrapperClass, hidden: !this.editing }, index.h("q2-input", { ref: el => (this.inputElement = el), label: this.locLabel, hideLabel: this.hideLabel, value: this.value, hints: this.hasHints ? this.hints : undefined, errors: this.hasErrors ? this.errors : undefined, type: this.type, disabled: this.disabled, formatModifier: this.formatModifier, maxlength: this.maxlength, "test-id": "editableInput", onChange: e => e.stopImmediatePropagation(), onInput: e => e.stopImmediatePropagation(), onTctInput: this.inputInput, onTctChange: this.inputChange, onKeyDown: this.inputKeyDown, onClick: this.inputClick }), index.h("q2-btn", { ref: el => (this.cancelBtnElement = el), class: "cancel-edit", label: `${index$1.loc('tecton.element.editableField.cancel')} ${this.locLabel}`, "hide-label": true, "test-id": "cancelButton", onClick: e => e.stopImmediatePropagation(), onTctClick: this.cancelClick }, index.h("q2-icon", { type: "close" })), index.h("q2-btn", { ref: el => (this.saveBtnElement = el), class: "save-edit", label: `${index$1.loc('tecton.element.editableField.save')} ${this.locLabel}`, "hide-label": true, "test-id": "saveButton", onClick: e => e.stopImmediatePropagation(), onTctClick: this.saveClick }, index.h("q2-icon", { type: "checkmark" }))));
204
204
  }
205
205
  generateReadStateDOM() {
206
206
  if (this.persistentLabel && this.locLabel) {
@@ -211,7 +211,7 @@ const Q2EditableField = class {
211
211
  // #endregion
212
212
  // #region Render Methods
213
213
  render() {
214
- return (index.h("div", { key: '928f5bdf39983dfd0441ffefe53fd6971633189b' }, this.generateEditStateDOM(), this.generateReadStateDOM()));
214
+ return (index.h("div", { key: 'dfabd2ca37dc085e1d01e31b1229909eb582988b' }, this.generateEditStateDOM(), this.generateReadStateDOM()));
215
215
  }
216
216
  get hostElement() { return index.getElement(this); }
217
217
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"q2-editable-field.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,kBAAkB,GAAG,g0DAAg0D;;MCa90D,eAAe,GAAA,MAAA;AAD5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;AAUI,QAAA,IAAoB,CAAA,oBAAA,GAAmB,EAAE;;AA+BzC,QAAA,IAAO,CAAA,OAAA,GAAY,KAAK;AAgCxB;;;;AAIG;AAEH,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;;AA4BlB,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AA+MlB,QAAA,IAAA,CAAA,WAAW,GAAG,CAAC,KAAmB,KAAI;AAClC,YAAA,KAAK,aAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,eAAe,EAAE;AACxB,YAAAA,qBAAU,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;YAC7E,IAAI,CAAC,YAAY,CAAC,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EAAS,IAAI,EAAC,MAAM,GAAG,CAClB,CACP;;;;IAgDd,MAAM,GAAA;QACF,QACIA,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACK,IAAI,CAAC,oBAAoB,EAAE,EAC3B,IAAI,CAAC,oBAAoB,EAAE,CAC1B;;;;;;;;;;;;;","names":["mirrorEmit","handleAriaLabel","overrideFocus","isEventFromElement","waitForNextPaint","loc","h"],"sources":["src/components/q2-editable-field/q2-editable-field.scss?tag=q2-editable-field&encapsulation=shadow","src/components/q2-editable-field/q2-editable-field.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline-block;\n max-width: 100%;\n}\n\n.q2-editable-field-wrapper {\n .begin-edit,\n .save-edit,\n .cancel-edit {\n flex: 0 0 44px;\n --tct-btn-icon-hover-background: #{var-list(\n --tct-editable-field-btn-hover-background,\n --app-gray-l3,\n #f2f2f2\n )};\n --tct-icon-stroke-primary: #{var-list(--tct-editable-field-btn-icon-stroke-primary, --app-gray, #747474)};\n --tct-icon-stroke-secondary: #{var-list(--tct-editable-field-btn-icon-stroke-secondary, --app-gray, #747474)};\n }\n}\n\n.q2-editable-field-wrapper:not([hidden]) {\n display: flex;\n}\n\n.q2-editable-field-wrapper.editing {\n align-items: flex-end;\n}\n\n:host([block]) {\n display: block;\n width: 100%;\n .q2-editable-field-wrapper:not([hidden]) {\n display: grid;\n grid-template-columns: 1fr auto auto;\n }\n}\n\nq2-input,\n.text-wrapper {\n margin: 0 var(--tct-scale-2, var(--app-scale-2x, 10px)) 0 0;\n}\n\nq2-input {\n flex: 1 1 auto;\n min-width: 170px;\n}\n\n.text-wrapper {\n flex: 0 auto;\n align-self: center;\n display: inline-block;\n}\n\n:host([truncated]) .text-wrapper {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\ndl {\n margin: var(--tct-scale-0, var(--app-scale-0x, 0));\n}\n\ndt {\n font-weight: 600;\n}\n\ndd {\n margin-left: var(--tct-scale-0, var(--app-scale-0x, 0));\n display: flex;\n align-items: center;\n}\n","import { Component, State, Prop, h, Listen, Element, Event, EventEmitter, Method, Watch } from '@stencil/core';\nimport { IEventDetail, Q2InputCustomEvent } from 'src/components';\nimport { handleAriaLabel, isEventFromElement, loc, overrideFocus, waitForNextPaint } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\nimport { Q2Input } from '../q2-input/q2-input';\nimport { IFormatterValueObject } from '../q2-input/q2-input-types';\n\n/**\n * @name Editable Field\n * @category Forms\n * @summary Use for inline editing of data that is normally displayed as read-only.\n */\n@Component({ tag: 'q2-editable-field', shadow: true, styleUrl: 'q2-editable-field.scss' })\nexport class Q2EditableField {\n // #region Own Properties\n\n cancelBtnElement: HTMLQ2BtnElement;\n defaultValue: string;\n editBtnElement: HTMLQ2BtnElement;\n innerValue: string;\n inputElement: HTMLQ2InputElement;\n saveBtnElement: HTMLQ2BtnElement;\n scheduledAfterRender: (() => void)[] = [];\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n formattedValue: string;\n\n // #endregion\n // #region Public Property API\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n ariaLabel: string;\n\n /** If `true`, component expands to fill the width of its parent element. */\n @Prop({ reflect: true })\n block: boolean;\n\n /** Disables the edit button and field. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /** Controls the edit state of the element. */\n @Prop({ reflect: true, mutable: true })\n editing: boolean = false;\n\n /**\n * Determines the `errors` applied to the `q2-input` element.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop()\n errors: string[];\n\n /**\n * Determines the `formatModifier` applied to the `q2-input` element.\n * @info\n * Only applicable when `type=\"currency\"`.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop({ reflect: true })\n formatModifier: string;\n\n /** Hide's the field's `<label>` element from view. */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * Determines the `hints` applied to the `q2-input` element.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop()\n hints: string[];\n\n /**\n * The visible descriptor for the element.\n * Serves as the input label while in the edit state and as a decorative label for the read state when `persistentLabel` is `true`.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n label: string = '';\n\n /**\n * Determines the `maxLength` applied to the `q2-input`.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop({ reflect: true })\n maxlength: number;\n\n /** Displays the provided label in the read state. */\n @Prop({ reflect: true })\n persistentLabel: boolean;\n\n /** Shortens long values with ellipses instead of splitting into multiple lines. */\n @Prop({ reflect: true })\n truncated: boolean;\n\n /**\n * Determines the `type` applied to the `q2-input` element.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for all `type` values.\n */\n @Prop({ reflect: true })\n type: Q2Input['type'];\n\n /** Serves as the visible text while in the read state, and the default value of the input while in the edit state. */\n @Prop({ reflect: true, mutable: true })\n value: string = '';\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the 'Edit', 'Cancel', or 'Save' buttons are clicked.\n *\n * The event detail will not include a `value` or `formattedValue` if the event name is 'edit' or 'cancel'.\n *@info\n * If you are utilizing events to provide input validation, it is recommended you use the `input` event, not the `change` event.\n * @deprecated Use 'tctChange' instead\n */\n @Event()\n change: EventEmitter<{\n editing: boolean;\n name: 'edit' | 'cancel' | 'save';\n value?: string;\n formattedValue?: string;\n }>;\n\n /**\n * Emitted when the user updates the `q2-input` element in the editing state.\n * @deprecated Use 'tctInput' instead\n */\n @Event()\n input: EventEmitter<{ formattedValue: string; value: string }>;\n\n /**\n * Emitted when the 'Edit', 'Cancel', or 'Save' buttons are clicked.\n *\n * The event detail will not include a `value` or `formattedValue` if the event name is 'edit' or 'cancel'.\n *\n * @info\n * If you are utilizing events to provide input validation, it is recommended you use the `input` event, not the `change` event.\n */\n @Event()\n tctChange: EventEmitter<{\n editing: boolean;\n name: 'edit' | 'cancel' | 'save';\n value?: string;\n formattedValue?: string;\n }>;\n\n /**\n * Emitted when the user updates the `q2-input` element in the editing state.\n */\n @Event()\n tctInput: EventEmitter<{ formattedValue: string; value: string }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n handleAriaLabel(this);\n\n this.defaultValue = this.value;\n }\n\n componentDidLoad() {\n overrideFocus(this.hostElement);\n }\n\n componentDidRender() {\n this.scheduledAfterRender.forEach(fn => fn());\n this.scheduledAfterRender = [];\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('change')\n onHostElementChange(event: CustomEvent) {\n if (!isEventFromElement(event, this.hostElement) || this.hostElement.onchange) return;\n queueMicrotask(() => {\n switch (event.detail.name) {\n case 'save':\n if (this.hasErrors) {\n this.inputElement.focus();\n break;\n }\n this.value = event.detail.value;\n this.editing = event.detail.editing;\n break;\n\n case 'cancel':\n this.inputElement.value = this.value;\n this.editing = event.detail.editing;\n break;\n\n case 'edit':\n this.editing = event.detail.editing;\n break;\n }\n });\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.hostElement.shadowRoot.querySelector<HTMLElement>(this.editing ? 'q2-input' : 'q2-btn.begin-edit').focus();\n }\n\n @Listen('tctFormatted')\n inputFormatted(event: CustomEvent<IFormatterValueObject>) {\n this.formattedValue = event.detail.formattedValue;\n }\n\n // #endregion\n // #region Public Methods API\n\n /**\n * Emulates clicking the cancel button, which will hide the `<q2-input>` field.\n *\n * @testOnly\n */\n @Method()\n clickCancel() {\n if (!this.editing) return;\n this.cancelBtnElement?.click();\n }\n\n /**\n * Emulates clicking the edit button, which will display the `<q2-input>` field.\n *\n * @testOnly\n */\n @Method()\n clickEdit() {\n if (this.editing) return;\n this.editBtnElement?.click();\n }\n\n /**\n * Emulates clicking the save button, saving value in the `<q2-input>` field, and emitting a `change` event.\n *\n * @testOnly\n */\n @Method()\n clickSave() {\n if (!this.editing) return;\n this.saveBtnElement?.click();\n }\n\n /**\n * Emulates clicking the edit button, and setting the value of the `<q2-input>` field.\n *\n * If the `clickSave` argument is `true` (default), the save button will be clicked after the value is set, and a\\\n * `change` event will be emitted.\n *\n * @testOnly\n */\n @Method()\n async setValue(value: string, options: { clickSave?: boolean } = { clickSave: true }) {\n await this.clickEdit();\n await waitForNextPaint();\n\n await this.inputElement.setValue(value);\n\n if (options.clickSave) {\n await this.clickSave();\n await waitForNextPaint();\n }\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('ariaLabel')\n ariaLabelObserver() {\n handleAriaLabel(this);\n }\n\n @Watch('editing')\n observesEditing(newValue: boolean, oldValue: boolean) {\n if (newValue === oldValue) return;\n this.scheduledAfterRender.push(this.hostElement.focus);\n }\n\n @Watch('errors')\n errorsObserver() {\n const { editing, hasErrors } = this;\n const focusedElement = this.hostElement.shadowRoot.activeElement;\n const isInputFocused = focusedElement?.tagName === 'Q2-INPUT';\n if (isInputFocused || !focusedElement || !editing || !hasErrors) return;\n this.inputElement.focus();\n }\n\n // #endregion\n // #region Local Methods\n\n get hasErrors(): boolean {\n return Array.isArray(this.errors) && !!this.errors.length;\n }\n\n get hasHints(): boolean {\n return Array.isArray(this.hints) && !!this.hints.length;\n }\n\n get locLabel() {\n return (this.label && loc(this.label)) || '';\n }\n\n get wrapperClass() {\n return `q2-editable-field-wrapper ${this.editing ? 'editing' : ''}`;\n }\n\n cancelClick = (event?: CustomEvent) => {\n event?.stopPropagation();\n mirrorEmit(this, ['change', 'tctChange'], { editing: false, name: 'cancel' });\n this.inputElement.setValue(this.defaultValue);\n };\n\n editClick = (event: CustomEvent) => {\n event?.stopPropagation();\n mirrorEmit(this, ['change', 'tctChange'], { editing: true, name: 'edit' });\n };\n\n generateEditStateDOM() {\n return (\n <div\n class={this.wrapperClass}\n hidden={!this.editing}\n >\n <q2-input\n ref={el => (this.inputElement = el)}\n label={this.locLabel}\n hideLabel={this.hideLabel}\n value={this.value}\n hints={this.hasHints ? this.hints : undefined}\n errors={this.hasErrors ? this.errors : undefined}\n type={this.type}\n disabled={this.disabled}\n formatModifier={this.formatModifier}\n maxlength={this.maxlength}\n test-id=\"editableInput\"\n onInput={e => e.stopImmediatePropagation()}\n onTctInput={this.inputInput}\n onTctChange={this.inputChange}\n onKeyDown={this.inputKeyDown}\n onClick={this.inputClick}\n />\n <q2-btn\n ref={el => (this.cancelBtnElement = el)}\n class=\"cancel-edit\"\n label={`${loc('tecton.element.editableField.cancel')} ${this.locLabel}`}\n hide-label\n test-id=\"cancelButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.cancelClick}\n >\n <q2-icon type=\"close\" />\n </q2-btn>\n <q2-btn\n ref={el => (this.saveBtnElement = el)}\n class=\"save-edit\"\n label={`${loc('tecton.element.editableField.save')} ${this.locLabel}`}\n hide-label\n test-id=\"saveButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.saveClick}\n >\n <q2-icon type=\"checkmark\" />\n </q2-btn>\n </div>\n );\n }\n\n generateReadStateDOM() {\n if (this.persistentLabel && this.locLabel) {\n return (\n <div\n class={this.wrapperClass}\n hidden={this.editing}\n >\n <dl>\n <dt class=\"read-state-label\">{this.locLabel}</dt>\n <dd>\n <span class=\"text-wrapper\">{this.formattedValue || this.value}</span>\n <q2-btn\n ref={el => (this.editBtnElement = el)}\n class=\"begin-edit\"\n label={`${loc('tecton.element.editableField.edit')} ${this.locLabel}`}\n hide-label\n disabled={this.disabled}\n test-id=\"editButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.editClick}\n >\n <q2-icon type=\"edit\" />\n </q2-btn>\n </dd>\n </dl>\n </div>\n );\n }\n return (\n <div\n class={this.wrapperClass}\n hidden={this.editing}\n >\n <div class=\"text-wrapper\">{this.formattedValue || this.value}</div>\n <q2-btn\n ref={el => (this.editBtnElement = el)}\n class=\"begin-edit\"\n label={`${loc('tecton.element.editableField.edit')} ${this.locLabel}`}\n hide-label\n disabled={this.disabled}\n test-id=\"editButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.editClick}\n >\n <q2-icon type=\"edit\" />\n </q2-btn>\n </div>\n );\n }\n\n inputChange = (e: CustomEvent) => {\n e.stopPropagation();\n };\n\n inputClick = (event: MouseEvent) => {\n event.stopPropagation();\n };\n\n inputInput = (event: Q2InputCustomEvent<IEventDetail> & InputEvent) => {\n event.stopPropagation();\n mirrorEmit(this, ['input', 'tctInput'], event.detail);\n this.formattedValue = event.detail.formattedValue;\n this.innerValue = event.detail.value;\n };\n\n inputKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' || e.key === 'Esc') {\n e.preventDefault();\n this.cancelClick();\n return;\n }\n\n if (e.key === 'Enter') {\n e.preventDefault();\n this.saveClick();\n return;\n }\n };\n\n saveClick = (event?: CustomEvent) => {\n event && event.stopPropagation();\n const valueFromInputProp = this.hostElement.shadowRoot.querySelector('q2-input').value;\n this.defaultValue = valueFromInputProp;\n mirrorEmit(this, ['change', 'tctChange'], {\n editing: false,\n name: 'save',\n value: this.innerValue || valueFromInputProp,\n formattedValue: this.formattedValue || valueFromInputProp,\n });\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n return (\n <div>\n {this.generateEditStateDOM()}\n {this.generateReadStateDOM()}\n </div>\n );\n }\n\n // #endregion\n}\n"],"version":3}
1
+ {"file":"q2-editable-field.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,kBAAkB,GAAG,g0DAAg0D;;MCa90D,eAAe,GAAA,MAAA;AAD5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;AAUI,QAAA,IAAoB,CAAA,oBAAA,GAAmB,EAAE;;AA+BzC,QAAA,IAAO,CAAA,OAAA,GAAY,KAAK;AAgCxB;;;;AAIG;AAEH,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;;AA4BlB,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AA+MlB,QAAA,I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AAG,EAAE,CAAC,EACrC,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,CAAA,EAAGD,WAAG,CAAC,mCAAmC,CAAC,CAAI,CAAA,EAAA,IAAI,CAAC,QAAQ,CAAE,CAAA,EAErE,YAAA,EAAA,IAAA,EAAA,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAA,SAAA,EACf,YAAY,EACpB,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,wBAAwB,EAAE,EAC1C,UAAU,EAAE,IAAI,CAAC,SAAS,EAAA,EAE1BC,OAAA,CAAA,SAAA,EAAA,EAAS,IAAI,EAAC,MAAM,GAAG,CAClB,CACP;;;;IAgDd,MAAM,GAAA;QACF,QACIA,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACK,IAAI,CAAC,oBAAoB,EAAE,EAC3B,IAAI,CAAC,oBAAoB,EAAE,CAC1B;;;;;;;;;;;;;","names":["mirrorEmit","handleAriaLabel","overrideFocus","isEventFromElement","waitForNextPaint","loc","h"],"sources":["src/components/q2-editable-field/q2-editable-field.scss?tag=q2-editable-field&encapsulation=shadow","src/components/q2-editable-field/q2-editable-field.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline-block;\n max-width: 100%;\n}\n\n.q2-editable-field-wrapper {\n .begin-edit,\n .save-edit,\n .cancel-edit {\n flex: 0 0 44px;\n --tct-btn-icon-hover-background: #{var-list(\n --tct-editable-field-btn-hover-background,\n --app-gray-l3,\n #f2f2f2\n )};\n --tct-icon-stroke-primary: #{var-list(--tct-editable-field-btn-icon-stroke-primary, --app-gray, #747474)};\n --tct-icon-stroke-secondary: #{var-list(--tct-editable-field-btn-icon-stroke-secondary, --app-gray, #747474)};\n }\n}\n\n.q2-editable-field-wrapper:not([hidden]) {\n display: flex;\n}\n\n.q2-editable-field-wrapper.editing {\n align-items: flex-end;\n}\n\n:host([block]) {\n display: block;\n width: 100%;\n .q2-editable-field-wrapper:not([hidden]) {\n display: grid;\n grid-template-columns: 1fr auto auto;\n }\n}\n\nq2-input,\n.text-wrapper {\n margin: 0 var(--tct-scale-2, var(--app-scale-2x, 10px)) 0 0;\n}\n\nq2-input {\n flex: 1 1 auto;\n min-width: 170px;\n}\n\n.text-wrapper {\n flex: 0 auto;\n align-self: center;\n display: inline-block;\n}\n\n:host([truncated]) .text-wrapper {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\ndl {\n margin: var(--tct-scale-0, var(--app-scale-0x, 0));\n}\n\ndt {\n font-weight: 600;\n}\n\ndd {\n margin-left: var(--tct-scale-0, var(--app-scale-0x, 0));\n display: flex;\n align-items: center;\n}\n","import { Component, State, Prop, h, Listen, Element, Event, EventEmitter, Method, Watch } from '@stencil/core';\nimport { IEventDetail, Q2InputCustomEvent } from 'src/components';\nimport { handleAriaLabel, isEventFromElement, loc, overrideFocus, waitForNextPaint } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\nimport { Q2Input } from '../q2-input/q2-input';\nimport { IFormatterValueObject } from '../q2-input/q2-input-types';\n\n/**\n * @name Editable Field\n * @category Forms\n * @summary Use for inline editing of data that is normally displayed as read-only.\n */\n@Component({ tag: 'q2-editable-field', shadow: true, styleUrl: 'q2-editable-field.scss' })\nexport class Q2EditableField {\n // #region Own Properties\n\n cancelBtnElement: HTMLQ2BtnElement;\n defaultValue: string;\n editBtnElement: HTMLQ2BtnElement;\n innerValue: string;\n inputElement: HTMLQ2InputElement;\n saveBtnElement: HTMLQ2BtnElement;\n scheduledAfterRender: (() => void)[] = [];\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n formattedValue: string;\n\n // #endregion\n // #region Public Property API\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n ariaLabel: string;\n\n /** If `true`, component expands to fill the width of its parent element. */\n @Prop({ reflect: true })\n block: boolean;\n\n /** Disables the edit button and field. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /** Controls the edit state of the element. */\n @Prop({ reflect: true, mutable: true })\n editing: boolean = false;\n\n /**\n * Determines the `errors` applied to the `q2-input` element.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop()\n errors: string[];\n\n /**\n * Determines the `formatModifier` applied to the `q2-input` element.\n * @info\n * Only applicable when `type=\"currency\"`.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop({ reflect: true })\n formatModifier: string;\n\n /** Hide's the field's `<label>` element from view. */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * Determines the `hints` applied to the `q2-input` element.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop()\n hints: string[];\n\n /**\n * The visible descriptor for the element.\n * Serves as the input label while in the edit state and as a decorative label for the read state when `persistentLabel` is `true`.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n label: string = '';\n\n /**\n * Determines the `maxLength` applied to the `q2-input`.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop({ reflect: true })\n maxlength: number;\n\n /** Displays the provided label in the read state. */\n @Prop({ reflect: true })\n persistentLabel: boolean;\n\n /** Shortens long values with ellipses instead of splitting into multiple lines. */\n @Prop({ reflect: true })\n truncated: boolean;\n\n /**\n * Determines the `type` applied to the `q2-input` element.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for all `type` values.\n */\n @Prop({ reflect: true })\n type: Q2Input['type'];\n\n /** Serves as the visible text while in the read state, and the default value of the input while in the edit state. */\n @Prop({ reflect: true, mutable: true })\n value: string = '';\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the 'Edit', 'Cancel', or 'Save' buttons are clicked.\n *\n * The event detail will not include a `value` or `formattedValue` if the event name is 'edit' or 'cancel'.\n *@info\n * If you are utilizing events to provide input validation, it is recommended you use the `input` event, not the `change` event.\n * @deprecated Use 'tctChange' instead\n */\n @Event()\n change: EventEmitter<{\n editing: boolean;\n name: 'edit' | 'cancel' | 'save';\n value?: string;\n formattedValue?: string;\n }>;\n\n /**\n * Emitted when the user updates the `q2-input` element in the editing state.\n * @deprecated Use 'tctInput' instead\n */\n @Event()\n input: EventEmitter<{ formattedValue: string; value: string }>;\n\n /**\n * Emitted when the 'Edit', 'Cancel', or 'Save' buttons are clicked.\n *\n * The event detail will not include a `value` or `formattedValue` if the event name is 'edit' or 'cancel'.\n *\n * @info\n * If you are utilizing events to provide input validation, it is recommended you use the `input` event, not the `change` event.\n */\n @Event()\n tctChange: EventEmitter<{\n editing: boolean;\n name: 'edit' | 'cancel' | 'save';\n value?: string;\n formattedValue?: string;\n }>;\n\n /**\n * Emitted when the user updates the `q2-input` element in the editing state.\n */\n @Event()\n tctInput: EventEmitter<{ formattedValue: string; value: string }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n handleAriaLabel(this);\n\n this.defaultValue = this.value;\n }\n\n componentDidLoad() {\n overrideFocus(this.hostElement);\n }\n\n componentDidRender() {\n this.scheduledAfterRender.forEach(fn => fn());\n this.scheduledAfterRender = [];\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('change')\n onHostElementChange(event: CustomEvent) {\n if (!isEventFromElement(event, this.hostElement) || this.hostElement.onchange) return;\n queueMicrotask(() => {\n switch (event.detail.name) {\n case 'save':\n if (this.hasErrors) {\n this.inputElement.focus();\n break;\n }\n this.value = event.detail.value;\n this.editing = event.detail.editing;\n break;\n\n case 'cancel':\n this.inputElement.value = this.value;\n this.editing = event.detail.editing;\n break;\n\n case 'edit':\n this.editing = event.detail.editing;\n break;\n }\n });\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.hostElement.shadowRoot.querySelector<HTMLElement>(this.editing ? 'q2-input' : 'q2-btn.begin-edit').focus();\n }\n\n @Listen('tctFormatted')\n inputFormatted(event: CustomEvent<IFormatterValueObject>) {\n this.formattedValue = event.detail.formattedValue;\n }\n\n // #endregion\n // #region Public Methods API\n\n /**\n * Emulates clicking the cancel button, which will hide the `<q2-input>` field.\n *\n * @testOnly\n */\n @Method()\n clickCancel() {\n if (!this.editing) return;\n this.cancelBtnElement?.click();\n }\n\n /**\n * Emulates clicking the edit button, which will display the `<q2-input>` field.\n *\n * @testOnly\n */\n @Method()\n clickEdit() {\n if (this.editing) return;\n this.editBtnElement?.click();\n }\n\n /**\n * Emulates clicking the save button, saving value in the `<q2-input>` field, and emitting a `change` event.\n *\n * @testOnly\n */\n @Method()\n clickSave() {\n if (!this.editing) return;\n this.saveBtnElement?.click();\n }\n\n /**\n * Emulates clicking the edit button, and setting the value of the `<q2-input>` field.\n *\n * If the `clickSave` argument is `true` (default), the save button will be clicked after the value is set, and a\\\n * `change` event will be emitted.\n *\n * @testOnly\n */\n @Method()\n async setValue(value: string, options: { clickSave?: boolean } = { clickSave: true }) {\n await this.clickEdit();\n await waitForNextPaint();\n\n await this.inputElement.setValue(value);\n\n if (options.clickSave) {\n await this.clickSave();\n await waitForNextPaint();\n }\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('ariaLabel')\n ariaLabelObserver() {\n handleAriaLabel(this);\n }\n\n @Watch('editing')\n observesEditing(newValue: boolean, oldValue: boolean) {\n if (newValue === oldValue) return;\n this.scheduledAfterRender.push(this.hostElement.focus);\n }\n\n @Watch('errors')\n errorsObserver() {\n const { editing, hasErrors } = this;\n const focusedElement = this.hostElement.shadowRoot.activeElement;\n const isInputFocused = focusedElement?.tagName === 'Q2-INPUT';\n if (isInputFocused || !focusedElement || !editing || !hasErrors) return;\n this.inputElement.focus();\n }\n\n // #endregion\n // #region Local Methods\n\n get hasErrors(): boolean {\n return Array.isArray(this.errors) && !!this.errors.length;\n }\n\n get hasHints(): boolean {\n return Array.isArray(this.hints) && !!this.hints.length;\n }\n\n get locLabel() {\n return (this.label && loc(this.label)) || '';\n }\n\n get wrapperClass() {\n return `q2-editable-field-wrapper ${this.editing ? 'editing' : ''}`;\n }\n\n cancelClick = (event?: CustomEvent) => {\n event?.stopPropagation();\n mirrorEmit(this, ['change', 'tctChange'], { editing: false, name: 'cancel' });\n this.inputElement.setValue(this.defaultValue);\n };\n\n editClick = (event: CustomEvent) => {\n event?.stopPropagation();\n mirrorEmit(this, ['change', 'tctChange'], { editing: true, name: 'edit' });\n };\n\n generateEditStateDOM() {\n return (\n <div\n class={this.wrapperClass}\n hidden={!this.editing}\n >\n <q2-input\n ref={el => (this.inputElement = el)}\n label={this.locLabel}\n hideLabel={this.hideLabel}\n value={this.value}\n hints={this.hasHints ? this.hints : undefined}\n errors={this.hasErrors ? this.errors : undefined}\n type={this.type}\n disabled={this.disabled}\n formatModifier={this.formatModifier}\n maxlength={this.maxlength}\n test-id=\"editableInput\"\n onChange={e => e.stopImmediatePropagation()}\n onInput={e => e.stopImmediatePropagation()}\n onTctInput={this.inputInput}\n onTctChange={this.inputChange}\n onKeyDown={this.inputKeyDown}\n onClick={this.inputClick}\n />\n <q2-btn\n ref={el => (this.cancelBtnElement = el)}\n class=\"cancel-edit\"\n label={`${loc('tecton.element.editableField.cancel')} ${this.locLabel}`}\n hide-label\n test-id=\"cancelButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.cancelClick}\n >\n <q2-icon type=\"close\" />\n </q2-btn>\n <q2-btn\n ref={el => (this.saveBtnElement = el)}\n class=\"save-edit\"\n label={`${loc('tecton.element.editableField.save')} ${this.locLabel}`}\n hide-label\n test-id=\"saveButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.saveClick}\n >\n <q2-icon type=\"checkmark\" />\n </q2-btn>\n </div>\n );\n }\n\n generateReadStateDOM() {\n if (this.persistentLabel && this.locLabel) {\n return (\n <div\n class={this.wrapperClass}\n hidden={this.editing}\n >\n <dl>\n <dt class=\"read-state-label\">{this.locLabel}</dt>\n <dd>\n <span class=\"text-wrapper\">{this.formattedValue || this.value}</span>\n <q2-btn\n ref={el => (this.editBtnElement = el)}\n class=\"begin-edit\"\n label={`${loc('tecton.element.editableField.edit')} ${this.locLabel}`}\n hide-label\n disabled={this.disabled}\n test-id=\"editButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.editClick}\n >\n <q2-icon type=\"edit\" />\n </q2-btn>\n </dd>\n </dl>\n </div>\n );\n }\n return (\n <div\n class={this.wrapperClass}\n hidden={this.editing}\n >\n <div class=\"text-wrapper\">{this.formattedValue || this.value}</div>\n <q2-btn\n ref={el => (this.editBtnElement = el)}\n class=\"begin-edit\"\n label={`${loc('tecton.element.editableField.edit')} ${this.locLabel}`}\n hide-label\n disabled={this.disabled}\n test-id=\"editButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.editClick}\n >\n <q2-icon type=\"edit\" />\n </q2-btn>\n </div>\n );\n }\n\n inputChange = (e: CustomEvent) => {\n e.stopPropagation();\n };\n\n inputClick = (event: MouseEvent) => {\n event.stopPropagation();\n };\n\n inputInput = (event: Q2InputCustomEvent<IEventDetail> & InputEvent) => {\n event.stopPropagation();\n mirrorEmit(this, ['input', 'tctInput'], event.detail);\n this.formattedValue = event.detail.formattedValue;\n this.innerValue = event.detail.value;\n };\n\n inputKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' || e.key === 'Esc') {\n e.preventDefault();\n this.cancelClick();\n return;\n }\n\n if (e.key === 'Enter') {\n e.preventDefault();\n this.saveClick();\n return;\n }\n };\n\n saveClick = (event?: CustomEvent) => {\n event && event.stopPropagation();\n const valueFromInputProp = this.hostElement.shadowRoot.querySelector('q2-input').value;\n this.defaultValue = valueFromInputProp;\n mirrorEmit(this, ['change', 'tctChange'], {\n editing: false,\n name: 'save',\n value: this.innerValue || valueFromInputProp,\n formattedValue: this.formattedValue || valueFromInputProp,\n });\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n return (\n <div>\n {this.generateEditStateDOM()}\n {this.generateReadStateDOM()}\n </div>\n );\n }\n\n // #endregion\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"version":3,"file":"q2-editable-field.entry.cjs.js","sources":["src/components/q2-editable-field/q2-editable-field.scss?tag=q2-editable-field&encapsulation=shadow","src/components/q2-editable-field/q2-editable-field.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline-block;\n max-width: 100%;\n}\n\n.q2-editable-field-wrapper {\n .begin-edit,\n .save-edit,\n .cancel-edit {\n flex: 0 0 44px;\n --tct-btn-icon-hover-background: #{var-list(\n --tct-editable-field-btn-hover-background,\n --app-gray-l3,\n #f2f2f2\n )};\n --tct-icon-stroke-primary: #{var-list(--tct-editable-field-btn-icon-stroke-primary, --app-gray, #747474)};\n --tct-icon-stroke-secondary: #{var-list(--tct-editable-field-btn-icon-stroke-secondary, --app-gray, #747474)};\n }\n}\n\n.q2-editable-field-wrapper:not([hidden]) {\n display: flex;\n}\n\n.q2-editable-field-wrapper.editing {\n align-items: flex-end;\n}\n\n:host([block]) {\n display: block;\n width: 100%;\n .q2-editable-field-wrapper:not([hidden]) {\n display: grid;\n grid-template-columns: 1fr auto auto;\n }\n}\n\nq2-input,\n.text-wrapper {\n margin: 0 var(--tct-scale-2, var(--app-scale-2x, 10px)) 0 0;\n}\n\nq2-input {\n flex: 1 1 auto;\n min-width: 170px;\n}\n\n.text-wrapper {\n flex: 0 auto;\n align-self: center;\n display: inline-block;\n}\n\n:host([truncated]) .text-wrapper {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\ndl {\n margin: var(--tct-scale-0, var(--app-scale-0x, 0));\n}\n\ndt {\n font-weight: 600;\n}\n\ndd {\n margin-left: var(--tct-scale-0, var(--app-scale-0x, 0));\n display: flex;\n align-items: center;\n}\n","import { Component, State, Prop, h, Listen, Element, Event, EventEmitter, Method, Watch } from '@stencil/core';\nimport { IEventDetail, Q2InputCustomEvent } from 'src/components';\nimport { handleAriaLabel, isEventFromElement, loc, overrideFocus, waitForNextPaint } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\nimport { Q2Input } from '../q2-input/q2-input';\nimport { IFormatterValueObject } from '../q2-input/q2-input-types';\n\n/**\n * @name Editable Field\n * @category Forms\n * @summary Use for inline editing of data that is normally displayed as read-only.\n */\n@Component({ tag: 'q2-editable-field', shadow: true, styleUrl: 'q2-editable-field.scss' })\nexport class Q2EditableField {\n // #region Own Properties\n\n cancelBtnElement: HTMLQ2BtnElement;\n defaultValue: string;\n editBtnElement: HTMLQ2BtnElement;\n innerValue: string;\n inputElement: HTMLQ2InputElement;\n saveBtnElement: HTMLQ2BtnElement;\n scheduledAfterRender: (() => void)[] = [];\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n formattedValue: string;\n\n // #endregion\n // #region Public Property API\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n ariaLabel: string;\n\n /** If `true`, component expands to fill the width of its parent element. */\n @Prop({ reflect: true })\n block: boolean;\n\n /** Disables the edit button and field. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /** Controls the edit state of the element. */\n @Prop({ reflect: true, mutable: true })\n editing: boolean = false;\n\n /**\n * Determines the `errors` applied to the `q2-input` element.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop()\n errors: string[];\n\n /**\n * Determines the `formatModifier` applied to the `q2-input` element.\n * @info\n * Only applicable when `type=\"currency\"`.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop({ reflect: true })\n formatModifier: string;\n\n /** Hide's the field's `<label>` element from view. */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * Determines the `hints` applied to the `q2-input` element.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop()\n hints: string[];\n\n /**\n * The visible descriptor for the element.\n * Serves as the input label while in the edit state and as a decorative label for the read state when `persistentLabel` is `true`.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n label: string = '';\n\n /**\n * Determines the `maxLength` applied to the `q2-input`.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop({ reflect: true })\n maxlength: number;\n\n /** Displays the provided label in the read state. */\n @Prop({ reflect: true })\n persistentLabel: boolean;\n\n /** Shortens long values with ellipses instead of splitting into multiple lines. */\n @Prop({ reflect: true })\n truncated: boolean;\n\n /**\n * Determines the `type` applied to the `q2-input` element.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for all `type` values.\n */\n @Prop({ reflect: true })\n type: Q2Input['type'];\n\n /** Serves as the visible text while in the read state, and the default value of the input while in the edit state. */\n @Prop({ reflect: true, mutable: true })\n value: string = '';\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the 'Edit', 'Cancel', or 'Save' buttons are clicked.\n *\n * The event detail will not include a `value` or `formattedValue` if the event name is 'edit' or 'cancel'.\n *@info\n * If you are utilizing events to provide input validation, it is recommended you use the `input` event, not the `change` event.\n * @deprecated Use 'tctChange' instead\n */\n @Event()\n change: EventEmitter<{\n editing: boolean;\n name: 'edit' | 'cancel' | 'save';\n value?: string;\n formattedValue?: string;\n }>;\n\n /**\n * Emitted when the user updates the `q2-input` element in the editing state.\n * @deprecated Use 'tctInput' instead\n */\n @Event()\n input: EventEmitter<{ formattedValue: string; value: string }>;\n\n /**\n * Emitted when the 'Edit', 'Cancel', or 'Save' buttons are clicked.\n *\n * The event detail will not include a `value` or `formattedValue` if the event name is 'edit' or 'cancel'.\n *\n * @info\n * If you are utilizing events to provide input validation, it is recommended you use the `input` event, not the `change` event.\n */\n @Event()\n tctChange: EventEmitter<{\n editing: boolean;\n name: 'edit' | 'cancel' | 'save';\n value?: string;\n formattedValue?: string;\n }>;\n\n /**\n * Emitted when the user updates the `q2-input` element in the editing state.\n */\n @Event()\n tctInput: EventEmitter<{ formattedValue: string; value: string }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n handleAriaLabel(this);\n\n this.defaultValue = this.value;\n }\n\n componentDidLoad() {\n overrideFocus(this.hostElement);\n }\n\n componentDidRender() {\n this.scheduledAfterRender.forEach(fn => fn());\n this.scheduledAfterRender = [];\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('change')\n onHostElementChange(event: CustomEvent) {\n if (!isEventFromElement(event, this.hostElement) || this.hostElement.onchange) return;\n queueMicrotask(() => {\n switch (event.detail.name) {\n case 'save':\n if (this.hasErrors) {\n this.inputElement.focus();\n break;\n }\n this.value = event.detail.value;\n this.editing = event.detail.editing;\n break;\n\n case 'cancel':\n this.inputElement.value = this.value;\n this.editing = event.detail.editing;\n break;\n\n case 'edit':\n this.editing = event.detail.editing;\n break;\n }\n });\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.hostElement.shadowRoot.querySelector<HTMLElement>(this.editing ? 'q2-input' : 'q2-btn.begin-edit').focus();\n }\n\n @Listen('tctFormatted')\n inputFormatted(event: CustomEvent<IFormatterValueObject>) {\n this.formattedValue = event.detail.formattedValue;\n }\n\n // #endregion\n // #region Public Methods API\n\n /**\n * Emulates clicking the cancel button, which will hide the `<q2-input>` field.\n *\n * @testOnly\n */\n @Method()\n clickCancel() {\n if (!this.editing) return;\n this.cancelBtnElement?.click();\n }\n\n /**\n * Emulates clicking the edit button, which will display the `<q2-input>` field.\n *\n * @testOnly\n */\n @Method()\n clickEdit() {\n if (this.editing) return;\n this.editBtnElement?.click();\n }\n\n /**\n * Emulates clicking the save button, saving value in the `<q2-input>` field, and emitting a `change` event.\n *\n * @testOnly\n */\n @Method()\n clickSave() {\n if (!this.editing) return;\n this.saveBtnElement?.click();\n }\n\n /**\n * Emulates clicking the edit button, and setting the value of the `<q2-input>` field.\n *\n * If the `clickSave` argument is `true` (default), the save button will be clicked after the value is set, and a\\\n * `change` event will be emitted.\n *\n * @testOnly\n */\n @Method()\n async setValue(value: string, options: { clickSave?: boolean } = { clickSave: true }) {\n await this.clickEdit();\n await waitForNextPaint();\n\n await this.inputElement.setValue(value);\n\n if (options.clickSave) {\n await this.clickSave();\n await waitForNextPaint();\n }\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('ariaLabel')\n ariaLabelObserver() {\n handleAriaLabel(this);\n }\n\n @Watch('editing')\n observesEditing(newValue: boolean, oldValue: boolean) {\n if (newValue === oldValue) return;\n this.scheduledAfterRender.push(this.hostElement.focus);\n }\n\n @Watch('errors')\n errorsObserver() {\n const { editing, hasErrors } = this;\n const focusedElement = this.hostElement.shadowRoot.activeElement;\n const isInputFocused = focusedElement?.tagName === 'Q2-INPUT';\n if (isInputFocused || !focusedElement || !editing || !hasErrors) return;\n this.inputElement.focus();\n }\n\n // #endregion\n // #region Local Methods\n\n get hasErrors(): boolean {\n return Array.isArray(this.errors) && !!this.errors.length;\n }\n\n get hasHints(): boolean {\n return Array.isArray(this.hints) && !!this.hints.length;\n }\n\n get locLabel() {\n return (this.label && loc(this.label)) || '';\n }\n\n get wrapperClass() {\n return `q2-editable-field-wrapper ${this.editing ? 'editing' : ''}`;\n }\n\n cancelClick = (event?: CustomEvent) => {\n event?.stopPropagation();\n mirrorEmit(this, ['change', 'tctChange'], { editing: false, name: 'cancel' });\n this.inputElement.setValue(this.defaultValue);\n };\n\n editClick = (event: CustomEvent) => {\n event?.stopPropagation();\n mirrorEmit(this, ['change', 'tctChange'], { editing: true, name: 'edit' });\n };\n\n generateEditStateDOM() {\n return (\n <div\n class={this.wrapperClass}\n hidden={!this.editing}\n >\n <q2-input\n ref={el => (this.inputElement = el)}\n label={this.locLabel}\n hideLabel={this.hideLabel}\n value={this.value}\n hints={this.hasHints ? this.hints : undefined}\n errors={this.hasErrors ? this.errors : undefined}\n type={this.type}\n disabled={this.disabled}\n formatModifier={this.formatModifier}\n maxlength={this.maxlength}\n test-id=\"editableInput\"\n onInput={e => e.stopImmediatePropagation()}\n onTctInput={this.inputInput}\n onTctChange={this.inputChange}\n onKeyDown={this.inputKeyDown}\n onClick={this.inputClick}\n />\n <q2-btn\n ref={el => (this.cancelBtnElement = el)}\n class=\"cancel-edit\"\n label={`${loc('tecton.element.editableField.cancel')} ${this.locLabel}`}\n hide-label\n test-id=\"cancelButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.cancelClick}\n >\n <q2-icon type=\"close\" />\n </q2-btn>\n <q2-btn\n ref={el => (this.saveBtnElement = el)}\n class=\"save-edit\"\n label={`${loc('tecton.element.editableField.save')} ${this.locLabel}`}\n hide-label\n test-id=\"saveButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.saveClick}\n >\n <q2-icon type=\"checkmark\" />\n </q2-btn>\n </div>\n );\n }\n\n generateReadStateDOM() {\n if (this.persistentLabel && this.locLabel) {\n return (\n <div\n class={this.wrapperClass}\n hidden={this.editing}\n >\n <dl>\n <dt class=\"read-state-label\">{this.locLabel}</dt>\n <dd>\n <span class=\"text-wrapper\">{this.formattedValue || this.value}</span>\n <q2-btn\n ref={el => (this.editBtnElement = el)}\n class=\"begin-edit\"\n label={`${loc('tecton.element.editableField.edit')} ${this.locLabel}`}\n hide-label\n disabled={this.disabled}\n test-id=\"editButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.editClick}\n >\n <q2-icon type=\"edit\" />\n </q2-btn>\n </dd>\n </dl>\n </div>\n );\n }\n return (\n <div\n class={this.wrapperClass}\n hidden={this.editing}\n >\n <div class=\"text-wrapper\">{this.formattedValue || this.value}</div>\n <q2-btn\n ref={el => (this.editBtnElement = el)}\n class=\"begin-edit\"\n label={`${loc('tecton.element.editableField.edit')} ${this.locLabel}`}\n hide-label\n disabled={this.disabled}\n test-id=\"editButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.editClick}\n >\n <q2-icon type=\"edit\" />\n </q2-btn>\n </div>\n );\n }\n\n inputChange = (e: CustomEvent) => {\n e.stopPropagation();\n };\n\n inputClick = (event: MouseEvent) => {\n event.stopPropagation();\n };\n\n inputInput = (event: Q2InputCustomEvent<IEventDetail> & InputEvent) => {\n event.stopPropagation();\n mirrorEmit(this, ['input', 'tctInput'], event.detail);\n this.formattedValue = event.detail.formattedValue;\n this.innerValue = event.detail.value;\n };\n\n inputKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' || e.key === 'Esc') {\n e.preventDefault();\n this.cancelClick();\n return;\n }\n\n if (e.key === 'Enter') {\n e.preventDefault();\n this.saveClick();\n return;\n }\n };\n\n saveClick = (event?: CustomEvent) => {\n event && event.stopPropagation();\n const valueFromInputProp = this.hostElement.shadowRoot.querySelector('q2-input').value;\n this.defaultValue = valueFromInputProp;\n mirrorEmit(this, ['change', 'tctChange'], {\n editing: false,\n name: 'save',\n value: this.innerValue || valueFromInputProp,\n formattedValue: this.formattedValue || valueFromInputProp,\n });\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n return (\n <div>\n {this.generateEditStateDOM()}\n {this.generateReadStateDOM()}\n </div>\n );\n }\n\n // #endregion\n}\n"],"names":["mirrorEmit","handleAriaLabel","overrideFocus","isEventFromElement","waitForNextPaint","loc","h"],"mappings":";;;;;;AAAA,MAAM,kBAAkB,GAAG,g0DAAg0D;;MCa90D,eAAe,GAAA,MAAA;AAD5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;AAUI,QAAA,IAAoB,CAAA,oBAAA,GAAmB,EAAE;;AA+BzC,QAAA,IAAO,CAAA,OAAA,GAAY,KAAK;AAgCxB;;;;AAIG;AAEH,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;;AA4BlB,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AA+MlB,QAAA,IAAA,CAAA,WAAW,GAAG,CAAC,KAAmB,KAAI;AAClC,YAAA,KAAK,aAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,eAAe,EAAE;AACxB,YAAAA,qBAAU,CAAC,IAAI,EAAE,CAAC,QAAQ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AAE,CAAC,IAAI,CAAC,CAAC,wBAAwB,EAAE,EAC1C,UAAU,EAAE,IAAI,CAAC,SAAS,EAAA,EAE1BC,OAAA,CAAA,SAAA,EAAA,EAAS,IAAI,EAAC,MAAM,GAAG,CAClB,CACP;;;;IAgDd,MAAM,GAAA;QACF,QACIA,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACK,IAAI,CAAC,oBAAoB,EAAE,EAC3B,IAAI,CAAC,oBAAoB,EAAE,CAC1B;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"q2-editable-field.entry.cjs.js","sources":["src/components/q2-editable-field/q2-editable-field.scss?tag=q2-editable-field&encapsulation=shadow","src/components/q2-editable-field/q2-editable-field.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline-block;\n max-width: 100%;\n}\n\n.q2-editable-field-wrapper {\n .begin-edit,\n .save-edit,\n .cancel-edit {\n flex: 0 0 44px;\n --tct-btn-icon-hover-background: #{var-list(\n --tct-editable-field-btn-hover-background,\n --app-gray-l3,\n #f2f2f2\n )};\n --tct-icon-stroke-primary: #{var-list(--tct-editable-field-btn-icon-stroke-primary, --app-gray, #747474)};\n --tct-icon-stroke-secondary: #{var-list(--tct-editable-field-btn-icon-stroke-secondary, --app-gray, #747474)};\n }\n}\n\n.q2-editable-field-wrapper:not([hidden]) {\n display: flex;\n}\n\n.q2-editable-field-wrapper.editing {\n align-items: flex-end;\n}\n\n:host([block]) {\n display: block;\n width: 100%;\n .q2-editable-field-wrapper:not([hidden]) {\n display: grid;\n grid-template-columns: 1fr auto auto;\n }\n}\n\nq2-input,\n.text-wrapper {\n margin: 0 var(--tct-scale-2, var(--app-scale-2x, 10px)) 0 0;\n}\n\nq2-input {\n flex: 1 1 auto;\n min-width: 170px;\n}\n\n.text-wrapper {\n flex: 0 auto;\n align-self: center;\n display: inline-block;\n}\n\n:host([truncated]) .text-wrapper {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\ndl {\n margin: var(--tct-scale-0, var(--app-scale-0x, 0));\n}\n\ndt {\n font-weight: 600;\n}\n\ndd {\n margin-left: var(--tct-scale-0, var(--app-scale-0x, 0));\n display: flex;\n align-items: center;\n}\n","import { Component, State, Prop, h, Listen, Element, Event, EventEmitter, Method, Watch } from '@stencil/core';\nimport { IEventDetail, Q2InputCustomEvent } from 'src/components';\nimport { handleAriaLabel, isEventFromElement, loc, overrideFocus, waitForNextPaint } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\nimport { Q2Input } from '../q2-input/q2-input';\nimport { IFormatterValueObject } from '../q2-input/q2-input-types';\n\n/**\n * @name Editable Field\n * @category Forms\n * @summary Use for inline editing of data that is normally displayed as read-only.\n */\n@Component({ tag: 'q2-editable-field', shadow: true, styleUrl: 'q2-editable-field.scss' })\nexport class Q2EditableField {\n // #region Own Properties\n\n cancelBtnElement: HTMLQ2BtnElement;\n defaultValue: string;\n editBtnElement: HTMLQ2BtnElement;\n innerValue: string;\n inputElement: HTMLQ2InputElement;\n saveBtnElement: HTMLQ2BtnElement;\n scheduledAfterRender: (() => void)[] = [];\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n formattedValue: string;\n\n // #endregion\n // #region Public Property API\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n ariaLabel: string;\n\n /** If `true`, component expands to fill the width of its parent element. */\n @Prop({ reflect: true })\n block: boolean;\n\n /** Disables the edit button and field. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /** Controls the edit state of the element. */\n @Prop({ reflect: true, mutable: true })\n editing: boolean = false;\n\n /**\n * Determines the `errors` applied to the `q2-input` element.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop()\n errors: string[];\n\n /**\n * Determines the `formatModifier` applied to the `q2-input` element.\n * @info\n * Only applicable when `type=\"currency\"`.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop({ reflect: true })\n formatModifier: string;\n\n /** Hide's the field's `<label>` element from view. */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * Determines the `hints` applied to the `q2-input` element.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop()\n hints: string[];\n\n /**\n * The visible descriptor for the element.\n * Serves as the input label while in the edit state and as a decorative label for the read state when `persistentLabel` is `true`.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n label: string = '';\n\n /**\n * Determines the `maxLength` applied to the `q2-input`.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for more information.\n */\n @Prop({ reflect: true })\n maxlength: number;\n\n /** Displays the provided label in the read state. */\n @Prop({ reflect: true })\n persistentLabel: boolean;\n\n /** Shortens long values with ellipses instead of splitting into multiple lines. */\n @Prop({ reflect: true })\n truncated: boolean;\n\n /**\n * Determines the `type` applied to the `q2-input` element.\n *\n * See [q2-input](https://tecton.q2developer.com/design-system/q2-input/) for all `type` values.\n */\n @Prop({ reflect: true })\n type: Q2Input['type'];\n\n /** Serves as the visible text while in the read state, and the default value of the input while in the edit state. */\n @Prop({ reflect: true, mutable: true })\n value: string = '';\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the 'Edit', 'Cancel', or 'Save' buttons are clicked.\n *\n * The event detail will not include a `value` or `formattedValue` if the event name is 'edit' or 'cancel'.\n *@info\n * If you are utilizing events to provide input validation, it is recommended you use the `input` event, not the `change` event.\n * @deprecated Use 'tctChange' instead\n */\n @Event()\n change: EventEmitter<{\n editing: boolean;\n name: 'edit' | 'cancel' | 'save';\n value?: string;\n formattedValue?: string;\n }>;\n\n /**\n * Emitted when the user updates the `q2-input` element in the editing state.\n * @deprecated Use 'tctInput' instead\n */\n @Event()\n input: EventEmitter<{ formattedValue: string; value: string }>;\n\n /**\n * Emitted when the 'Edit', 'Cancel', or 'Save' buttons are clicked.\n *\n * The event detail will not include a `value` or `formattedValue` if the event name is 'edit' or 'cancel'.\n *\n * @info\n * If you are utilizing events to provide input validation, it is recommended you use the `input` event, not the `change` event.\n */\n @Event()\n tctChange: EventEmitter<{\n editing: boolean;\n name: 'edit' | 'cancel' | 'save';\n value?: string;\n formattedValue?: string;\n }>;\n\n /**\n * Emitted when the user updates the `q2-input` element in the editing state.\n */\n @Event()\n tctInput: EventEmitter<{ formattedValue: string; value: string }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n handleAriaLabel(this);\n\n this.defaultValue = this.value;\n }\n\n componentDidLoad() {\n overrideFocus(this.hostElement);\n }\n\n componentDidRender() {\n this.scheduledAfterRender.forEach(fn => fn());\n this.scheduledAfterRender = [];\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('change')\n onHostElementChange(event: CustomEvent) {\n if (!isEventFromElement(event, this.hostElement) || this.hostElement.onchange) return;\n queueMicrotask(() => {\n switch (event.detail.name) {\n case 'save':\n if (this.hasErrors) {\n this.inputElement.focus();\n break;\n }\n this.value = event.detail.value;\n this.editing = event.detail.editing;\n break;\n\n case 'cancel':\n this.inputElement.value = this.value;\n this.editing = event.detail.editing;\n break;\n\n case 'edit':\n this.editing = event.detail.editing;\n break;\n }\n });\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.hostElement.shadowRoot.querySelector<HTMLElement>(this.editing ? 'q2-input' : 'q2-btn.begin-edit').focus();\n }\n\n @Listen('tctFormatted')\n inputFormatted(event: CustomEvent<IFormatterValueObject>) {\n this.formattedValue = event.detail.formattedValue;\n }\n\n // #endregion\n // #region Public Methods API\n\n /**\n * Emulates clicking the cancel button, which will hide the `<q2-input>` field.\n *\n * @testOnly\n */\n @Method()\n clickCancel() {\n if (!this.editing) return;\n this.cancelBtnElement?.click();\n }\n\n /**\n * Emulates clicking the edit button, which will display the `<q2-input>` field.\n *\n * @testOnly\n */\n @Method()\n clickEdit() {\n if (this.editing) return;\n this.editBtnElement?.click();\n }\n\n /**\n * Emulates clicking the save button, saving value in the `<q2-input>` field, and emitting a `change` event.\n *\n * @testOnly\n */\n @Method()\n clickSave() {\n if (!this.editing) return;\n this.saveBtnElement?.click();\n }\n\n /**\n * Emulates clicking the edit button, and setting the value of the `<q2-input>` field.\n *\n * If the `clickSave` argument is `true` (default), the save button will be clicked after the value is set, and a\\\n * `change` event will be emitted.\n *\n * @testOnly\n */\n @Method()\n async setValue(value: string, options: { clickSave?: boolean } = { clickSave: true }) {\n await this.clickEdit();\n await waitForNextPaint();\n\n await this.inputElement.setValue(value);\n\n if (options.clickSave) {\n await this.clickSave();\n await waitForNextPaint();\n }\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('ariaLabel')\n ariaLabelObserver() {\n handleAriaLabel(this);\n }\n\n @Watch('editing')\n observesEditing(newValue: boolean, oldValue: boolean) {\n if (newValue === oldValue) return;\n this.scheduledAfterRender.push(this.hostElement.focus);\n }\n\n @Watch('errors')\n errorsObserver() {\n const { editing, hasErrors } = this;\n const focusedElement = this.hostElement.shadowRoot.activeElement;\n const isInputFocused = focusedElement?.tagName === 'Q2-INPUT';\n if (isInputFocused || !focusedElement || !editing || !hasErrors) return;\n this.inputElement.focus();\n }\n\n // #endregion\n // #region Local Methods\n\n get hasErrors(): boolean {\n return Array.isArray(this.errors) && !!this.errors.length;\n }\n\n get hasHints(): boolean {\n return Array.isArray(this.hints) && !!this.hints.length;\n }\n\n get locLabel() {\n return (this.label && loc(this.label)) || '';\n }\n\n get wrapperClass() {\n return `q2-editable-field-wrapper ${this.editing ? 'editing' : ''}`;\n }\n\n cancelClick = (event?: CustomEvent) => {\n event?.stopPropagation();\n mirrorEmit(this, ['change', 'tctChange'], { editing: false, name: 'cancel' });\n this.inputElement.setValue(this.defaultValue);\n };\n\n editClick = (event: CustomEvent) => {\n event?.stopPropagation();\n mirrorEmit(this, ['change', 'tctChange'], { editing: true, name: 'edit' });\n };\n\n generateEditStateDOM() {\n return (\n <div\n class={this.wrapperClass}\n hidden={!this.editing}\n >\n <q2-input\n ref={el => (this.inputElement = el)}\n label={this.locLabel}\n hideLabel={this.hideLabel}\n value={this.value}\n hints={this.hasHints ? this.hints : undefined}\n errors={this.hasErrors ? this.errors : undefined}\n type={this.type}\n disabled={this.disabled}\n formatModifier={this.formatModifier}\n maxlength={this.maxlength}\n test-id=\"editableInput\"\n onChange={e => e.stopImmediatePropagation()}\n onInput={e => e.stopImmediatePropagation()}\n onTctInput={this.inputInput}\n onTctChange={this.inputChange}\n onKeyDown={this.inputKeyDown}\n onClick={this.inputClick}\n />\n <q2-btn\n ref={el => (this.cancelBtnElement = el)}\n class=\"cancel-edit\"\n label={`${loc('tecton.element.editableField.cancel')} ${this.locLabel}`}\n hide-label\n test-id=\"cancelButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.cancelClick}\n >\n <q2-icon type=\"close\" />\n </q2-btn>\n <q2-btn\n ref={el => (this.saveBtnElement = el)}\n class=\"save-edit\"\n label={`${loc('tecton.element.editableField.save')} ${this.locLabel}`}\n hide-label\n test-id=\"saveButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.saveClick}\n >\n <q2-icon type=\"checkmark\" />\n </q2-btn>\n </div>\n );\n }\n\n generateReadStateDOM() {\n if (this.persistentLabel && this.locLabel) {\n return (\n <div\n class={this.wrapperClass}\n hidden={this.editing}\n >\n <dl>\n <dt class=\"read-state-label\">{this.locLabel}</dt>\n <dd>\n <span class=\"text-wrapper\">{this.formattedValue || this.value}</span>\n <q2-btn\n ref={el => (this.editBtnElement = el)}\n class=\"begin-edit\"\n label={`${loc('tecton.element.editableField.edit')} ${this.locLabel}`}\n hide-label\n disabled={this.disabled}\n test-id=\"editButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.editClick}\n >\n <q2-icon type=\"edit\" />\n </q2-btn>\n </dd>\n </dl>\n </div>\n );\n }\n return (\n <div\n class={this.wrapperClass}\n hidden={this.editing}\n >\n <div class=\"text-wrapper\">{this.formattedValue || this.value}</div>\n <q2-btn\n ref={el => (this.editBtnElement = el)}\n class=\"begin-edit\"\n label={`${loc('tecton.element.editableField.edit')} ${this.locLabel}`}\n hide-label\n disabled={this.disabled}\n test-id=\"editButton\"\n onClick={e => e.stopImmediatePropagation()}\n onTctClick={this.editClick}\n >\n <q2-icon type=\"edit\" />\n </q2-btn>\n </div>\n );\n }\n\n inputChange = (e: CustomEvent) => {\n e.stopPropagation();\n };\n\n inputClick = (event: MouseEvent) => {\n event.stopPropagation();\n };\n\n inputInput = (event: Q2InputCustomEvent<IEventDetail> & InputEvent) => {\n event.stopPropagation();\n mirrorEmit(this, ['input', 'tctInput'], event.detail);\n this.formattedValue = event.detail.formattedValue;\n this.innerValue = event.detail.value;\n };\n\n inputKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' || e.key === 'Esc') {\n e.preventDefault();\n this.cancelClick();\n return;\n }\n\n if (e.key === 'Enter') {\n e.preventDefault();\n this.saveClick();\n return;\n }\n };\n\n saveClick = (event?: CustomEvent) => {\n event && event.stopPropagation();\n const valueFromInputProp = this.hostElement.shadowRoot.querySelector('q2-input').value;\n this.defaultValue = valueFromInputProp;\n mirrorEmit(this, ['change', 'tctChange'], {\n editing: false,\n name: 'save',\n value: this.innerValue || valueFromInputProp,\n formattedValue: this.formattedValue || valueFromInputProp,\n });\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n return (\n <div>\n {this.generateEditStateDOM()}\n {this.generateReadStateDOM()}\n </div>\n );\n }\n\n // #endregion\n}\n"],"names":["mirrorEmit","handleAriaLabel","overrideFocus","isEventFromElement","waitForNextPaint","loc","h"],"mappings":";;;;;;AAAA,MAAM,kBAAkB,GAAG,g0DAAg0D;;MCa90D,eAAe,GAAA,MAAA;AAD5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;AAUI,QAAA,IAAoB,CAAA,oBAAA,GAAmB,EAAE;;AA+BzC,QAAA,IAA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C,cAAc,EAAE,EAAA,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,KAAK,CAAO,EACnEA,OACI,CAAA,QAAA,EAAA,EAAA,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,EACrC,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,CAAA,EAAGD,WAAG,CAAC,mCAAmC,CAAC,CAAI,CAAA,EAAA,IAAI,CAAC,QAAQ,CAAE,CAAA,EAErE,YAAA,EAAA,IAAA,EAAA,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAA,SAAA,EACf,YAAY,EACpB,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,wBAAwB,EAAE,EAC1C,UAAU,EAAE,IAAI,CAAC,SAAS,EAAA,EAE1BC,OAAA,CAAA,SAAA,EAAA,EAAS,IAAI,EAAC,MAAM,GAAG,CAClB,CACP;;;;IAgDd,MAAM,GAAA;QACF,QACIA,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACK,IAAI,CAAC,oBAAoB,EAAE,EAC3B,IAAI,CAAC,oBAAoB,EAAE,CAC1B;;;;;;;;;;;;;"}
@@ -158,8 +158,8 @@ const Q2TabContainer = class {
158
158
  this.mutationObserver = null;
159
159
  }
160
160
  componentWillLoad() {
161
- if (!component.hasValidChildren(this.hostElement, 'q2-tab-pane')) {
162
- component.filterChildren(this.hostElement, 'q2-tab-pane');
161
+ if (!component.hasValidChildren(this.hostElement, ['q2-tab-pane', 'tecton-tab-pane'])) {
162
+ component.filterChildren(this.hostElement, ['q2-tab-pane', 'tecton-tab-pane']);
163
163
  }
164
164
  const observer = new MutationObserver(() => this.updateTabs());
165
165
  observer.observe(this.hostElement, { childList: true, attributes: true });
@@ -270,7 +270,7 @@ const Q2TabContainer = class {
270
270
  return (index.h("div", { class: "tab-pane-badge", "aria-label": `${tab.label}, ${tab.badgeCount} ${description}` }, tab.label, index.h("q2-badge", { value: tab.badgeCount, theme: theme, status: tab.badgeStatus })));
271
271
  }
272
272
  render() {
273
- return (index.h(index.Fragment, { key: '55766935610a03910ff95ca8d3282b887b36abcd' }, index.h("div", { key: 'add7a9817e22c04eb3426ff6716ba83784a1e3b4', class: "tab-container" }, this.scrollEnabled && (index.h(index.Fragment, { key: '49c3f671268794a4c7f37b14b62e07b3ac436aa1' }, index.h("div", { key: '361822a9c78adc12798eecd3556d9dd2154c798e', class: "gradient-left", hidden: !this.showScrollLeft }), index.h("div", { key: 'a25e15c2d6ae4a732a61e08215b3b34b81750b7d', class: "gradient-right", hidden: !this.showScrollRight }), index.h("q2-btn", { key: '58e807848868226a666e9ce3f0218d0cb76ff569', class: "btn-left", hidden: !this.showScrollLeft, onTctClick: () => this.onScrollBtnClick('left') }, index.h("q2-icon", { key: 'd907438b963235ebe69275171a586486e13675f5', type: "chevron-left", label: "scroll left" })), index.h("q2-btn", { key: 'cac533264a7f0486694079d8ce209b7c73ee30d2', class: "btn-right", hidden: !this.showScrollRight, onTctClick: () => this.onScrollBtnClick('right') }, index.h("q2-icon", { key: '638b0241ff186d3fccd054a6a04090752152ae88', type: "chevron-right", label: "scroll right" })))), index.h("ul", { key: '09fc2659537414f3ced6fdaf2a22aed4095206fc', onScroll: this.checkScrollState, ref: el => (this.listElement = el), class: this.noPrint ? 'no-print' : null, role: "tablist" }, this.tabs.map((tab, index) => this.renderTab(tab, index)))), index.h("div", { key: 'fce5bca2e6d8b552dece318d212f65b5bafa33f0', class: "tab-content" }, index.h("slot", { key: '4771f24d669715a2859b39976c77081ab9dc8f35', onSlotchange: () => this.onSlotChange() }))));
273
+ return (index.h(index.Fragment, { key: '2181b2505b4d48d9812b61d5414264425ff7f4af' }, index.h("div", { key: '0901678c9f074277414bf0dfd1b73cb3ec93cd6f', class: "tab-container" }, this.scrollEnabled && (index.h(index.Fragment, { key: '3cc265f40d308947e07bb2ca7cf2496bf1f74d44' }, index.h("div", { key: '8b0606af29da80fb969e94b2708077bf2e4ef7e2', class: "gradient-left", hidden: !this.showScrollLeft }), index.h("div", { key: '2412d226cf903beae013965e345f0f56ca9991d6', class: "gradient-right", hidden: !this.showScrollRight }), index.h("q2-btn", { key: 'edf2bf63eebe24832e529178fa185ad27c3a45ba', class: "btn-left", hidden: !this.showScrollLeft, onTctClick: () => this.onScrollBtnClick('left') }, index.h("q2-icon", { key: '7900b5426d1ec51880fe8c36d33a59873b1be508', type: "chevron-left", label: "scroll left" })), index.h("q2-btn", { key: '001628dae8b16b4c5aff651c8515cce25d08bbf2', class: "btn-right", hidden: !this.showScrollRight, onTctClick: () => this.onScrollBtnClick('right') }, index.h("q2-icon", { key: 'f4579ca37dd0e2908e3f68dc60eb923d4a3f314e', type: "chevron-right", label: "scroll right" })))), index.h("ul", { key: '53efc8ffaaf29dc1dfd9b86ee4105a87350aebfb', onScroll: this.checkScrollState, ref: el => (this.listElement = el), class: this.noPrint ? 'no-print' : null, role: "tablist" }, this.tabs.map((tab, index) => this.renderTab(tab, index)))), index.h("div", { key: '1e3d76467f667d04a488aacd5a51b641a0acbabc', class: "tab-content" }, index.h("slot", { key: '4384593fb9579c4187c50eee288517aba22c9ace', onSlotchange: () => this.onSlotChange() }))));
274
274
  }
275
275
  get hostElement() { return index.getElement(this); }
276
276
  static get watchers() { return {