@process.co/ui 0.0.6 → 0.0.8
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/css/ui.css +302 -0
- package/dist/components/fields/index.cjs +135 -1
- package/dist/components/fields/index.cjs.map +1 -1
- package/dist/components/fields/index.d.cts +1 -1
- package/dist/components/fields/index.d.ts +1 -1
- package/dist/components/fields/index.js +130 -2
- package/dist/components/fields/index.js.map +1 -1
- package/dist/{index-C1wa8N9L.d.cts → index-yubVl0hX.d.cts} +125 -2
- package/dist/{index-C1wa8N9L.d.ts → index-yubVl0hX.d.ts} +125 -2
- package/dist/index.cjs +423 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -2
- package/dist/index.d.ts +31 -2
- package/dist/index.js +406 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { I as Input,
|
|
2
|
+
export { n as InferConfig, j as InferredTypesContext, I as InferredTypesContextValue, l as InferredTypesProvider, q as Input, r as InputProps, N as NestedFieldProvider, e as NestedFieldProviderProps, O as OPERATORS_BY_TYPE, S as Select, t as SelectOption, s as SelectProps, v as SelectRenderProps, h as TemplateFieldChangeEvent, T as TemplateFieldContextValue, g as TemplateFieldFocusContext, c as TemplateFieldProvider, d as TemplateFieldProviderProps, f as TemplateFieldValidationError, o as getOperatorsForType, m as intersectTypes, p as parseInferSyntax, b as useFieldPath, k as useInferredTypes, a as useIsInTemplateFieldProvider, u as useTemplateFieldContext } from '../../index-yubVl0hX.cjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { I as Input,
|
|
2
|
+
export { n as InferConfig, j as InferredTypesContext, I as InferredTypesContextValue, l as InferredTypesProvider, q as Input, r as InputProps, N as NestedFieldProvider, e as NestedFieldProviderProps, O as OPERATORS_BY_TYPE, S as Select, t as SelectOption, s as SelectProps, v as SelectRenderProps, h as TemplateFieldChangeEvent, T as TemplateFieldContextValue, g as TemplateFieldFocusContext, c as TemplateFieldProvider, d as TemplateFieldProviderProps, f as TemplateFieldValidationError, o as getOperatorsForType, m as intersectTypes, p as parseInferSyntax, b as useFieldPath, k as useInferredTypes, a as useIsInTemplateFieldProvider, u as useTemplateFieldContext } from '../../index-yubVl0hX.js';
|
|
@@ -89,7 +89,8 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
89
89
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
90
90
|
}
|
|
91
91
|
import * as React3 from 'react';
|
|
92
|
-
|
|
92
|
+
import { createContext, useContext } from 'react';
|
|
93
|
+
// src/components/fields/index.tsx
|
|
93
94
|
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
94
95
|
function r(e) {
|
|
95
96
|
var t, f, n = "";
|
|
@@ -4966,5 +4967,132 @@ function NestedFieldProvider(param) {
|
|
|
4966
4967
|
var children = param.children;
|
|
4967
4968
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
4968
4969
|
}
|
|
4969
|
-
|
|
4970
|
+
var InferredTypesContext = createContext(null);
|
|
4971
|
+
function useInferredTypes() {
|
|
4972
|
+
return useContext(InferredTypesContext);
|
|
4973
|
+
}
|
|
4974
|
+
function InferredTypesProvider(param) {
|
|
4975
|
+
var children = param.children;
|
|
4976
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
4977
|
+
}
|
|
4978
|
+
function intersectTypes(types) {
|
|
4979
|
+
var validTypes = types.filter(function(t) {
|
|
4980
|
+
return !!t && t.length > 0;
|
|
4981
|
+
});
|
|
4982
|
+
if (validTypes.length === 0) return "any";
|
|
4983
|
+
if (validTypes.length === 1) return validTypes[0];
|
|
4984
|
+
return validTypes[0];
|
|
4985
|
+
}
|
|
4986
|
+
function parseInferSyntax(expectedType) {
|
|
4987
|
+
var _match_;
|
|
4988
|
+
if (!expectedType || !expectedType.startsWith("$infer<")) {
|
|
4989
|
+
return {
|
|
4990
|
+
mode: "normal"
|
|
4991
|
+
};
|
|
4992
|
+
}
|
|
4993
|
+
var match = expectedType.match(/^\$infer<(.+)>$/);
|
|
4994
|
+
if (!match) {
|
|
4995
|
+
return {
|
|
4996
|
+
mode: "normal"
|
|
4997
|
+
};
|
|
4998
|
+
}
|
|
4999
|
+
var content = ((_match_ = match[1]) === null || _match_ === void 0 ? void 0 : _match_.trim()) || "";
|
|
5000
|
+
if (!content.includes("|") && /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(content)) {
|
|
5001
|
+
return {
|
|
5002
|
+
mode: "subscribe",
|
|
5003
|
+
subscribeToField: content
|
|
5004
|
+
};
|
|
5005
|
+
}
|
|
5006
|
+
var allowedTypes = content.split("|").map(function(t) {
|
|
5007
|
+
return t.trim();
|
|
5008
|
+
}).filter(Boolean);
|
|
5009
|
+
return {
|
|
5010
|
+
mode: "publish",
|
|
5011
|
+
allowedTypes: allowedTypes
|
|
5012
|
+
};
|
|
5013
|
+
}
|
|
5014
|
+
var OPERATORS_BY_TYPE = {
|
|
5015
|
+
string: [
|
|
5016
|
+
{
|
|
5017
|
+
value: "==",
|
|
5018
|
+
label: "equals (==)"
|
|
5019
|
+
},
|
|
5020
|
+
{
|
|
5021
|
+
value: "!=",
|
|
5022
|
+
label: "not equals (!=)"
|
|
5023
|
+
},
|
|
5024
|
+
{
|
|
5025
|
+
value: "contains",
|
|
5026
|
+
label: "contains"
|
|
5027
|
+
},
|
|
5028
|
+
{
|
|
5029
|
+
value: "startsWith",
|
|
5030
|
+
label: "starts with"
|
|
5031
|
+
},
|
|
5032
|
+
{
|
|
5033
|
+
value: "endsWith",
|
|
5034
|
+
label: "ends with"
|
|
5035
|
+
}
|
|
5036
|
+
],
|
|
5037
|
+
number: [
|
|
5038
|
+
{
|
|
5039
|
+
value: "==",
|
|
5040
|
+
label: "equals (==)"
|
|
5041
|
+
},
|
|
5042
|
+
{
|
|
5043
|
+
value: "!=",
|
|
5044
|
+
label: "not equals (!=)"
|
|
5045
|
+
},
|
|
5046
|
+
{
|
|
5047
|
+
value: "<",
|
|
5048
|
+
label: "less than (<)"
|
|
5049
|
+
},
|
|
5050
|
+
{
|
|
5051
|
+
value: ">",
|
|
5052
|
+
label: "greater than (>)"
|
|
5053
|
+
},
|
|
5054
|
+
{
|
|
5055
|
+
value: "<=",
|
|
5056
|
+
label: "less than or equal (<=)"
|
|
5057
|
+
},
|
|
5058
|
+
{
|
|
5059
|
+
value: ">=",
|
|
5060
|
+
label: "greater than or equal (>=)"
|
|
5061
|
+
}
|
|
5062
|
+
],
|
|
5063
|
+
boolean: [
|
|
5064
|
+
{
|
|
5065
|
+
value: "==",
|
|
5066
|
+
label: "equals (==)"
|
|
5067
|
+
},
|
|
5068
|
+
{
|
|
5069
|
+
value: "!=",
|
|
5070
|
+
label: "not equals (!=)"
|
|
5071
|
+
}
|
|
5072
|
+
],
|
|
5073
|
+
any: [
|
|
5074
|
+
{
|
|
5075
|
+
value: "==",
|
|
5076
|
+
label: "equals (==)"
|
|
5077
|
+
},
|
|
5078
|
+
{
|
|
5079
|
+
value: "!=",
|
|
5080
|
+
label: "not equals (!=)"
|
|
5081
|
+
}
|
|
5082
|
+
]
|
|
5083
|
+
};
|
|
5084
|
+
function getOperatorsForType(type) {
|
|
5085
|
+
var _OPERATORS_BY_TYPE_type, _ref;
|
|
5086
|
+
return (_ref = (_OPERATORS_BY_TYPE_type = OPERATORS_BY_TYPE[type]) !== null && _OPERATORS_BY_TYPE_type !== void 0 ? _OPERATORS_BY_TYPE_type : OPERATORS_BY_TYPE.any) !== null && _ref !== void 0 ? _ref : [
|
|
5087
|
+
{
|
|
5088
|
+
value: "==",
|
|
5089
|
+
label: "equals (==)"
|
|
5090
|
+
},
|
|
5091
|
+
{
|
|
5092
|
+
value: "!=",
|
|
5093
|
+
label: "not equals (!=)"
|
|
5094
|
+
}
|
|
5095
|
+
];
|
|
5096
|
+
}
|
|
5097
|
+
export { InferredTypesContext, InferredTypesProvider, Input, NestedFieldProvider, OPERATORS_BY_TYPE, Select, TemplateFieldProvider, getOperatorsForType, intersectTypes, parseInferSyntax, useFieldPath, useInferredTypes, useIsInTemplateFieldProvider, useTemplateFieldContext }; //# sourceMappingURL=index.js.map
|
|
4970
5098
|
//# sourceMappingURL=index.js.map
|