@3mo/data-grid 0.2.5 → 0.2.6

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.
@@ -13,7 +13,7 @@ Localizer.register("de" /* LanguageCode.German */, {
13
13
  * @attr dataGrid
14
14
  * @attr tab
15
15
  */
16
- let DataGridSidePanel = class DataGridSidePanel extends Component {
16
+ export let DataGridSidePanel = class DataGridSidePanel extends Component {
17
17
  constructor() {
18
18
  super(...arguments);
19
19
  this.getColumnTemplate = (column) => {
@@ -24,117 +24,117 @@ let DataGridSidePanel = class DataGridSidePanel extends Component {
24
24
  this.dataGrid.requestUpdate();
25
25
  await this.dataGrid.updateComplete;
26
26
  };
27
- return html `
28
- <mo-checkbox ${style({ height: '30px' })}
29
- label=${column.heading}
30
- ?checked=${column.hidden === false}
31
- @change=${change}
32
- ></mo-checkbox>
27
+ return html `
28
+ <mo-checkbox ${style({ height: '30px' })}
29
+ label=${column.heading}
30
+ ?checked=${column.hidden === false}
31
+ @change=${change}
32
+ ></mo-checkbox>
33
33
  `;
34
34
  };
35
35
  }
36
36
  static get styles() {
37
- return css `
38
- :host {
39
- display: inline-block !important;
40
- transition: 250ms;
41
- width: 100%;
42
- height: 100%;
43
- transform-origin: right center;
44
- }
45
-
46
- :host(:not([hidden])) {
47
- border-inline-start: var(--mo-data-grid-border);
48
- background: var(--mo-color-transparent-gray-1);
49
- opacity: 1;
50
- }
51
-
52
- :host([hidden]) {
53
- opacity: 0;
54
- transform: scale(0, 1);
55
- width: 0;
56
- }
57
-
58
- #flexHeading {
59
- border-top: var(--mo-data-grid-border);
60
- border-bottom: var(--mo-data-grid-border);
61
- height: var(--mo-data-grid-header-height);
62
- padding-inline-start: 14px;
63
- }
64
-
65
- mo-scroller {
66
- width: calc(100% - calc(2 * 14px));
67
- padding: 0 14px;
68
- margin-top: 14px;
69
- overflow-x: hidden;
70
- }
71
-
72
- mo-scroller::part(container) {
73
- width: calc(100% - calc(2 * 14px));
74
- }
75
-
76
- mo-section mo-checkbox {
77
- margin-inline-start: -6px;
78
- }
79
-
80
- mo-section mo-icon-button {
81
- margin-inline-start: -10px;
82
- }
37
+ return css `
38
+ :host {
39
+ display: inline-block !important;
40
+ transition: 250ms;
41
+ width: 100%;
42
+ height: 100%;
43
+ transform-origin: right center;
44
+ }
45
+
46
+ :host(:not([hidden])) {
47
+ border-inline-start: var(--mo-data-grid-border);
48
+ background: var(--mo-color-transparent-gray-1);
49
+ opacity: 1;
50
+ }
51
+
52
+ :host([hidden]) {
53
+ opacity: 0;
54
+ transform: scale(0, 1);
55
+ width: 0;
56
+ }
57
+
58
+ #flexHeading {
59
+ border-top: var(--mo-data-grid-border);
60
+ border-bottom: var(--mo-data-grid-border);
61
+ height: var(--mo-data-grid-header-height);
62
+ padding-inline-start: 14px;
63
+ }
64
+
65
+ mo-scroller {
66
+ width: calc(100% - calc(2 * 14px));
67
+ padding: 0 14px;
68
+ margin-top: 14px;
69
+ overflow-x: hidden;
70
+ }
71
+
72
+ mo-scroller::part(container) {
73
+ width: calc(100% - calc(2 * 14px));
74
+ }
75
+
76
+ mo-section mo-checkbox {
77
+ margin-inline-start: -6px;
78
+ }
79
+
80
+ mo-section mo-icon-button {
81
+ margin-inline-start: -10px;
82
+ }
83
83
  `;
84
84
  }
85
85
  get template() {
86
- return html `
87
- <mo-flex ${style({ height: '100%' })}>
88
- ${this.dataGrid.hasToolbar || this.dataGrid.hasFilters === false ? nothing : html `
89
- <mo-tab-bar
90
- value=${ifDefined(this.dataGrid.sidePanelTab)}
91
- @change=${(e) => { var _a; return this.dataGrid.navigateToSidePanelTab((_a = e.detail) !== null && _a !== void 0 ? _a : "settings" /* DataGridSidePanelTab.Settings */); }}
92
- >
93
- <mo-tab icon='filter_list' value=${"filters" /* DataGridSidePanelTab.Filters */}></mo-tab>
94
- <mo-tab icon='settings' value=${"settings" /* DataGridSidePanelTab.Settings */}></mo-tab>
95
- </mo-tab-bar>
96
- `}
97
-
98
- ${this.dataGrid.hasToolbar === false && this.dataGrid.hasFilters === true ? nothing : html `
99
- <mo-flex id='flexHeading' direction='horizontal' alignItems='center'>
100
- <mo-heading typography='heading6' ${style({ width: '*', color: 'var(--mo-color-on-surface)' })}>${t(this.dataGrid.sidePanelTab === "filters" /* DataGridSidePanelTab.Filters */ ? 'Extended Filters' : 'Settings')}</mo-heading>
101
- <mo-icon-button icon='close' dense
102
- ${tooltip(t('Close'))}
103
- ${style({ cursor: 'pointer', color: 'var(--mo-color-gray)' })}
104
- @click=${() => this.dataGrid.navigateToSidePanelTab(undefined)}
105
- ></mo-icon-button>
106
- </mo-flex>
107
- `}
108
-
109
- <mo-scroller ${style({ height: '*' })}>
110
- ${this.dataGrid.sidePanelTab === "filters" /* DataGridSidePanelTab.Filters */ ? this.filtersTemplate : this.settingsTemplate}
111
- </mo-scroller>
112
- </mo-flex>
86
+ return html `
87
+ <mo-flex ${style({ height: '100%' })}>
88
+ ${this.dataGrid.hasToolbar || this.dataGrid.hasFilters === false ? nothing : html `
89
+ <mo-tab-bar
90
+ value=${ifDefined(this.dataGrid.sidePanelTab)}
91
+ @change=${(e) => { var _a; return this.dataGrid.navigateToSidePanelTab((_a = e.detail) !== null && _a !== void 0 ? _a : "settings" /* DataGridSidePanelTab.Settings */); }}
92
+ >
93
+ <mo-tab icon='filter_list' value=${"filters" /* DataGridSidePanelTab.Filters */}></mo-tab>
94
+ <mo-tab icon='settings' value=${"settings" /* DataGridSidePanelTab.Settings */}></mo-tab>
95
+ </mo-tab-bar>
96
+ `}
97
+
98
+ ${this.dataGrid.hasToolbar === false && this.dataGrid.hasFilters === true ? nothing : html `
99
+ <mo-flex id='flexHeading' direction='horizontal' alignItems='center'>
100
+ <mo-heading typography='heading6' ${style({ width: '*', color: 'var(--mo-color-on-surface)' })}>${t(this.dataGrid.sidePanelTab === "filters" /* DataGridSidePanelTab.Filters */ ? 'Extended Filters' : 'Settings')}</mo-heading>
101
+ <mo-icon-button icon='close' dense
102
+ ${tooltip(t('Close'))}
103
+ ${style({ cursor: 'pointer', color: 'var(--mo-color-gray)' })}
104
+ @click=${() => this.dataGrid.navigateToSidePanelTab(undefined)}
105
+ ></mo-icon-button>
106
+ </mo-flex>
107
+ `}
108
+
109
+ <mo-scroller ${style({ height: '*' })}>
110
+ ${this.dataGrid.sidePanelTab === "filters" /* DataGridSidePanelTab.Filters */ ? this.filtersTemplate : this.settingsTemplate}
111
+ </mo-scroller>
112
+ </mo-flex>
113
113
  `;
114
114
  }
115
115
  get filtersTemplate() {
116
- return html `
117
- <mo-flex gap='14px'>
118
- <slot name='filter'></slot>
119
- </mo-flex>
116
+ return html `
117
+ <mo-flex gap='14px'>
118
+ <slot name='filter'></slot>
119
+ </mo-flex>
120
120
  `;
121
121
  }
122
122
  get settingsTemplate() {
123
- return html `
124
- <mo-flex gap='14px'>
125
- <slot name='settings'></slot>
126
-
127
- <mo-section heading=${t('Columns')}>
128
- ${this.dataGrid.columns.map(this.getColumnTemplate)}
129
- </mo-section>
130
-
131
- <mo-section heading='Tools'>
132
- <mo-icon-button icon='file_download'
133
- ${tooltip('Export as Excel file')}
134
- @click=${() => this.dataGrid.exportExcelFile()}
135
- ></mo-icon-button>
136
- </mo-section>
137
- </mo-flex>
123
+ return html `
124
+ <mo-flex gap='14px'>
125
+ <slot name='settings'></slot>
126
+
127
+ <mo-section heading=${t('Columns')}>
128
+ ${this.dataGrid.columns.map(this.getColumnTemplate)}
129
+ </mo-section>
130
+
131
+ <mo-section heading='Tools'>
132
+ <mo-icon-button icon='file_download'
133
+ ${tooltip('Export as Excel file')}
134
+ @click=${() => this.dataGrid.exportExcelFile()}
135
+ ></mo-icon-button>
136
+ </mo-section>
137
+ </mo-flex>
138
138
  `;
139
139
  }
140
140
  };
@@ -147,4 +147,3 @@ __decorate([
147
147
  DataGridSidePanel = __decorate([
148
148
  component('mo-data-grid-side-panel')
149
149
  ], DataGridSidePanel);
150
- export { DataGridSidePanel };
@@ -2,15 +2,15 @@ var FieldSelectDataGridPageSize_1;
2
2
  import { __decorate } from "tslib";
3
3
  import { component, html, property, nothing } from '@a11d/lit';
4
4
  import { FieldSelect } from '@3mo/select-field';
5
- let FieldSelectDataGridPageSize = FieldSelectDataGridPageSize_1 = class FieldSelectDataGridPageSize extends FieldSelect {
5
+ export let FieldSelectDataGridPageSize = FieldSelectDataGridPageSize_1 = class FieldSelectDataGridPageSize extends FieldSelect {
6
6
  get optionsTemplate() {
7
- return html `
8
- ${!this.dataGrid || !this.dataGrid.supportsDynamicPageSize ? nothing : html `
9
- <mo-option value='auto'>Auto</mo-option>
10
- `}
11
- ${FieldSelectDataGridPageSize_1.data.map(size => html `
12
- <mo-option value=${size}>${size.format()}</mo-option>
13
- `)}
7
+ return html `
8
+ ${!this.dataGrid || !this.dataGrid.supportsDynamicPageSize ? nothing : html `
9
+ <mo-option value='auto'>Auto</mo-option>
10
+ `}
11
+ ${FieldSelectDataGridPageSize_1.data.map(size => html `
12
+ <mo-option value=${size}>${size.format()}</mo-option>
13
+ `)}
14
14
  `;
15
15
  }
16
16
  };
@@ -21,4 +21,3 @@ __decorate([
21
21
  FieldSelectDataGridPageSize = FieldSelectDataGridPageSize_1 = __decorate([
22
22
  component('mo-field-select-data-grid-page-size')
23
23
  ], FieldSelectDataGridPageSize);
24
- export { FieldSelectDataGridPageSize };
@@ -9,7 +9,7 @@ import { DataGridColumn } from './DataGridColumn.js';
9
9
  * @attr trueIconColor - Color of the true icon
10
10
  * @attr falseIconColor - Color of the false icon
11
11
  */
12
- let DataGridColumnBoolean = class DataGridColumnBoolean extends DataGridColumn {
12
+ export let DataGridColumnBoolean = class DataGridColumnBoolean extends DataGridColumn {
13
13
  constructor() {
14
14
  super(...arguments);
15
15
  this.trueIcon = 'done';
@@ -19,18 +19,18 @@ let DataGridColumnBoolean = class DataGridColumnBoolean extends DataGridColumn {
19
19
  }
20
20
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
21
21
  getContentTemplate(value, _data) {
22
- return html `
23
- <mo-flex justifyContent='center' ${style({ height: '100%' })}>
24
- <mo-icon icon=${value ? this.trueIcon : this.falseIcon} ${style({ color: value ? this.trueIconColor : this.falseIconColor })}></mo-icon>
25
- </mo-flex>
22
+ return html `
23
+ <mo-flex justifyContent='center' ${style({ height: '100%' })}>
24
+ <mo-icon icon=${value ? this.trueIcon : this.falseIcon} ${style({ color: value ? this.trueIconColor : this.falseIconColor })}></mo-icon>
25
+ </mo-flex>
26
26
  `;
27
27
  }
28
28
  getEditContentTemplate(value, data) {
29
- return html `
30
- <mo-checkbox label=${this.heading} data-focus
31
- ?checked=${value}
32
- @change=${(e) => this.handleEdit(e.detail === 'checked', data)}
33
- ></mo-checkbox>
29
+ return html `
30
+ <mo-checkbox label=${this.heading} data-focus
31
+ ?checked=${value}
32
+ @change=${(e) => this.handleEdit(e.detail === 'checked', data)}
33
+ ></mo-checkbox>
34
34
  `;
35
35
  }
36
36
  };
@@ -49,4 +49,3 @@ __decorate([
49
49
  DataGridColumnBoolean = __decorate([
50
50
  component('mo-data-grid-column-boolean')
51
51
  ], DataGridColumnBoolean);
52
- export { DataGridColumnBoolean };
@@ -3,7 +3,7 @@ import { component, html, ifDefined, property, style } from '@a11d/lit';
3
3
  import { Currency } from '@3mo/localization';
4
4
  import { DataGridColumnNumberBase } from './DataGridColumnNumberBase.js';
5
5
  /** @element mo-data-grid-column-currency */
6
- let DataGridColumnCurrency = class DataGridColumnCurrency extends DataGridColumnNumberBase {
6
+ export let DataGridColumnCurrency = class DataGridColumnCurrency extends DataGridColumnNumberBase {
7
7
  constructor() {
8
8
  super(...arguments);
9
9
  this.currency = Currency.EUR;
@@ -13,17 +13,17 @@ let DataGridColumnCurrency = class DataGridColumnCurrency extends DataGridColumn
13
13
  return html `${(value !== null && value !== void 0 ? value : 0).formatAsCurrency(this.currency)}`;
14
14
  }
15
15
  getEditContentTemplate(value, data) {
16
- return html `
17
- <mo-field-currency dense data-focus
18
- label=${this.heading}
19
- value=${ifDefined(value)}
20
- @change=${(e) => this.handleEdit(e.detail, data)}
21
- ></mo-field-currency>
16
+ return html `
17
+ <mo-field-currency dense data-focus
18
+ label=${this.heading}
19
+ value=${ifDefined(value)}
20
+ @change=${(e) => this.handleEdit(e.detail, data)}
21
+ ></mo-field-currency>
22
22
  `;
23
23
  }
24
24
  getSumTemplate(sum) {
25
- return html `
26
- <span ${style({ fontWeight: '500', color: 'var(--mo-color-accent)' })}>${sum.formatAsCurrency(this.currency)}</span>
25
+ return html `
26
+ <span ${style({ fontWeight: '500', color: 'var(--mo-color-accent)' })}>${sum.formatAsCurrency(this.currency)}</span>
27
27
  `;
28
28
  }
29
29
  };
@@ -33,4 +33,3 @@ __decorate([
33
33
  DataGridColumnCurrency = __decorate([
34
34
  component('mo-data-grid-column-currency')
35
35
  ], DataGridColumnCurrency);
36
- export { DataGridColumnCurrency };
@@ -5,7 +5,7 @@ import { DataGridColumn } from './DataGridColumn.js';
5
5
  * @element mo-data-grid-column-date
6
6
  * @attr hideDatePicker - Hide the date picker
7
7
  */
8
- let DataGridColumnDate = class DataGridColumnDate extends DataGridColumn {
8
+ export let DataGridColumnDate = class DataGridColumnDate extends DataGridColumn {
9
9
  constructor() {
10
10
  super(...arguments);
11
11
  this.hideDatePicker = false;
@@ -16,13 +16,13 @@ let DataGridColumnDate = class DataGridColumnDate extends DataGridColumn {
16
16
  return html `${value ? (_a = value.formatAsDate()) !== null && _a !== void 0 ? _a : '' : ''}`;
17
17
  }
18
18
  getEditContentTemplate(value, data) {
19
- return html `
20
- <mo-field-date dense data-focus
21
- ?hideDatePicker=${this.hideDatePicker}
22
- label=${this.heading}
23
- .value=${value}
24
- @change=${(e) => this.handleEdit(e.detail, data)}
25
- ></mo-field-date>
19
+ return html `
20
+ <mo-field-date dense data-focus
21
+ ?hideDatePicker=${this.hideDatePicker}
22
+ label=${this.heading}
23
+ .value=${value}
24
+ @change=${(e) => this.handleEdit(e.detail, data)}
25
+ ></mo-field-date>
26
26
  `;
27
27
  }
28
28
  };
@@ -32,4 +32,3 @@ __decorate([
32
32
  DataGridColumnDate = __decorate([
33
33
  component('mo-data-grid-column-date')
34
34
  ], DataGridColumnDate);
35
- export { DataGridColumnDate };
@@ -0,0 +1,14 @@
1
+ import { DataGridColumn } from './DataGridColumn.js';
2
+ /**
3
+ * @element mo-data-grid-column-date-time
4
+ */
5
+ export declare class DataGridColumnDateTime<TData> extends DataGridColumn<TData, Date> {
6
+ getContentTemplate(value: Date | undefined, _data: TData): import("lit-html").TemplateResult<1>;
7
+ getEditContentTemplate: undefined;
8
+ }
9
+ declare global {
10
+ interface HTMLElementTagNameMap {
11
+ 'mo-data-grid-column-date-time': DataGridColumnDateTime<unknown>;
12
+ }
13
+ }
14
+ //# sourceMappingURL=DataGridColumnDateTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataGridColumnDateTime.d.ts","sourceRoot":"","sources":["../../columns/DataGridColumnDateTime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD;;GAEG;AACH,qBACa,sBAAsB,CAAC,KAAK,CAAE,SAAQ,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC;IAG7E,kBAAkB,CAAC,KAAK,EAAE,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK;IAIxD,sBAAsB,YAAY;CAClC;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,+BAA+B,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAA;KAChE;CACD"}
@@ -0,0 +1,20 @@
1
+ import { __decorate } from "tslib";
2
+ import { component, html } from '@a11d/lit';
3
+ import { DataGridColumn } from './DataGridColumn.js';
4
+ /**
5
+ * @element mo-data-grid-column-date-time
6
+ */
7
+ export let DataGridColumnDateTime = class DataGridColumnDateTime extends DataGridColumn {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.getEditContentTemplate = undefined;
11
+ }
12
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
13
+ getContentTemplate(value, _data) {
14
+ var _a;
15
+ return html `${value ? (_a = value.format()) !== null && _a !== void 0 ? _a : '' : ''}`;
16
+ }
17
+ };
18
+ DataGridColumnDateTime = __decorate([
19
+ component('mo-data-grid-column-date-time')
20
+ ], DataGridColumnDateTime);
@@ -13,7 +13,7 @@ Localizer.register("de" /* LanguageCode.German */, {
13
13
  *
14
14
  * @fires delete
15
15
  */
16
- let DataGridColumnDeletion = class DataGridColumnDeletion extends DataGridColumn {
16
+ export let DataGridColumnDeletion = class DataGridColumnDeletion extends DataGridColumn {
17
17
  constructor() {
18
18
  super(...arguments);
19
19
  this.prevent = false;
@@ -38,4 +38,3 @@ __decorate([
38
38
  DataGridColumnDeletion = __decorate([
39
39
  component('mo-data-grid-column-deletion')
40
40
  ], DataGridColumnDeletion);
41
- export { DataGridColumnDeletion };
@@ -2,19 +2,18 @@ import { __decorate } from "tslib";
2
2
  import { component, html, nothing } from '@a11d/lit';
3
3
  import { DataGridColumn } from './DataGridColumn.js';
4
4
  /** @element mo-data-grid-column-image */
5
- let DataGridColumnImage = class DataGridColumnImage extends DataGridColumn {
5
+ export let DataGridColumnImage = class DataGridColumnImage extends DataGridColumn {
6
6
  constructor() {
7
7
  super(...arguments);
8
8
  this.getEditContentTemplate = undefined;
9
9
  }
10
10
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
11
  getContentTemplate(value, _data) {
12
- return !value ? nothing : html `
13
- <img style='vertical-align: middle' src=${value} onload='this.hidden = false' onerror='this.hidden = true'/>
12
+ return !value ? nothing : html `
13
+ <img style='vertical-align: middle' src=${value} onload='this.hidden = false' onerror='this.hidden = true'/>
14
14
  `;
15
15
  }
16
16
  };
17
17
  DataGridColumnImage = __decorate([
18
18
  component('mo-data-grid-column-image')
19
19
  ], DataGridColumnImage);
20
- export { DataGridColumnImage };
@@ -2,18 +2,18 @@ import { __decorate } from "tslib";
2
2
  import { nothing, component, html, ifDefined, style } from '@a11d/lit';
3
3
  import { DataGridColumnNumberBase } from './DataGridColumnNumberBase.js';
4
4
  /** @element mo-data-grid-column-number */
5
- let DataGridColumnNumber = class DataGridColumnNumber extends DataGridColumnNumberBase {
5
+ export let DataGridColumnNumber = class DataGridColumnNumber extends DataGridColumnNumberBase {
6
6
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
7
  getContentTemplate(value, _data) {
8
8
  var _a;
9
9
  return html `${Number.isFinite(value) ? (_a = value === null || value === void 0 ? void 0 : value.format()) !== null && _a !== void 0 ? _a : nothing : nothing}`;
10
10
  }
11
11
  getEditContentTemplate(value, data) {
12
- return html `
13
- <mo-field-number dense label=${this.heading} data-focus
14
- value=${ifDefined(value)}
15
- @change=${(e) => this.handleEdit(e.detail, data)}
16
- ></mo-field-number>
12
+ return html `
13
+ <mo-field-number dense label=${this.heading} data-focus
14
+ value=${ifDefined(value)}
15
+ @change=${(e) => this.handleEdit(e.detail, data)}
16
+ ></mo-field-number>
17
17
  `;
18
18
  }
19
19
  getSumTemplate(sum) {
@@ -23,4 +23,3 @@ let DataGridColumnNumber = class DataGridColumnNumber extends DataGridColumnNumb
23
23
  DataGridColumnNumber = __decorate([
24
24
  component('mo-data-grid-column-number')
25
25
  ], DataGridColumnNumber);
26
- export { DataGridColumnNumber };
@@ -2,19 +2,19 @@ import { __decorate } from "tslib";
2
2
  import { component, html, ifDefined, nothing } from '@a11d/lit';
3
3
  import { DataGridColumnNumberBase } from './DataGridColumnNumberBase.js';
4
4
  /** @element mo-data-grid-column-percent */
5
- let DataGridColumnPercent = class DataGridColumnPercent extends DataGridColumnNumberBase {
5
+ export let DataGridColumnPercent = class DataGridColumnPercent extends DataGridColumnNumberBase {
6
6
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
7
  getContentTemplate(value, _data) {
8
8
  var _a;
9
9
  return html `${Number.isFinite(value) ? (_a = value === null || value === void 0 ? void 0 : value.formatAsPercent()) !== null && _a !== void 0 ? _a : nothing : nothing}`;
10
10
  }
11
11
  getEditContentTemplate(value, data) {
12
- return html `
13
- <mo-field-percent dense data-focus
14
- label=${this.heading}
15
- value=${ifDefined(value)}
16
- @change=${(e) => this.handleEdit(e.detail, data)}
17
- ></mo-field-percent>
12
+ return html `
13
+ <mo-field-percent dense data-focus
14
+ label=${this.heading}
15
+ value=${ifDefined(value)}
16
+ @change=${(e) => this.handleEdit(e.detail, data)}
17
+ ></mo-field-percent>
18
18
  `;
19
19
  }
20
20
  getSumTemplate(sum) {
@@ -24,4 +24,3 @@ let DataGridColumnPercent = class DataGridColumnPercent extends DataGridColumnNu
24
24
  DataGridColumnPercent = __decorate([
25
25
  component('mo-data-grid-column-percent')
26
26
  ], DataGridColumnPercent);
27
- export { DataGridColumnPercent };
@@ -2,21 +2,20 @@ import { __decorate } from "tslib";
2
2
  import { component, html, ifDefined } from '@a11d/lit';
3
3
  import { DataGridColumn } from './DataGridColumn.js';
4
4
  /** @element mo-data-grid-column-text */
5
- let DataGridColumnText = class DataGridColumnText extends DataGridColumn {
5
+ export let DataGridColumnText = class DataGridColumnText extends DataGridColumn {
6
6
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
7
  getContentTemplate(value, _data) {
8
8
  return html `${value !== null && value !== void 0 ? value : ''}`;
9
9
  }
10
10
  getEditContentTemplate(value, data) {
11
- return html `
12
- <mo-field-text dense label=${this.heading} data-focus
13
- value=${ifDefined(value)}
14
- @change=${(e) => this.handleEdit(e.detail, data)}
15
- ></mo-field-text>
11
+ return html `
12
+ <mo-field-text dense label=${this.heading} data-focus
13
+ value=${ifDefined(value)}
14
+ @change=${(e) => this.handleEdit(e.detail, data)}
15
+ ></mo-field-text>
16
16
  `;
17
17
  }
18
18
  };
19
19
  DataGridColumnText = __decorate([
20
20
  component('mo-data-grid-column-text')
21
21
  ], DataGridColumnText);
22
- export { DataGridColumnText };
@@ -5,35 +5,35 @@ import { component, property, Component, html, css } from '@a11d/lit';
5
5
  * @attr heading
6
6
  * @slot - Sum of values
7
7
  */
8
- let DataGridFooterSum = class DataGridFooterSum extends Component {
8
+ export let DataGridFooterSum = class DataGridFooterSum extends Component {
9
9
  constructor() {
10
10
  super(...arguments);
11
11
  this.heading = '';
12
12
  }
13
13
  static get styles() {
14
- return css `
15
- :host {
16
- display: flex;
17
- flex-direction: column;
18
- position: relative;
19
- max-height: 100%;
20
- line-height: 1em;
21
- }
22
-
23
- div {
24
- color: var(--mo-color-foreground-transparent);
25
- font-size: x-small;
26
- text-transform: uppercase;
27
- text-align: center;
28
- }
14
+ return css `
15
+ :host {
16
+ display: flex;
17
+ flex-direction: column;
18
+ position: relative;
19
+ max-height: 100%;
20
+ line-height: 1em;
21
+ }
22
+
23
+ div {
24
+ color: var(--mo-color-foreground-transparent);
25
+ font-size: x-small;
26
+ text-transform: uppercase;
27
+ text-align: center;
28
+ }
29
29
  `;
30
30
  }
31
31
  get template() {
32
- return html `
33
- <div>${this.heading}</div>
34
- <mo-flex direction='horizontal' justifyContent='center'>
35
- <slot></slot>
36
- </mo-flex>
32
+ return html `
33
+ <div>${this.heading}</div>
34
+ <mo-flex direction='horizontal' justifyContent='center'>
35
+ <slot></slot>
36
+ </mo-flex>
37
37
  `;
38
38
  }
39
39
  };
@@ -43,4 +43,3 @@ __decorate([
43
43
  DataGridFooterSum = __decorate([
44
44
  component('mo-data-grid-footer-sum')
45
45
  ], DataGridFooterSum);
46
- export { DataGridFooterSum };
@@ -4,6 +4,7 @@ export * from './DataGridColumnCurrency.js';
4
4
  export * from './DataGridColumnPercent.js';
5
5
  export * from './DataGridColumnBoolean.js';
6
6
  export * from './DataGridColumnDate.js';
7
+ export * from './DataGridColumnDateTime.js';
7
8
  export * from './DataGridColumnImage.js';
8
9
  export * from './DataGridColumnNumber.js';
9
10
  export * from './DataGridColumnText.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../columns/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../columns/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA"}
@@ -4,6 +4,7 @@ export * from './DataGridColumnCurrency.js';
4
4
  export * from './DataGridColumnPercent.js';
5
5
  export * from './DataGridColumnBoolean.js';
6
6
  export * from './DataGridColumnDate.js';
7
+ export * from './DataGridColumnDateTime.js';
7
8
  export * from './DataGridColumnImage.js';
8
9
  export * from './DataGridColumnNumber.js';
9
10
  export * from './DataGridColumnText.js';