@shwfed/nuxt 0.1.23 → 0.1.25

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
3
  "configKey": "shwfed",
4
- "version": "0.1.23",
4
+ "version": "0.1.25",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -63,11 +63,16 @@ whenever(() => meta_k?.value, () => {
63
63
  </TooltipProvider>
64
64
  </template>
65
65
 
66
- <i18n lang="yaml">
67
- zh:
68
- command-palette-empty: 无搜索结果
69
- ja:
70
- command-palette-empty: 結果はありません
71
- en:
72
- command-palette-empty: No results
66
+ <i18n lang="json">
67
+ {
68
+ "zh": {
69
+ "command-palette-empty": "无搜索结果"
70
+ },
71
+ "ja": {
72
+ "command-palette-empty": "結果はありません"
73
+ },
74
+ "en": {
75
+ "command-palette-empty": "No results"
76
+ }
77
+ }
73
78
  </i18n>
@@ -1,6 +1,7 @@
1
1
  import { Environment, EvaluationError } from "@marcbachmann/cel-js";
2
2
  import { startOfDay, startOfWeek, startOfYear, startOfMonth, endOfDay, endOfWeek, endOfYear, endOfMonth, addYears, addMonths, addDays, addWeeks, setDate, setMonth, setYear, formatDate, isBefore, isAfter, isEqual } from "date-fns";
3
3
  import { TZDate } from "@date-fns/tz";
4
+ import { BigNumber } from "bignumber.js";
4
5
  export function createEnvironment(options) {
5
6
  const env = new Environment({
6
7
  enableOptionalTypes: true,
@@ -79,6 +80,14 @@ export function createEnvironment(options) {
79
80
  return formatDate(date, format);
80
81
  }).registerFunction("feature(string): bool", (feature) => {
81
82
  return (options?.features ?? []).includes(feature);
83
+ }).registerFunction("list<double>.sum(): double", (list) => {
84
+ return list.reduce((acc, curr) => acc.plus(curr), new BigNumber(0)).toNumber();
85
+ }).registerFunction("list<int>.sum(): double", (list) => {
86
+ return list.reduce((acc, curr) => acc.plus(curr), new BigNumber(0)).toNumber();
87
+ }).registerFunction("double.toLocaleString(dyn): string", (number, options2) => {
88
+ return number.toLocaleString(navigator.language, options2);
89
+ }).registerFunction("int.toLocaleString(dyn): string", (number, options2) => {
90
+ return number.toLocaleString(navigator.language, options2);
82
91
  });
83
92
  return env;
84
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,6 +45,7 @@
45
45
  "@tanstack/vue-table": "^8.21.3",
46
46
  "@tanstack/vue-virtual": "^3.13.18",
47
47
  "@vueuse/core": "^14.1.0",
48
+ "bignumber.js": "^9.3.1",
48
49
  "class-variance-authority": "^0.7.1",
49
50
  "clsx": "^2.1.1",
50
51
  "date-fns": "^4.1.0",