@blueking/bkui-form 1.0.1-beta.1 → 1.0.1-beta.3

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 (168) hide show
  1. package/esm/adapter/common/FieldGroupWrap.tsx.js +199 -0
  2. package/esm/adapter/field/ArrayField.tsx.js +55 -0
  3. package/esm/adapter/field/BooleanField.tsx.js +41 -0
  4. package/esm/adapter/field/CompositionField.tsx.js +113 -0
  5. package/esm/adapter/field/FieldProps.ts.js +85 -0
  6. package/esm/adapter/field/NumberField.tsx.js +19 -0
  7. package/esm/adapter/field/ObjectField.tsx.js +58 -0
  8. package/esm/adapter/field/SchemaField.tsx.js +28 -0
  9. package/esm/adapter/field/StringField.tsx.js +4 -0
  10. package/esm/adapter/widget/ArrayWidget.ts.js +196 -0
  11. package/esm/adapter/widget/ButtonWidget.ts.js +76 -0
  12. package/esm/adapter/widget/CheckboxWidget.ts.js +101 -0
  13. package/esm/adapter/widget/CollapseGroupWidget.ts.js +140 -0
  14. package/esm/adapter/widget/ColorPickerWidget.ts.js +71 -0
  15. package/esm/adapter/widget/InputWidget.ts.js +79 -0
  16. package/esm/adapter/widget/KeyValueArrayWidget.tsx.js +156 -0
  17. package/esm/adapter/widget/RadioWidget.ts.js +98 -0
  18. package/esm/adapter/widget/SelectWidget.ts.js +98 -0
  19. package/esm/adapter/widget/SwitchWidget.ts.js +73 -0
  20. package/esm/adapter/widget/TabGroupWidget.ts.js +145 -0
  21. package/esm/adapter/widget/TableWidget.ts.js +205 -0
  22. package/esm/adapter/widget/Widget.ts.js +497 -0
  23. package/esm/assets/fonts/iconcool.eot +0 -0
  24. package/esm/assets/fonts/iconcool.ttf +0 -0
  25. package/esm/assets/fonts/iconcool.woff +0 -0
  26. package/esm/assets/style.css +43 -0
  27. package/esm/controller/form.css +164 -0
  28. package/esm/controller/form.tsx.js +159 -0
  29. package/esm/controller/props.ts.js +75 -0
  30. package/esm/core/events.ts.js +74 -0
  31. package/esm/core/expression.ts.js +67 -0
  32. package/esm/core/lang.ts.js +25 -0
  33. package/esm/core/layout.ts.js +149 -0
  34. package/esm/core/path.ts.js +60 -0
  35. package/esm/core/proxy.ts.js +10 -0
  36. package/esm/core/reaction.ts.js +116 -0
  37. package/esm/core/register.ts.js +74 -0
  38. package/esm/core/schema.ts.js +302 -0
  39. package/esm/core/validator.ts.js +248 -0
  40. package/esm/core/widgetTree.ts.js +163 -0
  41. package/esm/index.ts.js +6 -0
  42. package/esm/node_modules/@blueking/cli-service/dist/lib/path.js +35 -0
  43. package/esm/node_modules/@blueking/cli-service/dist/lib/util.js +233 -0
  44. package/esm/node_modules/@blueking/cli-service/dist/tools/rust/helper/path.js +172 -0
  45. package/esm/node_modules/ajv/dist/ajv.js +50 -0
  46. package/esm/node_modules/ajv/dist/compile/codegen/code.js +156 -0
  47. package/esm/node_modules/ajv/dist/compile/codegen/index.js +697 -0
  48. package/esm/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
  49. package/esm/node_modules/ajv/dist/compile/errors.js +123 -0
  50. package/esm/node_modules/ajv/dist/compile/index.js +242 -0
  51. package/esm/node_modules/ajv/dist/compile/names.js +28 -0
  52. package/esm/node_modules/ajv/dist/compile/ref_error.js +12 -0
  53. package/esm/node_modules/ajv/dist/compile/resolve.js +155 -0
  54. package/esm/node_modules/ajv/dist/compile/rules.js +26 -0
  55. package/esm/node_modules/ajv/dist/compile/util.js +178 -0
  56. package/esm/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
  57. package/esm/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
  58. package/esm/node_modules/ajv/dist/compile/validate/dataType.js +203 -0
  59. package/esm/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
  60. package/esm/node_modules/ajv/dist/compile/validate/index.js +520 -0
  61. package/esm/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
  62. package/esm/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
  63. package/esm/node_modules/ajv/dist/core.js +618 -0
  64. package/esm/node_modules/ajv/dist/refs/data.json +13 -0
  65. package/esm/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
  66. package/esm/node_modules/ajv/dist/runtime/equal.js +7 -0
  67. package/esm/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
  68. package/esm/node_modules/ajv/dist/runtime/uri.js +6 -0
  69. package/esm/node_modules/ajv/dist/runtime/validation_error.js +11 -0
  70. package/esm/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
  71. package/esm/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
  72. package/esm/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
  73. package/esm/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
  74. package/esm/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
  75. package/esm/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
  76. package/esm/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
  77. package/esm/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
  78. package/esm/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
  79. package/esm/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
  80. package/esm/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
  81. package/esm/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
  82. package/esm/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
  83. package/esm/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
  84. package/esm/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
  85. package/esm/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
  86. package/esm/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
  87. package/esm/node_modules/ajv/dist/vocabularies/code.js +131 -0
  88. package/esm/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
  89. package/esm/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
  90. package/esm/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
  91. package/esm/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -0
  92. package/esm/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
  93. package/esm/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
  94. package/esm/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
  95. package/esm/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
  96. package/esm/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
  97. package/esm/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
  98. package/esm/node_modules/ajv/dist/vocabularies/validation/enum.js +48 -0
  99. package/esm/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
  100. package/esm/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
  101. package/esm/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
  102. package/esm/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
  103. package/esm/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
  104. package/esm/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
  105. package/esm/node_modules/ajv/dist/vocabularies/validation/pattern.js +24 -0
  106. package/esm/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
  107. package/esm/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
  108. package/esm/node_modules/ajv-formats/dist/formats.js +173 -0
  109. package/esm/node_modules/ajv-formats/dist/index.js +37 -0
  110. package/esm/node_modules/ajv-formats/dist/limit.js +69 -0
  111. package/esm/node_modules/ajv-i18n/localize/zh/index.js +154 -0
  112. package/esm/node_modules/fast-deep-equal/index.js +46 -0
  113. package/esm/node_modules/fast-uri/index.js +303 -0
  114. package/esm/node_modules/fast-uri/lib/schemes.js +188 -0
  115. package/esm/node_modules/fast-uri/lib/scopedChars.js +30 -0
  116. package/esm/node_modules/fast-uri/lib/utils.js +244 -0
  117. package/esm/node_modules/json-schema-traverse/index.js +89 -0
  118. package/esm/node_modules/semver/classes/comparator.js +143 -0
  119. package/esm/node_modules/semver/classes/range.js +557 -0
  120. package/esm/node_modules/semver/classes/semver.js +333 -0
  121. package/esm/node_modules/semver/functions/clean.js +8 -0
  122. package/esm/node_modules/semver/functions/cmp.js +54 -0
  123. package/esm/node_modules/semver/functions/coerce.js +62 -0
  124. package/esm/node_modules/semver/functions/compare-build.js +9 -0
  125. package/esm/node_modules/semver/functions/compare-loose.js +5 -0
  126. package/esm/node_modules/semver/functions/compare.js +7 -0
  127. package/esm/node_modules/semver/functions/diff.js +60 -0
  128. package/esm/node_modules/semver/functions/eq.js +5 -0
  129. package/esm/node_modules/semver/functions/gt.js +5 -0
  130. package/esm/node_modules/semver/functions/gte.js +5 -0
  131. package/esm/node_modules/semver/functions/inc.js +21 -0
  132. package/esm/node_modules/semver/functions/lt.js +5 -0
  133. package/esm/node_modules/semver/functions/lte.js +5 -0
  134. package/esm/node_modules/semver/functions/major.js +5 -0
  135. package/esm/node_modules/semver/functions/minor.js +5 -0
  136. package/esm/node_modules/semver/functions/neq.js +5 -0
  137. package/esm/node_modules/semver/functions/parse.js +18 -0
  138. package/esm/node_modules/semver/functions/patch.js +5 -0
  139. package/esm/node_modules/semver/functions/prerelease.js +8 -0
  140. package/esm/node_modules/semver/functions/rcompare.js +5 -0
  141. package/esm/node_modules/semver/functions/rsort.js +5 -0
  142. package/esm/node_modules/semver/functions/satisfies.js +12 -0
  143. package/esm/node_modules/semver/functions/sort.js +5 -0
  144. package/esm/node_modules/semver/functions/valid.js +8 -0
  145. package/esm/node_modules/semver/index.js +91 -0
  146. package/esm/node_modules/semver/internal/constants.js +37 -0
  147. package/esm/node_modules/semver/internal/debug.js +11 -0
  148. package/esm/node_modules/semver/internal/identifiers.js +29 -0
  149. package/esm/node_modules/semver/internal/lrucache.js +42 -0
  150. package/esm/node_modules/semver/internal/parse-options.js +17 -0
  151. package/esm/node_modules/semver/internal/re.js +223 -0
  152. package/esm/node_modules/semver/ranges/gtr.js +6 -0
  153. package/esm/node_modules/semver/ranges/intersects.js +9 -0
  154. package/esm/node_modules/semver/ranges/ltr.js +6 -0
  155. package/esm/node_modules/semver/ranges/max-satisfying.js +27 -0
  156. package/esm/node_modules/semver/ranges/min-satisfying.js +26 -0
  157. package/esm/node_modules/semver/ranges/min-version.js +63 -0
  158. package/esm/node_modules/semver/ranges/outside.js +82 -0
  159. package/esm/node_modules/semver/ranges/simplify.js +49 -0
  160. package/esm/node_modules/semver/ranges/subset.js +249 -0
  161. package/esm/node_modules/semver/ranges/to-comparators.js +10 -0
  162. package/esm/node_modules/semver/ranges/valid.js +13 -0
  163. package/esm/util/fetch.ts.js +190 -0
  164. package/esm/util/index.ts.js +276 -0
  165. package/package.json +3 -4
  166. package/dist/main.css +0 -208
  167. package/dist/main.js +0 -17353
  168. /package/{dist/svg/iconcool.eb237688.svg → esm/assets/fonts/iconcool.svg} +0 -0
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0;
4
+ const codegen_1 = require('../codegen/index.js');
5
+ const util_1 = require('../util.js');
6
+ function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {
7
+ if (keyword !== undefined && schema !== undefined) {
8
+ throw new Error('both "keyword" and "schema" passed, only one allowed');
9
+ }
10
+ if (keyword !== undefined) {
11
+ const sch = it.schema[keyword];
12
+ return schemaProp === undefined
13
+ ? {
14
+ schema: sch,
15
+ schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`,
16
+ errSchemaPath: `${it.errSchemaPath}/${keyword}`,
17
+ }
18
+ : {
19
+ schema: sch[schemaProp],
20
+ schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`,
21
+ errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`,
22
+ };
23
+ }
24
+ if (schema !== undefined) {
25
+ if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) {
26
+ throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
27
+ }
28
+ return {
29
+ schema,
30
+ schemaPath,
31
+ topSchemaRef,
32
+ errSchemaPath,
33
+ };
34
+ }
35
+ throw new Error('either "keyword" or "schema" must be passed');
36
+ }
37
+ exports.getSubschema = getSubschema;
38
+ function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {
39
+ if (data !== undefined && dataProp !== undefined) {
40
+ throw new Error('both "data" and "dataProp" passed, only one allowed');
41
+ }
42
+ const { gen } = it;
43
+ if (dataProp !== undefined) {
44
+ const { errorPath, dataPathArr, opts } = it;
45
+ const nextData = gen.let("data", (0, codegen_1._) `${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true);
46
+ dataContextProps(nextData);
47
+ subschema.errorPath = (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;
48
+ subschema.parentDataProperty = (0, codegen_1._) `${dataProp}`;
49
+ subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];
50
+ }
51
+ if (data !== undefined) {
52
+ const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); // replaceable if used once?
53
+ dataContextProps(nextData);
54
+ if (propertyName !== undefined)
55
+ subschema.propertyName = propertyName;
56
+ // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr
57
+ }
58
+ if (dataTypes)
59
+ subschema.dataTypes = dataTypes;
60
+ function dataContextProps(_nextData) {
61
+ subschema.data = _nextData;
62
+ subschema.dataLevel = it.dataLevel + 1;
63
+ subschema.dataTypes = [];
64
+ it.definedProperties = new Set();
65
+ subschema.parentData = it.data;
66
+ subschema.dataNames = [...it.dataNames, _nextData];
67
+ }
68
+ }
69
+ exports.extendSubschemaData = extendSubschemaData;
70
+ function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {
71
+ if (compositeRule !== undefined)
72
+ subschema.compositeRule = compositeRule;
73
+ if (createErrors !== undefined)
74
+ subschema.createErrors = createErrors;
75
+ if (allErrors !== undefined)
76
+ subschema.allErrors = allErrors;
77
+ subschema.jtdDiscriminator = jtdDiscriminator; // not inherited
78
+ subschema.jtdMetadata = jtdMetadata; // not inherited
79
+ }
80
+ exports.extendSubschemaMode = extendSubschemaMode;
81
+ //# sourceMappingURL=subschema.js.map