@dialpad/dialtone 9.99.0 → 9.100.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 +94 -85
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone.css +94 -85
- package/dist/css/dialtone.min.css +1 -1
- package/dist/tokens/doc.json +11964 -11964
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/components/item_layout/item_layout.vue.cjs +63 -1
- package/dist/vue2/components/item_layout/item_layout.vue.cjs.map +1 -1
- package/dist/vue2/components/item_layout/item_layout.vue.js +63 -1
- package/dist/vue2/components/item_layout/item_layout.vue.js.map +1 -1
- package/dist/vue2/components/list_item/list_item.vue.cjs +12 -13
- package/dist/vue2/components/list_item/list_item.vue.cjs.map +1 -1
- package/dist/vue2/components/list_item/list_item.vue.js +12 -13
- package/dist/vue2/components/list_item/list_item.vue.js.map +1 -1
- package/dist/vue2/dialtone-vue.cjs +1 -0
- package/dist/vue2/dialtone-vue.cjs.map +1 -1
- package/dist/vue2/dialtone-vue.js +2 -1
- package/dist/vue2/lib/ivr-node.cjs +1 -0
- package/dist/vue2/lib/ivr-node.cjs.map +1 -1
- package/dist/vue2/lib/ivr-node.js +2 -1
- package/dist/vue2/recipes/cards/ivr_node/ivr_node.vue.cjs +3 -1
- package/dist/vue2/recipes/cards/ivr_node/ivr_node.vue.cjs.map +1 -1
- package/dist/vue2/recipes/cards/ivr_node/ivr_node.vue.js +5 -3
- package/dist/vue2/recipes/cards/ivr_node/ivr_node.vue.js.map +1 -1
- package/dist/vue2/recipes/cards/ivr_node/ivr_node_constants.cjs +6 -1
- package/dist/vue2/recipes/cards/ivr_node/ivr_node_constants.cjs.map +1 -1
- package/dist/vue2/recipes/cards/ivr_node/ivr_node_constants.js +6 -1
- package/dist/vue2/recipes/cards/ivr_node/ivr_node_constants.js.map +1 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs +1 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs.map +1 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js +1 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js.map +1 -1
- package/dist/vue2/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.cjs +5 -1
- package/dist/vue2/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.cjs.map +1 -1
- package/dist/vue2/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.js +5 -1
- package/dist/vue2/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.cjs +10 -10
- package/dist/vue2/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js +10 -10
- package/dist/vue2/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs +2 -4
- package/dist/vue2/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_row/feed_item_row.vue.js +2 -4
- package/dist/vue2/recipes/conversation_view/feed_item_row/feed_item_row.vue.js.map +1 -1
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.cjs +4 -4
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.cjs.map +1 -1
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.js +4 -4
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.js.map +1 -1
- package/dist/vue2/types/components/item_layout/item_layout.vue.d.ts +66 -1
- package/dist/vue2/types/components/item_layout/item_layout.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/list_item/list_item.vue.d.ts +1 -22
- package/dist/vue2/types/components/list_item/list_item.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/cards/ivr_node/index.d.ts +1 -1
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node_constants.d.ts +6 -0
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node_constants.d.ts.map +1 -1
- package/dist/vue2/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/item_layout/contact_info/contact_info.vue.d.ts.map +1 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/components/item_layout/item_layout.vue.cjs +102 -44
- package/dist/vue3/components/item_layout/item_layout.vue.cjs.map +1 -1
- package/dist/vue3/components/item_layout/item_layout.vue.js +103 -45
- package/dist/vue3/components/item_layout/item_layout.vue.js.map +1 -1
- package/dist/vue3/components/list_item/list_item.vue.cjs +24 -17
- package/dist/vue3/components/list_item/list_item.vue.cjs.map +1 -1
- package/dist/vue3/components/list_item/list_item.vue.js +24 -17
- package/dist/vue3/components/list_item/list_item.vue.js.map +1 -1
- package/dist/vue3/dialtone-vue.cjs +1 -0
- package/dist/vue3/dialtone-vue.cjs.map +1 -1
- package/dist/vue3/dialtone-vue.js +2 -1
- package/dist/vue3/lib/ivr-node.cjs +1 -0
- package/dist/vue3/lib/ivr-node.cjs.map +1 -1
- package/dist/vue3/lib/ivr-node.js +2 -1
- package/dist/vue3/recipes/cards/ivr_node/ivr_node.vue.cjs +3 -1
- package/dist/vue3/recipes/cards/ivr_node/ivr_node.vue.cjs.map +1 -1
- package/dist/vue3/recipes/cards/ivr_node/ivr_node.vue.js +5 -3
- package/dist/vue3/recipes/cards/ivr_node/ivr_node.vue.js.map +1 -1
- package/dist/vue3/recipes/cards/ivr_node/ivr_node_constants.cjs +6 -1
- package/dist/vue3/recipes/cards/ivr_node/ivr_node_constants.cjs.map +1 -1
- package/dist/vue3/recipes/cards/ivr_node/ivr_node_constants.js +6 -1
- package/dist/vue3/recipes/cards/ivr_node/ivr_node_constants.js.map +1 -1
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs +1 -0
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs.map +1 -1
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js +1 -0
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js.map +1 -1
- package/dist/vue3/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.cjs +5 -1
- package/dist/vue3/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.cjs.map +1 -1
- package/dist/vue3/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.js +5 -1
- package/dist/vue3/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.cjs +51 -21
- package/dist/vue3/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js +52 -22
- package/dist/vue3/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs +2 -4
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.js +2 -4
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.js.map +1 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.cjs +16 -4
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.cjs.map +1 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.js +16 -4
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.js.map +1 -1
- package/dist/vue3/types/components/item_layout/item_layout.vue.d.ts +64 -0
- package/dist/vue3/types/components/item_layout/item_layout.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/list_item/list_item.vue.d.ts +1 -24
- package/dist/vue3/types/components/list_item/list_item.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/cards/ivr_node/index.d.ts +1 -1
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node_constants.d.ts +6 -0
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node_constants.d.ts.map +1 -1
- package/dist/vue3/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/item_layout/contact_info/contact_info.vue.d.ts.map +1 -1
- package/package.json +6 -2
|
@@ -9,6 +9,7 @@ const IVR_NODE_BRANCH = "branch";
|
|
|
9
9
|
const IVR_NODE_TRANSFER = "transfer";
|
|
10
10
|
const IVR_NODE_HANGUP = "hangup";
|
|
11
11
|
const IVR_NODE_ASSIGN = "assign";
|
|
12
|
+
const IVR_NODE_CUSTOMER_DATA = "customerdata";
|
|
12
13
|
const IVR_NODE_ICON_TYPES = {
|
|
13
14
|
[IVR_NODE_PROMPT_MENU]: "keypad",
|
|
14
15
|
[IVR_NODE_PROMPT_COLLECT]: "dialer",
|
|
@@ -17,6 +18,7 @@ const IVR_NODE_ICON_TYPES = {
|
|
|
17
18
|
[IVR_NODE_BRANCH]: "branch",
|
|
18
19
|
[IVR_NODE_GO_TO]: "call-merge",
|
|
19
20
|
[IVR_NODE_ASSIGN]: "chevrons-right",
|
|
21
|
+
[IVR_NODE_CUSTOMER_DATA]: "list-bullet",
|
|
20
22
|
[IVR_NODE_TRANSFER]: "transfer",
|
|
21
23
|
[IVR_NODE_HANGUP]: "phone-hang-up"
|
|
22
24
|
};
|
|
@@ -29,7 +31,8 @@ const IVR_NODE_LABELS = {
|
|
|
29
31
|
[IVR_NODE_GO_TO]: "Go-to",
|
|
30
32
|
[IVR_NODE_TRANSFER]: "Transfer",
|
|
31
33
|
[IVR_NODE_HANGUP]: "Hangup",
|
|
32
|
-
[IVR_NODE_ASSIGN]: "Assign"
|
|
34
|
+
[IVR_NODE_ASSIGN]: "Assign",
|
|
35
|
+
[IVR_NODE_CUSTOMER_DATA]: "Customer Data"
|
|
33
36
|
};
|
|
34
37
|
const IVR_NODE_CLASSES = {
|
|
35
38
|
PROMPT: {
|
|
@@ -53,12 +56,14 @@ const IVR_NODE_CLASS_MAPPING = {
|
|
|
53
56
|
[IVR_NODE_BRANCH]: IVR_NODE_CLASSES.LOGIC,
|
|
54
57
|
[IVR_NODE_GO_TO]: IVR_NODE_CLASSES.LOGIC,
|
|
55
58
|
[IVR_NODE_ASSIGN]: IVR_NODE_CLASSES.LOGIC,
|
|
59
|
+
[IVR_NODE_CUSTOMER_DATA]: IVR_NODE_CLASSES.LOGIC,
|
|
56
60
|
[IVR_NODE_TRANSFER]: IVR_NODE_CLASSES.TERMINAL,
|
|
57
61
|
[IVR_NODE_HANGUP]: IVR_NODE_CLASSES.TERMINAL
|
|
58
62
|
};
|
|
59
63
|
exports.IVR_NODE_ASSIGN = IVR_NODE_ASSIGN;
|
|
60
64
|
exports.IVR_NODE_BRANCH = IVR_NODE_BRANCH;
|
|
61
65
|
exports.IVR_NODE_CLASS_MAPPING = IVR_NODE_CLASS_MAPPING;
|
|
66
|
+
exports.IVR_NODE_CUSTOMER_DATA = IVR_NODE_CUSTOMER_DATA;
|
|
62
67
|
exports.IVR_NODE_EXPERT = IVR_NODE_EXPERT;
|
|
63
68
|
exports.IVR_NODE_GO_TO = IVR_NODE_GO_TO;
|
|
64
69
|
exports.IVR_NODE_HANGUP = IVR_NODE_HANGUP;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ivr_node_constants.cjs","sources":["../../../../recipes/cards/ivr_node/ivr_node_constants.js"],"sourcesContent":["export const IVR_NODE_PROMPT_MENU = 'promptmenu';\nexport const IVR_NODE_PROMPT_COLLECT = 'promptcollect';\nexport const IVR_NODE_PROMPT_PLAY = 'promptplay';\nexport const IVR_NODE_EXPERT = 'gotoexpert';\nexport const IVR_NODE_GO_TO = 'goto';\nexport const IVR_NODE_BRANCH = 'branch';\nexport const IVR_NODE_TRANSFER = 'transfer';\nexport const IVR_NODE_HANGUP = 'hangup';\nexport const IVR_NODE_ASSIGN = 'assign';\n\nexport const IVR_NODE_ICON_TYPES = {\n [IVR_NODE_PROMPT_MENU]: 'keypad',\n [IVR_NODE_PROMPT_COLLECT]: 'dialer',\n [IVR_NODE_PROMPT_PLAY]: 'volume-2',\n [IVR_NODE_EXPERT]: 'expert-node',\n [IVR_NODE_BRANCH]: 'branch',\n [IVR_NODE_GO_TO]: 'call-merge',\n [IVR_NODE_ASSIGN]: 'chevrons-right',\n [IVR_NODE_TRANSFER]: 'transfer',\n [IVR_NODE_HANGUP]: 'phone-hang-up',\n};\n\nexport const IVR_NODE_LABELS = {\n [IVR_NODE_PROMPT_MENU]: 'Menu',\n [IVR_NODE_PROMPT_COLLECT]: 'Collect',\n [IVR_NODE_PROMPT_PLAY]: 'Play',\n [IVR_NODE_EXPERT]: 'Expert',\n [IVR_NODE_BRANCH]: 'Branch',\n [IVR_NODE_GO_TO]: 'Go-to',\n [IVR_NODE_TRANSFER]: 'Transfer',\n [IVR_NODE_HANGUP]: 'Hangup',\n [IVR_NODE_ASSIGN]: 'Assign',\n};\n\nconst IVR_NODE_CLASSES = {\n PROMPT: {\n normal: 'd-recipe-ivr-node-prompt',\n selected: 'd-recipe-ivr-node-prompt--selected',\n },\n LOGIC: {\n normal: 'd-recipe-ivr-node-logic',\n selected: 'd-recipe-ivr-node-logic--selected',\n },\n TERMINAL: {\n normal: 'd-recipe-ivr-node-terminal',\n selected: 'd-recipe-ivr-node-terminal--selected',\n },\n};\n\nexport const IVR_NODE_CLASS_MAPPING = {\n [IVR_NODE_PROMPT_MENU]: IVR_NODE_CLASSES.PROMPT,\n [IVR_NODE_PROMPT_COLLECT]: IVR_NODE_CLASSES.PROMPT,\n [IVR_NODE_PROMPT_PLAY]: IVR_NODE_CLASSES.PROMPT,\n [IVR_NODE_EXPERT]: IVR_NODE_CLASSES.LOGIC,\n [IVR_NODE_BRANCH]: IVR_NODE_CLASSES.LOGIC,\n [IVR_NODE_GO_TO]: IVR_NODE_CLASSES.LOGIC,\n [IVR_NODE_ASSIGN]: IVR_NODE_CLASSES.LOGIC,\n [IVR_NODE_TRANSFER]: IVR_NODE_CLASSES.TERMINAL,\n [IVR_NODE_HANGUP]: IVR_NODE_CLASSES.TERMINAL,\n};\n"],"names":[],"mappings":";;AAAY,MAAC,uBAAuB;AACxB,MAAC,0BAA0B;AAC3B,MAAC,uBAAuB;AACxB,MAAC,kBAAkB;AACnB,MAAC,iBAAiB;AAClB,MAAC,kBAAkB;AACnB,MAAC,oBAAoB;AACrB,MAAC,kBAAkB;AACnB,MAAC,kBAAkB;
|
|
1
|
+
{"version":3,"file":"ivr_node_constants.cjs","sources":["../../../../recipes/cards/ivr_node/ivr_node_constants.js"],"sourcesContent":["export const IVR_NODE_PROMPT_MENU = 'promptmenu';\nexport const IVR_NODE_PROMPT_COLLECT = 'promptcollect';\nexport const IVR_NODE_PROMPT_PLAY = 'promptplay';\nexport const IVR_NODE_EXPERT = 'gotoexpert';\nexport const IVR_NODE_GO_TO = 'goto';\nexport const IVR_NODE_BRANCH = 'branch';\nexport const IVR_NODE_TRANSFER = 'transfer';\nexport const IVR_NODE_HANGUP = 'hangup';\nexport const IVR_NODE_ASSIGN = 'assign';\nexport const IVR_NODE_CUSTOMER_DATA = 'customerdata';\n\nexport const IVR_NODE_ICON_TYPES = {\n [IVR_NODE_PROMPT_MENU]: 'keypad',\n [IVR_NODE_PROMPT_COLLECT]: 'dialer',\n [IVR_NODE_PROMPT_PLAY]: 'volume-2',\n [IVR_NODE_EXPERT]: 'expert-node',\n [IVR_NODE_BRANCH]: 'branch',\n [IVR_NODE_GO_TO]: 'call-merge',\n [IVR_NODE_ASSIGN]: 'chevrons-right',\n [IVR_NODE_CUSTOMER_DATA]: 'list-bullet',\n [IVR_NODE_TRANSFER]: 'transfer',\n [IVR_NODE_HANGUP]: 'phone-hang-up',\n};\n\nexport const IVR_NODE_LABELS = {\n [IVR_NODE_PROMPT_MENU]: 'Menu',\n [IVR_NODE_PROMPT_COLLECT]: 'Collect',\n [IVR_NODE_PROMPT_PLAY]: 'Play',\n [IVR_NODE_EXPERT]: 'Expert',\n [IVR_NODE_BRANCH]: 'Branch',\n [IVR_NODE_GO_TO]: 'Go-to',\n [IVR_NODE_TRANSFER]: 'Transfer',\n [IVR_NODE_HANGUP]: 'Hangup',\n [IVR_NODE_ASSIGN]: 'Assign',\n [IVR_NODE_CUSTOMER_DATA]: 'Customer Data',\n};\n\nconst IVR_NODE_CLASSES = {\n PROMPT: {\n normal: 'd-recipe-ivr-node-prompt',\n selected: 'd-recipe-ivr-node-prompt--selected',\n },\n LOGIC: {\n normal: 'd-recipe-ivr-node-logic',\n selected: 'd-recipe-ivr-node-logic--selected',\n },\n TERMINAL: {\n normal: 'd-recipe-ivr-node-terminal',\n selected: 'd-recipe-ivr-node-terminal--selected',\n },\n};\n\nexport const IVR_NODE_CLASS_MAPPING = {\n [IVR_NODE_PROMPT_MENU]: IVR_NODE_CLASSES.PROMPT,\n [IVR_NODE_PROMPT_COLLECT]: IVR_NODE_CLASSES.PROMPT,\n [IVR_NODE_PROMPT_PLAY]: IVR_NODE_CLASSES.PROMPT,\n [IVR_NODE_EXPERT]: IVR_NODE_CLASSES.LOGIC,\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QAAQ;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,EACX;AAAA,EACD,OAAO;AAAA,IACL,QAAQ;AAAA,IACR,UAAU;AAAA,EACX;AAAA,EACD,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,EACX;AACH;AAEY,MAAC,yBAAyB;AAAA,EACpC,CAAC,oBAAoB,GAAG,iBAAiB;AAAA,EACzC,CAAC,uBAAuB,GAAG,iBAAiB;AAAA,EAC5C,CAAC,oBAAoB,GAAG,iBAAiB;AAAA,EACzC,CAAC,eAAe,GAAG,iBAAiB;AAAA,EACpC,CAAC,eAAe,GAAG,iBAAiB;AAAA,EACpC,CAAC,cAAc,GAAG,iBAAiB;AAAA,EACnC,CAAC,eAAe,GAAG,iBAAiB;AAAA,EACpC,CAAC,sBAAsB,GAAG,iBAAiB;AAAA,EAC3C,CAAC,iBAAiB,GAAG,iBAAiB;AAAA,EACtC,CAAC,eAAe,GAAG,iBAAiB;AACtC;;;;;;;;;;;;;;"}
|
|
@@ -7,6 +7,7 @@ const IVR_NODE_BRANCH = "branch";
|
|
|
7
7
|
const IVR_NODE_TRANSFER = "transfer";
|
|
8
8
|
const IVR_NODE_HANGUP = "hangup";
|
|
9
9
|
const IVR_NODE_ASSIGN = "assign";
|
|
10
|
+
const IVR_NODE_CUSTOMER_DATA = "customerdata";
|
|
10
11
|
const IVR_NODE_ICON_TYPES = {
|
|
11
12
|
[IVR_NODE_PROMPT_MENU]: "keypad",
|
|
12
13
|
[IVR_NODE_PROMPT_COLLECT]: "dialer",
|
|
@@ -15,6 +16,7 @@ const IVR_NODE_ICON_TYPES = {
|
|
|
15
16
|
[IVR_NODE_BRANCH]: "branch",
|
|
16
17
|
[IVR_NODE_GO_TO]: "call-merge",
|
|
17
18
|
[IVR_NODE_ASSIGN]: "chevrons-right",
|
|
19
|
+
[IVR_NODE_CUSTOMER_DATA]: "list-bullet",
|
|
18
20
|
[IVR_NODE_TRANSFER]: "transfer",
|
|
19
21
|
[IVR_NODE_HANGUP]: "phone-hang-up"
|
|
20
22
|
};
|
|
@@ -27,7 +29,8 @@ const IVR_NODE_LABELS = {
|
|
|
27
29
|
[IVR_NODE_GO_TO]: "Go-to",
|
|
28
30
|
[IVR_NODE_TRANSFER]: "Transfer",
|
|
29
31
|
[IVR_NODE_HANGUP]: "Hangup",
|
|
30
|
-
[IVR_NODE_ASSIGN]: "Assign"
|
|
32
|
+
[IVR_NODE_ASSIGN]: "Assign",
|
|
33
|
+
[IVR_NODE_CUSTOMER_DATA]: "Customer Data"
|
|
31
34
|
};
|
|
32
35
|
const IVR_NODE_CLASSES = {
|
|
33
36
|
PROMPT: {
|
|
@@ -51,6 +54,7 @@ const IVR_NODE_CLASS_MAPPING = {
|
|
|
51
54
|
[IVR_NODE_BRANCH]: IVR_NODE_CLASSES.LOGIC,
|
|
52
55
|
[IVR_NODE_GO_TO]: IVR_NODE_CLASSES.LOGIC,
|
|
53
56
|
[IVR_NODE_ASSIGN]: IVR_NODE_CLASSES.LOGIC,
|
|
57
|
+
[IVR_NODE_CUSTOMER_DATA]: IVR_NODE_CLASSES.LOGIC,
|
|
54
58
|
[IVR_NODE_TRANSFER]: IVR_NODE_CLASSES.TERMINAL,
|
|
55
59
|
[IVR_NODE_HANGUP]: IVR_NODE_CLASSES.TERMINAL
|
|
56
60
|
};
|
|
@@ -58,6 +62,7 @@ export {
|
|
|
58
62
|
IVR_NODE_ASSIGN,
|
|
59
63
|
IVR_NODE_BRANCH,
|
|
60
64
|
IVR_NODE_CLASS_MAPPING,
|
|
65
|
+
IVR_NODE_CUSTOMER_DATA,
|
|
61
66
|
IVR_NODE_EXPERT,
|
|
62
67
|
IVR_NODE_GO_TO,
|
|
63
68
|
IVR_NODE_HANGUP,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ivr_node_constants.js","sources":["../../../../recipes/cards/ivr_node/ivr_node_constants.js"],"sourcesContent":["export const IVR_NODE_PROMPT_MENU = 'promptmenu';\nexport const IVR_NODE_PROMPT_COLLECT = 'promptcollect';\nexport const IVR_NODE_PROMPT_PLAY = 'promptplay';\nexport const IVR_NODE_EXPERT = 'gotoexpert';\nexport const IVR_NODE_GO_TO = 'goto';\nexport const IVR_NODE_BRANCH = 'branch';\nexport const IVR_NODE_TRANSFER = 'transfer';\nexport const IVR_NODE_HANGUP = 'hangup';\nexport const IVR_NODE_ASSIGN = 'assign';\n\nexport const IVR_NODE_ICON_TYPES = {\n [IVR_NODE_PROMPT_MENU]: 'keypad',\n [IVR_NODE_PROMPT_COLLECT]: 'dialer',\n [IVR_NODE_PROMPT_PLAY]: 'volume-2',\n [IVR_NODE_EXPERT]: 'expert-node',\n [IVR_NODE_BRANCH]: 'branch',\n [IVR_NODE_GO_TO]: 'call-merge',\n [IVR_NODE_ASSIGN]: 'chevrons-right',\n [IVR_NODE_TRANSFER]: 'transfer',\n [IVR_NODE_HANGUP]: 'phone-hang-up',\n};\n\nexport const IVR_NODE_LABELS = {\n [IVR_NODE_PROMPT_MENU]: 'Menu',\n [IVR_NODE_PROMPT_COLLECT]: 'Collect',\n [IVR_NODE_PROMPT_PLAY]: 'Play',\n [IVR_NODE_EXPERT]: 'Expert',\n [IVR_NODE_BRANCH]: 'Branch',\n [IVR_NODE_GO_TO]: 'Go-to',\n [IVR_NODE_TRANSFER]: 'Transfer',\n [IVR_NODE_HANGUP]: 'Hangup',\n [IVR_NODE_ASSIGN]: 'Assign',\n};\n\nconst IVR_NODE_CLASSES = {\n PROMPT: {\n normal: 'd-recipe-ivr-node-prompt',\n selected: 'd-recipe-ivr-node-prompt--selected',\n },\n LOGIC: {\n normal: 'd-recipe-ivr-node-logic',\n selected: 'd-recipe-ivr-node-logic--selected',\n },\n TERMINAL: {\n normal: 'd-recipe-ivr-node-terminal',\n selected: 'd-recipe-ivr-node-terminal--selected',\n },\n};\n\nexport const IVR_NODE_CLASS_MAPPING = {\n [IVR_NODE_PROMPT_MENU]: IVR_NODE_CLASSES.PROMPT,\n [IVR_NODE_PROMPT_COLLECT]: IVR_NODE_CLASSES.PROMPT,\n [IVR_NODE_PROMPT_PLAY]: IVR_NODE_CLASSES.PROMPT,\n [IVR_NODE_EXPERT]: IVR_NODE_CLASSES.LOGIC,\n [IVR_NODE_BRANCH]: IVR_NODE_CLASSES.LOGIC,\n [IVR_NODE_GO_TO]: IVR_NODE_CLASSES.LOGIC,\n [IVR_NODE_ASSIGN]: IVR_NODE_CLASSES.LOGIC,\n [IVR_NODE_TRANSFER]: IVR_NODE_CLASSES.TERMINAL,\n [IVR_NODE_HANGUP]: IVR_NODE_CLASSES.TERMINAL,\n};\n"],"names":[],"mappings":"AAAY,MAAC,uBAAuB;AACxB,MAAC,0BAA0B;AAC3B,MAAC,uBAAuB;AACxB,MAAC,kBAAkB;AACnB,MAAC,iBAAiB;AAClB,MAAC,kBAAkB;AACnB,MAAC,oBAAoB;AACrB,MAAC,kBAAkB;AACnB,MAAC,kBAAkB;
|
|
1
|
+
{"version":3,"file":"ivr_node_constants.js","sources":["../../../../recipes/cards/ivr_node/ivr_node_constants.js"],"sourcesContent":["export const IVR_NODE_PROMPT_MENU = 'promptmenu';\nexport const IVR_NODE_PROMPT_COLLECT = 'promptcollect';\nexport const IVR_NODE_PROMPT_PLAY = 'promptplay';\nexport const IVR_NODE_EXPERT = 'gotoexpert';\nexport const IVR_NODE_GO_TO = 'goto';\nexport const IVR_NODE_BRANCH = 'branch';\nexport const IVR_NODE_TRANSFER = 'transfer';\nexport const IVR_NODE_HANGUP = 'hangup';\nexport const IVR_NODE_ASSIGN = 'assign';\nexport const IVR_NODE_CUSTOMER_DATA = 'customerdata';\n\nexport const IVR_NODE_ICON_TYPES = {\n [IVR_NODE_PROMPT_MENU]: 'keypad',\n [IVR_NODE_PROMPT_COLLECT]: 'dialer',\n [IVR_NODE_PROMPT_PLAY]: 'volume-2',\n [IVR_NODE_EXPERT]: 'expert-node',\n [IVR_NODE_BRANCH]: 'branch',\n [IVR_NODE_GO_TO]: 'call-merge',\n [IVR_NODE_ASSIGN]: 'chevrons-right',\n [IVR_NODE_CUSTOMER_DATA]: 'list-bullet',\n [IVR_NODE_TRANSFER]: 'transfer',\n [IVR_NODE_HANGUP]: 'phone-hang-up',\n};\n\nexport const IVR_NODE_LABELS = {\n [IVR_NODE_PROMPT_MENU]: 'Menu',\n [IVR_NODE_PROMPT_COLLECT]: 'Collect',\n [IVR_NODE_PROMPT_PLAY]: 'Play',\n [IVR_NODE_EXPERT]: 'Expert',\n [IVR_NODE_BRANCH]: 'Branch',\n [IVR_NODE_GO_TO]: 'Go-to',\n [IVR_NODE_TRANSFER]: 'Transfer',\n [IVR_NODE_HANGUP]: 'Hangup',\n [IVR_NODE_ASSIGN]: 'Assign',\n [IVR_NODE_CUSTOMER_DATA]: 'Customer Data',\n};\n\nconst IVR_NODE_CLASSES = {\n PROMPT: {\n normal: 'd-recipe-ivr-node-prompt',\n selected: 'd-recipe-ivr-node-prompt--selected',\n },\n LOGIC: {\n normal: 'd-recipe-ivr-node-logic',\n selected: 'd-recipe-ivr-node-logic--selected',\n },\n TERMINAL: {\n normal: 'd-recipe-ivr-node-terminal',\n selected: 'd-recipe-ivr-node-terminal--selected',\n },\n};\n\nexport const IVR_NODE_CLASS_MAPPING = {\n [IVR_NODE_PROMPT_MENU]: IVR_NODE_CLASSES.PROMPT,\n [IVR_NODE_PROMPT_COLLECT]: IVR_NODE_CLASSES.PROMPT,\n [IVR_NODE_PROMPT_PLAY]: IVR_NODE_CLASSES.PROMPT,\n [IVR_NODE_EXPERT]: IVR_NODE_CLASSES.LOGIC,\n [IVR_NODE_BRANCH]: IVR_NODE_CLASSES.LOGIC,\n [IVR_NODE_GO_TO]: IVR_NODE_CLASSES.LOGIC,\n [IVR_NODE_ASSIGN]: IVR_NODE_CLASSES.LOGIC,\n [IVR_NODE_CUSTOMER_DATA]: IVR_NODE_CLASSES.LOGIC,\n [IVR_NODE_TRANSFER]: IVR_NODE_CLASSES.TERMINAL,\n [IVR_NODE_HANGUP]: IVR_NODE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,GAAG,iBAAiB;AAAA,EAC5C,CAAC,oBAAoB,GAAG,iBAAiB;AAAA,EACzC,CAAC,eAAe,GAAG,iBAAiB;AAAA,EACpC,CAAC,eAAe,GAAG,iBAAiB;AAAA,EACpC,CAAC,cAAc,GAAG,iBAAiB;AAAA,EACnC,CAAC,eAAe,GAAG,iBAAiB;AAAA,EACpC,CAAC,sBAAsB,GAAG,iBAAiB;AAAA,EAC3C,CAAC,iBAAiB,GAAG,iBAAiB;AAAA,EACtC,CAAC,eAAe,GAAG,iBAAiB;AACtC;"}
|
|
@@ -571,7 +571,7 @@ var _sfc_render = function render() {
|
|
|
571
571
|
} }, _vm.$slots.header ? { key: "header", fn: function() {
|
|
572
572
|
return [_c("div", { ref: "header" }, [_vm._t("header")], 2)];
|
|
573
573
|
}, proxy: true } : null, { key: "list", fn: function() {
|
|
574
|
-
return [_c("div", { ref: "list", on: { "mousedown": function($event) {
|
|
574
|
+
return [_c("div", { ref: "list", staticClass: "d-recipe-combobox-multi-select__list", on: { "mousedown": function($event) {
|
|
575
575
|
$event.preventDefault();
|
|
576
576
|
} } }, [!_vm.loading ? _vm._t("list") : _c("div", { staticClass: "d-recipe-combobox-multi-select__list--loading" }, [_vm._v(" " + _vm._s(_vm.loadingMessage) + " ")])], 2)];
|
|
577
577
|
}, proxy: true }, _vm.$slots.footer ? { key: "footer", fn: function() {
|
package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox_multi_select.vue.cjs","sources":["../../../../recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-recipe-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :max-width=\"listMaxWidth\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n :visually-hidden-close=\"visuallyHiddenClose\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :transition=\"transition\"\n @select=\"onComboboxSelect\"\n @highlight=\"comboboxHighlight\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"d-recipe-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-recipe-combobox-multi-select__chip-wrapper', chipWrapperClass]\"\n >\n <dt-chip\n v-for=\"({ item, key }) in selectedItemsWithKeys\"\n ref=\"chips\"\n :key=\"key\"\n :label-class=\"['d-chip__label']\"\n :class=\"[\n 'd-recipe-combobox-multi-select__chip',\n { 'd-recipe-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :close-button-props=\"{ ariaLabel: 'close' }\"\n :size=\"CHIP_SIZES[size]\"\n v-on=\"chipListeners\"\n @keyup.backspace=\"onChipRemove(item)\"\n @close=\"onChipRemove(item)\"\n >\n {{ item }}\n </dt-chip>\n </span>\n\n <dt-input\n ref=\"input\"\n v-model=\"value\"\n class=\"d-recipe-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-recipe-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :aria-label=\"label\"\n :label=\"labelVisible ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-on=\"inputListeners\"\n @input=\"onInput\"\n />\n\n <dt-validation-messages\n :validation-messages=\"maxSelectedMessage\"\n :show-messages=\"showValidationMessages\"\n />\n </span>\n </template>\n\n <!-- @slot slot for popover header -->\n <template\n v-if=\"$slots.header\"\n #header\n >\n <div ref=\"header\">\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-recipe-combobox-multi-select__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"$slots.footer\"\n #footer\n >\n <div ref=\"footer\">\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-recipe-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtRecipeComboboxWithPopover from '@/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue';\nimport DtInput from '@/components/input/input.vue';\nimport DtChip from '@/components/chip/chip.vue';\nimport DtValidationMessages from '@/components/validation_messages/validation_messages.vue';\nimport { validationMessageValidator } from '@/common/validators';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/popover/popover_constants';\nimport {\n MULTI_SELECT_SIZES,\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './combobox_multi_select_constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport { getUniqueString } from '@/common/utils';\n\nexport default {\n name: 'DtRecipeComboboxMultiSelect',\n\n components: {\n DtRecipeComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n mixins: [SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n labelVisible: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Input placeholder\n */\n placeholder: {\n type: String,\n default: 'Select one or start typing',\n },\n\n /**\n * Input validation messages\n */\n inputMessages: {\n type: Array,\n default: () => [],\n validator: inputMessages => {\n return validationMessageValidator(inputMessages);\n },\n },\n\n /**\n * Show input validation message\n */\n showInputMessages: {\n type: Boolean,\n default: true,\n },\n\n // @TODO: https://dialpad.atlassian.net/browse/DP-52324\n // type: {\n // type: String,\n // values: ['input', 'select'],\n // default: 'select',\n // },\n\n /**\n * Determines if the list is loading\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The message when the list is loading\n */\n loadingMessage: {\n type: String,\n default: 'loading...',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxHeight: {\n type: String,\n default: '300px',\n },\n\n /**\n * The selected items\n */\n selectedItems: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Would be the maximum number of selections you can make. 0 is unlimited\n */\n maxSelected: {\n type: Number,\n default: 0,\n },\n\n /**\n * Max select message when the max selections is exceeded with the structure:\n * `[{\"message\": string, \"type\": VALIDATION_MESSAGE_TYPES }]`\n */\n maxSelectedMessage: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the chip, one of `xs`, `sm`, `md`\n */\n size: {\n type: String,\n default: 'md',\n validator: (t) => Object.values(MULTI_SELECT_SIZES).includes(t),\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * Determines whether the combobox should collapse to a single when losing focus.\n * @type {boolean}\n */\n collapseOnFocusOut: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Amount of reserved space (in px) on the right side of the input\n * before the chips and the input caret jump to the next line.\n * default is 64\n */\n reservedRightSpace: {\n type: Number,\n default: 64,\n },\n\n /**\n * Determines the maximum width of a single chip. If the text within this chip exceeds the value\n * it will be truncated with ellipses.\n * Possible units rem|px|em\n */\n chipMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the input element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n inputClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the input wrapper element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n inputWrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String }\n */\n 'input',\n\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when item removed\n *\n * @event remove\n * @type {String}\n */\n 'remove',\n\n /**\n * Event fired when max selected items limit is reached\n *\n * @event max-selected\n * @type {Object}\n */\n 'max-selected',\n\n /**\n * Native keyup event\n *\n * @event keyup\n * @type {KeyboardEvent}\n */\n 'keyup',\n\n /**\n * Event fired when combobox item is highlighted\n *\n * @event combobox-highlight\n * @type {Object}\n */\n 'combobox-highlight',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n resizeWindowObserver: null,\n initialInputHeight: null,\n CHIP_SIZES,\n inputFocused: false,\n hideInputText: false,\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n ...this.$listeners,\n keyup: event => {\n this.onChipKeyup(event);\n this.$emit('keyup', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...this.$listeners,\n input: event => {\n this.$emit('input', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n keyup: event => {\n this.onInputKeyup(event);\n this.$emit('keyup', event);\n },\n\n click: event => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n selectedItemsWithKeys () {\n return this.selectedItems.map(selectedItem => ({\n item: selectedItem,\n key: getUniqueString(selectedItem),\n }));\n },\n\n chipWrapperClass () {\n return {\n [`d-recipe-combobox-multi-select__chip-wrapper-${this.size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut,\n };\n },\n },\n\n watch: {\n selectedItems: {\n async handler () {\n this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n this.initSelectedItems();\n },\n },\n\n async label () {\n await this.$nextTick();\n // Adjust the chips position if label changed\n this.setChipsTopPosition();\n },\n\n async description () {\n await this.$nextTick();\n // Adjust the chips position if description changed\n this.setChipsTopPosition();\n },\n\n size: {\n async handler () {\n await this.$nextTick();\n const input = this.getInput();\n this.revertInputPadding(input);\n this.initialInputHeight = input.getBoundingClientRect().height;\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n mounted () {\n this.setInitialInputHeight();\n // Recalculate chip position and input padding when resizing window\n this.resizeWindowObserver = new ResizeObserver(async () => {\n this.setChipsTopPosition();\n this.setInputPadding();\n });\n this.resizeWindowObserver.observe(document.body);\n\n this.initSelectedItems();\n },\n\n beforeDestroy () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n comboboxHighlight (highlightIndex) {\n this.$emit('combobox-highlight', highlightIndex);\n },\n\n async initSelectedItems () {\n await this.$nextTick();\n this.setInputPadding();\n this.setChipsTopPosition();\n this.setInputMinWidth();\n this.checkMaxSelected();\n },\n\n onChipRemove (item) {\n this.$emit('remove', item);\n this.$refs.input?.focus();\n },\n\n onComboboxSelect (i) {\n if (this.loading) return;\n this.value = '';\n this.$emit('select', i);\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.showComboboxList();\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.closeComboboxList();\n },\n\n getChipButtons () {\n return this.$refs.chips && this.$refs.chips.map(chip => chip.$el.querySelector('button'));\n },\n\n getChips () {\n return this.$refs.chips && this.$refs.chips.map(chip => chip.$el);\n },\n\n getLastChipButton () {\n return this.$refs.chips && this.getChipButtons()[this.getChipButtons().length - 1];\n },\n\n getLastChip () {\n return this.$refs.chips && this.getChips()[this.getChips().length - 1];\n },\n\n getFirstChip () {\n return this.$refs.chips && this.getChips()[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyup (event) {\n const key = event.code?.toLowerCase();\n if (key === 'arrowleft') {\n // Move to the previous chip\n this.navigateBetweenChips(event.target, true);\n } else if (key === 'arrowright') {\n if (event.target.id === this.getLastChipButton().id) {\n // Move to the input if it's the last chip\n this.moveFromChipToInput();\n } else {\n // Move to the next chip\n this.navigateBetweenChips(event.target, false);\n }\n }\n },\n\n onInputKeyup (event) {\n const key = event.code?.toLowerCase();\n // If the cursor is at the start of the text,\n // press 'backspace' or 'left' focuses the last chip\n if (this.selectedItems.length > 0 && event.target.selectionStart === 0) {\n if (key === 'backspace' || key === 'arrowleft') {\n this.moveFromInputToChip();\n }\n }\n },\n\n moveFromInputToChip () {\n this.getLastChipButton().focus();\n this.$refs.input?.blur();\n this.closeComboboxList();\n },\n\n moveFromChipToInput () {\n this.getLastChipButton().blur();\n this.$refs.input?.focus();\n this.showComboboxList();\n },\n\n navigateBetweenChips (target, toLeft) {\n const from = this.getChipButtons().indexOf(target);\n const to = toLeft ? from - 1 : from + 1;\n if (to < 0 || to >= this.$refs.chips?.length) {\n return;\n }\n this.getChipButtons()[from].blur();\n this.getChipButtons()[to].focus();\n this.closeComboboxList();\n },\n\n setChipsTopPosition () {\n // To place the chips in the input box\n // The chip \"top\" position should be the same line as the input box\n const input = this.getInput();\n if (!input) return;\n const inputSlotWrapper = this.$refs.inputSlotWrapper;\n const top = input.getBoundingClientRect().top -\n inputSlotWrapper.getBoundingClientRect().top;\n const chipsWrapper = this.$refs.chipsWrapper;\n chipsWrapper.style.top = (top - CHIP_TOP_POSITION[this.size]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n const chipsWrapper = this.$refs.chipsWrapper;\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n // Avoid adding extra padding when the input is not focused if collapseOnFocusOut is true\n // This ensures the input returns to its original state when resizing\n if (this.collapseOnFocusOut && !this.inputFocused) return;\n\n // Get the position of the last chip\n // The input cursor should be the same \"top\" as that chip and next besides it\n const left = lastChip.offsetLeft + this.getFullWidth(lastChip);\n const spaceLeft = input.getBoundingClientRect().width - left;\n // input.style.paddingLeft = left + 'px';\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingLeft = left + 'px';\n } else {\n input.style.paddingLeft = '4px';\n }\n\n // Get the chip wrapper height minus the 4px padding\n const chipsWrapperHeight = chipsWrapper.getBoundingClientRect().height - 4;\n const lastChipHeight = lastChip.getBoundingClientRect().height - 4;\n\n // Get lastChip offsetTop plus 2px of the input padding.\n const top = spaceLeft > this.reservedRightSpace\n ? lastChip.offsetTop + 2\n : (chipsWrapperHeight + lastChipHeight - 9);\n\n input.style.paddingTop = `${top}px`;\n },\n\n revertInputPadding (input) {\n input.style.paddingLeft = '';\n input.style.paddingTop = '';\n input.style.paddingBottom = '';\n },\n\n getFullWidth (el) {\n const styles = window.getComputedStyle(el);\n return el.offsetWidth + parseInt(styles.marginLeft) + parseInt(styles.marginRight);\n },\n\n setInputMinWidth () {\n // Ensure the width of the input is \"slightly bigger\" than the width of a single chip\n const firstChip = this.getFirstChip();\n const input = this.getInput();\n if (!input) return;\n if (firstChip) {\n // Add 4px buffer for typing room\n input.style.minWidth = (this.getFullWidth(firstChip) + 4) + 'px';\n } else {\n input.style.minWidth = '';\n }\n },\n\n checkMaxSelected () {\n if (this.maxSelected === 0) return;\n if (this.selectedItems.length > this.maxSelected) {\n this.showValidationMessages = true;\n this.$emit('max-selected');\n } else {\n this.showValidationMessages = false;\n }\n },\n\n setInitialInputHeight () {\n const input = this.getInput();\n if (!input) return;\n this.initialInputHeight = input.getBoundingClientRect().height;\n },\n\n async handleInputFocusIn () {\n this.inputFocused = true;\n if (this.collapseOnFocusOut) {\n await this.$nextTick();\n this.setInputPadding();\n this.hideInputText = false;\n }\n },\n\n async handleInputFocusOut () {\n this.inputFocused = false;\n if (this.collapseOnFocusOut) {\n const input = this.getInput();\n if (!input) return;\n // Hide the input text when is not on first line\n if (!input.style.paddingTop) {\n return;\n }\n this.hideInputText = true;\n this.revertInputPadding(input);\n }\n },\n },\n};\n</script>\n"],"names":["DtRecipeComboboxWithPopover","DtInput","DtChip","DtValidationMessages","SrOnlyCloseButtonMixin","validationMessageValidator","MULTI_SELECT_SIZES","POPOVER_APPEND_TO_VALUES","CHIP_SIZES","getUniqueString","input","chip","CHIP_TOP_POSITION"],"mappings":";;;;;;;;;;;;AAuIA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,6BAAAA,sBAAA;AAAA,IACA,SAAAC,MAAA;AAAA,IACA,QAAAC,KAAA;AAAA,IACA,sBAAAC,oBAAA;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,qBAAAA,OAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA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AA;AACA;AAAA,QACA;AACA,aAAA,gBAAA;AACA,aAAA,mBAAAA,MAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"combobox_multi_select.vue.cjs","sources":["../../../../recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-recipe-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :max-width=\"listMaxWidth\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n :visually-hidden-close=\"visuallyHiddenClose\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :transition=\"transition\"\n @select=\"onComboboxSelect\"\n @highlight=\"comboboxHighlight\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"d-recipe-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-recipe-combobox-multi-select__chip-wrapper', chipWrapperClass]\"\n >\n <dt-chip\n v-for=\"({ item, key }) in selectedItemsWithKeys\"\n ref=\"chips\"\n :key=\"key\"\n :label-class=\"['d-chip__label']\"\n :class=\"[\n 'd-recipe-combobox-multi-select__chip',\n { 'd-recipe-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :close-button-props=\"{ ariaLabel: 'close' }\"\n :size=\"CHIP_SIZES[size]\"\n v-on=\"chipListeners\"\n @keyup.backspace=\"onChipRemove(item)\"\n @close=\"onChipRemove(item)\"\n >\n {{ item }}\n </dt-chip>\n </span>\n\n <dt-input\n ref=\"input\"\n v-model=\"value\"\n class=\"d-recipe-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-recipe-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :aria-label=\"label\"\n :label=\"labelVisible ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-on=\"inputListeners\"\n @input=\"onInput\"\n />\n\n <dt-validation-messages\n :validation-messages=\"maxSelectedMessage\"\n :show-messages=\"showValidationMessages\"\n />\n </span>\n </template>\n\n <!-- @slot slot for popover header -->\n <template\n v-if=\"$slots.header\"\n #header\n >\n <div ref=\"header\">\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n class=\"d-recipe-combobox-multi-select__list\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-recipe-combobox-multi-select__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"$slots.footer\"\n #footer\n >\n <div ref=\"footer\">\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-recipe-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtRecipeComboboxWithPopover from '@/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue';\nimport DtInput from '@/components/input/input.vue';\nimport DtChip from '@/components/chip/chip.vue';\nimport DtValidationMessages from '@/components/validation_messages/validation_messages.vue';\nimport { validationMessageValidator } from '@/common/validators';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/popover/popover_constants';\nimport {\n MULTI_SELECT_SIZES,\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './combobox_multi_select_constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport { getUniqueString } from '@/common/utils';\n\nexport default {\n name: 'DtRecipeComboboxMultiSelect',\n\n components: {\n DtRecipeComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n mixins: [SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n labelVisible: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Input placeholder\n */\n placeholder: {\n type: String,\n default: 'Select one or start typing',\n },\n\n /**\n * Input validation messages\n */\n inputMessages: {\n type: Array,\n default: () => [],\n validator: inputMessages => {\n return validationMessageValidator(inputMessages);\n },\n },\n\n /**\n * Show input validation message\n */\n showInputMessages: {\n type: Boolean,\n default: true,\n },\n\n // @TODO: https://dialpad.atlassian.net/browse/DP-52324\n // type: {\n // type: String,\n // values: ['input', 'select'],\n // default: 'select',\n // },\n\n /**\n * Determines if the list is loading\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The message when the list is loading\n */\n loadingMessage: {\n type: String,\n default: 'loading...',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxHeight: {\n type: String,\n default: '300px',\n },\n\n /**\n * The selected items\n */\n selectedItems: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Would be the maximum number of selections you can make. 0 is unlimited\n */\n maxSelected: {\n type: Number,\n default: 0,\n },\n\n /**\n * Max select message when the max selections is exceeded with the structure:\n * `[{\"message\": string, \"type\": VALIDATION_MESSAGE_TYPES }]`\n */\n maxSelectedMessage: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the chip, one of `xs`, `sm`, `md`\n */\n size: {\n type: String,\n default: 'md',\n validator: (t) => Object.values(MULTI_SELECT_SIZES).includes(t),\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * Determines whether the combobox should collapse to a single when losing focus.\n * @type {boolean}\n */\n collapseOnFocusOut: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Amount of reserved space (in px) on the right side of the input\n * before the chips and the input caret jump to the next line.\n * default is 64\n */\n reservedRightSpace: {\n type: Number,\n default: 64,\n },\n\n /**\n * Determines the maximum width of a single chip. If the text within this chip exceeds the value\n * it will be truncated with ellipses.\n * Possible units rem|px|em\n */\n chipMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the input element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n inputClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the input wrapper element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n inputWrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String }\n */\n 'input',\n\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when item removed\n *\n * @event remove\n * @type {String}\n */\n 'remove',\n\n /**\n * Event fired when max selected items limit is reached\n *\n * @event max-selected\n * @type {Object}\n */\n 'max-selected',\n\n /**\n * Native keyup event\n *\n * @event keyup\n * @type {KeyboardEvent}\n */\n 'keyup',\n\n /**\n * Event fired when combobox item is highlighted\n *\n * @event combobox-highlight\n * @type {Object}\n */\n 'combobox-highlight',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n resizeWindowObserver: null,\n initialInputHeight: null,\n CHIP_SIZES,\n inputFocused: false,\n hideInputText: false,\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n ...this.$listeners,\n keyup: event => {\n this.onChipKeyup(event);\n this.$emit('keyup', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...this.$listeners,\n input: event => {\n this.$emit('input', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n keyup: event => {\n this.onInputKeyup(event);\n this.$emit('keyup', event);\n },\n\n click: event => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n selectedItemsWithKeys () {\n return this.selectedItems.map(selectedItem => ({\n item: selectedItem,\n key: getUniqueString(selectedItem),\n }));\n },\n\n chipWrapperClass () {\n return {\n [`d-recipe-combobox-multi-select__chip-wrapper-${this.size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut,\n };\n },\n },\n\n watch: {\n selectedItems: {\n async handler () {\n this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n this.initSelectedItems();\n },\n },\n\n async label () {\n await this.$nextTick();\n // Adjust the chips position if label changed\n this.setChipsTopPosition();\n },\n\n async description () {\n await this.$nextTick();\n // Adjust the chips position if description changed\n this.setChipsTopPosition();\n },\n\n size: {\n async handler () {\n await this.$nextTick();\n const input = this.getInput();\n this.revertInputPadding(input);\n this.initialInputHeight = input.getBoundingClientRect().height;\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n mounted () {\n this.setInitialInputHeight();\n // Recalculate chip position and input padding when resizing window\n this.resizeWindowObserver = new ResizeObserver(async () => {\n this.setChipsTopPosition();\n this.setInputPadding();\n });\n this.resizeWindowObserver.observe(document.body);\n\n this.initSelectedItems();\n },\n\n beforeDestroy () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n comboboxHighlight (highlightIndex) {\n this.$emit('combobox-highlight', highlightIndex);\n },\n\n async initSelectedItems () {\n await this.$nextTick();\n this.setInputPadding();\n this.setChipsTopPosition();\n this.setInputMinWidth();\n this.checkMaxSelected();\n },\n\n onChipRemove (item) {\n this.$emit('remove', item);\n this.$refs.input?.focus();\n },\n\n onComboboxSelect (i) {\n if (this.loading) return;\n this.value = '';\n this.$emit('select', i);\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.showComboboxList();\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.closeComboboxList();\n },\n\n getChipButtons () {\n return this.$refs.chips && this.$refs.chips.map(chip => chip.$el.querySelector('button'));\n },\n\n getChips () {\n return this.$refs.chips && this.$refs.chips.map(chip => chip.$el);\n },\n\n getLastChipButton () {\n return this.$refs.chips && this.getChipButtons()[this.getChipButtons().length - 1];\n },\n\n getLastChip () {\n return this.$refs.chips && this.getChips()[this.getChips().length - 1];\n },\n\n getFirstChip () {\n return this.$refs.chips && this.getChips()[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyup (event) {\n const key = event.code?.toLowerCase();\n if (key === 'arrowleft') {\n // Move to the previous chip\n this.navigateBetweenChips(event.target, true);\n } else if (key === 'arrowright') {\n if (event.target.id === this.getLastChipButton().id) {\n // Move to the input if it's the last chip\n this.moveFromChipToInput();\n } else {\n // Move to the next chip\n this.navigateBetweenChips(event.target, false);\n }\n }\n },\n\n onInputKeyup (event) {\n const key = event.code?.toLowerCase();\n // If the cursor is at the start of the text,\n // press 'backspace' or 'left' focuses the last chip\n if (this.selectedItems.length > 0 && event.target.selectionStart === 0) {\n if (key === 'backspace' || key === 'arrowleft') {\n this.moveFromInputToChip();\n }\n }\n },\n\n moveFromInputToChip () {\n this.getLastChipButton().focus();\n this.$refs.input?.blur();\n this.closeComboboxList();\n },\n\n moveFromChipToInput () {\n this.getLastChipButton().blur();\n this.$refs.input?.focus();\n this.showComboboxList();\n },\n\n navigateBetweenChips (target, toLeft) {\n const from = this.getChipButtons().indexOf(target);\n const to = toLeft ? from - 1 : from + 1;\n if (to < 0 || to >= this.$refs.chips?.length) {\n return;\n }\n this.getChipButtons()[from].blur();\n this.getChipButtons()[to].focus();\n this.closeComboboxList();\n },\n\n setChipsTopPosition () {\n // To place the chips in the input box\n // The chip \"top\" position should be the same line as the input box\n const input = this.getInput();\n if (!input) return;\n const inputSlotWrapper = this.$refs.inputSlotWrapper;\n const top = input.getBoundingClientRect().top -\n inputSlotWrapper.getBoundingClientRect().top;\n const chipsWrapper = this.$refs.chipsWrapper;\n chipsWrapper.style.top = (top - CHIP_TOP_POSITION[this.size]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n const chipsWrapper = this.$refs.chipsWrapper;\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n // Avoid adding extra padding when the input is not focused if collapseOnFocusOut is true\n // This ensures the input returns to its original state when resizing\n if (this.collapseOnFocusOut && !this.inputFocused) return;\n\n // Get the position of the last chip\n // The input cursor should be the same \"top\" as that chip and next besides it\n const left = lastChip.offsetLeft + this.getFullWidth(lastChip);\n const spaceLeft = input.getBoundingClientRect().width - left;\n // input.style.paddingLeft = left + 'px';\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingLeft = left + 'px';\n } else {\n input.style.paddingLeft = '4px';\n }\n\n // Get the chip wrapper height minus the 4px padding\n const chipsWrapperHeight = chipsWrapper.getBoundingClientRect().height - 4;\n const lastChipHeight = lastChip.getBoundingClientRect().height - 4;\n\n // Get lastChip offsetTop plus 2px of the input padding.\n const top = spaceLeft > this.reservedRightSpace\n ? lastChip.offsetTop + 2\n : (chipsWrapperHeight + lastChipHeight - 9);\n\n input.style.paddingTop = `${top}px`;\n },\n\n revertInputPadding (input) {\n input.style.paddingLeft = '';\n input.style.paddingTop = '';\n input.style.paddingBottom = '';\n },\n\n getFullWidth (el) {\n const styles = window.getComputedStyle(el);\n return el.offsetWidth + parseInt(styles.marginLeft) + parseInt(styles.marginRight);\n },\n\n setInputMinWidth () {\n // Ensure the width of the input is \"slightly bigger\" than the width of a single chip\n const firstChip = this.getFirstChip();\n const input = this.getInput();\n if (!input) return;\n if (firstChip) {\n // Add 4px buffer for typing room\n input.style.minWidth = (this.getFullWidth(firstChip) + 4) + 'px';\n } else {\n input.style.minWidth = '';\n }\n },\n\n checkMaxSelected () {\n if (this.maxSelected === 0) return;\n if (this.selectedItems.length > this.maxSelected) {\n this.showValidationMessages = true;\n this.$emit('max-selected');\n } else {\n this.showValidationMessages = false;\n }\n },\n\n setInitialInputHeight () {\n const input = this.getInput();\n if (!input) return;\n this.initialInputHeight = input.getBoundingClientRect().height;\n },\n\n async handleInputFocusIn () {\n this.inputFocused = true;\n if (this.collapseOnFocusOut) {\n await this.$nextTick();\n this.setInputPadding();\n this.hideInputText = false;\n }\n },\n\n async handleInputFocusOut () {\n this.inputFocused = false;\n if (this.collapseOnFocusOut) {\n const input = this.getInput();\n if (!input) return;\n // Hide the input text when is not on first line\n if (!input.style.paddingTop) {\n return;\n }\n this.hideInputText = true;\n this.revertInputPadding(input);\n }\n },\n },\n};\n</script>\n"],"names":["DtRecipeComboboxWithPopover","DtInput","DtChip","DtValidationMessages","SrOnlyCloseButtonMixin","validationMessageValidator","MULTI_SELECT_SIZES","POPOVER_APPEND_TO_VALUES","CHIP_SIZES","getUniqueString","input","chip","CHIP_TOP_POSITION"],"mappings":";;;;;;;;;;;;AAwIA,MAAA,YAAA;AAAA,EACA,M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,aAAA,MAAA,cAAA;AAAA,MACA,OAAA;AACA,aAAA,yBAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,wBAAA;AACA,YAAAA,SAAA,KAAA;AACA,UAAA,CAAAA,OAAA;AACA,WAAA,qBAAAA,OAAA,sBAAA,EAAA;AAAA,IACA;AAAA,IAEA,MAAA,qBAAA;AACA,WAAA,eAAA;AACA,UAAA,KAAA,oBAAA;AACA,cAAA,KAAA;AACA,aAAA,gBAAA;AACA,aAAA,gBAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,MAAA,sBAAA;AACA,WAAA,eAAA;AACA,UAAA,KAAA,oBAAA;AACA,cAAAA,SAAA,KAAA;AACA,YAAA,CAAAA,OAAA;AAEA,YAAA,CAAAA,OAAA,MAAA,YAAA;AACA;AAAA,QACA;AACA,aAAA,gBAAA;AACA,aAAA,mBAAAA,MAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -569,7 +569,7 @@ var _sfc_render = function render() {
|
|
|
569
569
|
} }, _vm.$slots.header ? { key: "header", fn: function() {
|
|
570
570
|
return [_c("div", { ref: "header" }, [_vm._t("header")], 2)];
|
|
571
571
|
}, proxy: true } : null, { key: "list", fn: function() {
|
|
572
|
-
return [_c("div", { ref: "list", on: { "mousedown": function($event) {
|
|
572
|
+
return [_c("div", { ref: "list", staticClass: "d-recipe-combobox-multi-select__list", on: { "mousedown": function($event) {
|
|
573
573
|
$event.preventDefault();
|
|
574
574
|
} } }, [!_vm.loading ? _vm._t("list") : _c("div", { staticClass: "d-recipe-combobox-multi-select__list--loading" }, [_vm._v(" " + _vm._s(_vm.loadingMessage) + " ")])], 2)];
|
|
575
575
|
}, proxy: true }, _vm.$slots.footer ? { key: "footer", fn: function() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox_multi_select.vue.js","sources":["../../../../recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-recipe-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :max-width=\"listMaxWidth\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n :visually-hidden-close=\"visuallyHiddenClose\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :transition=\"transition\"\n @select=\"onComboboxSelect\"\n @highlight=\"comboboxHighlight\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"d-recipe-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-recipe-combobox-multi-select__chip-wrapper', chipWrapperClass]\"\n >\n <dt-chip\n v-for=\"({ item, key }) in selectedItemsWithKeys\"\n ref=\"chips\"\n :key=\"key\"\n :label-class=\"['d-chip__label']\"\n :class=\"[\n 'd-recipe-combobox-multi-select__chip',\n { 'd-recipe-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :close-button-props=\"{ ariaLabel: 'close' }\"\n :size=\"CHIP_SIZES[size]\"\n v-on=\"chipListeners\"\n @keyup.backspace=\"onChipRemove(item)\"\n @close=\"onChipRemove(item)\"\n >\n {{ item }}\n </dt-chip>\n </span>\n\n <dt-input\n ref=\"input\"\n v-model=\"value\"\n class=\"d-recipe-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-recipe-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :aria-label=\"label\"\n :label=\"labelVisible ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-on=\"inputListeners\"\n @input=\"onInput\"\n />\n\n <dt-validation-messages\n :validation-messages=\"maxSelectedMessage\"\n :show-messages=\"showValidationMessages\"\n />\n </span>\n </template>\n\n <!-- @slot slot for popover header -->\n <template\n v-if=\"$slots.header\"\n #header\n >\n <div ref=\"header\">\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-recipe-combobox-multi-select__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"$slots.footer\"\n #footer\n >\n <div ref=\"footer\">\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-recipe-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtRecipeComboboxWithPopover from '@/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue';\nimport DtInput from '@/components/input/input.vue';\nimport DtChip from '@/components/chip/chip.vue';\nimport DtValidationMessages from '@/components/validation_messages/validation_messages.vue';\nimport { validationMessageValidator } from '@/common/validators';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/popover/popover_constants';\nimport {\n MULTI_SELECT_SIZES,\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './combobox_multi_select_constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport { getUniqueString } from '@/common/utils';\n\nexport default {\n name: 'DtRecipeComboboxMultiSelect',\n\n components: {\n DtRecipeComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n mixins: [SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n labelVisible: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Input placeholder\n */\n placeholder: {\n type: String,\n default: 'Select one or start typing',\n },\n\n /**\n * Input validation messages\n */\n inputMessages: {\n type: Array,\n default: () => [],\n validator: inputMessages => {\n return validationMessageValidator(inputMessages);\n },\n },\n\n /**\n * Show input validation message\n */\n showInputMessages: {\n type: Boolean,\n default: true,\n },\n\n // @TODO: https://dialpad.atlassian.net/browse/DP-52324\n // type: {\n // type: String,\n // values: ['input', 'select'],\n // default: 'select',\n // },\n\n /**\n * Determines if the list is loading\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The message when the list is loading\n */\n loadingMessage: {\n type: String,\n default: 'loading...',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxHeight: {\n type: String,\n default: '300px',\n },\n\n /**\n * The selected items\n */\n selectedItems: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Would be the maximum number of selections you can make. 0 is unlimited\n */\n maxSelected: {\n type: Number,\n default: 0,\n },\n\n /**\n * Max select message when the max selections is exceeded with the structure:\n * `[{\"message\": string, \"type\": VALIDATION_MESSAGE_TYPES }]`\n */\n maxSelectedMessage: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the chip, one of `xs`, `sm`, `md`\n */\n size: {\n type: String,\n default: 'md',\n validator: (t) => Object.values(MULTI_SELECT_SIZES).includes(t),\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * Determines whether the combobox should collapse to a single when losing focus.\n * @type {boolean}\n */\n collapseOnFocusOut: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Amount of reserved space (in px) on the right side of the input\n * before the chips and the input caret jump to the next line.\n * default is 64\n */\n reservedRightSpace: {\n type: Number,\n default: 64,\n },\n\n /**\n * Determines the maximum width of a single chip. If the text within this chip exceeds the value\n * it will be truncated with ellipses.\n * Possible units rem|px|em\n */\n chipMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the input element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n inputClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the input wrapper element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n inputWrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String }\n */\n 'input',\n\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when item removed\n *\n * @event remove\n * @type {String}\n */\n 'remove',\n\n /**\n * Event fired when max selected items limit is reached\n *\n * @event max-selected\n * @type {Object}\n */\n 'max-selected',\n\n /**\n * Native keyup event\n *\n * @event keyup\n * @type {KeyboardEvent}\n */\n 'keyup',\n\n /**\n * Event fired when combobox item is highlighted\n *\n * @event combobox-highlight\n * @type {Object}\n */\n 'combobox-highlight',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n resizeWindowObserver: null,\n initialInputHeight: null,\n CHIP_SIZES,\n inputFocused: false,\n hideInputText: false,\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n ...this.$listeners,\n keyup: event => {\n this.onChipKeyup(event);\n this.$emit('keyup', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...this.$listeners,\n input: event => {\n this.$emit('input', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n keyup: event => {\n this.onInputKeyup(event);\n this.$emit('keyup', event);\n },\n\n click: event => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n selectedItemsWithKeys () {\n return this.selectedItems.map(selectedItem => ({\n item: selectedItem,\n key: getUniqueString(selectedItem),\n }));\n },\n\n chipWrapperClass () {\n return {\n [`d-recipe-combobox-multi-select__chip-wrapper-${this.size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut,\n };\n },\n },\n\n watch: {\n selectedItems: {\n async handler () {\n this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n this.initSelectedItems();\n },\n },\n\n async label () {\n await this.$nextTick();\n // Adjust the chips position if label changed\n this.setChipsTopPosition();\n },\n\n async description () {\n await this.$nextTick();\n // Adjust the chips position if description changed\n this.setChipsTopPosition();\n },\n\n size: {\n async handler () {\n await this.$nextTick();\n const input = this.getInput();\n this.revertInputPadding(input);\n this.initialInputHeight = input.getBoundingClientRect().height;\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n mounted () {\n this.setInitialInputHeight();\n // Recalculate chip position and input padding when resizing window\n this.resizeWindowObserver = new ResizeObserver(async () => {\n this.setChipsTopPosition();\n this.setInputPadding();\n });\n this.resizeWindowObserver.observe(document.body);\n\n this.initSelectedItems();\n },\n\n beforeDestroy () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n comboboxHighlight (highlightIndex) {\n this.$emit('combobox-highlight', highlightIndex);\n },\n\n async initSelectedItems () {\n await this.$nextTick();\n this.setInputPadding();\n this.setChipsTopPosition();\n this.setInputMinWidth();\n this.checkMaxSelected();\n },\n\n onChipRemove (item) {\n this.$emit('remove', item);\n this.$refs.input?.focus();\n },\n\n onComboboxSelect (i) {\n if (this.loading) return;\n this.value = '';\n this.$emit('select', i);\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.showComboboxList();\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.closeComboboxList();\n },\n\n getChipButtons () {\n return this.$refs.chips && this.$refs.chips.map(chip => chip.$el.querySelector('button'));\n },\n\n getChips () {\n return this.$refs.chips && this.$refs.chips.map(chip => chip.$el);\n },\n\n getLastChipButton () {\n return this.$refs.chips && this.getChipButtons()[this.getChipButtons().length - 1];\n },\n\n getLastChip () {\n return this.$refs.chips && this.getChips()[this.getChips().length - 1];\n },\n\n getFirstChip () {\n return this.$refs.chips && this.getChips()[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyup (event) {\n const key = event.code?.toLowerCase();\n if (key === 'arrowleft') {\n // Move to the previous chip\n this.navigateBetweenChips(event.target, true);\n } else if (key === 'arrowright') {\n if (event.target.id === this.getLastChipButton().id) {\n // Move to the input if it's the last chip\n this.moveFromChipToInput();\n } else {\n // Move to the next chip\n this.navigateBetweenChips(event.target, false);\n }\n }\n },\n\n onInputKeyup (event) {\n const key = event.code?.toLowerCase();\n // If the cursor is at the start of the text,\n // press 'backspace' or 'left' focuses the last chip\n if (this.selectedItems.length > 0 && event.target.selectionStart === 0) {\n if (key === 'backspace' || key === 'arrowleft') {\n this.moveFromInputToChip();\n }\n }\n },\n\n moveFromInputToChip () {\n this.getLastChipButton().focus();\n this.$refs.input?.blur();\n this.closeComboboxList();\n },\n\n moveFromChipToInput () {\n this.getLastChipButton().blur();\n this.$refs.input?.focus();\n this.showComboboxList();\n },\n\n navigateBetweenChips (target, toLeft) {\n const from = this.getChipButtons().indexOf(target);\n const to = toLeft ? from - 1 : from + 1;\n if (to < 0 || to >= this.$refs.chips?.length) {\n return;\n }\n this.getChipButtons()[from].blur();\n this.getChipButtons()[to].focus();\n this.closeComboboxList();\n },\n\n setChipsTopPosition () {\n // To place the chips in the input box\n // The chip \"top\" position should be the same line as the input box\n const input = this.getInput();\n if (!input) return;\n const inputSlotWrapper = this.$refs.inputSlotWrapper;\n const top = input.getBoundingClientRect().top -\n inputSlotWrapper.getBoundingClientRect().top;\n const chipsWrapper = this.$refs.chipsWrapper;\n chipsWrapper.style.top = (top - CHIP_TOP_POSITION[this.size]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n const chipsWrapper = this.$refs.chipsWrapper;\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n // Avoid adding extra padding when the input is not focused if collapseOnFocusOut is true\n // This ensures the input returns to its original state when resizing\n if (this.collapseOnFocusOut && !this.inputFocused) return;\n\n // Get the position of the last chip\n // The input cursor should be the same \"top\" as that chip and next besides it\n const left = lastChip.offsetLeft + this.getFullWidth(lastChip);\n const spaceLeft = input.getBoundingClientRect().width - left;\n // input.style.paddingLeft = left + 'px';\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingLeft = left + 'px';\n } else {\n input.style.paddingLeft = '4px';\n }\n\n // Get the chip wrapper height minus the 4px padding\n const chipsWrapperHeight = chipsWrapper.getBoundingClientRect().height - 4;\n const lastChipHeight = lastChip.getBoundingClientRect().height - 4;\n\n // Get lastChip offsetTop plus 2px of the input padding.\n const top = spaceLeft > this.reservedRightSpace\n ? lastChip.offsetTop + 2\n : (chipsWrapperHeight + lastChipHeight - 9);\n\n input.style.paddingTop = `${top}px`;\n },\n\n revertInputPadding (input) {\n input.style.paddingLeft = '';\n input.style.paddingTop = '';\n input.style.paddingBottom = '';\n },\n\n getFullWidth (el) {\n const styles = window.getComputedStyle(el);\n return el.offsetWidth + parseInt(styles.marginLeft) + parseInt(styles.marginRight);\n },\n\n setInputMinWidth () {\n // Ensure the width of the input is \"slightly bigger\" than the width of a single chip\n const firstChip = this.getFirstChip();\n const input = this.getInput();\n if (!input) return;\n if (firstChip) {\n // Add 4px buffer for typing room\n input.style.minWidth = (this.getFullWidth(firstChip) + 4) + 'px';\n } else {\n input.style.minWidth = '';\n }\n },\n\n checkMaxSelected () {\n if (this.maxSelected === 0) return;\n if (this.selectedItems.length > this.maxSelected) {\n this.showValidationMessages = true;\n this.$emit('max-selected');\n } else {\n this.showValidationMessages = false;\n }\n },\n\n setInitialInputHeight () {\n const input = this.getInput();\n if (!input) return;\n this.initialInputHeight = input.getBoundingClientRect().height;\n },\n\n async handleInputFocusIn () {\n this.inputFocused = true;\n if (this.collapseOnFocusOut) {\n await this.$nextTick();\n this.setInputPadding();\n this.hideInputText = false;\n }\n },\n\n async handleInputFocusOut () {\n this.inputFocused = false;\n if (this.collapseOnFocusOut) {\n const input = this.getInput();\n if (!input) return;\n // Hide the input text when is not on first line\n if (!input.style.paddingTop) {\n return;\n }\n this.hideInputText = true;\n this.revertInputPadding(input);\n }\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;;;;;;;;AAuIA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,QAAA,CAAA,sBAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,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
|
1
|
+
{"version":3,"file":"combobox_multi_select.vue.js","sources":["../../../../recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-recipe-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :max-width=\"listMaxWidth\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n :visually-hidden-close=\"visuallyHiddenClose\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :transition=\"transition\"\n @select=\"onComboboxSelect\"\n @highlight=\"comboboxHighlight\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"d-recipe-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-recipe-combobox-multi-select__chip-wrapper', chipWrapperClass]\"\n >\n <dt-chip\n v-for=\"({ item, key }) in selectedItemsWithKeys\"\n ref=\"chips\"\n :key=\"key\"\n :label-class=\"['d-chip__label']\"\n :class=\"[\n 'd-recipe-combobox-multi-select__chip',\n { 'd-recipe-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :close-button-props=\"{ ariaLabel: 'close' }\"\n :size=\"CHIP_SIZES[size]\"\n v-on=\"chipListeners\"\n @keyup.backspace=\"onChipRemove(item)\"\n @close=\"onChipRemove(item)\"\n >\n {{ item }}\n </dt-chip>\n </span>\n\n <dt-input\n ref=\"input\"\n v-model=\"value\"\n class=\"d-recipe-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-recipe-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :aria-label=\"label\"\n :label=\"labelVisible ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-on=\"inputListeners\"\n @input=\"onInput\"\n />\n\n <dt-validation-messages\n :validation-messages=\"maxSelectedMessage\"\n :show-messages=\"showValidationMessages\"\n />\n </span>\n </template>\n\n <!-- @slot slot for popover header -->\n <template\n v-if=\"$slots.header\"\n #header\n >\n <div ref=\"header\">\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n class=\"d-recipe-combobox-multi-select__list\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-recipe-combobox-multi-select__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"$slots.footer\"\n #footer\n >\n <div ref=\"footer\">\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-recipe-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtRecipeComboboxWithPopover from '@/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue';\nimport DtInput from '@/components/input/input.vue';\nimport DtChip from '@/components/chip/chip.vue';\nimport DtValidationMessages from '@/components/validation_messages/validation_messages.vue';\nimport { validationMessageValidator } from '@/common/validators';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/popover/popover_constants';\nimport {\n MULTI_SELECT_SIZES,\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './combobox_multi_select_constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport { getUniqueString } from '@/common/utils';\n\nexport default {\n name: 'DtRecipeComboboxMultiSelect',\n\n components: {\n DtRecipeComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n mixins: [SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n labelVisible: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Input placeholder\n */\n placeholder: {\n type: String,\n default: 'Select one or start typing',\n },\n\n /**\n * Input validation messages\n */\n inputMessages: {\n type: Array,\n default: () => [],\n validator: inputMessages => {\n return validationMessageValidator(inputMessages);\n },\n },\n\n /**\n * Show input validation message\n */\n showInputMessages: {\n type: Boolean,\n default: true,\n },\n\n // @TODO: https://dialpad.atlassian.net/browse/DP-52324\n // type: {\n // type: String,\n // values: ['input', 'select'],\n // default: 'select',\n // },\n\n /**\n * Determines if the list is loading\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The message when the list is loading\n */\n loadingMessage: {\n type: String,\n default: 'loading...',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxHeight: {\n type: String,\n default: '300px',\n },\n\n /**\n * The selected items\n */\n selectedItems: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Would be the maximum number of selections you can make. 0 is unlimited\n */\n maxSelected: {\n type: Number,\n default: 0,\n },\n\n /**\n * Max select message when the max selections is exceeded with the structure:\n * `[{\"message\": string, \"type\": VALIDATION_MESSAGE_TYPES }]`\n */\n maxSelectedMessage: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the chip, one of `xs`, `sm`, `md`\n */\n size: {\n type: String,\n default: 'md',\n validator: (t) => Object.values(MULTI_SELECT_SIZES).includes(t),\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * Determines whether the combobox should collapse to a single when losing focus.\n * @type {boolean}\n */\n collapseOnFocusOut: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Amount of reserved space (in px) on the right side of the input\n * before the chips and the input caret jump to the next line.\n * default is 64\n */\n reservedRightSpace: {\n type: Number,\n default: 64,\n },\n\n /**\n * Determines the maximum width of a single chip. If the text within this chip exceeds the value\n * it will be truncated with ellipses.\n * Possible units rem|px|em\n */\n chipMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the input element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n inputClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the input wrapper element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n inputWrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String }\n */\n 'input',\n\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when item removed\n *\n * @event remove\n * @type {String}\n */\n 'remove',\n\n /**\n * Event fired when max selected items limit is reached\n *\n * @event max-selected\n * @type {Object}\n */\n 'max-selected',\n\n /**\n * Native keyup event\n *\n * @event keyup\n * @type {KeyboardEvent}\n */\n 'keyup',\n\n /**\n * Event fired when combobox item is highlighted\n *\n * @event combobox-highlight\n * @type {Object}\n */\n 'combobox-highlight',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n resizeWindowObserver: null,\n initialInputHeight: null,\n CHIP_SIZES,\n inputFocused: false,\n hideInputText: false,\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n ...this.$listeners,\n keyup: event => {\n this.onChipKeyup(event);\n this.$emit('keyup', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...this.$listeners,\n input: event => {\n this.$emit('input', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n keyup: event => {\n this.onInputKeyup(event);\n this.$emit('keyup', event);\n },\n\n click: event => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n selectedItemsWithKeys () {\n return this.selectedItems.map(selectedItem => ({\n item: selectedItem,\n key: getUniqueString(selectedItem),\n }));\n },\n\n chipWrapperClass () {\n return {\n [`d-recipe-combobox-multi-select__chip-wrapper-${this.size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut,\n };\n },\n },\n\n watch: {\n selectedItems: {\n async handler () {\n this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n this.initSelectedItems();\n },\n },\n\n async label () {\n await this.$nextTick();\n // Adjust the chips position if label changed\n this.setChipsTopPosition();\n },\n\n async description () {\n await this.$nextTick();\n // Adjust the chips position if description changed\n this.setChipsTopPosition();\n },\n\n size: {\n async handler () {\n await this.$nextTick();\n const input = this.getInput();\n this.revertInputPadding(input);\n this.initialInputHeight = input.getBoundingClientRect().height;\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n mounted () {\n this.setInitialInputHeight();\n // Recalculate chip position and input padding when resizing window\n this.resizeWindowObserver = new ResizeObserver(async () => {\n this.setChipsTopPosition();\n this.setInputPadding();\n });\n this.resizeWindowObserver.observe(document.body);\n\n this.initSelectedItems();\n },\n\n beforeDestroy () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n comboboxHighlight (highlightIndex) {\n this.$emit('combobox-highlight', highlightIndex);\n },\n\n async initSelectedItems () {\n await this.$nextTick();\n this.setInputPadding();\n this.setChipsTopPosition();\n this.setInputMinWidth();\n this.checkMaxSelected();\n },\n\n onChipRemove (item) {\n this.$emit('remove', item);\n this.$refs.input?.focus();\n },\n\n onComboboxSelect (i) {\n if (this.loading) return;\n this.value = '';\n this.$emit('select', i);\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.showComboboxList();\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.closeComboboxList();\n },\n\n getChipButtons () {\n return this.$refs.chips && this.$refs.chips.map(chip => chip.$el.querySelector('button'));\n },\n\n getChips () {\n return this.$refs.chips && this.$refs.chips.map(chip => chip.$el);\n },\n\n getLastChipButton () {\n return this.$refs.chips && this.getChipButtons()[this.getChipButtons().length - 1];\n },\n\n getLastChip () {\n return this.$refs.chips && this.getChips()[this.getChips().length - 1];\n },\n\n getFirstChip () {\n return this.$refs.chips && this.getChips()[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyup (event) {\n const key = event.code?.toLowerCase();\n if (key === 'arrowleft') {\n // Move to the previous chip\n this.navigateBetweenChips(event.target, true);\n } else if (key === 'arrowright') {\n if (event.target.id === this.getLastChipButton().id) {\n // Move to the input if it's the last chip\n this.moveFromChipToInput();\n } else {\n // Move to the next chip\n this.navigateBetweenChips(event.target, false);\n }\n }\n },\n\n onInputKeyup (event) {\n const key = event.code?.toLowerCase();\n // If the cursor is at the start of the text,\n // press 'backspace' or 'left' focuses the last chip\n if (this.selectedItems.length > 0 && event.target.selectionStart === 0) {\n if (key === 'backspace' || key === 'arrowleft') {\n this.moveFromInputToChip();\n }\n }\n },\n\n moveFromInputToChip () {\n this.getLastChipButton().focus();\n this.$refs.input?.blur();\n this.closeComboboxList();\n },\n\n moveFromChipToInput () {\n this.getLastChipButton().blur();\n this.$refs.input?.focus();\n this.showComboboxList();\n },\n\n navigateBetweenChips (target, toLeft) {\n const from = this.getChipButtons().indexOf(target);\n const to = toLeft ? from - 1 : from + 1;\n if (to < 0 || to >= this.$refs.chips?.length) {\n return;\n }\n this.getChipButtons()[from].blur();\n this.getChipButtons()[to].focus();\n this.closeComboboxList();\n },\n\n setChipsTopPosition () {\n // To place the chips in the input box\n // The chip \"top\" position should be the same line as the input box\n const input = this.getInput();\n if (!input) return;\n const inputSlotWrapper = this.$refs.inputSlotWrapper;\n const top = input.getBoundingClientRect().top -\n inputSlotWrapper.getBoundingClientRect().top;\n const chipsWrapper = this.$refs.chipsWrapper;\n chipsWrapper.style.top = (top - CHIP_TOP_POSITION[this.size]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n const chipsWrapper = this.$refs.chipsWrapper;\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n // Avoid adding extra padding when the input is not focused if collapseOnFocusOut is true\n // This ensures the input returns to its original state when resizing\n if (this.collapseOnFocusOut && !this.inputFocused) return;\n\n // Get the position of the last chip\n // The input cursor should be the same \"top\" as that chip and next besides it\n const left = lastChip.offsetLeft + this.getFullWidth(lastChip);\n const spaceLeft = input.getBoundingClientRect().width - left;\n // input.style.paddingLeft = left + 'px';\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingLeft = left + 'px';\n } else {\n input.style.paddingLeft = '4px';\n }\n\n // Get the chip wrapper height minus the 4px padding\n const chipsWrapperHeight = chipsWrapper.getBoundingClientRect().height - 4;\n const lastChipHeight = lastChip.getBoundingClientRect().height - 4;\n\n // Get lastChip offsetTop plus 2px of the input padding.\n const top = spaceLeft > this.reservedRightSpace\n ? lastChip.offsetTop + 2\n : (chipsWrapperHeight + lastChipHeight - 9);\n\n input.style.paddingTop = `${top}px`;\n },\n\n revertInputPadding (input) {\n input.style.paddingLeft = '';\n input.style.paddingTop = '';\n input.style.paddingBottom = '';\n },\n\n getFullWidth (el) {\n const styles = window.getComputedStyle(el);\n return el.offsetWidth + parseInt(styles.marginLeft) + parseInt(styles.marginRight);\n },\n\n setInputMinWidth () {\n // Ensure the width of the input is \"slightly bigger\" than the width of a single chip\n const firstChip = this.getFirstChip();\n const input = this.getInput();\n if (!input) return;\n if (firstChip) {\n // Add 4px buffer for typing room\n input.style.minWidth = (this.getFullWidth(firstChip) + 4) + 'px';\n } else {\n input.style.minWidth = '';\n }\n },\n\n checkMaxSelected () {\n if (this.maxSelected === 0) return;\n if (this.selectedItems.length > this.maxSelected) {\n this.showValidationMessages = true;\n this.$emit('max-selected');\n } else {\n this.showValidationMessages = false;\n }\n },\n\n setInitialInputHeight () {\n const input = this.getInput();\n if (!input) return;\n this.initialInputHeight = input.getBoundingClientRect().height;\n },\n\n async handleInputFocusIn () {\n this.inputFocused = true;\n if (this.collapseOnFocusOut) {\n await this.$nextTick();\n this.setInputPadding();\n this.hideInputText = false;\n }\n },\n\n async handleInputFocusOut () {\n this.inputFocused = false;\n if (this.collapseOnFocusOut) {\n const input = this.getInput();\n if (!input) return;\n // Hide the input text when is not on first line\n if (!input.style.paddingTop) {\n return;\n }\n this.hideInputText = true;\n this.revertInputPadding(input);\n }\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;;;;;;;;AAwIA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,QAAA,CAAA,sBAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;A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A,mBAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -344,7 +344,11 @@ var _sfc_render = function render() {
|
|
|
344
344
|
} }, scopedSlots: _vm._u([_vm.$slots.header ? { key: "headerContent", fn: function() {
|
|
345
345
|
return [_c("div", { ref: "header" }, [_vm._t("header")], 2)];
|
|
346
346
|
}, proxy: true } : null, { key: "content", fn: function() {
|
|
347
|
-
return [_c("div", { ref: "listWrapper", class: [
|
|
347
|
+
return [_c("div", { ref: "listWrapper", class: [
|
|
348
|
+
"d-recipe-combobox-with-popover__list",
|
|
349
|
+
_vm.DROPDOWN_PADDING_CLASSES[_vm.padding],
|
|
350
|
+
_vm.listClass
|
|
351
|
+
], on: { "mouseleave": clearHighlightIndex, "focusout": clearHighlightIndex } }, [_vm.loading ? _c("combobox-loading-list", _vm._b({}, "combobox-loading-list", listProps, false)) : _vm.emptyList && _vm.emptyStateMessage ? _c("combobox-empty-list", _vm._b({ attrs: { "message": _vm.emptyStateMessage } }, "combobox-empty-list", listProps, false)) : _vm._t("list", null, { "listProps": listProps })], 2)];
|
|
348
352
|
}, proxy: true }, _vm.$slots.footer ? { key: "footerContent", fn: function() {
|
|
349
353
|
return [_c("div", { ref: "footer" }, [_vm._t("footer")], 2)];
|
|
350
354
|
}, proxy: true } : null], null, true) })];
|
package/dist/vue2/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox_with_popover.vue.cjs","sources":["../../../../recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue"],"sourcesContent":["<template>\n <dt-combobox\n ref=\"combobox\"\n :loading=\"loading\"\n :label=\"label\"\n :label-visible=\"labelVisible\"\n :size=\"size\"\n :description=\"description\"\n :empty-list=\"emptyList\"\n :empty-state-message=\"emptyStateMessage\"\n :show-list=\"isListShown\"\n :on-beginning-of-list=\"onBeginningOfList\"\n :on-end-of-list=\"onEndOfList\"\n :list-rendered-outside=\"true\"\n :list-id=\"listId\"\n data-qa=\"dt-combobox\"\n v-on=\"comboboxListeners\"\n >\n <template\n #input=\"{ inputProps }\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"externalAnchor\"\n ref=\"input\"\n @focusin=\"onFocusIn\"\n @keydown.up=\"openOnArrowKeyPress($event)\"\n @keydown.down=\"openOnArrowKeyPress($event)\"\n >\n <slot\n name=\"input\"\n :input-props=\"inputProps\"\n :on-input=\"handleDisplayList\"\n />\n </div>\n </template>\n <template #list=\"{ opened, listProps, clearHighlightIndex }\">\n <dt-popover\n ref=\"popover\"\n :open.sync=\"isListShown\"\n :hide-on-click=\"false\"\n :max-height=\"maxHeight\"\n :max-width=\"maxWidth\"\n :offset=\"popoverOffset\"\n :sticky=\"popoverSticky\"\n placement=\"bottom-start\"\n initial-focus-element=\"none\"\n padding=\"none\"\n role=\"listbox\"\n :external-anchor=\"externalAnchor\"\n :content-width=\"contentWidth\"\n :content-appear=\"true\"\n :content-tabindex=\"null\"\n :modal=\"false\"\n :auto-focus=\"false\"\n :append-to=\"appendTo\"\n :transition=\"transition\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n :visually-hidden-close=\"visuallyHiddenClose\"\n @opened=\"opened($event, arguments[1]);\"\n >\n <template\n v-if=\"$slots.header\"\n #headerContent\n >\n <div\n ref=\"header\"\n >\n <slot name=\"header\" />\n </div>\n </template>\n\n <template #content>\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n ref=\"listWrapper\"\n :class=\"[DROPDOWN_PADDING_CLASSES[padding], listClass]\"\n @mouseleave=\"clearHighlightIndex\"\n @focusout=\"clearHighlightIndex\"\n >\n <combobox-loading-list\n v-if=\"loading\"\n v-bind=\"listProps\"\n />\n <combobox-empty-list\n v-else-if=\"emptyList && emptyStateMessage\"\n v-bind=\"listProps\"\n :message=\"emptyStateMessage\"\n />\n <slot\n v-else\n name=\"list\"\n :list-props=\"listProps\"\n />\n </div>\n </template>\n\n <template\n v-if=\"$slots.footer\"\n #footerContent\n >\n <div\n ref=\"footer\"\n >\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-popover>\n </template>\n </dt-combobox>\n</template>\n\n<script>\nimport ComboboxLoadingList from '@/components/combobox/combobox_loading-list.vue';\nimport ComboboxEmptyList from '@/components/combobox/combobox_empty-list.vue';\nimport { DtCombobox, LABEL_SIZES } from '@/components/combobox';\nimport { DtPopover, POPOVER_APPEND_TO_VALUES, POPOVER_CONTENT_WIDTHS } from '@/components/popover';\nimport { getUniqueString } from '@/common/utils';\nimport { DROPDOWN_PADDING_CLASSES } from '@/components/dropdown';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\n\nexport default {\n name: 'DtRecipeComboboxWithPopover',\n\n components: {\n DtCombobox,\n DtPopover,\n ComboboxLoadingList,\n ComboboxEmptyList,\n },\n\n mixins: [SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n labelVisible: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the input, one of `xs`, `sm`, `md`, `lg`, `xl`\n * @values null, xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: null,\n validator: (t) => Object.values(LABEL_SIZES).includes(t),\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Sets an ID on the list element of the component. Used by several aria attributes\n * as well as when deriving the IDs for each item.\n */\n listId: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Additional class for the wrapper list element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * A method that will be called when the selection goes past the beginning of the list.\n */\n onBeginningOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * A method that will be called when the selection goes past the end of the list.\n */\n onEndOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Vertical padding size around the list element.\n */\n padding: {\n type: String,\n default: 'small',\n validator: (padding) => {\n return Object.keys(DROPDOWN_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n */\n contentWidth: {\n type: String,\n default: null,\n validator: contentWidth => POPOVER_CONTENT_WIDTHS.includes(contentWidth),\n },\n\n /**\n * If the list should be shown by pressing up or down arrow key on the input element.\n * This can be set when not passing showList prop.\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displaces the popover content box from its anchor element\n * by the specified number of pixels.\n */\n popoverOffset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * If the popover sticks to the input.\n */\n popoverSticky: {\n type: [Boolean, String],\n default: false,\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines when to show the skeletons and also controls aria-busy attribute.\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the list to an empty state, and displays the message from prop `emptyStateMessage`.\n */\n emptyList: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Message to show when the list is empty\n */\n emptyStateMessage: {\n type: String,\n default: '',\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n },\n\n emits: [\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when 'escape' key is pressed\n *\n * @event escape\n */\n 'escape',\n\n /**\n * Event fired when an item is highlighted\n *\n * @event highlight\n * @type {Number}\n */\n 'highlight',\n\n /**\n * Emitted when items are shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n ],\n\n data () {\n return {\n DROPDOWN_PADDING_CLASSES,\n isListShown: false,\n isInputFocused: false,\n isListFocused: false,\n externalAnchor: getUniqueString(),\n };\n },\n\n computed: {\n comboboxListeners () {\n return {\n ...this.$listeners,\n\n select: this.onSelect,\n\n escape: this.onEscape,\n\n highlight: this.onHighlight,\n };\n },\n },\n\n watch: {\n showList: {\n handler: function (show) {\n if (show !== null) {\n this.isListShown = show;\n }\n },\n\n immediate: true,\n },\n\n isListShown (val) {\n if (val) {\n window.addEventListener('mousedown', this.onFocusOut);\n } else {\n window.removeEventListener('mousedown', this.onFocusOut);\n }\n this.onOpened(val);\n },\n },\n\n methods: {\n handleDisplayList (value) {\n if (!this.hasSuggestionList && value) { this.showComboboxList(); }\n if (!this.hasSuggestionList && !value) { this.closeComboboxList(); }\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.isListShown = true;\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.isListShown = false;\n },\n\n onSelect (highlightIndex) {\n if (this.loading) return;\n\n this.$emit('select', highlightIndex);\n if (!this.hasSuggestionList) {\n // we don't display the list before the user has typed anything\n this.closeComboboxList();\n }\n },\n\n onEscape () {\n this.$emit('escape');\n this.closeComboboxList();\n },\n\n onHighlight (highlightIndex) {\n if (this.loading) return;\n\n this.$emit('highlight', highlightIndex);\n },\n\n onOpened (opened) {\n this.$emit('opened', opened);\n },\n\n onFocusIn (e) {\n if (this.hasSuggestionList && e && this.$refs.input?.querySelector('input') === e.target) {\n // only trigger if we show suggestion list when focused, and\n // it's the input specifically that was focused\n this.showComboboxList();\n }\n },\n\n onFocusOut (e) {\n // Check if the focus change was to another target within the combobox component\n const popoverEl = this.$refs.popover?.tip?.popper;\n const comboboxEl = this.$refs.input;\n\n if (e.composedPath()?.some(el => [popoverEl, comboboxEl].includes(el))) return;\n\n // If outside the combobox then close\n this.closeComboboxList();\n },\n\n openOnArrowKeyPress () {\n if (this.showList !== null || this.isListShown || !this.openWithArrowKeys) { return; }\n\n this.showComboboxList();\n },\n },\n};\n</script>\n"],"names":["DtCombobox","DtPopover","ComboboxLoadingList","ComboboxEmptyList","SrOnlyCloseButtonMixin","LABEL_SIZES","getUniqueString","DROPDOWN_PADDING_CLASSES","POPOVER_CONTENT_WIDTHS","POPOVER_APPEND_TO_VALUES"],"mappings":";;;;;;;;;;;;AAyHA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,YAAAA,SAAA;AAAA,IACA,WAAAC,QAAA;AAAA,IACA,qBAAAC,qBAAA;AAAA,IACA,mBAAAC,mBAAA;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,qBAAAA,OAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAA,MAAA,OAAA,OAAAC,8BAAA,EAAA,SAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAA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AA;AAGA,aAAA,iBAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,WAAA,GAAA;;AAEA,YAAA,aAAA,gBAAA,MAAA,YAAA,mBAAA,QAAA,mBAAA;AACA,YAAA,aAAA,KAAA,MAAA;AAEA,WAAA,OAAA,mBAAA,mBAAA,KAAA,QAAA,CAAA,WAAA,UAAA,EAAA,SAAA,EAAA,GAAA;AAGA,WAAA,kBAAA;AAAA,IACA;AAAA,IAEA,sBAAA;AACA,UAAA,KAAA,aAAA,QAAA,KAAA,eAAA,CAAA,KAAA,mBAAA;AAAA;AAAA,MAAA;AAEA,WAAA,iBAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"combobox_with_popover.vue.cjs","sources":["../../../../recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue"],"sourcesContent":["<template>\n <dt-combobox\n ref=\"combobox\"\n :loading=\"loading\"\n :label=\"label\"\n :label-visible=\"labelVisible\"\n :size=\"size\"\n :description=\"description\"\n :empty-list=\"emptyList\"\n :empty-state-message=\"emptyStateMessage\"\n :show-list=\"isListShown\"\n :on-beginning-of-list=\"onBeginningOfList\"\n :on-end-of-list=\"onEndOfList\"\n :list-rendered-outside=\"true\"\n :list-id=\"listId\"\n data-qa=\"dt-combobox\"\n v-on=\"comboboxListeners\"\n >\n <template\n #input=\"{ inputProps }\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"externalAnchor\"\n ref=\"input\"\n @focusin=\"onFocusIn\"\n @keydown.up=\"openOnArrowKeyPress($event)\"\n @keydown.down=\"openOnArrowKeyPress($event)\"\n >\n <slot\n name=\"input\"\n :input-props=\"inputProps\"\n :on-input=\"handleDisplayList\"\n />\n </div>\n </template>\n <template #list=\"{ opened, listProps, clearHighlightIndex }\">\n <dt-popover\n ref=\"popover\"\n :open.sync=\"isListShown\"\n :hide-on-click=\"false\"\n :max-height=\"maxHeight\"\n :max-width=\"maxWidth\"\n :offset=\"popoverOffset\"\n :sticky=\"popoverSticky\"\n placement=\"bottom-start\"\n initial-focus-element=\"none\"\n padding=\"none\"\n role=\"listbox\"\n :external-anchor=\"externalAnchor\"\n :content-width=\"contentWidth\"\n :content-appear=\"true\"\n :content-tabindex=\"null\"\n :modal=\"false\"\n :auto-focus=\"false\"\n :append-to=\"appendTo\"\n :transition=\"transition\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n :visually-hidden-close=\"visuallyHiddenClose\"\n @opened=\"opened($event, arguments[1]);\"\n >\n <template\n v-if=\"$slots.header\"\n #headerContent\n >\n <div\n ref=\"header\"\n >\n <slot name=\"header\" />\n </div>\n </template>\n\n <template #content>\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n ref=\"listWrapper\"\n :class=\"[\n 'd-recipe-combobox-with-popover__list',\n DROPDOWN_PADDING_CLASSES[padding],\n listClass,\n ]\"\n @mouseleave=\"clearHighlightIndex\"\n @focusout=\"clearHighlightIndex\"\n >\n <combobox-loading-list\n v-if=\"loading\"\n v-bind=\"listProps\"\n />\n <combobox-empty-list\n v-else-if=\"emptyList && emptyStateMessage\"\n v-bind=\"listProps\"\n :message=\"emptyStateMessage\"\n />\n <slot\n v-else\n name=\"list\"\n :list-props=\"listProps\"\n />\n </div>\n </template>\n\n <template\n v-if=\"$slots.footer\"\n #footerContent\n >\n <div\n ref=\"footer\"\n >\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-popover>\n </template>\n </dt-combobox>\n</template>\n\n<script>\nimport ComboboxLoadingList from '@/components/combobox/combobox_loading-list.vue';\nimport ComboboxEmptyList from '@/components/combobox/combobox_empty-list.vue';\nimport { DtCombobox, LABEL_SIZES } from '@/components/combobox';\nimport { DtPopover, POPOVER_APPEND_TO_VALUES, POPOVER_CONTENT_WIDTHS } from '@/components/popover';\nimport { getUniqueString } from '@/common/utils';\nimport { DROPDOWN_PADDING_CLASSES } from '@/components/dropdown';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\n\nexport default {\n name: 'DtRecipeComboboxWithPopover',\n\n components: {\n DtCombobox,\n DtPopover,\n ComboboxLoadingList,\n ComboboxEmptyList,\n },\n\n mixins: [SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n labelVisible: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the input, one of `xs`, `sm`, `md`, `lg`, `xl`\n * @values null, xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: null,\n validator: (t) => Object.values(LABEL_SIZES).includes(t),\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Sets an ID on the list element of the component. Used by several aria attributes\n * as well as when deriving the IDs for each item.\n */\n listId: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Additional class for the wrapper list element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * A method that will be called when the selection goes past the beginning of the list.\n */\n onBeginningOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * A method that will be called when the selection goes past the end of the list.\n */\n onEndOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Vertical padding size around the list element.\n */\n padding: {\n type: String,\n default: 'small',\n validator: (padding) => {\n return Object.keys(DROPDOWN_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n */\n contentWidth: {\n type: String,\n default: null,\n validator: contentWidth => POPOVER_CONTENT_WIDTHS.includes(contentWidth),\n },\n\n /**\n * If the list should be shown by pressing up or down arrow key on the input element.\n * This can be set when not passing showList prop.\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displaces the popover content box from its anchor element\n * by the specified number of pixels.\n */\n popoverOffset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * If the popover sticks to the input.\n */\n popoverSticky: {\n type: [Boolean, String],\n default: false,\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines when to show the skeletons and also controls aria-busy attribute.\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the list to an empty state, and displays the message from prop `emptyStateMessage`.\n */\n emptyList: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Message to show when the list is empty\n */\n emptyStateMessage: {\n type: String,\n default: '',\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n },\n\n emits: [\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when 'escape' key is pressed\n *\n * @event escape\n */\n 'escape',\n\n /**\n * Event fired when an item is highlighted\n *\n * @event highlight\n * @type {Number}\n */\n 'highlight',\n\n /**\n * Emitted when items are shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n ],\n\n data () {\n return {\n DROPDOWN_PADDING_CLASSES,\n isListShown: false,\n isInputFocused: false,\n isListFocused: false,\n externalAnchor: getUniqueString(),\n };\n },\n\n computed: {\n comboboxListeners () {\n return {\n ...this.$listeners,\n\n select: this.onSelect,\n\n escape: this.onEscape,\n\n highlight: this.onHighlight,\n };\n },\n },\n\n watch: {\n showList: {\n handler: function (show) {\n if (show !== null) {\n this.isListShown = show;\n }\n },\n\n immediate: true,\n },\n\n isListShown (val) {\n if (val) {\n window.addEventListener('mousedown', this.onFocusOut);\n } else {\n window.removeEventListener('mousedown', this.onFocusOut);\n }\n this.onOpened(val);\n },\n },\n\n methods: {\n handleDisplayList (value) {\n if (!this.hasSuggestionList && value) { this.showComboboxList(); }\n if (!this.hasSuggestionList && !value) { this.closeComboboxList(); }\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.isListShown = true;\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.isListShown = false;\n },\n\n onSelect (highlightIndex) {\n if (this.loading) return;\n\n this.$emit('select', highlightIndex);\n if (!this.hasSuggestionList) {\n // we don't display the list before the user has typed anything\n this.closeComboboxList();\n }\n },\n\n onEscape () {\n this.$emit('escape');\n this.closeComboboxList();\n },\n\n onHighlight (highlightIndex) {\n if (this.loading) return;\n\n this.$emit('highlight', highlightIndex);\n },\n\n onOpened (opened) {\n this.$emit('opened', opened);\n },\n\n onFocusIn (e) {\n if (this.hasSuggestionList && e && this.$refs.input?.querySelector('input') === e.target) {\n // only trigger if we show suggestion list when focused, and\n // it's the input specifically that was focused\n this.showComboboxList();\n }\n },\n\n onFocusOut (e) {\n // Check if the focus change was to another target within the combobox component\n const popoverEl = this.$refs.popover?.tip?.popper;\n const comboboxEl = this.$refs.input;\n\n if (e.composedPath()?.some(el => [popoverEl, comboboxEl].includes(el))) return;\n\n // If outside the combobox then close\n this.closeComboboxList();\n },\n\n openOnArrowKeyPress () {\n if (this.showList !== null || this.isListShown || !this.openWithArrowKeys) { return; }\n\n this.showComboboxList();\n },\n },\n};\n</script>\n"],"names":["DtCombobox","DtPopover","ComboboxLoadingList","ComboboxEmptyList","SrOnlyCloseButtonMixin","LABEL_SIZES","getUniqueString","DROPDOWN_PADDING_CLASSES","POPOVER_CONTENT_WIDTHS","POPOVER_APPEND_TO_VALUES"],"mappings":";;;;;;;;;;;;AA6HA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,YAAAA,SAAA;AAAA,IACA,WAAAC,QAAA;AAAA,IACA,qBAAAC,qBAAA;AAAA,IACA,mBAAAC,mBAAA;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,qBAAAA,OAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAA,MAAA,OAAA,OAAAC,8BAAA,EAAA,SAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,eAAAC,aAAA,gBAAA;AAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA,CAAA,QAAA,OAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,mBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AA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"}
|
|
@@ -342,7 +342,11 @@ var _sfc_render = function render() {
|
|
|
342
342
|
} }, scopedSlots: _vm._u([_vm.$slots.header ? { key: "headerContent", fn: function() {
|
|
343
343
|
return [_c("div", { ref: "header" }, [_vm._t("header")], 2)];
|
|
344
344
|
}, proxy: true } : null, { key: "content", fn: function() {
|
|
345
|
-
return [_c("div", { ref: "listWrapper", class: [
|
|
345
|
+
return [_c("div", { ref: "listWrapper", class: [
|
|
346
|
+
"d-recipe-combobox-with-popover__list",
|
|
347
|
+
_vm.DROPDOWN_PADDING_CLASSES[_vm.padding],
|
|
348
|
+
_vm.listClass
|
|
349
|
+
], on: { "mouseleave": clearHighlightIndex, "focusout": clearHighlightIndex } }, [_vm.loading ? _c("combobox-loading-list", _vm._b({}, "combobox-loading-list", listProps, false)) : _vm.emptyList && _vm.emptyStateMessage ? _c("combobox-empty-list", _vm._b({ attrs: { "message": _vm.emptyStateMessage } }, "combobox-empty-list", listProps, false)) : _vm._t("list", null, { "listProps": listProps })], 2)];
|
|
346
350
|
}, proxy: true }, _vm.$slots.footer ? { key: "footerContent", fn: function() {
|
|
347
351
|
return [_c("div", { ref: "footer" }, [_vm._t("footer")], 2)];
|
|
348
352
|
}, proxy: true } : null], null, true) })];
|