@operato/layout 7.1.30 → 7.1.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.
@@ -1,109 +0,0 @@
1
- import '@material/web/button/filled-button.js'
2
- import '@material/web/icon/icon.js'
3
-
4
- import { css, html, LitElement } from 'lit'
5
- import { customElement, property } from 'lit/decorators.js'
6
- import { connect } from 'pwa-helpers/connect-mixin.js'
7
-
8
- import { CLOSE_SNACKBAR } from '../actions/snackbar'
9
- import store from '../initializer.js'
10
-
11
- @customElement('ox-snack-bar')
12
- class SnackBar extends connect(store)(LitElement) {
13
- static styles = css`
14
- :host {
15
- display: block;
16
- position: fixed;
17
- top: 100%;
18
- left: 0;
19
- right: 0;
20
- padding: 12px;
21
- color: var(--md-sys-color-inverse-on-surface, white);
22
- background-color: var(--md-sys-color-inverse-surface, black);
23
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
24
- text-align: center;
25
- will-change: transform;
26
- transform: translate3d(0, 0, 0);
27
- transition-property: visibility, transform;
28
- transition-duration: 0.2s;
29
- visibility: hidden;
30
- }
31
-
32
- md-filled-button {
33
- margin-top: var(--spacing-medium);
34
- text-transform: capitalize;
35
- }
36
-
37
- :host([active]) {
38
- visibility: visible;
39
- transform: translate3d(0, -100%, 0);
40
- }
41
-
42
- md-icon {
43
- vertical-align: middle;
44
- max-width: 20px;
45
- --md-icon-size: 1.5em;
46
- }
47
-
48
- .info {
49
- color: var(--status-info-color);
50
- }
51
-
52
- .warn {
53
- color: var(--status-warning-color);
54
- }
55
-
56
- .error {
57
- color: var(--status-danger-color);
58
- }
59
-
60
- @media (min-width: 460px) {
61
- :host {
62
- width: 320px;
63
- margin: auto;
64
- }
65
- }
66
- `
67
-
68
- @property({ type: String }) level: 'info' | 'warn' | 'error' = 'info'
69
- @property({ type: String }) message: string = ''
70
- @property({ type: Boolean, reflect: true }) active: boolean = false
71
- @property({ type: Object }) action: any
72
-
73
- render() {
74
- return html`
75
- <span>
76
- <md-icon class=${this.level}
77
- >${this.level == 'info'
78
- ? html` notification_important `
79
- : this.level == 'warn'
80
- ? html` warning `
81
- : this.level == 'error'
82
- ? html` error `
83
- : html``}</md-icon
84
- >
85
- </span>
86
- <span>${this.message}</span>
87
- ${this.action && this.action.label
88
- ? html`
89
- <md-filled-button
90
- @click=${() => {
91
- store.dispatch({ type: CLOSE_SNACKBAR })
92
- this.action.callback()
93
- }}
94
- >${this.action.label}</md-filled-button
95
- >
96
- `
97
- : html``}
98
- `
99
- }
100
-
101
- stateChanged(state: any) {
102
- var { level, message, snackbarOpened, action } = state.snackbar || {}
103
-
104
- this.level = level
105
- this.message = message
106
- this.active = snackbarOpened
107
- this.action = action
108
- }
109
- }
@@ -1,72 +0,0 @@
1
- import { APPEND_VIEWPART, REMOVE_VIEWPART, UPDATE_VIEWPART, UPDATE_VIEWPORT_WIDTH, Viewpart } from '../actions/layout'
2
-
3
- const INITIAL_STATE: {
4
- viewparts: { [name: string]: Viewpart }
5
- width: 'WIDE' | 'NARROW'
6
- } = {
7
- viewparts: {},
8
- width: 'WIDE'
9
- }
10
-
11
- const layout = (state = INITIAL_STATE, action: any) => {
12
- let viewparts = { ...state.viewparts }
13
-
14
- switch (action.type) {
15
- case APPEND_VIEWPART:
16
- return {
17
- ...state,
18
- viewparts: {
19
- ...state.viewparts,
20
- [action.name]: {
21
- ...action.viewpart,
22
- position: action.position
23
- }
24
- }
25
- }
26
-
27
- case REMOVE_VIEWPART:
28
- delete viewparts[action.name]
29
- return {
30
- ...state,
31
- viewparts
32
- }
33
-
34
- case UPDATE_VIEWPART:
35
- let viewpart = viewparts[action.name]
36
- if (!viewpart) {
37
- return state
38
- }
39
- let override = action.override || {}
40
-
41
- if (viewpart.temporary && override.show === false) {
42
- /* temporary viewpart는 show=false가 될 때, 제거되어야 한다. */
43
- delete viewparts[action.name]
44
- return {
45
- ...state,
46
- viewparts
47
- }
48
- } else {
49
- return {
50
- ...state,
51
- viewparts: {
52
- ...state.viewparts,
53
- [action.name]: {
54
- ...viewpart,
55
- ...action.override
56
- }
57
- }
58
- }
59
- }
60
-
61
- case UPDATE_VIEWPORT_WIDTH:
62
- return {
63
- ...state,
64
- width: action.width
65
- }
66
-
67
- default:
68
- return state
69
- }
70
- }
71
-
72
- export default layout
@@ -1,32 +0,0 @@
1
- import { CLOSE_SNACKBAR, OPEN_SNACKBAR, SnackbarAction } from '../actions/snackbar.js'
2
-
3
- const INITIAL_STATE = {
4
- snackbarOpened: false,
5
- level: '',
6
- message: '',
7
- action: {}
8
- }
9
-
10
- const snackbar = (state = INITIAL_STATE, action: SnackbarAction) => {
11
- switch (action.type) {
12
- case OPEN_SNACKBAR:
13
- return {
14
- ...state,
15
- snackbarOpened: true,
16
- level: action.level || 'info',
17
- message: action.message,
18
- action: {
19
- ...action.action
20
- }
21
- }
22
- case CLOSE_SNACKBAR:
23
- return {
24
- ...state,
25
- snackbarOpened: false
26
- }
27
- default:
28
- return state
29
- }
30
- }
31
-
32
- export default snackbar
package/tsconfig.json DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2018",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "noEmitOnError": true,
7
- "lib": ["es2017", "dom"],
8
- "strict": true,
9
- "esModuleInterop": false,
10
- "allowSyntheticDefaultImports": true,
11
- "experimentalDecorators": true,
12
- "useDefineForClassFields": false,
13
- "importHelpers": true,
14
- "outDir": "dist",
15
- "sourceMap": true,
16
- "inlineSources": true,
17
- "rootDir": "./",
18
- "declaration": true,
19
- "incremental": true,
20
- "skipLibCheck": true,
21
- "types": ["node", "mocha"]
22
- },
23
- "include": ["**/*.ts"]
24
- }
@@ -1,27 +0,0 @@
1
- // import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
2
-
3
- /** Use Hot Module replacement by adding --hmr to the start command */
4
- const hmr = process.argv.includes('--hmr');
5
-
6
- export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
7
- open: '/demo/',
8
- /** Use regular watch mode if HMR is not enabled. */
9
- watch: !hmr,
10
- /** Resolve bare module imports */
11
- nodeResolve: {
12
- exportConditions: ['browser', 'development'],
13
- },
14
-
15
- /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
16
- // esbuildTarget: 'auto'
17
-
18
- /** Set appIndex to enable SPA routing */
19
- // appIndex: 'demo/index.html',
20
-
21
- plugins: [
22
- /** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
23
- // hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
24
- ],
25
-
26
- // See documentation for all available options
27
- });
@@ -1,41 +0,0 @@
1
- // import { playwrightLauncher } from '@web/test-runner-playwright';
2
-
3
- const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
4
-
5
- export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
6
- /** Test files to run */
7
- files: 'dist/test/**/*.test.js',
8
-
9
- /** Resolve bare module imports */
10
- nodeResolve: {
11
- exportConditions: ['browser', 'development'],
12
- },
13
-
14
- /** Filter out lit dev mode logs */
15
- filterBrowserLogs(log) {
16
- for (const arg of log.args) {
17
- if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
18
- return false;
19
- }
20
- }
21
- return true;
22
- },
23
-
24
- /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
25
- // esbuildTarget: 'auto',
26
-
27
- /** Amount of browsers to run concurrently */
28
- // concurrentBrowsers: 2,
29
-
30
- /** Amount of test files per browser to test concurrently */
31
- // concurrency: 1,
32
-
33
- /** Browsers to run tests on */
34
- // browsers: [
35
- // playwrightLauncher({ product: 'chromium' }),
36
- // playwrightLauncher({ product: 'firefox' }),
37
- // playwrightLauncher({ product: 'webkit' }),
38
- // ],
39
-
40
- // See documentation for all available options
41
- });