@qtoggle/qui 0.0.0
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/.eslintignore +2 -0
- package/.eslintrc.json +492 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +33 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
- package/.github/ISSUE_TEMPLATE/improvement_proposal.md +20 -0
- package/.github/workflows/main.yml +74 -0
- package/.pre-commit-config.yaml +8 -0
- package/LICENSE.txt +177 -0
- package/README.md +4 -0
- package/font/dejavusans-bold.woff +0 -0
- package/font/dejavusans-bolditalic.woff +0 -0
- package/font/dejavusans-italic.woff +0 -0
- package/font/dejavusans-regular.woff +0 -0
- package/img/qui-icons.svg +1937 -0
- package/js/base/base.js +47 -0
- package/js/base/condition-variable.js +92 -0
- package/js/base/errors.js +36 -0
- package/js/base/i18n.js +20 -0
- package/js/base/mixwith.js +135 -0
- package/js/base/require-js-compat.js +78 -0
- package/js/base/signal.js +91 -0
- package/js/base/singleton.js +66 -0
- package/js/base/timer.js +126 -0
- package/js/config.js +184 -0
- package/js/forms/common-fields/check-field.js +42 -0
- package/js/forms/common-fields/choice-buttons-field.js +30 -0
- package/js/forms/common-fields/color-combo-field.js +37 -0
- package/js/forms/common-fields/combo-field.js +108 -0
- package/js/forms/common-fields/common-fields.js +23 -0
- package/js/forms/common-fields/composite-field.js +132 -0
- package/js/forms/common-fields/custom-html-field.js +51 -0
- package/js/forms/common-fields/email-field.js +30 -0
- package/js/forms/common-fields/file-picker-field.js +46 -0
- package/js/forms/common-fields/jquery-ui-field.js +111 -0
- package/js/forms/common-fields/labels-field.js +69 -0
- package/js/forms/common-fields/numeric-field.js +39 -0
- package/js/forms/common-fields/password-field.js +28 -0
- package/js/forms/common-fields/phone-field.js +26 -0
- package/js/forms/common-fields/progress-disk-field.js +69 -0
- package/js/forms/common-fields/push-button-field.js +138 -0
- package/js/forms/common-fields/slider-field.js +51 -0
- package/js/forms/common-fields/text-area-field.js +34 -0
- package/js/forms/common-fields/text-field.js +89 -0
- package/js/forms/common-fields/up-down-field.js +85 -0
- package/js/forms/common-forms/common-forms.js +16 -0
- package/js/forms/common-forms/options-form.js +77 -0
- package/js/forms/common-forms/page-form.js +115 -0
- package/js/forms/form-button.js +202 -0
- package/js/forms/form-field.js +1183 -0
- package/js/forms/form.js +1181 -0
- package/js/forms/forms.js +68 -0
- package/js/global-glass.js +100 -0
- package/js/icons/default-stock.js +173 -0
- package/js/icons/icon.js +64 -0
- package/js/icons/icons.js +16 -0
- package/js/icons/multi-state-sprites-icon.js +362 -0
- package/js/icons/stock-icon.js +219 -0
- package/js/icons/stock.js +98 -0
- package/js/icons/stocks.js +57 -0
- package/js/index.js +232 -0
- package/js/lib/jquery.longpress.js +79 -0
- package/js/lib/jquery.module.js +4 -0
- package/js/lib/logger.module.js +4 -0
- package/js/lib/pep.module.js +4 -0
- package/js/lists/common-items/common-items.js +5 -0
- package/js/lists/common-items/icon-label-list-item.js +86 -0
- package/js/lists/common-lists/common-lists.js +5 -0
- package/js/lists/common-lists/page-list.js +53 -0
- package/js/lists/list-item.js +147 -0
- package/js/lists/list.js +636 -0
- package/js/lists/lists.js +26 -0
- package/js/main-ui/main-ui.js +64 -0
- package/js/main-ui/menu-bar.js +144 -0
- package/js/main-ui/options-bar.js +181 -0
- package/js/main-ui/status.js +185 -0
- package/js/main-ui/top-bar.js +59 -0
- package/js/messages/common-message-forms/common-message-forms.js +7 -0
- package/js/messages/common-message-forms/confirm-message-form.js +81 -0
- package/js/messages/common-message-forms/simple-message-form.js +67 -0
- package/js/messages/common-message-forms/sticky-simple-message-form.js +27 -0
- package/js/messages/message-form.js +107 -0
- package/js/messages/messages.js +21 -0
- package/js/messages/sticky-modal-page.js +98 -0
- package/js/messages/sticky-modal-progress-message.js +27 -0
- package/js/messages/toast.js +164 -0
- package/js/navigation.js +654 -0
- package/js/pages/breadcrumbs.js +124 -0
- package/js/pages/common-pages/common-pages.js +6 -0
- package/js/pages/common-pages/modal-progress-page.js +83 -0
- package/js/pages/common-pages/structured-page.js +46 -0
- package/js/pages/page.js +1018 -0
- package/js/pages/pages-context.js +154 -0
- package/js/pages/pages.js +252 -0
- package/js/pwa.js +337 -0
- package/js/sections/section.js +612 -0
- package/js/sections/sections.js +300 -0
- package/js/tables/common-cells/common-cells.js +7 -0
- package/js/tables/common-cells/icon-label-table-cell.js +68 -0
- package/js/tables/common-cells/push-button-table-cell.js +133 -0
- package/js/tables/common-cells/simple-table-cell.js +37 -0
- package/js/tables/common-tables/common-tables.js +5 -0
- package/js/tables/common-tables/page-table.js +55 -0
- package/js/tables/table-cell.js +198 -0
- package/js/tables/table-row.js +126 -0
- package/js/tables/table.js +492 -0
- package/js/tables/tables.js +36 -0
- package/js/theme.js +304 -0
- package/js/utils/ajax.js +126 -0
- package/js/utils/array.js +194 -0
- package/js/utils/colors.js +445 -0
- package/js/utils/cookies.js +65 -0
- package/js/utils/crypto.js +439 -0
- package/js/utils/css.js +234 -0
- package/js/utils/date.js +300 -0
- package/js/utils/files.js +27 -0
- package/js/utils/gestures.js +165 -0
- package/js/utils/html.js +76 -0
- package/js/utils/misc.js +81 -0
- package/js/utils/object.js +324 -0
- package/js/utils/promise.js +49 -0
- package/js/utils/string.js +192 -0
- package/js/utils/url.js +187 -0
- package/js/utils/utils.js +3 -0
- package/js/utils/visibility-manager.js +211 -0
- package/js/views/common-views/common-views.js +7 -0
- package/js/views/common-views/icon-label-view.js +210 -0
- package/js/views/common-views/progress-view.js +89 -0
- package/js/views/common-views/structured-view.js +368 -0
- package/js/views/view.js +467 -0
- package/js/views/views.js +3 -0
- package/js/widgets/base-widget.js +23 -0
- package/js/widgets/common-widgets/check-button.js +109 -0
- package/js/widgets/common-widgets/choice-buttons.js +322 -0
- package/js/widgets/common-widgets/color-combo.js +104 -0
- package/js/widgets/common-widgets/combo.js +645 -0
- package/js/widgets/common-widgets/common-widgets.js +17 -0
- package/js/widgets/common-widgets/email-input.js +7 -0
- package/js/widgets/common-widgets/file-picker.js +133 -0
- package/js/widgets/common-widgets/labels.js +132 -0
- package/js/widgets/common-widgets/numeric-input.js +49 -0
- package/js/widgets/common-widgets/password-input.js +91 -0
- package/js/widgets/common-widgets/phone-input.js +7 -0
- package/js/widgets/common-widgets/progress-disk.js +174 -0
- package/js/widgets/common-widgets/push-button.js +155 -0
- package/js/widgets/common-widgets/slider.js +455 -0
- package/js/widgets/common-widgets/text-area.js +52 -0
- package/js/widgets/common-widgets/text-input.js +174 -0
- package/js/widgets/common-widgets/up-down.js +351 -0
- package/js/widgets/widgets.js +57 -0
- package/js/window.js +557 -0
- package/jsdoc.conf.json +20 -0
- package/less/base.less +123 -0
- package/less/forms/common-fields.less +101 -0
- package/less/forms/common-forms.less +5 -0
- package/less/forms/form-button.less +21 -0
- package/less/forms/form-field.less +266 -0
- package/less/forms/form.less +131 -0
- package/less/global-glass.less +64 -0
- package/less/icon-label-view.less +82 -0
- package/less/icons.less +144 -0
- package/less/lists.less +105 -0
- package/less/main-ui.less +328 -0
- package/less/messages.less +189 -0
- package/less/no-effects.less +24 -0
- package/less/pages/breadcrumbs.less +98 -0
- package/less/pages/common-pages.less +36 -0
- package/less/pages/page.less +70 -0
- package/less/progress-view.less +51 -0
- package/less/stock-icons.less +43 -0
- package/less/structured-view.less +245 -0
- package/less/tables.less +84 -0
- package/less/theme-dark.less +133 -0
- package/less/theme-light.less +132 -0
- package/less/theme.less +419 -0
- package/less/visibility-manager.less +11 -0
- package/less/widgets/check-button.less +96 -0
- package/less/widgets/choice-buttons.less +160 -0
- package/less/widgets/color-combo.less +33 -0
- package/less/widgets/combo.less +230 -0
- package/less/widgets/common-buttons.less +120 -0
- package/less/widgets/common.less +24 -0
- package/less/widgets/input.less +258 -0
- package/less/widgets/labels.less +81 -0
- package/less/widgets/progress-disk.less +70 -0
- package/less/widgets/slider.less +199 -0
- package/less/widgets/updown.less +115 -0
- package/less/widgets/various.less +36 -0
- package/package.json +47 -0
- package/pyproject.toml +45 -0
- package/qui/__init__.py +110 -0
- package/qui/constants.py +1 -0
- package/qui/exceptions.py +2 -0
- package/qui/j2template.py +71 -0
- package/qui/settings.py +60 -0
- package/qui/templates/manifest.json +25 -0
- package/qui/templates/qui.html +126 -0
- package/qui/templates/service-worker.js +188 -0
- package/qui/web/__init__.py +0 -0
- package/qui/web/tornado.py +220 -0
- package/scripts/postinstall.sh +10 -0
- package/webpack/webpack-adjust-css-urls-loader.js +36 -0
- package/webpack/webpack-common.js +384 -0
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
|
|
2
|
+
import $ from '$qui/lib/jquery.module.js'
|
|
3
|
+
import Logger from '$qui/lib/logger.module.js'
|
|
4
|
+
|
|
5
|
+
import {Mixin} from '$qui/base/mixwith.js'
|
|
6
|
+
import StockIcon from '$qui/icons/stock-icon.js'
|
|
7
|
+
import VisibilityManager from '$qui/utils/visibility-manager.js'
|
|
8
|
+
import * as Window from '$qui/window.js'
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const logger = Logger.get('qui.views.commonviews.structuredview')
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/** @lends qui.views.commonviews.StructuredViewMixin */
|
|
15
|
+
const StructuredViewMixin = Mixin((superclass = Object) => {
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A view with top, body and bottom elements. Designed to be mixed together with {@link qui.views.ViewMixin}.
|
|
19
|
+
* @alias qui.views.commonviews.StructuredViewMixin
|
|
20
|
+
* @mixin
|
|
21
|
+
*/
|
|
22
|
+
class StructuredViewMixin extends superclass {
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @constructs
|
|
26
|
+
* @param {?String} [title] view title (set to `null` if you don't want a view top at all)
|
|
27
|
+
* @param {qui.icons.Icon} [icon] view icon
|
|
28
|
+
* @param {Boolean} [minimizable] indicates that the view should be minimizable by clicking on its top bar
|
|
29
|
+
* (defaults to `false`)
|
|
30
|
+
* @param {Boolean} [minimized] indicates that the view should be initially minimized (defaults to `false`)
|
|
31
|
+
* @param {Boolean} [largeTop] indicates that the view top bar should be larger (defaults to `true`)
|
|
32
|
+
* @param {Boolean} [topless] indicates that the view should not have a top bar (defaults to `false`)
|
|
33
|
+
* @param {Boolean} [closable] set to `true` to display a close button on the top bar (defaults to `false`,
|
|
34
|
+
* ignored when `minimizable` is `true`)
|
|
35
|
+
* @param {...*} args parent class parameters
|
|
36
|
+
*/
|
|
37
|
+
constructor({
|
|
38
|
+
title = null,
|
|
39
|
+
icon = null,
|
|
40
|
+
minimizable = false,
|
|
41
|
+
minimized = false,
|
|
42
|
+
largeTop = true,
|
|
43
|
+
topless = false,
|
|
44
|
+
closable = false,
|
|
45
|
+
...args
|
|
46
|
+
} = {}) {
|
|
47
|
+
super(args)
|
|
48
|
+
|
|
49
|
+
this._title = title
|
|
50
|
+
this._icon = icon
|
|
51
|
+
this._minimizable = minimizable
|
|
52
|
+
this._minimized = minimized
|
|
53
|
+
this._largeTop = largeTop
|
|
54
|
+
this._topless = topless
|
|
55
|
+
this._closable = closable
|
|
56
|
+
|
|
57
|
+
this._topDiv = null
|
|
58
|
+
this._bodyDiv = null
|
|
59
|
+
this._bottomDiv = null
|
|
60
|
+
this._bodyVisibilityManager = null
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/* HTML */
|
|
65
|
+
|
|
66
|
+
initHTML(html) {
|
|
67
|
+
html.addClass('qui-structured-view')
|
|
68
|
+
|
|
69
|
+
this._topDiv = this._makeTop()
|
|
70
|
+
html.append(this._topDiv)
|
|
71
|
+
|
|
72
|
+
if (!this._icon) {
|
|
73
|
+
html.addClass('iconless')
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (this._largeTop) {
|
|
77
|
+
html.addClass('large-top')
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (this._topless) {
|
|
81
|
+
html.addClass('topless')
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (this._closable) {
|
|
85
|
+
html.addClass('closable')
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (this._minimizable) {
|
|
89
|
+
html.addClass('minimizable')
|
|
90
|
+
this._topDiv.addClass('qui-base-button')
|
|
91
|
+
this._topDiv.on('click', function () {
|
|
92
|
+
this.toggleMinimized()
|
|
93
|
+
}.bind(this))
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
this._bodyDiv = this.makeBody()
|
|
97
|
+
this._bodyDiv.addClass('qui-structured-view-body')
|
|
98
|
+
|
|
99
|
+
this._bodyVisibilityManager = new VisibilityManager({
|
|
100
|
+
element: this._bodyDiv,
|
|
101
|
+
heightTransition: true
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
html.append(this._bodyDiv)
|
|
105
|
+
|
|
106
|
+
if (this._minimizable) {
|
|
107
|
+
if (this._minimized) {
|
|
108
|
+
this._bodyVisibilityManager.hideElement()
|
|
109
|
+
html.addClass('minimized')
|
|
110
|
+
}
|
|
111
|
+
else if (this._topDiv) {
|
|
112
|
+
this._topDiv.addClass('selected')
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
this._bottomDiv = this.makeBottom()
|
|
117
|
+
if (this._bottomDiv) {
|
|
118
|
+
this._bottomDiv.addClass('qui-structured-view-bottom')
|
|
119
|
+
html.append(this._bottomDiv)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
_makeTop() {
|
|
124
|
+
let topDiv = $('<div></div>', {class: 'qui-structured-view-top'})
|
|
125
|
+
let iconDiv = $('<div></div>', {class: 'qui-structured-view-icon'})
|
|
126
|
+
topDiv.append(iconDiv)
|
|
127
|
+
|
|
128
|
+
if (this._icon) {
|
|
129
|
+
this.prepareIcon(this._icon).applyTo(iconDiv)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
let titleSpan = $('<span></span>', {class: 'qui-structured-view-title'})
|
|
133
|
+
titleSpan.text(this._title || '')
|
|
134
|
+
topDiv.append(titleSpan)
|
|
135
|
+
|
|
136
|
+
if (this._minimizable) {
|
|
137
|
+
let minimizeIconDiv = $('<div></div>', {class: 'qui-structured-view-minimize-button'})
|
|
138
|
+
|
|
139
|
+
new StockIcon({
|
|
140
|
+
name: 'fat-arrow', variant: 'interactive', activeVariant: 'white', selectedVariant: 'white'
|
|
141
|
+
}).alter({scale: this._largeTop ? 1 : 0.75}).applyTo(minimizeIconDiv)
|
|
142
|
+
|
|
143
|
+
topDiv.append(minimizeIconDiv)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (this._closable && !this._minimizable) {
|
|
147
|
+
let closeIconDiv = $('<div></div>', {class: 'qui-base-button qui-structured-view-close-button'})
|
|
148
|
+
|
|
149
|
+
new StockIcon({
|
|
150
|
+
name: 'close', variant: 'interactive',
|
|
151
|
+
activeVariant: 'interactive-active', selectedVariant: 'interactive'
|
|
152
|
+
}).alter({scale: this._largeTop ? 1 : 0.75}).applyTo(closeIconDiv)
|
|
153
|
+
|
|
154
|
+
topDiv.append(closeIconDiv)
|
|
155
|
+
|
|
156
|
+
closeIconDiv.on('click', function () {
|
|
157
|
+
this.close().catch().then(function () {
|
|
158
|
+
logger.debug('breadcrumb navigation cancelled by rejected page close')
|
|
159
|
+
})
|
|
160
|
+
}.bind(this))
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return topDiv
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Implement this method to create the actual body of the view.
|
|
168
|
+
* @abstract
|
|
169
|
+
* @returns {jQuery}
|
|
170
|
+
*/
|
|
171
|
+
makeBody() {
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Implement this method to create the bottom part of the view.
|
|
176
|
+
* @returns {jQuery}
|
|
177
|
+
*/
|
|
178
|
+
makeBottom() {
|
|
179
|
+
return null
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Return the top element.
|
|
184
|
+
* @returns {jQuery}
|
|
185
|
+
*/
|
|
186
|
+
getTop() {
|
|
187
|
+
/* Make sure the HTML is created */
|
|
188
|
+
this.getHTML()
|
|
189
|
+
|
|
190
|
+
return this._topDiv
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Return the body element.
|
|
195
|
+
* @returns {jQuery}
|
|
196
|
+
*/
|
|
197
|
+
getBody() {
|
|
198
|
+
/* Make sure the HTML is created */
|
|
199
|
+
this.getHTML()
|
|
200
|
+
|
|
201
|
+
return this._bodyDiv
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Return the bottom element.
|
|
206
|
+
* @returns {?jQuery}
|
|
207
|
+
*/
|
|
208
|
+
getBottom() {
|
|
209
|
+
/* Make sure the HTML is created */
|
|
210
|
+
this.getHTML()
|
|
211
|
+
|
|
212
|
+
return this._bottomDiv
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
/* Title and icon */
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Return the view title.
|
|
220
|
+
* @returns {?String}
|
|
221
|
+
*/
|
|
222
|
+
getTitle() {
|
|
223
|
+
return this._title
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Set the view title.
|
|
228
|
+
* @param {String} title the new title
|
|
229
|
+
*/
|
|
230
|
+
setTitle(title) {
|
|
231
|
+
this._title = title
|
|
232
|
+
this.getTop().children('span.qui-structured-view-title').html(title || '')
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Return the view icon.
|
|
237
|
+
* @returns {qui.icons.Icon}
|
|
238
|
+
*/
|
|
239
|
+
getIcon() {
|
|
240
|
+
return this._icon
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Set the view icon.
|
|
245
|
+
* @param {?qui.icons.Icon} icon the new icon (`null` to disable icon)
|
|
246
|
+
*/
|
|
247
|
+
setIcon(icon) {
|
|
248
|
+
this._icon = icon
|
|
249
|
+
let iconDiv = this.getTop().children('div.qui-structured-view-icon')
|
|
250
|
+
if (this._icon) {
|
|
251
|
+
this.getHTML().removeClass('iconless')
|
|
252
|
+
this.prepareIcon(this._icon).applyTo(iconDiv)
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
this.getHTML().addClass('iconless')
|
|
256
|
+
iconDiv.html('')
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Prepare the view icon, altering its attributes as needed, before applying it.
|
|
262
|
+
* @param {qui.icons.Icon} icon
|
|
263
|
+
* @returns {qui.icons.Icon}
|
|
264
|
+
*/
|
|
265
|
+
prepareIcon(icon) {
|
|
266
|
+
if (!(icon instanceof StockIcon)) {
|
|
267
|
+
return icon
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (this._minimizable) {
|
|
271
|
+
icon = icon.alterDefault({
|
|
272
|
+
variant: 'interactive',
|
|
273
|
+
activeVariant: 'white',
|
|
274
|
+
selectedVariant: 'white'
|
|
275
|
+
})
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
icon = icon.alterDefault({variant: Window.isSmallScreen() ? 'white' : 'foreground'})
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return icon
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
/* Minimization */
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Minimize the view.
|
|
289
|
+
*/
|
|
290
|
+
minimize() {
|
|
291
|
+
if (this._minimized) {
|
|
292
|
+
return
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
this._minimized = true
|
|
296
|
+
|
|
297
|
+
this.getHTML().addClass('minimized')
|
|
298
|
+
this.getTop().removeClass('selected')
|
|
299
|
+
this._bodyVisibilityManager.hideElement()
|
|
300
|
+
|
|
301
|
+
this.onMinimize()
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Restore the view's minimization to normal state.
|
|
306
|
+
*/
|
|
307
|
+
unminimize() {
|
|
308
|
+
if (!this._minimized) {
|
|
309
|
+
return
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
this._minimized = false
|
|
313
|
+
|
|
314
|
+
this.getHTML().removeClass('minimized')
|
|
315
|
+
this.getTop().addClass('selected')
|
|
316
|
+
this._bodyVisibilityManager.showElement()
|
|
317
|
+
|
|
318
|
+
this.onUnminimize()
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Toggle the view's minimization state.
|
|
323
|
+
*/
|
|
324
|
+
toggleMinimized() {
|
|
325
|
+
if (this.isMinimized()) {
|
|
326
|
+
this.unminimize()
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
this.minimize()
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Tell if the view is minimized or not.
|
|
335
|
+
* @returns {Boolean}
|
|
336
|
+
*/
|
|
337
|
+
isMinimized() {
|
|
338
|
+
return this._minimized
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Tell if the view is minimizable or not.
|
|
343
|
+
* @returns {Boolean}
|
|
344
|
+
*/
|
|
345
|
+
isMinimizable() {
|
|
346
|
+
return this._minimizable
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Called when the view is minimized.
|
|
351
|
+
*/
|
|
352
|
+
onMinimize() {
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Called when the view is unminimized.
|
|
357
|
+
*/
|
|
358
|
+
onUnminimize() {
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return StructuredViewMixin
|
|
364
|
+
|
|
365
|
+
})
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
export default StructuredViewMixin
|