@ramathibodi/nuxt-commons 4.0.11 → 4.0.12

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.
Files changed (39) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/document/TemplateBuilder.d.vue.ts +2 -2
  3. package/dist/runtime/components/document/TemplateBuilder.vue +1 -1
  4. package/dist/runtime/components/document/TemplateBuilder.vue.d.ts +2 -2
  5. package/dist/runtime/components/form/ActionPad.vue +1 -0
  6. package/dist/runtime/components/form/Birthdate.d.vue.ts +3 -3
  7. package/dist/runtime/components/form/Birthdate.vue.d.ts +3 -3
  8. package/dist/runtime/components/form/Date.vue +11 -6
  9. package/dist/runtime/components/form/Dialog.d.vue.ts +1 -5
  10. package/dist/runtime/components/form/Dialog.vue +1 -0
  11. package/dist/runtime/components/form/Dialog.vue.d.ts +1 -5
  12. package/dist/runtime/components/form/EditPad.vue +1 -0
  13. package/dist/runtime/components/form/Pad.d.vue.ts +24 -0
  14. package/dist/runtime/components/form/Pad.vue +11 -6
  15. package/dist/runtime/components/form/Pad.vue.d.ts +24 -0
  16. package/dist/runtime/components/form/Time.vue +10 -5
  17. package/dist/runtime/components/form/images/Edit.d.vue.ts +1 -3
  18. package/dist/runtime/components/form/images/Edit.vue.d.ts +1 -3
  19. package/dist/runtime/components/model/AutoRefreshChip.d.vue.ts +16 -0
  20. package/dist/runtime/components/model/AutoRefreshChip.vue +34 -0
  21. package/dist/runtime/components/model/AutoRefreshChip.vue.d.ts +16 -0
  22. package/dist/runtime/components/model/Table.d.vue.ts +91 -61
  23. package/dist/runtime/components/model/Table.vue +24 -5
  24. package/dist/runtime/components/model/Table.vue.d.ts +91 -61
  25. package/dist/runtime/components/model/iterator.d.vue.ts +103 -71
  26. package/dist/runtime/components/model/iterator.vue +24 -5
  27. package/dist/runtime/components/model/iterator.vue.d.ts +103 -71
  28. package/dist/runtime/composables/apiModel.d.ts +2 -2
  29. package/dist/runtime/composables/apiModel.js +3 -3
  30. package/dist/runtime/composables/autoRefresh.d.ts +42 -0
  31. package/dist/runtime/composables/autoRefresh.js +57 -0
  32. package/dist/runtime/composables/document/template.js +1 -1
  33. package/dist/runtime/composables/graphqlModel.d.ts +2 -2
  34. package/dist/runtime/composables/graphqlModel.js +3 -3
  35. package/dist/runtime/composables/modelAutoRefresh.d.ts +29 -0
  36. package/dist/runtime/composables/modelAutoRefresh.js +16 -0
  37. package/dist/runtime/composables/utils/validation.d.ts +4 -0
  38. package/dist/runtime/composables/utils/validation.js +2 -0
  39. package/package.json +2 -2
