@aquera/nile-elements 0.0.30 → 0.0.32
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 +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +2 -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-code-editor/extensionSetup.d.ts +33 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/extensionSetup.js +63 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/extensionSetup.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js +42 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.d.ts +43 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js +114 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js.map +1 -0
- 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 +11 -0
- 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 +11 -5
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +55 -7
- 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 +672 -351
- 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-code-editor/extensionSetup.cjs.js +7 -0
- package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -0
- package/dist/nile-code-editor/extensionSetup.esm.js +1 -0
- package/dist/nile-code-editor/index.cjs.js +2 -0
- package/dist/nile-code-editor/index.cjs.js.map +1 -0
- package/dist/nile-code-editor/index.esm.js +1 -0
- package/dist/nile-code-editor/nile-code-editor.cjs.js +3 -0
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -0
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js +2 -0
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -0
- package/dist/nile-code-editor/nile-code-editor.css.esm.js +30 -0
- package/dist/nile-code-editor/nile-code-editor.esm.js +9 -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 +13 -2
- package/dist/nile-switcher/nile-switcher.esm.js +38 -30
- 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 +2 -0
- package/dist/src/index.js +2 -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-code-editor/extensionSetup.d.ts +33 -0
- package/dist/src/nile-code-editor/extensionSetup.js +63 -0
- package/dist/src/nile-code-editor/extensionSetup.js.map +1 -0
- package/dist/src/nile-code-editor/index.d.ts +1 -0
- package/dist/src/nile-code-editor/index.js +2 -0
- package/dist/src/nile-code-editor/index.js.map +1 -0
- package/dist/src/nile-code-editor/nile-code-editor.css.d.ts +12 -0
- package/dist/src/nile-code-editor/nile-code-editor.css.js +42 -0
- package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -0
- package/dist/src/nile-code-editor/nile-code-editor.d.ts +43 -0
- package/dist/src/nile-code-editor/nile-code-editor.js +114 -0
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -0
- 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 +11 -0
- package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.d.ts +11 -5
- package/dist/src/nile-switcher/nile-switcher.js +55 -7
- 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 +3 -1
- 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-code-editor/extensionSetup.ts +125 -0
- package/src/nile-code-editor/index.ts +1 -0
- package/src/nile-code-editor/nile-code-editor.css.ts +44 -0
- package/src/nile-code-editor/nile-code-editor.ts +127 -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 +11 -0
- package/src/nile-switcher/nile-switcher.ts +70 -10
- 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
@@ -13,6 +13,7 @@ import { CSSResultGroup } from 'lit';
|
|
13
13
|
import { choose } from 'lit/directives/choose.js';
|
14
14
|
import { classMap } from 'lit/directives/class-map.js';
|
15
15
|
import { repeat } from 'lit/directives/repeat.js';
|
16
|
+
import { watch } from '../internal/watch';
|
16
17
|
|
17
18
|
/**
|
18
19
|
* @summary Allows you to switch between nile elements
|
@@ -32,7 +33,6 @@ export interface switchconfig {
|
|
32
33
|
toggleSwitch: boolean;
|
33
34
|
disable?: boolean;
|
34
35
|
confirmation?: boolean;
|
35
|
-
current: number;
|
36
36
|
align: 'block' | 'inline';
|
37
37
|
inputs: switchInputType[];
|
38
38
|
}
|
@@ -45,11 +45,11 @@ export interface switchInputType {
|
|
45
45
|
| INPUT_TYPE_NAMES.TEXTAREA
|
46
46
|
| INPUT_TYPE_NAMES.RADIO
|
47
47
|
| INPUT_TYPE_NAMES.CONTENTEDITOR
|
48
|
-
| INPUT_TYPE_NAMES.OBJECT_MAPPER
|
48
|
+
| INPUT_TYPE_NAMES.OBJECT_MAPPER
|
49
|
+
| INPUT_TYPE_NAMES.CODE_EDITOR;
|
49
50
|
value?: String | boolean;
|
50
51
|
label?: String;
|
51
52
|
readonly?: boolean;
|
52
|
-
order: number;
|
53
53
|
type?: string;
|
54
54
|
icon: string;
|
55
55
|
mode?: string;
|
@@ -62,6 +62,8 @@ export interface switchInputType {
|
|
62
62
|
helperText?: string;
|
63
63
|
multiple?: boolean;
|
64
64
|
noborder?: boolean;
|
65
|
+
multiLine?: boolean;
|
66
|
+
expand?: boolean;
|
65
67
|
}
|
66
68
|
|
67
69
|
export enum POSITIONS {
|
@@ -82,6 +84,7 @@ export enum INPUT_TYPE_NAMES {
|
|
82
84
|
RADIO = 'radio',
|
83
85
|
CONTENTEDITOR = 'content-editor',
|
84
86
|
OBJECT_MAPPER = 'object-mapper',
|
87
|
+
CODE_EDITOR = 'code-editor',
|
85
88
|
}
|
86
89
|
|
87
90
|
export enum MODE {
|
@@ -98,14 +101,31 @@ export class NileSwitcher extends NileElement {
|
|
98
101
|
static styles: CSSResultGroup = styles;
|
99
102
|
|
100
103
|
@property({ type: Object }) nileSwitchConfig: switchconfig;
|
101
|
-
|
104
|
+
|
105
|
+
@property({ type: Number }) current: Number = 0;
|
106
|
+
|
107
|
+
@property({ type: Object }) currentInput: switchInputType;
|
102
108
|
|
103
109
|
connectedCallback() {
|
104
|
-
this.currentInput = this.nileSwitchConfig.inputs[0];
|
105
110
|
super.connectedCallback();
|
111
|
+
this.setCurrentInput();
|
106
112
|
this.emit('nile-init');
|
107
113
|
}
|
108
114
|
|
115
|
+
@watch(['current'], { waitUntilFirstUpdate: true })
|
116
|
+
handleSwitcherChange() {
|
117
|
+
this.setCurrentInput();
|
118
|
+
}
|
119
|
+
|
120
|
+
setCurrentInput() {
|
121
|
+
if (this.nileSwitchConfig?.inputs) {
|
122
|
+
this.currentInput = this.nileSwitchConfig.inputs.filter(
|
123
|
+
(input: switchInputType, index: Number) => {
|
124
|
+
return index === this.current;
|
125
|
+
}
|
126
|
+
)[0];
|
127
|
+
}
|
128
|
+
}
|
109
129
|
disconnectedCallback() {
|
110
130
|
super.disconnectedCallback();
|
111
131
|
this.emit('nile-destroy');
|
@@ -276,6 +296,39 @@ export class NileSwitcher extends NileElement {
|
|
276
296
|
</nile-input>`;
|
277
297
|
}
|
278
298
|
|
299
|
+
renderCodeEditor(Input: switchInputType) {
|
300
|
+
const {
|
301
|
+
value,
|
302
|
+
multiLine,
|
303
|
+
options,
|
304
|
+
disabled,
|
305
|
+
readonly,
|
306
|
+
errorMessage,
|
307
|
+
error,
|
308
|
+
inputType,
|
309
|
+
noborder,
|
310
|
+
} = Input;
|
311
|
+
return html`<nile-code-editor
|
312
|
+
class=${classMap({
|
313
|
+
'code-editor': true,
|
314
|
+
'code-editor__no-border': !!noborder,
|
315
|
+
})}
|
316
|
+
@nile-expand="${(e: CustomEvent) =>
|
317
|
+
this.handleExpand(e, INPUT_TYPE_NAMES.CODE_EDITOR)}"
|
318
|
+
@nile-change="${(e: CustomEvent) =>
|
319
|
+
this.handleChange(e, INPUT_TYPE_NAMES.CODE_EDITOR)}"
|
320
|
+
.multiline="${multiLine}"
|
321
|
+
.value="${value}"
|
322
|
+
.customOptions="${options}"
|
323
|
+
.showLineNumbers="false"
|
324
|
+
></nile-code-editor> `;
|
325
|
+
}
|
326
|
+
|
327
|
+
handleExpand(event: CustomEvent, inputType: string) {
|
328
|
+
this.currentInput.expand = event.detail.expand;
|
329
|
+
this.emit('nile-change', { input: this.currentInput });
|
330
|
+
}
|
331
|
+
|
279
332
|
handleChange(event: CustomEvent, inputType: string) {
|
280
333
|
switch (inputType) {
|
281
334
|
case INPUT_TYPE_NAMES.OBJECT_MAPPER:
|
@@ -284,6 +337,9 @@ export class NileSwitcher extends NileElement {
|
|
284
337
|
case INPUT_TYPE_NAMES.CHECKBOX:
|
285
338
|
this.currentInput.value = event.detail.checked;
|
286
339
|
break;
|
340
|
+
case INPUT_TYPE_NAMES.CODE_EDITOR:
|
341
|
+
this.currentInput.value = event.detail.value;
|
342
|
+
break;
|
287
343
|
default:
|
288
344
|
this.currentInput.value = event.detail.value;
|
289
345
|
}
|
@@ -300,7 +356,7 @@ export class NileSwitcher extends NileElement {
|
|
300
356
|
<div class="switcher-icons-container">
|
301
357
|
${repeat(
|
302
358
|
inputs,
|
303
|
-
input => html` <nile-tooltip
|
359
|
+
(input: any, index: number) => html` <nile-tooltip
|
304
360
|
class=${classMap({
|
305
361
|
'switcher-tooltip-container': true,
|
306
362
|
})}
|
@@ -309,7 +365,7 @@ export class NileSwitcher extends NileElement {
|
|
309
365
|
>
|
310
366
|
<div class=${classMap({
|
311
367
|
'switcher-icon-container': true,
|
312
|
-
current:
|
368
|
+
current: index === this.current,
|
313
369
|
})}>
|
314
370
|
<nile-icon
|
315
371
|
size="16"
|
@@ -318,7 +374,7 @@ export class NileSwitcher extends NileElement {
|
|
318
374
|
})}
|
319
375
|
.name=${input.icon}
|
320
376
|
color="#000000"
|
321
|
-
@click=${() => this.toggleField(input)}
|
377
|
+
@click=${() => this.toggleField(input, index)}
|
322
378
|
></nile-icon>
|
323
379
|
<div>
|
324
380
|
|
@@ -328,8 +384,8 @@ export class NileSwitcher extends NileElement {
|
|
328
384
|
`;
|
329
385
|
}
|
330
386
|
|
331
|
-
toggleField(currentInput: switchInputType) {
|
332
|
-
this.
|
387
|
+
toggleField(currentInput: switchInputType, index: Number) {
|
388
|
+
this.current = index;
|
333
389
|
this.emit('nile-switch', { input: this.currentInput });
|
334
390
|
}
|
335
391
|
|
@@ -360,6 +416,10 @@ export class NileSwitcher extends NileElement {
|
|
360
416
|
() => this.renderContentEditor(this.currentInput),
|
361
417
|
],
|
362
418
|
[INPUT_TYPE_NAMES.OBJECT_MAPPER, () => this.renderObjectMapper()],
|
419
|
+
[
|
420
|
+
INPUT_TYPE_NAMES.CODE_EDITOR,
|
421
|
+
() => this.renderCodeEditor(this.currentInput),
|
422
|
+
],
|
363
423
|
],
|
364
424
|
() => this.renderNileText(this.currentInput)
|
365
425
|
)}
|
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';
|
@@ -0,0 +1,176 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import { css } from 'lit-element';
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Toast CSS
|
12
|
+
*/
|
13
|
+
export const styles = css`
|
14
|
+
:host {
|
15
|
+
display: contents;
|
16
|
+
|
17
|
+
/* For better DX, we'll reset the margin here so the base part can inherit it */
|
18
|
+
margin: 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
[hidden] {
|
22
|
+
display: none;
|
23
|
+
}
|
24
|
+
|
25
|
+
.alert {
|
26
|
+
position: relative;
|
27
|
+
display: flex;
|
28
|
+
align-items: stretch;
|
29
|
+
border: solid 2px 2px;
|
30
|
+
border-radius: var(--nile-radius-base-standard);
|
31
|
+
margin: inherit;
|
32
|
+
padding: 12px;
|
33
|
+
gap: 10px;
|
34
|
+
}
|
35
|
+
|
36
|
+
.alert:not(.alert--has-icon) .alert__icon,
|
37
|
+
.alert:not(.alert--closable) .alert__close-button {
|
38
|
+
display: none;
|
39
|
+
}
|
40
|
+
|
41
|
+
.alert__prefix-icon-container {
|
42
|
+
height: 26px;
|
43
|
+
width: 26px;
|
44
|
+
border-radius: 4px;
|
45
|
+
padding: 6px;
|
46
|
+
box-sizing: border-box;
|
47
|
+
display: flex;
|
48
|
+
justify-content: center;
|
49
|
+
align-items: center;
|
50
|
+
}
|
51
|
+
|
52
|
+
.alert__icon {
|
53
|
+
flex: 0 0 auto;
|
54
|
+
display: flex;
|
55
|
+
align-items: center;
|
56
|
+
font-size: 10px;
|
57
|
+
}
|
58
|
+
|
59
|
+
.alert--success {
|
60
|
+
border: 1px solid var(--nile-colors-green-500);
|
61
|
+
background: var(--nile-colors-green-100);
|
62
|
+
box-shadow: 0px 14px 28px 0px rgba(119, 125, 130, 0.15);
|
63
|
+
}
|
64
|
+
|
65
|
+
.alert--success .alert__prefix-icon-container {
|
66
|
+
background: var(--nile-colors-green-500);
|
67
|
+
}
|
68
|
+
|
69
|
+
.alert--info {
|
70
|
+
border: 1px solid var(--nile-colors-blue-500);
|
71
|
+
background: var(--nile-colors-blue-100);
|
72
|
+
box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);
|
73
|
+
}
|
74
|
+
|
75
|
+
.alert--info .alert__prefix-icon-container {
|
76
|
+
background: var(--nile-colors-blue-500);
|
77
|
+
}
|
78
|
+
|
79
|
+
.alert--warning {
|
80
|
+
border: 1px solid var(--nile-colors-yellow-500);
|
81
|
+
background: var(--nile-colors-yellow-100);
|
82
|
+
box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);
|
83
|
+
}
|
84
|
+
|
85
|
+
.alert--warning .alert__prefix-icon-container {
|
86
|
+
background: var(--nile-colors-yellow-500);
|
87
|
+
}
|
88
|
+
|
89
|
+
.alert--error {
|
90
|
+
border: 1px solid var(--nile-colors-red-500);
|
91
|
+
background: var(--nile-colors-red-100);
|
92
|
+
box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);
|
93
|
+
}
|
94
|
+
|
95
|
+
.alert--error .alert__prefix-icon-container {
|
96
|
+
border: 1px solid var(--nile-colors-red-500);
|
97
|
+
background: var(--nile-colors-red-500);
|
98
|
+
}
|
99
|
+
|
100
|
+
.alert__message {
|
101
|
+
flex: 1 1 auto;
|
102
|
+
display: block;
|
103
|
+
overflow: hidden;
|
104
|
+
display: flex;
|
105
|
+
align-items: center;
|
106
|
+
flex-direction: column;
|
107
|
+
align-items: flex-start;
|
108
|
+
font-family: Colfax-regular;
|
109
|
+
font-size: 14px;
|
110
|
+
font-weight: 400;
|
111
|
+
line-height: 14px;
|
112
|
+
color: black;
|
113
|
+
}
|
114
|
+
|
115
|
+
.alert__message--title {
|
116
|
+
font-weight: 600;
|
117
|
+
}
|
118
|
+
|
119
|
+
.alert__message--content {
|
120
|
+
line-height: 21px;
|
121
|
+
}
|
122
|
+
|
123
|
+
.alert__message--content-only {
|
124
|
+
margin-top: 3px;
|
125
|
+
}
|
126
|
+
|
127
|
+
.alert__close-button {
|
128
|
+
flex: 0 0 auto;
|
129
|
+
display: flex;
|
130
|
+
align-items: center;
|
131
|
+
}
|
132
|
+
|
133
|
+
.alert__tags {
|
134
|
+
display: flex;
|
135
|
+
flex-wrap: wrap;
|
136
|
+
gap: 10px;
|
137
|
+
margin-top: 4px;
|
138
|
+
}
|
139
|
+
|
140
|
+
.alert__tag {
|
141
|
+
height: 24px;
|
142
|
+
display: flex;
|
143
|
+
border-radius: 4px;
|
144
|
+
border: 1px solid #e5e9eb;
|
145
|
+
background: var(--nile-colors-white-base);
|
146
|
+
}
|
147
|
+
|
148
|
+
.alert__tag-content {
|
149
|
+
border-left: 1px solid #e5e9eb;
|
150
|
+
display: flex;
|
151
|
+
align-items: center;
|
152
|
+
justify-content: center;
|
153
|
+
padding: 0 6px;
|
154
|
+
|
155
|
+
color: var(--nile-colors-dark-900);
|
156
|
+
font-family: Colfax-regular;
|
157
|
+
font-size: 12px;
|
158
|
+
font-style: normal;
|
159
|
+
font-weight: 500;
|
160
|
+
line-height: 12px;
|
161
|
+
letter-spacing: 0.2px;
|
162
|
+
}
|
163
|
+
|
164
|
+
.alert__tag-image {
|
165
|
+
height: 24px;
|
166
|
+
width: 24px;
|
167
|
+
border-radius: 4px 0 0 4px;
|
168
|
+
}
|
169
|
+
|
170
|
+
.alert__prefix-img{
|
171
|
+
height: 24px;
|
172
|
+
border-radius: 4px;
|
173
|
+
}
|
174
|
+
`;
|
175
|
+
|
176
|
+
export default [styles];
|