brew-js-react 0.1.0-beta
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/README.md +5 -0
- package/app.js +11 -0
- package/dialog.d.ts +33 -0
- package/dialog.js +83 -0
- package/dist/brew-js-react.js +1060 -0
- package/dist/brew-js-react.js.map +1 -0
- package/dist/brew-js-react.min.js +2 -0
- package/dist/brew-js-react.min.js.map +1 -0
- package/entry.js +2 -0
- package/hooks.d.ts +20 -0
- package/hooks.js +34 -0
- package/include/zeta-dom/dom.js +3 -0
- package/include/zeta-dom/domUtil.js +1 -0
- package/include/zeta-dom/events.js +1 -0
- package/include/zeta-dom/util.js +1 -0
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/mixin.d.ts +48 -0
- package/mixin.js +64 -0
- package/mixins/AnimateMixin.d.ts +9 -0
- package/mixins/AnimateMixin.js +31 -0
- package/mixins/AnimateSequenceItemMixin.d.ts +5 -0
- package/mixins/AnimateSequenceItemMixin.js +15 -0
- package/mixins/AnimateSequenceMixin.d.ts +6 -0
- package/mixins/AnimateSequenceMixin.js +29 -0
- package/mixins/ClassNameMixin.d.ts +12 -0
- package/mixins/ClassNameMixin.js +41 -0
- package/mixins/FlyoutMixin.d.ts +14 -0
- package/mixins/FlyoutMixin.js +95 -0
- package/mixins/FocusStateMixin.d.ts +3 -0
- package/mixins/FocusStateMixin.js +24 -0
- package/mixins/LoadingStateMixin.d.ts +3 -0
- package/mixins/LoadingStateMixin.js +27 -0
- package/mixins/Mixin.d.ts +47 -0
- package/mixins/Mixin.js +61 -0
- package/mixins/ScrollableMixin.d.ts +17 -0
- package/mixins/ScrollableMixin.js +46 -0
- package/mixins/StatefulMixin.d.ts +23 -0
- package/mixins/StatefulMixin.js +71 -0
- package/mixins/StaticAttributeMixin.d.ts +5 -0
- package/mixins/StaticAttributeMixin.js +13 -0
- package/package.json +46 -0
- package/view.d.ts +33 -0
- package/view.js +92 -0
|
@@ -0,0 +1,1060 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory(require("react"), require("react-dom"), require("brew-js"), require("zeta-dom"), require("zeta-dom-react"));
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define("brew-js-react", ["react", "react-dom", "brew-js", "zeta-dom", "zeta-dom-react"], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["brew-js-react"] = factory(require("react"), require("react-dom"), require("brew-js"), require("zeta-dom"), require("zeta-dom-react"));
|
|
8
|
+
else
|
|
9
|
+
root["brew-js-react"] = factory(root["React"], root["ReactDOM"], root["brew"], root["zeta"], root["zeta-dom-react"]);
|
|
10
|
+
})(self, function(__WEBPACK_EXTERNAL_MODULE__359__, __WEBPACK_EXTERNAL_MODULE__318__, __WEBPACK_EXTERNAL_MODULE__80__, __WEBPACK_EXTERNAL_MODULE__654__, __WEBPACK_EXTERNAL_MODULE__103__) {
|
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ "use strict";
|
|
13
|
+
/******/ var __webpack_modules__ = ({
|
|
14
|
+
|
|
15
|
+
/***/ 103:
|
|
16
|
+
/***/ ((module) => {
|
|
17
|
+
|
|
18
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__103__;
|
|
19
|
+
|
|
20
|
+
/***/ }),
|
|
21
|
+
|
|
22
|
+
/***/ 80:
|
|
23
|
+
/***/ ((module) => {
|
|
24
|
+
|
|
25
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__80__;
|
|
26
|
+
|
|
27
|
+
/***/ }),
|
|
28
|
+
|
|
29
|
+
/***/ 359:
|
|
30
|
+
/***/ ((module) => {
|
|
31
|
+
|
|
32
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__359__;
|
|
33
|
+
|
|
34
|
+
/***/ }),
|
|
35
|
+
|
|
36
|
+
/***/ 318:
|
|
37
|
+
/***/ ((module) => {
|
|
38
|
+
|
|
39
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__318__;
|
|
40
|
+
|
|
41
|
+
/***/ }),
|
|
42
|
+
|
|
43
|
+
/***/ 654:
|
|
44
|
+
/***/ ((module) => {
|
|
45
|
+
|
|
46
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__654__;
|
|
47
|
+
|
|
48
|
+
/***/ })
|
|
49
|
+
|
|
50
|
+
/******/ });
|
|
51
|
+
/************************************************************************/
|
|
52
|
+
/******/ // The module cache
|
|
53
|
+
/******/ var __webpack_module_cache__ = {};
|
|
54
|
+
/******/
|
|
55
|
+
/******/ // The require function
|
|
56
|
+
/******/ function __webpack_require__(moduleId) {
|
|
57
|
+
/******/ // Check if module is in cache
|
|
58
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
59
|
+
/******/ if (cachedModule !== undefined) {
|
|
60
|
+
/******/ return cachedModule.exports;
|
|
61
|
+
/******/ }
|
|
62
|
+
/******/ // Create a new module (and put it into the cache)
|
|
63
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
64
|
+
/******/ // no module.id needed
|
|
65
|
+
/******/ // no module.loaded needed
|
|
66
|
+
/******/ exports: {}
|
|
67
|
+
/******/ };
|
|
68
|
+
/******/
|
|
69
|
+
/******/ // Execute the module function
|
|
70
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
71
|
+
/******/
|
|
72
|
+
/******/ // Return the exports of the module
|
|
73
|
+
/******/ return module.exports;
|
|
74
|
+
/******/ }
|
|
75
|
+
/******/
|
|
76
|
+
/************************************************************************/
|
|
77
|
+
/******/ /* webpack/runtime/define property getters */
|
|
78
|
+
/******/ (() => {
|
|
79
|
+
/******/ // define getter functions for harmony exports
|
|
80
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
81
|
+
/******/ for(var key in definition) {
|
|
82
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
83
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
84
|
+
/******/ }
|
|
85
|
+
/******/ }
|
|
86
|
+
/******/ };
|
|
87
|
+
/******/ })();
|
|
88
|
+
/******/
|
|
89
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
90
|
+
/******/ (() => {
|
|
91
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
92
|
+
/******/ })();
|
|
93
|
+
/******/
|
|
94
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
95
|
+
/******/ (() => {
|
|
96
|
+
/******/ // define __esModule on exports
|
|
97
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
98
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
99
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
100
|
+
/******/ }
|
|
101
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
102
|
+
/******/ };
|
|
103
|
+
/******/ })();
|
|
104
|
+
/******/
|
|
105
|
+
/************************************************************************/
|
|
106
|
+
var __webpack_exports__ = {};
|
|
107
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
108
|
+
(() => {
|
|
109
|
+
|
|
110
|
+
// EXPORTS
|
|
111
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
112
|
+
"default": () => (/* binding */ entry)
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// NAMESPACE OBJECT: ./src/index.js
|
|
116
|
+
var src_namespaceObject = {};
|
|
117
|
+
__webpack_require__.r(src_namespaceObject);
|
|
118
|
+
__webpack_require__.d(src_namespaceObject, {
|
|
119
|
+
"AnimateMixin": () => (AnimateMixin),
|
|
120
|
+
"AnimateSequenceItemMixin": () => (AnimateSequenceItemMixin),
|
|
121
|
+
"AnimateSequenceMixin": () => (AnimateSequenceMixin),
|
|
122
|
+
"ClassNameMixin": () => (ClassNameMixin),
|
|
123
|
+
"Dialog": () => (Dialog),
|
|
124
|
+
"FlyoutMixin": () => (FlyoutMixin),
|
|
125
|
+
"FocusStateMixin": () => (FocusStateMixin),
|
|
126
|
+
"LoadingStateMixin": () => (LoadingStateMixin),
|
|
127
|
+
"Mixin": () => (Mixin),
|
|
128
|
+
"ScrollableMixin": () => (ScrollableMixin),
|
|
129
|
+
"StatefulMixin": () => (StatefulMixin),
|
|
130
|
+
"createDialog": () => (createDialog),
|
|
131
|
+
"linkTo": () => (linkTo),
|
|
132
|
+
"registerView": () => (registerView),
|
|
133
|
+
"renderView": () => (renderView),
|
|
134
|
+
"useAnimateMixin": () => (useAnimateMixin),
|
|
135
|
+
"useAnimateSequenceMixin": () => (useAnimateSequenceMixin),
|
|
136
|
+
"useAppReady": () => (useAppReady),
|
|
137
|
+
"useFlyoutMixin": () => (useFlyoutMixin),
|
|
138
|
+
"useFocusStateMixin": () => (useFocusStateMixin),
|
|
139
|
+
"useLanguage": () => (useLanguage),
|
|
140
|
+
"useLoadingStateMixin": () => (useLoadingStateMixin),
|
|
141
|
+
"useMixinRef": () => (useMixinRef),
|
|
142
|
+
"useRouteParam": () => (useRouteParam),
|
|
143
|
+
"useScrollableMixin": () => (useScrollableMixin)
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// EXTERNAL MODULE: external {"commonjs":"react","commonjs2":"react","amd":"react","root":"React"}
|
|
147
|
+
var external_commonjs_react_commonjs2_react_amd_react_root_React_ = __webpack_require__(359);
|
|
148
|
+
// EXTERNAL MODULE: external {"commonjs":"react-dom","commonjs2":"react-dom","amd":"react-dom","root":"ReactDOM"}
|
|
149
|
+
var external_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_root_ReactDOM_ = __webpack_require__(318);
|
|
150
|
+
// EXTERNAL MODULE: external {"commonjs":"brew-js","commonjs2":"brew-js","amd":"brew-js","root":"brew"}
|
|
151
|
+
var external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_ = __webpack_require__(80);
|
|
152
|
+
// EXTERNAL MODULE: external {"commonjs":"zeta-dom","commonjs2":"zeta-dom","amd":"zeta-dom","root":"zeta"}
|
|
153
|
+
var external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_ = __webpack_require__(654);
|
|
154
|
+
;// CONCATENATED MODULE: ./tmp/zeta-dom/util.js
|
|
155
|
+
|
|
156
|
+
var _zeta$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.util,
|
|
157
|
+
noop = _zeta$util.noop,
|
|
158
|
+
either = _zeta$util.either,
|
|
159
|
+
is = _zeta$util.is,
|
|
160
|
+
isUndefinedOrNull = _zeta$util.isUndefinedOrNull,
|
|
161
|
+
isArray = _zeta$util.isArray,
|
|
162
|
+
isFunction = _zeta$util.isFunction,
|
|
163
|
+
isThenable = _zeta$util.isThenable,
|
|
164
|
+
isPlainObject = _zeta$util.isPlainObject,
|
|
165
|
+
isArrayLike = _zeta$util.isArrayLike,
|
|
166
|
+
makeArray = _zeta$util.makeArray,
|
|
167
|
+
extend = _zeta$util.extend,
|
|
168
|
+
each = _zeta$util.each,
|
|
169
|
+
map = _zeta$util.map,
|
|
170
|
+
grep = _zeta$util.grep,
|
|
171
|
+
splice = _zeta$util.splice,
|
|
172
|
+
any = _zeta$util.any,
|
|
173
|
+
single = _zeta$util.single,
|
|
174
|
+
kv = _zeta$util.kv,
|
|
175
|
+
pick = _zeta$util.pick,
|
|
176
|
+
exclude = _zeta$util.exclude,
|
|
177
|
+
mapGet = _zeta$util.mapGet,
|
|
178
|
+
mapRemove = _zeta$util.mapRemove,
|
|
179
|
+
arrRemove = _zeta$util.arrRemove,
|
|
180
|
+
setAdd = _zeta$util.setAdd,
|
|
181
|
+
equal = _zeta$util.equal,
|
|
182
|
+
combineFn = _zeta$util.combineFn,
|
|
183
|
+
executeOnce = _zeta$util.executeOnce,
|
|
184
|
+
createPrivateStore = _zeta$util.createPrivateStore,
|
|
185
|
+
setTimeoutOnce = _zeta$util.setTimeoutOnce,
|
|
186
|
+
util_setImmediate = _zeta$util.setImmediate,
|
|
187
|
+
setImmediateOnce = _zeta$util.setImmediateOnce,
|
|
188
|
+
throwNotFunction = _zeta$util.throwNotFunction,
|
|
189
|
+
keys = _zeta$util.keys,
|
|
190
|
+
values = _zeta$util.values,
|
|
191
|
+
util_hasOwnProperty = _zeta$util.hasOwnProperty,
|
|
192
|
+
getOwnPropertyDescriptors = _zeta$util.getOwnPropertyDescriptors,
|
|
193
|
+
util_define = _zeta$util.define,
|
|
194
|
+
definePrototype = _zeta$util.definePrototype,
|
|
195
|
+
defineOwnProperty = _zeta$util.defineOwnProperty,
|
|
196
|
+
defineGetterProperty = _zeta$util.defineGetterProperty,
|
|
197
|
+
defineHiddenProperty = _zeta$util.defineHiddenProperty,
|
|
198
|
+
defineAliasProperty = _zeta$util.defineAliasProperty,
|
|
199
|
+
defineObservableProperty = _zeta$util.defineObservableProperty,
|
|
200
|
+
watch = _zeta$util.watch,
|
|
201
|
+
watchOnce = _zeta$util.watchOnce,
|
|
202
|
+
watchable = _zeta$util.watchable,
|
|
203
|
+
inherit = _zeta$util.inherit,
|
|
204
|
+
deepFreeze = _zeta$util.deepFreeze,
|
|
205
|
+
iequal = _zeta$util.iequal,
|
|
206
|
+
randomId = _zeta$util.randomId,
|
|
207
|
+
repeat = _zeta$util.repeat,
|
|
208
|
+
camel = _zeta$util.camel,
|
|
209
|
+
hyphenate = _zeta$util.hyphenate,
|
|
210
|
+
ucfirst = _zeta$util.ucfirst,
|
|
211
|
+
lcfirst = _zeta$util.lcfirst,
|
|
212
|
+
trim = _zeta$util.trim,
|
|
213
|
+
matchWord = _zeta$util.matchWord,
|
|
214
|
+
htmlDecode = _zeta$util.htmlDecode,
|
|
215
|
+
resolve = _zeta$util.resolve,
|
|
216
|
+
reject = _zeta$util.reject,
|
|
217
|
+
always = _zeta$util.always,
|
|
218
|
+
resolveAll = _zeta$util.resolveAll,
|
|
219
|
+
catchAsync = _zeta$util.catchAsync,
|
|
220
|
+
setPromiseTimeout = _zeta$util.setPromiseTimeout;
|
|
221
|
+
|
|
222
|
+
;// CONCATENATED MODULE: ./src/include/zeta-dom/util.js
|
|
223
|
+
|
|
224
|
+
;// CONCATENATED MODULE: ./tmp/zeta-dom/domUtil.js
|
|
225
|
+
|
|
226
|
+
var domUtil_zeta$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.util,
|
|
227
|
+
domReady = domUtil_zeta$util.domReady,
|
|
228
|
+
tagName = domUtil_zeta$util.tagName,
|
|
229
|
+
domUtil_is = domUtil_zeta$util.is,
|
|
230
|
+
isVisible = domUtil_zeta$util.isVisible,
|
|
231
|
+
matchSelector = domUtil_zeta$util.matchSelector,
|
|
232
|
+
comparePosition = domUtil_zeta$util.comparePosition,
|
|
233
|
+
connected = domUtil_zeta$util.connected,
|
|
234
|
+
containsOrEquals = domUtil_zeta$util.containsOrEquals,
|
|
235
|
+
acceptNode = domUtil_zeta$util.acceptNode,
|
|
236
|
+
combineNodeFilters = domUtil_zeta$util.combineNodeFilters,
|
|
237
|
+
iterateNode = domUtil_zeta$util.iterateNode,
|
|
238
|
+
iterateNodeToArray = domUtil_zeta$util.iterateNodeToArray,
|
|
239
|
+
getCommonAncestor = domUtil_zeta$util.getCommonAncestor,
|
|
240
|
+
parentsAndSelf = domUtil_zeta$util.parentsAndSelf,
|
|
241
|
+
selectIncludeSelf = domUtil_zeta$util.selectIncludeSelf,
|
|
242
|
+
selectClosestRelative = domUtil_zeta$util.selectClosestRelative,
|
|
243
|
+
createNodeIterator = domUtil_zeta$util.createNodeIterator,
|
|
244
|
+
createTreeWalker = domUtil_zeta$util.createTreeWalker,
|
|
245
|
+
bind = domUtil_zeta$util.bind,
|
|
246
|
+
bindUntil = domUtil_zeta$util.bindUntil,
|
|
247
|
+
dispatchDOMMouseEvent = domUtil_zeta$util.dispatchDOMMouseEvent,
|
|
248
|
+
removeNode = domUtil_zeta$util.removeNode,
|
|
249
|
+
getClass = domUtil_zeta$util.getClass,
|
|
250
|
+
setClass = domUtil_zeta$util.setClass,
|
|
251
|
+
getScrollOffset = domUtil_zeta$util.getScrollOffset,
|
|
252
|
+
getScrollParent = domUtil_zeta$util.getScrollParent,
|
|
253
|
+
getContentRect = domUtil_zeta$util.getContentRect,
|
|
254
|
+
scrollBy = domUtil_zeta$util.scrollBy,
|
|
255
|
+
scrollIntoView = domUtil_zeta$util.scrollIntoView,
|
|
256
|
+
createRange = domUtil_zeta$util.createRange,
|
|
257
|
+
rangeIntersects = domUtil_zeta$util.rangeIntersects,
|
|
258
|
+
rangeEquals = domUtil_zeta$util.rangeEquals,
|
|
259
|
+
rangeCovers = domUtil_zeta$util.rangeCovers,
|
|
260
|
+
compareRangePosition = domUtil_zeta$util.compareRangePosition,
|
|
261
|
+
makeSelection = domUtil_zeta$util.makeSelection,
|
|
262
|
+
getRect = domUtil_zeta$util.getRect,
|
|
263
|
+
getRects = domUtil_zeta$util.getRects,
|
|
264
|
+
toPlainRect = domUtil_zeta$util.toPlainRect,
|
|
265
|
+
rectEquals = domUtil_zeta$util.rectEquals,
|
|
266
|
+
rectCovers = domUtil_zeta$util.rectCovers,
|
|
267
|
+
rectIntersects = domUtil_zeta$util.rectIntersects,
|
|
268
|
+
pointInRect = domUtil_zeta$util.pointInRect,
|
|
269
|
+
mergeRect = domUtil_zeta$util.mergeRect,
|
|
270
|
+
elementFromPoint = domUtil_zeta$util.elementFromPoint;
|
|
271
|
+
|
|
272
|
+
;// CONCATENATED MODULE: ./src/include/zeta-dom/domUtil.js
|
|
273
|
+
|
|
274
|
+
;// CONCATENATED MODULE: ./tmp/zeta-dom/dom.js
|
|
275
|
+
|
|
276
|
+
var _defaultExport = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom;
|
|
277
|
+
/* harmony default export */ const dom = (_defaultExport);
|
|
278
|
+
var _zeta$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
|
|
279
|
+
textInputAllowed = _zeta$dom.textInputAllowed,
|
|
280
|
+
beginDrag = _zeta$dom.beginDrag,
|
|
281
|
+
beginPinchZoom = _zeta$dom.beginPinchZoom,
|
|
282
|
+
getShortcut = _zeta$dom.getShortcut,
|
|
283
|
+
setShortcut = _zeta$dom.setShortcut,
|
|
284
|
+
focusable = _zeta$dom.focusable,
|
|
285
|
+
focused = _zeta$dom.focused,
|
|
286
|
+
setModal = _zeta$dom.setModal,
|
|
287
|
+
retainFocus = _zeta$dom.retainFocus,
|
|
288
|
+
releaseFocus = _zeta$dom.releaseFocus,
|
|
289
|
+
dom_focus = _zeta$dom.focus;
|
|
290
|
+
|
|
291
|
+
;// CONCATENATED MODULE: ./src/include/zeta-dom/dom.js
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
/* harmony default export */ const zeta_dom_dom = (dom);
|
|
295
|
+
;// CONCATENATED MODULE: ./src/dialog.js
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
function createDialog(props) {
|
|
303
|
+
var root = document.createElement('div');
|
|
304
|
+
var closing = false;
|
|
305
|
+
var refresh = noop;
|
|
306
|
+
var promise;
|
|
307
|
+
|
|
308
|
+
function Component() {
|
|
309
|
+
var forceRefresh = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(0)[1];
|
|
310
|
+
|
|
311
|
+
refresh = function refresh() {
|
|
312
|
+
forceRefresh(function (v) {
|
|
313
|
+
return ++v;
|
|
314
|
+
});
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
return props.onRender(extend({
|
|
318
|
+
root: root,
|
|
319
|
+
closeDialog: closeDialog
|
|
320
|
+
}, props));
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function closeDialog(value) {
|
|
324
|
+
if (!closing) {
|
|
325
|
+
closing = true;
|
|
326
|
+
external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.closeFlyout(root, value).then(function () {
|
|
327
|
+
closing = false;
|
|
328
|
+
removeNode(root);
|
|
329
|
+
external_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_root_ReactDOM_.unmountComponentAtNode(root);
|
|
330
|
+
(props.onClose || noop)(root);
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return {
|
|
336
|
+
root: root,
|
|
337
|
+
refresh: refresh,
|
|
338
|
+
close: closeDialog,
|
|
339
|
+
open: function open() {
|
|
340
|
+
if (promise) {
|
|
341
|
+
return promise;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
root.className = props.className;
|
|
345
|
+
|
|
346
|
+
if (props.modal) {
|
|
347
|
+
root.setAttribute('is-modal', '');
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
document.body.appendChild(root);
|
|
351
|
+
|
|
352
|
+
if (props.modal) {
|
|
353
|
+
zeta_dom_dom.setModal(root);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
zeta_dom_dom.retainFocus(zeta_dom_dom.activeElement, root);
|
|
357
|
+
external_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_root_ReactDOM_.render(external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(Component), root);
|
|
358
|
+
promise = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.openFlyout(root);
|
|
359
|
+
always(promise, function () {
|
|
360
|
+
promise = null;
|
|
361
|
+
});
|
|
362
|
+
promise.then(props.onCommit);
|
|
363
|
+
(props.onOpen || noop)(root);
|
|
364
|
+
return promise;
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
function Dialog(props) {
|
|
369
|
+
/** @type {import("./dialog").DialogProps & { open: boolean }} */
|
|
370
|
+
var _props = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)({
|
|
371
|
+
open: false
|
|
372
|
+
})[0];
|
|
373
|
+
extend(_props, props);
|
|
374
|
+
|
|
375
|
+
if (props.children) {
|
|
376
|
+
_props.onRender = function () {
|
|
377
|
+
return external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(external_commonjs_react_commonjs2_react_amd_react_root_React_.Fragment, null, props.children);
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
var dialog = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
|
|
382
|
+
return createDialog(_props);
|
|
383
|
+
})[0];
|
|
384
|
+
(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
|
|
385
|
+
var opened = containsOrEquals(zeta_dom_dom.root, dialog.root);
|
|
386
|
+
|
|
387
|
+
if (either(opened, _props.open)) {
|
|
388
|
+
if (!opened) {
|
|
389
|
+
dialog.open();
|
|
390
|
+
} else {
|
|
391
|
+
dialog.close();
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}, [_props.open]);
|
|
395
|
+
(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
|
|
396
|
+
return dialog.close;
|
|
397
|
+
}, [dialog]);
|
|
398
|
+
(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
|
|
399
|
+
dialog.refresh();
|
|
400
|
+
});
|
|
401
|
+
return external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(external_commonjs_react_commonjs2_react_amd_react_root_React_.Fragment);
|
|
402
|
+
}
|
|
403
|
+
// EXTERNAL MODULE: external "zeta-dom-react"
|
|
404
|
+
var external_zeta_dom_react_ = __webpack_require__(103);
|
|
405
|
+
;// CONCATENATED MODULE: ./src/app.js
|
|
406
|
+
|
|
407
|
+
/** @type {Brew.AppInstance<Brew.WithRouter & Brew.WithI18n>} */
|
|
408
|
+
|
|
409
|
+
var app;
|
|
410
|
+
external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.install('react', function (app_) {
|
|
411
|
+
// @ts-ignore: type inference issue
|
|
412
|
+
app = app_;
|
|
413
|
+
});
|
|
414
|
+
external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.defaults.react = true;
|
|
415
|
+
;// CONCATENATED MODULE: ./src/hooks.js
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
function useAppReady() {
|
|
421
|
+
var sReady = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(false);
|
|
422
|
+
var ready = sReady[0],
|
|
423
|
+
setReady = sReady[1];
|
|
424
|
+
(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
|
|
425
|
+
app.ready.then(function () {
|
|
426
|
+
setReady(true);
|
|
427
|
+
});
|
|
428
|
+
}, []);
|
|
429
|
+
return ready;
|
|
430
|
+
}
|
|
431
|
+
function useLanguage() {
|
|
432
|
+
return (0,external_zeta_dom_react_.useObservableProperty)(app, 'language');
|
|
433
|
+
}
|
|
434
|
+
function useRouteParam(name, defaultValue) {
|
|
435
|
+
var sValue = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(app.route[name]);
|
|
436
|
+
var value = sValue[0],
|
|
437
|
+
setValue = sValue[1];
|
|
438
|
+
(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(function () {
|
|
439
|
+
var current = app.route[name]; // route parameter might be changed after state initialization and before useEffect hook is called
|
|
440
|
+
|
|
441
|
+
setValue(current);
|
|
442
|
+
return app.route.watch(name, setValue);
|
|
443
|
+
}, [name, defaultValue]);
|
|
444
|
+
|
|
445
|
+
if (!value && defaultValue !== undefined) {
|
|
446
|
+
app.navigate(app.route.getPath(extend({}, app.route, kv(name, defaultValue))), true);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
return value || '';
|
|
450
|
+
}
|
|
451
|
+
;// CONCATENATED MODULE: ./src/mixins/StaticAttributeMixin.js
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
function StaticAttributeMixin(attributes) {
|
|
455
|
+
Mixin.call(this);
|
|
456
|
+
this.attributes = attributes || {};
|
|
457
|
+
}
|
|
458
|
+
definePrototype(StaticAttributeMixin, Mixin, {
|
|
459
|
+
getCustomAttributes: function getCustomAttributes() {
|
|
460
|
+
return extend({}, this.attributes);
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
;// CONCATENATED MODULE: ./src/mixins/Mixin.js
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
function Mixin() {}
|
|
468
|
+
definePrototype(Mixin, {
|
|
469
|
+
next: function next() {},
|
|
470
|
+
getRef: function getRef() {
|
|
471
|
+
return noop;
|
|
472
|
+
},
|
|
473
|
+
getClassNames: function getClassNames() {
|
|
474
|
+
return [];
|
|
475
|
+
},
|
|
476
|
+
getCustomAttributes: function getCustomAttributes() {
|
|
477
|
+
return {};
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
watchable(Mixin.prototype);
|
|
481
|
+
util_define(Mixin, {
|
|
482
|
+
get scrollableTarget() {
|
|
483
|
+
return new StaticAttributeMixin({
|
|
484
|
+
'scrollable-target': ''
|
|
485
|
+
});
|
|
486
|
+
},
|
|
487
|
+
|
|
488
|
+
use: function use() {
|
|
489
|
+
var args = makeArray(arguments);
|
|
490
|
+
var ref = args[0];
|
|
491
|
+
var props = {};
|
|
492
|
+
var mixins = args.filter(function (v) {
|
|
493
|
+
return v instanceof Mixin;
|
|
494
|
+
});
|
|
495
|
+
var refs = mixins.map(function (v) {
|
|
496
|
+
return v.getRef();
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
if (ref && !(ref instanceof Mixin)) {
|
|
500
|
+
if (typeof ref !== 'function') {
|
|
501
|
+
refs.push(function (v) {
|
|
502
|
+
ref.current = v;
|
|
503
|
+
});
|
|
504
|
+
} else {
|
|
505
|
+
refs.push(ref);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
args.shift();
|
|
509
|
+
} else if (!ref) {
|
|
510
|
+
args.shift();
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
each(mixins, function (i, v) {
|
|
514
|
+
extend(props, v.getCustomAttributes());
|
|
515
|
+
});
|
|
516
|
+
extend(props, {
|
|
517
|
+
ref: combineFn(refs),
|
|
518
|
+
className: external_zeta_dom_react_.classNames.apply(null, args)
|
|
519
|
+
});
|
|
520
|
+
each(mixins, function (i, v) {
|
|
521
|
+
v.next();
|
|
522
|
+
});
|
|
523
|
+
return props;
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
;// CONCATENATED MODULE: ./src/mixins/StatefulMixin.js
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
function MixinRefImpl(mixin) {
|
|
531
|
+
this.mixin = mixin;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
definePrototype(MixinRefImpl, {
|
|
535
|
+
getMixin: function getMixin() {
|
|
536
|
+
return this.mixin;
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
function StatefulMixin() {
|
|
540
|
+
Mixin.call(this);
|
|
541
|
+
this.states = {};
|
|
542
|
+
this.prefix = '';
|
|
543
|
+
this.counter = 0;
|
|
544
|
+
}
|
|
545
|
+
definePrototype(StatefulMixin, Mixin, {
|
|
546
|
+
get ref() {
|
|
547
|
+
var state = this.state;
|
|
548
|
+
this.next();
|
|
549
|
+
return state.ref || (state.ref = new MixinRefImpl(this.clone()));
|
|
550
|
+
},
|
|
551
|
+
|
|
552
|
+
get state() {
|
|
553
|
+
var self = this;
|
|
554
|
+
var key = self.prefix + self.counter;
|
|
555
|
+
return self.states[key] || (self.states[key] = self.initState());
|
|
556
|
+
},
|
|
557
|
+
|
|
558
|
+
reset: function reset() {
|
|
559
|
+
this.counter = 0;
|
|
560
|
+
return this;
|
|
561
|
+
},
|
|
562
|
+
next: function next() {
|
|
563
|
+
this.counter++;
|
|
564
|
+
return this;
|
|
565
|
+
},
|
|
566
|
+
getRef: function getRef() {
|
|
567
|
+
var self = this;
|
|
568
|
+
var state = self.state;
|
|
569
|
+
return function (current) {
|
|
570
|
+
if (current !== state.element) {
|
|
571
|
+
state.element = current;
|
|
572
|
+
|
|
573
|
+
if (current) {
|
|
574
|
+
self.initElement(current, state);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
},
|
|
579
|
+
elements: function elements() {
|
|
580
|
+
return values(this.states).map(function (v) {
|
|
581
|
+
return v.element;
|
|
582
|
+
}).filter(function (v) {
|
|
583
|
+
return v;
|
|
584
|
+
});
|
|
585
|
+
},
|
|
586
|
+
initState: function initState() {
|
|
587
|
+
return {
|
|
588
|
+
element: null
|
|
589
|
+
};
|
|
590
|
+
},
|
|
591
|
+
initElement: function initElement(element, state) {},
|
|
592
|
+
clone: function clone() {
|
|
593
|
+
return inherit(Object.getPrototypeOf(this), {
|
|
594
|
+
states: this.states,
|
|
595
|
+
prefix: randomId() + '.',
|
|
596
|
+
counter: 0
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
;// CONCATENATED MODULE: ./src/mixins/ClassNameMixin.js
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
var ClassNameMixinSuper = StatefulMixin.prototype;
|
|
605
|
+
function ClassNameMixin(classNames) {
|
|
606
|
+
StatefulMixin.call(this);
|
|
607
|
+
this.classNames = classNames || [];
|
|
608
|
+
}
|
|
609
|
+
definePrototype(ClassNameMixin, StatefulMixin, {
|
|
610
|
+
getClassNames: function getClassNames() {
|
|
611
|
+
return [this.state.classNames];
|
|
612
|
+
},
|
|
613
|
+
initState: function initState() {
|
|
614
|
+
return {
|
|
615
|
+
element: null,
|
|
616
|
+
classNames: {}
|
|
617
|
+
};
|
|
618
|
+
},
|
|
619
|
+
initElement: function initElement(element, state) {
|
|
620
|
+
var self = this;
|
|
621
|
+
zeta_dom_dom.watchAttributes(element, ['class'], function (nodes) {
|
|
622
|
+
if (nodes.includes(element)) {
|
|
623
|
+
var prev = extend({}, state.classNames);
|
|
624
|
+
each(self.classNames, function (i, v) {
|
|
625
|
+
state.classNames[v] = element.classList.contains(v);
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
if (!equal(prev, state.classNames)) {
|
|
629
|
+
self.onClassNameUpdated(element, prev, state.classNames);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
},
|
|
634
|
+
clone: function clone() {
|
|
635
|
+
return extend(ClassNameMixinSuper.clone.call(this), {
|
|
636
|
+
classNames: this.classNames
|
|
637
|
+
});
|
|
638
|
+
},
|
|
639
|
+
onClassNameUpdated: function onClassNameUpdated(element, prevState, state) {}
|
|
640
|
+
});
|
|
641
|
+
;// CONCATENATED MODULE: ./src/mixins/AnimateMixin.js
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
var AnimateMixinSuper = ClassNameMixin.prototype;
|
|
645
|
+
function AnimateMixin() {
|
|
646
|
+
ClassNameMixin.call(this, ['tweening-in', 'tweening-out']);
|
|
647
|
+
}
|
|
648
|
+
definePrototype(AnimateMixin, ClassNameMixin, {
|
|
649
|
+
next: function next() {
|
|
650
|
+
this.effects = undefined;
|
|
651
|
+
this.trigger = undefined;
|
|
652
|
+
return AnimateMixinSuper.next.call(this);
|
|
653
|
+
},
|
|
654
|
+
"with": function _with(props) {
|
|
655
|
+
this.effects = props.effects;
|
|
656
|
+
this.trigger = props.trigger;
|
|
657
|
+
return this;
|
|
658
|
+
},
|
|
659
|
+
withEffects: function withEffects() {
|
|
660
|
+
this.effects = makeArray(arguments);
|
|
661
|
+
return this;
|
|
662
|
+
},
|
|
663
|
+
getCustomAttributes: function getCustomAttributes() {
|
|
664
|
+
return extend({}, AnimateMixinSuper.getCustomAttributes.call(this), {
|
|
665
|
+
'animate-in': (this.effects || []).join(' '),
|
|
666
|
+
'animate-on': this.trigger || 'show'
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
;// CONCATENATED MODULE: ./src/mixins/AnimateSequenceItemMixin.js
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
var AnimateSequenceItemMixinSuper = ClassNameMixin.prototype;
|
|
674
|
+
function AnimateSequenceItemMixin(className) {
|
|
675
|
+
ClassNameMixin.call(this, ['tweening-in', 'tweening-out']);
|
|
676
|
+
this.className = className;
|
|
677
|
+
}
|
|
678
|
+
definePrototype(AnimateSequenceItemMixin, ClassNameMixin, {
|
|
679
|
+
getClassNames: function getClassNames() {
|
|
680
|
+
return [this.className].concat(AnimateSequenceItemMixinSuper.getClassNames.call(this));
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
;// CONCATENATED MODULE: ./src/mixins/AnimateSequenceMixin.js
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
var AnimateSequenceMixinSuper = AnimateMixin.prototype;
|
|
688
|
+
var animateSequenceMixinCounter = 0;
|
|
689
|
+
function AnimateSequenceMixin() {
|
|
690
|
+
AnimateMixin.call(this);
|
|
691
|
+
this.className = 'brew-anim-' + ++animateSequenceMixinCounter;
|
|
692
|
+
this.item = new AnimateSequenceItemMixin(this.className);
|
|
693
|
+
}
|
|
694
|
+
definePrototype(AnimateSequenceMixin, AnimateMixin, {
|
|
695
|
+
reset: function reset() {
|
|
696
|
+
this.item.reset();
|
|
697
|
+
return AnimateSequenceMixinSuper.reset.call(this);
|
|
698
|
+
},
|
|
699
|
+
getCustomAttributes: function getCustomAttributes() {
|
|
700
|
+
return extend({}, AnimateSequenceMixinSuper.getCustomAttributes.call(this), {
|
|
701
|
+
'animate-sequence': '.' + this.className
|
|
702
|
+
});
|
|
703
|
+
},
|
|
704
|
+
clone: function clone() {
|
|
705
|
+
return extend(AnimateSequenceMixinSuper.clone.call(this), {
|
|
706
|
+
item: this.item.ref.getMixin()
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
;// CONCATENATED MODULE: ./src/mixins/FlyoutMixin.js
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
var FlyoutMixinSuper = ClassNameMixin.prototype;
|
|
715
|
+
var flyoutMixinCounter = 0;
|
|
716
|
+
function FlyoutMixin() {
|
|
717
|
+
ClassNameMixin.call(this, ['open', 'closing', 'tweening-in', 'tweening-out']);
|
|
718
|
+
this.isFlyoutOpened = false;
|
|
719
|
+
this.animating = false;
|
|
720
|
+
this.visible = false;
|
|
721
|
+
this.toggle = new ClassNameMixin(['target-opened']);
|
|
722
|
+
}
|
|
723
|
+
definePrototype(FlyoutMixin, ClassNameMixin, {
|
|
724
|
+
reset: function reset() {
|
|
725
|
+
this.toggle.reset();
|
|
726
|
+
return FlyoutMixinSuper.reset.call(this);
|
|
727
|
+
},
|
|
728
|
+
next: function next() {
|
|
729
|
+
this.effects = undefined;
|
|
730
|
+
return FlyoutMixinSuper.next.call(this);
|
|
731
|
+
},
|
|
732
|
+
withEffects: function withEffects() {
|
|
733
|
+
this.effects = makeArray(arguments);
|
|
734
|
+
return this;
|
|
735
|
+
},
|
|
736
|
+
getCustomAttributes: function getCustomAttributes() {
|
|
737
|
+
return extend({}, FlyoutMixinSuper.getCustomAttributes.call(this), {
|
|
738
|
+
'is-flyout': ''
|
|
739
|
+
}, this.effects && {
|
|
740
|
+
'animate-on': 'open',
|
|
741
|
+
'animate-in': this.effects.join(' '),
|
|
742
|
+
'animate-out': ''
|
|
743
|
+
});
|
|
744
|
+
},
|
|
745
|
+
onOpen: function onOpen(callback) {
|
|
746
|
+
return this.onToggleState(function (opened) {
|
|
747
|
+
if (opened) {
|
|
748
|
+
return callback();
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
},
|
|
752
|
+
onToggleState: function onToggleState(callback) {
|
|
753
|
+
return this.watch('isFlyoutOpened', callback);
|
|
754
|
+
},
|
|
755
|
+
onVisibilityChanged: function onVisibilityChanged(callback) {
|
|
756
|
+
return this.watch('visible', callback);
|
|
757
|
+
},
|
|
758
|
+
initElement: function initElement(element, state) {
|
|
759
|
+
var self = this;
|
|
760
|
+
FlyoutMixinSuper.initElement.call(self, element, state);
|
|
761
|
+
|
|
762
|
+
if (!element.id) {
|
|
763
|
+
element.id = 'flyout-' + ++flyoutMixinCounter;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
app.on(element, {
|
|
767
|
+
animationstart: function animationstart() {
|
|
768
|
+
self.animating = true;
|
|
769
|
+
},
|
|
770
|
+
animationcomplete: function animationcomplete() {
|
|
771
|
+
self.animating = false;
|
|
772
|
+
}
|
|
773
|
+
}, true);
|
|
774
|
+
setImmediate(function () {
|
|
775
|
+
each(self.toggle.elements(), function (i, v) {
|
|
776
|
+
v.setAttribute('toggle', '#' + element.id);
|
|
777
|
+
});
|
|
778
|
+
});
|
|
779
|
+
},
|
|
780
|
+
clone: function clone() {
|
|
781
|
+
var mixin = extend(FlyoutMixinSuper.clone.call(this), {
|
|
782
|
+
toggle: this.toggle.ref.getMixin()
|
|
783
|
+
});
|
|
784
|
+
defineAliasProperty(mixin, 'isFlyoutOpened', this);
|
|
785
|
+
return mixin;
|
|
786
|
+
},
|
|
787
|
+
onClassNameUpdated: function onClassNameUpdated(element, prevState, state) {
|
|
788
|
+
var self = this;
|
|
789
|
+
|
|
790
|
+
var isAdded = function isAdded(v) {
|
|
791
|
+
return prevState[v] !== state[v] && state[v];
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
var isRemoved = function isRemoved(v) {
|
|
795
|
+
return prevState[v] !== state[v] && !state[v];
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
if (isAdded('open')) {
|
|
799
|
+
self.isFlyoutOpened = true;
|
|
800
|
+
self.visible = true;
|
|
801
|
+
} else if (isAdded('closing') || isAdded('tweening-out')) {
|
|
802
|
+
self.isFlyoutOpened = false;
|
|
803
|
+
} else if (isRemoved('open')) {
|
|
804
|
+
self.visible = false;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
});
|
|
808
|
+
;// CONCATENATED MODULE: ./src/mixins/FocusStateMixin.js
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
var FocusStateMixinSuper = ClassNameMixin.prototype;
|
|
814
|
+
function FocusStateMixin() {
|
|
815
|
+
ClassNameMixin.call(this, ['focused']);
|
|
816
|
+
}
|
|
817
|
+
definePrototype(FocusStateMixin, ClassNameMixin, {
|
|
818
|
+
initElement: function initElement(element, state) {
|
|
819
|
+
FocusStateMixinSuper.initElement.call(this, element, state);
|
|
820
|
+
zeta_dom_dom.on(element, {
|
|
821
|
+
focusin: function focusin() {
|
|
822
|
+
setClass(element, 'focused', true);
|
|
823
|
+
},
|
|
824
|
+
focusout: function focusout() {
|
|
825
|
+
setClass(element, 'focused', false);
|
|
826
|
+
}
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
});
|
|
830
|
+
;// CONCATENATED MODULE: ./src/mixins/LoadingStateMixin.js
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
var LoadingStateMixinSuper = ClassNameMixin.prototype;
|
|
836
|
+
function LoadingStateMixin() {
|
|
837
|
+
ClassNameMixin.call(this, ['loading']);
|
|
838
|
+
}
|
|
839
|
+
definePrototype(LoadingStateMixin, ClassNameMixin, {
|
|
840
|
+
initElement: function initElement(element, state) {
|
|
841
|
+
LoadingStateMixinSuper.initElement.call(this, element, state);
|
|
842
|
+
zeta_dom_dom.on(element, {
|
|
843
|
+
asyncStart: function asyncStart() {
|
|
844
|
+
setClass(element, 'loading', true);
|
|
845
|
+
},
|
|
846
|
+
asyncEnd: function asyncEnd() {
|
|
847
|
+
setClass(element, 'loading', false);
|
|
848
|
+
},
|
|
849
|
+
cancelled: function cancelled() {
|
|
850
|
+
setClass(element, 'loading', false);
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
;// CONCATENATED MODULE: ./src/mixins/ScrollableMixin.js
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
var ScrollableMixinSuper = ClassNameMixin.prototype;
|
|
861
|
+
function ScrollableMixin() {
|
|
862
|
+
ClassNameMixin.call(this, ['scrollable-x', 'scrollable-x-l', 'scrollable-x-r', 'scrollable-y', 'scrollable-y-d', 'scrollable-y-u']);
|
|
863
|
+
this.target = Mixin.scrollableTarget;
|
|
864
|
+
this.pageIndex = 0;
|
|
865
|
+
}
|
|
866
|
+
definePrototype(ScrollableMixin, ClassNameMixin, {
|
|
867
|
+
withOptions: function withOptions(options) {
|
|
868
|
+
this.options = options;
|
|
869
|
+
return this;
|
|
870
|
+
},
|
|
871
|
+
getCustomAttributes: function getCustomAttributes() {
|
|
872
|
+
var options = this.options || {};
|
|
873
|
+
return extend({}, ScrollableMixinSuper.getCustomAttributes.call(this), {
|
|
874
|
+
'scrollable': [options.direction || 'both', options.handle || 'auto'].join(' ')
|
|
875
|
+
}, options.paged && {
|
|
876
|
+
'var': '{ pageIndex: 0 }',
|
|
877
|
+
'scroller-snap-page': options.paged,
|
|
878
|
+
'scroller-page': options.pagedItemSelector,
|
|
879
|
+
'scroller-state': 'pageIndex'
|
|
880
|
+
});
|
|
881
|
+
},
|
|
882
|
+
onPageIndexChanged: function onPageIndexChanged(callback) {
|
|
883
|
+
return this.watch('pageIndex', callback);
|
|
884
|
+
},
|
|
885
|
+
initElement: function initElement(element, state) {
|
|
886
|
+
var self = this;
|
|
887
|
+
app.on(element, 'statechange', function (e) {
|
|
888
|
+
if ('pageIndex' in e.newValues) {
|
|
889
|
+
extend(self, {
|
|
890
|
+
pageIndex: e.newValues.pageIndex
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
}, true);
|
|
894
|
+
},
|
|
895
|
+
clone: function clone() {
|
|
896
|
+
var mixin = ScrollableMixinSuper.clone.call(this);
|
|
897
|
+
defineAliasProperty(mixin, 'pageIndex', this);
|
|
898
|
+
return mixin;
|
|
899
|
+
}
|
|
900
|
+
});
|
|
901
|
+
;// CONCATENATED MODULE: ./src/mixin.js
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
function useScrollableMixin(options) {
|
|
914
|
+
return (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
|
|
915
|
+
return new ScrollableMixin();
|
|
916
|
+
})[0].reset().withOptions(options);
|
|
917
|
+
}
|
|
918
|
+
function useFlyoutMixin() {
|
|
919
|
+
return (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
|
|
920
|
+
return new FlyoutMixin();
|
|
921
|
+
})[0].reset();
|
|
922
|
+
}
|
|
923
|
+
function useAnimateMixin() {
|
|
924
|
+
return (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
|
|
925
|
+
return new AnimateMixin();
|
|
926
|
+
})[0].reset();
|
|
927
|
+
}
|
|
928
|
+
function useAnimateSequenceMixin() {
|
|
929
|
+
return (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
|
|
930
|
+
return new AnimateSequenceMixin();
|
|
931
|
+
})[0].reset();
|
|
932
|
+
}
|
|
933
|
+
function useFocusStateMixin() {
|
|
934
|
+
return (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
|
|
935
|
+
return new FocusStateMixin();
|
|
936
|
+
})[0].reset();
|
|
937
|
+
}
|
|
938
|
+
function useLoadingStateMixin() {
|
|
939
|
+
return (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(function () {
|
|
940
|
+
return new LoadingStateMixin();
|
|
941
|
+
})[0].reset();
|
|
942
|
+
}
|
|
943
|
+
function useMixinRef(mixin) {
|
|
944
|
+
return mixin.getMixin().reset();
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
;// CONCATENATED MODULE: ./src/view.js
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
var routeMap = new Map();
|
|
954
|
+
|
|
955
|
+
function ViewContainer() {
|
|
956
|
+
/** @type {any} */
|
|
957
|
+
var self = this;
|
|
958
|
+
external_commonjs_react_commonjs2_react_amd_react_root_React_.Component.apply(self, arguments);
|
|
959
|
+
self.mounted = false;
|
|
960
|
+
self.componentWillUnmount = app.on('navigate', function () {
|
|
961
|
+
if (self.mounted && self.getViewComponent()) {
|
|
962
|
+
self.forceUpdate();
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
definePrototype(ViewContainer, external_commonjs_react_commonjs2_react_amd_react_root_React_.Component, {
|
|
968
|
+
componentDidMount: function componentDidMount() {
|
|
969
|
+
this.mounted = true;
|
|
970
|
+
},
|
|
971
|
+
render: function render() {
|
|
972
|
+
/** @type {any} */
|
|
973
|
+
var self = this;
|
|
974
|
+
var V = self.getViewComponent();
|
|
975
|
+
|
|
976
|
+
if (V && V !== self.currentViewComponent) {
|
|
977
|
+
self.currentViewComponent = V;
|
|
978
|
+
|
|
979
|
+
if (self.currentView && self.currentElement) {
|
|
980
|
+
self.prevView = self.currentView;
|
|
981
|
+
self.prevElement = self.currentElement;
|
|
982
|
+
self.currentElement = undefined;
|
|
983
|
+
external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.animateOut(self.prevElement, 'show').then(function () {
|
|
984
|
+
self.prevElement = undefined;
|
|
985
|
+
self.prevView = undefined;
|
|
986
|
+
self.forceUpdate();
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
self.currentView = external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(V, {
|
|
991
|
+
key: app.route.view,
|
|
992
|
+
rootProps: exclude(self.props, ['views']),
|
|
993
|
+
onComponentLoaded: function onComponentLoaded(element) {
|
|
994
|
+
self.currentElement = element;
|
|
995
|
+
util_setImmediate(function () {
|
|
996
|
+
return external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.animateIn(element, 'show');
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
return external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(external_commonjs_react_commonjs2_react_amd_react_root_React_.Fragment, null, self.prevView, self.currentView);
|
|
1003
|
+
},
|
|
1004
|
+
getViewComponent: function getViewComponent() {
|
|
1005
|
+
var views = this.props.views;
|
|
1006
|
+
var V = any(views, function (V) {
|
|
1007
|
+
var params = routeMap.get(V);
|
|
1008
|
+
return params && equal(params, pick(app.route, keys(params)));
|
|
1009
|
+
});
|
|
1010
|
+
return V || void app.navigate(linkTo(views[0]), true);
|
|
1011
|
+
}
|
|
1012
|
+
});
|
|
1013
|
+
function registerView(factory, routeParams) {
|
|
1014
|
+
var Component = function Component(props) {
|
|
1015
|
+
var childProps = exclude(props, ['rootProps', 'onComponentLoaded']);
|
|
1016
|
+
var Component = (0,external_zeta_dom_react_.useAsyncContent)(factory)[0];
|
|
1017
|
+
return external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement('div', extend({}, props.rootProps, {
|
|
1018
|
+
ref: function ref(element) {
|
|
1019
|
+
if (element && Component) {
|
|
1020
|
+
(props.onComponentLoaded || noop)(element);
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
children: Component && external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(Component["default"], childProps)
|
|
1024
|
+
}));
|
|
1025
|
+
};
|
|
1026
|
+
|
|
1027
|
+
routeMap.set(Component, routeParams);
|
|
1028
|
+
return Component;
|
|
1029
|
+
}
|
|
1030
|
+
function renderView() {
|
|
1031
|
+
var views = makeArray(arguments);
|
|
1032
|
+
var props;
|
|
1033
|
+
|
|
1034
|
+
if (views[0] && typeof views[0] !== 'function') {
|
|
1035
|
+
props = views.shift();
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
return external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement(ViewContainer, extend({}, props, {
|
|
1039
|
+
views: views
|
|
1040
|
+
}));
|
|
1041
|
+
}
|
|
1042
|
+
function linkTo(view, params) {
|
|
1043
|
+
return app.route.getPath(extend({}, app.route, params, routeMap.get(view)));
|
|
1044
|
+
}
|
|
1045
|
+
;// CONCATENATED MODULE: ./src/index.js
|
|
1046
|
+
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
;// CONCATENATED MODULE: ./src/entry.js
|
|
1051
|
+
|
|
1052
|
+
/* harmony default export */ const entry = (src_namespaceObject);
|
|
1053
|
+
})();
|
|
1054
|
+
|
|
1055
|
+
__webpack_exports__ = __webpack_exports__["default"];
|
|
1056
|
+
/******/ return __webpack_exports__;
|
|
1057
|
+
/******/ })()
|
|
1058
|
+
;
|
|
1059
|
+
});
|
|
1060
|
+
//# sourceMappingURL=brew-js-react.js.map
|