@ethereal-nexus/core 0.1.0

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 (218) hide show
  1. package/LICENSE +201 -0
  2. package/dist/decorators/index.d.mts +8 -0
  3. package/dist/decorators/index.d.ts +8 -0
  4. package/dist/decorators/index.js +71 -0
  5. package/dist/decorators/index.js.map +1 -0
  6. package/dist/decorators/index.mjs +34 -0
  7. package/dist/decorators/index.mjs.map +1 -0
  8. package/dist/decorators/webcomponent/index.d.mts +8 -0
  9. package/dist/decorators/webcomponent/index.d.ts +8 -0
  10. package/dist/decorators/webcomponent/index.js +71 -0
  11. package/dist/decorators/webcomponent/index.js.map +1 -0
  12. package/dist/decorators/webcomponent/index.mjs +34 -0
  13. package/dist/decorators/webcomponent/index.mjs.map +1 -0
  14. package/dist/decorators/webcomponent/webcomponent.d.mts +12 -0
  15. package/dist/decorators/webcomponent/webcomponent.d.ts +12 -0
  16. package/dist/decorators/webcomponent/webcomponent.js +69 -0
  17. package/dist/decorators/webcomponent/webcomponent.js.map +1 -0
  18. package/dist/decorators/webcomponent/webcomponent.mjs +34 -0
  19. package/dist/decorators/webcomponent/webcomponent.mjs.map +1 -0
  20. package/dist/functions/index.d.mts +8 -0
  21. package/dist/functions/index.d.ts +8 -0
  22. package/dist/functions/index.js +44 -0
  23. package/dist/functions/index.js.map +1 -0
  24. package/dist/functions/index.mjs +16 -0
  25. package/dist/functions/index.mjs.map +1 -0
  26. package/dist/functions/parse/index.d.mts +8 -0
  27. package/dist/functions/parse/index.d.ts +8 -0
  28. package/dist/functions/parse/index.js +44 -0
  29. package/dist/functions/parse/index.js.map +1 -0
  30. package/dist/functions/parse/index.mjs +16 -0
  31. package/dist/functions/parse/index.mjs.map +1 -0
  32. package/dist/functions/parse/parse.d.mts +12 -0
  33. package/dist/functions/parse/parse.d.ts +12 -0
  34. package/dist/functions/parse/parse.js +35 -0
  35. package/dist/functions/parse/parse.js.map +1 -0
  36. package/dist/functions/parse/parse.mjs +10 -0
  37. package/dist/functions/parse/parse.mjs.map +1 -0
  38. package/dist/functions/parse/parsePrimitives.d.mts +10 -0
  39. package/dist/functions/parse/parsePrimitives.d.ts +10 -0
  40. package/dist/functions/parse/parsePrimitives.js +33 -0
  41. package/dist/functions/parse/parsePrimitives.js.map +1 -0
  42. package/dist/functions/parse/parsePrimitives.mjs +8 -0
  43. package/dist/functions/parse/parsePrimitives.mjs.map +1 -0
  44. package/dist/index.d.mts +20 -0
  45. package/dist/index.d.ts +20 -0
  46. package/dist/index.js +329 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/index.mjs +280 -0
  49. package/dist/index.mjs.map +1 -0
  50. package/dist/schema/checkbox/checkbox.d.mts +14 -0
  51. package/dist/schema/checkbox/checkbox.d.ts +14 -0
  52. package/dist/schema/checkbox/checkbox.js +46 -0
  53. package/dist/schema/checkbox/checkbox.js.map +1 -0
  54. package/dist/schema/checkbox/checkbox.mjs +21 -0
  55. package/dist/schema/checkbox/checkbox.mjs.map +1 -0
  56. package/dist/schema/checkbox/index.d.mts +3 -0
  57. package/dist/schema/checkbox/index.d.ts +3 -0
  58. package/dist/schema/checkbox/index.js +48 -0
  59. package/dist/schema/checkbox/index.js.map +1 -0
  60. package/dist/schema/checkbox/index.mjs +21 -0
  61. package/dist/schema/checkbox/index.mjs.map +1 -0
  62. package/dist/schema/dialog/dialog.d.mts +13 -0
  63. package/dist/schema/dialog/dialog.d.ts +13 -0
  64. package/dist/schema/dialog/dialog.js +92 -0
  65. package/dist/schema/dialog/dialog.js.map +1 -0
  66. package/dist/schema/dialog/dialog.mjs +67 -0
  67. package/dist/schema/dialog/dialog.mjs.map +1 -0
  68. package/dist/schema/dialog/index.d.mts +6 -0
  69. package/dist/schema/dialog/index.d.ts +6 -0
  70. package/dist/schema/dialog/index.js +94 -0
  71. package/dist/schema/dialog/index.js.map +1 -0
  72. package/dist/schema/dialog/index.mjs +67 -0
  73. package/dist/schema/dialog/index.mjs.map +1 -0
  74. package/dist/schema/hidden/hidden.d.mts +22 -0
  75. package/dist/schema/hidden/hidden.d.ts +22 -0
  76. package/dist/schema/hidden/hidden.js +42 -0
  77. package/dist/schema/hidden/hidden.js.map +1 -0
  78. package/dist/schema/hidden/hidden.mjs +17 -0
  79. package/dist/schema/hidden/hidden.mjs.map +1 -0
  80. package/dist/schema/hidden/index.d.mts +3 -0
  81. package/dist/schema/hidden/index.d.ts +3 -0
  82. package/dist/schema/hidden/index.js +44 -0
  83. package/dist/schema/hidden/index.js.map +1 -0
  84. package/dist/schema/hidden/index.mjs +17 -0
  85. package/dist/schema/hidden/index.mjs.map +1 -0
  86. package/dist/schema/image/image.d.mts +15 -0
  87. package/dist/schema/image/image.d.ts +15 -0
  88. package/dist/schema/image/image.js +47 -0
  89. package/dist/schema/image/image.js.map +1 -0
  90. package/dist/schema/image/image.mjs +22 -0
  91. package/dist/schema/image/image.mjs.map +1 -0
  92. package/dist/schema/image/index.d.mts +3 -0
  93. package/dist/schema/image/index.d.ts +3 -0
  94. package/dist/schema/image/index.js +49 -0
  95. package/dist/schema/image/index.js.map +1 -0
  96. package/dist/schema/image/index.mjs +22 -0
  97. package/dist/schema/image/index.mjs.map +1 -0
  98. package/dist/schema/multifield/index.d.mts +4 -0
  99. package/dist/schema/multifield/index.d.ts +4 -0
  100. package/dist/schema/multifield/index.js +50 -0
  101. package/dist/schema/multifield/index.js.map +1 -0
  102. package/dist/schema/multifield/index.mjs +23 -0
  103. package/dist/schema/multifield/index.mjs.map +1 -0
  104. package/dist/schema/multifield/multifield.d.mts +17 -0
  105. package/dist/schema/multifield/multifield.d.ts +17 -0
  106. package/dist/schema/multifield/multifield.js +48 -0
  107. package/dist/schema/multifield/multifield.js.map +1 -0
  108. package/dist/schema/multifield/multifield.mjs +23 -0
  109. package/dist/schema/multifield/multifield.mjs.map +1 -0
  110. package/dist/schema/object/index.d.mts +6 -0
  111. package/dist/schema/object/index.d.ts +6 -0
  112. package/dist/schema/object/index.js +51 -0
  113. package/dist/schema/object/index.js.map +1 -0
  114. package/dist/schema/object/index.mjs +24 -0
  115. package/dist/schema/object/index.mjs.map +1 -0
  116. package/dist/schema/object/object.d.mts +12 -0
  117. package/dist/schema/object/object.d.ts +12 -0
  118. package/dist/schema/object/object.js +49 -0
  119. package/dist/schema/object/object.js.map +1 -0
  120. package/dist/schema/object/object.mjs +24 -0
  121. package/dist/schema/object/object.mjs.map +1 -0
  122. package/dist/schema/optional/index.d.mts +3 -0
  123. package/dist/schema/optional/index.d.ts +3 -0
  124. package/dist/schema/optional/index.js +44 -0
  125. package/dist/schema/optional/index.js.map +1 -0
  126. package/dist/schema/optional/index.mjs +17 -0
  127. package/dist/schema/optional/index.mjs.map +1 -0
  128. package/dist/schema/optional/optional.d.mts +26 -0
  129. package/dist/schema/optional/optional.d.ts +26 -0
  130. package/dist/schema/optional/optional.js +42 -0
  131. package/dist/schema/optional/optional.js.map +1 -0
  132. package/dist/schema/optional/optional.mjs +17 -0
  133. package/dist/schema/optional/optional.mjs.map +1 -0
  134. package/dist/schema/pathbrowser/index.d.mts +3 -0
  135. package/dist/schema/pathbrowser/index.d.ts +3 -0
  136. package/dist/schema/pathbrowser/index.js +49 -0
  137. package/dist/schema/pathbrowser/index.js.map +1 -0
  138. package/dist/schema/pathbrowser/index.mjs +22 -0
  139. package/dist/schema/pathbrowser/index.mjs.map +1 -0
  140. package/dist/schema/pathbrowser/pathbrowser.d.mts +15 -0
  141. package/dist/schema/pathbrowser/pathbrowser.d.ts +15 -0
  142. package/dist/schema/pathbrowser/pathbrowser.js +47 -0
  143. package/dist/schema/pathbrowser/pathbrowser.js.map +1 -0
  144. package/dist/schema/pathbrowser/pathbrowser.mjs +22 -0
  145. package/dist/schema/pathbrowser/pathbrowser.mjs.map +1 -0
  146. package/dist/schema/select/index.d.mts +3 -0
  147. package/dist/schema/select/index.d.ts +3 -0
  148. package/dist/schema/select/index.js +49 -0
  149. package/dist/schema/select/index.js.map +1 -0
  150. package/dist/schema/select/index.mjs +22 -0
  151. package/dist/schema/select/index.mjs.map +1 -0
  152. package/dist/schema/select/select.d.mts +18 -0
  153. package/dist/schema/select/select.d.ts +18 -0
  154. package/dist/schema/select/select.js +47 -0
  155. package/dist/schema/select/select.js.map +1 -0
  156. package/dist/schema/select/select.mjs +22 -0
  157. package/dist/schema/select/select.mjs.map +1 -0
  158. package/dist/schema/text/index.d.mts +3 -0
  159. package/dist/schema/text/index.d.ts +3 -0
  160. package/dist/schema/text/index.js +49 -0
  161. package/dist/schema/text/index.js.map +1 -0
  162. package/dist/schema/text/index.mjs +22 -0
  163. package/dist/schema/text/index.mjs.map +1 -0
  164. package/dist/schema/text/text.d.mts +15 -0
  165. package/dist/schema/text/text.d.ts +15 -0
  166. package/dist/schema/text/text.js +47 -0
  167. package/dist/schema/text/text.js.map +1 -0
  168. package/dist/schema/text/text.mjs +22 -0
  169. package/dist/schema/text/text.mjs.map +1 -0
  170. package/dist/types/index.d.mts +5 -0
  171. package/dist/types/index.d.ts +5 -0
  172. package/dist/types/index.js +19 -0
  173. package/dist/types/index.js.map +1 -0
  174. package/dist/types/index.mjs +1 -0
  175. package/dist/types/index.mjs.map +1 -0
  176. package/dist/types/infer.d.mts +9 -0
  177. package/dist/types/infer.d.ts +9 -0
  178. package/dist/types/infer.js +19 -0
  179. package/dist/types/infer.js.map +1 -0
  180. package/dist/types/infer.mjs +1 -0
  181. package/dist/types/infer.mjs.map +1 -0
  182. package/dist/types/object.d.mts +39 -0
  183. package/dist/types/object.d.ts +39 -0
  184. package/dist/types/object.js +19 -0
  185. package/dist/types/object.js.map +1 -0
  186. package/dist/types/object.mjs +1 -0
  187. package/dist/types/object.mjs.map +1 -0
  188. package/dist/types/props.d.mts +13 -0
  189. package/dist/types/props.d.ts +13 -0
  190. package/dist/types/props.js +19 -0
  191. package/dist/types/props.js.map +1 -0
  192. package/dist/types/props.mjs +1 -0
  193. package/dist/types/props.mjs.map +1 -0
  194. package/dist/types/schema.d.mts +42 -0
  195. package/dist/types/schema.d.ts +42 -0
  196. package/dist/types/schema.js +19 -0
  197. package/dist/types/schema.js.map +1 -0
  198. package/dist/types/schema.mjs +1 -0
  199. package/dist/types/schema.mjs.map +1 -0
  200. package/dist/types/utils.d.mts +32 -0
  201. package/dist/types/utils.d.ts +32 -0
  202. package/dist/types/utils.js +19 -0
  203. package/dist/types/utils.js.map +1 -0
  204. package/dist/types/utils.mjs +1 -0
  205. package/dist/types/utils.mjs.map +1 -0
  206. package/dist/types/webcomponent.d.mts +7 -0
  207. package/dist/types/webcomponent.d.ts +7 -0
  208. package/dist/types/webcomponent.js +19 -0
  209. package/dist/types/webcomponent.js.map +1 -0
  210. package/dist/types/webcomponent.mjs +1 -0
  211. package/dist/types/webcomponent.mjs.map +1 -0
  212. package/dist/utils/pascalToKebab.d.mts +3 -0
  213. package/dist/utils/pascalToKebab.d.ts +3 -0
  214. package/dist/utils/pascalToKebab.js +33 -0
  215. package/dist/utils/pascalToKebab.js.map +1 -0
  216. package/dist/utils/pascalToKebab.mjs +8 -0
  217. package/dist/utils/pascalToKebab.mjs.map +1 -0
  218. package/package.json +37 -0
