@limetech/lime-elements 37.57.6 → 37.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/lime-elements.cjs.js +1 -1
  3. package/dist/cjs/limel-form.cjs.entry.js +106 -59
  4. package/dist/cjs/limel-form.cjs.entry.js.map +1 -1
  5. package/dist/cjs/limel-markdown.cjs.entry.js +4 -1
  6. package/dist/cjs/limel-markdown.cjs.entry.js.map +1 -1
  7. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{markdown-parser-38bfbd42.js → markdown-parser-23fa389f.js} +13 -2
  10. package/dist/cjs/{markdown-parser-38bfbd42.js.map → markdown-parser-23fa389f.js.map} +1 -1
  11. package/dist/collection/components/form/fields/schema-field.js +4 -0
  12. package/dist/collection/components/form/fields/schema-field.js.map +1 -1
  13. package/dist/collection/components/form/form.js +1 -1
  14. package/dist/collection/components/form/widgets/date-only-picker.js +24 -0
  15. package/dist/collection/components/form/widgets/date-only-picker.js.map +1 -0
  16. package/dist/collection/components/form/widgets/date-picker.js +15 -11
  17. package/dist/collection/components/form/widgets/date-picker.js.map +1 -1
  18. package/dist/collection/components/form/widgets/index.js +2 -1
  19. package/dist/collection/components/form/widgets/index.js.map +1 -1
  20. package/dist/collection/components/form/widgets/time-picker.js +23 -0
  21. package/dist/collection/components/form/widgets/time-picker.js.map +1 -0
  22. package/dist/collection/components/markdown/markdown-parser.js +12 -1
  23. package/dist/collection/components/markdown/markdown-parser.js.map +1 -1
  24. package/dist/collection/components/markdown/markdown.js +27 -0
  25. package/dist/collection/components/markdown/markdown.js.map +1 -1
  26. package/dist/collection/global/shared-types/custom-element.types.js +2 -0
  27. package/dist/collection/global/shared-types/custom-element.types.js.map +1 -0
  28. package/dist/collection/interface.js +1 -0
  29. package/dist/collection/interface.js.map +1 -1
  30. package/dist/esm/lime-elements.js +1 -1
  31. package/dist/esm/limel-form.entry.js +106 -59
  32. package/dist/esm/limel-form.entry.js.map +1 -1
  33. package/dist/esm/limel-markdown.entry.js +4 -1
  34. package/dist/esm/limel-markdown.entry.js.map +1 -1
  35. package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
  36. package/dist/esm/loader.js +1 -1
  37. package/dist/esm/{markdown-parser-a51f65f6.js → markdown-parser-4a4cd2c9.js} +13 -2
  38. package/dist/esm/{markdown-parser-a51f65f6.js.map → markdown-parser-4a4cd2c9.js.map} +1 -1
  39. package/dist/lime-elements/lime-elements.esm.js +1 -1
  40. package/dist/lime-elements/lime-elements.esm.js.map +1 -1
  41. package/dist/lime-elements/{p-379b68fd.js → p-31ebf375.js} +2 -2
  42. package/dist/lime-elements/p-31ebf375.js.map +1 -0
  43. package/dist/lime-elements/{p-b3b87ff5.entry.js → p-5de66206.entry.js} +5 -5
  44. package/dist/lime-elements/p-5de66206.entry.js.map +1 -0
  45. package/dist/lime-elements/{p-1bbb0dca.entry.js → p-75cfe1e5.entry.js} +2 -2
  46. package/dist/lime-elements/p-75cfe1e5.entry.js.map +1 -0
  47. package/dist/lime-elements/{p-b054f9de.entry.js → p-8da06871.entry.js} +2 -2
  48. package/dist/types/components/form/widgets/date-only-picker.d.ts +4 -0
  49. package/dist/types/components/form/widgets/time-picker.d.ts +4 -0
  50. package/dist/types/components/markdown/markdown-parser.d.ts +2 -0
  51. package/dist/types/components/markdown/markdown.d.ts +9 -0
  52. package/dist/types/components.d.ts +16 -0
  53. package/dist/types/global/shared-types/custom-element.types.d.ts +10 -0
  54. package/dist/types/interface.d.ts +1 -0
  55. package/package.json +5 -5
  56. package/dist/lime-elements/p-1bbb0dca.entry.js.map +0 -1
  57. package/dist/lime-elements/p-379b68fd.js.map +0 -1
  58. package/dist/lime-elements/p-b3b87ff5.entry.js.map +0 -1
  59. /package/dist/lime-elements/{p-b054f9de.entry.js.map → p-8da06871.entry.js.map} +0 -0
@@ -5,6 +5,7 @@ import { isEmpty, capitalize } from 'lodash-es';
5
5
  import { resetDependentFields } from './field-helpers';
6
6
  import { FieldTemplate } from '../templates';
7
7
  import { getHelpComponent } from '../help';
