igniteui-webcomponents 7.3.1 → 7.3.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.
- package/CHANGELOG.md +23 -1
- package/components/avatar/themes/avatar.base.css.js +1 -1
- package/components/avatar/themes/avatar.base.css.js.map +1 -1
- package/components/badge/themes/badge.base.css.js +1 -1
- package/components/badge/themes/badge.base.css.js.map +1 -1
- package/components/banner/themes/banner.base.css.js +1 -1
- package/components/banner/themes/banner.base.css.js.map +1 -1
- package/components/banner/themes/shared/banner.indigo.css.js +1 -1
- package/components/banner/themes/shared/banner.indigo.css.js.map +1 -1
- package/components/calendar/base.d.ts +7 -2
- package/components/calendar/base.js +8 -3
- package/components/calendar/base.js.map +1 -1
- package/components/calendar/calendar.d.ts +4 -0
- package/components/calendar/calendar.js +41 -14
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/days-view/days-view.d.ts +3 -6
- package/components/calendar/days-view/days-view.js +7 -16
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/calendar/helpers.d.ts +13 -0
- package/components/calendar/helpers.js +15 -0
- package/components/calendar/helpers.js.map +1 -1
- package/components/calendar/themes/calendar.base.css.js +1 -1
- package/components/calendar/themes/calendar.base.css.js.map +1 -1
- package/components/calendar/themes/days-view.base.css.js +1 -1
- package/components/calendar/themes/days-view.base.css.js.map +1 -1
- package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js +1 -1
- package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/shared/bootstrap/days-view.bootstrap.css.js +1 -1
- package/components/calendar/themes/shared/bootstrap/days-view.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/shared/fluent/days-view.fluent.css.js +1 -1
- package/components/calendar/themes/shared/fluent/days-view.fluent.css.js.map +1 -1
- package/components/calendar/themes/shared/indigo/calendar.indigo.css.js +1 -1
- package/components/calendar/themes/shared/indigo/calendar.indigo.css.js.map +1 -1
- package/components/calendar/themes/shared/indigo/days-view.indigo.css.js +1 -1
- package/components/calendar/themes/shared/indigo/days-view.indigo.css.js.map +1 -1
- package/components/calendar/themes/shared/material/days-view.material.css.js +1 -1
- package/components/calendar/themes/shared/material/days-view.material.css.js.map +1 -1
- package/components/calendar/themes/year-month-view.base.css.js +1 -1
- package/components/calendar/themes/year-month-view.base.css.js.map +1 -1
- package/components/card/themes/container.base.css.js +1 -1
- package/components/card/themes/container.base.css.js.map +1 -1
- package/components/carousel/themes/carousel.base.css.js +1 -1
- package/components/carousel/themes/carousel.base.css.js.map +1 -1
- package/components/carousel/themes/shared/carousel.indigo.css.js +1 -1
- package/components/carousel/themes/shared/carousel.indigo.css.js.map +1 -1
- package/components/chat/themes/chat.base.css.js +1 -1
- package/components/chat/themes/chat.base.css.js.map +1 -1
- package/components/chat/themes/message.base.css.js +1 -1
- package/components/chat/themes/message.base.css.js.map +1 -1
- package/components/checkbox/themes/checkbox.base.css.js +1 -1
- package/components/checkbox/themes/checkbox.base.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js.map +1 -1
- package/components/checkbox/themes/shared/switch/switch.bootstrap.css.js +1 -1
- package/components/checkbox/themes/shared/switch/switch.bootstrap.css.js.map +1 -1
- package/components/checkbox/themes/shared/switch/switch.fluent.css.js +1 -1
- package/components/checkbox/themes/shared/switch/switch.fluent.css.js.map +1 -1
- package/components/checkbox/themes/shared/switch/switch.indigo.css.js +1 -1
- package/components/checkbox/themes/shared/switch/switch.indigo.css.js.map +1 -1
- package/components/checkbox/themes/shared/switch/switch.material.css.js +1 -1
- package/components/checkbox/themes/shared/switch/switch.material.css.js.map +1 -1
- package/components/checkbox/themes/switch.base.css.js +1 -1
- package/components/checkbox/themes/switch.base.css.js.map +1 -1
- package/components/color-picker/themes/color-picker.base.css.js +1 -1
- package/components/color-picker/themes/color-picker.base.css.js.map +1 -1
- package/components/combo/themes/combo-item.base.css.js +1 -1
- package/components/combo/themes/combo-item.base.css.js.map +1 -1
- package/components/combo/themes/combo.base.css.js +1 -1
- package/components/combo/themes/combo.base.css.js.map +1 -1
- package/components/combo/themes/shared/combo.bootstrap.css.js +1 -1
- package/components/combo/themes/shared/combo.bootstrap.css.js.map +1 -1
- package/components/date-picker/date-picker.base.d.ts +11 -2
- package/components/date-picker/date-picker.base.js +8 -3
- package/components/date-picker/date-picker.base.js.map +1 -1
- package/components/date-picker/themes/date-picker.base.css.js +1 -1
- package/components/date-picker/themes/date-picker.base.css.js.map +1 -1
- package/components/date-range-picker/date-range-picker.base.css.js +1 -1
- package/components/date-range-picker/date-range-picker.base.css.js.map +1 -1
- package/components/date-range-picker/predefined-ranges-area.base.css.js +1 -1
- package/components/date-range-picker/predefined-ranges-area.base.css.js.map +1 -1
- package/components/divider/themes/divider.base.css.js +1 -1
- package/components/divider/themes/divider.base.css.js.map +1 -1
- package/components/dropdown/themes/dropdown-item.base.css.js +1 -1
- package/components/dropdown/themes/dropdown-item.base.css.js.map +1 -1
- package/components/dropdown/themes/dropdown.base.css.js +1 -1
- package/components/dropdown/themes/dropdown.base.css.js.map +1 -1
- package/components/file-input/themes/file-input.base.css.js +1 -1
- package/components/file-input/themes/file-input.base.css.js.map +1 -1
- package/components/file-input/themes/shared/file-input.bootstrap.css.js +1 -1
- package/components/file-input/themes/shared/file-input.bootstrap.css.js.map +1 -1
- package/components/input/themes/shared/input.indigo.css.js +1 -1
- package/components/input/themes/shared/input.indigo.css.js.map +1 -1
- package/components/input/themes/shared/input.material.css.js +1 -1
- package/components/input/themes/shared/input.material.css.js.map +1 -1
- package/components/list/themes/item.base.css.js +1 -1
- package/components/list/themes/item.base.css.js.map +1 -1
- package/components/nav-drawer/themes/item.base.css.js +1 -1
- package/components/nav-drawer/themes/item.base.css.js.map +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.js +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.js.map +1 -1
- package/components/progress/themes/linear/shared/linear.progress.bootstrap.css.d.ts +1 -0
- package/components/progress/themes/linear/shared/linear.progress.bootstrap.css.js +3 -0
- package/components/progress/themes/linear/shared/linear.progress.bootstrap.css.js.map +1 -0
- package/components/progress/themes/linear/themes.js +3 -2
- package/components/progress/themes/linear/themes.js.map +1 -1
- package/components/qr-code/qr-code.d.ts +28 -1
- package/components/qr-code/qr-code.js +56 -13
- package/components/qr-code/qr-code.js.map +1 -1
- package/components/qr-code/renderer/export.d.ts +28 -0
- package/components/qr-code/renderer/export.js +120 -0
- package/components/qr-code/renderer/export.js.map +1 -0
- package/components/qr-code/types.d.ts +26 -0
- package/components/qr-code/types.js.map +1 -1
- package/components/radio/themes/radio.base.css.js +1 -1
- package/components/radio/themes/radio.base.css.js.map +1 -1
- package/components/radio/themes/shared/radio.bootstrap.css.js +1 -1
- package/components/radio/themes/shared/radio.bootstrap.css.js.map +1 -1
- package/components/radio/themes/shared/radio.indigo.css.js +1 -1
- package/components/radio/themes/shared/radio.indigo.css.js.map +1 -1
- package/components/resize-container/themes/resize-container.base.css.d.ts +1 -0
- package/components/resize-container/themes/resize-container.base.css.js +3 -0
- package/components/resize-container/themes/resize-container.base.css.js.map +1 -0
- package/components/select/themes/select.base.css.js +1 -1
- package/components/select/themes/select.base.css.js.map +1 -1
- package/components/select/themes/shared/select.bootstrap.css.js +1 -1
- package/components/select/themes/shared/select.bootstrap.css.js.map +1 -1
- package/components/slider/themes/shared/slider.material.css.js +1 -1
- package/components/slider/themes/shared/slider.material.css.js.map +1 -1
- package/components/slider/themes/slider.base.css.js +1 -1
- package/components/slider/themes/slider.base.css.js.map +1 -1
- package/components/snackbar/themes/snackbar.base.css.js +1 -1
- package/components/snackbar/themes/snackbar.base.css.js.map +1 -1
- package/components/splitter/themes/splitter.base.css.js +1 -1
- package/components/splitter/themes/splitter.base.css.js.map +1 -1
- package/components/stepper/themes/step/step.base.css.js +1 -1
- package/components/stepper/themes/step/step.base.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.bootstrap.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.bootstrap.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.fluent.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.fluent.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.indigo.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.indigo.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.material.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.material.css.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.fluent.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.fluent.css.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.indigo.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.indigo.css.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.material.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.material.css.js.map +1 -1
- package/components/tabs/themes/tab.base.css.js +1 -1
- package/components/tabs/themes/tab.base.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.bootstrap.css.js +1 -1
- package/components/textarea/themes/shared/textarea.bootstrap.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.common.css.js +1 -1
- package/components/textarea/themes/shared/textarea.common.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.fluent.css.js +1 -1
- package/components/textarea/themes/shared/textarea.fluent.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.indigo.css.js +1 -1
- package/components/textarea/themes/shared/textarea.indigo.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.material.css.js +1 -1
- package/components/textarea/themes/shared/textarea.material.css.js.map +1 -1
- package/components/tile-manager/themes/tile.base.css.js +1 -1
- package/components/tile-manager/themes/tile.base.css.js.map +1 -1
- package/components/toast/themes/toast.base.css.js +1 -1
- package/components/toast/themes/toast.base.css.js.map +1 -1
- package/components/tooltip/themes/tooltip.base.css.js +1 -1
- package/components/tooltip/themes/tooltip.base.css.js.map +1 -1
- package/components/tree/themes/item.base.css.js +1 -1
- package/components/tree/themes/item.base.css.js.map +1 -1
- package/components/validation-container/themes/validator.base.css.js +1 -1
- package/components/validation-container/themes/validator.base.css.js.map +1 -1
- package/components/validation-container/validation-container.d.ts +10 -12
- package/components/validation-container/validation-container.js +14 -17
- package/components/validation-container/validation-container.js.map +1 -1
- package/custom-elements.json +563 -93
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/internals/definitions/defineAllComponents.js +4 -0
- package/internals/definitions/defineAllComponents.js.map +1 -1
- package/package.json +1 -1
- package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +21 -0
- package/skills/igniteui-wc-integrate-with-framework/SKILL.md +4 -3
- package/skills/igniteui-wc-integrate-with-framework/references/vanilla-js.md +14 -0
- package/skills/igniteui-wc-migrate-grid-lite-to-premium/SKILL.md +12 -2
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.base.css.js","sourceRoot":"","sources":["../../../../src/components/list/themes/item.base.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"item.base.css.js","sourceRoot":"","sources":["../../../../src/components/list/themes/item.base.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,qpEAAqpE,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`:host{display:flex;align-items:center;position:relative;gap:1rem;transition:background .15s ease-out;padding-inline:max(var(--is-large, 1)*max(1rem, -1 * 1rem)*var(--ig-spacing-inline-large, var(--ig-spacing-inline, var(--ig-spacing))),var(--is-medium, 1)*max(0.5rem, -1 * 0.5rem)*var(--ig-spacing-inline-medium, var(--ig-spacing-inline, var(--ig-spacing))),var(--is-small, 1)*max(0.25rem, -1 * 0.25rem)*var(--ig-spacing-inline-small, var(--ig-spacing-inline, var(--ig-spacing))));padding-block:max(var(--is-large, 1)*max(0.5rem, -1 * 0.5rem)*var(--ig-spacing-block-large, var(--ig-spacing-block, var(--ig-spacing))),var(--is-medium, 1)*max(0.25rem, -1 * 0.25rem)*var(--ig-spacing-block-medium, var(--ig-spacing-block, var(--ig-spacing))),var(--is-small, 1)*max(0.125rem, -1 * 0.125rem)*var(--ig-spacing-block-small, var(--ig-spacing-block, var(--ig-spacing))))}:host ::slotted(igc-avatar){--ig-size: 1}::slotted(*){--control-padding: 0;margin:0;font:inherit;opacity:inherit}[part=content]{flex-grow:1}[part=header]{display:flex;flex-direction:column;gap:.125rem}[part=start],[part=end]{display:flex;align-items:center;justify-content:center;gap:.5rem}[part=start] ::slotted(*){display:flex}[part=title]{font-family:var(--ig-subtitle-1-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-1-font-size);font-weight:var(--ig-subtitle-1-font-weight);font-style:var(--ig-subtitle-1-font-style);line-height:var(--ig-subtitle-1-line-height);letter-spacing:var(--ig-subtitle-1-letter-spacing);text-transform:var(--ig-subtitle-1-text-transform);margin-top:var(--ig-subtitle-1-margin-top);margin-bottom:var(--ig-subtitle-1-margin-bottom)}[part=subtitle]{font-family:var(--ig-body-2-font-family, var(--ig-font-family));font-size:var(--ig-body-2-font-size);font-weight:var(--ig-body-2-font-weight);font-style:var(--ig-body-2-font-style);line-height:var(--ig-body-2-line-height);letter-spacing:var(--ig-body-2-letter-spacing);text-transform:var(--ig-body-2-text-transform);margin-top:var(--ig-body-2-margin-top);margin-bottom:var(--ig-body-2-margin-bottom)}@media(forced-colors: active){:host([selected]),:host([selected]:last-of-type){outline:.0625rem solid Highlight;outline-offset:-0.0625rem}}`;\n "]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}[part~=base]{display:flex;align-items:center;flex-flow:row nowrap;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;outline:rgba(0,0,0,0);white-space:nowrap;text-decoration:none;border:none;justify-content:flex-start;transition:background .15s ease-out}[part~=base] ::slotted(igc-icon){--ig-size: 3;display:flex;font:inherit}[part=content]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}[part="base mini"]{display:block}[part="base mini"] [part=content]{display:none}:host([disabled]){-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:initial;pointer-events:none}`;
|
|
2
|
+
export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}[part~=base]{display:flex;align-items:center;flex-flow:row nowrap;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;outline:rgba(0,0,0,0);white-space:nowrap;text-decoration:none;border:none;justify-content:flex-start;transition:background .15s ease-out}[part~=base] ::slotted(igc-icon){--ig-size: 3;display:flex;font:inherit}[part=content]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}[part="base mini"]{display:block}[part="base mini"] [part=content]{display:none}:host([disabled]){-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:initial;pointer-events:none}@media(forced-colors: active){[part~=base]:hover,[part~=base]:focus-within{outline:.0625rem solid CanvasText;outline-offset:-0.0625rem}:host([active]) [part~=base]{--item-active-icon-color: Highlight;--item-active-text-color: Highlight}}`;
|
|
3
3
|
//# sourceMappingURL=item.base.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.base.css.js","sourceRoot":"","sources":["../../../../src/components/nav-drawer/themes/item.base.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,
|
|
1
|
+
{"version":3,"file":"item.base.css.js","sourceRoot":"","sources":["../../../../src/components/nav-drawer/themes/item.base.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,yzDAAyzD,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}[part~=base]{display:flex;align-items:center;flex-flow:row nowrap;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;outline:rgba(0,0,0,0);white-space:nowrap;text-decoration:none;border:none;justify-content:flex-start;transition:background .15s ease-out}[part~=base] ::slotted(igc-icon){--ig-size: 3;display:flex;font:inherit}[part=content]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}[part=\"base mini\"]{display:block}[part=\"base mini\"] [part=content]{display:none}:host([disabled]){-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:initial;pointer-events:none}@media(forced-colors: active){[part~=base]:hover,[part~=base]:focus-within{outline:.0625rem solid CanvasText;outline-offset:-0.0625rem}:host([active]) [part~=base]{--item-active-icon-color: Highlight;--item-active-text-color: Highlight}}`;\n "]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}@keyframes igc-indeterminate-primary{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.7017, 0.4958);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.3024, 0.3813, 0.55, 0.9563);transform:translateX(83.671%)}100%{transform:translateX(200.611%)}}@keyframes igc-indeterminate-primary-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.3347, 0.124, 0.7858, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.6614)}100%{transform:scaleX(0.08)}}@keyframes igc-indeterminate-secondary{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515, 0.4096);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31, 0.284, 0.8, 0.7337);transform:translateX(37.6519%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627, 0.6, 0.902);transform:translateX(84.3861%)}100%{transform:translateX(160.2777%)}}@keyframes igc-indeterminate-secondary-scale{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515, 0.4096);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.31, 0.284, 0.8, 0.7337);transform:scaleX(0.4571)}44.15%{animation-timing-function:cubic-bezier(0.4, 0.627, 0.6, 0.902);transform:scaleX(0.727)}100%{transform:scaleX(0.08)}}@keyframes igc-indeterminate-bar-fluent{0%{transform:translateX(-100%);transform-origin:left}100%{transform:translateX(310%);transform-origin:right}}@keyframes igc-indeterminate-bar-fluent-rtl{0%{transform:translateX(100%);transform-origin:right}100%{transform:translateX(-310%);transform-origin:left}}@keyframes igc-indeterminate-accordion{0%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*2);stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*9/10)}100%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*2/5)}}@keyframes igc-indeterminate-accordion-rtl{0%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*-2);stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*9/10)}100%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*-2/5)}}@keyframes igc-indeterminate-circular-fluent{0%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(-1*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(-90deg)}50%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2),calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2);stroke-dashoffset:calc(-1*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(360deg)}100%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(-1*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(990deg)}}@keyframes igc-indeterminate-circular-fluent-rtl{0%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(90deg)}50%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2),calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2);stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(-360deg)}100%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(-990deg)}}@keyframes igc-rotate-center{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes igc-initial-counter{from{--_progress-integer: 0;--_progress-fraction: 0}}@keyframes igc-initial-width{from{width:0}to{width:calc(var(--_progress-whole, 0)*1%)}}@keyframes igc-initial-dashoffset{from{stroke-dashoffset:calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)}to{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416) - var(--_progress-percentage)*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416))}}:host{--linear-animation-duration: 2000ms;--linear-strips-orientation: -45deg;display:flex;flex-grow:1;width:100%}:host(:dir(rtl)),:host([dir=rtl]){--linear-strips-orientation: 45deg}[part~=base]{display:flex;align-items:center;flex-direction:column;justify-content:center;font-family:var(--ig-font-family),serif;position:relative;width:100%;flex:1 1 100%}:host(:dir(rtl)[indeterminate]) [part~=track],:host([dir=rtl][indeterminate]) [part~=track]{transform:rotateY(180deg)}[part~=label]{display:flex;align-items:center;color:inherit;font-weight:600}[part~=track]{position:relative;width:inherit;overflow:hidden;z-index:0}[part~=fill]{width:calc(var(--_progress-whole, 0)*1%);transition:width var(--_transition-duration) linear;position:relative;height:100%}[part~=fill]:not([part~=indeterminate]){overflow:hidden;animation:igc-initial-width var(--_transition-duration) linear}[part~=indeterminate],[part~="indeterminate secondary"]{width:100% !important;height:inherit;position:absolute;background:rgba(0,0,0,0)}[part~=indeterminate]::after,[part~="indeterminate secondary"]::after{content:"";position:absolute;top:0;inset-inline-start:0;width:inherit;height:inherit;backface-visibility:hidden}[part~=indeterminate]:not([part~=secondary]){transform:scale3d(0, 1, 1);animation:igc-indeterminate-primary var(--linear-animation-duration) infinite linear;left:-145.1666%}[part~=indeterminate]:not([part~=secondary])::after{animation:igc-indeterminate-primary-scale var(--linear-animation-duration) infinite linear}[part~=secondary]{animation:igc-indeterminate-secondary var(--linear-animation-duration) infinite linear;left:-54.8888%}[part~=secondary]::after{animation:igc-indeterminate-secondary-scale var(--linear-animation-duration) infinite linear;width:100%;height:inherit}[part~=value]{font-family:var(--ig-subtitle-2-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-2-font-size);font-weight:var(--ig-subtitle-2-font-weight);font-style:var(--ig-subtitle-2-font-style);line-height:var(--ig-subtitle-2-line-height);letter-spacing:var(--ig-subtitle-2-letter-spacing);text-transform:var(--ig-subtitle-2-text-transform);margin-top:var(--ig-subtitle-2-margin-top);margin-bottom:var(--ig-subtitle-2-margin-bottom)}[part~=counter]{animation:igc-initial-counter var(--_transition-duration) ease-in-out;counter-reset:progress-integer round(down,var(--_progress-integer, 0),1) progress-fraction round(down,var(--_progress-fraction, 0),1);transition:--_progress-integer var(--_transition-duration) ease-in-out,--_progress-fraction var(--_transition-duration) ease-in-out;display:block}[part~=counter]::before{font-family:var(--ig-subtitle-2-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-2-font-size);font-weight:var(--ig-subtitle-2-font-weight);font-style:var(--ig-subtitle-2-font-style);line-height:var(--ig-subtitle-2-line-height);letter-spacing:var(--ig-subtitle-2-letter-spacing);text-transform:var(--ig-subtitle-2-text-transform);margin-top:var(--ig-subtitle-2-margin-top);margin-bottom:var(--ig-subtitle-2-margin-bottom)}[part~=counter]:not([part~=fraction])::before{content:counter(progress-integer) "%"}[part~=counter][part~=fraction]::before{content:counter(progress-integer) "." counter(progress-fraction, decimal-leading-zero) "%"}:host([label-align=top]) [part~=label],:host([label-align=top-start]) [part~=label],:host([label-align=top-end]) [part~=label]{order:-1}:host([label-align=top-start]) [part~=label],:host([label-align=bottom-start]) [part~=label],:host([label-align=start]) [part~=label]{align-self:flex-start}:host([label-align=bottom-end]) [part~=label],:host([label-align=top-end]) [part~=label],:host([label-align=end]) [part~=label]{align-self:flex-end}:host([label-align=top]) [part~=label],:host([label-align=bottom]) [part~=label]{align-self:center}[part~=hidden]{display:none}`;
|
|
2
|
+
export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}@keyframes igc-indeterminate-primary{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.7017, 0.4958);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.3024, 0.3813, 0.55, 0.9563);transform:translateX(83.671%)}100%{transform:translateX(200.611%)}}@keyframes igc-indeterminate-primary-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.3347, 0.124, 0.7858, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.6614)}100%{transform:scaleX(0.08)}}@keyframes igc-indeterminate-secondary{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515, 0.4096);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31, 0.284, 0.8, 0.7337);transform:translateX(37.6519%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627, 0.6, 0.902);transform:translateX(84.3861%)}100%{transform:translateX(160.2777%)}}@keyframes igc-indeterminate-secondary-scale{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515, 0.4096);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.31, 0.284, 0.8, 0.7337);transform:scaleX(0.4571)}44.15%{animation-timing-function:cubic-bezier(0.4, 0.627, 0.6, 0.902);transform:scaleX(0.727)}100%{transform:scaleX(0.08)}}@keyframes igc-indeterminate-bar-fluent{0%{transform:translateX(-100%);transform-origin:left}100%{transform:translateX(310%);transform-origin:right}}@keyframes igc-indeterminate-bar-fluent-rtl{0%{transform:translateX(100%);transform-origin:right}100%{transform:translateX(-310%);transform-origin:left}}@keyframes igc-indeterminate-accordion{0%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*2);stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*9/10)}100%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*2/5)}}@keyframes igc-indeterminate-accordion-rtl{0%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*-2);stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*9/10)}100%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*-2/5)}}@keyframes igc-indeterminate-circular-fluent{0%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(-1*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(-90deg)}50%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2),calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2);stroke-dashoffset:calc(-1*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(360deg)}100%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(-1*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(990deg)}}@keyframes igc-indeterminate-circular-fluent-rtl{0%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(90deg)}50%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2),calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2);stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(-360deg)}100%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(-990deg)}}@keyframes igc-rotate-center{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes igc-initial-counter{from{--_progress-integer: 0;--_progress-fraction: 0}}@keyframes igc-initial-width{from{width:0}to{width:calc(var(--_progress-whole, 0)*1%)}}@keyframes igc-initial-dashoffset{from{stroke-dashoffset:calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)}to{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416) - var(--_progress-percentage)*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416))}}:host{--linear-animation-duration: 2000ms;--linear-strips-orientation: -45deg;display:flex;flex-grow:1;width:100%}:host(:dir(rtl)),:host([dir=rtl]){--linear-strips-orientation: 45deg}[part~=base]{display:flex;align-items:center;flex-direction:column;justify-content:center;font-family:var(--ig-font-family),serif;position:relative;width:100%;flex:1 1 100%}:host(:dir(rtl)[indeterminate]) [part~=track],:host([dir=rtl][indeterminate]) [part~=track]{transform:rotateY(180deg)}[part~=label]{display:flex;align-items:center;color:inherit;font-weight:600}[part~=track]{position:relative;width:inherit;overflow:hidden;z-index:0}[part~=fill]{width:calc(var(--_progress-whole, 0)*1%);transition:width var(--_transition-duration) linear;position:relative;height:100%}[part~=fill]:not([part~=indeterminate]){overflow:hidden;animation:igc-initial-width var(--_transition-duration) linear}[part~=indeterminate],[part~="indeterminate secondary"]{width:100% !important;height:inherit;position:absolute;background:rgba(0,0,0,0)}[part~=indeterminate]::after,[part~="indeterminate secondary"]::after{content:"";position:absolute;top:0;inset-inline-start:0;width:inherit;height:inherit;backface-visibility:hidden}[part~=indeterminate]:not([part~=secondary]){transform:scale3d(0, 1, 1);animation:igc-indeterminate-primary var(--linear-animation-duration) infinite linear;left:-145.1666%}[part~=indeterminate]:not([part~=secondary])::after{animation:igc-indeterminate-primary-scale var(--linear-animation-duration) infinite linear}[part~=secondary]{animation:igc-indeterminate-secondary var(--linear-animation-duration) infinite linear;left:-54.8888%}[part~=secondary]::after{animation:igc-indeterminate-secondary-scale var(--linear-animation-duration) infinite linear;width:100%;height:inherit}[part~=value]{font-family:var(--ig-subtitle-2-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-2-font-size);font-weight:var(--ig-subtitle-2-font-weight);font-style:var(--ig-subtitle-2-font-style);line-height:var(--ig-subtitle-2-line-height);letter-spacing:var(--ig-subtitle-2-letter-spacing);text-transform:var(--ig-subtitle-2-text-transform);margin-top:var(--ig-subtitle-2-margin-top);margin-bottom:var(--ig-subtitle-2-margin-bottom)}[part~=counter]{animation:igc-initial-counter var(--_transition-duration) ease-in-out;counter-reset:progress-integer round(down,var(--_progress-integer, 0),1) progress-fraction round(down,var(--_progress-fraction, 0),1);transition:--_progress-integer var(--_transition-duration) ease-in-out,--_progress-fraction var(--_transition-duration) ease-in-out;display:block}[part~=counter]::before{font-family:var(--ig-subtitle-2-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-2-font-size);font-weight:var(--ig-subtitle-2-font-weight);font-style:var(--ig-subtitle-2-font-style);line-height:var(--ig-subtitle-2-line-height);letter-spacing:var(--ig-subtitle-2-letter-spacing);text-transform:var(--ig-subtitle-2-text-transform);margin-top:var(--ig-subtitle-2-margin-top);margin-bottom:var(--ig-subtitle-2-margin-bottom)}[part~=counter]:not([part~=fraction])::before{content:counter(progress-integer) "%"}[part~=counter][part~=fraction]::before{content:counter(progress-integer) "." counter(progress-fraction, decimal-leading-zero) "%"}:host([label-align=top]) [part~=label],:host([label-align=top-start]) [part~=label],:host([label-align=top-end]) [part~=label]{order:-1}:host([label-align=top-start]) [part~=label],:host([label-align=bottom-start]) [part~=label],:host([label-align=start]) [part~=label]{align-self:flex-start}:host([label-align=bottom-end]) [part~=label],:host([label-align=top-end]) [part~=label],:host([label-align=end]) [part~=label]{align-self:flex-end}:host([label-align=top]) [part~=label],:host([label-align=bottom]) [part~=label]{align-self:center}[part~=hidden]{display:none}@media(forced-colors: active){:host [part~=track]{outline:.0625rem solid CanvasText}:host [part~=fill]{border:.125rem solid CanvasText}}`;
|
|
3
3
|
//# sourceMappingURL=linear.progress.base.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linear.progress.base.css.js","sourceRoot":"","sources":["../../../../../src/components/progress/themes/linear/linear.progress.base.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,opTAAopT,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}@keyframes igc-indeterminate-primary{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.7017, 0.4958);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.3024, 0.3813, 0.55, 0.9563);transform:translateX(83.671%)}100%{transform:translateX(200.611%)}}@keyframes igc-indeterminate-primary-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.3347, 0.124, 0.7858, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.6614)}100%{transform:scaleX(0.08)}}@keyframes igc-indeterminate-secondary{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515, 0.4096);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31, 0.284, 0.8, 0.7337);transform:translateX(37.6519%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627, 0.6, 0.902);transform:translateX(84.3861%)}100%{transform:translateX(160.2777%)}}@keyframes igc-indeterminate-secondary-scale{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515, 0.4096);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.31, 0.284, 0.8, 0.7337);transform:scaleX(0.4571)}44.15%{animation-timing-function:cubic-bezier(0.4, 0.627, 0.6, 0.902);transform:scaleX(0.727)}100%{transform:scaleX(0.08)}}@keyframes igc-indeterminate-bar-fluent{0%{transform:translateX(-100%);transform-origin:left}100%{transform:translateX(310%);transform-origin:right}}@keyframes igc-indeterminate-bar-fluent-rtl{0%{transform:translateX(100%);transform-origin:right}100%{transform:translateX(-310%);transform-origin:left}}@keyframes igc-indeterminate-accordion{0%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*2);stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*9/10)}100%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*2/5)}}@keyframes igc-indeterminate-accordion-rtl{0%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*-2);stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*9/10)}100%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*-2/5)}}@keyframes igc-indeterminate-circular-fluent{0%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(-1*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(-90deg)}50%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2),calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2);stroke-dashoffset:calc(-1*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(360deg)}100%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(-1*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(990deg)}}@keyframes igc-indeterminate-circular-fluent-rtl{0%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(90deg)}50%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2),calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2);stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(-360deg)}100%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(-990deg)}}@keyframes igc-rotate-center{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes igc-initial-counter{from{--_progress-integer: 0;--_progress-fraction: 0}}@keyframes igc-initial-width{from{width:0}to{width:calc(var(--_progress-whole, 0)*1%)}}@keyframes igc-initial-dashoffset{from{stroke-dashoffset:calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)}to{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416) - var(--_progress-percentage)*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416))}}:host{--linear-animation-duration: 2000ms;--linear-strips-orientation: -45deg;display:flex;flex-grow:1;width:100%}:host(:dir(rtl)),:host([dir=rtl]){--linear-strips-orientation: 45deg}[part~=base]{display:flex;align-items:center;flex-direction:column;justify-content:center;font-family:var(--ig-font-family),serif;position:relative;width:100%;flex:1 1 100%}:host(:dir(rtl)[indeterminate]) [part~=track],:host([dir=rtl][indeterminate]) [part~=track]{transform:rotateY(180deg)}[part~=label]{display:flex;align-items:center;color:inherit;font-weight:600}[part~=track]{position:relative;width:inherit;overflow:hidden;z-index:0}[part~=fill]{width:calc(var(--_progress-whole, 0)*1%);transition:width var(--_transition-duration) linear;position:relative;height:100%}[part~=fill]:not([part~=indeterminate]){overflow:hidden;animation:igc-initial-width var(--_transition-duration) linear}[part~=indeterminate],[part~=\"indeterminate secondary\"]{width:100% !important;height:inherit;position:absolute;background:rgba(0,0,0,0)}[part~=indeterminate]::after,[part~=\"indeterminate secondary\"]::after{content:\"\";position:absolute;top:0;inset-inline-start:0;width:inherit;height:inherit;backface-visibility:hidden}[part~=indeterminate]:not([part~=secondary]){transform:scale3d(0, 1, 1);animation:igc-indeterminate-primary var(--linear-animation-duration) infinite linear;left:-145.1666%}[part~=indeterminate]:not([part~=secondary])::after{animation:igc-indeterminate-primary-scale var(--linear-animation-duration) infinite linear}[part~=secondary]{animation:igc-indeterminate-secondary var(--linear-animation-duration) infinite linear;left:-54.8888%}[part~=secondary]::after{animation:igc-indeterminate-secondary-scale var(--linear-animation-duration) infinite linear;width:100%;height:inherit}[part~=value]{font-family:var(--ig-subtitle-2-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-2-font-size);font-weight:var(--ig-subtitle-2-font-weight);font-style:var(--ig-subtitle-2-font-style);line-height:var(--ig-subtitle-2-line-height);letter-spacing:var(--ig-subtitle-2-letter-spacing);text-transform:var(--ig-subtitle-2-text-transform);margin-top:var(--ig-subtitle-2-margin-top);margin-bottom:var(--ig-subtitle-2-margin-bottom)}[part~=counter]{animation:igc-initial-counter var(--_transition-duration) ease-in-out;counter-reset:progress-integer round(down,var(--_progress-integer, 0),1) progress-fraction round(down,var(--_progress-fraction, 0),1);transition:--_progress-integer var(--_transition-duration) ease-in-out,--_progress-fraction var(--_transition-duration) ease-in-out;display:block}[part~=counter]::before{font-family:var(--ig-subtitle-2-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-2-font-size);font-weight:var(--ig-subtitle-2-font-weight);font-style:var(--ig-subtitle-2-font-style);line-height:var(--ig-subtitle-2-line-height);letter-spacing:var(--ig-subtitle-2-letter-spacing);text-transform:var(--ig-subtitle-2-text-transform);margin-top:var(--ig-subtitle-2-margin-top);margin-bottom:var(--ig-subtitle-2-margin-bottom)}[part~=counter]:not([part~=fraction])::before{content:counter(progress-integer) \"%\"}[part~=counter][part~=fraction]::before{content:counter(progress-integer) \".\" counter(progress-fraction, decimal-leading-zero) \"%\"}:host([label-align=top]) [part~=label],:host([label-align=top-start]) [part~=label],:host([label-align=top-end]) [part~=label]{order:-1}:host([label-align=top-start]) [part~=label],:host([label-align=bottom-start]) [part~=label],:host([label-align=start]) [part~=label]{align-self:flex-start}:host([label-align=bottom-end]) [part~=label],:host([label-align=top-end]) [part~=label],:host([label-align=end]) [part~=label]{align-self:flex-end}:host([label-align=top]) [part~=label],:host([label-align=bottom]) [part~=label]{align-self:center}[part~=hidden]{display:none}`;\n "]}
|
|
1
|
+
{"version":3,"file":"linear.progress.base.css.js","sourceRoot":"","sources":["../../../../../src/components/progress/themes/linear/linear.progress.base.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,4xTAA4xT,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size, var(--sb-size));scrollbar-color:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color)) var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size, var(--sb-size));height:var(--ig-scrollbar-size, var(--sb-size));background:var(--ig-scrollbar-track-background, var(--sb-track-bg-color))}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))}:host *,:host *::before,:host *::after{box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}@keyframes igc-indeterminate-primary{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.7017, 0.4958);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.3024, 0.3813, 0.55, 0.9563);transform:translateX(83.671%)}100%{transform:translateX(200.611%)}}@keyframes igc-indeterminate-primary-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.3347, 0.124, 0.7858, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.6614)}100%{transform:scaleX(0.08)}}@keyframes igc-indeterminate-secondary{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515, 0.4096);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31, 0.284, 0.8, 0.7337);transform:translateX(37.6519%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627, 0.6, 0.902);transform:translateX(84.3861%)}100%{transform:translateX(160.2777%)}}@keyframes igc-indeterminate-secondary-scale{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515, 0.4096);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.31, 0.284, 0.8, 0.7337);transform:scaleX(0.4571)}44.15%{animation-timing-function:cubic-bezier(0.4, 0.627, 0.6, 0.902);transform:scaleX(0.727)}100%{transform:scaleX(0.08)}}@keyframes igc-indeterminate-bar-fluent{0%{transform:translateX(-100%);transform-origin:left}100%{transform:translateX(310%);transform-origin:right}}@keyframes igc-indeterminate-bar-fluent-rtl{0%{transform:translateX(100%);transform-origin:right}100%{transform:translateX(-310%);transform-origin:left}}@keyframes igc-indeterminate-accordion{0%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*2);stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*9/10)}100%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*2/5)}}@keyframes igc-indeterminate-accordion-rtl{0%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*-2);stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*9/10)}100%{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*-2/5)}}@keyframes igc-indeterminate-circular-fluent{0%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(-1*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(-90deg)}50%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2),calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2);stroke-dashoffset:calc(-1*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(360deg)}100%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(-1*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(990deg)}}@keyframes igc-indeterminate-circular-fluent-rtl{0%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(90deg)}50%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2),calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/2);stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(-360deg)}100%{stroke-dasharray:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)*.0001),calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416);stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)/4);transform:rotate(-990deg)}}@keyframes igc-rotate-center{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes igc-initial-counter{from{--_progress-integer: 0;--_progress-fraction: 0}}@keyframes igc-initial-width{from{width:0}to{width:calc(var(--_progress-whole, 0)*1%)}}@keyframes igc-initial-dashoffset{from{stroke-dashoffset:calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416)}to{stroke-dashoffset:calc(calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416) - var(--_progress-percentage)*calc(calc(var(--circular-size) / 2 - var(--stroke-thickness) * 0.5) * 2 * 3.1416))}}:host{--linear-animation-duration: 2000ms;--linear-strips-orientation: -45deg;display:flex;flex-grow:1;width:100%}:host(:dir(rtl)),:host([dir=rtl]){--linear-strips-orientation: 45deg}[part~=base]{display:flex;align-items:center;flex-direction:column;justify-content:center;font-family:var(--ig-font-family),serif;position:relative;width:100%;flex:1 1 100%}:host(:dir(rtl)[indeterminate]) [part~=track],:host([dir=rtl][indeterminate]) [part~=track]{transform:rotateY(180deg)}[part~=label]{display:flex;align-items:center;color:inherit;font-weight:600}[part~=track]{position:relative;width:inherit;overflow:hidden;z-index:0}[part~=fill]{width:calc(var(--_progress-whole, 0)*1%);transition:width var(--_transition-duration) linear;position:relative;height:100%}[part~=fill]:not([part~=indeterminate]){overflow:hidden;animation:igc-initial-width var(--_transition-duration) linear}[part~=indeterminate],[part~=\"indeterminate secondary\"]{width:100% !important;height:inherit;position:absolute;background:rgba(0,0,0,0)}[part~=indeterminate]::after,[part~=\"indeterminate secondary\"]::after{content:\"\";position:absolute;top:0;inset-inline-start:0;width:inherit;height:inherit;backface-visibility:hidden}[part~=indeterminate]:not([part~=secondary]){transform:scale3d(0, 1, 1);animation:igc-indeterminate-primary var(--linear-animation-duration) infinite linear;left:-145.1666%}[part~=indeterminate]:not([part~=secondary])::after{animation:igc-indeterminate-primary-scale var(--linear-animation-duration) infinite linear}[part~=secondary]{animation:igc-indeterminate-secondary var(--linear-animation-duration) infinite linear;left:-54.8888%}[part~=secondary]::after{animation:igc-indeterminate-secondary-scale var(--linear-animation-duration) infinite linear;width:100%;height:inherit}[part~=value]{font-family:var(--ig-subtitle-2-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-2-font-size);font-weight:var(--ig-subtitle-2-font-weight);font-style:var(--ig-subtitle-2-font-style);line-height:var(--ig-subtitle-2-line-height);letter-spacing:var(--ig-subtitle-2-letter-spacing);text-transform:var(--ig-subtitle-2-text-transform);margin-top:var(--ig-subtitle-2-margin-top);margin-bottom:var(--ig-subtitle-2-margin-bottom)}[part~=counter]{animation:igc-initial-counter var(--_transition-duration) ease-in-out;counter-reset:progress-integer round(down,var(--_progress-integer, 0),1) progress-fraction round(down,var(--_progress-fraction, 0),1);transition:--_progress-integer var(--_transition-duration) ease-in-out,--_progress-fraction var(--_transition-duration) ease-in-out;display:block}[part~=counter]::before{font-family:var(--ig-subtitle-2-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-2-font-size);font-weight:var(--ig-subtitle-2-font-weight);font-style:var(--ig-subtitle-2-font-style);line-height:var(--ig-subtitle-2-line-height);letter-spacing:var(--ig-subtitle-2-letter-spacing);text-transform:var(--ig-subtitle-2-text-transform);margin-top:var(--ig-subtitle-2-margin-top);margin-bottom:var(--ig-subtitle-2-margin-bottom)}[part~=counter]:not([part~=fraction])::before{content:counter(progress-integer) \"%\"}[part~=counter][part~=fraction]::before{content:counter(progress-integer) \".\" counter(progress-fraction, decimal-leading-zero) \"%\"}:host([label-align=top]) [part~=label],:host([label-align=top-start]) [part~=label],:host([label-align=top-end]) [part~=label]{order:-1}:host([label-align=top-start]) [part~=label],:host([label-align=bottom-start]) [part~=label],:host([label-align=start]) [part~=label]{align-self:flex-start}:host([label-align=bottom-end]) [part~=label],:host([label-align=top-end]) [part~=label],:host([label-align=end]) [part~=label]{align-self:flex-end}:host([label-align=top]) [part~=label],:host([label-align=bottom]) [part~=label]{align-self:center}[part~=hidden]{display:none}@media(forced-colors: active){:host [part~=track]{outline:.0625rem solid CanvasText}:host [part~=fill]{border:.125rem solid CanvasText}}`;\n "]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear.progress.bootstrap.css.js","sourceRoot":"","sources":["../../../../../../src/components/progress/themes/linear/shared/linear.progress.bootstrap.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,uEAAuE,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`@media(forced-colors: active){:host [part~=fill]{border-width:.5rem}}`;\n "]}
|
|
@@ -9,6 +9,7 @@ import { styles as fluentLight } from './light/linear.progress.fluent.css.js';
|
|
|
9
9
|
import { styles as indigoLight } from './light/linear.progress.indigo.css.js';
|
|
10
10
|
import { styles as materialLight } from './light/linear.progress.material.css.js';
|
|
11
11
|
import { styles as sharedLight } from './light/linear.progress.shared.css.js';
|
|
12
|
+
import { styles as bootstrap } from './shared/linear.progress.bootstrap.css.js';
|
|
12
13
|
import { styles as fluent } from './shared/linear.progress.fluent.css.js';
|
|
13
14
|
import { styles as indigo } from './shared/linear.progress.indigo.css.js';
|
|
14
15
|
const light = {
|
|
@@ -16,7 +17,7 @@ const light = {
|
|
|
16
17
|
${sharedLight}
|
|
17
18
|
`,
|
|
18
19
|
bootstrap: css `
|
|
19
|
-
${bootstrapLight}
|
|
20
|
+
${bootstrap} ${bootstrapLight}
|
|
20
21
|
`,
|
|
21
22
|
material: css `
|
|
22
23
|
${materialLight}
|
|
@@ -33,7 +34,7 @@ const dark = {
|
|
|
33
34
|
${sharedDark}
|
|
34
35
|
`,
|
|
35
36
|
bootstrap: css `
|
|
36
|
-
${bootstrapDark}
|
|
37
|
+
${bootstrap} ${bootstrapDark}
|
|
37
38
|
`,
|
|
38
39
|
material: css `
|
|
39
40
|
${materialDark}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../../../../../src/components/progress/themes/linear/themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAI1B,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../../../../../src/components/progress/themes/linear/themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAI1B,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,MAAM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AAM,GAAG,GAAW,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { css } from 'lit';\n\nimport type { Themes } from '#theming/types.js';\n// Dark Overrides\nimport { styles as bootstrapDark } from './dark/linear.progress.bootstrap.css.js';\nimport { styles as fluentDark } from './dark/linear.progress.fluent.css.js';\nimport { styles as indigoDark } from './dark/linear.progress.indigo.css.js';\nimport { styles as materialDark } from './dark/linear.progress.material.css.js';\nimport { styles as sharedDark } from './dark/linear.progress.shared.css.js';\n// Light Overrides\nimport { styles as bootstrapLight } from './light/linear.progress.bootstrap.css.js';\nimport { styles as fluentLight } from './light/linear.progress.fluent.css.js';\nimport { styles as indigoLight } from './light/linear.progress.indigo.css.js';\nimport { styles as materialLight } from './light/linear.progress.material.css.js';\nimport { styles as sharedLight } from './light/linear.progress.shared.css.js';\nimport { styles as bootstrap } from './shared/linear.progress.bootstrap.css.js';\n// Shared Styles\nimport { styles as fluent } from './shared/linear.progress.fluent.css.js';\nimport { styles as indigo } from './shared/linear.progress.indigo.css.js';\n\nconst light = {\n shared: css`\n ${sharedLight}\n `,\n bootstrap: css`\n ${bootstrap} ${bootstrapLight}\n `,\n material: css`\n ${materialLight}\n `,\n fluent: css`\n ${fluent} ${fluentLight}\n `,\n indigo: css`\n ${indigo} ${indigoLight}\n `,\n};\n\nconst dark = {\n shared: css`\n ${sharedDark}\n `,\n bootstrap: css`\n ${bootstrap} ${bootstrapDark}\n `,\n material: css`\n ${materialDark}\n `,\n fluent: css`\n ${fluent} ${fluentDark}\n `,\n indigo: css`\n ${indigo} ${indigoDark}\n `,\n};\n\nexport const all: Themes = { light, dark };\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement, nothing, type PropertyValues } from 'lit';
|
|
2
|
-
import type { QrCornerSquareStyle, QrDotStyle, QrErrorCorrectionLevel } from './types.js';
|
|
2
|
+
import type { QrCodeExportOptions, QrCornerSquareStyle, QrDotStyle, QrErrorCorrectionLevel } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
5
|
* Generates a QR code based on the provided value and options.
|
|
@@ -24,6 +24,7 @@ export default class IgcQrCodeComponent extends LitElement {
|
|
|
24
24
|
private readonly _abortHandle;
|
|
25
25
|
private readonly _maskId;
|
|
26
26
|
private readonly _maskUrl;
|
|
27
|
+
private _logoReady;
|
|
27
28
|
private _matrixCache?;
|
|
28
29
|
private _logoAspectRatio;
|
|
29
30
|
private _logoLoadFailed;
|
|
@@ -125,6 +126,32 @@ export default class IgcQrCodeComponent extends LitElement {
|
|
|
125
126
|
private _pickErrorLevel;
|
|
126
127
|
private _getErrorLevelAndArea;
|
|
127
128
|
private _getMatrix;
|
|
129
|
+
/**
|
|
130
|
+
* Returns a self-contained copy of the rendered SVG with theme colors resolved
|
|
131
|
+
* and the logo inlined. Waits for a pending logo load and render first.
|
|
132
|
+
*/
|
|
133
|
+
private _createSnapshot;
|
|
134
|
+
/**
|
|
135
|
+
* Serializes the QR code to an `image/svg+xml` blob.
|
|
136
|
+
*
|
|
137
|
+
* Theme colors are resolved to plain `fill` attributes and a logo that is not a data URI
|
|
138
|
+
* is fetched and inlined, so the blob renders identically outside the component.
|
|
139
|
+
* A logo that cannot be fetched (for example a cross-origin URL without CORS headers) is omitted.
|
|
140
|
+
*
|
|
141
|
+
* Rejects when the component has no `value`.
|
|
142
|
+
*/
|
|
143
|
+
toBlob(): Promise<Blob>;
|
|
144
|
+
/**
|
|
145
|
+
* Exports the QR code as an image file.
|
|
146
|
+
*
|
|
147
|
+
* The `scale` option multiplies the `size` of the component: a 256px QR code exported
|
|
148
|
+
* with `scale: 2` produces a 512x512 image. When `download` is `true` the browser
|
|
149
|
+
* download dialog opens for the file.
|
|
150
|
+
*
|
|
151
|
+
* Rejects when the component has no `value`, when `format` is not supported, when `scale`
|
|
152
|
+
* is not a positive finite number, or when the resulting image exceeds the maximum canvas size.
|
|
153
|
+
*/
|
|
154
|
+
toImage(options?: QrCodeExportOptions): Promise<File>;
|
|
128
155
|
protected render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
129
156
|
}
|
|
130
157
|
declare global {
|
|
@@ -9,13 +9,14 @@ import { property, state } from 'lit/decorators.js';
|
|
|
9
9
|
import { createAbortHandle } from '#internals/abort-handler.js';
|
|
10
10
|
import { registerComponent } from '#internals/definitions/register.js';
|
|
11
11
|
import { bindIf } from '#internals/utils/lit.js';
|
|
12
|
-
import { clamp } from '#internals/utils/math.js';
|
|
12
|
+
import { clamp, numberInRangeInclusive } from '#internals/utils/math.js';
|
|
13
13
|
import { createIdGenerator } from '#internals/utils/strings.js';
|
|
14
14
|
import { addThemingController } from '#theming/theming-controller.js';
|
|
15
15
|
import { generateQRCodeMatrix } from './model/matrix.js';
|
|
16
16
|
import { DEFAULT_SIZE_RATIO, MAX_SAFE_AREA, SAFE_AREAS, } from './renderer/constants.js';
|
|
17
17
|
import { renderQrFinders } from './renderer/corner.js';
|
|
18
18
|
import { renderQrDots } from './renderer/dots.js';
|
|
19
|
+
import { createSvgSnapshot, downloadFile, ensureExtension, isExportFormat, MAX_EXPORT_DIMENSION, MIME_TYPES, rasterizeSvg, serializeSvg, } from './renderer/export.js';
|
|
19
20
|
import { renderQrMaskAndImage } from './renderer/image.js';
|
|
20
21
|
import { styles } from './themes/qr-code.base.css.js';
|
|
21
22
|
import { styles as shared } from './themes/shared/qr-code.common.css.js';
|
|
@@ -32,6 +33,7 @@ export default class IgcQrCodeComponent extends LitElement {
|
|
|
32
33
|
this._abortHandle = createAbortHandle();
|
|
33
34
|
this._maskId = nextMaskId();
|
|
34
35
|
this._maskUrl = `url(#${this._maskId})`;
|
|
36
|
+
this._logoReady = Promise.resolve();
|
|
35
37
|
this._logoAspectRatio = 1;
|
|
36
38
|
this._logoLoadFailed = false;
|
|
37
39
|
this.errorLevel = 'M';
|
|
@@ -52,32 +54,34 @@ export default class IgcQrCodeComponent extends LitElement {
|
|
|
52
54
|
this._abortHandle.abort();
|
|
53
55
|
this._logoLoadFailed = false;
|
|
54
56
|
this._logoAspectRatio = 1;
|
|
57
|
+
this._logoReady = Promise.resolve();
|
|
55
58
|
if (!this._hasValidLogoSrc()) {
|
|
56
59
|
return;
|
|
57
60
|
}
|
|
58
61
|
const signal = this._abortHandle.signal;
|
|
59
62
|
const img = new Image();
|
|
60
63
|
img.src = this.logoSrc;
|
|
61
|
-
|
|
64
|
+
const settle = () => {
|
|
62
65
|
if (img.naturalWidth && img.naturalHeight) {
|
|
63
66
|
this._logoAspectRatio = img.naturalWidth / img.naturalHeight;
|
|
64
67
|
}
|
|
65
68
|
else {
|
|
66
69
|
this._logoLoadFailed = true;
|
|
67
70
|
}
|
|
71
|
+
};
|
|
72
|
+
if (img.complete) {
|
|
73
|
+
settle();
|
|
68
74
|
return;
|
|
69
75
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
this._logoLoadFailed = true;
|
|
80
|
-
}, { once: true, signal });
|
|
76
|
+
this._logoReady = new Promise((resolve) => {
|
|
77
|
+
const done = () => {
|
|
78
|
+
settle();
|
|
79
|
+
resolve();
|
|
80
|
+
};
|
|
81
|
+
img.addEventListener('load', done, { once: true, signal });
|
|
82
|
+
img.addEventListener('error', done, { once: true, signal });
|
|
83
|
+
signal.addEventListener('abort', () => resolve(), { once: true });
|
|
84
|
+
});
|
|
81
85
|
}
|
|
82
86
|
_hasValidLogoSrc() {
|
|
83
87
|
if (!this.logoSrc)
|
|
@@ -131,6 +135,45 @@ export default class IgcQrCodeComponent extends LitElement {
|
|
|
131
135
|
this._matrixCache = { value, errorLevel, version: this.version, result };
|
|
132
136
|
return result;
|
|
133
137
|
}
|
|
138
|
+
async _createSnapshot() {
|
|
139
|
+
await this.updateComplete;
|
|
140
|
+
await this._logoReady;
|
|
141
|
+
await this.updateComplete;
|
|
142
|
+
const svg = this.renderRoot.querySelector('svg');
|
|
143
|
+
if (!svg) {
|
|
144
|
+
throw new Error('Cannot export an igc-qr-code without a value.');
|
|
145
|
+
}
|
|
146
|
+
return createSvgSnapshot(svg);
|
|
147
|
+
}
|
|
148
|
+
async toBlob() {
|
|
149
|
+
return serializeSvg(await this._createSnapshot());
|
|
150
|
+
}
|
|
151
|
+
async toImage(options) {
|
|
152
|
+
const { fileName, format = 'png', scale = 1, download } = options ?? {};
|
|
153
|
+
if (!isExportFormat(format)) {
|
|
154
|
+
throw new TypeError(`Unsupported export format: ${format}.`);
|
|
155
|
+
}
|
|
156
|
+
if (!Number.isFinite(scale) || scale <= 0) {
|
|
157
|
+
throw new RangeError('The export scale must be a positive finite number.');
|
|
158
|
+
}
|
|
159
|
+
const dimension = Math.round(this.size * scale);
|
|
160
|
+
if (!numberInRangeInclusive(dimension, 1, MAX_EXPORT_DIMENSION)) {
|
|
161
|
+
throw new RangeError(`The exported image side must be between 1 and ${MAX_EXPORT_DIMENSION} pixels.`);
|
|
162
|
+
}
|
|
163
|
+
const svg = await this._createSnapshot();
|
|
164
|
+
svg.setAttribute('width', `${dimension}`);
|
|
165
|
+
svg.setAttribute('height', `${dimension}`);
|
|
166
|
+
const svgBlob = serializeSvg(svg);
|
|
167
|
+
const blob = format === 'svg'
|
|
168
|
+
? svgBlob
|
|
169
|
+
: await rasterizeSvg(svgBlob, dimension, format);
|
|
170
|
+
const name = ensureExtension(fileName?.trim() || 'qr-code', format);
|
|
171
|
+
const file = new File([blob], name, { type: MIME_TYPES[format] });
|
|
172
|
+
if (download) {
|
|
173
|
+
downloadFile(file);
|
|
174
|
+
}
|
|
175
|
+
return file;
|
|
176
|
+
}
|
|
134
177
|
render() {
|
|
135
178
|
if (!this.value)
|
|
136
179
|
return nothing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qr-code.js","sourceRoot":"","sources":["../../../src/components/qr-code/qr-code.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAuB,M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AC,SAAS,IAAI,YAAY,IAAI,CAAC,KAAK,EAAE;;wCAEnB,OAAO,WAAW,OAAO;UACvD,IAAI;kBACI,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC,QAAQ,CAAC;YAC5C,YAAY,CAAC;YACb,MAAM;YACN,UAAU;YACV,QAAQ;YACR,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;YACA,eAAe,CAAC;YAChB,IAAI;YACJ,UAAU;YACV,QAAQ;YACR,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;;UAEF,KAAK;;KAEV,CAAC;IACJ,CAAC;;AA3RO;IADP,KAAK,EAAE;4DACqB;AAGrB;IADP,KAAK,EAAE;2DACwB;AAczB;IADN,QAAQ,EAAE;iDACW;AAWf;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACH;AAUjB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;sDACU;AAS1C;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACT;AAWX;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACT;AASX;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;mDACZ;AAgBjB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;oDAC7B;AASf;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;sDAC1B;AAUpB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;oDACE;AAShC;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;uDACW","sourcesContent":["import { html, LitElement, nothing, type PropertyValues } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { createAbortHandle } from '#internals/abort-handler.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport { bindIf } from '#internals/utils/lit.js';\nimport { clamp } from '#internals/utils/math.js';\nimport { createIdGenerator } from '#internals/utils/strings.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport type { QRCodeMatrixResult } from './model/matrix.js';\nimport { generateQRCodeMatrix } from './model/matrix.js';\nimport {\n DEFAULT_SIZE_RATIO,\n MAX_SAFE_AREA,\n SAFE_AREAS,\n} from './renderer/constants.js';\nimport { renderQrFinders } from './renderer/corner.js';\nimport { renderQrDots } from './renderer/dots.js';\nimport { renderQrMaskAndImage } from './renderer/image.js';\nimport { styles } from './themes/qr-code.base.css.js';\nimport { styles as shared } from './themes/shared/qr-code.common.css.js';\nimport { all } from './themes/themes.js';\nimport type {\n QrCornerSquareStyle,\n QrDotStyle,\n QrErrorCorrectionLevel,\n} from './types.js';\n\nconst nextMaskId = createIdGenerator('igc-qr-code-mask');\n\n/**\n *\n * Generates a QR code based on the provided value and options.\n * The component renders an SVG representation of the QR code, which can be customized using various properties.\n *\n * @element igc-qr-code\n *\n * @cssproperty --ig-qr-code-background - The background color of the QR code. Default is `white`.\n * @cssproperty --ig-qr-code-dark-color - The color of the data modules (dots), and the corner square/dot colors unless overridden below. Default is `black`.\n * @cssproperty --ig-qr-code-corner-square-color - The color of the outer finder-pattern corner squares. Defaults to `--ig-qr-code-dark-color`.\n * @cssproperty --ig-qr-code-corner-dot-color - The color of the inner finder-pattern corner dots. Defaults to `--ig-qr-code-dark-color`.\n *\n * @csspart background - The background rect of the QR code.\n * @csspart dots - The data modules (dots) of the QR code.\n * @csspart corner-square - The outer corner (finder-pattern) squares of the QR code.\n * @csspart corner-dot - The inner corner (finder-pattern) dots of the QR code.\n */\nexport default class IgcQrCodeComponent extends LitElement {\n public static readonly tagName = 'igc-qr-code';\n\n public static override styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcQrCodeComponent);\n }\n\n private readonly _abortHandle = createAbortHandle();\n private readonly _maskId = nextMaskId();\n private readonly _maskUrl = `url(#${this._maskId})`;\n private _matrixCache?: {\n value: string;\n errorLevel: QrErrorCorrectionLevel;\n version?: number;\n result: QRCodeMatrixResult;\n };\n\n @state()\n private _logoAspectRatio = 1;\n\n @state()\n private _logoLoadFailed = false;\n\n constructor() {\n super();\n addThemingController(this, all);\n }\n\n /**\n * The value to be encoded in the QR code. This can be any string, such as a URL, text, or other data.\n * When this property is set, the component will generate a QR code representing the provided value.\n *\n * @attr value\n */\n @property()\n public value?: string;\n\n /**\n * The version of the QR code to generate, which determines the size and data capacity of the QR code.\n * Valid values are integers from 1 to 40, where each version corresponds to a specific module size and data capacity.\n *\n * If not specified, the component will automatically select the smallest version that can accommodate the provided value.\n *\n * @attr version\n */\n @property({ type: Number })\n public version?: number;\n\n /**\n * The error correction level for the QR code, which determines the QR code's ability to be read if it is partially obscured or damaged.\n * Valid values are 'L', 'M', 'Q', and 'H', where 'L' provides the lowest level of error correction and 'H' provides the highest level.\n *\n * @attr error-level\n * @default 'M'\n */\n @property({ attribute: 'error-level' })\n public errorLevel?: QrErrorCorrectionLevel = 'M';\n\n /**\n * The size of the QR code in pixels. This determines the width and height of the generated QR code. The default value is 128 pixels.\n *\n * @attr size\n * @default 128\n */\n @property({ type: Number })\n public size = 128;\n\n /**\n * The margin (quiet zone) around the QR code, expressed as a number of QR code modules rather\n * than pixels. This is the blank border area surrounding the code, which helps ensure that it\n * can be properly scanned.\n *\n * @attr margin\n * @default 4\n */\n @property({ type: Number })\n public margin = 4;\n\n /**\n * The source URL of an optional logo image to be displayed at the center of the QR code. The logo can help with branding and recognition.\n * If provided, the component will attempt to render the logo within the QR code while maintaining scannability.\n *\n * @attr logo-src\n */\n @property({ attribute: 'logo-src' })\n public logoSrc?: string;\n\n /**\n * The size of the logo, as a ratio of the maximum area that can safely be obscured by a logo\n * while the QR code remains scannable (up to 9% of the code's area, at the highest error\n * correction level). The value should be a number between 0 and 1, where 0 means no logo and 1\n * means the logo will cover the full safe area (not the entire QR code).\n * The default value is 0.4, meaning the logo covers 40% of that safe area (~3.6% of the QR code).\n *\n * When `error-level` is not explicitly set, the smallest error correction level that can\n * accommodate the requested logo size is chosen automatically.\n *\n * @attr logo-size\n * @default 0.4\n */\n @property({ type: Number, attribute: 'logo-size' })\n public logoSize = 0.4;\n\n /**\n * The margin around the logo in pixels. This is the whitespace area surrounding the logo within the QR code,\n * which helps ensure that the logo does not interfere with the QR code's scannability.\n *\n * @attr logo-margin\n */\n @property({ type: Number, attribute: 'logo-margin' })\n public logoMargin?: number;\n\n /**\n * The style of the data modules (dots) in the QR code, and of the inner dot of each finder-pattern\n * corner. This can be 'square', 'circle', or 'rounded'.\n *\n * @attr dot-style\n * @default 'square'\n */\n @property({ attribute: 'dot-style' })\n public dotStyle: QrDotStyle = 'square';\n\n /**\n * The style of the corner squares in the QR code. This can be 'square', 'circle', or 'rounded'.\n *\n * @attr square-style\n * @default 'square'\n */\n @property({ attribute: 'square-style' })\n public squareStyle: QrCornerSquareStyle = 'square';\n\n /** @internal */\n protected override update(props: PropertyValues<this>): void {\n if (props.has('logoSrc')) {\n this._resolveAspectRatio();\n }\n\n super.update(props);\n }\n\n private _resolveAspectRatio(): void {\n this._abortHandle.abort();\n this._logoLoadFailed = false;\n this._logoAspectRatio = 1;\n\n if (!this._hasValidLogoSrc()) {\n return;\n }\n\n const signal = this._abortHandle.signal;\n const img = new Image();\n img.src = this.logoSrc!;\n\n if (img.complete) {\n if (img.naturalWidth && img.naturalHeight) {\n this._logoAspectRatio = img.naturalWidth / img.naturalHeight;\n } else {\n this._logoLoadFailed = true;\n }\n return;\n }\n\n img.addEventListener(\n 'load',\n () => {\n if (img.naturalWidth && img.naturalHeight) {\n this._logoAspectRatio = img.naturalWidth / img.naturalHeight;\n } else {\n this._logoLoadFailed = true;\n }\n },\n { once: true, signal }\n );\n\n img.addEventListener(\n 'error',\n () => {\n this._logoLoadFailed = true;\n },\n { once: true, signal }\n );\n }\n\n /**\n * Determines whether a valid logo source is provided.\n *\n * The method checks if the `logoSrc` property is set and if it does not start with potentially unsafe schemes like 'javascript:' or 'vbscript:'.\n * It also ensures that if the source is a data URI, it must be an image type.\n * This validation helps prevent security risks associated with rendering untrusted content in the QR code.\n */\n private _hasValidLogoSrc(): boolean {\n if (!this.logoSrc) return false;\n const s = this.logoSrc.trim().toLowerCase();\n if (s.startsWith('javascript:') || s.startsWith('vbscript:')) return false;\n if (s.startsWith('data:') && !s.startsWith('data:image/')) return false;\n return true;\n }\n\n private _pickErrorLevel(area: number): QrErrorCorrectionLevel {\n if (area <= SAFE_AREAS.L) return 'L';\n if (area <= SAFE_AREAS.M) return 'M';\n if (area <= SAFE_AREAS.Q) return 'Q';\n return 'H';\n }\n\n private _getErrorLevelAndArea(hasLogo: boolean) {\n const userErrorLevel = this.errorLevel;\n const size = this.logoSize;\n const sizeRatio = hasLogo ? clamp(size ?? DEFAULT_SIZE_RATIO, 0, 1) : 0;\n const targetArea = sizeRatio * MAX_SAFE_AREA;\n\n let errorLevel: QrErrorCorrectionLevel;\n let area: number;\n\n if (userErrorLevel) {\n errorLevel = userErrorLevel;\n area = Math.min(targetArea, SAFE_AREAS[userErrorLevel]);\n } else if (targetArea > 0) {\n errorLevel = this._pickErrorLevel(targetArea);\n area = targetArea;\n } else {\n errorLevel = 'M';\n area = 0;\n }\n\n return { errorLevel, area };\n }\n\n private _getMatrix(\n value: string,\n errorLevel: QrErrorCorrectionLevel\n ): QRCodeMatrixResult {\n const cached = this._matrixCache;\n if (\n cached &&\n cached.value === value &&\n cached.errorLevel === errorLevel &&\n cached.version === this.version\n ) {\n return cached.result;\n }\n\n const result = generateQRCodeMatrix(value, errorLevel, this.version);\n this._matrixCache = { value, errorLevel, version: this.version, result };\n return result;\n }\n\n protected override render() {\n if (!this.value) return nothing;\n\n const hasLogo = this._hasValidLogoSrc() && !this._logoLoadFailed;\n const { errorLevel, area } = this._getErrorLevelAndArea(hasLogo);\n\n const { matrix, size } = this._getMatrix(this.value, errorLevel);\n\n const totalModules = size + this.margin * 2;\n const moduleSize = size / totalModules;\n const marginPx = this.margin * moduleSize;\n const svgSize = moduleSize * (size + this.margin * 2);\n\n const { mask, image, shouldApplyMask } = renderQrMaskAndImage({\n hasLogo,\n src: this.logoSrc!,\n aspectRatio: this._logoAspectRatio,\n area,\n size: this.size,\n margin: this.logoMargin,\n svgSize,\n maskId: this._maskId,\n });\n\n return html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"img\"\n width=${this.size}\n height=${this.size}\n viewBox=\"0 0 ${svgSize} ${svgSize}\"\n >\n <title>${this.ariaLabel ?? `QR code: ${this.value}`}</title>\n\n <rect part=\"background\" width=${svgSize} height=${svgSize} />\n ${mask}\n <g mask=${bindIf(shouldApplyMask, this._maskUrl)}>\n ${renderQrDots({\n matrix,\n moduleSize,\n marginPx,\n dotStyle: this.dotStyle,\n })}\n ${renderQrFinders({\n size,\n moduleSize,\n marginPx,\n dotStyle: this.dotStyle,\n squareStyle: this.squareStyle,\n })}\n </g>\n ${image}\n </svg>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-qr-code': IgcQrCodeComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"qr-code.js","sourceRoot":"","sources":["../../../src/components/qr-code/qr-code.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,E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AAE;iDACW;AAWf;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACH;AAUjB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;sDACU;AAS1C;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACT;AAWX;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACT;AASX;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;mDACZ;AAgBjB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;oDAC7B;AASf;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;sDAC1B;AAUpB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;oDACE;AAShC;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;uDACW","sourcesContent":["import { html, LitElement, nothing, type PropertyValues } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { createAbortHandle } from '#internals/abort-handler.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport { bindIf } from '#internals/utils/lit.js';\nimport { clamp, numberInRangeInclusive } from '#internals/utils/math.js';\nimport { createIdGenerator } from '#internals/utils/strings.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport type { QRCodeMatrixResult } from './model/matrix.js';\nimport { generateQRCodeMatrix } from './model/matrix.js';\nimport {\n DEFAULT_SIZE_RATIO,\n MAX_SAFE_AREA,\n SAFE_AREAS,\n} from './renderer/constants.js';\nimport { renderQrFinders } from './renderer/corner.js';\nimport { renderQrDots } from './renderer/dots.js';\nimport {\n createSvgSnapshot,\n downloadFile,\n ensureExtension,\n isExportFormat,\n MAX_EXPORT_DIMENSION,\n MIME_TYPES,\n rasterizeSvg,\n serializeSvg,\n} from './renderer/export.js';\nimport { renderQrMaskAndImage } from './renderer/image.js';\nimport { styles } from './themes/qr-code.base.css.js';\nimport { styles as shared } from './themes/shared/qr-code.common.css.js';\nimport { all } from './themes/themes.js';\nimport type {\n QrCodeExportOptions,\n QrCornerSquareStyle,\n QrDotStyle,\n QrErrorCorrectionLevel,\n} from './types.js';\n\nconst nextMaskId = createIdGenerator('igc-qr-code-mask');\n\n/**\n *\n * Generates a QR code based on the provided value and options.\n * The component renders an SVG representation of the QR code, which can be customized using various properties.\n *\n * @element igc-qr-code\n *\n * @cssproperty --ig-qr-code-background - The background color of the QR code. Default is `white`.\n * @cssproperty --ig-qr-code-dark-color - The color of the data modules (dots), and the corner square/dot colors unless overridden below. Default is `black`.\n * @cssproperty --ig-qr-code-corner-square-color - The color of the outer finder-pattern corner squares. Defaults to `--ig-qr-code-dark-color`.\n * @cssproperty --ig-qr-code-corner-dot-color - The color of the inner finder-pattern corner dots. Defaults to `--ig-qr-code-dark-color`.\n *\n * @csspart background - The background rect of the QR code.\n * @csspart dots - The data modules (dots) of the QR code.\n * @csspart corner-square - The outer corner (finder-pattern) squares of the QR code.\n * @csspart corner-dot - The inner corner (finder-pattern) dots of the QR code.\n */\nexport default class IgcQrCodeComponent extends LitElement {\n public static readonly tagName = 'igc-qr-code';\n\n public static override styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcQrCodeComponent);\n }\n\n private readonly _abortHandle = createAbortHandle();\n private readonly _maskId = nextMaskId();\n private readonly _maskUrl = `url(#${this._maskId})`;\n private _logoReady: Promise<void> = Promise.resolve();\n private _matrixCache?: {\n value: string;\n errorLevel: QrErrorCorrectionLevel;\n version?: number;\n result: QRCodeMatrixResult;\n };\n\n @state()\n private _logoAspectRatio = 1;\n\n @state()\n private _logoLoadFailed = false;\n\n constructor() {\n super();\n addThemingController(this, all);\n }\n\n /**\n * The value to be encoded in the QR code. This can be any string, such as a URL, text, or other data.\n * When this property is set, the component will generate a QR code representing the provided value.\n *\n * @attr value\n */\n @property()\n public value?: string;\n\n /**\n * The version of the QR code to generate, which determines the size and data capacity of the QR code.\n * Valid values are integers from 1 to 40, where each version corresponds to a specific module size and data capacity.\n *\n * If not specified, the component will automatically select the smallest version that can accommodate the provided value.\n *\n * @attr version\n */\n @property({ type: Number })\n public version?: number;\n\n /**\n * The error correction level for the QR code, which determines the QR code's ability to be read if it is partially obscured or damaged.\n * Valid values are 'L', 'M', 'Q', and 'H', where 'L' provides the lowest level of error correction and 'H' provides the highest level.\n *\n * @attr error-level\n * @default 'M'\n */\n @property({ attribute: 'error-level' })\n public errorLevel?: QrErrorCorrectionLevel = 'M';\n\n /**\n * The size of the QR code in pixels. This determines the width and height of the generated QR code. The default value is 128 pixels.\n *\n * @attr size\n * @default 128\n */\n @property({ type: Number })\n public size = 128;\n\n /**\n * The margin (quiet zone) around the QR code, expressed as a number of QR code modules rather\n * than pixels. This is the blank border area surrounding the code, which helps ensure that it\n * can be properly scanned.\n *\n * @attr margin\n * @default 4\n */\n @property({ type: Number })\n public margin = 4;\n\n /**\n * The source URL of an optional logo image to be displayed at the center of the QR code. The logo can help with branding and recognition.\n * If provided, the component will attempt to render the logo within the QR code while maintaining scannability.\n *\n * @attr logo-src\n */\n @property({ attribute: 'logo-src' })\n public logoSrc?: string;\n\n /**\n * The size of the logo, as a ratio of the maximum area that can safely be obscured by a logo\n * while the QR code remains scannable (up to 9% of the code's area, at the highest error\n * correction level). The value should be a number between 0 and 1, where 0 means no logo and 1\n * means the logo will cover the full safe area (not the entire QR code).\n * The default value is 0.4, meaning the logo covers 40% of that safe area (~3.6% of the QR code).\n *\n * When `error-level` is not explicitly set, the smallest error correction level that can\n * accommodate the requested logo size is chosen automatically.\n *\n * @attr logo-size\n * @default 0.4\n */\n @property({ type: Number, attribute: 'logo-size' })\n public logoSize = 0.4;\n\n /**\n * The margin around the logo in pixels. This is the whitespace area surrounding the logo within the QR code,\n * which helps ensure that the logo does not interfere with the QR code's scannability.\n *\n * @attr logo-margin\n */\n @property({ type: Number, attribute: 'logo-margin' })\n public logoMargin?: number;\n\n /**\n * The style of the data modules (dots) in the QR code, and of the inner dot of each finder-pattern\n * corner. This can be 'square', 'circle', or 'rounded'.\n *\n * @attr dot-style\n * @default 'square'\n */\n @property({ attribute: 'dot-style' })\n public dotStyle: QrDotStyle = 'square';\n\n /**\n * The style of the corner squares in the QR code. This can be 'square', 'circle', or 'rounded'.\n *\n * @attr square-style\n * @default 'square'\n */\n @property({ attribute: 'square-style' })\n public squareStyle: QrCornerSquareStyle = 'square';\n\n /** @internal */\n protected override update(props: PropertyValues<this>): void {\n if (props.has('logoSrc')) {\n this._resolveAspectRatio();\n }\n\n super.update(props);\n }\n\n private _resolveAspectRatio(): void {\n this._abortHandle.abort();\n this._logoLoadFailed = false;\n this._logoAspectRatio = 1;\n this._logoReady = Promise.resolve();\n\n if (!this._hasValidLogoSrc()) {\n return;\n }\n\n const signal = this._abortHandle.signal;\n const img = new Image();\n img.src = this.logoSrc!;\n\n // On error the natural dimensions are 0, so one rule covers load and error.\n const settle = () => {\n if (img.naturalWidth && img.naturalHeight) {\n this._logoAspectRatio = img.naturalWidth / img.naturalHeight;\n } else {\n this._logoLoadFailed = true;\n }\n };\n\n if (img.complete) {\n settle();\n return;\n }\n\n this._logoReady = new Promise<void>((resolve) => {\n const done = () => {\n settle();\n resolve();\n };\n\n img.addEventListener('load', done, { once: true, signal });\n img.addEventListener('error', done, { once: true, signal });\n signal.addEventListener('abort', () => resolve(), { once: true });\n });\n }\n\n /**\n * Determines whether a valid logo source is provided.\n *\n * The method checks if the `logoSrc` property is set and if it does not start with potentially unsafe schemes like 'javascript:' or 'vbscript:'.\n * It also ensures that if the source is a data URI, it must be an image type.\n * This validation helps prevent security risks associated with rendering untrusted content in the QR code.\n */\n private _hasValidLogoSrc(): boolean {\n if (!this.logoSrc) return false;\n const s = this.logoSrc.trim().toLowerCase();\n if (s.startsWith('javascript:') || s.startsWith('vbscript:')) return false;\n if (s.startsWith('data:') && !s.startsWith('data:image/')) return false;\n return true;\n }\n\n private _pickErrorLevel(area: number): QrErrorCorrectionLevel {\n if (area <= SAFE_AREAS.L) return 'L';\n if (area <= SAFE_AREAS.M) return 'M';\n if (area <= SAFE_AREAS.Q) return 'Q';\n return 'H';\n }\n\n private _getErrorLevelAndArea(hasLogo: boolean) {\n const userErrorLevel = this.errorLevel;\n const size = this.logoSize;\n const sizeRatio = hasLogo ? clamp(size ?? DEFAULT_SIZE_RATIO, 0, 1) : 0;\n const targetArea = sizeRatio * MAX_SAFE_AREA;\n\n let errorLevel: QrErrorCorrectionLevel;\n let area: number;\n\n if (userErrorLevel) {\n errorLevel = userErrorLevel;\n area = Math.min(targetArea, SAFE_AREAS[userErrorLevel]);\n } else if (targetArea > 0) {\n errorLevel = this._pickErrorLevel(targetArea);\n area = targetArea;\n } else {\n errorLevel = 'M';\n area = 0;\n }\n\n return { errorLevel, area };\n }\n\n private _getMatrix(\n value: string,\n errorLevel: QrErrorCorrectionLevel\n ): QRCodeMatrixResult {\n const cached = this._matrixCache;\n if (\n cached &&\n cached.value === value &&\n cached.errorLevel === errorLevel &&\n cached.version === this.version\n ) {\n return cached.result;\n }\n\n const result = generateQRCodeMatrix(value, errorLevel, this.version);\n this._matrixCache = { value, errorLevel, version: this.version, result };\n return result;\n }\n\n /**\n * Returns a self-contained copy of the rendered SVG with theme colors resolved\n * and the logo inlined. Waits for a pending logo load and render first.\n */\n private async _createSnapshot(): Promise<SVGSVGElement> {\n // The logo load starts in `update()`, so flush a pending update before waiting\n // on it and then let the settled aspect ratio render.\n await this.updateComplete;\n await this._logoReady;\n await this.updateComplete;\n\n // The SVG is rendered only when there is a value.\n const svg = this.renderRoot.querySelector('svg');\n if (!svg) {\n throw new Error('Cannot export an igc-qr-code without a value.');\n }\n\n return createSvgSnapshot(svg);\n }\n\n /* blazorSuppress */\n /**\n * Serializes the QR code to an `image/svg+xml` blob.\n *\n * Theme colors are resolved to plain `fill` attributes and a logo that is not a data URI\n * is fetched and inlined, so the blob renders identically outside the component.\n * A logo that cannot be fetched (for example a cross-origin URL without CORS headers) is omitted.\n *\n * Rejects when the component has no `value`.\n */\n public async toBlob(): Promise<Blob> {\n return serializeSvg(await this._createSnapshot());\n }\n\n /* blazorSuppress */\n /**\n * Exports the QR code as an image file.\n *\n * The `scale` option multiplies the `size` of the component: a 256px QR code exported\n * with `scale: 2` produces a 512x512 image. When `download` is `true` the browser\n * download dialog opens for the file.\n *\n * Rejects when the component has no `value`, when `format` is not supported, when `scale`\n * is not a positive finite number, or when the resulting image exceeds the maximum canvas size.\n */\n public async toImage(options?: QrCodeExportOptions): Promise<File> {\n const { fileName, format = 'png', scale = 1, download } = options ?? {};\n\n if (!isExportFormat(format)) {\n throw new TypeError(`Unsupported export format: ${format}.`);\n }\n\n if (!Number.isFinite(scale) || scale <= 0) {\n throw new RangeError(\n 'The export scale must be a positive finite number.'\n );\n }\n\n const dimension = Math.round(this.size * scale);\n if (!numberInRangeInclusive(dimension, 1, MAX_EXPORT_DIMENSION)) {\n throw new RangeError(\n `The exported image side must be between 1 and ${MAX_EXPORT_DIMENSION} pixels.`\n );\n }\n\n const svg = await this._createSnapshot();\n svg.setAttribute('width', `${dimension}`);\n svg.setAttribute('height', `${dimension}`);\n\n const svgBlob = serializeSvg(svg);\n const blob =\n format === 'svg'\n ? svgBlob\n : await rasterizeSvg(svgBlob, dimension, format);\n\n const name = ensureExtension(fileName?.trim() || 'qr-code', format);\n const file = new File([blob], name, { type: MIME_TYPES[format] });\n\n if (download) {\n downloadFile(file);\n }\n\n return file;\n }\n\n protected override render() {\n if (!this.value) return nothing;\n\n const hasLogo = this._hasValidLogoSrc() && !this._logoLoadFailed;\n const { errorLevel, area } = this._getErrorLevelAndArea(hasLogo);\n\n const { matrix, size } = this._getMatrix(this.value, errorLevel);\n\n const totalModules = size + this.margin * 2;\n const moduleSize = size / totalModules;\n const marginPx = this.margin * moduleSize;\n const svgSize = moduleSize * (size + this.margin * 2);\n\n const { mask, image, shouldApplyMask } = renderQrMaskAndImage({\n hasLogo,\n src: this.logoSrc!,\n aspectRatio: this._logoAspectRatio,\n area,\n size: this.size,\n margin: this.logoMargin,\n svgSize,\n maskId: this._maskId,\n });\n\n return html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"img\"\n width=${this.size}\n height=${this.size}\n viewBox=\"0 0 ${svgSize} ${svgSize}\"\n >\n <title>${this.ariaLabel ?? `QR code: ${this.value}`}</title>\n\n <rect part=\"background\" width=${svgSize} height=${svgSize} />\n ${mask}\n <g mask=${bindIf(shouldApplyMask, this._maskUrl)}>\n ${renderQrDots({\n matrix,\n moduleSize,\n marginPx,\n dotStyle: this.dotStyle,\n })}\n ${renderQrFinders({\n size,\n moduleSize,\n marginPx,\n dotStyle: this.dotStyle,\n squareStyle: this.squareStyle,\n })}\n </g>\n ${image}\n </svg>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-qr-code': IgcQrCodeComponent;\n }\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { QrCodeExportFormat } from '../types.js';
|
|
2
|
+
type QrRasterFormat = Exclude<QrCodeExportFormat, 'svg'>;
|
|
3
|
+
/** MIME type of each export format. */
|
|
4
|
+
export declare const MIME_TYPES: Readonly<Record<QrCodeExportFormat, string>>;
|
|
5
|
+
/**
|
|
6
|
+
* Maximum side length in pixels of an exported raster image.
|
|
7
|
+
* Browsers fail to allocate or encode canvases past this bound.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MAX_EXPORT_DIMENSION = 16384;
|
|
10
|
+
/** Whether `format` is one of the supported export formats. */
|
|
11
|
+
export declare function isExportFormat(format: string): format is QrCodeExportFormat;
|
|
12
|
+
/** Appends the extension of `format` to `fileName` unless it already ends with a matching one. */
|
|
13
|
+
export declare function ensureExtension(fileName: string, format: QrCodeExportFormat): string;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a self-contained copy of the component SVG: theme colors are resolved
|
|
16
|
+
* to presentation attributes and the logo is inlined as a data URI.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createSvgSnapshot(source: SVGSVGElement): Promise<SVGSVGElement>;
|
|
19
|
+
/** Serializes an SVG element into an `image/svg+xml` blob. */
|
|
20
|
+
export declare function serializeSvg(svg: SVGSVGElement): Blob;
|
|
21
|
+
/**
|
|
22
|
+
* Rasterize an SVG blob into a square bitmap of `dimension` pixels per side
|
|
23
|
+
* and encodes it in the requested format.
|
|
24
|
+
*/
|
|
25
|
+
export declare function rasterizeSvg(svgBlob: Blob, dimension: number, format: QrRasterFormat): Promise<Blob>;
|
|
26
|
+
/** Triggers the browser download dialog for the given file. */
|
|
27
|
+
export declare function downloadFile(file: File): void;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export const MIME_TYPES = {
|
|
2
|
+
svg: 'image/svg+xml',
|
|
3
|
+
png: 'image/png',
|
|
4
|
+
jpeg: 'image/jpeg',
|
|
5
|
+
webp: 'image/webp',
|
|
6
|
+
};
|
|
7
|
+
export const MAX_EXPORT_DIMENSION = 16384;
|
|
8
|
+
const EXTENSIONS = {
|
|
9
|
+
svg: /\.svg$/i,
|
|
10
|
+
png: /\.png$/i,
|
|
11
|
+
jpeg: /\.jpe?g$/i,
|
|
12
|
+
webp: /\.webp$/i,
|
|
13
|
+
};
|
|
14
|
+
export function isExportFormat(format) {
|
|
15
|
+
return Object.hasOwn(MIME_TYPES, format);
|
|
16
|
+
}
|
|
17
|
+
export function ensureExtension(fileName, format) {
|
|
18
|
+
return EXTENSIONS[format].test(fileName) ? fileName : `${fileName}.${format}`;
|
|
19
|
+
}
|
|
20
|
+
function readBlobAsDataUrl(blob) {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
const reader = new FileReader();
|
|
23
|
+
reader.addEventListener('load', () => resolve(reader.result), {
|
|
24
|
+
once: true,
|
|
25
|
+
});
|
|
26
|
+
reader.addEventListener('error', () => reject(reader.error), {
|
|
27
|
+
once: true,
|
|
28
|
+
});
|
|
29
|
+
reader.readAsDataURL(blob);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
async function fetchImageAsDataUrl(url) {
|
|
33
|
+
try {
|
|
34
|
+
const response = await fetch(url);
|
|
35
|
+
const blob = response.ok ? await response.blob() : null;
|
|
36
|
+
return blob?.type.startsWith('image/') ? readBlobAsDataUrl(blob) : null;
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function resolveStyles(source, clone) {
|
|
43
|
+
const liveParts = source.querySelectorAll('[part]');
|
|
44
|
+
const cloneParts = clone.querySelectorAll('[part]');
|
|
45
|
+
for (const [index, element] of liveParts.entries()) {
|
|
46
|
+
const target = cloneParts[index];
|
|
47
|
+
const { fill } = getComputedStyle(element);
|
|
48
|
+
if (fill) {
|
|
49
|
+
target.setAttribute('fill', fill);
|
|
50
|
+
}
|
|
51
|
+
target.removeAttribute('part');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function inlineLogo(clone) {
|
|
55
|
+
const image = clone.querySelector('image');
|
|
56
|
+
const href = image?.getAttribute('href');
|
|
57
|
+
if (!image || !href || href.startsWith('data:')) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const dataUrl = await fetchImageAsDataUrl(href);
|
|
61
|
+
if (dataUrl) {
|
|
62
|
+
image.setAttribute('href', dataUrl);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
image.remove();
|
|
66
|
+
clone.querySelector('[mask]')?.removeAttribute('mask');
|
|
67
|
+
clone.querySelector('defs')?.remove();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export async function createSvgSnapshot(source) {
|
|
71
|
+
const clone = source.cloneNode(true);
|
|
72
|
+
resolveStyles(source, clone);
|
|
73
|
+
await inlineLogo(clone);
|
|
74
|
+
return clone;
|
|
75
|
+
}
|
|
76
|
+
export function serializeSvg(svg) {
|
|
77
|
+
const markup = new XMLSerializer().serializeToString(svg);
|
|
78
|
+
return new Blob([markup], { type: `${MIME_TYPES.svg};charset=utf-8` });
|
|
79
|
+
}
|
|
80
|
+
function loadImage(url) {
|
|
81
|
+
return new Promise((resolve, reject) => {
|
|
82
|
+
const image = new Image();
|
|
83
|
+
image.addEventListener('load', () => resolve(image), { once: true });
|
|
84
|
+
image.addEventListener('error', () => reject(new Error('Failed to load the QR code SVG for export.')), { once: true });
|
|
85
|
+
image.src = url;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export async function rasterizeSvg(svgBlob, dimension, format) {
|
|
89
|
+
const url = URL.createObjectURL(svgBlob);
|
|
90
|
+
try {
|
|
91
|
+
const image = await loadImage(url);
|
|
92
|
+
const canvas = document.createElement('canvas');
|
|
93
|
+
canvas.width = dimension;
|
|
94
|
+
canvas.height = dimension;
|
|
95
|
+
const context = canvas.getContext('2d');
|
|
96
|
+
if (format === 'jpeg') {
|
|
97
|
+
context.fillStyle = '#fff';
|
|
98
|
+
context.fillRect(0, 0, dimension, dimension);
|
|
99
|
+
}
|
|
100
|
+
context.drawImage(image, 0, 0, dimension, dimension);
|
|
101
|
+
const type = MIME_TYPES[format];
|
|
102
|
+
const blob = await new Promise((resolve) => canvas.toBlob(resolve, type));
|
|
103
|
+
if (!blob || blob.type !== type) {
|
|
104
|
+
throw new Error(`The browser cannot encode ${type} images.`);
|
|
105
|
+
}
|
|
106
|
+
return blob;
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
URL.revokeObjectURL(url);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
export function downloadFile(file) {
|
|
113
|
+
const url = URL.createObjectURL(file);
|
|
114
|
+
const anchor = document.createElement('a');
|
|
115
|
+
anchor.href = url;
|
|
116
|
+
anchor.download = file.name;
|
|
117
|
+
anchor.click();
|
|
118
|
+
setTimeout(() => URL.revokeObjectURL(url));
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=export.js.map
|