@@ -0,0 +1,14 @@
1
+ import { BaseSchema, BaseFieldInput } from '../../types/schema.js';
2
+ import '../../types/webcomponent.js';
3
+
4
+ interface CheckBoxSchema<TOutput extends boolean = boolean> extends BaseSchema<TOutput> {
5
+ /**
6
+ * The schema type.
7
+ */
8
+ type: 'checkbox';
9
+ }
10
+ interface CheckBoxInput extends BaseFieldInput {
11
+ }
12
+ declare function checkbox(input: CheckBoxInput): CheckBoxSchema;
13
+
14
+ export { type CheckBoxSchema, checkbox };
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/schema/checkbox/checkbox.ts
21
+ var checkbox_exports = {};
22
+ __export(checkbox_exports, {
23
+ checkbox: () => checkbox
24
+ });
25
+ module.exports = __toCommonJS(checkbox_exports);
26
+ function checkbox(input) {
27
+ const { label } = input;
28
+ return {
29
+ type: "checkbox",
30
+ _parse() {
31
+ return {
32
+ type: "checkbox",
33
+ label
34
+ };
35
+ },
36
+ _primitive() {
37
+ return "boolean";
38
+ },
39
+ ...input
40
+ };
41
+ }
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ checkbox
45
+ });
46
+ //# sourceMappingURL=checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/schema/checkbox/checkbox.ts"],"sourcesContent":["import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface CheckBoxSchema<TOutput extends boolean = boolean> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'checkbox';\n}\n\ninterface CheckBoxInput extends BaseFieldInput {}\n\nexport function checkbox(input: CheckBoxInput): CheckBoxSchema {\n const {label} = input;\n\n return {\n type: 'checkbox',\n _parse() {\n return {\n type: 'checkbox',\n label,\n }\n },\n _primitive() {\n return 'boolean'\n },\n ...input,\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWO,SAAS,SAAS,OAAsC;AAC7D,QAAM,EAAC,MAAK,IAAI;AAEhB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AACP,aAAO;AAAA,QACL,MAAM;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,IACA,aAAa;AACX,aAAO;AAAA,IACT;AAAA,IACA,GAAG;AAAA,EACL;AACF;","names":[]}
@@ -0,0 +1,21 @@
1
+ // src/schema/checkbox/checkbox.ts
2
+ function checkbox(input) {
3
+ const { label } = input;
4
+ return {
5
+ type: "checkbox",
6
+ _parse() {
7
+ return {
8
+ type: "checkbox",
9
+ label
10
+ };
11
+ },
12
+ _primitive() {
13
+ return "boolean";
14
+ },
15
+ ...input
16
+ };
17
+ }
18
+ export {
19
+ checkbox
20
+ };
21
+ //# sourceMappingURL=checkbox.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/schema/checkbox/checkbox.ts"],"sourcesContent":["import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface CheckBoxSchema<TOutput extends boolean = boolean> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'checkbox';\n}\n\ninterface CheckBoxInput extends BaseFieldInput {}\n\nexport function checkbox(input: CheckBoxInput): CheckBoxSchema {\n const {label} = input;\n\n return {\n type: 'checkbox',\n _parse() {\n return {\n type: 'checkbox',\n label,\n }\n },\n _primitive() {\n return 'boolean'\n },\n ...input,\n }\n}"],"mappings":";AAWO,SAAS,SAAS,OAAsC;AAC7D,QAAM,EAAC,MAAK,IAAI;AAEhB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AACP,aAAO;AAAA,QACL,MAAM;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,IACA,aAAa;AACX,aAAO;AAAA,IACT;AAAA,IACA,GAAG;AAAA,EACL;AACF;","names":[]}
@@ -0,0 +1,3 @@
1
+ export { CheckBoxSchema, checkbox } from './checkbox.mjs';
2
+ import '../../types/schema.mjs';
3
+ import '../../types/webcomponent.mjs';
@@ -0,0 +1,3 @@
1
+ export { CheckBoxSchema, checkbox } from './checkbox.js';
2
+ import '../../types/schema.js';
3
+ import '../../types/webcomponent.js';
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/schema/checkbox/index.ts
21
+ var checkbox_exports = {};
22
+ __export(checkbox_exports, {
23
+ checkbox: () => checkbox
24
+ });
25
+ module.exports = __toCommonJS(checkbox_exports);
26
+
27
+ // src/schema/checkbox/checkbox.ts
28
+ function checkbox(input) {
29
+ const { label } = input;
30
+ return {
31
+ type: "checkbox",
32
+ _parse() {
33
+ return {
34
+ type: "checkbox",
35
+ label
36
+ };
37
+ },
38
+ _primitive() {
39
+ return "boolean";
40
+ },
41
+ ...input
42
+ };
43
+ }
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ checkbox
47
+ });
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/schema/checkbox/index.ts","../../../src/schema/checkbox/checkbox.ts"],"sourcesContent":["export * from './checkbox'","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface CheckBoxSchema<TOutput extends boolean = boolean> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'checkbox';\n}\n\ninterface CheckBoxInput extends BaseFieldInput {}\n\nexport function checkbox(input: CheckBoxInput): CheckBoxSchema {\n const {label} = input;\n\n return {\n type: 'checkbox',\n _parse() {\n return {\n type: 'checkbox',\n label,\n }\n },\n _primitive() {\n return 'boolean'\n },\n ...input,\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWO,SAAS,SAAS,OAAsC;AAC7D,QAAM,EAAC,MAAK,IAAI;AAEhB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AACP,aAAO;AAAA,QACL,MAAM;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,IACA,aAAa;AACX,aAAO;AAAA,IACT;AAAA,IACA,GAAG;AAAA,EACL;AACF;","names":[]}
@@ -0,0 +1,21 @@
1
+ // src/schema/checkbox/checkbox.ts
2
+ function checkbox(input) {
3
+ const { label } = input;
4
+ return {
5
+ type: "checkbox",
6
+ _parse() {
7
+ return {
8
+ type: "checkbox",
9
+ label
10
+ };
11
+ },
12
+ _primitive() {
13
+ return "boolean";
14
+ },
15
+ ...input
16
+ };
17
+ }
18
+ export {
19
+ checkbox
20
+ };
21
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/schema/checkbox/checkbox.ts"],"sourcesContent":["import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface CheckBoxSchema<TOutput extends boolean = boolean> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'checkbox';\n}\n\ninterface CheckBoxInput extends BaseFieldInput {}\n\nexport function checkbox(input: CheckBoxInput): CheckBoxSchema {\n const {label} = input;\n\n return {\n type: 'checkbox',\n _parse() {\n return {\n type: 'checkbox',\n label,\n }\n },\n _primitive() {\n return 'boolean'\n },\n ...input,\n }\n}"],"mappings":";AAWO,SAAS,SAAS,OAAsC;AAC7D,QAAM,EAAC,MAAK,IAAI;AAEhB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AACP,aAAO;AAAA,QACL,MAAM;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,IACA,aAAa;AACX,aAAO;AAAA,IACT;AAAA,IACA,GAAG;AAAA,EACL;AACF;","names":[]}
@@ -0,0 +1,13 @@
1
+ import { EntryMask } from '../../types/utils.mjs';
2
+ import { BaseSchema } from '../../types/schema.mjs';
3
+ import { ObjectEntries, ObjectOutput } from '../../types/object.mjs';
4
+ import '../../types/webcomponent.mjs';
5
+ import '../optional/optional.mjs';
6
+
7
+ interface DialogSchema<TEntries extends ObjectEntries, TOutput = ObjectOutput<TEntries>> extends BaseSchema<TOutput> {
8
+ type: 'dialog';
9
+ tabs: (tabs: Record<string, EntryMask<TEntries>>) => Omit<DialogSchema<TEntries>, 'tabs'>;
10
+ }
11
+ declare function dialog<TEntries extends ObjectEntries>(entries: TEntries): DialogSchema<TEntries>;
12
+
13
+ export { type DialogSchema, dialog };
@@ -0,0 +1,13 @@
1
+ import { EntryMask } from '../../types/utils.js';
2
+ import { BaseSchema } from '../../types/schema.js';
3
+ import { ObjectEntries, ObjectOutput } from '../../types/object.js';
4
+ import '../../types/webcomponent.js';
5
+ import '../optional/optional.js';
6
+
7
+ interface DialogSchema<TEntries extends ObjectEntries, TOutput = ObjectOutput<TEntries>> extends BaseSchema<TOutput> {
8
+ type: 'dialog';
9
+ tabs: (tabs: Record<string, EntryMask<TEntries>>) => Omit<DialogSchema<TEntries>, 'tabs'>;
10
+ }
11
+ declare function dialog<TEntries extends ObjectEntries>(entries: TEntries): DialogSchema<TEntries>;
12
+
13
+ export { type DialogSchema, dialog };
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/schema/dialog/dialog.ts
21
+ var dialog_exports = {};
22
+ __export(dialog_exports, {
23
+ dialog: () => dialog
24
+ });
25
+ module.exports = __toCommonJS(dialog_exports);
26
+ function dialog(entries) {
27
+ return {
28
+ type: "dialog",
29
+ tabs(tabs) {
30
+ return {
31
+ ...this,
32
+ tabs: void 0,
33
+ _parse() {
34
+ const usedEntries = /* @__PURE__ */ new Set();
35
+ const tabsArray = Object.entries(tabs).map(([tabKey, value]) => {
36
+ const children = Object.entries(value).map(([key, value2]) => {
37
+ if (value2 === true) {
38
+ if (usedEntries.has(key)) {
39
+ throw new Error(`Entry "${String(tabKey)}.${String(key)}" is already used in another tab.`);
40
+ }
41
+ usedEntries.add(key);
42
+ return {
43
+ id: key,
44
+ ...entries[key]._parse()
45
+ };
46
+ }
47
+ });
48
+ return {
49
+ type: "tab",
50
+ label: tabKey,
51
+ id: `tab_${tabKey.toLowerCase().replaceAll(" ", "")}`,
52
+ children
53
+ };
54
+ });
55
+ return {
56
+ type: "tabs",
57
+ id: "tabs",
58
+ children: tabsArray
59
+ };
60
+ }
61
+ };
62
+ },
63
+ _parse() {
64
+ return Object.entries(entries).map(([key, entry]) => ({
65
+ id: key,
66
+ name: key,
67
+ ...entry._parse()
68
+ })).filter((entry) => {
69
+ if ("type" in entry) {
70
+ return entry.type !== "hidden";
71
+ }
72
+ });
73
+ },
74
+ _primitive() {
75
+ return Object.entries(entries).reduce(
76
+ (acc, [key, entry]) => {
77
+ const type = entry._primitive();
78
+ if (typeof type === "string") {
79
+ acc[key] = type;
80
+ }
81
+ return acc;
82
+ },
83
+ {}
84
+ );
85
+ }
86
+ };
87
+ }
88
+ // Annotate the CommonJS export names for ESM import in node:
89
+ 0 && (module.exports = {
90
+ dialog
91
+ });
92
+ //# sourceMappingURL=dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/schema/dialog/dialog.ts"],"sourcesContent":["import { BaseSchema, EntryMask } from '../../types';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\n\nexport interface DialogSchema<TEntries extends ObjectEntries, TOutput = ObjectOutput<TEntries>> extends BaseSchema<TOutput> {\n type: 'dialog';\n tabs: (tabs: Record<string, EntryMask<TEntries>>) => Omit<DialogSchema<TEntries>, 'tabs'>\n}\n\nexport function dialog<TEntries extends ObjectEntries>(entries: TEntries): DialogSchema<TEntries> {\n return {\n type: 'dialog',\n tabs(tabs) {\n return {\n ...this,\n tabs: undefined,\n _parse() {\n const usedEntries = new Set<keyof TEntries>();\n\n const tabsArray = Object.entries(tabs)\n .map(([tabKey, value]) => {\n\n const children = Object.entries(value).map(([key, value]) => {\n if(value === true) {\n if (usedEntries.has(key)) {\n throw new Error(`Entry \"${String(tabKey)}.${String(key)}\" is already used in another tab.`);\n }\n usedEntries.add(key);\n return {\n id: key,\n ...entries[key]._parse()\n }\n }\n })\n\n return {\n type: 'tab',\n label: tabKey,\n id: `tab_${tabKey.toLowerCase().replaceAll(' ', '')}`,\n children,\n }\n })\n\n return {\n type: 'tabs',\n id: 'tabs',\n children: tabsArray\n };\n }\n }\n },\n _parse() {\n return Object.entries(entries)\n .map(([key, entry]) => ({\n id: key,\n name: key,\n ...entry._parse()\n }))\n .filter((entry: object) => {\n if('type' in entry){\n return entry.type !== 'hidden'\n }\n })\n },\n _primitive() {\n return Object.entries(entries)\n .reduce(\n (acc: Record<string, WebcomponentPropTypes>, [key, entry]) => {\n const type = entry._primitive();\n if(typeof type === 'string') {\n acc[key] = type;\n }\n return acc;\n }, {});\n }\n };\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,SAAS,OAAuC,SAA2C;AAChG,SAAO;AAAA,IACL,MAAM;AAAA,IACN,KAAK,MAAM;AACT,aAAO;AAAA,QACL,GAAG;AAAA,QACH,MAAM;AAAA,QACN,SAAS;AACP,gBAAM,cAAc,oBAAI,IAAoB;AAE5C,gBAAM,YAAY,OAAO,QAAQ,IAAI,EAClC,IAAI,CAAC,CAAC,QAAQ,KAAK,MAAM;AAExB,kBAAM,WAAW,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAKA,MAAK,MAAM;AAC3D,kBAAGA,WAAU,MAAM;AACjB,oBAAI,YAAY,IAAI,GAAG,GAAG;AACxB,wBAAM,IAAI,MAAM,UAAU,OAAO,MAAM,CAAC,IAAI,OAAO,GAAG,CAAC,mCAAmC;AAAA,gBAC5F;AACA,4BAAY,IAAI,GAAG;AACnB,uBAAO;AAAA,kBACL,IAAI;AAAA,kBACJ,GAAG,QAAQ,GAAG,EAAE,OAAO;AAAA,gBACzB;AAAA,cACF;AAAA,YACF,CAAC;AAED,mBAAO;AAAA,cACL,MAAM;AAAA,cACN,OAAO;AAAA,cACP,IAAI,OAAO,OAAO,YAAY,EAAE,WAAW,KAAK,EAAE,CAAC;AAAA,cACnD;AAAA,YACF;AAAA,UACF,CAAC;AAEH,iBAAO;AAAA,YACL,MAAM;AAAA,YACN,IAAI;AAAA,YACJ,UAAU;AAAA,UACZ;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,SAAS;AACP,aAAO,OAAO,QAAQ,OAAO,EAC1B,IAAI,CAAC,CAAC,KAAK,KAAK,OAAO;AAAA,QACtB,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,GAAG,MAAM,OAAO;AAAA,MAClB,EAAE,EACD,OAAO,CAAC,UAAkB;AACzB,YAAG,UAAU,OAAM;AACjB,iBAAO,MAAM,SAAS;AAAA,QACxB;AAAA,MACF,CAAC;AAAA,IACL;AAAA,IACA,aAAa;AACX,aAAO,OAAO,QAAQ,OAAO,EAC1B;AAAA,QACC,CAAC,KAA4C,CAAC,KAAK,KAAK,MAAM;AAC5D,gBAAM,OAAO,MAAM,WAAW;AAC9B,cAAG,OAAO,SAAS,UAAU;AAC3B,gBAAI,GAAG,IAAI;AAAA,UACb;AACA,iBAAO;AAAA,QACT;AAAA,QAAG,CAAC;AAAA,MAAC;AAAA,IACX;AAAA,EACF;AACF;","names":["value"]}
@@ -0,0 +1,67 @@
1
+ // src/schema/dialog/dialog.ts
2
+ function dialog(entries) {
3
+ return {
4
+ type: "dialog",
5
+ tabs(tabs) {
6
+ return {
7
+ ...this,
8
+ tabs: void 0,
9
+ _parse() {
10
+ const usedEntries = /* @__PURE__ */ new Set();
11
+ const tabsArray = Object.entries(tabs).map(([tabKey, value]) => {
12
+ const children = Object.entries(value).map(([key, value2]) => {
13
+ if (value2 === true) {
14
+ if (usedEntries.has(key)) {
15
+ throw new Error(`Entry "${String(tabKey)}.${String(key)}" is already used in another tab.`);
16
+ }
17
+ usedEntries.add(key);
18
+ return {
19
+ id: key,
20
+ ...entries[key]._parse()
21
+ };
22
+ }
23
+ });
24
+ return {
25
+ type: "tab",
26
+ label: tabKey,
27
+ id: `tab_${tabKey.toLowerCase().replaceAll(" ", "")}`,
28
+ children
29
+ };
30
+ });
31
+ return {
32
+ type: "tabs",
33
+ id: "tabs",
34
+ children: tabsArray
35
+ };
36
+ }
37
+ };
38
+ },
39
+ _parse() {
40
+ return Object.entries(entries).map(([key, entry]) => ({
41
+ id: key,
42
+ name: key,
43
+ ...entry._parse()
44
+ })).filter((entry) => {
45
+ if ("type" in entry) {
46
+ return entry.type !== "hidden";
47
+ }
48
+ });
49
+ },
50
+ _primitive() {
51
+ return Object.entries(entries).reduce(
52
+ (acc, [key, entry]) => {
53
+ const type = entry._primitive();
54
+ if (typeof type === "string") {
55
+ acc[key] = type;
56
+ }
57
+ return acc;
58
+ },
59
+ {}
60
+ );
61
+ }
62
+ };
63
+ }
64
+ export {
65
+ dialog
66
+ };
67
+ //# sourceMappingURL=dialog.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/schema/dialog/dialog.ts"],"sourcesContent":["import { BaseSchema, EntryMask } from '../../types';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\n\nexport interface DialogSchema<TEntries extends ObjectEntries, TOutput = ObjectOutput<TEntries>> extends BaseSchema<TOutput> {\n type: 'dialog';\n tabs: (tabs: Record<string, EntryMask<TEntries>>) => Omit<DialogSchema<TEntries>, 'tabs'>\n}\n\nexport function dialog<TEntries extends ObjectEntries>(entries: TEntries): DialogSchema<TEntries> {\n return {\n type: 'dialog',\n tabs(tabs) {\n return {\n ...this,\n tabs: undefined,\n _parse() {\n const usedEntries = new Set<keyof TEntries>();\n\n const tabsArray = Object.entries(tabs)\n .map(([tabKey, value]) => {\n\n const children = Object.entries(value).map(([key, value]) => {\n if(value === true) {\n if (usedEntries.has(key)) {\n throw new Error(`Entry \"${String(tabKey)}.${String(key)}\" is already used in another tab.`);\n }\n usedEntries.add(key);\n return {\n id: key,\n ...entries[key]._parse()\n }\n }\n })\n\n return {\n type: 'tab',\n label: tabKey,\n id: `tab_${tabKey.toLowerCase().replaceAll(' ', '')}`,\n children,\n }\n })\n\n return {\n type: 'tabs',\n id: 'tabs',\n children: tabsArray\n };\n }\n }\n },\n _parse() {\n return Object.entries(entries)\n .map(([key, entry]) => ({\n id: key,\n name: key,\n ...entry._parse()\n }))\n .filter((entry: object) => {\n if('type' in entry){\n return entry.type !== 'hidden'\n }\n })\n },\n _primitive() {\n return Object.entries(entries)\n .reduce(\n (acc: Record<string, WebcomponentPropTypes>, [key, entry]) => {\n const type = entry._primitive();\n if(typeof type === 'string') {\n acc[key] = type;\n }\n return acc;\n }, {});\n }\n };\n}"],"mappings":";AASO,SAAS,OAAuC,SAA2C;AAChG,SAAO;AAAA,IACL,MAAM;AAAA,IACN,KAAK,MAAM;AACT,aAAO;AAAA,QACL,GAAG;AAAA,QACH,MAAM;AAAA,QACN,SAAS;AACP,gBAAM,cAAc,oBAAI,IAAoB;AAE5C,gBAAM,YAAY,OAAO,QAAQ,IAAI,EAClC,IAAI,CAAC,CAAC,QAAQ,KAAK,MAAM;AAExB,kBAAM,WAAW,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAKA,MAAK,MAAM;AAC3D,kBAAGA,WAAU,MAAM;AACjB,oBAAI,YAAY,IAAI,GAAG,GAAG;AACxB,wBAAM,IAAI,MAAM,UAAU,OAAO,MAAM,CAAC,IAAI,OAAO,GAAG,CAAC,mCAAmC;AAAA,gBAC5F;AACA,4BAAY,IAAI,GAAG;AACnB,uBAAO;AAAA,kBACL,IAAI;AAAA,kBACJ,GAAG,QAAQ,GAAG,EAAE,OAAO;AAAA,gBACzB;AAAA,cACF;AAAA,YACF,CAAC;AAED,mBAAO;AAAA,cACL,MAAM;AAAA,cACN,OAAO;AAAA,cACP,IAAI,OAAO,OAAO,YAAY,EAAE,WAAW,KAAK,EAAE,CAAC;AAAA,cACnD;AAAA,YACF;AAAA,UACF,CAAC;AAEH,iBAAO;AAAA,YACL,MAAM;AAAA,YACN,IAAI;AAAA,YACJ,UAAU;AAAA,UACZ;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,SAAS;AACP,aAAO,OAAO,QAAQ,OAAO,EAC1B,IAAI,CAAC,CAAC,KAAK,KAAK,OAAO;AAAA,QACtB,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,GAAG,MAAM,OAAO;AAAA,MAClB,EAAE,EACD,OAAO,CAAC,UAAkB;AACzB,YAAG,UAAU,OAAM;AACjB,iBAAO,MAAM,SAAS;AAAA,QACxB;AAAA,MACF,CAAC;AAAA,IACL;AAAA,IACA,aAAa;AACX,aAAO,OAAO,QAAQ,OAAO,EAC1B;AAAA,QACC,CAAC,KAA4C,CAAC,KAAK,KAAK,MAAM;AAC5D,gBAAM,OAAO,MAAM,WAAW;AAC9B,cAAG,OAAO,SAAS,UAAU;AAC3B,gBAAI,GAAG,IAAI;AAAA,UACb;AACA,iBAAO;AAAA,QACT;AAAA,QAAG,CAAC;AAAA,MAAC;AAAA,IACX;AAAA,EACF;AACF;","names":["value"]}
@@ -0,0 +1,6 @@
1
+ export { DialogSchema, dialog } from './dialog.mjs';
2
+ import '../../types/utils.mjs';
3
+ import '../../types/schema.mjs';
4
+ import '../../types/webcomponent.mjs';
5
+ import '../../types/object.mjs';
6
+ import '../optional/optional.mjs';
@@ -0,0 +1,6 @@
1
+ export { DialogSchema, dialog } from './dialog.js';
2
+ import '../../types/utils.js';
3
+ import '../../types/schema.js';
4
+ import '../../types/webcomponent.js';
5
+ import '../../types/object.js';
6
+ import '../optional/optional.js';
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/schema/dialog/index.ts
21
+ var dialog_exports = {};
22
+ __export(dialog_exports, {
23
+ dialog: () => dialog
24
+ });
25
+ module.exports = __toCommonJS(dialog_exports);
26
+
27
+ // src/schema/dialog/dialog.ts
28
+ function dialog(entries) {
29
+ return {
30
+ type: "dialog",
31
+ tabs(tabs) {
32
+ return {
33
+ ...this,
34
+ tabs: void 0,
35
+ _parse() {
36
+ const usedEntries = /* @__PURE__ */ new Set();
37
+ const tabsArray = Object.entries(tabs).map(([tabKey, value]) => {
38
+ const children = Object.entries(value).map(([key, value2]) => {
39
+ if (value2 === true) {
40
+ if (usedEntries.has(key)) {
41
+ throw new Error(`Entry "${String(tabKey)}.${String(key)}" is already used in another tab.`);
42
+ }
43
+ usedEntries.add(key);
44
+ return {
45
+ id: key,
46
+ ...entries[key]._parse()
47
+ };
48
+ }
49
+ });
50
+ return {
51
+ type: "tab",
52
+ label: tabKey,
53
+ id: `tab_${tabKey.toLowerCase().replaceAll(" ", "")}`,
54
+ children
55
+ };
56
+ });
57
+ return {
58
+ type: "tabs",
59
+ id: "tabs",
60
+ children: tabsArray
61
+ };
62
+ }
63
+ };
64
+ },
65
+ _parse() {
66
+ return Object.entries(entries).map(([key, entry]) => ({
67
+ id: key,
68
+ name: key,
69
+ ...entry._parse()
70
+ })).filter((entry) => {
71
+ if ("type" in entry) {
72
+ return entry.type !== "hidden";
73
+ }
74
+ });
75
+ },
76
+ _primitive() {
77
+ return Object.entries(entries).reduce(
78
+ (acc, [key, entry]) => {
79
+ const type = entry._primitive();
80
+ if (typeof type === "string") {
81
+ acc[key] = type;
82
+ }
83
+ return acc;
84
+ },
85
+ {}
86
+ );
87
+ }
88
+ };
89
+ }
90
+ // Annotate the CommonJS export names for ESM import in node:
91
+ 0 && (module.exports = {
92
+ dialog
93
+ });
94
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/schema/dialog/index.ts","../../../src/schema/dialog/dialog.ts"],"sourcesContent":["export * from './dialog';\n","import { BaseSchema, EntryMask } from '../../types';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\n\nexport interface DialogSchema<TEntries extends ObjectEntries, TOutput = ObjectOutput<TEntries>> extends BaseSchema<TOutput> {\n type: 'dialog';\n tabs: (tabs: Record<string, EntryMask<TEntries>>) => Omit<DialogSchema<TEntries>, 'tabs'>\n}\n\nexport function dialog<TEntries extends ObjectEntries>(entries: TEntries): DialogSchema<TEntries> {\n return {\n type: 'dialog',\n tabs(tabs) {\n return {\n ...this,\n tabs: undefined,\n _parse() {\n const usedEntries = new Set<keyof TEntries>();\n\n const tabsArray = Object.entries(tabs)\n .map(([tabKey, value]) => {\n\n const children = Object.entries(value).map(([key, value]) => {\n if(value === true) {\n if (usedEntries.has(key)) {\n throw new Error(`Entry \"${String(tabKey)}.${String(key)}\" is already used in another tab.`);\n }\n usedEntries.add(key);\n return {\n id: key,\n ...entries[key]._parse()\n }\n }\n })\n\n return {\n type: 'tab',\n label: tabKey,\n id: `tab_${tabKey.toLowerCase().replaceAll(' ', '')}`,\n children,\n }\n })\n\n return {\n type: 'tabs',\n id: 'tabs',\n children: tabsArray\n };\n }\n }\n },\n _parse() {\n return Object.entries(entries)\n .map(([key, entry]) => ({\n id: key,\n name: key,\n ...entry._parse()\n }))\n .filter((entry: object) => {\n if('type' in entry){\n return entry.type !== 'hidden'\n }\n })\n },\n _primitive() {\n return Object.entries(entries)\n .reduce(\n (acc: Record<string, WebcomponentPropTypes>, [key, entry]) => {\n const type = entry._primitive();\n if(typeof type === 'string') {\n acc[key] = type;\n }\n return acc;\n }, {});\n }\n };\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,SAAS,OAAuC,SAA2C;AAChG,SAAO;AAAA,IACL,MAAM;AAAA,IACN,KAAK,MAAM;AACT,aAAO;AAAA,QACL,GAAG;AAAA,QACH,MAAM;AAAA,QACN,SAAS;AACP,gBAAM,cAAc,oBAAI,IAAoB;AAE5C,gBAAM,YAAY,OAAO,QAAQ,IAAI,EAClC,IAAI,CAAC,CAAC,QAAQ,KAAK,MAAM;AAExB,kBAAM,WAAW,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAKA,MAAK,MAAM;AAC3D,kBAAGA,WAAU,MAAM;AACjB,oBAAI,YAAY,IAAI,GAAG,GAAG;AACxB,wBAAM,IAAI,MAAM,UAAU,OAAO,MAAM,CAAC,IAAI,OAAO,GAAG,CAAC,mCAAmC;AAAA,gBAC5F;AACA,4BAAY,IAAI,GAAG;AACnB,uBAAO;AAAA,kBACL,IAAI;AAAA,kBACJ,GAAG,QAAQ,GAAG,EAAE,OAAO;AAAA,gBACzB;AAAA,cACF;AAAA,YACF,CAAC;AAED,mBAAO;AAAA,cACL,MAAM;AAAA,cACN,OAAO;AAAA,cACP,IAAI,OAAO,OAAO,YAAY,EAAE,WAAW,KAAK,EAAE,CAAC;AAAA,cACnD;AAAA,YACF;AAAA,UACF,CAAC;AAEH,iBAAO;AAAA,YACL,MAAM;AAAA,YACN,IAAI;AAAA,YACJ,UAAU;AAAA,UACZ;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,SAAS;AACP,aAAO,OAAO,QAAQ,OAAO,EAC1B,IAAI,CAAC,CAAC,KAAK,KAAK,OAAO;AAAA,QACtB,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,GAAG,MAAM,OAAO;AAAA,MAClB,EAAE,EACD,OAAO,CAAC,UAAkB;AACzB,YAAG,UAAU,OAAM;AACjB,iBAAO,MAAM,SAAS;AAAA,QACxB;AAAA,MACF,CAAC;AAAA,IACL;AAAA,IACA,aAAa;AACX,aAAO,OAAO,QAAQ,OAAO,EAC1B;AAAA,QACC,CAAC,KAA4C,CAAC,KAAK,KAAK,MAAM;AAC5D,gBAAM,OAAO,MAAM,WAAW;AAC9B,cAAG,OAAO,SAAS,UAAU;AAC3B,gBAAI,GAAG,IAAI;AAAA,UACb;AACA,iBAAO;AAAA,QACT;AAAA,QAAG,CAAC;AAAA,MAAC;AAAA,IACX;AAAA,EACF;AACF;","names":["value"]}
@@ -0,0 +1,67 @@
1
+ // src/schema/dialog/dialog.ts
2
+ function dialog(entries) {
3
+ return {
4
+ type: "dialog",
5
+ tabs(tabs) {
6
+ return {
7
+ ...this,
8
+ tabs: void 0,
9
+ _parse() {
10
+ const usedEntries = /* @__PURE__ */ new Set();
11
+ const tabsArray = Object.entries(tabs).map(([tabKey, value]) => {
12
+ const children = Object.entries(value).map(([key, value2]) => {
13
+ if (value2 === true) {
14
+ if (usedEntries.has(key)) {
15
+ throw new Error(`Entry "${String(tabKey)}.${String(key)}" is already used in another tab.`);
16
+ }
17
+ usedEntries.add(key);
18
+ return {
19
+ id: key,
20
+ ...entries[key]._parse()
21
+ };
22
+ }
23
+ });
24
+ return {
25
+ type: "tab",
26
+ label: tabKey,
27
+ id: `tab_${tabKey.toLowerCase().replaceAll(" ", "")}`,
28
+ children
29
+ };
30
+ });
31
+ return {
32
+ type: "tabs",
33
+ id: "tabs",
34
+ children: tabsArray
35
+ };
36
+ }
37
+ };
38
+ },
39
+ _parse() {
40
+ return Object.entries(entries).map(([key, entry]) => ({
41
+ id: key,
42
+ name: key,
43
+ ...entry._parse()
44
+ })).filter((entry) => {
45
+ if ("type" in entry) {
46
+ return entry.type !== "hidden";
47
+ }
48
+ });
49
+ },
50
+ _primitive() {
51
+ return Object.entries(entries).reduce(
52
+ (acc, [key, entry]) => {
53
+ const type = entry._primitive();
54
+ if (typeof type === "string") {
55
+ acc[key] = type;
56
+ }
57
+ return acc;
58
+ },
59
+ {}
60
+ );
61
+ }
62
+ };
63
+ }
64
+ export {
65
+ dialog
66
+ };
67
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/schema/dialog/dialog.ts"],"sourcesContent":["import { BaseSchema, EntryMask } from '../../types';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\n\nexport interface DialogSchema<TEntries extends ObjectEntries, TOutput = ObjectOutput<TEntries>> extends BaseSchema<TOutput> {\n type: 'dialog';\n tabs: (tabs: Record<string, EntryMask<TEntries>>) => Omit<DialogSchema<TEntries>, 'tabs'>\n}\n\nexport function dialog<TEntries extends ObjectEntries>(entries: TEntries): DialogSchema<TEntries> {\n return {\n type: 'dialog',\n tabs(tabs) {\n return {\n ...this,\n tabs: undefined,\n _parse() {\n const usedEntries = new Set<keyof TEntries>();\n\n const tabsArray = Object.entries(tabs)\n .map(([tabKey, value]) => {\n\n const children = Object.entries(value).map(([key, value]) => {\n if(value === true) {\n if (usedEntries.has(key)) {\n throw new Error(`Entry \"${String(tabKey)}.${String(key)}\" is already used in another tab.`);\n }\n usedEntries.add(key);\n return {\n id: key,\n ...entries[key]._parse()\n }\n }\n })\n\n return {\n type: 'tab',\n label: tabKey,\n id: `tab_${tabKey.toLowerCase().replaceAll(' ', '')}`,\n children,\n }\n })\n\n return {\n type: 'tabs',\n id: 'tabs',\n children: tabsArray\n };\n }\n }\n },\n _parse() {\n return Object.entries(entries)\n .map(([key, entry]) => ({\n id: key,\n name: key,\n ...entry._parse()\n }))\n .filter((entry: object) => {\n if('type' in entry){\n return entry.type !== 'hidden'\n }\n })\n },\n _primitive() {\n return Object.entries(entries)\n .reduce(\n (acc: Record<string, WebcomponentPropTypes>, [key, entry]) => {\n const type = entry._primitive();\n if(typeof type === 'string') {\n acc[key] = type;\n }\n return acc;\n }, {});\n }\n };\n}"],"mappings":";AASO,SAAS,OAAuC,SAA2C;AAChG,SAAO;AAAA,IACL,MAAM;AAAA,IACN,KAAK,MAAM;AACT,aAAO;AAAA,QACL,GAAG;AAAA,QACH,MAAM;AAAA,QACN,SAAS;AACP,gBAAM,cAAc,oBAAI,IAAoB;AAE5C,gBAAM,YAAY,OAAO,QAAQ,IAAI,EAClC,IAAI,CAAC,CAAC,QAAQ,KAAK,MAAM;AAExB,kBAAM,WAAW,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAKA,MAAK,MAAM;AAC3D,kBAAGA,WAAU,MAAM;AACjB,oBAAI,YAAY,IAAI,GAAG,GAAG;AACxB,wBAAM,IAAI,MAAM,UAAU,OAAO,MAAM,CAAC,IAAI,OAAO,GAAG,CAAC,mCAAmC;AAAA,gBAC5F;AACA,4BAAY,IAAI,GAAG;AACnB,uBAAO;AAAA,kBACL,IAAI;AAAA,kBACJ,GAAG,QAAQ,GAAG,EAAE,OAAO;AAAA,gBACzB;AAAA,cACF;AAAA,YACF,CAAC;AAED,mBAAO;AAAA,cACL,MAAM;AAAA,cACN,OAAO;AAAA,cACP,IAAI,OAAO,OAAO,YAAY,EAAE,WAAW,KAAK,EAAE,CAAC;AAAA,cACnD;AAAA,YACF;AAAA,UACF,CAAC;AAEH,iBAAO;AAAA,YACL,MAAM;AAAA,YACN,IAAI;AAAA,YACJ,UAAU;AAAA,UACZ;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,SAAS;AACP,aAAO,OAAO,QAAQ,OAAO,EAC1B,IAAI,CAAC,CAAC,KAAK,KAAK,OAAO;AAAA,QACtB,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,GAAG,MAAM,OAAO;AAAA,MAClB,EAAE,EACD,OAAO,CAAC,UAAkB;AACzB,YAAG,UAAU,OAAM;AACjB,iBAAO,MAAM,SAAS;AAAA,QACxB;AAAA,MACF,CAAC;AAAA,IACL;AAAA,IACA,aAAa;AACX,aAAO,OAAO,QAAQ,OAAO,EAC1B;AAAA,QACC,CAAC,KAA4C,CAAC,KAAK,KAAK,MAAM;AAC5D,gBAAM,OAAO,MAAM,WAAW;AAC9B,cAAG,OAAO,SAAS,UAAU;AAC3B,gBAAI,GAAG,IAAI;AAAA,UACb;AACA,iBAAO;AAAA,QACT;AAAA,QAAG,CAAC;AAAA,MAAC;AAAA,IACX;AAAA,EACF;AACF;","names":["value"]}
@@ -0,0 +1,22 @@
1
+ import { BaseSchema } from '../../types/schema.mjs';
2
+ import { WebcomponentPropTypes } from '../../types/webcomponent.mjs';
3
+
4
+ interface HiddenSchema extends BaseSchema<string> {
5
+ /**
6
+ * The schema type.
7
+ */
8
+ type: 'hidden';
9
+ }
10
+ interface HiddenInput {
11
+ type: WebcomponentPropTypes;
12
+ }
13
+ /**
14
+ * Creates a hidden schema.
15
+ *
16
+ * @param input The type of input for the webcomponent binding.
17
+ *
18
+ * @returns A hidden schema.
19
+ */
20
+ declare function hidden(input: HiddenInput): HiddenSchema;
21
+
22
+ export { type HiddenSchema, hidden };
@@ -0,0 +1,22 @@
1
+ import { BaseSchema } from '../../types/schema.js';
2
+ import { WebcomponentPropTypes } from '../../types/webcomponent.js';
3
+
4
+ interface HiddenSchema extends BaseSchema<string> {
5
+ /**
6
+ * The schema type.
7
+ */
8
+ type: 'hidden';
9
+ }
10
+ interface HiddenInput {
11
+ type: WebcomponentPropTypes;
12
+ }
13
+ /**
14
+ * Creates a hidden schema.
15
+ *
16
+ * @param input The type of input for the webcomponent binding.
17
+ *
18
+ * @returns A hidden schema.
19
+ */
20
+ declare function hidden(input: HiddenInput): HiddenSchema;
21
+
22
+ export { type HiddenSchema, hidden };