@aquera/nile-elements 0.0.29 → 0.0.31

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 (190) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +1 -0
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +1 -0
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button/nile-button.css.js +2 -2
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button/nile-button.css.js.map +1 -1
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.js +12 -0
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -1
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js +1 -3
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  10. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.css.js +1 -0
  11. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.css.js.map +1 -1
  12. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-dialog/nile-dialog.js +0 -6
  13. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-dialog/nile-dialog.js.map +1 -1
  14. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.css.js +5 -0
  15. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
  16. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js +5 -2
  17. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  18. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.d.ts +4 -0
  19. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.js +16 -2
  20. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
  21. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.css.js +4 -0
  22. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.css.js.map +1 -1
  23. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js +4 -4
  24. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js.map +1 -1
  25. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.d.ts +1 -0
  26. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +9 -0
  27. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
  28. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +43 -6
  29. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
  30. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +30 -17
  31. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +143 -110
  32. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  33. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.css.js +1 -0
  34. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.css.js.map +1 -1
  35. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.js +1 -0
  36. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.js.map +1 -1
  37. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.css.js +4 -1
  38. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
  39. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js +5 -0
  40. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  41. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/index.d.ts +1 -0
  42. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/index.js +2 -0
  43. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/index.js.map +1 -0
  44. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.css.d.ts +12 -0
  45. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.css.js +174 -0
  46. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.css.js.map +1 -0
  47. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.d.ts +88 -0
  48. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.js +350 -0
  49. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.js.map +1 -0
  50. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  51. package/dist/index.cjs.js +1 -1
  52. package/dist/index.esm.js +1 -1
  53. package/dist/index.iife.js +651 -325
  54. package/dist/nile-button/nile-button.css.cjs.js +1 -1
  55. package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
  56. package/dist/nile-button/nile-button.css.esm.js +2 -2
  57. package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js +1 -1
  58. package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js.map +1 -1
  59. package/dist/nile-button-toggle/nile-button-toggle.css.esm.js +12 -0
  60. package/dist/nile-calendar/index.cjs.js +1 -1
  61. package/dist/nile-calendar/index.esm.js +1 -1
  62. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  63. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  64. package/dist/nile-calendar/nile-calendar.esm.js +4 -6
  65. package/dist/nile-calendar/timezones.cjs.js +1 -1
  66. package/dist/nile-calendar/timezones.cjs.js.map +1 -1
  67. package/dist/nile-calendar/timezones.esm.js +1 -1
  68. package/dist/nile-content-editor/nile-content-editor.css.cjs.js +1 -1
  69. package/dist/nile-content-editor/nile-content-editor.css.cjs.js.map +1 -1
  70. package/dist/nile-content-editor/nile-content-editor.css.esm.js +1 -0
  71. package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
  72. package/dist/nile-error-message/nile-error-message.cjs.js +1 -1
  73. package/dist/nile-error-message/nile-error-message.cjs.js.map +1 -1
  74. package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
  75. package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
  76. package/dist/nile-error-message/nile-error-message.css.esm.js +5 -0
  77. package/dist/nile-error-message/nile-error-message.esm.js +6 -4
  78. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  79. package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
  80. package/dist/nile-icon-button/nile-icon-button.esm.js +5 -2
  81. package/dist/nile-input/nile-input.cjs.js +1 -1
  82. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  83. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  84. package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
  85. package/dist/nile-input/nile-input.css.esm.js +4 -0
  86. package/dist/nile-input/nile-input.esm.js +2 -2
  87. package/dist/nile-select/nile-select.cjs.js +1 -1
  88. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  89. package/dist/nile-select/nile-select.esm.js +2 -2
  90. package/dist/nile-switcher/index.cjs.js +1 -1
  91. package/dist/nile-switcher/index.esm.js +1 -1
  92. package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
  93. package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
  94. package/dist/nile-switcher/nile-switcher.css.cjs.js +1 -1
  95. package/dist/nile-switcher/nile-switcher.css.cjs.js.map +1 -1
  96. package/dist/nile-switcher/nile-switcher.css.esm.js +45 -8
  97. package/dist/nile-switcher/nile-switcher.esm.js +72 -44
  98. package/dist/nile-tab/nile-tab.cjs.js +1 -1
  99. package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
  100. package/dist/nile-tab/nile-tab.css.cjs.js +1 -1
  101. package/dist/nile-tab/nile-tab.css.cjs.js.map +1 -1
  102. package/dist/nile-tab/nile-tab.css.esm.js +1 -0
  103. package/dist/nile-tab/nile-tab.esm.js +1 -0
  104. package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
  105. package/dist/nile-textarea/nile-textarea.cjs.js.map +1 -1
  106. package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
  107. package/dist/nile-textarea/nile-textarea.css.cjs.js.map +1 -1
  108. package/dist/nile-textarea/nile-textarea.css.esm.js +4 -1
  109. package/dist/nile-textarea/nile-textarea.esm.js +3 -1
  110. package/dist/nile-toast/index.cjs.js +2 -0
  111. package/dist/nile-toast/index.cjs.js.map +1 -0
  112. package/dist/nile-toast/index.esm.js +1 -0
  113. package/dist/nile-toast/nile-toast.cjs.js +2 -0
  114. package/dist/nile-toast/nile-toast.cjs.js.map +1 -0
  115. package/dist/nile-toast/nile-toast.css.cjs.js +2 -0
  116. package/dist/nile-toast/nile-toast.css.cjs.js.map +1 -0
  117. package/dist/nile-toast/nile-toast.css.esm.js +162 -0
  118. package/dist/nile-toast/nile-toast.esm.js +74 -0
  119. package/dist/src/index.d.ts +1 -0
  120. package/dist/src/index.js +1 -0
  121. package/dist/src/index.js.map +1 -1
  122. package/dist/src/nile-button/nile-button.css.js +2 -2
  123. package/dist/src/nile-button/nile-button.css.js.map +1 -1
  124. package/dist/src/nile-button-toggle/nile-button-toggle.css.js +12 -0
  125. package/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -1
  126. package/dist/src/nile-calendar/nile-calendar.js +1 -3
  127. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  128. package/dist/src/nile-content-editor/nile-content-editor.css.js +1 -0
  129. package/dist/src/nile-content-editor/nile-content-editor.css.js.map +1 -1
  130. package/dist/src/nile-dialog/nile-dialog.js +0 -6
  131. package/dist/src/nile-dialog/nile-dialog.js.map +1 -1
  132. package/dist/src/nile-error-message/nile-error-message.css.js +5 -0
  133. package/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
  134. package/dist/src/nile-error-message/nile-error-message.js +5 -2
  135. package/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  136. package/dist/src/nile-icon-button/nile-icon-button.d.ts +4 -0
  137. package/dist/src/nile-icon-button/nile-icon-button.js +16 -2
  138. package/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
  139. package/dist/src/nile-input/nile-input.css.js +4 -0
  140. package/dist/src/nile-input/nile-input.css.js.map +1 -1
  141. package/dist/src/nile-input/nile-input.js +4 -4
  142. package/dist/src/nile-input/nile-input.js.map +1 -1
  143. package/dist/src/nile-select/nile-select.d.ts +1 -0
  144. package/dist/src/nile-select/nile-select.js +9 -0
  145. package/dist/src/nile-select/nile-select.js.map +1 -1
  146. package/dist/src/nile-switcher/nile-switcher.css.js +43 -6
  147. package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
  148. package/dist/src/nile-switcher/nile-switcher.d.ts +30 -17
  149. package/dist/src/nile-switcher/nile-switcher.js +143 -110
  150. package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  151. package/dist/src/nile-tab/nile-tab.css.js +1 -0
  152. package/dist/src/nile-tab/nile-tab.css.js.map +1 -1
  153. package/dist/src/nile-tab/nile-tab.js +1 -0
  154. package/dist/src/nile-tab/nile-tab.js.map +1 -1
  155. package/dist/src/nile-textarea/nile-textarea.css.js +4 -1
  156. package/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
  157. package/dist/src/nile-textarea/nile-textarea.js +5 -0
  158. package/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  159. package/dist/src/nile-toast/index.d.ts +1 -0
  160. package/dist/src/nile-toast/index.js +2 -0
  161. package/dist/src/nile-toast/index.js.map +1 -0
  162. package/dist/src/nile-toast/nile-toast.css.d.ts +12 -0
  163. package/dist/src/nile-toast/nile-toast.css.js +174 -0
  164. package/dist/src/nile-toast/nile-toast.css.js.map +1 -0
  165. package/dist/src/nile-toast/nile-toast.d.ts +88 -0
  166. package/dist/src/nile-toast/nile-toast.js +350 -0
  167. package/dist/src/nile-toast/nile-toast.js.map +1 -0
  168. package/dist/tsconfig.tsbuildinfo +1 -1
  169. package/package.json +1 -1
  170. package/src/index.ts +1 -0
  171. package/src/nile-button/nile-button.css.ts +2 -2
  172. package/src/nile-button-toggle/nile-button-toggle.css.ts +12 -0
  173. package/src/nile-calendar/nile-calendar.ts +1 -5
  174. package/src/nile-content-editor/nile-content-editor.css.ts +1 -0
  175. package/src/nile-dialog/nile-dialog.ts +0 -6
  176. package/src/nile-error-message/nile-error-message.css.ts +5 -0
  177. package/src/nile-error-message/nile-error-message.ts +6 -2
  178. package/src/nile-icon-button/nile-icon-button.ts +24 -5
  179. package/src/nile-input/nile-input.css.ts +4 -0
  180. package/src/nile-input/nile-input.ts +6 -6
  181. package/src/nile-select/nile-select.ts +9 -0
  182. package/src/nile-switcher/nile-switcher.css.ts +43 -6
  183. package/src/nile-switcher/nile-switcher.ts +167 -172
  184. package/src/nile-tab/nile-tab.css.ts +1 -0
  185. package/src/nile-tab/nile-tab.ts +1 -0
  186. package/src/nile-textarea/nile-textarea.css.ts +4 -1
  187. package/src/nile-textarea/nile-textarea.ts +6 -1
  188. package/src/nile-toast/index.ts +1 -0
  189. package/src/nile-toast/nile-toast.css.ts +176 -0
  190. package/src/nile-toast/nile-toast.ts +381 -0
