@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.
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button/nile-button.css.js +2 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button/nile-button.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.js +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js +1 -3
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.css.js +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-dialog/nile-dialog.js +0 -6
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-dialog/nile-dialog.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.css.js +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js +5 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.d.ts +4 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.js +16 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.css.js +4 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js +4 -4
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +9 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +43 -6
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +30 -17
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +143 -110
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.css.js +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.js +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.css.js +4 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.css.js +174 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.d.ts +88 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.js +350 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-toast/nile-toast.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +651 -325
- package/dist/nile-button/nile-button.css.cjs.js +1 -1
- package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.css.esm.js +2 -2
- package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js +1 -1
- package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js.map +1 -1
- package/dist/nile-button-toggle/nile-button-toggle.css.esm.js +12 -0
- package/dist/nile-calendar/index.cjs.js +1 -1
- package/dist/nile-calendar/index.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.esm.js +4 -6
- package/dist/nile-calendar/timezones.cjs.js +1 -1
- package/dist/nile-calendar/timezones.cjs.js.map +1 -1
- package/dist/nile-calendar/timezones.esm.js +1 -1
- package/dist/nile-content-editor/nile-content-editor.css.cjs.js +1 -1
- package/dist/nile-content-editor/nile-content-editor.css.cjs.js.map +1 -1
- package/dist/nile-content-editor/nile-content-editor.css.esm.js +1 -0
- package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
- package/dist/nile-error-message/nile-error-message.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.cjs.js.map +1 -1
- package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
- package/dist/nile-error-message/nile-error-message.css.esm.js +5 -0
- package/dist/nile-error-message/nile-error-message.esm.js +6 -4
- package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
- package/dist/nile-icon-button/nile-icon-button.esm.js +5 -2
- package/dist/nile-input/nile-input.cjs.js +1 -1
- package/dist/nile-input/nile-input.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.css.cjs.js +1 -1
- package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.css.esm.js +4 -0
- package/dist/nile-input/nile-input.esm.js +2 -2
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.esm.js +2 -2
- package/dist/nile-switcher/index.cjs.js +1 -1
- package/dist/nile-switcher/index.esm.js +1 -1
- package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
- package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
- package/dist/nile-switcher/nile-switcher.css.cjs.js +1 -1
- package/dist/nile-switcher/nile-switcher.css.cjs.js.map +1 -1
- package/dist/nile-switcher/nile-switcher.css.esm.js +45 -8
- package/dist/nile-switcher/nile-switcher.esm.js +72 -44
- package/dist/nile-tab/nile-tab.cjs.js +1 -1
- package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
- package/dist/nile-tab/nile-tab.css.cjs.js +1 -1
- package/dist/nile-tab/nile-tab.css.cjs.js.map +1 -1
- package/dist/nile-tab/nile-tab.css.esm.js +1 -0
- package/dist/nile-tab/nile-tab.esm.js +1 -0
- package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.cjs.js.map +1 -1
- package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.css.cjs.js.map +1 -1
- package/dist/nile-textarea/nile-textarea.css.esm.js +4 -1
- package/dist/nile-textarea/nile-textarea.esm.js +3 -1
- package/dist/nile-toast/index.cjs.js +2 -0
- package/dist/nile-toast/index.cjs.js.map +1 -0
- package/dist/nile-toast/index.esm.js +1 -0
- package/dist/nile-toast/nile-toast.cjs.js +2 -0
- package/dist/nile-toast/nile-toast.cjs.js.map +1 -0
- package/dist/nile-toast/nile-toast.css.cjs.js +2 -0
- package/dist/nile-toast/nile-toast.css.cjs.js.map +1 -0
- package/dist/nile-toast/nile-toast.css.esm.js +162 -0
- package/dist/nile-toast/nile-toast.esm.js +74 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-button/nile-button.css.js +2 -2
- package/dist/src/nile-button/nile-button.css.js.map +1 -1
- package/dist/src/nile-button-toggle/nile-button-toggle.css.js +12 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.js +1 -3
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/dist/src/nile-content-editor/nile-content-editor.css.js +1 -0
- package/dist/src/nile-content-editor/nile-content-editor.css.js.map +1 -1
- package/dist/src/nile-dialog/nile-dialog.js +0 -6
- package/dist/src/nile-dialog/nile-dialog.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.css.js +5 -0
- package/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.js +5 -2
- package/dist/src/nile-error-message/nile-error-message.js.map +1 -1
- package/dist/src/nile-icon-button/nile-icon-button.d.ts +4 -0
- package/dist/src/nile-icon-button/nile-icon-button.js +16 -2
- package/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
- package/dist/src/nile-input/nile-input.css.js +4 -0
- package/dist/src/nile-input/nile-input.css.js.map +1 -1
- package/dist/src/nile-input/nile-input.js +4 -4
- package/dist/src/nile-input/nile-input.js.map +1 -1
- package/dist/src/nile-select/nile-select.d.ts +1 -0
- package/dist/src/nile-select/nile-select.js +9 -0
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.css.js +43 -6
- package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.d.ts +30 -17
- package/dist/src/nile-switcher/nile-switcher.js +143 -110
- package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/dist/src/nile-tab/nile-tab.css.js +1 -0
- package/dist/src/nile-tab/nile-tab.css.js.map +1 -1
- package/dist/src/nile-tab/nile-tab.js +1 -0
- package/dist/src/nile-tab/nile-tab.js.map +1 -1
- package/dist/src/nile-textarea/nile-textarea.css.js +4 -1
- package/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
- package/dist/src/nile-textarea/nile-textarea.js +5 -0
- package/dist/src/nile-textarea/nile-textarea.js.map +1 -1
- package/dist/src/nile-toast/index.d.ts +1 -0
- package/dist/src/nile-toast/index.js +2 -0
- package/dist/src/nile-toast/index.js.map +1 -0
- package/dist/src/nile-toast/nile-toast.css.d.ts +12 -0
- package/dist/src/nile-toast/nile-toast.css.js +174 -0
- package/dist/src/nile-toast/nile-toast.css.js.map +1 -0
- package/dist/src/nile-toast/nile-toast.d.ts +88 -0
- package/dist/src/nile-toast/nile-toast.js +350 -0
- package/dist/src/nile-toast/nile-toast.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/nile-button/nile-button.css.ts +2 -2
- package/src/nile-button-toggle/nile-button-toggle.css.ts +12 -0
- package/src/nile-calendar/nile-calendar.ts +1 -5
- package/src/nile-content-editor/nile-content-editor.css.ts +1 -0
- package/src/nile-dialog/nile-dialog.ts +0 -6
- package/src/nile-error-message/nile-error-message.css.ts +5 -0
- package/src/nile-error-message/nile-error-message.ts +6 -2
- package/src/nile-icon-button/nile-icon-button.ts +24 -5
- package/src/nile-input/nile-input.css.ts +4 -0
- package/src/nile-input/nile-input.ts +6 -6
- package/src/nile-select/nile-select.ts +9 -0
- package/src/nile-switcher/nile-switcher.css.ts +43 -6
- package/src/nile-switcher/nile-switcher.ts +167 -172
- package/src/nile-tab/nile-tab.css.ts +1 -0
- package/src/nile-tab/nile-tab.ts +1 -0
- package/src/nile-textarea/nile-textarea.css.ts +4 -1
- package/src/nile-textarea/nile-textarea.ts +6 -1
- package/src/nile-toast/index.ts +1 -0
- package/src/nile-toast/nile-toast.css.ts +176 -0
- 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
|
-
|
37
|
-
|
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
|
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
|
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
|
139
|
+
this.handleChange(e, inputType);
|
117
140
|
}}
|
118
141
|
></nile-input>`;
|
119
142
|
}
|
120
143
|
|
121
|
-
renderDropdown(Input: switchInputType
|
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
|
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
|
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
|
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
|
185
|
+
this.handleChange(e, inputType);
|
168
186
|
}}
|
169
187
|
></nile-textarea>`;
|
170
188
|
}
|
171
189
|
|
172
|
-
renderNileCheckBox(Input: switchInputType
|
173
|
-
const { value, label, disabled, inputType
|
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
|
199
|
+
this.handleChange(e, inputType);
|
181
200
|
}}
|
182
201
|
></nile-checkbox
|
183
202
|
>; `;
|
184
203
|
}
|
185
204
|
|
186
|
-
renderNileRadio(Input: switchInputType
|
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
|
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
|
219
|
-
let {
|
220
|
-
|
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
|
244
|
+
this.handleChange(e, inputType);
|
237
245
|
}}
|
238
246
|
>
|
239
247
|
</nile-content-editor>`;
|
240
248
|
}
|
241
249
|
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
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
|
-
|
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
|
-
'
|
260
|
+
'switcher-object-mapper': true,
|
261
|
+
'switcher-object-mapper--noborder': !!noborder,
|
273
262
|
})}
|
274
|
-
|
275
|
-
|
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
|
-
|
279
|
-
|
280
|
-
|
281
|
-
})}
|
282
|
-
.name=${icon}
|
269
|
+
class="pointer-cursor switcher-object-mapper-icon"
|
270
|
+
slot="suffix"
|
271
|
+
name="collapse"
|
283
272
|
color="#005EA6"
|
284
|
-
|
285
|
-
|
286
|
-
|
273
|
+
size="16"
|
274
|
+
>
|
275
|
+
</nile-icon>
|
276
|
+
</nile-input>`;
|
287
277
|
}
|
288
278
|
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
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
|
-
|
290
|
+
event.stopPropagation();
|
291
|
+
this.emit('nile-change', { input: this.currentInput });
|
297
292
|
}
|
298
293
|
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
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
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
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
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
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
|
}
|
package/src/nile-tab/nile-tab.ts
CHANGED
@@ -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';
|