@siemens/ix 1.0.0 → 1.1.0-beta.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.
Files changed (159) hide show
  1. package/README.md +4 -0
  2. package/dist/cjs/ix-blind.cjs.entry.js +1 -1
  3. package/dist/cjs/ix-breadcrumb_2.cjs.entry.js +1 -1
  4. package/dist/cjs/ix-button.cjs.entry.js +1 -1
  5. package/dist/cjs/ix-category-filter.cjs.entry.js +1 -1
  6. package/dist/cjs/ix-chip.cjs.entry.js +1 -1
  7. package/dist/cjs/ix-date-picker_2.cjs.entry.js +214 -56
  8. package/dist/cjs/ix-date-time-card.cjs.entry.js +1 -1
  9. package/dist/cjs/ix-datetime-picker.cjs.entry.js +79 -10
  10. package/dist/cjs/ix-dropdown_2.cjs.entry.js +1 -1
  11. package/dist/cjs/ix-event-list_2.cjs.entry.js +3 -3
  12. package/dist/cjs/ix-expanding-search.cjs.entry.js +2 -1
  13. package/dist/cjs/ix-filter-chip.cjs.entry.js +1 -1
  14. package/dist/cjs/ix-map-navigation_2.cjs.entry.js +0 -25
  15. package/dist/cjs/ix-menu_9.cjs.entry.js +32 -16
  16. package/dist/cjs/ix-select_2.cjs.entry.js +1 -1
  17. package/dist/cjs/ix-tile.cjs.entry.js +1 -1
  18. package/dist/cjs/ix-toast_2.cjs.entry.js +4 -0
  19. package/dist/cjs/ix-tree_2.cjs.entry.js +1 -1
  20. package/dist/cjs/ix-validation-tooltip.cjs.entry.js +1 -1
  21. package/dist/cjs/{ix-workflow-step.cjs.entry.js → ix-workflow-step_2.cjs.entry.js} +77 -0
  22. package/dist/cjs/loader.cjs.js +1 -1
  23. package/dist/cjs/siemens-ix.cjs.js +1 -1
  24. package/dist/collection/collection-manifest.json +6 -0
  25. package/dist/collection/components/blind/blind.css +1 -1
  26. package/dist/collection/components/breadcrumb/breadcrumb.css +1 -1
  27. package/dist/collection/components/button/button.css +3 -0
  28. package/dist/collection/components/button/button.js +1 -1
  29. package/dist/collection/components/category-filter/category-filter.css +2 -3
  30. package/dist/collection/components/chip/chip.css +8 -8
  31. package/dist/collection/components/date-picker/date-picker.css +51 -49
  32. package/dist/collection/components/date-picker/date-picker.js +371 -57
  33. package/dist/collection/components/date-picker/events.js +1 -0
  34. package/dist/collection/components/date-time-card/date-time-card.css +3 -1
  35. package/dist/collection/components/datetime-picker/datetime-picker.css +12 -3
  36. package/dist/collection/components/datetime-picker/datetime-picker.js +361 -21
  37. package/dist/collection/components/datetime-picker/event.js +9 -0
  38. package/dist/collection/components/dropdown/dropdown.css +1 -1
  39. package/dist/collection/components/event-list/event-list.css +2 -2
  40. package/dist/collection/components/event-list-item/event-list-item.css +36 -19
  41. package/dist/collection/components/event-list-item/event-list-item.js +2 -2
  42. package/dist/collection/components/expanding-search/expanding-search.css +6 -3
  43. package/dist/collection/components/expanding-search/expanding-search.js +1 -0
  44. package/dist/collection/components/filter-chip/filter-chip.css +2 -2
  45. package/dist/collection/components/map-navigation/map-navigation.js +1 -28
  46. package/dist/collection/components/menu/menu.js +36 -17
  47. package/dist/collection/components/menu-about/menu-about.js +13 -34
  48. package/dist/collection/components/menu-item/menu-item.css +2 -2
  49. package/dist/collection/components/menu-settings/menu-settings.js +1 -1
  50. package/dist/collection/components/select/select.css +1 -1
  51. package/dist/collection/components/tile/tile.css +1 -1
  52. package/dist/collection/components/time-picker/time-picker.js +188 -31
  53. package/dist/collection/components/toast/toast.js +6 -1
  54. package/dist/collection/components/tree-item/tree-item.css +9 -3
  55. package/dist/collection/components/validation-tooltip/validation-tooltip.css +2 -1
  56. package/dist/collection/exports.js +2 -0
  57. package/dist/components/button.js +2 -2
  58. package/dist/components/date-picker.js +162 -45
  59. package/dist/components/date-time-card.js +1 -1
  60. package/dist/components/dropdown.js +1 -1
  61. package/dist/components/filter-chip.js +1 -1
  62. package/dist/components/ix-blind.js +1 -1
  63. package/dist/components/ix-breadcrumb.js +1 -1
  64. package/dist/components/ix-category-filter.js +1 -1
  65. package/dist/components/ix-chip.js +1 -1
  66. package/dist/components/ix-datetime-picker.js +90 -11
  67. package/dist/components/ix-event-list-item.js +2 -2
  68. package/dist/components/ix-event-list.js +1 -1
  69. package/dist/components/ix-expanding-search.js +2 -1
  70. package/dist/components/ix-map-navigation.js +6 -51
  71. package/dist/components/ix-menu-about.js +115 -1
  72. package/dist/components/ix-menu.js +20 -2
  73. package/dist/components/ix-select.js +1 -1
  74. package/dist/components/ix-tile.js +1 -1
  75. package/dist/components/ix-validation-tooltip.js +1 -1
  76. package/dist/components/menu-item.js +1 -1
  77. package/dist/components/time-picker.js +70 -17
  78. package/dist/components/toast.js +4 -0
  79. package/dist/components/tree-item.js +1 -1
  80. package/dist/esm/ix-blind.entry.js +1 -1
  81. package/dist/esm/ix-breadcrumb_2.entry.js +1 -1
  82. package/dist/esm/ix-button.entry.js +1 -1
  83. package/dist/esm/ix-category-filter.entry.js +1 -1
  84. package/dist/esm/ix-chip.entry.js +1 -1
  85. package/dist/esm/ix-date-picker_2.entry.js +214 -56
  86. package/dist/esm/ix-date-time-card.entry.js +1 -1
  87. package/dist/esm/ix-datetime-picker.entry.js +79 -10
  88. package/dist/esm/ix-dropdown_2.entry.js +1 -1
  89. package/dist/esm/ix-event-list_2.entry.js +3 -3
  90. package/dist/esm/ix-expanding-search.entry.js +2 -1
  91. package/dist/esm/ix-filter-chip.entry.js +1 -1
  92. package/dist/esm/ix-map-navigation_2.entry.js +0 -25
  93. package/dist/esm/ix-menu_9.entry.js +32 -16
  94. package/dist/esm/ix-select_2.entry.js +1 -1
  95. package/dist/esm/ix-tile.entry.js +1 -1
  96. package/dist/esm/ix-toast_2.entry.js +4 -0
  97. package/dist/esm/ix-tree_2.entry.js +1 -1
  98. package/dist/esm/ix-validation-tooltip.entry.js +1 -1
  99. package/dist/esm/{ix-workflow-step.entry.js → ix-workflow-step_2.entry.js} +78 -2
  100. package/dist/esm/loader.js +1 -1
  101. package/dist/esm/siemens-ix.js +1 -1
  102. package/dist/siemens-ix/p-02501b64.entry.js +1 -0
  103. package/dist/siemens-ix/{p-03d95feb.entry.js → p-1d56d9b6.entry.js} +1 -1
  104. package/dist/siemens-ix/p-2b7ed5d4.entry.js +1 -0
  105. package/dist/siemens-ix/p-334b7d5c.entry.js +1 -0
  106. package/dist/siemens-ix/{p-cde8f20e.entry.js → p-4287bd7e.entry.js} +1 -1
  107. package/dist/siemens-ix/{p-7ec8a00e.entry.js → p-52d99490.entry.js} +1 -1
  108. package/dist/siemens-ix/{p-2cda7278.entry.js → p-5fed62f8.entry.js} +1 -1
  109. package/dist/siemens-ix/p-71de6498.entry.js +1 -0
  110. package/dist/siemens-ix/p-77823732.entry.js +1 -0
  111. package/dist/siemens-ix/{p-2ce29bcd.entry.js → p-94b86dec.entry.js} +1 -1
  112. package/dist/siemens-ix/{p-40842bea.entry.js → p-a49005f3.entry.js} +1 -1
  113. package/dist/siemens-ix/{p-e1f54836.entry.js → p-a8396077.entry.js} +1 -1
  114. package/dist/siemens-ix/{p-504927a0.entry.js → p-b93c2fab.entry.js} +1 -1
  115. package/dist/siemens-ix/p-bf5513a0.entry.js +1 -0
  116. package/dist/siemens-ix/p-c0c9fb81.entry.js +1 -0
  117. package/dist/siemens-ix/p-c792adb4.entry.js +1 -0
  118. package/dist/siemens-ix/{p-7a4c744e.entry.js → p-c9a5d942.entry.js} +1 -1
  119. package/dist/siemens-ix/p-cb6e62ff.entry.js +1 -0
  120. package/dist/siemens-ix/p-cbd0f8a7.entry.js +1 -0
  121. package/dist/siemens-ix/p-fa44655a.entry.js +1 -0
  122. package/dist/siemens-ix/siemens-ix.css +13 -13
  123. package/dist/siemens-ix/siemens-ix.esm.js +1 -1
  124. package/dist/types/components/date-picker/date-picker.d.ts +93 -13
  125. package/dist/types/components/date-picker/events.d.ts +5 -0
  126. package/dist/types/components/datetime-picker/datetime-picker.d.ts +106 -9
  127. package/dist/types/components/datetime-picker/event.d.ts +5 -0
  128. package/dist/types/components/map-navigation/map-navigation.d.ts +0 -8
  129. package/dist/types/components/menu/menu.d.ts +2 -0
  130. package/dist/types/components/menu-about/menu-about.d.ts +1 -4
  131. package/dist/types/components/time-picker/time-picker.d.ts +42 -8
  132. package/dist/types/components.d.ts +274 -38
  133. package/dist/types/exports.d.ts +2 -0
  134. package/package.json +10 -1
  135. package/scss/components/_buttons.scss +15 -5
  136. package/scss/components/_checkboxes.scss +26 -14
  137. package/scss/components/_dropdown.scss +1 -1
  138. package/scss/components/_forms.scss +2 -1
  139. package/scss/components/_radiobuttons.scss +26 -14
  140. package/scss/mixins/_hover.scss +0 -1
  141. package/src/components/date-picker/readme.md +31 -10
  142. package/src/components/datetime-picker/readme.md +23 -10
  143. package/src/components/menu-about/readme.md +5 -6
  144. package/src/components/time-picker/readme.md +25 -8
  145. package/dist/cjs/ix-workflow-steps.cjs.entry.js +0 -83
  146. package/dist/components/menu-about.js +0 -120
  147. package/dist/esm/ix-workflow-steps.entry.js +0 -79
  148. package/dist/siemens-ix/p-1e111d1d.entry.js +0 -1
  149. package/dist/siemens-ix/p-240d22b6.entry.js +0 -1
  150. package/dist/siemens-ix/p-3613be96.entry.js +0 -1
  151. package/dist/siemens-ix/p-5990f0cb.entry.js +0 -1
  152. package/dist/siemens-ix/p-59c81e2a.entry.js +0 -1
  153. package/dist/siemens-ix/p-61b032bf.entry.js +0 -1
  154. package/dist/siemens-ix/p-662d756f.entry.js +0 -1
  155. package/dist/siemens-ix/p-9d9b8ad1.entry.js +0 -1
  156. package/dist/siemens-ix/p-ca71538c.entry.js +0 -1
  157. package/dist/siemens-ix/p-caf856f2.entry.js +0 -1
  158. package/dist/siemens-ix/p-d31bf6db.entry.js +0 -1
  159. package/dist/siemens-ix/p-fe020fa3.entry.js +0 -1