@@ -3,6 +3,7 @@ export declare function useRules(): {
3
3
  requireIf: (conditionIf: boolean, customError?: string) => (value: any) => string | true;
4
4
  requireTrue: (customError?: string) => (value: any) => string | true;
5
5
  requireTrueIf: (conditionIf: boolean, customError?: string) => (value: any) => string | true;
6
+ requireNotEmpty: (customError?: string) => (value: any) => string | true;
6
7
  numeric: (customError?: string) => (value: any) => string | true;
7
8
  range: (minValue: number, maxValue: number, customError?: string) => (value: any) => string | true;
8
9
  integer: (customError?: string) => (value: any) => string | true;
@@ -31,6 +32,7 @@ export declare function useRules(): {
31
32
  requireIf: (conditionIf: boolean, customError?: string) => (value: any) => string | true;
32
33
  requireTrue: (customError?: string) => (value: any) => string | true;
33
34
  requireTrueIf: (conditionIf: boolean, customError?: string) => (value: any) => string | true;
35
+ requireNotEmpty: (customError?: string) => (value: any) => string | true;
34
36
  numeric: (customError?: string) => (value: any) => string | true;
35
37
  range: (minValue: number, maxValue: number, customError?: string) => (value: any) => string | true;
36
38
  integer: (customError?: string) => (value: any) => string | true;
@@ -59,6 +61,7 @@ export declare function useRules(): {
59
61
  requireIf: (conditionIf: boolean, customError?: string) => (value: any) => string | true;
60
62
  requireTrue: (customError?: string) => (value: any) => string | true;
61
63
  requireTrueIf: (conditionIf: boolean, customError?: string) => (value: any) => string | true;
64
+ requireNotEmpty: (customError?: string) => (value: any) => string | true;
62
65
  numeric: (customError?: string) => (value: any) => string | true;
63
66
  range: (minValue: number, maxValue: number, customError?: string) => (value: any) => string | true;
64
67
  integer: (customError?: string) => (value: any) => string | true;
@@ -87,6 +90,7 @@ export declare function useRules(): {
87
90
  requireIf: (conditionIf: boolean, customError?: string) => (value: any) => string | true;
88
91
  requireTrue: (customError?: string) => (value: any) => string | true;
89
92
  requireTrueIf: (conditionIf: boolean, customError?: string) => (value: any) => string | true;
93
+ requireNotEmpty: (customError?: string) => (value: any) => string | true;
90
94
  numeric: (customError?: string) => (value: any) => string | true;
91
95
  range: (minValue: number, maxValue: number, customError?: string) => (value: any) => string | true;
92
96
  integer: (customError?: string) => (value: any) => string | true;
@@ -7,6 +7,7 @@ export function useRules() {
7
7
  const requireIf = (conditionIf, customError = "This field is required") => (value) => condition(!!value || value === false || value === 0 || !conditionIf, customError);
8
8
  const requireTrue = (customError = "This field must be true") => (value) => condition(!!value, customError);
9
9
  const requireTrueIf = (conditionIf, customError = "This field must be true") => (value) => condition(!!value || !conditionIf, customError);
10
+ const requireNotEmpty = (customError = "This field is required") => (value) => condition(Array.isArray(value) ? value.length > 0 : !!value || value === false || value === 0, customError);
10
11
  const numeric = (customError = "This field must be a number") => (value) => condition(!value || !isNaN(Number(value)), customError);
11
12
  const range = (minValue, maxValue, customError = `Value is out of range (${minValue}-${maxValue})`) => (value) => condition(!value || value >= minValue && value <= maxValue, customError);
12
13
  const integer = (customError = "This field must be an integer") => (value) => condition(!value || isInteger(value) || /^\+?-?\d+$/.test(value), customError);
@@ -35,6 +36,7 @@ export function useRules() {
35
36
  requireIf,
36
37
  requireTrue,
37
38
  requireTrueIf,
39
+ requireNotEmpty,
38
40
  numeric,
39
41
  range,
40
42
  integer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramathibodi/nuxt-commons",
3
- "version": "4.0.11",
3
+ "version": "4.0.12",
4
4
  "description": "Ramathibodi Nuxt modules for common components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -88,7 +88,7 @@
88
88
  "@techstark/opencv-js": "4.11.0-release.1",
89
89
  "@thumbmarkjs/thumbmarkjs": "^1.7.4",
90
90
  "@vue/apollo-composable": "^4.2.2",
91
- "@vuepic/vue-datepicker": "^7.4.1",
91
+ "@vuepic/vue-datepicker": "^12.1.0",
92
92
  "@vueuse/integrations": "^14.2.1",
93
93
  "@zxing/browser": "^0.1.5",
94
94
  "cropperjs": "^1.6.2",