@acorex/layout 6.5.26 → 6.5.27
Sign up to get free protection for your applications and to get access to all the features.
- package/karma.conf.js +32 -0
- package/ng-package.json +9 -0
- package/package.json +10 -30
- package/src/lib/widget-board/editors/widget-size-editor/widget-size.editor.html +6 -0
- package/src/lib/widget-board/editors/widget-size-editor/widget-size.editor.ts +55 -0
- package/src/lib/widget-board/editors/widget-size-editor/widget-size.module.ts +19 -0
- package/src/lib/widget-board/widget-board.component.html +7 -0
- package/src/lib/widget-board/widget-board.component.scss +200 -0
- package/src/lib/widget-board/widget-board.component.ts +521 -0
- package/src/lib/widget-board/widget-board.module.ts +74 -0
- package/src/lib/widget-board/widget-config.component.html +16 -0
- package/src/lib/widget-board/widget-config.component.ts +99 -0
- package/src/lib/widget-board/widget-host.component.html +30 -0
- package/src/lib/widget-board/widget-host.component.ts +350 -0
- package/src/lib/widget-board/widget-save.component.html +43 -0
- package/src/lib/widget-board/widget-save.component.ts +88 -0
- package/src/lib/widget-board/widget.class.ts +179 -0
- package/src/test.ts +28 -0
- package/tsconfig.lib.json +23 -0
- package/tsconfig.lib.prod.json +6 -0
- package/tsconfig.spec.json +17 -0
- package/tslint.json +17 -0
- package/acorex-layout.d.ts +0 -5
- package/esm2020/acorex-layout.mjs +0 -5
- package/esm2020/lib/widget-board/editors/widget-size-editor/widget-size.editor.mjs +0 -46
- package/esm2020/lib/widget-board/editors/widget-size-editor/widget-size.module.mjs +0 -21
- package/esm2020/lib/widget-board/widget-board.component.mjs +0 -450
- package/esm2020/lib/widget-board/widget-board.module.mjs +0 -111
- package/esm2020/lib/widget-board/widget-config.component.mjs +0 -82
- package/esm2020/lib/widget-board/widget-host.component.mjs +0 -295
- package/esm2020/lib/widget-board/widget-save.component.mjs +0 -79
- package/esm2020/lib/widget-board/widget.class.mjs +0 -127
- package/esm2020/public-api.mjs +0 -7
- package/fesm2015/acorex-layout.mjs +0 -1180
- package/fesm2015/acorex-layout.mjs.map +0 -1
- package/fesm2020/acorex-layout.mjs +0 -1173
- package/fesm2020/acorex-layout.mjs.map +0 -1
- package/lib/widget-board/editors/widget-size-editor/widget-size.editor.d.ts +0 -19
- package/lib/widget-board/editors/widget-size-editor/widget-size.module.d.ts +0 -10
- package/lib/widget-board/widget-board.component.d.ts +0 -61
- package/lib/widget-board/widget-board.module.d.ts +0 -18
- package/lib/widget-board/widget-config.component.d.ts +0 -23
- package/lib/widget-board/widget-host.component.d.ts +0 -52
- package/lib/widget-board/widget-save.component.d.ts +0 -19
- package/lib/widget-board/widget.class.d.ts +0 -58
- /package/{public-api.d.ts → src/public-api.ts} +0 -0
package/karma.conf.js
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
// Karma configuration file, see link for more information
|
2
|
+
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
3
|
+
|
4
|
+
module.exports = function (config) {
|
5
|
+
config.set({
|
6
|
+
basePath: '',
|
7
|
+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
8
|
+
plugins: [
|
9
|
+
require('karma-jasmine'),
|
10
|
+
require('karma-chrome-launcher'),
|
11
|
+
require('karma-jasmine-html-reporter'),
|
12
|
+
require('karma-coverage-istanbul-reporter'),
|
13
|
+
require('@angular-devkit/build-angular/plugins/karma')
|
14
|
+
],
|
15
|
+
client: {
|
16
|
+
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
17
|
+
},
|
18
|
+
coverageIstanbulReporter: {
|
19
|
+
dir: require('path').join(__dirname, '../../../coverage/acorex/layout'),
|
20
|
+
reports: ['html', 'lcovonly', 'text-summary'],
|
21
|
+
fixWebpackSourcePaths: true
|
22
|
+
},
|
23
|
+
reporters: ['progress', 'kjhtml'],
|
24
|
+
port: 9876,
|
25
|
+
colors: true,
|
26
|
+
logLevel: config.LOG_INFO,
|
27
|
+
autoWatch: true,
|
28
|
+
browsers: ['Chrome'],
|
29
|
+
singleRun: false,
|
30
|
+
restartOnFileChange: true
|
31
|
+
});
|
32
|
+
};
|
package/ng-package.json
ADDED
package/package.json
CHANGED
@@ -1,31 +1,11 @@
|
|
1
|
-
{
|
2
|
-
"name": "@acorex/layout",
|
3
|
-
"version": "6.5.
|
4
|
-
"peerDependencies": {
|
5
|
-
"@angular/common": "^13.3.8",
|
6
|
-
"@angular/core": "^13.3.8"
|
7
|
-
},
|
8
|
-
"dependencies": {
|
9
|
-
"tslib": "^2.0.0"
|
10
|
-
}
|
11
|
-
"module": "fesm2015/acorex-layout.mjs",
|
12
|
-
"es2020": "fesm2020/acorex-layout.mjs",
|
13
|
-
"esm2020": "esm2020/acorex-layout.mjs",
|
14
|
-
"fesm2020": "fesm2020/acorex-layout.mjs",
|
15
|
-
"fesm2015": "fesm2015/acorex-layout.mjs",
|
16
|
-
"typings": "acorex-layout.d.ts",
|
17
|
-
"exports": {
|
18
|
-
"./package.json": {
|
19
|
-
"default": "./package.json"
|
20
|
-
},
|
21
|
-
".": {
|
22
|
-
"types": "./acorex-layout.d.ts",
|
23
|
-
"esm2020": "./esm2020/acorex-layout.mjs",
|
24
|
-
"es2020": "./fesm2020/acorex-layout.mjs",
|
25
|
-
"es2015": "./fesm2015/acorex-layout.mjs",
|
26
|
-
"node": "./fesm2015/acorex-layout.mjs",
|
27
|
-
"default": "./fesm2020/acorex-layout.mjs"
|
28
|
-
}
|
29
|
-
},
|
30
|
-
"sideEffects": false
|
1
|
+
{
|
2
|
+
"name": "@acorex/layout",
|
3
|
+
"version": "6.5.27",
|
4
|
+
"peerDependencies": {
|
5
|
+
"@angular/common": "^13.3.8",
|
6
|
+
"@angular/core": "^13.3.8"
|
7
|
+
},
|
8
|
+
"dependencies": {
|
9
|
+
"tslib": "^2.0.0"
|
10
|
+
}
|
31
11
|
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<div style="display: grid;grid-gap: 2%; grid-template-columns: 49% 49%;">
|
2
|
+
<ax-number-box (onValueChanged)="handleMinValueChange($event)" [value]="sizeX" [min]="minX" [max]="maxX">
|
3
|
+
</ax-number-box>
|
4
|
+
<ax-number-box (onValueChanged)="handleMaxValueChange($event)" [value]="sizeY" [min]="minY" [max]="maxY">
|
5
|
+
</ax-number-box>
|
6
|
+
</div>
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { Component, OnInit, ChangeDetectorRef } from '@angular/core';
|
2
|
+
import { AXProperyEditorComponent } from '@acorex/components';
|
3
|
+
|
4
|
+
@Component({
|
5
|
+
templateUrl: './widget-size.editor.html'
|
6
|
+
})
|
7
|
+
export class AXWidgetSizePropertyEditorComponent extends AXProperyEditorComponent<number[]> {
|
8
|
+
|
9
|
+
sizeX: number;
|
10
|
+
sizeY: number;
|
11
|
+
|
12
|
+
minX: number = 1;
|
13
|
+
maxX: number = 10;
|
14
|
+
|
15
|
+
minY: number = 1;
|
16
|
+
maxY: number = 10;
|
17
|
+
|
18
|
+
|
19
|
+
constructor(protected cdr: ChangeDetectorRef) {
|
20
|
+
super(cdr);
|
21
|
+
}
|
22
|
+
|
23
|
+
ngOnInit() {
|
24
|
+
if (Array.isArray(this.value)) {
|
25
|
+
this.sizeX = this.value[0];
|
26
|
+
this.sizeY = this.value[1];
|
27
|
+
}
|
28
|
+
else {
|
29
|
+
this.sizeX = 2;
|
30
|
+
this.sizeY = 2;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
handleMinValueChange(e: any) {
|
35
|
+
this.sizeX = e.value;
|
36
|
+
|
37
|
+
if (this.sizeY > 0) {
|
38
|
+
super.handleValueChange([this.sizeX, this.sizeY]);
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
handleMaxValueChange(e: any) {
|
43
|
+
this.sizeY = e.value;
|
44
|
+
if (this.sizeX > 0) {
|
45
|
+
super.handleValueChange([this.sizeX, this.sizeY]);
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
ngAfterViewInit() {
|
52
|
+
this.onRenderCompleted.emit();
|
53
|
+
}
|
54
|
+
|
55
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { NgModule } from '@angular/core';
|
2
|
+
import { CommonModule } from '@angular/common';
|
3
|
+
import { FormsModule } from '@angular/forms';
|
4
|
+
|
5
|
+
import { AXWidgetSizePropertyEditorComponent } from './widget-size.editor';
|
6
|
+
import { AXNumberBoxModule } from '@acorex/components';
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
@NgModule({
|
12
|
+
declarations: [AXWidgetSizePropertyEditorComponent],
|
13
|
+
imports: [CommonModule, FormsModule, AXNumberBoxModule],
|
14
|
+
exports: [AXWidgetSizePropertyEditorComponent],
|
15
|
+
providers: []
|
16
|
+
})
|
17
|
+
export class AXWidgetSizePropertyEditorModule {
|
18
|
+
|
19
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<div class="widgets-container" [class.rtl]="rtl" #container>
|
2
|
+
<ax-widget-host *ngFor="let w of widgets;trackBy: trackByFn" [config]='w' [sizeX]="w.sizeX" [readonly]="readonly || w.readonly"
|
3
|
+
[sizeY]="w.sizeY" [col]="w.col" [row]="w.row" (onRemove)="handleOnRemove($event)" (onSave)="handleOnSave($event)"
|
4
|
+
(onConfigChanged)="handleOnConfigChanged($event)" (onResized)="handleOnResizedChanged($event)"
|
5
|
+
[provideValue]="provideValue">
|
6
|
+
</ax-widget-host>
|
7
|
+
</div>
|
@@ -0,0 +1,200 @@
|
|
1
|
+
.widget-board {
|
2
|
+
display: inline-block;
|
3
|
+
margin: 15px 20px 15px 20px;
|
4
|
+
min-width: calc(100% - 40px);
|
5
|
+
min-height: calc(100% - 34px);
|
6
|
+
--animate-duration: 0.5s;
|
7
|
+
background-repeat: no-repeat;
|
8
|
+
|
9
|
+
&.grid-background {
|
10
|
+
|
11
|
+
background-repeat: repeat !important;
|
12
|
+
.widgets-container {
|
13
|
+
.widget-host {
|
14
|
+
touch-action: none;
|
15
|
+
|
16
|
+
|
17
|
+
.widget-edit-overlay {
|
18
|
+
display: block;
|
19
|
+
cursor: move;
|
20
|
+
}
|
21
|
+
|
22
|
+
&.widget-dragging {
|
23
|
+
z-index: 1000;
|
24
|
+
}
|
25
|
+
|
26
|
+
&:focus {
|
27
|
+
outline-width: 1px;
|
28
|
+
outline-style: solid;
|
29
|
+
outline-color: var(--ax-primary-color);
|
30
|
+
}
|
31
|
+
|
32
|
+
touch-action: none;
|
33
|
+
user-select: none;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
.widget-blank-placeholder {
|
38
|
+
background: var(--ax-primary-trans-light-color);
|
39
|
+
position: absolute;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
.widgets-container {
|
44
|
+
position: relative;
|
45
|
+
touch-action: none;
|
46
|
+
|
47
|
+
|
48
|
+
&.rtl {
|
49
|
+
.widget-host {
|
50
|
+
.widget-options-menu {
|
51
|
+
right: unset !important;
|
52
|
+
left: 0 !important;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
.widget-host {
|
59
|
+
position: absolute;
|
60
|
+
background: #fff;
|
61
|
+
box-shadow: 2px 2px 3px #dadada;
|
62
|
+
z-index: 0;
|
63
|
+
|
64
|
+
.widget-content {
|
65
|
+
width: 100%;
|
66
|
+
height: 100%;
|
67
|
+
display: flex;
|
68
|
+
flex-direction: column;
|
69
|
+
|
70
|
+
.widget-title {
|
71
|
+
padding: var(--ax-size-md);
|
72
|
+
text-align: start;
|
73
|
+
font-size: 1.5em;
|
74
|
+
position: absolute;
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
|
79
|
+
.widget-edit-loading {
|
80
|
+
display: none;
|
81
|
+
background: rgba(255, 255, 255, .85);
|
82
|
+
position: absolute;
|
83
|
+
width: 100%;
|
84
|
+
height: 100%;
|
85
|
+
top: 0;
|
86
|
+
left: 0;
|
87
|
+
z-index: 2;
|
88
|
+
display: flex;
|
89
|
+
}
|
90
|
+
|
91
|
+
.widget-config-overlay {
|
92
|
+
position: absolute;
|
93
|
+
background: rgba(255, 255, 255, 1);
|
94
|
+
width: 100%;
|
95
|
+
height: 100%;
|
96
|
+
top: 0;
|
97
|
+
left: 0;
|
98
|
+
z-index: 1;
|
99
|
+
padding: var(--ax-size-md);
|
100
|
+
cursor: pointer;
|
101
|
+
|
102
|
+
&:hover {
|
103
|
+
.widget-title {
|
104
|
+
text-decoration: underline;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
.widget-title {
|
111
|
+
text-align: start;
|
112
|
+
font-size: 1.5em;
|
113
|
+
}
|
114
|
+
|
115
|
+
.widget-config-box {
|
116
|
+
align-self: center;
|
117
|
+
text-align: center;
|
118
|
+
position: absolute;
|
119
|
+
top: 50%;
|
120
|
+
left: 50%;
|
121
|
+
transform: translate(-50%, -50%);
|
122
|
+
color: var(--ax-gray-dark-color);
|
123
|
+
|
124
|
+
|
125
|
+
.config-title {
|
126
|
+
font-size: 1.2em;
|
127
|
+
margin-bottom: var(--ax-size-md);
|
128
|
+
}
|
129
|
+
|
130
|
+
.config-icon {}
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
.widget-edit-overlay {
|
135
|
+
display: none;
|
136
|
+
background: rgba(255, 255, 255, .5);
|
137
|
+
position: absolute;
|
138
|
+
width: 100%;
|
139
|
+
height: 100%;
|
140
|
+
top: 0;
|
141
|
+
left: 0;
|
142
|
+
z-index: 10;
|
143
|
+
|
144
|
+
.widget-edit-menu {
|
145
|
+
margin: 6px;
|
146
|
+
text-align: end;
|
147
|
+
float: inline-end;
|
148
|
+
opacity: 1;
|
149
|
+
transition: opacity 1s ease;
|
150
|
+
|
151
|
+
.widget-edit-menu-button {
|
152
|
+
display: inline-block;
|
153
|
+
background-color: #f0f0f0;
|
154
|
+
border-radius: 1px;
|
155
|
+
border: 2px solid #fff;
|
156
|
+
box-sizing: border-box;
|
157
|
+
-webkit-box-sizing: border-box;
|
158
|
+
-moz-box-sizing: border-box;
|
159
|
+
padding: 0;
|
160
|
+
height: 32px;
|
161
|
+
width: 32px;
|
162
|
+
cursor: pointer;
|
163
|
+
color: #666;
|
164
|
+
|
165
|
+
&:hover {
|
166
|
+
border-color: #a6a6a6;
|
167
|
+
background-color: #c8c8c8;
|
168
|
+
}
|
169
|
+
}
|
170
|
+
}
|
171
|
+
}
|
172
|
+
|
173
|
+
.widget-options-menu {
|
174
|
+
display: none;
|
175
|
+
position: absolute;
|
176
|
+
top: 0;
|
177
|
+
right: 0;
|
178
|
+
z-index: 2;
|
179
|
+
cursor: pointer;
|
180
|
+
padding: 2px 5px;
|
181
|
+
|
182
|
+
&:hover {
|
183
|
+
background-color: #f0f0f0;
|
184
|
+
}
|
185
|
+
}
|
186
|
+
|
187
|
+
.widget-container {
|
188
|
+
padding: 1px;
|
189
|
+
height: 100%;
|
190
|
+
|
191
|
+
&:hover {
|
192
|
+
.widget-options-menu {
|
193
|
+
display: block;
|
194
|
+
}
|
195
|
+
}
|
196
|
+
}
|
197
|
+
}
|
198
|
+
|
199
|
+
}
|
200
|
+
}
|