shop-components 0.1.50 → 0.1.51
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
export interface SlotItemProps {
|
|
3
3
|
name: string;
|
|
4
|
+
onRemove?: () => void;
|
|
4
5
|
}
|
|
5
6
|
export declare class SlotItem extends LitElement {
|
|
6
7
|
props: SlotItemProps;
|
|
@@ -19,6 +20,7 @@ export declare class SlotItem extends LitElement {
|
|
|
19
20
|
deviceName: string;
|
|
20
21
|
slot: any;
|
|
21
22
|
get hasMoreFunctions(): boolean;
|
|
23
|
+
removeDevice: () => void;
|
|
22
24
|
onClick(e: MouseEvent): void;
|
|
23
25
|
setSize(size?: number): void;
|
|
24
26
|
addFunction(f: string): void;
|
|
@@ -64,6 +64,7 @@ export declare class Slot extends CSS2DObject {
|
|
|
64
64
|
get functions(): string[];
|
|
65
65
|
addFunction(f: string): void;
|
|
66
66
|
removeFunction(f: string): void;
|
|
67
|
+
clearFunctions(): void;
|
|
67
68
|
addFunctions(fs: string[]): void;
|
|
68
69
|
changeName(name: string): void;
|
|
69
70
|
clearSlot(): void;
|
package/dist/shop-components.mjs
CHANGED
|
@@ -57272,7 +57272,7 @@ function Zc(n, A) {
|
|
|
57272
57272
|
} });
|
|
57273
57273
|
};
|
|
57274
57274
|
}
|
|
57275
|
-
const nj = '*{box-sizing:border-box}.slot-item-container .main{pointer-events:auto;cursor:pointer;font-size:12px;color:#fff;width:12px;height:12px;background:#fff0;border:1px solid #fff;border-radius:50%;transition:background .2s,width .14s,height .14s,border .14s}.slot-item-container .main.disable{cursor:not-allowed}.slot-item-container .main.drag-over{border-color:red}.slot-item-container .main.can-install{position:relative;width:34px;height:34px;background:#0066ff1a;border-color:#06f}.slot-item-container .main.filled{border-color:#00ff95}.slot-item-container .main.selected{border-width:4px}.slot-item-container .main.selected+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .main.has-error{border-color:red}.slot-item-container .main.hidden{display:none}.slot-item-container .main.hidden+.info{display:none}.slot-item-container .main:after{pointer-events:none;content:attr(data-name);transition:all .2s .3s;opacity:0;position:absolute;left:50%;bottom:100%;transform:translate3d(-50%,5px,0);white-space:nowrap;font-size:12px;color:#000;padding:2px 8px;border-radius:2px;background:#fff}.slot-item-container .main:hover{background:#ffffff80}.slot-item-container .main:hover+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .name{position:relative}.slot-item-container .name-wrapper{margin-top:-10px;white-space:nowrap;font-size:12px;color:#444e69;padding:2px 8px;border-radius:2px;background:#fff}.slot-item-container .functions-wrapper{z-index:20000;position:absolute;left:0;top:100%}.slot-item-container .functions-wrapper>.functions{min-width:100px;padding:6px 0;border-left:1px solid #00ff95;border-radius:0 2px 2px 0;background:#0003;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.slot-item-container .functions-wrapper>.functions .btn-add{cursor:pointer;padding:2px 0;margin:0 8px;display:flex;justify-content:center;align-content:center;align-items:center;border:1px dashed #
|
|
57275
|
+
const nj = '*{box-sizing:border-box}.slot-item-container .main{pointer-events:auto;cursor:pointer;font-size:12px;color:#fff;width:12px;height:12px;background:#fff0;border:1px solid #fff;border-radius:50%;transition:background .2s,width .14s,height .14s,border .14s}.slot-item-container .main.disable{cursor:not-allowed}.slot-item-container .main.drag-over{border-color:red}.slot-item-container .main.can-install{position:relative;width:34px;height:34px;background:#0066ff1a;border-color:#06f}.slot-item-container .main.filled{border-color:#00ff95}.slot-item-container .main.selected{border-width:4px}.slot-item-container .main.selected+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .main.has-error{border-color:red}.slot-item-container .main.hidden{display:none}.slot-item-container .main.hidden+.info{display:none}.slot-item-container .main:after{pointer-events:none;content:attr(data-name);transition:all .2s .3s;opacity:0;position:absolute;left:50%;bottom:100%;transform:translate3d(-50%,5px,0);white-space:nowrap;font-size:12px;color:#000;padding:2px 8px;border-radius:2px;background:#fff}.slot-item-container .main:hover{background:#ffffff80}.slot-item-container .main:hover+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .name{position:relative}.slot-item-container .name-wrapper{margin-top:-10px;white-space:nowrap;font-size:12px;color:#444e69;padding:2px 8px;border-radius:2px;background:#fff}.slot-item-container .functions-wrapper{z-index:20000;position:absolute;left:0;top:100%}.slot-item-container .functions-wrapper>.functions{display:inline-block;min-width:100px;padding:6px 0;border-left:1px solid #00ff95;border-radius:0 2px 2px 0;background:#0003;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.slot-item-container .functions-wrapper>.functions .btn-add{cursor:pointer;padding:2px 0;margin:0 8px;display:flex;justify-content:center;align-content:center;align-items:center;border:1px dashed #eee;font-size:12px;color:#eee;border-radius:2px;-webkit-backdrop-filter:none;backdrop-filter:none;background:#00050a80}.slot-item-container .functions-wrapper>.functions .btn-add.btn-not-allowed{cursor:not-allowed}.slot-item-container .functions-wrapper>.functions .function{display:flex;justify-content:space-between;white-space:nowrap;margin-bottom:6px;padding:0 8px;font-size:12px;color:#eaeeee}.slot-item-container .functions-wrapper>.functions .function span{margin-right:4px}.slot-item-container .functions-wrapper>.functions .function .btn-remove{pointer-events:none;opacity:0;cursor:pointer;align-self:center;margin-right:0;height:14px;width:14px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAACnSURBVEiJxZaxFcMgDETPTuUtWCWTM4pZAq5RojRpnOfEyEKxSnh3HySeBEhNjZJJTRgUG89GyZWilbKOgJCaKmWtFG2UvFnwQr56jYAcengg3dozELPGIjh96x6hu26/DIa9vD0jq/nUA3nikQEkAOW9nACUGbf7skxlX2mIj1Ob0jK76QdxbYpGFNlk3rPnNndDQltFaLMLbdehAyd8ZP5l6Ed+W17xG7oN9QkytAAAAABJRU5ErkJggg==) center no-repeat;background-size:10px 10px}.slot-item-container .functions-wrapper>.functions .function:hover .btn-remove{pointer-events:auto;opacity:1;transform:scale(1.2)}.slot-item-container .device-name{position:relative;margin:2px 0;display:flex;min-width:120px;align-items:center;align-content:center;justify-content:flex-start;white-space:nowrap;height:20px;padding:0 20px 0 8px;font-size:14px;font-weight:700;color:#444e69}.slot-item-container .device-name span{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:250px}.slot-item-container .device-name:hover .btn-close{opacity:1;pointer-events:auto}.slot-item-container .device-name .btn-close{opacity:0;pointer-events:none;cursor:pointer;position:absolute;right:2px;top:2px;height:16px;width:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAB4SURBVDiNpZPLEYAgDAUXe6MuoK4UpwdBwQkQJDcyb9+QnxORCOC9jyxE4Y78DiWxAIcmISKnxaSrtZhMNSOB+ZeacAS7ngl3k1JOBSBpk1INPib0YHjH+Du2S1DhlSZOYbPJ1iLtrLKrG2a9yJopYzTD8Jx+ArgAylOzjm1WpDwAAAAASUVORK5CYII=) center no-repeat;background-size:10px 10px}.slot-item-container .device-name:before{content:"";position:absolute;left:0;height:10px;width:3px;background:#00ff95}.slot-item-container .device-name.empty{height:6px}.slot-item-container .device-name.empty:before{height:0}.slot-item-container .all-functions{opacity:0;pointer-events:none;min-width:80px;position:absolute;left:-10px;margin-left:100%;bottom:0;padding:6px 0;background:#fff;border-radius:2px;transition:all .3s}.slot-item-container .all-functions.show{opacity:1;pointer-events:auto;left:16px}.slot-item-container .all-functions label{margin-left:8px;margin-bottom:20px;color:#444e69;font-size:14px}.slot-item-container .all-functions .btn-close{cursor:pointer;position:absolute;right:7px;top:7px;height:16px;width:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAB4SURBVDiNpZPLEYAgDAUXe6MuoK4UpwdBwQkQJDcyb9+QnxORCOC9jyxE4Y78DiWxAIcmISKnxaSrtZhMNSOB+ZeacAS7ngl3k1JOBSBpk1INPib0YHjH+Du2S1DhlSZOYbPJ1iLtrLKrG2a9yJopYzTD8Jx+ArgAylOzjm1WpDwAAAAASUVORK5CYII=) center no-repeat;background-size:10px 10px}.slot-item-container .all-functions .functions{display:inline-block;max-height:200px;overflow-x:hidden;overflow-y:auto}.slot-item-container .all-functions .functions::-webkit-scrollbar{width:4px}.slot-item-container .all-functions .functions::-webkit-scrollbar-track{background-color:#fff}.slot-item-container .all-functions .functions::-webkit-scrollbar-thumb{background:#787878;border-radius:25px}.slot-item-container .all-functions .function{display:flex;justify-content:space-between;white-space:nowrap;padding:5px 10px;font-size:12px;color:#787878}.slot-item-container .all-functions .function span{display:flex;align-content:center;align-items:center;margin-right:4px}.slot-item-container .all-functions .function:hover{background:#444e6933}.slot-item-container .all-functions .btn-add{cursor:pointer;width:16px;font-size:16px;text-align:center;font-style:normal}.slot-item-container .info{overflow:hidden;margin-left:-2px;margin-top:-19px;position:absolute;left:100%;top:50%;transform:translateY(-50%);width:0;display:flex;align-items:flex-start;transition:all .3s}.slot-item-container .info img{flex:0 0 auto;width:53px;height:29px}', rj = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGsAAAA7CAYAAAB8MXT7AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGTSURBVHic7dxLbQNBEIThnigADGEhxAwcBoZgCIZgBoZgCIZgCIaQMIgZVC4daw/xXPLoqdX/3fbW0milUtfutMCdpCkiLhEx1U6CLkkvkt4k7atnQYekfR7US/Us6JB0yIOaqmfBA5JWks6SrhzUwCRN+TYdq2dBx+ygDtWzoEPSNg9qVz0LOmZBgsQ3sqUkvufqAf6SpFVEnCPiFhHr1tqteCR8hyBhYrY6OlTPgo5cHX1I2lbPgo6lBInFk3Rc+uroqXqAn8ogcc3H19bae+U8eIDEZ0LSJoMEZeHIWB2ZIPEZoCw0QVlogsRnYlYWsjoaGUHCRK6OOKiRfa2OMvWtqufBAwQJE5SFJmZl4aZ6FnSQ+Azk6mjxZeFv+/fycfbDWrTW1pSFgyLxmcjVEWXh6CgLTZD4DMzKwguro4ERJEywOjIhaUdZaIAgYYKy0ABloQkSnwlxKZUHcSmVBxKfgVwdnSgLB8d35iZIfCYoC01QFpog8Y3rftFWrotO+cilVKMiSJigLDSS30hQFhr4BEcKZN0LNhDxAAAAAElFTkSuQmCC";
|
|
57276
57276
|
var sj = Object.defineProperty, oj = Object.getOwnPropertyDescriptor, di = (n, A, e, t) => {
|
|
57277
57277
|
for (var i = t > 1 ? void 0 : t ? oj(A, e) : A, r = n.length - 1, s; r >= 0; r--)
|
|
57278
57278
|
(s = n[r]) && (i = (t ? s(A, e, i) : s(i)) || i);
|
|
@@ -57280,7 +57280,9 @@ var sj = Object.defineProperty, oj = Object.getOwnPropertyDescriptor, di = (n, A
|
|
|
57280
57280
|
};
|
|
57281
57281
|
let qt = class extends Yr {
|
|
57282
57282
|
constructor(n) {
|
|
57283
|
-
super(), this.props = n, this._size = 12, this._showDialog = !1, this.selected = !1, this.hasError = !1, this.canInstall = !1, this.hide = !1, this.disable = !1, this.filled = !1, this.allFunctions = [], this.functions = [], this.deviceName = ""
|
|
57283
|
+
super(), this.props = n, this._size = 12, this._showDialog = !1, this.selected = !1, this.hasError = !1, this.canInstall = !1, this.hide = !1, this.disable = !1, this.filled = !1, this.allFunctions = [], this.functions = [], this.deviceName = "", this.removeDevice = () => {
|
|
57284
|
+
this.props.onRemove && this.props.onRemove();
|
|
57285
|
+
};
|
|
57284
57286
|
}
|
|
57285
57287
|
get hasMoreFunctions() {
|
|
57286
57288
|
return this.allFunctions.length > this.functions.length;
|
|
@@ -57315,7 +57317,10 @@ let qt = class extends Yr {
|
|
|
57315
57317
|
|
|
57316
57318
|
${this.allFunctions.length ? Zi`
|
|
57317
57319
|
<div class="functions-wrapper">
|
|
57318
|
-
<div class="device-name ${!this.deviceName && "empty"}"
|
|
57320
|
+
<div class="device-name ${!this.deviceName && "empty"}">
|
|
57321
|
+
<span>${this.deviceName}</span>
|
|
57322
|
+
<i class="btn btn-close" @click=${this.removeDevice}></i>
|
|
57323
|
+
</div>
|
|
57319
57324
|
<div class="functions">
|
|
57320
57325
|
${this.functions.map((A) => Zi`
|
|
57321
57326
|
<div class="function"><span>${A}</span><i class="btn btn-remove"
|
|
@@ -57325,7 +57330,7 @@ let qt = class extends Yr {
|
|
|
57325
57330
|
</div>
|
|
57326
57331
|
`)}
|
|
57327
57332
|
${Zi`
|
|
57328
|
-
<div class="btn btn-add" @click=${() => {
|
|
57333
|
+
<div class="btn btn-add ${!this.hasMoreFunctions && "btn-not-allowed"}" @click=${() => {
|
|
57329
57334
|
this._showDialog = !this._showDialog;
|
|
57330
57335
|
}}>+添加
|
|
57331
57336
|
</div>`}
|
|
@@ -57411,7 +57416,12 @@ class lI extends Iv {
|
|
|
57411
57416
|
const e = document.createElement("div");
|
|
57412
57417
|
super(e), this.props = A, this._emitter = new Vr(), this._slotContainer = new St(), this._bracketSlots = [], this._hasError = !1, this.useBracket = !1, this.addEventListener = this._emitter.addListener.bind(this._emitter), this.removeEventListener = this._emitter.removeListener.bind(this._emitter), this._canInstall = !1, this._loading = !1, this._selected = !1, this._deviceSelected = !1, this._allFunctions = /* @__PURE__ */ new Set(), this._functions = /* @__PURE__ */ new Set(), this._timer = 0, this._parentPos = new O(), this._wrapper = new St(), this._showSlot = !0, this._preventDefaults = (t) => {
|
|
57413
57418
|
t.preventDefault(), t.stopPropagation();
|
|
57414
|
-
}, this.getWP = this._slotContainer.getWorldPosition.bind(this._slotContainer), this._showSlot = typeof A.show == "boolean" ? A.show : !0, this.name = A.name, this._slotUI = new qt({
|
|
57419
|
+
}, this.getWP = this._slotContainer.getWorldPosition.bind(this._slotContainer), this._showSlot = typeof A.show == "boolean" ? A.show : !0, this.name = A.name, this._slotUI = new qt({
|
|
57420
|
+
name: A.name,
|
|
57421
|
+
onRemove: () => {
|
|
57422
|
+
this.clearSlot();
|
|
57423
|
+
}
|
|
57424
|
+
}), this._slotUI.slot = this, this._slotUI.hide = !this._showSlot, e.append(this._slotUI), this._parentPos.copy(this.props.slot.position), this._slotUI.addEventListener("function-removed", ({ detail: t }) => {
|
|
57415
57425
|
this.removeFunction(t);
|
|
57416
57426
|
}), this._slotUI.addEventListener("function-added", ({ detail: t }) => {
|
|
57417
57427
|
this.addFunction(t);
|
|
@@ -57522,6 +57532,9 @@ class lI extends Iv {
|
|
|
57522
57532
|
removeFunction(A) {
|
|
57523
57533
|
this._functions.has(A) && (this._functions.delete(A), this._slotUI.functions = [...this.functions], this._emitter.emit(xi.ON_FUNCTION_REMOVED, A));
|
|
57524
57534
|
}
|
|
57535
|
+
clearFunctions() {
|
|
57536
|
+
this._functions.forEach((A) => this.removeFunction(A));
|
|
57537
|
+
}
|
|
57525
57538
|
addFunctions(A) {
|
|
57526
57539
|
A.forEach((e) => this.addFunction(e)), this._slotUI.functions = this.functions;
|
|
57527
57540
|
}
|
|
@@ -62475,7 +62488,7 @@ class MI extends Ie {
|
|
|
62475
62488
|
const aH = new hv();
|
|
62476
62489
|
class vK extends Ie {
|
|
62477
62490
|
constructor(A) {
|
|
62478
|
-
super(), this._props = A, this._emitter = new Vr(), this.addEventListener = this._emitter.addListener.bind(this._emitter), this._container = new St(), this.sizeBox = new fK(), this._goodsSize = new bd(0, 0, 0), this._slots = [], this._logos = [], this._skins = [], this._levels = /* @__PURE__ */ new Map(), this._bodyOpacity = 1, this._masts = /* @__PURE__ */ new Map(), this._liftMaxHeight = 0, this._jackMaxHeight = 0, this._forkMaxHeight = 0, this.controllers = [], this.goods = [], this._breathLights = [], this._shelves = /* @__PURE__ */ new Map(), this._shelfMaxLevel = 1, this._shelveAnimateTimes = [], this._url = "", this._showController = !0, this._showSlots = !0, this._shapeKeys = /* @__PURE__ */ new Map(), this._materialsCache = /* @__PURE__ */ new Map(), this.opacityCache = void 0, this._url = A.url || "", this._url && this.load(this._url).then(), this.add(this._container), this._props.showSizeBox && this.add(this.sizeBox), this.showController = typeof A.showController == "boolean" ? A.showController : !0, this._showSlots = typeof A.showSlots == "boolean" ? A.showSlots : !0;
|
|
62491
|
+
super(), this._props = A, this._emitter = new Vr(), this.addEventListener = this._emitter.addListener.bind(this._emitter), this._container = new St(), this.sizeBox = new fK(), this._goodsSize = new bd(0, 0, 0), this._slots = [], this._logos = [], this._skins = [], this._levels = /* @__PURE__ */ new Map(), this._bodyOpacity = 1, this._masts = /* @__PURE__ */ new Map(), this._liftMaxHeight = 0, this._jackMaxHeight = 0, this._forkMaxHeight = 0, this.controllers = [], this.goods = [], this._breathLights = [], this._shelves = /* @__PURE__ */ new Map(), this._shelfMaxLevel = 1, this._shelveAnimateTimes = [], this._url = "", this._showController = !0, this._showSlots = !0, this._shapeKeys = /* @__PURE__ */ new Map(), this._shapeKeyTimer = 0, this._materialsCache = /* @__PURE__ */ new Map(), this.opacityCache = void 0, this._url = A.url || "", this._url && this.load(this._url).then(), this.add(this._container), this._props.showSizeBox && this.add(this.sizeBox), this.showController = typeof A.showController == "boolean" ? A.showController : !0, this._showSlots = typeof A.showSlots == "boolean" ? A.showSlots : !0;
|
|
62479
62492
|
}
|
|
62480
62493
|
get shapeKeys() {
|
|
62481
62494
|
return this._shapeKeys;
|
|
@@ -62567,14 +62580,16 @@ class vK extends Ie {
|
|
|
62567
62580
|
));
|
|
62568
62581
|
}
|
|
62569
62582
|
setShapeKey(A, e) {
|
|
62570
|
-
this.
|
|
62571
|
-
|
|
62572
|
-
|
|
62573
|
-
|
|
62574
|
-
|
|
62575
|
-
|
|
62576
|
-
|
|
62577
|
-
|
|
62583
|
+
this._shapeKeyTimer && clearTimeout(this._shapeKeyTimer), this._shapeKeyTimer = setTimeout(() => {
|
|
62584
|
+
this._container.traverse((t) => {
|
|
62585
|
+
if (!Object.keys(t.morphTargetDictionary || {}).includes(A))
|
|
62586
|
+
return;
|
|
62587
|
+
let i = e;
|
|
62588
|
+
t.userData[`origin_${A}`] && (i -= t.userData[`origin_${A}`]);
|
|
62589
|
+
const r = t.morphTargetDictionary[A];
|
|
62590
|
+
t.morphTargetInfluences && (t.morphTargetInfluences[r] = i), t instanceof Pe && t.geometry.translate(0, 0, 1e-5);
|
|
62591
|
+
}), this._emitter.emit("shape-key-changed", A, e);
|
|
62592
|
+
}, 100);
|
|
62578
62593
|
}
|
|
62579
62594
|
_generateAmr(A) {
|
|
62580
62595
|
A.traverse((e) => {
|