@commmerce/ui 1.3.0 → 1.5.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/THIRD_PARTY_NOTICES.txt +101 -0
- package/dist/calendar.js +15 -19
- package/dist/cdn.js +1669 -1193
- package/dist/components/accordion.js +9 -8
- package/dist/components/action-bar.js +15 -15
- package/dist/components/action-menu.js +10 -9
- package/dist/components/app-card.js +15 -14
- package/dist/components/app-frame.d.ts +15 -0
- package/dist/components/app-frame.js +22 -2
- package/dist/components/badge.d.ts +2 -1
- package/dist/components/badge.js +4 -3
- package/dist/components/banner.js +6 -5
- package/dist/components/board.js +18 -18
- package/dist/components/bottom-navigation.d.ts +1 -1
- package/dist/components/bottom-navigation.js +9 -7
- package/dist/components/bottom-sheet.d.ts +1 -1
- package/dist/components/bottom-sheet.js +9 -8
- package/dist/components/button.d.ts +3 -3
- package/dist/components/button.js +22 -19
- package/dist/components/calendar.d.ts +380 -0
- package/dist/components/calendar.js +1480 -0
- package/dist/components/card.d.ts +1 -1
- package/dist/components/card.js +18 -12
- package/dist/components/checkbox.js +8 -7
- package/dist/components/color-field.js +9 -13
- package/dist/components/combobox.d.ts +8 -0
- package/dist/components/combobox.js +18 -18
- package/dist/components/comment.d.ts +1 -1
- package/dist/components/comment.js +12 -13
- package/dist/components/data-table.js +12 -11
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.js +7 -7
- package/dist/components/empty-state.d.ts +1 -1
- package/dist/components/empty-state.js +16 -16
- package/dist/components/file-upload.js +18 -16
- package/dist/components/filter-panel.js +1 -1
- package/dist/components/flash-offer-bar.js +8 -7
- package/dist/components/global-search.d.ts +1 -1
- package/dist/components/global-search.js +12 -9
- package/dist/components/grid.d.ts +1 -1
- package/dist/components/grid.js +1 -1
- package/dist/components/header-bar.js +38 -31
- package/dist/components/info-panel.d.ts +1 -1
- package/dist/components/info-panel.js +11 -10
- package/dist/components/layout.d.ts +1 -1
- package/dist/components/layout.js +1 -1
- package/dist/components/link-tabs.js +8 -7
- package/dist/components/metric.js +4 -4
- package/dist/components/mobile-menu.js +16 -15
- package/dist/components/modal.js +2 -1
- package/dist/components/nested-list.d.ts +2 -2
- package/dist/components/nested-list.js +21 -22
- package/dist/components/notification-panel.js +12 -11
- package/dist/components/option-group.js +10 -11
- package/dist/components/page-header.js +16 -15
- package/dist/components/page.d.ts +18 -4
- package/dist/components/page.js +22 -7
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +16 -9
- package/dist/components/progress-bar.js +4 -3
- package/dist/components/radio.js +12 -12
- package/dist/components/report-tile.d.ts +2 -2
- package/dist/components/report-tile.js +18 -18
- package/dist/components/resource-list.d.ts +22 -6
- package/dist/components/resource-list.js +92 -52
- package/dist/components/save-bar.js +8 -8
- package/dist/components/search.d.ts +5 -2
- package/dist/components/search.js +20 -14
- package/dist/components/segmented-control.d.ts +67 -0
- package/dist/components/segmented-control.js +76 -0
- package/dist/components/select.d.ts +8 -0
- package/dist/components/select.js +18 -18
- package/dist/components/side-navigation.js +20 -17
- package/dist/components/side-panel.js +4 -3
- package/dist/components/signature-field.d.ts +153 -0
- package/dist/components/signature-field.js +728 -0
- package/dist/components/skeleton-display.js +4 -4
- package/dist/components/skeleton.d.ts +1 -1
- package/dist/components/skeleton.js +2 -2
- package/dist/components/smart-tip.d.ts +1 -1
- package/dist/components/smart-tip.js +16 -16
- package/dist/components/spinner.js +1 -1
- package/dist/components/stack.d.ts +1 -1
- package/dist/components/stack.js +1 -1
- package/dist/components/status-tabs.d.ts +4 -3
- package/dist/components/status-tabs.js +26 -12
- package/dist/components/table-header.d.ts +4 -3
- package/dist/components/table-header.js +22 -15
- package/dist/components/tag.js +3 -4
- package/dist/components/text-field.d.ts +1 -1
- package/dist/components/text-field.js +8 -15
- package/dist/components/thumbnail.js +1 -1
- package/dist/components/timeline.js +12 -11
- package/dist/components/toast.js +6 -6
- package/dist/components/toggle.js +12 -11
- package/dist/components/tooltip.js +4 -3
- package/dist/custom-elements.json +13655 -9770
- package/dist/field.d.ts +15 -0
- package/dist/field.js +47 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/overlay.js +5 -4
- package/dist/popover.js +8 -8
- package/dist/spacing.d.ts +14 -4
- package/dist/spacing.js +13 -4
- package/package.json +3 -3
|
@@ -35,7 +35,7 @@ declare module '../localize.js' {
|
|
|
35
35
|
* any content. With `href` the whole row is a link; otherwise clicking a selectable row ticks it.
|
|
36
36
|
* @element cm-resource-item
|
|
37
37
|
* @slot - Row content: name, details, badges. To line up with a `cm-table-header`, set `columns` and give one element per column.
|
|
38
|
-
* @slot media - A
|
|
38
|
+
* @slot media - A 40px thumbnail (32px on phones): a `cm-thumbnail` (recommended; `alt=""` when the row names the product) or an `<img>`.
|
|
39
39
|
* @slot actions - Buttons at the end of the row. They do not toggle selection.
|
|
40
40
|
* @fires cm-resource-select - `detail: { value, selected }` when the merchant ticks or unticks the row. The list handles it.
|
|
41
41
|
*/
|
|
@@ -92,17 +92,21 @@ export declare class CmResourceItem extends CmLocalizedElement {
|
|
|
92
92
|
}
|
|
93
93
|
/**
|
|
94
94
|
* A list of products, orders, customers or other resources, with optional bulk selection.
|
|
95
|
-
* When `selectable`,
|
|
96
|
-
*
|
|
95
|
+
* When `selectable`, the list's header row (a slim grey bar at the top) has a select-all box lined up with the rows' checkboxes and,
|
|
96
|
+
* next to it, a small chevron menu (this page, all matching, none). Once something is selected the same row shows
|
|
97
|
+
* "2 products selected", a button to select all matching results when there are more than the rows, and the bulk actions.
|
|
98
|
+
* With a `cm-table-header` in the `header` slot, that header is the row: the box sits in its checkbox column, and the
|
|
99
|
+
* selection status and bulk actions cover the column names while rows are selected. (Until something is selected the
|
|
100
|
+
* chevron is hidden there, since the column names use its room; the box selects the page.)
|
|
97
101
|
* Put a `cm-table-header` in the `header` slot for column names and `cm-pagination` under the list.
|
|
98
102
|
* The list lines a slotted `cm-table-header` up with its rows (it sets the header's `resource-rows`): lay each row's
|
|
99
103
|
* content out as a grid with `grid-template-columns: var(--cm-table-columns)` and `column-gap: var(--cm-space-20)`,
|
|
100
104
|
* and set `--cm-table-columns` on the list.
|
|
101
105
|
* @element cm-resource-list
|
|
102
106
|
* @slot - `cm-resource-item` rows.
|
|
103
|
-
* @slot header - A `cm-table-header` (or anything)
|
|
104
|
-
* @slot bulk-actions - Buttons that act on the selection, e.g. "Bulk orders". Shown once a row is selected.
|
|
105
|
-
* @slot actions - Buttons at the end of the
|
|
107
|
+
* @slot header - A `cm-table-header` (or anything) above the rows. A `cm-table-header` here is lined up with the rows, checkbox column included, and shares its row with the select-all box.
|
|
108
|
+
* @slot bulk-actions - Buttons that act on the selection, e.g. "Bulk orders". Shown once a row is selected, in the header row: use `size="slim"` buttons (32px, the row's height).
|
|
109
|
+
* @slot actions - Buttons at the end of the header row, e.g. "Customise columns". With a slotted header they get a row of their own above it.
|
|
106
110
|
* @slot empty - Shown instead of the rows when there are none, e.g. a `cm-empty-state`.
|
|
107
111
|
* @fires cm-selection-change - `detail: { selected, all }`: values of the selected rows, and whether every matching resource (all `total`) is selected.
|
|
108
112
|
*/
|
|
@@ -143,6 +147,15 @@ export declare class CmResourceList extends CmLocalizedElement {
|
|
|
143
147
|
_rows: {
|
|
144
148
|
state: boolean;
|
|
145
149
|
};
|
|
150
|
+
_hasHeader: {
|
|
151
|
+
state: boolean;
|
|
152
|
+
};
|
|
153
|
+
_hasTable: {
|
|
154
|
+
state: boolean;
|
|
155
|
+
};
|
|
156
|
+
_hasActions: {
|
|
157
|
+
state: boolean;
|
|
158
|
+
};
|
|
146
159
|
};
|
|
147
160
|
/** Rows get checkboxes and the selection toolbar appears. */
|
|
148
161
|
selectable: boolean;
|
|
@@ -162,6 +175,9 @@ export declare class CmResourceList extends CmLocalizedElement {
|
|
|
162
175
|
label: string;
|
|
163
176
|
_count: number;
|
|
164
177
|
_rows: number;
|
|
178
|
+
_hasHeader: boolean;
|
|
179
|
+
_hasTable: boolean;
|
|
180
|
+
_hasActions: boolean;
|
|
165
181
|
static styles: import("lit").CSSResult[];
|
|
166
182
|
constructor();
|
|
167
183
|
/** The `cm-resource-item` rows. */
|
|
@@ -9,7 +9,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
10
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
11
|
};
|
|
12
|
-
var _CmResourceItem_instances, _CmResourceItem_internals, _CmResourceItem_onRowClick, _CmResourceList_instances, _CmResourceList_id, _CmResourceList_headers, _CmResourceList_plural, _CmResourceList_syncHeaders, _CmResourceList_onHeaderSlot, _CmResourceList_sync, _CmResourceList_emit, _CmResourceList_menuSelect;
|
|
12
|
+
var _CmResourceItem_instances, _CmResourceItem_internals, _CmResourceItem_onRowClick, _CmResourceList_instances, _CmResourceList_id, _CmResourceList_headers, _CmResourceList_plural, _CmResourceList_syncHeaders, _CmResourceList_onHeaderSlot, _CmResourceList_onActionsSlot, _CmResourceList_sync, _CmResourceList_emit, _CmResourceList_menuSelect;
|
|
13
13
|
import { html, css, nothing } from 'lit';
|
|
14
14
|
import { base, define, nextId } from '../base.js';
|
|
15
15
|
import { CmLocalizedElement, defineStrings, pluralCategory } from '../localize.js';
|
|
@@ -39,7 +39,7 @@ const strings = defineStrings('resourceList', {
|
|
|
39
39
|
loading: 'Loading {resource}',
|
|
40
40
|
});
|
|
41
41
|
const checkboxStyles = css `
|
|
42
|
-
.check { position: relative; display: inline-flex; flex: none; width:
|
|
42
|
+
.check { position: relative; display: inline-flex; flex: none; width: 16px; height: 16px; }
|
|
43
43
|
.check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
|
|
44
44
|
.check input:disabled { cursor: not-allowed; }
|
|
45
45
|
.box {
|
|
@@ -49,14 +49,14 @@ const checkboxStyles = css `
|
|
|
49
49
|
}
|
|
50
50
|
.dash { width: 50%; height: 2px; background: currentColor; }
|
|
51
51
|
.check input:focus-visible + .box { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
52
|
-
.check input:disabled + .box { border-color: var(--cm-border-
|
|
52
|
+
.check input:disabled + .box { border-color: var(--cm-border-subtle); background: var(--cm-bg-input-filled); }
|
|
53
53
|
`;
|
|
54
54
|
/**
|
|
55
55
|
* A row in a `cm-resource-list`: a checkbox when the list is selectable, an optional thumbnail and
|
|
56
56
|
* any content. With `href` the whole row is a link; otherwise clicking a selectable row ticks it.
|
|
57
57
|
* @element cm-resource-item
|
|
58
58
|
* @slot - Row content: name, details, badges. To line up with a `cm-table-header`, set `columns` and give one element per column.
|
|
59
|
-
* @slot media - A
|
|
59
|
+
* @slot media - A 40px thumbnail (32px on phones): a `cm-thumbnail` (recommended; `alt=""` when the row names the product) or an `<img>`.
|
|
60
60
|
* @slot actions - Buttons at the end of the row. They do not toggle selection.
|
|
61
61
|
* @fires cm-resource-select - `detail: { value, selected }` when the merchant ticks or unticks the row. The list handles it.
|
|
62
62
|
*/
|
|
@@ -111,7 +111,7 @@ export class CmResourceItem extends CmLocalizedElement {
|
|
|
111
111
|
${this.selectable
|
|
112
112
|
? html `<span class="check" part="checkbox"><input type="checkbox" aria-label=${this.t('select', { name: this.name })} .checked=${this.selected}
|
|
113
113
|
?disabled=${this.disabled} @change=${(e) => this.toggle(e.target.checked)} />
|
|
114
|
-
<span class="box" aria-hidden="true">${this.selected ? html `<cm-icon name="check" size="
|
|
114
|
+
<span class="box" aria-hidden="true">${this.selected ? html `<cm-icon name="check" size="12"></cm-icon>` : nothing}</span></span>`
|
|
115
115
|
: nothing}
|
|
116
116
|
<span class="media"><slot name="media"></slot></span>
|
|
117
117
|
<div class="content" part="content"><slot></slot></div>
|
|
@@ -143,20 +143,23 @@ CmResourceItem.styles = [
|
|
|
143
143
|
base,
|
|
144
144
|
checkboxStyles,
|
|
145
145
|
css `
|
|
146
|
-
:host { display: block; position: relative; border-bottom: var(--cm-border-1) solid var(--cm-border-
|
|
146
|
+
:host { display: block; position: relative; border-bottom: var(--cm-border-1) solid var(--cm-border-subtle); }
|
|
147
147
|
:host(:last-child) { border-bottom: 0; }
|
|
148
|
+
/* 56px rows (a 40px thumbnail with space-8 above and below), 14px text. A cm-table-header in the list's header
|
|
149
|
+
slot mirrors this geometry (resource-rows in table-header.ts): change both together. */
|
|
148
150
|
.row {
|
|
149
|
-
display: flex; align-items: center; gap: var(--cm-space-
|
|
150
|
-
|
|
151
|
+
display: flex; align-items: center; gap: var(--cm-space-12); box-sizing: border-box;
|
|
152
|
+
min-height: calc(var(--cm-control-height-lg) + 2 * var(--cm-space-8)); padding: var(--cm-space-8);
|
|
153
|
+
font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14);
|
|
151
154
|
}
|
|
152
|
-
:host(:hover:not([disabled])) .row, :host([selected]) .row { background: var(--cm-bg-
|
|
155
|
+
:host(:hover:not([disabled])) .row, :host([selected]) .row { background: var(--cm-bg-hover); }
|
|
153
156
|
:host([selectable]:not([href]):not([disabled])) .row { cursor: pointer; }
|
|
154
157
|
:host([disabled]) .row { color: var(--cm-text-tertiary); }
|
|
155
158
|
.media { display: contents; }
|
|
156
159
|
::slotted([slot='media']) {
|
|
157
|
-
flex: none; width:
|
|
160
|
+
flex: none; width: 40px; height: 40px; object-fit: cover; border-radius: var(--cm-radius-sm); background: var(--cm-thumb-bg);
|
|
158
161
|
}
|
|
159
|
-
::slotted(cm-thumbnail[slot='media']) { --cm-thumbnail-size:
|
|
162
|
+
::slotted(cm-thumbnail[slot='media']) { --cm-thumbnail-size: 40px; background: none; }
|
|
160
163
|
.content { flex: 1; min-width: 0; }
|
|
161
164
|
:host([columns]) .content {
|
|
162
165
|
display: grid; grid-template-columns: var(--cm-table-columns, minmax(0, 1fr)); column-gap: var(--cm-space-20); align-items: center;
|
|
@@ -165,30 +168,34 @@ CmResourceItem.styles = [
|
|
|
165
168
|
a { position: absolute; inset: 0; z-index: 0; border-radius: var(--cm-radius-xs); }
|
|
166
169
|
a:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: -2px; }
|
|
167
170
|
.check, .actions { position: relative; z-index: 1; }
|
|
168
|
-
.actions { display: flex; gap: var(--cm-space-
|
|
171
|
+
.actions { display: flex; gap: var(--cm-space-8); }
|
|
169
172
|
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
170
173
|
@media (max-width: 640px) {
|
|
171
|
-
.row { gap: var(--cm-space-
|
|
172
|
-
.check { width:
|
|
173
|
-
::slotted([slot='media']) { width:
|
|
174
|
-
::slotted(cm-thumbnail[slot='media']) { --cm-thumbnail-size:
|
|
174
|
+
.row { gap: var(--cm-space-8); padding: var(--cm-space-12) 0; }
|
|
175
|
+
.check { width: 20px; height: 20px; }
|
|
176
|
+
::slotted([slot='media']) { width: 32px; height: 32px; }
|
|
177
|
+
::slotted(cm-thumbnail[slot='media']) { --cm-thumbnail-size: 32px; }
|
|
175
178
|
}
|
|
176
179
|
`,
|
|
177
180
|
];
|
|
178
181
|
define('cm-resource-item', CmResourceItem);
|
|
179
182
|
/**
|
|
180
183
|
* A list of products, orders, customers or other resources, with optional bulk selection.
|
|
181
|
-
* When `selectable`,
|
|
182
|
-
*
|
|
184
|
+
* When `selectable`, the list's header row (a slim grey bar at the top) has a select-all box lined up with the rows' checkboxes and,
|
|
185
|
+
* next to it, a small chevron menu (this page, all matching, none). Once something is selected the same row shows
|
|
186
|
+
* "2 products selected", a button to select all matching results when there are more than the rows, and the bulk actions.
|
|
187
|
+
* With a `cm-table-header` in the `header` slot, that header is the row: the box sits in its checkbox column, and the
|
|
188
|
+
* selection status and bulk actions cover the column names while rows are selected. (Until something is selected the
|
|
189
|
+
* chevron is hidden there, since the column names use its room; the box selects the page.)
|
|
183
190
|
* Put a `cm-table-header` in the `header` slot for column names and `cm-pagination` under the list.
|
|
184
191
|
* The list lines a slotted `cm-table-header` up with its rows (it sets the header's `resource-rows`): lay each row's
|
|
185
192
|
* content out as a grid with `grid-template-columns: var(--cm-table-columns)` and `column-gap: var(--cm-space-20)`,
|
|
186
193
|
* and set `--cm-table-columns` on the list.
|
|
187
194
|
* @element cm-resource-list
|
|
188
195
|
* @slot - `cm-resource-item` rows.
|
|
189
|
-
* @slot header - A `cm-table-header` (or anything)
|
|
190
|
-
* @slot bulk-actions - Buttons that act on the selection, e.g. "Bulk orders". Shown once a row is selected.
|
|
191
|
-
* @slot actions - Buttons at the end of the
|
|
196
|
+
* @slot header - A `cm-table-header` (or anything) above the rows. A `cm-table-header` here is lined up with the rows, checkbox column included, and shares its row with the select-all box.
|
|
197
|
+
* @slot bulk-actions - Buttons that act on the selection, e.g. "Bulk orders". Shown once a row is selected, in the header row: use `size="slim"` buttons (32px, the row's height).
|
|
198
|
+
* @slot actions - Buttons at the end of the header row, e.g. "Customise columns". With a slotted header they get a row of their own above it.
|
|
192
199
|
* @slot empty - Shown instead of the rows when there are none, e.g. a `cm-empty-state`.
|
|
193
200
|
* @fires cm-selection-change - `detail: { selected, all }`: values of the selected rows, and whether every matching resource (all `total`) is selected.
|
|
194
201
|
*/
|
|
@@ -212,13 +219,19 @@ export class CmResourceList extends CmLocalizedElement {
|
|
|
212
219
|
this.label = '';
|
|
213
220
|
this._count = 0;
|
|
214
221
|
this._rows = 0;
|
|
222
|
+
this._hasHeader = false;
|
|
223
|
+
this._hasTable = false;
|
|
224
|
+
this._hasActions = false;
|
|
215
225
|
_CmResourceList_id.set(this, nextId('cm-rl'));
|
|
216
226
|
_CmResourceList_headers.set(this, new Set());
|
|
217
227
|
_CmResourceList_onHeaderSlot.set(this, (e) => {
|
|
218
228
|
const slot = e.target;
|
|
219
|
-
|
|
229
|
+
this._hasHeader = slot.assignedElements().length > 0;
|
|
220
230
|
__classPrivateFieldGet(this, _CmResourceList_instances, "m", _CmResourceList_syncHeaders).call(this, slot);
|
|
221
231
|
});
|
|
232
|
+
_CmResourceList_onActionsSlot.set(this, (e) => {
|
|
233
|
+
this._hasActions = e.target.assignedElements().length > 0;
|
|
234
|
+
});
|
|
222
235
|
_CmResourceList_menuSelect.set(this, (e) => {
|
|
223
236
|
e.stopPropagation(); // the list's own menu: don't leak its cm-select to the page
|
|
224
237
|
const v = e.detail.value;
|
|
@@ -286,27 +299,35 @@ export class CmResourceList extends CmLocalizedElement {
|
|
|
286
299
|
status = html `${this.t('selected', { count: n, resource: noun(n) })}${all && more
|
|
287
300
|
? html ` <button type="button" @click=${() => this.selectAll()}>${this.t('selectAll', { count: this.total, resource: plural })}</button>` : nothing}`;
|
|
288
301
|
}
|
|
302
|
+
const busy = n > 0 || this.allSelected;
|
|
303
|
+
const over = this._hasTable;
|
|
304
|
+
// The chevron needs the room the column names use, so over a header it waits until something is selected.
|
|
305
|
+
const menu = !this.hideSelectMenu && (!over || busy);
|
|
306
|
+
const actions = html `<slot name="actions" @slotchange=${__classPrivateFieldGet(this, _CmResourceList_onActionsSlot, "f")}></slot>`;
|
|
289
307
|
return html `
|
|
290
|
-
${this.selectable
|
|
291
|
-
|
|
308
|
+
${this.selectable && over ? html `<div class="top ${this._hasActions ? 'has' : ''}" part="top-actions">${actions}</div>` : nothing}
|
|
309
|
+
<div class="head ${this.selectable || this._hasHeader ? 'on' : ''} ${over ? 'over' : ''}">
|
|
310
|
+
<div class="header ${this._hasHeader ? 'has' : ''}"><slot name="header" @slotchange=${__classPrivateFieldGet(this, _CmResourceList_onHeaderSlot, "f")}></slot></div>
|
|
311
|
+
${this.selectable
|
|
312
|
+
? html `<div class="toolbar ${over ? 'over' : ''} ${busy ? 'busy' : ''}" part="toolbar">
|
|
292
313
|
<span class="select" part="select">
|
|
293
314
|
<span class="check"><input id="${__classPrivateFieldGet(this, _CmResourceList_id, "f")}-all" type="checkbox" .checked=${all} .indeterminate=${n > 0 && !all}
|
|
294
315
|
?disabled=${!enabled} @change=${(e) => this.selectPage(e.target.checked)} />
|
|
295
316
|
<span class="box" aria-hidden="true">${n > 0 && !all ? html `<span class="dash"></span>` : all ? html `<cm-icon name="check" size="12"></cm-icon>` : nothing}</span></span>
|
|
296
|
-
|
|
297
|
-
${this.hideSelectMenu ? nothing : html `<cm-action-menu icon-only icon="chevron-down" part="select-menu" label=${this.t('selectionOptions')}
|
|
317
|
+
${this.hideSelectMenu ? nothing : html `<cm-action-menu icon-only icon="chevron-down" part="select-menu" label=${this.t('selectionOptions')} ?hidden=${!menu}
|
|
298
318
|
.items=${[
|
|
299
319
|
{ label: this.t('selectPage', { count: enabled }), value: 'page', disabled: !enabled },
|
|
300
320
|
...(more ? [{ label: this.t('selectAll', { count: this.total, resource: plural }), value: 'all' }] : []),
|
|
301
321
|
{ label: this.t('selectNone'), value: 'none', disabled: !n && !this.allSelected },
|
|
302
322
|
]} @cm-select=${__classPrivateFieldGet(this, _CmResourceList_menuSelect, "f")}></cm-action-menu>`}
|
|
323
|
+
<label for="${__classPrivateFieldGet(this, _CmResourceList_id, "f")}-all" class=${over || busy ? 'sr' : 'label'}>${this.t('select')}<span class="sr"> ${this.t('selectPageHidden', { count: rows, resource: noun(rows) })}</span></label>
|
|
303
324
|
</span>
|
|
304
|
-
<span class="bulk" ?hidden=${!n}><slot name="bulk-actions"></slot></span>
|
|
305
325
|
<span class="status" part="status" role="status">${status}</span>
|
|
306
|
-
<span class="
|
|
326
|
+
<span class="bulk" ?hidden=${!n}><slot name="bulk-actions"></slot></span>
|
|
327
|
+
${over ? nothing : html `<span class="actions ${this._hasActions ? 'has' : ''}">${actions}</span>`}
|
|
307
328
|
</div>`
|
|
308
329
|
: nothing}
|
|
309
|
-
|
|
330
|
+
</div>
|
|
310
331
|
<div class="body">
|
|
311
332
|
<div class="list" part="list" role="list" aria-label=${this.label || plural.replace(/^./, (c) => c.toUpperCase())} aria-busy=${this.loading ? 'true' : 'false'}>
|
|
312
333
|
<slot @slotchange=${() => __classPrivateFieldGet(this, _CmResourceList_instances, "m", _CmResourceList_sync).call(this)}></slot>
|
|
@@ -317,7 +338,7 @@ export class CmResourceList extends CmLocalizedElement {
|
|
|
317
338
|
`;
|
|
318
339
|
}
|
|
319
340
|
}
|
|
320
|
-
_CmResourceList_id = new WeakMap(), _CmResourceList_headers = new WeakMap(), _CmResourceList_onHeaderSlot = new WeakMap(), _CmResourceList_menuSelect = new WeakMap(), _CmResourceList_instances = new WeakSet(), _CmResourceList_plural = function _CmResourceList_plural() {
|
|
341
|
+
_CmResourceList_id = new WeakMap(), _CmResourceList_headers = new WeakMap(), _CmResourceList_onHeaderSlot = new WeakMap(), _CmResourceList_onActionsSlot = new WeakMap(), _CmResourceList_menuSelect = new WeakMap(), _CmResourceList_instances = new WeakSet(), _CmResourceList_plural = function _CmResourceList_plural() {
|
|
321
342
|
if (this.resourceNamePlural)
|
|
322
343
|
return this.resourceNamePlural;
|
|
323
344
|
const own = this.resourceName;
|
|
@@ -338,6 +359,7 @@ _CmResourceList_id = new WeakMap(), _CmResourceList_headers = new WeakMap(), _Cm
|
|
|
338
359
|
for (const h of found)
|
|
339
360
|
h.setAttribute('resource-rows', this.selectable ? 'selectable' : 'plain');
|
|
340
361
|
__classPrivateFieldSet(this, _CmResourceList_headers, found, "f");
|
|
362
|
+
this._hasTable = found.size > 0;
|
|
341
363
|
}, _CmResourceList_sync = function _CmResourceList_sync() {
|
|
342
364
|
const items = this.items;
|
|
343
365
|
items.forEach((i) => (i.selectable = this.selectable));
|
|
@@ -357,34 +379,55 @@ CmResourceList.properties = {
|
|
|
357
379
|
label: {},
|
|
358
380
|
_count: { state: true },
|
|
359
381
|
_rows: { state: true },
|
|
382
|
+
_hasHeader: { state: true },
|
|
383
|
+
_hasTable: { state: true },
|
|
384
|
+
_hasActions: { state: true },
|
|
360
385
|
};
|
|
361
386
|
CmResourceList.styles = [
|
|
362
387
|
base,
|
|
363
388
|
checkboxStyles,
|
|
364
389
|
css `
|
|
365
|
-
:host { display: block; position: relative; background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); }
|
|
366
|
-
.
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
390
|
+
:host { display: block; position: relative; background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); --_pad: var(--cm-space-12); }
|
|
391
|
+
/* The header row. Rows sit --_pad in from the list's edges and pad space-8 inside (0 on phones), so their 16px
|
|
392
|
+
checkbox starts space-20 from the edge (space-12 on phones, 20px box). The header row runs edge to edge and puts
|
|
393
|
+
its box at the same place. The slotted header and the toolbar share one grid cell: the toolbar lies over the
|
|
394
|
+
header's checkbox column, and while rows are selected it covers the column names. */
|
|
395
|
+
.head { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0 var(--_pad); }
|
|
396
|
+
.head:not(.on) { display: none; }
|
|
397
|
+
.head.over > * { grid-area: 1 / 1; }
|
|
398
|
+
.head:not(.over) .toolbar { order: -1; }
|
|
399
|
+
.head:not(.over) .header { padding-block-start: var(--cm-space-8); }
|
|
400
|
+
.header:not(.has) { display: none; }
|
|
401
|
+
.toolbar {
|
|
402
|
+
position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-4) var(--cm-space-8);
|
|
403
|
+
box-sizing: border-box; min-height: var(--cm-control-height-sm);
|
|
404
|
+
margin-inline: calc(-1 * var(--_pad)); padding-block: 0; padding-inline: calc(var(--_pad) + var(--cm-space-8)) var(--_pad);
|
|
405
|
+
font-size: var(--cm-font-size-13); line-height: var(--cm-line-height-13);
|
|
406
|
+
background: var(--cm-bg-hover); box-shadow: inset 0 var(--cm-border-1) 0 var(--cm-border-subtle), inset 0 calc(-1 * var(--cm-border-1)) 0 var(--cm-border-subtle);
|
|
370
407
|
}
|
|
371
|
-
|
|
372
|
-
.
|
|
373
|
-
.
|
|
374
|
-
.select
|
|
375
|
-
.
|
|
408
|
+
/* Over a slotted header with nothing selected: only the box shows, in the header's checkbox column. */
|
|
409
|
+
.toolbar.over:not(.busy) { background: none; box-shadow: none; pointer-events: none; }
|
|
410
|
+
.toolbar.over:not(.busy) > * { pointer-events: auto; }
|
|
411
|
+
.select { display: inline-flex; align-items: center; gap: var(--cm-space-4); }
|
|
412
|
+
.select label { cursor: pointer; font-weight: 500; }
|
|
413
|
+
.select .label[hidden] { display: none; }
|
|
414
|
+
.select cm-action-menu::part(trigger) { width: var(--cm-space-24); min-height: var(--cm-space-24); border-radius: var(--cm-radius-xs); }
|
|
415
|
+
.select cm-action-menu[hidden] { display: none; }
|
|
416
|
+
.bulk { display: flex; flex-wrap: wrap; gap: var(--cm-space-8); }
|
|
376
417
|
.bulk[hidden] { display: none; }
|
|
377
|
-
.status {
|
|
418
|
+
.status { font-weight: 500; font-variant-numeric: tabular-nums; }
|
|
419
|
+
.status:empty { display: none; }
|
|
378
420
|
.status button { font: inherit; font-weight: 500; color: inherit; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }
|
|
379
421
|
.status button:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
380
|
-
.actions { display: flex; gap: var(--cm-space-
|
|
381
|
-
.
|
|
382
|
-
.
|
|
422
|
+
.actions { display: flex; gap: var(--cm-space-8); margin-inline-start: auto; }
|
|
423
|
+
.actions:not(.has) { display: none; }
|
|
424
|
+
.top { display: flex; justify-content: flex-end; gap: var(--cm-space-8); padding: var(--cm-space-8) var(--_pad); }
|
|
425
|
+
.top:not(.has) { display: none; }
|
|
383
426
|
.body { position: relative; }
|
|
384
|
-
.list { padding: 0 var(--
|
|
427
|
+
.list { padding: 0 var(--_pad) var(--cm-space-8); }
|
|
385
428
|
:host([loading]) .list ::slotted(*) { opacity: 0.4; }
|
|
386
429
|
.spinner {
|
|
387
|
-
position: absolute; inset-inline-start: 50%; top: 50%; width:
|
|
430
|
+
position: absolute; inset-inline-start: 50%; top: 50%; width: 48px; height: 48px; margin: -24px; border-radius: 50%;
|
|
388
431
|
border: 4px solid var(--cm-thumb-bg); border-top-color: var(--cm-icon-selected); animation: spin 0.8s linear infinite;
|
|
389
432
|
}
|
|
390
433
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
@@ -392,12 +435,9 @@ CmResourceList.styles = [
|
|
|
392
435
|
.empty:not(.show) { display: none; }
|
|
393
436
|
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
394
437
|
@media (max-width: 640px) {
|
|
395
|
-
.toolbar {
|
|
396
|
-
.
|
|
397
|
-
.
|
|
398
|
-
.header { padding: var(--cm-space-10) var(--cm-space-10) 0; }
|
|
399
|
-
.list { padding: 0 var(--cm-space-10); }
|
|
400
|
-
.spinner { width: 30px; height: 30px; margin: -15px; border-width: 3px; }
|
|
438
|
+
.toolbar { padding-inline: var(--_pad); }
|
|
439
|
+
.toolbar .check { width: 20px; height: 20px; }
|
|
440
|
+
.spinner { width: 32px; height: 32px; margin: -16px; border-width: 3px; }
|
|
401
441
|
}
|
|
402
442
|
`,
|
|
403
443
|
];
|
|
@@ -114,16 +114,16 @@ CmSaveBar.styles = [
|
|
|
114
114
|
:host(:not([open])) { display: none; }
|
|
115
115
|
.bar {
|
|
116
116
|
display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cm-space-20);
|
|
117
|
-
min-height:
|
|
118
|
-
background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-
|
|
119
|
-
border-radius: var(--cm-radius-md); box-shadow: var(--cm-shadow-
|
|
117
|
+
min-height: 64px; padding: var(--cm-space-12) var(--cm-space-20);
|
|
118
|
+
background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-subtle);
|
|
119
|
+
border-radius: var(--cm-radius-md); box-shadow: var(--cm-shadow-lg);
|
|
120
120
|
}
|
|
121
|
-
.message { flex: 1 1 200px; margin: 0; font-size:
|
|
122
|
-
.actions { flex: none; display: flex; gap: var(--cm-space-
|
|
121
|
+
.message { flex: 1 1 200px; margin: 0; font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); font-weight: 600; }
|
|
122
|
+
.actions { flex: none; display: flex; gap: var(--cm-space-8); margin-inline-start: auto; }
|
|
123
123
|
@media (max-width: 640px) {
|
|
124
|
-
.bar { min-height:
|
|
125
|
-
.message { font-size:
|
|
126
|
-
|
|
124
|
+
.bar { min-height: 56px; padding: var(--cm-space-8) var(--cm-space-12); gap: var(--cm-space-8); }
|
|
125
|
+
.message { font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); font-weight: 500; }
|
|
126
|
+
|
|
127
127
|
}
|
|
128
128
|
`,
|
|
129
129
|
];
|
|
@@ -77,8 +77,11 @@ export declare class CmSearch extends CmLocalizedElement {
|
|
|
77
77
|
filterLabel: string;
|
|
78
78
|
/** Number of filters applied; shown on the filter button when above 0. */
|
|
79
79
|
filterCount: number;
|
|
80
|
-
/**
|
|
81
|
-
|
|
80
|
+
/**
|
|
81
|
+
* `default` 36px (lists, table headers); `small` 32px (toolbars and filter rows, since 1.5); `large` 40px (page-level
|
|
82
|
+
* search). On touch screens every size is 44px.
|
|
83
|
+
*/
|
|
84
|
+
size: 'default' | 'small' | 'large';
|
|
82
85
|
/** Blocks interaction. Also set by a disabled `<fieldset>`. */
|
|
83
86
|
disabled: boolean;
|
|
84
87
|
static styles: import("lit").CSSResult[];
|
|
@@ -12,6 +12,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
12
12
|
var _CmSearch_instances, _CmSearch_internals, _CmSearch_id, _CmSearch_defaultValue, _CmSearch_fire, _CmSearch_onInput, _CmSearch_onKeyDown, _CmSearch_clear;
|
|
13
13
|
import { LitElement, html, css, nothing } from 'lit';
|
|
14
14
|
import { live } from 'lit/directives/live.js';
|
|
15
|
+
import { fieldStyles } from '../field.js';
|
|
15
16
|
import { base, define, nextId } from '../base.js';
|
|
16
17
|
import { CmLocalizedElement, defineStrings } from '../localize.js';
|
|
17
18
|
import './icon.js';
|
|
@@ -46,7 +47,10 @@ export class CmSearch extends CmLocalizedElement {
|
|
|
46
47
|
this.filter = false;
|
|
47
48
|
/** Number of filters applied; shown on the filter button when above 0. */
|
|
48
49
|
this.filterCount = 0;
|
|
49
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* `default` 36px (lists, table headers); `small` 32px (toolbars and filter rows, since 1.5); `large` 40px (page-level
|
|
52
|
+
* search). On touch screens every size is 44px.
|
|
53
|
+
*/
|
|
50
54
|
this.size = 'default';
|
|
51
55
|
/** Blocks interaction. Also set by a disabled `<fieldset>`. */
|
|
52
56
|
this.disabled = false;
|
|
@@ -65,19 +69,18 @@ export class CmSearch extends CmLocalizedElement {
|
|
|
65
69
|
formStateRestoreCallback(state) { this.value = state; }
|
|
66
70
|
updated() { __classPrivateFieldGet(this, _CmSearch_internals, "f").setFormValue(this.value); }
|
|
67
71
|
render() {
|
|
68
|
-
const big = this.size === 'large';
|
|
69
72
|
return html `<div class="box" part="box">
|
|
70
|
-
<cm-icon class="icon" name="search" size
|
|
73
|
+
<cm-icon class="icon" name="search" size="16"></cm-icon>
|
|
71
74
|
<input id=${__classPrivateFieldGet(this, _CmSearch_id, "f")} part="input" type="search" enterkeyhint="search" autocomplete="off"
|
|
72
75
|
aria-label=${this.label} .value=${live(this.value)} placeholder=${this.placeholder || nothing} ?disabled=${this.disabled}
|
|
73
76
|
@input=${__classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_onInput)} @change=${() => __classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_fire).call(this, 'change')} @keydown=${__classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_onKeyDown)} />
|
|
74
77
|
${this.value && !this.disabled
|
|
75
|
-
? html `<button type="button" class="clear" part="clear" aria-label=${this.t('clear')} @click=${__classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_clear)}><cm-icon name="close" size="
|
|
78
|
+
? html `<button type="button" class="clear" part="clear" aria-label=${this.t('clear')} @click=${__classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_clear)}><cm-icon name="close" size="16"></cm-icon></button>`
|
|
76
79
|
: nothing}
|
|
77
80
|
${this.filter
|
|
78
81
|
? html `<button type="button" class="filter" part="filter" ?disabled=${this.disabled}
|
|
79
82
|
aria-label=${this.filterCount > 0 ? this.t('filterApplied', { label: this.filterLabel, count: this.filterCount }) : this.filterLabel}
|
|
80
|
-
@click=${() => __classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_fire).call(this, 'cm-filter')}><cm-icon name="filter" size="
|
|
83
|
+
@click=${() => __classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_fire).call(this, 'cm-filter')}><cm-icon name="filter" size="16"></cm-icon>${this.filterCount > 0 ? html `<span class="count" aria-hidden="true">${this.filterCount}</span>` : nothing}</button>`
|
|
81
84
|
: nothing}
|
|
82
85
|
</div>`;
|
|
83
86
|
}
|
|
@@ -114,34 +117,37 @@ CmSearch.properties = {
|
|
|
114
117
|
};
|
|
115
118
|
CmSearch.styles = [
|
|
116
119
|
base,
|
|
120
|
+
fieldStyles,
|
|
117
121
|
css `
|
|
118
122
|
:host { display: block; }
|
|
123
|
+
:host([size='large']) { --_cm-field-h: var(--cm-control-height-lg, 40px); }
|
|
124
|
+
@media (pointer: coarse) { :host([size='large']) { --_cm-field-h: var(--cm-control-height-touch, 44px); } button { width: 32px; height: 32px; } }
|
|
119
125
|
.box {
|
|
120
|
-
display: flex; align-items: center; gap: var(--cm-space-
|
|
121
|
-
background: var(--cm-bg-
|
|
126
|
+
display: flex; align-items: center; gap: var(--cm-space-8); height: var(--_cm-field-h); padding-block: 0; padding-inline: var(--_cm-field-pad) var(--cm-space-8);
|
|
127
|
+
background: var(--cm-bg-surface); color: var(--cm-text-default);
|
|
122
128
|
border: var(--cm-border-1) solid var(--cm-border-input); border-radius: var(--cm-radius-sm);
|
|
123
129
|
}
|
|
124
|
-
:host([size='large']) .box { height: 46px; padding: 0 var(--cm-space-15); }
|
|
125
130
|
.box:focus-within { border-color: var(--cm-border-strong); box-shadow: 0 0 0 1px var(--cm-border-strong); }
|
|
126
|
-
.icon { flex: none; color: var(--cm-
|
|
131
|
+
.icon { flex: none; color: var(--cm-text-tertiary); }
|
|
127
132
|
input {
|
|
128
133
|
flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; outline: none;
|
|
129
|
-
font: inherit; font-size:
|
|
134
|
+
font: inherit; font-size: var(--_cm-field-font); color: var(--cm-text-default);
|
|
130
135
|
}
|
|
131
136
|
input::placeholder { color: var(--cm-text-tertiary); }
|
|
132
137
|
input::-webkit-search-cancel-button { display: none; }
|
|
133
138
|
button {
|
|
134
139
|
position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
|
|
135
|
-
width:
|
|
140
|
+
width: 24px; height: 24px; margin: 0; padding: 0; border: 0; border-radius: var(--cm-radius-xs);
|
|
136
141
|
background: none; color: var(--cm-icon-selected); cursor: pointer;
|
|
137
142
|
}
|
|
138
143
|
button:hover { background: var(--cm-bg-hover); }
|
|
139
144
|
button:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 0; }
|
|
140
145
|
.count {
|
|
141
|
-
position: absolute; top: -
|
|
142
|
-
background: var(--cm-action-primary); color: var(--cm-action-primary-text);
|
|
146
|
+
position: absolute; top: -4px; inset-inline-end: -4px; min-width: 16px; height: 16px; padding: 0 var(--cm-space-4); border-radius: var(--cm-radius-full);
|
|
147
|
+
background: var(--cm-action-primary); color: var(--cm-action-primary-text);
|
|
148
|
+
font-size: var(--cm-font-size-12); line-height: 16px; font-weight: 500; font-variant-numeric: tabular-nums;
|
|
143
149
|
}
|
|
144
|
-
:host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-
|
|
150
|
+
:host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
|
|
145
151
|
:host([disabled]) input { color: var(--cm-text-secondary); cursor: not-allowed; }
|
|
146
152
|
:host([disabled]) button { cursor: not-allowed; }
|
|
147
153
|
`,
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { CmOptionGroup } from './option-group.js';
|
|
2
|
+
declare const strings: {
|
|
3
|
+
/** Validation message when `required` and nothing is chosen. */
|
|
4
|
+
required: string;
|
|
5
|
+
};
|
|
6
|
+
declare module '../localize.js' {
|
|
7
|
+
interface CmStrings {
|
|
8
|
+
segmentedControl: typeof strings;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A compact switch between two to four views or filters of the same content ("Open / Done", "Board / List"): the
|
|
13
|
+
* options sit side by side in one track and exactly one is selected. Since 1.5.
|
|
14
|
+
*
|
|
15
|
+
* It is an option group with a different look, so it behaves exactly like `cm-option-group`: a radio group with one
|
|
16
|
+
* tab stop, arrow keys (mirrored in right-to-left text), Home and End move and select, `change` fires on every new
|
|
17
|
+
* choice, and inside a form it submits its `value`. Options come from `<option>` children or the `options` property.
|
|
18
|
+
* Option `tone`s are not shown: a view switch has no good or bad answer.
|
|
19
|
+
*
|
|
20
|
+
* Use it to change what a page or card shows, right away. To pick a setting that is saved with a form, use
|
|
21
|
+
* `cm-option-group` (bigger, separate buttons); for five or more choices, `cm-select`; for page sections, tabs.
|
|
22
|
+
* @element cm-segmented-control
|
|
23
|
+
* @slot - `<option value="…">Label</option>` elements. `disabled` and `selected` are honoured.
|
|
24
|
+
* @csspart options - The track (`role="radiogroup"`).
|
|
25
|
+
* @csspart option - Each option (`role="radio"`).
|
|
26
|
+
* @csspart label - The visible label, when `label` is set.
|
|
27
|
+
* @fires change - When the merchant picks a different option.
|
|
28
|
+
* @fires input - Same moment as `change`.
|
|
29
|
+
*/
|
|
30
|
+
export declare class CmSegmentedControl extends CmOptionGroup {
|
|
31
|
+
static properties: {
|
|
32
|
+
size: {
|
|
33
|
+
reflect: boolean;
|
|
34
|
+
};
|
|
35
|
+
label: {};
|
|
36
|
+
name: {
|
|
37
|
+
reflect: boolean;
|
|
38
|
+
};
|
|
39
|
+
value: {};
|
|
40
|
+
options: {
|
|
41
|
+
type: ArrayConstructor;
|
|
42
|
+
};
|
|
43
|
+
required: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
reflect: boolean;
|
|
46
|
+
};
|
|
47
|
+
disabled: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
reflect: boolean;
|
|
50
|
+
};
|
|
51
|
+
_slotted: {
|
|
52
|
+
state: boolean;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* `default`: a 36px track, the height of buttons and fields beside it. `small`: 32px, for toolbars, filter rows and
|
|
57
|
+
* card headers next to small fields and slim buttons. On touch screens both are 44px tall.
|
|
58
|
+
*/
|
|
59
|
+
size: 'default' | 'small';
|
|
60
|
+
static styles: import("lit").CSSResult[];
|
|
61
|
+
}
|
|
62
|
+
declare global {
|
|
63
|
+
interface HTMLElementTagNameMap {
|
|
64
|
+
'cm-segmented-control': CmSegmentedControl;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export {};
|