@dialpad/dialtone-vue 2.125.0 → 2.125.1
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/chunks/_plugin-vue2_normalizer-u6G_3nkj.js +33 -0
- package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js.map +1 -0
- package/dist/chunks/dropdown-SMWaTWyF.js +357 -0
- package/dist/chunks/dropdown-SMWaTWyF.js.map +1 -0
- package/dist/chunks/dropdown_constants-EUcDxBrX.js +9 -0
- package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +1 -0
- package/dist/chunks/icon_constants-OpYAAKwF.js +16 -0
- package/dist/chunks/icon_constants-OpYAAKwF.js.map +1 -0
- package/dist/chunks/index-nIyl_PL6.js +372 -0
- package/dist/chunks/index-nIyl_PL6.js.map +1 -0
- package/dist/chunks/index-o4OMWMuv.js +244 -0
- package/dist/chunks/index-o4OMWMuv.js.map +1 -0
- package/dist/chunks/input-1tm09l_-.js +273 -0
- package/dist/chunks/input-1tm09l_-.js.map +1 -0
- package/dist/chunks/input_group-zcAq3DQl.js +141 -0
- package/dist/chunks/input_group-zcAq3DQl.js.map +1 -0
- package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +197 -0
- package/dist/chunks/keyboard_list_navigation-F0O8nht0.js.map +1 -0
- package/dist/chunks/link_constants-vIUB92L4.js +16 -0
- package/dist/chunks/link_constants-vIUB92L4.js.map +1 -0
- package/dist/chunks/list_item_constants-LTUc74pD.js +13 -0
- package/dist/chunks/list_item_constants-LTUc74pD.js.map +1 -0
- package/dist/chunks/modal-VuMFkZFH.js +82 -0
- package/dist/chunks/modal-VuMFkZFH.js.map +1 -0
- package/dist/chunks/notice_action-9NmtQRai.js +182 -0
- package/dist/chunks/notice_action-9NmtQRai.js.map +1 -0
- package/dist/chunks/notice_constants-c--hBFQw.js +6 -0
- package/dist/chunks/notice_constants-c--hBFQw.js.map +1 -0
- package/dist/chunks/popover_constants-qjlEkroB.js +114 -0
- package/dist/chunks/popover_constants-qjlEkroB.js.map +1 -0
- package/dist/chunks/sr_only_close_button-JGole5Xi.js +86 -0
- package/dist/chunks/sr_only_close_button-JGole5Xi.js.map +1 -0
- package/dist/chunks/stack_constants-u7tNqGtc.js +13 -0
- package/dist/chunks/stack_constants-u7tNqGtc.js.map +1 -0
- package/dist/chunks/tab-Qm9LVkYj.js +346 -0
- package/dist/chunks/tab-Qm9LVkYj.js.map +1 -0
- package/dist/component-documentation.json +1 -1
- package/dist/dialtone-vue.js +354 -10368
- package/dist/dialtone-vue.js.map +1 -1
- package/dist/lib/attachment-carousel.js +250 -0
- package/dist/lib/attachment-carousel.js.map +1 -0
- package/dist/lib/avatar.js +369 -0
- package/dist/lib/avatar.js.map +1 -0
- package/dist/lib/badge.js +169 -0
- package/dist/lib/badge.js.map +1 -0
- package/dist/lib/banner.js +200 -0
- package/dist/lib/banner.js.map +1 -0
- package/dist/lib/breadcrumbs.js +138 -0
- package/dist/lib/breadcrumbs.js.map +1 -0
- package/dist/lib/button-group.js +45 -0
- package/dist/lib/button-group.js.map +1 -0
- package/dist/lib/button.js +328 -0
- package/dist/lib/button.js.map +1 -0
- package/dist/lib/callbar-button-with-popover.js +235 -0
- package/dist/lib/callbar-button-with-popover.js.map +1 -0
- package/dist/lib/callbar-button.js +175 -0
- package/dist/lib/callbar-button.js.map +1 -0
- package/dist/lib/callbox.js +142 -0
- package/dist/lib/callbox.js.map +1 -0
- package/dist/lib/card.js +72 -0
- package/dist/lib/card.js.map +1 -0
- package/dist/lib/checkbox-group.js +117 -0
- package/dist/lib/checkbox-group.js.map +1 -0
- package/dist/lib/checkbox.js +117 -0
- package/dist/lib/checkbox.js.map +1 -0
- package/dist/lib/chip.js +186 -0
- package/dist/lib/chip.js.map +1 -0
- package/dist/lib/codeblock.js +29 -0
- package/dist/lib/codeblock.js.map +1 -0
- package/dist/lib/collapsible.js +313 -0
- package/dist/lib/collapsible.js.map +1 -0
- package/dist/lib/combobox-multi-select.js +433 -0
- package/dist/lib/combobox-multi-select.js.map +1 -0
- package/dist/lib/combobox-with-popover.js +341 -0
- package/dist/lib/combobox-with-popover.js.map +1 -0
- package/dist/lib/combobox.js +19 -0
- package/dist/lib/combobox.js.map +1 -0
- package/dist/lib/constants.js +53 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/contact-info.js +145 -0
- package/dist/lib/contact-info.js.map +1 -0
- package/dist/lib/contact-row.js +203 -0
- package/dist/lib/contact-row.js.map +1 -0
- package/dist/lib/datepicker.js +552 -0
- package/dist/lib/datepicker.js.map +1 -0
- package/dist/lib/dates.js +57 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/description-list.js +83 -0
- package/dist/lib/description-list.js.map +1 -0
- package/dist/lib/dropdown.js +45 -0
- package/dist/lib/dropdown.js.map +1 -0
- package/dist/lib/editor.js +527 -0
- package/dist/lib/editor.js.map +1 -0
- package/dist/{emoji_picker-kiTOKaq8.js → lib/emoji-picker.js} +30 -12
- package/dist/lib/emoji-picker.js.map +1 -0
- package/dist/lib/emoji-row.js +83 -0
- package/dist/lib/emoji-row.js.map +1 -0
- package/dist/{emoji_text_wrapper-48ClwKvf.js → lib/emoji-text-wrapper.js} +19 -14
- package/dist/lib/emoji-text-wrapper.js.map +1 -0
- package/dist/lib/emoji.js +11 -0
- package/dist/{emoji.js.map → lib/emoji.js.map} +1 -1
- package/dist/lib/feed-item-row.js +207 -0
- package/dist/lib/feed-item-row.js.map +1 -0
- package/dist/lib/feed-pill.js +142 -0
- package/dist/lib/feed-pill.js.map +1 -0
- package/dist/lib/general-row.js +379 -0
- package/dist/lib/general-row.js.map +1 -0
- package/dist/lib/group-row.js +115 -0
- package/dist/lib/group-row.js.map +1 -0
- package/dist/lib/grouped-chip.js +45 -0
- package/dist/lib/grouped-chip.js.map +1 -0
- package/dist/lib/hovercard.js +194 -0
- package/dist/lib/hovercard.js.map +1 -0
- package/dist/lib/icon.js +82 -0
- package/dist/lib/icon.js.map +1 -0
- package/dist/lib/image-viewer.js +171 -0
- package/dist/lib/image-viewer.js.map +1 -0
- package/dist/lib/input-group.js +90 -0
- package/dist/lib/input-group.js.map +1 -0
- package/dist/lib/input.js +455 -0
- package/dist/lib/input.js.map +1 -0
- package/dist/lib/item-layout.js +39 -0
- package/dist/lib/item-layout.js.map +1 -0
- package/dist/lib/ivr-node.js +195 -0
- package/dist/lib/ivr-node.js.map +1 -0
- package/dist/lib/keyboard-shortcut.js +100 -0
- package/dist/lib/keyboard-shortcut.js.map +1 -0
- package/dist/lib/lazy-show.js +77 -0
- package/dist/lib/lazy-show.js.map +1 -0
- package/dist/lib/link.js +69 -0
- package/dist/lib/link.js.map +1 -0
- package/dist/lib/list-item-group.js +59 -0
- package/dist/lib/list-item-group.js.map +1 -0
- package/dist/lib/list-item.js +195 -0
- package/dist/lib/list-item.js.map +1 -0
- package/dist/{message_input.js → lib/message-input.js} +107 -56
- package/dist/lib/message-input.js.map +1 -0
- package/dist/lib/mixins.js +17 -0
- package/dist/lib/mixins.js.map +1 -0
- package/dist/lib/modal.js +324 -0
- package/dist/lib/modal.js.map +1 -0
- package/dist/lib/notice.js +158 -0
- package/dist/lib/notice.js.map +1 -0
- package/dist/lib/pagination.js +142 -0
- package/dist/lib/pagination.js.map +1 -0
- package/dist/lib/popover.js +779 -0
- package/dist/lib/popover.js.map +1 -0
- package/dist/lib/presence.js +60 -0
- package/dist/lib/presence.js.map +1 -0
- package/dist/lib/radio-group.js +97 -0
- package/dist/lib/radio-group.js.map +1 -0
- package/dist/lib/radio.js +111 -0
- package/dist/lib/radio.js.map +1 -0
- package/dist/lib/rich-text-editor.js +920 -0
- package/dist/lib/rich-text-editor.js.map +1 -0
- package/dist/lib/root-layout.js +127 -0
- package/dist/lib/root-layout.js.map +1 -0
- package/dist/lib/select-menu.js +243 -0
- package/dist/lib/select-menu.js.map +1 -0
- package/dist/lib/settings-menu-button.js +65 -0
- package/dist/lib/settings-menu-button.js.map +1 -0
- package/dist/lib/skeleton.js +574 -0
- package/dist/lib/skeleton.js.map +1 -0
- package/dist/lib/stack.js +118 -0
- package/dist/lib/stack.js.map +1 -0
- package/dist/lib/tabs.js +93 -0
- package/dist/lib/tabs.js.map +1 -0
- package/dist/lib/time-pill.js +43 -0
- package/dist/lib/time-pill.js.map +1 -0
- package/dist/lib/toast.js +226 -0
- package/dist/lib/toast.js.map +1 -0
- package/dist/lib/toggle.js +169 -0
- package/dist/lib/toggle.js.map +1 -0
- package/dist/{directives.js → lib/tooltip-directive.js} +24 -18
- package/dist/lib/tooltip-directive.js.map +1 -0
- package/dist/lib/tooltip.js +376 -0
- package/dist/lib/tooltip.js.map +1 -0
- package/dist/lib/top-banner-info.js +60 -0
- package/dist/lib/top-banner-info.js.map +1 -0
- package/dist/lib/unread-pill.js +61 -0
- package/dist/lib/unread-pill.js.map +1 -0
- package/dist/lib/utils.js +175 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/validation-messages.js +83 -0
- package/dist/lib/validation-messages.js.map +1 -0
- package/dist/lib/validators.js +12 -0
- package/dist/lib/validators.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/types/common/{constants.d.ts → constants/index.d.ts} +1 -1
- package/dist/types/common/constants/index.d.ts.map +1 -0
- package/dist/types/common/{dates.d.ts → dates/index.d.ts} +1 -1
- package/dist/types/common/dates/index.d.ts.map +1 -0
- package/dist/types/common/{emoji.d.ts → emoji/index.d.ts} +1 -1
- package/dist/types/common/{emoji.d.ts.map → emoji/index.d.ts.map} +1 -1
- package/dist/types/common/{utils.d.ts → utils/index.d.ts} +1 -1
- package/dist/types/common/utils/index.d.ts.map +1 -0
- package/dist/types/common/{validators.d.ts → validators/index.d.ts} +1 -1
- package/dist/types/common/validators/index.d.ts.map +1 -0
- package/dist/types/components/avatar/avatar.vue.d.ts +1 -1
- package/dist/types/components/button/button.vue.d.ts +2 -2
- package/dist/types/components/card/card.vue.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.vue.d.ts +7 -7
- package/dist/types/components/checkbox/checkbox.vue.d.ts.map +1 -1
- package/dist/types/components/chip/chip.vue.d.ts +2 -2
- package/dist/types/components/collapsible/collapsible.vue.d.ts +3 -3
- package/dist/types/components/combobox/combobox.vue.d.ts +7 -8
- package/dist/types/components/combobox/combobox.vue.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown.vue.d.ts +1 -1
- package/dist/types/components/emoji/emoji.vue.d.ts +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_selector.vue.d.ts +1 -219
- package/dist/types/components/icon/icon.vue.d.ts +20 -16
- package/dist/types/components/icon/icon.vue.d.ts.map +1 -1
- package/dist/types/components/icon/icon_constants.d.ts +2 -0
- package/dist/types/components/icon/icon_constants.d.ts.map +1 -1
- package/dist/types/components/icon/index.d.ts +1 -1
- package/dist/types/components/input_group/input_group.vue.d.ts +15 -6
- package/dist/types/components/input_group/input_group.vue.d.ts.map +1 -1
- package/dist/types/components/list_item_group/list_item_group.vue.d.ts +1 -1
- package/dist/types/components/modal/modal.vue.d.ts +7 -2
- package/dist/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/types/components/notice/notice_action.vue.d.ts +3 -1
- package/dist/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/types/components/popover/popover_header_footer.vue.d.ts +1 -1
- package/dist/types/components/radio/radio.vue.d.ts +2 -12
- package/dist/types/components/radio/radio.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton-list-item.vue.d.ts +1 -1
- package/dist/types/components/skeleton/skeleton-paragraph.vue.d.ts +3 -3
- package/dist/types/components/skeleton/skeleton-shape.vue.d.ts +2 -2
- package/dist/types/components/skeleton/skeleton-text.vue.d.ts +8 -3
- package/dist/types/components/skeleton/skeleton-text.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton.vue.d.ts +1 -1
- package/dist/types/components/toggle/toggle.vue.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.vue.d.ts +2 -2
- package/dist/types/index.d.ts +36 -29
- package/dist/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +1 -1
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +2 -2
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +1 -1
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +2 -2
- package/package.json +18 -58
- package/CHANGELOG.json +0 -1
- package/CHANGELOG.md +0 -2904
- package/dist/dialtone-vue.cjs +0 -6
- package/dist/dialtone-vue.cjs.map +0 -1
- package/dist/directives.cjs +0 -2
- package/dist/directives.cjs.map +0 -1
- package/dist/directives.js.map +0 -1
- package/dist/emoji.cjs +0 -2
- package/dist/emoji.cjs.map +0 -1
- package/dist/emoji.js +0 -36
- package/dist/emoji_picker-kiTOKaq8.js.map +0 -1
- package/dist/emoji_picker-njWWAm6V.cjs +0 -2
- package/dist/emoji_picker-njWWAm6V.cjs.map +0 -1
- package/dist/emoji_text_wrapper-48ClwKvf.js.map +0 -1
- package/dist/emoji_text_wrapper-ZlynvHnd.cjs +0 -2
- package/dist/emoji_text_wrapper-ZlynvHnd.cjs.map +0 -1
- package/dist/index-OF94C6nQ.js +0 -142834
- package/dist/index-OF94C6nQ.js.map +0 -1
- package/dist/index-Wx7Jagcr.cjs +0 -2
- package/dist/index-Wx7Jagcr.cjs.map +0 -1
- package/dist/message_input.cjs +0 -2
- package/dist/message_input.cjs.map +0 -1
- package/dist/message_input.js.map +0 -1
- package/dist/rich_text_editor-RVMsCB8N.cjs +0 -98
- package/dist/rich_text_editor-RVMsCB8N.cjs.map +0 -1
- package/dist/rich_text_editor-eMvTs_Gp.js +0 -16479
- package/dist/rich_text_editor-eMvTs_Gp.js.map +0 -1
- package/dist/tooltip-88U5vFMA.js +0 -2517
- package/dist/tooltip-88U5vFMA.js.map +0 -1
- package/dist/tooltip-i2wxFIIi.cjs +0 -22
- package/dist/tooltip-i2wxFIIi.cjs.map +0 -1
- package/dist/types/common/constants.d.ts.map +0 -1
- package/dist/types/common/dates.d.ts.map +0 -1
- package/dist/types/common/utils.d.ts.map +0 -1
- package/dist/types/common/validators.d.ts.map +0 -1
- package/dist/types/components/emoji_picker/emojis/index.d.ts +0 -50
- package/dist/types/components/emoji_picker/emojis/index.d.ts.map +0 -1
- package/dist/types/directives.d.ts +0 -2
- package/dist/types/directives.d.ts.map +0 -1
- package/dist/types/emoji.d.ts +0 -5
- package/dist/types/emoji.d.ts.map +0 -1
- package/dist/types/message_input.d.ts +0 -3
- package/dist/types/message_input.d.ts.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { intervalToDuration as i, isToday as l, isYesterday as c, isThisWeek as u, isThisYear as s, format as f, formatDuration as m, formatDistance as M } from "date-fns";
|
|
2
|
+
import { capitalizeFirstLetter as D } from "./utils.js";
|
|
3
|
+
import "./constants.js";
|
|
4
|
+
import "vue";
|
|
5
|
+
let r;
|
|
6
|
+
function n(e, t) {
|
|
7
|
+
return o(), f(e, t, {
|
|
8
|
+
locale: r
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function d(e, t) {
|
|
12
|
+
return o(), m(e, {
|
|
13
|
+
locale: r,
|
|
14
|
+
format: t
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function p(e, t) {
|
|
18
|
+
return o(), M(e, t, {
|
|
19
|
+
locale: r
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function E() {
|
|
23
|
+
return r !== void 0;
|
|
24
|
+
}
|
|
25
|
+
function o() {
|
|
26
|
+
if (!E())
|
|
27
|
+
throw new Error("Locale not set, please call setDateLocale(locale) and pass in a datefns locale object as the locale param before calling this function");
|
|
28
|
+
}
|
|
29
|
+
function _(e) {
|
|
30
|
+
r = e;
|
|
31
|
+
}
|
|
32
|
+
function b(e) {
|
|
33
|
+
return n(e, "MMMM d, y");
|
|
34
|
+
}
|
|
35
|
+
function v(e) {
|
|
36
|
+
if (e < 60)
|
|
37
|
+
return p(0, 29 * 1e3);
|
|
38
|
+
const t = i({
|
|
39
|
+
start: 0,
|
|
40
|
+
end: e * 1e3
|
|
41
|
+
});
|
|
42
|
+
return d(t, ["hours", "minutes"]);
|
|
43
|
+
}
|
|
44
|
+
function a(e) {
|
|
45
|
+
const t = new Intl.RelativeTimeFormat(r.code, { numeric: "auto" });
|
|
46
|
+
return D(t.formatToParts(e, "day")[0].value, r.code);
|
|
47
|
+
}
|
|
48
|
+
function F(e) {
|
|
49
|
+
return l(e) ? a(0) : c(e) ? a(-1) : u(e) ? n(e, "EEEE") : s(e) ? n(e, "EEEE, MMMM d") : n(e, "MMMM d, y");
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
v as durationInHHMM,
|
|
53
|
+
b as getDateMedium,
|
|
54
|
+
F as relativeDate,
|
|
55
|
+
_ as setDateLocale
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=dates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dates.js","sources":["../../common/dates/index.js"],"sourcesContent":["import {\n format,\n formatDuration,\n intervalToDuration,\n formatDistance,\n isToday,\n isYesterday,\n isThisWeek,\n isThisYear,\n} from 'date-fns';\nimport { capitalizeFirstLetter } from '../utils';\n\nlet dialtoneLocale;\n\n// Base functions just wrap core date-fns functions, but this allows us to do checks and set default options.\n\nfunction _baseFormat (date, formatString) {\n _checkLocaleSet();\n return format(date, formatString, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _baseFormatDuration (duration, formatString) {\n _checkLocaleSet();\n return formatDuration(duration, {\n locale: dialtoneLocale,\n format: formatString,\n });\n}\n\nfunction _baseFormatDistance (date, baseDate) {\n _checkLocaleSet();\n return formatDistance(date, baseDate, {\n locale: dialtoneLocale,\n });\n}\n\nfunction _isLocaleSet () {\n return dialtoneLocale !== undefined;\n}\n\nfunction _checkLocaleSet () {\n if (!_isLocaleSet()) {\n throw new Error('Locale not set, please call setDateLocale(locale) and pass ' +\n 'in a datefns locale object as the locale param before calling this function');\n }\n}\n\n/**\n * Sets the locale for date-fns. This should be called before any date-fns functions are called.\n * @param {Locale} locale A date-fns locale object\n */\nexport function setDateLocale (locale) {\n dialtoneLocale = locale;\n}\n\n/**\n * This formats a date to the Dialtone standard medium date format as shown here:\n * https://dialtone.dialpad.com/guides/writing-guidelines/#formats-by-length\n * @param {Date} date A javascript date object\n * @returns {string} A string in the format of 'September 2, 2022'\n */\nexport function getDateMedium (date) {\n return _baseFormat(date, 'MMMM d, y');\n}\n\n/**\n * Converts a call duration in total number of seconds to a human readable string\n * such as 'less than a minute' or '4 hours 34 minutes'.\n * @param {number} durationInSeconds The duration of the call in seconds\n * @returns {string} A human readable string representing the duration of the call\n */\nexport function durationInHHMM (durationInSeconds) {\n if (durationInSeconds < 60) {\n // returns 'less than a minute', we're doing it like this instead of returning a string\n // so datefns handles i18n.\n return _baseFormatDistance(0, 29 * 1000);\n }\n const duration = intervalToDuration({\n start: 0,\n end: durationInSeconds * 1000,\n });\n return _baseFormatDuration(duration, ['hours', 'minutes']);\n}\n\n/**\n * gets the human readable name of the day relative to the current time. For example, if you pass in -1 it will\n * say \"Yesterday\" if you pass in 0 it will say \"Today\", if you pass in 1 it will say \"Tomorrow\".\n * @param {number} days The number of days relative to the current time\n * @returns {string} A human readable string representing the distance between the date and now\n */\nfunction _getRelativeDaysText (days) {\n const rtl = new Intl.RelativeTimeFormat(dialtoneLocale.code, { numeric: 'auto' });\n return capitalizeFirstLetter(rtl.formatToParts(days, 'day')[0].value, dialtoneLocale.code);\n}\n\n/**\n * Returns the distance between the passed in date and now in a human readable format, typically used\n * when showing a history of items in a log such as a feed list.\n *\n * datefns does not support 'today' and 'yesterday' without showing time so we use Intl for these cases.\n *\n * examples below to explain\n * the different potential formats:\n *\n * If current day:\n * Today\n *\n * If previous day:\n * Yesterday\n *\n * Older than yesterday, but in the same calendar week:\n * Monday\n *\n * Older than the most recent calendar week, but in the same year:\n * Monday, October 14\n *\n * older than a calendar year:\n * October 14, 2022\n *\n *\n * @param {Date} date The timestamp of the item's date\n * @returns {string} A human readable string representing the distance between the date and now\n */\nexport function relativeDate (date) {\n if (isToday(date)) {\n return _getRelativeDaysText(0);\n } else if (isYesterday(date)) {\n return _getRelativeDaysText(-1);\n } else if (isThisWeek(date)) {\n return _baseFormat(date, 'EEEE');\n } else if (isThisYear(date)) {\n return _baseFormat(date, 'EEEE, MMMM d');\n } else {\n return _baseFormat(date, 'MMMM d, y');\n }\n}\n"],"names":["dialtoneLocale","_baseFormat","date","formatString","_checkLocaleSet","format","_baseFormatDuration","duration","formatDuration","_baseFormatDistance","baseDate","formatDistance","_isLocaleSet","setDateLocale","locale","getDateMedium","durationInHHMM","durationInSeconds","intervalToDuration","_getRelativeDaysText","days","rtl","capitalizeFirstLetter","relativeDate","isToday","isYesterday","isThisWeek","isThisYear"],"mappings":";;;;AAYA,IAAIA;AAIJ,SAASC,EAAaC,GAAMC,GAAc;AACxC,SAAAC,KACOC,EAAOH,GAAMC,GAAc;AAAA,IAChC,QAAQH;AAAA,EACZ,CAAG;AACH;AAEA,SAASM,EAAqBC,GAAUJ,GAAc;AACpD,SAAAC,KACOI,EAAeD,GAAU;AAAA,IAC9B,QAAQP;AAAA,IACR,QAAQG;AAAA,EACZ,CAAG;AACH;AAEA,SAASM,EAAqBP,GAAMQ,GAAU;AAC5C,SAAAN,KACOO,EAAeT,GAAMQ,GAAU;AAAA,IACpC,QAAQV;AAAA,EACZ,CAAG;AACH;AAEA,SAASY,IAAgB;AACvB,SAAOZ,MAAmB;AAC5B;AAEA,SAASI,IAAmB;AAC1B,MAAI,CAACQ,EAAY;AACf,UAAM,IAAI,MAAM,wIAC6D;AAEjF;AAMO,SAASC,EAAeC,GAAQ;AACrC,EAAAd,IAAiBc;AACnB;AAQO,SAASC,EAAeb,GAAM;AACnC,SAAOD,EAAYC,GAAM,WAAW;AACtC;AAQO,SAASc,EAAgBC,GAAmB;AACjD,MAAIA,IAAoB;AAGtB,WAAOR,EAAoB,GAAG,KAAK,GAAI;AAEzC,QAAMF,IAAWW,EAAmB;AAAA,IAClC,OAAO;AAAA,IACP,KAAKD,IAAoB;AAAA,EAC7B,CAAG;AACD,SAAOX,EAAoBC,GAAU,CAAC,SAAS,SAAS,CAAC;AAC3D;AAQA,SAASY,EAAsBC,GAAM;AACnC,QAAMC,IAAM,IAAI,KAAK,mBAAmBrB,EAAe,MAAM,EAAE,SAAS,OAAM,CAAE;AAChF,SAAOsB,EAAsBD,EAAI,cAAcD,GAAM,KAAK,EAAE,CAAC,EAAE,OAAOpB,EAAe,IAAI;AAC3F;AA8BO,SAASuB,EAAcrB,GAAM;AAClC,SAAIsB,EAAQtB,CAAI,IACPiB,EAAqB,CAAC,IACpBM,EAAYvB,CAAI,IAClBiB,EAAqB,EAAE,IACrBO,EAAWxB,CAAI,IACjBD,EAAYC,GAAM,MAAM,IACtByB,EAAWzB,CAAI,IACjBD,EAAYC,GAAM,cAAc,IAEhCD,EAAYC,GAAM,WAAW;AAExC;"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { b as i } from "../chunks/stack_constants-u7tNqGtc.js";
|
|
2
|
+
import { n } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.js";
|
|
3
|
+
const a = ["row", "column"], l = (t) => t.term ? typeof t.term == "string" : !1, o = (t) => t.description ? typeof t.description == "string" : !1, d = (t) => Array.isArray(t) ? t.every((r) => !(typeof r != "object" || !l(r) || !o(r))) : !1, c = {
|
|
4
|
+
name: "DtDescriptionList",
|
|
5
|
+
props: {
|
|
6
|
+
/**
|
|
7
|
+
* The direction for the list
|
|
8
|
+
* @values row, column
|
|
9
|
+
*/
|
|
10
|
+
direction: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: "row",
|
|
13
|
+
validator: (t) => a.includes(t)
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* A list of items that represent the term and the description
|
|
17
|
+
*/
|
|
18
|
+
items: {
|
|
19
|
+
type: Array,
|
|
20
|
+
default: () => [],
|
|
21
|
+
validator: (t) => d(t),
|
|
22
|
+
required: !0
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* Set the space between the elements
|
|
26
|
+
* @values 0, 100, 200, 300, 400, 500, 600
|
|
27
|
+
*/
|
|
28
|
+
gap: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "400",
|
|
31
|
+
validator: (t) => i.includes(t)
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Used to customize the term element
|
|
35
|
+
*/
|
|
36
|
+
termClass: {
|
|
37
|
+
type: [String, Array, Object],
|
|
38
|
+
default: ""
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* Used to customize the description element
|
|
42
|
+
*/
|
|
43
|
+
descriptionClass: {
|
|
44
|
+
type: [String, Array, Object],
|
|
45
|
+
default: ""
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
computed: {
|
|
49
|
+
dtClass() {
|
|
50
|
+
return ["dt-description-list__term", this.termClass];
|
|
51
|
+
},
|
|
52
|
+
ddClass() {
|
|
53
|
+
return ["dt-description-list__description", this.descriptionClass];
|
|
54
|
+
},
|
|
55
|
+
getDirectionClass() {
|
|
56
|
+
return `dt-description-list--${this.direction}`;
|
|
57
|
+
},
|
|
58
|
+
getGapClass() {
|
|
59
|
+
return `dt-description-list--gap-${this.gap}`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var p = function() {
|
|
64
|
+
var r = this, e = r._self._c;
|
|
65
|
+
return e("dl", { class: ["dt-description-list", r.getDirectionClass, r.getGapClass] }, [r._l(r.items, function(s) {
|
|
66
|
+
return [e("dt", { key: `dt-${s.term}`, class: r.dtClass }, [r._v(" " + r._s(s.term) + " ")]), e("dd", { key: `dd-${s.term}`, class: r.ddClass }, [r._v(" " + r._s(s.description) + " ")])];
|
|
67
|
+
})], 2);
|
|
68
|
+
}, u = [], f = /* @__PURE__ */ n(
|
|
69
|
+
c,
|
|
70
|
+
p,
|
|
71
|
+
u,
|
|
72
|
+
!1,
|
|
73
|
+
null,
|
|
74
|
+
null,
|
|
75
|
+
null,
|
|
76
|
+
null
|
|
77
|
+
);
|
|
78
|
+
const y = f.exports;
|
|
79
|
+
export {
|
|
80
|
+
a as DT_DESCRIPTION_LIST_DIRECTION,
|
|
81
|
+
y as DtDescriptionList
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=description-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description-list.js","sources":["../../components/description_list/description_list_constants.js","../../components/description_list/description_list_validators.js","../../components/description_list/description_list.vue"],"sourcesContent":["export const DT_DESCRIPTION_LIST_DIRECTION = ['row', 'column'];\n","const hasValidTerm = item => {\n if (!item.term) {\n return false;\n }\n\n return typeof item.term === 'string';\n};\n\nconst hasValidDescription = item => {\n if (!item.description) {\n return false;\n }\n\n return typeof item.description === 'string';\n};\n\nexport const itemsValidator = items => {\n if (!Array.isArray(items)) {\n return false;\n }\n\n return items.every(item => {\n if (typeof item !== 'object') {\n return false;\n }\n\n if (!hasValidTerm(item)) {\n return false;\n }\n\n if (!hasValidDescription(item)) {\n return false;\n }\n\n return true;\n });\n};\n","<template>\n <dl :class=\"['dt-description-list', getDirectionClass, getGapClass]\">\n <template\n v-for=\"item in items\"\n >\n <dt\n :key=\"`dt-${item.term}`\"\n :class=\"dtClass\"\n >\n {{ item.term }}\n </dt>\n <dd\n :key=\"`dd-${item.term}`\"\n :class=\"ddClass\"\n >\n {{ item.description }}\n </dd>\n </template>\n </dl>\n</template>\n\n<script>\nimport { DT_STACK_GAP } from '../stack/stack_constants';\nimport { DT_DESCRIPTION_LIST_DIRECTION } from './description_list_constants';\nimport { itemsValidator } from './description_list_validators';\n\nexport default {\n name: 'DtDescriptionList',\n\n props: {\n /**\n * The direction for the list\n * @values row, column\n */\n direction: {\n type: String,\n default: 'row',\n validator: direction => DT_DESCRIPTION_LIST_DIRECTION.includes(direction),\n },\n\n /**\n * A list of items that represent the term and the description\n */\n items: {\n type: Array,\n default: () => [],\n validator: items => itemsValidator(items),\n required: true,\n },\n\n /**\n * Set the space between the elements\n * @values 0, 100, 200, 300, 400, 500, 600\n */\n gap: {\n type: String,\n default: '400',\n validator: (gap) => DT_STACK_GAP.includes(gap),\n },\n\n /**\n * Used to customize the term element\n */\n termClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Used to customize the description element\n */\n descriptionClass: {\n type: [String, Array, Object],\n default: '',\n },\n },\n\n computed: {\n dtClass () {\n return ['dt-description-list__term', this.termClass];\n },\n\n ddClass () {\n return ['dt-description-list__description', this.descriptionClass];\n },\n\n getDirectionClass () {\n return `dt-description-list--${this.direction}`;\n },\n\n getGapClass () {\n return `dt-description-list--gap-${this.gap}`;\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n.dt-description-list {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n flex-direction: row;\n line-height: var(--dt-font-line-height-300);\n font-size: var(--dt-font-size-100);\n --description-list-gap: var(--dt-space-400);\n gap: var(--description-list-gap);\n each(range(0, 600, 100), {\n &--gap-@{value} {\n --description-list-gap: ~\"var(--dt-space-@{value})\";\n }\n });\n &--column {\n flex-direction: column;\n }\n &__term {\n color: var(--dt-color-foreground-tertiary);\n flex: 0 1 40%;\n }\n &__description {\n color: var(--dt-color-foreground-primary);\n flex: 1 1 50%;\n margin-left: 0;\n }\n}\n</style>\n"],"names":["DT_DESCRIPTION_LIST_DIRECTION","hasValidTerm","item","hasValidDescription","itemsValidator","items","_sfc_main","direction","gap","DT_STACK_GAP"],"mappings":";;AAAY,MAACA,IAAgC,CAAC,OAAO,QAAQ,GCAvDC,IAAe,CAAAC,MACdA,EAAK,OAIH,OAAOA,EAAK,QAAS,WAHnB,IAMLC,IAAsB,CAAAD,MACrBA,EAAK,cAIH,OAAOA,EAAK,eAAgB,WAH1B,IAMEE,IAAiB,CAAAC,MACvB,MAAM,QAAQA,CAAK,IAIjBA,EAAM,MAAM,CAAAH,MACb,SAAOA,KAAS,YAIhB,CAACD,EAAaC,CAAI,KAIlB,CAACC,EAAoBD,CAAI,EAK9B,IAjBQ,ICQXI,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAAP,EAAA,SAAAO,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,CAAA;AAAA,MACA,WAAA,CAAAF,MAAAD,EAAAC,CAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,KAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAG,MAAAC,EAAA,SAAAD,CAAA;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,kBAAA;AAAA,MACA,MAAA,CAAA,QAAA,OAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,UAAA;AACA,aAAA,CAAA,6BAAA,KAAA,SAAA;AAAA,IACA;AAAA,IAEA,UAAA;AACA,aAAA,CAAA,oCAAA,KAAA,gBAAA;AAAA,IACA;AAAA,IAEA,oBAAA;AACA,aAAA,wBAAA,KAAA,SAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,aAAA,4BAAA,KAAA,GAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { D as G } from "../chunks/dropdown-SMWaTWyF.js";
|
|
2
|
+
import { n as t } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.js";
|
|
3
|
+
import { D as L } from "../chunks/dropdown_constants-EUcDxBrX.js";
|
|
4
|
+
import "../chunks/keyboard_list_navigation-F0O8nht0.js";
|
|
5
|
+
import "./utils.js";
|
|
6
|
+
import "./constants.js";
|
|
7
|
+
import "vue";
|
|
8
|
+
import "../chunks/sr_only_close_button-JGole5Xi.js";
|
|
9
|
+
import "./icon.js";
|
|
10
|
+
import "@dialpad/dialtone-icons/vue2";
|
|
11
|
+
import "../chunks/icon_constants-OpYAAKwF.js";
|
|
12
|
+
import "@dialpad/dialtone-icons/icons.json";
|
|
13
|
+
import "./skeleton.js";
|
|
14
|
+
import "./button.js";
|
|
15
|
+
import "../chunks/link_constants-vIUB92L4.js";
|
|
16
|
+
import "./popover.js";
|
|
17
|
+
import "../chunks/popover_constants-qjlEkroB.js";
|
|
18
|
+
import "tippy.js";
|
|
19
|
+
import "@linusborg/vue-simple-portal";
|
|
20
|
+
import "../chunks/modal-VuMFkZFH.js";
|
|
21
|
+
import "./lazy-show.js";
|
|
22
|
+
import "../chunks/list_item_constants-LTUc74pD.js";
|
|
23
|
+
const p = {
|
|
24
|
+
name: "DtDropdownSeparator"
|
|
25
|
+
};
|
|
26
|
+
var i = function() {
|
|
27
|
+
var r = this, o = r._self._c;
|
|
28
|
+
return o("li", { staticClass: "dt-list-separator", attrs: { "aria-hidden": "true" } });
|
|
29
|
+
}, m = [], a = /* @__PURE__ */ t(
|
|
30
|
+
p,
|
|
31
|
+
i,
|
|
32
|
+
m,
|
|
33
|
+
!1,
|
|
34
|
+
null,
|
|
35
|
+
null,
|
|
36
|
+
null,
|
|
37
|
+
null
|
|
38
|
+
);
|
|
39
|
+
const z = a.exports;
|
|
40
|
+
export {
|
|
41
|
+
L as DROPDOWN_PADDING_CLASSES,
|
|
42
|
+
G as DtDropdown,
|
|
43
|
+
z as DtDropdownSeparator
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.js","sources":["../../components/dropdown/dropdown_separator.vue"],"sourcesContent":["<template>\n <li\n aria-hidden=\"true\"\n class=\"dt-list-separator\"\n />\n</template>\n\n<script>\nexport default {\n name: 'DtDropdownSeparator',\n};\n</script>\n\n<style lang=\"less\">\n.dt-list-item[role=\"menuitem\"] {\n border-radius: var(--dt-size-300);\n}\n.dt-list-separator {\n border-top: var(--dt-size-100) solid var(--dt-color-border-default);\n list-style: none;\n margin: var(--dt-space-300) var(--dt-space-300-negative);\n}\n</style>\n"],"names":["_sfc_main"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAQA,MAAAA,IAAA;AAAA,EACA,MAAA;AACA;;;;;;;;;;;;;;;"}
|