@limetech/lime-elements 38.28.1 → 38.29.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/CHANGELOG.md +24 -0
- package/README.md +17 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-list-item.cjs.entry.js +3 -100
- package/dist/cjs/limel-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-markdown.cjs.entry.js +1 -1
- package/dist/cjs/limel-markdown.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-radio-button.cjs.entry.js +31 -0
- package/dist/cjs/limel-radio-button.cjs.entry.js.map +1 -0
- package/dist/cjs/limel-table.cjs.entry.js +17 -2
- package/dist/cjs/limel-table.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/chip/chip.css +5 -0
- package/dist/collection/components/list-item/list-item.css +6 -46
- package/dist/collection/components/list-item/list-item.js +3 -111
- package/dist/collection/components/list-item/list-item.js.map +1 -1
- package/dist/collection/components/markdown/markdown.css +4 -0
- package/dist/collection/components/radio-button-group/radio-button.css +279 -0
- package/dist/collection/components/radio-button-group/radio-button.js +151 -0
- package/dist/collection/components/radio-button-group/radio-button.js.map +1 -0
- package/dist/collection/components/table/table.css +35 -42
- package/dist/collection/components/table/table.js +36 -1
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-chip_2.entry.js +1 -1
- package/dist/esm/limel-chip_2.entry.js.map +1 -1
- package/dist/esm/limel-list-item.entry.js +4 -101
- package/dist/esm/limel-list-item.entry.js.map +1 -1
- package/dist/esm/limel-markdown.entry.js +1 -1
- package/dist/esm/limel-markdown.entry.js.map +1 -1
- package/dist/esm/limel-radio-button.entry.js +27 -0
- package/dist/esm/limel-radio-button.entry.js.map +1 -0
- package/dist/esm/limel-table.entry.js +17 -2
- package/dist/esm/limel-table.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js.map +1 -1
- package/dist/lime-elements/p-29c2cdc6.entry.js +2 -0
- package/dist/lime-elements/p-29c2cdc6.entry.js.map +1 -0
- package/dist/lime-elements/{p-68192519.entry.js → p-5b5be3bf.entry.js} +2 -2
- package/dist/lime-elements/p-5b5be3bf.entry.js.map +1 -0
- package/dist/lime-elements/{p-0592207d.entry.js → p-9fc23e05.entry.js} +2 -2
- package/dist/lime-elements/p-9fc23e05.entry.js.map +1 -0
- package/dist/lime-elements/p-aae161ef.entry.js +2 -0
- package/dist/lime-elements/p-aae161ef.entry.js.map +1 -0
- package/dist/lime-elements/p-ae507565.entry.js +2 -0
- package/dist/lime-elements/p-ae507565.entry.js.map +1 -0
- package/dist/types/components/list-item/list-item.d.ts +0 -13
- package/dist/types/components/radio-button-group/{radio-button.template.d.ts → radio-button.d.ts} +28 -13
- package/dist/types/components/table/table.d.ts +6 -0
- package/dist/types/components.d.ts +149 -11
- package/package.json +2 -1
- package/dist/collection/components/radio-button-group/radio-button.template.js +0 -10
- package/dist/collection/components/radio-button-group/radio-button.template.js.map +0 -1
- package/dist/lime-elements/p-0334e593.entry.js +0 -2
- package/dist/lime-elements/p-0334e593.entry.js.map +0 -1
- package/dist/lime-elements/p-0592207d.entry.js.map +0 -1
- package/dist/lime-elements/p-2bfb4b41.entry.js +0 -2
- package/dist/lime-elements/p-2bfb4b41.entry.js.map +0 -1
- package/dist/lime-elements/p-68192519.entry.js.map +0 -1
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/**
|
|
3
|
+
* Note! This file is exported to `dist/scss/` in the published
|
|
4
|
+
* node module, for consumer projects to import.
|
|
5
|
+
* That means this file cannot import from any file that isn't
|
|
6
|
+
* also exported, keeping the same relative path.
|
|
7
|
+
*
|
|
8
|
+
* Or, just don't import anything, that works too.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* This mixin will mask out the content that is close to
|
|
15
|
+
* the edges of a scrollable area.
|
|
16
|
+
* - If the scrollable content has `overflow-y`, use `vertically`
|
|
17
|
+
* as an argument for `$direction`.
|
|
18
|
+
- If the scrollable content has `overflow-x`, use `horizontally`
|
|
19
|
+
* as an argument for `$direction`.
|
|
20
|
+
*
|
|
21
|
+
* For the visual effect to work smoothly, we need to make sure that
|
|
22
|
+
* the size of the fade-out edge effect is the same as the
|
|
23
|
+
* internal paddings of the scrollable area. Otherwise, content of a
|
|
24
|
+
* scrollable area that does not have a padding will fade out before
|
|
25
|
+
* any scrolling has been done.
|
|
26
|
+
* This is why this mixin already adds paddings, which automatically
|
|
27
|
+
* default to the size of the fade-out effect.
|
|
28
|
+
* This size defaults to `1rem`, but to override the size use
|
|
29
|
+
* `--limel-top-edge-fade-height` & `--limel-bottom-edge-fade-height`
|
|
30
|
+
* when `vertically` argument is set, and use
|
|
31
|
+
* `--limel-left-edge-fade-width` & `--limel-right-edge-fade-width`
|
|
32
|
+
* when `horizontally` argument is set.
|
|
33
|
+
* Of course you can also programmatically increase and decrease the
|
|
34
|
+
* size of these variables for each edge, based on the amount of
|
|
35
|
+
* scrolling that has been done by the user. In this case, make sure
|
|
36
|
+
* to add a custom padding where the mixin is used, to override
|
|
37
|
+
* the paddings that are automatically added by the mixin in the
|
|
38
|
+
* compiled CSS code.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* This mixin will add an animated underline to the bottom of an `a` elements.
|
|
42
|
+
* Note that you may need to add `all: unset;` –depending on your use case–
|
|
43
|
+
* before using this mixin.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* This mixin creates a cross-browser font stack.
|
|
47
|
+
* - `sans-serif` can be used for the UI of the components.
|
|
48
|
+
* - `monospace` can be used for code.
|
|
49
|
+
*
|
|
50
|
+
* ⚠️ If we change the font stacks, we need to update
|
|
51
|
+
* 1. the consumer documentation in `README.md`, and
|
|
52
|
+
* 2. the CSS variables of `--kompendium-example-font-family`
|
|
53
|
+
* in the `<style>` tag of `index.html`.
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* This mixin is a hack, using old CSS syntax
|
|
57
|
+
* to enable you to truncate a piece of text,
|
|
58
|
+
* after a certain number of lines.
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* This mixin will add a chessboard background pattern,
|
|
62
|
+
* typically used to visualize transparency.
|
|
63
|
+
*/
|
|
64
|
+
/**
|
|
65
|
+
* Make a container resizable by the user.
|
|
66
|
+
* This is used in the documentations and examples
|
|
67
|
+
* of some components, to demonstrate how the component
|
|
68
|
+
* behaves in a resizable container.
|
|
69
|
+
*/
|
|
70
|
+
/**
|
|
71
|
+
* The breakpoints below are used to create responsive designs
|
|
72
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
73
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
74
|
+
* file, to create consistent styles.
|
|
75
|
+
*
|
|
76
|
+
* :::important
|
|
77
|
+
* In very rare cases you should used media queries!
|
|
78
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
79
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
80
|
+
* :::
|
|
81
|
+
*/
|
|
82
|
+
/**
|
|
83
|
+
* Media query mixins for responsive design based on screen width.
|
|
84
|
+
* Note that these mixins do not detect the device type!
|
|
85
|
+
*/
|
|
86
|
+
*,
|
|
87
|
+
*:before,
|
|
88
|
+
*:after {
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.boolean-input {
|
|
93
|
+
--limel-boolean-input-box-size: 1.25rem;
|
|
94
|
+
--limel-boolean-input-gap-size: 0.5rem;
|
|
95
|
+
position: relative;
|
|
96
|
+
isolation: isolate;
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
min-height: var(--limel-checkbox-min-height, 2.5rem);
|
|
100
|
+
width: 100%;
|
|
101
|
+
}
|
|
102
|
+
.boolean-input input[type=checkbox],
|
|
103
|
+
.boolean-input input[type=radio] {
|
|
104
|
+
position: absolute;
|
|
105
|
+
width: 0;
|
|
106
|
+
height: 0;
|
|
107
|
+
margin: -1px;
|
|
108
|
+
padding: 0;
|
|
109
|
+
border: 0;
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
clip: rect(0, 0, 0, 0);
|
|
112
|
+
clip-path: inset(50%);
|
|
113
|
+
white-space: nowrap;
|
|
114
|
+
-webkit-appearance: none;
|
|
115
|
+
-moz-appearance: none;
|
|
116
|
+
appearance: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
label.boolean-input-label {
|
|
120
|
+
min-width: var(--limel-boolean-input-box-size);
|
|
121
|
+
min-height: var(--limel-boolean-input-box-size);
|
|
122
|
+
padding-top: 0.125rem;
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
position: relative;
|
|
125
|
+
width: 100%;
|
|
126
|
+
font-size: var(--limel-theme-default-small-font-size);
|
|
127
|
+
color: var(--limel-theme-text-primary-on-background-color);
|
|
128
|
+
padding-left: calc(var(--limel-boolean-input-box-size) + var(--limel-boolean-input-gap-size));
|
|
129
|
+
}
|
|
130
|
+
.disabled:not([readonly]):not([readonly=true]) label.boolean-input-label {
|
|
131
|
+
cursor: not-allowed;
|
|
132
|
+
color: var(--limel-theme-text-disabled-color);
|
|
133
|
+
}
|
|
134
|
+
.required label.boolean-input-label:after {
|
|
135
|
+
margin-left: 0.0625rem;
|
|
136
|
+
content: "*";
|
|
137
|
+
}
|
|
138
|
+
.invalid:not(.readonly) label.boolean-input-label {
|
|
139
|
+
color: var(--limel-theme-error-text-color);
|
|
140
|
+
}
|
|
141
|
+
:host(limel-checkbox.hide-label) label.boolean-input-label, .hide-label label.boolean-input-label {
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
white-space: nowrap;
|
|
144
|
+
text-overflow: ellipsis;
|
|
145
|
+
opacity: 0;
|
|
146
|
+
width: var(--limel-boolean-input-box-size);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.box {
|
|
150
|
+
position: absolute;
|
|
151
|
+
pointer-events: none;
|
|
152
|
+
transition: border-color 0.4s ease 0.2s, background-color 0.2s ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease;
|
|
153
|
+
display: inline-block;
|
|
154
|
+
vertical-align: middle;
|
|
155
|
+
width: var(--limel-boolean-input-box-size);
|
|
156
|
+
height: var(--limel-boolean-input-box-size);
|
|
157
|
+
margin-right: var(--limel-boolean-input-gap-size);
|
|
158
|
+
border-radius: var(--limel-boolean-input-box-border-radius);
|
|
159
|
+
border: 0.125rem solid;
|
|
160
|
+
border-color: var(--checkbox-unchecked-border-color, rgb(var(--contrast-900)));
|
|
161
|
+
background-color: var(--limel-checkbox-background-color, rgb(var(--contrast-300)));
|
|
162
|
+
/*
|
|
163
|
+
* NOTE: Original selectors using `:has()` are commented out due to Safari
|
|
164
|
+
* rendering bugs where descendant transitions (e.g. SVG stroke animations)
|
|
165
|
+
* or box/background updates sometimes fail to animate or even repaint
|
|
166
|
+
* reliably when the state change is detected only via `:has()`.
|
|
167
|
+
*
|
|
168
|
+
* Original (kept for future re-implementation, or cleanup):
|
|
169
|
+
* .boolean-input:has(input[type='checkbox']:checked) &,
|
|
170
|
+
* .boolean-input:has(input[type='radio']:checked) & {
|
|
171
|
+
* ...
|
|
172
|
+
* }
|
|
173
|
+
*
|
|
174
|
+
* Replacement uses adjacency: the markup places the `<input>` immediately
|
|
175
|
+
* before .box, so we can select the checked state with
|
|
176
|
+
* input:checked + .box. We retain the explicit `.checked` class pathway in
|
|
177
|
+
* case some templates toggle that class manually.
|
|
178
|
+
*
|
|
179
|
+
* Using the `:has()` selector is more reliable, because it doesn't
|
|
180
|
+
* depend on the DOM structure (e.g. if the markup changes and the input is
|
|
181
|
+
* no longer adjacent to the box), but Safari support for `:has()` is still
|
|
182
|
+
* somewhat inconsistent.
|
|
183
|
+
*/
|
|
184
|
+
/*
|
|
185
|
+
* See previous comment about Safari rendering bugs ☝️.
|
|
186
|
+
*
|
|
187
|
+
* Original (kept for for future re-implementation, or cleanup):
|
|
188
|
+
* .boolean-input:not(.disabled):has(label.boolean-input-label:hover) & { ... }
|
|
189
|
+
* .boolean-input:not(.disabled):has(label.boolean-input-label:active) & { ... }
|
|
190
|
+
*/
|
|
191
|
+
}
|
|
192
|
+
.checked .box, .boolean-input > input[type=checkbox]:checked + .box, .boolean-input > input[type=radio]:checked + .box {
|
|
193
|
+
background-color: var(--lime-primary-color, var(--limel-theme-primary-color));
|
|
194
|
+
border-color: var(--lime-primary-color, var(--limel-theme-primary-color));
|
|
195
|
+
}
|
|
196
|
+
.disabled .box {
|
|
197
|
+
opacity: 0.4;
|
|
198
|
+
}
|
|
199
|
+
.boolean-input:not(.disabled):hover .box {
|
|
200
|
+
will-change: box-shadow;
|
|
201
|
+
box-shadow: var(--button-shadow-hovered);
|
|
202
|
+
}
|
|
203
|
+
.boolean-input:not(.disabled):active .box {
|
|
204
|
+
will-change: box-shadow;
|
|
205
|
+
box-shadow: var(--button-shadow-pressed);
|
|
206
|
+
}
|
|
207
|
+
.box:before {
|
|
208
|
+
transition: color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);
|
|
209
|
+
content: "";
|
|
210
|
+
position: absolute;
|
|
211
|
+
inset: -0.1875rem;
|
|
212
|
+
border-radius: inherit;
|
|
213
|
+
/*
|
|
214
|
+
* See previous comment about Safari rendering bugs ☝️.
|
|
215
|
+
*
|
|
216
|
+
* Original (kept for for future re-implementation, or cleanup):
|
|
217
|
+
* .boolean-input:has(input[type='checkbox']:focus-visible) &,
|
|
218
|
+
* .boolean-input:has(input[type='radio']:focus-visible) & { ...}
|
|
219
|
+
*/
|
|
220
|
+
}
|
|
221
|
+
.boolean-input > input[type=checkbox]:focus-visible + .box:before, .boolean-input > input[type=radio]:focus-visible + .box:before {
|
|
222
|
+
will-change: box-shadow;
|
|
223
|
+
box-shadow: var(--shadow-depth-8-focused);
|
|
224
|
+
}
|
|
225
|
+
.box:after {
|
|
226
|
+
transition: opacity 0.2s ease, width 0.4s ease, box-shadow 0.6s cubic-bezier(0.68, -0.55, 0, 1.87), transform 0.6s cubic-bezier(0.68, -0.55, 0, 1.87);
|
|
227
|
+
content: "";
|
|
228
|
+
position: absolute;
|
|
229
|
+
inset: 0;
|
|
230
|
+
margin: auto;
|
|
231
|
+
border-radius: 1rem;
|
|
232
|
+
opacity: 0;
|
|
233
|
+
background-color: rgb(var(--color-white));
|
|
234
|
+
/* Hover fallback for pseudo-element (see explanation above). */
|
|
235
|
+
}
|
|
236
|
+
.boolean-input:not(.disabled):hover .box:after {
|
|
237
|
+
will-change: opacity, box-shadow, transform, width;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* :::important
|
|
242
|
+
* The `limel-radio-button` component can be used inside the HTML of
|
|
243
|
+
* other components to render a decorative radio button in
|
|
244
|
+
* their UI. An example of this is the list component.
|
|
245
|
+
* This means the content of `limel-radio-button` will become a part of the
|
|
246
|
+
* consumer's DOM structure.
|
|
247
|
+
*
|
|
248
|
+
* Additionally, the consumer components also need to import the current `.scss`
|
|
249
|
+
* file into their own styles file for the radio button to be rendered correctly!
|
|
250
|
+
* This means, if the styles in this file are not "specific" enough,
|
|
251
|
+
* there is a risk that the consumer component's styles are affected by
|
|
252
|
+
* our styles here.
|
|
253
|
+
*
|
|
254
|
+
* For instance if the consumer has a `<label>`,
|
|
255
|
+
* it might unintentionally inherit styles from the radio button; unless we
|
|
256
|
+
* make the such styles more specific here.
|
|
257
|
+
*
|
|
258
|
+
* Naturally, we cannot mitigate all sorts of potential styling problems.
|
|
259
|
+
* The consumer component should be aware of this issue too.
|
|
260
|
+
* But we can ensure that our styles here both make sense,
|
|
261
|
+
* are readable, and are as specific as possible to avoid unintended side effects.
|
|
262
|
+
* :::
|
|
263
|
+
*/
|
|
264
|
+
.radio-button {
|
|
265
|
+
--limel-boolean-input-box-border-radius: var(
|
|
266
|
+
--limel-boolean-input-box-size
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.box:after {
|
|
271
|
+
width: 100%;
|
|
272
|
+
height: 100%;
|
|
273
|
+
border-radius: 50%;
|
|
274
|
+
}
|
|
275
|
+
.boolean-input:has(input[type=radio]:checked) .box:after {
|
|
276
|
+
opacity: 1;
|
|
277
|
+
transform: scale(0.6);
|
|
278
|
+
box-shadow: var(--shadow-depth-8);
|
|
279
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
|
2
|
+
/**
|
|
3
|
+
* This is a low-level private component that renders individual radio button elements.
|
|
4
|
+
* It's used internally by the list-item component to render radio buttons when
|
|
5
|
+
* `type="radio"` is specified.
|
|
6
|
+
*
|
|
7
|
+
* ## Usage in the Library
|
|
8
|
+
*
|
|
9
|
+
* This template is primarily used by:
|
|
10
|
+
* - `limel-list` component when `type="radio"`
|
|
11
|
+
* - `limel-radio-button-group` component (which wraps `limel-list`)
|
|
12
|
+
*
|
|
13
|
+
* ## Why This Exists
|
|
14
|
+
*
|
|
15
|
+
* While we have `limel-radio-button-group` for most use cases, this template provides
|
|
16
|
+
* the actual radio button HTML structure with proper MDC classes and accessibility
|
|
17
|
+
* attributes. It ensures consistent styling and behavior across all radio button
|
|
18
|
+
* implementations in the library.
|
|
19
|
+
*
|
|
20
|
+
* ## Design Philosophy
|
|
21
|
+
*
|
|
22
|
+
* This follows the principle that individual radio buttons should not be standalone
|
|
23
|
+
* components, as a single radio button is never useful in a UI. Instead, this template
|
|
24
|
+
* is used to build groups of radio buttons through higher-level components.
|
|
25
|
+
*
|
|
26
|
+
* However, since this is a private component, consumers who need to use a radio button
|
|
27
|
+
* outside of the context of a list or group, can still use the `limel-radio-button`
|
|
28
|
+
* component directly according to in their UI needs.
|
|
29
|
+
*
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
export class RadioButtonComponent {
|
|
33
|
+
constructor() {
|
|
34
|
+
this.checked = undefined;
|
|
35
|
+
this.disabled = undefined;
|
|
36
|
+
this.id = undefined;
|
|
37
|
+
this.label = undefined;
|
|
38
|
+
this.onChange = undefined;
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
return (h(Host, { class: {
|
|
42
|
+
'boolean-input': true,
|
|
43
|
+
'radio-button': true,
|
|
44
|
+
checked: this.checked,
|
|
45
|
+
disabled: this.disabled,
|
|
46
|
+
} }, h("input", { type: "radio", id: this.id, checked: this.checked, disabled: this.disabled, onChange: this.onChange }), h("div", { class: "box" }), h("label", { class: "boolean-input-label", htmlFor: this.id }, this.label)));
|
|
47
|
+
}
|
|
48
|
+
static get is() { return "limel-radio-button"; }
|
|
49
|
+
static get originalStyleUrls() {
|
|
50
|
+
return {
|
|
51
|
+
"$": ["radio-button.scss"]
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
static get styleUrls() {
|
|
55
|
+
return {
|
|
56
|
+
"$": ["radio-button.css"]
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
static get properties() {
|
|
60
|
+
return {
|
|
61
|
+
"checked": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"mutable": false,
|
|
64
|
+
"complexType": {
|
|
65
|
+
"original": "boolean",
|
|
66
|
+
"resolved": "boolean",
|
|
67
|
+
"references": {}
|
|
68
|
+
},
|
|
69
|
+
"required": false,
|
|
70
|
+
"optional": true,
|
|
71
|
+
"docs": {
|
|
72
|
+
"tags": [],
|
|
73
|
+
"text": "Indicates whether the radio button is checked."
|
|
74
|
+
},
|
|
75
|
+
"attribute": "checked",
|
|
76
|
+
"reflect": true
|
|
77
|
+
},
|
|
78
|
+
"disabled": {
|
|
79
|
+
"type": "boolean",
|
|
80
|
+
"mutable": false,
|
|
81
|
+
"complexType": {
|
|
82
|
+
"original": "boolean",
|
|
83
|
+
"resolved": "boolean",
|
|
84
|
+
"references": {}
|
|
85
|
+
},
|
|
86
|
+
"required": false,
|
|
87
|
+
"optional": true,
|
|
88
|
+
"docs": {
|
|
89
|
+
"tags": [],
|
|
90
|
+
"text": "Disables the radio button when set to `true`."
|
|
91
|
+
},
|
|
92
|
+
"attribute": "disabled",
|
|
93
|
+
"reflect": true
|
|
94
|
+
},
|
|
95
|
+
"id": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"mutable": false,
|
|
98
|
+
"complexType": {
|
|
99
|
+
"original": "string",
|
|
100
|
+
"resolved": "string",
|
|
101
|
+
"references": {}
|
|
102
|
+
},
|
|
103
|
+
"required": true,
|
|
104
|
+
"optional": false,
|
|
105
|
+
"docs": {
|
|
106
|
+
"tags": [],
|
|
107
|
+
"text": "Associates the internal input with an external label."
|
|
108
|
+
},
|
|
109
|
+
"attribute": "id",
|
|
110
|
+
"reflect": false
|
|
111
|
+
},
|
|
112
|
+
"label": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "string",
|
|
117
|
+
"resolved": "string",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": true,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": "Visual label shown next to the radio button."
|
|
125
|
+
},
|
|
126
|
+
"attribute": "label",
|
|
127
|
+
"reflect": false
|
|
128
|
+
},
|
|
129
|
+
"onChange": {
|
|
130
|
+
"type": "unknown",
|
|
131
|
+
"mutable": false,
|
|
132
|
+
"complexType": {
|
|
133
|
+
"original": "(event: Event) => void",
|
|
134
|
+
"resolved": "(event: Event) => void",
|
|
135
|
+
"references": {
|
|
136
|
+
"Event": {
|
|
137
|
+
"location": "global"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"required": false,
|
|
142
|
+
"optional": true,
|
|
143
|
+
"docs": {
|
|
144
|
+
"tags": [],
|
|
145
|
+
"text": "Change handler forwarded to the underlying input element."
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=radio-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-button.js","sourceRoot":"","sources":["../../../src/components/radio-button-group/radio-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAMH,MAAM,OAAO,oBAAoB;;;;;;;;EA+BtB,MAAM;IACT,OAAO,CACH,EAAC,IAAI,IACD,KAAK,EAAE;QACH,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,IAAI;QACpB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;OAC1B;MAED,aACI,IAAI,EAAC,OAAO,EACZ,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACzB;MACF,WAAK,KAAK,EAAC,KAAK,GAAG;MACnB,aAAO,KAAK,EAAC,qBAAqB,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,IAC9C,IAAI,CAAC,KAAK,CACP,CACL,CACV,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n/**\n * This is a low-level private component that renders individual radio button elements.\n * It's used internally by the list-item component to render radio buttons when\n * `type=\"radio\"` is specified.\n *\n * ## Usage in the Library\n *\n * This template is primarily used by:\n * - `limel-list` component when `type=\"radio\"`\n * - `limel-radio-button-group` component (which wraps `limel-list`)\n *\n * ## Why This Exists\n *\n * While we have `limel-radio-button-group` for most use cases, this template provides\n * the actual radio button HTML structure with proper MDC classes and accessibility\n * attributes. It ensures consistent styling and behavior across all radio button\n * implementations in the library.\n *\n * ## Design Philosophy\n *\n * This follows the principle that individual radio buttons should not be standalone\n * components, as a single radio button is never useful in a UI. Instead, this template\n * is used to build groups of radio buttons through higher-level components.\n *\n * However, since this is a private component, consumers who need to use a radio button\n * outside of the context of a list or group, can still use the `limel-radio-button`\n * component directly according to in their UI needs.\n *\n * @private\n */\n@Component({\n tag: 'limel-radio-button',\n shadow: false,\n styleUrl: 'radio-button.scss',\n})\nexport class RadioButtonComponent {\n /**\n * Indicates whether the radio button is checked.\n */\n @Prop({ reflect: true })\n public checked?: boolean;\n\n /**\n * Disables the radio button when set to `true`.\n */\n @Prop({ reflect: true })\n public disabled?: boolean;\n\n /**\n * Associates the internal input with an external label.\n */\n @Prop()\n public id!: string;\n\n /**\n * Visual label shown next to the radio button.\n */\n @Prop()\n public label?: string;\n\n /**\n * Change handler forwarded to the underlying input element.\n */\n @Prop()\n public onChange?: (event: Event) => void;\n\n public render() {\n return (\n <Host\n class={{\n 'boolean-input': true,\n 'radio-button': true,\n checked: this.checked,\n disabled: this.disabled,\n }}\n >\n <input\n type=\"radio\"\n id={this.id}\n checked={this.checked}\n disabled={this.disabled}\n onChange={this.onChange}\n />\n <div class=\"box\" />\n <label class=\"boolean-input-label\" htmlFor={this.id}>\n {this.label}\n </label>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1063,11 +1063,6 @@ body.tabulator-print-fullscreen-hide > *:not(.tabulator-print-fullscreen) {
|
|
|
1063
1063
|
flex-shrink: 0;
|
|
1064
1064
|
}
|
|
1065
1065
|
|
|
1066
|
-
#tabulator-container:not(.has-pagination) .tabulator-paginator {
|
|
1067
|
-
visibility: hidden;
|
|
1068
|
-
display: none !important;
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
1066
|
#tabulator-container {
|
|
1072
1067
|
position: relative;
|
|
1073
1068
|
}
|
|
@@ -1118,18 +1113,8 @@ body.tabulator-print-fullscreen-hide > *:not(.tabulator-print-fullscreen) {
|
|
|
1118
1113
|
}
|
|
1119
1114
|
|
|
1120
1115
|
.tabulator-row {
|
|
1121
|
-
transition: background-color 0.2s ease;
|
|
1122
1116
|
height: 2.25rem;
|
|
1123
1117
|
}
|
|
1124
|
-
.tabulator-row:hover {
|
|
1125
|
-
transition: background-color 0.1s ease;
|
|
1126
|
-
}
|
|
1127
|
-
.tabulator-row.tabulator-row-odd, .tabulator-row.tabulator-row-odd:hover {
|
|
1128
|
-
background-color: rgb(var(--table-row-background-color--odd));
|
|
1129
|
-
}
|
|
1130
|
-
.tabulator-row.tabulator-row-even, .tabulator-row.tabulator-row-even:hover {
|
|
1131
|
-
background-color: rgb(var(--table-row-background-color--even));
|
|
1132
|
-
}
|
|
1133
1118
|
.tabulator-row .tabulator-cell {
|
|
1134
1119
|
border-right: transparent;
|
|
1135
1120
|
padding: 0.5rem;
|
|
@@ -1367,6 +1352,10 @@ limel-chip {
|
|
|
1367
1352
|
* Nothing in this file may output any CSS
|
|
1368
1353
|
* without being explicitly called by outside code.
|
|
1369
1354
|
*/
|
|
1355
|
+
#tabulator-container:not(.has-pagination) .tabulator-paginator {
|
|
1356
|
+
display: none !important;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1370
1359
|
.tabulator .tabulator-footer .tabulator-paginator {
|
|
1371
1360
|
box-sizing: border-box;
|
|
1372
1361
|
display: grid;
|
|
@@ -1608,8 +1597,22 @@ button.tabulator-page[data-page=first]:not([disabled]):hover:after, button.tabul
|
|
|
1608
1597
|
inset: 0;
|
|
1609
1598
|
min-height: 0.125rem;
|
|
1610
1599
|
transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;
|
|
1600
|
+
background-color: rgb(var(--limel-table-row-background-color));
|
|
1611
1601
|
}
|
|
1612
1602
|
|
|
1603
|
+
.tabulator-row:not(.tabulator-calcs) {
|
|
1604
|
+
background-color: transparent;
|
|
1605
|
+
}
|
|
1606
|
+
.tabulator-row:not(.tabulator-calcs).tabulator-row-odd {
|
|
1607
|
+
--limel-table-row-background-color: var(
|
|
1608
|
+
--table-row-background-color--odd
|
|
1609
|
+
);
|
|
1610
|
+
}
|
|
1611
|
+
.tabulator-row:not(.tabulator-calcs).tabulator-row-even {
|
|
1612
|
+
--limel-table-row-background-color: var(
|
|
1613
|
+
--table-row-background-color--even
|
|
1614
|
+
);
|
|
1615
|
+
}
|
|
1613
1616
|
.tabulator-row:not(.tabulator-calcs) .tabulator-cell {
|
|
1614
1617
|
pointer-events: none;
|
|
1615
1618
|
}
|
|
@@ -1619,8 +1622,12 @@ button.tabulator-page[data-page=first]:not([disabled]):hover:after, button.tabul
|
|
|
1619
1622
|
.tabulator-row:not(.tabulator-calcs).tabulator-selectable:hover {
|
|
1620
1623
|
z-index: 2;
|
|
1621
1624
|
}
|
|
1625
|
+
.tabulator-row:not(.tabulator-calcs).tabulator-selectable.active {
|
|
1626
|
+
--limel-table-row-background-color: var(
|
|
1627
|
+
--table-row-background-color--active
|
|
1628
|
+
);
|
|
1629
|
+
}
|
|
1622
1630
|
.tabulator-row:not(.tabulator-calcs).tabulator-selectable.active .interactive-feedback {
|
|
1623
|
-
background-color: rgb(var(--table-row-background-color--active));
|
|
1624
1631
|
box-shadow: var(--button-shadow-inset-pressed);
|
|
1625
1632
|
}
|
|
1626
1633
|
.tabulator-row:not(.tabulator-calcs).tabulator-selectable.active:before {
|
|
@@ -1702,10 +1709,6 @@ button.tabulator-page[data-page=first]:not([disabled]):hover:after, button.tabul
|
|
|
1702
1709
|
:host(.has-pagination-on-top) .select-all {
|
|
1703
1710
|
top: 2.625rem;
|
|
1704
1711
|
}
|
|
1705
|
-
:host(.has-pagination-on-top) #tabulator-container:not(.has-pagination) .tabulator-paginator {
|
|
1706
|
-
display: grid !important;
|
|
1707
|
-
opacity: 0;
|
|
1708
|
-
}
|
|
1709
1712
|
|
|
1710
1713
|
/**
|
|
1711
1714
|
* Note! This file is exported to `dist/scss/` in the published
|
|
@@ -1881,22 +1884,21 @@ button.tabulator-page[data-page=first]:not([disabled]):hover:after, button.tabul
|
|
|
1881
1884
|
padding-bottom: 0;
|
|
1882
1885
|
}
|
|
1883
1886
|
|
|
1884
|
-
/*
|
|
1885
|
-
* This file is imported into every component!
|
|
1886
|
-
*
|
|
1887
|
-
* Nothing in this file may output any CSS
|
|
1888
|
-
* without being explicitly called by outside code.
|
|
1889
|
-
*/
|
|
1890
1887
|
.select-all,
|
|
1891
1888
|
.limel-table--row-selector {
|
|
1892
1889
|
--limel-checkbox-min-height: 1.25rem;
|
|
1890
|
+
display: inline-flex !important;
|
|
1891
|
+
align-items: center;
|
|
1892
|
+
justify-content: center;
|
|
1893
|
+
text-overflow: unset !important;
|
|
1894
|
+
padding: 0 !important;
|
|
1893
1895
|
}
|
|
1894
1896
|
|
|
1895
1897
|
.select-all {
|
|
1896
1898
|
position: absolute;
|
|
1897
1899
|
z-index: 1;
|
|
1898
|
-
left: 0.
|
|
1899
|
-
top: 0.
|
|
1900
|
+
left: 0.375rem;
|
|
1901
|
+
top: 0.25rem;
|
|
1900
1902
|
}
|
|
1901
1903
|
|
|
1902
1904
|
.limel-table--row-selector {
|
|
@@ -1904,21 +1906,12 @@ button.tabulator-page[data-page=first]:not([disabled]):hover:after, button.tabul
|
|
|
1904
1906
|
left: 0;
|
|
1905
1907
|
border-width: 0;
|
|
1906
1908
|
z-index: 1;
|
|
1907
|
-
text-overflow: unset !important;
|
|
1908
|
-
padding-left: 0.5rem !important;
|
|
1909
|
-
padding-top: 0.25rem !important;
|
|
1910
|
-
}
|
|
1911
|
-
.limel-table--row-selector limel-checkbox {
|
|
1912
|
-
margin-top: 0.0625rem;
|
|
1913
|
-
}
|
|
1914
|
-
.tabulator-row-odd .limel-table--row-selector {
|
|
1915
|
-
background-image: linear-gradient(to right, rgb(var(--table-row-background-color--odd)) 70%, rgb(var(--table-row-background-color--odd), 0));
|
|
1916
|
-
}
|
|
1917
|
-
.tabulator-row-even .limel-table--row-selector {
|
|
1918
|
-
background-image: linear-gradient(to right, rgb(var(--table-row-background-color--even)) 70%, rgb(var(--table-row-background-color--even), 0));
|
|
1919
1909
|
}
|
|
1920
|
-
.
|
|
1921
|
-
|
|
1910
|
+
.limel-table--row-selector:before {
|
|
1911
|
+
content: "";
|
|
1912
|
+
inset: 0.25rem 0;
|
|
1913
|
+
position: absolute;
|
|
1914
|
+
background-image: linear-gradient(to right, rgb(var(--limel-table-row-background-color)) 70%, rgb(var(--limel-table-row-background-color), 0));
|
|
1922
1915
|
}
|
|
1923
1916
|
.limel-table--row-selector limel-checkbox {
|
|
1924
1917
|
transition: opacity 0.2s ease;
|
|
@@ -80,6 +80,7 @@ export class Table {
|
|
|
80
80
|
this.sorting = [];
|
|
81
81
|
this.activeRow = undefined;
|
|
82
82
|
this.movableColumns = undefined;
|
|
83
|
+
this.sortableColumns = true;
|
|
83
84
|
this.loading = false;
|
|
84
85
|
this.page = FIRST_PAGE;
|
|
85
86
|
this.emptyMessage = undefined;
|
|
@@ -192,6 +193,13 @@ export class Table {
|
|
|
192
193
|
this.initTableSelection();
|
|
193
194
|
this.init();
|
|
194
195
|
}
|
|
196
|
+
updateSortableColumns() {
|
|
197
|
+
if (!this.tabulator) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
this.tabulator.setColumns(this.getColumnDefinitions());
|
|
201
|
+
this.shouldSort = true;
|
|
202
|
+
}
|
|
195
203
|
updateSorting(newValue, oldValue) {
|
|
196
204
|
const newSorting = this.getColumnSorter(newValue);
|
|
197
205
|
const oldSorting = this.getColumnSorter(oldValue);
|
|
@@ -300,7 +308,13 @@ export class Table {
|
|
|
300
308
|
getColumnDefinitions() {
|
|
301
309
|
const columnDefinitions = this.columns
|
|
302
310
|
.map(this.addColumnAggregator)
|
|
303
|
-
.map(
|
|
311
|
+
.map((column) => {
|
|
312
|
+
var _a;
|
|
313
|
+
const definition = this.columnFactory.create(column);
|
|
314
|
+
const columnSortable = (_a = column.headerSort) !== null && _a !== void 0 ? _a : true;
|
|
315
|
+
definition.headerSort = this.sortableColumns && columnSortable;
|
|
316
|
+
return definition;
|
|
317
|
+
});
|
|
304
318
|
if (this.tableSelection) {
|
|
305
319
|
return this.tableSelection.getColumnDefinitions(columnDefinitions);
|
|
306
320
|
}
|
|
@@ -691,6 +705,24 @@ export class Table {
|
|
|
691
705
|
"attribute": "movable-columns",
|
|
692
706
|
"reflect": false
|
|
693
707
|
},
|
|
708
|
+
"sortableColumns": {
|
|
709
|
+
"type": "boolean",
|
|
710
|
+
"mutable": false,
|
|
711
|
+
"complexType": {
|
|
712
|
+
"original": "boolean",
|
|
713
|
+
"resolved": "boolean",
|
|
714
|
+
"references": {}
|
|
715
|
+
},
|
|
716
|
+
"required": false,
|
|
717
|
+
"optional": false,
|
|
718
|
+
"docs": {
|
|
719
|
+
"tags": [],
|
|
720
|
+
"text": "Set to `false` to disable column sorting through header interactions.\nProgrammatic sorting through the `sorting` prop and `sort` event remains available."
|
|
721
|
+
},
|
|
722
|
+
"attribute": "sortable-columns",
|
|
723
|
+
"reflect": false,
|
|
724
|
+
"defaultValue": "true"
|
|
725
|
+
},
|
|
694
726
|
"loading": {
|
|
695
727
|
"type": "boolean",
|
|
696
728
|
"mutable": false,
|
|
@@ -973,6 +1005,9 @@ export class Table {
|
|
|
973
1005
|
}, {
|
|
974
1006
|
"propName": "selectable",
|
|
975
1007
|
"methodName": "updateSelectable"
|
|
1008
|
+
}, {
|
|
1009
|
+
"propName": "sortableColumns",
|
|
1010
|
+
"methodName": "updateSortableColumns"
|
|
976
1011
|
}, {
|
|
977
1012
|
"propName": "sorting",
|
|
978
1013
|
"methodName": "updateSorting"
|