@skyservice-developers/vue-dev-kit 2.18.0 → 2.19.1

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,6 @@
1
1
  import { openBlock as b, createBlock as Le, Teleport as qo, renderSlot as ne, useSlots as bh, ref as ae, computed as X, watch as Jt, nextTick as Ln, onMounted as Ft, onUnmounted as Xo, createElementBlock as T, normalizeStyle as De, createElementVNode as E, normalizeClass as Z, createTextVNode as Qt, toDisplayString as F, createCommentVNode as N, resolveDynamicComponent as fu, createSlots as Zo, renderList as we, withCtx as be, normalizeProps as du, guardReactiveProps as hu, Fragment as fe, withModifiers as $t, withDirectives as Nt, vShow as dl, vModelText as Ha, withKeys as Eo, resolveComponent as St, createVNode as Ge, Transition as hl, TransitionGroup as Kg, mergeProps as Sr, defineComponent as He, useAttrs as Gg, onBeforeUnmount as nr, vModelSelect as pu, unref as Ye, onUpdated as kh, resolveDirective as qg, provide as Xg, inject as wh } from "vue";
2
- import { p as Ch, l as vu, A as Zg, f as Jg, o as lr, B as Qg, k as e1, c as Oc, r as $c, e as t1 } from "./api-C6FKIf2t.js";
3
- import { S as j7, g as F7, a as B7, b as U7, d as H7, h as z7, i as W7, j as Y7, m as K7, n as G7, q as q7, s as X7, t as Z7, u as J7, v as Q7, w as e9, x as t9, y as n9, z as a9, C as r9 } from "./api-C6FKIf2t.js";
2
+ import { r as Ch, n as vu, D as Zg, i as Jg, q as lr, E as Qg, m as e1, d as Oc, t as $c, e as t1 } from "./money-BCv6JlZu.js";
3
+ import { C as j7, S as F7, c as B7, f as U7, g as H7, a as z7, b as W7, h as Y7, j as K7, k as G7, l as q7, o as X7, p as Z7, s as J7, u as Q7, v as eO, w as tO, x as nO, y as aO, z as rO, A as iO, B as oO, F as sO } from "./money-BCv6JlZu.js";
4
4
  import "ua-parser-js";
5
5
  import { useVirtualizer as Th } from "@tanstack/vue-virtual";
6
6
  import { tableFeatures as n1, filterFns as a1, sortFns as r1, rowSortingFeature as i1, rowSelectionFeature as o1, rowPaginationFeature as s1, globalFilteringFeature as l1, columnVisibilityFeature as u1, columnSizingFeature as c1, columnFilteringFeature as f1, createPaginatedRowModel as d1, createSortedRowModel as h1, createFilteredRowModel as p1, createCoreRowModel as v1, createColumnHelper as m1, useTable as g1, FlexRender as Ic } from "@tanstack/vue-table";
@@ -3711,7 +3711,7 @@ const v7 = /* @__PURE__ */ le(Yy, [["render", o2], ["__scopeId", "data-v-2209df8
3711
3711
  ], 64))), 256))
3712
3712
  ])) : N("", !0);
3713
3713
  }
