@vuu-ui/vuu-utils 0.8.89 → 0.8.91
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/cjs/event-emitter.js +1 -1
- package/cjs/event-emitter.js.map +1 -1
- package/cjs/feature-utils.js +0 -3
- package/cjs/feature-utils.js.map +1 -1
- package/esm/event-emitter.js +1 -1
- package/esm/event-emitter.js.map +1 -1
- package/esm/feature-utils.js +0 -3
- package/esm/feature-utils.js.map +1 -1
- package/package.json +6 -6
package/cjs/event-emitter.js
CHANGED
|
@@ -36,7 +36,7 @@ class EventEmitter {
|
|
|
36
36
|
if (listenerOrListeners === listener) {
|
|
37
37
|
__privateGet(this, _events).delete(event);
|
|
38
38
|
} else if (Array.isArray(listenerOrListeners)) {
|
|
39
|
-
for (let i = length; i-- > 0; ) {
|
|
39
|
+
for (let i = listenerOrListeners.length; i-- > 0; ) {
|
|
40
40
|
if (listenerOrListeners[i] === listener) {
|
|
41
41
|
position = i;
|
|
42
42
|
break;
|
package/cjs/event-emitter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-emitter.js","sources":["../src/event-emitter.ts"],"sourcesContent":["type Listener = (...args: any[]) => void;\nexport type EmittedEvents = Record<string, Listener>;\n\nfunction isArrayOfListeners(\n listeners: EventListener | EventListener[]
|
|
1
|
+
{"version":3,"file":"event-emitter.js","sources":["../src/event-emitter.ts"],"sourcesContent":["type Listener = (...args: any[]) => void;\nexport type EmittedEvents = Record<string, Listener>;\n\nfunction isArrayOfListeners(\n listeners: EventListener | EventListener[],\n): listeners is EventListener[] {\n return Array.isArray(listeners);\n}\n\nfunction isOnlyListener(\n listeners: EventListener | EventListener[],\n): listeners is EventListener {\n return !Array.isArray(listeners);\n}\n\nexport interface IEventEmitter<Events extends EmittedEvents> {\n addListener<E extends keyof Events>(event: E, listener: Events[E]): void;\n emit<E extends keyof Events>(event: E, ...args: Parameters<Events[E]>): void;\n on<E extends keyof Events>(event: E, listener: Events[E]): void;\n removeListener<E extends keyof Events>(event: E, listener: Events[E]): void;\n removeAllListeners<E extends keyof Events>(event?: E): void;\n}\n\nexport class EventEmitter<Events extends EmittedEvents>\n implements IEventEmitter<Events>\n{\n #events: Map<keyof Events, Listener | Listener[]> = new Map();\n\n addListener<E extends keyof Events>(event: E, listener: Events[E]) {\n const listeners = this.#events.get(event);\n\n if (!listeners) {\n this.#events.set(event, listener);\n } else if (isArrayOfListeners(listeners)) {\n listeners.push(listener);\n } else if (isOnlyListener(listeners)) {\n this.#events.set(event, [listeners, listener]);\n }\n }\n\n removeListener<E extends keyof Events>(event: E, listener: Events[E]) {\n if (!this.#events.has(event)) {\n return;\n }\n\n const listenerOrListeners = this.#events.get(event);\n let position = -1;\n\n if (listenerOrListeners === listener) {\n this.#events.delete(event);\n } else if (Array.isArray(listenerOrListeners)) {\n for (let i = listenerOrListeners.length; i-- > 0; ) {\n if (listenerOrListeners[i] === listener) {\n position = i;\n break;\n }\n }\n\n if (position < 0) {\n return;\n }\n\n if (listenerOrListeners.length === 1) {\n listenerOrListeners.length = 0;\n this.#events.delete(event);\n } else {\n listenerOrListeners.splice(position, 1);\n }\n }\n }\n\n removeAllListeners<E extends keyof Events>(event?: E) {\n if (event && this.#events.has(event)) {\n this.#events.delete(event);\n } else if (event === undefined) {\n this.#events.clear();\n }\n }\n\n emit<E extends keyof Events>(event: E, ...args: Parameters<Events[E]>) {\n if (this.#events) {\n const handler = this.#events.get(event);\n if (handler) {\n this.invokeHandler(handler, args);\n }\n }\n }\n\n once<E extends keyof Events>(event: E, listener: Events[E]) {\n const handler = ((...args) => {\n this.removeListener(event, handler);\n listener(...args);\n }) as Events[E];\n\n this.on(event, handler);\n }\n\n on<E extends keyof Events>(event: E, listener: Events[E]) {\n this.addListener(event, listener);\n }\n\n hasListener<E extends keyof Events>(event: E, listener: Events[E]) {\n const listeners = this.#events.get(event);\n if (Array.isArray(listeners)) {\n return listeners.includes(listener);\n } else {\n return listeners === listener;\n }\n }\n\n private invokeHandler(handler: Listener | Array<Listener>, args: unknown[]) {\n if (isArrayOfListeners(handler)) {\n handler.slice().forEach((listener) => this.invokeHandler(listener, args));\n } else {\n switch (args.length) {\n case 0:\n handler();\n break;\n case 1:\n handler(args[0]);\n break;\n case 2:\n handler(args[0], args[1]);\n break;\n // slower\n default:\n handler.call(null, ...args);\n }\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA,IAAA,OAAA,CAAA;AAGA,SAAS,mBACP,SAC8B,EAAA;AAC9B,EAAO,OAAA,KAAA,CAAM,QAAQ,SAAS,CAAA,CAAA;AAChC,CAAA;AAEA,SAAS,eACP,SAC4B,EAAA;AAC5B,EAAO,OAAA,CAAC,KAAM,CAAA,OAAA,CAAQ,SAAS,CAAA,CAAA;AACjC,CAAA;AAUO,MAAM,YAEb,CAAA;AAAA,EAFO,WAAA,GAAA;AAGL,IAAA,YAAA,CAAA,IAAA,EAAA,OAAA,sBAAwD,GAAI,EAAA,CAAA,CAAA;AAAA,GAAA;AAAA,EAE5D,WAAA,CAAoC,OAAU,QAAqB,EAAA;AACjE,IAAA,MAAM,SAAY,GAAA,YAAA,CAAA,IAAA,EAAK,OAAQ,CAAA,CAAA,GAAA,CAAI,KAAK,CAAA,CAAA;AAExC,IAAA,IAAI,CAAC,SAAW,EAAA;AACd,MAAK,YAAA,CAAA,IAAA,EAAA,OAAA,CAAA,CAAQ,GAAI,CAAA,KAAA,EAAO,QAAQ,CAAA,CAAA;AAAA,KAClC,MAAA,IAAW,kBAAmB,CAAA,SAAS,CAAG,EAAA;AACxC,MAAA,SAAA,CAAU,KAAK,QAAQ,CAAA,CAAA;AAAA,KACzB,MAAA,IAAW,cAAe,CAAA,SAAS,CAAG,EAAA;AACpC,MAAA,YAAA,CAAA,IAAA,EAAK,SAAQ,GAAI,CAAA,KAAA,EAAO,CAAC,SAAA,EAAW,QAAQ,CAAC,CAAA,CAAA;AAAA,KAC/C;AAAA,GACF;AAAA,EAEA,c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OAAO,SAAc,KAAA,QAAA,CAAA;AAAA,KACvB;AAAA,GACF;AAAA,EAEQ,aAAA,CAAc,SAAqC,IAAiB,EAAA;AAC1E,IAAI,IAAA,kBAAA,CAAmB,OAAO,CAAG,EAAA;AAC/B,MAAQ,OAAA,CAAA,KAAA,GAAQ,OAAQ,CAAA,CAAC,aAAa,IAAK,CAAA,aAAA,CAAc,QAAU,EAAA,IAAI,CAAC,CAAA,CAAA;AAAA,KACnE,MAAA;AACL,MAAA,QAAQ,KAAK,MAAQ;AAAA,QACnB,KAAK,CAAA;AACH,UAAQ,OAAA,EAAA,CAAA;AACR,UAAA,MAAA;AAAA,QACF,KAAK,CAAA;AACH,UAAQ,OAAA,CAAA,IAAA,CAAK,CAAC,CAAC,CAAA,CAAA;AACf,UAAA,MAAA;AAAA,QACF,KAAK,CAAA;AACH,UAAA,OAAA,CAAQ,IAAK,CAAA,CAAC,CAAG,EAAA,IAAA,CAAK,CAAC,CAAC,CAAA,CAAA;AACxB,UAAA,MAAA;AAAA,QAEF;AACE,UAAQ,OAAA,CAAA,IAAA,CAAK,IAAM,EAAA,GAAG,IAAI,CAAA,CAAA;AAAA,OAC9B;AAAA,KACF;AAAA,GACF;AACF,CAAA;AAxGE,OAAA,GAAA,IAAA,OAAA,EAAA;;;;"}
|
package/cjs/feature-utils.js
CHANGED
|
@@ -59,9 +59,6 @@ const assertComponentsRegistered = (componentList) => {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
const getCustomAndTableFeatures = (dynamicFeatures, vuuTables) => {
|
|
62
|
-
console.log(`getCustomAndTableFeatures`, {
|
|
63
|
-
vuuTables
|
|
64
|
-
});
|
|
65
62
|
const [customFeatureConfig, tableFeaturesConfig] = arrayUtils.partition(
|
|
66
63
|
dynamicFeatures,
|
|
67
64
|
isCustomFeature
|
package/cjs/feature-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-utils.js","sources":["../src/feature-utils.ts"],"sourcesContent":["import type { TableSchema } from \"@vuu-ui/vuu-data-types\";\nimport type { VuuTable } from \"@vuu-ui/vuu-protocol-types\";\nimport { ListOption } from \"@vuu-ui/vuu-table-types\";\nimport { partition } from \"./array-utils\";\nimport { wordify } from \"./text-utils\";\nimport React, { ReactElement } from \"react\";\nimport { getLayoutComponent } from \"./component-registry\";\n\nexport type PathMap = {\n [key: string]: Pick<DynamicFeatureDescriptor, \"css\" | \"url\">;\n};\nexport type Environment = \"development\" | \"production\";\nexport const env = process.env.NODE_ENV as Environment;\n\nexport type LookupTableProvider = (table: VuuTable) => ListOption[];\n\nexport interface ViewConfig {\n allowRename?: boolean;\n closeable?: boolean;\n header?: boolean;\n}\n\nexport interface DynamicFeatureProps<P extends object | undefined = object> {\n /**\n props that will be passed to the lazily loaded component.\n */\n ComponentProps?: P;\n ViewProps?: ViewConfig;\n css?: string;\n height?: number;\n title?: string;\n /** \n The url of javascript bundle to lazily load. Bundle must provide a default export\n and that export must be a React component.\n */\n url: string;\n width?: number;\n}\n\ndeclare global {\n const vuuConfig: Promise<VuuConfig>;\n}\n\nexport interface DynamicFeatureDescriptor {\n name: string;\n title: string;\n url: string;\n css?: string;\n leftNavLocation: \"vuu-features\" | \"vuu-tables\";\n featureProps?: {\n schema?: \"*\" | VuuTable;\n schemas?: VuuTable[];\n };\n viewProps?: ViewConfig;\n}\n\nexport interface StaticFeatureDescriptor {\n group?: string;\n label: string;\n type: string;\n}\n\nconst isStaticFeature = (\n feature: unknown,\n): feature is StaticFeatureDescriptor =>\n feature !== null && typeof feature === \"object\" && \"type\" in feature;\n\nexport const isStaticFeatures = (\n features: unknown,\n): features is StaticFeatureDescriptor[] =>\n Array.isArray(features) && features.every(isStaticFeature);\n\nexport interface FilterTableFeatureProps {\n tableSchema: TableSchema;\n}\n\nexport type DynamicFeatures = {\n [key: string]: DynamicFeatureDescriptor;\n};\n\nexport function featureFromJson({ type }: { type: string }): ReactElement {\n const componentType = type.match(/^[a-z]/) ? type : getLayoutComponent(type);\n if (componentType === undefined) {\n throw Error(\n `layoutUtils unable to create feature component from JSON, unknown type ${type}`,\n );\n }\n return React.createElement(componentType);\n}\n\nexport interface VuuConfig {\n features: DynamicFeatures;\n authUrl?: string;\n websocketUrl: string;\n ssl: boolean;\n}\n\nexport const isCustomFeature = (feature: DynamicFeatureDescriptor) =>\n feature.leftNavLocation === \"vuu-features\";\n\nexport const isWildcardSchema = (schema?: \"*\" | VuuTable): schema is \"*\" =>\n schema === \"*\";\nexport const isTableSchema = (schema?: \"*\" | VuuTable): schema is VuuTable =>\n typeof schema === \"object\" &&\n typeof schema.module === \"string\" &&\n typeof schema.table === \"string\";\n\nexport interface FeaturePropsWithFilterTableFeature\n extends Omit<DynamicFeatureProps, \"ComponentProps\"> {\n ComponentProps: FilterTableFeatureProps;\n}\n\nexport const hasFilterTableFeatureProps = (\n props: DynamicFeatureProps,\n): props is FeaturePropsWithFilterTableFeature =>\n typeof props.ComponentProps === \"object\" &&\n props.ComponentProps !== null &&\n \"tableSchema\" in props.ComponentProps;\n\n// Sort TableScheas by module\nexport const byModule = (schema1: TableSchema, schema2: TableSchema) => {\n const m1 = schema1.table.module.toLowerCase();\n const m2 = schema2.table.module.toLowerCase();\n if (m1 < m2) {\n return -1;\n } else if (m1 > m2) {\n return 1;\n } else if (schema1.table.table < schema2.table.table) {\n return -1;\n } else if (schema1.table.table > schema2.table.table) {\n return 1;\n } else {\n return 0;\n }\n};\n\nexport type GetFeaturePaths = (params: {\n env: Environment;\n fileName: string;\n withCss?: boolean;\n}) => DynamicFeatureProps;\n\nexport const getFilterTableFeatures = (\n schemas: TableSchema[],\n getFeaturePath: GetFeaturePaths,\n) =>\n schemas\n .sort(byModule)\n .map<DynamicFeatureProps<FilterTableFeatureProps>>((schema) => ({\n ...getFeaturePath({ env, fileName: \"FilterTable\" }),\n ComponentProps: {\n tableSchema: schema,\n },\n ViewProps: {\n allowRename: true,\n },\n title: `${schema.table.module} ${schema.table.table}`,\n }));\n\nexport type Component = {\n componentName: string;\n component: unknown;\n};\n\nexport const assertComponentRegistered = (\n componentName: string,\n component: unknown,\n) => {\n if (typeof component !== \"function\") {\n console.warn(\n `${componentName} module not loaded, will be unabale to deserialize from layout JSON`,\n );\n }\n};\n\nexport const assertComponentsRegistered = (componentList: Component[]) => {\n for (const { componentName, component } of componentList) {\n assertComponentRegistered(componentName, component);\n }\n};\n\nexport const getCustomAndTableFeatures = (\n dynamicFeatures: DynamicFeatureDescriptor[],\n vuuTables: Map<string, TableSchema>,\n): {\n dynamicFeatures: DynamicFeatureProps[];\n tableFeatures: DynamicFeatureProps<FilterTableFeatureProps>[];\n} => {\n console.log(`getCustomAndTableFeatures`, {\n vuuTables,\n });\n const [customFeatureConfig, tableFeaturesConfig] = partition(\n dynamicFeatures,\n isCustomFeature,\n );\n\n const customFeatures: DynamicFeatureProps[] = [];\n const tableFeatures: DynamicFeatureProps<FilterTableFeatureProps>[] = [];\n\n for (const {\n featureProps = {},\n viewProps,\n ...feature\n } of tableFeaturesConfig) {\n const { schema } = featureProps;\n if (isWildcardSchema(schema) && vuuTables) {\n for (const tableSchema of vuuTables.values()) {\n tableFeatures.push({\n ...feature,\n ComponentProps: {\n tableSchema,\n },\n title: `${tableSchema.table.module} ${wordify(\n tableSchema.table.table,\n )}`,\n ViewProps: {\n ...viewProps,\n allowRename: true,\n },\n });\n }\n } else if (isTableSchema(schema) && vuuTables) {\n const tableSchema = vuuTables.get(schema.table);\n if (tableSchema) {\n tableFeatures.push({\n ...feature,\n ComponentProps: {\n tableSchema,\n },\n ViewProps: viewProps,\n });\n }\n }\n }\n\n for (const {\n featureProps = {},\n viewProps,\n ...feature\n } of customFeatureConfig) {\n const { schema, schemas } = featureProps;\n if (isTableSchema(schema) && vuuTables) {\n const tableSchema = vuuTables.get(schema.table);\n customFeatures.push({\n ...feature,\n ComponentProps: {\n tableSchema,\n },\n ViewProps: viewProps,\n });\n } else if (Array.isArray(schemas) && vuuTables) {\n customFeatures.push({\n ...feature,\n ComponentProps: schemas.reduce<Record<string, TableSchema>>(\n (map, schema) => {\n map[`${schema.table}Schema`] = vuuTables.get(\n schema.table,\n ) as TableSchema;\n return map;\n },\n {},\n ),\n ViewProps: viewProps,\n });\n } else {\n customFeatures.push(feature);\n }\n }\n return { dynamicFeatures: customFeatures, tableFeatures: tableFeatures };\n};\n"],"names":["getLayoutComponent","partition","wordify","schema"],"mappings":";;;;;;;AAYa,MAAA,GAAA,GAAM,QAAQ,GAAI,CAAA,SAAA;AAkD/B,MAAM,eAAA,GAAkB,CACtB,OAEA,KAAA,OAAA,KAAY,QAAQ,OAAO,OAAA,KAAY,YAAY,MAAU,IAAA,OAAA,CAAA;AAElD,MAAA,gBAAA,GAAmB,CAC9B,QAEA,KAAA,KAAA,CAAM,QAAQ,QAAQ,CAAA,IAAK,QAAS,CAAA,KAAA,CAAM,eAAe,EAAA;AAU3C,SAAA,eAAA,CAAgB,EAAE,IAAA,EAAwC,EAAA;AACxE,EAAA,MAAM,gBAAgB,IAAK,CAAA,KAAA,CAAM,QAAQ,CAAI,GAAA,IAAA,GAAOA,qCAAmB,IAAI,CAAA,CAAA;AAC3E,EAAA,IAAI,kBAAkB,KAAW,CAAA,EAAA;AAC/B,IAAM,MAAA,KAAA;AAAA,MACJ,0EAA0E,IAAI,CAAA,CAAA;AAAA,KAChF,CAAA;AAAA,GACF;AACA,EAAO,OAAA,KAAA,CAAM,cAAc,aAAa,CAAA,CAAA;AAC1C,CAAA;AASO,MAAM,eAAkB,GAAA,CAAC,OAC9B,KAAA,OAAA,CAAQ,eAAoB,KAAA,eAAA;AAEjB,MAAA,gBAAA,GAAmB,CAAC,MAAA,KAC/B,MAAW,KAAA,IAAA;AACN,MAAM,aAAgB,GAAA,CAAC,MAC5B,KAAA,OAAO,MAAW,KAAA,QAAA,IAClB,OAAO,MAAA,CAAO,MAAW,KAAA,QAAA,IACzB,OAAO,MAAA,CAAO,KAAU,KAAA,SAAA;AAOb,MAAA,0BAAA,GAA6B,CACxC,KAAA,KAE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CAAA,MAAA;AAAA,UACtB,CAAC,KAAKC,OAAW,KAAA;AACf,YAAA,GAAA,CAAI,CAAGA,EAAAA,OAAAA,CAAO,KAAK,CAAA,MAAA,CAAQ,IAAI,SAAU,CAAA,GAAA;AAAA,cACvCA,OAAO,CAAA,KAAA;AAAA,aACT,CAAA;AACA,YAAO,OAAA,GAAA,CAAA;AAAA,WACT;AAAA,UACA,EAAC;AAAA,SACH;AAAA,QACA,SAAW,EAAA,SAAA;AAAA,OACZ,CAAA,CAAA;AAAA,KACI,MAAA;AACL,MAAA,cAAA,CAAe,KAAK,OAAO,CAAA,CAAA;AAAA,KAC7B;AAAA,GACF;AACA,EAAO,OAAA,EAAE,eAAiB,EAAA,cAAA,EAAgB,aAA6B,EAAA,CAAA;AACzE;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"feature-utils.js","sources":["../src/feature-utils.ts"],"sourcesContent":["import type { TableSchema } from \"@vuu-ui/vuu-data-types\";\nimport type { VuuTable } from \"@vuu-ui/vuu-protocol-types\";\nimport { ListOption } from \"@vuu-ui/vuu-table-types\";\nimport { partition } from \"./array-utils\";\nimport { wordify } from \"./text-utils\";\nimport React, { ReactElement } from \"react\";\nimport { getLayoutComponent } from \"./component-registry\";\n\nexport type PathMap = {\n [key: string]: Pick<DynamicFeatureDescriptor, \"css\" | \"url\">;\n};\nexport type Environment = \"development\" | \"production\";\nexport const env = process.env.NODE_ENV as Environment;\n\nexport type LookupTableProvider = (table: VuuTable) => ListOption[];\n\nexport interface ViewConfig {\n allowRename?: boolean;\n closeable?: boolean;\n header?: boolean;\n}\n\nexport interface DynamicFeatureProps<P extends object | undefined = object> {\n /**\n props that will be passed to the lazily loaded component.\n */\n ComponentProps?: P;\n ViewProps?: ViewConfig;\n css?: string;\n height?: number;\n title?: string;\n /** \n The url of javascript bundle to lazily load. Bundle must provide a default export\n and that export must be a React component.\n */\n url: string;\n width?: number;\n}\n\ndeclare global {\n const vuuConfig: Promise<VuuConfig>;\n}\n\nexport interface DynamicFeatureDescriptor {\n name: string;\n title: string;\n url: string;\n css?: string;\n leftNavLocation: \"vuu-features\" | \"vuu-tables\";\n featureProps?: {\n schema?: \"*\" | VuuTable;\n schemas?: VuuTable[];\n };\n viewProps?: ViewConfig;\n}\n\nexport interface StaticFeatureDescriptor {\n group?: string;\n label: string;\n type: string;\n}\n\nconst isStaticFeature = (\n feature: unknown,\n): feature is StaticFeatureDescriptor =>\n feature !== null && typeof feature === \"object\" && \"type\" in feature;\n\nexport const isStaticFeatures = (\n features: unknown,\n): features is StaticFeatureDescriptor[] =>\n Array.isArray(features) && features.every(isStaticFeature);\n\nexport interface FilterTableFeatureProps {\n tableSchema: TableSchema;\n}\n\nexport type DynamicFeatures = {\n [key: string]: DynamicFeatureDescriptor;\n};\n\nexport function featureFromJson({ type }: { type: string }): ReactElement {\n const componentType = type.match(/^[a-z]/) ? type : getLayoutComponent(type);\n if (componentType === undefined) {\n throw Error(\n `layoutUtils unable to create feature component from JSON, unknown type ${type}`,\n );\n }\n return React.createElement(componentType);\n}\n\nexport interface VuuConfig {\n features: DynamicFeatures;\n authUrl?: string;\n websocketUrl: string;\n ssl: boolean;\n}\n\nexport const isCustomFeature = (feature: DynamicFeatureDescriptor) =>\n feature.leftNavLocation === \"vuu-features\";\n\nexport const isWildcardSchema = (schema?: \"*\" | VuuTable): schema is \"*\" =>\n schema === \"*\";\nexport const isTableSchema = (schema?: \"*\" | VuuTable): schema is VuuTable =>\n typeof schema === \"object\" &&\n typeof schema.module === \"string\" &&\n typeof schema.table === \"string\";\n\nexport interface FeaturePropsWithFilterTableFeature\n extends Omit<DynamicFeatureProps, \"ComponentProps\"> {\n ComponentProps: FilterTableFeatureProps;\n}\n\nexport const hasFilterTableFeatureProps = (\n props: DynamicFeatureProps,\n): props is FeaturePropsWithFilterTableFeature =>\n typeof props.ComponentProps === \"object\" &&\n props.ComponentProps !== null &&\n \"tableSchema\" in props.ComponentProps;\n\n// Sort TableScheas by module\nexport const byModule = (schema1: TableSchema, schema2: TableSchema) => {\n const m1 = schema1.table.module.toLowerCase();\n const m2 = schema2.table.module.toLowerCase();\n if (m1 < m2) {\n return -1;\n } else if (m1 > m2) {\n return 1;\n } else if (schema1.table.table < schema2.table.table) {\n return -1;\n } else if (schema1.table.table > schema2.table.table) {\n return 1;\n } else {\n return 0;\n }\n};\n\nexport type GetFeaturePaths = (params: {\n env: Environment;\n fileName: string;\n withCss?: boolean;\n}) => DynamicFeatureProps;\n\nexport const getFilterTableFeatures = (\n schemas: TableSchema[],\n getFeaturePath: GetFeaturePaths,\n) =>\n schemas\n .sort(byModule)\n .map<DynamicFeatureProps<FilterTableFeatureProps>>((schema) => ({\n ...getFeaturePath({ env, fileName: \"FilterTable\" }),\n ComponentProps: {\n tableSchema: schema,\n },\n ViewProps: {\n allowRename: true,\n },\n title: `${schema.table.module} ${schema.table.table}`,\n }));\n\nexport type Component = {\n componentName: string;\n component: unknown;\n};\n\nexport const assertComponentRegistered = (\n componentName: string,\n component: unknown,\n) => {\n if (typeof component !== \"function\") {\n console.warn(\n `${componentName} module not loaded, will be unabale to deserialize from layout JSON`,\n );\n }\n};\n\nexport const assertComponentsRegistered = (componentList: Component[]) => {\n for (const { componentName, component } of componentList) {\n assertComponentRegistered(componentName, component);\n }\n};\n\nexport const getCustomAndTableFeatures = (\n dynamicFeatures: DynamicFeatureDescriptor[],\n vuuTables: Map<string, TableSchema>,\n): {\n dynamicFeatures: DynamicFeatureProps[];\n tableFeatures: DynamicFeatureProps<FilterTableFeatureProps>[];\n} => {\n const [customFeatureConfig, tableFeaturesConfig] = partition(\n dynamicFeatures,\n isCustomFeature,\n );\n\n const customFeatures: DynamicFeatureProps[] = [];\n const tableFeatures: DynamicFeatureProps<FilterTableFeatureProps>[] = [];\n\n for (const {\n featureProps = {},\n viewProps,\n ...feature\n } of tableFeaturesConfig) {\n const { schema } = featureProps;\n if (isWildcardSchema(schema) && vuuTables) {\n for (const tableSchema of vuuTables.values()) {\n tableFeatures.push({\n ...feature,\n ComponentProps: {\n tableSchema,\n },\n title: `${tableSchema.table.module} ${wordify(\n tableSchema.table.table,\n )}`,\n ViewProps: {\n ...viewProps,\n allowRename: true,\n },\n });\n }\n } else if (isTableSchema(schema) && vuuTables) {\n const tableSchema = vuuTables.get(schema.table);\n if (tableSchema) {\n tableFeatures.push({\n ...feature,\n ComponentProps: {\n tableSchema,\n },\n ViewProps: viewProps,\n });\n }\n }\n }\n\n for (const {\n featureProps = {},\n viewProps,\n ...feature\n } of customFeatureConfig) {\n const { schema, schemas } = featureProps;\n if (isTableSchema(schema) && vuuTables) {\n const tableSchema = vuuTables.get(schema.table);\n customFeatures.push({\n ...feature,\n ComponentProps: {\n tableSchema,\n },\n ViewProps: viewProps,\n });\n } else if (Array.isArray(schemas) && vuuTables) {\n customFeatures.push({\n ...feature,\n ComponentProps: schemas.reduce<Record<string, TableSchema>>(\n (map, schema) => {\n map[`${schema.table}Schema`] = vuuTables.get(\n schema.table,\n ) as TableSchema;\n return map;\n },\n {},\n ),\n ViewProps: viewProps,\n });\n } else {\n customFeatures.push(feature);\n }\n }\n return { dynamicFeatures: customFeatures, tableFeatures: tableFeatures };\n};\n"],"names":["getLayoutComponent","partition","wordify","schema"],"mappings":";;;;;;;AAYa,MAAA,GAAA,GAAM,QAAQ,GAAI,CAAA,SAAA;AAkD/B,MAAM,eAAA,GAAkB,CACtB,OAEA,KAAA,OAAA,KAAY,QAAQ,OAAO,OAAA,KAAY,YAAY,MAAU,IAAA,OAAA,CAAA;AAElD,MAAA,gBAAA,GAAmB,CAC9B,QAEA,KAAA,KAAA,CAAM,QAAQ,QAAQ,CAAA,IAAK,QAAS,CAAA,KAAA,CAAM,eAAe,EAAA;AAU3C,SAAA,eAAA,CAAgB,EAAE,IAAA,EAAwC,EAAA;AACxE,EAAA,MAAM,gBAAgB,IAAK,CAAA,KAAA,CAAM,QAAQ,CAAI,GAAA,IAAA,GAAOA,qCAAmB,IAAI,CAAA,CAAA;AAC3E,EAAA,IAAI,k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AW,EAAA;AACtC,MAAA,MAAM,WAAc,GAAA,SAAA,CAAU,GAAI,CAAA,MAAA,CAAO,KAAK,CAAA,CAAA;AAC9C,MAAA,cAAA,CAAe,IAAK,CAAA;AAAA,QAClB,GAAG,OAAA;AAAA,QACH,cAAgB,EAAA;AAAA,UACd,WAAA;AAAA,SACF;AAAA,QACA,SAAW,EAAA,SAAA;AAAA,OACZ,CAAA,CAAA;AAAA,KACQ,MAAA,IAAA,KAAA,CAAM,OAAQ,CAAA,OAAO,KAAK,SAAW,EAAA;AAC9C,MAAA,cAAA,CAAe,IAAK,CAAA;AAAA,QAClB,GAAG,OAAA;AAAA,QACH,gBAAgB,OAAQ,CAAA,MAAA;AAAA,UACtB,CAAC,KAAKC,OAAW,KAAA;AACf,YAAA,GAAA,CAAI,CAAGA,EAAAA,OAAAA,CAAO,KAAK,CAAA,MAAA,CAAQ,IAAI,SAAU,CAAA,GAAA;AAAA,cACvCA,OAAO,CAAA,KAAA;AAAA,aACT,CAAA;AACA,YAAO,OAAA,GAAA,CAAA;AAAA,WACT;AAAA,UACA,EAAC;AAAA,SACH;AAAA,QACA,SAAW,EAAA,SAAA;AAAA,OACZ,CAAA,CAAA;AAAA,KACI,MAAA;AACL,MAAA,cAAA,CAAe,KAAK,OAAO,CAAA,CAAA;AAAA,KAC7B;AAAA,GACF;AACA,EAAO,OAAA,EAAE,eAAiB,EAAA,cAAA,EAAgB,aAA6B,EAAA,CAAA;AACzE;;;;;;;;;;;;;;;"}
|
package/esm/event-emitter.js
CHANGED
|
@@ -34,7 +34,7 @@ class EventEmitter {
|
|
|
34
34
|
if (listenerOrListeners === listener) {
|
|
35
35
|
__privateGet(this, _events).delete(event);
|
|
36
36
|
} else if (Array.isArray(listenerOrListeners)) {
|
|
37
|
-
for (let i = length; i-- > 0; ) {
|
|
37
|
+
for (let i = listenerOrListeners.length; i-- > 0; ) {
|
|
38
38
|
if (listenerOrListeners[i] === listener) {
|
|
39
39
|
position = i;
|
|
40
40
|
break;
|
package/esm/event-emitter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-emitter.js","sources":["../src/event-emitter.ts"],"sourcesContent":["type Listener = (...args: any[]) => void;\nexport type EmittedEvents = Record<string, Listener>;\n\nfunction isArrayOfListeners(\n listeners: EventListener | EventListener[]
|
|
1
|
+
{"version":3,"file":"event-emitter.js","sources":["../src/event-emitter.ts"],"sourcesContent":["type Listener = (...args: any[]) => void;\nexport type EmittedEvents = Record<string, Listener>;\n\nfunction isArrayOfListeners(\n listeners: EventListener | EventListener[],\n): listeners is EventListener[] {\n return Array.isArray(listeners);\n}\n\nfunction isOnlyListener(\n listeners: EventListener | EventListener[],\n): listeners is EventListener {\n return !Array.isArray(listeners);\n}\n\nexport interface IEventEmitter<Events extends EmittedEvents> {\n addListener<E extends keyof Events>(event: E, listener: Events[E]): void;\n emit<E extends keyof Events>(event: E, ...args: Parameters<Events[E]>): void;\n on<E extends keyof Events>(event: E, listener: Events[E]): void;\n removeListener<E extends keyof Events>(event: E, listener: Events[E]): void;\n removeAllListeners<E extends keyof Events>(event?: E): void;\n}\n\nexport class EventEmitter<Events extends EmittedEvents>\n implements IEventEmitter<Events>\n{\n #events: Map<keyof Events, Listener | Listener[]> = new Map();\n\n addListener<E extends keyof Events>(event: E, listener: Events[E]) {\n const listeners = this.#events.get(event);\n\n if (!listeners) {\n this.#events.set(event, listener);\n } else if (isArrayOfListeners(listeners)) {\n listeners.push(listener);\n } else if (isOnlyListener(listeners)) {\n this.#events.set(event, [listeners, listener]);\n }\n }\n\n removeListener<E extends keyof Events>(event: E, listener: Events[E]) {\n if (!this.#events.has(event)) {\n return;\n }\n\n const listenerOrListeners = this.#events.get(event);\n let position = -1;\n\n if (listenerOrListeners === listener) {\n this.#events.delete(event);\n } else if (Array.isArray(listenerOrListeners)) {\n for (let i = listenerOrListeners.length; i-- > 0; ) {\n if (listenerOrListeners[i] === listener) {\n position = i;\n break;\n }\n }\n\n if (position < 0) {\n return;\n }\n\n if (listenerOrListeners.length === 1) {\n listenerOrListeners.length = 0;\n this.#events.delete(event);\n } else {\n listenerOrListeners.splice(position, 1);\n }\n }\n }\n\n removeAllListeners<E extends keyof Events>(event?: E) {\n if (event && this.#events.has(event)) {\n this.#events.delete(event);\n } else if (event === undefined) {\n this.#events.clear();\n }\n }\n\n emit<E extends keyof Events>(event: E, ...args: Parameters<Events[E]>) {\n if (this.#events) {\n const handler = this.#events.get(event);\n if (handler) {\n this.invokeHandler(handler, args);\n }\n }\n }\n\n once<E extends keyof Events>(event: E, listener: Events[E]) {\n const handler = ((...args) => {\n this.removeListener(event, handler);\n listener(...args);\n }) as Events[E];\n\n this.on(event, handler);\n }\n\n on<E extends keyof Events>(event: E, listener: Events[E]) {\n this.addListener(event, listener);\n }\n\n hasListener<E extends keyof Events>(event: E, listener: Events[E]) {\n const listeners = this.#events.get(event);\n if (Array.isArray(listeners)) {\n return listeners.includes(listener);\n } else {\n return listeners === listener;\n }\n }\n\n private invokeHandler(handler: Listener | Array<Listener>, args: unknown[]) {\n if (isArrayOfListeners(handler)) {\n handler.slice().forEach((listener) => this.invokeHandler(listener, args));\n } else {\n switch (args.length) {\n case 0:\n handler();\n break;\n case 1:\n handler(args[0]);\n break;\n case 2:\n handler(args[0], args[1]);\n break;\n // slower\n default:\n handler.call(null, ...args);\n }\n }\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAA,OAAA,CAAA;AAGA,SAAS,mBACP,SAC8B,EAAA;AAC9B,EAAO,OAAA,KAAA,CAAM,QAAQ,SAAS,CAAA,CAAA;AAChC,CAAA;AAEA,SAAS,eACP,SAC4B,EAAA;AAC5B,EAAO,OAAA,CAAC,KAAM,CAAA,OAAA,CAAQ,SAAS,CAAA,CAAA;AACjC,CAAA;AAUO,MAAM,YAEb,CAAA;AAAA,EAFO,WAAA,GAAA;AAGL,IAAA,YAAA,CAAA,IAAA,EAAA,OAAA,sBAAwD,GAAI,EAAA,CAAA,CAAA;AAAA,GAAA;A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,UAAQ,OAAA,CAAA,IAAA,CAAK,IAAM,EAAA,GAAG,IAAI,CAAA,CAAA;AAAA,OAC9B;AAAA,KACF;AAAA,GACF;AACF,CAAA;AAxGE,OAAA,GAAA,IAAA,OAAA,EAAA;;;;"}
|
package/esm/feature-utils.js
CHANGED
|
@@ -57,9 +57,6 @@ const assertComponentsRegistered = (componentList) => {
|
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
const getCustomAndTableFeatures = (dynamicFeatures, vuuTables) => {
|
|
60
|
-
console.log(`getCustomAndTableFeatures`, {
|
|
61
|
-
vuuTables
|
|
62
|
-
});
|
|
63
60
|
const [customFeatureConfig, tableFeaturesConfig] = partition(
|
|
64
61
|
dynamicFeatures,
|
|
65
62
|
isCustomFeature
|
package/esm/feature-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-utils.js","sources":["../src/feature-utils.ts"],"sourcesContent":["import type { TableSchema } from \"@vuu-ui/vuu-data-types\";\nimport type { VuuTable } from \"@vuu-ui/vuu-protocol-types\";\nimport { ListOption } from \"@vuu-ui/vuu-table-types\";\nimport { partition } from \"./array-utils\";\nimport { wordify } from \"./text-utils\";\nimport React, { ReactElement } from \"react\";\nimport { getLayoutComponent } from \"./component-registry\";\n\nexport type PathMap = {\n [key: string]: Pick<DynamicFeatureDescriptor, \"css\" | \"url\">;\n};\nexport type Environment = \"development\" | \"production\";\nexport const env = process.env.NODE_ENV as Environment;\n\nexport type LookupTableProvider = (table: VuuTable) => ListOption[];\n\nexport interface ViewConfig {\n allowRename?: boolean;\n closeable?: boolean;\n header?: boolean;\n}\n\nexport interface DynamicFeatureProps<P extends object | undefined = object> {\n /**\n props that will be passed to the lazily loaded component.\n */\n ComponentProps?: P;\n ViewProps?: ViewConfig;\n css?: string;\n height?: number;\n title?: string;\n /** \n The url of javascript bundle to lazily load. Bundle must provide a default export\n and that export must be a React component.\n */\n url: string;\n width?: number;\n}\n\ndeclare global {\n const vuuConfig: Promise<VuuConfig>;\n}\n\nexport interface DynamicFeatureDescriptor {\n name: string;\n title: string;\n url: string;\n css?: string;\n leftNavLocation: \"vuu-features\" | \"vuu-tables\";\n featureProps?: {\n schema?: \"*\" | VuuTable;\n schemas?: VuuTable[];\n };\n viewProps?: ViewConfig;\n}\n\nexport interface StaticFeatureDescriptor {\n group?: string;\n label: string;\n type: string;\n}\n\nconst isStaticFeature = (\n feature: unknown,\n): feature is StaticFeatureDescriptor =>\n feature !== null && typeof feature === \"object\" && \"type\" in feature;\n\nexport const isStaticFeatures = (\n features: unknown,\n): features is StaticFeatureDescriptor[] =>\n Array.isArray(features) && features.every(isStaticFeature);\n\nexport interface FilterTableFeatureProps {\n tableSchema: TableSchema;\n}\n\nexport type DynamicFeatures = {\n [key: string]: DynamicFeatureDescriptor;\n};\n\nexport function featureFromJson({ type }: { type: string }): ReactElement {\n const componentType = type.match(/^[a-z]/) ? type : getLayoutComponent(type);\n if (componentType === undefined) {\n throw Error(\n `layoutUtils unable to create feature component from JSON, unknown type ${type}`,\n );\n }\n return React.createElement(componentType);\n}\n\nexport interface VuuConfig {\n features: DynamicFeatures;\n authUrl?: string;\n websocketUrl: string;\n ssl: boolean;\n}\n\nexport const isCustomFeature = (feature: DynamicFeatureDescriptor) =>\n feature.leftNavLocation === \"vuu-features\";\n\nexport const isWildcardSchema = (schema?: \"*\" | VuuTable): schema is \"*\" =>\n schema === \"*\";\nexport const isTableSchema = (schema?: \"*\" | VuuTable): schema is VuuTable =>\n typeof schema === \"object\" &&\n typeof schema.module === \"string\" &&\n typeof schema.table === \"string\";\n\nexport interface FeaturePropsWithFilterTableFeature\n extends Omit<DynamicFeatureProps, \"ComponentProps\"> {\n ComponentProps: FilterTableFeatureProps;\n}\n\nexport const hasFilterTableFeatureProps = (\n props: DynamicFeatureProps,\n): props is FeaturePropsWithFilterTableFeature =>\n typeof props.ComponentProps === \"object\" &&\n props.ComponentProps !== null &&\n \"tableSchema\" in props.ComponentProps;\n\n// Sort TableScheas by module\nexport const byModule = (schema1: TableSchema, schema2: TableSchema) => {\n const m1 = schema1.table.module.toLowerCase();\n const m2 = schema2.table.module.toLowerCase();\n if (m1 < m2) {\n return -1;\n } else if (m1 > m2) {\n return 1;\n } else if (schema1.table.table < schema2.table.table) {\n return -1;\n } else if (schema1.table.table > schema2.table.table) {\n return 1;\n } else {\n return 0;\n }\n};\n\nexport type GetFeaturePaths = (params: {\n env: Environment;\n fileName: string;\n withCss?: boolean;\n}) => DynamicFeatureProps;\n\nexport const getFilterTableFeatures = (\n schemas: TableSchema[],\n getFeaturePath: GetFeaturePaths,\n) =>\n schemas\n .sort(byModule)\n .map<DynamicFeatureProps<FilterTableFeatureProps>>((schema) => ({\n ...getFeaturePath({ env, fileName: \"FilterTable\" }),\n ComponentProps: {\n tableSchema: schema,\n },\n ViewProps: {\n allowRename: true,\n },\n title: `${schema.table.module} ${schema.table.table}`,\n }));\n\nexport type Component = {\n componentName: string;\n component: unknown;\n};\n\nexport const assertComponentRegistered = (\n componentName: string,\n component: unknown,\n) => {\n if (typeof component !== \"function\") {\n console.warn(\n `${componentName} module not loaded, will be unabale to deserialize from layout JSON`,\n );\n }\n};\n\nexport const assertComponentsRegistered = (componentList: Component[]) => {\n for (const { componentName, component } of componentList) {\n assertComponentRegistered(componentName, component);\n }\n};\n\nexport const getCustomAndTableFeatures = (\n dynamicFeatures: DynamicFeatureDescriptor[],\n vuuTables: Map<string, TableSchema>,\n): {\n dynamicFeatures: DynamicFeatureProps[];\n tableFeatures: DynamicFeatureProps<FilterTableFeatureProps>[];\n} => {\n console.log(`getCustomAndTableFeatures`, {\n vuuTables,\n });\n const [customFeatureConfig, tableFeaturesConfig] = partition(\n dynamicFeatures,\n isCustomFeature,\n );\n\n const customFeatures: DynamicFeatureProps[] = [];\n const tableFeatures: DynamicFeatureProps<FilterTableFeatureProps>[] = [];\n\n for (const {\n featureProps = {},\n viewProps,\n ...feature\n } of tableFeaturesConfig) {\n const { schema } = featureProps;\n if (isWildcardSchema(schema) && vuuTables) {\n for (const tableSchema of vuuTables.values()) {\n tableFeatures.push({\n ...feature,\n ComponentProps: {\n tableSchema,\n },\n title: `${tableSchema.table.module} ${wordify(\n tableSchema.table.table,\n )}`,\n ViewProps: {\n ...viewProps,\n allowRename: true,\n },\n });\n }\n } else if (isTableSchema(schema) && vuuTables) {\n const tableSchema = vuuTables.get(schema.table);\n if (tableSchema) {\n tableFeatures.push({\n ...feature,\n ComponentProps: {\n tableSchema,\n },\n ViewProps: viewProps,\n });\n }\n }\n }\n\n for (const {\n featureProps = {},\n viewProps,\n ...feature\n } of customFeatureConfig) {\n const { schema, schemas } = featureProps;\n if (isTableSchema(schema) && vuuTables) {\n const tableSchema = vuuTables.get(schema.table);\n customFeatures.push({\n ...feature,\n ComponentProps: {\n tableSchema,\n },\n ViewProps: viewProps,\n });\n } else if (Array.isArray(schemas) && vuuTables) {\n customFeatures.push({\n ...feature,\n ComponentProps: schemas.reduce<Record<string, TableSchema>>(\n (map, schema) => {\n map[`${schema.table}Schema`] = vuuTables.get(\n schema.table,\n ) as TableSchema;\n return map;\n },\n {},\n ),\n ViewProps: viewProps,\n });\n } else {\n customFeatures.push(feature);\n }\n }\n return { dynamicFeatures: customFeatures, tableFeatures: tableFeatures };\n};\n"],"names":["schema"],"mappings":";;;;;AAYa,MAAA,GAAA,GAAM,QAAQ,GAAI,CAAA,SAAA;AAkD/B,MAAM,eAAA,GAAkB,CACtB,OAEA,KAAA,OAAA,KAAY,QAAQ,OAAO,OAAA,KAAY,YAAY,MAAU,IAAA,OAAA,CAAA;AAElD,MAAA,gBAAA,GAAmB,CAC9B,QAEA,KAAA,KAAA,CAAM,QAAQ,QAAQ,CAAA,IAAK,QAAS,CAAA,KAAA,CAAM,eAAe,EAAA;AAU3C,SAAA,eAAA,CAAgB,EAAE,IAAA,EAAwC,EAAA;AACxE,EAAA,MAAM,gBAAgB,IAAK,CAAA,KAAA,CAAM,QAAQ,CAAI,GAAA,IAAA,GAAO,mBAAmB,I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AqB,EAAA;AACxB,IAAM,MAAA,EAAE,MAAQ,EAAA,OAAA,EAAY,GAAA,YAAA,CAAA;AAC5B,IAAI,IAAA,aAAA,CAAc,MAAM,CAAA,IAAK,SAAW,EAAA;AACtC,MAAA,MAAM,WAAc,GAAA,SAAA,CAAU,GAAI,CAAA,MAAA,CAAO,KAAK,CAAA,CAAA;AAC9C,MAAA,cAAA,CAAe,IAAK,CAAA;AAAA,QAClB,GAAG,OAAA;AAAA,QACH,cAAgB,EAAA;AAAA,UACd,WAAA;AAAA,SACF;AAAA,QACA,SAAW,EAAA,SAAA;AAAA,OACZ,CAAA,CAAA;AAAA,KACQ,MAAA,IAAA,KAAA,CAAM,OAAQ,CAAA,OAAO,KAAK,SAAW,EAAA;AAC9C,MAAA,cAAA,CAAe,IAAK,CAAA;AAAA,QAClB,GAAG,OAAA;AAAA,QACH,gBAAgB,OAAQ,CAAA,MAAA;AAAA,UACtB,CAAC,KAAKA,OAAW,KAAA;AACf,YAAA,GAAA,CAAI,CAAGA,EAAAA,OAAAA,CAAO,KAAK,CAAA,MAAA,CAAQ,IAAI,SAAU,CAAA,GAAA;AAAA,cACvCA,OAAO,CAAA,KAAA;AAAA,aACT,CAAA;AACA,YAAO,OAAA,GAAA,CAAA;AAAA,WACT;AAAA,UACA,EAAC;AAAA,SACH;AAAA,QACA,SAAW,EAAA,SAAA;AAAA,OACZ,CAAA,CAAA;AAAA,KACI,MAAA;AACL,MAAA,cAAA,CAAe,KAAK,OAAO,CAAA,CAAA;AAAA,KAC7B;AAAA,GACF;AACA,EAAO,OAAA,EAAE,eAAiB,EAAA,cAAA,EAAgB,aAA6B,EAAA,CAAA;AACzE;;;;"}
|
|
1
|
+
{"version":3,"file":"feature-utils.js","sources":["../src/feature-utils.ts"],"sourcesContent":["import type { TableSchema } from \"@vuu-ui/vuu-data-types\";\nimport type { VuuTable } from \"@vuu-ui/vuu-protocol-types\";\nimport { ListOption } from \"@vuu-ui/vuu-table-types\";\nimport { partition } from \"./array-utils\";\nimport { wordify } from \"./text-utils\";\nimport React, { ReactElement } from \"react\";\nimport { getLayoutComponent } from \"./component-registry\";\n\nexport type PathMap = {\n [key: string]: Pick<DynamicFeatureDescriptor, \"css\" | \"url\">;\n};\nexport type Environment = \"development\" | \"production\";\nexport const env = process.env.NODE_ENV as Environment;\n\nexport type LookupTableProvider = (table: VuuTable) => ListOption[];\n\nexport interface ViewConfig {\n allowRename?: boolean;\n closeable?: boolean;\n header?: boolean;\n}\n\nexport interface DynamicFeatureProps<P extends object | undefined = object> {\n /**\n props that will be passed to the lazily loaded component.\n */\n ComponentProps?: P;\n ViewProps?: ViewConfig;\n css?: string;\n height?: number;\n title?: string;\n /** \n The url of javascript bundle to lazily load. Bundle must provide a default export\n and that export must be a React component.\n */\n url: string;\n width?: number;\n}\n\ndeclare global {\n const vuuConfig: Promise<VuuConfig>;\n}\n\nexport interface DynamicFeatureDescriptor {\n name: string;\n title: string;\n url: string;\n css?: string;\n leftNavLocation: \"vuu-features\" | \"vuu-tables\";\n featureProps?: {\n schema?: \"*\" | VuuTable;\n schemas?: VuuTable[];\n };\n viewProps?: ViewConfig;\n}\n\nexport interface StaticFeatureDescriptor {\n group?: string;\n label: string;\n type: string;\n}\n\nconst isStaticFeature = (\n feature: unknown,\n): feature is StaticFeatureDescriptor =>\n feature !== null && typeof feature === \"object\" && \"type\" in feature;\n\nexport const isStaticFeatures = (\n features: unknown,\n): features is StaticFeatureDescriptor[] =>\n Array.isArray(features) && features.every(isStaticFeature);\n\nexport interface FilterTableFeatureProps {\n tableSchema: TableSchema;\n}\n\nexport type DynamicFeatures = {\n [key: string]: DynamicFeatureDescriptor;\n};\n\nexport function featureFromJson({ type }: { type: string }): ReactElement {\n const componentType = type.match(/^[a-z]/) ? type : getLayoutComponent(type);\n if (componentType === undefined) {\n throw Error(\n `layoutUtils unable to create feature component from JSON, unknown type ${type}`,\n );\n }\n return React.createElement(componentType);\n}\n\nexport interface VuuConfig {\n features: DynamicFeatures;\n authUrl?: string;\n websocketUrl: string;\n ssl: boolean;\n}\n\nexport const isCustomFeature = (feature: DynamicFeatureDescriptor) =>\n feature.leftNavLocation === \"vuu-features\";\n\nexport const isWildcardSchema = (schema?: \"*\" | VuuTable): schema is \"*\" =>\n schema === \"*\";\nexport const isTableSchema = (schema?: \"*\" | VuuTable): schema is VuuTable =>\n typeof schema === \"object\" &&\n typeof schema.module === \"string\" &&\n typeof schema.table === \"string\";\n\nexport interface FeaturePropsWithFilterTableFeature\n extends Omit<DynamicFeatureProps, \"ComponentProps\"> {\n ComponentProps: FilterTableFeatureProps;\n}\n\nexport const hasFilterTableFeatureProps = (\n props: DynamicFeatureProps,\n): props is FeaturePropsWithFilterTableFeature =>\n typeof props.ComponentProps === \"object\" &&\n props.ComponentProps !== null &&\n \"tableSchema\" in props.ComponentProps;\n\n// Sort TableScheas by module\nexport const byModule = (schema1: TableSchema, schema2: TableSchema) => {\n const m1 = schema1.table.module.toLowerCase();\n const m2 = schema2.table.module.toLowerCase();\n if (m1 < m2) {\n return -1;\n } else if (m1 > m2) {\n return 1;\n } else if (schema1.table.table < schema2.table.table) {\n return -1;\n } else if (schema1.table.table > schema2.table.table) {\n return 1;\n } else {\n return 0;\n }\n};\n\nexport type GetFeaturePaths = (params: {\n env: Environment;\n fileName: string;\n withCss?: boolean;\n}) => DynamicFeatureProps;\n\nexport const getFilterTableFeatures = (\n schemas: TableSchema[],\n getFeaturePath: GetFeaturePaths,\n) =>\n schemas\n .sort(byModule)\n .map<DynamicFeatureProps<FilterTableFeatureProps>>((schema) => ({\n ...getFeaturePath({ env, fileName: \"FilterTable\" }),\n ComponentProps: {\n tableSchema: schema,\n },\n ViewProps: {\n allowRename: true,\n },\n title: `${schema.table.module} ${schema.table.table}`,\n }));\n\nexport type Component = {\n componentName: string;\n component: unknown;\n};\n\nexport const assertComponentRegistered = (\n componentName: string,\n component: unknown,\n) => {\n if (typeof component !== \"function\") {\n console.warn(\n `${componentName} module not loaded, will be unabale to deserialize from layout JSON`,\n );\n }\n};\n\nexport const assertComponentsRegistered = (componentList: Component[]) => {\n for (const { componentName, component } of componentList) {\n assertComponentRegistered(componentName, component);\n }\n};\n\nexport const getCustomAndTableFeatures = (\n dynamicFeatures: DynamicFeatureDescriptor[],\n vuuTables: Map<string, TableSchema>,\n): {\n dynamicFeatures: DynamicFeatureProps[];\n tableFeatures: DynamicFeatureProps<FilterTableFeatureProps>[];\n} => {\n const [customFeatureConfig, tableFeaturesConfig] = partition(\n dynamicFeatures,\n isCustomFeature,\n );\n\n const customFeatures: DynamicFeatureProps[] = [];\n const tableFeatures: DynamicFeatureProps<FilterTableFeatureProps>[] = [];\n\n for (const {\n featureProps = {},\n viewProps,\n ...feature\n } of tableFeaturesConfig) {\n const { schema } = featureProps;\n if (isWildcardSchema(schema) && vuuTables) {\n for (const tableSchema of vuuTables.values()) {\n tableFeatures.push({\n ...feature,\n ComponentProps: {\n tableSchema,\n },\n title: `${tableSchema.table.module} ${wordify(\n tableSchema.table.table,\n )}`,\n ViewProps: {\n ...viewProps,\n allowRename: true,\n },\n });\n }\n } else if (isTableSchema(schema) && vuuTables) {\n const tableSchema = vuuTables.get(schema.table);\n if (tableSchema) {\n tableFeatures.push({\n ...feature,\n ComponentProps: {\n tableSchema,\n },\n ViewProps: viewProps,\n });\n }\n }\n }\n\n for (const {\n featureProps = {},\n viewProps,\n ...feature\n } of customFeatureConfig) {\n const { schema, schemas } = featureProps;\n if (isTableSchema(schema) && vuuTables) {\n const tableSchema = vuuTables.get(schema.table);\n customFeatures.push({\n ...feature,\n ComponentProps: {\n tableSchema,\n },\n ViewProps: viewProps,\n });\n } else if (Array.isArray(schemas) && vuuTables) {\n customFeatures.push({\n ...feature,\n ComponentProps: schemas.reduce<Record<string, TableSchema>>(\n (map, schema) => {\n map[`${schema.table}Schema`] = vuuTables.get(\n schema.table,\n ) as TableSchema;\n return map;\n },\n {},\n ),\n ViewProps: viewProps,\n });\n } else {\n customFeatures.push(feature);\n }\n }\n return { dynamicFeatures: customF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ACZ,CAAA,CAAA;AAAA,KACI,MAAA;AACL,MAAA,cAAA,CAAe,KAAK,OAAO,CAAA,CAAA;AAAA,KAC7B;AAAA,GACF;AACA,EAAO,OAAA,EAAE,eAAiB,EAAA,cAAA,EAAgB,aAA6B,EAAA,CAAA;AACzE;;;;"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.8.
|
|
2
|
+
"version": "0.8.91",
|
|
3
3
|
"author": "heswell",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"types": "types/index.d.ts",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@vuu-ui/vuu-data-types": "0.8.
|
|
8
|
-
"@vuu-ui/vuu-table-types": "0.8.
|
|
9
|
-
"@vuu-ui/vuu-filter-types": "0.8.
|
|
10
|
-
"@vuu-ui/vuu-protocol-types": "0.8.
|
|
7
|
+
"@vuu-ui/vuu-data-types": "0.8.91",
|
|
8
|
+
"@vuu-ui/vuu-table-types": "0.8.91",
|
|
9
|
+
"@vuu-ui/vuu-filter-types": "0.8.91",
|
|
10
|
+
"@vuu-ui/vuu-protocol-types": "0.8.91"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"@internationalized/date": "^3.0.0",
|
|
14
|
-
"@vuu-ui/vuu-filter-parser": "0.8.
|
|
14
|
+
"@vuu-ui/vuu-filter-parser": "0.8.91",
|
|
15
15
|
"clsx": "^2.0.0",
|
|
16
16
|
"react": ">=17.0.2",
|
|
17
17
|
"react-dom": ">=17.0.2"
|