@nova-design-system/nova-webcomponents 3.0.0-beta.29 → 3.0.0-beta.31
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/blazor-docs.json +25 -25
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/native.cjs.js +1 -1
- package/dist/cjs/nv-badge.cjs.entry.js +1 -1
- package/dist/cjs/nv-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdown.cjs.entry.js +1 -1
- package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +2 -2
- package/dist/cjs/nv-fielddropdownitem.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldselect.cjs.entry.js +1 -1
- package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +5 -5
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-popover.cjs.entry.js +2 -2
- package/dist/cjs/nv-popover.cjs.entry.js.map +1 -1
- package/dist/collection/components/nv-badge/nv-badge.css +20 -20
- package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.css +17 -6
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.css +9 -17
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +1 -1
- package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js.map +1 -1
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +1 -1
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +1 -1
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +8 -8
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js.map +1 -1
- package/dist/collection/components/nv-popover/nv-popover.js +3 -3
- package/dist/collection/components/nv-popover/nv-popover.js.map +1 -1
- package/dist/components/nv-badge.js +1 -1
- package/dist/components/nv-badge.js.map +1 -1
- package/dist/components/nv-fielddropdown.js +3 -3
- package/dist/components/nv-fielddropdown.js.map +1 -1
- package/dist/components/nv-fielddropdownitem.js +1 -1
- package/dist/components/nv-fieldnumber.js +1 -1
- package/dist/components/nv-fieldnumber.js.map +1 -1
- package/dist/components/nv-fieldselect.js +1 -1
- package/dist/components/nv-fieldselect.js.map +1 -1
- package/dist/components/nv-fieldtextarea.js +6 -6
- package/dist/components/nv-fieldtextarea.js.map +1 -1
- package/dist/components/nv-menu.js +1 -1
- package/dist/components/nv-popover.js +1 -1
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/{p-54ea8e62.js → p-1fa35ae5.js} +3 -3
- package/dist/components/{p-54ea8e62.js.map → p-1fa35ae5.js.map} +1 -1
- package/dist/components/{p-6c1b9782.js → p-ca5c171f.js} +3 -3
- package/dist/components/p-ca5c171f.js.map +1 -0
- package/dist/docs.json +26 -26
- package/dist/esm/loader.js +1 -1
- package/dist/esm/native.js +1 -1
- package/dist/esm/nv-badge.entry.js +1 -1
- package/dist/esm/nv-badge.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdown.entry.js +1 -1
- package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
- package/dist/esm/nv-fielddropdownitem.entry.js +2 -2
- package/dist/esm/nv-fielddropdownitem.entry.js.map +1 -1
- package/dist/esm/nv-fieldnumber.entry.js +1 -1
- package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
- package/dist/esm/nv-fieldselect.entry.js +1 -1
- package/dist/esm/nv-fieldselect.entry.js.map +1 -1
- package/dist/esm/nv-fieldtextarea.entry.js +5 -5
- package/dist/esm/nv-fieldtextarea.entry.js.map +1 -1
- package/dist/esm/nv-popover.entry.js +2 -2
- package/dist/esm/nv-popover.entry.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-cd75ee63.entry.js → p-31367928.entry.js} +2 -2
- package/dist/native/p-31367928.entry.js.map +1 -0
- package/dist/native/{p-a64baca2.entry.js → p-380bcc2b.entry.js} +2 -2
- package/dist/native/{p-a64baca2.entry.js.map → p-380bcc2b.entry.js.map} +1 -1
- package/dist/native/p-9fe47948.entry.js +2 -0
- package/dist/native/p-9fe47948.entry.js.map +1 -0
- package/dist/native/p-afbc5259.entry.js +2 -0
- package/dist/native/p-afbc5259.entry.js.map +1 -0
- package/dist/native/p-dacd68ab.entry.js +2 -0
- package/dist/native/p-dacd68ab.entry.js.map +1 -0
- package/dist/native/p-de9d0b05.entry.js +2 -0
- package/dist/native/p-de9d0b05.entry.js.map +1 -0
- package/dist/native/p-e05b0c4a.entry.js +2 -0
- package/dist/native/p-e05b0c4a.entry.js.map +1 -0
- package/dist/types/components/nv-fieldtextarea/nv-fieldtextarea.d.ts +2 -2
- package/dist/types/components.d.ts +8 -8
- package/dist/vscode-data.json +4 -4
- package/hydrate/index.js +15 -15
- package/hydrate/index.mjs +15 -15
- package/package.json +1 -1
- package/dist/components/p-6c1b9782.js.map +0 -1
- package/dist/native/p-25e410c1.entry.js +0 -2
- package/dist/native/p-25e410c1.entry.js.map +0 -1
- package/dist/native/p-3bc5875e.entry.js +0 -2
- package/dist/native/p-3bc5875e.entry.js.map +0 -1
- package/dist/native/p-8bfdda07.entry.js +0 -2
- package/dist/native/p-8bfdda07.entry.js.map +0 -1
- package/dist/native/p-c5e7ecc8.entry.js +0 -2
- package/dist/native/p-c5e7ecc8.entry.js.map +0 -1
- package/dist/native/p-cd75ee63.entry.js.map +0 -1
- package/dist/native/p-fa8a8b21.entry.js +0 -2
- package/dist/native/p-fa8a8b21.entry.js.map +0 -1
package/dist/blazor-docs.json
CHANGED
|
@@ -6735,6 +6735,30 @@
|
|
|
6735
6735
|
"getter": false,
|
|
6736
6736
|
"setter": false
|
|
6737
6737
|
},
|
|
6738
|
+
{
|
|
6739
|
+
"name": "inputId",
|
|
6740
|
+
"type": "string",
|
|
6741
|
+
"complexType": {
|
|
6742
|
+
"original": "string",
|
|
6743
|
+
"resolved": "string",
|
|
6744
|
+
"references": {}
|
|
6745
|
+
},
|
|
6746
|
+
"mutable": false,
|
|
6747
|
+
"attr": "input-id",
|
|
6748
|
+
"reflectToAttr": true,
|
|
6749
|
+
"docs": "Sets the ID for the input element and the for attribute of the associated\nlabel. If no ID is provided, a random one will be automatically generated\nto ensure unique identification, facilitating proper label association and\naccessibility.",
|
|
6750
|
+
"docsTags": [],
|
|
6751
|
+
"default": "uuidv4()",
|
|
6752
|
+
"values": [
|
|
6753
|
+
{
|
|
6754
|
+
"type": "string"
|
|
6755
|
+
}
|
|
6756
|
+
],
|
|
6757
|
+
"optional": false,
|
|
6758
|
+
"required": false,
|
|
6759
|
+
"getter": false,
|
|
6760
|
+
"setter": false
|
|
6761
|
+
},
|
|
6738
6762
|
{
|
|
6739
6763
|
"name": "label",
|
|
6740
6764
|
"type": "string",
|
|
@@ -7012,30 +7036,6 @@
|
|
|
7012
7036
|
"getter": false,
|
|
7013
7037
|
"setter": false
|
|
7014
7038
|
},
|
|
7015
|
-
{
|
|
7016
|
-
"name": "textareaId",
|
|
7017
|
-
"type": "string",
|
|
7018
|
-
"complexType": {
|
|
7019
|
-
"original": "string",
|
|
7020
|
-
"resolved": "string",
|
|
7021
|
-
"references": {}
|
|
7022
|
-
},
|
|
7023
|
-
"mutable": false,
|
|
7024
|
-
"attr": "textarea-id",
|
|
7025
|
-
"reflectToAttr": true,
|
|
7026
|
-
"docs": "Sets the ID for the textarea element and the for attribute of the associated\nlabel. If no ID is provided, a random one will be automatically generated\nto ensure unique identification, facilitating proper label association and\naccessibility.",
|
|
7027
|
-
"docsTags": [],
|
|
7028
|
-
"default": "uuidv4()",
|
|
7029
|
-
"values": [
|
|
7030
|
-
{
|
|
7031
|
-
"type": "string"
|
|
7032
|
-
}
|
|
7033
|
-
],
|
|
7034
|
-
"optional": false,
|
|
7035
|
-
"required": false,
|
|
7036
|
-
"getter": false,
|
|
7037
|
-
"setter": false
|
|
7038
|
-
},
|
|
7039
7039
|
{
|
|
7040
7040
|
"name": "validation",
|
|
7041
7041
|
"type": "string",
|
|
@@ -10591,7 +10591,7 @@
|
|
|
10591
10591
|
"reflectToAttr": false,
|
|
10592
10592
|
"docs": "Adjust the gap between the popover and its trigger element by setting how\nmany pixels they should be apart.",
|
|
10593
10593
|
"docsTags": [],
|
|
10594
|
-
"default": "
|
|
10594
|
+
"default": "6",
|
|
10595
10595
|
"values": [
|
|
10596
10596
|
{
|
|
10597
10597
|
"type": "double"
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-69764290.js');
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["nv-fielddropdown.cjs",[[68,"nv-fielddropdown",{"inputId":[513,"input-id"],"label":[513],"description":[513],"placeholder":[513],"name":[513],"open":[1540],"autocomplete":[513],"value":[1537],"required":[516],"error":[516],"errorDescription":[513,"error-description"],"readonly":[516],"disabled":[516],"emptyresult":[513],"filterable":[1540],"filterText":[32],"isFilterable":[32],"selectedValues":[32],"getFilterText":[64]},[[0,"itemSelected","handleItemSelected"],[0,"openChanged","handleOpenChanged"],[0,"keydown","handleKeyDown"]],{"filterable":["watchFilterableHandler"],"value":["watchValueHandler"]}]]],["nv-fieldpassword.cjs",[[68,"nv-fieldpassword",{"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"value":[1537],"disabled":[516],"readonly":[516],"required":[516],"error":[516],"errorDescription":[513,"error-description"],"success":[516],"maxlength":[514],"minlength":[514],"pattern":[513],"mode":[513],"autocomplete":[513],"hidePasswordIcon":[516,"hide-password-icon"],"showPassword":[516,"show-password"],"showPasswordState":[32]},null,{"showPassword":["handleShowPasswordChange"]}]]],["nv-alert.cjs",[[4,"nv-alert",{"color":[1],"feedback":[1537],"message":[513],"heading":[513],"icon":[513],"dismissible":[516],"preventAutoClose":[516,"prevent-auto-close"],"hidden":[1540]},null,{"hidden":["handleHiddenChange"]}]]],["nv-avatar.cjs",[[4,"nv-avatar",{"xsmall":[4],"small":[4],"medium":[4],"large":[4],"xlarge":[4],"text":[1],"url":[1],"alt":[513],"src":[1537],"initials":[1537],"size":[1537],"color":[513]}]]],["nv-badge.cjs",[[4,"nv-badge",{"dismissal":[4],"icon":[1],"iconLocation":[513,"icon-location"],"color":[513],"label":[513],"leadIcon":[1537,"lead-icon"],"dismissible":[1540],"hidden":[1540],"preventAutoClose":[516,"prevent-auto-close"],"_isHidden":[32]},null,{"dismissal":["handleDismissalChange"],"icon":["handleIconChange"],"hidden":["handleHiddenChange"]}]]],["nv-button.cjs",[[68,"nv-button",{"size":[513],"emphasis":[513],"danger":[516],"loading":[1540],"disabled":[1540],"fluid":[516],"type":[513]},null,{"loading":["handleLoadingChange"],"disabled":["handleDisabledChange"]}]]],["nv-fieldnumber.cjs",[[68,"nv-fieldnumber",{"message":[1],"validation":[1],"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"max":[514],"min":[514],"step":[514],"value":[1538]},null,{"value":["watchValueHandler"]}]]],["nv-fieldselect.cjs",[[68,"nv-fieldselect",{"message":[1],"validation":[1],"selectId":[513,"select-id"],"label":[513],"description":[1537],"name":[513],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"multiple":[516],"value":[1537],"displayValue":[516,"display-value"],"computedDisplayValue":[32],"internalReadonly":[32]},null,{"value":["updateDisplayValueWatcher"],"displayValue":["handleDisplayValueChange"],"readonly":["handleReadonlyChange"]}]]],["nv-fieldtext.cjs",[[68,"nv-fieldtext",{"message":[1],"validation":[1],"textInputType":[1,"text-input-type"],"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"value":[1537],"type":[1537],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"maxlength":[514],"minlength":[514],"pattern":[513],"autocomplete":[513],"multiple":[516]}]]],["nv-menu.cjs",[[4,"nv-menu",{"open":[1540],"nested":[4],"disableCloseOnSelect":[4,"disable-close-on-select"],"placement":[1],"show":[64],"close":[64]},[[2,"click","handleMenuClick"],[0,"keydown","handleKeydown"],[0,"openChanged","handleOpenChanged"]]]]],["nv-menuitem.cjs",[[4,"nv-menuitem",{"icon":[513],"disabled":[516],"shortcut":[513],"hasSubmenu":[516,"has-submenu"]}]]],["nv-tooltip.cjs",[[4,"nv-tooltip",{"message":[1],"placement":[1],"enterDelay":[2,"enter-delay"]}]]],["nv-base.cjs",[[4,"nv-base"]]],["nv-col.cjs",[[4,"nv-col",{"size":[514]}]]],["nv-datagrid.cjs",[[4,"nv-datagrid",{"columns":[16],"columnsJson":[513,"columns-json"],"data":[16],"dataJson":[513,"data-json"],"noDataMessage":[1,"no-data-message"],"noColumnsNoDataMessage":[1,"no-columns-no-data-message"],"table":[32],"parsedColumns":[32],"parsedData":[32],"hasSlotHead":[32],"hasSlotBody":[32]},null,{"columns":["parseColumns"],"columnsJson":["parseJsonColumns"],"data":["parseData"],"dataJson":["parseJsonData"],"parsedColumns":["handleParsedChange"],"parsedData":["handleParsedChange"]}]]],["nv-datagridbody.cjs",[[4,"nv-datagridbody"]]],["nv-datagridcolumn.cjs",[[4,"nv-datagridcolumn",{"header":[1],"accessor":[1]}]]],["nv-datagriddatacell.cjs",[[4,"nv-datagriddatacell",{"accessor":[1]}]]],["nv-datagridhead.cjs",[[4,"nv-datagridhead"]]],["nv-datagridrow.cjs",[[4,"nv-datagridrow"]]],["nv-fieldcheckbox.cjs",[[4,"nv-fieldcheckbox",{"message":[1],"validation":[1],"labelBefore":[4,"label-before"],"inputId":[513,"input-id"],"name":[513],"value":[513],"label":[513],"labelPlacement":[1537,"label-placement"],"hideLabel":[516,"hide-label"],"description":[1537],"error":[516],"errorDescription":[1537,"error-description"],"checked":[1540],"indeterminate":[1540],"disabled":[516],"readonly":[516],"required":[516]},[[0,"change","handleChange"]],{"checked":["onCheckedChanged"]}]]],["nv-fieldradio.cjs",[[68,"nv-fieldradio",{"message":[1],"labelBefore":[4,"label-before"],"inputId":[513,"input-id"],"name":[513],"value":[513],"label":[513],"labelPlacement":[1537,"label-placement"],"description":[1537],"error":[516],"errorDescription":[513,"error-description"],"checked":[1540],"disabled":[516]},[[0,"change","handleChange"]],{"checked":["handleCheckedChange"]}]]],["nv-fieldtextarea.cjs",[[68,"nv-fieldtextarea",{"message":[1],"validation":[1],"
|
|
11
|
+
return index.bootstrapLazy([["nv-fielddropdown.cjs",[[68,"nv-fielddropdown",{"inputId":[513,"input-id"],"label":[513],"description":[513],"placeholder":[513],"name":[513],"open":[1540],"autocomplete":[513],"value":[1537],"required":[516],"error":[516],"errorDescription":[513,"error-description"],"readonly":[516],"disabled":[516],"emptyresult":[513],"filterable":[1540],"filterText":[32],"isFilterable":[32],"selectedValues":[32],"getFilterText":[64]},[[0,"itemSelected","handleItemSelected"],[0,"openChanged","handleOpenChanged"],[0,"keydown","handleKeyDown"]],{"filterable":["watchFilterableHandler"],"value":["watchValueHandler"]}]]],["nv-fieldpassword.cjs",[[68,"nv-fieldpassword",{"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"value":[1537],"disabled":[516],"readonly":[516],"required":[516],"error":[516],"errorDescription":[513,"error-description"],"success":[516],"maxlength":[514],"minlength":[514],"pattern":[513],"mode":[513],"autocomplete":[513],"hidePasswordIcon":[516,"hide-password-icon"],"showPassword":[516,"show-password"],"showPasswordState":[32]},null,{"showPassword":["handleShowPasswordChange"]}]]],["nv-alert.cjs",[[4,"nv-alert",{"color":[1],"feedback":[1537],"message":[513],"heading":[513],"icon":[513],"dismissible":[516],"preventAutoClose":[516,"prevent-auto-close"],"hidden":[1540]},null,{"hidden":["handleHiddenChange"]}]]],["nv-avatar.cjs",[[4,"nv-avatar",{"xsmall":[4],"small":[4],"medium":[4],"large":[4],"xlarge":[4],"text":[1],"url":[1],"alt":[513],"src":[1537],"initials":[1537],"size":[1537],"color":[513]}]]],["nv-badge.cjs",[[4,"nv-badge",{"dismissal":[4],"icon":[1],"iconLocation":[513,"icon-location"],"color":[513],"label":[513],"leadIcon":[1537,"lead-icon"],"dismissible":[1540],"hidden":[1540],"preventAutoClose":[516,"prevent-auto-close"],"_isHidden":[32]},null,{"dismissal":["handleDismissalChange"],"icon":["handleIconChange"],"hidden":["handleHiddenChange"]}]]],["nv-button.cjs",[[68,"nv-button",{"size":[513],"emphasis":[513],"danger":[516],"loading":[1540],"disabled":[1540],"fluid":[516],"type":[513]},null,{"loading":["handleLoadingChange"],"disabled":["handleDisabledChange"]}]]],["nv-fieldnumber.cjs",[[68,"nv-fieldnumber",{"message":[1],"validation":[1],"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"max":[514],"min":[514],"step":[514],"value":[1538]},null,{"value":["watchValueHandler"]}]]],["nv-fieldselect.cjs",[[68,"nv-fieldselect",{"message":[1],"validation":[1],"selectId":[513,"select-id"],"label":[513],"description":[1537],"name":[513],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"multiple":[516],"value":[1537],"displayValue":[516,"display-value"],"computedDisplayValue":[32],"internalReadonly":[32]},null,{"value":["updateDisplayValueWatcher"],"displayValue":["handleDisplayValueChange"],"readonly":["handleReadonlyChange"]}]]],["nv-fieldtext.cjs",[[68,"nv-fieldtext",{"message":[1],"validation":[1],"textInputType":[1,"text-input-type"],"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"value":[1537],"type":[1537],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"maxlength":[514],"minlength":[514],"pattern":[513],"autocomplete":[513],"multiple":[516]}]]],["nv-menu.cjs",[[4,"nv-menu",{"open":[1540],"nested":[4],"disableCloseOnSelect":[4,"disable-close-on-select"],"placement":[1],"show":[64],"close":[64]},[[2,"click","handleMenuClick"],[0,"keydown","handleKeydown"],[0,"openChanged","handleOpenChanged"]]]]],["nv-menuitem.cjs",[[4,"nv-menuitem",{"icon":[513],"disabled":[516],"shortcut":[513],"hasSubmenu":[516,"has-submenu"]}]]],["nv-tooltip.cjs",[[4,"nv-tooltip",{"message":[1],"placement":[1],"enterDelay":[2,"enter-delay"]}]]],["nv-base.cjs",[[4,"nv-base"]]],["nv-col.cjs",[[4,"nv-col",{"size":[514]}]]],["nv-datagrid.cjs",[[4,"nv-datagrid",{"columns":[16],"columnsJson":[513,"columns-json"],"data":[16],"dataJson":[513,"data-json"],"noDataMessage":[1,"no-data-message"],"noColumnsNoDataMessage":[1,"no-columns-no-data-message"],"table":[32],"parsedColumns":[32],"parsedData":[32],"hasSlotHead":[32],"hasSlotBody":[32]},null,{"columns":["parseColumns"],"columnsJson":["parseJsonColumns"],"data":["parseData"],"dataJson":["parseJsonData"],"parsedColumns":["handleParsedChange"],"parsedData":["handleParsedChange"]}]]],["nv-datagridbody.cjs",[[4,"nv-datagridbody"]]],["nv-datagridcolumn.cjs",[[4,"nv-datagridcolumn",{"header":[1],"accessor":[1]}]]],["nv-datagriddatacell.cjs",[[4,"nv-datagriddatacell",{"accessor":[1]}]]],["nv-datagridhead.cjs",[[4,"nv-datagridhead"]]],["nv-datagridrow.cjs",[[4,"nv-datagridrow"]]],["nv-fieldcheckbox.cjs",[[4,"nv-fieldcheckbox",{"message":[1],"validation":[1],"labelBefore":[4,"label-before"],"inputId":[513,"input-id"],"name":[513],"value":[513],"label":[513],"labelPlacement":[1537,"label-placement"],"hideLabel":[516,"hide-label"],"description":[1537],"error":[516],"errorDescription":[1537,"error-description"],"checked":[1540],"indeterminate":[1540],"disabled":[516],"readonly":[516],"required":[516]},[[0,"change","handleChange"]],{"checked":["onCheckedChanged"]}]]],["nv-fieldradio.cjs",[[68,"nv-fieldradio",{"message":[1],"labelBefore":[4,"label-before"],"inputId":[513,"input-id"],"name":[513],"value":[513],"label":[513],"labelPlacement":[1537,"label-placement"],"description":[1537],"error":[516],"errorDescription":[513,"error-description"],"checked":[1540],"disabled":[516]},[[0,"change","handleChange"]],{"checked":["handleCheckedChange"]}]]],["nv-fieldtextarea.cjs",[[68,"nv-fieldtextarea",{"message":[1],"validation":[1],"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"value":[1537],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"maxlength":[514],"minlength":[514],"rows":[514],"resize":[513],"autosize":[516]},null,{"rows":["rowsChanged"],"autosize":["autosizeChanged"]}]]],["nv-fieldtoggle.cjs",[[4,"nv-fieldtoggle",{"inputId":[1,"input-id"],"name":[1],"value":[1],"label":[1],"labelPlacement":[513,"label-placement"],"hideLabel":[4,"hide-label"],"description":[513],"checked":[1540],"disabled":[4],"readonly":[4]},[[0,"change","handleChange"]],{"checked":["onCheckedChanged"]}]]],["nv-row.cjs",[[4,"nv-row"]]],["nv-stack.cjs",[[4,"nv-stack",{"gutter":[514],"fill":[516],"flex":[516],"full":[516],"vertical":[516]}]]],["nv-table.cjs",[[4,"nv-table",{"columns":[16],"columnsJson":[513,"columns-json"],"data":[16],"dataJson":[513,"data-json"],"noDataMessage":[1,"no-data-message"],"noColumnsNoDataMessage":[1,"no-columns-no-data-message"],"parsedColumns":[32],"parsedData":[32],"hasSlotHead":[32],"hasSlotBody":[32]},null,{"columns":["parseColumns"],"columnsJson":["parseJsonColumns"],"data":["parseData"],"dataJson":["parseJsonData"]}]]],["nv-tablebody.cjs",[[4,"nv-tablebody"]]],["nv-tablecolumn.cjs",[[4,"nv-tablecolumn",{"abbr":[1],"colspan":[2],"rowspan":[2],"headers":[1],"scope":[1]}]]],["nv-tabledatacell.cjs",[[4,"nv-tabledatacell",{"colspan":[2],"rowspan":[2],"headers":[1]}]]],["nv-tablehead.cjs",[[4,"nv-tablehead"]]],["nv-tablerow.cjs",[[4,"nv-tablerow"]]],["nv-icon.cjs",[[0,"nv-icon",{"xsmall":[4],"small":[4],"medium":[4],"large":[4],"xlarge":[4],"color":[1],"name":[513],"size":[1537],"spriteUrl":[32]}]]],["nv-fielddropdownitem.cjs",[[4,"nv-fielddropdownitem",{"disabled":[516],"selected":[1540],"value":[513],"label":[513]}]]],["nv-loader.cjs",[[0,"nv-loader",{"size":[513],"color":[513]}]]],["nv-iconbutton.cjs",[[68,"nv-iconbutton",{"size":[513],"emphasis":[513],"loading":[1540],"disabled":[1540],"active":[516],"name":[513],"type":[513],"shape":[513]},null,{"loading":["handleLoadingChange"],"disabled":["handleDisabledChange"]}]]],["nv-popover.cjs",[[4,"nv-popover",{"triggerElement":[1040],"open":[1540],"triggerMode":[1,"trigger-mode"],"placement":[1],"groupName":[1,"group-name"],"offset":[2],"hasArrow":[4,"has-arrow"],"disableFlip":[4,"disable-flip"],"shiftPadding":[2,"shift-padding"],"enterDelay":[2,"enter-delay"],"nested":[516],"show":[64],"hide":[64],"toggle":[64]},[[4,"openChanged","handleOpenChanged"],[4,"click","handleDocumentClick"],[5,"touchstart","handleDocumentTouch"]],{"open":["handleOpenChange"]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
package/dist/cjs/native.cjs.js
CHANGED
|
@@ -40,7 +40,7 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
|
40
40
|
|
|
41
41
|
patchBrowser().then(async (options) => {
|
|
42
42
|
await appGlobals.globalScripts();
|
|
43
|
-
return index.bootstrapLazy([["nv-fielddropdown.cjs",[[68,"nv-fielddropdown",{"inputId":[513,"input-id"],"label":[513],"description":[513],"placeholder":[513],"name":[513],"open":[1540],"autocomplete":[513],"value":[1537],"required":[516],"error":[516],"errorDescription":[513,"error-description"],"readonly":[516],"disabled":[516],"emptyresult":[513],"filterable":[1540],"filterText":[32],"isFilterable":[32],"selectedValues":[32],"getFilterText":[64]},[[0,"itemSelected","handleItemSelected"],[0,"openChanged","handleOpenChanged"],[0,"keydown","handleKeyDown"]],{"filterable":["watchFilterableHandler"],"value":["watchValueHandler"]}]]],["nv-fieldpassword.cjs",[[68,"nv-fieldpassword",{"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"value":[1537],"disabled":[516],"readonly":[516],"required":[516],"error":[516],"errorDescription":[513,"error-description"],"success":[516],"maxlength":[514],"minlength":[514],"pattern":[513],"mode":[513],"autocomplete":[513],"hidePasswordIcon":[516,"hide-password-icon"],"showPassword":[516,"show-password"],"showPasswordState":[32]},null,{"showPassword":["handleShowPasswordChange"]}]]],["nv-alert.cjs",[[4,"nv-alert",{"color":[1],"feedback":[1537],"message":[513],"heading":[513],"icon":[513],"dismissible":[516],"preventAutoClose":[516,"prevent-auto-close"],"hidden":[1540]},null,{"hidden":["handleHiddenChange"]}]]],["nv-avatar.cjs",[[4,"nv-avatar",{"xsmall":[4],"small":[4],"medium":[4],"large":[4],"xlarge":[4],"text":[1],"url":[1],"alt":[513],"src":[1537],"initials":[1537],"size":[1537],"color":[513]}]]],["nv-badge.cjs",[[4,"nv-badge",{"dismissal":[4],"icon":[1],"iconLocation":[513,"icon-location"],"color":[513],"label":[513],"leadIcon":[1537,"lead-icon"],"dismissible":[1540],"hidden":[1540],"preventAutoClose":[516,"prevent-auto-close"],"_isHidden":[32]},null,{"dismissal":["handleDismissalChange"],"icon":["handleIconChange"],"hidden":["handleHiddenChange"]}]]],["nv-button.cjs",[[68,"nv-button",{"size":[513],"emphasis":[513],"danger":[516],"loading":[1540],"disabled":[1540],"fluid":[516],"type":[513]},null,{"loading":["handleLoadingChange"],"disabled":["handleDisabledChange"]}]]],["nv-fieldnumber.cjs",[[68,"nv-fieldnumber",{"message":[1],"validation":[1],"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"max":[514],"min":[514],"step":[514],"value":[1538]},null,{"value":["watchValueHandler"]}]]],["nv-fieldselect.cjs",[[68,"nv-fieldselect",{"message":[1],"validation":[1],"selectId":[513,"select-id"],"label":[513],"description":[1537],"name":[513],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"multiple":[516],"value":[1537],"displayValue":[516,"display-value"],"computedDisplayValue":[32],"internalReadonly":[32]},null,{"value":["updateDisplayValueWatcher"],"displayValue":["handleDisplayValueChange"],"readonly":["handleReadonlyChange"]}]]],["nv-fieldtext.cjs",[[68,"nv-fieldtext",{"message":[1],"validation":[1],"textInputType":[1,"text-input-type"],"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"value":[1537],"type":[1537],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"maxlength":[514],"minlength":[514],"pattern":[513],"autocomplete":[513],"multiple":[516]}]]],["nv-menu.cjs",[[4,"nv-menu",{"open":[1540],"nested":[4],"disableCloseOnSelect":[4,"disable-close-on-select"],"placement":[1],"show":[64],"close":[64]},[[2,"click","handleMenuClick"],[0,"keydown","handleKeydown"],[0,"openChanged","handleOpenChanged"]]]]],["nv-menuitem.cjs",[[4,"nv-menuitem",{"icon":[513],"disabled":[516],"shortcut":[513],"hasSubmenu":[516,"has-submenu"]}]]],["nv-tooltip.cjs",[[4,"nv-tooltip",{"message":[1],"placement":[1],"enterDelay":[2,"enter-delay"]}]]],["nv-base.cjs",[[4,"nv-base"]]],["nv-col.cjs",[[4,"nv-col",{"size":[514]}]]],["nv-datagrid.cjs",[[4,"nv-datagrid",{"columns":[16],"columnsJson":[513,"columns-json"],"data":[16],"dataJson":[513,"data-json"],"noDataMessage":[1,"no-data-message"],"noColumnsNoDataMessage":[1,"no-columns-no-data-message"],"table":[32],"parsedColumns":[32],"parsedData":[32],"hasSlotHead":[32],"hasSlotBody":[32]},null,{"columns":["parseColumns"],"columnsJson":["parseJsonColumns"],"data":["parseData"],"dataJson":["parseJsonData"],"parsedColumns":["handleParsedChange"],"parsedData":["handleParsedChange"]}]]],["nv-datagridbody.cjs",[[4,"nv-datagridbody"]]],["nv-datagridcolumn.cjs",[[4,"nv-datagridcolumn",{"header":[1],"accessor":[1]}]]],["nv-datagriddatacell.cjs",[[4,"nv-datagriddatacell",{"accessor":[1]}]]],["nv-datagridhead.cjs",[[4,"nv-datagridhead"]]],["nv-datagridrow.cjs",[[4,"nv-datagridrow"]]],["nv-fieldcheckbox.cjs",[[4,"nv-fieldcheckbox",{"message":[1],"validation":[1],"labelBefore":[4,"label-before"],"inputId":[513,"input-id"],"name":[513],"value":[513],"label":[513],"labelPlacement":[1537,"label-placement"],"hideLabel":[516,"hide-label"],"description":[1537],"error":[516],"errorDescription":[1537,"error-description"],"checked":[1540],"indeterminate":[1540],"disabled":[516],"readonly":[516],"required":[516]},[[0,"change","handleChange"]],{"checked":["onCheckedChanged"]}]]],["nv-fieldradio.cjs",[[68,"nv-fieldradio",{"message":[1],"labelBefore":[4,"label-before"],"inputId":[513,"input-id"],"name":[513],"value":[513],"label":[513],"labelPlacement":[1537,"label-placement"],"description":[1537],"error":[516],"errorDescription":[513,"error-description"],"checked":[1540],"disabled":[516]},[[0,"change","handleChange"]],{"checked":["handleCheckedChange"]}]]],["nv-fieldtextarea.cjs",[[68,"nv-fieldtextarea",{"message":[1],"validation":[1],"
|
|
43
|
+
return index.bootstrapLazy([["nv-fielddropdown.cjs",[[68,"nv-fielddropdown",{"inputId":[513,"input-id"],"label":[513],"description":[513],"placeholder":[513],"name":[513],"open":[1540],"autocomplete":[513],"value":[1537],"required":[516],"error":[516],"errorDescription":[513,"error-description"],"readonly":[516],"disabled":[516],"emptyresult":[513],"filterable":[1540],"filterText":[32],"isFilterable":[32],"selectedValues":[32],"getFilterText":[64]},[[0,"itemSelected","handleItemSelected"],[0,"openChanged","handleOpenChanged"],[0,"keydown","handleKeyDown"]],{"filterable":["watchFilterableHandler"],"value":["watchValueHandler"]}]]],["nv-fieldpassword.cjs",[[68,"nv-fieldpassword",{"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"value":[1537],"disabled":[516],"readonly":[516],"required":[516],"error":[516],"errorDescription":[513,"error-description"],"success":[516],"maxlength":[514],"minlength":[514],"pattern":[513],"mode":[513],"autocomplete":[513],"hidePasswordIcon":[516,"hide-password-icon"],"showPassword":[516,"show-password"],"showPasswordState":[32]},null,{"showPassword":["handleShowPasswordChange"]}]]],["nv-alert.cjs",[[4,"nv-alert",{"color":[1],"feedback":[1537],"message":[513],"heading":[513],"icon":[513],"dismissible":[516],"preventAutoClose":[516,"prevent-auto-close"],"hidden":[1540]},null,{"hidden":["handleHiddenChange"]}]]],["nv-avatar.cjs",[[4,"nv-avatar",{"xsmall":[4],"small":[4],"medium":[4],"large":[4],"xlarge":[4],"text":[1],"url":[1],"alt":[513],"src":[1537],"initials":[1537],"size":[1537],"color":[513]}]]],["nv-badge.cjs",[[4,"nv-badge",{"dismissal":[4],"icon":[1],"iconLocation":[513,"icon-location"],"color":[513],"label":[513],"leadIcon":[1537,"lead-icon"],"dismissible":[1540],"hidden":[1540],"preventAutoClose":[516,"prevent-auto-close"],"_isHidden":[32]},null,{"dismissal":["handleDismissalChange"],"icon":["handleIconChange"],"hidden":["handleHiddenChange"]}]]],["nv-button.cjs",[[68,"nv-button",{"size":[513],"emphasis":[513],"danger":[516],"loading":[1540],"disabled":[1540],"fluid":[516],"type":[513]},null,{"loading":["handleLoadingChange"],"disabled":["handleDisabledChange"]}]]],["nv-fieldnumber.cjs",[[68,"nv-fieldnumber",{"message":[1],"validation":[1],"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"max":[514],"min":[514],"step":[514],"value":[1538]},null,{"value":["watchValueHandler"]}]]],["nv-fieldselect.cjs",[[68,"nv-fieldselect",{"message":[1],"validation":[1],"selectId":[513,"select-id"],"label":[513],"description":[1537],"name":[513],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"multiple":[516],"value":[1537],"displayValue":[516,"display-value"],"computedDisplayValue":[32],"internalReadonly":[32]},null,{"value":["updateDisplayValueWatcher"],"displayValue":["handleDisplayValueChange"],"readonly":["handleReadonlyChange"]}]]],["nv-fieldtext.cjs",[[68,"nv-fieldtext",{"message":[1],"validation":[1],"textInputType":[1,"text-input-type"],"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"value":[1537],"type":[1537],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"maxlength":[514],"minlength":[514],"pattern":[513],"autocomplete":[513],"multiple":[516]}]]],["nv-menu.cjs",[[4,"nv-menu",{"open":[1540],"nested":[4],"disableCloseOnSelect":[4,"disable-close-on-select"],"placement":[1],"show":[64],"close":[64]},[[2,"click","handleMenuClick"],[0,"keydown","handleKeydown"],[0,"openChanged","handleOpenChanged"]]]]],["nv-menuitem.cjs",[[4,"nv-menuitem",{"icon":[513],"disabled":[516],"shortcut":[513],"hasSubmenu":[516,"has-submenu"]}]]],["nv-tooltip.cjs",[[4,"nv-tooltip",{"message":[1],"placement":[1],"enterDelay":[2,"enter-delay"]}]]],["nv-base.cjs",[[4,"nv-base"]]],["nv-col.cjs",[[4,"nv-col",{"size":[514]}]]],["nv-datagrid.cjs",[[4,"nv-datagrid",{"columns":[16],"columnsJson":[513,"columns-json"],"data":[16],"dataJson":[513,"data-json"],"noDataMessage":[1,"no-data-message"],"noColumnsNoDataMessage":[1,"no-columns-no-data-message"],"table":[32],"parsedColumns":[32],"parsedData":[32],"hasSlotHead":[32],"hasSlotBody":[32]},null,{"columns":["parseColumns"],"columnsJson":["parseJsonColumns"],"data":["parseData"],"dataJson":["parseJsonData"],"parsedColumns":["handleParsedChange"],"parsedData":["handleParsedChange"]}]]],["nv-datagridbody.cjs",[[4,"nv-datagridbody"]]],["nv-datagridcolumn.cjs",[[4,"nv-datagridcolumn",{"header":[1],"accessor":[1]}]]],["nv-datagriddatacell.cjs",[[4,"nv-datagriddatacell",{"accessor":[1]}]]],["nv-datagridhead.cjs",[[4,"nv-datagridhead"]]],["nv-datagridrow.cjs",[[4,"nv-datagridrow"]]],["nv-fieldcheckbox.cjs",[[4,"nv-fieldcheckbox",{"message":[1],"validation":[1],"labelBefore":[4,"label-before"],"inputId":[513,"input-id"],"name":[513],"value":[513],"label":[513],"labelPlacement":[1537,"label-placement"],"hideLabel":[516,"hide-label"],"description":[1537],"error":[516],"errorDescription":[1537,"error-description"],"checked":[1540],"indeterminate":[1540],"disabled":[516],"readonly":[516],"required":[516]},[[0,"change","handleChange"]],{"checked":["onCheckedChanged"]}]]],["nv-fieldradio.cjs",[[68,"nv-fieldradio",{"message":[1],"labelBefore":[4,"label-before"],"inputId":[513,"input-id"],"name":[513],"value":[513],"label":[513],"labelPlacement":[1537,"label-placement"],"description":[1537],"error":[516],"errorDescription":[513,"error-description"],"checked":[1540],"disabled":[516]},[[0,"change","handleChange"]],{"checked":["handleCheckedChange"]}]]],["nv-fieldtextarea.cjs",[[68,"nv-fieldtextarea",{"message":[1],"validation":[1],"inputId":[513,"input-id"],"label":[513],"description":[1537],"placeholder":[513],"name":[513],"value":[1537],"disabled":[516],"readonly":[516],"required":[516],"error":[1540],"errorDescription":[1537,"error-description"],"success":[516],"maxlength":[514],"minlength":[514],"rows":[514],"resize":[513],"autosize":[516]},null,{"rows":["rowsChanged"],"autosize":["autosizeChanged"]}]]],["nv-fieldtoggle.cjs",[[4,"nv-fieldtoggle",{"inputId":[1,"input-id"],"name":[1],"value":[1],"label":[1],"labelPlacement":[513,"label-placement"],"hideLabel":[4,"hide-label"],"description":[513],"checked":[1540],"disabled":[4],"readonly":[4]},[[0,"change","handleChange"]],{"checked":["onCheckedChanged"]}]]],["nv-row.cjs",[[4,"nv-row"]]],["nv-stack.cjs",[[4,"nv-stack",{"gutter":[514],"fill":[516],"flex":[516],"full":[516],"vertical":[516]}]]],["nv-table.cjs",[[4,"nv-table",{"columns":[16],"columnsJson":[513,"columns-json"],"data":[16],"dataJson":[513,"data-json"],"noDataMessage":[1,"no-data-message"],"noColumnsNoDataMessage":[1,"no-columns-no-data-message"],"parsedColumns":[32],"parsedData":[32],"hasSlotHead":[32],"hasSlotBody":[32]},null,{"columns":["parseColumns"],"columnsJson":["parseJsonColumns"],"data":["parseData"],"dataJson":["parseJsonData"]}]]],["nv-tablebody.cjs",[[4,"nv-tablebody"]]],["nv-tablecolumn.cjs",[[4,"nv-tablecolumn",{"abbr":[1],"colspan":[2],"rowspan":[2],"headers":[1],"scope":[1]}]]],["nv-tabledatacell.cjs",[[4,"nv-tabledatacell",{"colspan":[2],"rowspan":[2],"headers":[1]}]]],["nv-tablehead.cjs",[[4,"nv-tablehead"]]],["nv-tablerow.cjs",[[4,"nv-tablerow"]]],["nv-icon.cjs",[[0,"nv-icon",{"xsmall":[4],"small":[4],"medium":[4],"large":[4],"xlarge":[4],"color":[1],"name":[513],"size":[1537],"spriteUrl":[32]}]]],["nv-fielddropdownitem.cjs",[[4,"nv-fielddropdownitem",{"disabled":[516],"selected":[1540],"value":[513],"label":[513]}]]],["nv-loader.cjs",[[0,"nv-loader",{"size":[513],"color":[513]}]]],["nv-iconbutton.cjs",[[68,"nv-iconbutton",{"size":[513],"emphasis":[513],"loading":[1540],"disabled":[1540],"active":[516],"name":[513],"type":[513],"shape":[513]},null,{"loading":["handleLoadingChange"],"disabled":["handleDisabledChange"]}]]],["nv-popover.cjs",[[4,"nv-popover",{"triggerElement":[1040],"open":[1540],"triggerMode":[1,"trigger-mode"],"placement":[1],"groupName":[1,"group-name"],"offset":[2],"hasArrow":[4,"has-arrow"],"disableFlip":[4,"disable-flip"],"shiftPadding":[2,"shift-padding"],"enterDelay":[2,"enter-delay"],"nested":[516],"show":[64],"hide":[64],"toggle":[64]},[[4,"openChanged","handleOpenChanged"],[4,"click","handleDocumentClick"],[5,"touchstart","handleDocumentTouch"]],{"open":["handleOpenChange"]}]]]], options);
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
exports.setNonce = index.setNonce;
|
|
@@ -7,7 +7,7 @@ const clsx = require('./clsx-fc789adc.js');
|
|
|
7
7
|
const timeline_animation = require('./timeline.animation-dbb9c5ea.js');
|
|
8
8
|
const fade_animation = require('./fade.animation-0d33d198.js');
|
|
9
9
|
|
|
10
|
-
const nvBadgeCss = "nv-icon{display:inline-block;width:fit-content;height:fit-content;color:inherit}nv-icon>.nv-icon-xs{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-icon>.nv-icon-sm{width:var(--spacing-4);height:var(--spacing-4);stroke-width:1.5px}nv-icon>.nv-icon-md{width:var(--spacing-5);height:var(--spacing-5);stroke-width:1.6px}nv-icon>.nv-icon-lg{width:var(--spacing-6);height:var(--spacing-6);stroke-width:1.8px}nv-icon>.nv-icon-xl{width:var(--spacing-7);height:var(--spacing-7);stroke-width:1.9px}nv-badge{padding:var(--badge-padding-y) var(--badge-padding-x);display:inline-flex !important;vertical-align:middle;align-items:center;border-radius:var(--radius-rounded-full);height:fit-content;width:fit-content}nv-badge.with-gap{padding:var(--badge-padding-y) var(--badge-padding-x);display:inline-flex !important;vertical-align:middle;align-items:center;border-radius:var(--radius-rounded-full);height:fit-content;width:fit-content;gap:var(--badge-gap-x)}nv-badge:not(.with-gap){padding:var(--badge-padding-y) var(--badge-padding-x);display:inline-flex !important;vertical-align:middle;align-items:center;border-radius:var(--radius-rounded-full);height:fit-content;width:fit-content}nv-badge.badge-1{color:var(--color-rainbow-1-
|
|
10
|
+
const nvBadgeCss = "nv-icon{display:inline-block;width:fit-content;height:fit-content;color:inherit}nv-icon>.nv-icon-xs{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-icon>.nv-icon-sm{width:var(--spacing-4);height:var(--spacing-4);stroke-width:1.5px}nv-icon>.nv-icon-md{width:var(--spacing-5);height:var(--spacing-5);stroke-width:1.6px}nv-icon>.nv-icon-lg{width:var(--spacing-6);height:var(--spacing-6);stroke-width:1.8px}nv-icon>.nv-icon-xl{width:var(--spacing-7);height:var(--spacing-7);stroke-width:1.9px}nv-badge{padding:var(--badge-padding-y) var(--badge-padding-x);display:inline-flex !important;vertical-align:middle;align-items:center;border-radius:var(--radius-rounded-full);height:fit-content;width:fit-content}nv-badge.with-gap{padding:var(--badge-padding-y) var(--badge-padding-x);display:inline-flex !important;vertical-align:middle;align-items:center;border-radius:var(--radius-rounded-full);height:fit-content;width:fit-content;gap:var(--badge-gap-x)}nv-badge:not(.with-gap){padding:var(--badge-padding-y) var(--badge-padding-x);display:inline-flex !important;vertical-align:middle;align-items:center;border-radius:var(--radius-rounded-full);height:fit-content;width:fit-content}nv-badge.badge-1{color:var(--color-rainbow-1-text);background-color:var(--color-rainbow-1-background)}nv-badge.badge-1 .close:focus,nv-badge.badge-1 .close:focus-within{outline:none}nv-badge.badge-1 .close:focus-visible,nv-badge.badge-1 .close:has(:focus-visible){outline:var(--focus-outline-stroke) solid var(--color-rainbow-1-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-1 nv-icon{color:var(--color-rainbow-1-icon)}nv-badge.badge-2{color:var(--color-rainbow-2-text);background-color:var(--color-rainbow-2-background)}nv-badge.badge-2 .close:focus,nv-badge.badge-2 .close:focus-within{outline:none}nv-badge.badge-2 .close:focus-visible,nv-badge.badge-2 .close:has(:focus-visible){outline:var(--focus-outline-stroke) solid var(--color-rainbow-2-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-2 nv-icon{color:var(--color-rainbow-2-icon)}nv-badge.badge-3{color:var(--color-rainbow-3-text);background-color:var(--color-rainbow-3-background)}nv-badge.badge-3 .close:focus,nv-badge.badge-3 .close:focus-within{outline:none}nv-badge.badge-3 .close:focus-visible,nv-badge.badge-3 .close:has(:focus-visible){outline:var(--focus-outline-stroke) solid var(--color-rainbow-3-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-3 nv-icon{color:var(--color-rainbow-3-icon)}nv-badge.badge-4{color:var(--color-rainbow-4-text);background-color:var(--color-rainbow-4-background)}nv-badge.badge-4 .close:focus,nv-badge.badge-4 .close:focus-within{outline:none}nv-badge.badge-4 .close:focus-visible,nv-badge.badge-4 .close:has(:focus-visible){outline:var(--focus-outline-stroke) solid var(--color-rainbow-4-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-4 nv-icon{color:var(--color-rainbow-4-icon)}nv-badge.badge-5{color:var(--color-rainbow-5-text);background-color:var(--color-rainbow-5-background)}nv-badge.badge-5 .close:focus,nv-badge.badge-5 .close:focus-within{outline:none}nv-badge.badge-5 .close:focus-visible,nv-badge.badge-5 .close:has(:focus-visible){outline:var(--focus-outline-stroke) solid var(--color-rainbow-5-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-5 nv-icon{color:var(--color-rainbow-5-icon)}nv-badge.badge-6{color:var(--color-rainbow-6-text);background-color:var(--color-rainbow-6-background)}nv-badge.badge-6 .close:focus,nv-badge.badge-6 .close:focus-within{outline:none}nv-badge.badge-6 .close:focus-visible,nv-badge.badge-6 .close:has(:focus-visible){outline:var(--focus-outline-stroke) solid var(--color-rainbow-6-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-6 nv-icon{color:var(--color-rainbow-6-icon)}nv-badge.badge-7{color:var(--color-rainbow-7-text);background-color:var(--color-rainbow-7-background)}nv-badge.badge-7 .close:focus,nv-badge.badge-7 .close:focus-within{outline:none}nv-badge.badge-7 .close:focus-visible,nv-badge.badge-7 .close:has(:focus-visible){outline:var(--focus-outline-stroke) solid var(--color-rainbow-7-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-7 nv-icon{color:var(--color-rainbow-7-icon)}nv-badge.badge-8{color:var(--color-rainbow-8-text);background-color:var(--color-rainbow-8-background)}nv-badge.badge-8 .close:focus,nv-badge.badge-8 .close:focus-within{outline:none}nv-badge.badge-8 .close:focus-visible,nv-badge.badge-8 .close:has(:focus-visible){outline:var(--focus-outline-stroke) solid var(--color-rainbow-8-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-8 nv-icon{color:var(--color-rainbow-8-icon)}nv-badge.badge-9{color:var(--color-rainbow-9-text);background-color:var(--color-rainbow-9-background)}nv-badge.badge-9 .close:focus,nv-badge.badge-9 .close:focus-within{outline:none}nv-badge.badge-9 .close:focus-visible,nv-badge.badge-9 .close:has(:focus-visible){outline:var(--focus-outline-stroke) solid var(--color-rainbow-9-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-9 nv-icon{color:var(--color-rainbow-9-icon)}nv-badge.badge-10{color:var(--color-rainbow-10-text);background-color:var(--color-rainbow-10-background)}nv-badge.badge-10 .close:focus,nv-badge.badge-10 .close:focus-within{outline:none}nv-badge.badge-10 .close:focus-visible,nv-badge.badge-10 .close:has(:focus-visible){outline:var(--focus-outline-stroke) solid var(--color-rainbow-10-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-10 nv-icon{color:var(--color-rainbow-10-icon)}nv-badge span{font-size:var(--font-size-xs);line-height:var(--line-height-xs) !important}nv-badge nv-icon>svg.icon-xs{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge nv-icon>svg.icon-sm{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge nv-icon>svg.icon-md{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge nv-icon>svg.icon-lg{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge nv-icon>svg.icon-xl{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge .close{padding:0;line-height:0;border:none;background:none;cursor:pointer;color:inherit;display:inline-flex;align-items:center;aspect-ratio:1/1;border-radius:var(--radius-rounded-full)}";
|
|
11
11
|
const NvBadgeStyle0 = nvBadgeCss;
|
|
12
12
|
|
|
13
13
|
const NvBadge = class {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"nv-badge.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,UAAU,GAAG,w4MAAw4M,CAAC;AAC55M,sBAAe,UAAU;;MCqBZ,OAAO;IALpB;;;;;;;;;;;QAgBW,cAAS,GAAY,KAAK,CAAC;;;;;;;QAwB3B,UAAK,GAAY,GAAG,CAAC;;;;QAMrB,UAAK,GAAmB,IAAI,CAAC;;;;QAMtC,aAAQ,GAAmB,IAAI,CAAC;;;;QAMhC,gBAAW,GAAY,KAAK,CAAC;;;;QAM7B,WAAM,GAAY,KAAK,CAAC;QAEhB,cAAS,GAAY,IAAI,CAAC,MAAM,CAAC;;;;;QAOhC,qBAAgB,GAAY,KAAK,CAAC;;;;;;;;QAoG1B,gBAAW,GAAG,CAAC,aAA0B;YACxD,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;gBAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;aACpB;YAED,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;SACvC,CAAC;KAmCH;;;;;;;;IA3GC,qBAAqB,CAAC,SAAkB;QACtC,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;KAC9B;;;;;IAOD,gBAAgB,CAAC,IAAY;QAC3B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;KACtB;;;;;IAOD,MAAM,kBAAkB,CAAC,MAAe;QACtC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI;YA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KAAK,EAAEC,SAAI,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE,EAAE;gBACjC,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,UAAU,EAAE,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK;gBAC1C,iBAAiB,EAAE,IAAI,CAAC,SAAS;aAClC,CAAC,IAEFF,mEAAM,IAAI,EAAC,cAAc,IACtB,IAAI,CAAC,QAAQ,KACZA,sEACE,IAAI,EAAC,cAAc,EACnB,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,IAAI,EAAC,IAAI,GACA,CACZ,CACI,EACN,IAAI,CAAC,KAAK,IAAIA,qEAAO,IAAI,CAAC,KAAK,CAAQ,EACvC,IAAI,CAAC,WAAW,KACfA,qEAAQ,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,IAC5DA,sEAAS,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,IAAI,GAAG,CACvB,CACV,CACI,EACP;KACH;;;;;;;;;;;;","names":["useFade","useCollapse","timeline","h","Host","clsx"],"sources":["src/components/nv-badge/nv-badge.scss?tag=nv-badge","src/components/nv-badge/nv-badge.tsx"],"sourcesContent":["@use \"sass:map\";\n@use \"../nv-icon/nv-icon.scss\" as icon;\n@import \"../../styles/focus-ring\";\n\n/* Variants */\n$badge-colors: (\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\");\n\n/* Define maps for color-related variables */\n$color-rainbow-content: (\n \"1\": var(--color-rainbow-1-content),\n \"2\": var(--color-rainbow-2-content),\n \"3\": var(--color-rainbow-3-content),\n \"4\": var(--color-rainbow-4-content),\n \"5\": var(--color-rainbow-5-content),\n \"6\": var(--color-rainbow-6-content),\n \"7\": var(--color-rainbow-7-content),\n \"8\": var(--color-rainbow-8-content),\n \"9\": var(--color-rainbow-9-content),\n \"10\": var(--color-rainbow-10-content)\n);\n\n$color-rainbow-background: (\n \"1\": var(--color-rainbow-1-background),\n \"2\": var(--color-rainbow-2-background),\n \"3\": var(--color-rainbow-3-background),\n \"4\": var(--color-rainbow-4-background),\n \"5\": var(--color-rainbow-5-background),\n \"6\": var(--color-rainbow-6-background),\n \"7\": var(--color-rainbow-7-background),\n \"8\": var(--color-rainbow-8-background),\n \"9\": var(--color-rainbow-9-background),\n \"10\": var(--color-rainbow-10-background)\n);\n\n@mixin root-styles() {\n padding: var(--badge-padding-y) var(--badge-padding-x);\n display: inline-flex !important; // override the display: none in [hidden] css\n vertical-align: middle;\n align-items: center;\n border-radius: var(--radius-rounded-full);\n height: fit-content;\n width: fit-content;\n}\n\n@mixin root-styles-with-gap() {\n @include root-styles();\n gap: var(--badge-gap-x);\n}\n\n@mixin badge-color($badge-number) {\n color: map.get($color-rainbow-content, $badge-number);\n background-color: map.get($color-rainbow-background, $badge-number);\n .close {\n @include focus-ring(var(--color-rainbow-#{$badge-number}-content), 0.2);\n }\n}\n\n@mixin icon-color($badge-number) {\n color: map.get($color-rainbow-content, $badge-number);\n}\n\n@mixin type-settings($font-size, $line-height) {\n font-size: var(--font-size-xs);\n line-height: var(--line-height-xs) !important;\n}\n\nnv-badge {\n @include root-styles();\n\n //gap styles\n &.with-gap {\n @include root-styles-with-gap();\n }\n\n &:not(.with-gap) {\n @include root-styles();\n }\n\n // color styles\n @each $i in $badge-colors {\n &.badge-#{$i} {\n @include badge-color($i);\n nv-icon {\n @include icon-color($i);\n }\n }\n }\n\n //label styles\n & span {\n @include type-settings(xs, xs);\n }\n\n // nv-icon styles\n & nv-icon > svg {\n @each $size, $config in icon.$icon-config {\n &.icon-#{$size} {\n @include icon.icon-size-and-stroke(\n map.get(map.get(icon.$icon-config, \"xs\"), size),\n map.get(map.get(icon.$icon-config, \"xs\"), stroke)\n );\n }\n }\n }\n\n .close {\n padding: 0;\n line-height: 0;\n border: none;\n background: none;\n cursor: pointer;\n color: inherit;\n display: inline-flex;\n align-items: center;\n aspect-ratio: 1/1;\n border-radius: var(--radius-rounded-full);\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Watch,\n Element,\n State,\n} from '@stencil/core';\nimport clsx from 'clsx';\nimport { useFade, useCollapse, timeline } from '../../animations';\n\n/**\n * @slot leading-icon - Icon before the label.\n */\n@Component({\n tag: 'nv-badge',\n styleUrl: 'nv-badge.scss',\n shadow: false,\n})\nexport class NvBadge {\n @Element() ref: HTMLNvBadgeElement;\n\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Whether the badge is dismissible.\n * @deprecated use dismissible instead.\n */\n @Prop()\n readonly dismissal: boolean = false;\n\n /**\n * The icon to display in the badge.\n * @deprecated use leadIcon or slot=\"leading-icon\" instead.\n */\n @Prop()\n readonly icon: string;\n\n /**\n * The location of the icon in the badge.\n * @deprecated only leadIcon now.\n */\n @Prop({ reflect: true })\n readonly iconLocation: 'left' | 'right';\n\n //#endregion DEPRECATED\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * The color of the badge. Use a string between 1 to 10\n */\n @Prop({ reflect: true })\n readonly color?: string = '1';\n\n /**\n * Main content of the badge.\n */\n @Prop({ reflect: true })\n readonly label?: string | null = null;\n\n /**\n * The lead icon of the badge.\n */\n @Prop({ reflect: true, mutable: true })\n leadIcon?: string | null = null;\n\n /**\n * Whether the badge is dismissible.\n */\n @Prop({ reflect: true, mutable: true })\n dismissible: boolean = false;\n\n /**\n * Controls the visibility of the badge. Will animate with fade and collapse.\n */\n @Prop({ reflect: true, mutable: true })\n hidden: boolean = false; // eslint-disable-line @stencil-community/reserved-member-names\n @State()\n private _isHidden: boolean = this.hidden;\n\n /**\n * When true, the alert does not automatically close upon dismissing.\n * Useful for externally controlled component behavior.\n */\n @Prop({ reflect: true })\n readonly preventAutoClose: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the badge is dismissed.\n */\n @Event()\n closeClicked: EventEmitter<MouseEvent>;\n\n /**\n * Emits when the 'hidden' prop changes, reflecting a change in visibility.\n * Passes hidden value to the detail.\n */\n @Event()\n hiddenChanged: EventEmitter<boolean>;\n\n /**\n * Emitted when the animations complete, detail includes the hidden value.\n */\n @Event()\n hiddenChangedComplete: EventEmitter<boolean>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n /**\n * Handles the dismissal prop change.\n * @param {boolean} dismissal - The new dismissal value.\n */\n @Watch('dismissal')\n handleDismissalChange(dismissal: boolean) {\n this.dismissible = dismissal;\n }\n\n /**\n * Handles the icon prop change.\n * @param {string} icon - The new icon value.\n */\n @Watch('icon')\n handleIconChange(icon: string) {\n this.leadIcon = icon;\n }\n\n /**\n * Handles the hidden prop change.\n * @param {boolean} hidden - The new hidden value.\n */\n @Watch('hidden')\n async handleHiddenChange(hidden: boolean) {\n this.hiddenChanged.emit(hidden);\n if (this._isHidden === true) this._isHidden = hidden;\n\n const { fadeIn, fadeOut } = useFade(this.ref, { duration: 150 });\n const { collapse, expand } = useCollapse(this.ref, { duration: 150 });\n\n if (hidden === true) await timeline(fadeOut, collapse).start();\n if (hidden === false) await timeline(expand, fadeIn).start();\n\n this.hiddenChangedComplete.emit(hidden);\n\n if (this._isHidden === false) this._isHidden = hidden;\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region LIFECYCLE\n\n /**\n * Component will load.\n */\n componentWillLoad() {\n if (this.dismissal) {\n this.dismissible = this.dismissal;\n }\n\n if (this.icon != null && this.icon != '') {\n this.leadIcon = this.icon;\n }\n\n if (this.hidden) {\n const { setCollapsed } = useCollapse(this.ref);\n const { setFadeOut } = useFade(this.ref);\n\n setCollapsed();\n setFadeOut();\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles the close button click.\n * @param {MouseEvent} originalEvent - The original event.\n */\n private readonly handleClose = (originalEvent?: MouseEvent) => {\n if (!this.preventAutoClose) {\n this.hidden = true;\n }\n\n this.closeClicked.emit(originalEvent);\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host\n class={clsx(`badge-${this.color}`, {\n 'has-close': this.dismissible,\n 'with-gap': this.dismissible || this.label,\n 'visually-hidden': this._isHidden,\n })}\n >\n <slot name=\"leading-icon\">\n {this.leadIcon && (\n <nv-icon\n slot=\"leading-icon\"\n name={this.leadIcon}\n size=\"sm\"\n ></nv-icon>\n )}\n </slot>\n {this.label && <span>{this.label}</span>}\n {this.dismissible && (\n <button onClick={this.handleClose} class=\"close\" type=\"button\">\n <nv-icon name=\"x\" size=\"sm\" />\n </button>\n )}\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
|
|
1
|
+
{"file":"nv-badge.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,UAAU,GAAG,40MAA40M,CAAC;AACh2M,sBAAe,UAAU;;MCqBZ,OAAO;IALpB;;;;;;;;;;;QAgBW,cAAS,GAAY,KAAK,CAAC;;;;;;;QAwB3B,UAAK,GAAY,GAAG,CAAC;;;;QAMrB,UAAK,GAAmB,IAAI,CAAC;;;;QAMtC,aAAQ,GAAmB,IAAI,CAAC;;;;QAMhC,gBAAW,GAAY,KAAK,CAAC;;;;QAM7B,WAAM,GAAY,KAAK,CAAC;QAEhB,cAAS,GAAY,IAAI,CAAC,MAAM,CAAC;;;;;QAOhC,qBAAgB,GAAY,KAAK,CAAC;;;;;;;;QAoG1B,gBAAW,GAAG,CAAC,aAA0B;YACxD,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;gBAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;aACpB;YAED,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;SACvC,CAAC;KAmCH;;;;;;;;IA3GC,qBAAqB,CAAC,SAAkB;QACtC,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;KAC9B;;;;;IAOD,gBAAgB,CAAC,IAAY;QAC3B,IAAI,CAAC,QAAQ,GAAG,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AAE,GAAGD,sBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAEzC,YAAY,EAAE,CAAC;YACf,UAAU,EAAE,CAAC;SACd;KACF;;;;IAsBD,MAAM;QACJ,QACEG,QAACC,UAAI,qDACH,KAAK,EAAEC,SAAI,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE,EAAE;gBACjC,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,UAAU,EAAE,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK;gBAC1C,iBAAiB,EAAE,IAAI,CAAC,SAAS;aAClC,CAAC,IAEFF,mEAAM,IAAI,EAAC,cAAc,IACtB,IAAI,CAAC,QAAQ,KACZA,sEACE,IAAI,EAAC,cAAc,EACnB,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,IAAI,EAAC,IAAI,GACA,CACZ,CACI,EACN,IAAI,CAAC,KAAK,IAAIA,qEAAO,IAAI,CAAC,KAAK,CAAQ,EACvC,IAAI,CAAC,WAAW,KACfA,qEAAQ,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,IAC5DA,sEAAS,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,IAAI,GAAG,CACvB,CACV,CACI,EACP;KACH;;;;;;;;;;;;","names":["useFade","useCollapse","timeline","h","Host","clsx"],"sources":["src/components/nv-badge/nv-badge.scss?tag=nv-badge","src/components/nv-badge/nv-badge.tsx"],"sourcesContent":["@use \"sass:map\";\n@use \"../nv-icon/nv-icon.scss\" as icon;\n@import \"../../styles/focus-ring\";\n\n/* Variants */\n$badge-colors: (\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\");\n\n/* Define maps for color-related variables */\n$color-rainbow-text: (\n \"1\": var(--color-rainbow-1-text),\n \"2\": var(--color-rainbow-2-text),\n \"3\": var(--color-rainbow-3-text),\n \"4\": var(--color-rainbow-4-text),\n \"5\": var(--color-rainbow-5-text),\n \"6\": var(--color-rainbow-6-text),\n \"7\": var(--color-rainbow-7-text),\n \"8\": var(--color-rainbow-8-text),\n \"9\": var(--color-rainbow-9-text),\n \"10\": var(--color-rainbow-10-text)\n);\n\n$color-rainbow-icon: (\n \"1\": var(--color-rainbow-1-icon),\n \"2\": var(--color-rainbow-2-icon),\n \"3\": var(--color-rainbow-3-icon),\n \"4\": var(--color-rainbow-4-icon),\n \"5\": var(--color-rainbow-5-icon),\n \"6\": var(--color-rainbow-6-icon),\n \"7\": var(--color-rainbow-7-icon),\n \"8\": var(--color-rainbow-8-icon),\n \"9\": var(--color-rainbow-9-icon),\n \"10\": var(--color-rainbow-10-icon)\n);\n\n$color-rainbow-background: (\n \"1\": var(--color-rainbow-1-background),\n \"2\": var(--color-rainbow-2-background),\n \"3\": var(--color-rainbow-3-background),\n \"4\": var(--color-rainbow-4-background),\n \"5\": var(--color-rainbow-5-background),\n \"6\": var(--color-rainbow-6-background),\n \"7\": var(--color-rainbow-7-background),\n \"8\": var(--color-rainbow-8-background),\n \"9\": var(--color-rainbow-9-background),\n \"10\": var(--color-rainbow-10-background)\n);\n\n@mixin root-styles() {\n padding: var(--badge-padding-y) var(--badge-padding-x);\n display: inline-flex !important; // override the display: none in [hidden] css\n vertical-align: middle;\n align-items: center;\n border-radius: var(--radius-rounded-full);\n height: fit-content;\n width: fit-content;\n}\n\n@mixin root-styles-with-gap() {\n @include root-styles();\n gap: var(--badge-gap-x);\n}\n\n@mixin badge-color($badge-number) {\n color: map.get($color-rainbow-text, $badge-number);\n background-color: map.get($color-rainbow-background, $badge-number);\n .close {\n @include focus-ring(var(--color-rainbow-#{$badge-number}-content), 0.2);\n }\n}\n\n@mixin icon-color($badge-number) {\n color: map.get($color-rainbow-icon, $badge-number);\n}\n\n@mixin type-settings($font-size, $line-height) {\n font-size: var(--font-size-xs);\n line-height: var(--line-height-xs) !important;\n}\n\nnv-badge {\n @include root-styles();\n\n //gap styles\n &.with-gap {\n @include root-styles-with-gap();\n }\n\n &:not(.with-gap) {\n @include root-styles();\n }\n\n // color styles\n @each $i in $badge-colors {\n &.badge-#{$i} {\n @include badge-color($i);\n nv-icon {\n @include icon-color($i);\n }\n }\n }\n\n //label styles\n & span {\n @include type-settings(xs, xs);\n }\n\n // nv-icon styles\n & nv-icon > svg {\n @each $size, $config in icon.$icon-config {\n &.icon-#{$size} {\n @include icon.icon-size-and-stroke(\n map.get(map.get(icon.$icon-config, \"xs\"), size),\n map.get(map.get(icon.$icon-config, \"xs\"), stroke)\n );\n }\n }\n }\n\n .close {\n padding: 0;\n line-height: 0;\n border: none;\n background: none;\n cursor: pointer;\n color: inherit;\n display: inline-flex;\n align-items: center;\n aspect-ratio: 1/1;\n border-radius: var(--radius-rounded-full);\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Watch,\n Element,\n State,\n} from '@stencil/core';\nimport clsx from 'clsx';\nimport { useFade, useCollapse, timeline } from '../../animations';\n\n/**\n * @slot leading-icon - Icon before the label.\n */\n@Component({\n tag: 'nv-badge',\n styleUrl: 'nv-badge.scss',\n shadow: false,\n})\nexport class NvBadge {\n @Element() ref: HTMLNvBadgeElement;\n\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Whether the badge is dismissible.\n * @deprecated use dismissible instead.\n */\n @Prop()\n readonly dismissal: boolean = false;\n\n /**\n * The icon to display in the badge.\n * @deprecated use leadIcon or slot=\"leading-icon\" instead.\n */\n @Prop()\n readonly icon: string;\n\n /**\n * The location of the icon in the badge.\n * @deprecated only leadIcon now.\n */\n @Prop({ reflect: true })\n readonly iconLocation: 'left' | 'right';\n\n //#endregion DEPRECATED\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * The color of the badge. Use a string between 1 to 10\n */\n @Prop({ reflect: true })\n readonly color?: string = '1';\n\n /**\n * Main content of the badge.\n */\n @Prop({ reflect: true })\n readonly label?: string | null = null;\n\n /**\n * The lead icon of the badge.\n */\n @Prop({ reflect: true, mutable: true })\n leadIcon?: string | null = null;\n\n /**\n * Whether the badge is dismissible.\n */\n @Prop({ reflect: true, mutable: true })\n dismissible: boolean = false;\n\n /**\n * Controls the visibility of the badge. Will animate with fade and collapse.\n */\n @Prop({ reflect: true, mutable: true })\n hidden: boolean = false; // eslint-disable-line @stencil-community/reserved-member-names\n @State()\n private _isHidden: boolean = this.hidden;\n\n /**\n * When true, the alert does not automatically close upon dismissing.\n * Useful for externally controlled component behavior.\n */\n @Prop({ reflect: true })\n readonly preventAutoClose: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the badge is dismissed.\n */\n @Event()\n closeClicked: EventEmitter<MouseEvent>;\n\n /**\n * Emits when the 'hidden' prop changes, reflecting a change in visibility.\n * Passes hidden value to the detail.\n */\n @Event()\n hiddenChanged: EventEmitter<boolean>;\n\n /**\n * Emitted when the animations complete, detail includes the hidden value.\n */\n @Event()\n hiddenChangedComplete: EventEmitter<boolean>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n /**\n * Handles the dismissal prop change.\n * @param {boolean} dismissal - The new dismissal value.\n */\n @Watch('dismissal')\n handleDismissalChange(dismissal: boolean) {\n this.dismissible = dismissal;\n }\n\n /**\n * Handles the icon prop change.\n * @param {string} icon - The new icon value.\n */\n @Watch('icon')\n handleIconChange(icon: string) {\n this.leadIcon = icon;\n }\n\n /**\n * Handles the hidden prop change.\n * @param {boolean} hidden - The new hidden value.\n */\n @Watch('hidden')\n async handleHiddenChange(hidden: boolean) {\n this.hiddenChanged.emit(hidden);\n if (this._isHidden === true) this._isHidden = hidden;\n\n const { fadeIn, fadeOut } = useFade(this.ref, { duration: 150 });\n const { collapse, expand } = useCollapse(this.ref, { duration: 150 });\n\n if (hidden === true) await timeline(fadeOut, collapse).start();\n if (hidden === false) await timeline(expand, fadeIn).start();\n\n this.hiddenChangedComplete.emit(hidden);\n\n if (this._isHidden === false) this._isHidden = hidden;\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region LIFECYCLE\n\n /**\n * Component will load.\n */\n componentWillLoad() {\n if (this.dismissal) {\n this.dismissible = this.dismissal;\n }\n\n if (this.icon != null && this.icon != '') {\n this.leadIcon = this.icon;\n }\n\n if (this.hidden) {\n const { setCollapsed } = useCollapse(this.ref);\n const { setFadeOut } = useFade(this.ref);\n\n setCollapsed();\n setFadeOut();\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles the close button click.\n * @param {MouseEvent} originalEvent - The original event.\n */\n private readonly handleClose = (originalEvent?: MouseEvent) => {\n if (!this.preventAutoClose) {\n this.hidden = true;\n }\n\n this.closeClicked.emit(originalEvent);\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host\n class={clsx(`badge-${this.color}`, {\n 'has-close': this.dismissible,\n 'with-gap': this.dismissible || this.label,\n 'visually-hidden': this._isHidden,\n })}\n >\n <slot name=\"leading-icon\">\n {this.leadIcon && (\n <nv-icon\n slot=\"leading-icon\"\n name={this.leadIcon}\n size=\"sm\"\n ></nv-icon>\n )}\n </slot>\n {this.label && <span>{this.label}</span>}\n {this.dismissible && (\n <button onClick={this.handleClose} class=\"close\" type=\"button\">\n <nv-icon name=\"x\" size=\"sm\" />\n </button>\n )}\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-72b8a9ad.js');
|
|
6
6
|
const v4 = require('./v4-7014b8b0.js');
|
|
7
7
|
|
|
8
|
-
const nvFielddropdownCss = "nv-fielddropdown{--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}nv-fielddropdown[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-fielddropdown[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)}nv-fielddropdown[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fielddropdown label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-fielddropdown nv-popover{width:100%;display:
|
|
8
|
+
const nvFielddropdownCss = "nv-fielddropdown{--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}nv-fielddropdown[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-fielddropdown[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)}nv-fielddropdown[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fielddropdown label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-fielddropdown nv-popover{width:100%}nv-fielddropdown div[data-scope=popover]{width:100%;padding:var(--list-custom-padding);background-color:var(--components-list-custom-background);border:1px solid var(--components-list-custom-border)}nv-fielddropdown ul[slot=content]{gap:var(--list-custom-gap-y);display:flex;flex-direction:column}nv-fielddropdown hr{border:none;height:1px;background-color:var(--components-list-custom-separator);margin:0}nv-fielddropdown .input-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch;width:100%}nv-fielddropdown .input-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;display:flex;align-items:center;position:relative;width:100%;min-height:40px}nv-fielddropdown .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fielddropdown .input-container:focus-within{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fielddropdown .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-fielddropdown .input-container:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fielddropdown .input-container input,nv-fielddropdown .input-container p.non-filterable-text{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:500;line-height:var(--form-field-line-height);width:100%;padding-right:2rem;flex-grow:1;margin:0;min-height:100%;box-sizing:border-box}nv-fielddropdown .input-container input:focus,nv-fielddropdown .input-container p.non-filterable-text:focus{outline:none}nv-fielddropdown .input-container input::placeholder,nv-fielddropdown .input-container p.non-filterable-text::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fielddropdown .input-container .toggle-dropdown-icon{position:absolute;right:0;top:50%;transform:translateY(-50%);z-index:2}nv-fielddropdown .input-container nv-icon.validation{color:var(--nv-field-border-default);position:absolute;right:50px}nv-fielddropdown .input-container.focus-within,nv-fielddropdown .input-container:hover{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fielddropdown .non-filterable-text{display:block;border-radius:var(--form-field-radius);background-color:var(--nv-field-background);color:var(--components-form-field-content-text);font-size:var(--form-field-font-size);font-weight:500;line-height:var(--form-field-line-height);box-sizing:border-box;cursor:pointer;height:100%;min-height:40px}nv-fielddropdown .non-filterable-text span{display:inline-block;width:100%;overflow:hidden;text-overflow:ellipsis}nv-fielddropdown .description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fielddropdown .error-description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", 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)}.input-container.focus-within,.input-container:hover{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}";
|
|
9
9
|
const NvFielddropdownStyle0 = nvFielddropdownCss;
|
|
10
10
|
|
|
11
11
|
const NVFieldDropDown = class {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"nv-fielddropdown.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,kBAAkB,GAAG,iwLAAiwL,CAAC;AAC7xL,8BAAe,kBAAkB;;MCiCpB,eAAe;IAN5B;;;;;;;;;;;;QAqBW,YAAO,GAAWA,KAAM,EAAE,CAAC;;;;QAwCpC,SAAI,GAAY,KAAK,CAAC;;;;;;;QASb,iBAAY,GAA+B,KAAK,CAAC;;;;;QAejD,aAAQ,GAAY,KAAK,CAAC;;;;;;QAQ1B,UAAK,GAAY,KAAK,CAAC;;;;;;QAgBvB,aAAQ,GAAY,KAAK,CAAC;;;;;;QAQ1B,aAAQ,GAAY,KAAK,CAAC;;;;QAM1B,gBAAW,GAAW,kBAAkB,CAAC;;;;QAMlD,eAAU,GAAW,EAAE,CAAC;;;;QAMxB,eAAU,GAAY,KAAK,CAAC;QAG5B,iBAAY,GAAY,IAAI,CAAC,UAAU,CAAC;QAGxC,mBAAc,GAAgB,IAAI,GAAG,EAAE,CAAC;;;;;QA4IhC,8BAAyB,GAAG,CAAC,KAAiB;YACpD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE;gBAClC,OAAO;aACR;YAED,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB,CAAC;;YAG3C,IAAI,MAAM,CAAC,OAAO,KAAK,GAAG,IAAI,MAAM,CAAC,OAAO,KAAK,MAAM,EAAE;gBACvD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;gBACjB,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;;gBAG3B,MAAM,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAC1C,kBAAkB,CACJ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,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAC,mBAAmB,IACjDA,mEAAM,IAAI,EAAC,mBAAmB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,CACzD,CACP,CACI,EACP;KACH;;;;;;;;;;;;","names":["uuidv4","h","Host"],"sources":["src/components/nv-fielddropdown/nv-fielddropdown.scss?tag=nv-fielddropdown","src/components/nv-fielddropdown/nv-fielddropdown.tsx"],"sourcesContent":["@import '../../styles/form-field';\n\nnv-fielddropdown {\n @include form-field-variables();\n @include form-field-root();\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 &[required]:not([required='false']) label {\n @include form-field-label-required();\n }\n\n label {\n @include form-field-label();\n }\n\n nv-popover {\n width: 100%;\n display: block;\n }\n\n .input-wrapper {\n @include form-field-input-wrapper();\n width: 100%;\n }\n\n .input-container {\n @include form-field-input-container();\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n min-height: 40px;\n input,\n p.non-filterable-text {\n @include form-field-input();\n width: 100%;\n padding-right: 2rem;\n flex-grow: 1;\n margin: 0;\n min-height: 100%;\n box-sizing: border-box;\n }\n\n .toggle-dropdown-icon {\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n z-index: 2;\n }\n\n nv-icon.validation {\n @include form-field-icon();\n position: absolute;\n right: 50px;\n }\n\n &.focus-within,\n &:hover {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0px 0px 0px var(--focus-field-stroke)\n var(--nv-field-focus-box-shadow);\n }\n }\n\n .non-filterable-text {\n display: block;\n border-radius: var(--form-field-radius);\n background-color: var(--nv-field-background);\n color: var(--components-form-field-content-text);\n font-size: var(--form-field-font-size);\n font-weight: 500;\n line-height: var(--form-field-line-height);\n box-sizing: border-box;\n cursor: pointer;\n height: 100%;\n min-height: 40px;\n\n span {\n display: inline-block;\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n\n hr {\n border: none;\n border-top: 1px solid var(--dropdown-divider-color, #ccc);\n margin: 0.5rem 0;\n }\n}\n\n.input-container.focus-within,\n.input-container:hover {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0px 0px 0px var(--focus-field-stroke)\n var(--nv-field-focus-box-shadow);\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n State,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Method,\n} from '@stencil/core';\n\nimport { v4 as uuidv4 } from 'uuid';\nimport { TextInputAutocomplete } from '../../utils/constants';\nimport { DropdownItemSelectedEventDetail } from '../nv-fielddropdownitem/DropdownItemSelectedEventDetail';\n\n/**\n * @slot content - Use a <ul></ul> tag for the slot, and place <nv-dropdownitem> elements inside.\n * @slot leading-input - Content to be placed before 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\n@Component({\n tag: 'nv-fielddropdown',\n styleUrl: 'nv-fielddropdown.scss',\n shadow: false,\n formAssociated: true,\n})\nexport class NVFieldDropDown {\n @Element() el: HTMLNvFielddropdownElement;\n private inputElement!: HTMLInputElement;\n private popoverElement!: HTMLNvPopoverElement;\n\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 })\n readonly 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 * The placeholder is displayed only when the filterable option is enabled.\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 * State of the dropdown popover.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\n\n /**\n * The autocomplete prop helps users fill out the input field faster by\n * suggesting entries they’ve used before, like their email or address.\n * You can turn it on to make forms more convenient or off to ensure users\n * always type in fresh data.\n */\n @Prop({ reflect: true })\n readonly autocomplete: `${TextInputAutocomplete}` = 'off';\n\n /**\n * Specifies the value of the input field, which determines the text displayed\n * within the field. This prop is typically used in controlled components\n * where the input’s value is managed by the component’s state.\n */\n @Prop({ reflect: true, mutable: true })\n value: string;\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 })\n readonly error: boolean = false;\n\n /**\n * A description that appears when there is an error related to the dropdown\n * field.\n * @validator message\n */\n @Prop({ reflect: true })\n readonly errorDescription: string;\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 * 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 * The text to display when no items match the filter.\n */\n @Prop({ reflect: true })\n readonly emptyresult: string = 'No results found';\n\n /**\n * The text entered by the user for filtering dropdown items.\n */\n @State()\n filterText: string = '';\n\n /**\n * Enables or disables the filtering feature for the dropdown items.\n */\n @Prop({ reflect: true, mutable: true })\n filterable: boolean = false;\n\n @State()\n isFilterable: boolean = this.filterable;\n\n @State()\n selectedValues: Set<string> = new Set();\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Event emitted when an item is selected.\n */\n @Event()\n dropdownItemSelected: EventEmitter<DropdownItemSelectedEventDetail>;\n\n @Listen('itemSelected')\n handleItemSelected(event: CustomEvent<DropdownItemSelectedEventDetail>) {\n if (this.disabled || this.readonly) return;\n\n // Retrieve all nv-fielddropdownitem elements present in the dropdown.\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n // For each item, remove the 'selected' attribute and the 'selected' class.\n items.forEach(item => {\n if (item !== event.target) {\n item.removeAttribute('selected');\n item.classList.remove('selected');\n }\n });\n\n // Update the value and emit the event with the selected item.\n this.value = event.detail.value;\n (event.target as HTMLNvFielddropdownitemElement).setAttribute(\n 'selected',\n 'true',\n );\n (event.target as HTMLElement).classList.add('selected');\n this.dropdownItemSelected.emit(event.detail);\n\n // Close the popover after selecting.\n if (this.popoverElement) {\n this.popoverElement.hide();\n }\n }\n\n /**\n * Emitted when the input value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n @Listen('openChanged')\n handleOpenChanged(event: CustomEvent<boolean>) {\n this.open = event.detail; // Update `open` based on the popover state\n }\n\n @Watch('filterable')\n watchFilterableHandler(newValue: boolean) {\n this.isFilterable = newValue;\n this.filterable = newValue;\n }\n\n @Watch('value')\n watchValueHandler() {\n // Handle value change and update the corresponding dropdown item if it exists\n this.setInitialSelection();\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Subscribe to click outside event.\n */\n connectedCallback() {\n document.addEventListener('click', this.handleClickOutside.bind(this));\n\n // Handle pre-selection during component initialization\n this.setInitialSelection();\n\n // Apply filtering if the dropdown is filterable and there is a value\n if (this.filterable && this.value) {\n this.filterText = this.value.toLowerCase();\n this.filterItems(); // Update the visibility of items\n } else {\n // Ensure all items are visible if no filtering is applied\n this.resetFilter();\n }\n }\n\n /**\n * Set the initial selection based on the current value and update the inputElement value.\n */\n private setInitialSelection() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const selectedItem = items.find(\n item =>\n item.getAttribute('label') === this.value ||\n item.getAttribute('value') === this.value ||\n item.textContent?.trim() === this.value,\n );\n\n // Remove 'selected' from all items first to reset the state\n items.forEach(item => {\n item.removeAttribute('selected');\n item.classList.remove('selected');\n });\n\n if (selectedItem) {\n // Add the `selected` attribute and `selected` class for visual styling\n selectedItem.setAttribute('selected', 'true');\n selectedItem.classList.add('selected');\n\n // Update the value and inputElement value to reflect the pre-selected item\n this.value =\n selectedItem.getAttribute('label') ||\n selectedItem.getAttribute('value') ||\n selectedItem.textContent?.trim() ||\n '';\n if (this.inputElement) {\n this.inputElement.value = this.value;\n }\n }\n }\n\n /**\n * Unsubscribe from click outside event.\n */\n disconnectedCallback() {\n document.removeEventListener('click', this.handleClickOutside.bind(this));\n }\n\n /**\n * Handle click on the input container.\n * @param {MouseEvent} event - The click event.\n */\n private handleInputContainerClick = (event: MouseEvent) => {\n if (this.disabled || this.readonly) {\n return; // Do nothing if the dropdown is disabled or read-only\n }\n\n const target = event.target as HTMLElement;\n\n // Check if it is the paragraph or another part of the container\n if (target.tagName === 'P' || target.tagName === 'SPAN') {\n this.open = true;\n this.popoverElement.show();\n\n // Simulate focus to trigger \"focus-within\" style\n const inputContainer = this.el.querySelector(\n '.input-container',\n ) as HTMLElement;\n if (inputContainer) {\n inputContainer.classList.add('focus-within');\n\n // Remove the \"focus-within\" class after a delay or when the popover is closed\n const removeFocusWithin = () => {\n inputContainer.classList.remove('focus-within');\n };\n\n // Or remove the class when the popover is closed\n this.popoverElement.addEventListener('hide', removeFocusWithin);\n }\n }\n };\n\n /**\n * Handle input change.\n * @param {Event} event - The input event.\n */\n private handleInput = (event: Event) => {\n if (!this.filterable) return; // Do not filter if `filterable` is false\n if (this.disabled || this.readonly) {\n return; // Do not toggle the state if the dropdown is disabled or read-only\n }\n const input = event.target as HTMLInputElement;\n this.filterText = input.value.toLowerCase();\n this.value = input.value; // Update the value\n this.valueChanged.emit(input.value); // Emit an event if needed\n this.filterItems(); // Update the visibility of items\n };\n\n /**\n * Filter dropdown items based on the text entered by the user.\n * If no items are found, display a message indicating no results.\n */\n private filterItems() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n // Remove the \"no results found\" item if it exists\n const existingEmptyItem = this.el.querySelector(\n 'nv-fielddropdownitem[data-empty]',\n );\n if (existingEmptyItem) {\n existingEmptyItem.remove();\n }\n\n let hasVisibleItems = false;\n\n // Iterate over all items and adjust their visibility\n items.forEach(item => {\n const textContent = item.textContent?.toLowerCase() || ''; // Get the textual content of the slot\n const value = item.value?.toLowerCase() || ''; // Get the value of the `value` attribute\n\n // Check if the filtered text is present either in the value or in the textual content\n const shouldShow =\n value.includes(this.filterText) ||\n textContent.includes(this.filterText);\n\n item.style.display = shouldShow ? '' : 'none'; // Hide or show the item\n\n if (shouldShow) {\n hasVisibleItems = true;\n }\n });\n\n // If no items are visible, add the \"no results found\" item\n if (!hasVisibleItems) {\n const emptyItem = document.createElement('nv-fielddropdownitem');\n emptyItem.setAttribute('data-empty', 'true');\n emptyItem.setAttribute('disabled', 'true');\n emptyItem.textContent = this.emptyresult;\n this.el.querySelector('ul[slot=\"content\"]')?.appendChild(emptyItem);\n }\n }\n\n /**\n * Reset the filter and make all items visible.\n */\n private resetFilter() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n items.forEach(item => {\n item.style.display = '';\n });\n }\n\n /**\n * Retrieves the current filter text entered by the user.\n * @returns {string} The filter text.\n */\n @Method()\n async getFilterText(): Promise<string> {\n return this.filterText;\n }\n\n /**\n * Handle click outside the component.\n * @param {MouseEvent} event - The click event.\n */\n private handleClickOutside(event: MouseEvent) {\n if (\n this.el.contains(event.target as Node) ||\n (this.inputElement && this.inputElement.contains(event.target as Node))\n ) {\n // If the click is inside the component or on the input, do not close the popover\n return;\n }\n\n this.popoverElement.hide(); // Close the popover if the click is outside the component\n }\n\n /**\n * Handle input focus.\n */\n private handleInputFocus = () => {\n if (this.disabled || this.readonly) {\n return; // Do not toggle the state if the dropdown is disabled or read-only\n }\n this.open = true; // Force the popover to open\n };\n\n /**\n * Handle input blur.\n */\n private handleInputBlur = () => {\n // Use a delay to check if the focus is still within the popover\n setTimeout(() => {\n if (!this.el.contains(document.activeElement)) {\n this.open = false;\n this.popoverElement.hide(); // Close the popover if the focus is outside the component\n }\n }, 150);\n };\n\n /**\n * Toggle the dropdown popover.\n * @returns {void}\n */\n private togglePopover = (): void => {\n if (this.disabled || this.readonly) {\n return; // Do not toggle if disabled or read-only\n }\n\n this.open = !this.open;\n if (this.open) {\n this.popoverElement.show();\n\n // Si le dropdown n'est pas filtrable, focus sur le premier élément\n if (!this.filterable) {\n this.focusFirstItem();\n }\n } else {\n this.popoverElement.hide();\n }\n };\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (!this.open) {\n if (event.key === 'ArrowDown') {\n this.open = true;\n this.popoverElement.show();\n\n if (!this.filterable) {\n // Focus sur le premier élément si ce n'est pas filtrable\n this.focusFirstItem();\n }\n\n event.preventDefault();\n return;\n }\n return;\n }\n\n // Vérifiez si le popover est défini avant de chercher les items\n if (!this.popoverElement) {\n console.warn('Popover element is not defined');\n return;\n }\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem:not([data-empty])'),\n ) as HTMLNvFielddropdownitemElement[];\n\n // Vérifiez si les items existent\n if (items.length === 0) {\n console.warn('No dropdown items found to navigate');\n return;\n }\n\n let currentIndex = items.findIndex(item =>\n item.classList.contains('highlighted'),\n );\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n currentIndex = (currentIndex + 1) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n currentIndex = (currentIndex - 1 + items.length) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'Enter' && currentIndex >= 0) {\n event.preventDefault();\n items[currentIndex].click();\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.open = false;\n this.popoverElement.hide();\n if (this.inputElement) {\n this.inputElement.blur();\n }\n }\n }\n\n private updateHighlightedItem(\n items: HTMLNvFielddropdownitemElement[],\n index: number,\n ) {\n items.forEach((item, i) => {\n if (i === index) {\n item.classList.add('highlighted');\n item.setAttribute('tabindex', '0');\n if (!item.checkVisibility()) {\n console.log('Item not focused');\n }\n\n item.focus(); // Forcer le focus ici\n item.scrollIntoView({ block: 'nearest' });\n } else {\n item.classList.remove('highlighted');\n item.setAttribute('tabindex', '-1');\n }\n });\n }\n\n private focusFirstItem() {\n const firstItem = this.el.querySelector('nv-fielddropdownitem');\n if (firstItem) {\n (firstItem as HTMLElement).focus();\n this.updateHighlightedItem(\n Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[],\n 0,\n );\n } else {\n console.warn('No first item found to focus');\n }\n }\n\n //#endregion METHODS\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 <nv-popover\n ref={el => (this.popoverElement = el as HTMLNvPopoverElement)}\n triggerMode=\"controlled\"\n placement=\"bottom-start\"\n open={this.open}\n >\n <div class=\"input-wrapper\" slot=\"trigger\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"input-container\"\n onClick={this.handleInputContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n {this.isFilterable || this.disabled || this.readonly ? (\n <input\n id={this.inputId}\n type=\"search\"\n ref={e => (this.inputElement = e)}\n autocomplete={this.autocomplete}\n placeholder={this.placeholder}\n name={this.name}\n value={this.value}\n required={this.required}\n disabled={this.disabled}\n readOnly={this.readonly}\n onInput={this.handleInput}\n onFocus={this.handleInputFocus}\n onBlur={this.handleInputBlur}\n onKeyDown={this.handleKeyDown} // Gérer les touches fléchées ici\n />\n ) : (\n <p\n id={this.inputId}\n class=\"non-filterable-text\"\n onClick={this.handleInputContainerClick}\n tabIndex={0} // Ajout du tabindex pour permettre de le focus\n onKeyDown={this.handleKeyDown} // Gérer les touches fléchées ici également\n onFocus={this.handleInputFocus}\n >\n <span>{this.value || this.placeholder}</span>\n </p>\n )}\n\n <nv-iconbutton\n class=\"toggle-dropdown-icon\"\n name={this.open ? 'chevron-top' : 'chevron-down'}\n size=\"md\"\n emphasis=\"lower\"\n aria-label={this.open ? 'Hide dropdown' : 'Show dropdown'}\n aria-pressed={this.open.toString()}\n onClick={this.togglePopover}\n />\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n <slot name=\"content\"></slot>\n </nv-popover>\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 //#endregion RENDER\n}\n"],"version":3}
|
|
1
|
+
{"file":"nv-fielddropdown.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,kBAAkB,GAAG,giMAAgiM,CAAC;AAC5jM,8BAAe,kBAAkB;;MCiCpB,eAAe;IAN5B;;;;;;;;;;;;QAqBW,YAAO,GAAWA,KAAM,EAAE,CAAC;;;;QAwCpC,SAAI,GAAY,KAAK,CA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AAI,CAAC,aAAa,EAC7B,OAAO,EAAE,IAAI,CAAC,gBAAgB,IAE9BA,sBAAO,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,WAAW,CAAQ,CAC3C,CACL,EAEDA,4EACE,KAAK,EAAC,sBAAsB,EAC5B,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,aAAa,GAAG,cAAc,EAChD,IAAI,EAAC,IAAI,EACT,QAAQ,EAAC,OAAO,gBACJ,IAAI,CAAC,IAAI,GAAG,eAAe,GAAG,eAAe,kBAC3C,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAClC,OAAO,EAAE,IAAI,CAAC,aAAa,GAC3B,CACE,EAENA,mEAAM,IAAI,EAAC,aAAa,GAAQ,CAC5B,EAENA,mEAAM,IAAI,EAAC,SAAS,GAAQ,CACjB,EAEZ,CAAC,IAAI,CAAC,WAAW;YAChB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,sBAAsB,CAAC,MAC7CA,kEAAK,KAAK,EAAC,aAAa,IACtBA,mEAAM,IAAI,EAAC,aAAa,IAAE,IAAI,CAAC,WAAW,CAAQ,CAC9C,CACP,EAEA,CAAC,IAAI,CAAC,gBAAgB;YACrB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,4BAA4B,CAAC,MACnDA,kEAAK,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAC,mBAAmB,IACjDA,mEAAM,IAAI,EAAC,mBAAmB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,CACzD,CACP,CACI,EACP;KACH;;;;;;;;;;;;","names":["uuidv4","h","Host"],"sources":["src/components/nv-fielddropdown/nv-fielddropdown.scss?tag=nv-fielddropdown","src/components/nv-fielddropdown/nv-fielddropdown.tsx"],"sourcesContent":["@import '../../styles/form-field';\n\nnv-fielddropdown {\n @include form-field-variables();\n @include form-field-root();\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 &[required]:not([required='false']) label {\n @include form-field-label-required();\n }\n\n label {\n @include form-field-label();\n }\n nv-popover {\n width: 100%\n }\n div[data-scope='popover'] {\n width: 100%;\n padding: var(--list-custom-padding);\n background-color: var(--components-list-custom-background);\n border: 1px solid var(--components-list-custom-border);\n\n }\n ul[slot='content'] {\n gap: var(--list-custom-gap-y);\n display: flex;\n flex-direction: column;\n }\n hr {\n border: none;\n height: 1px;\n background-color: var(--components-list-custom-separator);\n margin: 0;\n }\n\n .input-wrapper {\n @include form-field-input-wrapper();\n width: 100%;\n }\n\n .input-container {\n @include form-field-input-container();\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n min-height: 40px;\n input,\n p.non-filterable-text {\n @include form-field-input();\n width: 100%;\n padding-right: 2rem;\n flex-grow: 1;\n margin: 0;\n min-height: 100%;\n box-sizing: border-box;\n }\n\n .toggle-dropdown-icon {\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n z-index: 2;\n }\n\n nv-icon.validation {\n @include form-field-icon();\n position: absolute;\n right: 50px;\n }\n\n &.focus-within,\n &:hover {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0px 0px 0px var(--focus-field-stroke)\n var(--nv-field-focus-box-shadow);\n }\n }\n\n .non-filterable-text {\n display: block;\n border-radius: var(--form-field-radius);\n background-color: var(--nv-field-background);\n color: var(--components-form-field-content-text);\n font-size: var(--form-field-font-size);\n font-weight: 500;\n line-height: var(--form-field-line-height);\n box-sizing: border-box;\n cursor: pointer;\n height: 100%;\n min-height: 40px;\n\n span {\n display: inline-block;\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n\n.input-container.focus-within,\n.input-container:hover {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0px 0px 0px var(--focus-field-stroke)\n var(--nv-field-focus-box-shadow);\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n State,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Method,\n} from '@stencil/core';\n\nimport { v4 as uuidv4 } from 'uuid';\nimport { TextInputAutocomplete } from '../../utils/constants';\nimport { DropdownItemSelectedEventDetail } from '../nv-fielddropdownitem/DropdownItemSelectedEventDetail';\n\n/**\n * @slot content - Use a <ul></ul> tag for the slot, and place <nv-dropdownitem> elements inside.\n * @slot leading-input - Content to be placed before 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\n@Component({\n tag: 'nv-fielddropdown',\n styleUrl: 'nv-fielddropdown.scss',\n shadow: false,\n formAssociated: true,\n})\nexport class NVFieldDropDown {\n @Element() el: HTMLNvFielddropdownElement;\n private inputElement!: HTMLInputElement;\n private popoverElement!: HTMLNvPopoverElement;\n\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 })\n readonly 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 * The placeholder is displayed only when the filterable option is enabled.\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 * State of the dropdown popover.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\n\n /**\n * The autocomplete prop helps users fill out the input field faster by\n * suggesting entries they’ve used before, like their email or address.\n * You can turn it on to make forms more convenient or off to ensure users\n * always type in fresh data.\n */\n @Prop({ reflect: true })\n readonly autocomplete: `${TextInputAutocomplete}` = 'off';\n\n /**\n * Specifies the value of the input field, which determines the text displayed\n * within the field. This prop is typically used in controlled components\n * where the input’s value is managed by the component’s state.\n */\n @Prop({ reflect: true, mutable: true })\n value: string;\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 })\n readonly error: boolean = false;\n\n /**\n * A description that appears when there is an error related to the dropdown\n * field.\n * @validator message\n */\n @Prop({ reflect: true })\n readonly errorDescription: string;\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 * 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 * The text to display when no items match the filter.\n */\n @Prop({ reflect: true })\n readonly emptyresult: string = 'No results found';\n\n /**\n * The text entered by the user for filtering dropdown items.\n */\n @State()\n filterText: string = '';\n\n /**\n * Enables or disables the filtering feature for the dropdown items.\n */\n @Prop({ reflect: true, mutable: true })\n filterable: boolean = false;\n\n @State()\n isFilterable: boolean = this.filterable;\n\n @State()\n selectedValues: Set<string> = new Set();\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Event emitted when an item is selected.\n */\n @Event()\n dropdownItemSelected: EventEmitter<DropdownItemSelectedEventDetail>;\n\n @Listen('itemSelected')\n handleItemSelected(event: CustomEvent<DropdownItemSelectedEventDetail>) {\n if (this.disabled || this.readonly) return;\n\n // Retrieve all nv-fielddropdownitem elements present in the dropdown.\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n // For each item, remove the 'selected' attribute and the 'selected' class.\n items.forEach(item => {\n if (item !== event.target) {\n item.removeAttribute('selected');\n item.classList.remove('selected');\n }\n });\n\n // Update the value and emit the event with the selected item.\n this.value = event.detail.value;\n (event.target as HTMLNvFielddropdownitemElement).setAttribute(\n 'selected',\n 'true',\n );\n (event.target as HTMLElement).classList.add('selected');\n this.dropdownItemSelected.emit(event.detail);\n\n // Close the popover after selecting.\n if (this.popoverElement) {\n this.popoverElement.hide();\n }\n }\n\n /**\n * Emitted when the input value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n @Listen('openChanged')\n handleOpenChanged(event: CustomEvent<boolean>) {\n this.open = event.detail; // Update `open` based on the popover state\n }\n\n @Watch('filterable')\n watchFilterableHandler(newValue: boolean) {\n this.isFilterable = newValue;\n this.filterable = newValue;\n }\n\n @Watch('value')\n watchValueHandler() {\n // Handle value change and update the corresponding dropdown item if it exists\n this.setInitialSelection();\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Subscribe to click outside event.\n */\n connectedCallback() {\n document.addEventListener('click', this.handleClickOutside.bind(this));\n\n // Handle pre-selection during component initialization\n this.setInitialSelection();\n\n // Apply filtering if the dropdown is filterable and there is a value\n if (this.filterable && this.value) {\n this.filterText = this.value.toLowerCase();\n this.filterItems(); // Update the visibility of items\n } else {\n // Ensure all items are visible if no filtering is applied\n this.resetFilter();\n }\n }\n\n /**\n * Set the initial selection based on the current value and update the inputElement value.\n */\n private setInitialSelection() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n const selectedItem = items.find(\n item =>\n item.getAttribute('label') === this.value ||\n item.getAttribute('value') === this.value ||\n item.textContent?.trim() === this.value,\n );\n\n // Remove 'selected' from all items first to reset the state\n items.forEach(item => {\n item.removeAttribute('selected');\n item.classList.remove('selected');\n });\n\n if (selectedItem) {\n // Add the `selected` attribute and `selected` class for visual styling\n selectedItem.setAttribute('selected', 'true');\n selectedItem.classList.add('selected');\n\n // Update the value and inputElement value to reflect the pre-selected item\n this.value =\n selectedItem.getAttribute('label') ||\n selectedItem.getAttribute('value') ||\n selectedItem.textContent?.trim() ||\n '';\n if (this.inputElement) {\n this.inputElement.value = this.value;\n }\n }\n }\n\n /**\n * Unsubscribe from click outside event.\n */\n disconnectedCallback() {\n document.removeEventListener('click', this.handleClickOutside.bind(this));\n }\n\n /**\n * Handle click on the input container.\n * @param {MouseEvent} event - The click event.\n */\n private handleInputContainerClick = (event: MouseEvent) => {\n if (this.disabled || this.readonly) {\n return; // Do nothing if the dropdown is disabled or read-only\n }\n\n const target = event.target as HTMLElement;\n\n // Check if it is the paragraph or another part of the container\n if (target.tagName === 'P' || target.tagName === 'SPAN') {\n this.open = true;\n this.popoverElement.show();\n\n // Simulate focus to trigger \"focus-within\" style\n const inputContainer = this.el.querySelector(\n '.input-container',\n ) as HTMLElement;\n if (inputContainer) {\n inputContainer.classList.add('focus-within');\n\n // Remove the \"focus-within\" class after a delay or when the popover is closed\n const removeFocusWithin = () => {\n inputContainer.classList.remove('focus-within');\n };\n\n // Or remove the class when the popover is closed\n this.popoverElement.addEventListener('hide', removeFocusWithin);\n }\n }\n };\n\n /**\n * Handle input change.\n * @param {Event} event - The input event.\n */\n private handleInput = (event: Event) => {\n if (!this.filterable) return; // Do not filter if `filterable` is false\n if (this.disabled || this.readonly) {\n return; // Do not toggle the state if the dropdown is disabled or read-only\n }\n const input = event.target as HTMLInputElement;\n this.filterText = input.value.toLowerCase();\n this.value = input.value; // Update the value\n this.valueChanged.emit(input.value); // Emit an event if needed\n this.filterItems(); // Update the visibility of items\n };\n\n /**\n * Filter dropdown items based on the text entered by the user.\n * If no items are found, display a message indicating no results.\n */\n private filterItems() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n // Remove the \"no results found\" item if it exists\n const existingEmptyItem = this.el.querySelector(\n 'nv-fielddropdownitem[data-empty]',\n );\n if (existingEmptyItem) {\n existingEmptyItem.remove();\n }\n\n let hasVisibleItems = false;\n\n // Iterate over all items and adjust their visibility\n items.forEach(item => {\n const textContent = item.textContent?.toLowerCase() || ''; // Get the textual content of the slot\n const value = item.value?.toLowerCase() || ''; // Get the value of the `value` attribute\n\n // Check if the filtered text is present either in the value or in the textual content\n const shouldShow =\n value.includes(this.filterText) ||\n textContent.includes(this.filterText);\n\n item.style.display = shouldShow ? '' : 'none'; // Hide or show the item\n\n if (shouldShow) {\n hasVisibleItems = true;\n }\n });\n\n // If no items are visible, add the \"no results found\" item\n if (!hasVisibleItems) {\n const emptyItem = document.createElement('nv-fielddropdownitem');\n emptyItem.setAttribute('data-empty', 'true');\n emptyItem.setAttribute('disabled', 'true');\n emptyItem.textContent = this.emptyresult;\n this.el.querySelector('ul[slot=\"content\"]')?.appendChild(emptyItem);\n }\n }\n\n /**\n * Reset the filter and make all items visible.\n */\n private resetFilter() {\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[];\n\n items.forEach(item => {\n item.style.display = '';\n });\n }\n\n /**\n * Retrieves the current filter text entered by the user.\n * @returns {string} The filter text.\n */\n @Method()\n async getFilterText(): Promise<string> {\n return this.filterText;\n }\n\n /**\n * Handle click outside the component.\n * @param {MouseEvent} event - The click event.\n */\n private handleClickOutside(event: MouseEvent) {\n if (\n this.el.contains(event.target as Node) ||\n (this.inputElement && this.inputElement.contains(event.target as Node))\n ) {\n // If the click is inside the component or on the input, do not close the popover\n return;\n }\n\n this.popoverElement.hide(); // Close the popover if the click is outside the component\n }\n\n /**\n * Handle input focus.\n */\n private handleInputFocus = () => {\n if (this.disabled || this.readonly) {\n return; // Do not toggle the state if the dropdown is disabled or read-only\n }\n this.open = true; // Force the popover to open\n };\n\n /**\n * Handle input blur.\n */\n private handleInputBlur = () => {\n // Use a delay to check if the focus is still within the popover\n setTimeout(() => {\n if (!this.el.contains(document.activeElement)) {\n this.open = false;\n this.popoverElement.hide(); // Close the popover if the focus is outside the component\n }\n }, 150);\n };\n\n /**\n * Toggle the dropdown popover.\n * @returns {void}\n */\n private togglePopover = (): void => {\n if (this.disabled || this.readonly) {\n return; // Do not toggle if disabled or read-only\n }\n\n this.open = !this.open;\n if (this.open) {\n this.popoverElement.show();\n\n // Si le dropdown n'est pas filtrable, focus sur le premier élément\n if (!this.filterable) {\n this.focusFirstItem();\n }\n } else {\n this.popoverElement.hide();\n }\n };\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (!this.open) {\n if (event.key === 'ArrowDown') {\n this.open = true;\n this.popoverElement.show();\n\n if (!this.filterable) {\n // Focus sur le premier élément si ce n'est pas filtrable\n this.focusFirstItem();\n }\n\n event.preventDefault();\n return;\n }\n return;\n }\n\n // Vérifiez si le popover est défini avant de chercher les items\n if (!this.popoverElement) {\n console.warn('Popover element is not defined');\n return;\n }\n\n const items = Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem:not([data-empty])'),\n ) as HTMLNvFielddropdownitemElement[];\n\n // Vérifiez si les items existent\n if (items.length === 0) {\n console.warn('No dropdown items found to navigate');\n return;\n }\n\n let currentIndex = items.findIndex(item =>\n item.classList.contains('highlighted'),\n );\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n currentIndex = (currentIndex + 1) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n currentIndex = (currentIndex - 1 + items.length) % items.length;\n this.updateHighlightedItem(items, currentIndex);\n } else if (event.key === 'Enter' && currentIndex >= 0) {\n event.preventDefault();\n items[currentIndex].click();\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.open = false;\n this.popoverElement.hide();\n if (this.inputElement) {\n this.inputElement.blur();\n }\n }\n }\n\n private updateHighlightedItem(\n items: HTMLNvFielddropdownitemElement[],\n index: number,\n ) {\n items.forEach((item, i) => {\n if (i === index) {\n item.classList.add('highlighted');\n item.setAttribute('tabindex', '0');\n if (!item.checkVisibility()) {\n console.log('Item not focused');\n }\n\n item.focus(); // Forcer le focus ici\n item.scrollIntoView({ block: 'nearest' });\n } else {\n item.classList.remove('highlighted');\n item.setAttribute('tabindex', '-1');\n }\n });\n }\n\n private focusFirstItem() {\n const firstItem = this.el.querySelector('nv-fielddropdownitem');\n if (firstItem) {\n (firstItem as HTMLElement).focus();\n this.updateHighlightedItem(\n Array.from(\n this.el.querySelectorAll('nv-fielddropdownitem'),\n ) as HTMLNvFielddropdownitemElement[],\n 0,\n );\n } else {\n console.warn('No first item found to focus');\n }\n }\n\n //#endregion METHODS\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 <nv-popover\n ref={el => (this.popoverElement = el as HTMLNvPopoverElement)}\n triggerMode=\"controlled\"\n placement=\"bottom-start\"\n open={this.open}\n >\n <div class=\"input-wrapper\" slot=\"trigger\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"input-container\"\n onClick={this.handleInputContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n {this.isFilterable || this.disabled || this.readonly ? (\n <input\n id={this.inputId}\n type=\"search\"\n ref={e => (this.inputElement = e)}\n autocomplete={this.autocomplete}\n placeholder={this.placeholder}\n name={this.name}\n value={this.value}\n required={this.required}\n disabled={this.disabled}\n readOnly={this.readonly}\n onInput={this.handleInput}\n onFocus={this.handleInputFocus}\n onBlur={this.handleInputBlur}\n onKeyDown={this.handleKeyDown} // Gérer les touches fléchées ici\n />\n ) : (\n <p\n id={this.inputId}\n class=\"non-filterable-text\"\n onClick={this.handleInputContainerClick}\n tabIndex={0} // Ajout du tabindex pour permettre de le focus\n onKeyDown={this.handleKeyDown} // Gérer les touches fléchées ici également\n onFocus={this.handleInputFocus}\n >\n <span>{this.value || this.placeholder}</span>\n </p>\n )}\n\n <nv-iconbutton\n class=\"toggle-dropdown-icon\"\n name={this.open ? 'chevron-top' : 'chevron-down'}\n size=\"md\"\n emphasis=\"lower\"\n aria-label={this.open ? 'Hide dropdown' : 'Show dropdown'}\n aria-pressed={this.open.toString()}\n onClick={this.togglePopover}\n />\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n <slot name=\"content\"></slot>\n </nv-popover>\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 //#endregion RENDER\n}\n"],"version":3}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-72b8a9ad.js');
|
|
6
6
|
|
|
7
|
-
const nvFielddropdownitemCss = "nv-fielddropdownitem{display:flex;align-items:center;justify-content:space-between;
|
|
7
|
+
const nvFielddropdownitemCss = "nv-fielddropdownitem{display:flex;align-items:center;justify-content:space-between;width:100%;padding:var(--list-custom-item-padding-y) var(--list-custom-item-padding-x);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);transition:background-color 150ms ease-out, color 150ms ease-out;cursor:pointer}nv-fielddropdownitem:hover,nv-fielddropdownitem:focus,nv-fielddropdownitem:focus-within{background-color:var(--components-list-custom-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}nv-fielddropdownitem[disabled]:not([disabled=false]){cursor:not-allowed;background-color:unset;color:var(--components-menu-contextual-item-content-disabled)}nv-fielddropdownitem .dropdown-item-text-wrapper{display:flex;flex-grow:1;align-items:center;justify-content:space-between}nv-fielddropdownitem [data-scope=text]{flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nv-fielddropdownitem .selection-icon{color:var(--components-list-custom-item-content-default);align-self:center}";
|
|
8
8
|
const NvFielddropdownitemStyle0 = nvFielddropdownitemCss;
|
|
9
9
|
|
|
10
10
|
const NvFielddropdownitem = class {
|
|
@@ -57,7 +57,7 @@ const NvFielddropdownitem = class {
|
|
|
57
57
|
//#region RENDER
|
|
58
58
|
render() {
|
|
59
59
|
const showDefaultLayout = this.isNullOrEmptyOrWhitespace(this.label);
|
|
60
|
-
return (index.h(index.Host, { key: '0b0070ad824841f49bf5c24423131c46c41ef4ef', role: "menuitem", tabindex: this.disabled ? '-1' : '0', onClick: this.handleClick, class: { selected: this.selected } }, showDefaultLayout ? (index.h("slot", null)) : (index.h("div", { class: "
|
|
60
|
+
return (index.h(index.Host, { key: '0b0070ad824841f49bf5c24423131c46c41ef4ef', role: "menuitem", tabindex: this.disabled ? '-1' : '0', onClick: this.handleClick, class: { selected: this.selected } }, showDefaultLayout ? (index.h("slot", null)) : (index.h("div", { class: "dropdown-item-text-wrapper" }, index.h("span", { "data-scope": "text" }, this.label), this.selected && (index.h("nv-icon", { name: "check", "aria-hidden": "true", class: "selection-icon" }))))));
|
|
61
61
|
}
|
|
62
62
|
get el() { return index.getElement(this); }
|
|
63
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"nv-fielddropdownitem.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,sBAAsB,GAAG,
|
|
1
|
+
{"file":"nv-fielddropdownitem.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,sBAAsB,GAAG,mpCAAmpC,CAAC;AAC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,EAAE,IAAI,CAAC,WAAW,EACzB,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAEjC,iBAAiB,IAChBD,qBAAa,KAEbA,iBAAK,KAAK,EAAC,4BAA4B,IACrCA,gCAAiB,MAAM,IAAE,IAAI,CAAC,KAAK,CAAQ,EAC1C,IAAI,CAAC,QAAQ,KACZA,qBACE,IAAI,EAAC,OAAO,iBACA,MAAM,EAClB,KAAK,EAAC,gBAAgB,GACb,CACZ,CACG,CACP,CACI,EACP;KACH;;;;;;;","names":["h","Host"],"sources":["src/components/nv-fielddropdownitem/nv-fielddropdownitem.scss?tag=nv-fielddropdownitem","src/components/nv-fielddropdownitem/nv-fielddropdownitem.tsx"],"sourcesContent":["@import '../../styles/form-field';\n\nnv-fielddropdownitem {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n padding: var(--list-custom-item-padding-y) var(--list-custom-item-padding-x);\n font-size: var(--menu-contextual-item-font-size);\n font-weight: var(--menu-contextual-item-font-weight);\n color: var(--components-menu-contextual-item-content);\n border-radius: var(--menu-contextual-item-radius);\n transition: background-color 150ms ease-out, color 150ms ease-out;\n cursor: pointer;\n\n &:hover,\n &:focus,\n &:focus-within {\n background-color: var(--components-list-custom-item-background-hover);\n color: var(--components-menu-contextual-item-content-hover);\n }\n\n &[disabled]:not([disabled='false']) {\n cursor: not-allowed;\n background-color: unset;\n color: var(--components-menu-contextual-item-content-disabled);\n }\n.dropdown-item-text-wrapper{\n display: flex;\n flex-grow: 1;\n align-items: center;\n justify-content: space-between;\n}\n [data-scope='text'] {\n flex-grow: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .selection-icon {\n color: var(--components-list-custom-item-content-default);\n align-self: center;\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Element,\n} from '@stencil/core';\nimport { DropdownItemSelectedEventDetail } from './DropdownItemSelectedEventDetail';\n\n/**\n * @slot default - The content to be displayed inside the dropdown item.\n */\n\n@Component({\n tag: 'nv-fielddropdownitem',\n styleUrl: 'nv-fielddropdownitem.scss',\n shadow: false,\n})\nexport class NvFielddropdownitem {\n @Element() el: HTMLNvFielddropdownitemElement;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Disables the item, preventing any user interaction.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Indicates if the item is selected.\n */\n @Prop({ reflect: true, mutable: true })\n selected: boolean = false;\n\n /**\n * Value associated with the item.\n */\n @Prop({ reflect: true })\n readonly value?: string;\n\n /**\n * Label used as the value for the default layout.\n */\n @Prop({ reflect: true })\n readonly label?: string;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Event emitted when an item is clicked.\n */\n @Event()\n itemSelected: EventEmitter<DropdownItemSelectedEventDetail>;\n\n private handleClick = () => {\n if (!this.disabled) {\n let itemValue = this.value || '';\n if (!itemValue) {\n itemValue =\n Array.from(this.el.childNodes)\n .map(node => node.textContent?.trim())\n .filter(text => text && text.length > 0)\n .join(' ') || '';\n }\n\n this.selected = !this.selected; // Toggle the selected state\n\n this.itemSelected.emit({\n label: this.label,\n value: itemValue,\n selected: this.selected,\n disabled: this.disabled,\n });\n }\n };\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Utility function to check if a string is null, empty, or contains only whitespace.\n * @param {string | null | undefined} input - The string to check.\n * @returns {boolean} - Returns true if the string is null, empty, or contains only whitespace; otherwise, false.\n */\n private isNullOrEmptyOrWhitespace(input: string | null | undefined): boolean {\n return !input || input.trim().length === 0;\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region RENDER\n\n render() {\n const showDefaultLayout = this.isNullOrEmptyOrWhitespace(this.label);\n\n return (\n <Host\n role=\"menuitem\"\n tabindex={this.disabled ? '-1' : '0'}\n onClick={this.handleClick}\n class={{ selected: this.selected }}\n >\n {showDefaultLayout ? (\n <slot></slot>\n ) : (\n <div class=\"dropdown-item-text-wrapper\">\n <span data-scope=\"text\">{this.label}</span>\n {this.selected && (\n <nv-icon\n name=\"check\"\n aria-hidden=\"true\"\n class=\"selection-icon\"\n ></nv-icon>\n )}\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
|