@dialpad/dialtone 9.157.0 → 9.159.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/dialtone-default-theme.css +20 -1
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone-docs.json +1 -1
- package/dist/css/dialtone.css +20 -1
- package/dist/css/dialtone.min.css +1 -1
- package/dist/tokens/doc.json +92071 -92071
- package/dist/vue3/common/dates/index.js +4 -4
- package/dist/vue3/common/utils/index.js +3 -3
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/dialtone-vue.cjs +1 -1
- package/dist/vue3/dialtone-vue.js +349 -347
- package/dist/vue3/dialtone-vue.js.map +1 -1
- package/dist/vue3/lib/attachment-carousel/attachment-carousel.js +1 -1
- package/dist/vue3/lib/avatar/avatar.js +10 -10
- package/dist/vue3/lib/badge/badge.js +5 -5
- package/dist/vue3/lib/banner/banner.js +1 -1
- package/dist/vue3/lib/breadcrumbs/breadcrumb-item.js +2 -2
- package/dist/vue3/lib/breadcrumbs/breadcrumbs.js +1 -1
- package/dist/vue3/lib/button/button.js +14 -14
- package/dist/vue3/lib/button-group/button-group.js +2 -2
- package/dist/vue3/lib/button-group/buttons-decorator.js +2 -2
- package/dist/vue3/lib/callbar-button/callbar-button.js +2 -2
- package/dist/vue3/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs +1 -1
- package/dist/vue3/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js +9 -9
- package/dist/vue3/lib/callbar-button-with-popover/callbar-button-with-popover.cjs +1 -1
- package/dist/vue3/lib/callbar-button-with-popover/callbar-button-with-popover.js +9 -9
- package/dist/vue3/lib/callbox/callbox.js +1 -1
- package/dist/vue3/lib/card/card.js +4 -4
- package/dist/vue3/lib/checkbox/checkbox.js +5 -5
- package/dist/vue3/lib/checkbox-group/checkboxes-decorator.js +1 -1
- package/dist/vue3/lib/chip/chip.js +7 -7
- package/dist/vue3/lib/codeblock/codeblock.js +2 -2
- package/dist/vue3/lib/collapsible/collapsible-lazy-show.js +3 -3
- package/dist/vue3/lib/collapsible/collapsible.js +8 -8
- package/dist/vue3/lib/combobox/combobox-empty-list.js +2 -2
- package/dist/vue3/lib/combobox/combobox-loading-list.js +3 -3
- package/dist/vue3/lib/combobox/combobox.cjs +1 -1
- package/dist/vue3/lib/combobox/combobox.js +8 -8
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.js +1 -1
- package/dist/vue3/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
- package/dist/vue3/lib/combobox-with-popover/combobox-with-popover.js +10 -10
- package/dist/vue3/lib/contact-centers-row/contact-centers-row.js +7 -7
- package/dist/vue3/lib/contact-info/contact-info.js +1 -1
- package/dist/vue3/lib/contact-row/contact-row.js +1 -1
- package/dist/vue3/lib/datepicker/datepicker.cjs +1 -1
- package/dist/vue3/lib/datepicker/datepicker.cjs.map +1 -1
- package/dist/vue3/lib/datepicker/datepicker.js +306 -242
- package/dist/vue3/lib/datepicker/datepicker.js.map +1 -1
- package/dist/vue3/lib/datepicker/utils.cjs +1 -1
- package/dist/vue3/lib/datepicker/utils.cjs.map +1 -1
- package/dist/vue3/lib/datepicker/utils.js +40 -40
- package/dist/vue3/lib/datepicker/utils.js.map +1 -1
- package/dist/vue3/lib/description-list/description-list.js +3 -3
- package/dist/vue3/lib/dropdown/dropdown-list.js +4 -4
- package/dist/vue3/lib/dropdown/dropdown-separator.js +2 -2
- package/dist/vue3/lib/dropdown/dropdown.js +2 -2
- package/dist/vue3/lib/editor/editor.js +9 -9
- package/dist/vue3/lib/emoji/emoji.js +2 -2
- package/dist/vue3/lib/emoji-picker/emoji-picker.js +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.js +6 -6
- package/dist/vue3/lib/empty-state/empty-state.js +7 -7
- package/dist/vue3/lib/feed-item-pill/feed-item-pill.js +1 -1
- package/dist/vue3/lib/feed-item-row/feed-item-row.js +15 -15
- package/dist/vue3/lib/general-row/general-row.js +13 -13
- package/dist/vue3/lib/general-row/index.cjs +1 -1
- package/dist/vue3/lib/general-row/index.js +6 -4
- package/dist/vue3/lib/general-row/index.js.map +1 -1
- package/dist/vue3/lib/general-row/leftbar-general-row-icon.js +5 -5
- package/dist/vue3/lib/group-row/group-row.js +2 -2
- package/dist/vue3/lib/grouped-chip/grouped-chip.js +14 -14
- package/dist/vue3/lib/hovercard/hovercard.js +2 -2
- package/dist/vue3/lib/icon/icon.js +3 -3
- package/dist/vue3/lib/illustration/illustration.js +3 -3
- package/dist/vue3/lib/image-viewer/image-viewer.js +12 -12
- package/dist/vue3/lib/input/input.js +10 -10
- package/dist/vue3/lib/input-group/input-group.js +8 -8
- package/dist/vue3/lib/item-layout/item-layout.js +13 -13
- package/dist/vue3/lib/ivr-node/ivr-node.js +9 -9
- package/dist/vue3/lib/keyboard-shortcut/keyboard-shortcut.js +3 -3
- package/dist/vue3/lib/lazy-show/lazy-show.js +2 -2
- package/dist/vue3/lib/link/link.js +2 -2
- package/dist/vue3/lib/list-item/list-item.js +3 -3
- package/dist/vue3/lib/list-item-group/list-item-group.js +5 -5
- package/dist/vue3/lib/loader/loader.js +2 -2
- package/dist/vue3/lib/message-input/message-input-button.js +5 -5
- package/dist/vue3/lib/message-input/message-input-link.js +2 -2
- package/dist/vue3/lib/message-input/message-input-topbar.js +2 -2
- package/dist/vue3/lib/message-input/message-input.cjs +1 -1
- package/dist/vue3/lib/message-input/message-input.cjs.map +1 -1
- package/dist/vue3/lib/message-input/message-input.js +17 -16
- package/dist/vue3/lib/message-input/message-input.js.map +1 -1
- package/dist/vue3/lib/modal/modal.js +1 -1
- package/dist/vue3/lib/motion-text/motion-text.js +5 -5
- package/dist/vue3/lib/notice/notice-action.js +1 -1
- package/dist/vue3/lib/notice/notice-content.js +6 -6
- package/dist/vue3/lib/notice/notice-icon.js +4 -4
- package/dist/vue3/lib/notice/notice.js +1 -1
- package/dist/vue3/lib/pagination/pagination.js +1 -1
- package/dist/vue3/lib/popover/popover-constants.js +3 -3
- package/dist/vue3/lib/popover/popover-header-footer.js +6 -6
- package/dist/vue3/lib/popover/popover.js +7 -7
- package/dist/vue3/lib/presence/presence.js +4 -4
- package/dist/vue3/lib/radio/radio.js +10 -10
- package/dist/vue3/lib/radio-group/radios-decorator.js +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +4 -4
- package/dist/vue3/lib/root-layout/root-layout.js +3 -3
- package/dist/vue3/lib/scroller/scroller.js +1 -1
- package/dist/vue3/lib/select-menu/select-menu.js +12 -12
- package/dist/vue3/lib/settings-menu-button/settings-menu-button.js +3 -3
- package/dist/vue3/lib/skeleton/skeleton-list-item.js +2 -2
- package/dist/vue3/lib/skeleton/skeleton-paragraph.js +1 -1
- package/dist/vue3/lib/skeleton/skeleton-shape.js +2 -2
- package/dist/vue3/lib/skeleton/skeleton-text.js +4 -4
- package/dist/vue3/lib/skeleton/skeleton.js +1 -1
- package/dist/vue3/lib/split-button/split-button-alpha.js +2 -2
- package/dist/vue3/lib/split-button/split-button-omega.js +2 -2
- package/dist/vue3/lib/split-button/split-button.js +13 -13
- package/dist/vue3/lib/stack/stack.js +2 -2
- package/dist/vue3/lib/stack/utils.js +5 -5
- package/dist/vue3/lib/stack/validators.js +7 -7
- package/dist/vue3/lib/tab/tab-group.js +2 -2
- package/dist/vue3/lib/tab/tab-panel.js +2 -2
- package/dist/vue3/lib/tab/tab.js +2 -2
- package/dist/vue3/lib/time-pill/time-pill.js +2 -2
- package/dist/vue3/lib/toast/toast.js +1 -1
- package/dist/vue3/lib/toggle/toggle.js +7 -7
- package/dist/vue3/lib/tooltip/tooltip.js +5 -5
- package/dist/vue3/lib/top-banner-info/top-banner-info.js +2 -2
- package/dist/vue3/lib/unread-pill/unread-pill.js +1 -1
- package/dist/vue3/lib/validation-messages/validation-messages.js +6 -6
- package/dist/vue3/node_modules/@tiptap/vue-3.cjs.map +1 -1
- package/dist/vue3/node_modules/@tiptap/vue-3.js.map +1 -1
- package/dist/vue3/shared/sr_only_close_button.js +2 -2
- package/dist/vue3/types/components/datepicker/composables/useMonthYearPicker.d.ts +4 -0
- package/dist/vue3/types/components/datepicker/composables/useMonthYearPicker.d.ts.map +1 -1
- package/dist/vue3/types/components/datepicker/datepicker.vue.d.ts +8 -0
- package/dist/vue3/types/components/datepicker/datepicker.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/datepicker/modules/month-year-picker.vue.d.ts +4 -0
- package/dist/vue3/types/components/datepicker/modules/month-year-picker.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/datepicker/utils.d.ts +1 -1
- package/dist/vue3/types/components/datepicker/utils.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/index.d.ts +1 -0
- package/package.json +3 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hasSlotContent as b, extractVueListeners as g, getUniqueString as s } from "../../common/utils/index.js";
|
|
2
2
|
import C from "./collapsible-lazy-show.js";
|
|
3
3
|
import { DtIconChevronRight as x, DtIconChevronDown as S } from "@dialpad/dialtone-icons/vue3";
|
|
4
|
-
import { resolveComponent as a,
|
|
4
|
+
import { resolveComponent as a, openBlock as o, createBlock as i, resolveDynamicComponent as v, mergeProps as c, toHandlers as d, withCtx as r, createElementVNode as h, normalizeClass as L, renderSlot as p, createVNode as m, normalizeStyle as O, toDisplayString as T } from "vue";
|
|
5
5
|
import { _ as w } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
import D from "../lazy-show/lazy-show.js";
|
|
7
7
|
import B from "../button/button.js";
|
|
@@ -162,21 +162,21 @@ const z = {
|
|
|
162
162
|
}, A = ["id"], E = ["title"];
|
|
163
163
|
function k(n, W, e, H, l, t) {
|
|
164
164
|
const u = a("dt-icon-chevron-down"), f = a("dt-icon-chevron-right"), y = a("dt-button"), _ = a("dt-collapsible-lazy-show");
|
|
165
|
-
return
|
|
165
|
+
return o(), i(v(e.elementType), c({ ref: "collapsible" }, d(t.collapsibleListeners)), {
|
|
166
166
|
default: r(() => [
|
|
167
167
|
h("div", {
|
|
168
168
|
id: !e.ariaLabelledBy && t.labelledBy,
|
|
169
169
|
ref: "anchor",
|
|
170
170
|
class: L(e.anchorClass)
|
|
171
171
|
}, [
|
|
172
|
-
|
|
172
|
+
p(n.$slots, "anchor", {
|
|
173
173
|
attrs: {
|
|
174
174
|
"aria-controls": e.id,
|
|
175
175
|
"aria-expanded": l.isOpen.toString(),
|
|
176
176
|
role: "button"
|
|
177
177
|
}
|
|
178
178
|
}, () => [
|
|
179
|
-
|
|
179
|
+
m(y, {
|
|
180
180
|
importance: "clear",
|
|
181
181
|
kind: "muted",
|
|
182
182
|
"aria-controls": e.id,
|
|
@@ -187,11 +187,11 @@ function k(n, W, e, H, l, t) {
|
|
|
187
187
|
onClick: t.defaultToggleOpen
|
|
188
188
|
}, {
|
|
189
189
|
default: r(() => [
|
|
190
|
-
l.isOpen ? (
|
|
190
|
+
l.isOpen ? (o(), i(u, {
|
|
191
191
|
key: 0,
|
|
192
192
|
class: "d-collapsible__icon",
|
|
193
193
|
size: "300"
|
|
194
|
-
})) : (
|
|
194
|
+
})) : (o(), i(f, {
|
|
195
195
|
key: 1,
|
|
196
196
|
class: "d-collapsible__icon",
|
|
197
197
|
size: "300"
|
|
@@ -205,7 +205,7 @@ function k(n, W, e, H, l, t) {
|
|
|
205
205
|
}, 8, ["aria-controls", "aria-expanded", "style", "onClick"])
|
|
206
206
|
])
|
|
207
207
|
], 10, A),
|
|
208
|
-
|
|
208
|
+
m(_, c({
|
|
209
209
|
id: e.id,
|
|
210
210
|
ref: "contentWrapper",
|
|
211
211
|
"aria-hidden": `${!l.isOpen}`,
|
|
@@ -226,7 +226,7 @@ function k(n, W, e, H, l, t) {
|
|
|
226
226
|
onAfterEnter: t.onEnterTransitionComplete
|
|
227
227
|
}), {
|
|
228
228
|
default: r(() => [
|
|
229
|
-
|
|
229
|
+
p(n.$slots, "content")
|
|
230
230
|
]),
|
|
231
231
|
_: 3
|
|
232
232
|
}, 16, ["id", "aria-hidden", "aria-labelledby", "aria-label", "show", "element-type", "class", "style", "onAfterLeave", "onAfterEnter"])
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveComponent as s,
|
|
1
|
+
import { resolveComponent as s, openBlock as m, createElementBlock as n, renderSlot as a, createVNode as i, normalizeClass as r, withCtx as l, createElementVNode as c, toDisplayString as p } from "vue";
|
|
2
2
|
import { _ } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
3
|
import d from "../list-item/list-item.js";
|
|
4
4
|
const b = {
|
|
@@ -28,7 +28,7 @@ const b = {
|
|
|
28
28
|
};
|
|
29
29
|
function u(e, y, t, x, C, g) {
|
|
30
30
|
const o = s("dt-list-item");
|
|
31
|
-
return
|
|
31
|
+
return m(), n("ol", f, [
|
|
32
32
|
a(e.$slots, "default", {}, () => [
|
|
33
33
|
i(o, {
|
|
34
34
|
role: "option",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveComponent as t,
|
|
1
|
+
import { resolveComponent as t, openBlock as o, createElementBlock as e, Fragment as m, renderList as c, createVNode as n, withCtx as _ } from "vue";
|
|
2
2
|
import { _ as a } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
3
|
import p from "../skeleton/skeleton.js";
|
|
4
4
|
import l from "../list-item/list-item.js";
|
|
@@ -11,8 +11,8 @@ const d = {
|
|
|
11
11
|
};
|
|
12
12
|
function u(b, x, k, L, g, y) {
|
|
13
13
|
const s = t("dt-skeleton"), r = t("dt-list-item");
|
|
14
|
-
return
|
|
15
|
-
(
|
|
14
|
+
return o(), e("ol", f, [
|
|
15
|
+
(o(), e(m, null, c(7, (i) => n(r, {
|
|
16
16
|
key: i,
|
|
17
17
|
role: "option",
|
|
18
18
|
"navigation-type": "none"
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./combobox-loading-list.cjs"),g=require("./combobox-empty-list.cjs"),l=require("../../common/utils/index.cjs"),e=require("vue"),u=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),m=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./combobox-loading-list.cjs"),g=require("./combobox-empty-list.cjs"),l=require("../../common/utils/index.cjs"),e=require("vue"),u=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),m=require("./combobox-constants.cjs"),p=require("../../common/mixins/keyboard-list-navigation.cjs"),y={compatConfig:{MODE:3},name:"DtCombobox",components:{ComboboxLoadingList:a.default,ComboboxEmptyList:g.default},mixins:[p.default({indexKey:"highlightIndex",idKey:"highlightId",listElementKey:"getListElement",afterHighlightMethod:"afterHighlight",beginningOfListMethod:"beginningOfListMethod",endOfListMethod:"endOfListMethod",activeItemKey:"activeItemEl"})],props:{label:{type:String,required:!0},labelVisible:{type:Boolean,default:!0},size:{type:String,default:null,validator:i=>Object.values(m.COMBOBOX_LABEL_SIZES).includes(i)},description:{type:String,default:""},listId:{type:String,default(){return l.getUniqueString()}},onBeginningOfList:{type:Function,default:null},onEndOfList:{type:Function,default:null},showList:{type:Boolean,default:!1},listRenderedOutside:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyList:{type:Boolean,default:!1},emptyStateMessage:{type:String,default:""},emptyStateClass:{type:[String,Object,Array],default:""},clickOnSelect:{type:Boolean,default:!1}},emits:["select","escape","highlight","opened"],data(){return{outsideRenderedListRef:null,hasSlotContent:l.hasSlotContent}},computed:{inputProps(){return{label:this.label,labelVisible:this.labelVisible,size:this.size,description:this.description,role:"combobox","aria-label":this.label,"aria-expanded":this.showList.toString(),"aria-owns":this.listId,"aria-haspopup":"listbox","aria-activedescendant":this.activeItemId,"aria-controls":this.listId}},listProps(){return{role:"listbox",id:this.listId,class:"d-ps-relative","aria-label":this.label}},beginningOfListMethod(){return this.onBeginningOfList||this.jumpToEnd},endOfListMethod(){return this.onEndOfList||this.jumpToBeginning},activeItemId(){if(!(!this.showList||this.highlightIndex<0||this.loading))return this.highlightId},activeItemEl(){return this.highlightId?this.getListElement().querySelector("#"+this.highlightId):""}},watch:{showList(i){this.listRenderedOutside||(this.setInitialHighlightIndex(),this.$emit("opened",i)),!i&&this.outsideRenderedListRef&&(this.outsideRenderedListRef.removeEventListener("mousemove",this.onMouseHighlight),this.outsideRenderedListRef=null)},loading(){this.$nextTick(()=>{this.setInitialHighlightIndex()})},$props:{deep:!0,immediate:!0,handler(){this.validateEmptyListProps()}}},created(){this.validateEmptyListProps()},methods:{onMouseHighlight(i){if(this.loading)return;const t=i.target.closest("li");t&&this.highlightId!==t.id&&this.setHighlightId(t.id)},getListElement(){var i;return this.outsideRenderedListRef??((i=this.$refs.listWrapper)==null?void 0:i.querySelector(`#${this.listId}`))},clearHighlightIndex(){this.showList&&this.setHighlightIndex(-1)},afterHighlight(){this.loading||this.$emit("highlight",this.highlightIndex)},onEnterKey(){var i;this.loading||this.emptyList||this.highlightIndex>=0&&(this.$emit("select",this.highlightIndex),this.clickOnSelect&&((i=this.activeItemEl)==null||i.click()))},onEscapeKey(){this.$emit("escape")},onOpen(i,t){var n;this.outsideRenderedListRef=t,(n=this.outsideRenderedListRef)==null||n.addEventListener("mousemove",this.onMouseHighlight),this.$emit("opened",i),i&&this.setInitialHighlightIndex()},onKeyValidation(i,t){!this.showList||!this.getListElement()||this[t](i)},setInitialHighlightIndex(){this.showList&&this.$nextTick(()=>{this.setHighlightIndex(this.loading?-1:0)})},validateEmptyListProps(){this.$slots.emptyListItem||this.emptyList&&!this.emptyStateMessage&&console.error(`Invalid props: you must pass both props emptyList and emptyStateMessage to show the
|
|
2
2
|
empty message.`)}}},f={"data-qa":"dt-combobox-input-wrapper"};function c(i,t,n,L,r,s){const d=e.resolveComponent("combobox-loading-list"),h=e.resolveComponent("combobox-empty-list");return e.openBlock(),e.createElementBlock("div",{onKeydown:[t[3]||(t[3]=e.withKeys(e.withModifiers(o=>s.onKeyValidation(o,"onEscapeKey"),["stop"]),["esc"])),t[4]||(t[4]=e.withKeys(e.withModifiers(o=>s.onKeyValidation(o,"onEnterKey"),["exact"]),["enter"])),t[5]||(t[5]=e.withKeys(e.withModifiers(o=>s.onKeyValidation(o,"onUpKey"),["stop","prevent"]),["up"])),t[6]||(t[6]=e.withKeys(e.withModifiers(o=>s.onKeyValidation(o,"onDownKey"),["stop","prevent"]),["down"])),t[7]||(t[7]=e.withKeys(e.withModifiers(o=>s.onKeyValidation(o,"onHomeKey"),["stop","prevent"]),["home"])),t[8]||(t[8]=e.withKeys(e.withModifiers(o=>s.onKeyValidation(o,"onEndKey"),["stop","prevent"]),["end"]))]},[e.createElementVNode("div",f,[e.renderSlot(i.$slots,"input",{inputProps:s.inputProps})]),n.showList?(e.openBlock(),e.createElementBlock("div",{key:0,ref:"listWrapper","data-qa":"dt-combobox-list-wrapper",onMouseleave:t[0]||(t[0]=(...o)=>s.clearHighlightIndex&&s.clearHighlightIndex(...o)),onFocusout:t[1]||(t[1]=(...o)=>s.clearHighlightIndex&&s.clearHighlightIndex(...o)),onMousemoveCapture:t[2]||(t[2]=(...o)=>s.onMouseHighlight&&s.onMouseHighlight(...o))},[n.loading&&!n.listRenderedOutside?(e.openBlock(),e.createBlock(d,e.normalizeProps(e.mergeProps({key:0},s.listProps)),null,16)):n.emptyList&&(n.emptyStateMessage||r.hasSlotContent(i.$slots.emptyListItem))&&!n.listRenderedOutside?(e.openBlock(),e.createBlock(h,e.mergeProps({key:1},s.listProps,{message:n.emptyStateMessage,"item-class":n.emptyStateClass}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"emptyListItem")]),_:3},16,["message","item-class"])):e.renderSlot(i.$slots,"list",{key:2,listProps:s.listProps,opened:s.onOpen,clearHighlightIndex:s.clearHighlightIndex})],544)):e.createCommentVNode("",!0)],32)}const b=u._(y,[["render",c]]);exports.default=b;
|
|
3
3
|
//# sourceMappingURL=combobox.cjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import y from "./combobox-loading-list.js";
|
|
2
2
|
import I from "./combobox-empty-list.js";
|
|
3
3
|
import { hasSlotContent as L, getUniqueString as b } from "../../common/utils/index.js";
|
|
4
|
-
import { resolveComponent as h,
|
|
4
|
+
import { resolveComponent as h, openBlock as d, createElementBlock as a, withKeys as l, withModifiers as o, createElementVNode as c, renderSlot as r, createBlock as g, normalizeProps as x, mergeProps as m, withCtx as v, createCommentVNode as E } from "vue";
|
|
5
5
|
import { _ as O } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
-
import S from "
|
|
7
|
-
import
|
|
6
|
+
import { COMBOBOX_LABEL_SIZES as S } from "./combobox-constants.js";
|
|
7
|
+
import H from "../../common/mixins/keyboard-list-navigation.js";
|
|
8
8
|
const K = {
|
|
9
9
|
compatConfig: { MODE: 3 },
|
|
10
10
|
name: "DtCombobox",
|
|
@@ -13,7 +13,7 @@ const K = {
|
|
|
13
13
|
ComboboxEmptyList: I
|
|
14
14
|
},
|
|
15
15
|
mixins: [
|
|
16
|
-
|
|
16
|
+
H({
|
|
17
17
|
indexKey: "highlightIndex",
|
|
18
18
|
idKey: "highlightId",
|
|
19
19
|
listElementKey: "getListElement",
|
|
@@ -46,7 +46,7 @@ const K = {
|
|
|
46
46
|
size: {
|
|
47
47
|
type: String,
|
|
48
48
|
default: null,
|
|
49
|
-
validator: (e) => Object.values(
|
|
49
|
+
validator: (e) => Object.values(S).includes(e)
|
|
50
50
|
},
|
|
51
51
|
/**
|
|
52
52
|
* Description for the input
|
|
@@ -299,11 +299,11 @@ function w(e, t, n, R, p, i) {
|
|
|
299
299
|
onFocusout: t[1] || (t[1] = (...s) => i.clearHighlightIndex && i.clearHighlightIndex(...s)),
|
|
300
300
|
onMousemoveCapture: t[2] || (t[2] = (...s) => i.onMouseHighlight && i.onMouseHighlight(...s))
|
|
301
301
|
}, [
|
|
302
|
-
n.loading && !n.listRenderedOutside ? (d(), g(u,
|
|
302
|
+
n.loading && !n.listRenderedOutside ? (d(), g(u, x(m({ key: 0 }, i.listProps)), null, 16)) : n.emptyList && (n.emptyStateMessage || p.hasSlotContent(e.$slots.emptyListItem)) && !n.listRenderedOutside ? (d(), g(f, m({ key: 1 }, i.listProps, {
|
|
303
303
|
message: n.emptyStateMessage,
|
|
304
304
|
"item-class": n.emptyStateClass
|
|
305
305
|
}), {
|
|
306
|
-
default:
|
|
306
|
+
default: v(() => [
|
|
307
307
|
r(e.$slots, "emptyListItem")
|
|
308
308
|
]),
|
|
309
309
|
_: 3
|
|
@@ -313,7 +313,7 @@ function w(e, t, n, R, p, i) {
|
|
|
313
313
|
opened: i.onOpen,
|
|
314
314
|
clearHighlightIndex: i.clearHighlightIndex
|
|
315
315
|
})
|
|
316
|
-
], 544)) :
|
|
316
|
+
], 544)) : E("", !0)
|
|
317
317
|
], 32);
|
|
318
318
|
}
|
|
319
319
|
const z = /* @__PURE__ */ O(K, [["render", w]]);
|
|
@@ -6,7 +6,7 @@ import { validationMessageValidator as M } from "../../common/validators/index.j
|
|
|
6
6
|
import { extractNonListeners as B, returnFirstEl as d, extractVueListeners as O, hasSlotContent as T } from "../../common/utils/index.js";
|
|
7
7
|
import { POPOVER_APPEND_TO_VALUES as P } from "../popover/popover-constants.js";
|
|
8
8
|
import { CHIP_TOP_POSITION as F, CHIP_SIZES as k, MULTI_SELECT_SIZES as H } from "./combobox-multi-select-constants.js";
|
|
9
|
-
import { resolveComponent as p,
|
|
9
|
+
import { resolveComponent as p, openBlock as u, createBlock as f, mergeProps as g, createSlots as R, withCtx as r, createElementVNode as h, withModifiers as V, renderSlot as m, createElementBlock as b, toDisplayString as C, normalizeClass as z, Fragment as E, renderList as D, toHandlers as K, withKeys as N, createTextVNode as A, createVNode as y } from "vue";
|
|
10
10
|
import { _ as U } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const j = {
|
|
12
12
|
compatConfig: { MODE: 3 },
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const S=require("../combobox/combobox-loading-list.cjs"),y=require("../combobox/combobox-empty-list.cjs"),u=require("../../common/utils/index.cjs"),t=require("vue"),L=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const S=require("../combobox/combobox-loading-list.cjs"),y=require("../combobox/combobox-empty-list.cjs"),u=require("../../common/utils/index.cjs"),t=require("vue"),L=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),_=require("../popover/popover.cjs"),x=require("../combobox/combobox.cjs"),h=require("../dropdown/dropdown-constants.cjs"),m=require("../popover/popover-constants.cjs"),w=require("../combobox/combobox-constants.cjs"),C={compatConfig:{MODE:3},name:"DtRecipeComboboxWithPopover",components:{DtCombobox:x.default,DtPopover:_.default,ComboboxLoadingList:S.default,ComboboxEmptyList:y.default},props:{label:{type:String,required:!0},labelVisible:{type:Boolean,default:!0},size:{type:String,default:null,validator:e=>Object.values(w.COMBOBOX_LABEL_SIZES).includes(e)},description:{type:String,default:""},showList:{type:Boolean,default:null},listId:{type:String,default(){return u.getUniqueString()}},listClass:{type:[String,Array,Object],default:""},onBeginningOfList:{type:Function,default:null},onEndOfList:{type:Function,default:null},maxHeight:{type:String,default:""},maxWidth:{type:String,default:""},padding:{type:String,default:"small",validator:e=>Object.keys(h.DROPDOWN_PADDING_CLASSES).some(n=>n===e)},contentWidth:{type:String,default:null,validator:e=>m.POPOVER_CONTENT_WIDTHS.includes(e)},openWithArrowKeys:{type:Boolean,default:!1},popoverOffset:{type:Array,default:()=>[0,4]},popoverSticky:{type:[Boolean,String],default:!1},hasSuggestionList:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},emptyList:{type:Boolean,default:!1},emptyStateMessage:{type:String,default:""},appendTo:{type:[HTMLElement,String],default:"body",validator:e=>m.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},transition:{type:String,default:"fade"}},emits:["select","escape","highlight","opened"],data(){return{DROPDOWN_PADDING_CLASSES:h.DROPDOWN_PADDING_CLASSES,isListShown:!1,isInputFocused:!1,isListFocused:!1,externalAnchor:u.getUniqueString(),hasSlotContent:u.hasSlotContent}},computed:{comboboxListeners(){return{...this.$attrs,onSelect:this.onSelect,onEscape:this.onEscape,onHighlight:this.onHighlight}}},watch:{showList:{handler:function(e){e!==null&&(this.isListShown=e)},immediate:!0},isListShown(e){e?window.addEventListener("mousedown",this.onFocusOut):window.removeEventListener("mousedown",this.onFocusOut),this.onOpened(e)}},methods:{handleDisplayList(e){!this.hasSuggestionList&&e&&this.showComboboxList(),!this.hasSuggestionList&&!e&&this.closeComboboxList()},showComboboxList(){this.showList==null&&(this.isListShown=!0)},closeComboboxList(){this.showList==null&&(this.isListShown=!1)},onSelect(e){this.loading||(this.$emit("select",e),this.hasSuggestionList||this.closeComboboxList())},onEscape(){this.$emit("escape"),this.closeComboboxList()},onHighlight(e){this.loading||this.$emit("highlight",e)},onOpened(e){this.$emit("opened",e)},onFocusIn(e){var n;this.hasSuggestionList&&e&&((n=this.$refs.input)==null?void 0:n.querySelector("input"))===e.target&&this.showComboboxList()},onFocusOut(e){var r,i,s;const n=(i=(r=this.$refs.popover)==null?void 0:r.tip)==null?void 0:i.popper,o=this.$refs.input;(s=e.composedPath())!=null&&s.some(a=>[n,o].includes(a))||this.closeComboboxList()},openOnArrowKeyPress(){this.showList!==null||this.isListShown||!this.openWithArrowKeys||this.showComboboxList()}}},v=["id"],O={ref:"header"},E=["onMouseleave","onFocusout"],P={ref:"footer"};function D(e,n,o,r,i,s){const a=t.resolveComponent("combobox-loading-list"),p=t.resolveComponent("combobox-empty-list"),b=t.resolveComponent("dt-popover"),f=t.resolveComponent("dt-combobox");return t.openBlock(),t.createBlock(f,t.mergeProps({ref:"combobox",loading:o.loading,label:o.label,"label-visible":o.labelVisible,size:o.size,description:o.description,"empty-list":o.emptyList,"empty-state-message":o.emptyStateMessage,"show-list":i.isListShown,"on-beginning-of-list":o.onBeginningOfList,"on-end-of-list":o.onEndOfList,"list-rendered-outside":!0,"list-id":o.listId,"data-qa":"dt-combobox"},s.comboboxListeners),{input:t.withCtx(({inputProps:d})=>[t.createElementVNode("div",{id:i.externalAnchor,ref:"input",onFocusin:n[0]||(n[0]=(...l)=>s.onFocusIn&&s.onFocusIn(...l)),onKeydown:[n[1]||(n[1]=t.withKeys(l=>s.openOnArrowKeyPress(l),["up"])),n[2]||(n[2]=t.withKeys(l=>s.openOnArrowKeyPress(l),["down"]))]},[t.renderSlot(e.$slots,"input",{inputProps:d,onInput:s.handleDisplayList})],40,v)]),list:t.withCtx(({opened:d,listProps:l,clearHighlightIndex:c})=>[t.createVNode(b,{ref:"popover",open:i.isListShown,"onUpdate:open":n[3]||(n[3]=g=>i.isListShown=g),"hide-on-click":!1,"max-height":o.maxHeight,"max-width":o.maxWidth,offset:o.popoverOffset,sticky:o.popoverSticky,placement:"bottom-start","initial-focus-element":"none",padding:"none",role:"listbox","external-anchor":i.externalAnchor,"content-width":o.contentWidth,"content-appear":!0,"content-tabindex":null,modal:!1,"auto-focus":!1,"append-to":o.appendTo,transition:o.transition,onOpened:d},t.createSlots({content:t.withCtx(()=>[t.createElementVNode("div",{ref:"listWrapper",class:t.normalizeClass(["d-recipe-combobox-with-popover__list",i.DROPDOWN_PADDING_CLASSES[o.padding],o.listClass]),onMouseleave:c,onFocusout:c},[o.loading?(t.openBlock(),t.createBlock(a,t.normalizeProps(t.mergeProps({key:0},l)),null,16)):o.emptyList&&o.emptyStateMessage?(t.openBlock(),t.createBlock(p,t.mergeProps({key:1},l,{message:o.emptyStateMessage}),null,16,["message"])):t.renderSlot(e.$slots,"list",{key:2,listProps:l})],42,E)]),_:2},[i.hasSlotContent(e.$slots.header)?{name:"headerContent",fn:t.withCtx(()=>[t.createElementVNode("div",O,[t.renderSlot(e.$slots,"header")],512)]),key:"0"}:void 0,i.hasSlotContent(e.$slots.footer)?{name:"footerContent",fn:t.withCtx(()=>[t.createElementVNode("div",P,[t.renderSlot(e.$slots,"footer")],512)]),key:"1"}:void 0]),1032,["open","max-height","max-width","offset","sticky","external-anchor","content-width","append-to","transition","onOpened"])]),_:3},16,["loading","label","label-visible","size","description","empty-list","empty-state-message","show-list","on-beginning-of-list","on-end-of-list","list-id"])}const A=L._(C,[["render",D]]);exports.default=A;
|
|
2
2
|
//# sourceMappingURL=combobox-with-popover.cjs.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import _ from "../combobox/combobox-loading-list.js";
|
|
2
2
|
import C from "../combobox/combobox-empty-list.js";
|
|
3
3
|
import { hasSlotContent as v, getUniqueString as g } from "../../common/utils/index.js";
|
|
4
|
-
import { resolveComponent as r,
|
|
4
|
+
import { resolveComponent as r, openBlock as f, createBlock as p, mergeProps as c, withCtx as l, createVNode as E, createSlots as P, createElementVNode as a, normalizeClass as A, normalizeProps as D, renderSlot as d, withKeys as y } from "vue";
|
|
5
5
|
import { _ as B } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import I from "../combobox/combobox.js";
|
|
6
|
+
import k from "../popover/popover.js";
|
|
7
|
+
import F from "../combobox/combobox.js";
|
|
9
8
|
import { DROPDOWN_PADDING_CLASSES as S } from "../dropdown/dropdown-constants.js";
|
|
9
|
+
import { POPOVER_APPEND_TO_VALUES as W, POPOVER_CONTENT_WIDTHS as I } from "../popover/popover-constants.js";
|
|
10
10
|
import { COMBOBOX_LABEL_SIZES as M } from "../combobox/combobox-constants.js";
|
|
11
11
|
const N = {
|
|
12
12
|
compatConfig: { MODE: 3 },
|
|
13
13
|
name: "DtRecipeComboboxWithPopover",
|
|
14
14
|
components: {
|
|
15
|
-
DtCombobox:
|
|
16
|
-
DtPopover:
|
|
15
|
+
DtCombobox: F,
|
|
16
|
+
DtPopover: k,
|
|
17
17
|
ComboboxLoadingList: _,
|
|
18
18
|
ComboboxEmptyList: C
|
|
19
19
|
},
|
|
@@ -121,7 +121,7 @@ const N = {
|
|
|
121
121
|
contentWidth: {
|
|
122
122
|
type: String,
|
|
123
123
|
default: null,
|
|
124
|
-
validator: (t) =>
|
|
124
|
+
validator: (t) => I.includes(t)
|
|
125
125
|
},
|
|
126
126
|
/**
|
|
127
127
|
* If the list should be shown by pressing up or down arrow key on the input element.
|
|
@@ -183,7 +183,7 @@ const N = {
|
|
|
183
183
|
appendTo: {
|
|
184
184
|
type: [HTMLElement, String],
|
|
185
185
|
default: "body",
|
|
186
|
-
validator: (t) =>
|
|
186
|
+
validator: (t) => W.includes(t) || t instanceof HTMLElement
|
|
187
187
|
},
|
|
188
188
|
/**
|
|
189
189
|
* Named transition when the content display is toggled.
|
|
@@ -292,7 +292,7 @@ const N = {
|
|
|
292
292
|
}, H = ["id"], K = { ref: "header" }, T = ["onMouseleave", "onFocusout"], V = { ref: "footer" };
|
|
293
293
|
function z(t, o, e, m, i, n) {
|
|
294
294
|
const u = r("combobox-loading-list"), L = r("combobox-empty-list"), w = r("dt-popover"), x = r("dt-combobox");
|
|
295
|
-
return
|
|
295
|
+
return f(), p(x, c({
|
|
296
296
|
ref: "combobox",
|
|
297
297
|
loading: e.loading,
|
|
298
298
|
label: e.label,
|
|
@@ -359,7 +359,7 @@ function z(t, o, e, m, i, n) {
|
|
|
359
359
|
onMouseleave: b,
|
|
360
360
|
onFocusout: b
|
|
361
361
|
}, [
|
|
362
|
-
e.loading ? (
|
|
362
|
+
e.loading ? (f(), p(u, D(c({ key: 0 }, s)), null, 16)) : e.emptyList && e.emptyStateMessage ? (f(), p(L, c({ key: 1 }, s, { message: e.emptyStateMessage }), null, 16, ["message"])) : d(t.$slots, "list", {
|
|
363
363
|
key: 2,
|
|
364
364
|
listProps: s
|
|
365
365
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addClassStyleAttrs as S, removeClassStyleAttrs as A, returnFirstEl as u, extractVueListeners as E, safeConcatStrings as N } from "../../common/utils/index.js";
|
|
2
2
|
import { DtIconChevronDown as W, DtIconHeadphones as k } from "@dialpad/dialtone-icons/vue3";
|
|
3
3
|
import { DialtoneLocalization as D } from "../../localization/index.js";
|
|
4
|
-
import { resolveComponent as i,
|
|
4
|
+
import { resolveComponent as i, openBlock as h, createElementBlock as f, mergeProps as w, createElementVNode as o, normalizeClass as T, toHandlers as q, createVNode as _, normalizeStyle as B, withCtx as b, createTextVNode as C, toDisplayString as y, renderSlot as v, createBlock as $, createCommentVNode as L, withModifiers as z } from "vue";
|
|
5
5
|
import { _ as O } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
import R from "../emoji-text-wrapper/emoji-text-wrapper.js";
|
|
7
7
|
import j from "../badge/badge.js";
|
|
@@ -171,14 +171,14 @@ function G(e, r, a, m, n, t) {
|
|
|
171
171
|
size: "200"
|
|
172
172
|
}, {
|
|
173
173
|
default: b(() => [
|
|
174
|
-
y(
|
|
174
|
+
C(y(a.description), 1)
|
|
175
175
|
]),
|
|
176
176
|
_: 1
|
|
177
177
|
})
|
|
178
178
|
], 4)
|
|
179
179
|
], 16, x),
|
|
180
|
-
a.hideActions ?
|
|
181
|
-
|
|
180
|
+
a.hideActions ? L("", !0) : (h(), f("div", M, [
|
|
181
|
+
v(e.$slots, "right"),
|
|
182
182
|
o("div", H, [
|
|
183
183
|
t.showUnreadCount ? (h(), $(d, {
|
|
184
184
|
key: 0,
|
|
@@ -188,10 +188,10 @@ function G(e, r, a, m, n, t) {
|
|
|
188
188
|
type: "bulletin"
|
|
189
189
|
}, {
|
|
190
190
|
default: b(() => [
|
|
191
|
-
y(
|
|
191
|
+
C(y(a.unreadCount), 1)
|
|
192
192
|
]),
|
|
193
193
|
_: 1
|
|
194
|
-
})) :
|
|
194
|
+
})) : L("", !0),
|
|
195
195
|
_(g, {
|
|
196
196
|
class: "d-recipe-leftbar-row__action",
|
|
197
197
|
"data-qa": "dt-recipe-leftbar-row-action-button",
|
|
@@ -211,7 +211,7 @@ function G(e, r, a, m, n, t) {
|
|
|
211
211
|
]))
|
|
212
212
|
], 2),
|
|
213
213
|
o("div", F, [
|
|
214
|
-
|
|
214
|
+
v(e.$slots, "timer")
|
|
215
215
|
])
|
|
216
216
|
], 16);
|
|
217
217
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import g from "../item-layout/item-layout.js";
|
|
2
2
|
import h from "../avatar/avatar.js";
|
|
3
|
-
import { resolveComponent as m,
|
|
3
|
+
import { resolveComponent as m, openBlock as n, createBlock as i, createSlots as u, withCtx as o, createElementVNode as l, renderSlot as c, createElementBlock as _, Fragment as p, renderList as S, resolveDynamicComponent as k } from "vue";
|
|
4
4
|
import { _ as b } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const C = {
|
|
6
6
|
compatConfig: { MODE: 3 },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { safeConcatStrings as w, extractVueListeners as g } from "../../common/utils/index.js";
|
|
2
2
|
import { DtIconUser as C } from "@dialpad/dialtone-icons/vue3";
|
|
3
|
-
import { resolveComponent as a,
|
|
3
|
+
import { resolveComponent as a, openBlock as o, createBlock as d, mergeProps as S, toHandlers as v, withCtx as t, createVNode as s, createTextVNode as u, toDisplayString as c, createElementVNode as h, createElementBlock as x, normalizeClass as b, createCommentVNode as m, createSlots as B } from "vue";
|
|
4
4
|
import { _ as D } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
import T from "../emoji-text-wrapper/emoji-text-wrapper.js";
|
|
6
6
|
import k from "../general-row/general-row.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),A=require("@dialpad/dialtone-icons/vue3"),h=require("date-fns"),$=require("./utils.cjs"),x=require("./datepicker-constants.cjs"),v=require("../../common/utils/index.cjs"),L=require("../../localization/index.cjs"),M=require("../stack/stack.cjs"),C=require("../tooltip/tooltip.cjs"),N=require("../button/button.cjs");function P(i,u){const c=e.ref(h.getMonth(i.selectedDate)),t=e.ref(h.getYear(i.selectedDate)),r=e.ref(null),n=e.ref(0),p=e.ref([]),f=new L.DialtoneLocalization,m=e.computed(()=>$.getCalendarDays(c.value,t.value,r.value));e.watch(c,()=>{l(),u("calendar-days",m.value)},{immediate:!0}),e.watch(t,()=>{l(),u("calendar-days",m.value)},{immediate:!0});function D(a){return $.formatMonth(a,x.INTL_MONTH_FORMAT,f.currentLocale)}function _(a){p.value.includes(a)||p.value.push(a)}function k(){v.returnFirstEl(p.value[0].$el).focus()}function b(a){switch(a.key){case"ArrowLeft":a.preventDefault(),n.value===0?(n.value=3,v.returnFirstEl(p.value[n.value].$el).focus()):(n.value--,v.returnFirstEl(p.value[n.value].$el).focus());break;case"ArrowRight":a.preventDefault(),n.value===3?(n.value=0,v.returnFirstEl(p.value[n.value].$el).focus()):(n.value++,v.returnFirstEl(p.value[n.value].$el).focus());break;case"ArrowDown":a.preventDefault(),u("focus-first-day");break;case"Tab":a.preventDefault(),u("focus-first-day");break;case"Escape":u("close-datepicker");break}}function l(){const a=h.getYear(i.selectedDate),g=h.getMonth(i.selectedDate);a!==t.value||g!==c.value?r.value=null:r.value=h.getDate(i.selectedDate)}function o(a){(c.value===0&&a===-1||c.value===11&&a===1)&&(t.value+=a);const g=h.set(i.selectedDate,{month:c.value,year:t.value}),R=a===1?h.addMonths(g,1):h.subMonths(g,1);c.value=h.getMonth(R)}function y(a){t.value=t.value+a}function d(){o(1)}function T(){o(-1)}function E(){return`${f.$t("DIALTONE_DATEPICKER_CHANGE_TO")} ${f.$t("DIALTONE_DATEPICKER_PREVIOUS_YEAR")} ${t.value-1}`}function w(){return`${f.$t("DIALTONE_DATEPICKER_CHANGE_TO")} ${f.$t("DIALTONE_DATEPICKER_PREVIOUS_MONTH")} ${D(c.value-1)}`}function I(){return`${f.$t("DIALTONE_DATEPICKER_CHANGE_TO")} ${f.$t("DIALTONE_DATEPICKER_NEXT_YEAR")} ${t.value+1}`}function s(){return`${f.$t("DIALTONE_DATEPICKER_CHANGE_TO")} ${f.$t("DIALTONE_DATEPICKER_NEXT_MONTH")} ${D(c.value+1)}`}return{selectMonth:c,selectYear:t,formattedMonth:D,setDayRef:_,focusMonthYearPicker:k,handleKeyDown:b,changeMonth:o,changeYear:y,goToNextMonth:d,goToPrevMonth:T,previousYearAriaLabel:E,previousMonthAriaLabel:w,nextYearAriaLabel:I,nextMonthAriaLabel:s}}const F={id:"calendar-heading",class:"d-datepicker__month-year-title"},O={__name:"month-year-picker",props:{selectedDate:{type:Date,required:!0}},emits:["calendar-days","focus-first-day","focus-last-day","close-datepicker"],setup(i,{expose:u,emit:c}){const t=i,r=c,n=new L.DialtoneLocalization,{selectMonth:p,selectYear:f,formattedMonth:m,setDayRef:D,focusMonthYearPicker:_,handleKeyDown:k,changeMonth:b,changeYear:l,goToNextMonth:o,goToPrevMonth:y,previousYearAriaLabel:d,previousMonthAriaLabel:T,nextMonthAriaLabel:E,nextYearAriaLabel:w}=P(t,r);return e.onMounted(()=>{_()}),u({focusMonthYearPicker:_,goToNextMonth:o,goToPrevMonth:y}),(I,s)=>(e.openBlock(),e.createBlock(e.unref(M.default),{class:"d-datepicker__month-year",direction:"row",gap:"300"},{default:e.withCtx(()=>[e.createVNode(e.unref(M.default),{as:"nav",class:"d-datepicker__nav",direction:"row",gap:"200"},{default:e.withCtx(()=>[e.createVNode(e.unref(C.default),{"fallback-placements":["top-start","auto"],message:e.unref(n).$t("DIALTONE_DATEPICKER_PREVIOUS_YEAR"),placement:"top"},{anchor:e.withCtx(()=>[e.createVNode(e.unref(N.default),{id:"prevYearButton",ref:a=>{a&&e.unref(D)(a)},"aria-label":e.unref(d)(),circle:!0,class:"d-datepicker__nav-btn",importance:"clear",kind:"muted",size:"xs",type:"button",onClick:s[0]||(s[0]=a=>e.unref(l)(-1)),onKeydown:s[1]||(s[1]=a=>e.unref(k)(a))},{default:e.withCtx(()=>[e.createVNode(e.unref(A.DtIconChevronsLeft),{size:"200"})]),_:1},8,["aria-label"])]),_:1},8,["message"]),e.createVNode(e.unref(C.default),{"fallback-placements":["top-start","auto"],message:e.unref(n).$t("DIALTONE_DATEPICKER_PREVIOUS_MONTH"),placement:"top"},{anchor:e.withCtx(()=>[e.createVNode(e.unref(N.default),{id:"prevMonthButton",ref:a=>{a&&e.unref(D)(a)},"aria-label":e.unref(T)(),circle:!0,class:"d-datepicker__nav-btn",importance:"clear",kind:"muted",size:"xs",type:"button",onClick:s[2]||(s[2]=a=>e.unref(b)(-1)),onKeydown:s[3]||(s[3]=a=>e.unref(k)(a))},{default:e.withCtx(()=>[e.createVNode(e.unref(A.DtIconChevronLeft),{size:"200"})]),_:1},8,["aria-label"])]),_:1},8,["message"])]),_:1}),e.createElementVNode("div",F,e.toDisplayString(e.unref(m)(e.unref(p)))+" "+e.toDisplayString(e.unref(f)),1),e.createVNode(e.unref(M.default),{as:"nav",class:"d-datepicker__nav",direction:"row",gap:"200"},{default:e.withCtx(()=>[e.createVNode(e.unref(C.default),{"fallback-placements":["top-end","auto"],message:e.unref(n).$t("DIALTONE_DATEPICKER_NEXT_MONTH"),placement:"top"},{anchor:e.withCtx(()=>[e.createVNode(e.unref(N.default),{id:"nextMonthButton",ref:a=>{a&&e.unref(D)(a)},"aria-label":e.unref(E)(),circle:!0,class:"d-datepicker__nav-btn",importance:"clear",kind:"muted",size:"xs",type:"button",onClick:s[4]||(s[4]=a=>e.unref(b)(1)),onKeydown:s[5]||(s[5]=a=>e.unref(k)(a))},{default:e.withCtx(()=>[e.createVNode(e.unref(A.DtIconChevronRight),{size:"200"})]),_:1},8,["aria-label"])]),_:1},8,["message"]),e.createVNode(e.unref(C.default),{"fallback-placements":["top-end","auto"],message:e.unref(n).$t("DIALTONE_DATEPICKER_NEXT_YEAR"),placement:"top"},{anchor:e.withCtx(()=>[e.createVNode(e.unref(N.default),{id:"nextYearButton",ref:a=>{a&&e.unref(D)(a)},"aria-label":e.unref(w)(),circle:!0,class:"d-datepicker__nav-btn",importance:"clear",kind:"muted",size:"xs",type:"button",onClick:s[6]||(s[6]=a=>e.unref(l)(1)),onKeydown:s[7]||(s[7]=a=>e.unref(k)(a))},{default:e.withCtx(()=>[e.createVNode(e.unref(A.DtIconChevronsRight),{size:"200"})]),_:1},8,["aria-label"])]),_:1},8,["message"])]),_:1})]),_:1}))}};function V(i,u){const c=e.ref(null),t=e.ref(0),r=e.ref([]),n=new L.DialtoneLocalization,p=e.computed(()=>$.getWeekDayNames(i.locale,x.WEEK_START));e.watch(()=>i.calendarDays,()=>{t.value=0,r.value=[],c.value=null});function f(l){return n.$t("DIALTONE_DATEPICKER_SELECT_DAY")+` ${$.formatDate(l.value,x.INTL_MONTH_FORMAT,n.currentLocale)}`}function m(l,o){!r.value.some(y=>y.el===l)&&o.currentMonth&&r.value.push({el:l,day:o})}function D(l){switch(l.key){case"ArrowUp":l.preventDefault(),t.value-=7;try{v.returnFirstEl(r.value[t.value].el.$el).focus()}catch{const o=$.calculatePrevFocusDate(r.value[t.value+7].day.value);u("go-to-prev-month"),e.nextTick(()=>{v.returnFirstEl(r.value[o-1].el.$el).focus(),t.value+=o-1})}break;case"ArrowDown":l.preventDefault(),t.value+=7;try{v.returnFirstEl(r.value[t.value].el.$el).focus()}catch{const o=$.calculateNextFocusDate(r.value[t.value-7].day.value);u("go-to-next-month"),e.nextTick(()=>{v.returnFirstEl(r.value[o-1].el.$el).focus(),t.value+=o-1})}break;case"ArrowLeft":l.preventDefault(),t.value>0?(t.value-=1,v.returnFirstEl(r.value[t.value].el.$el).focus()):(u("go-to-prev-month"),k());break;case"ArrowRight":l.preventDefault(),t.value<r.value.length-1?(t.value+=1,v.returnFirstEl(r.value[t.value].el.$el).focus()):(u("go-to-next-month"),_());break;case"Tab":l.preventDefault(),u("focus-month-year-picker");break;case"Escape":u("close-datepicker");break}}function _(){t.value=0,e.nextTick(()=>{v.returnFirstEl(r.value[t.value].el.$el).focus()})}function k(){e.nextTick(()=>{t.value=r.value.length-1,v.returnFirstEl(r.value[t.value].el.$el).focus()})}function b(l){l.currentMonth&&(c.value=l.text,u("select-date",l.value))}return{selectedDay:c,weekDays:p,dayAriaLabel:f,setDayRef:m,handleKeyDown:D,focusFirstDay:_,selectDay:b}}const Y={class:"d-datepicker__calendar","aria-labelledby":"calendar-heading"},K=["title","aria-label"],B={__name:"calendar",props:{calendarDays:{type:Array,required:!0}},emits:["select-date","focus-month-year-picker","close-datepicker","go-to-next-month","go-to-prev-month"],setup(i,{expose:u,emit:c}){const t=i,r=c,{selectedDay:n,weekDays:p,dayAriaLabel:f,setDayRef:m,handleKeyDown:D,focusFirstDay:_,selectDay:k}=V(t,r);return u({focusFirstDay:_}),(b,l)=>(e.openBlock(),e.createElementBlock("table",Y,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),o=>(e.openBlock(),e.createElementBlock("th",{key:o,scope:"col",class:"d-datepicker__cell d-datepicker__cell--header"},[e.createElementVNode("span",{class:"d-datepicker__weekday",title:o,"aria-label":o},e.toDisplayString(o),9,K)]))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.calendarDays,(o,y)=>(e.openBlock(),e.createElementBlock("tr",{key:y},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.days,(d,T)=>(e.openBlock(),e.createElementBlock("td",{key:y+T,class:"d-datepicker__cell",role:"listbox"},[e.createVNode(e.unref(N.default),{ref_for:!0,ref:E=>{E&&e.unref(m)(E,d)},class:e.normalizeClass(["d-datepicker__day",{"d-datepicker__day--disabled":!d.currentMonth,"d-datepicker__day--selected":e.unref(n)?d.text===e.unref(n)&&d.currentMonth:d.selected}]),circle:!0,size:"sm",importance:"clear",disabled:!d.currentMonth,type:"button","aria-selected":e.unref(n)?d.text===e.unref(n)&&d.currentMonth:d.selected,"aria-label":e.unref(f)(d),role:"option",onClick:E=>e.unref(k)(d),onKeydown:l[0]||(l[0]=E=>e.unref(D)(E))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.text),1)]),_:2},1032,["disabled","class","aria-selected","aria-label","onClick"])]))),128))]))),128))])]))}},z={class:"d-datepicker__hd"},S={class:"d-datepicker__bd"},q={__name:"datepicker",props:{selectedDate:{type:Date,default:()=>new Date}},emits:["selected-date","close-datepicker"],setup(i){const u=e.ref([]);function c(t){u.value=t}return e.onMounted(()=>{const t=e.getCurrentInstance();v.warnIfUnmounted(v.returnFirstEl(t.proxy.$el),"datepicker")}),(t,r)=>(e.openBlock(),e.createBlock(e.unref(M.default),{class:"d-datepicker",gap:"400"},{default:e.withCtx(()=>[e.createElementVNode("div",z,[e.createVNode(O,{ref:"monthYearPicker","selected-date":i.selectedDate,onCalendarDays:c,onFocusFirstDay:r[0]||(r[0]=n=>t.$refs.calendar.focusFirstDay()),onFocusLastDay:r[1]||(r[1]=n=>t.$refs.calendar.focusLastDay()),onCloseDatepicker:r[2]||(r[2]=n=>t.$emit("close-datepicker"))},null,8,["selected-date"])]),e.createElementVNode("div",S,[e.createVNode(B,{ref:"calendar","calendar-days":u.value,onSelectDate:r[3]||(r[3]=n=>t.$emit("selected-date",n)),onFocusMonthYearPicker:r[4]||(r[4]=n=>t.$refs.monthYearPicker.focusMonthYearPicker()),onCloseDatepicker:r[5]||(r[5]=n=>t.$emit("close-datepicker")),onGoToNextMonth:r[6]||(r[6]=n=>t.$refs.monthYearPicker.goToNextMonth()),onGoToPrevMonth:r[7]||(r[7]=n=>t.$refs.monthYearPicker.goToPrevMonth())},null,8,["calendar-days"])])]),_:1}))}};exports.default=q;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("@dialpad/dialtone-icons/vue3"),c=require("date-fns"),N=require("./utils.cjs"),P=require("./datepicker-constants.cjs"),v=require("../../common/utils/index.cjs"),R=require("../../localization/index.cjs"),A=require("../stack/stack.cjs"),M=require("../tooltip/tooltip.cjs"),T=require("../button/button.cjs");function V(r,o){const s=e.ref(c.getMonth(r.selectedDate)),a=e.ref(c.getYear(r.selectedDate)),n=e.ref(null),l=e.ref(0),m=e.ref([]),D=new R.DialtoneLocalization,b=e.computed(()=>N.getCalendarDays(s.value,a.value,n.value,r.minDate,r.maxDate)),k=e.computed(()=>{if(!r.minDate)return!1;const t=c.subMonths(new Date(a.value,s.value,1),1);return c.endOfMonth(t)<c.startOfDay(r.minDate)}),E=e.computed(()=>{if(!r.maxDate)return!1;const t=c.addMonths(new Date(a.value,s.value,1),1);return c.startOfMonth(t)>c.startOfDay(r.maxDate)}),p=e.computed(()=>{if(!r.minDate)return!1;const t=new Date(a.value-1,s.value,1);return c.endOfMonth(t)<c.startOfDay(r.minDate)}),_=e.computed(()=>{if(!r.maxDate)return!1;const t=new Date(a.value+1,s.value,1);return c.startOfMonth(t)>c.startOfDay(r.maxDate)});e.watch(s,()=>{$(),o("calendar-days",b.value)},{immediate:!0}),e.watch(a,()=>{$(),o("calendar-days",b.value)},{immediate:!0}),e.watch(()=>r.minDate,()=>{o("calendar-days",b.value)}),e.watch(()=>r.maxDate,()=>{o("calendar-days",b.value)});function u(t){return N.formatMonth(t,P.INTL_MONTH_FORMAT,D.currentLocale)}function i(t){m.value.includes(t)||m.value.push(t)}function y(){v.returnFirstEl(m.value[0].$el).focus()}function f(t){switch(t.key){case"ArrowLeft":t.preventDefault(),l.value===0?(l.value=3,v.returnFirstEl(m.value[l.value].$el).focus()):(l.value--,v.returnFirstEl(m.value[l.value].$el).focus());break;case"ArrowRight":t.preventDefault(),l.value===3?(l.value=0,v.returnFirstEl(m.value[l.value].$el).focus()):(l.value++,v.returnFirstEl(m.value[l.value].$el).focus());break;case"ArrowDown":t.preventDefault(),o("focus-first-day");break;case"Tab":t.preventDefault(),o("focus-first-day");break;case"Escape":o("close-datepicker");break}}function $(){const t=c.getYear(r.selectedDate),x=c.getMonth(r.selectedDate);t!==a.value||x!==s.value?n.value=null:n.value=c.getDate(r.selectedDate)}function h(t){if(t===-1&&k.value||t===1&&E.value)return;(s.value===0&&t===-1||s.value===11&&t===1)&&(a.value+=t);const x=c.set(r.selectedDate,{month:s.value,year:a.value}),F=t===1?c.addMonths(x,1):c.subMonths(x,1);s.value=c.getMonth(F)}function w(t){t===-1&&p.value||t===1&&_.value||(a.value=a.value+t)}function C(){h(1)}function L(){h(-1)}function I(){return`${D.$t("DIALTONE_DATEPICKER_CHANGE_TO")} ${D.$t("DIALTONE_DATEPICKER_PREVIOUS_YEAR")} ${a.value-1}`}function O(){return`${D.$t("DIALTONE_DATEPICKER_CHANGE_TO")} ${D.$t("DIALTONE_DATEPICKER_PREVIOUS_MONTH")} ${u(s.value-1)}`}function Y(){return`${D.$t("DIALTONE_DATEPICKER_CHANGE_TO")} ${D.$t("DIALTONE_DATEPICKER_NEXT_YEAR")} ${a.value+1}`}function d(){return`${D.$t("DIALTONE_DATEPICKER_CHANGE_TO")} ${D.$t("DIALTONE_DATEPICKER_NEXT_MONTH")} ${u(s.value+1)}`}return{selectMonth:s,selectYear:a,formattedMonth:u,setDayRef:i,focusMonthYearPicker:y,handleKeyDown:f,changeMonth:h,changeYear:w,goToNextMonth:C,goToPrevMonth:L,isPrevMonthDisabled:k,isNextMonthDisabled:E,isPrevYearDisabled:p,isNextYearDisabled:_,previousYearAriaLabel:I,previousMonthAriaLabel:O,nextYearAriaLabel:Y,nextMonthAriaLabel:d}}const K={id:"calendar-heading",class:"d-datepicker__month-year-title"},B={__name:"month-year-picker",props:{selectedDate:{type:Date,required:!0},minDate:{type:Date,default:null},maxDate:{type:Date,default:null}},emits:["calendar-days","focus-first-day","focus-last-day","close-datepicker"],setup(r,{expose:o,emit:s}){const a=r,n=s,l=new R.DialtoneLocalization,{selectMonth:m,selectYear:D,formattedMonth:b,setDayRef:k,focusMonthYearPicker:E,handleKeyDown:p,changeMonth:_,changeYear:u,goToNextMonth:i,goToPrevMonth:y,isPrevMonthDisabled:f,isNextMonthDisabled:$,isPrevYearDisabled:h,isNextYearDisabled:w,previousYearAriaLabel:C,previousMonthAriaLabel:L,nextMonthAriaLabel:I,nextYearAriaLabel:O}=V(a,n);return e.onMounted(()=>{E()}),o({focusMonthYearPicker:E,goToNextMonth:i,goToPrevMonth:y}),(Y,d)=>(e.openBlock(),e.createBlock(e.unref(A.default),{class:"d-datepicker__month-year",direction:"row",gap:"300"},{default:e.withCtx(()=>[e.createVNode(e.unref(A.default),{as:"nav",class:"d-datepicker__nav",direction:"row",gap:"200"},{default:e.withCtx(()=>[e.createVNode(e.unref(M.default),{"fallback-placements":["top-start","auto"],message:e.unref(l).$t("DIALTONE_DATEPICKER_PREVIOUS_YEAR"),placement:"top"},{anchor:e.withCtx(()=>[e.createVNode(e.unref(T.default),{id:"prevYearButton",ref:t=>{t&&e.unref(k)(t)},"aria-label":e.unref(C)(),circle:!0,disabled:e.unref(h),class:"d-datepicker__nav-btn",importance:"clear",kind:"muted",size:"xs",type:"button",onClick:d[0]||(d[0]=t=>e.unref(u)(-1)),onKeydown:d[1]||(d[1]=t=>e.unref(p)(t))},{default:e.withCtx(()=>[e.createVNode(e.unref(g.DtIconChevronsLeft),{size:"200"})]),_:1},8,["aria-label","disabled"])]),_:1},8,["message"]),e.createVNode(e.unref(M.default),{"fallback-placements":["top-start","auto"],message:e.unref(l).$t("DIALTONE_DATEPICKER_PREVIOUS_MONTH"),placement:"top"},{anchor:e.withCtx(()=>[e.createVNode(e.unref(T.default),{id:"prevMonthButton",ref:t=>{t&&e.unref(k)(t)},"aria-label":e.unref(L)(),circle:!0,disabled:e.unref(f),class:"d-datepicker__nav-btn",importance:"clear",kind:"muted",size:"xs",type:"button",onClick:d[2]||(d[2]=t=>e.unref(_)(-1)),onKeydown:d[3]||(d[3]=t=>e.unref(p)(t))},{default:e.withCtx(()=>[e.createVNode(e.unref(g.DtIconChevronLeft),{size:"200"})]),_:1},8,["aria-label","disabled"])]),_:1},8,["message"])]),_:1}),e.createElementVNode("div",K,e.toDisplayString(e.unref(b)(e.unref(m)))+" "+e.toDisplayString(e.unref(D)),1),e.createVNode(e.unref(A.default),{as:"nav",class:"d-datepicker__nav",direction:"row",gap:"200"},{default:e.withCtx(()=>[e.createVNode(e.unref(M.default),{"fallback-placements":["top-end","auto"],message:e.unref(l).$t("DIALTONE_DATEPICKER_NEXT_MONTH"),placement:"top"},{anchor:e.withCtx(()=>[e.createVNode(e.unref(T.default),{id:"nextMonthButton",ref:t=>{t&&e.unref(k)(t)},"aria-label":e.unref(I)(),circle:!0,disabled:e.unref($),class:"d-datepicker__nav-btn",importance:"clear",kind:"muted",size:"xs",type:"button",onClick:d[4]||(d[4]=t=>e.unref(_)(1)),onKeydown:d[5]||(d[5]=t=>e.unref(p)(t))},{default:e.withCtx(()=>[e.createVNode(e.unref(g.DtIconChevronRight),{size:"200"})]),_:1},8,["aria-label","disabled"])]),_:1},8,["message"]),e.createVNode(e.unref(M.default),{"fallback-placements":["top-end","auto"],message:e.unref(l).$t("DIALTONE_DATEPICKER_NEXT_YEAR"),placement:"top"},{anchor:e.withCtx(()=>[e.createVNode(e.unref(T.default),{id:"nextYearButton",ref:t=>{t&&e.unref(k)(t)},"aria-label":e.unref(O)(),circle:!0,disabled:e.unref(w),class:"d-datepicker__nav-btn",importance:"clear",kind:"muted",size:"xs",type:"button",onClick:d[6]||(d[6]=t=>e.unref(u)(1)),onKeydown:d[7]||(d[7]=t=>e.unref(p)(t))},{default:e.withCtx(()=>[e.createVNode(e.unref(g.DtIconChevronsRight),{size:"200"})]),_:1},8,["aria-label","disabled"])]),_:1},8,["message"])]),_:1})]),_:1}))}};function z(r,o){const s=e.ref(null),a=e.ref(0),n=e.ref([]),l=new R.DialtoneLocalization,m=e.computed(()=>N.getWeekDayNames(r.locale,P.WEEK_START));e.watch(()=>r.calendarDays,()=>{a.value=0,n.value=[],s.value=null});function D(u){return l.$t("DIALTONE_DATEPICKER_SELECT_DAY")+` ${N.formatDate(u.value,P.INTL_MONTH_FORMAT,l.currentLocale)}`}function b(u,i){!n.value.some(y=>y.el===u)&&!i.disabled&&n.value.push({el:u,day:i})}function k(u){switch(u.key){case"ArrowUp":u.preventDefault(),a.value-=7;try{v.returnFirstEl(n.value[a.value].el.$el).focus()}catch{const i=N.calculatePrevFocusDate(n.value[a.value+7].day.value);o("go-to-prev-month"),e.nextTick(()=>{v.returnFirstEl(n.value[i-1].el.$el).focus(),a.value+=i-1})}break;case"ArrowDown":u.preventDefault(),a.value+=7;try{v.returnFirstEl(n.value[a.value].el.$el).focus()}catch{const i=N.calculateNextFocusDate(n.value[a.value-7].day.value);o("go-to-next-month"),e.nextTick(()=>{v.returnFirstEl(n.value[i-1].el.$el).focus(),a.value+=i-1})}break;case"ArrowLeft":u.preventDefault(),a.value>0?(a.value-=1,v.returnFirstEl(n.value[a.value].el.$el).focus()):(o("go-to-prev-month"),p());break;case"ArrowRight":u.preventDefault(),a.value<n.value.length-1?(a.value+=1,v.returnFirstEl(n.value[a.value].el.$el).focus()):(o("go-to-next-month"),E());break;case"Tab":u.preventDefault(),o("focus-month-year-picker");break;case"Escape":o("close-datepicker");break}}function E(){a.value=0,e.nextTick(()=>{v.returnFirstEl(n.value[a.value].el.$el).focus()})}function p(){e.nextTick(()=>{a.value=n.value.length-1,v.returnFirstEl(n.value[a.value].el.$el).focus()})}function _(u){u.disabled||(s.value=u.text,o("select-date",u.value))}return{selectedDay:s,weekDays:m,dayAriaLabel:D,setDayRef:b,handleKeyDown:k,focusFirstDay:E,selectDay:_}}const q={class:"d-datepicker__calendar","aria-labelledby":"calendar-heading"},S=["title","aria-label"],H={__name:"calendar",props:{calendarDays:{type:Array,required:!0}},emits:["select-date","focus-month-year-picker","close-datepicker","go-to-next-month","go-to-prev-month"],setup(r,{expose:o,emit:s}){const a=r,n=s,{selectedDay:l,weekDays:m,dayAriaLabel:D,setDayRef:b,handleKeyDown:k,focusFirstDay:E,selectDay:p}=z(a,n);return o({focusFirstDay:E}),(_,u)=>(e.openBlock(),e.createElementBlock("table",q,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),i=>(e.openBlock(),e.createElementBlock("th",{key:i,scope:"col",class:"d-datepicker__cell d-datepicker__cell--header"},[e.createElementVNode("span",{class:"d-datepicker__weekday",title:i,"aria-label":i},e.toDisplayString(i),9,S)]))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.calendarDays,(i,y)=>(e.openBlock(),e.createElementBlock("tr",{key:y},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.days,(f,$)=>(e.openBlock(),e.createElementBlock("td",{key:y+$,class:"d-datepicker__cell",role:"listbox"},[e.createVNode(e.unref(T.default),{ref_for:!0,ref:h=>{h&&e.unref(b)(h,f)},class:e.normalizeClass(["d-datepicker__day",{"d-datepicker__day--disabled":f.disabled,"d-datepicker__day--selected":e.unref(l)?f.text===e.unref(l)&&!f.disabled:f.selected}]),circle:!0,size:"sm",importance:"clear",disabled:f.disabled,type:"button","aria-selected":e.unref(l)?f.text===e.unref(l)&&!f.disabled:f.selected,"aria-label":e.unref(D)(f),role:"option",onClick:h=>e.unref(p)(f),onKeydown:u[0]||(u[0]=h=>e.unref(k)(h))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.text),1)]),_:2},1032,["disabled","class","aria-selected","aria-label","onClick"])]))),128))]))),128))])]))}},G={class:"d-datepicker__hd"},U={class:"d-datepicker__bd"},X={__name:"datepicker",props:{selectedDate:{type:Date,default:()=>new Date},minDate:{type:Date,default:null},maxDate:{type:Date,default:null,validator:(r,o)=>r&&o.minDate&&r<o.minDate?(console.warn("[DtDatepicker]: maxDate must be after or equal to minDate."),!1):!0}},emits:["selected-date","close-datepicker"],setup(r){const o=e.ref([]);function s(a){o.value=a}return e.onMounted(()=>{const a=e.getCurrentInstance();v.warnIfUnmounted(v.returnFirstEl(a.proxy.$el),"datepicker")}),(a,n)=>(e.openBlock(),e.createBlock(e.unref(A.default),{class:"d-datepicker",gap:"400"},{default:e.withCtx(()=>[e.createElementVNode("div",G,[e.createVNode(B,{ref:"monthYearPicker","selected-date":r.selectedDate,"min-date":r.minDate,"max-date":r.maxDate,onCalendarDays:s,onFocusFirstDay:n[0]||(n[0]=l=>a.$refs.calendar.focusFirstDay()),onFocusLastDay:n[1]||(n[1]=l=>a.$refs.calendar.focusLastDay()),onCloseDatepicker:n[2]||(n[2]=l=>a.$emit("close-datepicker"))},null,8,["selected-date","min-date","max-date"])]),e.createElementVNode("div",U,[e.createVNode(H,{ref:"calendar","calendar-days":o.value,onSelectDate:n[3]||(n[3]=l=>a.$emit("selected-date",l)),onFocusMonthYearPicker:n[4]||(n[4]=l=>a.$refs.monthYearPicker.focusMonthYearPicker()),onCloseDatepicker:n[5]||(n[5]=l=>a.$emit("close-datepicker")),onGoToNextMonth:n[6]||(n[6]=l=>a.$refs.monthYearPicker.goToNextMonth()),onGoToPrevMonth:n[7]||(n[7]=l=>a.$refs.monthYearPicker.goToPrevMonth())},null,8,["calendar-days"])])]),_:1}))}};exports.default=X;
|
|
2
2
|
//# sourceMappingURL=datepicker.cjs.map
|