@sme.up/ketchup 4.0.0 → 4.1.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/dist/cjs/{cell-utils-1f89a299.js → cell-utils-841a7769.js} +2 -2
- package/dist/cjs/{f-chip-2d58c8f7.js → f-chip-b9f489ff.js} +7 -5
- package/dist/cjs/{f-image-5f4f29ca.js → f-image-0c3e6aa7.js} +3 -4
- package/dist/cjs/{index-3c471303.js → index-0416afab.js} +73 -64
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
- package/dist/cjs/kup-autocomplete_29.cjs.entry.js +1014 -1103
- package/dist/cjs/kup-calendar.cjs.entry.js +8 -8
- package/dist/cjs/kup-dash-list.cjs.entry.js +6 -6
- package/dist/cjs/kup-dash_2.cjs.entry.js +106 -62
- package/dist/cjs/kup-drawer.cjs.entry.js +4 -4
- package/dist/cjs/kup-field.cjs.entry.js +3 -3
- package/dist/cjs/kup-iframe.cjs.entry.js +4 -4
- package/dist/cjs/kup-lazy.cjs.entry.js +4 -4
- package/dist/cjs/kup-magic-box.cjs.entry.js +21 -30
- package/dist/cjs/{kup-manager-59ad8bdc.js → kup-manager-828bd598.js} +599 -519
- package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -4
- package/dist/cjs/{kup-objects-59ea949c.js → kup-objects-89f38d6a.js} +7 -29
- package/dist/cjs/kup-probe.cjs.entry.js +3 -3
- package/dist/cjs/kup-qlik.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{utils-2af73538.js → utils-5192ee20.js} +1 -1
- package/dist/collection/assets/data-table.js +1 -0
- package/dist/collection/collection-manifest.json +2 -3
- package/dist/collection/components/kup-accordion/kup-accordion.js +14 -14
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.css +9 -0
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +20 -23
- package/dist/collection/components/kup-badge/kup-badge.js +12 -12
- package/dist/collection/components/kup-box/kup-box.css +30 -30
- package/dist/collection/components/kup-box/kup-box.js +181 -171
- package/dist/collection/components/kup-button/kup-button.css +8 -5
- package/dist/collection/components/kup-button/kup-button.js +26 -26
- package/dist/collection/components/kup-button-list/kup-button-list.css +8 -5
- package/dist/collection/components/kup-button-list/kup-button-list.js +18 -18
- package/dist/collection/components/kup-calendar/kup-calendar.css +8 -6
- package/dist/collection/components/kup-calendar/kup-calendar.js +30 -30
- package/dist/collection/components/kup-card/kup-card-helper.js +2 -1
- package/dist/collection/components/kup-card/kup-card.css +20 -1
- package/dist/collection/components/kup-card/kup-card.js +26 -26
- package/dist/collection/components/kup-chart/kup-chart.js +40 -40
- package/dist/collection/components/kup-checkbox/kup-checkbox.js +18 -18
- package/dist/collection/components/kup-chip/kup-chip.css +0 -1
- package/dist/collection/components/kup-chip/kup-chip.js +14 -14
- package/dist/collection/components/kup-color-picker/kup-color-picker.css +6 -9
- package/dist/collection/components/kup-color-picker/kup-color-picker.js +32 -40
- package/dist/collection/components/kup-combobox/kup-combobox.css +9 -0
- package/dist/collection/components/kup-combobox/kup-combobox.js +20 -23
- package/dist/collection/components/kup-dash-list/kup-dash-list.js +2 -2
- package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +1 -0
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +25 -46
- package/dist/collection/components/kup-data-table/kup-data-table.css +83 -87
- package/dist/collection/components/kup-data-table/kup-data-table.js +364 -531
- package/dist/collection/components/kup-date-picker/kup-date-picker.css +2373 -5
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +72 -104
- package/dist/collection/components/kup-drawer/kup-drawer.js +8 -8
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.css +13 -5
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +38 -43
- package/dist/collection/components/kup-field/kup-field.js +20 -20
- package/dist/collection/components/kup-gauge/kup-gauge.js +16 -16
- package/dist/collection/components/kup-grid/kup-grid.css +2 -1
- package/dist/collection/components/kup-grid/kup-grid.js +12 -12
- package/dist/collection/components/kup-iframe/kup-iframe.js +4 -4
- package/dist/collection/components/kup-image/kup-image.js +24 -24
- package/dist/collection/components/kup-lazy/kup-lazy.js +16 -16
- package/dist/collection/components/kup-list/kup-list-declarations.js +1 -1
- package/dist/collection/components/kup-list/kup-list.css +4 -0
- package/dist/collection/components/kup-list/kup-list.js +38 -47
- package/dist/collection/components/kup-magic-box/kup-magic-box.css +11 -6
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +27 -36
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +10 -10
- package/dist/collection/components/kup-paginator/kup-paginator.css +8 -5
- package/dist/collection/components/kup-probe/kup-probe.js +8 -8
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +20 -20
- package/dist/collection/components/kup-radio/kup-radio.js +16 -16
- package/dist/collection/components/kup-rating/kup-rating.js +14 -14
- package/dist/collection/components/kup-spinner/kup-spinner.js +22 -22
- package/dist/collection/components/kup-switch/kup-switch.js +16 -16
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +12 -12
- package/dist/collection/components/kup-text-field/kup-text-field.js +48 -48
- package/dist/collection/components/kup-time-picker/kup-time-picker.css +2376 -0
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +50 -83
- package/dist/collection/components/kup-tooltip/kup-tooltip.js +18 -12
- package/dist/collection/components/kup-tree/kup-tree.css +10 -10
- package/dist/collection/components/kup-tree/kup-tree.js +96 -66
- package/dist/collection/f-components/f-button/f-button.js +4 -2
- package/dist/collection/f-components/f-image/f-image.js +1 -2
- package/dist/collection/f-components/f-text-field/f-text-field.js +8 -6
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +11 -3
- package/dist/collection/utils/kup-debug/kup-debug.js +25 -27
- package/dist/collection/utils/kup-dynamic-position/kup-dynamic-position.js +3 -5
- package/dist/collection/utils/kup-interact/kup-interact-declarations.js +48 -0
- package/dist/collection/utils/kup-interact/kup-interact.js +362 -0
- package/dist/collection/utils/kup-manager/kup-manager.js +18 -6
- package/dist/collection/utils/kup-objects/kup-objects.js +7 -29
- package/dist/collection/utils/kup-scroll-on-hover/kup-scroll-on-hover.js +60 -62
- package/dist/collection/utils/kup-toolbar/kup-toolbar.js +16 -18
- package/dist/esm/{cell-utils-cb612463.js → cell-utils-de384721.js} +2 -2
- package/dist/esm/{f-chip-125d5dd6.js → f-chip-d585b63e.js} +7 -5
- package/dist/esm/{f-image-68b34fab.js → f-image-23548d00.js} +3 -4
- package/dist/esm/{index-bf2824a6.js → index-51694018.js} +73 -64
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +5 -5
- package/dist/esm/kup-autocomplete_29.entry.js +818 -907
- package/dist/esm/kup-calendar.entry.js +8 -8
- package/dist/esm/kup-dash-list.entry.js +6 -6
- package/dist/esm/kup-dash_2.entry.js +106 -62
- package/dist/esm/kup-drawer.entry.js +4 -4
- package/dist/esm/kup-field.entry.js +3 -3
- package/dist/esm/kup-iframe.entry.js +4 -4
- package/dist/esm/kup-lazy.entry.js +4 -4
- package/dist/esm/kup-magic-box.entry.js +21 -30
- package/dist/esm/{kup-manager-e7d7b353.js → kup-manager-583f2815.js} +595 -520
- package/dist/esm/kup-nav-bar.entry.js +4 -4
- package/dist/esm/{kup-objects-d38d2fa2.js → kup-objects-5968aefd.js} +7 -29
- package/dist/esm/kup-probe.entry.js +3 -3
- package/dist/esm/kup-qlik.entry.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-13dd007a.js → utils-a1dd14c3.js} +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-64ea7e37.entry.js → p-0e91c9c9.entry.js} +1 -1
- package/dist/ketchup/{p-0320e24e.entry.js → p-0f2b6a24.entry.js} +1 -1
- package/dist/ketchup/{p-a5424073.js → p-361d9431.js} +1 -1
- package/dist/ketchup/p-565785ce.js +1 -0
- package/dist/ketchup/{p-7896031c.entry.js → p-57eb45ac.entry.js} +1 -1
- package/dist/ketchup/{p-08c7a092.js → p-6f5d8830.js} +1 -1
- package/dist/ketchup/{p-9c858a38.entry.js → p-802d8906.entry.js} +1 -1
- package/dist/ketchup/p-850b9e67.entry.js +1 -0
- package/dist/ketchup/{p-a12a5690.entry.js → p-88a5787a.entry.js} +1 -1
- package/dist/ketchup/p-8ed2b7bf.entry.js +1 -0
- package/dist/ketchup/{p-ee89966f.entry.js → p-90a0c2b7.entry.js} +2 -2
- package/dist/ketchup/{p-876da4c2.entry.js → p-94c0dd8c.entry.js} +1 -1
- package/dist/ketchup/p-9ec3c377.entry.js +45 -0
- package/dist/ketchup/p-b30f34d8.js +1 -0
- package/dist/ketchup/p-b6a47512.entry.js +1 -0
- package/dist/ketchup/p-bfaf8a82.js +1 -0
- package/dist/ketchup/{p-940ab57a.entry.js → p-ca0ebdcc.entry.js} +1 -1
- package/dist/ketchup/p-d5a3a4ed.js +1 -0
- package/dist/ketchup/{p-c7ee1fbc.js → p-ee7b190c.js} +1 -1
- package/dist/ketchup/{p-b0724035.entry.js → p-f6b54fa1.entry.js} +1 -1
- package/dist/types/components/kup-box/kup-box-declarations.d.ts +11 -2
- package/dist/types/components/kup-box/kup-box.d.ts +8 -4
- package/dist/types/components/kup-color-picker/kup-color-picker.d.ts +0 -1
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +12 -4
- package/dist/types/components/kup-data-table/kup-data-table-helper.d.ts +0 -2
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +16 -49
- package/dist/types/components/kup-date-picker/kup-date-picker.d.ts +11 -14
- package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +0 -4
- package/dist/types/components/kup-list/kup-list-declarations.d.ts +1 -1
- package/dist/types/components/kup-list/kup-list.d.ts +2 -3
- package/dist/types/components/kup-magic-box/kup-magic-box.d.ts +1 -0
- package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +7 -11
- package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +4 -4
- package/dist/types/components/kup-tree/kup-tree.d.ts +3 -0
- package/dist/types/components.d.ts +84 -121
- package/dist/types/utils/kup-dynamic-position/kup-dynamic-position.d.ts +2 -2
- package/dist/types/utils/kup-interact/kup-interact-declarations.d.ts +127 -0
- package/dist/types/utils/kup-interact/kup-interact.d.ts +93 -0
- package/dist/types/utils/kup-manager/kup-manager-declarations.d.ts +21 -4
- package/dist/types/utils/kup-manager/kup-manager.d.ts +2 -2
- package/dist/types/utils/kup-objects/kup-objects.d.ts +1 -7
- package/package.json +3 -3
- package/dist/cjs/drag-and-drop-4787ff6f.js +0 -281
- package/dist/cjs/kup-grid.cjs.entry.js +0 -130
- package/dist/collection/assets/images/drag-multiple.js +0 -1
- package/dist/collection/components/kup-layout/kup-layout.css +0 -53
- package/dist/collection/components/kup-layout/kup-layout.js +0 -156
- package/dist/collection/utils/drag-and-drop.js +0 -109
- package/dist/collection/utils/kup-dialog/kup-dialog-declarations.js +0 -36
- package/dist/collection/utils/kup-dialog/kup-dialog.js +0 -310
- package/dist/esm/drag-and-drop-321cb4ca.js +0 -265
- package/dist/esm/kup-grid.entry.js +0 -126
- package/dist/ketchup/p-00fe1e3e.js +0 -1
- package/dist/ketchup/p-1165f4ea.entry.js +0 -1
- package/dist/ketchup/p-170d3cba.js +0 -1
- package/dist/ketchup/p-18cb3ba3.js +0 -1
- package/dist/ketchup/p-23541a97.entry.js +0 -45
- package/dist/ketchup/p-8fb9d9b2.entry.js +0 -1
- package/dist/ketchup/p-b14e77f0.js +0 -1
- package/dist/ketchup/p-d24cfdea.entry.js +0 -1
- package/dist/ketchup/p-fcd2fd8f.js +0 -1
- package/dist/ketchup/p-fce3b9d8.entry.js +0 -1
- package/dist/types/assets/images/drag-multiple.d.ts +0 -1
- package/dist/types/components/kup-layout/kup-layout.d.ts +0 -25
- package/dist/types/utils/drag-and-drop.d.ts +0 -53
- package/dist/types/utils/kup-dialog/kup-dialog-declarations.d.ts +0 -43
- package/dist/types/utils/kup-dialog/kup-dialog.d.ts +0 -50
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Component, Element, Event, forceUpdate, h, Host, Listen, Method, Prop, State, Watch, } from '@stencil/core';
|
|
2
|
-
import { kupDynamicPositionAttribute, } from '../../utils/kup-dynamic-position/kup-dynamic-position-declarations';
|
|
3
2
|
import { kupManagerInstance, } from '../../utils/kup-manager/kup-manager';
|
|
4
3
|
import { getMonthsAsStringByLocale, getDaysOfWeekAsStringByLocale, fillString, DateTimeFormatOptionsMonth, } from '../../utils/utils';
|
|
5
4
|
import { KupDatePickerProps, SourceEvent, } from './kup-date-picker-declarations';
|
|
@@ -7,6 +6,8 @@ import { FButtonStyling } from '../../f-components/f-button/f-button-declaration
|
|
|
7
6
|
import { KupDebugCategory } from '../../utils/kup-debug/kup-debug-declarations';
|
|
8
7
|
import { componentWrapperId } from '../../variables/GenericVariables';
|
|
9
8
|
import { KupDatesFormats, KupDatesNormalize, } from '../../utils/kup-dates/kup-dates-declarations';
|
|
9
|
+
import { FTextField } from '../../f-components/f-text-field/f-text-field';
|
|
10
|
+
import { FTextFieldMDC } from '../../f-components/f-text-field/f-text-field-mdc';
|
|
10
11
|
export class KupDatePicker {
|
|
11
12
|
constructor() {
|
|
12
13
|
/*-------------------------------------------------*/
|
|
@@ -52,16 +53,15 @@ export class KupDatePicker {
|
|
|
52
53
|
*/
|
|
53
54
|
this.kupManager = kupManagerInstance();
|
|
54
55
|
this.calendarView = SourceEvent.DATE;
|
|
55
|
-
this.textfieldEl =
|
|
56
|
-
this.pickerContainerEl =
|
|
56
|
+
this.textfieldEl = null;
|
|
57
|
+
this.pickerContainerEl = null;
|
|
57
58
|
this.pickerEl = {
|
|
58
59
|
value: new Date().toISOString(),
|
|
59
60
|
date: new Date(),
|
|
60
61
|
};
|
|
61
62
|
this.pickerOpened = false;
|
|
62
63
|
}
|
|
63
|
-
onKupDatePickerItemClick(
|
|
64
|
-
e.stopPropagation();
|
|
64
|
+
onKupDatePickerItemClick(value) {
|
|
65
65
|
this.setPickerValueSelected(value);
|
|
66
66
|
this.kupChange.emit({
|
|
67
67
|
comp: this,
|
|
@@ -74,8 +74,7 @@ export class KupDatePicker {
|
|
|
74
74
|
value: this.value,
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
onKupClearIconClick(
|
|
78
|
-
e.stopPropagation();
|
|
77
|
+
onKupClearIconClick() {
|
|
79
78
|
this.setPickerValueSelected('');
|
|
80
79
|
this.kupChange.emit({
|
|
81
80
|
comp: this,
|
|
@@ -87,8 +86,7 @@ export class KupDatePicker {
|
|
|
87
86
|
id: this.rootElement.id,
|
|
88
87
|
});
|
|
89
88
|
}
|
|
90
|
-
onKupDatePickerMonthYearItemClick(
|
|
91
|
-
e.stopPropagation();
|
|
89
|
+
onKupDatePickerMonthYearItemClick(value) {
|
|
92
90
|
switch (this.calendarView) {
|
|
93
91
|
case SourceEvent.MONTH: {
|
|
94
92
|
this.calendarView = SourceEvent.DATE;
|
|
@@ -102,7 +100,6 @@ export class KupDatePicker {
|
|
|
102
100
|
this.refreshPickerComponentValue(value);
|
|
103
101
|
}
|
|
104
102
|
onKupBlur() {
|
|
105
|
-
this.closePicker();
|
|
106
103
|
this.kupBlur.emit({
|
|
107
104
|
id: this.rootElement.id,
|
|
108
105
|
value: this.value,
|
|
@@ -110,19 +107,16 @@ export class KupDatePicker {
|
|
|
110
107
|
});
|
|
111
108
|
}
|
|
112
109
|
onKupChange(e) {
|
|
113
|
-
e.
|
|
114
|
-
this.refreshPickerValue(e.detail.value, this.kupChange);
|
|
110
|
+
this.refreshPickerValue(e.target.value, this.kupChange);
|
|
115
111
|
}
|
|
116
|
-
onKupClick(
|
|
117
|
-
e.stopPropagation();
|
|
112
|
+
onKupClick() {
|
|
118
113
|
this.kupClick.emit({
|
|
119
114
|
comp: this,
|
|
120
115
|
id: this.rootElement.id,
|
|
121
116
|
value: this.value,
|
|
122
117
|
});
|
|
123
118
|
}
|
|
124
|
-
onKupFocus(
|
|
125
|
-
e.stopPropagation();
|
|
119
|
+
onKupFocus() {
|
|
126
120
|
this.kupFocus.emit({
|
|
127
121
|
comp: this,
|
|
128
122
|
id: this.rootElement.id,
|
|
@@ -130,15 +124,14 @@ export class KupDatePicker {
|
|
|
130
124
|
});
|
|
131
125
|
}
|
|
132
126
|
onKupInput(e) {
|
|
133
|
-
e.
|
|
134
|
-
this.refreshPickerValue(e.detail.value, this.kupInput, true);
|
|
127
|
+
this.refreshPickerValue(e.target.value, this.kupInput, true);
|
|
135
128
|
}
|
|
136
129
|
onkupTextFieldSubmit(e) {
|
|
137
|
-
e.
|
|
138
|
-
|
|
130
|
+
if (e.key === 'Enter') {
|
|
131
|
+
this.refreshPickerValue(e.target.value, this.kupTextFieldSubmit);
|
|
132
|
+
}
|
|
139
133
|
}
|
|
140
|
-
onKupIconClick(
|
|
141
|
-
e.stopPropagation();
|
|
134
|
+
onKupIconClick() {
|
|
142
135
|
if (this.isPickerOpened()) {
|
|
143
136
|
this.closePicker();
|
|
144
137
|
}
|
|
@@ -160,7 +153,6 @@ export class KupDatePicker {
|
|
|
160
153
|
this.closePicker();
|
|
161
154
|
}
|
|
162
155
|
if (e.key === 'Enter') {
|
|
163
|
-
e.stopPropagation();
|
|
164
156
|
this.setPickerValueSelected();
|
|
165
157
|
}
|
|
166
158
|
}
|
|
@@ -216,7 +208,7 @@ export class KupDatePicker {
|
|
|
216
208
|
*/
|
|
217
209
|
async setFocus() {
|
|
218
210
|
if (this.textfieldEl != null) {
|
|
219
|
-
this.textfieldEl.
|
|
211
|
+
this.textfieldEl.focus();
|
|
220
212
|
}
|
|
221
213
|
}
|
|
222
214
|
/**
|
|
@@ -225,14 +217,12 @@ export class KupDatePicker {
|
|
|
225
217
|
*/
|
|
226
218
|
async setValue(value) {
|
|
227
219
|
this.value = value;
|
|
228
|
-
this.setTextFieldInitalValue(this.getDateForOutput());
|
|
229
220
|
}
|
|
230
221
|
/*-------------------------------------------------*/
|
|
231
222
|
/* P r i v a t e M e t h o d s */
|
|
232
223
|
/*-------------------------------------------------*/
|
|
233
224
|
refreshPickerValue(eventDetailValue, eventToRaise, isOnInputEvent) {
|
|
234
225
|
let newValue = eventDetailValue;
|
|
235
|
-
let dayJs = this.kupManager.dates.normalize(eventDetailValue, KupDatesNormalize.DATE);
|
|
236
226
|
if (this.kupManager.dates.isValid(eventDetailValue)) {
|
|
237
227
|
newValue = this.kupManager.dates.format(this.kupManager.dates.normalize(eventDetailValue, KupDatesNormalize.DATE), KupDatesFormats.ISO_DATE);
|
|
238
228
|
this.refreshPickerComponentValue(newValue);
|
|
@@ -280,11 +270,6 @@ export class KupDatePicker {
|
|
|
280
270
|
getPickerValueSelected() {
|
|
281
271
|
return this.pickerEl.value;
|
|
282
272
|
}
|
|
283
|
-
setTextFieldInitalValue(value) {
|
|
284
|
-
if (this.textfieldEl !== undefined) {
|
|
285
|
-
this.textfieldEl.setValue(value);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
273
|
getValueForPickerComponent() {
|
|
289
274
|
return this.value;
|
|
290
275
|
}
|
|
@@ -294,22 +279,22 @@ export class KupDatePicker {
|
|
|
294
279
|
let containerEl = this.pickerContainerEl;
|
|
295
280
|
this.pickerOpened = true;
|
|
296
281
|
this.refreshPickerComponentValue(this.getValueForPickerComponent());
|
|
297
|
-
let textFieldWidth = null;
|
|
298
282
|
if (textfieldEl != null) {
|
|
299
|
-
textFieldWidth =
|
|
300
|
-
textfieldEl.shadowRoot.querySelector('.mdc-text-field').clientWidth;
|
|
301
283
|
textfieldEl.classList.add('toggled');
|
|
302
|
-
textfieldEl.emitSubmitEventOnEnter = false;
|
|
303
284
|
}
|
|
304
285
|
if (containerEl != null) {
|
|
305
|
-
this.kupManager.dynamicPosition.start(containerEl);
|
|
306
286
|
containerEl.classList.add('visible');
|
|
307
|
-
|
|
287
|
+
const elStyle = containerEl.style;
|
|
308
288
|
elStyle.height = 'auto';
|
|
309
|
-
|
|
310
|
-
elStyle.minWidth = textFieldWidth + 'px';
|
|
311
|
-
}
|
|
289
|
+
elStyle.minWidth = textfieldEl.clientWidth + 'px';
|
|
312
290
|
}
|
|
291
|
+
this.kupManager.utilities.pointerDownCallbacks.add({
|
|
292
|
+
cb: () => {
|
|
293
|
+
this.closePicker();
|
|
294
|
+
},
|
|
295
|
+
onlyOnce: true,
|
|
296
|
+
el: this.pickerContainerEl,
|
|
297
|
+
});
|
|
313
298
|
}
|
|
314
299
|
closePicker() {
|
|
315
300
|
if (!this.isPickerOpened()) {
|
|
@@ -320,10 +305,8 @@ export class KupDatePicker {
|
|
|
320
305
|
this.pickerOpened = false;
|
|
321
306
|
if (textfieldEl != null) {
|
|
322
307
|
textfieldEl.classList.remove('toggled');
|
|
323
|
-
textfieldEl.emitSubmitEventOnEnter = true;
|
|
324
308
|
}
|
|
325
309
|
if (containerEl != null) {
|
|
326
|
-
this.kupManager.dynamicPosition.stop(containerEl);
|
|
327
310
|
containerEl.classList.remove('visible');
|
|
328
311
|
}
|
|
329
312
|
}
|
|
@@ -333,19 +316,15 @@ export class KupDatePicker {
|
|
|
333
316
|
getTextFieldId() {
|
|
334
317
|
return this.textfieldEl.id;
|
|
335
318
|
}
|
|
336
|
-
prepDateTextfield() {
|
|
337
|
-
return this.prepTextfield(this.getDateForOutput());
|
|
338
|
-
}
|
|
339
319
|
prepTextfield(initialValue) {
|
|
340
|
-
|
|
341
|
-
if (!textfieldData
|
|
342
|
-
textfieldData
|
|
320
|
+
const textfieldData = Object.assign({}, this.data['kup-text-field']);
|
|
321
|
+
if (!textfieldData.icon) {
|
|
322
|
+
textfieldData.icon = 'calendar';
|
|
343
323
|
}
|
|
344
|
-
if (textfieldData
|
|
345
|
-
textfieldData
|
|
324
|
+
if (textfieldData.icon) {
|
|
325
|
+
textfieldData.trailingIcon = true;
|
|
346
326
|
}
|
|
347
|
-
|
|
348
|
-
return comp;
|
|
327
|
+
return (h(FTextField, Object.assign({}, textfieldData, { disabled: this.disabled, id: this.rootElement.id + '_text-field', value: initialValue, onBlur: () => this.onKupBlur(), onChange: (e) => this.onKupChange(e), onClearIconClick: () => this.onKupClearIconClick(), onClick: () => this.onKupClick(), onFocus: () => this.onKupFocus(), onIconClick: () => this.onKupIconClick(), onKeyDown: (e) => this.onkupTextFieldSubmit(e), onInput: (e) => this.onKupInput(e) }), this.prepDatePicker()));
|
|
349
328
|
}
|
|
350
329
|
getInitEndYear(curYear) {
|
|
351
330
|
let initYear = curYear - (curYear % 10);
|
|
@@ -392,17 +371,13 @@ export class KupDatePicker {
|
|
|
392
371
|
}
|
|
393
372
|
let prevButtonComp = null;
|
|
394
373
|
let nextButtonComp = null;
|
|
395
|
-
prevButtonComp = (h("kup-button", { id: "prev-page", icon: "chevron_left", "onkup-button-click": (
|
|
396
|
-
nextButtonComp = (h("kup-button", { id: "next-page", icon: "chevron_right", "onkup-button-click": (
|
|
397
|
-
return (h("div", {
|
|
398
|
-
if (!this.isRelatedTargetInThisComponent(e)) {
|
|
399
|
-
this.onKupBlur();
|
|
400
|
-
}
|
|
401
|
-
} },
|
|
374
|
+
prevButtonComp = (h("kup-button", { id: "prev-page", icon: "chevron_left", "onkup-button-click": () => this.prevPage() }));
|
|
375
|
+
nextButtonComp = (h("kup-button", { id: "next-page", icon: "chevron_right", "onkup-button-click": () => this.nextPage() }));
|
|
376
|
+
return (h("div", { id: "date-picker-div", ref: (el) => (this.pickerContainerEl = el) },
|
|
402
377
|
h("div", { class: "section-1" },
|
|
403
378
|
h("div", { class: "sub-1 nav" },
|
|
404
379
|
prevButtonComp,
|
|
405
|
-
h("kup-button", { customStyle: "#kup-component button {text-transform:capitalize}", id: "change-view-button", styling: FButtonStyling.FLAT, label: changeViewButtonLabel, "onkup-button-click": (
|
|
380
|
+
h("kup-button", { customStyle: "#kup-component button {text-transform:capitalize}", id: "change-view-button", styling: FButtonStyling.FLAT, label: changeViewButtonLabel, "onkup-button-click": () => this.changeView() }),
|
|
406
381
|
nextButtonComp)),
|
|
407
382
|
h("div", { class: "section-2" }, this.createCalendar())));
|
|
408
383
|
}
|
|
@@ -464,8 +439,8 @@ export class KupDatePicker {
|
|
|
464
439
|
dayClass += ' selected';
|
|
465
440
|
}
|
|
466
441
|
row.push(h("td", { class: dayClass },
|
|
467
|
-
h("span", Object.assign({}, dataIndex, { class: "item-number", onClick: (
|
|
468
|
-
this.onKupDatePickerItemClick(
|
|
442
|
+
h("span", Object.assign({}, dataIndex, { class: "item-number", onClick: () => {
|
|
443
|
+
this.onKupDatePickerItemClick(dataIndex['data-index']);
|
|
469
444
|
} }), dayCount)));
|
|
470
445
|
dayCount++;
|
|
471
446
|
if (dayCount > lastMonthDay.getDate()) {
|
|
@@ -510,8 +485,8 @@ export class KupDatePicker {
|
|
|
510
485
|
monthClass += ' selected';
|
|
511
486
|
}
|
|
512
487
|
row.push(h("td", { class: monthClass },
|
|
513
|
-
h("span", Object.assign({}, dataIndex, { class: "item-number", onClick: (
|
|
514
|
-
this.onKupDatePickerMonthYearItemClick(
|
|
488
|
+
h("span", Object.assign({}, dataIndex, { class: "item-number", onClick: () => {
|
|
489
|
+
this.onKupDatePickerMonthYearItemClick(dataIndex['data-index']);
|
|
515
490
|
} }), months[monthCount])));
|
|
516
491
|
monthCount++;
|
|
517
492
|
}
|
|
@@ -553,8 +528,8 @@ export class KupDatePicker {
|
|
|
553
528
|
yearClass += ' selected';
|
|
554
529
|
}
|
|
555
530
|
row.push(h("td", { class: yearClass },
|
|
556
|
-
h("span", Object.assign({}, dataIndex, { class: "item-number", onClick: (
|
|
557
|
-
this.onKupDatePickerMonthYearItemClick(
|
|
531
|
+
h("span", Object.assign({}, dataIndex, { class: "item-number", onClick: () => {
|
|
532
|
+
this.onKupDatePickerMonthYearItemClick(dataIndex['data-index']);
|
|
558
533
|
} }), yearCount)));
|
|
559
534
|
yearCount++;
|
|
560
535
|
}
|
|
@@ -566,8 +541,7 @@ export class KupDatePicker {
|
|
|
566
541
|
return (h("table", { id: "calendar" },
|
|
567
542
|
h("tbody", null, tbody)));
|
|
568
543
|
}
|
|
569
|
-
changeView(
|
|
570
|
-
e.stopPropagation();
|
|
544
|
+
changeView() {
|
|
571
545
|
switch (this.calendarView) {
|
|
572
546
|
case SourceEvent.DATE: {
|
|
573
547
|
this.calendarView = SourceEvent.MONTH;
|
|
@@ -583,8 +557,7 @@ export class KupDatePicker {
|
|
|
583
557
|
}
|
|
584
558
|
this.refresh();
|
|
585
559
|
}
|
|
586
|
-
prevPage(
|
|
587
|
-
e.stopPropagation();
|
|
560
|
+
prevPage() {
|
|
588
561
|
let date = this.pickerEl.date;
|
|
589
562
|
let yy = date.getFullYear();
|
|
590
563
|
let mm = date.getMonth();
|
|
@@ -610,8 +583,7 @@ export class KupDatePicker {
|
|
|
610
583
|
this.pickerEl.date = date;
|
|
611
584
|
this.refresh();
|
|
612
585
|
}
|
|
613
|
-
nextPage(
|
|
614
|
-
e.stopPropagation();
|
|
586
|
+
nextPage() {
|
|
615
587
|
let date = this.pickerEl.date;
|
|
616
588
|
let yy = date.getFullYear();
|
|
617
589
|
let mm = date.getMonth();
|
|
@@ -644,11 +616,6 @@ export class KupDatePicker {
|
|
|
644
616
|
let v1 = this.kupManager.dates.format(this.value);
|
|
645
617
|
return v1;
|
|
646
618
|
}
|
|
647
|
-
recalcPosition() {
|
|
648
|
-
if (this.pickerContainerEl != null && this.textfieldEl != null) {
|
|
649
|
-
this.kupManager.dynamicPosition.register(this.pickerContainerEl, this.textfieldEl);
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
619
|
/*-------------------------------------------------*/
|
|
653
620
|
/* L i f e c y c l e H o o k s */
|
|
654
621
|
/*-------------------------------------------------*/
|
|
@@ -670,11 +637,18 @@ export class KupDatePicker {
|
|
|
670
637
|
this.kupManager.debug.logRender(this, false);
|
|
671
638
|
}
|
|
672
639
|
componentDidRender() {
|
|
673
|
-
this.
|
|
640
|
+
const root = this.rootElement.shadowRoot;
|
|
641
|
+
if (root) {
|
|
642
|
+
const f = root.querySelector('.f-text-field--wrapper');
|
|
643
|
+
if (f) {
|
|
644
|
+
this.textfieldEl = f.querySelector('input');
|
|
645
|
+
FTextFieldMDC(f);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
674
648
|
this.kupManager.debug.logRender(this, true);
|
|
675
649
|
}
|
|
676
650
|
render() {
|
|
677
|
-
|
|
651
|
+
const hostClass = {};
|
|
678
652
|
if (this.data &&
|
|
679
653
|
this.data['kup-text-field'] &&
|
|
680
654
|
this.data['kup-text-field']['className'] &&
|
|
@@ -687,18 +661,12 @@ export class KupDatePicker {
|
|
|
687
661
|
hostClass['kup-full-width'] = true;
|
|
688
662
|
}
|
|
689
663
|
const customStyle = this.kupManager.theme.setCustomStyle(this.rootElement);
|
|
690
|
-
return (h(Host, { class: hostClass
|
|
664
|
+
return (h(Host, { class: hostClass },
|
|
691
665
|
customStyle ? h("style", null, customStyle) : null,
|
|
692
|
-
h("div", { id: componentWrapperId },
|
|
693
|
-
this.prepDateTextfield(),
|
|
694
|
-
this.prepDatePicker())));
|
|
666
|
+
h("div", { id: componentWrapperId }, this.prepTextfield(this.getDateForOutput()))));
|
|
695
667
|
}
|
|
696
668
|
disconnectedCallback() {
|
|
697
669
|
this.kupManager.theme.unregister(this);
|
|
698
|
-
const dynamicPositionElements = this.rootElement.shadowRoot.querySelectorAll('[' + kupDynamicPositionAttribute + ']');
|
|
699
|
-
if (dynamicPositionElements.length > 0) {
|
|
700
|
-
this.kupManager.dynamicPosition.unregister(Array.prototype.slice.call(dynamicPositionElements));
|
|
701
|
-
}
|
|
702
670
|
}
|
|
703
671
|
static get is() { return "kup-date-picker"; }
|
|
704
672
|
static get encapsulation() { return "shadow"; }
|
|
@@ -721,11 +689,11 @@ export class KupDatePicker {
|
|
|
721
689
|
"optional": false,
|
|
722
690
|
"docs": {
|
|
723
691
|
"tags": [{
|
|
724
|
-
"
|
|
725
|
-
"
|
|
692
|
+
"name": "default",
|
|
693
|
+
"text": "\"\""
|
|
726
694
|
}, {
|
|
727
|
-
"
|
|
728
|
-
"
|
|
695
|
+
"name": "see",
|
|
696
|
+
"text": "https://ketchup.smeup.com/ketchup-showcase/#/customization"
|
|
729
697
|
}],
|
|
730
698
|
"text": "Custom style of the component."
|
|
731
699
|
},
|
|
@@ -749,8 +717,8 @@ export class KupDatePicker {
|
|
|
749
717
|
"optional": false,
|
|
750
718
|
"docs": {
|
|
751
719
|
"tags": [{
|
|
752
|
-
"
|
|
753
|
-
"
|
|
720
|
+
"name": "default",
|
|
721
|
+
"text": "null"
|
|
754
722
|
}],
|
|
755
723
|
"text": "Props of the sub-components."
|
|
756
724
|
},
|
|
@@ -768,8 +736,8 @@ export class KupDatePicker {
|
|
|
768
736
|
"optional": false,
|
|
769
737
|
"docs": {
|
|
770
738
|
"tags": [{
|
|
771
|
-
"
|
|
772
|
-
"
|
|
739
|
+
"name": "default",
|
|
740
|
+
"text": "false"
|
|
773
741
|
}],
|
|
774
742
|
"text": "Defaults at false. When set to true, the component is disabled."
|
|
775
743
|
},
|
|
@@ -789,8 +757,8 @@ export class KupDatePicker {
|
|
|
789
757
|
"optional": false,
|
|
790
758
|
"docs": {
|
|
791
759
|
"tags": [{
|
|
792
|
-
"
|
|
793
|
-
"
|
|
760
|
+
"name": "default",
|
|
761
|
+
"text": "1"
|
|
794
762
|
}],
|
|
795
763
|
"text": "First day number (0 - sunday, 1 - monday, ...)\nTODO: manage with kupDates.locale, remove prop"
|
|
796
764
|
},
|
|
@@ -810,8 +778,8 @@ export class KupDatePicker {
|
|
|
810
778
|
"optional": false,
|
|
811
779
|
"docs": {
|
|
812
780
|
"tags": [{
|
|
813
|
-
"
|
|
814
|
-
"
|
|
781
|
+
"name": "default",
|
|
782
|
+
"text": "\"\""
|
|
815
783
|
}],
|
|
816
784
|
"text": "Sets the initial value of the component"
|
|
817
785
|
},
|
|
@@ -1030,8 +998,8 @@ export class KupDatePicker {
|
|
|
1030
998
|
"signature": "(descriptions?: boolean) => Promise<GenericObject>",
|
|
1031
999
|
"parameters": [{
|
|
1032
1000
|
"tags": [{
|
|
1033
|
-
"
|
|
1034
|
-
"
|
|
1001
|
+
"name": "param",
|
|
1002
|
+
"text": "descriptions - When provided and true, the result will be the list of props with their description."
|
|
1035
1003
|
}],
|
|
1036
1004
|
"text": "- When provided and true, the result will be the list of props with their description."
|
|
1037
1005
|
}],
|
|
@@ -1094,8 +1062,8 @@ export class KupDatePicker {
|
|
|
1094
1062
|
"signature": "(value: string) => Promise<void>",
|
|
1095
1063
|
"parameters": [{
|
|
1096
1064
|
"tags": [{
|
|
1097
|
-
"
|
|
1098
|
-
"
|
|
1065
|
+
"name": "param",
|
|
1066
|
+
"text": "value - Value to be set."
|
|
1099
1067
|
}],
|
|
1100
1068
|
"text": "- Value to be set."
|
|
1101
1069
|
}],
|
|
@@ -1123,7 +1091,7 @@ export class KupDatePicker {
|
|
|
1123
1091
|
static get listeners() { return [{
|
|
1124
1092
|
"name": "keyup",
|
|
1125
1093
|
"method": "listenKeyup",
|
|
1126
|
-
"target":
|
|
1094
|
+
"target": undefined,
|
|
1127
1095
|
"capture": false,
|
|
1128
1096
|
"passive": false
|
|
1129
1097
|
}]; }
|
|
@@ -154,11 +154,11 @@ export class KupDrawer {
|
|
|
154
154
|
"optional": false,
|
|
155
155
|
"docs": {
|
|
156
156
|
"tags": [{
|
|
157
|
-
"
|
|
158
|
-
"
|
|
157
|
+
"name": "default",
|
|
158
|
+
"text": "\"\""
|
|
159
159
|
}, {
|
|
160
|
-
"
|
|
161
|
-
"
|
|
160
|
+
"name": "see",
|
|
161
|
+
"text": "https://ketchup.smeup.com/ketchup-showcase/#/customization"
|
|
162
162
|
}],
|
|
163
163
|
"text": "Custom style of the component."
|
|
164
164
|
},
|
|
@@ -253,8 +253,8 @@ export class KupDrawer {
|
|
|
253
253
|
"signature": "(descriptions?: boolean) => Promise<GenericObject>",
|
|
254
254
|
"parameters": [{
|
|
255
255
|
"tags": [{
|
|
256
|
-
"
|
|
257
|
-
"
|
|
256
|
+
"name": "param",
|
|
257
|
+
"text": "descriptions - When provided and true, the result will be the list of props with their description."
|
|
258
258
|
}],
|
|
259
259
|
"text": "- When provided and true, the result will be the list of props with their description."
|
|
260
260
|
}],
|
|
@@ -336,8 +336,8 @@ export class KupDrawer {
|
|
|
336
336
|
"signature": "(props: GenericObject) => Promise<void>",
|
|
337
337
|
"parameters": [{
|
|
338
338
|
"tags": [{
|
|
339
|
-
"
|
|
340
|
-
"
|
|
339
|
+
"name": "param",
|
|
340
|
+
"text": "props - Object containing props that will be set to the component."
|
|
341
341
|
}],
|
|
342
342
|
"text": "- Object containing props that will be set to the component."
|
|
343
343
|
}],
|
|
@@ -153,16 +153,19 @@
|
|
|
153
153
|
width: 4em;
|
|
154
154
|
}
|
|
155
155
|
.f-button--wrapper .button.button--floating:hover, .f-button--wrapper .button.button--floating:focus {
|
|
156
|
-
box-shadow: 0
|
|
156
|
+
box-shadow: 0 5px 5px -3px rgba(var(--kup-text-color-rgb), 0.2), 0 8px 10px 1px rgba(var(--kup-text-color-rgb), 0.14), 0 3px 14px 2px rgba(var(--kup-text-color-rgb), 0.12);
|
|
157
157
|
}
|
|
158
158
|
.f-button--wrapper .button.button--floating:active {
|
|
159
|
-
box-shadow: 0
|
|
159
|
+
box-shadow: 0 7px 8px -4px rgba(var(--kup-text-color-rgb), 0.2), 0 12px 17px 2px rgba(var(--kup-text-color-rgb), 0.14), 0 5px 22px 4px rgba(var(--kup-text-color-rgb), 0.12);
|
|
160
160
|
}
|
|
161
161
|
.f-button--wrapper .button.button--raised {
|
|
162
|
-
box-shadow:
|
|
162
|
+
box-shadow: 0 3px 1px -2px rgba(var(--kup-text-color-rgb), 0.2), 0 2px 2px 0 rgba(var(--kup-text-color-rgb), 0.14), 0 1px 5px 0 rgba(var(--kup-text-color-rgb), 0.12);
|
|
163
163
|
}
|
|
164
|
-
.f-button--wrapper .button.button--raised:hover {
|
|
165
|
-
box-shadow: 0
|
|
164
|
+
.f-button--wrapper .button.button--raised:focus, .f-button--wrapper .button.button--raised:hover {
|
|
165
|
+
box-shadow: 0 2px 4px -1px rgba(var(--kup-text-color-rgb), 0.2), 0 4px 5px 0 rgba(var(--kup-text-color-rgb), 0.14), 0 1px 10px 0 rgba(var(--kup-text-color-rgb), 0.12);
|
|
166
|
+
}
|
|
167
|
+
.f-button--wrapper .button.button--raised:active {
|
|
168
|
+
box-shadow: 0 5px 5px -3px rgba(var(--kup-text-color-rgb), 0.2), 0 8px 10px 1px rgba(var(--kup-text-color-rgb), 0.14), 0 3px 14px 2px rgba(var(--kup-text-color-rgb), 0.12);
|
|
166
169
|
}
|
|
167
170
|
.f-button--wrapper .button.button--outlined {
|
|
168
171
|
border-width: 1px;
|
|
@@ -374,6 +377,11 @@
|
|
|
374
377
|
transform: rotate(180deg);
|
|
375
378
|
}
|
|
376
379
|
|
|
380
|
+
kup-list {
|
|
381
|
+
position: absolute;
|
|
382
|
+
z-index: 1;
|
|
383
|
+
}
|
|
384
|
+
|
|
377
385
|
/*-------------------------------------------------*/
|
|
378
386
|
/* C o m p o n e n t C l a s s e s */
|
|
379
387
|
/*-------------------------------------------------*/
|