@ethereal-nexus/core 0.3.4 → 1.0.1
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/LICENSE.md +201 -0
- package/dist/decorators/index.d.mts +1 -1
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/webcomponent/index.d.mts +1 -1
- package/dist/decorators/webcomponent/index.d.ts +1 -1
- package/dist/decorators/webcomponent/webcomponent.d.mts +1 -1
- package/dist/decorators/webcomponent/webcomponent.d.ts +1 -1
- package/dist/functions/component/component.d.mts +1 -1
- package/dist/functions/component/component.d.ts +1 -1
- package/dist/functions/component/index.d.mts +1 -1
- package/dist/functions/component/index.d.ts +1 -1
- package/dist/functions/index.d.mts +1 -1
- package/dist/functions/index.d.ts +1 -1
- package/dist/functions/parse/index.d.mts +1 -1
- package/dist/functions/parse/index.d.ts +1 -1
- package/dist/functions/parse/parse.d.mts +1 -1
- package/dist/functions/parse/parse.d.ts +1 -1
- package/dist/functions/parse/parsePrimitives.d.mts +1 -1
- package/dist/functions/parse/parsePrimitives.d.ts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -1
- package/dist/schema/calendar/calendar.d.mts +1 -1
- package/dist/schema/calendar/calendar.d.ts +1 -1
- package/dist/schema/calendar/index.d.mts +1 -1
- package/dist/schema/calendar/index.d.ts +1 -1
- package/dist/schema/checkbox/checkbox.d.mts +1 -1
- package/dist/schema/checkbox/checkbox.d.ts +1 -1
- package/dist/schema/checkbox/index.d.mts +1 -1
- package/dist/schema/checkbox/index.d.ts +1 -1
- package/dist/schema/datamodel/datamodel.d.mts +1 -1
- package/dist/schema/datamodel/datamodel.d.ts +1 -1
- package/dist/schema/datamodel/index.d.mts +1 -1
- package/dist/schema/datamodel/index.d.ts +1 -1
- package/dist/schema/datasource/datasource.d.mts +1 -1
- package/dist/schema/datasource/datasource.d.ts +1 -1
- package/dist/schema/datasource/index.d.mts +1 -1
- package/dist/schema/datasource/index.d.ts +1 -1
- package/dist/schema/dialog/condition.d.mts +1 -1
- package/dist/schema/dialog/condition.d.ts +1 -1
- package/dist/schema/dialog/condition.js +5 -0
- package/dist/schema/dialog/condition.js.map +1 -1
- package/dist/schema/dialog/condition.mjs +5 -0
- package/dist/schema/dialog/condition.mjs.map +1 -1
- package/dist/schema/dialog/dialog.d.mts +1 -1
- package/dist/schema/dialog/dialog.d.ts +1 -1
- package/dist/schema/dialog/dialog.js +5 -0
- package/dist/schema/dialog/dialog.js.map +1 -1
- package/dist/schema/dialog/dialog.mjs +5 -0
- package/dist/schema/dialog/dialog.mjs.map +1 -1
- package/dist/schema/dialog/index.d.mts +1 -1
- package/dist/schema/dialog/index.d.ts +1 -1
- package/dist/schema/dialog/index.js +5 -0
- package/dist/schema/dialog/index.js.map +1 -1
- package/dist/schema/dialog/index.mjs +5 -0
- package/dist/schema/dialog/index.mjs.map +1 -1
- package/dist/schema/dialog/tabs.d.mts +1 -1
- package/dist/schema/dialog/tabs.d.ts +1 -1
- package/dist/schema/dialog/types.d.mts +1 -1
- package/dist/schema/dialog/types.d.ts +1 -1
- package/dist/schema/dialog/types.js.map +1 -1
- package/dist/schema/dynamic/dynamic.d.mts +1 -1
- package/dist/schema/dynamic/dynamic.d.ts +1 -1
- package/dist/schema/dynamic/index.d.mts +1 -1
- package/dist/schema/dynamic/index.d.ts +1 -1
- package/dist/schema/group/group.d.mts +1 -1
- package/dist/schema/group/group.d.ts +1 -1
- package/dist/schema/group/index.d.mts +1 -1
- package/dist/schema/group/index.d.ts +1 -1
- package/dist/schema/hidden/hidden.d.mts +1 -1
- package/dist/schema/hidden/hidden.d.ts +1 -1
- package/dist/schema/hidden/index.d.mts +1 -1
- package/dist/schema/hidden/index.d.ts +1 -1
- package/dist/schema/image/image.d.mts +1 -1
- package/dist/schema/image/image.d.ts +1 -1
- package/dist/schema/image/index.d.mts +1 -1
- package/dist/schema/image/index.d.ts +1 -1
- package/dist/schema/multifield/index.d.mts +1 -1
- package/dist/schema/multifield/index.d.ts +1 -1
- package/dist/schema/multifield/multifield.d.mts +1 -1
- package/dist/schema/multifield/multifield.d.ts +1 -1
- package/dist/schema/object/index.d.mts +1 -1
- package/dist/schema/object/index.d.ts +1 -1
- package/dist/schema/object/object.d.mts +1 -1
- package/dist/schema/object/object.d.ts +1 -1
- package/dist/schema/optional/index.d.mts +1 -1
- package/dist/schema/optional/index.d.ts +1 -1
- package/dist/schema/optional/optional.d.mts +1 -1
- package/dist/schema/optional/optional.d.ts +1 -1
- package/dist/schema/pathbrowser/index.d.mts +1 -1
- package/dist/schema/pathbrowser/index.d.ts +1 -1
- package/dist/schema/pathbrowser/pathbrowser.d.mts +1 -1
- package/dist/schema/pathbrowser/pathbrowser.d.ts +1 -1
- package/dist/schema/rte/index.d.mts +1 -1
- package/dist/schema/rte/index.d.ts +1 -1
- package/dist/schema/rte/rte.d.mts +1 -1
- package/dist/schema/rte/rte.d.ts +1 -1
- package/dist/schema/select/index.d.mts +1 -1
- package/dist/schema/select/index.d.ts +1 -1
- package/dist/schema/select/select.d.mts +1 -1
- package/dist/schema/select/select.d.ts +1 -1
- package/dist/schema/text/index.d.mts +1 -1
- package/dist/schema/text/index.d.ts +1 -1
- package/dist/schema/text/text.d.mts +1 -1
- package/dist/schema/text/text.d.ts +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/infer.d.mts +1 -1
- package/dist/types/infer.d.ts +1 -1
- package/dist/types/object.d.mts +1 -1
- package/dist/types/object.d.ts +1 -1
- package/dist/types/schema.d.mts +1 -1
- package/dist/types/schema.d.ts +1 -1
- package/dist/{types-rfg_xywc.d.ts → types-Cvbi87LT.d.ts} +4 -1
- package/dist/{types-B8taWezd.d.mts → types-DUGwdG43.d.mts} +4 -1
- package/package.json +7 -7
|
@@ -62,6 +62,11 @@ function addConditionToField(fields, path, condition) {
|
|
|
62
62
|
if (!field.children) {
|
|
63
63
|
throw new Error(`Field with id "${key}" has no children`);
|
|
64
64
|
}
|
|
65
|
+
const nextKey = keys[i + 1];
|
|
66
|
+
if (nextKey === "$this") {
|
|
67
|
+
field.condition = condition;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
65
70
|
currentFields = field.children;
|
|
66
71
|
}
|
|
67
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schema/dialog/tabs.ts","../../../src/schema/dialog/condition.ts","../../../src/utils/pathToArray.ts","../../../src/schema/dialog/dialog.ts"],"sourcesContent":["import { EntryMask } from '../../types';\nimport { Field } from './types';\n\nexport class Tabs<TEntries> {\n private tabs = new Map<string, EntryMask<TEntries>>();\n\n addTab(name: string, entries: EntryMask<TEntries>) {\n this.tabs.set(name, entries);\n }\n\n parse(entries: Field[]) {\n const result = []\n const usedEntries = new Set();\n\n if(this.tabs.size === 0) {\n return entries\n }\n\n for(const [name, mask] of this.tabs) {\n const children = []\n\n if(!mask) {\n throw new Error(`Entry \"${String(name)}\" does not have an appropriate tab configuration.`);\n }\n\n for(const [key,] of Object.entries(mask)) {\n const field = entries.find(f => f.id === key)\n\n if (usedEntries.has(key)) {\n throw new Error(`Entry \"${String(name)}.${String(key)}\" is already used in another tab.`);\n }\n\n if(!field) {\n throw new Error(`Field with id \"${key}\" not found`);\n }\n\n children.push(entries.find(f => f.id === key))\n }\n\n result.push({\n type: 'tab',\n label: name,\n id: `tab_${name.toLowerCase().replaceAll(' ', '')}`,\n children\n })\n }\n\n return [{\n type: 'tabs',\n id: 'tabs',\n children: result\n }]\n }\n}","import { NestedPaths } from '../../types';\nimport { ConditionFn, ConditionOperators, Conditions, Field } from './types';\nimport { ObjectEntries } from '../../types/object';\n\nfunction addConditionToField(fields: Field[], path: string, condition: Conditions): void {\n const keys = path.split('.');\n let currentFields = fields;\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const field = currentFields.find(f => f.id === key);\n\n if (!field) {\n throw new Error(`Field with id \"${key}\" not found`);\n }\n\n if (i === keys.length - 1) {\n field.condition = condition;\n } else {\n if (!field.children) {\n throw new Error(`Field with id \"${key}\" has no children`);\n }\n currentFields = field.children;\n }\n }\n}\n\nexport class Condition<TEntries extends ObjectEntries> {\n private conditions = new Map<string, Conditions>();\n\n addCondition(field: NestedPaths<TEntries>, condition: ConditionFn<TEntries>) {\n const operators: ConditionOperators<TEntries> = {\n eq: (field, value) => ({ operator: 'eq', field, value }),\n neq: (field, value) => ({ operator: 'neq', field, value }),\n exists: (field) => ({ operator: 'exists', field }),\n and: (...operations) => ({ operator: 'and', value: operations }),\n or: (...operations) => ({ operator: 'or', value: operations })\n };\n\n this.conditions.set(field, condition(operators));\n }\n\n parse(entries: Field[]) {\n for (let [key, value] of this.conditions) {\n addConditionToField(entries, key, value)\n }\n\n return entries;\n }\n}\n","interface PathValue {\n path: string[];\n value: any;\n}\n\nexport function pathToArray(obj: Record<string, any>, parentPath: string[] = []): PathValue[] {\n const result: PathValue[] = [];\n\n for (const [key, value] of Object.entries(obj)) {\n const currentPath = [...parentPath, key];\n\n if (typeof value === 'object' && !value.hasOwnProperty('operator') && !Array.isArray(value)) {\n // If the value is an object, recurse into it\n result.push(...pathToArray(value, currentPath));\n } else {\n // If the value is not an object, store the path and value\n result.push({ path: currentPath, value });\n }\n }\n\n return result;\n}","import { BaseSchema, EntryMask, NestedPaths } from '../../types';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\nimport { Tabs } from './tabs';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { Condition } from './condition';\nimport { pathToArray } from '../../utils/pathToArray';\nimport { ConditionsArgument } from './types';\n\nexport interface DialogSchema<TEntries extends ObjectEntries> extends BaseSchema<ObjectOutput<TEntries>> {\n type: 'dialog';\n tabs: (tabs: Record<string, EntryMask<TEntries>>) => DialogSchema<TEntries>;\n conditions: (conditions: ConditionsArgument<TEntries>) => DialogSchema<TEntries>;\n}\n\nclass DialogBuilder<TEntries extends ObjectEntries> implements DialogSchema<TEntries> {\n private conditionsModule: Condition<TEntries>;\n private tabsModule: Tabs<TEntries>;\n private readonly entries: TEntries;\n readonly type = 'dialog';\n\n constructor(entries: TEntries) {\n this.entries = entries;\n this.conditionsModule = new Condition<TEntries>();\n this.tabsModule = new Tabs<TEntries>();\n }\n\n conditions(conditions: ConditionsArgument<TEntries>) {\n const conditionsArray = pathToArray(conditions)\n for (const condition of conditionsArray) {\n this.conditionsModule.addCondition(condition.path.join('.') as NestedPaths<TEntries>, condition.value);\n }\n return this;\n }\n\n tabs(tabs: Record<string, EntryMask<TEntries>>) {\n for (const [key, tab] of Object.entries(tabs)) {\n this.tabsModule.addTab(key as any, tab!);\n }\n return this;\n }\n\n _parse() {\n const dialog = Object.entries(this.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 const dialogWithConditions = this.conditionsModule.parse(dialog);\n const dialogWithTabs = this.tabsModule.parse(dialogWithConditions);\n return {\n dialog: dialogWithTabs\n };\n }\n\n _primitive() {\n const result: Record<string, WebcomponentPropTypes> = {};\n\n for (const [key, entry] of Object.entries(this.entries)) {\n const type = entry._primitive();\n if (typeof type === 'string') {\n result[key] = type;\n }\n }\n\n return result;\n }\n}\n\nexport function dialog<TEntries extends ObjectEntries>(entries: TEntries) {\n return new DialogBuilder(entries)\n}"],"mappings":";;;;;AAGO,IAAM,OAAN,MAAqB;AAAA,EAArB;AACL,wBAAQ,QAAO,oBAAI,IAAiC;AAAA;AAAA,EAEpD,OAAO,MAAc,SAA8B;AACjD,SAAK,KAAK,IAAI,MAAM,OAAO;AAAA,EAC7B;AAAA,EAEA,MAAM,SAAkB;AACtB,UAAM,SAAS,CAAC;AAChB,UAAM,cAAc,oBAAI,IAAI;AAE5B,QAAG,KAAK,KAAK,SAAS,GAAG;AACvB,aAAO;AAAA,IACT;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AAAA,EACT;AACF;AAEO,SAAS,OAAuC,SAAmB;AACxE,SAAO,IAAI,cAAc,OAAO;AAClC;","names":["field","dialog"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/schema/dialog/tabs.ts","../../../src/schema/dialog/condition.ts","../../../src/utils/pathToArray.ts","../../../src/schema/dialog/dialog.ts"],"sourcesContent":["import { EntryMask } from '../../types';\nimport { Field } from './types';\n\nexport class Tabs<TEntries> {\n private tabs = new Map<string, EntryMask<TEntries>>();\n\n addTab(name: string, entries: EntryMask<TEntries>) {\n this.tabs.set(name, entries);\n }\n\n parse(entries: Field[]) {\n const result = []\n const usedEntries = new Set();\n\n if(this.tabs.size === 0) {\n return entries\n }\n\n for(const [name, mask] of this.tabs) {\n const children = []\n\n if(!mask) {\n throw new Error(`Entry \"${String(name)}\" does not have an appropriate tab configuration.`);\n }\n\n for(const [key,] of Object.entries(mask)) {\n const field = entries.find(f => f.id === key)\n\n if (usedEntries.has(key)) {\n throw new Error(`Entry \"${String(name)}.${String(key)}\" is already used in another tab.`);\n }\n\n if(!field) {\n throw new Error(`Field with id \"${key}\" not found`);\n }\n\n children.push(entries.find(f => f.id === key))\n }\n\n result.push({\n type: 'tab',\n label: name,\n id: `tab_${name.toLowerCase().replaceAll(' ', '')}`,\n children\n })\n }\n\n return [{\n type: 'tabs',\n id: 'tabs',\n children: result\n }]\n }\n}","import { NestedPaths } from '../../types';\nimport { ConditionFn, ConditionOperators, Conditions, Field } from './types';\nimport { ObjectEntries } from '../../types/object';\n\nfunction addConditionToField(fields: Field[], path: string, condition: Conditions): void {\n const keys = path.split('.');\n let currentFields = fields;\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const field = currentFields.find(f => f.id === key);\n\n if (!field) {\n throw new Error(`Field with id \"${key}\" not found`);\n }\n\n if (i === keys.length - 1) {\n field.condition = condition;\n } else {\n if (!field.children) {\n throw new Error(`Field with id \"${key}\" has no children`);\n }\n\n const nextKey = keys[i + 1];\n if(nextKey === '$this') {\n field.condition = condition;\n break;\n }\n currentFields = field.children;\n }\n }\n}\n\nexport class Condition<TEntries extends ObjectEntries> {\n private conditions = new Map<string, Conditions>();\n\n addCondition(field: NestedPaths<TEntries>, condition: ConditionFn<TEntries>) {\n const operators: ConditionOperators<TEntries> = {\n eq: (field, value) => ({ operator: 'eq', field, value }),\n neq: (field, value) => ({ operator: 'neq', field, value }),\n exists: (field) => ({ operator: 'exists', field }),\n and: (...operations) => ({ operator: 'and', value: operations }),\n or: (...operations) => ({ operator: 'or', value: operations })\n };\n\n this.conditions.set(field, condition(operators));\n }\n\n parse(entries: Field[]) {\n for (let [key, value] of this.conditions) {\n addConditionToField(entries, key, value)\n }\n\n return entries;\n }\n}\n","interface PathValue {\n path: string[];\n value: any;\n}\n\nexport function pathToArray(obj: Record<string, any>, parentPath: string[] = []): PathValue[] {\n const result: PathValue[] = [];\n\n for (const [key, value] of Object.entries(obj)) {\n const currentPath = [...parentPath, key];\n\n if (typeof value === 'object' && !value.hasOwnProperty('operator') && !Array.isArray(value)) {\n // If the value is an object, recurse into it\n result.push(...pathToArray(value, currentPath));\n } else {\n // If the value is not an object, store the path and value\n result.push({ path: currentPath, value });\n }\n }\n\n return result;\n}","import { BaseSchema, EntryMask, NestedPaths } from '../../types';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\nimport { Tabs } from './tabs';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { Condition } from './condition';\nimport { pathToArray } from '../../utils/pathToArray';\nimport { ConditionsArgument } from './types';\n\nexport interface DialogSchema<TEntries extends ObjectEntries> extends BaseSchema<ObjectOutput<TEntries>> {\n type: 'dialog';\n tabs: (tabs: Record<string, EntryMask<TEntries>>) => DialogSchema<TEntries>;\n conditions: (conditions: ConditionsArgument<TEntries>) => DialogSchema<TEntries>;\n}\n\nclass DialogBuilder<TEntries extends ObjectEntries> implements DialogSchema<TEntries> {\n private conditionsModule: Condition<TEntries>;\n private tabsModule: Tabs<TEntries>;\n private readonly entries: TEntries;\n readonly type = 'dialog';\n\n constructor(entries: TEntries) {\n this.entries = entries;\n this.conditionsModule = new Condition<TEntries>();\n this.tabsModule = new Tabs<TEntries>();\n }\n\n conditions(conditions: ConditionsArgument<TEntries>) {\n const conditionsArray = pathToArray(conditions)\n for (const condition of conditionsArray) {\n this.conditionsModule.addCondition(condition.path.join('.') as NestedPaths<TEntries>, condition.value);\n }\n return this;\n }\n\n tabs(tabs: Record<string, EntryMask<TEntries>>) {\n for (const [key, tab] of Object.entries(tabs)) {\n this.tabsModule.addTab(key as any, tab!);\n }\n return this;\n }\n\n _parse() {\n const dialog = Object.entries(this.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 const dialogWithConditions = this.conditionsModule.parse(dialog);\n const dialogWithTabs = this.tabsModule.parse(dialogWithConditions);\n return {\n dialog: dialogWithTabs\n };\n }\n\n _primitive() {\n const result: Record<string, WebcomponentPropTypes> = {};\n\n for (const [key, entry] of Object.entries(this.entries)) {\n const type = entry._primitive();\n if (typeof type === 'string') {\n result[key] = type;\n }\n }\n\n return result;\n }\n}\n\nexport function dialog<TEntries extends ObjectEntries>(entries: TEntries) {\n return new DialogBuilder(entries)\n}"],"mappings":";;;;;AAGO,IAAM,OAAN,MAAqB;AAAA,EAArB;AACL,wBAAQ,QAAO,oBAAI,IAAiC;AAAA;AAAA,EAEpD,OAAO,MAAc,SAA8B;AACjD,SAAK,KAAK,IAAI,MAAM,OAAO;AAAA,EAC7B;AAAA,EAEA,MAAM,SAAkB;AACtB,UAAM,SAAS,CAAC;AAChB,UAAM,cAAc,oBAAI,IAAI;AAE5B,QAAG,KAAK,KAAK,SAAS,GAAG;AACvB,aAAO;AAAA,IACT;AAEA,eAAU,CAAC,MAAM,IAAI,KAAK,KAAK,MAAM;AACnC,YAAM,WAAW,CAAC;AAElB,UAAG,CAAC,MAAM;AACR,cAAM,IAAI,MAA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SAAS,OAAuC,SAAmB;AACxE,SAAO,IAAI,cAAc,OAAO;AAClC;","names":["field","dialog"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field } from '../../types-
|
|
1
|
+
export { b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field } from '../../types-DUGwdG43.mjs';
|
|
2
2
|
import '../../types/utils.mjs';
|
|
3
3
|
import '../../types/webcomponent.mjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field } from '../../types-
|
|
1
|
+
export { b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field } from '../../types-Cvbi87LT.js';
|
|
2
2
|
import '../../types/utils.js';
|
|
3
3
|
import '../../types/webcomponent.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schema/dialog/types.ts"],"sourcesContent":["import { ObjectEntries, ObjectOutput } from '../../types/object';\nimport { AddType, DeepPartial, LeavesPath, NodesPath, PathValue, UnArray } from '../../types';\n\ntype Operators = 'eq' | 'neq' | 'and' | 'or' | 'exists'\n\nexport interface Conditions<T extends Operators = Operators> {\n operator: T;\n field?: string;\n value?: any;\n}\n\nexport interface ConditionOperators<TEntries extends ObjectEntries = any> {\n eq: <P extends NodesPath<UnArray<ObjectOutput<TEntries>>>>(\n field: P,\n value: PathValue<UnArray<ObjectOutput<TEntries>>, P>\n ) => Conditions<'eq'>;\n neq: <P extends NodesPath<UnArray<ObjectOutput<TEntries>>>>(\n field: P,\n value: PathValue<UnArray<ObjectOutput<TEntries>>, P>\n ) => Conditions<'neq'>;\n exists: <P extends NodesPath<UnArray<ObjectOutput<TEntries>>>>(\n field: P,\n ) => Conditions<'exists'>;\n and: (...args: Conditions[]) => Conditions<'and'>;\n or: (...args: Conditions[]) => Conditions<'or'>;\n}\n\nexport type ConditionFn<TEntries extends ObjectEntries> = (ops: ConditionOperators<TEntries>) => Conditions;\n\nexport type ConditionsArgument<TEntries extends ObjectEntries> = AddType<UnArray<DeepPartial<ObjectOutput<TEntries>>>, ConditionFn<TEntries>>\n\nexport type Field = { id: string, condition?: Conditions, children?: Field[] }"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/schema/dialog/types.ts"],"sourcesContent":["import { ObjectEntries, ObjectOutput } from '../../types/object';\nimport { AddType, DeepPartial, LeavesPath, NodesPath, PathValue, UnArray } from '../../types';\n\ntype Operators = 'eq' | 'neq' | 'and' | 'or' | 'exists'\n\nexport interface Conditions<T extends Operators = Operators> {\n operator: T;\n field?: string;\n value?: any;\n}\n\nexport interface ConditionOperators<TEntries extends ObjectEntries = any> {\n eq: <P extends NodesPath<UnArray<ObjectOutput<TEntries>>>>(\n field: P,\n value: PathValue<UnArray<ObjectOutput<TEntries>>, P>\n ) => Conditions<'eq'>;\n neq: <P extends NodesPath<UnArray<ObjectOutput<TEntries>>>>(\n field: P,\n value: PathValue<UnArray<ObjectOutput<TEntries>>, P>\n ) => Conditions<'neq'>;\n exists: <P extends NodesPath<UnArray<ObjectOutput<TEntries>>>>(\n field: P,\n ) => Conditions<'exists'>;\n and: (...args: Conditions[]) => Conditions<'and'>;\n or: (...args: Conditions[]) => Conditions<'or'>;\n}\n\nexport type ConditionFn<TEntries extends ObjectEntries> = (ops: ConditionOperators<TEntries>) => Conditions;\n\ntype ThisPlaceholder = symbol\nexport type ConditionsArgument<TEntries extends ObjectEntries> = AddType<UnArray<DeepPartial<AddType<ObjectOutput<TEntries>, {$this: ThisPlaceholder}>>>, ConditionFn<TEntries>>\n\nexport type Field = { id: string, condition?: Conditions, children?: Field[] }"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseSchema, d as BaseFieldInput } from '../../types-
|
|
1
|
+
import { B as BaseSchema, d as BaseFieldInput } from '../../types-DUGwdG43.mjs';
|
|
2
2
|
import { InferOutput } from '../../types/infer.mjs';
|
|
3
3
|
import '../../types/webcomponent.mjs';
|
|
4
4
|
import '../../types/utils.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseSchema, d as BaseFieldInput } from '../../types-
|
|
1
|
+
import { B as BaseSchema, d as BaseFieldInput } from '../../types-Cvbi87LT.js';
|
|
2
2
|
import { InferOutput } from '../../types/infer.js';
|
|
3
3
|
import '../../types/webcomponent.js';
|
|
4
4
|
import '../../types/utils.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseSchema, d as BaseFieldInput } from '../../types-
|
|
1
|
+
import { B as BaseSchema, d as BaseFieldInput } from '../../types-DUGwdG43.mjs';
|
|
2
2
|
import { InferOutput } from '../../types/infer.mjs';
|
|
3
3
|
import '../../types/webcomponent.mjs';
|
|
4
4
|
import '../../types/utils.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseSchema, d as BaseFieldInput } from '../../types-
|
|
1
|
+
import { B as BaseSchema, d as BaseFieldInput } from '../../types-Cvbi87LT.js';
|
|
2
2
|
import { InferOutput } from '../../types/infer.js';
|
|
3
3
|
import '../../types/webcomponent.js';
|
|
4
4
|
import '../../types/utils.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as ObjectEntries, g as ObjectOutput, B as BaseSchema } from '../../types-
|
|
1
|
+
import { f as ObjectEntries, g as ObjectOutput, B as BaseSchema } from '../../types-DUGwdG43.mjs';
|
|
2
2
|
import '../../types/webcomponent.mjs';
|
|
3
3
|
import '../../types/utils.mjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as ObjectEntries, g as ObjectOutput, B as BaseSchema } from '../../types-
|
|
1
|
+
import { f as ObjectEntries, g as ObjectOutput, B as BaseSchema } from '../../types-Cvbi87LT.js';
|
|
2
2
|
import '../../types/webcomponent.js';
|
|
3
3
|
import '../../types/utils.js';
|
|
4
4
|
|
package/dist/schema/rte/rte.d.ts
CHANGED
package/dist/types/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { GetServerSideProps } from './props.mjs';
|
|
2
2
|
export { AddType, DeepPartial, EntryMask, LeavesPath, NestedPaths, NodesPath, PathValue, RequireAtLeastOne, ResolveObject, UnArray } from './utils.mjs';
|
|
3
|
-
export { d as BaseFieldInput, B as BaseSchema, e as Output } from '../types-
|
|
3
|
+
export { d as BaseFieldInput, B as BaseSchema, e as Output } from '../types-DUGwdG43.mjs';
|
|
4
4
|
export { InferOutput } from './infer.mjs';
|
|
5
5
|
export { ComponentModel } from './component.mjs';
|
|
6
6
|
import './webcomponent.mjs';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { GetServerSideProps } from './props.js';
|
|
2
2
|
export { AddType, DeepPartial, EntryMask, LeavesPath, NestedPaths, NodesPath, PathValue, RequireAtLeastOne, ResolveObject, UnArray } from './utils.js';
|
|
3
|
-
export { d as BaseFieldInput, B as BaseSchema, e as Output } from '../types-
|
|
3
|
+
export { d as BaseFieldInput, B as BaseSchema, e as Output } from '../types-Cvbi87LT.js';
|
|
4
4
|
export { InferOutput } from './infer.js';
|
|
5
5
|
export { ComponentModel } from './component.js';
|
|
6
6
|
import './webcomponent.js';
|
package/dist/types/infer.d.mts
CHANGED
package/dist/types/infer.d.ts
CHANGED
package/dist/types/object.d.mts
CHANGED
package/dist/types/object.d.ts
CHANGED
package/dist/types/schema.d.mts
CHANGED
package/dist/types/schema.d.ts
CHANGED
|
@@ -121,7 +121,10 @@ interface ConditionOperators<TEntries extends ObjectEntries = any> {
|
|
|
121
121
|
or: (...args: Conditions[]) => Conditions<'or'>;
|
|
122
122
|
}
|
|
123
123
|
type ConditionFn<TEntries extends ObjectEntries> = (ops: ConditionOperators<TEntries>) => Conditions;
|
|
124
|
-
type
|
|
124
|
+
type ThisPlaceholder = symbol;
|
|
125
|
+
type ConditionsArgument<TEntries extends ObjectEntries> = AddType<UnArray<DeepPartial<AddType<ObjectOutput<TEntries>, {
|
|
126
|
+
$this: ThisPlaceholder;
|
|
127
|
+
}>>>, ConditionFn<TEntries>>;
|
|
125
128
|
type Field = {
|
|
126
129
|
id: string;
|
|
127
130
|
condition?: Conditions;
|
|
@@ -121,7 +121,10 @@ interface ConditionOperators<TEntries extends ObjectEntries = any> {
|
|
|
121
121
|
or: (...args: Conditions[]) => Conditions<'or'>;
|
|
122
122
|
}
|
|
123
123
|
type ConditionFn<TEntries extends ObjectEntries> = (ops: ConditionOperators<TEntries>) => Conditions;
|
|
124
|
-
type
|
|
124
|
+
type ThisPlaceholder = symbol;
|
|
125
|
+
type ConditionsArgument<TEntries extends ObjectEntries> = AddType<UnArray<DeepPartial<AddType<ObjectOutput<TEntries>, {
|
|
126
|
+
$this: ThisPlaceholder;
|
|
127
|
+
}>>>, ConditionFn<TEntries>>;
|
|
125
128
|
type Field = {
|
|
126
129
|
id: string;
|
|
127
130
|
condition?: Conditions;
|
package/package.json
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethereal-nexus/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
|
-
"build": "tsup ./src",
|
|
11
|
-
"dev": "tsup ./src --watch"
|
|
12
|
-
},
|
|
13
8
|
"exports": {
|
|
14
9
|
".": {
|
|
15
10
|
"require": "./dist/index.js",
|
|
@@ -33,5 +28,10 @@
|
|
|
33
28
|
},
|
|
34
29
|
"dependencies": {
|
|
35
30
|
"@r2wc/react-to-web-component": "^2.0.3"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
34
|
+
"build": "tsup ./src",
|
|
35
|
+
"dev": "tsup ./src --watch"
|
|
36
36
|
}
|
|
37
|
-
}
|
|
37
|
+
}
|