@@ -22,18 +22,6 @@ export class MapNavigation {
22
22
  get menuOverlay() {
23
23
  return this.hostElement.querySelector('ix-menu-overlay');
24
24
  }
25
- get about() {
26
- return this.hostElement.querySelector('ix-menu-about');
27
- }
28
- get aboutItems() {
29
- return this.hostElement.querySelector('ix-menu-about-item');
30
- }
31
- get settings() {
32
- return this.hostElement.querySelector('ix-menu-settings');
33
- }
34
- get settingsItems() {
35
- return this.hostElement.querySelector('ix-menu-settings-item');
36
- }
37
25
  get mapNavMenu() {
38
26
  return this.hostElement.querySelector('.map-nav-menu');
39
27
  }
@@ -45,8 +33,6 @@ export class MapNavigation {
45
33
  }
46
34
  componentDidRender() {
47
35
  this.appendMenu();
48
- this.appendAbout();
49
- this.appendSettings();
50
36
  // this.openOverlay('Test', document.createElement('ix-breadcrumb'), 'info', 'color-warning');
51
37
  this.closeOverlay();
52
38
  }
@@ -59,17 +45,6 @@ export class MapNavigation {
59
45
  });
60
46
  this.menu.enableMapExpand = true;
61
47
  }
62
- appendAbout() {
63
- const about = this.about || document.createElement('ix-menu-about');
64
- about.append(this.aboutItems);
65
- this.menu.appendChild(about);
66
- }
67
- appendSettings() {
68
- if (this.menu.enableSettings && this.settings) {
69
- this.menu.appendChild(this.settings);
70
- this.settings.append(this.settingsItems);
71
- }
72
- }
73
48
  toggleSidebar(show) {
74
49
  if (show !== undefined) {
75
50
  this.isSidebarOpen = show;
@@ -241,9 +216,7 @@ export class MapNavigation {
241
216
  }
242
217
  }; }
