@ironsource/shared-ui 2.1.12-rc.31 → 2.1.12-rc.32
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/DataGrid.vue_vue_type_style_index_0_scoped_36ec94a7_lang.css +1 -0
- package/DataGridHeader.vue_vue_type_style_index_0_scoped_840e700c_lang.css +1 -0
- package/DataGridRowsCounter.vue_vue_type_style_index_0_scoped_e38c881a_lang.css +1 -0
- package/MultipleDataGrid.vue_vue_type_style_index_0_scoped_3caa1d7b_lang.css +1 -0
- package/RadioButton.vue_vue_type_style_index_0_scoped_1da367f8_lang.css +1 -0
- package/TooltipHeader.vue_vue_type_style_index_0_scoped_5160f12d_lang.css +1 -0
- package/components/chart/TooltipHeader.vue.js +2 -2
- package/components/chart/TooltipHeader.vue2.js +21 -20
- package/components/chart/utils/utils.js +14 -13
- package/components/dateRange/common/DateRange.common.js +60 -60
- package/components/radioButton/v3/RadioButton.vue.d.ts +5 -0
- package/components/radioButton/v3/RadioButton.vue.js +3 -3
- package/components/radioButton/v3/RadioButton.vue2.js +32 -31
- package/components/radioButton/v3/index.d.ts +20 -1
- package/components/table/v4/DataGrid.vue.d.ts +4 -4
- package/components/table/v4/DataGrid.vue.js +3 -3
- package/components/table/v4/DataGrid.vue2.js +237 -245
- package/components/table/v4/DataGridHeader.vue.d.ts +85 -0
- package/components/table/v4/DataGridHeader.vue.js +7 -0
- package/components/table/v4/DataGridHeader.vue2.js +82 -0
- package/components/table/v4/DataGridRowsCounter.vue.js +3 -3
- package/components/table/v4/DataGridRowsCounter.vue2.js +12 -12
- package/components/table/v4/MultipleDataGrid.vue.d.ts +6 -5
- package/components/table/v4/MultipleDataGrid.vue.js +2 -2
- package/components/table/v4/MultipleDataGrid.vue2.js +91 -90
- package/components/table/v4/index.d.ts +552 -305
- package/components/table/v4/index.js +7 -4
- package/components/table/v4/storyUtils.d.ts +8 -0
- package/index.d.ts +1578 -1085
- package/index.js +1 -1
- package/package.json +1 -1
- package/utils/date.d.ts +1 -0
- package/utils/date.js +9 -0
- package/utils/formatNumbers.d.ts +1 -1
- package/utils/formatNumbers.js +38 -21
- package/DataGrid.vue_vue_type_style_index_0_scoped_8e8df067_lang.css +0 -1
- package/DataGridRowsCounter.vue_vue_type_style_index_0_scoped_ef699ec5_lang.css +0 -1
- package/MultipleDataGrid.vue_vue_type_style_index_0_scoped_020a9896_lang.css +0 -1
- package/RadioButton.vue_vue_type_style_index_0_scoped_3c6b715c_lang.css +0 -1
- package/TooltipHeader.vue_vue_type_style_index_0_scoped_3b15c693_lang.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.sticky[data-v-36ec94a7]{position:sticky}.table-container[data-v-36ec94a7]{width:100%;position:relative;display:flex;flex-direction:column}.table-head-container[data-v-36ec94a7]{display:flex;align-items:center;white-space:nowrap;color:var(--text-primary)}.table-footer[data-v-36ec94a7]{color:var(--text-primary);background-color:var(--background-paper-elevation-0);padding:0 var(--spacing-300);display:flex;align-items:center;min-height:var(--spacing-600);border:1px solid var(--common-divider);border-radius:var(--border-radius-md);border-top-right-radius:0;border-top-left-radius:0}.table-body-wrapper[data-v-36ec94a7]{display:inline-table}.table-row[data-v-36ec94a7]{position:relative}.table-row.loading[data-v-36ec94a7]{opacity:.7}.table-row:not(.expanded):last-child>td[data-v-36ec94a7]{border-bottom:none}.table-row.expanded:last-child>.expanded-row[data-v-36ec94a7]{border-bottom:none}.expanded-row[data-v-36ec94a7]{grid-column:var(--45c28f25);border-bottom:1px solid var(--common-divider);background-color:var(--background-default)}table[data-v-36ec94a7]{position:relative;display:block;overflow:auto;background:var(--background-paper-elevation-0);border:1px solid var(--common-divider);color:var(--text-primary);text-align:left;table-layout:fixed;width:100%;max-height:100%;border-radius:var(--border-radius-md);border-collapse:collapse;border-spacing:0}table.hasFooter[data-v-36ec94a7]{border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom:none}table td[data-v-36ec94a7],table th[data-v-36ec94a7]{line-height:normal;padding:0 var(--spacing-200)}table td[data-v-36ec94a7]:first-of-type,table th[data-v-36ec94a7]:first-of-type{padding-left:var(--spacing-300)}table td[data-v-36ec94a7]:last-of-type,table th[data-v-36ec94a7]:last-of-type{padding-right:var(--spacing-300)}table td.expand-toggle-cell[data-v-36ec94a7],table th.expand-toggle-cell[data-v-36ec94a7]{padding-left:var(--spacing-150);padding-right:var(--spacing-75)}table>thead[data-v-36ec94a7]{border-bottom:none;z-index:calc(var(--760f151e) + 1);display:inline-table;min-width:100%}table>thead>tr[data-v-36ec94a7]{color:var(--text-primary);border-bottom:1px solid var(--common-divider);height:var(--spacing-500);display:grid;grid-template-columns:var(--b1b12644)}table>thead>tr>th[data-v-36ec94a7]{background:var(--background-paper-elevation-0);width:100%;display:flex;align-items:center;cursor:default}table>thead>tr>th.isSortable[data-v-36ec94a7]{cursor:pointer}table>thead>tr>td[data-v-36ec94a7]{display:flex;align-items:center}table>thead>tr>th.bordered[data-v-36ec94a7],table>thead>tr>td.bordered[data-v-36ec94a7]{border-right:1px solid var(--common-divider)}table>thead>tr>th.bordered.isStickyRight[data-v-36ec94a7],table>thead>tr>td.bordered.isStickyRight[data-v-36ec94a7]{border-right:none;border-left:1px solid var(--common-divider)}table>thead>tr>th.isTextRight[data-v-36ec94a7],table>thead>tr>td.isTextRight[data-v-36ec94a7]{justify-content:flex-end}table>thead.sticky[data-v-36ec94a7]{position:sticky;top:0;background:var(--background-default)}table>thead.isStickyHeader[data-v-36ec94a7]{z-index:calc(var(--760f151e) + 2);top:calc(var(--spacing-800) - 1px)}table .totals-row[data-v-36ec94a7]{height:40px}table .totals-row[data-v-36ec94a7]:hover{background:var(--background-paper-elevation-1)}table .totals-row>td.sticky[data-v-36ec94a7]{background-color:var(--background-default)}table>tbody[data-v-36ec94a7]{display:block}table>tbody>*>tr[data-v-36ec94a7]{background-color:var(--background-default);height:auto;display:grid;align-items:center;grid-template-columns:var(--b1b12644)}table>tbody>*>tr:nth-of-type(2n)>td[data-v-36ec94a7]{background-color:var(--background-default)}table>tbody>*>tr:hover:not(.loading)>td[data-v-36ec94a7],table>tbody>*>tr.activeMenu>td[data-v-36ec94a7]{background-color:var(--background-paper-elevation-1)}table>tbody td[data-v-36ec94a7]{background-color:var(--background-default);border:none;min-width:0;display:flex;height:auto;width:100%;place-items:center;border-bottom:1px solid var(--common-divider);justify-content:start}table>tbody td.bordered[data-v-36ec94a7]{border-right:1px solid var(--common-divider)}table>tbody td.bordered.isStickyRight[data-v-36ec94a7]{border-right:none;border-left:1px solid var(--common-divider)}table>tbody td.isTextRight[data-v-36ec94a7]{justify-content:flex-end;text-align:right}.underlined[data-v-36ec94a7]{border-bottom:.0625rem dashed var(--default-outlined-border)}.underlined[data-v-36ec94a7]:hover{cursor:help}.section-container[data-v-36ec94a7]{left:0}.sections[data-v-36ec94a7]{display:flex}.section[data-v-36ec94a7]{padding:0 1.5rem;background:var(--background-default);left:0;height:32px;display:flex;align-items:flex-end;border-right:1px solid var(--common-divider)}.table-cell[data-v-36ec94a7]{width:100%}.empty-state[data-v-36ec94a7]{min-height:250px}.floating-row[data-v-36ec94a7]{display:flex;inset:0;pointer-events:none;position:absolute;z-index:calc(var(--760f151e) + 1)}.floating-row *[data-v-36ec94a7-s]{pointer-events:auto}.bg[data-v-36ec94a7]{background:var(--background-default)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.table-header[data-v-840e700c]{display:flex;align-items:center;height:calc(var(--spacing-800) - 1px);border-bottom:1px solid var(--common-divider);background-color:var(--background-paper-elevation-0);position:sticky;left:0;padding:var(--spacing-300)}.table-header--standalone[data-v-840e700c]{border:1px solid var(--common-divider);border-top-right-radius:var(--border-radius-md);border-top-left-radius:var(--border-radius-md)}.table-header .table-title[data-v-840e700c]{display:flex;flex:1;align-items:center;justify-content:flex-start;height:100%;color:var(--text-primary)}.table-header .table-header-right[data-v-840e700c]{display:flex;align-items:center;height:100%}.table-header .search-wrapper[data-v-840e700c]{width:13.75rem}.table-header.isStickyHeader[data-v-840e700c]{z-index:calc(var(--c8ef23c8) + 3);top:0}.table-header-pre-search-content[data-v-840e700c]{margin-right:var(--spacing-100);display:flex;align-items:center}.table-header-actions[data-v-840e700c]{margin-left:var(--spacing-100);display:flex;align-items:center}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.data-grid-rows-counter[data-v-e38c881a]{color:var(--text-secondary)}.text-strong[data-v-e38c881a]{color:var(--text-primary)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.multi-table-container[data-v-3caa1d7b]{border-radius:var(--border-radius-md);border:1px solid var(--common-divider);display:flex;flex-direction:column;overflow-y:auto;width:100%}.multi-table-container .multi-table-header[data-v-3caa1d7b]{border-bottom:none;height:calc(var(--spacing-800) - 2px)}.multi-table-container .multi-table-header[data-v-3caa1d7b] .search-wrapper{width:auto}.multi-table-container[data-v-3caa1d7b] table{display:table;border:unset;border-radius:unset}.multi-table-container[data-v-3caa1d7b] thead{border-top:1px solid var(--common-divider)}.multi-table-container .tables-container[data-v-3caa1d7b] thead.sticky{top:62px}.multi-table-container .empty-state[data-v-3caa1d7b]{min-height:250px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.label[data-v-1da367f8]{color:#41454d}.radio-button[data-v-1da367f8]{display:flex;align-items:flex-start}.radio-button--disabled[data-v-1da367f8]{opacity:.7;cursor:default}.radio-button--disabled .label[data-v-1da367f8]{cursor:default}.helper-text[data-v-1da367f8]{margin-left:-1.5rem;margin-top:.25rem;color:#53575b}.helper-text--error[data-v-1da367f8]{color:#da564f}.helper-text--text[data-v-1da367f8]{color:#696a6b}.wrapper[data-v-1da367f8]{display:inline-flex;align-items:center;justify-content:center;position:relative;box-sizing:border-box;background-color:transparent;outline:0;border:0;margin:0;cursor:pointer;user-select:none;vertical-align:middle;appearance:none;text-decoration:none;padding:.125rem .5rem;border-radius:50%}.label[data-v-1da367f8]{cursor:pointer;color:#53575b;flex-direction:column;display:inline-flex}.circle[data-v-1da367f8]{border-radius:50%;width:16px;transition:all .2s ease-in-out 0s;height:16px}.circle[data-v-1da367f8]:not(.circle--selected){box-shadow:#a9afb4 0 0 0 2px inset}.circle--selected[data-v-1da367f8]{background-color:#3083ff}.circle[data-v-1da367f8]:before{display:block;width:16px;height:16px;background-image:radial-gradient(rgb(255,255,255),rgb(255,255,255) 3px,transparent 28%);content:""}input[data-v-1da367f8]{cursor:inherit;position:absolute;opacity:0;width:100%;height:100%;top:0;left:0;margin:0;padding:0;z-index:1}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.tooltip-title-wrapper[data-v-5160f12d]{display:flex;flex-direction:column;color:var(--text-primary);margin-bottom:var(--spacing-100)}.tooltip-title-wrapper .main-title[data-v-5160f12d]{display:flex;align-items:center;gap:.25rem}.tooltip-title-wrapper .title-text[data-v-5160f12d]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.tooltip-title-wrapper .title-image[data-v-5160f12d]{width:20px;height:20px;border-radius:4px}.tooltip-title-wrapper .tooltip-sub-title[data-v-5160f12d]{color:var(--text-secondary)}.tooltip-title-wrapper .platform-icon[data-v-5160f12d]{color:var(--action-active)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TooltipHeader.vue2.js";
|
|
2
2
|
/* empty css */import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../TooltipHeader.
|
|
4
|
-
const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-
|
|
3
|
+
// import "../../TooltipHeader.vue_vue_type_style_index_0_scoped_5160f12d_lang.css"; //*');
|
|
4
|
+
const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-5160f12d"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import "../../TooltipHeader.
|
|
1
|
+
import "../../TooltipHeader.vue_vue_type_style_index_0_scoped_5160f12d_lang.css"; import { defineComponent as v, computed as u, openBlock as i, createElementBlock as f, createElementVNode as A, unref as t, createCommentVNode as s, createBlock as m, createVNode as D, withCtx as d, createTextVNode as x, toDisplayString as p } from "vue";
|
|
2
|
+
import { getUTCDate as T } from "../../utils/date.js";
|
|
2
3
|
import { formatValue as r } from "./utils/utils.js";
|
|
3
4
|
import y from "../typography/v4/Typography.vue.js";
|
|
4
5
|
import { DateInterval as c } from "./types.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { startOfWeek as
|
|
8
|
-
import { LONG_DATE_FORMAT as
|
|
9
|
-
const
|
|
6
|
+
import k from "../icon/v4/IconV4.vue.js";
|
|
7
|
+
import C from "../icon/v4/IconFlag.vue.js";
|
|
8
|
+
import { startOfWeek as F, endOfWeek as I, startOfMonth as O, endOfMonth as E } from "date-fns";
|
|
9
|
+
import { LONG_DATE_FORMAT as n } from "./consts.js";
|
|
10
|
+
const N = { class: "tooltip-title-wrapper" }, L = { class: "main-title" }, M = ["src"], S = /* @__PURE__ */ v({
|
|
10
11
|
__name: "TooltipHeader",
|
|
11
12
|
props: {
|
|
12
13
|
title: { default: "" },
|
|
@@ -16,25 +17,25 @@ const E = { class: "tooltip-title-wrapper" }, N = { class: "main-title" }, L = [
|
|
|
16
17
|
totalsChart: { type: Boolean, default: !1 }
|
|
17
18
|
},
|
|
18
19
|
setup(a) {
|
|
19
|
-
const e = a, o =
|
|
20
|
-
${r(
|
|
21
|
-
${r(
|
|
20
|
+
const e = a, o = u(() => e.dataPoints.length ? e.dataPoints[0].dataset : null), h = u(() => e.totalsChart ? o.value?.label || e.title : e.xAxisFormat === "date" ? g(T(e.title)) : r(e.title, e.xAxisFormat)), g = (l) => e.xAxisDateInterval === c.WEEKLY ? `
|
|
21
|
+
${r(F(l), n)} -
|
|
22
|
+
${r(I(l), n)}
|
|
22
23
|
` : e.xAxisDateInterval === c.MONTHLY ? `
|
|
23
|
-
${r(
|
|
24
|
-
${r(
|
|
25
|
-
` : r(l,
|
|
26
|
-
return (l,
|
|
27
|
-
A("div",
|
|
28
|
-
a.totalsChart && t(o)?.image ? (
|
|
24
|
+
${r(O(l), n)} -
|
|
25
|
+
${r(E(l), n)}
|
|
26
|
+
` : r(l, n);
|
|
27
|
+
return (l, V) => (i(), f("div", N, [
|
|
28
|
+
A("div", L, [
|
|
29
|
+
a.totalsChart && t(o)?.image ? (i(), f("img", {
|
|
29
30
|
key: 0,
|
|
30
31
|
class: "title-image",
|
|
31
32
|
src: t(o)?.image
|
|
32
|
-
}, null, 8,
|
|
33
|
-
a.totalsChart && t(o)?.countryFlag ? (
|
|
33
|
+
}, null, 8, M)) : s("", !0),
|
|
34
|
+
a.totalsChart && t(o)?.countryFlag ? (i(), m(t(C), {
|
|
34
35
|
key: 1,
|
|
35
36
|
"country-code": t(o).countryFlag
|
|
36
37
|
}, null, 8, ["country-code"])) : s("", !0),
|
|
37
|
-
a.totalsChart && t(o)?.icon ? (
|
|
38
|
+
a.totalsChart && t(o)?.icon ? (i(), m(t(k), {
|
|
38
39
|
key: 2,
|
|
39
40
|
class: "platform-icon",
|
|
40
41
|
type: t(o)?.iconType,
|
|
@@ -51,7 +52,7 @@ const E = { class: "tooltip-title-wrapper" }, N = { class: "main-title" }, L = [
|
|
|
51
52
|
_: 1
|
|
52
53
|
})
|
|
53
54
|
]),
|
|
54
|
-
a.xAxisFormat === "date" && a.xAxisDateInterval !== t(c).WEEKLY && a.xAxisDateInterval !== t(c).MONTHLY ? (
|
|
55
|
+
a.xAxisFormat === "date" && a.xAxisDateInterval !== t(c).WEEKLY && a.xAxisDateInterval !== t(c).MONTHLY ? (i(), m(t(y), {
|
|
55
56
|
key: 0,
|
|
56
57
|
class: "tooltip-sub-title",
|
|
57
58
|
variant: "caption"
|
|
@@ -65,5 +66,5 @@ const E = { class: "tooltip-title-wrapper" }, N = { class: "main-title" }, L = [
|
|
|
65
66
|
}
|
|
66
67
|
});
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
+
S as default
|
|
69
70
|
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
+
import { getUTCDate as n } from "../../../utils/date.js";
|
|
1
2
|
import { format as e } from "date-fns";
|
|
2
|
-
import { TICK_LABEL_FONT as
|
|
3
|
-
import { nFormatter as
|
|
4
|
-
import { truncateTextToFit as
|
|
5
|
-
import { REGEX_LINEBREAK as
|
|
6
|
-
const
|
|
3
|
+
import { TICK_LABEL_FONT as E } from "../consts.js";
|
|
4
|
+
import { nFormatter as c } from "../../../utils/formatNumbers.js";
|
|
5
|
+
import { truncateTextToFit as T } from "../../../utils/text.js";
|
|
6
|
+
import { REGEX_LINEBREAK as i } from "../../../consts/regex.js";
|
|
7
|
+
const u = (r, t, o = !1) => t === "day" ? e(n(r), "EEEE") : t === "number" ? c(r, o) : t === "date" ? e(n(r), "MMM dd") : t === "dateLong" ? e(n(r), "MMM dd, yyyy") : String(r), _ = ({
|
|
7
8
|
label: r,
|
|
8
9
|
format: t,
|
|
9
|
-
availableSpace:
|
|
10
|
-
truncate:
|
|
10
|
+
availableSpace: o,
|
|
11
|
+
truncate: s = !1
|
|
11
12
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
return
|
|
13
|
+
const p = i.test(r), f = (d) => {
|
|
14
|
+
const m = u(d, t);
|
|
15
|
+
return s && o > 0 ? T(m, E, o) : m;
|
|
15
16
|
};
|
|
16
|
-
return
|
|
17
|
+
return p ? r.split(i).map(f) : f(r);
|
|
17
18
|
};
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
u as formatValue,
|
|
21
|
+
_ as prepareTickLabel
|
|
21
22
|
};
|
|
@@ -3,13 +3,13 @@ import { useToggle as fe } from "../../../composables/useToggle.js";
|
|
|
3
3
|
import { ref as r, computed as b, onMounted as de, onBeforeMount as ce, onUnmounted as ve, watch as Q } from "vue";
|
|
4
4
|
import { min as me, addDays as ge, format as X } from "date-fns";
|
|
5
5
|
import { presetsList as he, formatError as De, mandatoryValuesError as Me, navigatePrev as Z, navigateNext as V } from "./consts.common.js";
|
|
6
|
-
import
|
|
6
|
+
import d from "./DateServices.common.js";
|
|
7
7
|
const pe = (o, y) => {
|
|
8
|
-
const N = r(null),
|
|
8
|
+
const N = r(null), c = r({ started: !1, date: null }), x = r(!1), _ = 2, T = r({ from: null, to: null }), u = r({}), g = r([]), k = r(null), i = r({}), p = r({}), E = r(!1), w = r(null), s = r(null), j = r("left"), P = r(null), O = r(null), C = r([]), K = r(null), [D] = fe({ initialValue: !1 }), q = r(null);
|
|
9
9
|
ie(q, () => {
|
|
10
10
|
D.value = !1;
|
|
11
11
|
});
|
|
12
|
-
const
|
|
12
|
+
const U = (e, t) => {
|
|
13
13
|
const a = {
|
|
14
14
|
weeks: [],
|
|
15
15
|
days: {},
|
|
@@ -17,20 +17,20 @@ const pe = (o, y) => {
|
|
|
17
17
|
year: t
|
|
18
18
|
};
|
|
19
19
|
let n, l;
|
|
20
|
-
const
|
|
21
|
-
let
|
|
22
|
-
const f =
|
|
20
|
+
const v = new Date(t, e, 1).getDay();
|
|
21
|
+
let m = 1;
|
|
22
|
+
const f = d.getCurrentTimeUTC();
|
|
23
23
|
f.setHours(0, 0, 0, 0);
|
|
24
|
-
const ue =
|
|
24
|
+
const ue = d.daysInMonth(e, t);
|
|
25
25
|
for (let I = 0; I < 6; I++) {
|
|
26
26
|
l = [];
|
|
27
27
|
for (let H = 0; H < 7; H++)
|
|
28
|
-
n = {}, I === 0 &&
|
|
28
|
+
n = {}, I === 0 && v > 0 && H < v && (n.value = 0), m > ue && (n.value = 0), !n.value && n.value !== 0 && (n.value = m, m += 1, a.days[n.value] = n, n.date = new Date(t, e, n.value), f < n.date ? n.isFuture = !0 : n.date.getTime() === f.getTime() && (n.isToday = !0, o.includeToday || (n.disabled = !0))), l.push(n);
|
|
29
29
|
a.weeks.push(l);
|
|
30
30
|
}
|
|
31
31
|
return a;
|
|
32
|
-
},
|
|
33
|
-
let e =
|
|
32
|
+
}, S = () => {
|
|
33
|
+
let e = d.getCurrentTimeUTC();
|
|
34
34
|
if (s.value && s.value.toEnd ? e = s.value.toEnd : o.range && o.range.to && (e = o.range.to), !u.value[`${e.getFullYear().toString()}_${e.getMonth().toString()}`]) {
|
|
35
35
|
u.value = {}, g.value = [];
|
|
36
36
|
for (let t = 0; t < _; t++) {
|
|
@@ -38,7 +38,7 @@ const pe = (o, y) => {
|
|
|
38
38
|
a.setDate(1), a.setMonth(e.getMonth() - t);
|
|
39
39
|
const n = `${a.getFullYear().toString()}_${a.getMonth().toString()}`;
|
|
40
40
|
u.value[n] = {
|
|
41
|
-
parsedMonth:
|
|
41
|
+
parsedMonth: U(
|
|
42
42
|
a.getMonth(),
|
|
43
43
|
a.getFullYear()
|
|
44
44
|
),
|
|
@@ -49,28 +49,28 @@ const pe = (o, y) => {
|
|
|
49
49
|
}, z = (e, t) => {
|
|
50
50
|
w.value = e;
|
|
51
51
|
let a = e;
|
|
52
|
-
e === "date" && (a = o.datePresetList),
|
|
52
|
+
e === "date" && (a = o.datePresetList), C.value = he[a], t && (s.value = {
|
|
53
53
|
fromStart: null,
|
|
54
54
|
fromEnd: null,
|
|
55
55
|
toStart: null,
|
|
56
56
|
toEnd: null
|
|
57
|
-
},
|
|
57
|
+
}, T.value.from = "", T.value.to = "", c.value = { started: !1, date: null }, i.value = "custom"), y("rangeTypeChanged", w.value);
|
|
58
58
|
}, ee = (e) => {
|
|
59
|
-
i.value = e.id, M(k.value[e.id].dates()),
|
|
59
|
+
i.value = e.id, M(k.value[e.id].dates()), S();
|
|
60
60
|
}, M = (e, t = !1) => {
|
|
61
61
|
let a = e;
|
|
62
|
-
return !e.from && !e.to && e.preset ? a = k.value[e.preset]?.dates() : (!e || !e.from && !e.to) && (a = k.value[
|
|
62
|
+
return !e.from && !e.to && e.preset ? a = k.value[e.preset]?.dates() : (!e || !e.from && !e.to) && (a = k.value[C.value[0]]), o.maxDaysInRange && (K.value = t ? ge(a.from, o.maxDaysInRange) : null), E.value = !1, !a.from || !a.to || !(a.from instanceof Date) || !(a.to instanceof Date) ? (O.value = De, E.value = !0, !1) : a.from > a.to ? (O.value = `"From" date can't be bigger than "To" date`, E.value = !0, !1) : (s.value = R(a), T.value.from = X(
|
|
63
63
|
s.value.fromStart,
|
|
64
64
|
o.dateFormat
|
|
65
|
-
),
|
|
65
|
+
), T.value.to = X(s.value.toEnd, o.dateFormat), !0);
|
|
66
66
|
}, F = () => {
|
|
67
|
-
i.value === "custom" ? P.value =
|
|
67
|
+
i.value === "custom" ? P.value = d.getDateRangeString(s.value) : P.value = J.value, y("currentDateChanged", P.value);
|
|
68
68
|
}, te = () => {
|
|
69
69
|
if (s.value.fromStart == null || s.value.toEnd == null) {
|
|
70
|
-
|
|
70
|
+
E.value = !0, O.value = Me;
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
const e =
|
|
73
|
+
const e = d.getCurrentTimeUTC();
|
|
74
74
|
s.value.toEnd > e && (s.value.toEnd = e), F(), p.value = i.value, y("rangeChanged", {
|
|
75
75
|
from: s.value.fromStart,
|
|
76
76
|
to: s.value.toEnd,
|
|
@@ -79,29 +79,29 @@ const pe = (o, y) => {
|
|
|
79
79
|
}, ae = (e, t) => e ? Z : t ? V : null, ne = (e) => {
|
|
80
80
|
let t = null, a = null;
|
|
81
81
|
const n = _ - 1;
|
|
82
|
-
let l = "", h = null,
|
|
82
|
+
let l = "", h = null, v = null;
|
|
83
83
|
switch (e) {
|
|
84
84
|
case V:
|
|
85
|
-
Object.keys(u.value).forEach((
|
|
86
|
-
const f = u.value[
|
|
85
|
+
Object.keys(u.value).forEach((m) => {
|
|
86
|
+
const f = u.value[m];
|
|
87
87
|
f.order === 0 && (h = f), f.order === n ? (g.value.splice(
|
|
88
|
-
g.value.indexOf(
|
|
88
|
+
g.value.indexOf(m),
|
|
89
89
|
1
|
|
90
|
-
), delete u.value[
|
|
90
|
+
), delete u.value[m]) : f.order += 1;
|
|
91
91
|
}), t = h.parsedMonth.month + 1, a = h.parsedMonth.year, t > 11 && (t = 0, a += 1), l = `${a.toString()}_${t.toString()}`, u.value[l] = {
|
|
92
|
-
parsedMonth:
|
|
92
|
+
parsedMonth: U(t, a),
|
|
93
93
|
order: 0
|
|
94
94
|
}, g.value.push(l);
|
|
95
95
|
break;
|
|
96
96
|
case Z:
|
|
97
|
-
Object.keys(u.value).forEach((
|
|
98
|
-
const f = u.value[
|
|
99
|
-
f.order === n && (
|
|
100
|
-
g.value.indexOf(
|
|
97
|
+
Object.keys(u.value).forEach((m) => {
|
|
98
|
+
const f = u.value[m];
|
|
99
|
+
f.order === n && (v = f), f.order === 0 ? (g.value.splice(
|
|
100
|
+
g.value.indexOf(m),
|
|
101
101
|
1
|
|
102
|
-
), delete u.value[
|
|
103
|
-
}), t =
|
|
104
|
-
parsedMonth:
|
|
102
|
+
), delete u.value[m]) : f.order -= 1;
|
|
103
|
+
}), t = v.parsedMonth.month - 1, a = v.parsedMonth.year, t < 0 && (t = 11, a -= 1), l = `${a.toString()}_${t.toString()}`, u.value[l] = {
|
|
104
|
+
parsedMonth: U(t, a),
|
|
105
105
|
order: n
|
|
106
106
|
}, g.value.unshift(l);
|
|
107
107
|
break;
|
|
@@ -111,10 +111,10 @@ const pe = (o, y) => {
|
|
|
111
111
|
switch (w.value) {
|
|
112
112
|
case "week":
|
|
113
113
|
t = {
|
|
114
|
-
fromStart:
|
|
115
|
-
fromEnd:
|
|
116
|
-
toStart:
|
|
117
|
-
toEnd:
|
|
114
|
+
fromStart: d.getFirstDayOfWeek(e.from),
|
|
115
|
+
fromEnd: d.getLastDayOfWeek(e.from),
|
|
116
|
+
toStart: d.getFirstDayOfWeek(e.to),
|
|
117
|
+
toEnd: d.getLastDayOfWeek(e.to)
|
|
118
118
|
};
|
|
119
119
|
break;
|
|
120
120
|
case "month":
|
|
@@ -124,13 +124,13 @@ const pe = (o, y) => {
|
|
|
124
124
|
e.from.getMonth(),
|
|
125
125
|
1
|
|
126
126
|
),
|
|
127
|
-
fromEnd:
|
|
127
|
+
fromEnd: d.getLastDayOfMonth(e.from),
|
|
128
128
|
toStart: new Date(
|
|
129
129
|
e.to.getFullYear(),
|
|
130
130
|
e.to.getMonth(),
|
|
131
131
|
1
|
|
132
132
|
),
|
|
133
|
-
toEnd:
|
|
133
|
+
toEnd: d.getLastDayOfMonth(e.to)
|
|
134
134
|
};
|
|
135
135
|
break;
|
|
136
136
|
case "date":
|
|
@@ -144,10 +144,10 @@ const pe = (o, y) => {
|
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
146
|
return t;
|
|
147
|
-
},
|
|
147
|
+
}, L = (e, t) => e.getUTCFullYear() === t.getUTCFullYear() && e.getUTCMonth() === t.getUTCMonth() && e.getUTCDate() === t.getUTCDate(), $ = (e) => {
|
|
148
148
|
let t = !1;
|
|
149
149
|
if (!e.from && !e.to && e.preset) {
|
|
150
|
-
const l =
|
|
150
|
+
const l = C.value.find(
|
|
151
151
|
(h) => h.id === e.preset
|
|
152
152
|
);
|
|
153
153
|
i.value = l.id, t = !0;
|
|
@@ -157,15 +157,15 @@ const pe = (o, y) => {
|
|
|
157
157
|
to: new Date(e.to)
|
|
158
158
|
};
|
|
159
159
|
a.from.setHours(0, 0, 0, 0), a.to.setHours(0, 0, 0, 0);
|
|
160
|
-
const n =
|
|
160
|
+
const n = C.value.map((l) => l.id);
|
|
161
161
|
if (Object.keys(k.value).forEach((l) => {
|
|
162
162
|
const h = k.value[l];
|
|
163
163
|
if (l !== "custom" && !t && n.indexOf(l) !== -1) {
|
|
164
|
-
const
|
|
165
|
-
|
|
164
|
+
const v = h.dates();
|
|
165
|
+
v.from.setHours(0, 0, 0, 0), v.to.setHours(0, 0, 0, 0), L(v.from, a.from) && L(v.to, a.to) && (i.value = l, t = !0);
|
|
166
166
|
}
|
|
167
167
|
}), t) {
|
|
168
|
-
const l =
|
|
168
|
+
const l = C.value.find(
|
|
169
169
|
(h) => h.id === i.value
|
|
170
170
|
);
|
|
171
171
|
y("dateRangePresetNameChanged", l.name);
|
|
@@ -173,24 +173,24 @@ const pe = (o, y) => {
|
|
|
173
173
|
y("dateRangePresetNameChanged", null), i.value = "custom";
|
|
174
174
|
p.value = i.value;
|
|
175
175
|
}, A = (e, t, a) => {
|
|
176
|
-
if (!
|
|
177
|
-
i.value = "custom",
|
|
178
|
-
{ from:
|
|
176
|
+
if (!c.value.started)
|
|
177
|
+
i.value = "custom", c.value.started = !0, c.value.date = new Date(a, t, e.value), M(
|
|
178
|
+
{ from: c.value.date, to: c.value.date },
|
|
179
179
|
!0
|
|
180
180
|
);
|
|
181
181
|
else {
|
|
182
|
-
const n = new Date(a, t, e.value), l =
|
|
183
|
-
|
|
182
|
+
const n = new Date(a, t, e.value), l = c.value.date;
|
|
183
|
+
c.value.started = !1, c.value.date = null, n < l ? A(e, t, a) : M({ from: l, to: n });
|
|
184
184
|
}
|
|
185
185
|
}, B = () => {
|
|
186
186
|
const e = N.value.offsetLeft;
|
|
187
187
|
return window.innerWidth - e > 930 ? "left" : "right";
|
|
188
188
|
}, W = (e = !0) => {
|
|
189
|
-
D.value = !D.value, D.value ? (j.value = B(), M(o.range),
|
|
189
|
+
D.value = !D.value, D.value ? (j.value = B(), M(o.range), S(), y("opened")) : (M(o.range), S(), i.value = p.value, e && y("dismissed"));
|
|
190
190
|
}, G = () => {
|
|
191
191
|
D.value && W();
|
|
192
192
|
}, le = () => {
|
|
193
|
-
k.value =
|
|
193
|
+
k.value = d.getPresetsFunctions(o.includeToday), k.value.custom = {
|
|
194
194
|
dates: () => o.range
|
|
195
195
|
};
|
|
196
196
|
}, oe = b(() => (g.value || []).reduce((e, t) => {
|
|
@@ -199,7 +199,7 @@ const pe = (o, y) => {
|
|
|
199
199
|
).length;
|
|
200
200
|
return e && !n;
|
|
201
201
|
}, !0)), Y = () => {
|
|
202
|
-
o.range && (x.value = !0, z(o.initialType || o.types[0]), le(), $(o.range), M(o.range),
|
|
202
|
+
o.range && (x.value = !0, z(o.initialType || o.types[0]), le(), $(o.range), M(o.range), S(), F());
|
|
203
203
|
};
|
|
204
204
|
de(() => {
|
|
205
205
|
Y();
|
|
@@ -216,10 +216,10 @@ const pe = (o, y) => {
|
|
|
216
216
|
e && e !== t && (x.value ? ($(e), M(e), F()) : Y());
|
|
217
217
|
}
|
|
218
218
|
), Q(D, (e) => {
|
|
219
|
-
e || (
|
|
219
|
+
e || (c.value.started = !1);
|
|
220
220
|
});
|
|
221
221
|
const J = b(() => {
|
|
222
|
-
const e =
|
|
222
|
+
const e = C.value.find(
|
|
223
223
|
(t) => t.id === i.value
|
|
224
224
|
);
|
|
225
225
|
return e ? e.name : "";
|
|
@@ -233,21 +233,21 @@ const pe = (o, y) => {
|
|
|
233
233
|
getMaxAllowedDate: se,
|
|
234
234
|
selectedPresetName: J,
|
|
235
235
|
selectedPreset: i,
|
|
236
|
-
displayError:
|
|
236
|
+
displayError: E,
|
|
237
237
|
rangeType: w,
|
|
238
238
|
selectedRange: s,
|
|
239
239
|
placement: j,
|
|
240
240
|
currentDate: P,
|
|
241
241
|
error: O,
|
|
242
|
-
presets:
|
|
242
|
+
presets: C,
|
|
243
243
|
isOpen: D,
|
|
244
244
|
popup: q,
|
|
245
|
-
selectionStart:
|
|
245
|
+
selectionStart: c,
|
|
246
246
|
initialized: x,
|
|
247
|
-
textDates:
|
|
247
|
+
textDates: T,
|
|
248
248
|
currentMonths: u,
|
|
249
249
|
displayedMonthsKeys: g,
|
|
250
|
-
initMonths:
|
|
250
|
+
initMonths: S,
|
|
251
251
|
changeType: z,
|
|
252
252
|
presetChanged: ee,
|
|
253
253
|
initRange: M,
|
|
@@ -256,7 +256,7 @@ const pe = (o, y) => {
|
|
|
256
256
|
getNavigation: ae,
|
|
257
257
|
navigationCallback: ne,
|
|
258
258
|
getSelectedRangeByType: R,
|
|
259
|
-
compareDates:
|
|
259
|
+
compareDates: L,
|
|
260
260
|
determinePreset: $,
|
|
261
261
|
selectionChanged: A,
|
|
262
262
|
checkPlacement: B,
|
|
@@ -5,6 +5,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
5
5
|
errorText?: string;
|
|
6
6
|
modelValue?: string;
|
|
7
7
|
testId?: string;
|
|
8
|
+
disabledButton?: boolean;
|
|
8
9
|
}>, {
|
|
9
10
|
label: string;
|
|
10
11
|
name: string;
|
|
@@ -12,6 +13,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
12
13
|
errorText: string;
|
|
13
14
|
modelValue: any;
|
|
14
15
|
testId: string;
|
|
16
|
+
disabledButton: boolean;
|
|
15
17
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
18
|
"update:modelValue": (...args: any[]) => void;
|
|
17
19
|
change: (...args: any[]) => void;
|
|
@@ -22,6 +24,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
22
24
|
errorText?: string;
|
|
23
25
|
modelValue?: string;
|
|
24
26
|
testId?: string;
|
|
27
|
+
disabledButton?: boolean;
|
|
25
28
|
}>, {
|
|
26
29
|
label: string;
|
|
27
30
|
name: string;
|
|
@@ -29,6 +32,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
29
32
|
errorText: string;
|
|
30
33
|
modelValue: any;
|
|
31
34
|
testId: string;
|
|
35
|
+
disabledButton: boolean;
|
|
32
36
|
}>>> & {
|
|
33
37
|
onChange?: (...args: any[]) => any;
|
|
34
38
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
|
@@ -39,6 +43,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
39
43
|
modelValue: string;
|
|
40
44
|
helperText: string;
|
|
41
45
|
errorText: string;
|
|
46
|
+
disabledButton: boolean;
|
|
42
47
|
}>, {
|
|
43
48
|
default?(_: {}): any;
|
|
44
49
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RadioButton.vue2.js";
|
|
2
2
|
/* empty css */import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../../RadioButton.
|
|
4
|
-
const
|
|
3
|
+
// import "../../../RadioButton.vue_vue_type_style_index_0_scoped_1da367f8_lang.css"; //*');
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1da367f8"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../../../RadioButton.
|
|
1
|
+
import "../../../RadioButton.vue_vue_type_style_index_0_scoped_1da367f8_lang.css"; import { defineComponent as y, openBlock as n, createElementBlock as E, normalizeClass as T, unref as t, createElementVNode as r, withDirectives as I, mergeProps as u, isRef as C, vModelRadio as N, renderSlot as g, createVNode as w, withCtx as i, createTextVNode as f, toDisplayString as m, createBlock as v, createCommentVNode as R } from "vue";
|
|
2
2
|
import c from "../../typography/Text.vue.js";
|
|
3
3
|
import { useRadio as z } from "../common/useRadio.js";
|
|
4
4
|
import { RadioTestIdModifiers as o } from "../../../testids/index.js";
|
|
5
5
|
import { useTestIdAttrs as A } from "../../../utils/testIds.js";
|
|
6
|
-
const D = { class: "wrapper" }, L = ["value", "name", "disabled"], O = /* @__PURE__ */
|
|
6
|
+
const D = { class: "wrapper" }, L = ["value", "name", "disabled"], O = /* @__PURE__ */ y({
|
|
7
7
|
__name: "RadioButton",
|
|
8
8
|
props: {
|
|
9
9
|
label: { default: "" },
|
|
@@ -11,62 +11,63 @@ const D = { class: "wrapper" }, L = ["value", "name", "disabled"], O = /* @__PUR
|
|
|
11
11
|
helperText: { default: "" },
|
|
12
12
|
errorText: { default: "" },
|
|
13
13
|
modelValue: { default: void 0 },
|
|
14
|
-
testId: { default: "" }
|
|
14
|
+
testId: { default: "" },
|
|
15
|
+
disabledButton: { type: Boolean, default: !1 }
|
|
15
16
|
},
|
|
16
17
|
emits: ["update:modelValue", "change"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
), d = A(
|
|
22
|
-
return (
|
|
23
|
-
class:
|
|
18
|
+
setup(e, { emit: B }) {
|
|
19
|
+
const x = e, { radioRef: V, focus: p, disabled: b, modelValue: a, radioGroup: h } = z(
|
|
20
|
+
x,
|
|
21
|
+
B
|
|
22
|
+
), d = A(x.testId, o);
|
|
23
|
+
return (k, l) => (n(), E("label", {
|
|
24
|
+
class: T(["radio-button", { "radio-button--disabled": t(b) }])
|
|
24
25
|
}, [
|
|
25
26
|
r("span", D, [
|
|
26
|
-
|
|
27
|
+
I(r("input", u({
|
|
27
28
|
ref_key: "radioRef",
|
|
28
|
-
ref:
|
|
29
|
+
ref: V,
|
|
29
30
|
"onUpdate:modelValue": l[0] || (l[0] = (s) => C(a) ? a.value = s : null),
|
|
30
|
-
value:
|
|
31
|
-
name:
|
|
31
|
+
value: e.label,
|
|
32
|
+
name: e.name || t(h)?.name,
|
|
32
33
|
type: "radio",
|
|
33
|
-
disabled:
|
|
34
|
-
},
|
|
35
|
-
onFocus: l[1] || (l[1] = (s) =>
|
|
36
|
-
onBlur: l[2] || (l[2] = (s) =>
|
|
34
|
+
disabled: t(b) || e.disabledButton
|
|
35
|
+
}, t(d)[t(o).FIELD], {
|
|
36
|
+
onFocus: l[1] || (l[1] = (s) => p.value = !0),
|
|
37
|
+
onBlur: l[2] || (l[2] = (s) => p.value = !1)
|
|
37
38
|
}), null, 16, L), [
|
|
38
|
-
[N,
|
|
39
|
+
[N, t(a)]
|
|
39
40
|
]),
|
|
40
41
|
r("span", {
|
|
41
|
-
class:
|
|
42
|
+
class: T([{ "circle--selected": t(a) === e.label }, "circle"])
|
|
42
43
|
}, null, 2)
|
|
43
44
|
]),
|
|
44
|
-
r("span",
|
|
45
|
-
g(
|
|
45
|
+
r("span", u({ class: "label" }, t(d)[t(o).LABEL]), [
|
|
46
|
+
g(k.$slots, "default", {}, () => [
|
|
46
47
|
w(c, { "is-truncated": "" }, {
|
|
47
|
-
default:
|
|
48
|
-
m(
|
|
48
|
+
default: i(() => [
|
|
49
|
+
f(m(e.label), 1)
|
|
49
50
|
]),
|
|
50
51
|
_: 1
|
|
51
52
|
})
|
|
52
53
|
], !0),
|
|
53
|
-
!
|
|
54
|
+
!e.errorText && e.helperText ? (n(), v(c, {
|
|
54
55
|
key: 0,
|
|
55
56
|
class: "helper-text--text helper-text",
|
|
56
57
|
size: "caption"
|
|
57
58
|
}, {
|
|
58
|
-
default:
|
|
59
|
-
m(
|
|
59
|
+
default: i(() => [
|
|
60
|
+
f(m(e.helperText), 1)
|
|
60
61
|
]),
|
|
61
62
|
_: 1
|
|
62
63
|
})) : R("", !0),
|
|
63
|
-
|
|
64
|
+
e.errorText ? (n(), v(c, u({
|
|
64
65
|
key: 1,
|
|
65
66
|
size: "caption",
|
|
66
67
|
class: "helper-text--error helper-text"
|
|
67
|
-
},
|
|
68
|
-
default:
|
|
69
|
-
m(
|
|
68
|
+
}, t(d)[t(o).ERROR_TEXT]), {
|
|
69
|
+
default: i(() => [
|
|
70
|
+
f(m(e.errorText), 1)
|
|
70
71
|
]),
|
|
71
72
|
_: 1
|
|
72
73
|
}, 16)) : R("", !0)
|