@nova-design-system/nova-react 3.24.0 → 3.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cjs/dom.utils-CuXVGECR-8VY5SfMZ.js +177 -0
- package/dist/cjs/generated/components.server.js +82 -62
- package/dist/cjs/index-BeFrXZol.js +9699 -0
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/{nv-accordion-item.entry-Bu1tAcCq.js → nv-accordion-item.entry-DtzjLTCo.js} +8 -7
- package/dist/cjs/{nv-accordion.entry-jWjLdX8w.js → nv-accordion.entry-DRcTfezT.js} +10 -8
- package/dist/cjs/{nv-alert.entry-E9ZJay_K.js → nv-alert.entry-86bfoXVx.js} +6 -4
- package/dist/cjs/nv-avatar.entry-mp2LJ6RA.js +68 -0
- package/dist/cjs/nv-badge_2.entry-BrDaHeqh.js +220 -0
- package/dist/cjs/nv-breadcrumb.entry-B2q7jJy2.js +49 -0
- package/dist/cjs/nv-breadcrumbs.entry-DKzST1uS.js +21 -0
- package/dist/cjs/nv-button.entry-CVgcU-bi.js +166 -0
- package/dist/cjs/{nv-buttongroup.entry-CuZCRsnV.js → nv-buttongroup.entry-CvuBGaGK.js} +12 -6
- package/dist/cjs/{nv-calendar.entry-CT3mASW6.js → nv-calendar.entry-BCcGhxzJ.js} +27 -19
- package/dist/cjs/{nv-col.entry--pCxkaTh.js → nv-col.entry-CzTahRVr.js} +3 -3
- package/dist/cjs/{nv-datagrid.entry-CGCEhO8C.js → nv-datagrid.entry-DWZxNqTE.js} +47 -184
- package/dist/cjs/{nv-datagridcolumn.entry-Fsqc7CT_.js → nv-datagridcolumn.entry-CzCzmdQl.js} +1 -1
- package/dist/cjs/{nv-dialog.entry-B6OYcZxQ.js → nv-dialog.entry-ByVD02QB.js} +19 -20
- package/dist/cjs/{nv-dialogfooter_2.entry-C4fP_n2-.js → nv-dialogfooter_2.entry-BmQcYJsD.js} +11 -29
- package/dist/cjs/{nv-drawer.entry-C5O4KvHU.js → nv-drawer.entry-C15JRJ3N.js} +19 -19
- package/dist/cjs/{nv-drawerfooter_2.entry-C-reYJXG.js → nv-drawerfooter_2.entry-DuDac_Os.js} +11 -29
- package/dist/cjs/nv-fieldcheckbox.entry-CwDOQzSW.js +179 -0
- package/dist/cjs/{nv-fielddate.entry-dqZDBVmm.js → nv-fielddate.entry-DKICGwc0.js} +15 -13
- package/dist/cjs/{nv-fielddaterange.entry-wNRasXky.js → nv-fielddaterange.entry-DGEK8F9p.js} +15 -14
- package/dist/cjs/{nv-fielddropdown.entry-BA15piWa.js → nv-fielddropdown.entry-BLS7lRzD.js} +33 -31
- package/dist/cjs/nv-fielddropdownitem.entry-Bbfi3A8C.js +69 -0
- package/dist/cjs/{nv-fieldmultiselect.entry-BWY5xOAd.js → nv-fieldmultiselect.entry-Cpy7HzlZ.js} +28 -24
- package/dist/cjs/nv-fieldnumber.entry-SbNb4hKr.js +189 -0
- package/dist/cjs/nv-fieldpassword.entry-CPsgagjY.js +167 -0
- package/dist/cjs/nv-fieldradio.entry-DLP-rmKU.js +105 -0
- package/dist/cjs/{nv-fieldselect.entry-uUIZ6hmN.js → nv-fieldselect.entry-DOOO03kM.js} +20 -12
- package/dist/cjs/{nv-fieldslider.entry-DnvmxxYY.js → nv-fieldslider.entry-CpVbxkpo.js} +33 -15
- package/dist/cjs/nv-fieldtext.entry-BpbG4WHv.js +163 -0
- package/dist/cjs/nv-fieldtextarea.entry-BA_RApYN.js +245 -0
- package/dist/cjs/{nv-fieldtime.entry-DlMNDTht.js → nv-fieldtime.entry-DaJfwQtC.js} +15 -9
- package/dist/cjs/{nv-icon.entry-CnUkRzaA.js → nv-icon.entry-DIi792yJ.js} +4 -4
- package/dist/cjs/nv-iconbutton_2.entry-B4xB5WtE.js +171 -0
- package/dist/cjs/{nv-menu.entry-Dc_FvIx7.js → nv-menu.entry-DHWhkWeB.js} +9 -13
- package/dist/cjs/nv-menuitem.entry-CQApuT2D.js +59 -0
- package/dist/cjs/nv-notification-bullet.entry-CnYVWE_Z.js +76 -0
- package/dist/cjs/{nv-notification.entry-C3m5p5BL.js → nv-notification.entry-DraOvzsu.js} +4 -4
- package/dist/cjs/nv-notificationcontainer.entry-BDo-rQLL.js +41 -0
- package/dist/cjs/nv-paginationtable.entry-CS7BhAVe.js +231 -0
- package/dist/cjs/{nv-popover.entry-B0c-2rO4.js → nv-popover.entry-DSyKCLtF.js} +105 -33
- package/dist/cjs/nv-row.entry-D21zN2Vr.js +22 -0
- package/dist/cjs/{nv-sidebar.entry-CiN813gQ.js → nv-sidebar.entry-DpKgnjsJ.js} +10 -6
- package/dist/cjs/nv-sidebarcontent.entry-BWFDcui8.js +22 -0
- package/dist/cjs/{nv-sidebardivider.entry-B4EMyca5.js → nv-sidebardivider.entry-BSzLq-h3.js} +4 -4
- package/dist/cjs/{nv-sidebarfooter.entry-CHi4qOFe.js → nv-sidebarfooter.entry-C3DLHPSQ.js} +4 -4
- package/dist/cjs/nv-sidebargroup.entry-BMYLbCql.js +23 -0
- package/dist/cjs/{nv-sidebarheader.entry-_7ch0O3G.js → nv-sidebarheader.entry-CkUGD-Tw.js} +4 -4
- package/dist/cjs/{nv-sidebarlogo.entry-Ch9F-JnT.js → nv-sidebarlogo.entry-BX1-1S1v.js} +4 -4
- package/dist/cjs/{nv-sidebarnavitem.entry-DVrafSMr.js → nv-sidebarnavitem.entry-CPwt0Njh.js} +9 -7
- package/dist/cjs/nv-sidebarnavsubitem.entry-HZOTB6Tl.js +35 -0
- package/dist/cjs/{nv-split.entry-0HTslRAX.js → nv-split.entry-DdtzktvN.js} +10 -6
- package/dist/cjs/nv-stack.entry-BMLt30Nt.js +31 -0
- package/dist/cjs/{nv-table.entry-DH85n8Mc.js → nv-table.entry-RTiqKRKM.js} +6 -4
- package/dist/cjs/{nv-tableheader.entry-CKfocdxD.js → nv-tableheader.entry-Ci4qo8eY.js} +4 -4
- package/dist/cjs/nv-toggle.entry-s8B7-8P7.js +82 -0
- package/dist/cjs/nv-togglebutton.entry-CyHgU4Wl.js +66 -0
- package/dist/cjs/{nv-togglebuttongroup.entry-C0NLbsq7.js → nv-togglebuttongroup.entry-Bn_9DsdP.js} +13 -9
- package/dist/cjs/nv-tooltip.entry-D6kxXLO-.js +56 -0
- package/dist/components/NvDatatable/NvDatatable.js +29 -8
- package/dist/generated/components.js +11 -0
- package/dist/generated/components.server.js +81 -62
- package/dist/providers/NotificationProvider.js +9 -8
- package/dist/types/components/NvDatatable/types.d.ts +6 -0
- package/dist/types/generated/components.d.ts +52 -46
- package/dist/types/generated/components.server.d.ts +52 -46
- package/package.json +7 -4
- package/dist/cjs/index-kU2nW5aN.js +0 -40286
- package/dist/cjs/nv-avatar.entry-CUX7u0kR.js +0 -68
- package/dist/cjs/nv-badge_2.entry-bxpV5gxE.js +0 -213
- package/dist/cjs/nv-breadcrumb.entry-Cbbb9Qeh.js +0 -46
- package/dist/cjs/nv-breadcrumbs.entry-BTqnp9zO.js +0 -21
- package/dist/cjs/nv-button.entry-upWH19y6.js +0 -162
- package/dist/cjs/nv-fieldcheckbox.entry-bk7UNQny.js +0 -177
- package/dist/cjs/nv-fielddropdownitem.entry-DEWaf9dC.js +0 -72
- package/dist/cjs/nv-fieldnumber.entry-DoYORd0d.js +0 -187
- package/dist/cjs/nv-fieldpassword.entry-CPaLj9aD.js +0 -165
- package/dist/cjs/nv-fieldradio.entry-CvUmEaCa.js +0 -103
- package/dist/cjs/nv-fieldtext.entry-BYAJp3n_.js +0 -163
- package/dist/cjs/nv-fieldtextarea.entry-DU2bWYeg.js +0 -237
- package/dist/cjs/nv-iconbutton_2.entry-hqp4AcRq.js +0 -167
- package/dist/cjs/nv-menuitem.entry-DzMhx6c_.js +0 -60
- package/dist/cjs/nv-notification-bullet.entry-BwhHCMQF.js +0 -76
- package/dist/cjs/nv-notificationcontainer.entry-DTRNn7VE.js +0 -41
- package/dist/cjs/nv-row.entry-CdcjVGZv.js +0 -22
- package/dist/cjs/nv-sidebarcontent.entry-D9hpAhK8.js +0 -22
- package/dist/cjs/nv-sidebargroup.entry-RVqrsyIU.js +0 -23
- package/dist/cjs/nv-sidebarnavsubitem.entry-C0XDAzma.js +0 -35
- package/dist/cjs/nv-stack.entry-CqO7uTQf.js +0 -31
- package/dist/cjs/nv-toggle.entry-BHUl76Im.js +0 -80
- package/dist/cjs/nv-togglebutton.entry-D_9COjY-.js +0 -67
- package/dist/cjs/nv-tooltip.entry-BfViGE_U.js +0 -55
- /package/dist/cjs/{i18n.utils-IlwlcG9l-ku0bScip.js → i18n.utils-CR9MpYzU-ku0bScip.js} +0 -0
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-kU2nW5aN.js');
|
|
4
|
-
var clsxChV9xqsO = require('./clsx-ChV9xqsO-BtxeOLZW.js');
|
|
5
|
-
var v4BdYh22OP = require('./v4-BdYh22OP-C1vaJ4yP.js');
|
|
6
|
-
require('@stencil/react-output-target/runtime');
|
|
7
|
-
require('react');
|
|
8
|
-
require('react-dom');
|
|
9
|
-
|
|
10
|
-
const nvFieldtextareaCss = "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-fieldtextarea{--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-fieldtextarea[fluid]:not([fluid=false]){max-width:unset}nv-fieldtextarea[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-fieldtextarea[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-fieldtextarea[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-fieldtextarea[required]:not([required=false]) label::after,nv-fieldtextarea[aria-required=true] label::after{content:\"*\";color:var(--components-form-text-required);font-weight:var(--font-weight-high-emphasis)}nv-fieldtextarea 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-fieldtextarea .textarea-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch}nv-fieldtextarea .textarea-wrapper .textarea-container{display:flex;flex-grow:1;padding:calc(var(--form-field-padding-y) - 1px) var(--form-field-padding-x);justify-content:center;align-items:center;gap:var(--form-field-gap);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);background:var(--nv-field-background);transition:all 150ms ease-out}nv-fieldtextarea .textarea-wrapper .textarea-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldtextarea .textarea-wrapper .textarea-container:focus-within{border-color:var(--nv-field-border-focus);box-shadow:0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fieldtextarea .textarea-wrapper .textarea-container:has(textarea:read-only){opacity:0.5;background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fieldtextarea .textarea-wrapper .textarea-container:has(textarea:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldtextarea .textarea-wrapper .textarea-container textarea::-webkit-scrollbar{width:6px;height:6px}nv-fieldtextarea .textarea-wrapper .textarea-container textarea::-webkit-scrollbar-track{background-color:var(--color-level-10-background);border-radius:9999px}nv-fieldtextarea .textarea-wrapper .textarea-container textarea::-webkit-scrollbar-thumb{background-color:var(--color-gray-200);border-radius:9999px}nv-fieldtextarea .textarea-wrapper .textarea-container textarea{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);text-overflow:ellipsis;font-size:var(--form-field-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--form-field-line-height)}nv-fieldtextarea .textarea-wrapper .textarea-container textarea:focus{outline:none}nv-fieldtextarea .textarea-wrapper .textarea-container textarea::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-fieldtextarea .textarea-wrapper .textarea-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fieldtextarea .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-fieldtextarea .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)}";
|
|
11
|
-
|
|
12
|
-
const NvFieldtextarea = class {
|
|
13
|
-
constructor(hostRef) {
|
|
14
|
-
index.registerInstance(this, hostRef);
|
|
15
|
-
this.valueChanged = index.createEvent(this, "valueChanged", 3);
|
|
16
|
-
//#endregion DEPRECATED
|
|
17
|
-
/****************************************************************************/
|
|
18
|
-
//#region PROPERTIES
|
|
19
|
-
/**
|
|
20
|
-
* Sets the ID for the input element and the for attribute of the associated
|
|
21
|
-
* label. If no ID is provided, a random one will be automatically generated
|
|
22
|
-
* to ensure unique identification, facilitating proper label association and
|
|
23
|
-
* accessibility.
|
|
24
|
-
*/
|
|
25
|
-
this.inputId = v4BdYh22OP.v4();
|
|
26
|
-
/**
|
|
27
|
-
* The disabled prop lets you turn off the textarea field so that users can’t
|
|
28
|
-
* type in it. When disabled, the field is grayed out and won’t respond to#
|
|
29
|
-
* clicks or touches.
|
|
30
|
-
*/
|
|
31
|
-
this.disabled = false;
|
|
32
|
-
/**
|
|
33
|
-
* Display the textarea field’s content without allowing users to change it.
|
|
34
|
-
* Users can still click on it, select, and copy the text, but they won’t be
|
|
35
|
-
* able to type or delete anything.
|
|
36
|
-
*/
|
|
37
|
-
this.readonly = false;
|
|
38
|
-
/**
|
|
39
|
-
* Marks the textarea field as required, ensuring that the user must fill it out
|
|
40
|
-
* before submitting the form.
|
|
41
|
-
* @note This uses the native HTML `required` attribute, which triggers browser validation.
|
|
42
|
-
*/
|
|
43
|
-
this.required = false;
|
|
44
|
-
/**
|
|
45
|
-
* Marks the textarea field as required for accessibility purposes without triggering
|
|
46
|
-
* native HTML validation. Use this when implementing custom validation logic.
|
|
47
|
-
* @note When set, this uses `aria-required` instead of the native `required` attribute.
|
|
48
|
-
* This allows developers to implement custom validation while maintaining accessibility.
|
|
49
|
-
* @note If this prop is not explicitly set, the component will check for the HTML attribute
|
|
50
|
-
* 'aria-required' directly to determine if it should be applied.
|
|
51
|
-
*/
|
|
52
|
-
this.ariaRequiredAttr = false;
|
|
53
|
-
/**
|
|
54
|
-
* Alters the textarea field's appearance to indicate an error, helping users
|
|
55
|
-
* identify fields that need correction.
|
|
56
|
-
* @validator error
|
|
57
|
-
*/
|
|
58
|
-
this.error = false;
|
|
59
|
-
/**
|
|
60
|
-
* Changes the textarea field’s appearance to indicate successful textarea or
|
|
61
|
-
* validation.
|
|
62
|
-
*/
|
|
63
|
-
this.success = false;
|
|
64
|
-
/**
|
|
65
|
-
* The number of visible text lines for the control. The default is 3. This
|
|
66
|
-
* can be useful when you want to limit the size of the textarea field or when
|
|
67
|
-
* you want to make the textarea field smaller to fit a specific layout. The
|
|
68
|
-
* textarea field will expand vertically to fit the text as the user types.
|
|
69
|
-
*/
|
|
70
|
-
this.rows = 3;
|
|
71
|
-
/**
|
|
72
|
-
* Controls the resize property of a textarea. It can be set to none, both,
|
|
73
|
-
* horizontal, or vertical. The default is vertical.
|
|
74
|
-
*/
|
|
75
|
-
this.resize = 'vertical';
|
|
76
|
-
/**
|
|
77
|
-
* Enable this to make the textarea automatically resize as the user types,
|
|
78
|
-
* adjusting the height to fit the content. For the best experience, avoid
|
|
79
|
-
* vertical resizing, as it’s controlled by this feature. Horizontal resizing
|
|
80
|
-
* can still be allowed if desired.
|
|
81
|
-
*/
|
|
82
|
-
this.autosize = false;
|
|
83
|
-
/**
|
|
84
|
-
* Applies focus to the input field as soon as the component is mounted. This
|
|
85
|
-
* is equivalent to setting the native autofocus attribute on a <textarea>
|
|
86
|
-
* element.
|
|
87
|
-
*/
|
|
88
|
-
this.autofocus = false;
|
|
89
|
-
/**
|
|
90
|
-
* Allows the field to stretch and fill the entire width of its container.
|
|
91
|
-
*/
|
|
92
|
-
this.fluid = false;
|
|
93
|
-
//#endregion WATCHERS
|
|
94
|
-
/****************************************************************************/
|
|
95
|
-
//#region METHODS
|
|
96
|
-
this.handleTextarea = (event) => {
|
|
97
|
-
const textarea = event.target;
|
|
98
|
-
this.value = textarea.value;
|
|
99
|
-
this.valueChanged.emit(textarea.value);
|
|
100
|
-
};
|
|
101
|
-
this.handleTextareaContainerClick = () => {
|
|
102
|
-
this.textareaElement.focus();
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
//#endregion EVENTS
|
|
106
|
-
/****************************************************************************/
|
|
107
|
-
//#region WATCHERS
|
|
108
|
-
/**
|
|
109
|
-
* If autosize is true, we need to make sure to update the min-height when
|
|
110
|
-
* the rows change.
|
|
111
|
-
*/
|
|
112
|
-
rowsChanged() {
|
|
113
|
-
if (this.autosize) {
|
|
114
|
-
this.adjustTextareaHeight();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* If autosize is true, we need to make sure to update the height and
|
|
119
|
-
* min-height, if false, we need to remove the height property.
|
|
120
|
-
*/
|
|
121
|
-
autosizeChanged() {
|
|
122
|
-
if (this.autosize) {
|
|
123
|
-
this.adjustTextareaHeight();
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
this.textareaElement?.style.removeProperty('height');
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Make sure to adjust the height of the textarea when the value changes
|
|
131
|
-
* programmatically or by typing when autosize is on.
|
|
132
|
-
*/
|
|
133
|
-
handleValueChange() {
|
|
134
|
-
if (this.autosize) {
|
|
135
|
-
this.adjustTextareaHeight();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
adjustTextareaHeight() {
|
|
139
|
-
if (this.textareaElement && this.autosize) {
|
|
140
|
-
/**
|
|
141
|
-
* The first requestAnimationFrame ensures that the DOM has applied any
|
|
142
|
-
* pending changes (e.g., value updates or attribute changes) before
|
|
143
|
-
* proceeding to the next frame.
|
|
144
|
-
*/
|
|
145
|
-
requestAnimationFrame(() => {
|
|
146
|
-
/**
|
|
147
|
-
* The second requestAnimationFrame ensures that the browser has fully
|
|
148
|
-
* recalculated layout and styles based on the updated DOM, such as
|
|
149
|
-
* recalculating scrollHeight for the textarea after the new value is
|
|
150
|
-
* rendered.
|
|
151
|
-
*/
|
|
152
|
-
requestAnimationFrame(() => {
|
|
153
|
-
this.textareaElement.style.height = 'auto';
|
|
154
|
-
const computedStyle = window.getComputedStyle(this.textareaElement);
|
|
155
|
-
const lineHeight = parseFloat(computedStyle.lineHeight);
|
|
156
|
-
const paddingTop = parseFloat(computedStyle.paddingTop);
|
|
157
|
-
const paddingBottom = parseFloat(computedStyle.paddingBottom);
|
|
158
|
-
const borderTopWidth = parseFloat(computedStyle.borderTopWidth);
|
|
159
|
-
const borderBottomWidth = parseFloat(computedStyle.borderBottomWidth);
|
|
160
|
-
// Calculate min-height based on rows
|
|
161
|
-
const minHeight = lineHeight * this.rows +
|
|
162
|
-
paddingTop +
|
|
163
|
-
paddingBottom +
|
|
164
|
-
borderTopWidth +
|
|
165
|
-
borderBottomWidth;
|
|
166
|
-
this.textareaElement.style.minHeight = `${minHeight}px`;
|
|
167
|
-
this.textareaElement.style.height =
|
|
168
|
-
this.textareaElement.scrollHeight + 'px';
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
//#endregion METHODS
|
|
174
|
-
/****************************************************************************/
|
|
175
|
-
//#region LIFECYCLE
|
|
176
|
-
componentWillRender() {
|
|
177
|
-
if (this.message) {
|
|
178
|
-
this.description = this.message;
|
|
179
|
-
}
|
|
180
|
-
if (this.validation) {
|
|
181
|
-
this.errorDescription = this.validation;
|
|
182
|
-
this.error = true;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
componentDidLoad() {
|
|
186
|
-
if (this.autosize) {
|
|
187
|
-
this.adjustTextareaHeight();
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
//#endregion LIFECYCLE
|
|
191
|
-
/****************************************************************************/
|
|
192
|
-
//#region RENDER
|
|
193
|
-
render() {
|
|
194
|
-
// Check aria-required from multiple sources:
|
|
195
|
-
// 1. HTML attribute 'aria-required' (direct HTML) - check if explicitly set
|
|
196
|
-
// 2. JavaScript prop (when prop is explicitly set via JavaScript)
|
|
197
|
-
// We use hasAttribute to determine if the attribute was explicitly set by the user,
|
|
198
|
-
// since the prop now defaults to false (to maintain Blazor compatibility)
|
|
199
|
-
const hasAriaRequiredAttr = this.el.hasAttribute('aria-required') ||
|
|
200
|
-
this.el.hasAttribute('aria-required-attr');
|
|
201
|
-
const ariaRequiredFromAttr = hasAriaRequiredAttr
|
|
202
|
-
? this.el.getAttribute('aria-required') ||
|
|
203
|
-
this.el.getAttribute('aria-required-attr')
|
|
204
|
-
: null;
|
|
205
|
-
// Use aria-required if the attribute was explicitly set
|
|
206
|
-
// With reflect: true, setting the prop will also set the attribute
|
|
207
|
-
const useAriaRequired = hasAriaRequiredAttr;
|
|
208
|
-
// Determine the value: use attribute if it exists (prop reflects to attribute via reflect: true)
|
|
209
|
-
// If attribute doesn't exist, the prop was never set and we don't use aria-required
|
|
210
|
-
const ariaRequiredAttrValue = hasAriaRequiredAttr
|
|
211
|
-
? ariaRequiredFromAttr
|
|
212
|
-
: null;
|
|
213
|
-
// Determine which attributes to use
|
|
214
|
-
// If aria-required HTML attribute is present, use it (convert string to boolean)
|
|
215
|
-
// If required is set and aria-required is not "false", use native required
|
|
216
|
-
// If aria-required is "false", don't use native required even if required is set
|
|
217
|
-
const ariaRequiredValue = useAriaRequired
|
|
218
|
-
? ariaRequiredAttrValue === 'true' || ariaRequiredAttrValue === ''
|
|
219
|
-
: undefined;
|
|
220
|
-
const useNativeRequired = this.required && (!useAriaRequired || ariaRequiredValue === true);
|
|
221
|
-
return (index.h(index.Host, { key: '0800e702f2212313aba04685710981ea5c9f1e13' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'e5978fdc5f8588aba9e04571e0beb772d6c1843e', htmlFor: this.inputId }, index.h("slot", { key: 'f846862e07c1196e8f7d2c007846f40f90dea6c1', name: "label" }, this.label))), index.h("div", { key: 'a61a7551075e23adf63bb62c8a44b22fc78af72d', class: "textarea-wrapper" }, index.h("div", { key: '0e57bca81abbad3752875f3acfad7e94b1aa8f8e', class: "textarea-container", onClick: this.handleTextareaContainerClick }, index.h("textarea", { key: '9348dedab4d701980656c180d197db720061964a', id: this.inputId, ref: e => (this.textareaElement = e), placeholder: this.placeholder, autofocus: this.autofocus, name: this.name, disabled: this.disabled, readOnly: this.readonly, required: useNativeRequired ? this.required : undefined, ...(ariaRequiredValue !== undefined && {
|
|
222
|
-
'aria-required': String(ariaRequiredValue),
|
|
223
|
-
}), maxlength: this.maxlength, minlength: this.minlength, autocomplete: "off", value: this.value, onInput: this.handleTextarea, rows: this.rows, class: clsxChV9xqsO.clsx(this.resize === 'none' && 'resize-none', this.resize === 'vertical' && 'resize-y', this.resize === 'horizontal' && 'resize-x', this.resize === 'both' && 'resize') }))), (this.description ||
|
|
224
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '75e01c35855b9275c45546bbe8f1b9129365e208', class: "description" }, index.h("slot", { key: 'a0ecbbcef8a51b4d0dfaf14f3781a2e6d3d7cac3', name: "description" }, this.description))), (this.errorDescription ||
|
|
225
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '8fc8170fa84865844cb544bfbd202b459707247a', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '58d1774d57bf08c42e7c953b9606c5d9b0954ffc', name: "error-description" }, this.errorDescription)))));
|
|
226
|
-
}
|
|
227
|
-
static get formAssociated() { return true; }
|
|
228
|
-
get el() { return index.getElement(this); }
|
|
229
|
-
static get watchers() { return {
|
|
230
|
-
"rows": ["rowsChanged"],
|
|
231
|
-
"autosize": ["autosizeChanged"],
|
|
232
|
-
"value": ["handleValueChange"]
|
|
233
|
-
}; }
|
|
234
|
-
};
|
|
235
|
-
NvFieldtextarea.style = nvFieldtextareaCss;
|
|
236
|
-
|
|
237
|
-
exports.nv_fieldtextarea = NvFieldtextarea;
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-kU2nW5aN.js');
|
|
4
|
-
var clsxChV9xqsO = require('./clsx-ChV9xqsO-BtxeOLZW.js');
|
|
5
|
-
require('@stencil/react-output-target/runtime');
|
|
6
|
-
require('react');
|
|
7
|
-
require('react-dom');
|
|
8
|
-
|
|
9
|
-
const nvIconbuttonCss = "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:calc(var(--button-xs-icon-button-padding) - 1px);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:calc(var(--button-sm-icon-button-padding) - 1px);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:calc(var(--button-md-icon-button-padding) - 1px);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:calc(var(--button-lg-icon-button-padding) - 1px);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)}";
|
|
10
|
-
|
|
11
|
-
const NvIconbutton = class {
|
|
12
|
-
constructor(hostRef) {
|
|
13
|
-
index.registerInstance(this, hostRef);
|
|
14
|
-
if (hostRef.$hostElement$["s-ei"]) {
|
|
15
|
-
this.internals = hostRef.$hostElement$["s-ei"];
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
this.internals = hostRef.$hostElement$.attachInternals();
|
|
19
|
-
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
20
|
-
}
|
|
21
|
-
/****************************************************************************/
|
|
22
|
-
//#region PROPERTIES
|
|
23
|
-
/**
|
|
24
|
-
* Determines how large or small the button appears, allowing for
|
|
25
|
-
* customization of the button's dimensions to fit different design
|
|
26
|
-
* specifications and user needs.
|
|
27
|
-
*/
|
|
28
|
-
this.size = 'md';
|
|
29
|
-
/**
|
|
30
|
-
* Adjusts the button’s emphasis to make it more or less visually prominent
|
|
31
|
-
* to users. Use this to draw attention to important actions or reduce focus
|
|
32
|
-
* on less critical ones.
|
|
33
|
-
*/
|
|
34
|
-
this.emphasis = 'high';
|
|
35
|
-
/**
|
|
36
|
-
* Set this to true to show a spinner on the button, letting users know that
|
|
37
|
-
* their action is being processed. It helps improve user experience by
|
|
38
|
-
* indicating ongoing activities. The icon is not displayed when the button
|
|
39
|
-
* is loading. Also, the button is disabled. If you want to disable the
|
|
40
|
-
* button, it is not possible. It is automatically disabled when loading.
|
|
41
|
-
*/
|
|
42
|
-
this.loading = false;
|
|
43
|
-
/**
|
|
44
|
-
* Disables the button, preventing user interaction.
|
|
45
|
-
*/
|
|
46
|
-
this.disabled = false;
|
|
47
|
-
/**
|
|
48
|
-
* Makes the button look active when it’s within a compatible component
|
|
49
|
-
* like a button group.
|
|
50
|
-
*/
|
|
51
|
-
this.active = false;
|
|
52
|
-
/**
|
|
53
|
-
* Sets the button type to control its function in forms. Use 'submit' to send
|
|
54
|
-
* form data, 'reset' to clear the form, or 'button' for a standard button
|
|
55
|
-
* that doesn’t interact with form submission by default.
|
|
56
|
-
*/
|
|
57
|
-
this.type = 'button';
|
|
58
|
-
/**
|
|
59
|
-
* Sets the shape of the button. Choose between square and rounded.
|
|
60
|
-
*/
|
|
61
|
-
this.shape = 'square';
|
|
62
|
-
/**
|
|
63
|
-
* Use this to make the button skip-able when users navigate with the keyboard.
|
|
64
|
-
* The button remains clickable but won’t be reached via the Tab key.
|
|
65
|
-
*/
|
|
66
|
-
this.disableTabindex = false;
|
|
67
|
-
//#endregion PROPERTIES
|
|
68
|
-
/****************************************************************************/
|
|
69
|
-
//#region METHODS
|
|
70
|
-
/**
|
|
71
|
-
* Handles form-related actions when the button is clicked.
|
|
72
|
-
* - Submits the form if the button type is 'submit'.
|
|
73
|
-
* - Resets the form if the button type is 'reset'.
|
|
74
|
-
* @param {Event} event - The click event.
|
|
75
|
-
*/
|
|
76
|
-
this.handleClick = (event) => {
|
|
77
|
-
if (this.disabled) {
|
|
78
|
-
event.preventDefault();
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (this.type === 'submit') {
|
|
82
|
-
this.internals?.form?.requestSubmit();
|
|
83
|
-
}
|
|
84
|
-
if (this.type === 'reset') {
|
|
85
|
-
this.internals?.form?.reset();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
//#endregion METHODS
|
|
90
|
-
/****************************************************************************/
|
|
91
|
-
//#region WATCHERS
|
|
92
|
-
handleLoadingChange(loading) {
|
|
93
|
-
this.loading = loading;
|
|
94
|
-
this.disabled = loading;
|
|
95
|
-
}
|
|
96
|
-
handleDisabledChange(disabled) {
|
|
97
|
-
if (this.loading) {
|
|
98
|
-
this.disabled = this.loading;
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
this.disabled = disabled;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
//#endregion WATCHERS
|
|
105
|
-
/****************************************************************************/
|
|
106
|
-
//#region EVENTS
|
|
107
|
-
handleKeyDown(event) {
|
|
108
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
109
|
-
event.preventDefault();
|
|
110
|
-
this.el.click();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
handleTouchStart(event) {
|
|
114
|
-
if (event.touches.length > 1)
|
|
115
|
-
return;
|
|
116
|
-
event.preventDefault();
|
|
117
|
-
this.el.click();
|
|
118
|
-
}
|
|
119
|
-
//#endregion EVENTS
|
|
120
|
-
/****************************************************************************/
|
|
121
|
-
//#region LIFECYCLE
|
|
122
|
-
componentWillLoad() {
|
|
123
|
-
if (this.loading) {
|
|
124
|
-
this.disabled = this.loading;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
//#endregion LIFECYCLE
|
|
128
|
-
/****************************************************************************/
|
|
129
|
-
//#region RENDER
|
|
130
|
-
render() {
|
|
131
|
-
return (index.h(index.Host, { key: '2e0011f5ebb23512aa89756ae7fd5ad81586f8b1', role: "button", type: this.type, tabindex: this.disableTabindex ? -1 : 0, disabled: this.disabled ? true : undefined, class: clsxChV9xqsO.clsx('root', `size-${this.size}`, `emphasis-${this.emphasis}`, this.loading && 'loading', `shape-${this.shape}`), onClick: this.handleClick }, this.loading && index.h("nv-loader", { key: '435692a00ed0af3548c2ac875e573af00daf5d62', size: this.size }), !this.loading && index.h("nv-icon", { key: '00b08fbd43724ad7ce54c96cd052ba637e111ece', name: this.name, size: this.size }), index.h("slot", { key: 'bb61e7db6115c9017007f15320dd5b2f6ccd9671' })));
|
|
132
|
-
}
|
|
133
|
-
static get formAssociated() { return true; }
|
|
134
|
-
get el() { return index.getElement(this); }
|
|
135
|
-
static get watchers() { return {
|
|
136
|
-
"loading": ["handleLoadingChange"],
|
|
137
|
-
"disabled": ["handleDisabledChange"]
|
|
138
|
-
}; }
|
|
139
|
-
};
|
|
140
|
-
NvIconbutton.style = nvIconbuttonCss;
|
|
141
|
-
|
|
142
|
-
const nvLoaderCss = "@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)}";
|
|
143
|
-
|
|
144
|
-
const NvLoader = class {
|
|
145
|
-
constructor(hostRef) {
|
|
146
|
-
index.registerInstance(this, hostRef);
|
|
147
|
-
/****************************************************************************/
|
|
148
|
-
//#region PROPERTIES
|
|
149
|
-
/**
|
|
150
|
-
* Choose the size of the loader to best fit your application’s needs, whether
|
|
151
|
-
* it’s a small spinner for subtle loading indicators or a large one for more
|
|
152
|
-
* prominent displays.
|
|
153
|
-
*/
|
|
154
|
-
this.size = 'md';
|
|
155
|
-
}
|
|
156
|
-
//#endregion PROPERTIES
|
|
157
|
-
/****************************************************************************/
|
|
158
|
-
//#region RENDER
|
|
159
|
-
/* <slot> empty to force rendering change */
|
|
160
|
-
render() {
|
|
161
|
-
return (index.h(index.Host, { key: '4347ec4ee393edb5e23a60e253bae73d0f9db583', class: clsxChV9xqsO.clsx(this.size && `size-${this.size}`, this.color && `color-${this.color}`) }));
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
NvLoader.style = nvLoaderCss;
|
|
165
|
-
|
|
166
|
-
exports.nv_iconbutton = NvIconbutton;
|
|
167
|
-
exports.nv_loader = NvLoader;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-kU2nW5aN.js');
|
|
4
|
-
require('@stencil/react-output-target/runtime');
|
|
5
|
-
require('react');
|
|
6
|
-
require('react-dom');
|
|
7
|
-
|
|
8
|
-
const nvMenuitemCss = "nv-menuitem{display:flex;align-items:center;max-width:300px;width:100vw;font-size:var(--menu-contextual-item-font-size);font-weight:var(--menu-contextual-item-font-weight);color:var(--components-menu-contextual-item-content);border-radius:var(--menu-contextual-item-radius);gap:var(--menu-contextual-item-gap-x);padding:var(--menu-contextual-item-padding-y) var(--menu-contextual-item-padding-x);transition:background-color 150ms ease-out;cursor:pointer}nv-menuitem:hover,nv-menuitem:focus,nv-menuitem:focus-within{background-color:var(--components-menu-contextual-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}nv-menuitem *{pointer-events:none}nv-menuitem kbd{color:var(--components-menu-contextual-item-shortcut)}nv-menuitem [data-scope=text]{margin-right:auto}nv-menuitem[disabled]:not([disabled=false]){cursor:unset;background-color:unset;color:var(--components-menu-contextual-item-content-disabled)}";
|
|
9
|
-
|
|
10
|
-
const NvMenuitem = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
this.menuitemSelected = index.createEvent(this, "menuitemSelected", 7);
|
|
14
|
-
/**
|
|
15
|
-
* Disables the item, preventing user interaction.
|
|
16
|
-
*/
|
|
17
|
-
this.disabled = false;
|
|
18
|
-
/**
|
|
19
|
-
* If the menu item has a submenu, the a caret icon will be displayed.
|
|
20
|
-
*/
|
|
21
|
-
this.hasSubmenu = false;
|
|
22
|
-
}
|
|
23
|
-
/* eslint-enable nova/event-bubbling */
|
|
24
|
-
handleMenuItemSelect(event) {
|
|
25
|
-
// If the element is disabled, stop propagation
|
|
26
|
-
if (this.disabled) {
|
|
27
|
-
event.stopPropagation();
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
this.menuitemSelected.emit({
|
|
31
|
-
id: this.el.id,
|
|
32
|
-
name: this.name,
|
|
33
|
-
hasSubmenu: this.hasSubmenu,
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
handleClick(event) {
|
|
37
|
-
this.handleMenuItemSelect(event);
|
|
38
|
-
}
|
|
39
|
-
handleKeyDown(event) {
|
|
40
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
41
|
-
const activeElement = document.activeElement;
|
|
42
|
-
if (activeElement &&
|
|
43
|
-
activeElement.tagName === 'NV-MENUITEM' &&
|
|
44
|
-
!activeElement.hasAttribute('has-submenu')) {
|
|
45
|
-
event.preventDefault();
|
|
46
|
-
this.el.click();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
//#endregion EVENTS
|
|
51
|
-
/****************************************************************************/
|
|
52
|
-
//#region RENDER
|
|
53
|
-
render() {
|
|
54
|
-
return (index.h(index.Host, { key: 'e21f532b90f018810befe6a03ef4cb75fe05aea2', role: "menuitem", tabindex: this.disabled ? '-1' : '0' }, this.icon && index.h("nv-icon", { key: 'a63bdcae06b1311440ec95ecf002a8b9a130aea8', name: this.icon }), index.h("slot", { key: 'f25c0104369b8d70ce35d4bf74cf92c1bcdf66c6' }), this.label && index.h("span", { key: '5ab5691b53857876c8e13e91f975b41e255999da', "data-scope": "text" }, this.label), this.shortcut && !this.hasSubmenu && index.h("kbd", { key: 'c93777342da74e2cba4dfbbdf6657814b3996f41' }, this.shortcut), this.hasSubmenu && index.h("nv-icon", { key: '87a58745651c54efb1c96841846363e377ee6fca', name: "chevron-right" })));
|
|
55
|
-
}
|
|
56
|
-
get el() { return index.getElement(this); }
|
|
57
|
-
};
|
|
58
|
-
NvMenuitem.style = nvMenuitemCss;
|
|
59
|
-
|
|
60
|
-
exports.nv_menuitem = NvMenuitem;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-kU2nW5aN.js');
|
|
4
|
-
require('@stencil/react-output-target/runtime');
|
|
5
|
-
require('react');
|
|
6
|
-
require('react-dom');
|
|
7
|
-
|
|
8
|
-
const nvNotificationBulletCss = "nv-notification-bullet{display:inline-flex;align-items:center;justify-content:center;min-width:var(--sidebar-notification-bullet-size);max-width:var(--sidebar-notification-bullet-size);height:var(--sidebar-notification-bullet-size);padding:0 var(--spacing-1);border-radius:var(--radius-rounded-full);font-size:var(--sidebar-notification-bullet-font-size);font-weight:var(--sidebar-notification-bullet-font-weight);white-space:nowrap;flex-shrink:0;position:relative;}nv-notification-bullet.nv-notification-bullet-brand .nv-notification-bullet{display:inline-flex;align-items:center;justify-content:center;min-width:var(--sidebar-notification-bullet-size);max-width:var(--sidebar-notification-bullet-size);height:var(--sidebar-notification-bullet-size);padding:0 var(--spacing-1);border-radius:var(--radius-rounded-full);font-size:var(--sidebar-notification-bullet-font-size);font-weight:var(--sidebar-notification-bullet-font-weight);white-space:nowrap;flex-shrink:0}nv-notification-bullet.nv-notification-bullet-brand .nv-notification-bullet.nv-notification-bullet-high{background-color:var(--color-brand-500);color:var(--color-feedback-neutral-high-contrast-title)}nv-notification-bullet.nv-notification-bullet-brand .nv-notification-bullet.nv-notification-bullet-low{background-color:var(--color-brand-50);color:var(--color-brand-600);border:1px solid var(--color-brand-600)}nv-notification-bullet{}nv-notification-bullet.nv-notification-bullet-neutral{display:inline-flex;align-items:center;justify-content:center;min-width:var(--sidebar-notification-bullet-size);max-width:var(--sidebar-notification-bullet-size);height:var(--sidebar-notification-bullet-size);padding:0 var(--spacing-1);border-radius:var(--radius-rounded-full);font-size:var(--sidebar-notification-bullet-font-size);font-weight:var(--sidebar-notification-bullet-font-weight);white-space:nowrap;flex-shrink:0}nv-notification-bullet.nv-notification-bullet-neutral .nv-notification-bullet.nv-notification-bullet-high{background-color:var(--color-feedback-neutral-high-contrast-background);color:var(--color-feedback-neutral-high-contrast-title)}nv-notification-bullet.nv-notification-bullet-neutral .nv-notification-bullet.nv-notification-bullet-low{background-color:var(--color-feedback-neutral-low-background);color:var(--color-feedback-neutral-low-text);border-radius:var(--radius-rounded-full)}nv-notification-bullet{}nv-notification-bullet.nv-notification-bullet-with-cross-border::before{content:\"\";position:absolute;top:55%;left:45%;transform:translate(-50%, -50%);width:calc(var(--sidebar-notification-bullet-size) + 1.5px);height:calc(var(--sidebar-notification-bullet-size) * 1.5);border-radius:var(--radius-rounded-full);background-color:var(--nv-component-background, var(--nv-sidebarnavitem-background, var(--color-interaction-container-neutral-background)));z-index:-1;pointer-events:none}nv-notification-bullet{}nv-sidebar[collapsed] nv-notification-bullet.nv-notification-bullet-with-cross-border::before{width:calc(var(--sidebar-notification-bullet-size-reduced) * 1.5);height:calc(var(--sidebar-notification-bullet-size-reduced) * 1.5)}nv-notification-bullet{}nv-notification-bullet .nv-notification-bullet.nv-notification-bullet-reduced,nv-sidebar[collapsed] nv-notification-bullet .nv-notification-bullet{width:var(--sidebar-notification-bullet-size-reduced);height:var(--sidebar-notification-bullet-size-reduced);min-width:var(--sidebar-notification-bullet-size-reduced);max-width:var(--sidebar-notification-bullet-size-reduced);min-height:var(--sidebar-notification-bullet-size-reduced);max-height:var(--sidebar-notification-bullet-size-reduced);padding:0;font-size:0}";
|
|
9
|
-
|
|
10
|
-
const NvNotificationBullet = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
/**
|
|
14
|
-
* Determines the size of the notification bullet.
|
|
15
|
-
* - default: Normal size with text visible
|
|
16
|
-
* - reduced: Smaller size, text hidden (just a dot)
|
|
17
|
-
*/
|
|
18
|
-
this.size = 'default';
|
|
19
|
-
/**
|
|
20
|
-
* Allows to add a border to add contrast on background.
|
|
21
|
-
*/
|
|
22
|
-
this.contrastingBorder = false;
|
|
23
|
-
}
|
|
24
|
-
//#endregion PROPERTIES
|
|
25
|
-
/****************************************************************************/
|
|
26
|
-
//#region METHODS
|
|
27
|
-
getIntention() {
|
|
28
|
-
if (this.intention) {
|
|
29
|
-
return this.intention;
|
|
30
|
-
}
|
|
31
|
-
// Inherit from parent nv-sidebar
|
|
32
|
-
const sidebar = this.el.closest('nv-sidebar');
|
|
33
|
-
if (sidebar) {
|
|
34
|
-
const sidebarIntention = sidebar.getAttribute('notification-intention');
|
|
35
|
-
if (sidebarIntention === 'neutral' || sidebarIntention === 'brand') {
|
|
36
|
-
return sidebarIntention;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return 'brand'; // Default fallback
|
|
40
|
-
}
|
|
41
|
-
getEmphasis() {
|
|
42
|
-
if (this.emphasis) {
|
|
43
|
-
return this.emphasis;
|
|
44
|
-
}
|
|
45
|
-
// Inherit from parent nv-sidebar
|
|
46
|
-
const sidebar = this.el.closest('nv-sidebar');
|
|
47
|
-
if (sidebar) {
|
|
48
|
-
const sidebarEmphasis = sidebar.getAttribute('notification-emphasis');
|
|
49
|
-
if (sidebarEmphasis === 'high' || sidebarEmphasis === 'low') {
|
|
50
|
-
return sidebarEmphasis;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return 'high'; // Default fallback
|
|
54
|
-
}
|
|
55
|
-
//#region RENDER
|
|
56
|
-
render() {
|
|
57
|
-
const displayCount = this.count ?? 0;
|
|
58
|
-
const displayText = displayCount > 99 ? '99+' : String(displayCount);
|
|
59
|
-
if (displayCount <= 0) {
|
|
60
|
-
return index.h(index.Host, { style: { display: 'none' } });
|
|
61
|
-
}
|
|
62
|
-
const sizeClass = this.size === 'reduced' ? 'nv-notification-bullet-reduced' : '';
|
|
63
|
-
const intention = this.getIntention();
|
|
64
|
-
const emphasis = this.getEmphasis();
|
|
65
|
-
const intentionClass = `nv-notification-bullet-${intention}`;
|
|
66
|
-
const emphasisClass = `nv-notification-bullet-${emphasis}`;
|
|
67
|
-
const borderClass = this.contrastingBorder
|
|
68
|
-
? 'nv-notification-bullet-with-border'
|
|
69
|
-
: '';
|
|
70
|
-
return (index.h(index.Host, { class: `${intentionClass} ${borderClass ? 'nv-notification-bullet-with-cross-border' : ''}` }, index.h("span", { class: `nv-notification-bullet ${emphasisClass} ${sizeClass} ${borderClass}`, "aria-label": `${displayCount} notifications` }, displayText)));
|
|
71
|
-
}
|
|
72
|
-
get el() { return index.getElement(this); }
|
|
73
|
-
};
|
|
74
|
-
NvNotificationBullet.style = nvNotificationBulletCss;
|
|
75
|
-
|
|
76
|
-
exports.nv_notification_bullet = NvNotificationBullet;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-kU2nW5aN.js');
|
|
4
|
-
require('@stencil/react-output-target/runtime');
|
|
5
|
-
require('react');
|
|
6
|
-
require('react-dom');
|
|
7
|
-
|
|
8
|
-
const nvNotificationcontainerCss = "nv-notificationcontainer{position:fixed;display:flex;flex-direction:column;padding:var(--spacing-2);padding-top:0;z-index:9999;pointer-events:none;width:100%;max-width:512px}nv-notificationcontainer.position-top-right{top:0;right:0}nv-notificationcontainer.position-top-right nv-notification{margin-top:var(--spacing-2)}nv-notificationcontainer.position-top-left{top:0;left:0}nv-notificationcontainer.position-top-left nv-notification{margin-bottom:var(--spacing-2)}nv-notificationcontainer.position-top-center{top:0;left:50%;transform:translateX(-50%)}nv-notificationcontainer.position-top-center nv-notification{margin-bottom:var(--spacing-2)}nv-notificationcontainer.position-bottom-right{bottom:0;right:0;flex-direction:column-reverse}nv-notificationcontainer.position-bottom-right nv-notification{margin-top:var(--spacing-2)}nv-notificationcontainer.position-bottom-left{bottom:0;left:0;flex-direction:column-reverse}nv-notificationcontainer.position-bottom-left nv-notification{margin-top:var(--spacing-2)}nv-notificationcontainer.position-bottom-center{bottom:0;left:50%;transform:translateX(-50%);flex-direction:column-reverse}nv-notificationcontainer.position-bottom-center nv-notification{margin-top:var(--spacing-2)}nv-notificationcontainer>*{pointer-events:auto}";
|
|
9
|
-
|
|
10
|
-
const NvNotificationContainer = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
/****************************************************************************/
|
|
14
|
-
//#region PROPERTIES
|
|
15
|
-
/**
|
|
16
|
-
* Position of the notification container on the screen.
|
|
17
|
-
*/
|
|
18
|
-
this.position = 'top-right';
|
|
19
|
-
}
|
|
20
|
-
//#endregion PROPERTIES
|
|
21
|
-
/****************************************************************************/
|
|
22
|
-
//#region METHODS
|
|
23
|
-
//#endregion METHODS
|
|
24
|
-
/****************************************************************************/
|
|
25
|
-
//#region WATCHERS
|
|
26
|
-
//#endregion WATCHERS
|
|
27
|
-
/****************************************************************************/
|
|
28
|
-
//#region LIFECYCLE
|
|
29
|
-
//#endregion LIFECYCLE
|
|
30
|
-
/****************************************************************************/
|
|
31
|
-
//#region EVENTS
|
|
32
|
-
//#endregion EVENTS
|
|
33
|
-
/****************************************************************************/
|
|
34
|
-
//#region RENDER
|
|
35
|
-
render() {
|
|
36
|
-
return (index.h(index.Host, { key: '5dee0dc22cb8917d8134e2f256996118e3e30b42', class: `position-${this.position}` }, index.h("slot", { key: '14664d70fb1840877d80eda1b3c7804457ffa67f' })));
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
NvNotificationContainer.style = nvNotificationcontainerCss;
|
|
40
|
-
|
|
41
|
-
exports.nv_notificationcontainer = NvNotificationContainer;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-kU2nW5aN.js');
|
|
4
|
-
require('@stencil/react-output-target/runtime');
|
|
5
|
-
require('react');
|
|
6
|
-
require('react-dom');
|
|
7
|
-
|
|
8
|
-
const nvRowCss = "nv-row{display:flex;flex-wrap:wrap;margin-right:calc(var(--spacing-4) * -1);margin-left:calc(var(--spacing-4) * -1);row-gap:var(--spacing-4)}";
|
|
9
|
-
|
|
10
|
-
const NvRow = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
}
|
|
14
|
-
/****************************************************************************/
|
|
15
|
-
//#region RENDER
|
|
16
|
-
render() {
|
|
17
|
-
return (index.h(index.Host, { key: 'fda91377821b426a6cbc6ade6f253144a388fb62' }, index.h("slot", { key: '5d7cc9aa4d4ad0b251aa5c028adfddade4e4d1c4' })));
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
NvRow.style = nvRowCss;
|
|
21
|
-
|
|
22
|
-
exports.nv_row = NvRow;
|