@aotearoan/neon 21.0.0 → 21.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/enums/NeonBadgeSize.cjs.js +2 -0
- package/dist/common/enums/NeonBadgeSize.cjs.js.map +1 -0
- package/dist/common/enums/NeonBadgeSize.es.js +5 -0
- package/dist/common/enums/NeonBadgeSize.es.js.map +1 -0
- package/dist/common/utils/NeonDateUtils.cjs.js +1 -1
- package/dist/common/utils/NeonDateUtils.cjs.js.map +1 -1
- package/dist/common/utils/NeonDateUtils.es.js +52 -48
- package/dist/common/utils/NeonDateUtils.es.js.map +1 -1
- package/dist/components/navigation/link/NeonLink.vue.cjs.js +1 -1
- package/dist/components/navigation/link/NeonLink.vue.cjs.js.map +1 -1
- package/dist/components/navigation/link/NeonLink.vue.es.js +27 -33
- package/dist/components/navigation/link/NeonLink.vue.es.js.map +1 -1
- package/dist/components/navigation/menu/NeonMenu.vue.cjs.js +1 -1
- package/dist/components/navigation/menu/NeonMenu.vue.cjs.js.map +1 -1
- package/dist/components/navigation/menu/NeonMenu.vue.es.js +15 -15
- package/dist/components/navigation/menu/NeonMenu.vue.es.js.map +1 -1
- package/dist/components/presentation/badge/NeonBadge.cjs.js +1 -1
- package/dist/components/presentation/badge/NeonBadge.cjs.js.map +1 -1
- package/dist/components/presentation/badge/NeonBadge.es.js +8 -8
- package/dist/components/presentation/badge/NeonBadge.es.js.map +1 -1
- package/dist/components/presentation/dropdown/NeonDropdown.cjs.js +1 -1
- package/dist/components/presentation/dropdown/NeonDropdown.cjs.js.map +1 -1
- package/dist/components/presentation/dropdown/NeonDropdown.es.js +28 -24
- package/dist/components/presentation/dropdown/NeonDropdown.es.js.map +1 -1
- package/dist/components/presentation/dropdown/NeonDropdown.vue.cjs.js +1 -1
- package/dist/components/presentation/dropdown/NeonDropdown.vue.cjs.js.map +1 -1
- package/dist/components/presentation/dropdown/NeonDropdown.vue.es.js +23 -21
- package/dist/components/presentation/dropdown/NeonDropdown.vue.es.js.map +1 -1
- package/dist/components/user-input/button/NeonButton.cjs.js +1 -1
- package/dist/components/user-input/button/NeonButton.cjs.js.map +1 -1
- package/dist/components/user-input/button/NeonButton.es.js +26 -22
- package/dist/components/user-input/button/NeonButton.es.js.map +1 -1
- package/dist/components/user-input/button/NeonButton.vue.cjs.js +1 -1
- package/dist/components/user-input/button/NeonButton.vue.cjs.js.map +1 -1
- package/dist/components/user-input/button/NeonButton.vue.es.js +11 -10
- package/dist/components/user-input/button/NeonButton.vue.es.js.map +1 -1
- package/dist/components/user-input/date-picker/NeonDatePicker.cjs.js +1 -1
- package/dist/components/user-input/date-picker/NeonDatePicker.cjs.js.map +1 -1
- package/dist/components/user-input/date-picker/NeonDatePicker.es.js +27 -23
- package/dist/components/user-input/date-picker/NeonDatePicker.es.js.map +1 -1
- package/dist/components/user-input/date-picker/NeonDatePicker.vue.cjs.js +1 -1
- package/dist/components/user-input/date-picker/NeonDatePicker.vue.cjs.js.map +1 -1
- package/dist/components/user-input/date-picker/NeonDatePicker.vue.es.js +99 -114
- package/dist/components/user-input/date-picker/NeonDatePicker.vue.es.js.map +1 -1
- package/dist/components/user-input/input/NeonInput.cjs.js +1 -1
- package/dist/components/user-input/input/NeonInput.cjs.js.map +1 -1
- package/dist/components/user-input/input/NeonInput.es.js +30 -30
- package/dist/components/user-input/input/NeonInput.es.js.map +1 -1
- package/dist/neon.cjs.js +1 -1
- package/dist/neon.es.js +93 -91
- package/dist/neon.es.js.map +1 -1
- package/dist/src/common/enums/NeonBadgeSize.d.ts +15 -0
- package/dist/src/common/models/NeonCalendarConfig.d.ts +10 -0
- package/dist/src/common/utils/NeonDateUtils.d.ts +4 -2
- package/dist/src/components/feedback/dialog/NeonDialog.d.ts +12 -0
- package/dist/src/components/feedback/note/NeonNote.d.ts +6 -0
- package/dist/src/components/layout/card-list/NeonCardList.d.ts +20 -4
- package/dist/src/components/layout/modal/NeonModal.d.ts +6 -0
- package/dist/src/components/navigation/dropdown-menu/NeonDropdownMenu.d.ts +123 -39
- package/dist/src/components/navigation/menu/NeonMenu.d.ts +99 -27
- package/dist/src/components/navigation/mobile-menu/NeonMobileMenu.d.ts +57 -39
- package/dist/src/components/presentation/badge/NeonBadge.d.ts +12 -20
- package/dist/src/components/presentation/dropdown/NeonDropdown.d.ts +45 -23
- package/dist/src/components/presentation/image-carousel/NeonImageCarousel.d.ts +6 -0
- package/dist/src/components/user-input/button/NeonButton.d.ts +15 -1
- package/dist/src/components/user-input/date-picker/NeonDatePicker.d.ts +144 -116
- package/dist/src/components/user-input/file/NeonFile.d.ts +16 -14
- package/dist/src/components/user-input/input/NeonInput.d.ts +5 -9
- package/dist/src/components/user-input/number/NeonNumber.d.ts +20 -46
- package/dist/src/components/user-input/search/NeonSearch.d.ts +165 -165
- package/dist/src/components/user-input/select/NeonSelect.d.ts +261 -81
- package/dist/src/neon.d.ts +1 -0
- package/package.json +1 -1
- package/src/sass/components/_action-menu.scss +2 -7
- package/src/sass/components/_badge.scss +16 -42
- package/src/sass/components/_button.scss +0 -6
- package/src/sass/components/_card-list.scss +1 -6
- package/src/sass/components/_date-picker.scss +20 -0
- package/src/sass/components/_link.scss +3 -5
- package/src/sass/components/_search.scss +12 -0
- package/src/sass/components/_tree-menu.scss +1 -0
- package/src/sass/variables.scss +7 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import m from "./NeonDropdown.es.js";
|
|
2
|
-
import { resolveComponent as i, openBlock as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
2
|
+
import { resolveComponent as i, openBlock as l, createElementBlock as a, normalizeClass as p, createElementVNode as t, renderSlot as s, createVNode as u, withKeys as r, withModifiers as d, createBlock as v, createCommentVNode as f, withDirectives as y, vShow as C } from "vue";
|
|
3
|
+
import c from "../../../_virtual/_plugin-vue_export-helper.es.js";
|
|
4
|
+
const k = { ref: "dropdownButton" }, O = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "neon-dropdown__button-wrapper"
|
|
7
|
-
},
|
|
8
|
-
function z(o, e, B, V, S,
|
|
7
|
+
}, $ = ["id", "tabindex"];
|
|
8
|
+
function z(o, e, B, V, S, A) {
|
|
9
9
|
const b = i("neon-button"), w = i("neon-badge"), g = i("neon-expansion-indicator");
|
|
10
|
-
return
|
|
10
|
+
return l(), a("div", {
|
|
11
11
|
class: p([[
|
|
12
12
|
{
|
|
13
13
|
"neon-dropdown--with-indicator": o.indicator,
|
|
@@ -20,17 +20,19 @@ function z(o, e, B, V, S, K) {
|
|
|
20
20
|
`neon-dropdown--${o.color}`
|
|
21
21
|
], "neon-dropdown"])
|
|
22
22
|
}, [
|
|
23
|
-
t("div",
|
|
23
|
+
t("div", k, [
|
|
24
24
|
s(o.$slots, "dropdown-button", {}, () => [
|
|
25
|
-
o.isButtonStyle ? (
|
|
25
|
+
o.isButtonStyle ? (l(), a("div", O, [
|
|
26
26
|
u(b, {
|
|
27
27
|
id: o.id,
|
|
28
28
|
"alternate-color": o.alternateColor,
|
|
29
29
|
"aria-expanded": o.modelValue,
|
|
30
30
|
"button-style": o.dropdownStyle,
|
|
31
|
-
color: o.color,
|
|
31
|
+
color: o.dropdownStyle === "input" ? "low-contrast" : o.color,
|
|
32
32
|
disabled: o.disabled,
|
|
33
33
|
icon: o.icon,
|
|
34
|
+
"icon-aria-label": o.iconAriaLabel,
|
|
35
|
+
"icon-position": o.dropdownStyle === "input" ? "right" : "left",
|
|
34
36
|
indicator: o.indicator,
|
|
35
37
|
"indicator-expanded": o.modelValue,
|
|
36
38
|
label: o.label,
|
|
@@ -41,11 +43,11 @@ function z(o, e, B, V, S, K) {
|
|
|
41
43
|
onFocus: e[1] || (e[1] = (n) => o.onFocus()),
|
|
42
44
|
onClickCapture: d(o.toggleOpen, ["stop", "prevent"]),
|
|
43
45
|
onKeydownCapture: [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
r(d(o.toggleOpen, ["stop", "prevent"]), ["enter"]),
|
|
47
|
+
r(d(o.toggleOpen, ["stop", "prevent"]), ["space"])
|
|
46
48
|
]
|
|
47
|
-
}, null, 8, ["id", "alternate-color", "aria-expanded", "button-style", "color", "disabled", "icon", "indicator", "indicator-expanded", "label", "size", "onClickCapture", "onKeydownCapture"])
|
|
48
|
-
])) : (
|
|
49
|
+
}, null, 8, ["id", "alternate-color", "aria-expanded", "button-style", "color", "disabled", "icon", "icon-aria-label", "icon-position", "indicator", "indicator-expanded", "label", "size", "onClickCapture", "onKeydownCapture"])
|
|
50
|
+
])) : (l(), a("div", {
|
|
49
51
|
key: 1,
|
|
50
52
|
id: o.id,
|
|
51
53
|
ref: "dropdownButton",
|
|
@@ -54,8 +56,8 @@ function z(o, e, B, V, S, K) {
|
|
|
54
56
|
role: "button",
|
|
55
57
|
onClickCapture: e[2] || (e[2] = d((...n) => o.toggleOpen && o.toggleOpen(...n), ["stop", "prevent"])),
|
|
56
58
|
onKeydownCapture: [
|
|
57
|
-
e[3] || (e[3] =
|
|
58
|
-
e[4] || (e[4] =
|
|
59
|
+
e[3] || (e[3] = r(d((...n) => o.toggleOpen && o.toggleOpen(...n), ["stop", "prevent"]), ["enter"])),
|
|
60
|
+
e[4] || (e[4] = r(d((...n) => o.toggleOpen && o.toggleOpen(...n), ["stop", "prevent"]), ["space"]))
|
|
59
61
|
]
|
|
60
62
|
}, [
|
|
61
63
|
u(w, {
|
|
@@ -69,28 +71,28 @@ function z(o, e, B, V, S, K) {
|
|
|
69
71
|
label: o.label,
|
|
70
72
|
size: o.size
|
|
71
73
|
}, null, 8, ["alternate-color", "circular", "color", "disabled", "icon", "image", "imageAlt", "label", "size"]),
|
|
72
|
-
o.indicator ? (
|
|
74
|
+
o.indicator ? (l(), v(g, {
|
|
73
75
|
key: 0,
|
|
74
76
|
color: o.color,
|
|
75
77
|
disabled: o.disabled,
|
|
76
78
|
expanded: o.modelValue,
|
|
77
79
|
class: "neon-button__indicator"
|
|
78
|
-
}, null, 8, ["color", "disabled", "expanded"])) :
|
|
79
|
-
], 40,
|
|
80
|
+
}, null, 8, ["color", "disabled", "expanded"])) : f("", !0)
|
|
81
|
+
], 40, $))
|
|
80
82
|
])
|
|
81
83
|
], 512),
|
|
82
84
|
e[5] || (e[5] = t("div", { class: "neon-dropdown__click-blocker" }, null, -1)),
|
|
83
|
-
|
|
85
|
+
y(t("div", {
|
|
84
86
|
ref: "dropdownContent",
|
|
85
87
|
class: p([`neon-dropdown__content--${o.dropdownPlacement}`, "neon-dropdown__content"])
|
|
86
88
|
}, [
|
|
87
89
|
s(o.$slots, "default")
|
|
88
90
|
], 2), [
|
|
89
|
-
[
|
|
91
|
+
[C, o.openOnHover || o.modelValue]
|
|
90
92
|
])
|
|
91
93
|
], 2);
|
|
92
94
|
}
|
|
93
|
-
const E = /* @__PURE__ */
|
|
95
|
+
const E = /* @__PURE__ */ c(m, [["render", z]]);
|
|
94
96
|
export {
|
|
95
97
|
E as default
|
|
96
98
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonDropdown.vue.es.js","sources":["../../../../src/components/presentation/dropdown/NeonDropdown.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n {\n 'neon-dropdown--with-indicator': indicator,\n 'neon-dropdown--open': modelValue,\n 'neon-dropdown--open-on-hover': openOnHover,\n 'neon-dropdown--icon-only': icon && !label,\n 'neon-dropdown--disabled': disabled,\n },\n `neon-dropdown--${size}`,\n `neon-dropdown--${color}`,\n ]\"\n class=\"neon-dropdown\"\n >\n <div ref=\"dropdownButton\">\n <!-- @slot optionally replace the dropdown button with a custom control -->\n <slot name=\"dropdown-button\">\n <div v-if=\"isButtonStyle\" class=\"neon-dropdown__button-wrapper\">\n <neon-button\n :id=\"id\"\n :alternate-color=\"alternateColor\"\n :aria-expanded=\"modelValue\"\n :button-style=\"dropdownStyle\"\n :color=\"color\"\n :disabled=\"disabled\"\n :icon=\"icon\"\n :indicator=\"indicator\"\n :indicator-expanded=\"modelValue\"\n :label=\"label\"\n :size=\"size\"\n aria-haspopup=\"true\"\n class=\"neon-dropdown__button\"\n @blur=\"onBlur()\"\n @focus=\"onFocus()\"\n @click.stop.prevent.capture=\"toggleOpen\"\n @keydown.enter.stop.prevent.capture=\"toggleOpen\"\n @keydown.space.stop.prevent.capture=\"toggleOpen\"\n />\n </div>\n <div\n v-else\n :id=\"id\"\n ref=\"dropdownButton\"\n :tabindex=\"!disabled ? 0 : undefined\"\n class=\"neon-dropdown__badge\"\n role=\"button\"\n @click.stop.prevent.capture=\"toggleOpen\"\n @keydown.enter.stop.prevent.capture=\"toggleOpen\"\n @keydown.space.stop.prevent.capture=\"toggleOpen\"\n >\n <neon-badge\n :alternate-color=\"alternateColor\"\n :circular=\"dropdownStyle === 'circular-badge'\"\n :color=\"color\"\n :disabled=\"disabled\"\n :icon=\"icon\"\n :image=\"image\"\n :imageAlt=\"imageAlt\"\n :label=\"label\"\n :size=\"size\"\n />\n <neon-expansion-indicator\n v-if=\"indicator\"\n :color=\"color\"\n :disabled=\"disabled\"\n :expanded=\"modelValue\"\n class=\"neon-button__indicator\"\n />\n </div>\n </slot>\n </div>\n <div class=\"neon-dropdown__click-blocker\" />\n <div\n v-show=\"openOnHover || modelValue\"\n ref=\"dropdownContent\"\n :class=\"`neon-dropdown__content--${dropdownPlacement}`\"\n class=\"neon-dropdown__content\"\n >\n <!-- @slot The content of the open dropdown -->\n <slot></slot>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonDropdown.ts\"></script>\n"],"names":["_hoisted_1","_createElementBlock","_normalizeClass","_ctx","_createElementVNode","_renderSlot","_openBlock","_hoisted_2","_createVNode","_component_neon_button","args","_component_neon_badge","_createBlock","_component_neon_expansion_indicator","_vShow"],"mappings":";;;AAeS,MAAAA,IAAA,EAAA,KAAI,iBAAgB;;EAGK,OAAM;;;;cAjBtCC,
|
|
1
|
+
{"version":3,"file":"NeonDropdown.vue.es.js","sources":["../../../../src/components/presentation/dropdown/NeonDropdown.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n {\n 'neon-dropdown--with-indicator': indicator,\n 'neon-dropdown--open': modelValue,\n 'neon-dropdown--open-on-hover': openOnHover,\n 'neon-dropdown--icon-only': icon && !label,\n 'neon-dropdown--disabled': disabled,\n },\n `neon-dropdown--${size}`,\n `neon-dropdown--${color}`,\n ]\"\n class=\"neon-dropdown\"\n >\n <div ref=\"dropdownButton\">\n <!-- @slot optionally replace the dropdown button with a custom control -->\n <slot name=\"dropdown-button\">\n <div v-if=\"isButtonStyle\" class=\"neon-dropdown__button-wrapper\">\n <neon-button\n :id=\"id\"\n :alternate-color=\"alternateColor\"\n :aria-expanded=\"modelValue\"\n :button-style=\"dropdownStyle\"\n :color=\"dropdownStyle === 'input' ? 'low-contrast' : color\"\n :disabled=\"disabled\"\n :icon=\"icon\"\n :icon-aria-label=\"iconAriaLabel\"\n :icon-position=\"dropdownStyle === 'input' ? 'right' : 'left'\"\n :indicator=\"indicator\"\n :indicator-expanded=\"modelValue\"\n :label=\"label\"\n :size=\"size\"\n aria-haspopup=\"true\"\n class=\"neon-dropdown__button\"\n @blur=\"onBlur()\"\n @focus=\"onFocus()\"\n @click.stop.prevent.capture=\"toggleOpen\"\n @keydown.enter.stop.prevent.capture=\"toggleOpen\"\n @keydown.space.stop.prevent.capture=\"toggleOpen\"\n />\n </div>\n <div\n v-else\n :id=\"id\"\n ref=\"dropdownButton\"\n :tabindex=\"!disabled ? 0 : undefined\"\n class=\"neon-dropdown__badge\"\n role=\"button\"\n @click.stop.prevent.capture=\"toggleOpen\"\n @keydown.enter.stop.prevent.capture=\"toggleOpen\"\n @keydown.space.stop.prevent.capture=\"toggleOpen\"\n >\n <neon-badge\n :alternate-color=\"alternateColor\"\n :circular=\"dropdownStyle === 'circular-badge'\"\n :color=\"color\"\n :disabled=\"disabled\"\n :icon=\"icon\"\n :image=\"image\"\n :imageAlt=\"imageAlt\"\n :label=\"label\"\n :size=\"size\"\n />\n <neon-expansion-indicator\n v-if=\"indicator\"\n :color=\"color\"\n :disabled=\"disabled\"\n :expanded=\"modelValue\"\n class=\"neon-button__indicator\"\n />\n </div>\n </slot>\n </div>\n <div class=\"neon-dropdown__click-blocker\" />\n <div\n v-show=\"openOnHover || modelValue\"\n ref=\"dropdownContent\"\n :class=\"`neon-dropdown__content--${dropdownPlacement}`\"\n class=\"neon-dropdown__content\"\n >\n <!-- @slot The content of the open dropdown -->\n <slot></slot>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonDropdown.ts\"></script>\n"],"names":["_hoisted_1","_createElementBlock","_normalizeClass","_ctx","_createElementVNode","_renderSlot","_openBlock","_hoisted_2","_createVNode","_component_neon_button","args","_component_neon_badge","_createBlock","_component_neon_expansion_indicator","_vShow"],"mappings":";;;AAeS,MAAAA,IAAA,EAAA,KAAI,iBAAgB;;EAGK,OAAM;;;;cAjBtCC,EAmFM,OAAA;AAAA,IAlFH,OAAKC,EAAA,CAAA;AAAA;yCAAqDC,EAAA;AAAA,+BAA0CA,EAAA;AAAA,wCAAoDA,EAAA;AAAA,QAAiD,4BAAAA,EAAA,SAASA,EAAA;AAAA,mCAA0CA,EAAA;AAAA;wBAA2CA,EAAA,IAAI;AAAA,wBAA4BA,EAAA,KAAK;AAAA,OAWvU,eAAe,CAAA;AAAA;IAErBC,EA0DM,OA1DNJ,GA0DM;AAAA,MAxDJK,EAuDOF,iCAvDP,MAuDO;AAAA,QAtDMA,EAAA,iBAAXG,KAAAL,EAuBM,OAvBNM,GAuBM;AAAA,UAtBJC,EAqBEC,GAAA;AAAA,YApBC,IAAIN,EAAA;AAAA,YACJ,mBAAiBA,EAAA;AAAA,YACjB,iBAAeA,EAAA;AAAA,YACf,gBAAcA,EAAA;AAAA,YACd,OAAOA,EAAA,kBAAa,UAAA,iBAAgCA,EAAA;AAAA,YACpD,UAAUA,EAAA;AAAA,YACV,MAAMA,EAAA;AAAA,YACN,mBAAiBA,EAAA;AAAA,YACjB,iBAAeA,EAAA,kBAAa,UAAA,UAAA;AAAA,YAC5B,WAAWA,EAAA;AAAA,YACX,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BAA8B,GAAA,MAAA,EAAA;AAAA,MACzCA,EAQM,OAAA;AAAA,MANJ,KAAI;AAAA,MACH,OAAKF,EAAA,CAAA,2BAA6BC,EAAA,iBAAiB,IAC9C,wBAAwB,CAAA;AAAA;MAG9BE,EAAaF,EAAA,QAAA,SAAA;AAAA;MANL,CAAAW,GAAAX,EAAA,eAAeA,EAAA,UAAU;AAAA;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),f=require("../../../common/enums/NeonButtonSize.cjs.js"),y=require("../../../common/enums/NeonFunctionalColor.cjs.js"),o=require("../../../common/enums/NeonButtonStyle.cjs.js"),S=require("../../../common/enums/NeonHorizontalPosition.cjs.js"),N=require("../../presentation/icon/NeonIcon.vue.cjs.js"),B=require("../../navigation/link/NeonLink.vue.cjs.js"),g=require("../../presentation/expansion-indicator/NeonExpansionIndicator.vue.cjs.js"),l=require("../../../common/enums/NeonState.cjs.js"),m=e.defineComponent({name:"NeonButton",components:{NeonExpansionIndicator:g,NeonIcon:N,NeonLink:B},props:{href:{type:String,default:null},label:{type:String,default:null},size:{type:String,default:f.NeonButtonSize.Medium},color:{type:String,default:y.NeonFunctionalColor.Primary},inverse:{type:Boolean,default:!1},alternateColor:{type:String,default:null},icon:{type:String,default:null},iconAriaLabel:{type:String},iconPosition:{type:String,default:S.NeonHorizontalPosition.Left},buttonStyle:{type:String,default:o.NeonButtonStyle.Solid},state:{type:String,default:l.NeonState.Ready},disabled:{type:Boolean,default:!1},transparent:{type:Boolean,default:!1},outline:{type:Boolean,default:!0},circular:{type:Boolean,default:null},fullWidth:{type:Boolean,default:null},indicator:{type:Boolean,default:!1},indicatorExpanded:{type:Boolean,default:null}},emits:["click"],setup(t,{emit:a}){const u=e.useAttrs(),i=e.ref(null),c=e.computed(()=>{switch(t.state){case l.NeonState.Loading:return"loading";case l.NeonState.Success:return"check";case l.NeonState.Error:return"times";default:return t.icon}}),r=e.computed(()=>[`neon-button--${t.size}`,!t.inverse&&`neon-button--${t.color}`,`neon-button--${t.buttonStyle}`,`neon-button--state-${t.state}`,{"neon-button--text-transparent":t.transparent&&t.buttonStyle===o.NeonButtonStyle.Text,"neon-button--disabled":t.disabled,"neon-button--inverse":t.inverse,"neon-button--circular":t.circular,"neon-button--no-outline":!t.outline,"neon-button--full-width":t.fullWidth,"neon-button--with-icon neon-button--icon-only":t.buttonStyle!==o.NeonButtonStyle.Input&&!t.label&&t.icon&&!t.indicator,"neon-button--with-icon neon-button--icon-left":t.label&&t.icon&&t.iconPosition==="left","neon-button--with-icon neon-button--icon-right":(t.label||t.buttonStyle===o.NeonButtonStyle.Input)&&t.icon&&t.iconPosition==="right",[`neon-button--alternate-color-${t.alternateColor}`]:t.alternateColor}]),d=()=>{var n;return(n=i.value)==null?void 0:n.click()},s=e.computed(()=>{const{onClick:n,...b}=u;return b});return{iconName:c,classes:r,button:i,attrs:u,sanitizedAttributes:s,clickLink:d,clickButton:()=>{var n;t.disabled||a("click"),(n=i.value)==null||n.blur()}}}});module.exports=m;
|
|
2
2
|
//# sourceMappingURL=NeonButton.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonButton.cjs.js","sources":["../../../../src/components/user-input/button/NeonButton.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, ref, useAttrs } from 'vue';\nimport { NeonButtonSize } from '@/common/enums/NeonButtonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonButtonStyle } from '@/common/enums/NeonButtonStyle';\nimport { NeonHorizontalPosition } from '@/common/enums/NeonHorizontalPosition';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\nimport NeonExpansionIndicator from '@/components/presentation/expansion-indicator/NeonExpansionIndicator.vue';\nimport { NeonState } from '@/common/enums/NeonState';\n\n/**\n * A button component. Renders an HTML button or, if an href is provided, renders using NeonLink in the style of a button. NeonButton supports all events and attributes of HTML buttons, e.g, @click.\n */\nexport default defineComponent({\n name: 'NeonButton',\n components: {\n NeonExpansionIndicator,\n NeonIcon,\n NeonLink,\n },\n props: {\n /**\n * Optional href for rendering a button as a link\n */\n href: { type: String, default: null },\n /**\n * The text to display on a button\n */\n label: { type: String, default: null },\n /**\n * The button size\n */\n size: { type: String as () => NeonButtonSize, default: NeonButtonSize.Medium },\n /**\n * The button color\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.Primary },\n /**\n * Display the button as high-contrast with inverted colors. This is useful for placing a button on a colored background.\n * NOTE: Supports Solid & Outline button styles only (gradient & text buttons are not supported)\n */\n inverse: { type: Boolean, default: false },\n /**\n * Solid buttons ONLY. Alternate color for creating a gradient buttons. NOTE: can also be the same color as 'color'.\n */\n alternateColor: { type: String as () => NeonFunctionalColor, default: null },\n /**\n * Optional icon to display\n */\n icon: { type: String, default: null },\n /**\n * Position of the icon if combined with text\n */\n iconPosition: { type: String as () => NeonHorizontalPosition, default: NeonHorizontalPosition.Left },\n /**\n * The style of button\n */\n buttonStyle: { type: String as () => NeonButtonStyle, default: NeonButtonStyle.Solid },\n /**\n * Provide button states of <em>ready, loading, success or error</em> which change the display of the button (with icons) to reflect the state.\n */\n state: { type: String as () => NeonState, default: NeonState.Ready },\n /**\n * Whether the button is disabled\n */\n disabled: { type: Boolean, default: false },\n /**\n * For text buttons, do not display the background. This is useful for icon buttons in headers.\n */\n transparent: { type: Boolean, default: false },\n /**\n * Whether to display a button outline when the button has focus\n */\n outline: { type: Boolean, default: true },\n /**\n * Make the button circular. NOTE: This is only for icon only buttons.\n */\n circular: { type: Boolean, default: null },\n /**\n * Make a button extend to the full width of the parent container.\n */\n fullWidth: { type: Boolean, default: null },\n /**\n * INTERNAL USE ONLY: display a NeonExpansionIndicator on the button (used for dropdown buttons)\n * @ignore\n */\n indicator: { type: Boolean, default: false },\n /**\n * INTERNAL USE ONLY: display the NeonExpansionIndicator on the button as <em>open</em> or <em>closed</em>.\n * @ignore\n */\n indicatorExpanded: { type: Boolean, default: null },\n },\n emits: [\n /**\n * Emitted when the user clicks on the button or link.\n */\n 'click',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n\n const button = ref<HTMLElement | null>(null);\n\n const iconName = computed(() => {\n switch (props.state) {\n case NeonState.Loading:\n return 'loading';\n case NeonState.Success:\n return 'check';\n case NeonState.Error:\n return 'times';\n default:\n return props.icon;\n }\n });\n\n const classes = computed(() => {\n return [\n `neon-button--${props.size}`,\n !props.inverse && `neon-button--${props.color}`,\n `neon-button--${props.buttonStyle}`,\n `neon-button--state-${props.state}`,\n {\n 'neon-button--text-transparent': props.transparent && props.buttonStyle === NeonButtonStyle.Text,\n 'neon-button--disabled': props.disabled,\n 'neon-button--inverse': props.inverse,\n 'neon-button--circular': props.circular,\n 'neon-button--no-outline': !props.outline,\n 'neon-button--full-width': props.fullWidth,\n 'neon-button--with-icon neon-button--icon-only'
|
|
1
|
+
{"version":3,"file":"NeonButton.cjs.js","sources":["../../../../src/components/user-input/button/NeonButton.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, ref, useAttrs } from 'vue';\nimport { NeonButtonSize } from '@/common/enums/NeonButtonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonButtonStyle } from '@/common/enums/NeonButtonStyle';\nimport { NeonHorizontalPosition } from '@/common/enums/NeonHorizontalPosition';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\nimport NeonExpansionIndicator from '@/components/presentation/expansion-indicator/NeonExpansionIndicator.vue';\nimport { NeonState } from '@/common/enums/NeonState';\n\n/**\n * A button component. Renders an HTML button or, if an href is provided, renders using NeonLink in the style of a button. NeonButton supports all events and attributes of HTML buttons, e.g, @click.\n */\nexport default defineComponent({\n name: 'NeonButton',\n components: {\n NeonExpansionIndicator,\n NeonIcon,\n NeonLink,\n },\n props: {\n /**\n * Optional href for rendering a button as a link\n */\n href: { type: String, default: null },\n /**\n * The text to display on a button\n */\n label: { type: String, default: null },\n /**\n * The button size\n */\n size: { type: String as () => NeonButtonSize, default: NeonButtonSize.Medium },\n /**\n * The button color\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.Primary },\n /**\n * Display the button as high-contrast with inverted colors. This is useful for placing a button on a colored background.\n * NOTE: Supports Solid & Outline button styles only (gradient & text buttons are not supported)\n */\n inverse: { type: Boolean, default: false },\n /**\n * Solid buttons ONLY. Alternate color for creating a gradient buttons. NOTE: can also be the same color as 'color'.\n */\n alternateColor: { type: String as () => NeonFunctionalColor, default: null },\n /**\n * Optional icon to display\n */\n icon: { type: String, default: null },\n /**\n * The aria label of the icon button\n */\n iconAriaLabel: { type: String },\n /**\n * Position of the icon if combined with text\n */\n iconPosition: { type: String as () => NeonHorizontalPosition, default: NeonHorizontalPosition.Left },\n /**\n * The style of button\n */\n buttonStyle: { type: String as () => NeonButtonStyle, default: NeonButtonStyle.Solid },\n /**\n * Provide button states of <em>ready, loading, success or error</em> which change the display of the button (with icons) to reflect the state.\n */\n state: { type: String as () => NeonState, default: NeonState.Ready },\n /**\n * Whether the button is disabled\n */\n disabled: { type: Boolean, default: false },\n /**\n * For text buttons, do not display the background. This is useful for icon buttons in headers.\n */\n transparent: { type: Boolean, default: false },\n /**\n * Whether to display a button outline when the button has focus\n */\n outline: { type: Boolean, default: true },\n /**\n * Make the button circular. NOTE: This is only for icon only buttons.\n */\n circular: { type: Boolean, default: null },\n /**\n * Make a button extend to the full width of the parent container.\n */\n fullWidth: { type: Boolean, default: null },\n /**\n * INTERNAL USE ONLY: display a NeonExpansionIndicator on the button (used for dropdown buttons)\n * @ignore\n */\n indicator: { type: Boolean, default: false },\n /**\n * INTERNAL USE ONLY: display the NeonExpansionIndicator on the button as <em>open</em> or <em>closed</em>.\n * @ignore\n */\n indicatorExpanded: { type: Boolean, default: null },\n },\n emits: [\n /**\n * Emitted when the user clicks on the button or link.\n */\n 'click',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n\n const button = ref<HTMLElement | null>(null);\n\n const iconName = computed(() => {\n switch (props.state) {\n case NeonState.Loading:\n return 'loading';\n case NeonState.Success:\n return 'check';\n case NeonState.Error:\n return 'times';\n default:\n return props.icon;\n }\n });\n\n const classes = computed(() => {\n return [\n `neon-button--${props.size}`,\n !props.inverse && `neon-button--${props.color}`,\n `neon-button--${props.buttonStyle}`,\n `neon-button--state-${props.state}`,\n {\n 'neon-button--text-transparent': props.transparent && props.buttonStyle === NeonButtonStyle.Text,\n 'neon-button--disabled': props.disabled,\n 'neon-button--inverse': props.inverse,\n 'neon-button--circular': props.circular,\n 'neon-button--no-outline': !props.outline,\n 'neon-button--full-width': props.fullWidth,\n 'neon-button--with-icon neon-button--icon-only':\n props.buttonStyle !== NeonButtonStyle.Input && !props.label && props.icon && !props.indicator,\n 'neon-button--with-icon neon-button--icon-left': props.label && props.icon && props.iconPosition === 'left',\n 'neon-button--with-icon neon-button--icon-right':\n (props.label || props.buttonStyle === NeonButtonStyle.Input) &&\n props.icon &&\n props.iconPosition === 'right',\n [`neon-button--alternate-color-${props.alternateColor}`]: props.alternateColor,\n },\n ];\n });\n\n const clickLink = () => button.value?.click();\n\n const sanitizedAttributes = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onClick, ...sanitized } = attrs;\n return sanitized;\n });\n\n const clickButton = () => {\n if (!props.disabled) {\n emit('click');\n }\n button.value?.blur();\n };\n\n return {\n iconName,\n classes,\n button,\n attrs,\n sanitizedAttributes,\n clickLink,\n clickButton,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonExpansionIndicator","NeonIcon","NeonLink","NeonButtonSize","NeonFunctionalColor","NeonHorizontalPosition","NeonButtonStyle","NeonState","props","emit","attrs","useAttrs","button","ref","iconName","computed","classes","clickLink","_a","sanitizedAttributes","onClick","sanitized"],"mappings":"ghBAaAA,EA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UAAU,MACb,MAAO,QACT,QACE,OAAOC,EAAM,IAAA,CAEnB,CAAC,EAEKQ,EAAUD,EAAAA,SAAS,IAChB,CACL,gBAAgBP,EAAM,IAAI,GAC1B,CAACA,EAAM,SAAW,gBAAgBA,EAAM,KAAK,GAC7C,gBAAgBA,EAAM,WAAW,GACjC,sBAAsBA,EAAM,KAAK,GACjC,CACE,gCAAiCA,EAAM,aAAeA,EAAM,cAAgBF,EAAAA,gBAAgB,KAC5F,wBAAyBE,EAAM,SAC/B,uBAAwBA,EAAM,QAC9B,wBAAyBA,EAAM,SAC/B,0BAA2B,CAACA,EAAM,QAClC,0BAA2BA,EAAM,UACjC,gDACEA,EAAM,cAAgBF,EAAAA,gBAAgB,OAAS,CAACE,EAAM,OAASA,EAAM,MAAQ,CAACA,EAAM,UACtF,gDAAiDA,EAAM,OAASA,EAAM,MAAQA,EAAM,eAAiB,OACrG,kDACGA,EAAM,OAASA,EAAM,cAAgBF,kBAAgB,QACtDE,EAAM,MACNA,EAAM,eAAiB,QACzB,CAAC,gCAAgCA,EAAM,cAAc,EAAE,EAAGA,EAAM,cAAA,CAClE,CAEH,EAEKS,EAAY,IAAA,OAAM,OAAAC,EAAAN,EAAO,QAAP,YAAAM,EAAc,SAEhCC,EAAsBJ,EAAAA,SAAS,IAAM,CAEzC,KAAM,CAAE,QAAAK,EAAS,GAAGC,CAAA,EAAcX,EAClC,OAAOW,CACT,CAAC,EASD,MAAO,CACL,SAAAP,EACA,QAAAE,EACA,OAAAJ,EACA,MAAAF,EACA,oBAAAS,EACA,UAAAF,EACA,YAdkB,IAAM,OACnBT,EAAM,UACTC,EAAK,OAAO,GAEdS,EAAAN,EAAO,QAAP,MAAAM,EAAc,MAChB,CASE,CAEJ,CACF,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as s, useAttrs as m, ref as y, computed as i } from "vue";
|
|
2
2
|
import { NeonButtonSize as S } from "../../../common/enums/NeonButtonSize.es.js";
|
|
3
3
|
import { NeonFunctionalColor as g } from "../../../common/enums/NeonFunctionalColor.es.js";
|
|
4
|
-
import { NeonButtonStyle as
|
|
4
|
+
import { NeonButtonStyle as e } from "../../../common/enums/NeonButtonStyle.es.js";
|
|
5
5
|
import { NeonHorizontalPosition as B } from "../../../common/enums/NeonHorizontalPosition.es.js";
|
|
6
6
|
import h from "../../presentation/icon/NeonIcon.vue.es.js";
|
|
7
7
|
import k from "../../navigation/link/NeonLink.vue.es.js";
|
|
8
8
|
import N from "../../presentation/expansion-indicator/NeonExpansionIndicator.vue.es.js";
|
|
9
|
-
import { NeonState as
|
|
10
|
-
const
|
|
9
|
+
import { NeonState as o } from "../../../common/enums/NeonState.es.js";
|
|
10
|
+
const E = s({
|
|
11
11
|
name: "NeonButton",
|
|
12
12
|
components: {
|
|
13
13
|
NeonExpansionIndicator: N,
|
|
@@ -44,6 +44,10 @@ const I = b({
|
|
|
44
44
|
* Optional icon to display
|
|
45
45
|
*/
|
|
46
46
|
icon: { type: String, default: null },
|
|
47
|
+
/**
|
|
48
|
+
* The aria label of the icon button
|
|
49
|
+
*/
|
|
50
|
+
iconAriaLabel: { type: String },
|
|
47
51
|
/**
|
|
48
52
|
* Position of the icon if combined with text
|
|
49
53
|
*/
|
|
@@ -51,11 +55,11 @@ const I = b({
|
|
|
51
55
|
/**
|
|
52
56
|
* The style of button
|
|
53
57
|
*/
|
|
54
|
-
buttonStyle: { type: String, default:
|
|
58
|
+
buttonStyle: { type: String, default: e.Solid },
|
|
55
59
|
/**
|
|
56
60
|
* Provide button states of <em>ready, loading, success or error</em> which change the display of the button (with icons) to reflect the state.
|
|
57
61
|
*/
|
|
58
|
-
state: { type: String, default:
|
|
62
|
+
state: { type: String, default: o.Ready },
|
|
59
63
|
/**
|
|
60
64
|
* Whether the button is disabled
|
|
61
65
|
*/
|
|
@@ -94,56 +98,56 @@ const I = b({
|
|
|
94
98
|
"click"
|
|
95
99
|
],
|
|
96
100
|
setup(t, { emit: u }) {
|
|
97
|
-
const
|
|
101
|
+
const a = m(), l = y(null), c = i(() => {
|
|
98
102
|
switch (t.state) {
|
|
99
|
-
case
|
|
103
|
+
case o.Loading:
|
|
100
104
|
return "loading";
|
|
101
|
-
case
|
|
105
|
+
case o.Success:
|
|
102
106
|
return "check";
|
|
103
|
-
case
|
|
107
|
+
case o.Error:
|
|
104
108
|
return "times";
|
|
105
109
|
default:
|
|
106
110
|
return t.icon;
|
|
107
111
|
}
|
|
108
|
-
}), r =
|
|
112
|
+
}), r = i(() => [
|
|
109
113
|
`neon-button--${t.size}`,
|
|
110
114
|
!t.inverse && `neon-button--${t.color}`,
|
|
111
115
|
`neon-button--${t.buttonStyle}`,
|
|
112
116
|
`neon-button--state-${t.state}`,
|
|
113
117
|
{
|
|
114
|
-
"neon-button--text-transparent": t.transparent && t.buttonStyle ===
|
|
118
|
+
"neon-button--text-transparent": t.transparent && t.buttonStyle === e.Text,
|
|
115
119
|
"neon-button--disabled": t.disabled,
|
|
116
120
|
"neon-button--inverse": t.inverse,
|
|
117
121
|
"neon-button--circular": t.circular,
|
|
118
122
|
"neon-button--no-outline": !t.outline,
|
|
119
123
|
"neon-button--full-width": t.fullWidth,
|
|
120
|
-
"neon-button--with-icon neon-button--icon-only": !t.label && t.icon && !t.indicator,
|
|
124
|
+
"neon-button--with-icon neon-button--icon-only": t.buttonStyle !== e.Input && !t.label && t.icon && !t.indicator,
|
|
121
125
|
"neon-button--with-icon neon-button--icon-left": t.label && t.icon && t.iconPosition === "left",
|
|
122
|
-
"neon-button--with-icon neon-button--icon-right": t.label && t.icon && t.iconPosition === "right",
|
|
126
|
+
"neon-button--with-icon neon-button--icon-right": (t.label || t.buttonStyle === e.Input) && t.icon && t.iconPosition === "right",
|
|
123
127
|
[`neon-button--alternate-color-${t.alternateColor}`]: t.alternateColor
|
|
124
128
|
}
|
|
125
129
|
]), d = () => {
|
|
126
130
|
var n;
|
|
127
|
-
return (n =
|
|
128
|
-
}, f =
|
|
129
|
-
const { onClick: n, ...
|
|
130
|
-
return
|
|
131
|
+
return (n = l.value) == null ? void 0 : n.click();
|
|
132
|
+
}, f = i(() => {
|
|
133
|
+
const { onClick: n, ...b } = a;
|
|
134
|
+
return b;
|
|
131
135
|
});
|
|
132
136
|
return {
|
|
133
137
|
iconName: c,
|
|
134
138
|
classes: r,
|
|
135
|
-
button:
|
|
136
|
-
attrs:
|
|
139
|
+
button: l,
|
|
140
|
+
attrs: a,
|
|
137
141
|
sanitizedAttributes: f,
|
|
138
142
|
clickLink: d,
|
|
139
143
|
clickButton: () => {
|
|
140
144
|
var n;
|
|
141
|
-
t.disabled || u("click"), (n =
|
|
145
|
+
t.disabled || u("click"), (n = l.value) == null || n.blur();
|
|
142
146
|
}
|
|
143
147
|
};
|
|
144
148
|
}
|
|
145
149
|
});
|
|
146
150
|
export {
|
|
147
|
-
|
|
151
|
+
E as default
|
|
148
152
|
};
|
|
149
153
|
//# sourceMappingURL=NeonButton.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonButton.es.js","sources":["../../../../src/components/user-input/button/NeonButton.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, ref, useAttrs } from 'vue';\nimport { NeonButtonSize } from '@/common/enums/NeonButtonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonButtonStyle } from '@/common/enums/NeonButtonStyle';\nimport { NeonHorizontalPosition } from '@/common/enums/NeonHorizontalPosition';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\nimport NeonExpansionIndicator from '@/components/presentation/expansion-indicator/NeonExpansionIndicator.vue';\nimport { NeonState } from '@/common/enums/NeonState';\n\n/**\n * A button component. Renders an HTML button or, if an href is provided, renders using NeonLink in the style of a button. NeonButton supports all events and attributes of HTML buttons, e.g, @click.\n */\nexport default defineComponent({\n name: 'NeonButton',\n components: {\n NeonExpansionIndicator,\n NeonIcon,\n NeonLink,\n },\n props: {\n /**\n * Optional href for rendering a button as a link\n */\n href: { type: String, default: null },\n /**\n * The text to display on a button\n */\n label: { type: String, default: null },\n /**\n * The button size\n */\n size: { type: String as () => NeonButtonSize, default: NeonButtonSize.Medium },\n /**\n * The button color\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.Primary },\n /**\n * Display the button as high-contrast with inverted colors. This is useful for placing a button on a colored background.\n * NOTE: Supports Solid & Outline button styles only (gradient & text buttons are not supported)\n */\n inverse: { type: Boolean, default: false },\n /**\n * Solid buttons ONLY. Alternate color for creating a gradient buttons. NOTE: can also be the same color as 'color'.\n */\n alternateColor: { type: String as () => NeonFunctionalColor, default: null },\n /**\n * Optional icon to display\n */\n icon: { type: String, default: null },\n /**\n * Position of the icon if combined with text\n */\n iconPosition: { type: String as () => NeonHorizontalPosition, default: NeonHorizontalPosition.Left },\n /**\n * The style of button\n */\n buttonStyle: { type: String as () => NeonButtonStyle, default: NeonButtonStyle.Solid },\n /**\n * Provide button states of <em>ready, loading, success or error</em> which change the display of the button (with icons) to reflect the state.\n */\n state: { type: String as () => NeonState, default: NeonState.Ready },\n /**\n * Whether the button is disabled\n */\n disabled: { type: Boolean, default: false },\n /**\n * For text buttons, do not display the background. This is useful for icon buttons in headers.\n */\n transparent: { type: Boolean, default: false },\n /**\n * Whether to display a button outline when the button has focus\n */\n outline: { type: Boolean, default: true },\n /**\n * Make the button circular. NOTE: This is only for icon only buttons.\n */\n circular: { type: Boolean, default: null },\n /**\n * Make a button extend to the full width of the parent container.\n */\n fullWidth: { type: Boolean, default: null },\n /**\n * INTERNAL USE ONLY: display a NeonExpansionIndicator on the button (used for dropdown buttons)\n * @ignore\n */\n indicator: { type: Boolean, default: false },\n /**\n * INTERNAL USE ONLY: display the NeonExpansionIndicator on the button as <em>open</em> or <em>closed</em>.\n * @ignore\n */\n indicatorExpanded: { type: Boolean, default: null },\n },\n emits: [\n /**\n * Emitted when the user clicks on the button or link.\n */\n 'click',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n\n const button = ref<HTMLElement | null>(null);\n\n const iconName = computed(() => {\n switch (props.state) {\n case NeonState.Loading:\n return 'loading';\n case NeonState.Success:\n return 'check';\n case NeonState.Error:\n return 'times';\n default:\n return props.icon;\n }\n });\n\n const classes = computed(() => {\n return [\n `neon-button--${props.size}`,\n !props.inverse && `neon-button--${props.color}`,\n `neon-button--${props.buttonStyle}`,\n `neon-button--state-${props.state}`,\n {\n 'neon-button--text-transparent': props.transparent && props.buttonStyle === NeonButtonStyle.Text,\n 'neon-button--disabled': props.disabled,\n 'neon-button--inverse': props.inverse,\n 'neon-button--circular': props.circular,\n 'neon-button--no-outline': !props.outline,\n 'neon-button--full-width': props.fullWidth,\n 'neon-button--with-icon neon-button--icon-only'
|
|
1
|
+
{"version":3,"file":"NeonButton.es.js","sources":["../../../../src/components/user-input/button/NeonButton.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, ref, useAttrs } from 'vue';\nimport { NeonButtonSize } from '@/common/enums/NeonButtonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonButtonStyle } from '@/common/enums/NeonButtonStyle';\nimport { NeonHorizontalPosition } from '@/common/enums/NeonHorizontalPosition';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\nimport NeonExpansionIndicator from '@/components/presentation/expansion-indicator/NeonExpansionIndicator.vue';\nimport { NeonState } from '@/common/enums/NeonState';\n\n/**\n * A button component. Renders an HTML button or, if an href is provided, renders using NeonLink in the style of a button. NeonButton supports all events and attributes of HTML buttons, e.g, @click.\n */\nexport default defineComponent({\n name: 'NeonButton',\n components: {\n NeonExpansionIndicator,\n NeonIcon,\n NeonLink,\n },\n props: {\n /**\n * Optional href for rendering a button as a link\n */\n href: { type: String, default: null },\n /**\n * The text to display on a button\n */\n label: { type: String, default: null },\n /**\n * The button size\n */\n size: { type: String as () => NeonButtonSize, default: NeonButtonSize.Medium },\n /**\n * The button color\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.Primary },\n /**\n * Display the button as high-contrast with inverted colors. This is useful for placing a button on a colored background.\n * NOTE: Supports Solid & Outline button styles only (gradient & text buttons are not supported)\n */\n inverse: { type: Boolean, default: false },\n /**\n * Solid buttons ONLY. Alternate color for creating a gradient buttons. NOTE: can also be the same color as 'color'.\n */\n alternateColor: { type: String as () => NeonFunctionalColor, default: null },\n /**\n * Optional icon to display\n */\n icon: { type: String, default: null },\n /**\n * The aria label of the icon button\n */\n iconAriaLabel: { type: String },\n /**\n * Position of the icon if combined with text\n */\n iconPosition: { type: String as () => NeonHorizontalPosition, default: NeonHorizontalPosition.Left },\n /**\n * The style of button\n */\n buttonStyle: { type: String as () => NeonButtonStyle, default: NeonButtonStyle.Solid },\n /**\n * Provide button states of <em>ready, loading, success or error</em> which change the display of the button (with icons) to reflect the state.\n */\n state: { type: String as () => NeonState, default: NeonState.Ready },\n /**\n * Whether the button is disabled\n */\n disabled: { type: Boolean, default: false },\n /**\n * For text buttons, do not display the background. This is useful for icon buttons in headers.\n */\n transparent: { type: Boolean, default: false },\n /**\n * Whether to display a button outline when the button has focus\n */\n outline: { type: Boolean, default: true },\n /**\n * Make the button circular. NOTE: This is only for icon only buttons.\n */\n circular: { type: Boolean, default: null },\n /**\n * Make a button extend to the full width of the parent container.\n */\n fullWidth: { type: Boolean, default: null },\n /**\n * INTERNAL USE ONLY: display a NeonExpansionIndicator on the button (used for dropdown buttons)\n * @ignore\n */\n indicator: { type: Boolean, default: false },\n /**\n * INTERNAL USE ONLY: display the NeonExpansionIndicator on the button as <em>open</em> or <em>closed</em>.\n * @ignore\n */\n indicatorExpanded: { type: Boolean, default: null },\n },\n emits: [\n /**\n * Emitted when the user clicks on the button or link.\n */\n 'click',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n\n const button = ref<HTMLElement | null>(null);\n\n const iconName = computed(() => {\n switch (props.state) {\n case NeonState.Loading:\n return 'loading';\n case NeonState.Success:\n return 'check';\n case NeonState.Error:\n return 'times';\n default:\n return props.icon;\n }\n });\n\n const classes = computed(() => {\n return [\n `neon-button--${props.size}`,\n !props.inverse && `neon-button--${props.color}`,\n `neon-button--${props.buttonStyle}`,\n `neon-button--state-${props.state}`,\n {\n 'neon-button--text-transparent': props.transparent && props.buttonStyle === NeonButtonStyle.Text,\n 'neon-button--disabled': props.disabled,\n 'neon-button--inverse': props.inverse,\n 'neon-button--circular': props.circular,\n 'neon-button--no-outline': !props.outline,\n 'neon-button--full-width': props.fullWidth,\n 'neon-button--with-icon neon-button--icon-only':\n props.buttonStyle !== NeonButtonStyle.Input && !props.label && props.icon && !props.indicator,\n 'neon-button--with-icon neon-button--icon-left': props.label && props.icon && props.iconPosition === 'left',\n 'neon-button--with-icon neon-button--icon-right':\n (props.label || props.buttonStyle === NeonButtonStyle.Input) &&\n props.icon &&\n props.iconPosition === 'right',\n [`neon-button--alternate-color-${props.alternateColor}`]: props.alternateColor,\n },\n ];\n });\n\n const clickLink = () => button.value?.click();\n\n const sanitizedAttributes = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onClick, ...sanitized } = attrs;\n return sanitized;\n });\n\n const clickButton = () => {\n if (!props.disabled) {\n emit('click');\n }\n button.value?.blur();\n };\n\n return {\n iconName,\n classes,\n button,\n attrs,\n sanitizedAttributes,\n clickLink,\n clickButton,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonExpansionIndicator","NeonIcon","NeonLink","NeonButtonSize","NeonFunctionalColor","NeonHorizontalPosition","NeonButtonStyle","NeonState","props","emit","attrs","useAttrs","button","ref","iconName","computed","classes","clickLink","_a","sanitizedAttributes","onClick","sanitized"],"mappings":";;;;;;;;;AAaA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,wBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,U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AO,UAAP,gBAAAM,EAAc;AAAA,OAEhCC,IAAsBJ,EAAS,MAAM;AAEzC,YAAM,EAAE,SAAAK,GAAS,GAAGC,EAAA,IAAcX;AAClC,aAAOW;AAAA,IACT,CAAC;AASD,WAAO;AAAA,MACL,UAAAP;AAAA,MACA,SAAAE;AAAA,MACA,QAAAJ;AAAA,MACA,OAAAF;AAAA,MACA,qBAAAS;AAAA,MACA,WAAAF;AAAA,MACA,aAdkB,MAAM;;AACxB,QAAKT,EAAM,YACTC,EAAK,OAAO,IAEdS,IAAAN,EAAO,UAAP,QAAAM,EAAc;AAAA,MAChB;AAAA,IASE;AAAA,EAEJ;AACF,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const r=require("./NeonButton.cjs.js"),n=require("vue"),a=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),d={key:1,class:"neon-button__label"},u=["disabled","tabindex"],b={key:1,class:"neon-button__label"};function c(e,o,k,m,y,B){const t=n.resolveComponent("neon-icon"),l=n.resolveComponent("neon-link"),
|
|
1
|
+
"use strict";const r=require("./NeonButton.cjs.js"),n=require("vue"),a=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),d={key:1,class:"neon-button__label"},u=["disabled","tabindex"],b={key:1,class:"neon-button__label"};function c(e,o,k,m,y,B){const t=n.resolveComponent("neon-icon"),l=n.resolveComponent("neon-link"),i=n.resolveComponent("neon-expansion-indicator");return e.href?(n.openBlock(),n.createBlock(l,n.mergeProps({key:0,ref:"button",class:[e.classes,"neon-button"],href:e.href,tabindex:e.disabled?-1:0,"outline-style":"none",role:"button"},e.sanitizedAttributes,{onKeydown:n.withKeys(n.withModifiers(e.clickLink,["prevent"]),["space"])}),{default:n.withCtx(()=>[e.icon||e.state!=="ready"?(n.openBlock(),n.createBlock(t,{key:0,color:e.buttonStyle!=="solid"?e.color:void 0,disabled:e.disabled,inverse:e.buttonStyle==="solid"||e.inverse,name:e.iconName},null,8,["color","disabled","inverse","name"])):n.createCommentVNode("",!0),e.label?(n.openBlock(),n.createElementBlock("span",d,n.toDisplayString(e.label),1)):n.createCommentVNode("",!0)]),_:1},16,["class","href","tabindex","onKeydown"])):(n.openBlock(),n.createElementBlock("button",n.mergeProps({key:1,ref:"button",class:[e.classes,"neon-button"],disabled:e.disabled||e.state!=="ready",tabindex:e.disabled?-1:0},e.sanitizedAttributes,{onClick:o[0]||(o[0]=(...s)=>e.clickButton&&e.clickButton(...s))}),[e.icon||e.state!=="ready"?(n.openBlock(),n.createBlock(t,{key:0,"aria-label":e.iconAriaLabel,color:e.buttonStyle!=="solid"?e.color:void 0,disabled:e.disabled,inverse:e.buttonStyle==="solid"||e.inverse,name:e.iconName},null,8,["aria-label","color","disabled","inverse","name"])):n.createCommentVNode("",!0),e.label||e.buttonStyle==="input"?(n.openBlock(),n.createElementBlock("span",b,n.toDisplayString(e.label||e.buttonStyle==="input"&&""),1)):n.createCommentVNode("",!0),e.indicator?(n.openBlock(),n.createBlock(i,{key:2,color:e.buttonStyle==="text"?e.color:"low-contrast",disabled:e.disabled,expanded:e.indicatorExpanded,inverse:e.buttonStyle==="solid"||e.inverse,class:"neon-button__indicator"},null,8,["color","disabled","expanded","inverse"])):n.createCommentVNode("",!0)],16,u))}const p=a(r,[["render",c]]);module.exports=p;
|
|
2
2
|
//# sourceMappingURL=NeonButton.vue.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonButton.vue.cjs.js","sources":["../../../../src/components/user-input/button/NeonButton.vue"],"sourcesContent":["<template>\n <neon-link\n v-if=\"href\"\n ref=\"button\"\n :class=\"classes\"\n :href=\"href\"\n :tabindex=\"!disabled ? 0 : -1\"\n class=\"neon-button\"\n outline-style=\"none\"\n role=\"button\"\n v-bind=\"sanitizedAttributes\"\n @keydown.space.prevent=\"clickLink\"\n >\n <neon-icon\n v-if=\"icon || state !== 'ready'\"\n :color=\"buttonStyle !== 'solid' ? color : undefined\"\n :disabled=\"disabled\"\n :inverse=\"buttonStyle === 'solid' || inverse\"\n :name=\"iconName\"\n />\n <span v-if=\"label\" class=\"neon-button__label\">{{ label }}</span>\n </neon-link>\n <button\n v-else\n ref=\"button\"\n :class=\"classes\"\n :disabled=\"disabled || state !== 'ready'\"\n :tabindex=\"!disabled ? 0 : -1\"\n class=\"neon-button\"\n v-bind=\"sanitizedAttributes\"\n @click=\"clickButton\"\n >\n <neon-icon\n v-if=\"icon || state !== 'ready'\"\n :color=\"buttonStyle !== 'solid' ? color : undefined\"\n :disabled=\"disabled\"\n :inverse=\"buttonStyle === 'solid' || inverse\"\n :name=\"iconName\"\n />\n <span v-if=\"label\" class=\"neon-button__label\"
|
|
1
|
+
{"version":3,"file":"NeonButton.vue.cjs.js","sources":["../../../../src/components/user-input/button/NeonButton.vue"],"sourcesContent":["<template>\n <neon-link\n v-if=\"href\"\n ref=\"button\"\n :class=\"classes\"\n :href=\"href\"\n :tabindex=\"!disabled ? 0 : -1\"\n class=\"neon-button\"\n outline-style=\"none\"\n role=\"button\"\n v-bind=\"sanitizedAttributes\"\n @keydown.space.prevent=\"clickLink\"\n >\n <neon-icon\n v-if=\"icon || state !== 'ready'\"\n :color=\"buttonStyle !== 'solid' ? color : undefined\"\n :disabled=\"disabled\"\n :inverse=\"buttonStyle === 'solid' || inverse\"\n :name=\"iconName\"\n />\n <span v-if=\"label\" class=\"neon-button__label\">{{ label }}</span>\n </neon-link>\n <button\n v-else\n ref=\"button\"\n :class=\"classes\"\n :disabled=\"disabled || state !== 'ready'\"\n :tabindex=\"!disabled ? 0 : -1\"\n class=\"neon-button\"\n v-bind=\"sanitizedAttributes\"\n @click=\"clickButton\"\n >\n <neon-icon\n v-if=\"icon || state !== 'ready'\"\n :aria-label=\"iconAriaLabel\"\n :color=\"buttonStyle !== 'solid' ? color : undefined\"\n :disabled=\"disabled\"\n :inverse=\"buttonStyle === 'solid' || inverse\"\n :name=\"iconName\"\n />\n <span v-if=\"label || buttonStyle === 'input'\" class=\"neon-button__label\">\n {{ label || (buttonStyle === 'input' && '') }}\n </span>\n <neon-expansion-indicator\n v-if=\"indicator\"\n :color=\"buttonStyle === 'text' ? color : 'low-contrast'\"\n :disabled=\"disabled\"\n :expanded=\"indicatorExpanded\"\n :inverse=\"buttonStyle === 'solid' || inverse\"\n class=\"neon-button__indicator\"\n />\n </button>\n</template>\n\n<script lang=\"ts\" src=\"./NeonButton.ts\" />\n"],"names":["_ctx","_openBlock","_createBlock","_component_neon_link","_mergeProps","_component_neon_icon","_createElementBlock","_hoisted_1","_toDisplayString","args","_hoisted_3","_component_neon_expansion_indicator"],"mappings":"8IAoBuB,MAAM,yDAoBqB,MAAM,gLAtC9CA,EAAA,MADRC,EAAAA,YAAAC,EAAAA,YAoBYC,EApBZC,aAoBY,OAlBV,IAAI,SACH,MAAK,CAAEJ,EAAA,QAGF,aAAa,EAFlB,KAAMA,EAAA,KACN,SAAWA,EAAA,SAAQ,GAAA,EAEpB,gBAAc,OACd,KAAK,UACGA,EAAA,oBAAmB,CAC1B,qCAAuBA,EAAA,UAAS,CAAA,SAAA,CAAA,EAAA,CAAA,OAAA,CAAA,uBAEjC,IAME,CALMA,EAAA,MAAQA,EAAA,QAAK,uBADrBE,EAAAA,YAMEG,EAAA,OAJC,MAAOL,EAAA,cAAW,QAAeA,EAAA,MAAQ,OACzC,SAAUA,EAAA,SACV,QAASA,EAAA,cAAW,SAAgBA,EAAA,QACpC,KAAMA,EAAA,qFAEGA,EAAA,qBAAZM,EAAAA,mBAAgE,OAAhEC,EAAgEC,EAAAA,gBAAfR,EAAA,KAAK,EAAA,CAAA,oFAExDC,EAAAA,YAAAK,EAAAA,mBA6BS,SA7BTF,aA6BS,OA3BP,IAAI,SACH,MAAK,CAAEJ,EAAA,QAGF,aAAa,EAFlB,SAAUA,EAAA,UAAYA,EAAA,QAAK,QAC3B,SAAWA,EAAA,SAAQ,GAAA,GAEZA,EAAA,oBAAmB,CAC1B,4BAAOA,EAAA,aAAAA,EAAA,YAAA,GAAAS,CAAA,MAGAT,EAAA,MAAQA,EAAA,QAAK,uBADrBE,EAAAA,YAOEG,EAAA,OALC,aAAYL,EAAA,cACZ,MAAOA,EAAA,cAAW,QAAeA,EAAA,MAAQ,OACzC,SAAUA,EAAA,SACV,QAASA,EAAA,cAAW,SAAgBA,EAAA,QACpC,KAAMA,EAAA,kGAEGA,EAAA,OAASA,EAAA,cAAW,SAAhCC,EAAAA,UAAA,EAAAK,EAAAA,mBAEO,OAFPI,EAEOF,EAAAA,gBADFR,EAAA,OAAUA,EAAA,cAAW,SAAA,EAAA,EAAA,CAAA,+BAGlBA,EAAA,yBADRE,EAAAA,YAOES,EAAA,OALC,MAAOX,EAAA,cAAW,OAAcA,EAAA,MAAK,eACrC,SAAUA,EAAA,SACV,SAAUA,EAAA,kBACV,QAASA,EAAA,cAAW,SAAgBA,EAAA,QACrC,MAAM"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
1
|
+
import y from "./NeonButton.es.js";
|
|
2
|
+
import { resolveComponent as l, openBlock as n, createBlock as i, mergeProps as d, withKeys as m, withModifiers as f, withCtx as k, createCommentVNode as o, createElementBlock as s, toDisplayString as r } from "vue";
|
|
3
3
|
import c from "../../../_virtual/_plugin-vue_export-helper.es.js";
|
|
4
4
|
const v = {
|
|
5
5
|
key: 1,
|
|
@@ -9,7 +9,7 @@ const v = {
|
|
|
9
9
|
class: "neon-button__label"
|
|
10
10
|
};
|
|
11
11
|
function w(e, t, B, C, N, $) {
|
|
12
|
-
const a =
|
|
12
|
+
const a = l("neon-icon"), b = l("neon-link"), u = l("neon-expansion-indicator");
|
|
13
13
|
return e.href ? (n(), i(b, d({
|
|
14
14
|
key: 0,
|
|
15
15
|
ref: "button",
|
|
@@ -19,7 +19,7 @@ function w(e, t, B, C, N, $) {
|
|
|
19
19
|
"outline-style": "none",
|
|
20
20
|
role: "button"
|
|
21
21
|
}, e.sanitizedAttributes, {
|
|
22
|
-
onKeydown:
|
|
22
|
+
onKeydown: m(f(e.clickLink, ["prevent"]), ["space"])
|
|
23
23
|
}), {
|
|
24
24
|
default: k(() => [
|
|
25
25
|
e.icon || e.state !== "ready" ? (n(), i(a, {
|
|
@@ -29,10 +29,10 @@ function w(e, t, B, C, N, $) {
|
|
|
29
29
|
inverse: e.buttonStyle === "solid" || e.inverse,
|
|
30
30
|
name: e.iconName
|
|
31
31
|
}, null, 8, ["color", "disabled", "inverse", "name"])) : o("", !0),
|
|
32
|
-
e.label ? (n(),
|
|
32
|
+
e.label ? (n(), s("span", v, r(e.label), 1)) : o("", !0)
|
|
33
33
|
]),
|
|
34
34
|
_: 1
|
|
35
|
-
}, 16, ["class", "href", "tabindex", "onKeydown"])) : (n(),
|
|
35
|
+
}, 16, ["class", "href", "tabindex", "onKeydown"])) : (n(), s("button", d({
|
|
36
36
|
key: 1,
|
|
37
37
|
ref: "button",
|
|
38
38
|
class: [e.classes, "neon-button"],
|
|
@@ -43,12 +43,13 @@ function w(e, t, B, C, N, $) {
|
|
|
43
43
|
}), [
|
|
44
44
|
e.icon || e.state !== "ready" ? (n(), i(a, {
|
|
45
45
|
key: 0,
|
|
46
|
+
"aria-label": e.iconAriaLabel,
|
|
46
47
|
color: e.buttonStyle !== "solid" ? e.color : void 0,
|
|
47
48
|
disabled: e.disabled,
|
|
48
49
|
inverse: e.buttonStyle === "solid" || e.inverse,
|
|
49
50
|
name: e.iconName
|
|
50
|
-
}, null, 8, ["color", "disabled", "inverse", "name"])) : o("", !0),
|
|
51
|
-
e.label ? (n(),
|
|
51
|
+
}, null, 8, ["aria-label", "color", "disabled", "inverse", "name"])) : o("", !0),
|
|
52
|
+
e.label || e.buttonStyle === "input" ? (n(), s("span", S, r(e.label || e.buttonStyle === "input" && ""), 1)) : o("", !0),
|
|
52
53
|
e.indicator ? (n(), i(u, {
|
|
53
54
|
key: 2,
|
|
54
55
|
color: e.buttonStyle === "text" ? e.color : "low-contrast",
|
|
@@ -59,8 +60,8 @@ function w(e, t, B, C, N, $) {
|
|
|
59
60
|
}, null, 8, ["color", "disabled", "expanded", "inverse"])) : o("", !0)
|
|
60
61
|
], 16, h));
|
|
61
62
|
}
|
|
62
|
-
const
|
|
63
|
+
const z = /* @__PURE__ */ c(y, [["render", w]]);
|
|
63
64
|
export {
|
|
64
|
-
|
|
65
|
+
z as default
|
|
65
66
|
};
|
|
66
67
|
//# sourceMappingURL=NeonButton.vue.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonButton.vue.es.js","sources":["../../../../src/components/user-input/button/NeonButton.vue"],"sourcesContent":["<template>\n <neon-link\n v-if=\"href\"\n ref=\"button\"\n :class=\"classes\"\n :href=\"href\"\n :tabindex=\"!disabled ? 0 : -1\"\n class=\"neon-button\"\n outline-style=\"none\"\n role=\"button\"\n v-bind=\"sanitizedAttributes\"\n @keydown.space.prevent=\"clickLink\"\n >\n <neon-icon\n v-if=\"icon || state !== 'ready'\"\n :color=\"buttonStyle !== 'solid' ? color : undefined\"\n :disabled=\"disabled\"\n :inverse=\"buttonStyle === 'solid' || inverse\"\n :name=\"iconName\"\n />\n <span v-if=\"label\" class=\"neon-button__label\">{{ label }}</span>\n </neon-link>\n <button\n v-else\n ref=\"button\"\n :class=\"classes\"\n :disabled=\"disabled || state !== 'ready'\"\n :tabindex=\"!disabled ? 0 : -1\"\n class=\"neon-button\"\n v-bind=\"sanitizedAttributes\"\n @click=\"clickButton\"\n >\n <neon-icon\n v-if=\"icon || state !== 'ready'\"\n :color=\"buttonStyle !== 'solid' ? color : undefined\"\n :disabled=\"disabled\"\n :inverse=\"buttonStyle === 'solid' || inverse\"\n :name=\"iconName\"\n />\n <span v-if=\"label\" class=\"neon-button__label\"
|
|
1
|
+
{"version":3,"file":"NeonButton.vue.es.js","sources":["../../../../src/components/user-input/button/NeonButton.vue"],"sourcesContent":["<template>\n <neon-link\n v-if=\"href\"\n ref=\"button\"\n :class=\"classes\"\n :href=\"href\"\n :tabindex=\"!disabled ? 0 : -1\"\n class=\"neon-button\"\n outline-style=\"none\"\n role=\"button\"\n v-bind=\"sanitizedAttributes\"\n @keydown.space.prevent=\"clickLink\"\n >\n <neon-icon\n v-if=\"icon || state !== 'ready'\"\n :color=\"buttonStyle !== 'solid' ? color : undefined\"\n :disabled=\"disabled\"\n :inverse=\"buttonStyle === 'solid' || inverse\"\n :name=\"iconName\"\n />\n <span v-if=\"label\" class=\"neon-button__label\">{{ label }}</span>\n </neon-link>\n <button\n v-else\n ref=\"button\"\n :class=\"classes\"\n :disabled=\"disabled || state !== 'ready'\"\n :tabindex=\"!disabled ? 0 : -1\"\n class=\"neon-button\"\n v-bind=\"sanitizedAttributes\"\n @click=\"clickButton\"\n >\n <neon-icon\n v-if=\"icon || state !== 'ready'\"\n :aria-label=\"iconAriaLabel\"\n :color=\"buttonStyle !== 'solid' ? color : undefined\"\n :disabled=\"disabled\"\n :inverse=\"buttonStyle === 'solid' || inverse\"\n :name=\"iconName\"\n />\n <span v-if=\"label || buttonStyle === 'input'\" class=\"neon-button__label\">\n {{ label || (buttonStyle === 'input' && '') }}\n </span>\n <neon-expansion-indicator\n v-if=\"indicator\"\n :color=\"buttonStyle === 'text' ? color : 'low-contrast'\"\n :disabled=\"disabled\"\n :expanded=\"indicatorExpanded\"\n :inverse=\"buttonStyle === 'solid' || inverse\"\n class=\"neon-button__indicator\"\n />\n </button>\n</template>\n\n<script lang=\"ts\" src=\"./NeonButton.ts\" />\n"],"names":["_ctx","_openBlock","_createBlock","_component_neon_link","_mergeProps","_component_neon_icon","_createElementBlock","_hoisted_1","_toDisplayString","args","_hoisted_3","_component_neon_expansion_indicator"],"mappings":";;;;;EAoBuB,OAAM;;;EAoBqB,OAAM;;;;SAtC9CA,EAAA,QADRC,KAAAC,EAoBYC,GApBZC,EAoBY;AAAA;IAlBV,KAAI;AAAA,IACH,OAAK,CAAEJ,EAAA,SAGF,aAAa;AAAA,IAFlB,MAAMA,EAAA;AAAA,IACN,UAAWA,EAAA,WAAQ,KAAA;AAAA,IA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A,EAAA,gBAAW,WAAgBA,EAAA;AAAA,MACrC,OAAM;AAAA;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t=require("vue"),ee=require("../../../common/enums/NeonSize.cjs.js"),ae=require("../../../common/enums/NeonFunctionalColor.cjs.js"),te=require("../../presentation/dropdown/NeonDropdown.vue.cjs.js"),ne=require("../button/NeonButton.vue.cjs.js"),le=require("../input/NeonInput.vue.cjs.js"),r=require("../../../common/utils/NeonDateUtils.cjs.js"),oe=require("../../../common/enums/NeonDropdownPlacement.cjs.js"),ue=t.defineComponent({name:"NeonDatePicker",components:{NeonButton:ne,NeonDropdown:te,NeonInput:le},props:{modelValue:{type:String,default:null},locale:{type:String,default:null},disabled:{type:Boolean,default:!1},size:{type:String,default:ee.NeonSize.Medium},color:{type:String,default:ae.NeonFunctionalColor.Primary},min:{type:String,default:null},max:{type:String,default:null},placement:{type:String,default:oe.NeonDropdownPlacement.BottomLeft},disabledDates:{type:Array,default:()=>[]},placeholder:{type:String,required:!1},openCalendarLabel:{type:String,default:"Open calendar"},doneLabel:{type:String,default:"Done"},clearLabel:{type:String,default:"Clear"},changeMonthLabel:{type:String,default:"Change month"},previousMonthLabel:{type:String,default:"Previous month"},nextMonthLabel:{type:String,default:"Next month"},changeYearLabel:{type:String,default:"Change year"},previousYearLabel:{type:String,default:"Previous year"},nextYearLabel:{type:String,default:"Next year"},previousDecadeLabel:{type:String,default:"Previous decade"},nextDecadeLabel:{type:String,default:"Next decade"}},setup(e,{emit:y}){const D=t.useAttrs(),q=!D.required,T=t.ref(null),
|
|
1
|
+
"use strict";const t=require("vue"),ee=require("../../../common/enums/NeonSize.cjs.js"),ae=require("../../../common/enums/NeonFunctionalColor.cjs.js"),te=require("../../presentation/dropdown/NeonDropdown.vue.cjs.js"),ne=require("../button/NeonButton.vue.cjs.js"),le=require("../input/NeonInput.vue.cjs.js"),r=require("../../../common/utils/NeonDateUtils.cjs.js"),oe=require("../../../common/enums/NeonDropdownPlacement.cjs.js"),ue=t.defineComponent({name:"NeonDatePicker",components:{NeonButton:ne,NeonDropdown:te,NeonInput:le},props:{id:{type:String},modelValue:{type:String,default:null},locale:{type:String,default:null},disabled:{type:Boolean,default:!1},size:{type:String,default:ee.NeonSize.Medium},color:{type:String,default:ae.NeonFunctionalColor.Primary},min:{type:String,default:null},max:{type:String,default:null},placement:{type:String,default:oe.NeonDropdownPlacement.BottomLeft},disabledDates:{type:Array,default:()=>[]},placeholder:{type:String,required:!1},openCalendarLabel:{type:String,default:"Open calendar"},doneLabel:{type:String,default:"Done"},clearLabel:{type:String,default:"Clear"},changeMonthLabel:{type:String,default:"Change month"},previousMonthLabel:{type:String,default:"Previous month"},nextMonthLabel:{type:String,default:"Next month"},changeYearLabel:{type:String,default:"Change year"},previousYearLabel:{type:String,default:"Previous year"},nextYearLabel:{type:String,default:"Next year"},previousDecadeLabel:{type:String,default:"Previous decade"},nextDecadeLabel:{type:String,default:"Next decade"}},setup(e,{emit:y}){const D=t.useAttrs(),q=!D.required,T=t.ref(null),v=t.ref(null),f=t.ref(!1),c=t.ref(!1),d=t.ref(!1),U=t.computed(()=>{if(e.modelValue){const a=r.NeonDateUtils.stringToNeonDate(e.modelValue,e.locale,!0);if(a){const{dayFormatted:n,monthShortName:u,yearFormatted:Z}=a;return`${n} ${u} ${Z}`}}return e.placeholder||""}),V=(a,n,u)=>r.NeonDateUtils.dmyToIso(a,n,u),m=new Date,h=e.locale||navigator.language,o=t.ref(m.getMonth()),l=t.ref(m.getFullYear()),s=t.ref(Math.floor(l.value/10)*10),b=()=>{o.value=e.modelValue?+e.modelValue.substring(5,7):+m.toLocaleString(h,{month:"numeric"}),l.value=e.modelValue?+e.modelValue.substring(0,4):+m.toLocaleString(h,{year:"numeric"}),s.value=Math.floor(l.value/10)*10};b();const i=t.computed(()=>r.NeonDateUtils.toCalendarConfiguration(e.modelValue,o.value,l.value,s.value,e.locale)),I=t.computed(()=>{const{day:a,month:n,year:u}=i.value.today;return r.NeonDateUtils.dmyToIso(a,n,u)}),O=()=>{if(!e.disabled&&(b(),v.value)){const a=v.value.querySelector(".neon-date-picker__calendar-date--selected");a&&setTimeout(()=>a.focus())}},w=a=>{y("update:modelValue",a)},F=()=>{o.value===1?(o.value=12,l.value=l.value-1):o.value=o.value-1},$=()=>{o.value===12?(o.value=1,l.value=l.value+1):o.value=o.value+1},p=()=>{c.value=!0},N=t.computed(()=>e.min&&e.min>=r.NeonDateUtils.dmyToIso(1,i.value.pageMonth,i.value.pageYear)),S=t.computed(()=>{const{pageYear:a,pageMonth:n,lastDayOfMonth:u}=i.value;return e.max&&e.max<=r.NeonDateUtils.dmyToIso(u,n,a)}),_=t.computed(()=>N.value&&S.value),z=()=>{l.value=l.value-1},B=()=>{l.value=l.value+1},k=()=>{d.value=!0},x=t.computed(()=>e.min&&e.min>=r.NeonDateUtils.dmyToIso(1,1,i.value.pageYear)),Y=t.computed(()=>e.max&&e.max<=r.NeonDateUtils.dmyToIso(31,12,i.value.pageYear)),A=t.computed(()=>x.value&&Y.value),R=()=>{s.value=s.value-10},j=()=>{s.value=s.value+10},E=t.computed(()=>e.min&&e.min>=r.NeonDateUtils.dmyToIso(1,1,Math.floor(i.value.pageYear/10)*10)),G=t.computed(()=>e.max&&e.max<=r.NeonDateUtils.dmyToIso(31,12,Math.floor(i.value.pageYear/10)*10+9)),g=()=>{c.value=!1,d.value=!1},H=()=>{f.value=!1,g()},J=()=>{y("update:modelValue",null),f.value=!1,g()},K=a=>{o.value=a,c.value=!1},Q=a=>{l.value=a,d.value=!1},W=a=>{var n;return((n=e.disabledDates)==null?void 0:n.indexOf(a))>=0||e.min&&e.min>a||e.max&&e.max<a},X=(a,n)=>{const u=`${a}-${n<10?"0"+n:n}`;return C.value&&C.value>u||P.value&&P.value<u},M=t.computed(()=>e.min?+e.min.substring(0,4):null),C=t.computed(()=>e.min?e.min.substring(0,7):null),L=t.computed(()=>e.max?+e.max.substring(0,4):null),P=t.computed(()=>e.max?e.max.substring(0,7):null);return{attrs:D,calendar:i,calendarOpen:f,dropdown:T,formattedValue:U,isChangeDateDisabled:_,isChangeYearDisabled:A,isNextDisabled:S,isNextDecadeDisabled:G,isNextYearDisabled:Y,isPreviousDisabled:N,isPreviousDecadeDisabled:E,isPreviousYearDisabled:x,monthSelectionOpen:c,optional:q,today:I,calendarRef:v,yearSelectionOpen:d,changeMonth:p,changeYear:k,clear:J,done:H,emitDate:w,isDisabled:W,isoDate:V,isMonthDisabled:X,isYearDisabled:a=>M.value&&M.value>a||L.value&&L.value<a,toggleCalendar:O,onNext:$,onNextDecade:j,onNextYear:B,onPrevious:F,onPreviousDecade:R,onPreviousYear:z,resetToCalendar:g,selectMonth:K,selectYear:Q}}});module.exports=ue;
|
|
2
2
|
//# sourceMappingURL=NeonDatePicker.cjs.js.map
|