3714
- }), y7 = /* @__PURE__ */ le(S2, [["__scopeId", "data-v-2032c9b7"]]), E2 = ["id", "value", "disabled"], D2 = {
3714
+ }), y7 = /* @__PURE__ */ le(S2, [["__scopeId", "data-v-d25e6c02"]]), E2 = ["id", "value", "disabled"], D2 = {
3715
3715
  key: 0,
3716
3716
  value: "",
3717
3717
  disabled: "",
@@ -23915,6 +23915,7 @@ var Wg = "sky-toast-notification", hr = {
23915
23915
  };
23916
23916
  export {
23917
23917
  b1 as BaseTeleport,
23918
+ j7 as CURRENCY_ICONS,
23918
23919
  o7 as Dialog,
23919
23920
  xc as DialogModal,
23920
23921
  Rc as DialogNext,
@@ -23953,44 +23954,46 @@ export {
23953
23954
  Sh as SkyTableVirtualBody,
23954
23955
  w7 as SkyTabs,
23955
23956
  C7 as SkyTileCard,
23956
- j7 as SkyserviceAPI,
23957
+ F7 as SkyserviceAPI,
23957
23958
  x7 as TableColumnSettings,
23958
23959
  I7 as TableMassActions,
23959
23960
  R7 as TableVirtualBody,
23960
23961
  T7 as createSkyColumnHelper,
23962
+ B7 as currencyIcon,
23961
23963
  t1 as exit,
23962
- F7 as getBack,
23963
- B7 as getCompany,
23964
- U7 as getLang,
23964
+ U7 as formatMoney,
23965
+ H7 as getBack,
23966
+ z7 as getCompany,
23967
+ W7 as getLang,
23965
23968
  Oc as getLocalStorageData,
23966
- H7 as getProductCategories,
23969
+ Y7 as getProductCategories,
23967
23970
  Jg as getSenderId,
23968
- z7 as getStoreData,
23969
- W7 as getToken,
23970
- Y7 as getUser,
23971
+ K7 as getStoreData,
23972
+ G7 as getToken,
23973
+ q7 as getUser,
23971
23974
  e1 as getWindowData,
23972
23975
  XE as globalStore,
23973
23976
  vu as isAndroidWebview,
23974
- K7 as isCefWebview,
23975
- G7 as isInIframe,
23977
+ X7 as isCefWebview,
23978
+ Z7 as isInIframe,
23976
23979
  lr as isInsideIframe,
23977
23980
  Ch as isIosWebview,
23978
- q7 as isWebview,
23981
+ J7 as isWebview,
23979
23982
  $c as navigate,
23980
23983
  V7 as notificationModule,
23981
- X7 as notify,
23982
- Z7 as notifyError,
23983
- J7 as notifyWarn,
23984
- Q7 as onMessage,
23985
- e9 as openCrispChat,
23986
- t9 as openExternalLink,
23987
- n9 as setLocalStorage,
23988
- a9 as setRocketMode,
23984
+ Q7 as notify,
23985
+ eO as notifyError,
23986
+ tO as notifyWarn,
23987
+ nO as onMessage,
23988
+ aO as openCrispChat,
23989
+ rO as openExternalLink,
23990
+ iO as setLocalStorage,
23991
+ oO as setRocketMode,
23989
23992
  Zg as setSenderId,
23990
23993
  Hb as skyTableFeatures,
23991
23994
  Qg as trackVisit,
23992
23995
  D7 as useColumnVisibility,
23993
23996
  E7 as useTableSelection,
23994
23997
  S7 as useTableSort,
23995
- r9 as webviewCheck
23998
+ sO as webviewCheck
23996
23999
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyservice-developers/vue-dev-kit",
3
- "version": "2.18.0",
3
+ "version": "2.19.1",
4
4
  "description": "Vue 3 component library + TypeScript SDK (iframe bridge + HTTP API) for Skyservice mini-apps",
5
5
  "type": "module",
6
6
  "main": "./dist/vue-dev-kit.cjs",
@@ -1 +0,0 @@
1
- "use strict";const k=require("ua-parser-js"),v="DASHBOARD",C=5e3;let P=0,f=null;function A(){return`sdk_${Date.now()}_${++P}`}function E(){return"APP_"+Math.random().toString(36).slice(2,10)}function L(t){f=t}function w(){return f||(f=E()),f}function s(t){window.parent.postMessage({...t,sender:w(),target:t.target||v},"*")}function g(t,e,r=C){return h()?new Promise(n=>{const o=A(),i=w(),a=setTimeout(()=>{window.removeEventListener("message",p),n(null)},r);function p(b){const c=b.data;(c==null?void 0:c.type)==="DATA_RESPONSE"&&(c==null?void 0:c.requestId)===o&&(!c.target||c.target===i)&&(clearTimeout(a),window.removeEventListener("message",p),n(c.data??null))}window.addEventListener("message",p),s({type:"DATA_REQUEST",requestId:o,source:t,key:e})}):Promise.resolve(null)}function T(t){s({type:"navigate",path:t})}function I(){s({type:"exit"})}const _=I;function d(t){return g("store",t)}function l(t){return g("localStorage",t)}function D(t){return g("window",t)}function W(){return d("company")}function R(){return d("user")}function U(){return l("token")}function N(){return l("lang")}function $(){return d("productCategories")}function O(t,e){s({type:"setLocalStorage",key:t,value:e})}function M(t){s({type:"setRocketMode",value:t})}function j(t,e){s({type:"trackVisit",name:t,path:e})}function x(t){s({type:"openExternalLink",url:t})}function B(){s({type:"openCrispChat"})}function q(t){s({type:"notification",text:t})}function G(t){s({type:"notification",text:t,variant:"error"})}function V(t){s({type:"notification",text:t,variant:"warn"})}function h(){try{return window.self!==window.top}catch{return!0}}const z=h;function F(t){function e(r){var n;((n=r.data)==null?void 0:n.sender)===v&&t(r.data)}return window.addEventListener("message",e),()=>window.removeEventListener("message",e)}function u(){if(typeof window>"u")return"browser";if(window.webkit!=null&&window.webkit.messageHandlers!==void 0)try{if(k(navigator.userAgent).browser.name==="WebKit")return"ios_webview"}catch(t){console.error(t)}return typeof Android<"u"?"android_webview":typeof window.cefQuery<"u"?"cef_webview":"browser"}function H(){return u()==="ios_webview"}function Q(){return u()==="android_webview"}function J(){return u()==="cef_webview"}function K(){return u()!=="browser"}const Y="https://api.cabinet.developer.skyservice.online/index.php";class m{constructor(e){this.permsCache=null,this.token=e.token,this.companyId=e.companyId,this.appId=e.appId,this.developerId=e.developerId,this.deploymentId=e.deploymentId,this.appName=e.appName;const r=e.domain.replace("dashboard","api");this.baseUrl=r.startsWith("http")?r:`https://${r}`}static create(e){return new m(e)}async get(e){const r=new URLSearchParams({token:this.token,companyId:this.companyId,...e}),n=await fetch(`${this.baseUrl}/?${r}`);if(!n.ok)throw new Error(`Skyservice API error: ${n.status}`);const o=await n.json();if(o.status!=="done")throw new Error(`Skyservice API returned status: ${o.status}`);return o.data}async post(e,r,n){const o=new URLSearchParams({token:this.token,...r}),i=await fetch(`${e}?${o}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok)throw new Error(`Skyservice API error: ${i.status}`);const a=await i.json();if(a.status!=="done")throw new Error(`Skyservice API returned status: ${a.status}`);return a.data}async getTradepoints(e){const r=await this.get({section:"tradepoints",action:"getTradepoints"});return e!=null&&e.includeDeleted?r.items:r.items.filter(n=>!n.deleted&&!n.frozen)}async getCategoryTree(e){const r=await this.get({section:"productCategory",action:"getCategories",...e?{tradepointId:String(e)}:{}});return S(r,e)}async getProducts(e){const r=await this.get({section:"products",action:"getProducts",pagelimit:"9999",ot:"desc",of:"nomenclatureId",...e!=null&&e.tradepointId?{tradepointId:String(e.tradepointId)}:{}});return ee(r.items,e==null?void 0:e.includeInactive)}async setAppActive({isActive:e,title:r,settings:n}){const o=e?"activateApp":"deactivateApp",i={company_id:this.companyId,app_id:this.appId,...this.developerId!==void 0&&{developer_id:this.developerId},...e&&n!==void 0&&{settings:n}},a=await this.post(Y,{section:"integrations",action:o},i);return this.deploymentId&&this.appName&&typeof window<"u"&&window.self!==window.top&&window.parent.postMessage({type:"sendActiveApp",id:a.id,is_active:e,deploymentId:this.deploymentId,appName:this.appName,title:r},"*"),a}async getPerms(e){const r=await this.loadPerms();return e===void 0?r:!!r[String(e)]}clearPermsCache(){this.permsCache=null}async loadPerms(){var r;if(this.permsCache)return this.permsCache;if(typeof window<"u")try{const n=await d("perms");if(n&&Object.keys(n).length>0)return this.permsCache=y(n),this.permsCache}catch{}const e=await this.get({section:"adminPanel",action:"getStart"});return this.permsCache=y((r=e==null?void 0:e.settings)==null?void 0:r.perms),this.permsCache}}function y(t){const e={};if(!t||typeof t!="object")return e;for(const[r,n]of Object.entries(t))e[r]=!!n;return e}function S(t,e){var n,o;const r=[];for(const i of t){if(e!=null&&!((n=i.tradepointShow)==null?void 0:n[String(e)]))continue;const a={id:i.id,pid:i.pid,name:i.name,active:i.active,background:i.background,show:i.show};i.img&&(a.img=i.img),(o=i.children)!=null&&o.length&&(a.children=S(i.children,e)),r.push(a)}return r}const X=new Set(["product","techcard"]),Z="/img/no.png";function ee(t,e){const r=[];for(const n of t)X.has(n.type)&&(!e&&!n.active||r.push({id:n.id,name:n.nomenclatureName,price:n.price,categoryId:n.categoryId,categoryName:n.categoryTitle||"",active:n.active,type:n.type,unit:n.unit,logo:n.logo&&n.logo!==Z?n.logo:""}));return r}exports.SkyserviceAPI=m;exports.exit=I;exports.getBack=_;exports.getCompany=W;exports.getLang=N;exports.getLocalStorageData=l;exports.getProductCategories=$;exports.getSenderId=w;exports.getStoreData=d;exports.getToken=U;exports.getUser=R;exports.getWindowData=D;exports.isAndroidWebview=Q;exports.isCefWebview=J;exports.isInIframe=z;exports.isInsideIframe=h;exports.isIosWebview=H;exports.isWebview=K;exports.navigate=T;exports.notify=q;exports.notifyError=G;exports.notifyWarn=V;exports.onMessage=F;exports.openCrispChat=B;exports.openExternalLink=x;exports.setLocalStorage=O;exports.setRocketMode=M;exports.setSenderId=L;exports.trackVisit=j;exports.webviewCheck=u;