scu-web-components 0.0.21 → 0.0.22
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/dist/chunks/chunk.2SWJYWHF.js +4 -0
- package/dist/chunks/chunk.2SWJYWHF.js.map +7 -0
- package/dist/chunks/chunk.3FBPDSVX.js +246 -0
- package/dist/chunks/chunk.3FBPDSVX.js.map +7 -0
- package/dist/chunks/chunk.3ZF5XE56.js +2 -0
- package/dist/chunks/chunk.3ZF5XE56.js.map +7 -0
- package/dist/chunks/chunk.5B2MVQ27.js +2 -0
- package/dist/chunks/chunk.5B2MVQ27.js.map +7 -0
- package/dist/chunks/chunk.5O57EYF4.js +2 -0
- package/dist/chunks/chunk.5O57EYF4.js.map +7 -0
- package/dist/chunks/chunk.5P5RU7GD.js +2 -0
- package/dist/chunks/chunk.5P5RU7GD.js.map +7 -0
- package/dist/chunks/chunk.5SNSWZHO.js +2 -0
- package/dist/chunks/chunk.5SNSWZHO.js.map +7 -0
- package/dist/chunks/chunk.62GWBO3B.js +2 -0
- package/dist/chunks/chunk.62GWBO3B.js.map +7 -0
- package/dist/chunks/chunk.6JEOFLOD.js +2 -0
- package/dist/chunks/chunk.6JEOFLOD.js.map +7 -0
- package/dist/chunks/chunk.6JZBSBO7.js +2 -0
- package/dist/chunks/chunk.6JZBSBO7.js.map +7 -0
- package/dist/chunks/chunk.75XREEIK.js +58 -0
- package/dist/chunks/chunk.75XREEIK.js.map +7 -0
- package/dist/chunks/chunk.7CJJ52HY.js +2 -0
- package/dist/chunks/chunk.7CJJ52HY.js.map +7 -0
- package/dist/chunks/chunk.7RDBE3IG.js +2 -0
- package/dist/chunks/chunk.7RDBE3IG.js.map +7 -0
- package/dist/chunks/chunk.7VW267FJ.js +17 -0
- package/dist/chunks/chunk.7VW267FJ.js.map +7 -0
- package/dist/chunks/chunk.7Z2IEKUA.js +17 -0
- package/dist/chunks/chunk.7Z2IEKUA.js.map +7 -0
- package/dist/chunks/chunk.ACJT3GFX.js +17 -0
- package/dist/chunks/chunk.ACJT3GFX.js.map +7 -0
- package/dist/chunks/chunk.B63G34N3.js +2 -0
- package/dist/chunks/chunk.B63G34N3.js.map +7 -0
- package/dist/chunks/chunk.BXOGDFND.js +17 -0
- package/dist/chunks/chunk.BXOGDFND.js.map +7 -0
- package/dist/chunks/chunk.DCCR6AGA.js +4 -0
- package/dist/chunks/chunk.DCCR6AGA.js.map +7 -0
- package/dist/chunks/chunk.DTU7NHQP.js +2 -0
- package/dist/chunks/chunk.DTU7NHQP.js.map +7 -0
- package/dist/chunks/chunk.EXCY4PGS.js +2 -0
- package/dist/chunks/chunk.EXCY4PGS.js.map +7 -0
- package/dist/chunks/chunk.F7TA5BBQ.js +4 -0
- package/dist/chunks/chunk.F7TA5BBQ.js.map +7 -0
- package/dist/chunks/chunk.HLMRJM7V.js +47 -0
- package/dist/chunks/chunk.HLMRJM7V.js.map +7 -0
- package/dist/chunks/chunk.IAALPGL2.js +2 -0
- package/dist/chunks/chunk.IAALPGL2.js.map +7 -0
- package/dist/chunks/chunk.KLCHR5KI.js +2 -0
- package/dist/chunks/chunk.KLCHR5KI.js.map +7 -0
- package/dist/chunks/chunk.KLH46EZA.js +2 -0
- package/dist/chunks/chunk.KLH46EZA.js.map +7 -0
- package/dist/chunks/chunk.L6NJJXH5.js +2 -0
- package/dist/chunks/chunk.L6NJJXH5.js.map +7 -0
- package/dist/chunks/chunk.LAQTQIRZ.js +2 -0
- package/dist/chunks/chunk.LAQTQIRZ.js.map +7 -0
- package/dist/chunks/chunk.MBVU2OPU.js +4 -0
- package/dist/chunks/chunk.MBVU2OPU.js.map +7 -0
- package/dist/chunks/chunk.MGZVQJ3S.js +245 -0
- package/dist/chunks/chunk.MGZVQJ3S.js.map +7 -0
- package/dist/chunks/chunk.MLENW6F3.js +246 -0
- package/dist/chunks/chunk.MLENW6F3.js.map +7 -0
- package/dist/chunks/chunk.O5A7YZKV.js +29 -0
- package/dist/chunks/chunk.O5A7YZKV.js.map +7 -0
- package/dist/chunks/chunk.O6N6AMBN.js +209 -0
- package/dist/chunks/chunk.O6N6AMBN.js.map +7 -0
- package/dist/chunks/chunk.PXGXIL4I.js +246 -0
- package/dist/chunks/chunk.PXGXIL4I.js.map +7 -0
- package/dist/chunks/chunk.QXE7UNSK.js +245 -0
- package/dist/chunks/chunk.QXE7UNSK.js.map +7 -0
- package/dist/chunks/chunk.R4YGOT4Y.js +49 -0
- package/dist/chunks/chunk.R4YGOT4Y.js.map +7 -0
- package/dist/chunks/chunk.RBSBLP6E.js +256 -0
- package/dist/chunks/chunk.RBSBLP6E.js.map +7 -0
- package/dist/chunks/chunk.RXMGI7HR.js +2 -0
- package/dist/chunks/chunk.RXMGI7HR.js.map +7 -0
- package/dist/chunks/chunk.S4MESEBR.js +32 -0
- package/dist/chunks/chunk.S4MESEBR.js.map +7 -0
- package/dist/chunks/chunk.SIJSFRVB.js +2 -0
- package/dist/chunks/chunk.SIJSFRVB.js.map +7 -0
- package/dist/chunks/chunk.TXOGG2T7.js +2 -0
- package/dist/chunks/chunk.TXOGG2T7.js.map +7 -0
- package/dist/chunks/chunk.UVVG6NF4.js +2 -0
- package/dist/chunks/chunk.UVVG6NF4.js.map +7 -0
- package/dist/chunks/chunk.W3ITQHQQ.js +245 -0
- package/dist/chunks/chunk.W3ITQHQQ.js.map +7 -0
- package/dist/chunks/chunk.WPOS6KBC.js +2 -0
- package/dist/chunks/chunk.WPOS6KBC.js.map +7 -0
- package/dist/chunks/chunk.WSDDWC5Y.js +47 -0
- package/dist/chunks/chunk.WSDDWC5Y.js.map +7 -0
- package/dist/chunks/chunk.YPWTNS7G.js +17 -0
- package/dist/chunks/chunk.YPWTNS7G.js.map +7 -0
- package/dist/chunks/chunk.YXBLJ773.js +4 -0
- package/dist/chunks/chunk.YXBLJ773.js.map +7 -0
- package/dist/chunks/chunk.Z3OBLET2.js +2 -0
- package/dist/chunks/chunk.Z3OBLET2.js.map +7 -0
- package/dist/chunks/chunk.ZKGK7XFD.js +117 -0
- package/dist/chunks/chunk.ZKGK7XFD.js.map +7 -0
- package/dist/chunks/chunk.ZKH7NVYV.js +17 -0
- package/dist/chunks/chunk.ZKH7NVYV.js.map +7 -0
- package/dist/chunks/chunk.ZWJHKP3F.js +4 -0
- package/dist/chunks/chunk.ZWJHKP3F.js.map +7 -0
- package/dist/custom-elements.json +187 -132
- package/dist/docs/components/ScwCard.json +19 -0
- package/dist/docs/components/ScwImage.json +46 -10
- package/dist/docs/components/manifest.json +78 -78
- package/dist/docs/config.json +1 -1
- package/dist/scw-alert/ScwAlert.js +1 -1
- package/dist/scw-alert/scw-alert.js +1 -1
- package/dist/scw-button/ScwButton.js +1 -1
- package/dist/scw-button/scw-button.js +1 -1
- package/dist/scw-card/ScwCard.js +1 -1
- package/dist/scw-card/scw-card.js +1 -1
- package/dist/scw-components.js +1 -1
- package/dist/scw-form-component/scw-form-component.js +1 -1
- package/dist/scw-heading/ScwHeading.js +1 -1
- package/dist/scw-heading/scw-heading.js +1 -1
- package/dist/scw-icon/ScwIcon.js +1 -1
- package/dist/scw-icon/scw-icon.js +1 -1
- package/dist/scw-image/ScwImage.js +1 -1
- package/dist/scw-image/scw-image-validate.js +1 -1
- package/dist/scw-image/scw-image.js +1 -1
- package/dist/scw-input/scw-input.js +1 -1
- package/dist/scw-link/ScwLink.js +1 -1
- package/dist/scw-link/scw-link.js +1 -1
- package/dist/scw-link-base/ScwLinkBase.js +1 -1
- package/dist/scw-link-base/scw-link-base.js +1 -1
- package/dist/scw-menu-item/ScwMenuItem.js +1 -1
- package/dist/scw-menu-item/scw-menu-item.js +1 -1
- package/dist/scw-page-alert/scw-page-alert.js +1 -1
- package/dist/scw-select/scw-select.js +1 -1
- package/dist/scw-single-input/scw-single-input.js +1 -1
- package/dist/scw-textarea/scw-textarea.js +1 -1
- package/dist/scw.js +1 -1
- package/dist/utils/suffix.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../node_modules/lit-html/src/directive-helpers.ts", "../../../node_modules/lit-html/src/experimental-hydrate.ts", "../../../node_modules/lit-element/src/experimental-hydrate-support.ts", "../../src/scw.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {_$LH, Part, DirectiveParent, TemplateResult} from './lit-html.js';\nimport {\n DirectiveResult,\n DirectiveClass,\n PartInfo,\n AttributePartInfo,\n} from './directive.js';\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\n\nconst {_ChildPart: ChildPart} = _$LH;\n\ntype ChildPart = InstanceType<typeof ChildPart>;\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n window.ShadyDOM?.inUse &&\n window.ShadyDOM?.noPatch === true\n ? window.ShadyDOM!.wrap\n : (node: Node) => node;\n\n/**\n * Tests if a value is a primitive value.\n *\n * See https://tc39.github.io/ecma262/#sec-typeof-operator\n */\nexport const isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\n\nexport const TemplateResultType = {\n HTML: 1,\n SVG: 2,\n} as const;\n\nexport type TemplateResultType =\n typeof TemplateResultType[keyof typeof TemplateResultType];\n\n/**\n * Tests if a value is a TemplateResult.\n */\nexport const isTemplateResult = (\n value: unknown,\n type?: TemplateResultType\n): value is TemplateResult =>\n type === undefined\n ? // This property needs to remain unminified.\n (value as TemplateResult)?.['_$litType$'] !== undefined\n : (value as TemplateResult)?.['_$litType$'] === type;\n\n/**\n * Tests if a value is a DirectiveResult.\n */\nexport const isDirectiveResult = (value: unknown): value is DirectiveResult =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'] !== undefined;\n\n/**\n * Retrieves the Directive class for a DirectiveResult\n */\nexport const getDirectiveClass = (value: unknown): DirectiveClass | undefined =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'];\n\n/**\n * Tests whether a part has only a single-expression with no strings to\n * interpolate between.\n *\n * Only AttributePart and PropertyPart can have multiple expressions.\n * Multi-expression parts have a `strings` property and single-expression\n * parts do not.\n */\nexport const isSingleExpression = (part: PartInfo) =>\n (part as AttributePartInfo).strings === undefined;\n\nconst createMarker = () => document.createComment('');\n\n/**\n * Inserts a ChildPart into the given container ChildPart's DOM, either at the\n * end of the container ChildPart, or before the optional `refPart`.\n *\n * This does not add the part to the containerPart's committed value. That must\n * be done by callers.\n *\n * @param containerPart Part within which to add the new ChildPart\n * @param refPart Part before which to add the new ChildPart; when omitted the\n * part added to the end of the `containerPart`\n * @param part Part to insert, or undefined to create a new part\n */\nexport const insertPart = (\n containerPart: ChildPart,\n refPart?: ChildPart,\n part?: ChildPart\n): ChildPart => {\n const container = wrap(containerPart._$startNode).parentNode!;\n\n const refNode =\n refPart === undefined ? containerPart._$endNode : refPart._$startNode;\n\n if (part === undefined) {\n const startNode = wrap(container).insertBefore(createMarker(), refNode);\n const endNode = wrap(container).insertBefore(createMarker(), refNode);\n part = new ChildPart(\n startNode,\n endNode,\n containerPart,\n containerPart.options\n );\n } else {\n const endNode = wrap(part._$endNode!).nextSibling;\n const oldParent = part._$parent;\n const parentChanged = oldParent !== containerPart;\n if (parentChanged) {\n part._$reparentDisconnectables?.(containerPart);\n // Note that although `_$reparentDisconnectables` updates the part's\n // `_$parent` reference after unlinking from its current parent, that\n // method only exists if Disconnectables are present, so we need to\n // unconditionally set it here\n part._$parent = containerPart;\n // Since the _$isConnected getter is somewhat costly, only\n // read it once we know the subtree has directives that need\n // to be notified\n let newConnectionState;\n if (\n part._$notifyConnectionChanged !== undefined &&\n (newConnectionState = containerPart._$isConnected) !==\n oldParent!._$isConnected\n ) {\n part._$notifyConnectionChanged(newConnectionState);\n }\n }\n if (endNode !== refNode || parentChanged) {\n let start: Node | null = part._$startNode;\n while (start !== endNode) {\n const n: Node | null = wrap(start!).nextSibling;\n wrap(container).insertBefore(start!, refNode);\n start = n;\n }\n }\n }\n\n return part;\n};\n\n/**\n * Sets the value of a Part.\n *\n * Note that this should only be used to set/update the value of user-created\n * parts (i.e. those created using `insertPart`); it should not be used\n * by directives to set the value of the directive's container part. Directives\n * should return a value from `update`/`render` to update their part state.\n *\n * For directives that require setting their part value asynchronously, they\n * should extend `AsyncDirective` and call `this.setValue()`.\n *\n * @param part Part to set\n * @param value Value to set\n * @param index For `AttributePart`s, the index to set\n * @param directiveParent Used internally; should not be set by user\n */\nexport const setChildPartValue = <T extends ChildPart>(\n part: T,\n value: unknown,\n directiveParent: DirectiveParent = part\n): T => {\n part._$setValue(value, directiveParent);\n return part;\n};\n\n// A sentinal value that can never appear as a part value except when set by\n// live(). Used to force a dirty-check to fail and cause a re-render.\nconst RESET_VALUE = {};\n\n/**\n * Sets the committed value of a ChildPart directly without triggering the\n * commit stage of the part.\n *\n * This is useful in cases where a directive needs to update the part such\n * that the next update detects a value change or not. When value is omitted,\n * the next update will be guaranteed to be detected as a change.\n *\n * @param part\n * @param value\n */\nexport const setCommittedValue = (part: Part, value: unknown = RESET_VALUE) =>\n (part._$committedValue = value);\n\n/**\n * Returns the committed value of a ChildPart.\n *\n * The committed value is used for change detection and efficient updates of\n * the part. It can differ from the value set by the template or directive in\n * cases where the template value is transformed before being commited.\n *\n * - `TemplateResult`s are committed as a `TemplateInstance`\n * - Iterables are committed as `Array<ChildPart>`\n * - All other types are committed as the template value or value returned or\n * set by a directive.\n *\n * @param part\n */\nexport const getCommittedValue = (part: ChildPart) => part._$committedValue;\n\n/**\n * Removes a ChildPart from the DOM, including any of its content.\n *\n * @param part The Part to remove\n */\nexport const removePart = (part: ChildPart) => {\n part._$notifyConnectionChanged?.(false, true);\n let start: ChildNode | null = part._$startNode;\n const end: ChildNode | null = wrap(part._$endNode!).nextSibling;\n while (start !== end) {\n const n: ChildNode | null = wrap(start!).nextSibling;\n (wrap(start!) as ChildNode).remove();\n start = n;\n }\n};\n\nexport const clearPart = (part: ChildPart) => {\n part._$clear();\n};\n", "/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport type {TemplateResult} from './lit-html.js';\n\nimport {noChange, RenderOptions, _$LH} from './lit-html.js';\nimport {AttributePartInfo, PartType} from './directive.js';\nimport {\n isPrimitive,\n isSingleExpression,\n isTemplateResult,\n} from './directive-helpers.js';\n\nconst {\n _TemplateInstance: TemplateInstance,\n _isIterable: isIterable,\n _resolveDirective: resolveDirective,\n _ChildPart: ChildPart,\n _ElementPart: ElementPart,\n} = _$LH;\n\ntype ChildPart = InstanceType<typeof ChildPart>;\ntype TemplateInstance = InstanceType<typeof TemplateInstance>;\n\n/**\n * Information needed to rehydrate a single TemplateResult.\n */\ntype ChildPartState =\n | {\n type: 'leaf';\n /** The ChildPart that the result is rendered to */\n part: ChildPart;\n }\n | {\n type: 'iterable';\n /** The ChildPart that the result is rendered to */\n part: ChildPart;\n value: Iterable<unknown>;\n iterator: Iterator<unknown>;\n done: boolean;\n }\n | {\n type: 'template-instance';\n /** The ChildPart that the result is rendered to */\n part: ChildPart;\n\n result: TemplateResult;\n\n /** The TemplateInstance created from the TemplateResult */\n instance: TemplateInstance;\n\n /**\n * The index of the next Template part to be hydrated. This is mutable and\n * updated as the tree walk discovers new part markers at the right level in\n * the template instance tree. Note there is only one Template part per\n * attribute with (one or more) bindings.\n */\n templatePartIndex: number;\n\n /**\n * The index of the next TemplateInstance part to be hydrated. This is used\n * to retrieve the value from the TemplateResult and initialize the\n * TemplateInstance parts' values for dirty-checking on first render.\n */\n instancePartIndex: number;\n };\n\n/**\n * hydrate() operates on a container with server-side rendered content and\n * restores the client side data structures needed for lit-html updates such as\n * TemplateInstances and Parts. After calling `hydrate`, lit-html will behave as\n * if it initially rendered the DOM, and any subsequent updates will update\n * efficiently, the same as if lit-html had rendered the DOM on the client.\n *\n * hydrate() must be called on DOM that adheres the to lit-ssr structure for\n * parts. ChildParts must be represented with both a start and end comment\n * marker, and ChildParts that contain a TemplateInstance must have the template\n * digest written into the comment data.\n *\n * Since render() encloses its output in a ChildPart, there must always be a root\n * ChildPart.\n *\n * Example (using for # ... for annotations in HTML)\n *\n * Given this input:\n *\n * html`<div class=${x}>${y}</div>`\n *\n * The SSR DOM is:\n *\n * <!--lit-part AEmR7W+R0Ak=--> # Start marker for the root ChildPart created\n * # by render(). Includes the digest of the\n * # template\n * <div class=\"TEST_X\">\n * <!--lit-node 0--> # Indicates there are attribute bindings here\n * # The number is the depth-first index of the parent\n * # node in the template.\n * <!--lit-part--> # Start marker for the ${x} expression\n * TEST_Y\n * <!--/lit-part--> # End marker for the ${x} expression\n * </div>\n *\n * <!--/lit-part--> # End marker for the root ChildPart\n *\n * @param rootValue\n * @param container\n * @param userOptions\n */\nexport const hydrate = (\n rootValue: unknown,\n container: Element | DocumentFragment,\n options: Partial<RenderOptions> = {}\n) => {\n // TODO(kschaaf): Do we need a helper for _$litPart$ (\"part for node\")?\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((container as any)['_$litPart$'] !== undefined) {\n throw new Error('container already contains a live render');\n }\n\n // Since render() creates a ChildPart to render into, we'll always have\n // exactly one root part. We need to hold a reference to it so we can set\n // it in the parts cache.\n let rootPart: ChildPart | undefined = undefined;\n\n // When we are in-between ChildPart markers, this is the current ChildPart.\n // It's needed to be able to set the ChildPart's endNode when we see a\n // close marker\n let currentChildPart: ChildPart | undefined = undefined;\n\n // Used to remember parent template state as we recurse into nested\n // templates\n const stack: Array<ChildPartState> = [];\n\n const walker = document.createTreeWalker(\n container,\n NodeFilter.SHOW_COMMENT,\n null,\n false\n );\n let marker: Comment | null;\n\n // Walk the DOM looking for part marker comments\n while ((marker = walker.nextNode() as Comment | null) !== null) {\n const markerText = marker.data;\n if (markerText.startsWith('lit-part')) {\n if (stack.length === 0 && rootPart !== undefined) {\n throw new Error('there must be only one root part per container');\n }\n // Create a new ChildPart and push it onto the stack\n currentChildPart = openChildPart(rootValue, marker, stack, options);\n rootPart ??= currentChildPart;\n } else if (markerText.startsWith('lit-node')) {\n // Create and hydrate attribute parts into the current ChildPart on the\n // stack\n createAttributeParts(marker, stack, options);\n // Remove `defer-hydration` attribute, if any\n const parent = marker.parentElement!;\n if (parent.hasAttribute('defer-hydration')) {\n parent.removeAttribute('defer-hydration');\n }\n } else if (markerText.startsWith('/lit-part')) {\n // Close the current ChildPart, and pop the previous one off the stack\n if (stack.length === 1 && currentChildPart !== rootPart) {\n throw new Error('internal error');\n }\n currentChildPart = closeChildPart(marker, currentChildPart, stack);\n }\n }\n console.assert(\n rootPart !== undefined,\n 'there should be exactly one root part in a render container'\n );\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (container as any)['_$litPart$'] = rootPart;\n};\n\nconst openChildPart = (\n rootValue: unknown,\n marker: Comment,\n stack: Array<ChildPartState>,\n options: RenderOptions\n) => {\n let value: unknown;\n // We know the startNode now. We'll know the endNode when we get to\n // the matching marker and set it in closeChildPart()\n // TODO(kschaaf): Current constructor takes both nodes\n let part;\n if (stack.length === 0) {\n part = new ChildPart(marker, null, undefined, options);\n value = rootValue;\n } else {\n const state = stack[stack.length - 1];\n if (state.type === 'template-instance') {\n part = new ChildPart(marker, null, state.instance, options);\n state.instance._parts.push(part);\n value = state.result.values[state.instancePartIndex++];\n state.templatePartIndex++;\n } else if (state.type === 'iterable') {\n part = new ChildPart(marker, null, state.part, options);\n const result = state.iterator.next();\n if (result.done) {\n value = undefined;\n state.done = true;\n throw new Error('Unhandled shorter than expected iterable');\n } else {\n value = result.value;\n }\n (state.part._$committedValue as Array<ChildPart>).push(part);\n } else {\n // state.type === 'leaf'\n // TODO(kschaaf): This is unexpected, and likely a result of a primitive\n // been rendered on the client when a TemplateResult was rendered on the\n // server; this part will be hydrated but not used. We can detect it, but\n // we need to decide what to do in this case. Note that this part won't be\n // retained by any parent TemplateInstance, since a primitive had been\n // rendered in its place.\n // https://github.com/lit/lit/issues/1434\n // throw new Error('Hydration value mismatch: Found a TemplateInstance' +\n // 'where a leaf value was expected');\n part = new ChildPart(marker, null, state.part, options);\n }\n }\n\n // Initialize the ChildPart state depending on the type of value and push\n // it onto the stack. This logic closely follows the ChildPart commit()\n // cascade order:\n // 1. directive\n // 2. noChange\n // 3. primitive (note strings must be handled before iterables, since they\n // are iterable)\n // 4. TemplateResult\n // 5. Node (not yet implemented, but fallback handling is fine)\n // 6. Iterable\n // 7. nothing (handled in fallback)\n // 8. Fallback for everything else\n value = resolveDirective(part, value);\n if (value === noChange) {\n stack.push({part, type: 'leaf'});\n } else if (isPrimitive(value)) {\n stack.push({part, type: 'leaf'});\n part._$committedValue = value;\n // TODO(kschaaf): We can detect when a primitive is being hydrated on the\n // client where a TemplateResult was rendered on the server, but we need to\n // decide on a strategy for what to do next.\n // https://github.com/lit/lit/issues/1434\n // if (marker.data !== 'lit-part') {\n // throw new Error('Hydration value mismatch: Primitive found where TemplateResult expected');\n // }\n } else if (isTemplateResult(value)) {\n // Check for a template result digest\n const markerWithDigest = `lit-part ${digestForTemplateResult(value)}`;\n if (marker.data === markerWithDigest) {\n const template = ChildPart.prototype._$getTemplate(value);\n const instance = new TemplateInstance(template, part);\n stack.push({\n type: 'template-instance',\n instance,\n part,\n templatePartIndex: 0,\n instancePartIndex: 0,\n result: value,\n });\n // For TemplateResult values, we set the part value to the\n // generated TemplateInstance\n part._$committedValue = instance;\n } else {\n // TODO: if this isn't the server-rendered template, do we\n // need to stop hydrating this subtree? Clear it? Add tests.\n throw new Error(\n 'Hydration value mismatch: Unexpected TemplateResult rendered to part'\n );\n }\n } else if (isIterable(value)) {\n // currentChildPart.value will contain an array of ChildParts\n stack.push({\n part: part,\n type: 'iterable',\n value,\n iterator: value[Symbol.iterator](),\n done: false,\n });\n part._$committedValue = [];\n } else {\n // Fallback for everything else (nothing, Objects, Functions,\n // etc.): we just initialize the part's value\n // Note that `Node` value types are not currently supported during\n // SSR, so that part of the cascade is missing.\n stack.push({part: part, type: 'leaf'});\n part._$committedValue = value == null ? '' : value;\n }\n return part;\n};\n\nconst closeChildPart = (\n marker: Comment,\n part: ChildPart | undefined,\n stack: Array<ChildPartState>\n): ChildPart | undefined => {\n if (part === undefined) {\n throw new Error('unbalanced part marker');\n }\n\n part._$endNode = marker;\n\n const currentState = stack.pop()!;\n\n if (currentState.type === 'iterable') {\n if (!currentState.iterator.next().done) {\n throw new Error('unexpected longer than expected iterable');\n }\n }\n\n if (stack.length > 0) {\n const state = stack[stack.length - 1];\n return state.part;\n } else {\n return undefined;\n }\n};\n\nconst createAttributeParts = (\n comment: Comment,\n stack: Array<ChildPartState>,\n options: RenderOptions\n) => {\n // Get the nodeIndex from DOM. We're only using this for an integrity\n // check right now, we might not need it.\n const match = /lit-node (\\d+)/.exec(comment.data)!;\n const nodeIndex = parseInt(match[1]);\n\n // For void elements, the node the comment was referring to will be\n // the previousSibling; for non-void elements, the comment is guaranteed\n // to be the first child of the element (i.e. it won't have a previousSibling\n // meaning it should use the parentElement)\n const node = comment.previousSibling ?? comment.parentElement;\n\n const state = stack[stack.length - 1];\n if (state.type === 'template-instance') {\n const instance = state.instance;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // If the next template part is in attribute-position on the current node,\n // create the instance part for it and prime its state\n const templatePart = instance._$template.parts[state.templatePartIndex];\n if (\n templatePart === undefined ||\n (templatePart.type !== PartType.ATTRIBUTE &&\n templatePart.type !== PartType.ELEMENT) ||\n templatePart.index !== nodeIndex\n ) {\n break;\n }\n\n if (templatePart.type === PartType.ATTRIBUTE) {\n // The instance part is created based on the constructor saved in the\n // template part\n const instancePart = new templatePart.ctor(\n node as HTMLElement,\n templatePart.name,\n templatePart.strings,\n state.instance,\n options\n );\n\n const value = isSingleExpression(\n instancePart as unknown as AttributePartInfo\n )\n ? state.result.values[state.instancePartIndex]\n : state.result.values;\n\n // Setting the attribute value primes committed value with the resolved\n // directive value; we only then commit that value for event/property\n // parts since those were not serialized, and pass `noCommit` for the\n // others to avoid perf impact of touching the DOM unnecessarily\n const noCommit = !(\n instancePart.type === PartType.EVENT ||\n instancePart.type === PartType.PROPERTY\n );\n instancePart._$setValue(\n value,\n instancePart,\n state.instancePartIndex,\n noCommit\n );\n state.instancePartIndex += templatePart.strings.length - 1;\n instance._parts.push(instancePart);\n } else {\n // templatePart.type === PartType.ELEMENT\n const instancePart = new ElementPart(\n node as HTMLElement,\n state.instance,\n options\n );\n resolveDirective(\n instancePart,\n state.result.values[state.instancePartIndex++]\n );\n instance._parts.push(instancePart);\n }\n state.templatePartIndex++;\n }\n } else {\n throw new Error('internal error');\n }\n};\n\n// Number of 32 bit elements to use to create template digests\nconst digestSize = 2;\n// We need to specify a digest to use across rendering environments. This is a\n// simple digest build from a DJB2-ish hash modified from:\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\n// It has been changed to an array of hashes to add additional bits.\n// Goals:\n// - Extremely low collision rate. We may not be able to detect collisions.\n// - Extremely fast.\n// - Extremely small code size.\n// - Safe to include in HTML comment text or attribute value.\n// - Easily specifiable and implementable in multiple languages.\n// We don't care about cryptographic suitability.\nexport const digestForTemplateResult = (templateResult: TemplateResult) => {\n const hashes = new Uint32Array(digestSize).fill(5381);\n\n for (const s of templateResult.strings) {\n for (let i = 0; i < s.length; i++) {\n hashes[i % digestSize] = (hashes[i % digestSize] * 33) ^ s.charCodeAt(i);\n }\n }\n return btoa(String.fromCharCode(...new Uint8Array(hashes.buffer)));\n};\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * LitElement support for hydration of content rendered using lit-ssr.\n *\n * @packageDocumentation\n */\n\nimport type {PropertyValues} from '@lit/reactive-element';\nimport {render, RenderOptions} from 'lit-html';\nimport {hydrate} from 'lit-html/experimental-hydrate.js';\n\ninterface PatchableLitElement extends HTMLElement {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n new (...args: any[]): PatchableLitElement;\n enableUpdating(requestedUpdate?: boolean): void;\n createRenderRoot(): Element | ShadowRoot;\n renderRoot: HTMLElement | DocumentFragment;\n render(): unknown;\n renderOptions: RenderOptions;\n _$needsHydration: boolean;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nglobalThis.litElementHydrateSupport = ({\n LitElement,\n}: {\n LitElement: PatchableLitElement;\n}) => {\n const observedAttributes = Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(LitElement),\n 'observedAttributes'\n )!.get!;\n\n // Add `defer-hydration` to observedAttributes\n Object.defineProperty(LitElement, 'observedAttributes', {\n get() {\n return [...observedAttributes.call(this), 'defer-hydration'];\n },\n });\n\n // Enable element when 'defer-hydration' attribute is removed by calling the\n // super.connectedCallback()\n const attributeChangedCallback =\n LitElement.prototype.attributeChangedCallback;\n LitElement.prototype.attributeChangedCallback = function (\n name: string,\n old: string | null,\n value: string | null\n ) {\n if (name === 'defer-hydration' && value === null) {\n connectedCallback.call(this);\n }\n attributeChangedCallback.call(this, name, old, value);\n };\n\n // Override `connectedCallback` to capture whether we need hydration, and\n // defer `super.connectedCallback()` if the 'defer-hydration' attribute is set\n const connectedCallback = LitElement.prototype.connectedCallback;\n LitElement.prototype.connectedCallback = function (\n this: PatchableLitElement\n ) {\n // If the outer scope of this element has not yet been hydrated, wait until\n // 'defer-hydration' attribute has been removed to enable\n if (!this.hasAttribute('defer-hydration')) {\n connectedCallback.call(this);\n }\n };\n\n // If we've been server-side rendered, just return `this.shadowRoot`, don't\n // call the base implementation, which would also adopt styles (for now)\n const createRenderRoot = LitElement.prototype.createRenderRoot;\n LitElement.prototype.createRenderRoot = function (this: PatchableLitElement) {\n if (this.shadowRoot) {\n this._$needsHydration = true;\n return this.shadowRoot;\n } else {\n return createRenderRoot.call(this);\n }\n };\n\n // Hydrate on first update when needed\n const update = Object.getPrototypeOf(LitElement.prototype).update;\n LitElement.prototype.update = function (\n this: PatchableLitElement,\n changedProperties: PropertyValues\n ) {\n const value = this.render();\n // Since this is a patch, we can't call super.update(), so we capture\n // it off the proto chain and call it instead\n update.call(this, changedProperties);\n if (this._$needsHydration) {\n this._$needsHydration = false;\n hydrate(value, this.renderRoot, this.renderOptions);\n } else {\n render(value, this.renderRoot, this.renderOptions);\n }\n };\n};\n", "import 'lit-element/experimental-hydrate-support.js';\n\nconst registeredComponents : {\n [key: string]: true;\n} = {};\n\nexport let config : {\n suffix : string | false,\n};\n\n/**\n * Define Components\n * Gotchas:\n * - can't have two runtimes on same page, so need root to be unversioned and \n * child versioned (from same url)\n * - b/c the comp classes can only be registered once. The child should\n * always be bundled.\n * @param {object} args\n * @return {void}\n */\nexport async function defineComponents(\n args : {\n components?: string[],\n suffix?: string,\n } = {},\n) {\n // defaults to a runtime config w/ all comps, no suffix, and assets runtime.\n const {\n components = false,\n suffix = false,\n } = args;\n\n // Global Config\n config = {\n suffix,\n };\n\n const allComponents = components ? false : true;\n\n const suffixFinal = suffix ? `-${suffix}` : '';\n const promiseArr: Promise<void>[] = [];\n\n /**\n * Add to a promise\n * @param {string} compStr\n * @param {any} importCall\n */\n function addToPromise(compStr: string, importCall: any) {\n promiseArr.push((async () => {\n const compName = `${compStr}${suffixFinal}`;\n // avoid name dups (doesn't catch class dups!!!!)\n if ( !registeredComponents[compName] ) {\n registeredComponents[compName] = true;\n try {\n window.customElements.define(\n compName,\n (await importCall).default,\n );\n } catch (error) {\n console.error( compName, error );\n }\n }\n })());\n }\n\n /**\n * include\n * @argument {string} compStr\n * @return {boolean}\n */\n function include(compStr: string) {\n if (allComponents) return true;\n if (Array.isArray( components) ) {\n return components ? components.includes(compStr) : false;\n }\n }\n\n // need the import to be picked up by esbuild...\n if (include('scw-component')) {\n addToPromise('scw-component',\n import(`./scw-component/ScwComponent`));\n }\n if (include('scw-form-component')) {\n addToPromise('scw-form-component',\n import(`./scw-form-component/scw-form-component`) );\n }\n if (include('scw-card')) {\n addToPromise('scw-card',\n import(`./scw-card/ScwCard`));\n }\n if (include('scw-input-field')) {\n addToPromise('scw-input-field',\n import(`./scw-input-field/scw-input-field`) );\n }\n if (include('scw-input-layout')) {\n addToPromise('scw-input-layout',\n import(`./scw-input-layout/scw-input-layout`) );\n }\n if (include('scw-link')) {\n addToPromise('scw-link',\n import(`./scw-link/ScwLink`) );\n }\n if (include('scw-button')) {\n addToPromise('scw-button',\n import(`./scw-button/ScwButton`) );\n }\n if (include('scw-menu')) {\n addToPromise('scw-menu',\n import(`./scw-menu/ScwMenu`) );\n }\n if (include('scw-menu-item')) {\n addToPromise('scw-menu-item',\n import(`./scw-menu-item/ScwMenuItem`) );\n }\n if (include('scw-icon')) {\n addToPromise('scw-icon',\n import(`./scw-icon/ScwIcon`) );\n }\n if (include('scw-heading')) {\n addToPromise('scw-heading',\n import(`./scw-heading/ScwHeading`) );\n }\n if (include('scw-image')) {\n addToPromise('scw-image',\n import(`./scw-image/ScwImage`) );\n }\n if (include('scw-input')) {\n addToPromise('scw-input',\n import(`./scw-input/scw-input`) );\n }\n if (include('scw-single-input')) {\n addToPromise('scw-single-input',\n import(`./scw-single-input/scw-single-input`) );\n }\n if (include('scw-single-input-layout')) {\n addToPromise('scw-single-input-layout',\n import(`./scw-single-input-layout/scw-single-input-layout`) );\n }\n if (include('scw-responsive')) {\n addToPromise('scw-responsive',\n import(`./scw-responsive/scw-responsive`) );\n }\n if (include('scw-validation')) {\n addToPromise('scw-validation',\n import(`./scw-validation/scw-validation`) );\n }\n if (include('scw-validate')) {\n addToPromise('scw-validate',\n import(`./scw-validate/scw-validate`) );\n }\n if (include('scw-flex-h-component')) {\n addToPromise('scw-flex-h-component',\n import(`./scw-flex-h-component/scw-flex-h-component`) );\n }\n if (include('scw-flex-v-component')) {\n addToPromise('scw-flex-v-component',\n import(`./scw-flex-v-component/scw-flex-v-component`) );\n }\n if (include('scw-stack-component')) {\n addToPromise('scw-stack-component',\n import(`./scw-stack-component/scw-stack-component`) );\n }\n if (include('scw-layout-component')) {\n addToPromise('scw-layout-component',\n import(`./scw-layout-component/scw-layout-component`) );\n }\n if (include('scw-element-component')) {\n addToPromise('scw-element-component',\n import(`./scw-element-component/scw-element-component`) );\n }\n if (include('scw-center-component')) {\n addToPromise('scw-center-component',\n import(`./scw-center-component/ScwCenterComponent`) );\n }\n if (include('scw-float-component')) {\n addToPromise('scw-float-component',\n import(`./scw-float-component/scw-float-component`) );\n }\n if (include('scw-pane-component')) {\n addToPromise('scw-pane-component',\n import(`./scw-pane-component/scw-pane-component`) );\n }\n if (include('scw-form')) {\n addToPromise('scw-form',\n import(`./scw-form/scw-form`) );\n }\n if (include('scw-page-alert')) {\n addToPromise('scw-page-alert',\n import(`./scw-page-alert/scw-page-alert`) );\n }\n if (include('scw-link-base')) {\n addToPromise('scw-link-base',\n import(`./scw-link-base/ScwLinkBase`) );\n }\n if (include('scw-textarea')) {\n addToPromise('scw-textarea',\n import(`./scw-textarea/scw-textarea`) );\n }\n if (include('scw-select')) {\n addToPromise('scw-select',\n import(`./scw-select/scw-select`) );\n }\n if (include('scw-alert')) {\n addToPromise('scw-alert',\n import(`./scw-alert/ScwAlert`) );\n }\n\n return Promise.all(promiseArr);\n}\n"],
|
|
5
|
+
"mappings": "8FAeA,GAAA,CAAO,EAAY,GAAa,EAkBnB,EAAe,GAChB,AAAV,IAAU,MAAyB,AAAA,MAAT,IAAS,UAA4B,AAAA,MAAT,IAAS,WAnBjE,GAgCa,GAAmB,CAC9B,EACA,IAAA,CAAA,GAAA,GAAA,EAEA,MAAA,AAAA,KAAA,OAAA,AAEkD,CAAA,GAA7C,KAA6C,MAA7C,AAAA,IAAA,OAAA,OAAA,EAAuC,cAF5C,OAE4C,CAAA,GACvC,KADuC,MACvC,AAAA,IAAA,OAAA,OAAA,EAAuC,cAAM,CAAA,EAvCpD,GA+Da,GAAsB,GAAA,AAChC,EAA2B,UADK,OC9DnC,GAAA,CACE,EAAmB,EACnB,EAAa,EACb,EAAmB,EACnB,EAAY,EACZ,EAAc,GACZ,EAyFS,EAAU,CACrB,EACA,EACA,EAAkC,CAAA,IAAA,CAKlC,G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IX.js";import{a as o}from"./chunk.ZS4C3T6Z.js";import{g as a}from"./chunk.5YJY6NT6.js";var c=(e=>(e.text="text",e.boolean="boolean",e.submit="submit",e))(c||{}),h=(i=>(i.submit="submit",i.cancel="cancel",i))(h||{}),t=class extends f{constructor(){super(...arguments);this.formType="text";this.value="";this.placeholder="";this.selected=!1;this.readOnly=!1;this.required=!1;this.requiredLabel=" *";this.focused=!1;this.invalid=!1}connectedCallback(){super.connectedCallback(),this.required&&this.createAndAddValidationRule("required",this.requiredFeedback)}decorateValues(i){if(!this.name){this.warn(`${this.element} didn't find a name`);return}this.formType==="boolean"?i[this.name]=this.selected:i[this.name]=this.value}findIfRequired(){let i=this.findValidationRules();return i?i.isRequired():!1}findValidationRules(){return Array.from(this.children).find(l=>l.nodeName.indexOf("SCW-VALIDATION")===0)}validate(){let i=this.findValidationRules(),e=[];return i&&(e=i.validate(this.value)),this.invalid=e.length>0,this.invalid?this.feedback=e[0].feedback:this.feedback="",e}createValidateRule(){return document.createElement(`scw-${"validate"}${u()}`)}addValidationRule(i){let e=this.findValidationRules();e||(e=document.createElement(`scw-${"validation"}${u()}`),this.prepend(e)),Array.from(e.children).find(s=>s.getAttribute("type")===i.type)||e.appendChild(i)}createAndAddValidationRule(i,e){let l=this.createValidateRule();l.setAttribute("type",i),e&&l.setAttribute("feedback",e),this.addValidationRule(l)}removeValidationRule(i){let e=this.findValidationRules();if(!e)return;let d=Array.from(e.children).find(s=>s.type===i);d&&d.parentNode&&d.parentNode.removeChild(d)}render(){return o`
|
|
2
|
+
scw-form-component
|
|
3
|
+
`}};a([n({type:c,reflect:!0,attribute:"form-type"})],t.prototype,"formType",2),a([n({type:String})],t.prototype,"name",2),a([n({type:String})],t.prototype,"value",2),a([n({type:String})],t.prototype,"placeholder",2),a([n({type:String})],t.prototype,"selected",2),a([n({type:Boolean,attribute:"read-only"})],t.prototype,"readOnly",2),a([n({type:Boolean})],t.prototype,"required",2),a([n({type:String,attribute:"required-label"})],t.prototype,"requiredLabel",2),a([n({type:String,attribute:"required-feedback"})],t.prototype,"requiredFeedback",2),a([r()],t.prototype,"feedback",2),a([r()],t.prototype,"focused",2),a([r()],t.prototype,"invalid",2);export{c as a,h as b,t as c};
|
|
4
|
+
//# sourceMappingURL=chunk.ZWJHKP3F.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/scw-form-component/scw-form-component.ts"],
|
|
4
|
+
"sourcesContent": ["import {html} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport ScwComponent from '../scw-component/ScwComponent';\nimport {Components} from '../utils/enums/Components';\nimport ScwValidate from '../scw-validate/scw-validate';\nimport ScwValidation from '../scw-validation/scw-validation';\nimport {ValidationResult, ValidationTypes}\n from '../scw-validate/validationTypes';\nimport getSuffix from '../utils/suffix';\n\nexport enum ScwFormComponentTypes {\n text = 'text',\n boolean = 'boolean',\n submit = 'submit'\n}\n\nexport enum ScwFormComponentSubmitTypes {\n submit = 'submit',\n cancel = 'cancel'\n}\n\n/**\n * ScwFormComponent\n * @class\n * @tag scw-form-component\n */\nexport default class ScwFormComponent extends ScwComponent {\n // ============== ScwFormComponent ===========================================\n /** (ScwFormComponent) the usage in a form (& scw-form a query target) */\n @property({\n type: ScwFormComponentTypes,\n reflect: true,\n attribute: 'form-type',\n })\n formType: ScwFormComponentTypes = ScwFormComponentTypes.text;\n\n /** (ScwFormComponent) name to identify form element and attach data */\n @property({type: String})\n name: string | undefined;\n\n /** (ScwFormComponent) name to identify form element and attach data */\n @property({type: String})\n value: string = '';\n\n /** (ScwFormComponent) text showing when there is no value */\n @property({type: String})\n placeholder: string = '';\n\n /** (ScwFormComponent) name to identify form element and attach data */\n @property({type: String})\n selected: boolean = false;\n\n /** (ScwFormComponent) read-only state management */\n @property({type: Boolean, attribute: 'read-only'})\n readOnly: boolean = false;\n\n /** (ScwFormComponent) required state management */\n @property({type: Boolean})\n required: boolean = false;\n\n /** (ScwFormComponent) label indicator for required */\n @property({type: String, attribute: 'required-label'})\n requiredLabel: string = ' *';\n\n /** (ScwFormComponent) label indicator for required */\n @property({type: String, attribute: 'required-feedback'})\n requiredFeedback?: string;\n\n // ===== STATE ===============================================================\n /** the text to use for feedback */\n @state() feedback: string | undefined;\n\n /** determines whether the input is focused or not */\n @state() focused : boolean = false;\n\n /** whether this form element is valid, passed validation */\n @state() invalid: boolean = false;\n\n /** connectedCallback */\n connectedCallback(): void {\n super.connectedCallback();\n if (this.required) {\n this.createAndAddValidationRule(\n ValidationTypes.required,\n this.requiredFeedback,\n );\n }\n }\n\n /** (ScwFormComponent) each form element to decorates the final data object\n * @param {Object} formData\n */\n decorateValues(formData: {}): void {\n if (!this.name) {\n this.warn(`${this.element} didn't find a name`);\n return;\n }\n if (this.formType === ScwFormComponentTypes.boolean) {\n formData[this.name] = this.selected;// ? 'true' : 'false';\n } else {\n formData[this.name] = this.value;\n }\n }\n\n /**\n * Check to see if form element is required w/o knowing if there is validation\n * @return {boolean}\n */\n findIfRequired() : boolean {\n const rules = this.findValidationRules();\n if (rules) {\n return rules.isRequired();\n }\n return false;\n }\n\n /**\n * Find validation child if there...\n * @return {ScwValidation | undefined}\n */\n findValidationRules() : ScwValidation | undefined {\n const childrenArr = Array.from(this.children);\n const validation = childrenArr.find((child: any) => {\n // component may not be initialized yet...\n return child.nodeName.indexOf('SCW-VALIDATION') === 0;\n // return child.element === Components.validation;\n });\n return validation as unknown as ScwValidation;\n }\n\n /**\n * run the validation rules if there...\n * @param {string} value\n * @return {ValidationResult[]}\n */\n validate() : ValidationResult[] {\n const validation = this.findValidationRules();\n let results : ValidationResult[] = [];\n if (validation) {\n results = validation.validate(this.value);\n }\n this.invalid = ( results.length > 0);\n if (this.invalid ) {\n this.feedback = results[0].feedback;\n } else {\n this.feedback = '';\n }\n return results;\n }\n\n\n /**\n * create a validation rule from scratch\n * @return {ScwValidate}\n */\n createValidateRule() : ScwValidate {\n return document.createElement(\n `scw-${Components.validate}${getSuffix()}`,\n ) as unknown as ScwValidate;\n }\n\n /**\n * add validation to to child validation (create if not there)\n * @param {ScwValidate} rule\n */\n addValidationRule(rule: ScwValidate ) {\n let validationRules = this.findValidationRules();\n if (!validationRules) {\n validationRules = document.createElement(\n `scw-${Components.validation}${getSuffix()}`,\n ) as unknown as ScwValidation;\n this.prepend( validationRules );\n }\n // Check for dups?\n const children = Array.from(validationRules.children);\n const existingRule = children.find((child : any) => {\n return child.getAttribute('type') === rule.type;\n });\n if ( !existingRule ) {\n validationRules.appendChild(rule);\n }\n }\n\n /**\n * create a validation of a certain type...\n * @param {ValidationTypes} type\n * @param {string} feedbackOverride\n */\n createAndAddValidationRule(\n type: ValidationTypes,\n feedbackOverride?: string,\n ) {\n const rule = this.createValidateRule();\n rule.setAttribute('type', type );// .type = type;\n if (feedbackOverride) {\n rule.setAttribute('feedback', feedbackOverride );\n }\n this.addValidationRule( rule );\n }\n\n /**\n *\n * @param {ValidationTypes} type\n */\n removeValidationRule(\n type: ValidationTypes,\n ) {\n const validationRules = this.findValidationRules();\n if (!validationRules) return;\n const children = Array.from(validationRules.children);\n const child = children.find(\n (child : any) => child.type === type,\n ) as unknown as HTMLElement;\n if ( child && child.parentNode ) child.parentNode.removeChild(child);\n }\n\n /**\n * render\n * @return {object} component DOM\n */\n render(): object {\n return html`\n scw-form-component\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": "8KAUO,GAAK,GAAL,CAAK,GACV,QAAO,OACP,UAAU,UACV,SAAS,SAHC,WAMA,EAAL,CAAK,GACV,UAAS,SACT,SAAS,SAFC,WAUZ,eAA8C,EAAa,CAA3D,kCAQI,cAAkC,OAQlC,WAAgB,GAIhB,iBAAsB,GAItB,cAAoB,GAIpB,cAAoB,GAIpB,cAAoB,GAIpB,mBAAwB,KAWjB,aAAoB,GAGpB,aAAmB,GAG5B,mBAA0B,CACxB,MAAM,kBAAkB,EACpB,KAAK,UACP,KAAK,2BACH,WACA,KAAK,gBACP,CAEJ,CAKA,eAA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AAM,KAAK,EAAgB,QAAQ,EAC7B,KACrB,AAAC,GAAgB,EAAM,OAAS,CAClC,EACA,AAAK,GAAS,EAAM,YAAa,EAAM,WAAW,YAAY,CAAK,CACrE,CAMA,QAAiB,CACf,MAAO;AAAA;AAAA,KAGT,CACF,EA/LI,GALF,AAAC,EAAS,CACR,KAAM,EACN,QAAS,GACT,UAAW,WACb,CAAC,GACC,AARJ,EAQI,wBAIA,GADF,AAAC,EAAS,CAAC,KAAM,MAAM,CAAC,GACtB,AAZJ,EAYI,oBAIA,GADF,AAAC,EAAS,CAAC,KAAM,MAAM,CAAC,GACtB,AAhBJ,EAgBI,qBAIA,GADF,AAAC,EAAS,CAAC,KAAM,MAAM,CAAC,GACtB,AApBJ,EAoBI,2BAIA,GADF,AAAC,EAAS,CAAC,KAAM,MAAM,CAAC,GACtB,AAxBJ,EAwBI,wBAIA,GADF,AAAC,EAAS,CAAC,KAAM,QAAS,UAAW,WAAW,CAAC,GAC/C,AA5BJ,EA4BI,wBAIA,GADF,AAAC,EAAS,CAAC,KAAM,OAAO,CAAC,GACvB,AAhCJ,EAgCI,wBAIA,GADF,AAAC,EAAS,CAAC,KAAM,OAAQ,UAAW,gBAAgB,CAAC,GACnD,AApCJ,EAoCI,6BAIA,GADF,AAAC,EAAS,CAAC,KAAM,OAAQ,UAAW,mBAAmB,CAAC,GACtD,AAxCJ,EAwCI,gCAIO,GAAT,AAAC,EAAM,GAAE,AA5CX,EA4CW,wBAGA,GAAT,AAAC,EAAM,GAAE,AA/CX,EA+CW,uBAGA,GAAT,AAAC,EAAM,GAAE,AAlDX,EAkDW",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1187,6 +1187,16 @@
|
|
|
1187
1187
|
"description": "(ScwCard) Label on the link",
|
|
1188
1188
|
"attribute": "linkLabel"
|
|
1189
1189
|
},
|
|
1190
|
+
{
|
|
1191
|
+
"kind": "field",
|
|
1192
|
+
"name": "preload",
|
|
1193
|
+
"type": {
|
|
1194
|
+
"text": "boolean"
|
|
1195
|
+
},
|
|
1196
|
+
"default": "false",
|
|
1197
|
+
"description": "(ScwCard) whether to preload image or not",
|
|
1198
|
+
"attribute": "preload"
|
|
1199
|
+
},
|
|
1190
1200
|
{
|
|
1191
1201
|
"kind": "field",
|
|
1192
1202
|
"name": "size",
|
|
@@ -1564,6 +1574,15 @@
|
|
|
1564
1574
|
"description": "(ScwCard) Label on the link",
|
|
1565
1575
|
"fieldName": "linkLabel"
|
|
1566
1576
|
},
|
|
1577
|
+
{
|
|
1578
|
+
"name": "preload",
|
|
1579
|
+
"type": {
|
|
1580
|
+
"text": "boolean"
|
|
1581
|
+
},
|
|
1582
|
+
"default": "false",
|
|
1583
|
+
"description": "(ScwCard) whether to preload image or not",
|
|
1584
|
+
"fieldName": "preload"
|
|
1585
|
+
},
|
|
1567
1586
|
{
|
|
1568
1587
|
"name": "size",
|
|
1569
1588
|
"type": {
|
|
@@ -4288,6 +4307,25 @@
|
|
|
4288
4307
|
"description": "(ScwImage) src of image",
|
|
4289
4308
|
"attribute": "src"
|
|
4290
4309
|
},
|
|
4310
|
+
{
|
|
4311
|
+
"kind": "field",
|
|
4312
|
+
"name": "alt",
|
|
4313
|
+
"type": {
|
|
4314
|
+
"text": "string | undefined"
|
|
4315
|
+
},
|
|
4316
|
+
"description": "(ScwImage) alt of image",
|
|
4317
|
+
"attribute": "alt"
|
|
4318
|
+
},
|
|
4319
|
+
{
|
|
4320
|
+
"kind": "field",
|
|
4321
|
+
"name": "preload",
|
|
4322
|
+
"type": {
|
|
4323
|
+
"text": "boolean"
|
|
4324
|
+
},
|
|
4325
|
+
"default": "false",
|
|
4326
|
+
"description": "(ScwImage) whether to preload image or not",
|
|
4327
|
+
"attribute": "preload"
|
|
4328
|
+
},
|
|
4291
4329
|
{
|
|
4292
4330
|
"kind": "field",
|
|
4293
4331
|
"name": "noLazyLoading",
|
|
@@ -4665,6 +4703,23 @@
|
|
|
4665
4703
|
"description": "(ScwImage) src of image",
|
|
4666
4704
|
"fieldName": "src"
|
|
4667
4705
|
},
|
|
4706
|
+
{
|
|
4707
|
+
"name": "alt",
|
|
4708
|
+
"type": {
|
|
4709
|
+
"text": "string | undefined"
|
|
4710
|
+
},
|
|
4711
|
+
"description": "(ScwImage) alt of image",
|
|
4712
|
+
"fieldName": "alt"
|
|
4713
|
+
},
|
|
4714
|
+
{
|
|
4715
|
+
"name": "preload",
|
|
4716
|
+
"type": {
|
|
4717
|
+
"text": "boolean"
|
|
4718
|
+
},
|
|
4719
|
+
"default": "false",
|
|
4720
|
+
"description": "(ScwImage) whether to preload image or not",
|
|
4721
|
+
"fieldName": "preload"
|
|
4722
|
+
},
|
|
4668
4723
|
{
|
|
4669
4724
|
"name": "no-lazy-loading",
|
|
4670
4725
|
"type": {
|
|
@@ -6171,69 +6226,13 @@
|
|
|
6171
6226
|
},
|
|
6172
6227
|
{
|
|
6173
6228
|
"kind": "javascript-module",
|
|
6174
|
-
"path": "src/scw-
|
|
6229
|
+
"path": "src/scw-layout-component/scw-layout-component.ts",
|
|
6175
6230
|
"declarations": [
|
|
6176
6231
|
{
|
|
6177
6232
|
"kind": "class",
|
|
6178
|
-
"description": "
|
|
6179
|
-
"name": "
|
|
6233
|
+
"description": "ScwLayoutComponent",
|
|
6234
|
+
"name": "ScwLayoutComponent",
|
|
6180
6235
|
"members": [
|
|
6181
|
-
{
|
|
6182
|
-
"kind": "field",
|
|
6183
|
-
"name": "label",
|
|
6184
|
-
"type": {
|
|
6185
|
-
"text": "string | undefined"
|
|
6186
|
-
},
|
|
6187
|
-
"description": "(ScwInputLayout) the text to use for the label",
|
|
6188
|
-
"attribute": "label"
|
|
6189
|
-
},
|
|
6190
|
-
{
|
|
6191
|
-
"kind": "field",
|
|
6192
|
-
"name": "feedback",
|
|
6193
|
-
"type": {
|
|
6194
|
-
"text": "string | undefined"
|
|
6195
|
-
},
|
|
6196
|
-
"description": "(ScwInputLayout) the text to use for feedback",
|
|
6197
|
-
"attribute": "feedback"
|
|
6198
|
-
},
|
|
6199
|
-
{
|
|
6200
|
-
"kind": "field",
|
|
6201
|
-
"name": "hideLabel",
|
|
6202
|
-
"type": {
|
|
6203
|
-
"text": "boolean"
|
|
6204
|
-
},
|
|
6205
|
-
"default": "false",
|
|
6206
|
-
"description": "(ScwInputLayout) hides the main label",
|
|
6207
|
-
"attribute": "hide-label"
|
|
6208
|
-
},
|
|
6209
|
-
{
|
|
6210
|
-
"kind": "field",
|
|
6211
|
-
"name": "hideFeedback",
|
|
6212
|
-
"type": {
|
|
6213
|
-
"text": "boolean"
|
|
6214
|
-
},
|
|
6215
|
-
"default": "false",
|
|
6216
|
-
"description": "(ScwInputLayout) hides the feedback label",
|
|
6217
|
-
"attribute": "hide-feedback"
|
|
6218
|
-
},
|
|
6219
|
-
{
|
|
6220
|
-
"kind": "field",
|
|
6221
|
-
"name": "rightIcon",
|
|
6222
|
-
"type": {
|
|
6223
|
-
"text": "string | undefined"
|
|
6224
|
-
},
|
|
6225
|
-
"description": "(ScwInputLayout) shows first right icon and determines the icon svg.",
|
|
6226
|
-
"attribute": "right-icon"
|
|
6227
|
-
},
|
|
6228
|
-
{
|
|
6229
|
-
"kind": "field",
|
|
6230
|
-
"name": "right2Icon",
|
|
6231
|
-
"type": {
|
|
6232
|
-
"text": "string | undefined"
|
|
6233
|
-
},
|
|
6234
|
-
"description": "(ScwInputLayout) shows second right icon and determines the icon svg.",
|
|
6235
|
-
"attribute": "right-2-icon"
|
|
6236
|
-
},
|
|
6237
6236
|
{
|
|
6238
6237
|
"kind": "field",
|
|
6239
6238
|
"name": "element",
|
|
@@ -6254,7 +6253,7 @@
|
|
|
6254
6253
|
"type": {
|
|
6255
6254
|
"text": "string"
|
|
6256
6255
|
},
|
|
6257
|
-
"default": "
|
|
6256
|
+
"default": "true",
|
|
6258
6257
|
"description": "(ScwComponent) whether or not to look to attributes for responsive sizing\nviewport | element | none",
|
|
6259
6258
|
"attribute": "responsive",
|
|
6260
6259
|
"inheritedFrom": {
|
|
@@ -6340,57 +6339,13 @@
|
|
|
6340
6339
|
}
|
|
6341
6340
|
}
|
|
6342
6341
|
],
|
|
6342
|
+
"superclass": {
|
|
6343
|
+
"name": "ScwComponent",
|
|
6344
|
+
"module": "/src/scw-component/ScwComponent"
|
|
6345
|
+
},
|
|
6346
|
+
"tagName": "scw-layout-component",
|
|
6347
|
+
"customElement": true,
|
|
6343
6348
|
"attributes": [
|
|
6344
|
-
{
|
|
6345
|
-
"name": "label",
|
|
6346
|
-
"type": {
|
|
6347
|
-
"text": "string | undefined"
|
|
6348
|
-
},
|
|
6349
|
-
"description": "(ScwInputLayout) the text to use for the label",
|
|
6350
|
-
"fieldName": "label"
|
|
6351
|
-
},
|
|
6352
|
-
{
|
|
6353
|
-
"name": "feedback",
|
|
6354
|
-
"type": {
|
|
6355
|
-
"text": "string | undefined"
|
|
6356
|
-
},
|
|
6357
|
-
"description": "(ScwInputLayout) the text to use for feedback",
|
|
6358
|
-
"fieldName": "feedback"
|
|
6359
|
-
},
|
|
6360
|
-
{
|
|
6361
|
-
"name": "hide-label",
|
|
6362
|
-
"type": {
|
|
6363
|
-
"text": "boolean"
|
|
6364
|
-
},
|
|
6365
|
-
"default": "false",
|
|
6366
|
-
"description": "(ScwInputLayout) hides the main label",
|
|
6367
|
-
"fieldName": "hideLabel"
|
|
6368
|
-
},
|
|
6369
|
-
{
|
|
6370
|
-
"name": "hide-feedback",
|
|
6371
|
-
"type": {
|
|
6372
|
-
"text": "boolean"
|
|
6373
|
-
},
|
|
6374
|
-
"default": "false",
|
|
6375
|
-
"description": "(ScwInputLayout) hides the feedback label",
|
|
6376
|
-
"fieldName": "hideFeedback"
|
|
6377
|
-
},
|
|
6378
|
-
{
|
|
6379
|
-
"name": "right-icon",
|
|
6380
|
-
"type": {
|
|
6381
|
-
"text": "string | undefined"
|
|
6382
|
-
},
|
|
6383
|
-
"description": "(ScwInputLayout) shows first right icon and determines the icon svg.",
|
|
6384
|
-
"fieldName": "rightIcon"
|
|
6385
|
-
},
|
|
6386
|
-
{
|
|
6387
|
-
"name": "right-2-icon",
|
|
6388
|
-
"type": {
|
|
6389
|
-
"text": "string | undefined"
|
|
6390
|
-
},
|
|
6391
|
-
"description": "(ScwInputLayout) shows second right icon and determines the icon svg.",
|
|
6392
|
-
"fieldName": "right2Icon"
|
|
6393
|
-
},
|
|
6394
6349
|
{
|
|
6395
6350
|
"name": "responsive",
|
|
6396
6351
|
"type": {
|
|
@@ -6429,13 +6384,7 @@
|
|
|
6429
6384
|
"module": "src/scw-component/ScwComponent.ts"
|
|
6430
6385
|
}
|
|
6431
6386
|
}
|
|
6432
|
-
]
|
|
6433
|
-
"superclass": {
|
|
6434
|
-
"name": "ScwComponent",
|
|
6435
|
-
"module": "/src/scw-component/ScwComponent"
|
|
6436
|
-
},
|
|
6437
|
-
"tagName": "scw-input-layout",
|
|
6438
|
-
"customElement": true
|
|
6387
|
+
]
|
|
6439
6388
|
}
|
|
6440
6389
|
],
|
|
6441
6390
|
"exports": [
|
|
@@ -6443,21 +6392,77 @@
|
|
|
6443
6392
|
"kind": "js",
|
|
6444
6393
|
"name": "default",
|
|
6445
6394
|
"declaration": {
|
|
6446
|
-
"name": "
|
|
6447
|
-
"module": "src/scw-
|
|
6395
|
+
"name": "ScwLayoutComponent",
|
|
6396
|
+
"module": "src/scw-layout-component/scw-layout-component.ts"
|
|
6448
6397
|
}
|
|
6449
6398
|
}
|
|
6450
6399
|
]
|
|
6451
6400
|
},
|
|
6452
6401
|
{
|
|
6453
6402
|
"kind": "javascript-module",
|
|
6454
|
-
"path": "src/scw-layout
|
|
6403
|
+
"path": "src/scw-input-layout/scw-input-layout.ts",
|
|
6455
6404
|
"declarations": [
|
|
6456
6405
|
{
|
|
6457
6406
|
"kind": "class",
|
|
6458
|
-
"description": "
|
|
6459
|
-
"name": "
|
|
6407
|
+
"description": "ScwInputLayout",
|
|
6408
|
+
"name": "ScwInputLayout",
|
|
6460
6409
|
"members": [
|
|
6410
|
+
{
|
|
6411
|
+
"kind": "field",
|
|
6412
|
+
"name": "label",
|
|
6413
|
+
"type": {
|
|
6414
|
+
"text": "string | undefined"
|
|
6415
|
+
},
|
|
6416
|
+
"description": "(ScwInputLayout) the text to use for the label",
|
|
6417
|
+
"attribute": "label"
|
|
6418
|
+
},
|
|
6419
|
+
{
|
|
6420
|
+
"kind": "field",
|
|
6421
|
+
"name": "feedback",
|
|
6422
|
+
"type": {
|
|
6423
|
+
"text": "string | undefined"
|
|
6424
|
+
},
|
|
6425
|
+
"description": "(ScwInputLayout) the text to use for feedback",
|
|
6426
|
+
"attribute": "feedback"
|
|
6427
|
+
},
|
|
6428
|
+
{
|
|
6429
|
+
"kind": "field",
|
|
6430
|
+
"name": "hideLabel",
|
|
6431
|
+
"type": {
|
|
6432
|
+
"text": "boolean"
|
|
6433
|
+
},
|
|
6434
|
+
"default": "false",
|
|
6435
|
+
"description": "(ScwInputLayout) hides the main label",
|
|
6436
|
+
"attribute": "hide-label"
|
|
6437
|
+
},
|
|
6438
|
+
{
|
|
6439
|
+
"kind": "field",
|
|
6440
|
+
"name": "hideFeedback",
|
|
6441
|
+
"type": {
|
|
6442
|
+
"text": "boolean"
|
|
6443
|
+
},
|
|
6444
|
+
"default": "false",
|
|
6445
|
+
"description": "(ScwInputLayout) hides the feedback label",
|
|
6446
|
+
"attribute": "hide-feedback"
|
|
6447
|
+
},
|
|
6448
|
+
{
|
|
6449
|
+
"kind": "field",
|
|
6450
|
+
"name": "rightIcon",
|
|
6451
|
+
"type": {
|
|
6452
|
+
"text": "string | undefined"
|
|
6453
|
+
},
|
|
6454
|
+
"description": "(ScwInputLayout) shows first right icon and determines the icon svg.",
|
|
6455
|
+
"attribute": "right-icon"
|
|
6456
|
+
},
|
|
6457
|
+
{
|
|
6458
|
+
"kind": "field",
|
|
6459
|
+
"name": "right2Icon",
|
|
6460
|
+
"type": {
|
|
6461
|
+
"text": "string | undefined"
|
|
6462
|
+
},
|
|
6463
|
+
"description": "(ScwInputLayout) shows second right icon and determines the icon svg.",
|
|
6464
|
+
"attribute": "right-2-icon"
|
|
6465
|
+
},
|
|
6461
6466
|
{
|
|
6462
6467
|
"kind": "field",
|
|
6463
6468
|
"name": "element",
|
|
@@ -6478,7 +6483,7 @@
|
|
|
6478
6483
|
"type": {
|
|
6479
6484
|
"text": "string"
|
|
6480
6485
|
},
|
|
6481
|
-
"default": "
|
|
6486
|
+
"default": "false",
|
|
6482
6487
|
"description": "(ScwComponent) whether or not to look to attributes for responsive sizing\nviewport | element | none",
|
|
6483
6488
|
"attribute": "responsive",
|
|
6484
6489
|
"inheritedFrom": {
|
|
@@ -6564,13 +6569,57 @@
|
|
|
6564
6569
|
}
|
|
6565
6570
|
}
|
|
6566
6571
|
],
|
|
6567
|
-
"superclass": {
|
|
6568
|
-
"name": "ScwComponent",
|
|
6569
|
-
"module": "/src/scw-component/ScwComponent"
|
|
6570
|
-
},
|
|
6571
|
-
"tagName": "scw-layout-component",
|
|
6572
|
-
"customElement": true,
|
|
6573
6572
|
"attributes": [
|
|
6573
|
+
{
|
|
6574
|
+
"name": "label",
|
|
6575
|
+
"type": {
|
|
6576
|
+
"text": "string | undefined"
|
|
6577
|
+
},
|
|
6578
|
+
"description": "(ScwInputLayout) the text to use for the label",
|
|
6579
|
+
"fieldName": "label"
|
|
6580
|
+
},
|
|
6581
|
+
{
|
|
6582
|
+
"name": "feedback",
|
|
6583
|
+
"type": {
|
|
6584
|
+
"text": "string | undefined"
|
|
6585
|
+
},
|
|
6586
|
+
"description": "(ScwInputLayout) the text to use for feedback",
|
|
6587
|
+
"fieldName": "feedback"
|
|
6588
|
+
},
|
|
6589
|
+
{
|
|
6590
|
+
"name": "hide-label",
|
|
6591
|
+
"type": {
|
|
6592
|
+
"text": "boolean"
|
|
6593
|
+
},
|
|
6594
|
+
"default": "false",
|
|
6595
|
+
"description": "(ScwInputLayout) hides the main label",
|
|
6596
|
+
"fieldName": "hideLabel"
|
|
6597
|
+
},
|
|
6598
|
+
{
|
|
6599
|
+
"name": "hide-feedback",
|
|
6600
|
+
"type": {
|
|
6601
|
+
"text": "boolean"
|
|
6602
|
+
},
|
|
6603
|
+
"default": "false",
|
|
6604
|
+
"description": "(ScwInputLayout) hides the feedback label",
|
|
6605
|
+
"fieldName": "hideFeedback"
|
|
6606
|
+
},
|
|
6607
|
+
{
|
|
6608
|
+
"name": "right-icon",
|
|
6609
|
+
"type": {
|
|
6610
|
+
"text": "string | undefined"
|
|
6611
|
+
},
|
|
6612
|
+
"description": "(ScwInputLayout) shows first right icon and determines the icon svg.",
|
|
6613
|
+
"fieldName": "rightIcon"
|
|
6614
|
+
},
|
|
6615
|
+
{
|
|
6616
|
+
"name": "right-2-icon",
|
|
6617
|
+
"type": {
|
|
6618
|
+
"text": "string | undefined"
|
|
6619
|
+
},
|
|
6620
|
+
"description": "(ScwInputLayout) shows second right icon and determines the icon svg.",
|
|
6621
|
+
"fieldName": "right2Icon"
|
|
6622
|
+
},
|
|
6574
6623
|
{
|
|
6575
6624
|
"name": "responsive",
|
|
6576
6625
|
"type": {
|
|
@@ -6609,7 +6658,13 @@
|
|
|
6609
6658
|
"module": "src/scw-component/ScwComponent.ts"
|
|
6610
6659
|
}
|
|
6611
6660
|
}
|
|
6612
|
-
]
|
|
6661
|
+
],
|
|
6662
|
+
"superclass": {
|
|
6663
|
+
"name": "ScwComponent",
|
|
6664
|
+
"module": "/src/scw-component/ScwComponent"
|
|
6665
|
+
},
|
|
6666
|
+
"tagName": "scw-input-layout",
|
|
6667
|
+
"customElement": true
|
|
6613
6668
|
}
|
|
6614
6669
|
],
|
|
6615
6670
|
"exports": [
|
|
@@ -6617,8 +6672,8 @@
|
|
|
6617
6672
|
"kind": "js",
|
|
6618
6673
|
"name": "default",
|
|
6619
6674
|
"declaration": {
|
|
6620
|
-
"name": "
|
|
6621
|
-
"module": "src/scw-layout
|
|
6675
|
+
"name": "ScwInputLayout",
|
|
6676
|
+
"module": "src/scw-input-layout/scw-input-layout.ts"
|
|
6622
6677
|
}
|
|
6623
6678
|
}
|
|
6624
6679
|
]
|
|
@@ -84,6 +84,16 @@
|
|
|
84
84
|
"description": "(ScwCard) Label on the link",
|
|
85
85
|
"attribute": "linkLabel"
|
|
86
86
|
},
|
|
87
|
+
{
|
|
88
|
+
"kind": "field",
|
|
89
|
+
"name": "preload",
|
|
90
|
+
"type": {
|
|
91
|
+
"text": "boolean"
|
|
92
|
+
},
|
|
93
|
+
"default": "false",
|
|
94
|
+
"description": "(ScwCard) whether to preload image or not",
|
|
95
|
+
"attribute": "preload"
|
|
96
|
+
},
|
|
87
97
|
{
|
|
88
98
|
"kind": "field",
|
|
89
99
|
"name": "size",
|
|
@@ -461,6 +471,15 @@
|
|
|
461
471
|
"description": "(ScwCard) Label on the link",
|
|
462
472
|
"fieldName": "linkLabel"
|
|
463
473
|
},
|
|
474
|
+
{
|
|
475
|
+
"name": "preload",
|
|
476
|
+
"type": {
|
|
477
|
+
"text": "boolean"
|
|
478
|
+
},
|
|
479
|
+
"default": "false",
|
|
480
|
+
"description": "(ScwCard) whether to preload image or not",
|
|
481
|
+
"fieldName": "preload"
|
|
482
|
+
},
|
|
464
483
|
{
|
|
465
484
|
"name": "size",
|
|
466
485
|
"type": {
|