@ramathibodi/nuxt-commons 0.1.68 → 0.1.70
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 +1 -1
- package/dist/module.mjs +15 -1
- package/dist/runtime/components/device/IdCardButton.vue +83 -0
- package/dist/runtime/components/device/IdCardWebSocket.vue +195 -0
- package/dist/runtime/components/device/Scanner.vue +338 -0
- package/dist/runtime/components/form/File.vue +189 -126
- package/dist/runtime/components/form/Pad.vue +67 -1
- package/dist/runtime/components/form/SignPad.vue +126 -141
- package/dist/runtime/components/form/Table.vue +4 -1
- package/dist/runtime/components/form/TableData.vue +4 -1
- package/dist/runtime/components/form/images/Field.vue +276 -219
- package/dist/runtime/components/model/Autocomplete.vue +4 -1
- package/dist/runtime/components/model/Combobox.vue +4 -1
- package/dist/runtime/components/model/Select.vue +4 -1
- package/dist/runtime/composables/api.d.ts +4 -4
- package/dist/runtime/composables/api.js +33 -21
- package/dist/runtime/composables/assetFile.d.ts +31 -0
- package/dist/runtime/composables/assetFile.js +134 -0
- package/dist/runtime/composables/clientConfig.d.ts +15 -0
- package/dist/runtime/composables/clientConfig.js +79 -0
- package/dist/runtime/composables/document/templateFormTable.js +4 -1
- package/dist/runtime/composables/hostAgent.d.ts +260 -0
- package/dist/runtime/composables/hostAgent.js +74 -0
- package/dist/runtime/composables/hostAgentWs.d.ts +272 -0
- package/dist/runtime/composables/hostAgentWs.js +145 -0
- package/dist/runtime/composables/localStorageModel.d.ts +38 -0
- package/dist/runtime/composables/localStorageModel.js +88 -0
- package/dist/runtime/plugins/clientConfig.d.ts +2 -0
- package/dist/runtime/plugins/clientConfig.js +22 -0
- package/dist/runtime/plugins/default.d.ts +2 -0
- package/dist/runtime/plugins/default.js +50 -0
- package/dist/runtime/types/clientConfig.d.ts +13 -0
- package/package.json +3 -2
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from "nuxt/app";
|
|
2
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
|
3
|
+
nuxtApp.vueApp.directive("default", {
|
|
4
|
+
beforeMount(el, binding) {
|
|
5
|
+
const def = binding.value;
|
|
6
|
+
if (def === void 0 || def === null || def === "") return;
|
|
7
|
+
const apply = (value) => {
|
|
8
|
+
if ("value" in el) {
|
|
9
|
+
;
|
|
10
|
+
el.value = value;
|
|
11
|
+
}
|
|
12
|
+
el.dispatchEvent(new Event("input", { bubbles: true }));
|
|
13
|
+
el.dispatchEvent(new Event("change", { bubbles: true }));
|
|
14
|
+
};
|
|
15
|
+
apply(def);
|
|
16
|
+
const inner = el.querySelector?.("input, textarea, select");
|
|
17
|
+
if (inner) {
|
|
18
|
+
const onMountedSync = () => {
|
|
19
|
+
const cur = inner.value;
|
|
20
|
+
if (cur === "" || cur == null) {
|
|
21
|
+
inner.value = String(def);
|
|
22
|
+
inner.dispatchEvent(new Event("input", { bubbles: true }));
|
|
23
|
+
inner.dispatchEvent(new Event("change", { bubbles: true }));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
queueMicrotask(onMountedSync);
|
|
27
|
+
el.__vDefaultCleanup = () => {
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
// If the default value changes later, you can decide whether to re-apply.
|
|
32
|
+
// This version only applies when the current DOM value is empty.
|
|
33
|
+
updated(el, binding) {
|
|
34
|
+
const def = binding.value;
|
|
35
|
+
if (def === void 0 || def === null || def === "") return;
|
|
36
|
+
const target = "value" in el ? el : el.querySelector?.("input, textarea, select");
|
|
37
|
+
if (!target) return;
|
|
38
|
+
const cur = target.value;
|
|
39
|
+
if (cur === "" || cur === void 0 || cur === null) {
|
|
40
|
+
target.value = def;
|
|
41
|
+
target.dispatchEvent(new Event("input", { bubbles: true }));
|
|
42
|
+
target.dispatchEvent(new Event("change", { bubbles: true }));
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
unmounted(el) {
|
|
46
|
+
el.__vDefaultCleanup?.();
|
|
47
|
+
delete el.__vDefaultCleanup;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ClientConfig,ClientConfigService } from "../composables/clientConfig";
|
|
2
|
+
|
|
3
|
+
declare module "#app" {
|
|
4
|
+
interface NuxtApp {
|
|
5
|
+
$clientConfig: ClientConfig;
|
|
6
|
+
$clientConfigService: ClientConfigService;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface RuntimeNuxtApp {
|
|
10
|
+
$clientConfig: ClientConfig;
|
|
11
|
+
$clientConfigService: ClientConfigService;
|
|
12
|
+
}
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ramathibodi/nuxt-commons",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.70",
|
|
4
4
|
"description": "Ramathibodi Nuxt modules for common components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"@mdi/font": "^7.4.47",
|
|
71
71
|
"@nuxt/kit": "^3.16.2",
|
|
72
72
|
"@nuxtjs/apollo": "5.0.0-alpha.14",
|
|
73
|
+
"@thumbmarkjs/thumbmarkjs": "^1.6.1",
|
|
73
74
|
"@vue/apollo-composable": "^4.2.2",
|
|
74
75
|
"@vuepic/vue-datepicker": "^7.4.1",
|
|
75
76
|
"@vueuse/integrations": "^11.3.0",
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
"fuse.js": "^7.1.0",
|
|
81
82
|
"gql-query-builder": "^3.8.0",
|
|
82
83
|
"graphql": "^16.10.0",
|
|
83
|
-
"localstorage-
|
|
84
|
+
"localstorage-slim": "^2.7.1",
|
|
84
85
|
"lodash": "^4.17.21",
|
|
85
86
|
"luxon": "^3.6.1",
|
|
86
87
|
"maska": "^2.1.11",
|