@mezzanine-ui/core 0.15.0 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_styles.scss +3 -0
- package/anchor/_anchor-styles.scss +48 -0
- package/anchor/_anchor.scss +1 -0
- package/anchor/_index.scss +1 -0
- package/anchor/anchor.d.ts +7 -0
- package/anchor/anchor.js +9 -0
- package/anchor/index.d.ts +1 -0
- package/anchor/index.js +1 -0
- package/calendarMethodsLuxon/index.js +4 -4
- package/package.json +3 -3
package/_styles.scss
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
@use '~@mezzanine-ui/system/palette';
|
|
2
|
+
@use '~@mezzanine-ui/system/transition';
|
|
3
|
+
@use '../button/utils' as btn-utils;
|
|
4
|
+
@use './anchor' as *;
|
|
5
|
+
|
|
6
|
+
$bar-width: 1px !default;
|
|
7
|
+
$anchor-left-padding: 12px !default;
|
|
8
|
+
|
|
9
|
+
.#{$prefix} {
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-template-columns: 1fr;
|
|
13
|
+
gap: 8px;
|
|
14
|
+
position: relative;
|
|
15
|
+
|
|
16
|
+
&__bar {
|
|
17
|
+
position: absolute;
|
|
18
|
+
left: 0;
|
|
19
|
+
top: 0;
|
|
20
|
+
z-index: 0;
|
|
21
|
+
width: $bar-width;
|
|
22
|
+
height: 100%;
|
|
23
|
+
background-color: palette.color(border);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&__anchor {
|
|
27
|
+
@include btn-utils.reset();
|
|
28
|
+
|
|
29
|
+
display: inline-grid;
|
|
30
|
+
position: relative;
|
|
31
|
+
z-index: 1;
|
|
32
|
+
width: 100%;
|
|
33
|
+
border-left: $bar-width solid palette.color(border);
|
|
34
|
+
padding-left: $anchor-left-padding;
|
|
35
|
+
text-align: left;
|
|
36
|
+
color: palette.color(action-inactive);
|
|
37
|
+
transition: transition.standard(border-left), transition.standard(color);
|
|
38
|
+
|
|
39
|
+
&:hover {
|
|
40
|
+
color: palette.color(primary);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&--active {
|
|
44
|
+
color: palette.color(primary);
|
|
45
|
+
border-left: $bar-width solid palette.color(primary);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$prefix: mzn-anchor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@forward './anchor';
|
package/anchor/anchor.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './anchor';
|
package/anchor/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { anchorClasses, anchorPrefix } from './anchor.js';
|
|
@@ -10,10 +10,10 @@ const CalendarMethodsLuxon = {
|
|
|
10
10
|
getHour: (date) => DateTime.fromISO(date).hour,
|
|
11
11
|
getDate: (date) => DateTime.fromISO(date).day,
|
|
12
12
|
getWeekDay: (date) => DateTime.fromISO(date).weekday,
|
|
13
|
-
getMonth: (date) => DateTime.fromISO(date).month,
|
|
13
|
+
getMonth: (date) => DateTime.fromISO(date).month - 1,
|
|
14
14
|
getYear: (date) => DateTime.fromISO(date).year,
|
|
15
15
|
getWeekDayNames: (locale) => Info.weekdays('narrow', { locale }),
|
|
16
|
-
getMonthShortName: (month, locale) => DateTime.now().set({ month }).toFormat('MMM', { locale }),
|
|
16
|
+
getMonthShortName: (month, locale) => DateTime.now().set({ month: month + 1 }).toFormat('MMM', { locale }),
|
|
17
17
|
getMonthShortNames: (locale) => Info.months('short', { locale }),
|
|
18
18
|
/** Manipulate */
|
|
19
19
|
addDay: (date, diff) => DateTime.fromISO(date).plus({ day: diff }).toISO(),
|
|
@@ -22,7 +22,7 @@ const CalendarMethodsLuxon = {
|
|
|
22
22
|
setSecond: (date, second) => DateTime.fromISO(date).set({ second }).toISO(),
|
|
23
23
|
setMinute: (date, minute) => DateTime.fromISO(date).set({ minute }).toISO(),
|
|
24
24
|
setHour: (date, hour) => DateTime.fromISO(date).set({ hour }).toISO(),
|
|
25
|
-
setMonth: (date, month) => DateTime.fromISO(date).set({ month }).toISO(),
|
|
25
|
+
setMonth: (date, month) => DateTime.fromISO(date).set({ month: month + 1 }).toISO(),
|
|
26
26
|
setYear: (date, year) => DateTime.fromISO(date).set({ year }).toISO(),
|
|
27
27
|
setDate: (date, target) => DateTime.fromISO(date).set({ day: target }).toISO(),
|
|
28
28
|
startOf: (target, granularity) => DateTime.fromISO(target).startOf(granularity).toISO(),
|
|
@@ -42,7 +42,7 @@ const CalendarMethodsLuxon = {
|
|
|
42
42
|
isBetween: (value, target1, target2) => Interval.fromDateTimes(DateTime.fromISO(target1), DateTime.fromISO(target2)).contains(DateTime.fromISO(value)),
|
|
43
43
|
isSameDate: (dateOne, dateTwo) => DateTime.fromISO(dateOne).hasSame(DateTime.fromISO(dateTwo), 'day'),
|
|
44
44
|
isSameWeek: (dateOne, dateTwo) => DateTime.fromISO(dateOne).hasSame(DateTime.fromISO(dateTwo), 'week'),
|
|
45
|
-
isInMonth: (target, month) => DateTime.fromISO(target).month === month,
|
|
45
|
+
isInMonth: (target, month) => DateTime.fromISO(target).month === month + 1,
|
|
46
46
|
isDateIncluded: (date, targets) => targets
|
|
47
47
|
.some((target) => DateTime.fromISO(date).hasSame(DateTime.fromISO(target), 'day')),
|
|
48
48
|
isWeekIncluded: (firstDateOfWeek, targets) => targets.some((target) => DateTime.fromISO(firstDateOfWeek).hasSame(DateTime.fromISO(target), 'week')),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mezzanine-ui/core",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "Core for mezzanine-ui",
|
|
5
5
|
"author": "Mezzanine",
|
|
6
6
|
"repository": {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@mezzanine-ui/icons": "^0.15.
|
|
44
|
-
"@mezzanine-ui/system": "^0.15.
|
|
43
|
+
"@mezzanine-ui/icons": "^0.15.2",
|
|
44
|
+
"@mezzanine-ui/system": "^0.15.2",
|
|
45
45
|
"lodash": "^4.17.21",
|
|
46
46
|
"tslib": "^2.4.1"
|
|
47
47
|
},
|