@@ -12,20 +12,19 @@ import NileElement from '../internal/nile-element';
12
12
  import { CSSResultGroup } from 'lit';
13
13
  import { choose } from 'lit/directives/choose.js';
14
14
  import { classMap } from 'lit/directives/class-map.js';
15
+ import { repeat } from 'lit/directives/repeat.js';
15
16
 
16
17
  /**
17
18
  * @summary Allows you to switch between nile elements
18
-
19
+ *
19
20
  * @dependency nile-icon
20
21
  * @dependency nile-input
21
22
  * @dependency nile-checkbox
22
23
  * @dependency nile-dropdown
23
24
  * @dependency nile-textarea
24
25
  *
25
-
26
26
  * @event nile-change - Emitted when the control's value changes.
27
27
  * @event nile-switch - Emitted when the nile component is being switched.
28
-
29
28
  */
30
29
 
31
30
  export interface switchconfig {
@@ -33,8 +32,9 @@ export interface switchconfig {
33
32
  toggleSwitch: boolean;
34
33
  disable?: boolean;
35
34
  confirmation?: boolean;
36
- defaultInput: switchInputType;
37
- switchInput: switchInputType;
35
+ current: number;
36
+ align: 'block' | 'inline';
37
+ inputs: switchInputType[];
38
38
  }
39
39
 
40
40
  export interface switchInputType {
@@ -44,11 +44,15 @@ export interface switchInputType {
44
44
  | INPUT_TYPE_NAMES.CHECKBOX
45
45
  | INPUT_TYPE_NAMES.TEXTAREA
46
46
  | INPUT_TYPE_NAMES.RADIO
47
- | INPUT_TYPE_NAMES.CONTENTEDITOR;
47
+ | INPUT_TYPE_NAMES.CONTENTEDITOR
48
+ | INPUT_TYPE_NAMES.OBJECT_MAPPER;
48
49
  value?: String | boolean;
49
50
  label?: String;
50
51
  readonly?: boolean;
52
+ order: number;
51
53
  type?: string;
54
+ icon: string;
55
+ mode?: string;
52
56
  placeholder?: string;
53
57
  disabled?: boolean;
54
58
  required?: boolean;
@@ -60,6 +64,11 @@ export interface switchInputType {
60
64
  noborder?: boolean;
61
65
  }
62
66
 
67
+ export enum POSITIONS {
68
+ INLINE = 'inline',
69
+ BLOCK = 'block',
70
+ }
71
+
63
72
  export enum INPUT_TYPE {
64
73
  DEFAULT = 'defaultInput',
65
74
  SWITCH = 'switchInput',
@@ -72,6 +81,12 @@ export enum INPUT_TYPE_NAMES {
72
81
  TEXTAREA = 'text-area',
73
82
  RADIO = 'radio',
74
83
  CONTENTEDITOR = 'content-editor',
84
+ OBJECT_MAPPER = 'object-mapper',
85
+ }
86
+
87
+ export enum MODE {
88
+ CREATE = 'create',
89
+ EDIT = 'edit',
75
90
  }
76
91
 
77
92
  @customElement('nile-switcher')
@@ -81,9 +96,12 @@ export class NileSwitcher extends NileElement {
81
96
  * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
82
97
  */
83
98
  static styles: CSSResultGroup = styles;
99
+
84
100
  @property({ type: Object }) nileSwitchConfig: switchconfig;
101
+ @property() currentInput: switchInputType;
85
102
 
86
103
  connectedCallback() {
104
+ this.currentInput = this.nileSwitchConfig.inputs[0];
87
105
  super.connectedCallback();
88
106
  this.emit('nile-init');
89
107
  }
@@ -93,7 +111,7 @@ export class NileSwitcher extends NileElement {
93
111
  this.emit('nile-destroy');
94
112
  }
95
113
 
96
- renderNileText(Input: switchInputType, inputType: string) {
114
+ renderNileText(Input: switchInputType) {
97
115
  const {
98
116
  value,
99
117
  label,
@@ -102,9 +120,14 @@ export class NileSwitcher extends NileElement {
102
120
  required,
103
121
  error,
104
122
  errorMessage,
105
- inputType: inputTypeName,
123
+ inputType,
124
+ noborder,
106
125
  } = Input;
107
126
  return html`<nile-input
127
+ class=${classMap({
128
+ 'switcher-input': true,
129
+ 'switcher-input--noborder': !!noborder,
130
+ })}
108
131
  .value=${value}
109
132
  .label=${label}
110
133
  .disabled=${disabled}
@@ -113,12 +136,12 @@ export class NileSwitcher extends NileElement {
113
136
  .placeholder=${placeholder}
114
137
  .error=${error}
115
138
  @nile-input=${(e: CustomEvent) => {
116
- this.handleChange(e, inputType, inputTypeName);
139
+ this.handleChange(e, inputType);
117
140
  }}
118
141
  ></nile-input>`;
119
142
  }
120
143
 
121
- renderDropdown(Input: switchInputType, inputType: string) {
144
+ renderDropdown(Input: switchInputType) {
122
145
  const {
123
146
  options,
124
147
  multiple,
@@ -127,10 +150,11 @@ export class NileSwitcher extends NileElement {
127
150
  value,
128
151
  error,
129
152
  errorMessage,
130
- inputType: inputTypeName,
153
+ inputType,
131
154
  } = Input;
132
155
 
133
156
  return html`<nile-select
157
+ class="switcher-dropdown"
134
158
  .placeholder=${placeholder}
135
159
  .disabled="${disabled}"
136
160
  .multiple="${multiple}"
@@ -138,7 +162,7 @@ export class NileSwitcher extends NileElement {
138
162
  .error="${error}"
139
163
  .errorMessage="${errorMessage}"
140
164
  @nile-change=${(e: CustomEvent) => {
141
- this.handleChange(e, inputType, inputTypeName);
165
+ this.handleChange(e, inputType);
142
166
  }}
143
167
  >
144
168
  ${options?.map((option: any) => {
@@ -147,58 +171,48 @@ export class NileSwitcher extends NileElement {
147
171
  </nile-select>`;
148
172
  }
149
173
 
150
- renderNileTextArea(Input: switchInputType, inputType: string) {
151
- const {
152
- value,
153
- disabled,
154
- readonly,
155
- errorMessage,
156
- error,
157
- inputType: inputTypeName,
158
- } = Input;
174
+ renderNileTextArea(Input: switchInputType) {
175
+ const { value, disabled, readonly, errorMessage, error, inputType } = Input;
159
176
 
160
177
  return html`<nile-textarea
178
+ class="switcher-textarea"
161
179
  .value=${value}
162
180
  .disabled=${disabled}
163
181
  ?readonly=${readonly}
164
182
  .error=${error}
165
183
  .errorMessage=${errorMessage}
166
184
  @nile-input=${(e: CustomEvent) => {
167
- this.handleChange(e, inputType, inputTypeName);
185
+ this.handleChange(e, inputType);
168
186
  }}
169
187
  ></nile-textarea>`;
170
188
  }
171
189
 
172
- renderNileCheckBox(Input: switchInputType, inputType: string) {
173
- const { value, label, disabled, inputType: inputTypeName } = Input;
190
+ renderNileCheckBox(Input: switchInputType) {
191
+ const { value, label, disabled, inputType } = Input;
174
192
 
175
193
  return html`<nile-checkbox
194
+ class="switcher-checkbox"
176
195
  .checked=${value}
177
196
  .label=${label}
178
197
  .disabled=${disabled}
179
198
  @valueChange=${(e: CustomEvent) => {
180
- this.handleChange(e, inputType, inputTypeName);
199
+ this.handleChange(e, inputType);
181
200
  }}
182
201
  ></nile-checkbox
183
202
  >; `;
184
203
  }
185
204
 
186
- renderNileRadio(Input: switchInputType, inputType: string) {
187
- const {
188
- options,
189
- value,
190
- disabled,
191
- inputType: inputTypeName,
192
- errorMessage,
193
- } = Input;
205
+ renderNileRadio(Input: switchInputType) {
206
+ const { options, value, disabled, errorMessage, inputType } = Input;
194
207
 
195
208
  const haserrorMessage = !!errorMessage;
196
209
 
197
210
  return html`<nile-radio-group
211
+ class="switcher-radio-group"
198
212
  .value=${value}
199
213
  .disabled=${disabled}
200
214
  @change=${(e: CustomEvent) => {
201
- this.handleChange(e, inputType, inputTypeName);
215
+ this.handleChange(e, inputType);
202
216
  }}
203
217
  >
204
218
  ${options &&
@@ -215,17 +229,11 @@ export class NileSwitcher extends NileElement {
215
229
  `;
216
230
  }
217
231
 
218
- renderContentEditor(Input: switchInputType, inputType: string) {
219
- let {
220
- options,
221
- inputType: inputTypeName,
222
- errorMessage,
223
- type,
224
- readonly,
225
- noborder,
226
- value,
227
- } = Input;
232
+ renderContentEditor(Input: switchInputType) {
233
+ let { options, inputType, errorMessage, type, readonly, noborder, value } =
234
+ Input;
228
235
  return html`<nile-content-editor
236
+ class="switcher-content-editor"
229
237
  .value=${value}
230
238
  .options=${options}
231
239
  .type=${type}
@@ -233,154 +241,141 @@ export class NileSwitcher extends NileElement {
233
241
  .noborder=${noborder}
234
242
  .errorMessage=${errorMessage}
235
243
  @nile-change=${(e: CustomEvent) => {
236
- this.handleChange(e, inputType, inputTypeName);
244
+ this.handleChange(e, inputType);
237
245
  }}
238
246
  >
239
247
  </nile-content-editor>`;
240
248
  }
241
249
 
242
- handleChange(event: CustomEvent, inputType: string, inputTypeName: string) {
243
- if (inputTypeName === INPUT_TYPE_NAMES.CHECKBOX) {
244
- this.nileSwitchConfig[inputType as keyof switchconfig].value =
245
- event.detail.checked;
246
- } else {
247
- this.nileSwitchConfig[inputType as keyof switchconfig].value =
248
- event.detail.value;
249
- }
250
- event.stopPropagation();
251
- this.emit('nile-change', { config: this.nileSwitchConfig });
252
- }
253
-
254
- renderIcon(defaultInput: switchInputType, switchInput: switchInputType) {
255
- const defaultHelperText = defaultInput.helperText;
256
- const switchHelperText = switchInput.helperText;
257
-
258
- const icon = !this.nileSwitchConfig.toggleSwitch
259
- ? 'header-functions'
260
- : 'stringinput';
250
+ renderObjectMapper() {
251
+ const noborder = this.currentInput.noborder;
252
+ const mode = this.currentInput.mode;
253
+ const value =
254
+ this.currentInput.mode === MODE.CREATE
255
+ ? 'Click to Create - Not Mapped'
256
+ : '';
261
257
 
262
- const helperText = !this.nileSwitchConfig.toggleSwitch
263
- ? !!switchHelperText
264
- ? switchHelperText
265
- : `switch to ${switchInput.inputType}`
266
- : !!defaultHelperText
267
- ? defaultHelperText
268
- : `switch to ${defaultInput.inputType}`;
269
-
270
- return html` <nile-tooltip
258
+ return html`<nile-input
271
259
  class=${classMap({
272
- 'tooltip-container': true,
260
+ 'switcher-object-mapper': true,
261
+ 'switcher-object-mapper--noborder': !!noborder,
273
262
  })}
274
- content=${helperText}
275
- placement="bottom"
263
+ .value=${value}
264
+ readonly="true"
265
+ @click="${(e: CustomEvent) =>
266
+ this.handleChange(e, INPUT_TYPE_NAMES.OBJECT_MAPPER)}"
276
267
  >
277
268
  <nile-icon
278
- size="14"
279
- class=${classMap({
280
- 'pointer-cursor': true,
281
- })}
282
- .name=${icon}
269
+ class="pointer-cursor switcher-object-mapper-icon"
270
+ slot="suffix"
271
+ name="collapse"
283
272
  color="#005EA6"
284
- @click=${this.toggleField}
285
- ></nile-icon>
286
- </nile-tooltip>`;
273
+ size="16"
274
+ >
275
+ </nile-icon>
276
+ </nile-input>`;
287
277
  }
288
278
 
289
- toggleField() {
290
- if (!this.nileSwitchConfig.confirmation) {
291
- this.nileSwitchConfig = {
292
- ...this.nileSwitchConfig,
293
- toggleSwitch: !this.nileSwitchConfig.toggleSwitch,
294
- };
279
+ handleChange(event: CustomEvent, inputType: string) {
280
+ switch (inputType) {
281
+ case INPUT_TYPE_NAMES.OBJECT_MAPPER:
282
+ this.currentInput.value = 'clicked';
283
+ break;
284
+ case INPUT_TYPE_NAMES.CHECKBOX:
285
+ this.currentInput.value = event.detail.checked;
286
+ break;
287
+ default:
288
+ this.currentInput.value = event.detail.value;
295
289
  }
296
- this.emit('nile-switch', { config: this.nileSwitchConfig });
290
+ event.stopPropagation();
291
+ this.emit('nile-change', { input: this.currentInput });
297
292
  }
298
293
 
299
- singleFieldSwitcher(
300
- defaultInput: switchInputType,
301
- switchInput: switchInputType,
302
- toggleField: boolean,
303
- disable: boolean
304
- ) {
305
- const defaultInputType = defaultInput.inputType;
306
- const switchInputType = switchInput.inputType;
294
+ renderIcon() {
295
+ const inputs = this.nileSwitchConfig.inputs;
296
+ const toolTipPosition =
297
+ this.nileSwitchConfig.align === POSITIONS.BLOCK ? 'top' : 'bottom';
298
+
307
299
  return html`
308
- ${!toggleField
309
- ? choose(
310
- defaultInputType,
311
- [
312
- [
313
- INPUT_TYPE_NAMES.TEXT,
314
- () => this.renderNileText(defaultInput, INPUT_TYPE.DEFAULT),
315
- ],
316
- [
317
- INPUT_TYPE_NAMES.CHECKBOX,
318
- () => this.renderNileCheckBox(defaultInput, INPUT_TYPE.DEFAULT),
319
- ],
320
- [
321
- INPUT_TYPE_NAMES.TEXTAREA,
322
- () => this.renderNileTextArea(defaultInput, INPUT_TYPE.DEFAULT),
323
- ],
324
- [
325
- INPUT_TYPE_NAMES.RADIO,
326
- () => this.renderNileRadio(defaultInput, INPUT_TYPE.DEFAULT),
327
- ],
328
- [
329
- INPUT_TYPE_NAMES.DROPDOWN,
330
- () =>
331
- this.renderDropdown(
332
- this.nileSwitchConfig.defaultInput,
333
- INPUT_TYPE.DEFAULT
334
- ),
335
- ],
336
- [
337
- INPUT_TYPE_NAMES.CONTENTEDITOR,
338
- () =>
339
- this.renderContentEditor(
340
- this.nileSwitchConfig.defaultInput,
341
- INPUT_TYPE.DEFAULT
342
- ),
343
- ],
344
- ],
345
- () => this.renderNileText(defaultInput, INPUT_TYPE.DEFAULT)
346
- )
347
- : choose(
348
- switchInputType,
349
- [
350
- [
351
- INPUT_TYPE_NAMES.TEXTAREA,
352
- () => this.renderNileTextArea(switchInput, INPUT_TYPE.SWITCH),
353
- ],
354
- [
355
- INPUT_TYPE_NAMES.TEXT,
356
- () => this.renderNileText(switchInput, INPUT_TYPE.SWITCH),
357
- ],
358
- [
359
- INPUT_TYPE_NAMES.CONTENTEDITOR,
360
- () => this.renderContentEditor(switchInput, INPUT_TYPE.SWITCH),
361
- ],
362
- ],
363
-
364
- () => this.renderNileTextArea(switchInput, INPUT_TYPE.SWITCH)
365
- )}
366
- ${!disable ? this.renderIcon(defaultInput, switchInput) : ''}
300
+ <div class="switcher-icons-container">
301
+ ${repeat(
302
+ inputs,
303
+ input => html` <nile-tooltip
304
+ class=${classMap({
305
+ 'switcher-tooltip-container': true,
306
+ })}
307
+ content=${input.helperText}
308
+ placement=${toolTipPosition}
309
+ >
310
+ <div class=${classMap({
311
+ 'switcher-icon-container': true,
312
+ current: input.order === this.currentInput.order,
313
+ })}>
314
+ <nile-icon
315
+ size="16"
316
+ class=${classMap({
317
+ 'pointer-cursor': true,
318
+ })}
319
+ .name=${input.icon}
320
+ color="#000000"
321
+ @click=${() => this.toggleField(input)}
322
+ ></nile-icon>
323
+ <div>
324
+
325
+ </nile-tooltip>`
326
+ )}
327
+ </div>
367
328
  `;
368
329
  }
369
- public render(): TemplateResult {
370
- const {
371
- toggleSwitch: toggleField,
372
- defaultInput,
373
- switchInput,
374
- disable,
375
- } = this.nileSwitchConfig;
376
-
377
- return html`<div class="input-container">
378
- ${this.singleFieldSwitcher(
379
- defaultInput,
380
- switchInput,
381
- toggleField,
382
- !!disable
330
+
331
+ toggleField(currentInput: switchInputType) {
332
+ this.currentInput = currentInput;
333
+ this.emit('nile-switch', { input: this.currentInput });
334
+ }
335
+
336
+ singleFieldSwitcher() {
337
+ return html`
338
+ ${choose(
339
+ this.currentInput.inputType,
340
+ [
341
+ [INPUT_TYPE_NAMES.TEXT, () => this.renderNileText(this.currentInput)],
342
+ [
343
+ INPUT_TYPE_NAMES.CHECKBOX,
344
+ () => this.renderNileCheckBox(this.currentInput),
345
+ ],
346
+ [
347
+ INPUT_TYPE_NAMES.TEXTAREA,
348
+ () => this.renderNileTextArea(this.currentInput),
349
+ ],
350
+ [
351
+ INPUT_TYPE_NAMES.RADIO,
352
+ () => this.renderNileRadio(this.currentInput),
353
+ ],
354
+ [
355
+ INPUT_TYPE_NAMES.DROPDOWN,
356
+ () => this.renderDropdown(this.currentInput),
357
+ ],
358
+ [
359
+ INPUT_TYPE_NAMES.CONTENTEDITOR,
360
+ () => this.renderContentEditor(this.currentInput),
361
+ ],
362
+ [INPUT_TYPE_NAMES.OBJECT_MAPPER, () => this.renderObjectMapper()],
363
+ ],
364
+ () => this.renderNileText(this.currentInput)
383
365
  )}
366
+ `;
367
+ }
368
+
369
+ public render(): TemplateResult {
370
+ const align = this.nileSwitchConfig.align;
371
+ return html`<div
372
+ class=${classMap({
373
+ 'switcher-block': align === POSITIONS.BLOCK,
374
+ 'switcher-inline': align === POSITIONS.INLINE,
375
+ 'switcher-input-container': true,
376
+ })}
377
+ >
378
+ ${this.renderIcon()} ${this.singleFieldSwitcher()}
384
379
  </div>`;
385
380
  }
386
381
  }
@@ -35,6 +35,7 @@ export const styles = css`
35
35
  font-weight: 500;
36
36
  line-height: 16px;
37
37
  letter-spacing: 0.2px;
38
+ gap: 4px;
38
39
  }
39
40
 
40
41
  .tab:hover:not(.tab--disabled) {
@@ -100,6 +100,7 @@ export class NileTab extends NileElement {
100
100
  })}
101
101
  tabindex=${this.disabled ? '-1' : '0'}
102
102
  >
103
+ <slot name="prefix"></slot>
103
104
  <slot></slot>
104
105
  ${this.closable
105
106
  ? html`
@@ -80,6 +80,7 @@ export const styles = css`
80
80
  border-radius: var(--nile-radius-base-standard);
81
81
  transition: 0.3s color, 0.3s border, 0.3s box-shadow, 0.3s background-color;
82
82
  cursor: text;
83
+ min-height:12px;
83
84
  }
84
85
 
85
86
  /* Standard textareas */
@@ -181,16 +182,18 @@ export const styles = css`
181
182
  /* Resize types */
182
183
  .textarea--resize-none .textarea__control {
183
184
  resize: none;
185
+ min-height:12px;
184
186
  }
185
187
 
186
188
  .textarea--resize-vertical .textarea__control {
187
189
  resize: vertical;
190
+ min-height:12px;
188
191
  }
189
192
 
190
193
  .textarea--resize-auto .textarea__control {
191
- height: auto;
192
194
  resize: none;
193
195
  overflow-y: hidden;
196
+ min-height:12px;
194
197
  }
195
198
 
196
199
  .textarea--standard.textarea--warning {
@@ -160,12 +160,15 @@ export class NileTextarea extends NileElement {
160
160
  this.resizeObserver.observe(this.input);
161
161
  });
162
162
 
163
+
163
164
  if(this.fullHeight){
164
165
  requestAnimationFrame(() => {
165
166
  let parentHeight = this.parentElement?.getBoundingClientRect().height;
166
-
167
167
  if (parentHeight) {
168
168
  parentHeight = parentHeight - 65;
169
+ if (parentHeight<12) {
170
+ parentHeight=12;
171
+ }
169
172
  this.shadowRoot?.querySelector('textarea')?.style.setProperty('height', `${parentHeight}px`);
170
173
  }
171
174
  });
@@ -351,6 +354,8 @@ export class NileTextarea extends NileElement {
351
354
  @input=${this.handleInput}
352
355
  @focus=${this.handleFocus}
353
356
  @blur=${this.handleBlur}
357
+
358
+
354
359
  ></textarea>
355
360
  </div>
356
361
  </div>
@@ -0,0 +1 @@
1
+ export { NileToast } from './nile-toast';