@cocreate/calculate 1.15.0 → 1.16.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.
- package/CHANGELOG.md +27 -0
- package/demo/index.html +20 -25
- package/docs/index.html +13 -13
- package/package.json +7 -11
- package/src/index.js +950 -142
- package/webpack.config.js +65 -90
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
## [1.16.1](https://github.com/CoCreate-app/CoCreate-calculate/compare/v1.16.0...v1.16.1) (2025-04-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* added comments ([7ef054f](https://github.com/CoCreate-app/CoCreate-calculate/commit/7ef054f95558036f5d62b00676bf99a58fb425c4))
|
|
7
|
+
* added css-loader ([4649096](https://github.com/CoCreate-app/CoCreate-calculate/commit/46490965d3738e685afd41c44bc78e1e34fe1968))
|
|
8
|
+
* getAttribute ([2a79157](https://github.com/CoCreate-app/CoCreate-calculate/commit/2a7915740101e34923c499c9ebaac29e6b91c9fa))
|
|
9
|
+
* unified observer array of object ([8a525fa](https://github.com/CoCreate-app/CoCreate-calculate/commit/8a525fa0e0ab7a02b77783b2f0fae6a04851ef70))
|
|
10
|
+
* update query attributes ([38a77ff](https://github.com/CoCreate-app/CoCreate-calculate/commit/38a77ffb054b479f5ac926152e32980337ddbfe8))
|
|
11
|
+
* updated cocreate modules versions ([bf2795b](https://github.com/CoCreate-app/CoCreate-calculate/commit/bf2795b72ea5e7c7cbded8da66caa06e615353ee))
|
|
12
|
+
* webpack.config and devdependencies ([5f97fca](https://github.com/CoCreate-app/CoCreate-calculate/commit/5f97fcad7165a5332a0371b469f687d1fd7caa07))
|
|
13
|
+
|
|
14
|
+
# [1.16.0](https://github.com/CoCreate-app/CoCreate-calculate/compare/v1.15.0...v1.16.0) (2025-04-11)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* sanitize and calulate expressionbs ([0710efb](https://github.com/CoCreate-app/CoCreate-calculate/commit/0710efbdd72bdc563e387819e5a7c43a9d5bfb25))
|
|
20
|
+
* update demo ([4d6f6b6](https://github.com/CoCreate-app/CoCreate-calculate/commit/4d6f6b60b68dcdefb1eae64939fde8eea0e45096))
|
|
21
|
+
* update observer observe param to type and and attributeName to attributeFilter ([d50f013](https://github.com/CoCreate-app/CoCreate-calculate/commit/d50f013c0fb3de9e94bad052e11077da042ae223))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* **calculator:** Add mathematical expression evaluator ([89a3e61](https://github.com/CoCreate-app/CoCreate-calculate/commit/89a3e61c87b7cbcdd42a29583ddfbceafe611df8))
|
|
27
|
+
|
|
1
28
|
# [1.15.0](https://github.com/CoCreate-app/CoCreate-calculate/compare/v1.14.7...v1.15.0) (2024-11-04)
|
|
2
29
|
|
|
3
30
|
|
package/demo/index.html
CHANGED
|
@@ -1,30 +1,25 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
<head>
|
|
4
|
+
<title>Calculate | CoCreateJS</title>
|
|
5
|
+
<!-- CoCreate Favicon -->
|
|
6
|
+
<link
|
|
7
|
+
rel="icon"
|
|
8
|
+
type="image/png"
|
|
9
|
+
sizes="32x32"
|
|
10
|
+
href="../assets/favicon.ico" />
|
|
11
|
+
<link rel="manifest" href="/manifest.webmanifest" />
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<input value="12" calculate="$value * 100" />
|
|
15
|
+
<input class="class1" key="total" id="id1" value="12" />
|
|
16
|
+
<input class="class1" key="total" id="id2" value="13" />
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<h1 calculate="{[key='total']} + {(#te)}">sum</h1>
|
|
18
|
+
<input id="te" calculate="($selctor #id1) + ($selctor #id2)" />
|
|
19
|
+
<input calculate="($selctor [key='total']) + 1" />
|
|
20
|
+
<h1 calculate="($selctor [key='total']) + ($selctor .class1)">sum</h1>
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<!--<script src="../dist/CoCreate-calculate.js"></script>-->
|
|
28
|
-
<script src="https://CoCreate.app/dist/CoCreate.js"></script>
|
|
29
|
-
</body>
|
|
22
|
+
<!--<script src="../dist/CoCreate-calculate.js"></script>-->
|
|
23
|
+
<script src="https://dev.CoCreate.app/dist/CoCreate.js"></script>
|
|
24
|
+
</body>
|
|
30
25
|
</html>
|
package/docs/index.html
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
id="menuL"
|
|
47
47
|
class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl"
|
|
48
48
|
resizable
|
|
49
|
-
resize-
|
|
49
|
+
resize-query="[content_id='content']"
|
|
50
50
|
resize-property="margin-left"
|
|
51
51
|
resize-value="width">
|
|
52
52
|
<menu
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
share-width="700"
|
|
76
76
|
share-media="https://cdn.cocreate.app/docs/calculate.png"
|
|
77
77
|
hover="display:block!important"
|
|
78
|
-
hover-
|
|
78
|
+
hover-query=".social-networks">
|
|
79
79
|
<div class="display:none social-networks">
|
|
80
80
|
<a
|
|
81
81
|
class="margin-right:15px"
|
|
@@ -134,11 +134,11 @@
|
|
|
134
134
|
class="border-bottom:1px_solid_lightgrey"
|
|
135
135
|
scroll
|
|
136
136
|
scroll-intersect="color:dodgerblue"
|
|
137
|
-
scroll-
|
|
137
|
+
scroll-query="#calculate-install-section">
|
|
138
138
|
<span
|
|
139
139
|
class="display:flex align-items:center width:fit-content"
|
|
140
140
|
hover="display:block!important"
|
|
141
|
-
hover-
|
|
141
|
+
hover-query="[href='#calculate-install']">
|
|
142
142
|
<h2 class="padding:5px_0px">Install</h2>
|
|
143
143
|
<a
|
|
144
144
|
class="margin-left:10px display:none"
|
|
@@ -159,11 +159,11 @@
|
|
|
159
159
|
class="margin-top:80px border-bottom:1px_solid_lightgrey"
|
|
160
160
|
scroll
|
|
161
161
|
scroll-intersect="color:dodgerblue"
|
|
162
|
-
scroll-
|
|
162
|
+
scroll-query="#calculate-usage-section">
|
|
163
163
|
<span
|
|
164
164
|
class="display:flex align-items:center width:fit-content"
|
|
165
165
|
hover="display:block!important"
|
|
166
|
-
hover-
|
|
166
|
+
hover-query="[href='#calculate-usage']">
|
|
167
167
|
<h2 class="padding:5px_0px">Usage</h2>
|
|
168
168
|
<a
|
|
169
169
|
class="margin-left:10px display:none"
|
|
@@ -193,11 +193,11 @@
|
|
|
193
193
|
class="margin-top:80px border-bottom:1px_solid_lightgrey"
|
|
194
194
|
scroll
|
|
195
195
|
scroll-intersect="color:dodgerblue"
|
|
196
|
-
scroll-
|
|
196
|
+
scroll-query="#calculate-attributes-section">
|
|
197
197
|
<span
|
|
198
198
|
class="display:flex align-items:center width:fit-content"
|
|
199
199
|
hover="display:block!important"
|
|
200
|
-
hover-
|
|
200
|
+
hover-query="[href='#calculate-attributes']">
|
|
201
201
|
<h2 class="padding:5px_0px">Attributes</h2>
|
|
202
202
|
<a
|
|
203
203
|
class="margin-left:10px display:none"
|
|
@@ -244,11 +244,11 @@
|
|
|
244
244
|
class="border-bottom:1px_solid_lightgrey"
|
|
245
245
|
scroll
|
|
246
246
|
scroll-intersect="color:dodgerblue"
|
|
247
|
-
scroll-
|
|
247
|
+
scroll-query="#calculate-demo-section">
|
|
248
248
|
<span
|
|
249
249
|
class="display:flex align-items:center width:fit-content"
|
|
250
250
|
hover="display:block!important"
|
|
251
|
-
hover-
|
|
251
|
+
hover-query="[href='#calculate-demo']">
|
|
252
252
|
<h2 class="padding:5px_0px">Demo</h2>
|
|
253
253
|
<a
|
|
254
254
|
class="margin-left:10px display:none"
|
|
@@ -295,7 +295,7 @@
|
|
|
295
295
|
show="#eye-slash"
|
|
296
296
|
hide="#eye, #demo-preview"
|
|
297
297
|
toggle="code-height"
|
|
298
|
-
toggle-
|
|
298
|
+
toggle-query="#demo-code"
|
|
299
299
|
><i
|
|
300
300
|
class="height:18px"
|
|
301
301
|
src="/assets/svg/eye.svg"></i
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
show="#eye, #demo-preview"
|
|
308
308
|
hide="#eye-slash"
|
|
309
309
|
toggle="code-height"
|
|
310
|
-
toggle-
|
|
310
|
+
toggle-query="#demo-code"
|
|
311
311
|
><i src="/assets/svg/eye-slash.svg"></i
|
|
312
312
|
></a>
|
|
313
313
|
<a
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
<a
|
|
331
331
|
class="margin-right:5px"
|
|
332
332
|
fullscreen
|
|
333
|
-
fullscreen-
|
|
333
|
+
fullscreen-query="#playground"></a>
|
|
334
334
|
</div>
|
|
335
335
|
</div>
|
|
336
336
|
<!-- End SandBox -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/calculate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.1",
|
|
4
4
|
"description": "A handy vanilla JavaScript calculator, concatenate multiple elements containing integers & execute calculates. Can be used for creating invoices,making payments & any kind of complex calculate. Easily configured using HTML5 attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"calculate",
|
|
@@ -46,21 +46,17 @@
|
|
|
46
46
|
},
|
|
47
47
|
"main": "./src/index.js",
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"clean-webpack-plugin": "^3.0.0",
|
|
53
|
-
"file-loader": "^6.2.0",
|
|
49
|
+
"css-loader": "^5.1.3",
|
|
50
|
+
"esbuild": "^0.25.2",
|
|
51
|
+
"esbuild-loader": "^4.3.0",
|
|
54
52
|
"mini-css-extract-plugin": "^1.5.0",
|
|
55
|
-
"style-loader": "^3.3.1",
|
|
56
|
-
"terser-webpack-plugin": "^5.1.1",
|
|
57
53
|
"webpack": "^5.24.4",
|
|
58
54
|
"webpack-cli": "^4.5.0",
|
|
59
55
|
"webpack-log": "^3.0.1"
|
|
60
56
|
},
|
|
61
57
|
"dependencies": {
|
|
62
|
-
"@cocreate/element-prototype": "^1.
|
|
63
|
-
"@cocreate/observer": "^1.
|
|
64
|
-
"@cocreate/utils": "^1.
|
|
58
|
+
"@cocreate/element-prototype": "^1.29.0",
|
|
59
|
+
"@cocreate/observer": "^1.18.0",
|
|
60
|
+
"@cocreate/utils": "^1.38.0"
|
|
65
61
|
}
|
|
66
62
|
}
|