s-platform-landing-section 0.1.10-alpha.5 → 0.1.10-alpha.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/index.js +95 -82
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +95 -82
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17,6 +17,57 @@ var io = require('react-icons/io');
|
|
|
17
17
|
var si = require('react-icons/si');
|
|
18
18
|
var go = require('react-icons/go');
|
|
19
19
|
|
|
20
|
+
function _arrayLikeToArray(r, a) {
|
|
21
|
+
(null == a || a > r.length) && (a = r.length);
|
|
22
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
23
|
+
return n;
|
|
24
|
+
}
|
|
25
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
26
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
27
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
28
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
29
|
+
t && (r = t);
|
|
30
|
+
var o = 0;
|
|
31
|
+
return function () {
|
|
32
|
+
return o >= r.length ? {
|
|
33
|
+
done: !0
|
|
34
|
+
} : {
|
|
35
|
+
done: !1,
|
|
36
|
+
value: r[o++]
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
41
|
+
}
|
|
42
|
+
function _extends() {
|
|
43
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
44
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
45
|
+
var t = arguments[e];
|
|
46
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
47
|
+
}
|
|
48
|
+
return n;
|
|
49
|
+
}, _extends.apply(null, arguments);
|
|
50
|
+
}
|
|
51
|
+
function _objectDestructuringEmpty(t) {
|
|
52
|
+
if (null == t) throw new TypeError("Cannot destructure " + t);
|
|
53
|
+
}
|
|
54
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
55
|
+
if (null == r) return {};
|
|
56
|
+
var t = {};
|
|
57
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
58
|
+
if (e.includes(n)) continue;
|
|
59
|
+
t[n] = r[n];
|
|
60
|
+
}
|
|
61
|
+
return t;
|
|
62
|
+
}
|
|
63
|
+
function _unsupportedIterableToArray(r, a) {
|
|
64
|
+
if (r) {
|
|
65
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
66
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
67
|
+
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) ? _arrayLikeToArray(r, a) : void 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
20
71
|
var Button = function Button(props) {
|
|
21
72
|
var _props$label = props.label,
|
|
22
73
|
label = _props$label === void 0 ? "" : _props$label,
|
|
@@ -40,6 +91,13 @@ var Button = function Button(props) {
|
|
|
40
91
|
}, label);
|
|
41
92
|
};
|
|
42
93
|
|
|
94
|
+
var _excluded = ["Link"];
|
|
95
|
+
var LinkToPage = function LinkToPage(props) {
|
|
96
|
+
var _props$Link = props.Link,
|
|
97
|
+
Link = _props$Link === void 0 ? null : _props$Link,
|
|
98
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
99
|
+
return Link ? /*#__PURE__*/React__default.createElement(Link, otherProps, props.children) : /*#__PURE__*/React__default.createElement("a", otherProps, props.children);
|
|
100
|
+
};
|
|
43
101
|
var NavBar7 = function NavBar7(props) {
|
|
44
102
|
var _routes$filter;
|
|
45
103
|
var _useState = React.useState(false),
|
|
@@ -50,14 +108,17 @@ var NavBar7 = function NavBar7(props) {
|
|
|
50
108
|
shopConfigStyle = props.shopConfigStyle,
|
|
51
109
|
_props$routes = props.routes,
|
|
52
110
|
routes = _props$routes === void 0 ? [] : _props$routes,
|
|
53
|
-
_props$
|
|
54
|
-
|
|
111
|
+
_props$currentRoute = props.currentRoute,
|
|
112
|
+
currentRoute = _props$currentRoute === void 0 ? null : _props$currentRoute,
|
|
55
113
|
_props$userInfo = props.userInfo,
|
|
56
114
|
userInfo = _props$userInfo === void 0 ? null : _props$userInfo,
|
|
57
|
-
_props$
|
|
58
|
-
|
|
115
|
+
_props$Link2 = props.Link,
|
|
116
|
+
Link = _props$Link2 === void 0 ? null : _props$Link2,
|
|
59
117
|
_props$useSelector = props.useSelector,
|
|
60
118
|
useSelector = _props$useSelector === void 0 ? null : _props$useSelector;
|
|
119
|
+
var cartItems = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
|
|
120
|
+
return state.cart.items;
|
|
121
|
+
});
|
|
61
122
|
var _useState2 = React.useState(""),
|
|
62
123
|
totalItem = _useState2[0],
|
|
63
124
|
setTotalItem = _useState2[1];
|
|
@@ -71,15 +132,9 @@ var NavBar7 = function NavBar7(props) {
|
|
|
71
132
|
}
|
|
72
133
|
setTotalItem(totalItem);
|
|
73
134
|
}, [cartItems]);
|
|
74
|
-
var cartItems2 = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
|
|
75
|
-
return state.cart.items;
|
|
76
|
-
});
|
|
77
|
-
console.log("NavBar7 cartItems2", cartItems2);
|
|
78
|
-
React.useEffect(function () {
|
|
79
|
-
console.log("NavBar7 cartItems2", cartItems2);
|
|
80
|
-
}, [cartItems2]);
|
|
81
135
|
var cart = function cart() {
|
|
82
|
-
return /*#__PURE__*/React__default.createElement(
|
|
136
|
+
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
137
|
+
Link: Link,
|
|
83
138
|
href: "/carts"
|
|
84
139
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
85
140
|
className: "relative cursor-pointer"
|
|
@@ -94,7 +149,8 @@ var NavBar7 = function NavBar7(props) {
|
|
|
94
149
|
className: "w-full sticky top-0 shadow z-50 bg-background"
|
|
95
150
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
96
151
|
className: "hidden lg:flex gap-6 justify-between items-center py-2 px-4 xl:px-20"
|
|
97
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
152
|
+
}, /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
153
|
+
Link: Link,
|
|
98
154
|
href: "/",
|
|
99
155
|
className: "flex items-center gap-2"
|
|
100
156
|
}, /*#__PURE__*/React__default.createElement("img", {
|
|
@@ -108,9 +164,10 @@ var NavBar7 = function NavBar7(props) {
|
|
|
108
164
|
}, routes === null || routes === void 0 ? void 0 : (_routes$filter = routes.filter(function (e) {
|
|
109
165
|
return e === null || e === void 0 ? void 0 : e.isShow;
|
|
110
166
|
})) === null || _routes$filter === void 0 ? void 0 : _routes$filter.map(function (route, index) {
|
|
111
|
-
return /*#__PURE__*/React__default.createElement(
|
|
167
|
+
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
168
|
+
Link: Link,
|
|
112
169
|
href: route === null || route === void 0 ? void 0 : route.route
|
|
113
|
-
}, (
|
|
170
|
+
}, (currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.name) === (route === null || route === void 0 ? void 0 : route.name) ? /*#__PURE__*/React__default.createElement("div", {
|
|
114
171
|
className: "py-1 border-b text-textHeading border-textHeading"
|
|
115
172
|
}, route === null || route === void 0 ? void 0 : route.label) : /*#__PURE__*/React__default.createElement("div", {
|
|
116
173
|
className: "py-1"
|
|
@@ -143,7 +200,8 @@ var NavBar7 = function NavBar7(props) {
|
|
|
143
200
|
type: 'outline'
|
|
144
201
|
})))), /*#__PURE__*/React__default.createElement("div", {
|
|
145
202
|
className: "relative lg:hidden flex gap-4 items-center px-4 py-2"
|
|
146
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
203
|
+
}, /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
204
|
+
Link: Link,
|
|
147
205
|
href: "/",
|
|
148
206
|
className: "flex flex-1 gap-2 items-center"
|
|
149
207
|
}, /*#__PURE__*/React__default.createElement("img", {
|
|
@@ -178,10 +236,11 @@ var NavBar7 = function NavBar7(props) {
|
|
|
178
236
|
}, /*#__PURE__*/React__default.createElement(rx.RxCross2, {
|
|
179
237
|
size: 24
|
|
180
238
|
})), /*#__PURE__*/React__default.createElement("div", null, routes === null || routes === void 0 ? void 0 : routes.map(function (route, index) {
|
|
181
|
-
return /*#__PURE__*/React__default.createElement(
|
|
239
|
+
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
240
|
+
Link: Link,
|
|
182
241
|
href: route === null || route === void 0 ? void 0 : route.route
|
|
183
242
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
184
|
-
className: "py-2 " + ((
|
|
243
|
+
className: "py-2 " + ((currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.name) === (route === null || route === void 0 ? void 0 : route.name) ? "text-textHeading" : "")
|
|
185
244
|
}, route === null || route === void 0 ? void 0 : route.label));
|
|
186
245
|
})))) : null));
|
|
187
246
|
};
|
|
@@ -339,57 +398,6 @@ function _catch(body, recover) {
|
|
|
339
398
|
return result;
|
|
340
399
|
}
|
|
341
400
|
|
|
342
|
-
function _arrayLikeToArray(r, a) {
|
|
343
|
-
(null == a || a > r.length) && (a = r.length);
|
|
344
|
-
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
345
|
-
return n;
|
|
346
|
-
}
|
|
347
|
-
function _createForOfIteratorHelperLoose(r, e) {
|
|
348
|
-
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
349
|
-
if (t) return (t = t.call(r)).next.bind(t);
|
|
350
|
-
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
351
|
-
t && (r = t);
|
|
352
|
-
var o = 0;
|
|
353
|
-
return function () {
|
|
354
|
-
return o >= r.length ? {
|
|
355
|
-
done: !0
|
|
356
|
-
} : {
|
|
357
|
-
done: !1,
|
|
358
|
-
value: r[o++]
|
|
359
|
-
};
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
363
|
-
}
|
|
364
|
-
function _extends() {
|
|
365
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
366
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
367
|
-
var t = arguments[e];
|
|
368
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
369
|
-
}
|
|
370
|
-
return n;
|
|
371
|
-
}, _extends.apply(null, arguments);
|
|
372
|
-
}
|
|
373
|
-
function _objectDestructuringEmpty(t) {
|
|
374
|
-
if (null == t) throw new TypeError("Cannot destructure " + t);
|
|
375
|
-
}
|
|
376
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
377
|
-
if (null == r) return {};
|
|
378
|
-
var t = {};
|
|
379
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
380
|
-
if (e.includes(n)) continue;
|
|
381
|
-
t[n] = r[n];
|
|
382
|
-
}
|
|
383
|
-
return t;
|
|
384
|
-
}
|
|
385
|
-
function _unsupportedIterableToArray(r, a) {
|
|
386
|
-
if (r) {
|
|
387
|
-
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
388
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
389
|
-
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) ? _arrayLikeToArray(r, a) : void 0;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
|
|
393
401
|
function bind(fn, thisArg) {
|
|
394
402
|
return function wrap() {
|
|
395
403
|
return fn.apply(thisArg, arguments);
|
|
@@ -1710,12 +1718,12 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
1710
1718
|
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
1711
1719
|
|
|
1712
1720
|
var utils$1 = {
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1721
|
+
__proto__: null,
|
|
1722
|
+
hasBrowserEnv: hasBrowserEnv,
|
|
1723
|
+
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
1724
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
1725
|
+
navigator: _navigator,
|
|
1726
|
+
origin: origin
|
|
1719
1727
|
};
|
|
1720
1728
|
|
|
1721
1729
|
var platform$1 = {
|
|
@@ -4854,8 +4862,8 @@ var callBound = function callBoundIntrinsic(name, allowMissing) {
|
|
|
4854
4862
|
var _nodeResolve_empty = {};
|
|
4855
4863
|
|
|
4856
4864
|
var _nodeResolve_empty$1 = {
|
|
4857
|
-
|
|
4858
|
-
|
|
4865
|
+
__proto__: null,
|
|
4866
|
+
'default': _nodeResolve_empty
|
|
4859
4867
|
};
|
|
4860
4868
|
|
|
4861
4869
|
var utilInspect = getCjsExportFromNamespace(_nodeResolve_empty$1);
|
|
@@ -7134,7 +7142,7 @@ var createSpaScheduleApi = function createSpaScheduleApi(shopId, data) {
|
|
|
7134
7142
|
});
|
|
7135
7143
|
};
|
|
7136
7144
|
|
|
7137
|
-
var _excluded = ["productName"];
|
|
7145
|
+
var _excluded$1 = ["productName"];
|
|
7138
7146
|
var BookingController = function BookingController(props) {
|
|
7139
7147
|
_objectDestructuringEmpty(props);
|
|
7140
7148
|
var createSchedule = function createSchedule(customerName, customerPhone, scheduleDate, services, shopId) {
|
|
@@ -7148,7 +7156,7 @@ var BookingController = function BookingController(props) {
|
|
|
7148
7156
|
scheduleDate: new Date(scheduleDate).getTime(),
|
|
7149
7157
|
services: services === null || services === void 0 ? void 0 : services.map(function (_ref) {
|
|
7150
7158
|
var productName = _ref.productName,
|
|
7151
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
7159
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
7152
7160
|
return rest;
|
|
7153
7161
|
}),
|
|
7154
7162
|
shopId: shopId
|
|
@@ -9164,15 +9172,20 @@ var ProductDetail10 = function ProductDetail10(props) {
|
|
|
9164
9172
|
var indexOptions = variant.index.split(",");
|
|
9165
9173
|
setVariant(variant);
|
|
9166
9174
|
var options = (product === null || product === void 0 ? void 0 : product.optionValues) || [];
|
|
9167
|
-
|
|
9168
|
-
return
|
|
9175
|
+
options = options.map(function (e, i) {
|
|
9176
|
+
return _extends({}, e, {
|
|
9177
|
+
valueIndex: (indexOptions === null || indexOptions === void 0 ? void 0 : indexOptions[i]) || 0
|
|
9178
|
+
});
|
|
9169
9179
|
});
|
|
9170
9180
|
setOptions(options);
|
|
9171
9181
|
};
|
|
9172
9182
|
var selectOption = function selectOption(optionIndex, valueIndex) {
|
|
9173
9183
|
console.log("selectOption optionIndex valueIndex", optionIndex, valueIndex);
|
|
9184
|
+
var newOption = _extends({}, options[optionIndex], {
|
|
9185
|
+
valueIndex: valueIndex
|
|
9186
|
+
});
|
|
9187
|
+
options.splice(optionIndex, 1, newOption);
|
|
9174
9188
|
var newOptions = [].concat(options);
|
|
9175
|
-
newOptions[optionIndex].valueIndex = valueIndex;
|
|
9176
9189
|
setOptions(newOptions);
|
|
9177
9190
|
console.log("newOptions", newOptions);
|
|
9178
9191
|
var variant = getVariantFromOption(newOptions);
|