cx 24.8.6 → 24.9.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.
@@ -1,93 +1,91 @@
1
-
2
- @mixin cx-list(
3
- $name: 'list',
4
- $besm: $cx-besm
5
- ) {
6
- $block: map-get($besm, block);
7
- $element: map-get($besm, element);
8
- $state: map-get($besm, state);
9
- $mod: map-get($besm, mod);
10
-
11
- .#{$block}#{$name} {
12
- list-style: none;
13
- margin: 0;
14
- padding: 0;
15
- overflow: auto;
16
- border: 0 solid $cx-default-border-color;
17
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
18
-
19
- @include cx-add-state-rules($cx-list, default);
20
-
21
- &:hover {
22
- @include cx-add-state-rules($cx-list, hover);
23
- }
24
-
25
- &.#{$state}focused {
26
- @include cx-add-state-rules($cx-list, focus);
27
- }
28
-
29
- &.#{$mod}bordered {
30
- border-width: 1px;
31
-
32
- & > .#{$element}#{$name}-item:not(:first-child) {
33
- border-top-width: 1px;
34
- }
35
- }
36
- }
37
-
38
- .#{$element}#{$name}-item {
39
- margin: 0;
40
- border: 0 solid $cx-default-border-color;
41
-
42
- &.#{$state}pad {
43
- padding: $cx-default-list-item-padding;
44
- }
45
-
46
- @include cx-add-state-rules($cx-list-item, default);
47
-
48
- .#{$state}selectable > & {
49
- cursor: pointer;
50
- }
51
-
52
- &:hover {
53
- @include cx-add-state-rules($cx-list-item, hover);
54
- }
55
-
56
- &.#{$state}cursor {
57
- @include cx-add-state-rules($cx-list-item, hover);
58
-
59
- .#{$block}#{$name}.#{$state}focused > &, .#{$block}#{$name}:focus > & {
60
- @include cx-add-state-rules($cx-list-item, cursor);
61
-
62
- &:active {
63
- @include cx-add-state-rules($cx-list-item, active);
64
- }
65
- }
66
- }
67
-
68
- &.#{$state}selected {
69
- @include cx-add-state-rules($cx-list-item, selected);
70
-
71
- &.#{$state}cursor {
72
- @include cx-add-state-rules($cx-list-item, selected-hover);
73
-
74
- .#{$block}#{$name}.#{$state}focused > &, .#{$block}#{$name}:focus > & {
75
- @include cx-add-state-rules($cx-list-item, selected-cursor);
76
- }
77
- }
78
- }
79
-
80
- &.#{$state}disabled {
81
- @include cx-add-state-rules($cx-list-item, disabled);
82
- }
83
- }
84
-
85
- .#{$element}#{$name}-empty-text {
86
- padding: $cx-default-list-item-padding;
87
- color: $cx-default-empty-text-color;
88
- }
89
- }
90
-
91
- @if (cx-should-include('cx/widgets/List')) {
92
- @include cx-list();
93
- }
1
+ @mixin cx-list($name: "list", $besm: $cx-besm) {
2
+ $block: map-get($besm, block);
3
+ $element: map-get($besm, element);
4
+ $state: map-get($besm, state);
5
+ $mod: map-get($besm, mod);
6
+
7
+ .#{$block}#{$name} {
8
+ list-style: none;
9
+ margin: 0;
10
+ padding: 0;
11
+ overflow: auto;
12
+ border: 0 solid $cx-default-border-color;
13
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
14
+
15
+ @include cx-add-state-rules($cx-list, default);
16
+
17
+ &:hover {
18
+ @include cx-add-state-rules($cx-list, hover);
19
+ }
20
+
21
+ &.#{$state}focused {
22
+ @include cx-add-state-rules($cx-list, focus);
23
+ }
24
+
25
+ &.#{$mod}bordered {
26
+ border-width: 1px;
27
+
28
+ & > .#{$element}#{$name}-item:not(:first-child) {
29
+ border-top-width: 1px;
30
+ }
31
+ }
32
+ }
33
+
34
+ .#{$element}#{$name}-item {
35
+ margin: 0;
36
+ border: 0 solid $cx-default-border-color;
37
+
38
+ @include cx-add-state-rules($cx-list-item, default);
39
+
40
+ &.#{$state}pad {
41
+ padding: $cx-default-list-item-padding;
42
+ }
43
+
44
+ .#{$state}selectable > & {
45
+ cursor: pointer;
46
+ }
47
+
48
+ &:hover {
49
+ @include cx-add-state-rules($cx-list-item, hover);
50
+ }
51
+
52
+ &.#{$state}cursor {
53
+ @include cx-add-state-rules($cx-list-item, hover);
54
+
55
+ .#{$block}#{$name}.#{$state}focused > &,
56
+ .#{$block}#{$name}:focus > & {
57
+ @include cx-add-state-rules($cx-list-item, cursor);
58
+
59
+ &:active {
60
+ @include cx-add-state-rules($cx-list-item, active);
61
+ }
62
+ }
63
+ }
64
+
65
+ &.#{$state}selected {
66
+ @include cx-add-state-rules($cx-list-item, selected);
67
+
68
+ &.#{$state}cursor {
69
+ @include cx-add-state-rules($cx-list-item, selected-hover);
70
+
71
+ .#{$block}#{$name}.#{$state}focused > &,
72
+ .#{$block}#{$name}:focus > & {
73
+ @include cx-add-state-rules($cx-list-item, selected-cursor);
74
+ }
75
+ }
76
+ }
77
+
78
+ &.#{$state}disabled {
79
+ @include cx-add-state-rules($cx-list-item, disabled);
80
+ }
81
+ }
82
+
83
+ .#{$element}#{$name}-empty-text {
84
+ padding: $cx-default-list-item-padding;
85
+ color: $cx-default-empty-text-color;
86
+ }
87
+ }
88
+
89
+ @if (cx-should-include("cx/widgets/List")) {
90
+ @include cx-list();
91
+ }
@@ -1,196 +1,196 @@
1
- @mixin cx-calendar(
2
- $name: "calendar",
3
- $state-style-map: $cx-calendar-state-style-map,
4
- $width: $cx-default-input-width,
5
- $icon-size: $cx-default-icon-size,
6
- $besm: $cx-besm
7
- ) {
8
- $block: map-get($besm, block);
9
- $element: map-get($besm, element);
10
- $state: map-get($besm, state);
11
- $mod: map-get($besm, mod);
12
-
13
- .#{$block}calendar {
14
- @include cx-add-state-rules($state-style-map, "default");
15
-
16
- display: inline-block;
17
- vertical-align: middle;
18
- width: 18em;
19
- overflow-y: auto;
20
- box-sizing: border-box;
21
-
22
- &:hover {
23
- @include cx-add-state-rules($state-style-map, "hover");
24
- }
25
-
26
- &:focus {
27
- @include cx-add-state-rules($state-style-map, "focus");
28
- }
29
-
30
- &.#{$state}error {
31
- @include cx-add-state-rules($state-style-map, "error");
32
-
33
- &:focus {
34
- @include cx-add-state-rules($state-style-map, "error-focus");
35
- }
36
- }
37
-
38
- table {
39
- border-spacing: 0;
40
- width: 100%;
41
- }
42
-
43
- td,
44
- th {
45
- text-align: center;
46
- width: 2em;
47
- line-height: 2em;
48
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
49
- }
50
-
51
- th {
52
- font-weight: cx-get-state-rule($state-style-map, header, font-weight);
53
- }
54
-
55
- tbody td {
56
- @include cx-add-state-rules($cx-calendar-day-state-style-map, default);
57
- user-select: none;
58
- }
59
-
60
- .#{$element}#{$name}-header {
61
- @include cx-add-state-rules($state-style-map, header);
62
- }
63
-
64
- td.#{$state}today {
65
- @include cx-add-state-rules($cx-calendar-day-state-style-map, today);
66
-
67
- &:hover {
68
- @include cx-add-state-rules($cx-calendar-day-state-style-map, hover);
69
- }
70
- }
71
-
72
- td.#{$state}outside {
73
- @include cx-add-state-rules($cx-calendar-day-state-style-map, outside);
74
- }
75
-
76
- td.#{$state}unselectable {
77
- @include cx-add-state-rules($cx-calendar-day-state-style-map, disabled);
78
- }
79
-
80
- td.#{$state}cursor,
81
- .#{$element}#{$name}-header td:hover {
82
- @include cx-add-state-rules($cx-calendar-day-state-style-map, hover);
83
- }
84
-
85
- td.#{$state}selected {
86
- @include cx-add-state-rules($cx-calendar-day-state-style-map, selected);
87
- }
88
-
89
- &:not(.#{$state}disabled) {
90
- td {
91
- cursor: pointer;
92
- }
93
- }
94
-
95
- td:not(.cxe-calendar-year-option):first-child,
96
- td:not(.cxe-calendar-year-option):last-child {
97
- display: none;
98
- pointer-events: none;
99
- }
100
-
101
- &:focus {
102
- td.#{$state}cursor,
103
- .#{$element}#{$name}-header td:hover {
104
- @include cx-add-state-rules($cx-calendar-day-state-style-map, hover-focus);
105
-
106
- &:active {
107
- @include cx-add-state-rules($cx-calendar-day-state-style-map, active);
108
- }
109
- }
110
-
111
- td.#{$state}selected {
112
- @include cx-add-state-rules($cx-calendar-day-state-style-map, selected-focus);
113
- }
114
- }
115
-
116
- &.#{$state}disabled {
117
- background-color: transparent;
118
- border-color: transparent;
119
- color: darken(#fff, 18);
120
- pointer-events: none;
121
- opacity: 0.9;
122
- }
123
- }
124
-
125
- .#{$element}#{$name}-header td {
126
- line-height: 0;
127
- }
128
-
129
- .#{$element}#{$name}-icon-next-year,
130
- .#{$element}#{$name}-icon-prev-year,
131
- .#{$element}#{$name}-icon-prev-month,
132
- .#{$element}#{$name}-icon-next-month {
133
- width: $icon-size;
134
- height: $icon-size;
135
- display: inline-block;
136
- font-size: $icon-size;
137
- line-height: $icon-size;
138
- user-select: none;
139
- }
140
-
141
- .#{$element}#{$name}-year {
142
- &-name {
143
- cursor: pointer;
144
- }
145
-
146
- &-picker {
147
- user-select: none;
148
- overflow-y: scroll;
149
- width: 100%;
150
- max-height: 24em;
151
- height: auto;
152
- }
153
-
154
- &-option {
155
- cursor: pointer;
156
- @include cx-add-state-rules($cx-calendar-day-state-style-map, default);
157
-
158
- &.#{$state}active {
159
- @include cx-add-state-rules($cx-calendar-day-state-style-map, today);
160
- }
161
-
162
- &:hover {
163
- @include cx-add-state-rules($cx-calendar-day-state-style-map, hover);
164
- }
165
-
166
- &.#{$state}selected {
167
- @include cx-add-state-rules($cx-calendar-day-state-style-map, selected);
168
- }
169
- }
170
- }
171
-
172
- .#{$element}#{$name}-icon-prev-year {
173
- transform: rotate(180deg);
174
- }
175
- .#{$element}#{$name}-icon-prev-month {
176
- transform: rotate(90deg);
177
- }
178
- .#{$element}#{$name}-icon-next-month {
179
- transform: rotate(-90deg);
180
- }
181
-
182
- th.#{$element}#{$name}-display {
183
- line-height: 1.5;
184
- padding: 0.5em;
185
- }
186
-
187
- .#{$element}#{$name}-toolbar {
188
- display: flex;
189
- justify-content: center;
190
- margin-top: cx-top(cx-get-state-rule($state-style-map, default, "padding", 0));
191
- }
192
- }
193
-
194
- @if (cx-should-include("cx/widgets/Calendar")) {
195
- @include cx-calendar();
196
- }
1
+ @mixin cx-calendar(
2
+ $name: "calendar",
3
+ $state-style-map: $cx-calendar-state-style-map,
4
+ $width: $cx-default-input-width,
5
+ $icon-size: $cx-default-icon-size,
6
+ $besm: $cx-besm
7
+ ) {
8
+ $block: map-get($besm, block);
9
+ $element: map-get($besm, element);
10
+ $state: map-get($besm, state);
11
+ $mod: map-get($besm, mod);
12
+
13
+ .#{$block}calendar {
14
+ display: inline-block;
15
+ vertical-align: middle;
16
+ width: 18em;
17
+ overflow-y: auto;
18
+ box-sizing: border-box;
19
+
20
+ @include cx-add-state-rules($state-style-map, "default");
21
+
22
+ &:hover {
23
+ @include cx-add-state-rules($state-style-map, "hover");
24
+ }
25
+
26
+ &:focus {
27
+ @include cx-add-state-rules($state-style-map, "focus");
28
+ }
29
+
30
+ &.#{$state}error {
31
+ @include cx-add-state-rules($state-style-map, "error");
32
+
33
+ &:focus {
34
+ @include cx-add-state-rules($state-style-map, "error-focus");
35
+ }
36
+ }
37
+
38
+ table {
39
+ border-spacing: 0;
40
+ width: 100%;
41
+ }
42
+
43
+ td,
44
+ th {
45
+ text-align: center;
46
+ width: 2em;
47
+ line-height: 2em;
48
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
49
+ }
50
+
51
+ th {
52
+ font-weight: cx-get-state-rule($state-style-map, header, font-weight);
53
+ }
54
+
55
+ tbody td {
56
+ user-select: none;
57
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, default);
58
+ }
59
+
60
+ .#{$element}#{$name}-header {
61
+ @include cx-add-state-rules($state-style-map, header);
62
+ }
63
+
64
+ td.#{$state}today {
65
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, today);
66
+
67
+ &:hover {
68
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, hover);
69
+ }
70
+ }
71
+
72
+ td.#{$state}outside {
73
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, outside);
74
+ }
75
+
76
+ td.#{$state}unselectable {
77
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, disabled);
78
+ }
79
+
80
+ td.#{$state}cursor,
81
+ .#{$element}#{$name}-header td:hover {
82
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, hover);
83
+ }
84
+
85
+ td.#{$state}selected {
86
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, selected);
87
+ }
88
+
89
+ &:not(.#{$state}disabled) {
90
+ td {
91
+ cursor: pointer;
92
+ }
93
+ }
94
+
95
+ td:not(.cxe-calendar-year-option):first-child,
96
+ td:not(.cxe-calendar-year-option):last-child {
97
+ display: none;
98
+ pointer-events: none;
99
+ }
100
+
101
+ &:focus {
102
+ td.#{$state}cursor,
103
+ .#{$element}#{$name}-header td:hover {
104
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, hover-focus);
105
+
106
+ &:active {
107
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, active);
108
+ }
109
+ }
110
+
111
+ td.#{$state}selected {
112
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, selected-focus);
113
+ }
114
+ }
115
+
116
+ &.#{$state}disabled {
117
+ background-color: transparent;
118
+ border-color: transparent;
119
+ color: darken(#fff, 18);
120
+ pointer-events: none;
121
+ opacity: 0.9;
122
+ }
123
+ }
124
+
125
+ .#{$element}#{$name}-header td {
126
+ line-height: 0;
127
+ }
128
+
129
+ .#{$element}#{$name}-icon-next-year,
130
+ .#{$element}#{$name}-icon-prev-year,
131
+ .#{$element}#{$name}-icon-prev-month,
132
+ .#{$element}#{$name}-icon-next-month {
133
+ width: $icon-size;
134
+ height: $icon-size;
135
+ display: inline-block;
136
+ font-size: $icon-size;
137
+ line-height: $icon-size;
138
+ user-select: none;
139
+ }
140
+
141
+ .#{$element}#{$name}-year {
142
+ &-name {
143
+ cursor: pointer;
144
+ }
145
+
146
+ &-picker {
147
+ user-select: none;
148
+ overflow-y: scroll;
149
+ width: 100%;
150
+ max-height: 24em;
151
+ height: auto;
152
+ }
153
+
154
+ &-option {
155
+ cursor: pointer;
156
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, default);
157
+
158
+ &.#{$state}active {
159
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, today);
160
+ }
161
+
162
+ &:hover {
163
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, hover);
164
+ }
165
+
166
+ &.#{$state}selected {
167
+ @include cx-add-state-rules($cx-calendar-day-state-style-map, selected);
168
+ }
169
+ }
170
+ }
171
+
172
+ .#{$element}#{$name}-icon-prev-year {
173
+ transform: rotate(180deg);
174
+ }
175
+ .#{$element}#{$name}-icon-prev-month {
176
+ transform: rotate(90deg);
177
+ }
178
+ .#{$element}#{$name}-icon-next-month {
179
+ transform: rotate(-90deg);
180
+ }
181
+
182
+ th.#{$element}#{$name}-display {
183
+ line-height: 1.5;
184
+ padding: 0.5em;
185
+ }
186
+
187
+ .#{$element}#{$name}-toolbar {
188
+ display: flex;
189
+ justify-content: center;
190
+ margin-top: cx-top(cx-get-state-rule($state-style-map, default, "padding", 0));
191
+ }
192
+ }
193
+
194
+ @if (cx-should-include("cx/widgets/Calendar")) {
195
+ @include cx-calendar();
196
+ }