brew-js-react 0.4.4 → 0.4.6
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/dist/brew-js-react.js +33 -50
- package/dist/brew-js-react.js.map +1 -1
- package/dist/brew-js-react.min.js +2 -2
- package/dist/brew-js-react.min.js.map +1 -1
- package/include/brew-js/directive.js +1 -0
- package/mixins/AnimateMixin.d.ts +37 -2
- package/mixins/ClassNameMixin.d.ts +5 -2
- package/mixins/FlyoutMixin.d.ts +55 -0
- package/mixins/FlyoutMixin.js +5 -3
- package/mixins/FlyoutToggleMixin.d.ts +10 -0
- package/mixins/FlyoutToggleMixin.js +2 -2
- package/mixins/LoadingStateMixin.js +4 -15
- package/mixins/ScrollableMixin.d.ts +143 -6
- package/mixins/ScrollableMixin.js +14 -15
- package/mixins/StatefulMixin.d.ts +3 -3
- package/mixins/StaticAttributeMixin.d.ts +3 -0
- package/package.json +3 -3
package/dist/brew-js-react.js
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
/*! brew-js-react v0.4.
|
|
1
|
+
/*! brew-js-react v0.4.6 | (c) misonou | https://hackmd.io/@misonou/brew-js-react */
|
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
3
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
4
|
-
module.exports = factory(require("brew-js"), require("react"), require("react-dom"), (function webpackLoadOptionalExternalModule() { try { return require("react-dom/client"); } catch(e) {} }()), require("zeta-dom"), require("zeta-dom-react"), require("waterpipe")
|
|
4
|
+
module.exports = factory(require("brew-js"), require("react"), require("react-dom"), (function webpackLoadOptionalExternalModule() { try { return require("react-dom/client"); } catch(e) {} }()), require("zeta-dom"), require("zeta-dom-react"), require("waterpipe"));
|
|
5
5
|
else if(typeof define === 'function' && define.amd)
|
|
6
|
-
define("brew-js-react", ["brew-js", "react", "react-dom", "react-dom/client", "zeta-dom", "zeta-dom-react", "waterpipe"
|
|
6
|
+
define("brew-js-react", ["brew-js", "react", "react-dom", "react-dom/client", "zeta-dom", "zeta-dom-react", "waterpipe"], factory);
|
|
7
7
|
else if(typeof exports === 'object')
|
|
8
|
-
exports["brew-js-react"] = factory(require("brew-js"), require("react"), require("react-dom"), (function webpackLoadOptionalExternalModule() { try { return require("react-dom/client"); } catch(e) {} }()), require("zeta-dom"), require("zeta-dom-react"), require("waterpipe")
|
|
8
|
+
exports["brew-js-react"] = factory(require("brew-js"), require("react"), require("react-dom"), (function webpackLoadOptionalExternalModule() { try { return require("react-dom/client"); } catch(e) {} }()), require("zeta-dom"), require("zeta-dom-react"), require("waterpipe"));
|
|
9
9
|
else
|
|
10
|
-
root["brew-js-react"] = factory(root["brew"], root["React"], root["ReactDOM"], root["react-dom/client"], root["zeta"], root["zeta-dom-react"], root["waterpipe"]
|
|
11
|
-
})(self, function(__WEBPACK_EXTERNAL_MODULE__80__, __WEBPACK_EXTERNAL_MODULE__359__, __WEBPACK_EXTERNAL_MODULE__318__, __WEBPACK_EXTERNAL_MODULE__715__, __WEBPACK_EXTERNAL_MODULE__654__, __WEBPACK_EXTERNAL_MODULE__103__, __WEBPACK_EXTERNAL_MODULE__28__
|
|
10
|
+
root["brew-js-react"] = factory(root["brew"], root["React"], root["ReactDOM"], root["react-dom/client"], root["zeta"], root["zeta-dom-react"], root["waterpipe"]);
|
|
11
|
+
})(self, function(__WEBPACK_EXTERNAL_MODULE__80__, __WEBPACK_EXTERNAL_MODULE__359__, __WEBPACK_EXTERNAL_MODULE__318__, __WEBPACK_EXTERNAL_MODULE__715__, __WEBPACK_EXTERNAL_MODULE__654__, __WEBPACK_EXTERNAL_MODULE__103__, __WEBPACK_EXTERNAL_MODULE__28__) {
|
|
12
12
|
return /******/ (() => { // webpackBootstrap
|
|
13
13
|
/******/ var __webpack_modules__ = ({
|
|
14
14
|
|
|
15
|
-
/***/ 145:
|
|
16
|
-
/***/ ((module) => {
|
|
17
|
-
|
|
18
|
-
"use strict";
|
|
19
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__145__;
|
|
20
|
-
|
|
21
|
-
/***/ }),
|
|
22
|
-
|
|
23
15
|
/***/ 715:
|
|
24
16
|
/***/ ((module) => {
|
|
25
17
|
|
|
@@ -397,6 +389,8 @@ var _lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_z
|
|
|
397
389
|
setShortcut = _lib$dom.setShortcut,
|
|
398
390
|
focusable = _lib$dom.focusable,
|
|
399
391
|
focused = _lib$dom.focused,
|
|
392
|
+
setTabRoot = _lib$dom.setTabRoot,
|
|
393
|
+
unsetTabRoot = _lib$dom.unsetTabRoot,
|
|
400
394
|
setModal = _lib$dom.setModal,
|
|
401
395
|
releaseModal = _lib$dom.releaseModal,
|
|
402
396
|
retainFocus = _lib$dom.retainFocus,
|
|
@@ -422,7 +416,9 @@ var domLock_lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom
|
|
|
422
416
|
;// CONCATENATED MODULE: ./tmp/brew-js/domAction.js
|
|
423
417
|
|
|
424
418
|
var addAsyncAction = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addAsyncAction,
|
|
419
|
+
isFlyoutOpen = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.isFlyoutOpen,
|
|
425
420
|
closeFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.closeFlyout,
|
|
421
|
+
toggleFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toggleFlyout,
|
|
426
422
|
openFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.openFlyout;
|
|
427
423
|
|
|
428
424
|
;// CONCATENATED MODULE: ./src/dialog.js
|
|
@@ -1569,7 +1565,7 @@ definePrototype(FlyoutToggleMixin, ClassNameMixin, {
|
|
|
1569
1565
|
var self = this;
|
|
1570
1566
|
FlyoutToggleMixinSuper.initElement.call(self, element, state);
|
|
1571
1567
|
self.onDispose(zeta_dom_dom.on(element, 'click', function () {
|
|
1572
|
-
|
|
1568
|
+
toggleFlyout(self.flyoutMixin.elements()[0], element);
|
|
1573
1569
|
}));
|
|
1574
1570
|
}
|
|
1575
1571
|
});
|
|
@@ -1581,6 +1577,7 @@ definePrototype(FlyoutToggleMixin, ClassNameMixin, {
|
|
|
1581
1577
|
|
|
1582
1578
|
var FlyoutMixinSuper = ClassNameMixin.prototype;
|
|
1583
1579
|
var valueMap = new WeakMap();
|
|
1580
|
+
var aliasProps = 'animating isFlyoutOpened modal tabThrough visible'.split(' ');
|
|
1584
1581
|
function FlyoutMixin() {
|
|
1585
1582
|
var self = this;
|
|
1586
1583
|
ClassNameMixin.call(self, ['open', 'closing', 'visible', 'tweening-in', 'tweening-out']);
|
|
@@ -1662,8 +1659,9 @@ definePrototype(FlyoutMixin, ClassNameMixin, {
|
|
|
1662
1659
|
var mixin = extend(FlyoutMixinSuper.clone.call(self), {
|
|
1663
1660
|
toggle: self.toggle.ref.getMixin()
|
|
1664
1661
|
});
|
|
1665
|
-
|
|
1666
|
-
|
|
1662
|
+
each(aliasProps, function (i, v) {
|
|
1663
|
+
defineAliasProperty(mixin, v, self);
|
|
1664
|
+
});
|
|
1667
1665
|
return mixin;
|
|
1668
1666
|
},
|
|
1669
1667
|
onClassNameUpdated: function onClassNameUpdated(element, prevState, state) {
|
|
@@ -1738,20 +1736,9 @@ function LoadingStateMixin() {
|
|
|
1738
1736
|
definePrototype(LoadingStateMixin, StatefulMixin, {
|
|
1739
1737
|
initElement: function initElement(element, state) {
|
|
1740
1738
|
LoadingStateMixinSuper.initElement.call(this, element, state);
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
state.loading = true;
|
|
1745
|
-
setClass(element, 'loading', true);
|
|
1746
|
-
},
|
|
1747
|
-
asyncEnd: function asyncEnd() {
|
|
1748
|
-
state.loading = false;
|
|
1749
|
-
setClass(element, 'loading', false);
|
|
1750
|
-
},
|
|
1751
|
-
cancelled: function cancelled() {
|
|
1752
|
-
state.loading = false;
|
|
1753
|
-
setClass(element, 'loading', false);
|
|
1754
|
-
}
|
|
1739
|
+
this.onDispose(subscribeAsync(element, function (loading) {
|
|
1740
|
+
state.loading = loading;
|
|
1741
|
+
setClass(element, 'loading', loading);
|
|
1755
1742
|
}));
|
|
1756
1743
|
},
|
|
1757
1744
|
getClassNames: function getClassNames() {
|
|
@@ -1760,12 +1747,11 @@ definePrototype(LoadingStateMixin, StatefulMixin, {
|
|
|
1760
1747
|
}];
|
|
1761
1748
|
}
|
|
1762
1749
|
});
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1750
|
+
;// CONCATENATED MODULE: ./tmp/brew-js/directive.js
|
|
1751
|
+
|
|
1752
|
+
var getDirectiveComponent = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.getDirectiveComponent,
|
|
1753
|
+
registerDirective = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.registerDirective;
|
|
1767
1754
|
|
|
1768
|
-
/* harmony default export */ const jquery = (external_jQuery_);
|
|
1769
1755
|
;// CONCATENATED MODULE: ./src/mixins/ScrollableMixin.js
|
|
1770
1756
|
|
|
1771
1757
|
|
|
@@ -1773,6 +1759,7 @@ var external_jQuery_ = __webpack_require__(145);
|
|
|
1773
1759
|
|
|
1774
1760
|
|
|
1775
1761
|
var ScrollableMixinSuper = ClassNameMixin.prototype;
|
|
1762
|
+
var ScrollableMixin_aliasProps = 'pageIndex scrolling'.split(' ');
|
|
1776
1763
|
function ScrollableMixin() {
|
|
1777
1764
|
var self = this;
|
|
1778
1765
|
ClassNameMixin.call(self, ['scrollable-x', 'scrollable-x-l', 'scrollable-x-r', 'scrollable-y', 'scrollable-y-d', 'scrollable-y-u']);
|
|
@@ -1789,11 +1776,9 @@ definePrototype(ScrollableMixin, ClassNameMixin, {
|
|
|
1789
1776
|
var options = this.options || {};
|
|
1790
1777
|
return extend({}, ScrollableMixinSuper.getCustomAttributes.call(this), {
|
|
1791
1778
|
'scrollable': [options.direction || 'both', options.handle || 'auto'].join(' ')
|
|
1792
|
-
}, options.
|
|
1793
|
-
'var': '{ pageIndex: 0 }',
|
|
1779
|
+
}, options.pagedItemSelector && {
|
|
1794
1780
|
'scroller-snap-page': options.paged,
|
|
1795
|
-
'scroller-page': options.pagedItemSelector
|
|
1796
|
-
'scroller-state': 'pageIndex'
|
|
1781
|
+
'scroller-page': options.pagedItemSelector
|
|
1797
1782
|
}, options.persistScroll && {
|
|
1798
1783
|
'persist-scroll': ''
|
|
1799
1784
|
});
|
|
@@ -1804,12 +1789,8 @@ definePrototype(ScrollableMixin, ClassNameMixin, {
|
|
|
1804
1789
|
initElement: function initElement(element, state) {
|
|
1805
1790
|
var self = this;
|
|
1806
1791
|
self.onDispose(app_app.on(element, {
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
extend(self, {
|
|
1810
|
-
pageIndex: e.newValues.pageIndex
|
|
1811
|
-
});
|
|
1812
|
-
}
|
|
1792
|
+
scrollIndexChange: function scrollIndexChange(e) {
|
|
1793
|
+
self.pageIndex = e.newIndex;
|
|
1813
1794
|
},
|
|
1814
1795
|
scrollStart: function scrollStart() {
|
|
1815
1796
|
self.scrolling = true;
|
|
@@ -1821,14 +1802,16 @@ definePrototype(ScrollableMixin, ClassNameMixin, {
|
|
|
1821
1802
|
},
|
|
1822
1803
|
clone: function clone() {
|
|
1823
1804
|
var mixin = ScrollableMixinSuper.clone.call(this);
|
|
1824
|
-
|
|
1805
|
+
each(ScrollableMixin_aliasProps, function (i, v) {
|
|
1806
|
+
defineAliasProperty(mixin, v, self);
|
|
1807
|
+
});
|
|
1825
1808
|
return mixin;
|
|
1826
1809
|
}
|
|
1827
1810
|
});
|
|
1828
|
-
each('destroy enable disable setOptions refresh scrollPadding stop scrollLeft scrollTop scrollBy scrollTo scrollByPage scrollToPage scrollToElement', function (i, v) {
|
|
1811
|
+
each('destroy enable disable setOptions setStickyPosition refresh scrollPadding stop scrollLeft scrollTop scrollBy scrollTo scrollByPage scrollToPage scrollToElement', function (i, v) {
|
|
1829
1812
|
defineHiddenProperty(ScrollableMixin.prototype, v, function () {
|
|
1830
|
-
var obj =
|
|
1831
|
-
return obj.scrollable.apply(
|
|
1813
|
+
var obj = getDirectiveComponent(this.elements()[0]);
|
|
1814
|
+
return obj.scrollable[v].apply(null, arguments);
|
|
1832
1815
|
});
|
|
1833
1816
|
});
|
|
1834
1817
|
;// CONCATENATED MODULE: ./src/mixins/ScrollIntoViewMixin.js
|