amotify 0.1.33 → 0.1.34
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/@declaration/_.js +1 -1
- package/dist/@declaration/property.d.ts +2 -2
- package/dist/@styles/componentClasses/_.css +1 -1
- package/dist/@styles/index.css +1 -1
- package/dist/@styles/init.css +1 -1
- package/dist/@styles/style.css +31 -1
- package/dist/@styles/var.css +1 -1
- package/dist/@utils/GenerateClassName.js +1 -470
- package/dist/@utils/LaunchReactApp.d.ts +1 -1
- package/dist/@utils/LaunchReactApp.js +1 -78
- package/dist/@utils/_.js +1 -12
- package/dist/@utils/collectForm.js +1 -96
- package/dist/@utils/color.js +1 -103
- package/dist/@utils/config.js +1 -101
- package/dist/@utils/fin.js +1 -39
- package/dist/@utils/getElement.js +1 -13
- package/dist/@utils/jsminEx.js +1 -172
- package/dist/@utils/pageTransit.js +1 -33
- package/dist/@utils/useRecycle.js +1 -44
- package/dist/@utils/useStore.js +1 -54
- package/dist/atoms/Box.js +1 -20
- package/dist/atoms/FAI.js +1 -148
- package/dist/atoms/Flex.js +1 -34
- package/dist/atoms/Grid.js +1 -17
- package/dist/atoms/Img.js +1 -65
- package/dist/atoms/Logo.js +51 -359
- package/dist/atoms/P.js +1 -20
- package/dist/atoms/Placeholder.js +1 -44
- package/dist/atoms/Span.js +1 -20
- package/dist/atoms/_.js +1 -9
- package/dist/chunk-VY3566IV.js +1 -0
- package/dist/fn/Button.js +1 -316
- package/dist/fn/Cropper.js +1 -1009
- package/dist/fn/Effect/Fade.js +1 -88
- package/dist/fn/Effect/Pudding.js +1 -22
- package/dist/fn/Effect/Ripple.js +3 -117
- package/dist/fn/Effect/_.js +1 -14
- package/dist/fn/Input/AutoHeightText.js +1 -112
- package/dist/fn/Input/Checker.js +1 -36
- package/dist/fn/Input/Chips/Selector.js +1 -472
- package/dist/fn/Input/Chips/_.js +1 -349
- package/dist/fn/Input/Contenteditable.js +1 -160
- package/dist/fn/Input/DigitCharacters.js +1 -275
- package/dist/fn/Input/Filer.js +1 -619
- package/dist/fn/Input/Hidden.js +1 -48
- package/dist/fn/Input/List.js +1 -450
- package/dist/fn/Input/Parts.js +1 -121
- package/dist/fn/Input/Plain.js +1 -12
- package/dist/fn/Input/RichSelect.js +1 -279
- package/dist/fn/Input/Search.js +1 -53
- package/dist/fn/Input/Segmented.js +1 -245
- package/dist/fn/Input/Select.js +1 -278
- package/dist/fn/Input/Slider.js +1 -538
- package/dist/fn/Input/Switch.js +1 -221
- package/dist/fn/Input/Text.js +1 -626
- package/dist/fn/Input/TextArea.js +1 -151
- package/dist/fn/Input/Time/Picker.js +1 -1457
- package/dist/fn/Input/Time/_.js +1 -867
- package/dist/fn/Input/_.js +1 -48
- package/dist/fn/Input/core.js +1 -626
- package/dist/fn/Layout/PageNotFound.js +1 -90
- package/dist/fn/Layout/PageRouter.js +1 -87
- package/dist/fn/Layout/PageViewController.js +1 -29
- package/dist/fn/Layout/Plate.js +1 -37
- package/dist/fn/Layout/RootViewController.js +1 -315
- package/dist/fn/Layout/SwipeView.js +1 -348
- package/dist/fn/Layout/TabBar.js +1 -72
- package/dist/fn/Layout/_.js +1 -22
- package/dist/fn/Loader/_.js +1 -104
- package/dist/fn/Loader/corner.js +1 -85
- package/dist/fn/Loader/mini.js +1 -125
- package/dist/fn/Loader/top.js +1 -73
- package/dist/fn/Sheet.js +1 -1100
- package/dist/fn/Snackbar.js +1 -216
- package/dist/fn/Table/Data.js +1 -974
- package/dist/fn/Table/Drag.js +1 -435
- package/dist/fn/Table/Normal.js +1 -136
- package/dist/fn/Table/Parts.js +1 -41
- package/dist/fn/Table/Wrapper.js +1 -60
- package/dist/fn/Table/_.js +1 -16
- package/dist/fn/Table/cellStyling.js +1 -51
- package/dist/fn/Tooltips.js +1 -58
- package/dist/fn/_.js +1 -10
- package/dist/index.js +1 -20
- package/dist/mols/Accordion.js +1 -152
- package/dist/mols/Column.js +1 -16
- package/dist/mols/LinkifyText.js +1 -42
- package/dist/mols/List.js +1 -42
- package/dist/mols/Row.js +1 -47
- package/dist/mols/Text.js +1 -67
- package/dist/mols/_.js +1 -6
- package/dist/temps/_.js +1 -1
- package/dist/temps/designBook.js +20 -3636
- package/package.json +1 -1
- package/dist/chunk-JJ3PEWPN.js +0 -60
|
@@ -1,78 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
$$,
|
|
5
|
-
Config
|
|
6
|
-
} from "./_";
|
|
7
|
-
import React from "react";
|
|
8
|
-
import defaultReactDOMClient from "react-dom/client";
|
|
9
|
-
import * as ReactRouterDOM from "react-router-dom";
|
|
10
|
-
import useRecycle from "./useRecycle";
|
|
11
|
-
import Box from "../atoms/Box";
|
|
12
|
-
import Sheet from "../fn/Sheet";
|
|
13
|
-
import Snackbar from "../fn/Snackbar";
|
|
14
|
-
import Loader from "../fn/Loader/_";
|
|
15
|
-
import Effect from "../fn/Effect/_";
|
|
16
|
-
const AmotifyRoot = (params) => {
|
|
17
|
-
let Key = useRecycle.set("RootViewController_" + Config.get().sessionUID);
|
|
18
|
-
return React.createElement(
|
|
19
|
-
"amotify-app",
|
|
20
|
-
{
|
|
21
|
-
id: "appRoot_" + Config.get().sessionUID
|
|
22
|
-
},
|
|
23
|
-
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
-
/* @__PURE__ */ jsx(Effect.Pudding.Wrapper, {}),
|
|
25
|
-
/* @__PURE__ */ jsx(Effect.Ripple.Wrapper, {}),
|
|
26
|
-
/* @__PURE__ */ jsx(Loader.Wrapper, {}),
|
|
27
|
-
/* @__PURE__ */ jsx(Snackbar.Wrapper, {}),
|
|
28
|
-
/* @__PURE__ */ jsx(Sheet.Wrapper, {}),
|
|
29
|
-
/* @__PURE__ */ jsx(Box, { className: `AMOTIFY_be AMOTIFY_be_root ${params.originClassName}`, children: /* @__PURE__ */ jsx(
|
|
30
|
-
ReactRouterDOM.BrowserRouter,
|
|
31
|
-
{
|
|
32
|
-
children: params.children
|
|
33
|
-
},
|
|
34
|
-
Key
|
|
35
|
-
) })
|
|
36
|
-
] })
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
const LaunchReactApp = (params) => {
|
|
40
|
-
let {
|
|
41
|
-
appRoot,
|
|
42
|
-
baseElement,
|
|
43
|
-
reactElement,
|
|
44
|
-
inlineCSS,
|
|
45
|
-
originClassName = "AMOTIFY_be_origin",
|
|
46
|
-
appearances
|
|
47
|
-
} = params;
|
|
48
|
-
let base = $$(baseElement);
|
|
49
|
-
if (!base[0])
|
|
50
|
-
return;
|
|
51
|
-
if (!reactElement)
|
|
52
|
-
return;
|
|
53
|
-
if (appRoot)
|
|
54
|
-
Config.update.appRoot(appRoot);
|
|
55
|
-
let {
|
|
56
|
-
roundness,
|
|
57
|
-
themeColor,
|
|
58
|
-
darkMode
|
|
59
|
-
} = appearances || {};
|
|
60
|
-
$$.is.exist(roundness) && Config.update.roundness(roundness);
|
|
61
|
-
$$.is.exist(themeColor) && Config.update.themeColor(themeColor);
|
|
62
|
-
$$.is.exist(darkMode) && Config.update.darkMode(darkMode);
|
|
63
|
-
defaultReactDOMClient.createRoot(base[0]).render(/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
64
|
-
/* @__PURE__ */ jsx("style", { children: inlineCSS }),
|
|
65
|
-
/* @__PURE__ */ jsx(
|
|
66
|
-
AmotifyRoot,
|
|
67
|
-
{
|
|
68
|
-
originClassName,
|
|
69
|
-
children: reactElement
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
] }));
|
|
73
|
-
};
|
|
74
|
-
export {
|
|
75
|
-
LaunchReactApp,
|
|
76
|
-
React,
|
|
77
|
-
LaunchReactApp as default
|
|
78
|
-
};
|
|
1
|
+
import"../chunk-VY3566IV.js";import{Fragment as R,jsx as e,jsxs as f}from"react/jsx-runtime";import{$$ as a,Config as o}from"./_";import l from"react";import M from"react-dom/client";import*as E from"react-router-dom";import y from"./useRecycle";import A from"../atoms/Box";import b from"../fn/Sheet";import k from"../fn/Snackbar";import x from"../fn/Loader/_";import c from"../fn/Effect/_";const I=t=>{let r=y.set("RootViewController_"+o.get().sessionUID);return l.createElement("amotify-app",{id:"appRoot_"+o.get().sessionUID},f(R,{children:[e(c.Pudding.Wrapper,{}),e(c.Ripple.Wrapper,{}),e(x.Wrapper,{}),e(k.Wrapper,{}),e(b.Wrapper,{}),e(A,{className:`AMOTIFY_be AMOTIFY_be_root ${t.originClassName}`,children:e(E.BrowserRouter,{children:t.children},r)})]}))},d=t=>{let{appRoot:r,baseElement:u,reactElement:n,inlineCSS:C,originClassName:g="AMOTIFY_be_origin",appearances:h}=t,p=a(u);if(!p[0]||!n)return;r&&o.update.appRoot(r);let{roundness:i,themeColor:s,darkMode:m}=h||{};a.is.exist(i)&&o.update.roundness(i),a.is.exist(s)&&o.update.themeColor(s),a.is.exist(m)&&o.update.darkMode(m),M.createRoot(p[0]).render(f(R,{children:[e("style",{children:C}),e(I,{originClassName:g,children:n})]}))};export{d as LaunchReactApp,l as React,d as default};
|
package/dist/@utils/_.js
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./jsminEx";
|
|
3
|
-
export * from "./config";
|
|
4
|
-
export * from "./useStore";
|
|
5
|
-
export * from "./useRecycle";
|
|
6
|
-
export * from "./collectForm";
|
|
7
|
-
export * from "./pageTransit";
|
|
8
|
-
export * from "./color";
|
|
9
|
-
export * from "./GenerateClassName";
|
|
10
|
-
export * from "./LaunchReactApp";
|
|
11
|
-
export * from "./getElement";
|
|
12
|
-
export * from "./fin";
|
|
1
|
+
export*from"../@declaration/_";export*from"./jsminEx";export*from"./config";export*from"./useStore";export*from"./useRecycle";export*from"./collectForm";export*from"./pageTransit";export*from"./color";export*from"./GenerateClassName";export*from"./LaunchReactApp";export*from"./getElement";export*from"./fin";
|
|
@@ -1,96 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__async
|
|
3
|
-
} from "../chunk-JJ3PEWPN.js";
|
|
4
|
-
import $$ from "@mingoo/jsmin";
|
|
5
|
-
import useStore from "./useStore";
|
|
6
|
-
let formProcess = false;
|
|
7
|
-
const collectForm = (form) => __async(void 0, null, function* () {
|
|
8
|
-
if (formProcess)
|
|
9
|
-
return {
|
|
10
|
-
valid: false,
|
|
11
|
-
data: {}
|
|
12
|
-
};
|
|
13
|
-
let focusElement = document.activeElement;
|
|
14
|
-
if (focusElement)
|
|
15
|
-
focusElement.blur();
|
|
16
|
-
formProcess = true;
|
|
17
|
-
let Inputs = $$(`[data-form="${form}"]`), totalValid = 1, Values = {};
|
|
18
|
-
for (let index = 0; index < Inputs.length; index++) {
|
|
19
|
-
let Input = Inputs[index];
|
|
20
|
-
let { componentId = "" } = Input.dataset;
|
|
21
|
-
let componentData = useStore.get(componentId);
|
|
22
|
-
if (componentData && componentData.Refresh)
|
|
23
|
-
yield componentData.Refresh();
|
|
24
|
-
let {
|
|
25
|
-
value: displayValue,
|
|
26
|
-
name,
|
|
27
|
-
checked,
|
|
28
|
-
dataset: {
|
|
29
|
-
value,
|
|
30
|
-
name: dataName = "",
|
|
31
|
-
inputType = "",
|
|
32
|
-
validation
|
|
33
|
-
}
|
|
34
|
-
} = Inputs[index];
|
|
35
|
-
let Value = value;
|
|
36
|
-
name = name || dataName;
|
|
37
|
-
validation = Number((validation != null ? validation : "true") == "true");
|
|
38
|
-
if (inputType == "hidden") {
|
|
39
|
-
if (Value)
|
|
40
|
-
Value = JSON.parse(Value);
|
|
41
|
-
} else if (["radio", "checkbox", "checker"].includes(inputType)) {
|
|
42
|
-
if (Value) {
|
|
43
|
-
Value = JSON.parse(Value);
|
|
44
|
-
if ($$.is.array(Value)) {
|
|
45
|
-
Value = Value.map((v) => JSON.parse(v));
|
|
46
|
-
} else {
|
|
47
|
-
Value = JSON.parse(Value);
|
|
48
|
-
}
|
|
49
|
-
if (inputType == "radio") {
|
|
50
|
-
Value = Value[0];
|
|
51
|
-
}
|
|
52
|
-
if (inputType == "checker") {
|
|
53
|
-
Value = Boolean(Value[0]);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
} else if (["chips-single", "chips-multi"].includes(inputType)) {
|
|
57
|
-
Value = JSON.parse(Value);
|
|
58
|
-
if (Value.length) {
|
|
59
|
-
if (inputType == "chips-single")
|
|
60
|
-
Value = Value[0];
|
|
61
|
-
}
|
|
62
|
-
} else if (inputType == "time") {
|
|
63
|
-
if (Value)
|
|
64
|
-
Value = JSON.parse(Value);
|
|
65
|
-
} else if (inputType == "select") {
|
|
66
|
-
if (Value)
|
|
67
|
-
Value = JSON.parse(Value);
|
|
68
|
-
} else if (inputType == "richSelect") {
|
|
69
|
-
if (Value)
|
|
70
|
-
Value = JSON.parse(Value);
|
|
71
|
-
} else if (inputType == "file") {
|
|
72
|
-
if (componentData) {
|
|
73
|
-
let files = componentData.Files;
|
|
74
|
-
Value = files;
|
|
75
|
-
}
|
|
76
|
-
} else if (inputType == "slider") {
|
|
77
|
-
if (Value)
|
|
78
|
-
Value = JSON.parse(Value);
|
|
79
|
-
} else if (inputType == "switch") {
|
|
80
|
-
Value = checked | 0;
|
|
81
|
-
}
|
|
82
|
-
let valid = (validation != null ? validation : 1) | 0;
|
|
83
|
-
totalValid &= valid;
|
|
84
|
-
if (validation)
|
|
85
|
-
Values[name] = Value;
|
|
86
|
-
}
|
|
87
|
-
formProcess = false;
|
|
88
|
-
return {
|
|
89
|
-
valid: Boolean(totalValid),
|
|
90
|
-
data: Values
|
|
91
|
-
};
|
|
92
|
-
});
|
|
93
|
-
export {
|
|
94
|
-
collectForm,
|
|
95
|
-
collectForm as default
|
|
96
|
-
};
|
|
1
|
+
import{e as m}from"../chunk-VY3566IV.js";import u from"@mingoo/jsmin";import b from"./useStore";let f=!1;const d=h=>m(void 0,null,function*(){if(f)return{valid:!1,data:{}};let c=document.activeElement;c&&c.blur(),f=!0;let s=u(`[data-form="${h}"]`),o=1,n={};for(let i=0;i<s.length;i++){let N=s[i],{componentId:O=""}=N.dataset,a=b.get(O);a&&a.Refresh&&(yield a.Refresh());let{value:F,name:r,checked:S,dataset:{value:y,name:J="",inputType:t="",validation:l}}=s[i],e=y;r=r||J,l=+((l!=null?l:"true")=="true"),t=="hidden"?e&&(e=JSON.parse(e)):["radio","checkbox","checker"].includes(t)?e&&(e=JSON.parse(e),u.is.array(e)?e=e.map(p=>JSON.parse(p)):e=JSON.parse(e),t=="radio"&&(e=e[0]),t=="checker"&&(e=!!e[0])):["chips-single","chips-multi"].includes(t)?(e=JSON.parse(e),e.length&&t=="chips-single"&&(e=e[0])):t=="time"||t=="select"||t=="richSelect"?e&&(e=JSON.parse(e)):t=="file"?a&&(e=a.Files):t=="slider"?e&&(e=JSON.parse(e)):t=="switch"&&(e=S|0);let g=(l!=null?l:1)|0;o&=g,l&&(n[r]=e)}return f=!1,{valid:!!o,data:n}});export{d as collectForm,d as default};
|
package/dist/@utils/color.js
CHANGED
|
@@ -1,103 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
$$,
|
|
4
|
-
Config
|
|
5
|
-
} from "./_";
|
|
6
|
-
const ColorObjects = [
|
|
7
|
-
{ key: "comun", isBrand: false, isAvocado: true },
|
|
8
|
-
{ key: "leaf", isBrand: false, isAvocado: true },
|
|
9
|
-
{ key: "heart", isBrand: false, isAvocado: true },
|
|
10
|
-
{ key: "droplet", isBrand: false, isAvocado: true },
|
|
11
|
-
{ key: "brick", isBrand: false, isAvocado: false },
|
|
12
|
-
{ key: "flower", isBrand: false, isAvocado: false },
|
|
13
|
-
{ key: "lip", isBrand: false, isAvocado: false },
|
|
14
|
-
{ key: "wine", isBrand: false, isAvocado: false },
|
|
15
|
-
{ key: "theater", isBrand: false, isAvocado: false },
|
|
16
|
-
{ key: "bat", isBrand: false, isAvocado: false },
|
|
17
|
-
{ key: "poizon", isBrand: false, isAvocado: false },
|
|
18
|
-
{ key: "eggplant", isBrand: false, isAvocado: false },
|
|
19
|
-
{ key: "ufo", isBrand: false, isAvocado: false },
|
|
20
|
-
{ key: "alien", isBrand: false, isAvocado: false },
|
|
21
|
-
{ key: "tombstone", isBrand: false, isAvocado: false },
|
|
22
|
-
{ key: "ninja", isBrand: false, isAvocado: false },
|
|
23
|
-
{ key: "moon", isBrand: false, isAvocado: false },
|
|
24
|
-
{ key: "rain", isBrand: false, isAvocado: false },
|
|
25
|
-
{ key: "unicorn", isBrand: false, isAvocado: false },
|
|
26
|
-
{ key: "axe", isBrand: false, isAvocado: false },
|
|
27
|
-
{ key: "gem", isBrand: false, isAvocado: false },
|
|
28
|
-
{ key: "soap", isBrand: false, isAvocado: false },
|
|
29
|
-
{ key: "drizzle", isBrand: false, isAvocado: false },
|
|
30
|
-
{ key: "building", isBrand: false, isAvocado: false },
|
|
31
|
-
{ key: "fish", isBrand: false, isAvocado: false },
|
|
32
|
-
{ key: "icicles", isBrand: false, isAvocado: false },
|
|
33
|
-
{ key: "water", isBrand: false, isAvocado: false },
|
|
34
|
-
{ key: "tree1", isBrand: false, isAvocado: false },
|
|
35
|
-
{ key: "tree2", isBrand: false, isAvocado: false },
|
|
36
|
-
{ key: "tree3", isBrand: false, isAvocado: false },
|
|
37
|
-
{ key: "battery", isBrand: false, isAvocado: false },
|
|
38
|
-
{ key: "seedle", isBrand: false, isAvocado: false },
|
|
39
|
-
{ key: "greenTea", isBrand: false, isAvocado: false },
|
|
40
|
-
{ key: "oak", isBrand: false, isAvocado: false },
|
|
41
|
-
{ key: "salad", isBrand: false, isAvocado: false },
|
|
42
|
-
{ key: "cloudy", isBrand: false, isAvocado: false },
|
|
43
|
-
{ key: "lemon", isBrand: false, isAvocado: false },
|
|
44
|
-
{ key: "angel", isBrand: false, isAvocado: false },
|
|
45
|
-
{ key: "parasol", isBrand: false, isAvocado: false },
|
|
46
|
-
{ key: "pizza", isBrand: false, isAvocado: false },
|
|
47
|
-
{ key: "thunder", isBrand: false, isAvocado: false },
|
|
48
|
-
{ key: "latte", isBrand: false, isAvocado: false },
|
|
49
|
-
{ key: "island", isBrand: false, isAvocado: false },
|
|
50
|
-
{ key: "shovel", isBrand: false, isAvocado: false },
|
|
51
|
-
{ key: "coffee", isBrand: false, isAvocado: false },
|
|
52
|
-
{ key: "carrot", isBrand: false, isAvocado: false },
|
|
53
|
-
{ key: "cactus", isBrand: false, isAvocado: false },
|
|
54
|
-
{ key: "volcano", isBrand: false, isAvocado: false },
|
|
55
|
-
{ key: "choco", isBrand: false, isAvocado: false },
|
|
56
|
-
{ key: "industry", isBrand: false, isAvocado: false },
|
|
57
|
-
{ key: "gun", isBrand: false, isAvocado: false },
|
|
58
|
-
{ key: "galaxy", isBrand: false, isAvocado: false },
|
|
59
|
-
{ key: "line", isBrand: true, isAvocado: false },
|
|
60
|
-
{ key: "twitter", isBrand: true, isAvocado: false },
|
|
61
|
-
{ key: "amazon", isBrand: true, isAvocado: false },
|
|
62
|
-
{ key: "facebook", isBrand: true, isAvocado: false },
|
|
63
|
-
{ key: "android", isBrand: true, isAvocado: false },
|
|
64
|
-
{ key: "slackBlue", isBrand: true, isAvocado: false },
|
|
65
|
-
{ key: "slackGreen", isBrand: true, isAvocado: false },
|
|
66
|
-
{ key: "slackRed", isBrand: true, isAvocado: false },
|
|
67
|
-
{ key: "slackYellow", isBrand: true, isAvocado: false },
|
|
68
|
-
{ key: "slackBase", isBrand: true, isAvocado: false },
|
|
69
|
-
{ key: "googleBlue", isBrand: true, isAvocado: false },
|
|
70
|
-
{ key: "googleGreen", isBrand: true, isAvocado: false },
|
|
71
|
-
{ key: "googleYellow", isBrand: true, isAvocado: false },
|
|
72
|
-
{ key: "googleRed", isBrand: true, isAvocado: false }
|
|
73
|
-
];
|
|
74
|
-
const SetThemeColorTag = () => {
|
|
75
|
-
let hex = "#45515c";
|
|
76
|
-
let meta = $$("#ThemeColorMetaTag");
|
|
77
|
-
if (!meta[0])
|
|
78
|
-
return;
|
|
79
|
-
meta.setAttribute("content", hex);
|
|
80
|
-
};
|
|
81
|
-
const DarkmodeColors = {
|
|
82
|
-
light: "#FFF",
|
|
83
|
-
dark: "#333",
|
|
84
|
-
dim: "#666",
|
|
85
|
-
auto: () => {
|
|
86
|
-
return Config.get().isSystemDarkmode() ? "#333" : "#FFF";
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
const ThemeColors = {};
|
|
90
|
-
ColorObjects.forEach((ColorObject) => {
|
|
91
|
-
let { key, isAvocado, isBrand } = ColorObject;
|
|
92
|
-
ThemeColors[key] = {
|
|
93
|
-
alfa: (alfa) => `hsla( var( --cH_${key} ),var( --cS_${key} ),var( --cL_${key} ),${alfa != null ? alfa : 1} ) `,
|
|
94
|
-
isAvocado,
|
|
95
|
-
isBrand
|
|
96
|
-
};
|
|
97
|
-
});
|
|
98
|
-
export {
|
|
99
|
-
ColorObjects,
|
|
100
|
-
DarkmodeColors,
|
|
101
|
-
SetThemeColorTag,
|
|
102
|
-
ThemeColors
|
|
103
|
-
};
|
|
1
|
+
import"../chunk-VY3566IV.js";import{$$ as d,Config as r}from"./_";const f=[{key:"comun",isBrand:!1,isAvocado:!0},{key:"leaf",isBrand:!1,isAvocado:!0},{key:"heart",isBrand:!1,isAvocado:!0},{key:"droplet",isBrand:!1,isAvocado:!0},{key:"brick",isBrand:!1,isAvocado:!1},{key:"flower",isBrand:!1,isAvocado:!1},{key:"lip",isBrand:!1,isAvocado:!1},{key:"wine",isBrand:!1,isAvocado:!1},{key:"theater",isBrand:!1,isAvocado:!1},{key:"bat",isBrand:!1,isAvocado:!1},{key:"poizon",isBrand:!1,isAvocado:!1},{key:"eggplant",isBrand:!1,isAvocado:!1},{key:"ufo",isBrand:!1,isAvocado:!1},{key:"alien",isBrand:!1,isAvocado:!1},{key:"tombstone",isBrand:!1,isAvocado:!1},{key:"ninja",isBrand:!1,isAvocado:!1},{key:"moon",isBrand:!1,isAvocado:!1},{key:"rain",isBrand:!1,isAvocado:!1},{key:"unicorn",isBrand:!1,isAvocado:!1},{key:"axe",isBrand:!1,isAvocado:!1},{key:"gem",isBrand:!1,isAvocado:!1},{key:"soap",isBrand:!1,isAvocado:!1},{key:"drizzle",isBrand:!1,isAvocado:!1},{key:"building",isBrand:!1,isAvocado:!1},{key:"fish",isBrand:!1,isAvocado:!1},{key:"icicles",isBrand:!1,isAvocado:!1},{key:"water",isBrand:!1,isAvocado:!1},{key:"tree1",isBrand:!1,isAvocado:!1},{key:"tree2",isBrand:!1,isAvocado:!1},{key:"tree3",isBrand:!1,isAvocado:!1},{key:"battery",isBrand:!1,isAvocado:!1},{key:"seedle",isBrand:!1,isAvocado:!1},{key:"greenTea",isBrand:!1,isAvocado:!1},{key:"oak",isBrand:!1,isAvocado:!1},{key:"salad",isBrand:!1,isAvocado:!1},{key:"cloudy",isBrand:!1,isAvocado:!1},{key:"lemon",isBrand:!1,isAvocado:!1},{key:"angel",isBrand:!1,isAvocado:!1},{key:"parasol",isBrand:!1,isAvocado:!1},{key:"pizza",isBrand:!1,isAvocado:!1},{key:"thunder",isBrand:!1,isAvocado:!1},{key:"latte",isBrand:!1,isAvocado:!1},{key:"island",isBrand:!1,isAvocado:!1},{key:"shovel",isBrand:!1,isAvocado:!1},{key:"coffee",isBrand:!1,isAvocado:!1},{key:"carrot",isBrand:!1,isAvocado:!1},{key:"cactus",isBrand:!1,isAvocado:!1},{key:"volcano",isBrand:!1,isAvocado:!1},{key:"choco",isBrand:!1,isAvocado:!1},{key:"industry",isBrand:!1,isAvocado:!1},{key:"gun",isBrand:!1,isAvocado:!1},{key:"galaxy",isBrand:!1,isAvocado:!1},{key:"line",isBrand:!0,isAvocado:!1},{key:"twitter",isBrand:!0,isAvocado:!1},{key:"amazon",isBrand:!0,isAvocado:!1},{key:"facebook",isBrand:!0,isAvocado:!1},{key:"android",isBrand:!0,isAvocado:!1},{key:"slackBlue",isBrand:!0,isAvocado:!1},{key:"slackGreen",isBrand:!0,isAvocado:!1},{key:"slackRed",isBrand:!0,isAvocado:!1},{key:"slackYellow",isBrand:!0,isAvocado:!1},{key:"slackBase",isBrand:!0,isAvocado:!1},{key:"googleBlue",isBrand:!0,isAvocado:!1},{key:"googleGreen",isBrand:!0,isAvocado:!1},{key:"googleYellow",isBrand:!0,isAvocado:!1},{key:"googleRed",isBrand:!0,isAvocado:!1}],y=()=>{let e="#45515c",a=d("#ThemeColorMetaTag");a[0]&&a.setAttribute("content",e)},n={light:"#FFF",dark:"#333",dim:"#666",auto:()=>r.get().isSystemDarkmode()?"#333":"#FFF"},o={};f.forEach(e=>{let{key:a,isAvocado:i,isBrand:l}=e;o[a]={alfa:s=>`hsla( var( --cH_${a} ),var( --cS_${a} ),var( --cL_${a} ),${s!=null?s:1} ) `,isAvocado:i,isBrand:l}});export{f as ColorObjects,n as DarkmodeColors,y as SetThemeColorTag,o as ThemeColors};
|
package/dist/@utils/config.js
CHANGED
|
@@ -1,101 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__spreadProps,
|
|
3
|
-
__spreadValues
|
|
4
|
-
} from "../chunk-JJ3PEWPN.js";
|
|
5
|
-
import {
|
|
6
|
-
$$
|
|
7
|
-
} from "./_";
|
|
8
|
-
import { useRecycle } from "./useRecycle";
|
|
9
|
-
import {
|
|
10
|
-
ColorObjects,
|
|
11
|
-
SetThemeColorTag
|
|
12
|
-
} from "./color";
|
|
13
|
-
const sessionUID = $$.uuid.gen();
|
|
14
|
-
const userAgent = window.navigator.userAgent.toLowerCase();
|
|
15
|
-
const deviceType = userAgent.indexOf("windows nt") !== -1 ? "windows" : userAgent.indexOf("android") !== -1 ? "android" : userAgent.indexOf("iphone") !== -1 ? "iPhone" : userAgent.indexOf("ipad") > -1 || userAgent.indexOf("macintosh") > -1 && "ontouchend" in document ? "iPad" : userAgent.indexOf("mac os x") !== -1 ? "macOSX" : "undefined";
|
|
16
|
-
const browserType = userAgent.indexOf("msie") !== -1 || userAgent.indexOf("trident") !== -1 ? "ie" : userAgent.indexOf("edge") !== -1 ? "edge" : userAgent.indexOf("chrome") !== -1 ? "chrome" : userAgent.indexOf("safari") !== -1 ? "safari" : userAgent.indexOf("firefox") !== -1 ? "firefox" : userAgent.indexOf("opera") !== -1 || userAgent.indexOf("opr") !== -1 ? "opera" : "undefined";
|
|
17
|
-
let __inmemoryConfig = {
|
|
18
|
-
sessionUID,
|
|
19
|
-
appRoot: document.body,
|
|
20
|
-
darkMode: "light",
|
|
21
|
-
themeColor: "comun",
|
|
22
|
-
roundness: 2,
|
|
23
|
-
isSystemDarkmode: () => {
|
|
24
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches == true;
|
|
25
|
-
},
|
|
26
|
-
deviceIs: deviceType,
|
|
27
|
-
browserIs: browserType,
|
|
28
|
-
isPhone: ["Android", "iPhone"].includes(deviceType),
|
|
29
|
-
isTouchDevice: window.ontouchstart !== void 0 && 0 < navigator.maxTouchPoints,
|
|
30
|
-
isIOS: ["iPhone", "iPad"].includes(deviceType),
|
|
31
|
-
screen: {
|
|
32
|
-
breakpoint: 834,
|
|
33
|
-
phonepoint: 690,
|
|
34
|
-
viewHeight: window.innerHeight,
|
|
35
|
-
viewWidth: window.innerWidth,
|
|
36
|
-
isBreakpoint: (px = 834) => window.innerWidth <= px,
|
|
37
|
-
isPhonepoint: (px = 690) => window.innerWidth <= px
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
const Config = {
|
|
41
|
-
get: () => {
|
|
42
|
-
return __inmemoryConfig;
|
|
43
|
-
},
|
|
44
|
-
set: (config) => {
|
|
45
|
-
__inmemoryConfig = __spreadValues(__spreadValues({}, __inmemoryConfig), config);
|
|
46
|
-
},
|
|
47
|
-
update: {
|
|
48
|
-
appRoot: (value) => {
|
|
49
|
-
Config.set(__spreadProps(__spreadValues({}, Config.get()), {
|
|
50
|
-
appRoot: value
|
|
51
|
-
}));
|
|
52
|
-
},
|
|
53
|
-
themeColor: (value) => {
|
|
54
|
-
if (!ColorObjects.find((ColorObject) => ColorObject.key == value))
|
|
55
|
-
value = "comun";
|
|
56
|
-
if (value == Config.get().themeColor)
|
|
57
|
-
return;
|
|
58
|
-
Config.set(__spreadProps(__spreadValues({}, Config.get()), {
|
|
59
|
-
themeColor: value
|
|
60
|
-
}));
|
|
61
|
-
let body = $$(document.body);
|
|
62
|
-
body.removeClass(body.findClass(/^bdsTC/)).addClass("bdsTC_" + value).callback(() => {
|
|
63
|
-
SetThemeColorTag();
|
|
64
|
-
});
|
|
65
|
-
Config.restart();
|
|
66
|
-
},
|
|
67
|
-
darkMode: (value) => {
|
|
68
|
-
if (!["light", "dark", "dim", "auto"].includes(value))
|
|
69
|
-
value = "light";
|
|
70
|
-
if (value == Config.get().darkMode)
|
|
71
|
-
return;
|
|
72
|
-
let Value = value == "auto" ? Config.get().isSystemDarkmode() ? "dark" : "light" : value;
|
|
73
|
-
Config.set(__spreadProps(__spreadValues({}, Config.get()), {
|
|
74
|
-
darkMode: Value
|
|
75
|
-
}));
|
|
76
|
-
let body = $$(document.body);
|
|
77
|
-
body.removeClass(body.findClass(/^bdsDM/)).addClass("bdsDM_" + Value);
|
|
78
|
-
Config.restart();
|
|
79
|
-
},
|
|
80
|
-
roundness: (value) => {
|
|
81
|
-
if (!(value >= 0 && value <= 5))
|
|
82
|
-
value = 2;
|
|
83
|
-
if (value == Config.get().roundness)
|
|
84
|
-
return;
|
|
85
|
-
Config.set(__spreadProps(__spreadValues({}, Config.get()), {
|
|
86
|
-
roundness: value
|
|
87
|
-
}));
|
|
88
|
-
Config.restart();
|
|
89
|
-
},
|
|
90
|
-
screen: (value) => {
|
|
91
|
-
Config.get().screen = __spreadValues(__spreadValues({}, Config.get().screen), value);
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
restart: () => {
|
|
95
|
-
useRecycle.do("RootViewController_" + Config.get().sessionUID);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
export {
|
|
99
|
-
Config,
|
|
100
|
-
Config as default
|
|
101
|
-
};
|
|
1
|
+
import{b as i,c as t}from"../chunk-VY3566IV.js";import{$$ as s}from"./_";import{useRecycle as c}from"./useRecycle";import{ColorObjects as h,SetThemeColorTag as u}from"./color";const f=s.uuid.gen(),n=window.navigator.userAgent.toLowerCase(),a=n.indexOf("windows nt")!==-1?"windows":n.indexOf("android")!==-1?"android":n.indexOf("iphone")!==-1?"iPhone":n.indexOf("ipad")>-1||n.indexOf("macintosh")>-1&&"ontouchend"in document?"iPad":n.indexOf("mac os x")!==-1?"macOSX":"undefined",p=n.indexOf("msie")!==-1||n.indexOf("trident")!==-1?"ie":n.indexOf("edge")!==-1?"edge":n.indexOf("chrome")!==-1?"chrome":n.indexOf("safari")!==-1?"safari":n.indexOf("firefox")!==-1?"firefox":n.indexOf("opera")!==-1||n.indexOf("opr")!==-1?"opera":"undefined";let m={sessionUID:f,appRoot:document.body,darkMode:"light",themeColor:"comun",roundness:2,isSystemDarkmode:()=>window.matchMedia("(prefers-color-scheme: dark)").matches==!0,deviceIs:a,browserIs:p,isPhone:["Android","iPhone"].includes(a),isTouchDevice:window.ontouchstart!==void 0&&0<navigator.maxTouchPoints,isIOS:["iPhone","iPad"].includes(a),screen:{breakpoint:834,phonepoint:690,viewHeight:window.innerHeight,viewWidth:window.innerWidth,isBreakpoint:(e=834)=>window.innerWidth<=e,isPhonepoint:(e=690)=>window.innerWidth<=e}};const o={get:()=>m,set:e=>{m=i(i({},m),e)},update:{appRoot:e=>{o.set(t(i({},o.get()),{appRoot:e}))},themeColor:e=>{if(h.find(d=>d.key==e)||(e="comun"),e==o.get().themeColor)return;o.set(t(i({},o.get()),{themeColor:e}));let r=s(document.body);r.removeClass(r.findClass(/^bdsTC/)).addClass("bdsTC_"+e).callback(()=>{u()}),o.restart()},darkMode:e=>{if(["light","dark","dim","auto"].includes(e)||(e="light"),e==o.get().darkMode)return;let r=e=="auto"?o.get().isSystemDarkmode()?"dark":"light":e;o.set(t(i({},o.get()),{darkMode:r}));let d=s(document.body);d.removeClass(d.findClass(/^bdsDM/)).addClass("bdsDM_"+r),o.restart()},roundness:e=>{e>=0&&e<=5||(e=2),e!=o.get().roundness&&(o.set(t(i({},o.get()),{roundness:e})),o.restart())},screen:e=>{o.get().screen=i(i({},o.get().screen),e)}},restart:()=>{c.do("RootViewController_"+o.get().sessionUID)}};export{o as Config,o as default};
|
package/dist/@utils/fin.js
CHANGED
|
@@ -1,39 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
$$,
|
|
3
|
-
Config,
|
|
4
|
-
SetThemeColorTag
|
|
5
|
-
} from "./_";
|
|
6
|
-
$$(document.body).addClass([
|
|
7
|
-
"usrDevice_" + Config.get().deviceIs,
|
|
8
|
-
"bdsDM_" + Config.get().darkMode,
|
|
9
|
-
"bdsTC_" + Config.get().themeColor
|
|
10
|
-
]);
|
|
11
|
-
$$(window).addEvent({
|
|
12
|
-
eventType: "load",
|
|
13
|
-
callback: () => {
|
|
14
|
-
let style = document.body.style;
|
|
15
|
-
let Body = $$(document.body);
|
|
16
|
-
let topNavHeight = Number(Body.getStyleProperty("--topNavHeight").removeLetters() || 0);
|
|
17
|
-
let footerNavHeight = Number(Body.getStyleProperty("--footerNavHeight").removeLetters() || 0);
|
|
18
|
-
let viewHeight = window.innerHeight;
|
|
19
|
-
let contentHeight = viewHeight - topNavHeight - footerNavHeight;
|
|
20
|
-
style.setProperty("--viewHeight", window.innerHeight + "px");
|
|
21
|
-
style.setProperty("--contentHeight", contentHeight + "px");
|
|
22
|
-
}
|
|
23
|
-
}).addEvent({
|
|
24
|
-
eventType: "resize",
|
|
25
|
-
eventID: "getDeviceInfo",
|
|
26
|
-
callback: () => {
|
|
27
|
-
Config.update.screen({
|
|
28
|
-
viewHeight: window.innerHeight,
|
|
29
|
-
viewWidth: window.innerWidth
|
|
30
|
-
});
|
|
31
|
-
let Body = $$(document.body);
|
|
32
|
-
let viewHeight = window.innerHeight;
|
|
33
|
-
let topNavHeight = Number(Body.getStyleProperty("--topNavHeight").removeLetters());
|
|
34
|
-
let footerNavHeight = Number(Body.getStyleProperty("--footerNavHeight").removeLetters());
|
|
35
|
-
let contentHeight = viewHeight - topNavHeight - footerNavHeight;
|
|
36
|
-
Body.setStyleProperty("--viewHeight", viewHeight + "px").setStyleProperty("--sideNavHeight", contentHeight + "px").setStyleProperty("--contentHeight", contentHeight + "px");
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
SetThemeColorTag();
|
|
1
|
+
import{$$ as o,Config as i,SetThemeColorTag as l}from"./_";o(document.body).addClass(["usrDevice_"+i.get().deviceIs,"bdsDM_"+i.get().darkMode,"bdsTC_"+i.get().themeColor]),o(window).addEvent({eventType:"load",callback:()=>{let e=document.body.style,t=o(document.body),r=Number(t.getStyleProperty("--topNavHeight").removeLetters()||0),n=Number(t.getStyleProperty("--footerNavHeight").removeLetters()||0),d=window.innerHeight-r-n;e.setProperty("--viewHeight",window.innerHeight+"px"),e.setProperty("--contentHeight",d+"px")}}).addEvent({eventType:"resize",eventID:"getDeviceInfo",callback:()=>{i.update.screen({viewHeight:window.innerHeight,viewWidth:window.innerWidth});let e=o(document.body),t=window.innerHeight,r=Number(e.getStyleProperty("--topNavHeight").removeLetters()),n=Number(e.getStyleProperty("--footerNavHeight").removeLetters()),g=t-r-n;e.setStyleProperty("--viewHeight",t+"px").setStyleProperty("--sideNavHeight",g+"px").setStyleProperty("--contentHeight",g+"px")}}),l();
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Config from "./config";
|
|
3
|
-
import $$ from "@mingoo/jsmin";
|
|
4
|
-
const $$fromRoot = (args) => {
|
|
5
|
-
let appRoot = Config.get().appRoot;
|
|
6
|
-
if ($$.is.shadowRoot(appRoot))
|
|
7
|
-
return $$(appRoot).find(args);
|
|
8
|
-
return $$(args);
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
$$fromRoot,
|
|
12
|
-
$$fromRoot as default
|
|
13
|
-
};
|
|
1
|
+
import"../chunk-VY3566IV.js";import e from"./config";import o from"@mingoo/jsmin";const p=t=>{let r=e.get().appRoot;return o.is.shadowRoot(r)?o(r).find(t):o(t)};export{p as $$fromRoot,p as default};
|
package/dist/@utils/jsminEx.js
CHANGED
|
@@ -1,172 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__async
|
|
3
|
-
} from "../chunk-JJ3PEWPN.js";
|
|
4
|
-
import $$ from "@mingoo/jsmin";
|
|
5
|
-
let publicURI = "https://cdn.amotify.com/";
|
|
6
|
-
$$.CDNReader = (url) => {
|
|
7
|
-
return new Promise((resolve, reject) => {
|
|
8
|
-
if (!url)
|
|
9
|
-
return resolve(false);
|
|
10
|
-
let tag = document.createElement("script");
|
|
11
|
-
tag.src = url;
|
|
12
|
-
tag.addEventListener("load", () => {
|
|
13
|
-
resolve(true);
|
|
14
|
-
});
|
|
15
|
-
$$(document.body).append(tag);
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
{
|
|
19
|
-
const D = (wb, fn) => {
|
|
20
|
-
return new D.fn.SpreadSheet(wb, fn);
|
|
21
|
-
};
|
|
22
|
-
D.fn = D.prototype = {};
|
|
23
|
-
$$.extend({
|
|
24
|
-
SpreadSheet: function(workbook, fileName) {
|
|
25
|
-
this.ok = true;
|
|
26
|
-
try {
|
|
27
|
-
this.workbook = workbook;
|
|
28
|
-
this.fileName = fileName;
|
|
29
|
-
} catch (error) {
|
|
30
|
-
console.log(error);
|
|
31
|
-
this.ok = false;
|
|
32
|
-
}
|
|
33
|
-
return this;
|
|
34
|
-
},
|
|
35
|
-
isValid: function() {
|
|
36
|
-
return this.ok;
|
|
37
|
-
},
|
|
38
|
-
getWorkbook: function() {
|
|
39
|
-
return this.workbook;
|
|
40
|
-
},
|
|
41
|
-
updateFileName: function(fileName) {
|
|
42
|
-
this.fileName = fileName;
|
|
43
|
-
return this;
|
|
44
|
-
},
|
|
45
|
-
updateMerges: function(merges) {
|
|
46
|
-
let json = this.toJson();
|
|
47
|
-
json.sheets.forEach((sheet, index) => {
|
|
48
|
-
let sheetMerges = merges[index];
|
|
49
|
-
const worksheet = this.workbook.getWorksheet(sheet.sheetName);
|
|
50
|
-
for (let [from, to] of sheetMerges) {
|
|
51
|
-
if (from && to)
|
|
52
|
-
worksheet.mergeCells(from + ":" + to);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
},
|
|
56
|
-
updateStyles: function(styles) {
|
|
57
|
-
let json = this.toJson();
|
|
58
|
-
json.sheets.forEach((sheet, index) => {
|
|
59
|
-
let sheetStyles = styles[index];
|
|
60
|
-
const worksheet = this.workbook.getWorksheet(sheet.sheetName);
|
|
61
|
-
for (let style of sheetStyles) {
|
|
62
|
-
let {
|
|
63
|
-
type,
|
|
64
|
-
target,
|
|
65
|
-
values
|
|
66
|
-
} = style;
|
|
67
|
-
let Targets = $$.flatArray(target);
|
|
68
|
-
for (let [key, value] of Object.entries(values))
|
|
69
|
-
for (let Target of Targets)
|
|
70
|
-
worksheet["get" + type.toCapital()](Target)[key] = value;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
},
|
|
74
|
-
toJson: function() {
|
|
75
|
-
let json = {
|
|
76
|
-
fileName: this.fileName,
|
|
77
|
-
sheets: []
|
|
78
|
-
};
|
|
79
|
-
this.workbook.eachSheet((sheet, id) => {
|
|
80
|
-
let sheetJson = {
|
|
81
|
-
sheetName: sheet.name,
|
|
82
|
-
rows: []
|
|
83
|
-
};
|
|
84
|
-
sheet.eachRow((row, rowIndex) => {
|
|
85
|
-
let [emp, ...values] = row.values;
|
|
86
|
-
sheetJson.rows.push(values);
|
|
87
|
-
});
|
|
88
|
-
json.sheets.push(sheetJson);
|
|
89
|
-
});
|
|
90
|
-
return json;
|
|
91
|
-
},
|
|
92
|
-
export: function(fileType) {
|
|
93
|
-
return __async(this, null, function* () {
|
|
94
|
-
fileType = fileType || "xlsx";
|
|
95
|
-
const uint8Array = yield this.workbook[fileType].writeBuffer();
|
|
96
|
-
const blob = new Blob([uint8Array], { type: "application/octet-binary" });
|
|
97
|
-
const dummyAnchor = document.createElement("a");
|
|
98
|
-
dummyAnchor.href = (window.URL || window.webkitURL).createObjectURL(blob);
|
|
99
|
-
dummyAnchor.download = this.fileName + "." + fileType;
|
|
100
|
-
dummyAnchor.click();
|
|
101
|
-
dummyAnchor.remove();
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}, D);
|
|
105
|
-
D.fn.SpreadSheet.prototype = D.fn;
|
|
106
|
-
D.fn.SpreadSheet.prototype.constructor = D;
|
|
107
|
-
let cdn_excelJS = publicURI + "@env/@foreign/exceljs.min.js";
|
|
108
|
-
$$.spreadSheet = {
|
|
109
|
-
readFromFile: (file) => __async(void 0, null, function* () {
|
|
110
|
-
if (!window.ExcelJS)
|
|
111
|
-
yield $$.CDNReader(cdn_excelJS);
|
|
112
|
-
if (!window.ExcelJS)
|
|
113
|
-
return;
|
|
114
|
-
let fileType = file.type;
|
|
115
|
-
let fileName = file.name.replace(/\.[^/.]+$/, "");
|
|
116
|
-
if (fileType.match(/csv/)) {
|
|
117
|
-
let csv = yield file.text();
|
|
118
|
-
const rows = csv.split(/[\n\r]+/).map((row) => row.split(/,/));
|
|
119
|
-
const workbook2 = new ExcelJS.Workbook();
|
|
120
|
-
const workSheet = workbook2.addWorksheet("Sheet1");
|
|
121
|
-
rows.forEach((row) => workSheet.addRow(row));
|
|
122
|
-
return D(workbook2, fileName);
|
|
123
|
-
}
|
|
124
|
-
const workbook = new ExcelJS.Workbook();
|
|
125
|
-
const buffer = (yield file.read("binaryString")).target.result;
|
|
126
|
-
return D(yield workbook.xlsx.load(buffer), fileName);
|
|
127
|
-
}),
|
|
128
|
-
readFromJson: (params) => __async(void 0, null, function* () {
|
|
129
|
-
if (!window.ExcelJS)
|
|
130
|
-
yield $$.CDNReader(cdn_excelJS);
|
|
131
|
-
if (!window.ExcelJS)
|
|
132
|
-
return;
|
|
133
|
-
let {
|
|
134
|
-
sheets,
|
|
135
|
-
fileName = ""
|
|
136
|
-
} = params;
|
|
137
|
-
fileName = fileName || $$.uuid.gen();
|
|
138
|
-
const workbook = new ExcelJS.Workbook();
|
|
139
|
-
sheets.forEach((sheet, index) => {
|
|
140
|
-
let {
|
|
141
|
-
sheetName,
|
|
142
|
-
rows,
|
|
143
|
-
merges = [],
|
|
144
|
-
styles = []
|
|
145
|
-
} = sheet;
|
|
146
|
-
sheetName = sheetName || "\u30B7\u30FC\u30C8" + (index + 1);
|
|
147
|
-
workbook.addWorksheet(sheetName);
|
|
148
|
-
const worksheet = workbook.getWorksheet(sheetName);
|
|
149
|
-
worksheet.addRows(rows);
|
|
150
|
-
for (let [from, to] of merges)
|
|
151
|
-
if (from && to)
|
|
152
|
-
worksheet.mergeCells(from + ":" + to);
|
|
153
|
-
for (let style of styles) {
|
|
154
|
-
let {
|
|
155
|
-
type,
|
|
156
|
-
target,
|
|
157
|
-
values
|
|
158
|
-
} = style;
|
|
159
|
-
let Targets = $$.flatArray(target);
|
|
160
|
-
for (let [key, value] of Object.entries(values))
|
|
161
|
-
for (let Target of Targets)
|
|
162
|
-
worksheet["get" + type.toCapital()](Target)[key] = value;
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
return D(workbook, fileName);
|
|
166
|
-
})
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
export {
|
|
170
|
-
$$,
|
|
171
|
-
$$ as default
|
|
172
|
-
};
|
|
1
|
+
import{e as y}from"../chunk-VY3566IV.js";import i from"@mingoo/jsmin";let J="https://cdn.amotify.com/";i.CDNReader=r=>new Promise((f,e)=>{if(!r)return f(!1);let t=document.createElement("script");t.src=r,t.addEventListener("load",()=>{f(!0)}),i(document.body).append(t)});{const r=(e,t)=>new r.fn.SpreadSheet(e,t);r.fn=r.prototype={},i.extend({SpreadSheet:function(e,t){this.ok=!0;try{this.workbook=e,this.fileName=t}catch(s){console.log(s),this.ok=!1}return this},isValid:function(){return this.ok},getWorkbook:function(){return this.workbook},updateFileName:function(e){return this.fileName=e,this},updateMerges:function(e){this.toJson().sheets.forEach((s,o)=>{let l=e[o];const c=this.workbook.getWorksheet(s.sheetName);for(let[n,a]of l)n&&a&&c.mergeCells(n+":"+a)})},updateStyles:function(e){this.toJson().sheets.forEach((s,o)=>{let l=e[o];const c=this.workbook.getWorksheet(s.sheetName);for(let n of l){let{type:a,target:p,values:h}=n,u=i.flatArray(p);for(let[d,m]of Object.entries(h))for(let w of u)c["get"+a.toCapital()](w)[d]=m}})},toJson:function(){let e={fileName:this.fileName,sheets:[]};return this.workbook.eachSheet((t,s)=>{let o={sheetName:t.name,rows:[]};t.eachRow((l,c)=>{let[n,...a]=l.values;o.rows.push(a)}),e.sheets.push(o)}),e},export:function(e){return y(this,null,function*(){e=e||"xlsx";const t=yield this.workbook[e].writeBuffer(),s=new Blob([t],{type:"application/octet-binary"}),o=document.createElement("a");o.href=(window.URL||window.webkitURL).createObjectURL(s),o.download=this.fileName+"."+e,o.click(),o.remove()})}},r),r.fn.SpreadSheet.prototype=r.fn,r.fn.SpreadSheet.prototype.constructor=r;let f=J+"@env/@foreign/exceljs.min.js";i.spreadSheet={readFromFile:e=>y(void 0,null,function*(){if(window.ExcelJS||(yield i.CDNReader(f)),!window.ExcelJS)return;let t=e.type,s=e.name.replace(/\.[^/.]+$/,"");if(t.match(/csv/)){const n=(yield e.text()).split(/[\n\r]+/).map(h=>h.split(/,/)),a=new ExcelJS.Workbook,p=a.addWorksheet("Sheet1");return n.forEach(h=>p.addRow(h)),r(a,s)}const o=new ExcelJS.Workbook,l=(yield e.read("binaryString")).target.result;return r(yield o.xlsx.load(l),s)}),readFromJson:e=>y(void 0,null,function*(){if(window.ExcelJS||(yield i.CDNReader(f)),!window.ExcelJS)return;let{sheets:t,fileName:s=""}=e;s=s||i.uuid.gen();const o=new ExcelJS.Workbook;return t.forEach((l,c)=>{let{sheetName:n,rows:a,merges:p=[],styles:h=[]}=l;n=n||"\u30B7\u30FC\u30C8"+(c+1),o.addWorksheet(n);const u=o.getWorksheet(n);u.addRows(a);for(let[d,m]of p)d&&m&&u.mergeCells(d+":"+m);for(let d of h){let{type:m,target:w,values:S}=d,g=i.flatArray(w);for(let[k,x]of Object.entries(S))for(let b of g)u["get"+m.toCapital()](b)[k]=x}}),r(o,s)})}}export{i as $$,i as default};
|