@nova-design-system/nova-webcomponents 3.19.0 → 3.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-93d3b2f8.js +4 -0
- package/dist/cjs/index.cjs.js +1 -2
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/native.cjs.js +1 -1
- package/dist/cjs/nv-button.cjs.entry.js +7 -2
- package/dist/cjs/nv-button.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-datagrid.cjs.entry.js +2 -2
- package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-dialog.cjs.entry.js +1 -1
- package/dist/cjs/nv-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +24 -7
- package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldslider.cjs.entry.js +3 -1
- package/dist/cjs/nv-fieldslider.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-icon.cjs.entry.js +1 -1
- package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-iconbutton_2.cjs.entry.js +6 -1
- package/dist/cjs/nv-iconbutton_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-tableheader.cjs.entry.js +77 -0
- package/dist/cjs/nv-tableheader.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-toggle.cjs.entry.js +2 -2
- package/dist/cjs/nv-togglebutton.cjs.entry.js +2 -2
- package/dist/cjs/nv-togglebutton.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-togglebuttongroup.cjs.entry.js +1 -1
- package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/nv-button/nv-button.js +26 -1
- package/dist/collection/components/nv-button/nv-button.js.map +1 -1
- package/dist/collection/components/nv-button/styles/nv-button.css +4 -0
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
- package/dist/collection/components/nv-datagrid/nv-datagrid.js +4 -2
- package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
- package/dist/collection/components/nv-dialog/nv-dialog.css +1 -0
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +26 -9
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js.map +1 -1
- package/dist/collection/components/nv-fieldslider/partials/field-input.js +3 -1
- package/dist/collection/components/nv-fieldslider/partials/field-input.js.map +1 -1
- package/dist/collection/components/nv-icon/nv-icons.js +1 -2
- package/dist/collection/components/nv-icon/nv-icons.js.map +1 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +26 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js.map +1 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +1 -1
- package/dist/collection/components/nv-table/nv-table.docs.js +7 -0
- package/dist/collection/components/nv-table/nv-table.docs.js.map +1 -1
- package/dist/collection/components/nv-tableheader/nv-tableheader.css +28 -0
- package/dist/collection/components/nv-tableheader/nv-tableheader.docs.js +13 -0
- package/dist/collection/components/nv-tableheader/nv-tableheader.docs.js.map +1 -0
- package/dist/collection/components/nv-tableheader/nv-tableheader.js +139 -0
- package/dist/collection/components/nv-tableheader/nv-tableheader.js.map +1 -0
- package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
- package/dist/collection/components/nv-togglebutton/nv-togglebutton.js +1 -1
- package/dist/collection/components/nv-togglebutton/styles/nv-togglebutton.css +4 -0
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.js +1 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
- package/dist/components/index.js +1 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/nv-accordion-item.js +1 -1
- package/dist/components/nv-accordion.js +3 -3
- package/dist/components/nv-alert.js +1 -1
- package/dist/components/nv-avatar.js +1 -1
- package/dist/components/nv-badge.js +1 -1
- package/dist/components/nv-breadcrumb.js +1 -1
- package/dist/components/nv-button.js +1 -1
- package/dist/components/nv-datagrid.js +4 -4
- package/dist/components/nv-datagrid.js.map +1 -1
- package/dist/components/nv-dialog.js +4 -4
- package/dist/components/nv-dialog.js.map +1 -1
- package/dist/components/nv-dialogfooter.js +1 -1
- package/dist/components/nv-fielddate.js +2 -2
- package/dist/components/nv-fielddaterange.js +2 -2
- package/dist/components/nv-fielddropdown.js +3 -3
- package/dist/components/nv-fielddropdownitem.js +1 -1
- package/dist/components/nv-fieldmultiselect.js +3 -3
- package/dist/components/nv-fieldnumber.js +1 -1
- package/dist/components/nv-fieldpassword.js +2 -2
- package/dist/components/nv-fieldselect.js +2 -2
- package/dist/components/nv-fieldslider.js +6 -4
- package/dist/components/nv-fieldslider.js.map +1 -1
- package/dist/components/nv-fieldtext.js +1 -1
- package/dist/components/nv-fieldtime.js +2 -2
- package/dist/components/nv-icon.js +1 -1
- package/dist/components/nv-iconbutton.js +1 -1
- package/dist/components/nv-menu.js +2 -2
- package/dist/components/nv-menuitem.js +1 -1
- package/dist/components/nv-notification.js +1 -1
- package/dist/components/nv-tableheader.d.ts +11 -0
- package/dist/components/nv-tableheader.js +112 -0
- package/dist/components/nv-tableheader.js.map +1 -0
- package/dist/components/nv-toggle.js +2 -2
- package/dist/components/nv-togglebutton.js +2 -2
- package/dist/components/nv-togglebutton.js.map +1 -1
- package/dist/components/nv-togglebuttongroup.js +1 -1
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/{p-60083982.js → p-00347aae.js} +3 -3
- package/dist/components/{p-60083982.js.map → p-00347aae.js.map} +1 -1
- package/dist/components/p-0bfe8a47.js +88 -0
- package/dist/components/p-0bfe8a47.js.map +1 -0
- package/dist/components/p-2062ba39.js +191 -0
- package/dist/components/p-2062ba39.js.map +1 -0
- package/dist/components/{p-5a5db065.js → p-5c6b5444.js} +10 -4
- package/dist/components/p-5c6b5444.js.map +1 -0
- package/dist/components/{p-18f50d91.js → p-61382072.js} +2 -2
- package/dist/components/{p-18f50d91.js.map → p-61382072.js.map} +1 -1
- package/dist/components/{p-81d915ef.js → p-643d7802.js} +2 -2
- package/dist/components/{p-81d915ef.js.map → p-643d7802.js.map} +1 -1
- package/dist/components/{p-334e19d3.js → p-86588fba.js} +3 -3
- package/dist/components/{p-334e19d3.js.map → p-86588fba.js.map} +1 -1
- package/dist/components/{p-45a3cf85.js → p-8ce28cff.js} +2 -2
- package/dist/components/{p-45a3cf85.js.map → p-8ce28cff.js.map} +1 -1
- package/dist/components/{p-2ac6f42d.js → p-c4d20cc9.js} +2 -2
- package/dist/components/{p-2ac6f42d.js.map → p-c4d20cc9.js.map} +1 -1
- package/dist/components/{p-49205084.js → p-c69f5a37.js} +2 -2
- package/dist/components/{p-49205084.js.map → p-c69f5a37.js.map} +1 -1
- package/dist/components/{p-e0eb748c.js → p-d1d4cc45.js} +27 -10
- package/dist/components/{p-e0eb748c.js.map → p-d1d4cc45.js.map} +1 -1
- package/dist/esm/index-dc2723f3.js +4 -0
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/native.js +1 -1
- package/dist/esm/nv-button.entry.js +7 -2
- package/dist/esm/nv-button.entry.js.map +1 -1
- package/dist/esm/nv-datagrid.entry.js +2 -2
- package/dist/esm/nv-datagrid.entry.js.map +1 -1
- package/dist/esm/nv-dialog.entry.js +1 -1
- package/dist/esm/nv-dialog.entry.js.map +1 -1
- package/dist/esm/nv-fieldnumber.entry.js +24 -7
- package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
- package/dist/esm/nv-fieldslider.entry.js +3 -1
- package/dist/esm/nv-fieldslider.entry.js.map +1 -1
- package/dist/esm/nv-icon.entry.js +1 -1
- package/dist/esm/nv-icon.entry.js.map +1 -1
- package/dist/esm/nv-iconbutton_2.entry.js +6 -1
- package/dist/esm/nv-iconbutton_2.entry.js.map +1 -1
- package/dist/esm/nv-tableheader.entry.js +73 -0
- package/dist/esm/nv-tableheader.entry.js.map +1 -0
- package/dist/esm/nv-toggle.entry.js +2 -2
- package/dist/esm/nv-togglebutton.entry.js +2 -2
- package/dist/esm/nv-togglebutton.entry.js.map +1 -1
- package/dist/esm/nv-togglebuttongroup.entry.js +1 -1
- package/dist/esm/nv-tooltip.entry.js +1 -1
- package/dist/native/index.esm.js +1 -1
- package/dist/native/index.esm.js.map +1 -1
- package/dist/native/native.css +1 -1
- package/dist/native/native.esm.js +1 -1
- package/dist/native/native.esm.js.map +1 -1
- package/dist/native/p-2b4cf4b8.entry.js +2 -0
- package/dist/native/{p-dfb6b65e.entry.js.map → p-2b4cf4b8.entry.js.map} +1 -1
- package/dist/native/{p-8e423742.entry.js → p-44ba73dc.entry.js} +2 -2
- package/dist/native/{p-8e423742.entry.js.map → p-44ba73dc.entry.js.map} +1 -1
- package/dist/native/{p-075d231e.entry.js → p-4de8697c.entry.js} +2 -2
- package/dist/native/{p-44a78545.entry.js → p-533e2530.entry.js} +2 -2
- package/dist/native/p-56ed7306.entry.js +2 -0
- package/dist/native/p-56ed7306.entry.js.map +1 -0
- package/dist/native/p-973f5db2.entry.js +2 -0
- package/dist/native/p-973f5db2.entry.js.map +1 -0
- package/dist/native/p-ae5be175.entry.js +2 -0
- package/dist/native/p-ae5be175.entry.js.map +1 -0
- package/dist/native/p-b43d6629.entry.js +2 -0
- package/dist/native/p-b43d6629.entry.js.map +1 -0
- package/dist/native/{p-c0de4bb0.entry.js → p-bd9bf6a1.entry.js} +2 -2
- package/dist/native/p-bd9bf6a1.entry.js.map +1 -0
- package/dist/native/{p-122c78c3.entry.js → p-be49d837.entry.js} +2 -2
- package/dist/native/{p-122c78c3.entry.js.map → p-be49d837.entry.js.map} +1 -1
- package/dist/native/{p-445221dc.entry.js → p-c4baad6e.entry.js} +2 -2
- package/dist/native/p-c901693d.entry.js +2 -0
- package/dist/native/p-c901693d.entry.js.map +1 -0
- package/dist/types/components/nv-button/nv-button.d.ts +5 -0
- package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +2 -0
- package/dist/types/components/nv-fieldnumber/nv-fieldnumber.d.ts +7 -3
- package/dist/types/components/nv-fieldslider/partials/field-input.d.ts +1 -1
- package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
- package/dist/types/components/nv-iconbutton/nv-iconbutton.d.ts +5 -0
- package/dist/types/components/nv-tableheader/nv-tableheader.d.ts +32 -0
- package/dist/types/components/nv-tableheader/nv-tableheader.docs.d.ts +4 -0
- package/dist/types/components.d.ts +96 -4
- package/dist/vscode-data.json +39 -6
- package/hydrate/index.js +141 -25
- package/hydrate/index.mjs +141 -25
- package/package.json +5 -1
- package/dist/components/p-5a5db065.js.map +0 -1
- package/dist/components/p-946a047c.js +0 -88
- package/dist/components/p-946a047c.js.map +0 -1
- package/dist/components/p-e1b2eba2.js +0 -185
- package/dist/components/p-e1b2eba2.js.map +0 -1
- package/dist/native/p-a6fc987a.entry.js +0 -2
- package/dist/native/p-a6fc987a.entry.js.map +0 -1
- package/dist/native/p-b626ef47.entry.js +0 -2
- package/dist/native/p-b626ef47.entry.js.map +0 -1
- package/dist/native/p-c0de4bb0.entry.js.map +0 -1
- package/dist/native/p-d62869ff.entry.js +0 -2
- package/dist/native/p-d62869ff.entry.js.map +0 -1
- package/dist/native/p-d8f3cf92.entry.js +0 -2
- package/dist/native/p-d8f3cf92.entry.js.map +0 -1
- package/dist/native/p-dfb6b65e.entry.js +0 -2
- /package/dist/native/{p-075d231e.entry.js.map → p-4de8697c.entry.js.map} +0 -0
- /package/dist/native/{p-44a78545.entry.js.map → p-533e2530.entry.js.map} +0 -0
- /package/dist/native/{p-445221dc.entry.js.map → p-c4baad6e.entry.js.map} +0 -0
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h, d as Host } from './p-5829b9f7.js';
|
|
2
|
-
import { b as ButtonType, B as ButtonSize } from './p-51602221.js';
|
|
3
|
-
import { d as defineCustomElement$1 } from './p-222136c2.js';
|
|
4
|
-
|
|
5
|
-
const nvButtonCss = "nv-button{text-decoration:none;display:inline-flex;justify-content:center;align-items:center;font-style:normal;font-weight:var(--font-weight-medium-emphasis);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;transition:background-color 150ms ease-out;user-select:none;cursor:pointer;height:fit-content;width:fit-content}nv-button[size=xs]{padding:var(--button-xs-padding-y) var(--button-xs-padding-x);gap:var(--button-xs-gap);border-radius:var(--button-xs-border-radius);line-height:var(--button-xs-line-height);font-size:var(--button-xs-font-size)}nv-button[size=xs] nv-icon>svg{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-button[size=sm]{padding:var(--button-sm-padding-y) var(--button-sm-padding-x);gap:var(--button-sm-gap);border-radius:var(--button-sm-border-radius);line-height:var(--button-sm-line-height);font-size:var(--button-sm-font-size)}nv-button[size=sm] nv-icon>svg{width:var(--spacing-4);height:var(--spacing-4);stroke-width:1.5px}nv-button[size=md]{padding:var(--button-md-padding-y) var(--button-md-padding-x);gap:var(--button-md-gap);border-radius:var(--button-md-border-radius);line-height:var(--button-md-line-height);font-size:var(--button-md-font-size)}nv-button[size=md] nv-icon>svg{width:var(--spacing-5);height:var(--spacing-5);stroke-width:1.6px}nv-button[size=lg]{padding:var(--button-lg-padding-y) var(--button-lg-padding-x);gap:var(--button-lg-gap);border-radius:var(--button-lg-border-radius);line-height:var(--button-lg-line-height);font-size:var(--button-lg-font-size)}nv-button[size=lg] nv-icon>svg{width:var(--spacing-6);height:var(--spacing-6);stroke-width:1.8px}nv-button[emphasis=high]{background:var(--components-button-high-background);border:1px solid var(--components-button-high-border);color:var(--components-button-high-text)}nv-button[emphasis=high]:hover{background:var(--components-button-high-background-hover);border:1px solid var(--components-button-high-border);color:var(--components-button-high-text-hover)}nv-button[emphasis=high]:active{background:var(--components-button-high-background-active);border:1px solid var(--components-button-high-border-active);color:var(--components-button-high-text-active)}nv-button[emphasis=high]:focus,nv-button[emphasis=high]:focus-within{outline:none}nv-button[emphasis=high]:focus-visible,nv-button[emphasis=high]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=high]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-button[emphasis=high][active]:not([active=false]){background:var(--components-button-high-background-active);border:1px solid var(--components-button-high-border-active);color:var(--components-button-high-text-active)}nv-button[emphasis=high][danger]:not([danger=false]){background:var(--components-button-destructive-high-background);border:1px solid transparent;color:var(--components-button-destructive-high-text)}nv-button[emphasis=high][danger]:not([danger=false]):hover{background:var(--components-button-destructive-high-background-hover);border:1px solid transparent;color:var(--components-button-destructive-high-text-hover)}nv-button[emphasis=high][danger]:not([danger=false]):focus,nv-button[emphasis=high][danger]:not([danger=false]):focus-within{outline:none}nv-button[emphasis=high][danger]:not([danger=false]):focus-visible,nv-button[emphasis=high][danger]:not([danger=false]):has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-destructive);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=medium]{background:var(--components-button-medium-background);border:1px solid var(--components-button-medium-border);color:var(--components-button-medium-text)}nv-button[emphasis=medium]:hover{background:var(--components-button-medium-background-hover);border:1px solid var(--components-button-medium-border);color:var(--components-button-medium-text-hover)}nv-button[emphasis=medium]:active{background:var(--components-button-medium-background-active);border:1px solid var(--components-button-medium-border-active);color:var(--components-button-medium-text-active)}nv-button[emphasis=medium]:focus,nv-button[emphasis=medium]:focus-within{outline:none}nv-button[emphasis=medium]:focus-visible,nv-button[emphasis=medium]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=medium]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-button[emphasis=medium][active]:not([active=false]){background:var(--components-button-medium-background-active);border:1px solid var(--components-button-medium-border-active);color:var(--components-button-medium-text-active)}nv-button[emphasis=medium][danger]:not([danger=false]){background:var(--components-button-destructive-medium-background);border:1px solid var(--components-button-destructive-medium-border);color:var(--components-button-destructive-medium-text)}nv-button[emphasis=medium][danger]:not([danger=false]):hover{background:var(--components-button-destructive-medium-background-hover);border:1px solid var(--components-button-destructive-medium-border);color:var(--components-button-destructive-medium-text-hover)}nv-button[emphasis=medium][danger]:not([danger=false]):focus,nv-button[emphasis=medium][danger]:not([danger=false]):focus-within{outline:none}nv-button[emphasis=medium][danger]:not([danger=false]):focus-visible,nv-button[emphasis=medium][danger]:not([danger=false]):has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-destructive);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=low]{background:var(--components-button-low-background);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text)}nv-button[emphasis=low]:hover{background:var(--components-button-low-background-hover);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text-hover)}nv-button[emphasis=low]:active{background:var(--components-button-low-background-active);border:1px solid var(--components-button-low-border-active);color:var(--components-button-low-text-active)}nv-button[emphasis=low]:focus,nv-button[emphasis=low]:focus-within{outline:none}nv-button[emphasis=low]:focus-visible,nv-button[emphasis=low]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=low]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-button[emphasis=low][active]:not([active=false]){background:var(--components-button-low-background-active);border:1px solid var(--components-button-low-border-active);color:var(--components-button-low-text-active)}nv-button[emphasis=low][danger]:not([danger=false]){background:var(--components-button-destructive-low-background);border:1px solid var(--components-button-destructive-low-border);color:var(--components-button-destructive-low-text)}nv-button[emphasis=low][danger]:not([danger=false]):hover{background:var(--components-button-destructive-low-background-hover);border:1px solid var(--components-button-destructive-low-border);color:var(--components-button-destructive-low-text-hover)}nv-button[emphasis=low][danger]:not([danger=false]):focus,nv-button[emphasis=low][danger]:not([danger=false]):focus-within{outline:none}nv-button[emphasis=low][danger]:not([danger=false]):focus-visible,nv-button[emphasis=low][danger]:not([danger=false]):has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-destructive);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=lower]{background:var(--components-button-lower-background);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text)}nv-button[emphasis=lower]:hover{background:var(--components-button-lower-background-hover);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text-hover)}nv-button[emphasis=lower]:active{background:var(--components-button-lower-background-active);border:1px solid var(--components-button-lower-border-active);color:var(--components-button-lower-text-active)}nv-button[emphasis=lower]:focus,nv-button[emphasis=lower]:focus-within{outline:none}nv-button[emphasis=lower]:focus-visible,nv-button[emphasis=lower]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=lower]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-button[emphasis=lower][active]:not([active=false]){background:var(--components-button-lower-background-active);border:1px solid var(--components-button-lower-border-active);color:var(--components-button-lower-text-active)}nv-button[emphasis=lower][danger]:not([danger=false]){background:var(--components-button-destructive-lower-background);border:1px solid var(--components-button-destructive-lower-border);color:var(--components-button-destructive-lower-text)}nv-button[emphasis=lower][danger]:not([danger=false]):hover{background:var(--components-button-destructive-lower-background-hover);border:1px solid var(--components-button-destructive-lower-border);color:var(--components-button-destructive-lower-text-hover)}nv-button[emphasis=lower][danger]:not([danger=false]):focus,nv-button[emphasis=lower][danger]:not([danger=false]):focus-within{outline:none}nv-button[emphasis=lower][danger]:not([danger=false]):focus-visible,nv-button[emphasis=lower][danger]:not([danger=false]):has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-destructive);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[fluid]:not([fluid=false]){width:100%}nv-button[loading]:not([loading=false]) [slot=leading-icon]{display:none}";
|
|
6
|
-
const NvButtonStyle0 = nvButtonCss;
|
|
7
|
-
|
|
8
|
-
const NvButton = /*@__PURE__*/ proxyCustomElement(class NvButton extends H {
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
11
|
-
this.__registerHost();
|
|
12
|
-
this.internals = this.attachInternals();
|
|
13
|
-
/****************************************************************************/
|
|
14
|
-
//#region PROPERTIES
|
|
15
|
-
/**
|
|
16
|
-
* Determines how large or small the button appears, allowing for
|
|
17
|
-
* customization of the button's dimensions to fit different design
|
|
18
|
-
* specifications and user needs.
|
|
19
|
-
*/
|
|
20
|
-
this.size = 'md';
|
|
21
|
-
/**
|
|
22
|
-
* Adjusts the button's emphasis to make it more or less visually prominent
|
|
23
|
-
* to users. Use this to draw attention to important actions or reduce focus
|
|
24
|
-
* on less critical ones
|
|
25
|
-
*/
|
|
26
|
-
this.emphasis = 'high';
|
|
27
|
-
/**
|
|
28
|
-
* Use this prop to highlight the button when it represents the current page
|
|
29
|
-
* or active selection. This helps users understand their navigation context.
|
|
30
|
-
*/
|
|
31
|
-
this.active = false;
|
|
32
|
-
/**
|
|
33
|
-
* Applies styling that visually indicates the button represents a dangerous
|
|
34
|
-
* action.
|
|
35
|
-
*/
|
|
36
|
-
this.danger = false;
|
|
37
|
-
/**
|
|
38
|
-
* Set this to true to show a spinner on the button, letting users know that
|
|
39
|
-
* their action is being processed. It helps improve user experience by
|
|
40
|
-
* indicating ongoing activities.
|
|
41
|
-
*/
|
|
42
|
-
this.loading = false;
|
|
43
|
-
/**
|
|
44
|
-
* Disables the button, preventing user interaction.
|
|
45
|
-
*/
|
|
46
|
-
this.disabled = false;
|
|
47
|
-
/**
|
|
48
|
-
* Allows the button to stretch and fill the entire width of its container.
|
|
49
|
-
*/
|
|
50
|
-
this.fluid = false;
|
|
51
|
-
/**
|
|
52
|
-
* Sets the button type to control its function in forms. Use 'submit' to send
|
|
53
|
-
* form data, 'reset' to clear the form, or 'button' for a standard button
|
|
54
|
-
* that doesn't interact with form submission by default.
|
|
55
|
-
*/
|
|
56
|
-
this.type = 'button';
|
|
57
|
-
//#endregion PROPERTIES
|
|
58
|
-
/****************************************************************************/
|
|
59
|
-
//#region METHODS
|
|
60
|
-
/**
|
|
61
|
-
* Handles button click events, managing form actions and disabled states.
|
|
62
|
-
* Prevents default behavior when button is disabled or loading, and
|
|
63
|
-
* processes form submissions/resets when appropriate.
|
|
64
|
-
* @param {Event} event - The click event.
|
|
65
|
-
*/
|
|
66
|
-
this.handleButtonClick = (event) => {
|
|
67
|
-
var _a;
|
|
68
|
-
if (this.loading || this.disabled) {
|
|
69
|
-
event.preventDefault();
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (this.type !== ButtonType.Button &&
|
|
73
|
-
(this.form || ((_a = this.internals) === null || _a === void 0 ? void 0 : _a.form))) {
|
|
74
|
-
this.processFormAction();
|
|
75
|
-
}
|
|
76
|
-
else if (this.form && this.type === ButtonType.Button) {
|
|
77
|
-
console.warn('Button has a form id but is not of type submit or reset so no form action will be processed.', `Button:`, this.el);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Processes form-related actions by finding the associated form element
|
|
82
|
-
* and triggering the appropriate action (submit/reset) based on button type.
|
|
83
|
-
* Falls back to ElementInternals form if no explicit form ID is provided.
|
|
84
|
-
*/
|
|
85
|
-
this.processFormAction = () => {
|
|
86
|
-
var _a, _b;
|
|
87
|
-
const formElement = this.form
|
|
88
|
-
? document.getElementById(this.form)
|
|
89
|
-
: (_a = this.internals) === null || _a === void 0 ? void 0 : _a.form;
|
|
90
|
-
if (!formElement) {
|
|
91
|
-
console.warn('No form element found.', `Form ID: ${this.form || 'Not provided'}`, `Internals form:`, (_b = this.internals) === null || _b === void 0 ? void 0 : _b.form);
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
switch (this.type) {
|
|
95
|
-
case ButtonType.Submit:
|
|
96
|
-
formElement.requestSubmit();
|
|
97
|
-
break;
|
|
98
|
-
case ButtonType.Reset:
|
|
99
|
-
formElement.reset();
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
//#endregion METHODS
|
|
105
|
-
/****************************************************************************/
|
|
106
|
-
//#region EVENTS
|
|
107
|
-
handleKeyDown(event) {
|
|
108
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
109
|
-
event.preventDefault();
|
|
110
|
-
this.el.click();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
//#endregion EVENTS
|
|
114
|
-
/****************************************************************************/
|
|
115
|
-
//#region WATCHERS
|
|
116
|
-
handleLoadingChange(loading) {
|
|
117
|
-
this.loading = loading;
|
|
118
|
-
this.disabled = loading;
|
|
119
|
-
}
|
|
120
|
-
handleDisabledChange(disabled) {
|
|
121
|
-
if (this.loading) {
|
|
122
|
-
this.disabled = this.loading;
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
this.disabled = disabled;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
//#endregion WATCHERS
|
|
129
|
-
/****************************************************************************/
|
|
130
|
-
//#region LIFECYCLE
|
|
131
|
-
componentWillLoad() {
|
|
132
|
-
if (this.loading) {
|
|
133
|
-
this.disabled = this.loading;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
//#endregion LIFECYCLE
|
|
137
|
-
/****************************************************************************/
|
|
138
|
-
//#region RENDER
|
|
139
|
-
render() {
|
|
140
|
-
return (h(Host, { key: '42488f71ad33233c839cd70b3ea57aee50b143b3', role: "button", tabindex: "0", onClick: this.handleButtonClick }, this.loading && (h("nv-loader", { key: 'a30c71eebb8f0476bcca5acbc8e7ac7f6377740c', size: this.size === ButtonSize.Large ? 'sm' : 'xs' })), h("slot", { key: '4bbcee81ef7236ae35471c649971c122e4b468f3', name: "leading-icon" }), h("slot", { key: '82203f6aed911e61aef2438bba3b3e664ffb9f76' }), h("slot", { key: 'c97a5ce78c15556b8c1a91a4d06eb6bc9a9cd255', name: "trailing-icon" })));
|
|
141
|
-
}
|
|
142
|
-
static get formAssociated() { return true; }
|
|
143
|
-
get el() { return this; }
|
|
144
|
-
static get watchers() { return {
|
|
145
|
-
"loading": ["handleLoadingChange"],
|
|
146
|
-
"disabled": ["handleDisabledChange"]
|
|
147
|
-
}; }
|
|
148
|
-
static get style() { return NvButtonStyle0; }
|
|
149
|
-
}, [68, "nv-button", {
|
|
150
|
-
"size": [513],
|
|
151
|
-
"emphasis": [513],
|
|
152
|
-
"active": [516],
|
|
153
|
-
"danger": [516],
|
|
154
|
-
"loading": [1540],
|
|
155
|
-
"disabled": [1540],
|
|
156
|
-
"fluid": [516],
|
|
157
|
-
"type": [513],
|
|
158
|
-
"form": [513]
|
|
159
|
-
}, [[0, "keydown", "handleKeyDown"]], {
|
|
160
|
-
"loading": ["handleLoadingChange"],
|
|
161
|
-
"disabled": ["handleDisabledChange"]
|
|
162
|
-
}]);
|
|
163
|
-
function defineCustomElement() {
|
|
164
|
-
if (typeof customElements === "undefined") {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
const components = ["nv-button", "nv-loader"];
|
|
168
|
-
components.forEach(tagName => { switch (tagName) {
|
|
169
|
-
case "nv-button":
|
|
170
|
-
if (!customElements.get(tagName)) {
|
|
171
|
-
customElements.define(tagName, NvButton);
|
|
172
|
-
}
|
|
173
|
-
break;
|
|
174
|
-
case "nv-loader":
|
|
175
|
-
if (!customElements.get(tagName)) {
|
|
176
|
-
defineCustomElement$1();
|
|
177
|
-
}
|
|
178
|
-
break;
|
|
179
|
-
} });
|
|
180
|
-
}
|
|
181
|
-
defineCustomElement();
|
|
182
|
-
|
|
183
|
-
export { NvButton as N, defineCustomElement as d };
|
|
184
|
-
|
|
185
|
-
//# sourceMappingURL=p-e1b2eba2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1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M,IAAI,EAAC,cAAc,GAAQ,EACjC,8DAAa,EACb,6DAAM,IAAI,EAAC,eAAe,GAAQ,CAC7B,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/nv-button/styles/nv-button.scss?tag=nv-button","src/components/nv-button/nv-button.tsx"],"sourcesContent":["@use \"./mixins\" as *;\n\n// Make sure to update nv-button class in the tailwind-components.scss file when\n// you add new styles or change the structure here.\nnv-button {\n @include root-styles();\n\n @each $size in $sizes {\n &[size=\"#{$size}\"] {\n @include size-styles($size);\n }\n }\n\n @each $emphasis in $emphases {\n &[emphasis=\"#{$emphasis}\"] {\n @include emphasis-styles($emphasis);\n\n &[active]:not([active=\"false\"]) {\n @include active-styles($emphasis);\n }\n\n &[danger]:not([danger=\"false\"]) {\n @include danger-styles($emphasis);\n }\n }\n }\n\n &[fluid]:not([fluid=\"false\"]) {\n @include fluid-styles();\n }\n\n &[loading]:not([loading=\"false\"]) {\n [slot=\"leading-icon\"] {\n display: none;\n }\n }\n}\n","import {\n Component,\n Listen,\n Host,\n h,\n Prop,\n AttachInternals,\n Element,\n Watch,\n} from '@stencil/core';\n\nimport { ButtonSize, ButtonEmphasis, ButtonType } from '../../utils/constants';\n\n/**\n * @slot default - Content of the button.\n * @slot leading-icon - Icon before the label.\n * @slot trailing-icon - Icon after the label.\n */\n@Component({\n tag: 'nv-button',\n shadow: false,\n formAssociated: true,\n styleUrl: 'styles/nv-button.scss',\n})\nexport class NvButton {\n @AttachInternals() internals: ElementInternals;\n @Element() el: HTMLNvButtonElement;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Determines how large or small the button appears, allowing for\n * customization of the button's dimensions to fit different design\n * specifications and user needs.\n */\n @Prop({ reflect: true })\n readonly size: `${ButtonSize}` = 'md';\n\n /**\n * Adjusts the button's emphasis to make it more or less visually prominent\n * to users. Use this to draw attention to important actions or reduce focus\n * on less critical ones\n */\n @Prop({ reflect: true })\n readonly emphasis: `${ButtonEmphasis}` = 'high';\n\n /**\n * Use this prop to highlight the button when it represents the current page\n * or active selection. This helps users understand their navigation context.\n */\n @Prop({ reflect: true })\n readonly active: boolean = false;\n\n /**\n * Applies styling that visually indicates the button represents a dangerous\n * action.\n */\n @Prop({ reflect: true })\n readonly danger: boolean = false;\n\n /**\n * Set this to true to show a spinner on the button, letting users know that\n * their action is being processed. It helps improve user experience by\n * indicating ongoing activities.\n */\n @Prop({ reflect: true, mutable: true })\n loading: boolean = false;\n\n /**\n * Disables the button, preventing user interaction.\n */\n @Prop({ reflect: true, mutable: true })\n disabled: boolean = false;\n\n /**\n * Allows the button to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n /**\n * Sets the button type to control its function in forms. Use 'submit' to send\n * form data, 'reset' to clear the form, or 'button' for a standard button\n * that doesn't interact with form submission by default.\n */\n @Prop({ reflect: true })\n readonly type: `${ButtonType}` = 'button';\n\n /**\n * Sets the form associated with the button in case the (submit) button is not a child of a form.\n * Matches the native HTML button 'form' attribute behavior.\n */\n @Prop({ reflect: true })\n readonly form: string;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles button click events, managing form actions and disabled states.\n * Prevents default behavior when button is disabled or loading, and\n * processes form submissions/resets when appropriate.\n * @param {Event} event - The click event.\n */\n private handleButtonClick = (event: Event): void => {\n if (this.loading || this.disabled) {\n event.preventDefault();\n return;\n }\n\n if (\n this.type !== ButtonType.Button &&\n (this.form || this.internals?.form)\n ) {\n this.processFormAction();\n } else if (this.form && this.type === ButtonType.Button) {\n console.warn(\n 'Button has a form id but is not of type submit or reset so no form action will be processed.',\n `Button:`,\n this.el,\n );\n }\n };\n\n /**\n * Processes form-related actions by finding the associated form element\n * and triggering the appropriate action (submit/reset) based on button type.\n * Falls back to ElementInternals form if no explicit form ID is provided.\n */\n private processFormAction = (): void => {\n const formElement = this.form\n ? (document.getElementById(this.form) as HTMLFormElement)\n : this.internals?.form;\n\n if (!formElement) {\n console.warn(\n 'No form element found.',\n `Form ID: ${this.form || 'Not provided'}`,\n `Internals form:`,\n this.internals?.form,\n );\n return;\n }\n\n switch (this.type) {\n case ButtonType.Submit:\n formElement.requestSubmit();\n break;\n case ButtonType.Reset:\n formElement.reset();\n break;\n }\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region EVENTS\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.el.click();\n }\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('loading')\n handleLoadingChange(loading: boolean) {\n this.loading = loading;\n this.disabled = loading;\n }\n\n @Watch('disabled')\n handleDisabledChange(disabled: boolean) {\n if (this.loading) {\n this.disabled = this.loading;\n } else {\n this.disabled = disabled;\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n if (this.loading) {\n this.disabled = this.loading;\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host role=\"button\" tabindex=\"0\" onClick={this.handleButtonClick}>\n {this.loading && (\n <nv-loader\n size={this.size === ButtonSize.Large ? 'sm' : 'xs'}\n ></nv-loader>\n )}\n\n <slot name=\"leading-icon\"></slot>\n <slot></slot>\n <slot name=\"trailing-icon\"></slot>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as o,h as t,H as e,g as n}from"./p-3060df80.js";import{b as s,B as r}from"./p-51602221.js";const a="nv-button{text-decoration:none;display:inline-flex;justify-content:center;align-items:center;font-style:normal;font-weight:var(--font-weight-medium-emphasis);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;transition:background-color 150ms ease-out;user-select:none;cursor:pointer;height:fit-content;width:fit-content}nv-button[size=xs]{padding:var(--button-xs-padding-y) var(--button-xs-padding-x);gap:var(--button-xs-gap);border-radius:var(--button-xs-border-radius);line-height:var(--button-xs-line-height);font-size:var(--button-xs-font-size)}nv-button[size=xs] nv-icon>svg{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-button[size=sm]{padding:var(--button-sm-padding-y) var(--button-sm-padding-x);gap:var(--button-sm-gap);border-radius:var(--button-sm-border-radius);line-height:var(--button-sm-line-height);font-size:var(--button-sm-font-size)}nv-button[size=sm] nv-icon>svg{width:var(--spacing-4);height:var(--spacing-4);stroke-width:1.5px}nv-button[size=md]{padding:var(--button-md-padding-y) var(--button-md-padding-x);gap:var(--button-md-gap);border-radius:var(--button-md-border-radius);line-height:var(--button-md-line-height);font-size:var(--button-md-font-size)}nv-button[size=md] nv-icon>svg{width:var(--spacing-5);height:var(--spacing-5);stroke-width:1.6px}nv-button[size=lg]{padding:var(--button-lg-padding-y) var(--button-lg-padding-x);gap:var(--button-lg-gap);border-radius:var(--button-lg-border-radius);line-height:var(--button-lg-line-height);font-size:var(--button-lg-font-size)}nv-button[size=lg] nv-icon>svg{width:var(--spacing-6);height:var(--spacing-6);stroke-width:1.8px}nv-button[emphasis=high]{background:var(--components-button-high-background);border:1px solid var(--components-button-high-border);color:var(--components-button-high-text)}nv-button[emphasis=high]:hover{background:var(--components-button-high-background-hover);border:1px solid var(--components-button-high-border);color:var(--components-button-high-text-hover)}nv-button[emphasis=high]:active{background:var(--components-button-high-background-active);border:1px solid var(--components-button-high-border-active);color:var(--components-button-high-text-active)}nv-button[emphasis=high]:focus,nv-button[emphasis=high]:focus-within{outline:none}nv-button[emphasis=high]:focus-visible,nv-button[emphasis=high]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=high]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-button[emphasis=high][active]:not([active=false]){background:var(--components-button-high-background-active);border:1px solid var(--components-button-high-border-active);color:var(--components-button-high-text-active)}nv-button[emphasis=high][danger]:not([danger=false]){background:var(--components-button-destructive-high-background);border:1px solid transparent;color:var(--components-button-destructive-high-text)}nv-button[emphasis=high][danger]:not([danger=false]):hover{background:var(--components-button-destructive-high-background-hover);border:1px solid transparent;color:var(--components-button-destructive-high-text-hover)}nv-button[emphasis=high][danger]:not([danger=false]):focus,nv-button[emphasis=high][danger]:not([danger=false]):focus-within{outline:none}nv-button[emphasis=high][danger]:not([danger=false]):focus-visible,nv-button[emphasis=high][danger]:not([danger=false]):has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-destructive);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=medium]{background:var(--components-button-medium-background);border:1px solid var(--components-button-medium-border);color:var(--components-button-medium-text)}nv-button[emphasis=medium]:hover{background:var(--components-button-medium-background-hover);border:1px solid var(--components-button-medium-border);color:var(--components-button-medium-text-hover)}nv-button[emphasis=medium]:active{background:var(--components-button-medium-background-active);border:1px solid var(--components-button-medium-border-active);color:var(--components-button-medium-text-active)}nv-button[emphasis=medium]:focus,nv-button[emphasis=medium]:focus-within{outline:none}nv-button[emphasis=medium]:focus-visible,nv-button[emphasis=medium]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=medium]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-button[emphasis=medium][active]:not([active=false]){background:var(--components-button-medium-background-active);border:1px solid var(--components-button-medium-border-active);color:var(--components-button-medium-text-active)}nv-button[emphasis=medium][danger]:not([danger=false]){background:var(--components-button-destructive-medium-background);border:1px solid var(--components-button-destructive-medium-border);color:var(--components-button-destructive-medium-text)}nv-button[emphasis=medium][danger]:not([danger=false]):hover{background:var(--components-button-destructive-medium-background-hover);border:1px solid var(--components-button-destructive-medium-border);color:var(--components-button-destructive-medium-text-hover)}nv-button[emphasis=medium][danger]:not([danger=false]):focus,nv-button[emphasis=medium][danger]:not([danger=false]):focus-within{outline:none}nv-button[emphasis=medium][danger]:not([danger=false]):focus-visible,nv-button[emphasis=medium][danger]:not([danger=false]):has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-destructive);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=low]{background:var(--components-button-low-background);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text)}nv-button[emphasis=low]:hover{background:var(--components-button-low-background-hover);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text-hover)}nv-button[emphasis=low]:active{background:var(--components-button-low-background-active);border:1px solid var(--components-button-low-border-active);color:var(--components-button-low-text-active)}nv-button[emphasis=low]:focus,nv-button[emphasis=low]:focus-within{outline:none}nv-button[emphasis=low]:focus-visible,nv-button[emphasis=low]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=low]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-button[emphasis=low][active]:not([active=false]){background:var(--components-button-low-background-active);border:1px solid var(--components-button-low-border-active);color:var(--components-button-low-text-active)}nv-button[emphasis=low][danger]:not([danger=false]){background:var(--components-button-destructive-low-background);border:1px solid var(--components-button-destructive-low-border);color:var(--components-button-destructive-low-text)}nv-button[emphasis=low][danger]:not([danger=false]):hover{background:var(--components-button-destructive-low-background-hover);border:1px solid var(--components-button-destructive-low-border);color:var(--components-button-destructive-low-text-hover)}nv-button[emphasis=low][danger]:not([danger=false]):focus,nv-button[emphasis=low][danger]:not([danger=false]):focus-within{outline:none}nv-button[emphasis=low][danger]:not([danger=false]):focus-visible,nv-button[emphasis=low][danger]:not([danger=false]):has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-destructive);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=lower]{background:var(--components-button-lower-background);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text)}nv-button[emphasis=lower]:hover{background:var(--components-button-lower-background-hover);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text-hover)}nv-button[emphasis=lower]:active{background:var(--components-button-lower-background-active);border:1px solid var(--components-button-lower-border-active);color:var(--components-button-lower-text-active)}nv-button[emphasis=lower]:focus,nv-button[emphasis=lower]:focus-within{outline:none}nv-button[emphasis=lower]:focus-visible,nv-button[emphasis=lower]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[emphasis=lower]:disabled:not([disabled=false]){opacity:0.5;cursor:not-allowed;box-shadow:none}nv-button[emphasis=lower][active]:not([active=false]){background:var(--components-button-lower-background-active);border:1px solid var(--components-button-lower-border-active);color:var(--components-button-lower-text-active)}nv-button[emphasis=lower][danger]:not([danger=false]){background:var(--components-button-destructive-lower-background);border:1px solid var(--components-button-destructive-lower-border);color:var(--components-button-destructive-lower-text)}nv-button[emphasis=lower][danger]:not([danger=false]):hover{background:var(--components-button-destructive-lower-background-hover);border:1px solid var(--components-button-destructive-lower-border);color:var(--components-button-destructive-lower-text-hover)}nv-button[emphasis=lower][danger]:not([danger=false]):focus,nv-button[emphasis=lower][danger]:not([danger=false]):focus-within{outline:none}nv-button[emphasis=lower][danger]:not([danger=false]):focus-visible,nv-button[emphasis=lower][danger]:not([danger=false]):has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-destructive);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-button[fluid]:not([fluid=false]){width:100%}nv-button[loading]:not([loading=false]) [slot=leading-icon]{display:none}";const i=a;const u=class{constructor(t){o(this,t);if(t.$hostElement$["s-ei"]){this.internals=t.$hostElement$["s-ei"]}else{this.internals=t.$hostElement$.attachInternals();t.$hostElement$["s-ei"]=this.internals}this.size="md";this.emphasis="high";this.active=false;this.danger=false;this.loading=false;this.disabled=false;this.fluid=false;this.type="button";this.handleButtonClick=o=>{var t;if(this.loading||this.disabled){o.preventDefault();return}if(this.type!==s.Button&&(this.form||((t=this.internals)===null||t===void 0?void 0:t.form))){this.processFormAction()}else if(this.form&&this.type===s.Button){console.warn("Button has a form id but is not of type submit or reset so no form action will be processed.",`Button:`,this.el)}};this.processFormAction=()=>{var o,t;const e=this.form?document.getElementById(this.form):(o=this.internals)===null||o===void 0?void 0:o.form;if(!e){console.warn("No form element found.",`Form ID: ${this.form||"Not provided"}`,`Internals form:`,(t=this.internals)===null||t===void 0?void 0:t.form);return}switch(this.type){case s.Submit:e.requestSubmit();break;case s.Reset:e.reset();break}}}handleKeyDown(o){if(o.key==="Enter"||o.key===" "){o.preventDefault();this.el.click()}}handleLoadingChange(o){this.loading=o;this.disabled=o}handleDisabledChange(o){if(this.loading){this.disabled=this.loading}else{this.disabled=o}}componentWillLoad(){if(this.loading){this.disabled=this.loading}}render(){return t(e,{key:"42488f71ad33233c839cd70b3ea57aee50b143b3",role:"button",tabindex:"0",onClick:this.handleButtonClick},this.loading&&t("nv-loader",{key:"a30c71eebb8f0476bcca5acbc8e7ac7f6377740c",size:this.size===r.Large?"sm":"xs"}),t("slot",{key:"4bbcee81ef7236ae35471c649971c122e4b468f3",name:"leading-icon"}),t("slot",{key:"82203f6aed911e61aef2438bba3b3e664ffb9f76"}),t("slot",{key:"c97a5ce78c15556b8c1a91a4d06eb6bc9a9cd255",name:"trailing-icon"}))}static get formAssociated(){return true}get el(){return n(this)}static get watchers(){return{loading:["handleLoadingChange"],disabled:["handleDisabledChange"]}}};u.style=i;export{u as nv_button};
|
|
2
|
-
//# sourceMappingURL=p-a6fc987a.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["nvButtonCss","NvButtonStyle0","NvButton","constructor","hostRef","this","size","emphasis","active","danger","loading","disabled","fluid","type","handleButtonClick","event","preventDefault","ButtonType","Button","form","_a","internals","processFormAction","console","warn","el","formElement","document","getElementById","_b","Submit","requestSubmit","Reset","reset","handleKeyDown","key","click","handleLoadingChange","handleDisabledChange","componentWillLoad","render","h","Host","role","tabindex","onClick","ButtonSize","Large","name"],"sources":["src/components/nv-button/styles/nv-button.scss?tag=nv-button","src/components/nv-button/nv-button.tsx"],"sourcesContent":["@use \"./mixins\" as *;\n\n// Make sure to update nv-button class in the tailwind-components.scss file when\n// you add new styles or change the structure here.\nnv-button {\n @include root-styles();\n\n @each $size in $sizes {\n &[size=\"#{$size}\"] {\n @include size-styles($size);\n }\n }\n\n @each $emphasis in $emphases {\n &[emphasis=\"#{$emphasis}\"] {\n @include emphasis-styles($emphasis);\n\n &[active]:not([active=\"false\"]) {\n @include active-styles($emphasis);\n }\n\n &[danger]:not([danger=\"false\"]) {\n @include danger-styles($emphasis);\n }\n }\n }\n\n &[fluid]:not([fluid=\"false\"]) {\n @include fluid-styles();\n }\n\n &[loading]:not([loading=\"false\"]) {\n [slot=\"leading-icon\"] {\n display: none;\n }\n }\n}\n","import {\n Component,\n Listen,\n Host,\n h,\n Prop,\n AttachInternals,\n Element,\n Watch,\n} from '@stencil/core';\n\nimport { ButtonSize, ButtonEmphasis, ButtonType } from '../../utils/constants';\n\n/**\n * @slot default - Content of the button.\n * @slot leading-icon - Icon before the label.\n * @slot trailing-icon - Icon after the label.\n */\n@Component({\n tag: 'nv-button',\n shadow: false,\n formAssociated: true,\n styleUrl: 'styles/nv-button.scss',\n})\nexport class NvButton {\n @AttachInternals() internals: ElementInternals;\n @Element() el: HTMLNvButtonElement;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Determines how large or small the button appears, allowing for\n * customization of the button's dimensions to fit different design\n * specifications and user needs.\n */\n @Prop({ reflect: true })\n readonly size: `${ButtonSize}` = 'md';\n\n /**\n * Adjusts the button's emphasis to make it more or less visually prominent\n * to users. Use this to draw attention to important actions or reduce focus\n * on less critical ones\n */\n @Prop({ reflect: true })\n readonly emphasis: `${ButtonEmphasis}` = 'high';\n\n /**\n * Use this prop to highlight the button when it represents the current page\n * or active selection. This helps users understand their navigation context.\n */\n @Prop({ reflect: true })\n readonly active: boolean = false;\n\n /**\n * Applies styling that visually indicates the button represents a dangerous\n * action.\n */\n @Prop({ reflect: true })\n readonly danger: boolean = false;\n\n /**\n * Set this to true to show a spinner on the button, letting users know that\n * their action is being processed. It helps improve user experience by\n * indicating ongoing activities.\n */\n @Prop({ reflect: true, mutable: true })\n loading: boolean = false;\n\n /**\n * Disables the button, preventing user interaction.\n */\n @Prop({ reflect: true, mutable: true })\n disabled: boolean = false;\n\n /**\n * Allows the button to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n /**\n * Sets the button type to control its function in forms. Use 'submit' to send\n * form data, 'reset' to clear the form, or 'button' for a standard button\n * that doesn't interact with form submission by default.\n */\n @Prop({ reflect: true })\n readonly type: `${ButtonType}` = 'button';\n\n /**\n * Sets the form associated with the button in case the (submit) button is not a child of a form.\n * Matches the native HTML button 'form' attribute behavior.\n */\n @Prop({ reflect: true })\n readonly form: string;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles button click events, managing form actions and disabled states.\n * Prevents default behavior when button is disabled or loading, and\n * processes form submissions/resets when appropriate.\n * @param {Event} event - The click event.\n */\n private handleButtonClick = (event: Event): void => {\n if (this.loading || this.disabled) {\n event.preventDefault();\n return;\n }\n\n if (\n this.type !== ButtonType.Button &&\n (this.form || this.internals?.form)\n ) {\n this.processFormAction();\n } else if (this.form && this.type === ButtonType.Button) {\n console.warn(\n 'Button has a form id but is not of type submit or reset so no form action will be processed.',\n `Button:`,\n this.el,\n );\n }\n };\n\n /**\n * Processes form-related actions by finding the associated form element\n * and triggering the appropriate action (submit/reset) based on button type.\n * Falls back to ElementInternals form if no explicit form ID is provided.\n */\n private processFormAction = (): void => {\n const formElement = this.form\n ? (document.getElementById(this.form) as HTMLFormElement)\n : this.internals?.form;\n\n if (!formElement) {\n console.warn(\n 'No form element found.',\n `Form ID: ${this.form || 'Not provided'}`,\n `Internals form:`,\n this.internals?.form,\n );\n return;\n }\n\n switch (this.type) {\n case ButtonType.Submit:\n formElement.requestSubmit();\n break;\n case ButtonType.Reset:\n formElement.reset();\n break;\n }\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region EVENTS\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.el.click();\n }\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('loading')\n handleLoadingChange(loading: boolean) {\n this.loading = loading;\n this.disabled = loading;\n }\n\n @Watch('disabled')\n handleDisabledChange(disabled: boolean) {\n if (this.loading) {\n this.disabled = this.loading;\n } else {\n this.disabled = disabled;\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n if (this.loading) {\n this.disabled = this.loading;\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host role=\"button\" tabindex=\"0\" onClick={this.handleButtonClick}>\n {this.loading && (\n <nv-loader\n size={this.size === ButtonSize.Large ? 'sm' : 'xs'}\n ></nv-loader>\n )}\n\n <slot name=\"leading-icon\"></slot>\n <slot></slot>\n <slot name=\"trailing-icon\"></slot>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"mappings":"oGAAA,MAAMA,EAAc,i4TACpB,MAAAC,EAAeD,E,MCuBFE,EAAQ,MANrB,WAAAC,CAAAC,G,0KAmBWC,KAAAC,KAAwB,KAQxBD,KAAAE,SAAgC,OAOhCF,KAAAG,OAAkB,MAOlBH,KAAAI,OAAkB,MAQ3BJ,KAAAK,QAAmB,MAMnBL,KAAAM,SAAoB,MAMXN,KAAAO,MAAiB,MAQjBP,KAAAQ,KAAwB,SAmBzBR,KAAAS,kBAAqBC,I,MAC3B,GAAIV,KAAKK,SAAWL,KAAKM,SAAU,CACjCI,EAAMC,iBACN,M,CA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BACXP,EAAA,QAAAN,IAAA,6CACAM,EAAA,QAAAN,IAAA,2CAAMa,KAAK,kB","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h as e,r as i,c as t,H as r,g as n}from"./p-3060df80.js";import{c as a}from"./p-8a1a6e56.js";import{v as s}from"./p-f5ff676c.js";function o(e){if(Number.isInteger(e))return 0;const i=e.toString();const t=i.split(".")[1];return t?t.length:0}function l(e,i,t){return Math.max(i,Math.min(t,e))}function d(e,i,t){if(t===i)return 0;return(e-i)/(t-i)*100}function c(e,i,t,r){const n=l(e,i,t);const a=o(r);if(a>0){const e=Math.pow(10,a);const s=Math.round((n-i)*e);const o=Math.round(r*e);const d=Math.round(s/o);const c=d*o;const f=i+c/e;return l(parseFloat(f.toFixed(a)),i,t)}const s=(n-i)/r;const d=Math.round(s);const c=i+d*r;return l(c,i,t)}function f(e,i,t){const r=[];for(let n=e;n<=i;n+=t){r.push(Number(n.toFixed(10)))}if(r[r.length-1]!==i){r.push(i)}return r}function h(e,i){if(!i||i.length===0)return e;let t=i[0].value;let r=Math.abs(e-t);for(const n of i){const i=Math.abs(e-n.value);if(i<r){r=i;t=n.value}}return t}function u(e,i){const t=o(i);if(t>0){return e.toFixed(t)}return String(e)}const v=i=>{const{value:t,min:r,max:n,step:a,rawPosition:s,isDragging:o,snap:c,disabled:f,readonly:h,onKeyDown:v,labelBeforeValue:b,labelAfterValue:p}=i;let m=t;if(o&&!c){m=l(s,r,n)}const k=d(m,r,n);return e("div",{class:"thumb",style:{left:`${k}%`},role:"slider","aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":t,"aria-disabled":f?"true":undefined,"aria-readonly":h?"true":undefined,tabindex:f?-1:0,onKeyDown:v},e("div",{class:"thumb-tooltip"},b&&e("span",{class:"label-before"},b),u(t,a),p&&e("span",{class:"label-after"},p)))};const b=i=>{const{rangeValue:t,rawRangePosition:r,activeDragThumb:n,isDragging:a,snap:s,min:o,max:c,step:f,disabled:h,readonly:v,onKeyDown:b,labelBeforeValue:p,labelAfterValue:m}=i;const[k,g]=t;let y=k;let x=g;if(a&&!s){const[e,i]=r;if(n==="left"){y=l(e,o,Math.min(g,c))}else if(n==="right"){x=l(i,Math.max(k,o),c)}}const w=d(y,o,c);const V=d(x,o,c);return[e("div",{class:"track-range",style:{left:`${w}%`,width:`${V-w}%`}}),e("div",{class:"thumb thumb-left",style:{left:`${w}%`},role:"slider","aria-valuemin":o,"aria-valuemax":c,"aria-valuenow":k,"aria-disabled":h?"true":undefined,"aria-readonly":v?"true":undefined,"data-thumb":"left",tabindex:h?-1:0,onKeyDown:b},e("div",{class:"thumb-tooltip"},p&&e("span",{class:"label-before"},p),u(k,f),m&&e("span",{class:"label-after"},m))),e("div",{class:"thumb thumb-right",style:{left:`${V}%`},role:"slider","aria-valuemin":o,"aria-valuemax":c,"aria-valuenow":g,"aria-disabled":h?"true":undefined,"aria-readonly":v?"true":undefined,"data-thumb":"right",tabindex:h?-1:0,onKeyDown:b},e("div",{class:"thumb-tooltip"},p&&e("span",{class:"label-before"},p),u(g,f),m&&e("span",{class:"label-after"},m)))]};const p=i=>{const{ticks:t,min:r,max:n}=i;if(t.length===0){return null}return e("div",{class:"track-ticks"},t.map((i=>{const t=d(i.value,r,n);return e("div",{class:"track-tick",style:{left:`${t}%`}},i.label&&e("div",{class:"tick-label"},i.label))})))};const m=i=>{const{range:t,hasField:r,value:n,rangeValue:s,index:o,inputId:l,min:d,max:c,step:f,disabled:h,readonly:u,onInput:v,labelBeforeValue:b,labelAfterValue:p,name:m,endName:k}=i;const g=t?s[o]:n;const y=t?{"data-index":o.toString()}:{};let x;if(t){if(o===0){x=m||""}else{x=k||(m?`${m}-end`:"")}}else{x=m||""}const w=e=>{e.stopPropagation();const i=e.detail;if(isNaN(i)){return}v({value:i,index:o})};return r?e("div",{class:a(!r&&"hidden-input")},e("nv-fieldnumber",Object.assign({id:l,value:g,min:d,max:c,step:f,disabled:h,readonly:u,name:x},y,{onInput:e=>e.stopPropagation(),onValueChanged:w}),b&&e("span",{class:"label-before",slot:"leading-input"},b),p&&e("span",{class:"label-after",slot:"trailing-input"},p))):e("input",{id:l,type:"hidden",value:g,disabled:h,readonly:u,name:x})};const k='nv-fieldslider .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .track-range{background:var(--components-slider-track-filled-focus)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .thumb{border-color:var(--components-slider-track-filled-focus)}nv-fieldslider[error] .slider-container .track-container .track .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:hover{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-handler-background-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:focus{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldslider{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box;max-width:480px}nv-fieldslider .slider-container{width:100%;display:flex;flex-direction:row;align-items:center;gap:var(--form-gap-x)}nv-fieldslider .slider-container .track-container{position:relative;flex:1;height:calc(var(--slider-handler-size-min) + 0.25rem);padding:calc(var(--slider-handler-size-min) / 2) 0}nv-fieldslider .slider-container .track-container .track{position:relative;height:var(--slider-track-height);background:var(--components-slider-track-background);border-radius:var(--slider-track-radius);cursor:pointer;touch-action:none;user-select:none}nv-fieldslider .slider-container .track-container .track::after{content:"";position:absolute;top:calc(-13px + var(--slider-track-height) / 2);left:0;width:100%;height:26px;background:rgba(255, 255, 255, 0)}nv-fieldslider .slider-container .track-container .track .track-range{position:absolute;top:0;height:var(--slider-track-height);background:var(--components-slider-track-filled-default);border-radius:var(--slider-track-radius);pointer-events:none}nv-fieldslider .slider-container .track-container .track .thumb{position:absolute;top:50%;width:var(--slider-handler-size-min);height:var(--slider-handler-size-min);background:#ffffff;border:var(--slider-handler-stroke) solid var(--components-slider-track-filled-default);border-radius:50%;transform:translate(-50%, -50%);z-index:1;cursor:grab;touch-action:none;user-select:none;transition:width 0.2s, height 0.2s, box-shadow 0.2s, background-color 0.2s}nv-fieldslider .slider-container .track-container .track .thumb:after{content:"";position:absolute;top:-7px;left:-7px;width:calc(100% + 14px);height:calc(100% + 14px);background:rgba(255, 255, 255, 0)}nv-fieldslider .slider-container .track-container .track .thumb:hover{width:var(--slider-handler-size-max);height:var(--slider-handler-size-max);border-color:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container .track .thumb:focus{width:var(--slider-handler-size-min);height:var(--slider-handler-size-min);border-color:var(--components-slider-track-filled-focus);outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1);transition:outline;background:var(--components-slider-handler-background-focus)}nv-fieldslider .slider-container .track-container .track .thumb:active{cursor:grabbing;background:var(--components-slider-handler-background-hover)}nv-fieldslider .slider-container .track-container .track .thumb .thumb-tooltip{position:absolute;top:25px;left:50%;background-color:var(--components-tooltip-background);color:var(--components-tooltip-text);padding:5px;border-radius:var(--tooltip-radius);font-size:var(--tooltip-font-size);z-index:10;pointer-events:none;user-select:none;opacity:0;transition:opacity 0.3s ease-in-out;transform:translateX(-50%);backface-visibility:hidden;-webkit-font-smoothing:antialiased;transform-style:preserve-3d}nv-fieldslider .slider-container .track-container .track .thumb .thumb-tooltip:after{content:"";background:var(--components-tooltip-background);box-shadow:none;border:none;position:absolute;border-bottom-color:transparent;border-right-color:transparent;width:6px;height:6px;transform:rotate(45deg);border-radius:1px;top:-3px;left:50%;margin-left:-3px;backface-visibility:hidden;will-change:transform, opacity}nv-fieldslider .slider-container .track-container .track .thumb:hover .thumb-tooltip,nv-fieldslider .slider-container .track-container .track .thumb:active .thumb-tooltip,nv-fieldslider .slider-container .track-container .track .thumb:focus .thumb-tooltip{opacity:1}nv-fieldslider .slider-container .track-container .track-ticks{position:relative;height:1rem;margin-top:0.25rem}nv-fieldslider .slider-container .track-container .track-ticks .track-tick{position:absolute;top:0;width:var(--slider-tick-height);height:var(--slider-tick-height);background:var(--components-form-field-border-default);border-radius:50%;transform:translate(-50%, 0);pointer-events:none}nv-fieldslider .slider-container .track-container .track-ticks .track-tick:first-of-type{transform:translate(0, 0)}nv-fieldslider .slider-container .track-container .track-ticks .track-tick:last-of-type{transform:translate(-100%, 0)}nv-fieldslider .slider-container .track-container .track-ticks .track-tick .tick-label{position:absolute;top:calc(var(--slider-tick-height) + 0.25rem);left:50%;color:var(--components-form-field-border-default);transform:translateX(-50%);white-space:nowrap}.track-tick-first nv-fieldslider .slider-container .track-container .track-ticks .track-tick .tick-label{left:0;transform:translateX(0)}.track-tick-last nv-fieldslider .slider-container .track-container .track-ticks .track-tick .tick-label{left:100%;transform:translateX(-100%)}nv-fieldslider .slider-container .input-container{display:flex;flex-grow:1;justify-content:center;align-items:center;align-self:stretch;border-radius:var(--form-field-radius);border-width:1px;border-style:solid;border-color:var(--nv-field-border-default);opacity:var(--components-form-opacity-default, 1);background:var(--nv-field-background);transition:all 150ms ease-out;width:90px;flex-grow:unset}nv-fieldslider .slider-container .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldslider .slider-container .input-container:focus-within,nv-fieldslider .slider-container .input-container:focus-within:hover,nv-fieldslider .slider-container .input-container:focus,nv-fieldslider .slider-container .input-container:focus:hover{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fieldslider .slider-container .input-container:has(input:read-only){opacity:0.5;background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fieldslider .slider-container .input-container:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldslider .slider-container .input-container input{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);padding:var(--form-field-padding-y) var(--form-field-padding-x);font-size:var(--form-field-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--form-field-line-height);width:100%;}nv-fieldslider .slider-container .input-container input:focus{outline:none}nv-fieldslider .slider-container .input-container input::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:var(--font-weight-low-emphasis);line-height:var(--form-field-line-height)}nv-fieldslider .slider-container .input-container input[type=password]::-ms-clear,nv-fieldslider .slider-container .input-container input[type=password]::-ms-reveal{display:none;width:0;height:0}nv-fieldslider .slider-container .input-container .label-before{margin-left:var(--spacing-2);color:var(--components-form-field-icon-default)}nv-fieldslider .slider-container .input-container .label-after{margin-right:var(--spacing-2);color:var(--components-form-field-icon-default)}nv-fieldslider[fluid]:not([fluid=false]){max-width:unset}nv-fieldslider[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive-in-field)}nv-fieldslider[success]:not([success=false]){--nv-field-border-default:var(--components-form-field-border-success);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-success)}nv-fieldslider[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fieldslider[readonly]:not([readonly=false]) .track,nv-fieldslider[readonly]:not([readonly=false]) .thumb{cursor:default}nv-fieldslider label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--form-label-line-height)}nv-fieldslider nv-icon.validation{color:var(--nv-field-border-default)}nv-fieldslider[hide-label]:not([hide-label=false]) label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}nv-fieldslider[has-field]:not([has-field=false]) .thumb-tooltip{display:none}nv-fieldslider>.description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fieldslider>.error-description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}nv-fieldslider>.error-description[hidden]{display:none}';const g=k;const y=class{constructor(e){i(this,e);this.valueChanged=t(this,"valueChanged",7);this.startInputId=s();this.endInputId=s();this.hideLabel=false;this.hasField=false;this.range=false;this.disabled=false;this.readonly=false;this.error=false;this.success=false;this.value=[0];this.step=1;this.snap=false;this.snapTicks=false;this.min=0;this.max=100;this.showTicks=false;this.fluid=false;this.isDragging=false;this.activeDragThumb="single";this.internalTicks=[];this.rawPosition=0;this.rawRangePosition=[0,0];this.valueInternal=0;this.rangeValueInternal=[0,0];this.parseValue=()=>{if(typeof this.value==="string"){console.error("Sliders require a number or array of numbers to be passed in the value prop.");return}if(this.range&&this.value.length!==2){console.error("Range sliders require an array of two values to be passed in the value prop.");return}if(!this.range&&this.value.length!==1){console.error("Single sliders require a single value as an array to be passed in the value prop.");return}this.valueInternal=this.value[0];this.rangeValueInternal=[this.value[0],this.value[1]]};this.onTrackInteraction=e=>{if(this.disabled||this.readonly){return}const i=e.currentTarget.getBoundingClientRect();const t=l((e.clientX-i.left)/i.width*100,0,100);const r=this.min+t/100*(this.max-this.min);this.rawPosition=r;if(this.range){const e=d(this.rangeValueInternal[0],this.min,this.max);const i=d(this.rangeValueInternal[1],this.min,this.max);const n=Math.abs(t-e);const a=Math.abs(t-i);if(n<=a){this.activeDragThumb="left";this.rawRangePosition=[r,this.rawRangePosition[1]];this.handleValueChange([r,this.rangeValueInternal[1]])}else{this.activeDragThumb="right";this.rawRangePosition=[this.rawRangePosition[0],r];this.handleValueChange([this.rangeValueInternal[0],r])}}else{this.activeDragThumb="single";this.rawPosition=r;this.handleValueChange(r)}this.isDragging=true;this.registerGlobalEvents()};this.onPointerMove=e=>{if(!this.isDragging||this.disabled||this.readonly){return}const i=this.el.querySelector(".track");if(!i)return;const t=i.getBoundingClientRect();const r=l((e.clientX-t.left)/t.width*100,0,100);const n=this.min+r/100*(this.max-this.min);if(this.range){if(this.activeDragThumb==="left"){this.rawRangePosition=[n,this.rawRangePosition[1]];this.handleValueChange([n,this.rangeValueInternal[1]])}else{this.rawRangePosition=[this.rawRangePosition[0],n];this.handleValueChange([this.rangeValueInternal[0],n])}}else{this.rawPosition=n;this.handleValueChange(n)}};this.onPointerUp=()=>{this.isDragging=false;this.removeGlobalEvents()};this.onKeyDown=e=>{if(this.disabled||this.readonly){return}let i;const t=e.shiftKey?10:1;const r=this.step*t;if(this.range){const t=e.target.getAttribute("data-thumb");const n=t==="left"?0:1;const a=[...this.rangeValueInternal];switch(e.key){case"ArrowRight":case"ArrowUp":a[n]+=r;break;case"ArrowLeft":case"ArrowDown":a[n]-=r;break;case"Home":a[n]=this.min;break;case"End":a[n]=this.max;break;case"PageUp":a[n]+=r*10;break;case"PageDown":a[n]-=r*10;break;default:return}i=a}else{switch(e.key){case"ArrowRight":case"ArrowUp":i=this.valueInternal+r;break;case"ArrowLeft":case"ArrowDown":i=this.valueInternal-r;break;case"Home":i=this.min;break;case"End":i=this.max;break;case"PageUp":i=this.valueInternal+r*10;break;case"PageDown":i=this.valueInternal-r*10;break;default:return}}e.preventDefault();this.handleValueChange(i)};this.handleFieldChange=e=>{const i=e.value;if(isNaN(i)){return}if(this.range){const t=e.index===0?0:1;const r=[...this.rangeValueInternal];r[t]=i;this.handleValueChange(r)}else{this.handleValueChange(i)}}}validateValue(e){const i=l(e,this.min,this.max);if(this.snapTicks&&this.internalTicks&&this.internalTicks.length>0){return h(i,this.internalTicks)}return c(i,this.min,this.max,this.step)}handleValueChange(e){if(this.disabled||this.readonly){return}if(this.range){if(Array.isArray(e)&&e.length===2){const i=[Math.min(e[0],e[1]),Math.max(e[0],e[1])];const t=[this.validateValue(i[0]),this.validateValue(i[1])];if(t[0]!==this.rangeValueInternal[0]||t[1]!==this.rangeValueInternal[1]){this.rangeValueInternal=t;this.value=this.rangeValueInternal;this.valueChanged.emit(this.rangeValueInternal)}}}else{if(typeof e==="number"){const i=this.validateValue(e);if(i!==this.valueInternal){this.valueInternal=i;this.value=[this.valueInternal];this.valueChanged.emit([this.valueInternal])}}}}generateDisplayTicks(){if(this.ticks&&this.ticks.length>0){this.internalTicks=[...this.ticks].sort(((e,i)=>e.value-i.value));return}if(!this.showTicks){this.internalTicks=[];return}const e=f(this.min,this.max,this.step);this.internalTicks=e.map((e=>({value:e})))}registerGlobalEvents(){document.addEventListener("pointermove",this.onPointerMove);document.addEventListener("pointerup",this.onPointerUp);document.addEventListener("pointercancel",this.onPointerUp)}removeGlobalEvents(){document.removeEventListener("pointermove",this.onPointerMove);document.removeEventListener("pointerup",this.onPointerUp);document.removeEventListener("pointercancel",this.onPointerUp)}onValueChange(){this.parseValue()}onConfigChange(){this.generateDisplayTicks();if(this.range){this.handleValueChange(this.rangeValueInternal)}else{this.handleValueChange(this.valueInternal)}}onRangeChange(e){if(e){this.rangeValueInternal=[this.min,this.valueInternal]}else{this.valueInternal=this.rangeValueInternal[1]}}connectedCallback(){this.parseValue();this.generateDisplayTicks();if(this.range){if(!Array.isArray(this.rangeValueInternal)||this.rangeValueInternal.length!==2){this.rangeValueInternal=[this.min,this.max]}this.handleValueChange(this.rangeValueInternal);this.rawRangePosition=[this.rangeValueInternal[0],this.rangeValueInternal[1]]}else{this.handleValueChange(this.valueInternal);this.rawPosition=this.valueInternal}}componentWillLoad(){if(this.value.length===1&&this.range){this.value=[this.value[0],this.value[0]]}else if(this.value.length===2&&!this.range){this.value=[this.value[0]]}}disconnectedCallback(){this.removeGlobalEvents()}render(){return e(r,{key:"e4d4719682957f858468c3df97c82d5be29e87b8"},(this.label||this.el.querySelector('[slot="label"]'))&&e("label",{key:"a6d84550e4b91a4f23252e31ebbd3680b5a81aad",htmlFor:this.startInputId},e("slot",{key:"44ce936f4b50ae5be5c3b8769b990fda82ff9b27",name:"label"},this.label)),e("div",{key:"578a9673356506f87d906ff34254f93c0f724ebb",class:"slider-container"},this.range?e(m,{range:this.range,hasField:this.hasField,value:this.valueInternal,rangeValue:this.rangeValueInternal,index:0,inputId:this.startInputId,min:this.min,max:this.max,step:this.step,disabled:this.disabled,readonly:this.readonly,onInput:this.handleFieldChange,labelBeforeValue:this.labelBeforeValue,labelAfterValue:this.labelAfterValue,name:this.name,endName:this.endName}):null,e("div",{key:"1dd30a5e703309993e8d61dc44bf1ad0adbc11e0",class:"track-container"},e("div",{key:"870f688ec85678ac490cfc1542cc8d1802a43ec7",class:"track",onPointerDown:this.onTrackInteraction},this.range?e(b,{rangeValue:this.rangeValueInternal,rawRangePosition:this.rawRangePosition,activeDragThumb:this.activeDragThumb,isDragging:this.isDragging,snap:this.snap,min:this.min,max:this.max,step:this.step,disabled:this.disabled,readonly:this.readonly,onKeyDown:this.onKeyDown,labelBeforeValue:this.labelBeforeValue,labelAfterValue:this.labelAfterValue}):e(v,{value:this.valueInternal,min:this.min,max:this.max,step:this.step,rawPosition:this.rawPosition,isDragging:this.isDragging,snap:this.snap,disabled:this.disabled,readonly:this.readonly,onKeyDown:this.onKeyDown,labelBeforeValue:this.labelBeforeValue,labelAfterValue:this.labelAfterValue})),e(p,{key:"75fb4d22e84ea569928e475e35d0031130f6c6ed",ticks:this.internalTicks,min:this.min,max:this.max})),this.range?e(m,{range:this.range,hasField:this.hasField,value:this.valueInternal,rangeValue:this.rangeValueInternal,index:1,inputId:this.endInputId,min:this.min,max:this.max,step:this.step,disabled:this.disabled,readonly:this.readonly,onInput:this.handleFieldChange,labelBeforeValue:this.labelBeforeValue,labelAfterValue:this.labelAfterValue,name:this.name,endName:this.endName}):e(m,{range:this.range,hasField:this.hasField,value:this.valueInternal,rangeValue:this.rangeValueInternal,inputId:this.startInputId,min:this.min,max:this.max,step:this.step,disabled:this.disabled,readonly:this.readonly,onInput:this.handleFieldChange,labelBeforeValue:this.labelBeforeValue,labelAfterValue:this.labelAfterValue,name:this.name})),(this.success||this.description||this.el.querySelector('[slot="description"]'))&&e("div",{key:"b88410b4d04254b66c146b39dc4215f92c42b9b8",class:"description"},this.success&&e("nv-icon",{key:"4b3886cd627e8243d899399c60b85c47ce823170",name:"circle-check",class:"validation",size:"md"}),e("slot",{key:"b262880c747c3f6d1e51b1d4214761d7aecc9f9c",name:"description"},this.description)),(this.error||this.errorDescription||this.el.querySelector('[slot="error-description"]'))&&e("div",{key:"ad5d61a003680c4ff53217bf594dcb4e5fa1b053",class:"error-description",hidden:!this.error},this.error&&e("nv-icon",{key:"3898c1781b38497b3bd797587980ed9fd32c8afc",name:"alert-circle",class:"validation",size:"md"}),e("slot",{key:"7fa0cf391cdb113eba7dbcd76a66044fc4d60281",name:"error-description"},this.errorDescription)))}static get formAssociated(){return true}get el(){return n(this)}static get watchers(){return{value:["onValueChange"],min:["onConfigChange"],max:["onConfigChange"],step:["onConfigChange"],ticks:["onConfigChange"],showTicks:["onConfigChange"],snap:["onConfigChange"],snapTicks:["onConfigChange"],range:["onRangeChange"]}}};y.style=g;export{y as nv_fieldslider};
|
|
2
|
-
//# sourceMappingURL=p-b626ef47.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getDecimalPlaces","num","Number","isInteger","str","toString","decimalPart","split","length","clamp","value","min","max","Math","valueToPercent","snapToStep","step","clamped","decimalPlaces","multiplier","pow","scaledValue","round","scaledStep","roundedSteps","scaledSnapped","snapped","parseFloat","toFixed","stepsFromMin","generateTicks","ticks","v","push","snapToTicks","closestTick","minDistance","abs","tick","distance","formatValueForDisplay","String","SingleThumb","props","rawPosition","isDragging","snap","disabled","readonly","onKeyDown","labelBeforeValue","labelAfterValue","displayPosition","percent","h","class","style","left","role","undefined","tabindex","RangeThumb","rangeValue","rawRangePosition","activeDragThumb","leftValue","rightValue","displayLeftPosition","displayRightPosition","rawLeft","rawRight","leftPercent","rightPercent","width","TickMarks","map","label","FieldInput","range","hasField","index","inputId","onInput","name","endName","fieldValue","dataAttrs","inputName","handleValueChanged","event","stopPropagation","newValue","detail","isNaN","clsx","Object","assign","id","e","onValueChanged","slot","type","nvFieldsliderCss","NvFieldsliderStyle0","NvFieldslider","constructor","hostRef","this","startInputId","uuidv4","endInputId","hideLabel","error","success","snapTicks","showTicks","fluid","internalTicks","valueInternal","rangeValueInternal","parseValue","console","onTrackInteraction","trackRect","currentTarget","getBoundingClientRect","percentage","clientX","leftPct","rightPct","distanceToLeft","distanceToRight","handleValueChange","registerGlobalEvents","onPointerMove","trackElement","el","querySelector","onPointerUp","removeGlobalEvents","stepMultiplier","shiftKey","singleStep","focusedThumb","target","getAttribute","idx","currentValue","key","preventDefault","handleFieldChange","details","fieldIndex","updatedRange","validateValue","val","clampedValue","Array","isArray","orderedValues","validatedValues","valueChanged","emit","validatedValue","generateDisplayTicks","sort","a","b","autoTicks","document","addEventListener","removeEventListener","onValueChange","onConfigChange","onRangeChange","connectedCallback","componentWillLoad","disconnectedCallback","render","Host","htmlFor","onPointerDown","description","size","errorDescription","hidden"],"sources":["src/components/nv-fieldslider/nv-fieldslider.utils.ts","src/components/nv-fieldslider/partials/single-thumb.tsx","src/components/nv-fieldslider/partials/range-thumb.tsx","src/components/nv-fieldslider/partials/tick-marks.tsx","src/components/nv-fieldslider/partials/field-input.tsx","src/components/nv-fieldslider/styles/nv-fieldslider.scss?tag=nv-fieldslider","src/components/nv-fieldslider/nv-fieldslider.tsx"],"sourcesContent":["/**\n * Utility functions for nv-fieldslider.\n */\n\n/**\n * Gets the number of decimal places in a number.\n * @param {number} num - The number to check\n * @returns {number} The number of decimal places\n */\nexport function getDecimalPlaces(num: number): number {\n if (Number.isInteger(num)) return 0;\n const str = num.toString();\n const decimalPart = str.split('.')[1];\n return decimalPart ? decimalPart.length : 0;\n}\n\n/**\n * Clamp a value between min and max.\n * @param {number} value - The value to clamp\n * @param {number} min - The minimum boundary\n * @param {number} max - The maximum boundary\n * @returns {number} The clamped value\n */\nexport function clamp(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, value));\n}\n\n/**\n * Calculate the percentage position of a value within a range.\n * @param {number} value - The value to convert to percentage\n * @param {number} min - The minimum value of the range\n * @param {number} max - The maximum value of the range\n * @returns {number} The percentage (0-100)\n */\nexport function valueToPercent(\n value: number,\n min: number,\n max: number,\n): number {\n if (max === min) return 0;\n return ((value - min) / (max - min)) * 100;\n}\n\n/**\n * Snap a value to the nearest step.\n * @param {number} value - The value to snap\n * @param {number} min - The minimum boundary\n * @param {number} max - The maximum boundary\n * @param {number} step - The step size\n * @returns {number} The snapped value\n */\nexport function snapToStep(\n value: number,\n min: number,\n max: number,\n step: number,\n): number {\n const clamped = clamp(value, min, max);\n const decimalPlaces = getDecimalPlaces(step);\n\n // To avoid floating point issues in calculations, we can work with integers\n // by multiplying all values by a power of 10 based on decimal places\n if (decimalPlaces > 0) {\n const multiplier = Math.pow(10, decimalPlaces);\n\n // Convert to integer-based calculation\n const scaledValue = Math.round((clamped - min) * multiplier);\n const scaledStep = Math.round(step * multiplier);\n\n // Round to nearest step using integer math\n const roundedSteps = Math.round(scaledValue / scaledStep);\n\n // Calculate snapped value and scale back down\n const scaledSnapped = roundedSteps * scaledStep;\n const snapped = min + scaledSnapped / multiplier;\n\n // Format to correct decimal places to ensure precision\n return clamp(parseFloat(snapped.toFixed(decimalPlaces)), min, max);\n }\n\n // For integer steps, use the original method\n const stepsFromMin = (clamped - min) / step;\n const roundedSteps = Math.round(stepsFromMin);\n const snapped = min + roundedSteps * step;\n\n return clamp(snapped, min, max);\n}\n\n/**\n * Generate tick values for the slider.\n * @param {number} min - The minimum value\n * @param {number} max - The maximum value\n * @param {number} step - The step size\n * @returns {number[]} Array of tick values\n */\nexport function generateTicks(\n min: number,\n max: number,\n step: number,\n): number[] {\n const ticks: number[] = [];\n for (let v = min; v <= max; v += step) {\n ticks.push(Number(v.toFixed(10))); // avoid floating point issues\n }\n if (ticks[ticks.length - 1] !== max) {\n ticks.push(max);\n }\n return ticks;\n}\n\n/**\n * Snap a value to the nearest tick mark.\n * @param {number} value - The value to snap\n * @param {object[]} ticks - Array of tick objects\n * @returns {number} The value of the closest tick\n */\nexport function snapToTicks(\n value: number,\n ticks: {\n /** The value of the tick */\n value: number;\n }[],\n) {\n if (!ticks || ticks.length === 0) return value;\n\n // Find the closest tick\n let closestTick = ticks[0].value;\n let minDistance = Math.abs(value - closestTick);\n\n for (const tick of ticks) {\n const distance = Math.abs(value - tick.value);\n if (distance < minDistance) {\n minDistance = distance;\n closestTick = tick.value;\n }\n }\n\n return closestTick;\n}\n\n/**\n * Format a numeric value for display, preserving trailing zeros based on step precision\n * @param {number} value - The value to format\n * @param {number} step - The step size that determines decimal precision\n * @returns {string} Formatted value string with appropriate decimal places\n */\nexport function formatValueForDisplay(value: number, step: number): string {\n const decimalPlaces = getDecimalPlaces(step);\n if (decimalPlaces > 0) {\n return value.toFixed(decimalPlaces);\n }\n return String(value);\n}\n","import { FunctionalComponent, h } from '@stencil/core';\nimport {\n valueToPercent,\n clamp,\n formatValueForDisplay,\n} from '../nv-fieldslider.utils';\n\n/**\n * Props for the SingleThumb component\n */\ninterface SingleThumbProps {\n /** Current value of the slider */\n value: number;\n /** Minimum allowed value */\n min: number;\n /** Maximum allowed value */\n max: number;\n /** Step size of the slider */\n step: number;\n /** Raw position during dragging */\n rawPosition: number;\n /** Whether the thumb is currently being dragged */\n isDragging: boolean;\n /** Whether the thumb should visually snap to steps */\n snap: boolean;\n /** Whether the slider is disabled */\n disabled: boolean;\n /** Whether the slider is readonly */\n readonly: boolean;\n /** Key down event handler */\n onKeyDown: (event: KeyboardEvent) => void;\n /** Label to display before the value */\n labelBeforeValue?: string;\n /** Label to display after the value */\n labelAfterValue?: string;\n}\n\n/**\n * Renders single thumb in standard mode.\n * @param {SingleThumbProps} props - Component properties\n * @returns {JSX.Element} JSX element representing the thumb\n */\nexport const SingleThumb: FunctionalComponent<SingleThumbProps> = props => {\n const {\n value,\n min,\n max,\n step,\n rawPosition,\n isDragging,\n snap,\n disabled,\n readonly,\n onKeyDown,\n labelBeforeValue,\n labelAfterValue,\n } = props;\n\n // Use raw position for visual display during dragging, but the snapped value otherwise\n let displayPosition = value;\n if (isDragging && !snap) {\n displayPosition = clamp(rawPosition, min, max);\n }\n\n const percent = valueToPercent(displayPosition, min, max);\n\n return (\n <div\n class=\"thumb\"\n style={{ left: `${percent}%` }}\n role=\"slider\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={value}\n aria-disabled={disabled ? 'true' : undefined}\n aria-readonly={readonly ? 'true' : undefined}\n tabindex={disabled ? -1 : 0}\n onKeyDown={onKeyDown}\n >\n <div class=\"thumb-tooltip\">\n {labelBeforeValue && (\n <span class=\"label-before\">{labelBeforeValue}</span>\n )}\n {formatValueForDisplay(value, step)}\n {labelAfterValue && <span class=\"label-after\">{labelAfterValue}</span>}\n </div>\n </div>\n );\n};\n","import { FunctionalComponent, h } from '@stencil/core';\nimport {\n valueToPercent,\n clamp,\n formatValueForDisplay,\n} from '../nv-fieldslider.utils';\n\n/**\n * Props for the RangeThumb component\n */\ninterface RangeThumbProps {\n /** Range values [left, right] */\n rangeValue: number[];\n /** Raw positions during dragging [left, right] */\n rawRangePosition: [number, number];\n /** Currently active thumb while dragging */\n activeDragThumb: 'left' | 'right' | 'single';\n /** Whether the thumb is currently being dragged */\n isDragging: boolean;\n /** Whether the thumb should visually snap to steps */\n snap: boolean;\n /** Minimum allowed value */\n min: number;\n /** Maximum allowed value */\n max: number;\n /** Step size of the slider */\n step: number;\n /** Whether the slider is disabled */\n disabled: boolean;\n /** Whether the slider is readonly */\n readonly: boolean;\n /** Key down event handler */\n onKeyDown: (event: KeyboardEvent) => void;\n /** Label to display before the value */\n labelBeforeValue?: string;\n /** Label to display after the value */\n labelAfterValue?: string;\n}\n\n/**\n * Renders dual thumbs in range mode.\n * @param {RangeThumbProps} props - Component properties\n * @returns {JSX.Element[]} Array of JSX elements representing the range slider thumbs\n */\nexport const RangeThumb: FunctionalComponent<RangeThumbProps> = props => {\n const {\n rangeValue,\n rawRangePosition,\n activeDragThumb,\n isDragging,\n snap,\n min,\n max,\n step,\n disabled,\n readonly,\n onKeyDown,\n labelBeforeValue,\n labelAfterValue,\n } = props;\n\n const [leftValue, rightValue] = rangeValue;\n\n // Use raw positions for visual display during dragging, but the snapped values otherwise\n let displayLeftPosition = leftValue;\n let displayRightPosition = rightValue;\n\n if (isDragging && !snap) {\n const [rawLeft, rawRight] = rawRangePosition;\n if (activeDragThumb === 'left') {\n displayLeftPosition = clamp(rawLeft, min, Math.min(rightValue, max));\n } else if (activeDragThumb === 'right') {\n displayRightPosition = clamp(rawRight, Math.max(leftValue, min), max);\n }\n }\n\n const leftPercent = valueToPercent(displayLeftPosition, min, max);\n const rightPercent = valueToPercent(displayRightPosition, min, max);\n\n return [\n <div\n class=\"track-range\"\n style={{\n left: `${leftPercent}%`,\n width: `${rightPercent - leftPercent}%`,\n }}\n />,\n <div\n class=\"thumb thumb-left\"\n style={{ left: `${leftPercent}%` }}\n role=\"slider\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={leftValue} // Always use the snapped value for ARIA\n aria-disabled={disabled ? 'true' : undefined}\n aria-readonly={readonly ? 'true' : undefined}\n data-thumb=\"left\"\n tabindex={disabled ? -1 : 0}\n onKeyDown={onKeyDown}\n >\n <div class=\"thumb-tooltip\">\n {labelBeforeValue && (\n <span class=\"label-before\">{labelBeforeValue}</span>\n )}\n {formatValueForDisplay(leftValue, step)}\n {labelAfterValue && <span class=\"label-after\">{labelAfterValue}</span>}\n </div>\n </div>,\n <div\n class=\"thumb thumb-right\"\n style={{ left: `${rightPercent}%` }}\n role=\"slider\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={rightValue} // Always use the snapped value for ARIA\n aria-disabled={disabled ? 'true' : undefined}\n aria-readonly={readonly ? 'true' : undefined}\n data-thumb=\"right\"\n tabindex={disabled ? -1 : 0}\n onKeyDown={onKeyDown}\n >\n <div class=\"thumb-tooltip\">\n {labelBeforeValue && (\n <span class=\"label-before\">{labelBeforeValue}</span>\n )}\n {formatValueForDisplay(rightValue, step)}\n {labelAfterValue && <span class=\"label-after\">{labelAfterValue}</span>}\n </div>\n </div>,\n ];\n};\n","import { FunctionalComponent, h } from '@stencil/core';\nimport { valueToPercent } from '../nv-fieldslider.utils';\n\n/**\n * Represents a tick mark on the slider\n */\ninterface Tick {\n /** The numeric value of the tick */\n value: number;\n /** Optional label for the tick */\n label?: string;\n}\n\n/**\n * Props for the TickMarks component\n */\ninterface TickMarksProps {\n /** Array of tick definitions */\n ticks: Tick[];\n /** Minimum allowed value */\n min: number;\n /** Maximum allowed value */\n max: number;\n}\n\n/**\n * Renders tick marks along the slider track.\n * @param {TickMarksProps} props - Component properties\n * @returns {JSX.Element | null} JSX element representing the tick marks or null if no ticks\n */\nexport const TickMarks: FunctionalComponent<TickMarksProps> = props => {\n const { ticks, min, max } = props;\n\n if (ticks.length === 0) {\n return null;\n }\n\n return (\n <div class=\"track-ticks\">\n {ticks.map(tick => {\n const percent = valueToPercent(tick.value, min, max);\n return (\n <div class=\"track-tick\" style={{ left: `${percent}%` }}>\n {tick.label && <div class=\"tick-label\">{tick.label}</div>}\n </div>\n );\n })}\n </div>\n );\n};\n","import { FunctionalComponent, h } from '@stencil/core';\nimport clsx from 'clsx';\n\n/**\n * Props for the FieldInput component\n */\nexport interface FieldInputProps {\n /** Whether this is a range slider */\n range: boolean;\n /** Whether to show the input field */\n hasField: boolean;\n /** The value for single mode */\n value: number;\n /** The values for range mode [min, max] */\n rangeValue: number[];\n /** Index (0 or 1) for range mode, ignored in single mode */\n index?: number;\n /** ID for the input field */\n inputId: string;\n /** Minimum allowed value */\n min: number;\n /** Maximum allowed value */\n max: number;\n /** Step size */\n step: number;\n /** Whether the slider is disabled */\n disabled: boolean;\n /** Whether the slider is readonly */\n readonly: boolean;\n /** Handler for input changes */\n onInput: (details: {\n /** Parsed value */\n value: number;\n /** Index (0 or 1) for range mode, ignored in single mode */\n index?: number;\n }) => void;\n /** Label to display before the value */\n labelBeforeValue?: string;\n /** Label to display after the value */\n labelAfterValue?: string;\n /** Name attribute for the input field (for form submission) */\n name?: string;\n /** Name attribute for the end input field (when in range mode) */\n endName?: string;\n}\n\n/**\n * Renders field input for direct value entry\n * @param {FieldInputProps} props - Component properties\n * @returns {JSX.Element} JSX element representing the field input\n */\nexport const FieldInput: FunctionalComponent<FieldInputProps> = props => {\n const {\n range,\n hasField,\n value,\n rangeValue,\n index,\n inputId,\n min,\n max,\n step,\n disabled,\n readonly,\n onInput,\n labelBeforeValue,\n labelAfterValue,\n name,\n endName,\n } = props;\n\n // Determine the appropriate value based on mode and index\n const fieldValue = range ? rangeValue[index] : value;\n\n // In range mode, we need data-index for event handling\n const dataAttrs = range ? { 'data-index': index.toString() } : {};\n\n // Determine the appropriate name based on mode and index\n let inputName: string;\n if (range) {\n if (index === 0) {\n inputName = name || '';\n } else {\n // Use endName if provided, otherwise append \"-end\" to the name\n inputName = endName || (name ? `${name}-end` : '');\n }\n } else {\n inputName = name || '';\n }\n\n const handleValueChanged = (\n event: CustomEvent<HTMLNvFieldnumberElementEventMap['valueChanged']>,\n ): void => {\n event.stopPropagation();\n const newValue = event.detail;\n\n if (isNaN(newValue)) {\n return;\n }\n\n onInput({\n value: newValue,\n index,\n });\n };\n\n return hasField ? (\n <div class={clsx(!hasField && 'hidden-input')}>\n <nv-fieldnumber\n id={inputId}\n value={fieldValue}\n min={min}\n max={max}\n step={step}\n disabled={disabled}\n readonly={readonly}\n name={inputName}\n {...dataAttrs}\n onInput={e => e.stopPropagation()}\n onValueChanged={handleValueChanged}\n >\n {labelBeforeValue && (\n <span class=\"label-before\" slot=\"leading-input\">\n {labelBeforeValue}\n </span>\n )}\n {labelAfterValue && (\n <span class=\"label-after\" slot=\"trailing-input\">\n {labelAfterValue}\n </span>\n )}\n </nv-fieldnumber>\n </div>\n ) : (\n <input\n id={inputId}\n type=\"hidden\"\n value={fieldValue}\n disabled={disabled}\n readonly={readonly}\n name={inputName}\n />\n );\n};\n","@use \"./mixins\" as *;\n\nnv-fieldslider {\n @include form-field-variables();\n @include form-field-root();\n\n .slider-container {\n @include slider-container-styles();\n\n .track-container {\n @include track-container-styles();\n\n .track {\n @include track-styles();\n .track-range {\n @include track-range-styles();\n }\n .thumb {\n @include thumb-styles();\n .thumb-tooltip {\n @include thumb-tooltip-styles();\n }\n &:hover, &:active, &:focus {\n .thumb-tooltip {\n opacity: 1;\n }\n }\n }\n }\n\n .track-ticks {\n @include track-ticks-styles();\n .track-tick {\n @include track-tick-styles();\n .tick-label {\n @include tick-label-styles();\n }\n }\n }\n }\n\n .input-container {\n @include form-field-input-container();\n @include input-container-styles();\n input {\n @include form-field-input();\n }\n .label-before {\n @include input-label-before-styles();\n }\n .label-after {\n @include input-label-after-styles();\n }\n }\n }\n\n &[fluid]:not([fluid=\"false\"]) {\n @include form-field-fluid();\n }\n\n &[error]:not([error=\"false\"]) {\n @include form-field-error-variables();\n }\n\n &[success]:not([success=\"false\"]) {\n @include form-field-success-variables();\n }\n\n &[readonly]:not([readonly=\"false\"]) {\n @include form-field-readonly-variables();\n .track,\n .thumb {\n cursor: default;\n }\n }\n\n label {\n @include form-field-label();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n\n &[hide-label]:not([hide-label=\"false\"]) label {\n @include form-field-hide-label();\n }\n\n &[has-field]:not([has-field=\"false\"]) {\n .thumb-tooltip {\n display: none;\n }\n }\n\n > .description {\n @include form-field-description();\n }\n\n > .error-description {\n @include form-field-error-description();\n &[hidden] {\n display: none;\n }\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n State,\n Watch,\n Element,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport {\n clamp,\n valueToPercent,\n snapToStep,\n generateTicks,\n snapToTicks,\n} from './nv-fieldslider.utils';\n\nimport { SingleThumb } from './partials/single-thumb';\nimport { RangeThumb } from './partials/range-thumb';\nimport { TickMarks } from './partials/tick-marks';\nimport { FieldInput, type FieldInputProps } from './partials/field-input';\n\n/**\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fieldslider',\n styleUrl: 'styles/nv-fieldslider.scss',\n shadow: false,\n formAssociated: true,\n})\nexport class NvFieldslider {\n @Element() el: HTMLNvFieldsliderElement;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the start input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated.\n */\n @Prop({ reflect: true })\n readonly startInputId: string = uuidv4();\n\n /**\n * Sets the ID for the end input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated.\n */\n @Prop({ reflect: true })\n readonly endInputId: string = uuidv4();\n\n /**\n * Provides a textual description of the slider's function, helping users\n * understand what the control adjusts. It also supports accessibility by\n * serving as the accessible name for the component.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Keeps the interface clean by removing visible labels, but still announces\n * the label to screen readers so users relying on assistive tech aren't left\n * guessing.\n */\n @Prop({ reflect: true })\n readonly hideLabel: boolean = false;\n\n /**\n * Add helpful hints or extra information under the slider. This is where you\n * can clarify what users should enter or provide additional instructions,\n * making the form easier to fill out correctly.\n */\n @Prop({ reflect: true })\n readonly description: string;\n\n /**\n * Enables an optional numeric input field alongside the slider, allowing\n * users to type a value directly instead of—or in addition to—using the\n * slider handle. The field accepts numeric values in the format based on\n * client-side local settings.\n */\n @Prop({ reflect: true })\n readonly hasField: boolean = false;\n\n /**\n * Allows the slider to display two thumbs, enabling users to select a\n * continuous range between a minimum and maximum value. Ideal for use cases\n * like filtering by price or time.\n */\n @Prop({ reflect: true })\n readonly range: boolean = false;\n\n /**\n * Disables user interaction with the slider and its associated input fields.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Makes the slider and input non-editable while keeping them focusable and\n * included in form submissions.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Alters the slider's appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true })\n readonly error: boolean = false;\n\n /**\n * A description that appears when there is an error related to the slider.\n * @validator message\n */\n @Prop({ reflect: true })\n readonly errorDescription: string;\n\n /**\n * Changes the slider's appearance to indicate successful input or validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * Numeric value of the slider as an array of numbers. When in single mode,\n * the value should be a an array of one number. When in range mode, the value\n * should be an array of two numbers.\n */\n @Prop({ reflect: true, mutable: true })\n value: number[] = [0];\n\n /**\n * Defines the interval between selectable values on the slider. Controls how\n * much the value increases or decreases with each keyboard interaction, drag\n * movement, or direct input.\n */\n @Prop({ reflect: true })\n readonly step: number = 1;\n\n /**\n * Controls whether the slider handle should visually snap to step values\n * during dragging. When false, the handle can be positioned at any point\n * along the track while dragging, but the actual value will still snap to the\n * nearest step value. When true, the handle will visually snap to the nearest\n * step value during dragging.\n */\n @Prop({ reflect: true })\n readonly snap: boolean = false;\n\n /**\n * When true and custom ticks are provided, the slider will snap to the nearest\n * tick value during dragging, instead of using the step value. This is useful\n * when you have custom ticks at specific values that don't align with regular step intervals.\n */\n @Prop({ reflect: true })\n readonly snapTicks: boolean = false;\n\n /**\n * Name attribute for the form input element. Required for form submission.\n * For range sliders, this will be used for the start value input and add -end\n * to the end input name.\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * Name attribute for the end value input when using range mode.\n * If not provided, the name attribute will be used with '-end' appended.\n */\n @Prop({ reflect: true })\n readonly endName: string;\n\n /**\n * Defines the minimum allowed value for the slider. The thumb cannot move\n * below this value, and manual input is also constrained accordingly.\n */\n @Prop({ reflect: true })\n readonly min: number = 0;\n\n /**\n * Defines the maximum allowed value for the slider. The thumb cannot move\n * above this value, and manual input is also constrained accordingly.\n */\n @Prop({ reflect: true })\n readonly max: number = 100;\n\n /**\n * Controls the visibility of tick marks on the slider. When enabled, all\n * visual ticks that indicate step points along the track are shown. If custom\n * ticks are provided, they are always shown regardless of this setting.\n */\n @Prop({ reflect: true })\n readonly showTicks: boolean = false;\n\n /**\n * Allows you to specify custom tick marks at specific values along the\n * slider. Each tick can optionally display a label to provide additional\n * context or guidance for users.\n */\n @Prop({ reflect: false })\n readonly ticks: {\n /** The numeric value of the tick */\n value: number;\n /** The label of the tick */\n label?: string;\n }[];\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n /**\n * Use this to automatically show a label, like \"~\" for approximate values,\n * before the slider's value in the tooltip or input, giving users quick\n * context about the number.\n */\n @Prop({ reflect: true })\n readonly labelBeforeValue: string;\n\n /**\n * Use this to automatically show a label, like \"$\" or \"kg,\" after the value\n * on the slider's tooltip or input, helping users better understand the\n * number.\n */\n @Prop({ reflect: true })\n readonly labelAfterValue: string;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region STATE\n\n @State()\n isDragging = false;\n\n @State()\n activeDragThumb: 'left' | 'right' | 'single' = 'single';\n\n @State()\n internalTicks: typeof this.ticks = [];\n\n // These track the raw slider positions for visual display\n @State()\n rawPosition = 0;\n\n @State()\n rawRangePosition: [number, number] = [0, 0];\n\n @State()\n valueInternal: number = 0;\n\n @State()\n rangeValueInternal: [number, number] = [0, 0];\n\n //#endregion STATE\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Ensures value is valid and within bounds.\n * @param {number} val - The value to validate\n * @returns {number} The validated and snapped value\n */\n private validateValue(val: number): number {\n // First ensure the value is within bounds\n const clampedValue = clamp(val, this.min, this.max);\n\n // If snapTicks is true and we have custom ticks, snap to the nearest tick\n if (this.snapTicks && this.internalTicks && this.internalTicks.length > 0) {\n return snapToTicks(clampedValue, this.internalTicks);\n }\n\n // Otherwise snap to step values\n return snapToStep(clampedValue, this.min, this.max, this.step);\n }\n\n /**\n * Parses the value string into a number or array of numbers for internal use.\n */\n private parseValue = (): void => {\n if (typeof this.value === 'string') {\n console.error(\n 'Sliders require a number or array of numbers to be passed in the value prop.',\n );\n return;\n }\n if (this.range && this.value.length !== 2) {\n console.error(\n 'Range sliders require an array of two values to be passed in the value prop.',\n );\n return;\n }\n\n if (!this.range && this.value.length !== 1) {\n console.error(\n 'Single sliders require a single value as an array to be passed in the value prop.',\n );\n return;\n }\n this.valueInternal = this.value[0];\n this.rangeValueInternal = [this.value[0], this.value[1]];\n };\n\n /**\n * Handles value changes from slider interaction.\n * @param {number | number[]} newValue - The new value or range values\n */\n private handleValueChange(newValue: number | number[]): void {\n if (this.disabled || this.readonly) {\n return;\n }\n\n if (this.range) {\n // Handle range values\n if (Array.isArray(newValue) && newValue.length === 2) {\n // Ensure values are in order (left ≤ right)\n const orderedValues = [\n Math.min(newValue[0], newValue[1]),\n Math.max(newValue[0], newValue[1]),\n ];\n\n // Snap to steps and clamp\n const validatedValues: [number, number] = [\n this.validateValue(orderedValues[0]),\n this.validateValue(orderedValues[1]),\n ];\n\n if (\n validatedValues[0] !== this.rangeValueInternal[0] ||\n validatedValues[1] !== this.rangeValueInternal[1]\n ) {\n this.rangeValueInternal = validatedValues;\n this.value = this.rangeValueInternal;\n this.valueChanged.emit(this.rangeValueInternal);\n }\n }\n } else {\n // Handle single value\n if (typeof newValue === 'number') {\n const validatedValue = this.validateValue(newValue);\n\n if (validatedValue !== this.valueInternal) {\n this.valueInternal = validatedValue;\n this.value = [this.valueInternal];\n this.valueChanged.emit([this.valueInternal]);\n }\n }\n }\n }\n\n /**\n * Generates the ticks to display based on props and state.\n */\n private generateDisplayTicks(): void {\n // If custom ticks are provided, always use them regardless of showTicks setting\n if (this.ticks && this.ticks.length > 0) {\n this.internalTicks = [...this.ticks].sort((a, b) => a.value - b.value);\n return;\n }\n\n // If showTicks is false and there are no custom ticks, hide all ticks\n if (!this.showTicks) {\n this.internalTicks = [];\n return;\n }\n\n // Generate all ticks at each step point\n const autoTicks = generateTicks(this.min, this.max, this.step);\n this.internalTicks = autoTicks.map(value => ({ value }));\n }\n\n /**\n * Handles pointer events on the track.\n * @param {PointerEvent} event - The pointer event\n */\n private onTrackInteraction = (event: PointerEvent): void => {\n if (this.disabled || this.readonly) {\n return;\n }\n\n const trackRect = (\n event.currentTarget as HTMLElement\n ).getBoundingClientRect();\n const percentage = clamp(\n ((event.clientX - trackRect.left) / trackRect.width) * 100,\n 0,\n 100,\n );\n\n const newValue = this.min + (percentage / 100) * (this.max - this.min);\n\n // Store raw position for visual display\n this.rawPosition = newValue;\n\n if (this.range) {\n // In range mode, determine which thumb to move based on proximity\n const leftPct = valueToPercent(\n this.rangeValueInternal[0],\n this.min,\n this.max,\n );\n const rightPct = valueToPercent(\n this.rangeValueInternal[1],\n this.min,\n this.max,\n );\n\n const distanceToLeft = Math.abs(percentage - leftPct);\n const distanceToRight = Math.abs(percentage - rightPct);\n\n if (distanceToLeft <= distanceToRight) {\n this.activeDragThumb = 'left';\n this.rawRangePosition = [newValue, this.rawRangePosition[1]];\n this.handleValueChange([newValue, this.rangeValueInternal[1]]);\n } else {\n this.activeDragThumb = 'right';\n this.rawRangePosition = [this.rawRangePosition[0], newValue];\n this.handleValueChange([this.rangeValueInternal[0], newValue]);\n }\n } else {\n this.activeDragThumb = 'single';\n this.rawPosition = newValue;\n this.handleValueChange(newValue);\n }\n\n this.isDragging = true;\n this.registerGlobalEvents();\n };\n\n /**\n * Handles pointer move events during drag.\n * @param {PointerEvent} event - The pointer event\n */\n private onPointerMove = (event: PointerEvent): void => {\n if (!this.isDragging || this.disabled || this.readonly) {\n return;\n }\n\n const trackElement = this.el.querySelector('.track') as HTMLElement;\n if (!trackElement) return;\n\n const trackRect = trackElement.getBoundingClientRect();\n const percentage = clamp(\n ((event.clientX - trackRect.left) / trackRect.width) * 100,\n 0,\n 100,\n );\n\n const newValue = this.min + (percentage / 100) * (this.max - this.min);\n\n // Update visual position\n if (this.range) {\n if (this.activeDragThumb === 'left') {\n this.rawRangePosition = [newValue, this.rawRangePosition[1]];\n this.handleValueChange([newValue, this.rangeValueInternal[1]]);\n } else {\n this.rawRangePosition = [this.rawRangePosition[0], newValue];\n this.handleValueChange([this.rangeValueInternal[0], newValue]);\n }\n } else {\n this.rawPosition = newValue;\n this.handleValueChange(newValue);\n }\n };\n\n /**\n * Handles the end of a drag operation.\n */\n private onPointerUp = (): void => {\n this.isDragging = false;\n this.removeGlobalEvents();\n };\n\n /**\n * Registers global events for tracking pointer movement.\n */\n private registerGlobalEvents(): void {\n document.addEventListener('pointermove', this.onPointerMove);\n document.addEventListener('pointerup', this.onPointerUp);\n document.addEventListener('pointercancel', this.onPointerUp);\n }\n\n /**\n * Removes global events when tracking ends.\n */\n private removeGlobalEvents(): void {\n document.removeEventListener('pointermove', this.onPointerMove);\n document.removeEventListener('pointerup', this.onPointerUp);\n document.removeEventListener('pointercancel', this.onPointerUp);\n }\n\n /**\n * Handles keydown events for keyboard accessibility.\n * @param {KeyboardEvent} event - The keyboard event\n */\n private onKeyDown = (event: KeyboardEvent): void => {\n if (this.disabled || this.readonly) {\n return;\n }\n\n let newValue: number | number[];\n const stepMultiplier = event.shiftKey ? 10 : 1;\n const singleStep = this.step * stepMultiplier;\n\n if (this.range) {\n const focusedThumb = (event.target as HTMLElement).getAttribute(\n 'data-thumb',\n );\n const idx = focusedThumb === 'left' ? 0 : 1;\n const currentValue = [...this.rangeValueInternal];\n\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowUp':\n currentValue[idx] += singleStep;\n break;\n case 'ArrowLeft':\n case 'ArrowDown':\n currentValue[idx] -= singleStep;\n break;\n case 'Home':\n currentValue[idx] = this.min;\n break;\n case 'End':\n currentValue[idx] = this.max;\n break;\n case 'PageUp':\n currentValue[idx] += singleStep * 10;\n break;\n case 'PageDown':\n currentValue[idx] -= singleStep * 10;\n break;\n default:\n return;\n }\n\n newValue = currentValue;\n } else {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowUp':\n newValue = this.valueInternal + singleStep;\n break;\n case 'ArrowLeft':\n case 'ArrowDown':\n newValue = this.valueInternal - singleStep;\n break;\n case 'Home':\n newValue = this.min;\n break;\n case 'End':\n newValue = this.max;\n break;\n case 'PageUp':\n newValue = this.valueInternal + singleStep * 10;\n break;\n case 'PageDown':\n newValue = this.valueInternal - singleStep * 10;\n break;\n default:\n return;\n }\n }\n\n event.preventDefault();\n this.handleValueChange(newValue);\n };\n\n /**\n * Handles field input value changes.\n * @param {FieldInputProps['onInput']} details - The parsed value and index\n */\n private handleFieldChange: FieldInputProps['onInput'] = (details): void => {\n const newValue = details.value;\n\n if (isNaN(newValue)) {\n return;\n }\n\n if (this.range) {\n const fieldIndex = details.index === 0 ? 0 : 1;\n const updatedRange = [...this.rangeValueInternal];\n updatedRange[fieldIndex] = newValue;\n this.handleValueChange(updatedRange);\n } else {\n this.handleValueChange(newValue);\n }\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('value')\n onValueChange() {\n this.parseValue();\n }\n\n @Watch('min')\n @Watch('max')\n @Watch('step')\n @Watch('ticks')\n @Watch('showTicks')\n @Watch('snap')\n @Watch('snapTicks')\n onConfigChange() {\n this.generateDisplayTicks();\n\n if (this.range) {\n this.handleValueChange(this.rangeValueInternal);\n } else {\n this.handleValueChange(this.valueInternal);\n }\n }\n\n @Watch('range')\n onRangeChange(newValue: boolean) {\n if (newValue) {\n // Switching to range mode\n this.rangeValueInternal = [this.min, this.valueInternal];\n } else {\n // Switching to single mode, take the higher value\n this.valueInternal = this.rangeValueInternal[1];\n }\n }\n //#endregion WATCHERS\n /****************************************************************************/\n //#region LIFECYCLE\n connectedCallback() {\n this.parseValue();\n this.generateDisplayTicks();\n\n // Initialize values and make sure they're valid\n if (this.range) {\n if (\n !Array.isArray(this.rangeValueInternal) ||\n this.rangeValueInternal.length !== 2\n ) {\n this.rangeValueInternal = [this.min, this.max];\n }\n this.handleValueChange(this.rangeValueInternal);\n // Initialize raw range position to match actual values\n this.rawRangePosition = [\n this.rangeValueInternal[0],\n this.rangeValueInternal[1],\n ];\n } else {\n this.handleValueChange(this.valueInternal);\n // Initialize raw position to match actual value\n this.rawPosition = this.valueInternal;\n }\n }\n\n componentWillLoad() {\n // Initialize value array based on range mode when props are available\n if (this.value.length === 1 && this.range) {\n // If range mode but only one value provided, duplicate it\n this.value = [this.value[0], this.value[0]];\n } else if (this.value.length === 2 && !this.range) {\n // If single mode but two values provided, take the first\n this.value = [this.value[0]];\n }\n }\n\n disconnectedCallback() {\n this.removeGlobalEvents();\n }\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the slider values change.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<number[]>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host>\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.startInputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <div class=\"slider-container\">\n {/* First input (always render for the start value, but may be hidden) */}\n {this.range ? (\n <FieldInput\n range={this.range}\n hasField={this.hasField}\n value={this.valueInternal}\n rangeValue={this.rangeValueInternal}\n index={0}\n inputId={this.startInputId}\n min={this.min}\n max={this.max}\n step={this.step}\n disabled={this.disabled}\n readonly={this.readonly}\n onInput={this.handleFieldChange}\n labelBeforeValue={this.labelBeforeValue}\n labelAfterValue={this.labelAfterValue}\n name={this.name}\n endName={this.endName}\n />\n ) : null}\n\n <div class=\"track-container\">\n <div class=\"track\" onPointerDown={this.onTrackInteraction}>\n {this.range ? (\n <RangeThumb\n rangeValue={this.rangeValueInternal}\n rawRangePosition={this.rawRangePosition}\n activeDragThumb={this.activeDragThumb}\n isDragging={this.isDragging}\n snap={this.snap}\n min={this.min}\n max={this.max}\n step={this.step}\n disabled={this.disabled}\n readonly={this.readonly}\n onKeyDown={this.onKeyDown}\n labelBeforeValue={this.labelBeforeValue}\n labelAfterValue={this.labelAfterValue}\n />\n ) : (\n <SingleThumb\n value={this.valueInternal}\n min={this.min}\n max={this.max}\n step={this.step}\n rawPosition={this.rawPosition}\n isDragging={this.isDragging}\n snap={this.snap}\n disabled={this.disabled}\n readonly={this.readonly}\n onKeyDown={this.onKeyDown}\n labelBeforeValue={this.labelBeforeValue}\n labelAfterValue={this.labelAfterValue}\n />\n )}\n </div>\n\n <TickMarks\n ticks={this.internalTicks}\n min={this.min}\n max={this.max}\n />\n </div>\n\n {/* Second input (for range mode, or for single value if not already rendered) */}\n {this.range ? (\n <FieldInput\n range={this.range}\n hasField={this.hasField}\n value={this.valueInternal}\n rangeValue={this.rangeValueInternal}\n index={1}\n inputId={this.endInputId}\n min={this.min}\n max={this.max}\n step={this.step}\n disabled={this.disabled}\n readonly={this.readonly}\n onInput={this.handleFieldChange}\n labelBeforeValue={this.labelBeforeValue}\n labelAfterValue={this.labelAfterValue}\n name={this.name}\n endName={this.endName}\n />\n ) : (\n <FieldInput\n range={this.range}\n hasField={this.hasField}\n value={this.valueInternal}\n rangeValue={this.rangeValueInternal}\n inputId={this.startInputId}\n min={this.min}\n max={this.max}\n step={this.step}\n disabled={this.disabled}\n readonly={this.readonly}\n onInput={this.handleFieldChange}\n labelBeforeValue={this.labelBeforeValue}\n labelAfterValue={this.labelAfterValue}\n name={this.name}\n />\n )}\n </div>\n\n {(this.success ||\n this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"md\" />\n )}\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.error ||\n this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div class=\"error-description\" hidden={!this.error}>\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n // #endregion RENDER\n}\n"],"mappings":"iJASgBA,EAAiBC,GAC/B,GAAIC,OAAOC,UAAUF,GAAM,OAAO,EAClC,MAAMG,EAAMH,EAAII,WAChB,MAAMC,EAAcF,EAAIG,MAAM,KAAK,GACnC,OAAOD,EAAcA,EAAYE,OAAS,CAC5C,C,SASgBC,EAAMC,EAAeC,EAAaC,GAChD,OAAOC,KAAKD,IAAID,E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,IAAA,2CAAMjE,KAAK,eAAewB,KAAK2E,eAIjC3E,KAAKK,OACLL,KAAK6E,kBACL7E,KAAK6B,GAAGC,cAAc,gCACtBnF,EAAA,OAAA8F,IAAA,2CAAK7F,MAAM,oBAAoBkI,QAAS9E,KAAKK,OAC1CL,KAAKK,OACJ1D,EAAA,WAAA8F,IAAA,2CAASjE,KAAK,eAAe5B,MAAM,aAAagI,KAAK,OAEvDjI,EAAA,QAAA8F,IAAA,2CAAMjE,KAAK,qBAAqBwB,KAAK6E,mB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["nvFieldnumberCss","NvFieldnumberStyle0","NvFieldnumber","constructor","hostRef","this","inputId","uuidv4","disabled","readonly","required","error","success","step","autofocus","fluid","handleInput","event","input","target","value","valueAsNumber","handleInputContainerClick","inputElement","focus","handlePlus","stepUp","Number","handleMinus","stepDown","preventSelection","preventDefault","isMinValueReached","min","undefined","isMaxValueReached","max","watchValueHandler","newValue","valueChanged","emit","componentWillRender","message","description","validation","errorDescription","render","h","Host","key","label","el","querySelector","htmlFor","name","class","onClick","id","ref","e","placeholder","type","readOnly","onInput","size","emphasis","onMouseDown","tabindex","hidden"],"sources":["src/components/nv-fieldnumber/nv-fieldnumber.scss?tag=nv-fieldnumber","src/components/nv-fieldnumber/nv-fieldnumber.tsx"],"sourcesContent":["@import '../../styles/form-field';\n\nnv-fieldnumber {\n @include form-field-variables();\n @include form-field-root();\n\n &[fluid]:not([fluid=\"false\"]) {\n @include form-field-fluid();\n }\n\n &[readonly]:not([readonly='false']) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error='false']) {\n @include form-field-error-variables();\n }\n\n &[success]:not([success='false']) {\n @include form-field-success-variables();\n }\n\n &[required]:not([required='false']) label {\n @include form-field-label-required();\n }\n\n label {\n @include form-field-label();\n }\n\n .input-wrapper {\n @include form-field-input-wrapper();\n\n .input-container {\n @include form-field-input-container();\n\n container-type: inline-size;\n container-name: field-number-input-container;\n overflow: hidden;\n position: relative;\n\n input {\n @include form-field-input();\n\n width: 100%;\n appearance: textfield;\n\n &::-webkit-inner-spin-button,\n &::-webkit-outer-spin-button {\n appearance: none;\n margin: 0;\n }\n }\n\n nv-icon.validation {\n @include form-field-icon();\n margin-right: var(--form-field-gap);\n }\n\n > nv-iconbutton {\n @include form-field-action();\n }\n\n .stepper {\n display: flex;\n border-left: var(--notification-border-width-low-emphasis) solid var(--components-form-field-border-readonly);\n > nv-iconbutton {\n @include form-field-action();\n border-radius: 0px;\n }\n }\n\n // container query to remove .stepper and and the spacer when the container is less than 150px\n // .. this needs to be an absolute value because container queries do not accept variables\n // .. using relative width (cqw) compared to a parent container would not work\n // .. because the parent container follows the child's width\n @container field-number-input-container (width < 150px) {\n .stepper-spacer {\n display: none;\n }\n\n .stepper {\n display: none;\n }\n }\n }\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}","import {\n Component,\n Prop,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Watch,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * @slot leading-input - Content to be placed before the input text, within the input container.\n * @slot trailing-input - Content to be placed after the input text, within the input container.\n * @slot before-input - Content to be placed before the input text, outside the input container.\n * @slot after-input - Content to be placed after the input text, outside the input container.\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fieldnumber',\n styleUrl: 'nv-fieldnumber.scss',\n shadow: false,\n formAssociated: true,\n})\nexport class NvFieldnumber {\n @Element() el: HTMLNvFieldnumberElement;\n private inputElement!: HTMLInputElement;\n\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Message defines a 'hint ' message for the number field.\n * @deprecated Use `description` instead.\n */\n @Prop({ reflect: true })\n readonly message: string;\n\n /**\n * Add the message to the validation state.\n * @deprecated Use `errorDescription` and set the error prop instead.\n */\n @Prop({ reflect: true })\n readonly validation: string;\n\n //#endregion DEPRECATED\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly inputId: string = uuidv4();\n\n /**\n * Lets you define the text that explains what users should enter in the text\n * input field. It’s a crucial element for making forms clear and\n * user-friendly.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Add helpful hints or extra information under the text input field. This is\n * where you can clarify what users should enter or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true, mutable: true })\n description: string;\n\n /**\n * Display temporary text inside the input field to give users a hint about\n * what to type. It’s a great way to provide examples or suggestions directly\n * in the field before they start typing.\n */\n @Prop({ reflect: true })\n readonly placeholder: string;\n\n /**\n * Defines the name attribute of the input field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the input’s data in form submissions. It should be\n * unique within the form to avoid conflicts\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * The disabled prop lets you turn off the input field so that users can’t\n * type in it. When disabled, the field is grayed out and won’t respond to#\n * clicks or touches.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Display the input field’s content without allowing users to change it.\n * Users can still click on it, select, and copy the text, but they won’t be\n * able to type or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks the input field as required, ensuring that the user must fill it out\n * before submitting the form.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Alters the input field’s appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true, mutable: true })\n error: boolean = false;\n\n /**\n * Show a helpful message under the input field when there’s a problem. It\n * explains what’s wrong and how users can fix it, making the error easier to\n * understand and resolve.\n * @validator message\n */\n @Prop({ reflect: true, mutable: true })\n errorDescription: string;\n\n /**\n * Changes the input field’s appearance to indicate successful input or\n * validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * The maximum value that the input field can accept. Use this in combination\n * with min to create a range of valid values.\n */\n @Prop({ reflect: true })\n readonly max: number;\n\n /**\n * The minimum value that the input field can accept. Use this in combination\n * with max to create a range of valid values.\n */\n @Prop({ reflect: true })\n readonly min: number;\n\n /**\n * Define the increment value for the input field. It determines how much the\n * value will increase or decrease when the user clicks the stepper buttons.\n */\n @Prop({ reflect: true })\n readonly step: number = 1;\n\n /**\n * The value of the input field. It’s the text that users type in or the value\n * that you set programmatically. This is the main way to interact with the\n * input field, and it’s essential for creating forms that users can fill out.\n */\n @Prop({ reflect: true, mutable: true })\n value: number;\n\n /**\n * Applies focus to the input field as soon as the component is mounted. This\n * is equivalent to setting the native autofocus attribute on an <input>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the input value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<number>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('value')\n watchValueHandler(newValue: number) {\n this.valueChanged.emit(newValue);\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region METHODS\n\n private handleInput = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.value = input.valueAsNumber;\n };\n\n private handleInputContainerClick = () => {\n this.inputElement.focus();\n };\n\n private handlePlus = () => {\n this.inputElement.stepUp();\n this.value = Number(this.inputElement.value);\n };\n\n private handleMinus = () => {\n this.inputElement.stepDown();\n this.value = Number(this.inputElement.value);\n };\n\n // prevents text selection when clicking the buttons multiple times\n private preventSelection = (event: Event) => {\n event.preventDefault();\n };\n\n private isMinValueReached = (): boolean => {\n return this.min !== undefined && this.value <= this.min;\n };\n\n private isMaxValueReached = (): boolean => {\n return this.max !== undefined && this.value >= this.max;\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillRender() {\n if (this.message) {\n this.description = this.message;\n }\n\n if (this.validation) {\n this.errorDescription = this.validation;\n this.error = true;\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host>\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <div class=\"input-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div class=\"input-container\" onClick={this.handleInputContainerClick}>\n <slot name=\"leading-input\"></slot>\n\n <input\n id={this.inputId}\n ref={e => (this.inputElement = e)}\n placeholder={this.placeholder}\n name={this.name}\n type=\"number\"\n autofocus={this.autofocus}\n required={this.required}\n max={this.max}\n min={this.min}\n step={this.step}\n value={this.value}\n disabled={this.disabled}\n readOnly={this.readonly}\n onInput={this.handleInput}\n />\n\n <slot name=\"trailing-input\"></slot>\n\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"md\" />\n )}\n\n <div class=\"stepper\">\n <nv-iconbutton\n size=\"md\"\n name=\"minus\"\n emphasis=\"lower\"\n onClick={this.handleMinus}\n disabled={this.isMinValueReached()}\n onMouseDown={this.preventSelection}\n tabindex=\"-1\"\n ></nv-iconbutton>\n <nv-iconbutton\n size=\"md\"\n name=\"plus\"\n emphasis=\"lower\"\n onClick={this.handlePlus}\n disabled={this.isMaxValueReached()}\n onMouseDown={this.preventSelection}\n tabindex=\"-1\"\n />\n </div>\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div hidden={!this.error} class=\"error-description\">\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"mappings":"oGAAA,MAAMA,EAAmB,y8TACzB,MAAAC,EAAeD,E,MC0BFE,EAAa,MAN1B,WAAAC,CAAAC,G,qDAsCWC,KAAAC,QAAkBC,IAyClBF,KAAAG,SAAoB,MAQpBH,KAAAI,SAAoB,MAOpBJ,KAAAK,SAAoB,MAQ7BL,KAAAM,MAAiB,MAgBRN,KAAAO,QAAmB,MAqBnBP,KAAAQ,KAAe,EAiBfR,KAAAS,UAAqB,MAMrBT,KAAAU,MAAiB,MA0BlBV,KAAAW,YAAeC,IACrB,MAAMC,EAAQD,EAAME,OACpBd,KAAKe,MAAQF,EAAMG,aAAa,EAG1BhB,KAAAiB,0BAA4B,KAClCjB,KAAKkB,aAAaC,OAAO,EAGnBnB,KAAAoB,WAAa,KACnBpB,KAAKkB,aAAaG,SAClBrB,KAAKe,MAAQO,OAAOtB,KAAKkB,aAAaH,MAAM,EAGtCf,KAAAuB,YAAc,KACpBvB,KAAKkB,aAAaM,WAClBxB,KAAKe,MAAQO,OAAOtB,KAAKkB,aAAaH,MAAM,EAItCf,KAAAyB,iBAAoBb,IAC1BA,EAAMc,gBAAgB,EAGhB1B,KAAA2B,kBAAoB,IACnB3B,KAAK4B,MAAQC,WAAa7B,KAAKe,OAASf,KAAK4B,IAG9C5B,KAAA8B,kBAAoB,IACnB9B,KAAK+B,MAAQF,WAAa7B,KAAKe,OAASf,KAAK+B,G,CArCtD,iBAAAC,CAAkBC,GAChBjC,KAAKkC,aAAaC,KAAKF,E,CA2CzB,mBAAAG,GACE,GAAIpC,KAAKqC,QAAS,CAChBrC,KAAKsC,YAActC,KAAKqC,O,CAG1B,GAAIrC,KAAKuC,WAAY,CACnBvC,KAAKwC,iBAAmBxC,KAAKu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AAK,OACLW,SAAS,QACTT,QAASnD,KAAKoB,WACdjB,SAAUH,KAAK8B,oBACf+B,YAAa7D,KAAKyB,iBAClBqC,SAAS,SAKfpB,EAAA,QAAAE,IAAA,2CAAMK,KAAK,kBAGXjD,KAAKsC,aACLtC,KAAK8C,GAAGC,cAAc,0BACtBL,EAAA,OAAAE,IAAA,2CAAKM,MAAM,eACTR,EAAA,QAAAE,IAAA,2CAAMK,KAAK,eAAejD,KAAKsC,eAIjCtC,KAAKwC,kBACLxC,KAAK8C,GAAGC,cAAc,gCACtBL,EAAA,OAAAE,IAAA,2CAAKmB,QAAS/D,KAAKM,MAAO4C,MAAM,qBAC9BR,EAAA,QAAAE,IAAA,2CAAMK,KAAK,qBAAqBjD,KAAKwC,mB","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as o,h as t,H as e,g as n}from"./p-3060df80.js";import{c as r}from"./p-8a1a6e56.js";const i="nv-iconbutton.root{display:inline-flex;justify-content:center;align-items:center;font-style:normal;font-weight:var(--font-weight-medium-emphasis);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;transition:background-color 150ms ease-out;height:fit-content;width:fit-content}nv-iconbutton.size-xs{padding:var(--button-xs-icon-button-padding);gap:var(--button-xs-gap);border-radius:var(--button-xs-border-radius);line-height:var(--button-xs-line-height);font-size:var(--button-xs-font-size)}nv-iconbutton.size-sm{padding:var(--button-sm-icon-button-padding);gap:var(--button-sm-gap);border-radius:var(--button-sm-border-radius);line-height:var(--button-sm-line-height);font-size:var(--button-sm-font-size)}nv-iconbutton.size-md{padding:var(--button-md-icon-button-padding);gap:var(--button-md-gap);border-radius:var(--button-md-border-radius);line-height:var(--button-md-line-height);font-size:var(--button-md-font-size)}nv-iconbutton.size-lg{padding:var(--button-lg-icon-button-padding);gap:var(--button-lg-gap);border-radius:var(--button-lg-border-radius);line-height:var(--button-lg-line-height);font-size:var(--button-lg-font-size)}nv-iconbutton.emphasis-high{background:var(--components-button-high-background);border:1px solid var(--components-button-high-border);color:var(--components-button-high-text)}nv-iconbutton.emphasis-high:hover{background:var(--components-button-high-background-hover);color:var(--components-button-high-text-hover)}nv-iconbutton.emphasis-high:focus,nv-iconbutton.emphasis-high:focus-within{outline:none}nv-iconbutton.emphasis-high:focus-visible,nv-iconbutton.emphasis-high:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-high:disabled{background:var(--components-button-high-background);color:var(--components-button-high-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-high nv-icon>svg{color:var(--components-button-high-icon)}nv-iconbutton.emphasis-medium{background:var(--components-button-medium-background);border:1px solid var(--components-button-medium-border);color:var(--components-button-medium-text)}nv-iconbutton.emphasis-medium:hover{background:var(--components-button-medium-background-hover);color:var(--components-button-medium-text-hover)}nv-iconbutton.emphasis-medium:focus,nv-iconbutton.emphasis-medium:focus-within{outline:none}nv-iconbutton.emphasis-medium:focus-visible,nv-iconbutton.emphasis-medium:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-medium:disabled{background:var(--components-button-medium-background);color:var(--components-button-medium-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-medium nv-icon>svg{color:var(--components-button-medium-icon)}nv-iconbutton.emphasis-low{background:var(--components-button-low-background);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text)}nv-iconbutton.emphasis-low:hover{background:var(--components-button-low-background-hover);color:var(--components-button-low-text-hover)}nv-iconbutton.emphasis-low:focus,nv-iconbutton.emphasis-low:focus-within{outline:none}nv-iconbutton.emphasis-low:focus-visible,nv-iconbutton.emphasis-low:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-low:disabled{background:var(--components-button-low-background);color:var(--components-button-low-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-low nv-icon>svg{color:var(--components-button-low-icon)}nv-iconbutton.emphasis-lower{background:var(--components-button-lower-background);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text)}nv-iconbutton.emphasis-lower:hover{background:var(--components-button-lower-background-hover);color:var(--components-button-lower-text-hover)}nv-iconbutton.emphasis-lower:focus,nv-iconbutton.emphasis-lower:focus-within{outline:none}nv-iconbutton.emphasis-lower:focus-visible,nv-iconbutton.emphasis-lower:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-lower:disabled{background:var(--components-button-lower-background);color:var(--components-button-lower-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-lower nv-icon>svg{color:var(--components-button-lower-icon)}nv-iconbutton.loading [slot=leading-icon]{display:none}nv-iconbutton.shape-rounded{border-radius:var(--radius-rounded-full)}";const a=i;const s=class{constructor(t){o(this,t);if(t.$hostElement$["s-ei"]){this.internals=t.$hostElement$["s-ei"]}else{this.internals=t.$hostElement$.attachInternals();t.$hostElement$["s-ei"]=this.internals}this.size="md";this.emphasis="high";this.loading=false;this.disabled=false;this.active=false;this.type="button";this.shape="square";this.handleClick=o=>{var t,e,n,r;if(this.disabled){o.preventDefault();return}if(this.type==="submit"){(e=(t=this.internals)===null||t===void 0?void 0:t.form)===null||e===void 0?void 0:e.requestSubmit()}if(this.type==="reset"){(r=(n=this.internals)===null||n===void 0?void 0:n.form)===null||r===void 0?void 0:r.reset()}}}handleLoadingChange(o){this.loading=o;this.disabled=o}handleDisabledChange(o){if(this.loading){this.disabled=this.loading}else{this.disabled=o}}handleKeyDown(o){if(o.key==="Enter"||o.key===" "){o.preventDefault();this.el.click()}}handleTouchStart(o){if(o.touches.length>1)return;o.preventDefault();this.el.click()}componentWillLoad(){if(this.loading){this.disabled=this.loading}}render(){return t(e,{key:"5590d5f6378669a2f74ce93d33ac14c86f435523",role:"button",type:this.type,tabindex:"0",disabled:this.disabled?true:undefined,class:r("root",`size-${this.size}`,`emphasis-${this.emphasis}`,this.loading&&"loading",`shape-${this.shape}`),onClick:this.handleClick},this.loading&&t("nv-loader",{key:"f88ed8a8b579d15318f419c8072a4c14e56990ce",size:this.size}),!this.loading&&t("nv-icon",{key:"12b3fc9818014ea93237e8037ce2d90ee214517a",name:this.name,size:this.size}),t("slot",{key:"97e130b7caf544954f3168866429ed7633e46301"}))}static get formAssociated(){return true}get el(){return n(this)}static get watchers(){return{loading:["handleLoadingChange"],disabled:["handleDisabledChange"]}}};s.style=a;const l='@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}nv-loader{display:inline-block;position:relative;aspect-ratio:1/1;border-radius:9999px;color:inherit}nv-loader.size-xs{width:var(--loader-size-xs);height:var(--loader-size-xs)}nv-loader.size-xs::before,nv-loader.size-xs::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-xs::before{content:" ";border:calc(var(--loader-size-xs) / 10) solid;opacity:0.3}nv-loader.size-xs::after{content:" ";border-top:calc(var(--loader-size-xs) / 10) solid transparent;border-left:calc(var(--loader-size-xs) / 10) solid transparent;border-right:calc(var(--loader-size-xs) / 10) solid transparent;border-bottom:calc(var(--loader-size-xs) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-sm{width:var(--loader-size-sm);height:var(--loader-size-sm)}nv-loader.size-sm::before,nv-loader.size-sm::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-sm::before{content:" ";border:calc(var(--loader-size-sm) / 10) solid;opacity:0.3}nv-loader.size-sm::after{content:" ";border-top:calc(var(--loader-size-sm) / 10) solid transparent;border-left:calc(var(--loader-size-sm) / 10) solid transparent;border-right:calc(var(--loader-size-sm) / 10) solid transparent;border-bottom:calc(var(--loader-size-sm) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-md{width:var(--loader-size-md);height:var(--loader-size-md)}nv-loader.size-md::before,nv-loader.size-md::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-md::before{content:" ";border:calc(var(--loader-size-md) / 10) solid;opacity:0.3}nv-loader.size-md::after{content:" ";border-top:calc(var(--loader-size-md) / 10) solid transparent;border-left:calc(var(--loader-size-md) / 10) solid transparent;border-right:calc(var(--loader-size-md) / 10) solid transparent;border-bottom:calc(var(--loader-size-md) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-lg{width:var(--loader-size-lg);height:var(--loader-size-lg)}nv-loader.size-lg::before,nv-loader.size-lg::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-lg::before{content:" ";border:calc(var(--loader-size-lg) / 10) solid;opacity:0.3}nv-loader.size-lg::after{content:" ";border-top:calc(var(--loader-size-lg) / 10) solid transparent;border-left:calc(var(--loader-size-lg) / 10) solid transparent;border-right:calc(var(--loader-size-lg) / 10) solid transparent;border-bottom:calc(var(--loader-size-lg) / 10) solid;animation:rotation 1s linear infinite}nv-loader.size-xl{width:var(--loader-size-xl);height:var(--loader-size-xl)}nv-loader.size-xl::before,nv-loader.size-xl::after{content:" ";position:absolute;top:0;left:0;border-radius:inherit;width:100%;height:100%}nv-loader.size-xl::before{content:" ";border:calc(var(--loader-size-xl) / 10) solid;opacity:0.3}nv-loader.size-xl::after{content:" ";border-top:calc(var(--loader-size-xl) / 10) solid transparent;border-left:calc(var(--loader-size-xl) / 10) solid transparent;border-right:calc(var(--loader-size-xl) / 10) solid transparent;border-bottom:calc(var(--loader-size-xl) / 10) solid;animation:rotation 1s linear infinite}nv-loader.color-brand::before{border-color:var(--components-loader-brand-background);opacity:1}nv-loader.color-brand::after{border-bottom-color:var(--components-loader-brand-foreground)}nv-loader.color-white::before{border-color:var(--components-loader-white-background);opacity:1}nv-loader.color-white::after{border-bottom-color:var(--components-loader-white-foreground)}';const d=l;const c=class{constructor(t){o(this,t);this.size="md"}render(){return t(e,{key:"b90db971210fb08781098cefaf8832bd5692a09e",class:r(this.size&&`size-${this.size}`,this.color&&`color-${this.color}`)})}};c.style=d;export{s as nv_iconbutton,c as nv_loader};
|
|
2
|
-
//# sourceMappingURL=p-d62869ff.entry.js.map
|