243
218
  static get states() { return {
244
- "isSidebarOpen": {},
245
- "isAboutOpen": {},
246
- "isSettingsOpen": {}
219
+ "isSidebarOpen": {}
247
220
  }; }
248
221
  static get events() { return [{
249
222
  "method": "navigationToggled",
@@ -158,6 +158,9 @@ export class Menu {
158
158
  get avatarItem() {
159
159
  return this.hostElement.querySelector('ix-menu-avatar');
160
160
  }
161
+ get tabsContainer() {
162
+ return this.hostElement.querySelector('#menu-tabs');
163
+ }
161
164
  showTab(index) {
162
165
  return index + 1 <= this.visibleMenuItems;
163
166
  }
@@ -480,6 +483,15 @@ export class Menu {
480
483
  getCollapseIcon() {
481
484
  return this.mapExpand ? 'double-chevron-left' : 'double-chevron-right';
482
485
  }
486
+ isMenuItemClicked(event) {
487
+ const path = event.composedPath();
488
+ const menuItems = path
489
+ .filter((element) => element.id !== 'more-tab')
490
+ .filter((element) => {
491
+ return element.tagName === 'IX-MENU-ITEM';
492
+ });
493
+ return menuItems.some((menu) => this.tabsContainer.contains(menu));
494
+ }
483
495
  render() {
484
496
  return (h(Host, { class: {
485
497
  expanded: this.expand,
@@ -499,24 +511,31 @@ export class Menu {
499
511
  h("rect", { class: "line line-2", x: "5", y: "15.5", width: "22", height: "2" }),
500
512
  h("rect", { class: "line line-3", x: "5", y: "21.5", width: "22", height: "2" }))),
501
513
  h("div", { id: "avatar-tab-placeholder" }),
502
- h("div", { class: "tabs-top" }),
503
- h("slot", null),
504
- h("div", { class: "active-more-tab" }, this.activeTab ? (h("ix-menu-item", { class: "internal-tab", active: true, tabIcon: this.activeTab.tabIcon }, this.activeTab.innerText)) : null),
505
- h("ix-menu-item", { id: "more-tab", tabIcon: "more-menu", class: {
506
- 'internal-tab': true,
507
- }, style: {
508
- display: this.showMoreButton() ? 'block' : 'none',
509
- }, title: "Show more", notifications: this.countMoreNotifications, onClick: () => this.toggleShowMoreDropdown() },
510
- this.i18nMore,
511
- h("ix-dropdown", { show: this.showMoreItems }, this.menuItems
512
- .filter((elm, index) => !this.showTab(index) &&
513
- !this.isMenuItemActive(elm) &&
514
- this.isVisible(elm))
515
- .map((e) => {
516
- return (h("ix-menu-item", { tabIcon: e.tabIcon, active: e.active, class: "internal-tab appended", onClick: () => e.dispatchEvent(new CustomEvent('click')) }, e.innerText));
517
- }))),
514
+ h("div", { id: "menu-tabs", style: {
515
+ display: 'contents',
516
+ }, onClick: (event) => {
517
+ if (this.isMenuItemClicked(event)) {
518
+ this.resetOverlay();
519
+ }
520
+ } },
521
+ h("div", { class: "tabs-top" }),
522
+ h("slot", null),
523
+ h("div", { class: "active-more-tab" }, this.activeTab ? (h("ix-menu-item", { class: "internal-tab", active: true, tabIcon: this.activeTab.tabIcon }, this.activeTab.innerText)) : null),
524
+ h("ix-menu-item", { id: "more-tab", tabIcon: "more-menu", class: {
525
+ 'internal-tab': true,
526
+ }, style: {
527
+ display: this.showMoreButton() ? 'block' : 'none',
528
+ }, title: "Show more", notifications: this.countMoreNotifications, onClick: () => this.toggleShowMoreDropdown() },
529
+ this.i18nMore,
530
+ h("ix-dropdown", { show: this.showMoreItems }, this.menuItems
531
+ .filter((elm, index) => !this.showTab(index) &&
532
+ !this.isMenuItemActive(elm) &&
533
+ this.isVisible(elm))
534
+ .map((e) => {
535
+ return (h("ix-menu-item", { tabIcon: e.tabIcon, active: e.active, class: "internal-tab appended", onClick: () => e.dispatchEvent(new CustomEvent('click')) }, e.innerText));
536
+ })))),
518
537
  h("div", { class: "bottom-tab-divider" }),
519
- this.enableSettings && !this.isSettingsEmpty ? (h("ix-menu-item", { class: {
538
+ this.enableSettings && !this.isSettingsEmpty ? (h("ix-menu-item", { id: "settings", class: {
520
539
  'internal-tab': true,
521
540
  'bottom-tab': true,
522
541
  active: this.showSettings,
@@ -6,17 +6,9 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- import { Component, Element, Event, forceUpdate, h, Host, Prop, State, Watch } from '@stencil/core';
9
+ import { Component, Element, Event, forceUpdate, h, Host, Prop, State, Watch, } from '@stencil/core';
10
10
  export class MenuAbout {
11
11
  constructor() {
12
- /**
13
- *
14
- */
15
- this.i18nImprintLabel = 'Imprint';
16
- /**
17
- * Active tab
18
- */
19
- this.activeTabLabel = this.i18nImprintLabel;
20
12
  /**
21
13
  * Label of first tab
22
14
  */
@@ -40,12 +32,11 @@ export class MenuAbout {
40
32
  });
41
33
  }
42
34
  componentWillLoad() {
43
- var _a;
44
- this.setTab(this.activeTabLabel || ((_a = this.aboutItems[0]) === null || _a === void 0 ? void 0 : _a.label));
35
+ if (this.aboutItems.length) {
36
+ this.setTab(this.activeTabLabel || this.aboutItems[0].label);
37
+ }
45
38
  }
46
39
  componentDidLoad() {
47
- var _a;
48
- this.setTab(this.activeTabLabel || ((_a = this.aboutItems[0]) === null || _a === void 0 ? void 0 : _a.label));
49
40
  forceUpdate(this.el);
50
41
  }
51
42
  componentWillRender() {
@@ -62,6 +53,13 @@ export class MenuAbout {
62
53
  const selectedItem = this.aboutItems.find((item) => item.label === label);
63
54
  return this.aboutItems.indexOf(selectedItem);
64
55
  }
56
+ getTabItems() {
57
+ return this.aboutItems.map(({ label }) => {
58
+ return (h("ix-tab-item", { class: {
59
+ active: label === this.activeTabLabel,
60
+ }, onClick: () => this.setTab(label) }, label));
61
+ });
62
+ }
65
63
  render() {
66
64
  return (h(Host, { class: {
67
65
  animate__animated: true,
@@ -71,7 +69,7 @@ export class MenuAbout {
71
69
  h("div", { class: "about-header" },
72
70
  h("h2", { class: "text-h2" }, this.label),
73
71
  h("ix-icon-button", { ghost: true, size: "24", icon: "close", onClick: (e) => this.close.emit(e) })),
74
- h("ix-tabs", { selected: this.getSelectedTabIndex(this.activeTabLabel), class: "about-tabs" }, this.labels.map((label) => (h("ix-tab-item", { onClick: () => this.setTab(label) }, label)))),
72
+ h("ix-tabs", { selected: this.getSelectedTabIndex(this.activeTabLabel), class: "about-tabs" }, this.getTabItems()),
75
73
  h("div", { class: "about-items" },
76
74
  h("slot", null))));
77
75
  }
@@ -84,24 +82,6 @@ export class MenuAbout {
84
82
  "$": ["menu-about.css"]
85
83
  }; }
86
84
  static get properties() { return {
87
- "i18nImprintLabel": {
88
- "type": "string",
89
- "mutable": false,
90
- "complexType": {
91
- "original": "string",
92
- "resolved": "string",
93
- "references": {}
94
- },
95
- "required": false,
96
- "optional": false,
97
- "docs": {
98
- "tags": [],
99
- "text": ""
100
- },
101
- "attribute": "i-1-8n-imprint-label",
102
- "reflect": true,
103
- "defaultValue": "'Imprint'"
104
- },
105
85
  "activeTabLabel": {
106
86
  "type": "string",
107
87
  "mutable": true,
@@ -117,8 +97,7 @@ export class MenuAbout {
117
97
  "text": "Active tab"
118
98
  },
119
99
  "attribute": "active-tab-label",
120
- "reflect": true,
121
- "defaultValue": "this.i18nImprintLabel"
100
+ "reflect": false
122
101
  },
123
102
  "label": {
124
103
  "type": "string",
@@ -59,10 +59,10 @@ ix-menu-item i.glyph {
59
59
  color: var(--theme-nav-item-primary-icon--color);
60
60
  position: relative;
61
61
  }
62
- ix-menu-item .tab:focus {
62
+ ix-menu-item .tab:focus-visible {
63
63
  outline: none;
64
64
  }
65
- ix-menu-item:focus {
65
+ ix-menu-item:focus-visible {
66
66
  outline: none;
67
67
  }
68
68
  ix-menu-item .tab:not(:last-child) {
@@ -6,7 +6,7 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- import { Component, Element, Event, forceUpdate, h, Host, Prop, Watch } from '@stencil/core';
9
+ import { Component, Element, Event, forceUpdate, h, Host, Prop, Watch, } from '@stencil/core';
10
10
  export class MenuAbout {
11
11
  constructor() {
12
12
  /**
@@ -117,7 +117,7 @@
117
117
  -webkit-margin-end: 2rem;
118
118
  margin-inline-end: 2rem;
119
119
  }
120
- :host .input-container input, :host .input-container input:hover, :host .input-container input:focus {
120
+ :host .input-container input, :host .input-container input:hover, :host .input-container input:focus-visible {
121
121
  border: none;
122
122
  outline: none;
123
123
  }
@@ -53,7 +53,7 @@
53
53
  min-height: 10rem;
54
54
  max-height: 10rem;
55
55
  }
56
- :host:active, :host:focus, :host:visited {
56
+ :host:active, :host:focus-visible, :host:visited {
57
57
  outline: none;
58
58
  }
59
59
  :host .tile-header {
@@ -6,35 +6,68 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- import { Component, Element, Event, h, Host, Prop, State } from '@stencil/core';
9
+ import { Component, Element, Event, h, Host, Method, Prop, State, } from '@stencil/core';
10
10
  import { DateTime } from 'luxon';
11
11
  export class TimePicker {
12
12
  constructor() {
13
13
  /**
14
- * Set corners style
14
+ * Format of time string
15
+ *
16
+ * @since 1.1.0
17
+ */
18
+ this.format = 'TT';
19
+ /**
20
+ * Corner style
15
21
  */
16
22
  this.corners = 'rounded';
17
23
  /**
18
- * set styles
24
+ * @deprecated - will get removed with next major release
19
25
  */
20
26
  this.individual = true;
21
27
  /**
22
- * Show Hour Input
28
+ * Show hour input
23
29
  */
24
30
  this.showHour = false;
25
31
  /**
26
- * Show Minutes Input
32
+ * Show minutes input
27
33
  */
28
34
  this.showMinutes = false;
29
35
  /**
30
- * Show Seconds Input
36
+ * Show seconds input
31
37
  */
32
38
  this.showSeconds = false;
33
39
  /**
34
- * Show Time Reference Input
40
+ * Select time with format string
41
+ *
42
+ * @since 1.1.0
43
+ */
44
+ this.time = DateTime.now().toFormat(this.format);
45
+ /**
46
+ * Show time reference input
47
+ *
48
+ * @since 1.1.0 time reference is default aligned with formt tt
49
+ */
50
+ this.showTimeReference = undefined;
51
+ /**
52
+ * Set time reference
35
53
  */
36
- this.showTimeReference = false;
37
- this.time = DateTime.fromFormat('00:00:00 AM', 'tt');
54
+ this.timeReference = DateTime.fromFormat(this.time, this.format).toFormat('a');
55
+ /**
56
+ * Text of date select button
57
+ *
58
+ * @since 1.1.0
59
+ */
60
+ this.textSelectTime = 'Done';
61
+ this._time = DateTime.fromFormat(this.time, this.format);
62
+ }
63
+ get hour() {
64
+ return this._time.hour;
65
+ }
66
+ get minutes() {
67
+ return this._time.minute;
68
+ }
69
+ get seconds() {
70
+ return this._time.second;
38
71
  }
39
72
  updateInput(step, { hours = undefined, minutes = undefined, seconds = undefined }) {
40
73
  if (hours)
@@ -47,25 +80,40 @@ export class TimePicker {
47
80
  step === 'up'
48
81
  ? this.secondInputRef.stepUp()
49
82
  : this.secondInputRef.stepDown();
50
- this.time = this.time.set({
83
+ this._time = this._time.set({
51
84
  hour: Number(this.hourInputRef.value),
52
85
  minute: Number(this.minuteInputRef.value),
53
86
  second: Number(this.secondInputRef.value),
54
87
  });
55
- this.setHourAccordingToReference();
56
- this.timeChange.emit(this.time.toFormat('TT'));
88
+ this.emitTimeChange();
57
89
  }
58
90
  changeReference() {
59
91
  this.referenceInputRef.value =
60
92
  this.referenceInputRef.value === 'PM' ? 'AM' : 'PM';
61
93
  this.setHourAccordingToReference();
62
- this.timeChange.emit(this.time.toFormat('TT'));
94
+ this.emitTimeChange();
63
95
  }
64
96
  setHourAccordingToReference() {
65
97
  let hour = Number(this.hourInputRef.value);
66
98
  if (this.referenceInputRef.value === 'PM')
67
99
  hour += 12;
68
- this.time = this.time.set({ hour });
100
+ this._time = this._time.set({ hour });
101
+ }
102
+ emitTimeChange() {
103
+ const time = this._time.toFormat(this.format);
104
+ this.timeChange.emit(time);
105
+ }
106
+ componentWillLoad() {
107
+ if (this.showTimeReference === undefined) {
108
+ const matchedKeys = Object.keys(DateTime.fromFormatExplain(this.time, this.format).matches);
109
+ this.showTimeReference = matchedKeys.includes('a');
110
+ }
111
+ }
112
+ /**
113
+ * Get current time
114
+ */
115
+ async getCurrentTime() {
116
+ return this._time;
69
117
  }
70
118
  render() {
71
119
  let hideHour = !this.showHour;
@@ -87,17 +135,17 @@ export class TimePicker {
87
135
  h("div", { class: "clock" },
88
136
  h("div", { class: { columns: true, hidden: hideHour } },
89
137
  h("ix-icon-button", { size: "16", onClick: () => this.updateInput('up', { hours: true }), ghost: true, icon: "chevron-up", variant: "Primary", class: "arrows" }),
90
- h("input", { name: "hours", type: "number", placeholder: "00", min: "0", disabled: true, max: this.showTimeReference === true ? 11 : 23, ref: (ref) => (this.hourInputRef = ref) }),
138
+ h("input", { name: "hours", type: "number", placeholder: "00", value: this.hour, min: "0", disabled: true, max: this.showTimeReference === true ? 11 : 23, ref: (ref) => (this.hourInputRef = ref) }),
91
139
  h("ix-icon-button", { size: "16", onClick: () => this.updateInput('down', { hours: true }), ghost: true, icon: "chevron-down", variant: "Primary", class: "arrows" })),
92
140
  h("div", { class: { 'column-seperator': true, hidden: hideHourSeperator } }, ":"),
93
141
  h("div", { class: { columns: true, hidden: hideMinutes } },
94
142
  h("ix-icon-button", { size: "16", onClick: () => this.updateInput('up', { minutes: true }), ghost: true, icon: "chevron-up", variant: "Primary", class: "arrows" }),
95
- h("input", { name: "minutes", type: "number", placeholder: "00", min: "0", max: "59", disabled: true, ref: (ref) => (this.minuteInputRef = ref) }),
143
+ h("input", { name: "minutes", type: "number", placeholder: "00", value: this.minutes, min: "0", max: "59", disabled: true, ref: (ref) => (this.minuteInputRef = ref) }),
96
144
  h("ix-icon-button", { size: "16", onClick: () => this.updateInput('down', { minutes: true }), ghost: true, icon: "chevron-down", variant: "Primary", class: "arrows" })),
97
145
  h("div", { class: { 'column-seperator': true, hidden: hideMinutesSeperator } }, ":"),
98
146
  h("div", { class: { columns: true, hidden: hideSeconds } },
99
147
  h("ix-icon-button", { size: "16", onClick: () => this.updateInput('up', { seconds: true }), ghost: true, icon: "chevron-up", variant: "Primary", class: "arrows" }),
100
- h("input", { name: "seconds", type: "number", placeholder: "00", disabled: true, min: "0", max: "59", ref: (ref) => (this.secondInputRef = ref) }),
148
+ h("input", { name: "seconds", type: "number", placeholder: "00", value: this.seconds, disabled: true, min: "0", max: "59", ref: (ref) => (this.secondInputRef = ref) }),
101
149
  h("ix-icon-button", { size: "16", onClick: () => this.updateInput('down', { seconds: true }), ghost: true, icon: "chevron-down", variant: "Primary", class: "arrows" })),
102
150
  h("div", { class: {
103
151
  columns: true,
@@ -105,10 +153,10 @@ export class TimePicker {
105
153
  hidden: hideTimeReference,
106
154
  } },
107
155
  h("ix-icon-button", { size: "16", onClick: () => this.changeReference(), ghost: true, icon: "chevron-up", variant: "Primary", class: "arrows" }),
108
- h("input", { name: "reference", type: "text", ref: (ref) => (this.referenceInputRef = ref), value: "AM", disabled: true, class: "text-align" }),
156
+ h("input", { name: "reference", type: "text", ref: (ref) => (this.referenceInputRef = ref), value: this.timeReference, disabled: true, class: "text-align" }),
109
157
  h("ix-icon-button", { size: "16", onClick: () => this.changeReference(), ghost: true, icon: "chevron-down", variant: "Primary", class: "arrows" }))),
110
158
  h("div", { class: { button: true, hidden: hideIndividual } },
111
- h("ix-button", { onClick: () => this.done.emit(this.time.toFormat('TT')) }, "Done")))));
159
+ h("ix-button", { onClick: () => this.done.emit(this._time.toFormat(this.format)) }, this.textSelectTime)))));
112
160
  }
113
161
  static get is() { return "ix-time-picker"; }
114
162
  static get encapsulation() { return "scoped"; }
@@ -119,6 +167,27 @@ export class TimePicker {
119
167
  "$": ["time-picker.css"]
120
168
  }; }
121
169
  static get properties() { return {
170
+ "format": {
171
+ "type": "string",
172
+ "mutable": false,
173
+ "complexType": {
174
+ "original": "string",
175
+ "resolved": "string",
176
+ "references": {}
177
+ },
178
+ "required": false,
179
+ "optional": false,
180
+ "docs": {
181
+ "tags": [{
182
+ "name": "since",
183
+ "text": "1.1.0"
184
+ }],
185
+ "text": "Format of time string"
186
+ },
187
+ "attribute": "format",
188
+ "reflect": false,
189
+ "defaultValue": "'TT'"
190
+ },
122
191
  "corners": {
123
192
  "type": "string",
124
193
  "mutable": false,
@@ -136,7 +205,7 @@ export class TimePicker {
136
205
  "optional": false,
137
206
  "docs": {
138
207
  "tags": [],
139
- "text": "Set corners style"
208
+ "text": "Corner style"
140
209
  },
141
210
  "attribute": "corners",
142
211
  "reflect": false,
@@ -153,8 +222,11 @@ export class TimePicker {
153
222
  "required": false,
154
223
  "optional": false,
155
224
  "docs": {
156
- "tags": [],
157
- "text": "set styles"
225
+ "tags": [{
226
+ "name": "deprecated",
227
+ "text": "- will get removed with next major release"
228
+ }],
229
+ "text": ""
158
230
  },
159
231
  "attribute": "individual",
160
232
  "reflect": false,
@@ -172,7 +244,7 @@ export class TimePicker {
172
244
  "optional": false,
173
245
  "docs": {
174
246
  "tags": [],
175
- "text": "Show Hour Input"
247
+ "text": "Show hour input"
176
248
  },
177
249
  "attribute": "show-hour",
178
250
  "reflect": false,
@@ -190,7 +262,7 @@ export class TimePicker {
190
262
  "optional": false,
191
263
  "docs": {
192
264
  "tags": [],
193
- "text": "Show Minutes Input"
265
+ "text": "Show minutes input"
194
266
  },
195
267
  "attribute": "show-minutes",
196
268
  "reflect": false,
@@ -208,29 +280,92 @@ export class TimePicker {
208
280
  "optional": false,
209
281
  "docs": {
210
282
  "tags": [],
211
- "text": "Show Seconds Input"
283
+ "text": "Show seconds input"
212
284
  },
213
285
  "attribute": "show-seconds",
214
286
  "reflect": false,
215
287
  "defaultValue": "false"
216
288
  },
289
+ "time": {
290
+ "type": "string",
291
+ "mutable": false,
292
+ "complexType": {
293
+ "original": "string",
294
+ "resolved": "string",
295
+ "references": {}
296
+ },
297
+ "required": false,
298
+ "optional": false,
299
+ "docs": {
300
+ "tags": [{
301
+ "name": "since",
302
+ "text": "1.1.0"
303
+ }],
304
+ "text": "Select time with format string"
305
+ },
306
+ "attribute": "time",
307
+ "reflect": false,
308
+ "defaultValue": "DateTime.now().toFormat(this.format)"
309
+ },
217
310
  "showTimeReference": {
218
- "type": "boolean",
311
+ "type": "any",
312
+ "mutable": true,
313
+ "complexType": {
314
+ "original": "any",
315
+ "resolved": "any",
316
+ "references": {}
317
+ },
318
+ "required": false,
319
+ "optional": false,
320
+ "docs": {
321
+ "tags": [{
322
+ "name": "since",
323
+ "text": "1.1.0 time reference is default aligned with formt tt"
324
+ }],
325
+ "text": "Show time reference input"
326
+ },
327
+ "attribute": "show-time-reference",
328
+ "reflect": false,
329
+ "defaultValue": "undefined"
330
+ },
331
+ "timeReference": {
332
+ "type": "string",
219
333
  "mutable": false,
220
334
  "complexType": {
221
- "original": "boolean",
222
- "resolved": "boolean",
335
+ "original": "'AM' | 'PM'",
336
+ "resolved": "\"AM\" | \"PM\"",
223
337
  "references": {}
224
338
  },
225
339
  "required": false,
226
340
  "optional": false,
227
341
  "docs": {
228
342
  "tags": [],
229
- "text": "Show Time Reference Input"
343
+ "text": "Set time reference"
230
344
  },
231
- "attribute": "show-time-reference",
345
+ "attribute": "time-reference",
232
346
  "reflect": false,
233
- "defaultValue": "false"
347
+ "defaultValue": "DateTime.fromFormat(\n this.time,\n this.format\n ).toFormat('a') as 'PM' | 'AM'"
348
+ },
349
+ "textSelectTime": {
350
+ "type": "string",
351
+ "mutable": false,
352
+ "complexType": {
353
+ "original": "string",
354
+ "resolved": "string",
355
+ "references": {}
356
+ },
357
+ "required": false,
358
+ "optional": false,
359
+ "docs": {
360
+ "tags": [{
361
+ "name": "since",
362
+ "text": "1.1.0"
363
+ }],
364
+ "text": "Text of date select button"
365
+ },
366
+ "attribute": "text-select-time",
367
+ "reflect": false,
368
+ "defaultValue": "'Done'"
234
369
  }
235
370
  }; }
236
371
  static get states() { return {
@@ -270,5 +405,27 @@ export class TimePicker {
270
405
  "references": {}
271
406
  }
272
407
  }]; }
408
+ static get methods() { return {
409
+ "getCurrentTime": {
410
+ "complexType": {
411
+ "signature": "() => Promise<DateTime>",
412
+ "parameters": [],
413
+ "references": {
414
+ "Promise": {
415
+ "location": "global"
416
+ },
417
+ "DateTime": {
418
+ "location": "import",
419
+ "path": "luxon"
420
+ }
421
+ },
422
+ "return": "Promise<DateTime>"
423
+ },
424
+ "docs": {
425
+ "text": "Get current time",
426
+ "tags": []
427
+ }
428
+ }
429
+ }; }
273
430
  static get elementRef() { return "hostElement"; }
274
431
  }
@@ -9,6 +9,10 @@
9
9
  import { Component, Element, Event, h, Host, Prop, State } from '@stencil/core';
10
10
  export class Toast {
11
11
  constructor() {
12
+ /**
13
+ * Toast type
14
+ */
15
+ this.type = 'info';
12
16
  /**
13
17
  * Autoclose title after delay
14
18
  */
@@ -117,7 +121,8 @@ export class Toast {
117
121
  "text": "Toast type"
118
122
  },
119
123
  "attribute": "type",
120
- "reflect": false
124
+ "reflect": false,
125
+ "defaultValue": "'info'"
121
126
  },
122
127
  "toastTitle": {
123
128
  "type": "string",
@@ -50,13 +50,19 @@
50
50
  cursor: pointer;
51
51
  }
52
52
  :host:not(.disabled):not(:disabled):not(.selected).hover, :host:not(.disabled):not(:disabled):not(.selected):hover {
53
- background-color: var(--theme-ghost-hover);
53
+ background-color: var(--theme-tree-item--background--hover);
54
54
  }
55
55
  :host:not(.disabled):not(:disabled):not(.selected).active, :host:not(.disabled):not(:disabled):not(.selected):active {
56
- background-color: var(--theme-ghost-pressed);
56
+ background-color: var(--theme-tree-item--background--active);
57
57
  }
58
58
  :host.selected {
59
- background-color: var(--theme-ghost-selected);
59
+ background-color: var(--theme-tree-item--background--selected);
60
+ }
61
+ :host.selected.hover, :host.selected:hover {
62
+ background-color: var(--theme-tree-item--background--selected-hover);
63
+ }
64
+ :host.selected.active, :host.selected:active {
65
+ background-color: var(--theme-tree-item--background--selected-active);
60
66
  }
61
67
  :host .tree-node-container {
62
68
  display: flex;