sproutjs-core 2.9.1 → 2.9.2
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/package.json +1 -1
- package/sprout-core.js +118 -79
- package/sprout-core.js.map +1 -1
- package/sprout-core.min.js +1 -1
- package/sprout-core.min.js.map +1 -1
- package/sprout-core.strict.js +105 -68
- package/sprout-core.strict.js.map +1 -1
- package/sprout-core.strict.min.js +1 -1
- package/sprout-core.strict.min.js.map +1 -1
package/sprout-core.strict.js
CHANGED
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
throw Error("Can't use ".concat(methodName, " in ReadonlySet"));
|
|
129
129
|
}
|
|
130
130
|
} ]);
|
|
131
|
-
}(_wrapNativeSuper(Set)), OBSERVED_ATTRIBUTES = [ "ref", "hidden" ], BOOLEAN_ATTRIBUTES = new ReadonlySet([ "hidden", "checked", "disabled", "required", "selected" ]), AUTO_ATTRIBUTES_TO_PROPS = new ReadonlySet([ "checked", "disabled", "selected", "src" ]), SUPPORTED_ATTRIBUTES_FOR_BINDING = new ReadonlySet([ "value", "checked" ]), BUILT_IN_STATE_PROPS = new ReadonlySet([ "
|
|
131
|
+
}(_wrapNativeSuper(Set)), OBSERVED_ATTRIBUTES = [ "ref", "hidden" ], BOOLEAN_ATTRIBUTES = new ReadonlySet([ "hidden", "checked", "disabled", "required", "selected" ]), AUTO_ATTRIBUTES_TO_PROPS = new ReadonlySet([ "checked", "disabled", "selected", "src" ]), SUPPORTED_ATTRIBUTES_FOR_BINDING = new ReadonlySet([ "value", "checked" ]), BUILT_IN_STATE_PROPS = new ReadonlySet([ "$host", "_global", "_stateManager", "_isActive", "_isStateManager", "populate", "hasOwnProperty" ]), GLOBAL_STATE_NOT_SET_YET = "Global State Not Set Yet", HTML_ELEMENT_CLASSES_MAP = (Object.freeze({
|
|
132
132
|
NO_DEPENDENCIES_ARRAY_IN_SET_HOOK: function NO_DEPENDENCIES_ARRAY_IN_SET_HOOK(stateProp) {
|
|
133
133
|
return "State set hook, must include a dependencies array! None was found for ".concat(stateProp);
|
|
134
134
|
}
|
|
@@ -327,6 +327,7 @@
|
|
|
327
327
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
328
328
|
return n;
|
|
329
329
|
}
|
|
330
|
+
new CustomElementRegistry;
|
|
330
331
|
var pendingPaintNodeManagers = NODES_STATE.pendingPaintNodeManagers, rafIds = new Map;
|
|
331
332
|
function queueAnimationFrame(functionsToRun, type, afterRunFn) {
|
|
332
333
|
var rafId;
|
|
@@ -715,21 +716,42 @@
|
|
|
715
716
|
host.propAttributes.has(propName) || host.propAttributes.set(propName, new Set),
|
|
716
717
|
host.propAttributes.get(propName).add(attrNode);
|
|
717
718
|
}
|
|
719
|
+
function parse_utils_arrayLikeToArray(r, a) {
|
|
720
|
+
(null == a || a > r.length) && (a = r.length);
|
|
721
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
722
|
+
return n;
|
|
723
|
+
}
|
|
718
724
|
function parseStateExpression(expression) {
|
|
719
725
|
if (0 === expression.indexOf("@")) return [ "property", [ expression.substring(1) ] ];
|
|
720
726
|
if (0 === expression.indexOf("!")) return [ "negation", [ expression.substring(1) ] ];
|
|
721
727
|
for (var _char, charIndex = 0, parsed = expression[charIndex]; charIndex++ < expression.length; ) {
|
|
722
728
|
if (_char = expression[charIndex], 3 == charIndex && "is_" == parsed) return [ "equality", expression.substring(3).split(":") ];
|
|
723
|
-
if ("?" === _char) return [ "ternary", parsed
|
|
729
|
+
if ("?" === _char) return [ "ternary", [ parsed ].concat((r = expression.substring(charIndex + 1).split(":"),
|
|
730
|
+
function parse_utils_arrayWithoutHoles(r) {
|
|
731
|
+
if (Array.isArray(r)) return parse_utils_arrayLikeToArray(r);
|
|
732
|
+
}(r) || function parse_utils_iterableToArray(r) {
|
|
733
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
734
|
+
}(r) || function parse_utils_unsupportedIterableToArray(r, a) {
|
|
735
|
+
if (r) {
|
|
736
|
+
if ("string" == typeof r) return parse_utils_arrayLikeToArray(r, a);
|
|
737
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
738
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? parse_utils_arrayLikeToArray(r, a) : void 0;
|
|
739
|
+
}
|
|
740
|
+
}(r) || function parse_utils_nonIterableSpread() {
|
|
741
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
742
|
+
}())) ];
|
|
724
743
|
parsed += _char;
|
|
725
744
|
}
|
|
745
|
+
var r;
|
|
726
746
|
return [ "literal", [ expression ] ];
|
|
727
747
|
}
|
|
728
748
|
function fromAttributeValue(value) {
|
|
729
749
|
return "" === value || null !== value && value;
|
|
730
750
|
}
|
|
731
751
|
function state_utils_slicedToArray(r, e) {
|
|
732
|
-
return
|
|
752
|
+
return function state_utils_arrayWithHoles(r) {
|
|
753
|
+
if (Array.isArray(r)) return r;
|
|
754
|
+
}(r) || function state_utils_iterableToArrayLimit(r, l) {
|
|
733
755
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
734
756
|
if (null != t) {
|
|
735
757
|
var e, n, i, u, a = [], f = !0, o = !1;
|
|
@@ -749,31 +771,21 @@
|
|
|
749
771
|
}
|
|
750
772
|
return a;
|
|
751
773
|
}
|
|
752
|
-
}(r, e) || state_utils_unsupportedIterableToArray(r,
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
}
|
|
762
|
-
function state_utils_unsupportedIterableToArray(r, a) {
|
|
763
|
-
if (r) {
|
|
764
|
-
if ("string" == typeof r) return state_utils_arrayLikeToArray(r, a);
|
|
765
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
766
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? state_utils_arrayLikeToArray(r, a) : void 0;
|
|
767
|
-
}
|
|
774
|
+
}(r, e) || function state_utils_unsupportedIterableToArray(r, a) {
|
|
775
|
+
if (r) {
|
|
776
|
+
if ("string" == typeof r) return state_utils_arrayLikeToArray(r, a);
|
|
777
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
778
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? state_utils_arrayLikeToArray(r, a) : void 0;
|
|
779
|
+
}
|
|
780
|
+
}(r, e) || function state_utils_nonIterableRest() {
|
|
781
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
782
|
+
}();
|
|
768
783
|
}
|
|
769
784
|
function state_utils_arrayLikeToArray(r, a) {
|
|
770
785
|
(null == a || a > r.length) && (a = r.length);
|
|
771
786
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
772
787
|
return n;
|
|
773
788
|
}
|
|
774
|
-
function state_utils_arrayWithHoles(r) {
|
|
775
|
-
if (Array.isArray(r)) return r;
|
|
776
|
-
}
|
|
777
789
|
"undefined" != typeof window && (window.SproutWaitIdle = function waitForIdle() {
|
|
778
790
|
return new Promise((function(resolve) {
|
|
779
791
|
requestAnimationFrame((function check() {
|
|
@@ -791,7 +803,7 @@
|
|
|
791
803
|
return BOOLEAN_ATTRIBUTES.has(attributeName);
|
|
792
804
|
}(attrName) ? elementSetAttribute.call(this, attrName, attrValue) : "false" === attrValue ? this.removeAttribute(attrName) : elementSetAttribute.call(this, attrName, "");
|
|
793
805
|
}, setStateAttribute = function setStateAttribute(attrName, statePropExpression) {
|
|
794
|
-
var _parseStateExpression2 =
|
|
806
|
+
var _parseStateExpression2 = state_utils_slicedToArray(parseStateExpression(statePropExpression), 2), type = _parseStateExpression2[0], args = _parseStateExpression2[1], stateProp = args[0], _this$getState2 = state_utils_slicedToArray(this.getState(stateProp, !0), 2), stateVal = _this$getState2[0], theState = _this$getState2[1], stateManager = theState._stateManager, valueToSet = "literal" === type ? stateVal : stateManager.bindStatePropExpression(statePropExpression, type, args);
|
|
795
807
|
this.removeAttribute(attrName);
|
|
796
808
|
var stateAttrNode = document.createAttribute(attrName);
|
|
797
809
|
stateAttrNode.nodeValue = valueToSet, setHiddenProperty(stateAttrNode, "isStateAttribute", !0),
|
|
@@ -803,7 +815,7 @@
|
|
|
803
815
|
once: !0
|
|
804
816
|
});
|
|
805
817
|
}, setStateText = function setStateText(statePropExpression) {
|
|
806
|
-
var _parseStateExpression4 =
|
|
818
|
+
var _parseStateExpression4 = state_utils_slicedToArray(parseStateExpression(statePropExpression), 2), type = _parseStateExpression4[0], args = _parseStateExpression4[1], stateProp = args[0], _this$getState4 = state_utils_slicedToArray(this.getState(stateProp, !0), 2), stateVal = _this$getState4[0], theState = _this$getState4[1], stateManager = theState._stateManager, valueToSet = "literal" === type ? stateVal : stateManager.bindStatePropExpression(statePropExpression, type, args), textNode = document.createTextNode(valueToSet);
|
|
807
819
|
setHiddenProperty(textNode, "isStateAttribute", !0), theState._stateManager.addStateNode(statePropExpression, textNode),
|
|
808
820
|
this.appendChild(textNode), this.addEventListener("disconnected", (function() {
|
|
809
821
|
theState._stateManager.removeStateNode(statePropExpression, textNode);
|
|
@@ -826,7 +838,7 @@
|
|
|
826
838
|
}));
|
|
827
839
|
}
|
|
828
840
|
function handleStateChange(stateManager, stateProp, changedValue) {
|
|
829
|
-
var _descrp$get;
|
|
841
|
+
var _descrp$get, _stateManager$stateHo, _stateManager$stateHo2;
|
|
830
842
|
if (!isBuiltInStateProp(stateProp)) {
|
|
831
843
|
var newValue = null != changedValue ? changedValue : stateManager.state[stateProp], descrp = Object.getOwnPropertyDescriptor(stateManager.state, stateProp);
|
|
832
844
|
null == descrp || null === (_descrp$get = descrp.get) || void 0 === _descrp$get || _descrp$get.isStateGetter,
|
|
@@ -841,11 +853,16 @@
|
|
|
841
853
|
});
|
|
842
854
|
state.dispatchEvent(stateChangeEvent);
|
|
843
855
|
}(stateManager.state, stateProp, newValue), generateStateNodeActions(stateManager, stateProp, newValue),
|
|
844
|
-
stateProp.startsWith("!") || generateStateNodeActions(stateManager, "!".concat(stateProp), !newValue)
|
|
856
|
+
stateProp.startsWith("!") || generateStateNodeActions(stateManager, "!".concat(stateProp), !newValue),
|
|
857
|
+
null === (_stateManager$stateHo = stateManager.stateHooks.get(stateProp)) || void 0 === _stateManager$stateHo || _stateManager$stateHo.forEach((function(hookFn) {
|
|
858
|
+
hookFn(stateProp, newValue);
|
|
859
|
+
})), null === (_stateManager$stateHo2 = stateManager.stateHooks.get("$$ALL")) || void 0 === _stateManager$stateHo2 || _stateManager$stateHo2.forEach((function(hookFn) {
|
|
860
|
+
hookFn(stateProp, newValue);
|
|
861
|
+
}));
|
|
845
862
|
}
|
|
846
863
|
}
|
|
847
864
|
function isBuiltInStateProp(stateProp) {
|
|
848
|
-
return BUILT_IN_STATE_PROPS.has(stateProp);
|
|
865
|
+
return "string" == typeof stateProp && (0 === stateProp.indexOf("$$") || BUILT_IN_STATE_PROPS.has(stateProp));
|
|
849
866
|
}
|
|
850
867
|
function isSetterHook(stateProp) {
|
|
851
868
|
return 0 === stateProp.indexOf("set_");
|
|
@@ -1741,11 +1758,10 @@
|
|
|
1741
1758
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
1742
1759
|
}, StateManager_typeof(o);
|
|
1743
1760
|
}
|
|
1744
|
-
function StateManager_iterableToArray(r) {
|
|
1745
|
-
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
1746
|
-
}
|
|
1747
1761
|
function StateManager_slicedToArray(r, e) {
|
|
1748
|
-
return
|
|
1762
|
+
return function StateManager_arrayWithHoles(r) {
|
|
1763
|
+
if (Array.isArray(r)) return r;
|
|
1764
|
+
}(r) || function StateManager_iterableToArrayLimit(r, l) {
|
|
1749
1765
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
1750
1766
|
if (null != t) {
|
|
1751
1767
|
var e, n, i, u, a = [], f = !0, o = !1;
|
|
@@ -1765,10 +1781,9 @@
|
|
|
1765
1781
|
}
|
|
1766
1782
|
return a;
|
|
1767
1783
|
}
|
|
1768
|
-
}(r, e) || StateManager_unsupportedIterableToArray(r, e) || StateManager_nonIterableRest()
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1784
|
+
}(r, e) || StateManager_unsupportedIterableToArray(r, e) || function StateManager_nonIterableRest() {
|
|
1785
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1786
|
+
}();
|
|
1772
1787
|
}
|
|
1773
1788
|
function StateManager_unsupportedIterableToArray(r, a) {
|
|
1774
1789
|
if (r) {
|
|
@@ -1782,9 +1797,6 @@
|
|
|
1782
1797
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
1783
1798
|
return n;
|
|
1784
1799
|
}
|
|
1785
|
-
function StateManager_arrayWithHoles(r) {
|
|
1786
|
-
if (Array.isArray(r)) return r;
|
|
1787
|
-
}
|
|
1788
1800
|
function StateManager_defineProperties(e, r) {
|
|
1789
1801
|
for (var t = 0; t < r.length; t++) {
|
|
1790
1802
|
var o = r[t];
|
|
@@ -1833,7 +1845,8 @@
|
|
|
1833
1845
|
StateManager_defineProperty(this, "privateState", {}), StateManager_defineProperty(this, "state", new EventTarget),
|
|
1834
1846
|
StateManager_defineProperty(this, "stateDependencies", new Map), StateManager_defineProperty(this, "parentStateProp", void 0),
|
|
1835
1847
|
StateManager_defineProperty(this, "parentStateManager", void 0), StateManager_defineProperty(this, "dirtyProps", new Set),
|
|
1836
|
-
StateManager_defineProperty(this, "nodeManager", new NodeManager),
|
|
1848
|
+
StateManager_defineProperty(this, "nodeManager", new NodeManager), StateManager_defineProperty(this, "stateHooks", new Map),
|
|
1849
|
+
function StateManager_classPrivateFieldInitSpec(e, t, a) {
|
|
1837
1850
|
(function StateManager_checkPrivateRedeclaration(e, t) {
|
|
1838
1851
|
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
1839
1852
|
})(e, t), t.set(e, a);
|
|
@@ -1841,7 +1854,10 @@
|
|
|
1841
1854
|
this.parentStateManager = parentStateManager, this.handleStateChange = handleStateFunction,
|
|
1842
1855
|
this.appScope = appScope, setHiddenProperty(this.state, "_stateManager", this, !0),
|
|
1843
1856
|
this.state.$$isInitializing = !0, this.state.populate = function(populateObject) {
|
|
1844
|
-
for (var property in populateObject) this.hasOwnProperty(property)
|
|
1857
|
+
for (var property in populateObject) if (this.hasOwnProperty(property)) {
|
|
1858
|
+
if (isBuiltInStateProp(property)) continue;
|
|
1859
|
+
this[property] = populateObject[property];
|
|
1860
|
+
}
|
|
1845
1861
|
}, parentStateProp && parentStateManager && (this.state = function makeReactive(stateObject) {
|
|
1846
1862
|
var appScope = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : window;
|
|
1847
1863
|
return new Proxy(stateObject, function StateObjectValueHandler(rootStateObj, objPropertyName) {
|
|
@@ -1926,7 +1942,7 @@
|
|
|
1926
1942
|
set: function set(value) {
|
|
1927
1943
|
value !== stateManager.privateState[stateProp] && (value = statifyValue(value, stateProp, stateManager, appScope),
|
|
1928
1944
|
stateManager.privateState[stateProp] = value, stateManager.setDirtyProp(stateProp),
|
|
1929
|
-
stateManager.setDirtyProp("".concat(stateProp, ".length")));
|
|
1945
|
+
Array.isArray(value) && stateManager.setDirtyProp("".concat(stateProp, ".length")));
|
|
1930
1946
|
},
|
|
1931
1947
|
get: function get() {
|
|
1932
1948
|
return stateManager.privateState[stateProp];
|
|
@@ -1991,7 +2007,9 @@
|
|
|
1991
2007
|
return function StateManager_toConsumableArray(r) {
|
|
1992
2008
|
return function StateManager_arrayWithoutHoles(r) {
|
|
1993
2009
|
if (Array.isArray(r)) return StateManager_arrayLikeToArray(r);
|
|
1994
|
-
}(r) || StateManager_iterableToArray(r)
|
|
2010
|
+
}(r) || function StateManager_iterableToArray(r) {
|
|
2011
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
2012
|
+
}(r) || StateManager_unsupportedIterableToArray(r) || function StateManager_nonIterableSpread() {
|
|
1995
2013
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1996
2014
|
}();
|
|
1997
2015
|
}(stateProps).toSorted((function(a, b) {
|
|
@@ -2054,13 +2072,11 @@
|
|
|
2054
2072
|
}, {
|
|
2055
2073
|
key: "bindStatePropExpression",
|
|
2056
2074
|
value: function bindStatePropExpression(statePropExpression, type, args) {
|
|
2075
|
+
var contextStateProp = args[0];
|
|
2057
2076
|
if (!type || !args) {
|
|
2058
|
-
var _parseStateExpression2 =
|
|
2059
|
-
|
|
2060
|
-
}(parseStateExpression(statePropExpression));
|
|
2061
|
-
type = _parseStateExpression2[0], args = _parseStateExpression2.slice(1);
|
|
2077
|
+
var _parseStateExpression2 = StateManager_slicedToArray(parseStateExpression(statePropExpression), 2);
|
|
2078
|
+
type = _parseStateExpression2[0], args = _parseStateExpression2[1], contextStateProp = args[0];
|
|
2062
2079
|
}
|
|
2063
|
-
var contextStateProp = args[0];
|
|
2064
2080
|
if (!contextStateProp) throw Error("Must specify state property name for State expression: ".concat(statePropExpression));
|
|
2065
2081
|
var stateObj = this.state, descriptor = Object.getOwnPropertyDescriptor(stateObj, contextStateProp);
|
|
2066
2082
|
if (descriptor || (stateObj = stateObj._global, descriptor = Object.getOwnPropertyDescriptor(stateObj, contextStateProp)),
|
|
@@ -2111,6 +2127,17 @@
|
|
|
2111
2127
|
value: function isUsing(pluginName) {
|
|
2112
2128
|
return StateManager_classPrivateFieldGet(_plugins, this).has(pluginName);
|
|
2113
2129
|
}
|
|
2130
|
+
}, {
|
|
2131
|
+
key: "addStateHook",
|
|
2132
|
+
value: function addStateHook(hookFunction) {
|
|
2133
|
+
var _this$stateHooks$get, _this5 = this, stateProps = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [];
|
|
2134
|
+
stateProps.length ? stateProps.forEach((function(stateProp) {
|
|
2135
|
+
var _this5$stateHooks$get;
|
|
2136
|
+
(null !== (_this5$stateHooks$get = _this5.stateHooks.get(stateProp)) && void 0 !== _this5$stateHooks$get ? _this5$stateHooks$get : (_this5.stateHooks.set(stateProp, new Set),
|
|
2137
|
+
_this5.stateHooks.get(stateProp))).add(hookFunction);
|
|
2138
|
+
})) : (null !== (_this$stateHooks$get = this.stateHooks.get("$$ALL")) && void 0 !== _this$stateHooks$get ? _this$stateHooks$get : (this.stateHooks.set("$$ALL", new Set),
|
|
2139
|
+
this.stateHooks.get("$$ALL"))).add(hookFunction);
|
|
2140
|
+
}
|
|
2114
2141
|
} ]);
|
|
2115
2142
|
}();
|
|
2116
2143
|
const Cougar_StateManager = StateManager;
|
|
@@ -2263,9 +2290,10 @@
|
|
|
2263
2290
|
this.bindAttributeToState(attributeName, statePropName);
|
|
2264
2291
|
},
|
|
2265
2292
|
bindprop: function bindprop(commandValue) {
|
|
2266
|
-
var _commandValue$split6 = commands_slicedToArray(commandValue.split(":"), 2), statePropName = _commandValue$split6[0], elementPropName = _commandValue$split6[1], _this$getState2 = commands_slicedToArray(this.getState(statePropName, !0), 2),
|
|
2267
|
-
|
|
2268
|
-
|
|
2293
|
+
var _this = this, _commandValue$split6 = commands_slicedToArray(commandValue.split(":"), 2), statePropName = _commandValue$split6[0], elementPropName = _commandValue$split6[1], _this$getState2 = commands_slicedToArray(this.getState(statePropName, !0), 2), stateValue = _this$getState2[0], stateObject = _this$getState2[1];
|
|
2294
|
+
this[elementPropName] = stateValue, stateObject._stateManager.addStateHook((function(_, newValue) {
|
|
2295
|
+
_this[elementPropName] = newValue;
|
|
2296
|
+
}), [ statePropName ]);
|
|
2269
2297
|
}
|
|
2270
2298
|
};
|
|
2271
2299
|
function ReactiveElement_typeof(o) {
|
|
@@ -2400,10 +2428,16 @@
|
|
|
2400
2428
|
ReactiveElement_checkPrivateRedeclaration(e, a), a.add(e);
|
|
2401
2429
|
}(_this = ReactiveElement_callSuper(this, ReactiveElement), _ReactiveElement_brand),
|
|
2402
2430
|
ReactiveElement_defineProperty(_this, "host", null), ReactiveElement_classPrivateFieldInitSpec(_this, _wasMounted, !1),
|
|
2403
|
-
ReactiveElement_defineProperty(_this, "refName", void 0),
|
|
2431
|
+
ReactiveElement_defineProperty(_this, "refName", void 0), ReactiveElement_defineProperty(_this, "boundStateToProperties", new Map),
|
|
2432
|
+
ReactiveElement_classPrivateFieldInitSpec(_this, _pendingAttributeChanges, []),
|
|
2404
2433
|
_this.isReactiveElement = !0, _this.isNativeElement = !0, _this;
|
|
2405
2434
|
}
|
|
2406
2435
|
return ReactiveElement_inherits(ReactiveElement, _elementClass), ReactiveElement_createClass(ReactiveElement, [ {
|
|
2436
|
+
key: "bindStateToProperty",
|
|
2437
|
+
value: function bindStateToProperty(statePropName, elementProprtyName) {
|
|
2438
|
+
this.boundStateToProperties.set(statePropName, elementProprtyName);
|
|
2439
|
+
}
|
|
2440
|
+
}, {
|
|
2407
2441
|
key: "activate",
|
|
2408
2442
|
value: function activate() {
|
|
2409
2443
|
var _step, _this2 = this, commands = [], _iterator = function ReactiveElement_createForOfIteratorHelper(r, e) {
|
|
@@ -2505,6 +2539,9 @@
|
|
|
2505
2539
|
var _this$host, host = null !== (_this$host = this.host) && void 0 !== _this$host ? _this$host : this;
|
|
2506
2540
|
host.ref && delete host.ref[this.refName];
|
|
2507
2541
|
}
|
|
2542
|
+
}, {
|
|
2543
|
+
key: "connectedMoveCallback",
|
|
2544
|
+
value: function connectedMoveCallback() {}
|
|
2508
2545
|
}, {
|
|
2509
2546
|
key: "attributeChangedCallback",
|
|
2510
2547
|
value: function attributeChangedCallback(attributeName, oldValue, newValue) {
|
|
@@ -3639,7 +3676,7 @@
|
|
|
3639
3676
|
return ReactiveCustomElement;
|
|
3640
3677
|
}(appScope), function build(appScope, appName) {
|
|
3641
3678
|
function _defineCustomElementFromTemplate() {
|
|
3642
|
-
return
|
|
3679
|
+
return _defineCustomElementFromTemplate = function _asyncToGenerator(n) {
|
|
3643
3680
|
return function() {
|
|
3644
3681
|
var t = this, e = arguments;
|
|
3645
3682
|
return new Promise((function(r, o) {
|
|
@@ -3653,43 +3690,43 @@
|
|
|
3653
3690
|
_next(void 0);
|
|
3654
3691
|
}));
|
|
3655
3692
|
};
|
|
3656
|
-
}(_regeneratorRuntime().mark((function
|
|
3693
|
+
}(_regeneratorRuntime().mark((function _callee(template, elemName, globalStylesheet) {
|
|
3657
3694
|
var templateContent, style, runtime, runtimeScript, runtimeCode;
|
|
3658
|
-
return _regeneratorRuntime().wrap((function
|
|
3659
|
-
for (;;) switch (
|
|
3695
|
+
return _regeneratorRuntime().wrap((function _callee$(_context) {
|
|
3696
|
+
for (;;) switch (_context.prev = _context.next) {
|
|
3660
3697
|
case 0:
|
|
3661
3698
|
if (templateContent = template.content, (style = templateContent.querySelector("style")) && templateContent.removeChild(style),
|
|
3662
3699
|
(runtimeScript = templateContent.querySelector("script")) && (runtimeCode = runtimeScript.textContent,
|
|
3663
3700
|
templateContent.removeChild(runtimeScript), runtimeCode && 0 !== runtimeCode.trim().length)) try {
|
|
3664
3701
|
runtime = Function(runtimeCode)();
|
|
3665
3702
|
} catch (e) {}
|
|
3666
|
-
customElements.define(elemName, function(_appScope$
|
|
3667
|
-
function
|
|
3703
|
+
customElements.define(elemName, function(_appScope$ReactiveCus) {
|
|
3704
|
+
function _class() {
|
|
3668
3705
|
var _style;
|
|
3669
|
-
return build_classCallCheck(this,
|
|
3706
|
+
return build_classCallCheck(this, _class), build_callSuper(this, _class, [ templateContent, runtime, null === (_style = style) || void 0 === _style ? void 0 : _style.textContent, globalStylesheet ]);
|
|
3670
3707
|
}
|
|
3671
|
-
return build_inherits(
|
|
3672
|
-
}(appScope.ReactiveCustomElement)), customElements.define("".concat(elemName, "-dsd"), function(_appScope$
|
|
3673
|
-
function
|
|
3674
|
-
return build_classCallCheck(this,
|
|
3708
|
+
return build_inherits(_class, _appScope$ReactiveCus), build_createClass(_class);
|
|
3709
|
+
}(appScope.ReactiveCustomElement)), customElements.define("".concat(elemName, "-dsd"), function(_appScope$ReactiveCus2) {
|
|
3710
|
+
function _class2() {
|
|
3711
|
+
return build_classCallCheck(this, _class2), build_callSuper(this, _class2, [ templateContent, runtime, null, globalStylesheet, !0 ]);
|
|
3675
3712
|
}
|
|
3676
|
-
return build_inherits(
|
|
3713
|
+
return build_inherits(_class2, _appScope$ReactiveCus2), build_createClass(_class2);
|
|
3677
3714
|
}(appScope.ReactiveCustomElement));
|
|
3678
3715
|
|
|
3679
3716
|
case 7:
|
|
3680
3717
|
case "end":
|
|
3681
|
-
return
|
|
3718
|
+
return _context.stop();
|
|
3682
3719
|
}
|
|
3683
|
-
}),
|
|
3684
|
-
})))
|
|
3720
|
+
}), _callee);
|
|
3721
|
+
}))), _defineCustomElementFromTemplate.apply(this, arguments);
|
|
3685
3722
|
}
|
|
3686
|
-
|
|
3723
|
+
appScope.scopedCustomElementRegistry, function build() {
|
|
3687
3724
|
var globalStylesheet = new CSSStyleSheet, globalStyle = document.querySelector('head > style[app="'.concat(appName, '"]'));
|
|
3688
3725
|
globalStyle ? globalStylesheet.replaceSync(globalStyle.textContent) : globalStylesheet.replaceSync(""),
|
|
3689
3726
|
globalStylesheet.insertRule(SPROUT_FROZEN_CLASS_CSS), "function" == typeof globalThis["".concat(appName, "_runtime")] && globalThis["".concat(appName, "_runtime")].call(appScope),
|
|
3690
3727
|
Array.prototype.forEach.call(document.querySelectorAll('template[app="'.concat(appName, '"]')), (function(template) {
|
|
3691
3728
|
var componentName = template.getAttribute("for");
|
|
3692
|
-
componentName && function defineCustomElementFromTemplate(
|
|
3729
|
+
componentName && function defineCustomElementFromTemplate(_x, _x2, _x3) {
|
|
3693
3730
|
_defineCustomElementFromTemplate.apply(this, arguments);
|
|
3694
3731
|
}(template, componentName, globalStylesheet);
|
|
3695
3732
|
}));
|