8
+ import { TimePicker } from '../widgets/time-picker';
8
9
  /**
9
10
  * If given a value and schema, check if the value should be translated
10
11
  * from null to undefined to avoid issues with validation
@@ -179,6 +180,9 @@ export class SchemaField extends React.Component {
179
180
  return this.renderCustomComponent(this.props);
180
181
  }
181
182
  const fieldProps = Object.assign(Object.assign({}, this.props), { onChange: this.handleChange });
183
+ if (this.props.schema.format === 'time') {
184
+ fieldProps.uiSchema = Object.assign({ 'ui:widget': TimePicker }, fieldProps.uiSchema);
185
+ }
182
186
  return React.createElement(JSONSchemaField, fieldProps);
183
187
  }
184
188
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"schema-field.js","sourceRoot":"","sources":["../../../../src/components/form/fields/schema-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,eAAe,MAAM,8CAA8C,CAAC;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAW,EAAE;EACvD,OAAO,KAAK,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAW,EAAE;;EAC3C,MAAM,IAAI,GAAG,MAAA,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AAkB,CACjE,KAAK,CAAC,MAAM,CACf,CAAC;IAEF,8BAA8B,CAAC,IAAI,CAAC,CAAC;IAErC,MAAM,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE;MACvD,IAAI,EAAE,IAAI;MACV,YAAY,kCACL,yBAAyB,GACzB,IAAI,CAAC,yBAAyB,EAAE,CACtC;MACD,MAAM,EAAE;QACJ,MAAM,EAAE,IAAI,CAAC,2BAA2B;OAC3C;KACJ,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,aAAa,CACtB,aAAa,kCAEN,IAAI,CAAC,KAAK,KACb,UAAU,EAAE,+BAA+B,KAE/C,SAAS,EACT,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CACjC,CAAC;EACN,CAAC;EAED,MAAM;IACF,IAAI,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;MACvC,OAAO,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACjD;IAED,MAAM,UAAU,mCACT,IAAI,CAAC,KAAK,KACb,QAAQ,EAAE,IAAI,CAAC,YAAY,GAC9B,CAAC;IAEF,OAAO,KAAK,CAAC,aAAa,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;EAC5D,CAAC;EAED;;;;;;;;;KASG;EACK,aAAa,CAAC,QAAgB;IAClC,IAAI,QAAQ,KAAK,SAAS,EAAE;MACxB,OAAO,SAAS,CAAC;KACpB;IAED,OAAO,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;EACpD,CAAC;CACJ","sourcesContent":["import { LimeElementsAdapter } from '../adapters';\nimport JSONSchemaField from '@rjsf/core/lib/components/fields/SchemaField';\nimport React from 'react';\nimport { FieldProps } from './types';\nimport { isEmpty, capitalize } from 'lodash-es';\nimport { resetDependentFields } from './field-helpers';\nimport { FieldTemplate } from '../templates';\nimport { getHelpComponent } from '../help';\nimport { FormSchema } from '../form.types';\n\n/**\n * If given a value and schema, check if the value should be translated\n * from null to undefined to avoid issues with validation\n *\n * This function needs to be used for several reasons:\n * 1. CustomEvent does not allow `detail` to equal `undefined`, but we can call onChange with `undefined` in React\n * 2. `null` is treated as a valid value in a jsonschema and with marshmallow and it has its own type (null)\n * 3. Without changing `null` to `undefined` there would be no way to remove a field from\n * from the submitted form data once it had any data. (when POSTing, undefined is not posted since its not valid json)\n * 4. The only applies to custom web components since widgets handle transforming null/'' to undefined depending on the widget\n * and its purpose.\n *\n * Example:\n * If I have an object `{ name?: string, email?: string }` that I am using a custom web component for `name`,\n * then initially, the formData will be `{}` which is fine because neither name or email are required. Then if i input a\n * value for name the formData will be `{ name: 'some_value' }` which is also fine. But then if I want to remove name\n * from the form data I would delete all the text from the name input field. Web components would emit this empty value\n * as '' or null. If the web component tries to emit `undefined`, null would be emitted instead because CustomEvent has\n * a default `detail` value of null\n *\n * @param value - the value associated with the schema\n * @param schema - the schema for the value\n * @returns whether or not null should be changed to undefined\n */\nconst shouldChangeToUndefined = (value, schema): boolean => {\n return value === null && !schema.type.includes('null');\n};\n\nconst hasCustomComponent = (schema): boolean => {\n const name = schema.lime?.component?.name;\n if (!name) {\n return false;\n }\n\n try {\n verifyCustomComponentIsDefined(name);\n } catch {\n // eslint-disable-next-line no-console\n console.warn(`Custom component ${name} not defined`);\n\n return false;\n }\n\n return true;\n};\n\nconst verifyCustomComponentIsDefined = (elementName): void => {\n const supportsCustomElements = 'customElements' in window;\n\n if (!supportsCustomElements) {\n throw new Error(\n 'Custom form elements are not supported by this browser!',\n );\n }\n\n if (!customElements.get(elementName)) {\n throw new Error(`Custom form element '${elementName}' is not defined!`);\n }\n};\n\nconst getCustomComponent = (\n schema,\n): { name: string; props: { [key: string]: any } } => {\n const name = schema.lime?.component?.name;\n const props = schema.lime?.component?.props || {};\n\n return { name: name, props: props };\n};\n\n/**\n * Create properties from the factory that is set on `limel-form`\n *\n * @param formContext - the form context\n * @param schema - the schema for the current field\n * @returns the properties created by the factory\n */\nexport function getFactoryProps(\n formContext: any,\n schema: FormSchema,\n): Record<string, any> {\n const factory: (schema: FormSchema) => Record<string, any> =\n formContext.propsFactory;\n if (typeof factory !== 'function') {\n return {};\n }\n\n const props = factory(schema);\n if (!props) {\n return {};\n }\n\n return props;\n}\n\nexport class SchemaField extends React.Component<FieldProps> {\n state = {\n modified: false,\n };\n\n constructor(props) {\n super(props);\n this.handleChange = this.handleChange.bind(this);\n this.handleCustomComponentChange =\n this.handleCustomComponentChange.bind(this);\n }\n\n private hasValue() {\n const value = this.getValue();\n if (!value) {\n return false;\n }\n\n if (Array.isArray(value)) {\n return !!value.length;\n }\n\n if (typeof value === 'object') {\n return !isEmpty(value);\n }\n\n return true;\n }\n\n private getLabel() {\n const { schema } = this.props;\n\n return schema.title;\n }\n\n private isInvalid() {\n const { modified } = this.state;\n const { errorSchema } = this.props;\n\n return (\n (modified || this.hasValue() || !this.isRequired()) &&\n !isEmpty(errorSchema)\n );\n }\n\n private isRequired() {\n const { required, schema } = this.props;\n\n return required || schema.minItems > 0;\n }\n\n private getHelperText() {\n const { errorSchema, schema } = this.props;\n\n if (!this.isInvalid()) {\n const helperText = schema.lime?.component?.props?.helperText;\n\n return helperText || schema.description;\n }\n\n if (!isEmpty(errorSchema) && '__errors' in errorSchema) {\n return capitalize(errorSchema.__errors[0]); // eslint-disable-line no-underscore-dangle\n }\n\n return schema.description;\n }\n\n private getValue() {\n const { formData } = this.props;\n\n return formData;\n }\n\n private handleCustomComponentChange(event) {\n const { schema } = this.props;\n event.stopPropagation();\n\n let value = event.detail;\n\n if (shouldChangeToUndefined(value, schema)) {\n value = undefined;\n }\n\n this.handleChange(value);\n }\n\n private handleChange(data) {\n const { formData, schema } = this.props;\n const { rootSchema } = this.props.registry;\n\n this.setState({ modified: true });\n\n const newData = resetDependentFields(\n formData,\n data,\n schema,\n rootSchema,\n );\n\n this.props.onChange(newData);\n }\n\n private buildCustomComponentProps() {\n const {\n disabled,\n readonly,\n name,\n registry,\n schema,\n errorSchema,\n idSchema,\n } = this.props;\n const factoryProps = getFactoryProps(registry.formContext, schema);\n\n return {\n ...factoryProps,\n value: this.getValue(),\n required: this.isRequired(),\n readonly: readonly || schema.readOnly,\n disabled: disabled,\n invalid: this.isInvalid(),\n label: this.getLabel(),\n helperText: this.getHelperText(),\n formInfo: {\n schema: schema,\n rootSchema: registry.formContext.schema,\n errorSchema: errorSchema,\n rootValue: registry.formContext.rootValue,\n name: name,\n schemaPath: this.getSchemaPath(idSchema?.$id),\n },\n };\n }\n\n private renderCustomComponent(props: FieldProps) {\n const { name, props: userDefinedComponentProps } = getCustomComponent(\n props.schema,\n );\n\n verifyCustomComponentIsDefined(name);\n\n const component = React.createElement(LimeElementsAdapter, {\n name: name,\n elementProps: {\n ...userDefinedComponentProps,\n ...this.buildCustomComponentProps(),\n },\n events: {\n change: this.handleCustomComponentChange,\n },\n });\n\n return React.createElement(\n FieldTemplate,\n {\n ...this.props,\n classNames: 'form-group field field-custom',\n },\n component,\n getHelpComponent(props.schema),\n );\n }\n\n render() {\n if (hasCustomComponent(this.props.schema)) {\n return this.renderCustomComponent(this.props);\n }\n\n const fieldProps = {\n ...this.props,\n onChange: this.handleChange,\n };\n\n return React.createElement(JSONSchemaField, fieldProps);\n }\n\n /**\n * Gets the path to the current property within the schema\n *\n * @param schemaId - the id of the schema\n * @returns an array with the schema path for the current property\n * @example\n * const schemaId = 'root_sections_0_controls_0_name';\n * const schemaPath = getSchemaPath(schemaId);\n * // ➡ ['sections', '0', 'controls', '0', 'name']\n */\n private getSchemaPath(schemaId: string): string[] {\n if (schemaId === undefined) {\n return undefined;\n }\n\n return schemaId.replace('root_', '').split('_');\n }\n}\n"]}
1
+ {"version":3,"file":"schema-field.js","sourceRoot":"","sources":["../../../../src/components/form/fields/schema-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,eAAe,MAAM,8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AK,CAAC,CAAC;KACjD;IAED,MAAM,UAAU,mCACT,IAAI,CAAC,KAAK,KACb,QAAQ,EAAE,IAAI,CAAC,YAAY,GAC9B,CAAC;IAEF,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,MAAM,EAAE;MACrC,UAAU,CAAC,QAAQ,mBACf,WAAW,EAAE,UAAU,IACpB,UAAU,CAAC,QAAQ,CACzB,CAAC;KACL;IAED,OAAO,KAAK,CAAC,aAAa,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;EAC5D,CAAC;EAED;;;;;;;;;KASG;EACK,aAAa,CAAC,QAAgB;IAClC,IAAI,QAAQ,KAAK,SAAS,EAAE;MACxB,OAAO,SAAS,CAAC;KACpB;IAED,OAAO,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;EACpD,CAAC;CACJ","sourcesContent":["import { LimeElementsAdapter } from '../adapters';\nimport JSONSchemaField from '@rjsf/core/lib/components/fields/SchemaField';\nimport React from 'react';\nimport { FieldProps } from './types';\nimport { isEmpty, capitalize } from 'lodash-es';\nimport { resetDependentFields } from './field-helpers';\nimport { FieldTemplate } from '../templates';\nimport { getHelpComponent } from '../help';\nimport { FormSchema } from '../form.types';\nimport { TimePicker } from '../widgets/time-picker';\n\n/**\n * If given a value and schema, check if the value should be translated\n * from null to undefined to avoid issues with validation\n *\n * This function needs to be used for several reasons:\n * 1. CustomEvent does not allow `detail` to equal `undefined`, but we can call onChange with `undefined` in React\n * 2. `null` is treated as a valid value in a jsonschema and with marshmallow and it has its own type (null)\n * 3. Without changing `null` to `undefined` there would be no way to remove a field from\n * from the submitted form data once it had any data. (when POSTing, undefined is not posted since its not valid json)\n * 4. The only applies to custom web components since widgets handle transforming null/'' to undefined depending on the widget\n * and its purpose.\n *\n * Example:\n * If I have an object `{ name?: string, email?: string }` that I am using a custom web component for `name`,\n * then initially, the formData will be `{}` which is fine because neither name or email are required. Then if i input a\n * value for name the formData will be `{ name: 'some_value' }` which is also fine. But then if I want to remove name\n * from the form data I would delete all the text from the name input field. Web components would emit this empty value\n * as '' or null. If the web component tries to emit `undefined`, null would be emitted instead because CustomEvent has\n * a default `detail` value of null\n *\n * @param value - the value associated with the schema\n * @param schema - the schema for the value\n * @returns whether or not null should be changed to undefined\n */\nconst shouldChangeToUndefined = (value, schema): boolean => {\n return value === null && !schema.type.includes('null');\n};\n\nconst hasCustomComponent = (schema): boolean => {\n const name = schema.lime?.component?.name;\n if (!name) {\n return false;\n }\n\n try {\n verifyCustomComponentIsDefined(name);\n } catch {\n // eslint-disable-next-line no-console\n console.warn(`Custom component ${name} not defined`);\n\n return false;\n }\n\n return true;\n};\n\nconst verifyCustomComponentIsDefined = (elementName): void => {\n const supportsCustomElements = 'customElements' in window;\n\n if (!supportsCustomElements) {\n throw new Error(\n 'Custom form elements are not supported by this browser!',\n );\n }\n\n if (!customElements.get(elementName)) {\n throw new Error(`Custom form element '${elementName}' is not defined!`);\n }\n};\n\nconst getCustomComponent = (\n schema,\n): { name: string; props: { [key: string]: any } } => {\n const name = schema.lime?.component?.name;\n const props = schema.lime?.component?.props || {};\n\n return { name: name, props: props };\n};\n\n/**\n * Create properties from the factory that is set on `limel-form`\n *\n * @param formContext - the form context\n * @param schema - the schema for the current field\n * @returns the properties created by the factory\n */\nexport function getFactoryProps(\n formContext: any,\n schema: FormSchema,\n): Record<string, any> {\n const factory: (schema: FormSchema) => Record<string, any> =\n formContext.propsFactory;\n if (typeof factory !== 'function') {\n return {};\n }\n\n const props = factory(schema);\n if (!props) {\n return {};\n }\n\n return props;\n}\n\nexport class SchemaField extends React.Component<FieldProps> {\n state = {\n modified: false,\n };\n\n constructor(props) {\n super(props);\n this.handleChange = this.handleChange.bind(this);\n this.handleCustomComponentChange =\n this.handleCustomComponentChange.bind(this);\n }\n\n private hasValue() {\n const value = this.getValue();\n if (!value) {\n return false;\n }\n\n if (Array.isArray(value)) {\n return !!value.length;\n }\n\n if (typeof value === 'object') {\n return !isEmpty(value);\n }\n\n return true;\n }\n\n private getLabel() {\n const { schema } = this.props;\n\n return schema.title;\n }\n\n private isInvalid() {\n const { modified } = this.state;\n const { errorSchema } = this.props;\n\n return (\n (modified || this.hasValue() || !this.isRequired()) &&\n !isEmpty(errorSchema)\n );\n }\n\n private isRequired() {\n const { required, schema } = this.props;\n\n return required || schema.minItems > 0;\n }\n\n private getHelperText() {\n const { errorSchema, schema } = this.props;\n\n if (!this.isInvalid()) {\n const helperText = schema.lime?.component?.props?.helperText;\n\n return helperText || schema.description;\n }\n\n if (!isEmpty(errorSchema) && '__errors' in errorSchema) {\n return capitalize(errorSchema.__errors[0]); // eslint-disable-line no-underscore-dangle\n }\n\n return schema.description;\n }\n\n private getValue() {\n const { formData } = this.props;\n\n return formData;\n }\n\n private handleCustomComponentChange(event) {\n const { schema } = this.props;\n event.stopPropagation();\n\n let value = event.detail;\n\n if (shouldChangeToUndefined(value, schema)) {\n value = undefined;\n }\n\n this.handleChange(value);\n }\n\n private handleChange(data) {\n const { formData, schema } = this.props;\n const { rootSchema } = this.props.registry;\n\n this.setState({ modified: true });\n\n const newData = resetDependentFields(\n formData,\n data,\n schema,\n rootSchema,\n );\n\n this.props.onChange(newData);\n }\n\n private buildCustomComponentProps() {\n const {\n disabled,\n readonly,\n name,\n registry,\n schema,\n errorSchema,\n idSchema,\n } = this.props;\n const factoryProps = getFactoryProps(registry.formContext, schema);\n\n return {\n ...factoryProps,\n value: this.getValue(),\n required: this.isRequired(),\n readonly: readonly || schema.readOnly,\n disabled: disabled,\n invalid: this.isInvalid(),\n label: this.getLabel(),\n helperText: this.getHelperText(),\n formInfo: {\n schema: schema,\n rootSchema: registry.formContext.schema,\n errorSchema: errorSchema,\n rootValue: registry.formContext.rootValue,\n name: name,\n schemaPath: this.getSchemaPath(idSchema?.$id),\n },\n };\n }\n\n private renderCustomComponent(props: FieldProps) {\n const { name, props: userDefinedComponentProps } = getCustomComponent(\n props.schema,\n );\n\n verifyCustomComponentIsDefined(name);\n\n const component = React.createElement(LimeElementsAdapter, {\n name: name,\n elementProps: {\n ...userDefinedComponentProps,\n ...this.buildCustomComponentProps(),\n },\n events: {\n change: this.handleCustomComponentChange,\n },\n });\n\n return React.createElement(\n FieldTemplate,\n {\n ...this.props,\n classNames: 'form-group field field-custom',\n },\n component,\n getHelpComponent(props.schema),\n );\n }\n\n render() {\n if (hasCustomComponent(this.props.schema)) {\n return this.renderCustomComponent(this.props);\n }\n\n const fieldProps = {\n ...this.props,\n onChange: this.handleChange,\n };\n\n if (this.props.schema.format === 'time') {\n fieldProps.uiSchema = {\n 'ui:widget': TimePicker,\n ...fieldProps.uiSchema,\n };\n }\n\n return React.createElement(JSONSchemaField, fieldProps);\n }\n\n /**\n * Gets the path to the current property within the schema\n *\n * @param schemaId - the id of the schema\n * @returns an array with the schema path for the current property\n * @example\n * const schemaId = 'root_sections_0_controls_0_name';\n * const schemaPath = getSchemaPath(schemaId);\n * // ➡ ['sections', '0', 'controls', '0', 'name']\n */\n private getSchemaPath(schemaId: string): string[] {\n if (schemaId === undefined) {\n return undefined;\n }\n\n return schemaId.replace('root_', '').split('_');\n }\n}\n"]}
@@ -303,7 +303,7 @@ export class Form {
303
303
  "mutable": false,
304
304
  "complexType": {
305
305
  "original": "ValidationError",
306
- "resolved": "{ [key: string]: ValidationError | string[]; }",
306
+ "resolved": "{ [key: string]: string[] | ValidationError; }",
307
307
  "references": {
308
308
  "ValidationError": {
309
309
  "location": "import",
@@ -0,0 +1,24 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s)
4
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import React from 'react';
14
+ import { DatePicker } from './date-picker';
15
+ export const DateOnlyPicker = (_a) => {
16
+ var { value } = _a, props = __rest(_a, ["value"]);
17
+ // A date-only string is treated as UTC by the Date constructor,
18
+ // but we want to parse it as local date
19
+ if (typeof value === 'string' && /-\d\d$/.test(value)) {
20
+ value += 'T00:00';
21
+ }
22
+ return React.createElement(DatePicker, Object.assign({ type: 'date', value: value }, props));
23
+ };
24
+ //# sourceMappingURL=date-only-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-only-picker.js","sourceRoot":"","sources":["../../../../src/components/form/widgets/date-only-picker.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,CAAC,MAAM,cAAc,GAAyC,CAAC,EAGpE,EAAE,EAAE;MAHgE,EACjE,KAAK,OAER,EADM,KAAK,cAFyD,SAGpE,CADW;EAER,gEAAgE;EAChE,wCAAwC;EACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;IACnD,KAAK,IAAI,QAAQ,CAAC;GACrB;EAED,OAAO,KAAK,CAAC,aAAa,CAAC,UAAU,kBACjC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,KAAK,IACT,KAAK,EACV,CAAC;AACP,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { DatePicker } from './date-picker';\nimport { WidgetProps } from './types';\n\nexport const DateOnlyPicker: React.FunctionComponent<WidgetProps> = ({\n value,\n ...props\n}) => {\n // A date-only string is treated as UTC by the Date constructor,\n // but we want to parse it as local date\n if (typeof value === 'string' && /-\\d\\d$/.test(value)) {\n value += 'T00:00';\n }\n\n return React.createElement(DatePicker, {\n type: 'date',\n value: value,\n ...props,\n });\n};\n"]}
@@ -1,3 +1,15 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s)
4
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
1
13
  import moment from 'moment/moment';
2
14
  import React from 'react';
3
15
  import { LimeElementsWidgetAdapter } from '../adapters';
@@ -11,8 +23,8 @@ export class DatePicker extends React.Component {
11
23
  this.handleChange = this.handleChange.bind(this);
12
24
  }
13
25
  render() {
14
- const props = this.props;
15
- const additionalProps = getAdditionalProps(props.schema);
26
+ var _a, _b;
27
+ const _c = this.props, { type = 'datetime' } = _c, props = __rest(_c, ["type"]);
16
28
  return React.createElement(LimeElementsWidgetAdapter, {
17
29
  name: 'limel-date-picker',
18
30
  value: this.getValue(),
@@ -20,7 +32,7 @@ export class DatePicker extends React.Component {
20
32
  change: this.handleChange,
21
33
  },
22
34
  widgetProps: props,
23
- extraProps: Object.assign({}, additionalProps),
35
+ extraProps: Object.assign({ type: type }, (_b = (_a = props.schema.lime) === null || _a === void 0 ? void 0 : _a.component) === null || _b === void 0 ? void 0 : _b.props),
24
36
  });
25
37
  }
26
38
  getValue() {
@@ -50,12 +62,4 @@ export class DatePicker extends React.Component {
50
62
  props.onChange(dateString);
51
63
  }
52
64
  }
53
- function getAdditionalProps(schema) {
54
- var _a, _b;
55
- let props = {};
56
- if ((_b = (_a = schema.lime) === null || _a === void 0 ? void 0 : _a.component) === null || _b === void 0 ? void 0 : _b.props) {
57
- props = schema.lime.component.props;
58
- }
59
- return props;
60
- }
61
65
  //# sourceMappingURL=date-picker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.js","sourceRoot":"","s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E;MACjB,OAAO;KACV;IAED,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;MACf,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;MAErB,OAAO;KACV;IAED,MAAM,aAAa,GAAG;MAClB,WAAW,EAAE,sBAAsB;MACnC,IAAI,EAAE,YAAY;MAClB,IAAI,EAAE,UAAU;KACnB,CAAC;IACF,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAC1C,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CACrC,CAAC;IACF,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;EAC/B,CAAC;CACJ;AAED,SAAS,kBAAkB,CAAC,MAAkB;;EAC1C,IAAI,KAAK,GAAQ,EAAE,CAAC;EAEpB,IAAI,MAAA,MAAA,MAAM,CAAC,IAAI,0CAAE,SAAS,0CAAE,KAAK,EAAE;IAC/B,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;GACvC;EAED,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["import moment from 'moment/moment';\nimport React from 'react';\nimport { WidgetProps } from './types';\nimport { LimeElementsWidgetAdapter } from '../adapters';\nimport { FormSchema } from '../form.types';\n\nexport class DatePicker extends React.Component {\n public refs: any;\n public state = {\n modified: false,\n };\n\n constructor(public props: WidgetProps) {\n super(props);\n this.handleChange = this.handleChange.bind(this);\n }\n\n public render() {\n const props: WidgetProps = this.props;\n const additionalProps = getAdditionalProps(props.schema);\n\n return React.createElement(LimeElementsWidgetAdapter, {\n name: 'limel-date-picker',\n value: this.getValue(),\n events: {\n change: this.handleChange,\n },\n widgetProps: props,\n extraProps: {\n ...additionalProps,\n },\n });\n }\n\n private getValue() {\n if (typeof this.props.value === 'string') {\n return new Date(this.props.value);\n } else {\n return this.props.value;\n }\n }\n\n private handleChange(event: CustomEvent<Date>) {\n const props = this.props;\n event.stopPropagation();\n\n if (!props.onChange) {\n return;\n }\n\n if (!event.detail) {\n props.onChange(null);\n\n return;\n }\n\n const formatMapping = {\n 'date-time': 'YYYY-MM-DDTHH:mm:ssZ',\n date: 'YYYY-MM-DD',\n time: 'HH:mm:ss',\n };\n const dateString = moment(event.detail).format(\n formatMapping[props.schema.format],\n );\n props.onChange(dateString);\n }\n}\n\nfunction getAdditionalProps(schema: FormSchema) {\n let props: any = {};\n\n if (schema.lime?.component?.props) {\n props = schema.lime.component.props;\n }\n\n return props;\n}\n"]}
1
+ {"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../../../../src/components/form/widgets/date-picker.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,MAAM,MAAM,eAAe,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAMxD,MAAM,OAAO,UAAW,SAAQ,KAAK,CAAC,SAA0B;EAM5D,YAAmB,KAAsB;IACrC,KAAK,CAAC,KAAK,CAAC,CAAC;IADE,UAAK,GAAL,KAAK,CAAiB;IAJlC,UAAK,GAAG;MACX,QAAQ,EAAE,KAAK;KAClB,CAAC;IAIE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EACrD,CAAC;EAEM,MAAM;;IACT,MAAM,KAAkC,IAAI,CAAC,KAAK,EAA5C,EAAE,IAAI,GAAG,UAAU,OAAyB,EAApB,KAAK,cAA7B,QAA+B,CAAa,CAAC;IAEnD,OAAO,KAAK,CAAC,aAAa,CAAC,yBAAyB,EAAE;MAClD,IAAI,EAAE,mBAAmB;MACzB,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE;MACtB,MAAM,EAAE;QACJ,MAAM,EAAE,IAAI,CAAC,YAAY;OAC5B;MACD,WAAW,EAAE,KAAK;MAClB,UAAU,kBACN,IAAI,EAAE,IAAI,IACP,MAAA,MAAA,KAAK,CAAC,MAAM,CAAC,IAAI,0CAAE,SAAS,0CAAE,KAAK,CACzC;KACJ,CAAC,CAAC;EACP,CAAC;EAEO,QAAQ;IACZ,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;MACtC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACrC;SAAM;MACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;KAC3B;EACL,CAAC;EAEO,YAAY,CAAC,KAAwB;IACzC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACzB,KAAK,CAAC,eAAe,EAAE,CAAC;IAExB,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;MACjB,OAAO;KACV;IAED,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;MACf,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;MAErB,OAAO;KACV;IAED,MAAM,aAAa,GAAG;MAClB,WAAW,EAAE,sBAAsB;MACnC,IAAI,EAAE,YAAY;MAClB,IAAI,EAAE,UAAU;KACnB,CAAC;IACF,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAC1C,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CACrC,CAAC;IACF,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;EAC/B,CAAC;CACJ","sourcesContent":["import moment from 'moment/moment';\nimport React from 'react';\nimport { DateType } from '../../date-picker/date.types';\nimport { WidgetProps } from './types';\nimport { LimeElementsWidgetAdapter } from '../adapters';\n\ntype DateWidgetProps = WidgetProps & {\n type?: DateType;\n};\n\nexport class DatePicker extends React.Component<DateWidgetProps> {\n public refs: any;\n public state = {\n modified: false,\n };\n\n constructor(public props: DateWidgetProps) {\n super(props);\n this.handleChange = this.handleChange.bind(this);\n }\n\n public render() {\n const { type = 'datetime', ...props } = this.props;\n\n return React.createElement(LimeElementsWidgetAdapter, {\n name: 'limel-date-picker',\n value: this.getValue(),\n events: {\n change: this.handleChange,\n },\n widgetProps: props,\n extraProps: {\n type: type,\n ...props.schema.lime?.component?.props,\n },\n });\n }\n\n private getValue() {\n if (typeof this.props.value === 'string') {\n return new Date(this.props.value);\n } else {\n return this.props.value;\n }\n }\n\n private handleChange(event: CustomEvent<Date>) {\n const props = this.props;\n event.stopPropagation();\n\n if (!props.onChange) {\n return;\n }\n\n if (!event.detail) {\n props.onChange(null);\n\n return;\n }\n\n const formatMapping = {\n 'date-time': 'YYYY-MM-DDTHH:mm:ssZ',\n date: 'YYYY-MM-DD',\n time: 'HH:mm:ss',\n };\n const dateString = moment(event.detail).format(\n formatMapping[props.schema.format],\n );\n props.onChange(dateString);\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { Checkbox } from './checkbox';
2
+ import { DateOnlyPicker } from './date-only-picker';
2
3
  import { DatePicker } from './date-picker';
3
4
  import { InputField } from './input-field';
4
5
  import { Select } from './select';
@@ -6,7 +7,7 @@ import { Slider } from './slider';
6
7
  export const widgets = {
7
8
  CheckboxWidget: Checkbox,
8
9
  DateTimeWidget: DatePicker,
9
- DateWidget: DatePicker,
10
+ DateWidget: DateOnlyPicker,
10
11
  EmailWidget: InputField,
11
12
  TextWidget: InputField,
12
13
  SelectWidget: Select,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/form/widgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAuBlC,MAAM,CAAC,MAAM,OAAO,GAAqC;EACrD,cAAc,EAAE,QAAQ;EACxB,cAAc,EAAE,UAAU;EAC1B,UAAU,EAAE,UAAU;EACtB,WAAW,EAAE,UAAU;EACvB,UAAU,EAAE,UAAU;EACtB,YAAY,EAAE,MAAM;EACpB,WAAW,EAAE,MAAM;CACtB,CAAC","sourcesContent":["import { Checkbox } from './checkbox';\nimport { DatePicker } from './date-picker';\nimport { InputField } from './input-field';\nimport { Select } from './select';\nimport { Slider } from './slider';\n\n// These are defined by react-json-schema-form\nexport type WidgetType =\n | 'AltDateTimeWidget'\n | 'AltDateWidget'\n | 'CheckboxesWidget'\n | 'CheckboxWidget'\n | 'ColorWidget'\n | 'DateTimeWidget'\n | 'DateWidget'\n | 'EmailWidget'\n | 'FileWidget'\n | 'HiddenWidget'\n | 'PasswordWidget'\n | 'RadioWidget'\n | 'RangeWidget'\n | 'SelectWidget'\n | 'TextareaWidget'\n | 'TextWidget'\n | 'UpDownWidget'\n | 'URLWidget';\n\nexport const widgets: Partial<Record<WidgetType, any>> = {\n CheckboxWidget: Checkbox,\n DateTimeWidget: DatePicker,\n DateWidget: DatePicker,\n EmailWidget: InputField,\n TextWidget: InputField,\n SelectWidget: Select,\n RangeWidget: Slider,\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/form/widgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAuBlC,MAAM,CAAC,MAAM,OAAO,GAAqC;EACrD,cAAc,EAAE,QAAQ;EACxB,cAAc,EAAE,UAAU;EAC1B,UAAU,EAAE,cAAc;EAC1B,WAAW,EAAE,UAAU;EACvB,UAAU,EAAE,UAAU;EACtB,YAAY,EAAE,MAAM;EACpB,WAAW,EAAE,MAAM;CACtB,CAAC","sourcesContent":["import { Checkbox } from './checkbox';\nimport { DateOnlyPicker } from './date-only-picker';\nimport { DatePicker } from './date-picker';\nimport { InputField } from './input-field';\nimport { Select } from './select';\nimport { Slider } from './slider';\n\n// These are defined by react-json-schema-form\nexport type WidgetType =\n | 'AltDateTimeWidget'\n | 'AltDateWidget'\n | 'CheckboxesWidget'\n | 'CheckboxWidget'\n | 'ColorWidget'\n | 'DateTimeWidget'\n | 'DateWidget'\n | 'EmailWidget'\n | 'FileWidget'\n | 'HiddenWidget'\n | 'PasswordWidget'\n | 'RadioWidget'\n | 'RangeWidget'\n | 'SelectWidget'\n | 'TextareaWidget'\n | 'TextWidget'\n | 'UpDownWidget'\n | 'URLWidget';\n\nexport const widgets: Partial<Record<WidgetType, any>> = {\n CheckboxWidget: Checkbox,\n DateTimeWidget: DatePicker,\n DateWidget: DateOnlyPicker,\n EmailWidget: InputField,\n TextWidget: InputField,\n SelectWidget: Select,\n RangeWidget: Slider,\n};\n"]}
@@ -0,0 +1,23 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s)
4
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import React from 'react';
14
+ import { DatePicker } from './date-picker';
15
+ export const TimePicker = (_a) => {
16
+ var { value } = _a, props = __rest(_a, ["value"]);
17
+ if (typeof value === 'string' && timeStringPattern.test(value)) {
18
+ value = new Date('2000-01-01T' + value);
19
+ }
20
+ return React.createElement(DatePicker, Object.assign({ type: 'time', value: value }, props));
21
+ };
22
+ const timeStringPattern = /^\d\d:\d\d/;
23
+ //# sourceMappingURL=time-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time-picker.js","sourceRoot":"","sources":["../../../../src/components/form/widgets/time-picker.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,CAAC,MAAM,UAAU,GAAyC,CAAC,EAGhE,EAAE,EAAE;MAH4D,EAC7D,KAAK,OAER,EADM,KAAK,cAFqD,SAGhE,CADW;EAER,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;IAC5D,KAAK,GAAG,IAAI,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;GAC3C;EAED,OAAO,KAAK,CAAC,aAAa,CAAC,UAAU,kBACjC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,KAAK,IACT,KAAK,EACV,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,YAAY,CAAC","sourcesContent":["import React from 'react';\nimport { DatePicker } from './date-picker';\nimport { WidgetProps } from './types';\n\nexport const TimePicker: React.FunctionComponent<WidgetProps> = ({\n value,\n ...props\n}) => {\n if (typeof value === 'string' && timeStringPattern.test(value)) {\n value = new Date('2000-01-01T' + value);\n }\n\n return React.createElement(DatePicker, {\n type: 'time',\n value: value,\n ...props,\n });\n};\n\nconst timeStringPattern = /^\\d\\d:\\d\\d/;\n"]}
@@ -23,6 +23,7 @@ import { sanitizeStyle } from './sanitize-style';
23
23
  * @returns The resulting HTML.
24
24
  */
25
25
  export async function markdownToHTML(text, options) {
26
+ var _a;
26
27
  if (options === null || options === void 0 ? void 0 : options.forceHardLineBreaks) {
27
28
  text = text.replace(/(?<!\\)([\n\r])/g, ' $1');
28
29
  }
@@ -32,7 +33,7 @@ export async function markdownToHTML(text, options) {
32
33
  .use(remarkRehype, { allowDangerousHtml: true })
33
34
  .use(rehypeExternalLinks, { target: '_blank' })
34
35
  .use(rehypeRaw)
35
- .use(rehypeSanitize, Object.assign(Object.assign({}, defaultSchema), { attributes: Object.assign(Object.assign({}, defaultSchema.attributes), { p: [['className', 'MsoNormal']], '*': ['style', 'width'] }) }))
36
+ .use(rehypeSanitize, Object.assign({}, getWhiteList((_a = options === null || options === void 0 ? void 0 : options.whitelist) !== null && _a !== void 0 ? _a : [])))
36
37
  .use(() => {
37
38
  return (tree) => {
38
39
  // Run the sanitizeStyle function on all elements, to sanitize
@@ -44,4 +45,14 @@ export async function markdownToHTML(text, options) {
44
45
  .process(text);
45
46
  return file.toString();
46
47
  }
48
+ function getWhiteList(allowedComponents) {
49
+ const whitelist = Object.assign(Object.assign({}, defaultSchema), { tagNames: [
50
+ ...(defaultSchema.tagNames || []),
51
+ ...allowedComponents.map((component) => component.tagName),
52
+ ], attributes: Object.assign(Object.assign({}, defaultSchema.attributes), { p: [['className', 'MsoNormal']], '*': ['style', 'width'] }) });
53
+ for (const component of allowedComponents) {
54
+ whitelist.attributes[component.tagName] = component.attributes;
55
+ }
56
+ return whitelist;
57
+ }
47
58
  //# sourceMappingURL=markdown-parser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-parser.js","sourceRoot":"","sources":["../../../src/components/markdown/markdown-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,cAAc,EAAE,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAC/C,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAChC,IAAY,EACZ,OAA+B;EAE/B,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,mBAAmB,EAAE;IAC9B,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;GACnD;EAED,MAAM,IAAI,GAAG,MAAM,OAAO,EAAE;KACvB,GAAG,CAAC,WAAW,CAAC;KAChB,GAAG,CAAC,SAAS,CAAC;KACd,GAAG,CAAC,YAAY,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;KAC/C,GAAG,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;KAC9C,GAAG,CAAC,SAAS,CAAC;KACd,GAAG,CAAC,cAAc,kCACZ,aAAa,KAChB,UAAU,kCACH,aAAa,CAAC,UAAU,KAC3B,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,EAC/B,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,OAE7B;KACD,GAAG,CAAC,GAAG,EAAE;IACN,OAAO,CAAC,IAAU,EAAE,EAAE;MAClB,8DAA8D;MAC9D,uDAAuD;MACvD,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;IAC1C,CAAC,CAAC;EACN,CAAC,CAAC;KACD,GAAG,CAAC,eAAe,CAAC;KACpB,OAAO,CAAC,IAAI,CAAC,CAAC;EAEnB,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["import { unified } from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkRehype from 'remark-rehype';\nimport remarkGfm from 'remark-gfm';\nimport rehypeExternalLinks from 'rehype-external-links';\nimport rehypeSanitize, { defaultSchema } from 'rehype-sanitize';\nimport rehypeStringify from 'rehype-stringify';\nimport rehypeRaw from 'rehype-raw';\nimport { visit } from 'unist-util-visit';\nimport { sanitizeStyle } from './sanitize-style';\nimport { Node } from 'unist';\n\n/**\n * Takes a string as input and returns a new string\n * where the text has been converted to HTML.\n *\n * If the text is formatted with .md markdown, it will\n * be transformed to HTML.\n *\n * If the text already is in HTML it will be sanitized and\n * \"dangerous\" tags such as <script> will be removed.\n *\n * @param text - The string to convert.\n * @param options - Options for the conversions.\n * @returns The resulting HTML.\n */\nexport async function markdownToHTML(\n text: string,\n options?: markdownToHTMLOptions,\n): Promise<string> {\n if (options?.forceHardLineBreaks) {\n text = text.replace(/(?<!\\\\)([\\n\\r])/g, ' $1');\n }\n\n const file = await unified()\n .use(remarkParse)\n .use(remarkGfm)\n .use(remarkRehype, { allowDangerousHtml: true })\n .use(rehypeExternalLinks, { target: '_blank' })\n .use(rehypeRaw)\n .use(rehypeSanitize, {\n ...defaultSchema,\n attributes: {\n ...defaultSchema.attributes,\n p: [['className', 'MsoNormal']], // Allow the class 'MsoNormal' on <p> elements\n '*': ['style', 'width'], // Allow `style` and 'width' attribute on all elements\n },\n })\n .use(() => {\n return (tree: Node) => {\n // Run the sanitizeStyle function on all elements, to sanitize\n // the value of the `style` attribute, if there is one.\n visit(tree, 'element', sanitizeStyle);\n };\n })\n .use(rehypeStringify)\n .process(text);\n\n return file.toString();\n}\n\n/**\n * Options for markdownToHTML.\n */\nexport interface markdownToHTMLOptions {\n /**\n * Set to `true` to convert all soft line breaks to hard line breaks.\n */\n forceHardLineBreaks?: boolean;\n}\n"]}
1
+ {"version":3,"file":"markdown-parser.js","sourceRoot":"","sources":["../../../src/components/markdown/markdown-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,SAA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CAAC;AAED,SAAS,YAAY,CAAC,iBAAkC;EACpD,MAAM,SAAS,mCACR,aAAa,KAChB,QAAQ,EAAE;MACN,GAAG,CAAC,aAAa,CAAC,QAAQ,IAAI,EAAE,CAAC;MACjC,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;KAC7D,EACD,UAAU,kCACH,aAAa,CAAC,UAAU,KAC3B,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,EAC/B,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,MAE9B,CAAC;EAEF,KAAK,MAAM,SAAS,IAAI,iBAAiB,EAAE;IACvC,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC;GAClE;EAED,OAAO,SAAS,CAAC;AACrB,CAAC","sourcesContent":["import { unified } from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkRehype from 'remark-rehype';\nimport remarkGfm from 'remark-gfm';\nimport rehypeExternalLinks from 'rehype-external-links';\nimport rehypeSanitize, { defaultSchema } from 'rehype-sanitize';\nimport rehypeStringify from 'rehype-stringify';\nimport rehypeRaw from 'rehype-raw';\nimport { visit } from 'unist-util-visit';\nimport { sanitizeStyle } from './sanitize-style';\nimport { Node } from 'unist';\nimport { Schema } from 'rehype-sanitize/lib';\nimport { CustomElement } from '../../global/shared-types/custom-element.types';\n\n/**\n * Takes a string as input and returns a new string\n * where the text has been converted to HTML.\n *\n * If the text is formatted with .md markdown, it will\n * be transformed to HTML.\n *\n * If the text already is in HTML it will be sanitized and\n * \"dangerous\" tags such as <script> will be removed.\n *\n * @param text - The string to convert.\n * @param options - Options for the conversions.\n * @returns The resulting HTML.\n */\nexport async function markdownToHTML(\n text: string,\n options?: markdownToHTMLOptions,\n): Promise<string> {\n if (options?.forceHardLineBreaks) {\n text = text.replace(/(?<!\\\\)([\\n\\r])/g, ' $1');\n }\n\n const file = await unified()\n .use(remarkParse)\n .use(remarkGfm)\n .use(remarkRehype, { allowDangerousHtml: true })\n .use(rehypeExternalLinks, { target: '_blank' })\n .use(rehypeRaw)\n .use(rehypeSanitize, {\n ...getWhiteList(options?.whitelist ?? []),\n })\n .use(() => {\n return (tree: Node) => {\n // Run the sanitizeStyle function on all elements, to sanitize\n // the value of the `style` attribute, if there is one.\n visit(tree, 'element', sanitizeStyle);\n };\n })\n .use(rehypeStringify)\n .process(text);\n\n return file.toString();\n}\n\nfunction getWhiteList(allowedComponents: CustomElement[]): Schema {\n const whitelist: Schema = {\n ...defaultSchema,\n tagNames: [\n ...(defaultSchema.tagNames || []),\n ...allowedComponents.map((component) => component.tagName),\n ],\n attributes: {\n ...defaultSchema.attributes,\n p: [['className', 'MsoNormal']], // Allow the class 'MsoNormal' on <p> elements\n '*': ['style', 'width'], // Allow `style` and 'width' attribute on all elements\n },\n };\n\n for (const component of allowedComponents) {\n whitelist.attributes[component.tagName] = component.attributes;\n }\n\n return whitelist;\n}\n\n/**\n * Options for markdownToHTML.\n */\nexport interface markdownToHTMLOptions {\n /**\n * Set to `true` to convert all soft line breaks to hard line breaks.\n */\n forceHardLineBreaks?: boolean;\n whitelist?: CustomElement[];\n}\n"]}
@@ -16,15 +16,19 @@ import { markdownToHTML } from './markdown-parser';
16
16
  * @exampleComponent limel-example-markdown-blockquotes
17
17
  * @exampleComponent limel-example-markdown-horizontal-rule
18
18
  * @exampleComponent limel-example-markdown-composite
19
+ * @exampleComponent limel-example-markdown-custom-component
19
20
  */
20
21
  export class Markdown {
21
22
  constructor() {
22
23
  this.value = undefined;
24
+ this.whitelist = undefined;
23
25
  }
24
26
  async textChanged() {
27
+ var _a;
25
28
  try {
26
29
  const html = await markdownToHTML(this.value, {
27
30
  forceHardLineBreaks: true,
31
+ whitelist: (_a = this.whitelist) !== null && _a !== void 0 ? _a : [],
28
32
  });
29
33
  this.rootElement.innerHTML = html;
30
34
  }
@@ -71,6 +75,29 @@ export class Markdown {
71
75
  },
72
76
  "attribute": "value",
73
77
  "reflect": false
78
+ },
79
+ "whitelist": {
80
+ "type": "unknown",
81
+ "mutable": false,
82
+ "complexType": {
83
+ "original": "CustomElement[]",
84
+ "resolved": "CustomElement[]",
85
+ "references": {
86
+ "CustomElement": {
87
+ "location": "import",
88
+ "path": "../../global/shared-types/custom-element.types"
89
+ }
90
+ }
91
+ },
92
+ "required": false,
93
+ "optional": true,
94
+ "docs": {
95
+ "tags": [{
96
+ "name": "alpha",
97
+ "text": undefined
98
+ }],
99
+ "text": "Whitelisted html elements.\n\nAny custom element added here will not be sanitized and thus rendered."
100
+ }
74
101
  }
75
102
  };
76
103
  }
@@ -1 +1 @@
1
- {"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../../src/components/markdown/markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;;;;;;;;;;GAgBG;AAMH,MAAM,OAAO,QAAQ;;;;EAUV,KAAK,CAAC,WAAW;IACpB,IAAI;MACA,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE;QAC1C,mBAAmB,EAAE,IAAI;OAC5B,CAAC,CAAC;MACH,IAAI,CAAC,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC;KACrC;IAAC,OAAO,KAAK,EAAE;MACZ,sCAAsC;MACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACxB;EACL,CAAC;EAEM,KAAK,CAAC,gBAAgB;IACzB,IAAI,CAAC,WAAW,EAAE,CAAC;EACvB,CAAC;EAIM,MAAM;IACT,OAAO;MACH,WACI,EAAE,EAAC,UAAU,EACb,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,EAAoB,CAAC,GACxD;KACL,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop, Watch } from '@stencil/core';\nimport { markdownToHTML } from './markdown-parser';\n\n/**\n * The Markdown component receives markdown syntax\n * and renders it as HTML.\n *\n * @exampleComponent limel-example-markdown-headings\n * @exampleComponent limel-example-markdown-emphasis\n * @exampleComponent limel-example-markdown-lists\n * @exampleComponent limel-example-markdown-links\n * @exampleComponent limel-example-markdown-images\n * @exampleComponent limel-example-markdown-code\n * @exampleComponent limel-example-markdown-footnotes\n * @exampleComponent limel-example-markdown-tables\n * @exampleComponent limel-example-markdown-html\n * @exampleComponent limel-example-markdown-blockquotes\n * @exampleComponent limel-example-markdown-horizontal-rule\n * @exampleComponent limel-example-markdown-composite\n */\n@Component({\n tag: 'limel-markdown',\n styleUrl: 'markdown.scss',\n shadow: true,\n})\nexport class Markdown {\n /**\n * The input text. Treated as GitHub Flavored Markdown, with the addition\n * that any included HTML will be parsed and rendered as HTML, rather than\n * as text.\n */\n @Prop()\n public value: string;\n\n @Watch('value')\n public async textChanged() {\n try {\n const html = await markdownToHTML(this.value, {\n forceHardLineBreaks: true,\n });\n this.rootElement.innerHTML = html;\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n }\n\n public async componentDidLoad() {\n this.textChanged();\n }\n\n private rootElement: HTMLDivElement;\n\n public render() {\n return [\n <div\n id=\"markdown\"\n ref={(el) => (this.rootElement = el as HTMLDivElement)}\n />,\n ];\n }\n}\n"]}
1
+ {"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../../src/components/markdown/markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD;;;;;;;;;;;;;;;;;GAiBG;AAMH,MAAM,OAAO,QAAQ;;;;;EAmBV,KAAK,CAAC,WAAW;;IACpB,IAAI;MACA,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE;QAC1C,mBAAmB,EAAE,IAAI;QACzB,SAAS,EAAE,MAAA,IAAI,CAAC,SAAS,mCAAI,EAAE;OAClC,CAAC,CAAC;MACH,IAAI,CAAC,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC;KACrC;IAAC,OAAO,KAAK,EAAE;MACZ,sCAAsC;MACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACxB;EACL,CAAC;EAEM,KAAK,CAAC,gBAAgB;IACzB,IAAI,CAAC,WAAW,EAAE,CAAC;EACvB,CAAC;EAIM,MAAM;IACT,OAAO;MACH,WACI,EAAE,EAAC,UAAU,EACb,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,EAAoB,CAAC,GACxD;KACL,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop, Watch } from '@stencil/core';\nimport { markdownToHTML } from './markdown-parser';\nimport { CustomElement } from '../../global/shared-types/custom-element.types';\n\n/**\n * The Markdown component receives markdown syntax\n * and renders it as HTML.\n *\n * @exampleComponent limel-example-markdown-headings\n * @exampleComponent limel-example-markdown-emphasis\n * @exampleComponent limel-example-markdown-lists\n * @exampleComponent limel-example-markdown-links\n * @exampleComponent limel-example-markdown-images\n * @exampleComponent limel-example-markdown-code\n * @exampleComponent limel-example-markdown-footnotes\n * @exampleComponent limel-example-markdown-tables\n * @exampleComponent limel-example-markdown-html\n * @exampleComponent limel-example-markdown-blockquotes\n * @exampleComponent limel-example-markdown-horizontal-rule\n * @exampleComponent limel-example-markdown-composite\n * @exampleComponent limel-example-markdown-custom-component\n */\n@Component({\n tag: 'limel-markdown',\n styleUrl: 'markdown.scss',\n shadow: true,\n})\nexport class Markdown {\n /**\n * The input text. Treated as GitHub Flavored Markdown, with the addition\n * that any included HTML will be parsed and rendered as HTML, rather than\n * as text.\n */\n @Prop()\n public value: string;\n\n /**\n * Whitelisted html elements.\n *\n * Any custom element added here will not be sanitized and thus rendered.\n * @alpha\n */\n @Prop()\n public whitelist?: CustomElement[];\n\n @Watch('value')\n public async textChanged() {\n try {\n const html = await markdownToHTML(this.value, {\n forceHardLineBreaks: true,\n whitelist: this.whitelist ?? [],\n });\n this.rootElement.innerHTML = html;\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n }\n\n public async componentDidLoad() {\n this.textChanged();\n }\n\n private rootElement: HTMLDivElement;\n\n public render() {\n return [\n <div\n id=\"markdown\"\n ref={(el) => (this.rootElement = el as HTMLDivElement)}\n />,\n ];\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=custom-element.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-element.types.js","sourceRoot":"","sources":["../../../src/global/shared-types/custom-element.types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Custom Element\n *\n * @alpha\n */\nexport interface CustomElement {\n tagName: string;\n attributes: string[];\n}\n"]}
@@ -11,6 +11,7 @@ export * from './components/dialog/dialog.types';
11
11
  export * from './components/dock/dock.types';
12
12
  export * from './global/shared-types/file.types';
13
13
  export * from './components/flex-container/flex-container.types';
14
+ export * from './global/shared-types/custom-element.types';
14
15
  export { FormLayoutType, } from './components/form/form.types';
15
16
  export * from './components/help/help.types';
16
17
  export * from './components/icon/icon.types';
@@ -1 +1 @@
1
- {"version":3,"file":"interface.js","sourceRoot":"","sources":["../src/interface.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wDAAwD,CAAC;AACvE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kDAAkD,CAAC;AACjE,OAAO,EAaH,cAAc,GAIjB,MAAM,8BAA8B,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,4CAA4C,CAAC;AAK3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './components/action-bar/action-bar.types';\nexport * from './components/breadcrumbs/breadcrumbs.types';\nexport * from './components/button/button.types';\nexport * from './components/callout/callout.types';\nexport * from './components/chip-set/chip.types';\nexport * from './components/circular-progress/circular-progress.types';\nexport * from './components/code-editor/code-editor.types';\nexport * from './components/collapsible-section/action';\nexport * from './components/date-picker/date.types';\nexport * from './components/dialog/dialog.types';\nexport * from './components/dock/dock.types';\nexport * from './global/shared-types/file.types';\nexport * from './components/flex-container/flex-container.types';\nexport {\n EventEmitter,\n ValidationStatus,\n FormError,\n ValidationError,\n FormComponent,\n FormInfo,\n LimeSchemaOptions,\n LimeLayoutOptions,\n FormComponentOptions,\n FormLayoutOptions,\n GridLayoutOptions,\n RowLayoutOptions,\n FormLayoutType,\n ReplaceObjectType,\n FormSchemaArrayItem,\n FormSubKeySchema,\n} from './components/form/form.types';\nexport * from './components/help/help.types';\nexport * from './components/icon/icon.types';\nexport * from './components/info-tile/info-tile.types';\nexport * from './components/input-field/input-field.types';\nexport {\n ListComponent,\n ListSeparator,\n} from './components/list/list-item.types';\nexport * from './components/dynamic-label/label.types';\nexport * from './components/list/list.types';\nexport * from './components/menu/menu.types';\nexport * from './components/menu-list/menu-list.types';\nexport * from './components/picker/actions.types';\nexport * from './components/picker/searcher.types';\nexport * from './components/progress-flow/progress-flow.types';\nexport * from './components/select/option.types';\nexport * from './components/spinner/spinner.types';\nexport * from './components/tab-panel/tab-panel.types';\nexport * from './components/table/table.types';\nexport * from './global/shared-types/separator.types';\nexport * from './global/shared-types/icon.types';\nexport * from './global/shared-types/image.types';\n"]}
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["../src/interface.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wDAAwD,CAAC;AACvE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kDAAkD,CAAC;AACjE,cAAc,4CAA4C,CAAC;AAC3D,OAAO,EAaH,cAAc,GAIjB,MAAM,8BAA8B,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,4CAA4C,CAAC;AAK3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './components/action-bar/action-bar.types';\nexport * from './components/breadcrumbs/breadcrumbs.types';\nexport * from './components/button/button.types';\nexport * from './components/callout/callout.types';\nexport * from './components/chip-set/chip.types';\nexport * from './components/circular-progress/circular-progress.types';\nexport * from './components/code-editor/code-editor.types';\nexport * from './components/collapsible-section/action';\nexport * from './components/date-picker/date.types';\nexport * from './components/dialog/dialog.types';\nexport * from './components/dock/dock.types';\nexport * from './global/shared-types/file.types';\nexport * from './components/flex-container/flex-container.types';\nexport * from './global/shared-types/custom-element.types';\nexport {\n EventEmitter,\n ValidationStatus,\n FormError,\n ValidationError,\n FormComponent,\n FormInfo,\n LimeSchemaOptions,\n LimeLayoutOptions,\n FormComponentOptions,\n FormLayoutOptions,\n GridLayoutOptions,\n RowLayoutOptions,\n FormLayoutType,\n ReplaceObjectType,\n FormSchemaArrayItem,\n FormSubKeySchema,\n} from './components/form/form.types';\nexport * from './components/help/help.types';\nexport * from './components/icon/icon.types';\nexport * from './components/info-tile/info-tile.types';\nexport * from './components/input-field/input-field.types';\nexport {\n ListComponent,\n ListSeparator,\n} from './components/list/list-item.types';\nexport * from './components/dynamic-label/label.types';\nexport * from './components/list/list.types';\nexport * from './components/menu/menu.types';\nexport * from './components/menu-list/menu-list.types';\nexport * from './components/picker/actions.types';\nexport * from './components/picker/searcher.types';\nexport * from './components/progress-flow/progress-flow.types';\nexport * from './components/select/option.types';\nexport * from './components/spinner/spinner.types';\nexport * from './components/tab-panel/tab-panel.types';\nexport * from './components/table/table.types';\nexport * from './global/shared-types/separator.types';\nexport * from './global/shared-types/icon.types';\nexport * from './global/shared-types/image.types';\n"]}
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return bootstrapLazy(JSON.parse("[[\"limel-text-editor\",[[1,\"limel-text-editor\",{\"contentType\":[1,\"content-type\"],\"language\":[513],\"disabled\":[516],\"readonly\":[516],\"helperText\":[513,\"helper-text\"],\"placeholder\":[513],\"label\":[513],\"invalid\":[516],\"value\":[513],\"required\":[516],\"allowResize\":[516,\"allow-resize\"],\"ui\":[513]}]]],[\"limel-file\",[[1,\"limel-file\",{\"value\":[16],\"label\":[513],\"required\":[516],\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"accept\":[513],\"language\":[1]}]]],[\"limel-picker\",[[1,\"limel-picker\",{\"disabled\":[4],\"readonly\":[516],\"label\":[1],\"searchLabel\":[1,\"search-label\"],\"helperText\":[513,\"helper-text\"],\"leadingIcon\":[1,\"leading-icon\"],\"emptyResultMessage\":[1,\"empty-result-message\"],\"required\":[4],\"invalid\":[516],\"value\":[16],\"searcher\":[16],\"multiple\":[4],\"delimiter\":[513],\"actions\":[16],\"actionPosition\":[1,\"action-position\"],\"actionScrollBehavior\":[1,\"action-scroll-behavior\"],\"badgeIcons\":[516,\"badge-icons\"],\"items\":[32],\"textValue\":[32],\"loading\":[32],\"chips\":[32]}]]],[\"limel-split-button\",[[17,\"limel-split-button\",{\"label\":[513],\"primary\":[516],\"icon\":[513],\"disabled\":[516],\"loading\":[516],\"loadingFailed\":[516,\"loading-failed\"],\"items\":[16]}]]],[\"limel-file-viewer\",[[1,\"limel-file-viewer\",{\"url\":[513],\"filename\":[513],\"alt\":[513],\"allowFullscreen\":[516,\"allow-fullscreen\"],\"allowOpenInNewTab\":[516,\"allow-open-in-new-tab\"],\"allowDownload\":[516,\"allow-download\"],\"language\":[1],\"officeViewer\":[513,\"office-viewer\"],\"actions\":[16],\"isFullscreen\":[32],\"fileType\":[32],\"loading\":[32],\"fileUrl\":[32]}]]],[\"limel-color-picker\",[[1,\"limel-color-picker\",{\"value\":[513],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"tooltipLabel\":[513,\"tooltip-label\"],\"required\":[516],\"readonly\":[516],\"isOpen\":[32]}]]],[\"limel-date-picker\",[[1,\"limel-date-picker\",{\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"label\":[513],\"placeholder\":[513],\"helperText\":[513,\"helper-text\"],\"required\":[516],\"value\":[16],\"type\":[513],\"format\":[513],\"language\":[513],\"formatter\":[16],\"internalFormat\":[32],\"showPortal\":[32]}]]],[\"limel-dock\",[[1,\"limel-dock\",{\"dockItems\":[16],\"dockFooterItems\":[16],\"accessibleLabel\":[513,\"accessible-label\"],\"expanded\":[516],\"allowResize\":[516,\"allow-resize\"],\"mobileBreakPoint\":[514,\"mobile-break-point\"],\"useMobileLayout\":[32]}]]],[\"limel-snackbar\",[[1,\"limel-snackbar\",{\"open\":[516],\"message\":[1],\"timeout\":[514],\"actionText\":[1,\"action-text\"],\"dismissible\":[4],\"multiline\":[4],\"language\":[1],\"offset\":[32],\"isOpen\":[32],\"closing\":[32],\"show\":[64]},[[0,\"changeOffset\",\"onChangeIndex\"]]]]],[\"limel-tab-panel\",[[1,\"limel-tab-panel\",{\"tabs\":[1040]}]]],[\"limel-select\",[[1,\"limel-select\",{\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"required\":[516],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"value\":[16],\"options\":[16],\"multiple\":[4],\"menuOpen\":[32]}]]],[\"limel-button-group\",[[1,\"limel-button-group\",{\"value\":[16],\"disabled\":[516],\"selectedButtonId\":[32]}]]],[\"limel-collapsible-section\",[[1,\"limel-collapsible-section\",{\"isOpen\":[1540,\"is-open\"],\"header\":[513],\"actions\":[16]}]]],[\"limel-help\",[[1,\"limel-help\",{\"value\":[1],\"trigger\":[1],\"readMoreLink\":[16],\"openDirection\":[513,\"open-direction\"],\"isOpen\":[32]}]]],[\"limel-dynamic-label_4\",[[17,\"limel-list\",{\"items\":[16],\"badgeIcons\":[4,\"badge-icons\"],\"iconSize\":[1,\"icon-size\"],\"type\":[1],\"maxLinesSecondaryText\":[2,\"max-lines-secondary-text\"]}],[1,\"limel-menu-surface\",{\"open\":[4],\"allowClicksElement\":[16]}],[1,\"limel-dynamic-label\",{\"value\":[8],\"defaultLabel\":[16],\"labels\":[16]}],[1,\"limel-helper-line\",{\"helperText\":[513,\"helper-text\"],\"length\":[514],\"maxLength\":[514,\"max-length\"],\"invalid\":[516],\"helperTextId\":[513,\"helper-text-id\"]}]]],[\"limel-checkbox\",[[1,\"limel-checkbox\",{\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"checked\":[516],\"indeterminate\":[516],\"required\":[516],\"readonlyLabels\":[16],\"modified\":[32]}]]],[\"limel-table\",[[1,\"limel-table\",{\"data\":[16],\"columns\":[16],\"mode\":[1],\"layout\":[1],\"pageSize\":[2,\"page-size\"],\"totalRows\":[2,\"total-rows\"],\"sorting\":[16],\"activeRow\":[1040],\"movableColumns\":[4,\"movable-columns\"],\"loading\":[4],\"page\":[2],\"emptyMessage\":[1,\"empty-message\"],\"aggregates\":[16],\"selectable\":[4],\"selection\":[16]}]]],[\"limel-info-tile\",[[1,\"limel-info-tile\",{\"value\":[520],\"icon\":[1],\"label\":[513],\"prefix\":[513],\"suffix\":[513],\"disabled\":[516],\"badge\":[520],\"loading\":[516],\"link\":[16],\"progress\":[16]}]]],[\"limel-switch\",[[1,\"limel-switch\",{\"label\":[513],\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"value\":[516],\"helperText\":[513,\"helper-text\"],\"readonlyLabels\":[16],\"fieldId\":[32]}]]],[\"limel-dialog\",[[1,\"limel-dialog\",{\"heading\":[1],\"fullscreen\":[516],\"open\":[1540],\"closingActions\":[16]}]]],[\"limel-progress-flow\",[[1,\"limel-progress-flow\",{\"flowItems\":[16],\"disabled\":[4],\"readonly\":[4]}]]],[\"limel-shortcut\",[[1,\"limel-shortcut\",{\"icon\":[513],\"label\":[513],\"disabled\":[516],\"badge\":[520],\"link\":[16]}]]],[\"limel-banner\",[[1,\"limel-banner\",{\"message\":[513],\"icon\":[513],\"isOpen\":[32],\"open\":[64],\"close\":[64]}]]],[\"limel-callout\",[[1,\"limel-callout\",{\"heading\":[513],\"icon\":[513],\"type\":[513],\"language\":[1]}]]],[\"limel-slider\",[[1,\"limel-slider\",{\"disabled\":[516],\"readonly\":[516],\"factor\":[514],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"unit\":[513],\"value\":[514],\"valuemax\":[514],\"valuemin\":[514],\"step\":[514],\"percentageClass\":[32]}]]],[\"limel-code-editor\",[[1,\"limel-code-editor\",{\"value\":[1],\"language\":[1],\"readonly\":[4],\"lineNumbers\":[4,\"line-numbers\"],\"fold\":[4],\"lint\":[4],\"colorScheme\":[1,\"color-scheme\"],\"random\":[32]}]]],[\"limel-config\",[[1,\"limel-config\",{\"config\":[16]}]]],[\"limel-flex-container\",[[1,\"limel-flex-container\",{\"direction\":[513],\"justify\":[513],\"align\":[513],\"reverse\":[516]}]]],[\"limel-form\",[[1,\"limel-form\",{\"schema\":[16],\"value\":[16],\"disabled\":[4],\"propsFactory\":[16],\"transformErrors\":[16],\"errors\":[16]}]]],[\"limel-grid\",[[1,\"limel-grid\"]]],[\"limel-action-bar_4\",[[1,\"limel-action-bar\",{\"actions\":[16],\"accessibleLabel\":[513,\"accessible-label\"],\"layout\":[513],\"openDirection\":[513,\"open-direction\"],\"overflowCutoff\":[32]}],[1,\"limel-text-editor-link-menu\",{\"link\":[16],\"language\":[513],\"isOpen\":[516,\"is-open\"],\"invalidLink\":[32]}],[0,\"limel-action-bar-overflow-menu\",{\"items\":[16],\"openDirection\":[513,\"open-direction\"]}],[0,\"limel-action-bar-item\",{\"item\":[16],\"isVisible\":[516,\"is-visible\"],\"selected\":[516]}]]],[\"limel-prosemirror-adapter\",[[1,\"limel-prosemirror-adapter\",{\"contentType\":[1,\"content-type\"],\"value\":[1],\"language\":[513],\"view\":[32],\"actionBarItems\":[32],\"link\":[32],\"isLinkMenuOpen\":[32]}]]],[\"limel-color-picker-palette\",[[17,\"limel-color-picker-palette\",{\"value\":[513],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"required\":[516]}]]],[\"limel-popover_2\",[[1,\"limel-popover\",{\"open\":[4],\"openDirection\":[513,\"open-direction\"]}],[1,\"limel-popover-surface\",{\"contentCollection\":[16]}]]],[\"limel-dock-button\",[[0,\"limel-dock-button\",{\"item\":[16],\"expanded\":[516],\"useMobileLayout\":[516,\"use-mobile-layout\"],\"isOpen\":[32]}]]],[\"limel-tab-bar\",[[1,\"limel-tab-bar\",{\"tabs\":[1040],\"canScrollLeft\":[32],\"canScrollRight\":[32]},[[9,\"resize\",\"handleWindowResize\"]]]]],[\"limel-header\",[[1,\"limel-header\",{\"icon\":[1],\"heading\":[1],\"subheading\":[1],\"supportingText\":[1,\"supporting-text\"],\"subheadingDivider\":[1,\"subheading-divider\"]}]]],[\"limel-help-content\",[[1,\"limel-help-content\",{\"value\":[1],\"readMoreLink\":[16]}]]],[\"limel-progress-flow-item\",[[0,\"limel-progress-flow-item\",{\"item\":[16],\"disabled\":[4],\"readonly\":[4],\"currentStep\":[4,\"current-step\"]}]]],[\"limel-circular-progress\",[[1,\"limel-circular-progress\",{\"value\":[2],\"maxValue\":[2,\"max-value\"],\"prefix\":[513],\"suffix\":[1],\"displayPercentageColors\":[4,\"display-percentage-colors\"],\"size\":[513]}]]],[\"limel-flatpickr-adapter\",[[1,\"limel-flatpickr-adapter\",{\"value\":[16],\"type\":[1],\"format\":[1],\"isOpen\":[4,\"is-open\"],\"inputElement\":[16],\"language\":[1],\"formatter\":[16]}]]],[\"limel-file-dropzone_2\",[[1,\"limel-file-dropzone\",{\"accept\":[513],\"disabled\":[4],\"text\":[1],\"helperText\":[1,\"helper-text\"],\"hasFileToDrop\":[32]}],[1,\"limel-file-input\",{\"accept\":[513],\"disabled\":[516],\"multiple\":[516]}]]],[\"limel-markdown\",[[1,\"limel-markdown\",{\"value\":[1]}]]],[\"limel-icon_2\",[[1,\"limel-portal\",{\"openDirection\":[513,\"open-direction\"],\"position\":[513],\"containerId\":[513,\"container-id\"],\"containerStyle\":[16],\"parent\":[16],\"inheritParentWidth\":[516,\"inherit-parent-width\"],\"visible\":[516],\"anchor\":[16]}],[1,\"limel-icon\",{\"size\":[513],\"name\":[513],\"badge\":[516]}]]],[\"limel-icon-button\",[[17,\"limel-icon-button\",{\"icon\":[513],\"elevated\":[516],\"label\":[513],\"disabled\":[516]}]]],[\"limel-linear-progress\",[[1,\"limel-linear-progress\",{\"value\":[514],\"indeterminate\":[516]}]]],[\"limel-badge_3\",[[1,\"limel-badge\",{\"label\":[520]}],[1,\"limel-tooltip\",{\"elementId\":[513,\"element-id\"],\"label\":[513],\"helperLabel\":[513,\"helper-label\"],\"maxlength\":[514],\"openDirection\":[513,\"open-direction\"],\"open\":[32]}],[1,\"limel-tooltip-content\",{\"label\":[513],\"helperLabel\":[513,\"helper-label\"],\"maxlength\":[514]}]]],[\"limel-breadcrumbs_5\",[[1,\"limel-menu\",{\"items\":[16],\"disabled\":[516],\"openDirection\":[513,\"open-direction\"],\"surfaceWidth\":[513,\"surface-width\"],\"open\":[1540],\"badgeIcons\":[516,\"badge-icons\"],\"gridLayout\":[516,\"grid-layout\"],\"loading\":[516],\"currentSubMenu\":[1040],\"rootItem\":[16],\"searcher\":[16],\"emptyResultMessage\":[1,\"empty-result-message\"],\"loadingSubItems\":[32],\"searchValue\":[32],\"searchResults\":[32]}],[1,\"limel-breadcrumbs\",{\"items\":[16],\"divider\":[1]}],[17,\"limel-menu-list\",{\"items\":[16],\"badgeIcons\":[4,\"badge-icons\"],\"iconSize\":[1,\"icon-size\"],\"type\":[1],\"maxLinesSecondaryText\":[2,\"max-lines-secondary-text\"]}],[1,\"limel-input-field\",{\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"label\":[513],\"placeholder\":[513],\"helperText\":[513,\"helper-text\"],\"prefix\":[513],\"suffix\":[513],\"required\":[516],\"value\":[513],\"trailingIcon\":[513,\"trailing-icon\"],\"leadingIcon\":[513,\"leading-icon\"],\"pattern\":[513],\"type\":[513],\"formatNumber\":[516,\"format-number\"],\"step\":[520],\"max\":[514],\"min\":[514],\"maxlength\":[514],\"minlength\":[514],\"completions\":[16],\"showLink\":[516,\"show-link\"],\"locale\":[513],\"isFocused\":[32],\"wasInvalid\":[32],\"showCompletions\":[32]}],[1,\"limel-spinner\",{\"size\":[513],\"limeBranded\":[4,\"lime-branded\"]}]]],[\"limel-chip_2\",[[1,\"limel-chip-set\",{\"value\":[16],\"type\":[513],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"inputType\":[513,\"input-type\"],\"maxItems\":[514,\"max-items\"],\"required\":[516],\"searchLabel\":[513,\"search-label\"],\"emptyInputOnBlur\":[516,\"empty-input-on-blur\"],\"clearAllButton\":[4,\"clear-all-button\"],\"leadingIcon\":[513,\"leading-icon\"],\"delimiter\":[513],\"language\":[1],\"editMode\":[32],\"textValue\":[32],\"blurred\":[32],\"inputChipIndexSelected\":[32],\"selectedChipIds\":[32],\"getEditMode\":[64],\"setFocus\":[64],\"emptyInput\":[64]}],[17,\"limel-chip\",{\"language\":[513],\"text\":[513],\"icon\":[1],\"image\":[16],\"link\":[16],\"badge\":[520],\"disabled\":[516],\"readonly\":[516],\"selected\":[516],\"invalid\":[516],\"removable\":[516],\"type\":[513],\"loading\":[516],\"progress\":[514],\"identifier\":[520],\"menuItems\":[16]}]]],[\"limel-button\",[[17,\"limel-button\",{\"label\":[513],\"primary\":[516],\"outlined\":[516],\"icon\":[513],\"disabled\":[516],\"loading\":[516],\"loadingFailed\":[516,\"loading-failed\"],\"justLoaded\":[32]}]]]]"), options);
20
+ return bootstrapLazy(JSON.parse("[[\"limel-text-editor\",[[1,\"limel-text-editor\",{\"contentType\":[1,\"content-type\"],\"language\":[513],\"disabled\":[516],\"readonly\":[516],\"helperText\":[513,\"helper-text\"],\"placeholder\":[513],\"label\":[513],\"invalid\":[516],\"value\":[513],\"required\":[516],\"allowResize\":[516,\"allow-resize\"],\"ui\":[513]}]]],[\"limel-file\",[[1,\"limel-file\",{\"value\":[16],\"label\":[513],\"required\":[516],\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"accept\":[513],\"language\":[1]}]]],[\"limel-picker\",[[1,\"limel-picker\",{\"disabled\":[4],\"readonly\":[516],\"label\":[1],\"searchLabel\":[1,\"search-label\"],\"helperText\":[513,\"helper-text\"],\"leadingIcon\":[1,\"leading-icon\"],\"emptyResultMessage\":[1,\"empty-result-message\"],\"required\":[4],\"invalid\":[516],\"value\":[16],\"searcher\":[16],\"multiple\":[4],\"delimiter\":[513],\"actions\":[16],\"actionPosition\":[1,\"action-position\"],\"actionScrollBehavior\":[1,\"action-scroll-behavior\"],\"badgeIcons\":[516,\"badge-icons\"],\"items\":[32],\"textValue\":[32],\"loading\":[32],\"chips\":[32]}]]],[\"limel-split-button\",[[17,\"limel-split-button\",{\"label\":[513],\"primary\":[516],\"icon\":[513],\"disabled\":[516],\"loading\":[516],\"loadingFailed\":[516,\"loading-failed\"],\"items\":[16]}]]],[\"limel-file-viewer\",[[1,\"limel-file-viewer\",{\"url\":[513],\"filename\":[513],\"alt\":[513],\"allowFullscreen\":[516,\"allow-fullscreen\"],\"allowOpenInNewTab\":[516,\"allow-open-in-new-tab\"],\"allowDownload\":[516,\"allow-download\"],\"language\":[1],\"officeViewer\":[513,\"office-viewer\"],\"actions\":[16],\"isFullscreen\":[32],\"fileType\":[32],\"loading\":[32],\"fileUrl\":[32]}]]],[\"limel-color-picker\",[[1,\"limel-color-picker\",{\"value\":[513],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"tooltipLabel\":[513,\"tooltip-label\"],\"required\":[516],\"readonly\":[516],\"isOpen\":[32]}]]],[\"limel-date-picker\",[[1,\"limel-date-picker\",{\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"label\":[513],\"placeholder\":[513],\"helperText\":[513,\"helper-text\"],\"required\":[516],\"value\":[16],\"type\":[513],\"format\":[513],\"language\":[513],\"formatter\":[16],\"internalFormat\":[32],\"showPortal\":[32]}]]],[\"limel-dock\",[[1,\"limel-dock\",{\"dockItems\":[16],\"dockFooterItems\":[16],\"accessibleLabel\":[513,\"accessible-label\"],\"expanded\":[516],\"allowResize\":[516,\"allow-resize\"],\"mobileBreakPoint\":[514,\"mobile-break-point\"],\"useMobileLayout\":[32]}]]],[\"limel-snackbar\",[[1,\"limel-snackbar\",{\"open\":[516],\"message\":[1],\"timeout\":[514],\"actionText\":[1,\"action-text\"],\"dismissible\":[4],\"multiline\":[4],\"language\":[1],\"offset\":[32],\"isOpen\":[32],\"closing\":[32],\"show\":[64]},[[0,\"changeOffset\",\"onChangeIndex\"]]]]],[\"limel-tab-panel\",[[1,\"limel-tab-panel\",{\"tabs\":[1040]}]]],[\"limel-select\",[[1,\"limel-select\",{\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"required\":[516],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"value\":[16],\"options\":[16],\"multiple\":[4],\"menuOpen\":[32]}]]],[\"limel-button-group\",[[1,\"limel-button-group\",{\"value\":[16],\"disabled\":[516],\"selectedButtonId\":[32]}]]],[\"limel-collapsible-section\",[[1,\"limel-collapsible-section\",{\"isOpen\":[1540,\"is-open\"],\"header\":[513],\"actions\":[16]}]]],[\"limel-help\",[[1,\"limel-help\",{\"value\":[1],\"trigger\":[1],\"readMoreLink\":[16],\"openDirection\":[513,\"open-direction\"],\"isOpen\":[32]}]]],[\"limel-dynamic-label_4\",[[17,\"limel-list\",{\"items\":[16],\"badgeIcons\":[4,\"badge-icons\"],\"iconSize\":[1,\"icon-size\"],\"type\":[1],\"maxLinesSecondaryText\":[2,\"max-lines-secondary-text\"]}],[1,\"limel-menu-surface\",{\"open\":[4],\"allowClicksElement\":[16]}],[1,\"limel-dynamic-label\",{\"value\":[8],\"defaultLabel\":[16],\"labels\":[16]}],[1,\"limel-helper-line\",{\"helperText\":[513,\"helper-text\"],\"length\":[514],\"maxLength\":[514,\"max-length\"],\"invalid\":[516],\"helperTextId\":[513,\"helper-text-id\"]}]]],[\"limel-checkbox\",[[1,\"limel-checkbox\",{\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"checked\":[516],\"indeterminate\":[516],\"required\":[516],\"readonlyLabels\":[16],\"modified\":[32]}]]],[\"limel-table\",[[1,\"limel-table\",{\"data\":[16],\"columns\":[16],\"mode\":[1],\"layout\":[1],\"pageSize\":[2,\"page-size\"],\"totalRows\":[2,\"total-rows\"],\"sorting\":[16],\"activeRow\":[1040],\"movableColumns\":[4,\"movable-columns\"],\"loading\":[4],\"page\":[2],\"emptyMessage\":[1,\"empty-message\"],\"aggregates\":[16],\"selectable\":[4],\"selection\":[16]}]]],[\"limel-info-tile\",[[1,\"limel-info-tile\",{\"value\":[520],\"icon\":[1],\"label\":[513],\"prefix\":[513],\"suffix\":[513],\"disabled\":[516],\"badge\":[520],\"loading\":[516],\"link\":[16],\"progress\":[16]}]]],[\"limel-switch\",[[1,\"limel-switch\",{\"label\":[513],\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"value\":[516],\"helperText\":[513,\"helper-text\"],\"readonlyLabels\":[16],\"fieldId\":[32]}]]],[\"limel-dialog\",[[1,\"limel-dialog\",{\"heading\":[1],\"fullscreen\":[516],\"open\":[1540],\"closingActions\":[16]}]]],[\"limel-progress-flow\",[[1,\"limel-progress-flow\",{\"flowItems\":[16],\"disabled\":[4],\"readonly\":[4]}]]],[\"limel-shortcut\",[[1,\"limel-shortcut\",{\"icon\":[513],\"label\":[513],\"disabled\":[516],\"badge\":[520],\"link\":[16]}]]],[\"limel-banner\",[[1,\"limel-banner\",{\"message\":[513],\"icon\":[513],\"isOpen\":[32],\"open\":[64],\"close\":[64]}]]],[\"limel-callout\",[[1,\"limel-callout\",{\"heading\":[513],\"icon\":[513],\"type\":[513],\"language\":[1]}]]],[\"limel-slider\",[[1,\"limel-slider\",{\"disabled\":[516],\"readonly\":[516],\"factor\":[514],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"unit\":[513],\"value\":[514],\"valuemax\":[514],\"valuemin\":[514],\"step\":[514],\"percentageClass\":[32]}]]],[\"limel-code-editor\",[[1,\"limel-code-editor\",{\"value\":[1],\"language\":[1],\"readonly\":[4],\"lineNumbers\":[4,\"line-numbers\"],\"fold\":[4],\"lint\":[4],\"colorScheme\":[1,\"color-scheme\"],\"random\":[32]}]]],[\"limel-config\",[[1,\"limel-config\",{\"config\":[16]}]]],[\"limel-flex-container\",[[1,\"limel-flex-container\",{\"direction\":[513],\"justify\":[513],\"align\":[513],\"reverse\":[516]}]]],[\"limel-form\",[[1,\"limel-form\",{\"schema\":[16],\"value\":[16],\"disabled\":[4],\"propsFactory\":[16],\"transformErrors\":[16],\"errors\":[16]}]]],[\"limel-grid\",[[1,\"limel-grid\"]]],[\"limel-action-bar_4\",[[1,\"limel-action-bar\",{\"actions\":[16],\"accessibleLabel\":[513,\"accessible-label\"],\"layout\":[513],\"openDirection\":[513,\"open-direction\"],\"overflowCutoff\":[32]}],[1,\"limel-text-editor-link-menu\",{\"link\":[16],\"language\":[513],\"isOpen\":[516,\"is-open\"],\"invalidLink\":[32]}],[0,\"limel-action-bar-overflow-menu\",{\"items\":[16],\"openDirection\":[513,\"open-direction\"]}],[0,\"limel-action-bar-item\",{\"item\":[16],\"isVisible\":[516,\"is-visible\"],\"selected\":[516]}]]],[\"limel-prosemirror-adapter\",[[1,\"limel-prosemirror-adapter\",{\"contentType\":[1,\"content-type\"],\"value\":[1],\"language\":[513],\"view\":[32],\"actionBarItems\":[32],\"link\":[32],\"isLinkMenuOpen\":[32]}]]],[\"limel-color-picker-palette\",[[17,\"limel-color-picker-palette\",{\"value\":[513],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"required\":[516]}]]],[\"limel-popover_2\",[[1,\"limel-popover\",{\"open\":[4],\"openDirection\":[513,\"open-direction\"]}],[1,\"limel-popover-surface\",{\"contentCollection\":[16]}]]],[\"limel-dock-button\",[[0,\"limel-dock-button\",{\"item\":[16],\"expanded\":[516],\"useMobileLayout\":[516,\"use-mobile-layout\"],\"isOpen\":[32]}]]],[\"limel-tab-bar\",[[1,\"limel-tab-bar\",{\"tabs\":[1040],\"canScrollLeft\":[32],\"canScrollRight\":[32]},[[9,\"resize\",\"handleWindowResize\"]]]]],[\"limel-header\",[[1,\"limel-header\",{\"icon\":[1],\"heading\":[1],\"subheading\":[1],\"supportingText\":[1,\"supporting-text\"],\"subheadingDivider\":[1,\"subheading-divider\"]}]]],[\"limel-help-content\",[[1,\"limel-help-content\",{\"value\":[1],\"readMoreLink\":[16]}]]],[\"limel-progress-flow-item\",[[0,\"limel-progress-flow-item\",{\"item\":[16],\"disabled\":[4],\"readonly\":[4],\"currentStep\":[4,\"current-step\"]}]]],[\"limel-circular-progress\",[[1,\"limel-circular-progress\",{\"value\":[2],\"maxValue\":[2,\"max-value\"],\"prefix\":[513],\"suffix\":[1],\"displayPercentageColors\":[4,\"display-percentage-colors\"],\"size\":[513]}]]],[\"limel-flatpickr-adapter\",[[1,\"limel-flatpickr-adapter\",{\"value\":[16],\"type\":[1],\"format\":[1],\"isOpen\":[4,\"is-open\"],\"inputElement\":[16],\"language\":[1],\"formatter\":[16]}]]],[\"limel-file-dropzone_2\",[[1,\"limel-file-dropzone\",{\"accept\":[513],\"disabled\":[4],\"text\":[1],\"helperText\":[1,\"helper-text\"],\"hasFileToDrop\":[32]}],[1,\"limel-file-input\",{\"accept\":[513],\"disabled\":[516],\"multiple\":[516]}]]],[\"limel-markdown\",[[1,\"limel-markdown\",{\"value\":[1],\"whitelist\":[16]}]]],[\"limel-icon_2\",[[1,\"limel-portal\",{\"openDirection\":[513,\"open-direction\"],\"position\":[513],\"containerId\":[513,\"container-id\"],\"containerStyle\":[16],\"parent\":[16],\"inheritParentWidth\":[516,\"inherit-parent-width\"],\"visible\":[516],\"anchor\":[16]}],[1,\"limel-icon\",{\"size\":[513],\"name\":[513],\"badge\":[516]}]]],[\"limel-icon-button\",[[17,\"limel-icon-button\",{\"icon\":[513],\"elevated\":[516],\"label\":[513],\"disabled\":[516]}]]],[\"limel-linear-progress\",[[1,\"limel-linear-progress\",{\"value\":[514],\"indeterminate\":[516]}]]],[\"limel-badge_3\",[[1,\"limel-badge\",{\"label\":[520]}],[1,\"limel-tooltip\",{\"elementId\":[513,\"element-id\"],\"label\":[513],\"helperLabel\":[513,\"helper-label\"],\"maxlength\":[514],\"openDirection\":[513,\"open-direction\"],\"open\":[32]}],[1,\"limel-tooltip-content\",{\"label\":[513],\"helperLabel\":[513,\"helper-label\"],\"maxlength\":[514]}]]],[\"limel-breadcrumbs_5\",[[1,\"limel-menu\",{\"items\":[16],\"disabled\":[516],\"openDirection\":[513,\"open-direction\"],\"surfaceWidth\":[513,\"surface-width\"],\"open\":[1540],\"badgeIcons\":[516,\"badge-icons\"],\"gridLayout\":[516,\"grid-layout\"],\"loading\":[516],\"currentSubMenu\":[1040],\"rootItem\":[16],\"searcher\":[16],\"emptyResultMessage\":[1,\"empty-result-message\"],\"loadingSubItems\":[32],\"searchValue\":[32],\"searchResults\":[32]}],[1,\"limel-breadcrumbs\",{\"items\":[16],\"divider\":[1]}],[17,\"limel-menu-list\",{\"items\":[16],\"badgeIcons\":[4,\"badge-icons\"],\"iconSize\":[1,\"icon-size\"],\"type\":[1],\"maxLinesSecondaryText\":[2,\"max-lines-secondary-text\"]}],[1,\"limel-input-field\",{\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"label\":[513],\"placeholder\":[513],\"helperText\":[513,\"helper-text\"],\"prefix\":[513],\"suffix\":[513],\"required\":[516],\"value\":[513],\"trailingIcon\":[513,\"trailing-icon\"],\"leadingIcon\":[513,\"leading-icon\"],\"pattern\":[513],\"type\":[513],\"formatNumber\":[516,\"format-number\"],\"step\":[520],\"max\":[514],\"min\":[514],\"maxlength\":[514],\"minlength\":[514],\"completions\":[16],\"showLink\":[516,\"show-link\"],\"locale\":[513],\"isFocused\":[32],\"wasInvalid\":[32],\"showCompletions\":[32]}],[1,\"limel-spinner\",{\"size\":[513],\"limeBranded\":[4,\"lime-branded\"]}]]],[\"limel-chip_2\",[[1,\"limel-chip-set\",{\"value\":[16],\"type\":[513],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"inputType\":[513,\"input-type\"],\"maxItems\":[514,\"max-items\"],\"required\":[516],\"searchLabel\":[513,\"search-label\"],\"emptyInputOnBlur\":[516,\"empty-input-on-blur\"],\"clearAllButton\":[4,\"clear-all-button\"],\"leadingIcon\":[513,\"leading-icon\"],\"delimiter\":[513],\"language\":[1],\"editMode\":[32],\"textValue\":[32],\"blurred\":[32],\"inputChipIndexSelected\":[32],\"selectedChipIds\":[32],\"getEditMode\":[64],\"setFocus\":[64],\"emptyInput\":[64]}],[17,\"limel-chip\",{\"language\":[513],\"text\":[513],\"icon\":[1],\"image\":[16],\"link\":[16],\"badge\":[520],\"disabled\":[516],\"readonly\":[516],\"selected\":[516],\"invalid\":[516],\"removable\":[516],\"type\":[513],\"loading\":[516],\"progress\":[514],\"identifier\":[520],\"menuItems\":[16]}]]],[\"limel-button\",[[17,\"limel-button\",{\"label\":[513],\"primary\":[516],\"outlined\":[516],\"icon\":[513],\"disabled\":[516],\"loading\":[516],\"loadingFailed\":[516,\"loading-failed\"],\"justLoaded\":[32]}]]]]"), options);
21
21
  });
22
22
 
23
23
  //# sourceMappingURL=lime-elements.js.map