@startinblox/core 0.17.19 → 0.17.21-beta.10

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.
@@ -286,7 +286,7 @@ const WidgetMixin = {
286
286
  };
287
287
  const escapedField = this.getEscapedField(field); // transfer all multiple-[field]-[attr] attributes as [attr] for multiple widget [field]
288
288
 
289
- const multipleAttributes = ['fields', 'label', 'widget', 'add-label', 'remove-label', 'next', 'empty-widget'];
289
+ const multipleAttributes = ['fields', 'label', 'widget', 'add-label', 'remove-label', 'next', 'empty-widget', 'add-class', 'remove-class'];
290
290
 
291
291
  for (let attr of multipleAttributes) this.addToAttributes("multiple-".concat(escapedField, "-").concat(attr), attr, attrs); // transfer all [attr]-[field] attributes as [attr] attribute for widget [field]
292
292
 
@@ -294,7 +294,7 @@ const WidgetMixin = {
294
294
  const defaultAttributes = ['range', 'enum', 'label', 'placeholder', 'class',,
295
295
  /* 'widget', */
296
296
  'required', 'editable', 'autocomplete', 'upload-url', 'option-label', 'option-value', 'order-by', // deprecated. Remove in 0.15
297
- 'each-label', 'order-asc', 'order-desc', 'min', 'max', 'pattern', 'title', 'start-value', 'end-value', 'alt', 'step', 'maxlength', 'minlength', 'search-text', 'search-placeholder'];
297
+ 'each-label', 'order-asc', 'order-desc', 'min', 'max', 'pattern', 'title', 'start-value', 'end-value', 'alt', 'step', 'maxlength', 'minlength', 'search-text', 'search-placeholder', 'link-text'];
298
298
 
299
299
  for (let attr of defaultAttributes) this.addToAttributes("".concat(attr, "-").concat(escapedField), attr, attrs);
300
300
 
@@ -1 +1 @@
1
- {"version":3,"sources":["widgetMixin.ts"],"names":["spread","preHTML","parseFieldsString","findClosingBracketMatchIndex","newWidgetFactory","WidgetType","html","render","ifDefined","WidgetMixin","name","use","attributes","fields","type","String","default","undefined","initialState","nameWidgets","_div","created","attached","dataSrc","resource","noRender","populate","parentElement","div","document","createElement","element","appendChild","value","widgets","map","querySelector","getFields","attr","isContainer","res","console","error","Error","prop","properties","startsWith","push","getAction","field","action","getAttribute","editable","hasAttribute","getSetRegexp","RegExp","getSet","setString","match","firstSetBracket","indexOf","length","lastSetBracket","set","substring","isSet","foundSets","isString","fetchValue","getValue","escapedField","getEscapedField","resourceValue","empty","widgetFromTagName","tagName","CUSTOM","USER","customElements","get","NATIVE","getWidget","widget","defaultWidget","defaultSetWidget","multiple","attribute","defaultMultipleWidget","addToAttributes","lookForAttr","setAttrKey","widgetAttributes","attrs","multipleAttributes","defaultAttributes","addableAttributes","Array","from","filter","a","replace","resourceId","createWidgetTemplate","transformAttributes","createString","createSet","currentResource","widgetMeta","widgetTemplate","class","defineAttribute","setAttribute","setWidget","setAttributes","initializing","Object","keys","component","setFields","hasOnlyEmpty","valueSet","widgetsTemplate","Promise","all","template","slice"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,MAAT,EAAiBC,OAAjB,QAAgC,qBAAhC;AACA,SAASC,iBAAT,EAA4BC,4BAA5B,QAAgE,iBAAhE;AACA,SAASC,gBAAT,QAAiC,mCAAjC;AACA,SAA0BC,UAA1B,QAAsD,cAAtD;AACA,SAASC,IAAT,EAAeC,MAAf,QAA6C,UAA7C;AACA,SAASC,SAAT,QAA0B,gCAA1B;AAEA,MAAMC,WAAW,GAAG;AAClBC,EAAAA,IAAI,EAAE,cADY;AAElBC,EAAAA,GAAG,EAAE,EAFa;AAGlBC,EAAAA,UAAU,EAAE;AACVC,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAEC,MADA;AAENC,MAAAA,OAAO,EAAEC;AAFH;AADE,GAHM;AASlBC,EAAAA,YAAY,EAAE;AACZC,IAAAA,WAAW,EAAE,IADD;AAEZC,IAAAA,IAAI,EAAE;AAFM,GATI;;AAalBC,EAAAA,OAAO,GAAS;AACd,SAAKF,WAAL,GAAmB,EAAnB;AACD,GAfiB;;AAgBlBG,EAAAA,QAAQ,GAAS;AAC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A0BrD,KAA1B,CAAjC,CAAZ,CAA9B;AACA,UAAM2E,QAAQ,GAAGtH,IAAH,qBAAUmH,eAAV,CAAd;AACAlH,IAAAA,MAAM,CAACqH,QAAD,EAAW1C,MAAM,CAAC9C,aAAP,CAAqB,gBAArB,KAA0C8C,MAArD,CAAN;AACA,WAAOA,MAAP;AACD,GA/ViB;;AAgWlBsB,EAAAA,YAAY,CAACvE,KAAD,EAAgC;AAC1C,WAAO3B,IAAP,qBACU2B,KAAK,CAAC4F,KAAN,CAAY,CAAZ,EAAe,CAAC,CAAhB,EAAmBzB,OAAnB,CAA2B,WAA3B,EAAwC,IAAxC,CADV;AAGD,GApWiB;;AAqWlB;AACF;AACA;AACA;AACE7B,EAAAA,eAAe,CAACtB,KAAD,EAAwB;AACrC,WAAOA,KAAK,CAACH,UAAN,CAAiB,GAAjB,IAAwBG,KAAK,CAAC4E,KAAN,CAAY,CAAZ,EAAe5E,KAAK,CAACY,MAArB,CAAxB,GAAuDZ,KAA9D;AACD;;AA3WiB,CAApB;AA8WA,SACExC,WADF","sourcesContent":["import { spread, preHTML } from '../libs/lit-helpers';\nimport { parseFieldsString, findClosingBracketMatchIndex } from '../libs/helpers';\nimport { newWidgetFactory } from '../new-widgets/new-widget-factory';\nimport { WidgetInterface, WidgetType, Resource } from './interfaces';\nimport { html, render, TemplateResult } from 'lit-html';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nconst WidgetMixin = {\n name: 'widget-mixin',\n use: [],\n attributes: {\n fields: {\n type: String,\n default: undefined,\n }\n },\n initialState: {\n nameWidgets: null,\n _div: null\n },\n created(): void {\n this.nameWidgets = [];\n },\n attached(): void {\n if (!this.dataSrc && !this.resource && this.noRender === null) this.populate();\n },\n get parentElement(): string {\n return 'div';\n },\n get div(): HTMLElement {\n if (this._div) return this._div;\n this._div = document.createElement(this.parentElement);\n this.element.appendChild(this._div);\n return this._div;\n },\n set div(value) {\n this._div = value\n },\n get widgets() {\n return this.nameWidgets.map((name: string) => this.element.querySelector(`[name=\"${name}\"]`));\n },\n /**\n * Return field list of the component\n */\n async getFields(): Promise<string[]>{ // TODO : improve code\n const attr = this.fields;\n if (attr === '') return [];\n if (attr) return parseFieldsString(attr);\n\n let resource = this.resource as Resource;\n if (resource && resource.isContainer()) { // If container, keep the 1rst resource\n for (let res of resource['ldp:contains']) {\n resource = res;\n break;\n }\n }\n\n if (!this.dataSrc) console.error(new Error('You must provide a \"fields\" attribute'));\n if(!resource) return [];\n\n let fields: string[] = [];\n for (const prop of resource.properties) {\n if ((!prop.startsWith('@') && !(prop === \"permissions\")) && await resource[prop]) fields.push(prop);\n }\n return fields;\n },\n /**\n * return attribute if \"field\" is an action\n * @param field - string\n */\n getAction(field: string): string {\n const action = this.element.getAttribute('action-' + field);\n return action;\n },\n /**\n * return true if \"field\" is editable\n * @param field - string\n */\n editable(field: string): string {\n return this.element.hasAttribute('editable-' + field);\n },\n /**\n * Return regexp to check if \"field\" is a set\n * @param field - string\n */\n getSetRegexp(field: string) {\n return new RegExp(`(^|\\\\,|\\\\(|\\\\s)\\\\s*${field}\\\\s*\\\\(`, 'g')\n },\n /**\n * Return fields contained in set \"field\"\n * @param field - string\n */\n getSet(field: string): string[] {\n const setString = this.fields.match(this.getSetRegexp(field));\n if (!setString) return [];\n const firstSetBracket = this.fields.indexOf(setString[0]) + (setString[0].length) - 1;\n const lastSetBracket = findClosingBracketMatchIndex(this.fields, firstSetBracket);\n const set = this.fields.substring(firstSetBracket + 1, lastSetBracket);\n return parseFieldsString(set);\n },\n /**\n * Return true if \"field\" is a set\n * @param field - string\n */\n isSet(field: string): boolean {\n if (!this.fields) return false;\n let foundSets = this.fields.match(this.getSetRegexp(field));\n return foundSets ? foundSets.length > 0 : false;\n },\n isString(field: string): boolean {\n return field.startsWith('\\'') || field.startsWith('\\\"');\n },\n /**\n * Return the value of \"resource\" for predicate \"field\"\n * @param field - string\n * @param resource - Resource\n */\n async fetchValue(field: string, resource: Resource) {\n return resource && !resource.isContainer() ? await resource[field] : undefined;\n },\n /**\n * Return the value of the field\n * @param field - field\n */\n async getValue(field: string, resource: Resource) {\n const escapedField = this.getEscapedField(field);\n if (this.getAction(escapedField)) {\n return this.getAction(escapedField);\n }\n if (this.element.hasAttribute('value-' + field)) {\n return this.element.getAttribute('value-' + field);\n }\n let resourceValue = await this.fetchValue(field, resource);\n\n // Empty value\n if (resourceValue === undefined || resourceValue === '' || resourceValue === null) // If null or empty, return field default value\n return this.element.hasAttribute('default-' + field) ?\n this.element.getAttribute('default-' + field) : '';\n\n return resourceValue;\n },\n empty(): void {},\n /**\n * Return a widget from a tagName, and create it if necessary\n * @param tagName - string\n */\n widgetFromTagName(tagName: string) {\n let type = tagName.startsWith('solid') ? WidgetType.CUSTOM : WidgetType.USER;\n if (!customElements.get(tagName)) { // component does not exist\n if (tagName.startsWith('solid')) newWidgetFactory(tagName); // solid- -> create it\n else type = WidgetType.NATIVE; // or use a native tag\n }\n return { tagName, type }; // return tagName\n },\n /**\n * Return widget for field \"field\"\n * @param field - string\n * @param isSet - boolean\n */\n getWidget(field: string, isSet: boolean = false): WidgetInterface {\n const widget = this.element.getAttribute('widget-' + field);\n\n if (widget) return this.widgetFromTagName(widget);\n if (this.getAction(field)) return this.widgetFromTagName('solid-action');\n\n return !isSet ? this.widgetFromTagName(this.defaultWidget) : this.widgetFromTagName(this.defaultSetWidget);\n },\n /**\n * Return multiple widget if \"field\" is a multiple, false if it's not\n * @param field - string\n */\n multiple(field: string): WidgetInterface|null {\n const attribute = 'multiple-' + field;\n if (!this.element.hasAttribute(attribute)) return null;\n const widget = this.element.getAttribute(attribute) || this.defaultMultipleWidget;\n return this.widgetFromTagName(widget);\n },\n /**\n * If attribute \"lookForAttr\" is set on element, add \"attrKey\" to the \"attributes\" list\n * @param lookForAttr - string\n * @param setAttrKey - string\n * @param attributes - object\n */\n addToAttributes(lookForAttr: string, setAttrKey: string, attributes: object) {\n const attribute = this.element.getAttribute(lookForAttr);\n if (attribute == null) return;\n attributes[setAttrKey] = attribute;\n },\n /**\n * Return all the attributes of widget \"field\"\n * @param field - string\n * @param resource - Resource\n */\n widgetAttributes(field: string, resource: Resource): object {\n const attrs = { name: field };\n const escapedField = this.getEscapedField(field);\n\n // transfer all multiple-[field]-[attr] attributes as [attr] for multiple widget [field]\n const multipleAttributes = [\n 'fields',\n 'label',\n 'widget',\n 'add-label',\n 'remove-label',\n 'next', \n 'empty-widget'\n ];\n for (let attr of multipleAttributes) this.addToAttributes(`multiple-${escapedField}-${attr}`, attr, attrs)\n\n // transfer all [attr]-[field] attributes as [attr] attribute for widget [field]\n const defaultAttributes = [\n 'range',\n 'enum',\n 'label',\n 'placeholder',\n 'class',\n /* 'widget', */,\n 'required',\n 'editable',\n 'autocomplete',\n 'upload-url',\n 'option-label',\n 'option-value',\n 'order-by', // deprecated. Remove in 0.15\n 'each-label',\n 'order-asc',\n 'order-desc',\n 'min',\n 'max',\n 'pattern',\n 'title',\n 'start-value',\n 'end-value',\n 'alt',\n 'step',\n 'maxlength',\n 'minlength',\n 'search-text',\n 'search-placeholder',\n ];\n for (let attr of defaultAttributes) this.addToAttributes(`${attr}-${escapedField}`, attr, attrs)\n\n const addableAttributes: Attr[] = (Array.from(this.element.attributes) as Attr[]).filter((a: Attr) => a.name.startsWith(`addable-${escapedField}`));\n for (let attr of addableAttributes) this.addToAttributes(attr.name, attr.name.replace(`addable-${escapedField}`, 'addable'), attrs)\n\n const resourceId = resource ? resource!['@id'] : null;\n if (this.multiple(escapedField)) attrs['widget'] = this.getWidget(escapedField).tagName;\n if (this.getAction(escapedField) && resourceId) attrs['src'] = this.element.getAttribute('src-' + escapedField) || resourceId;\n if (this.editable(escapedField) && resourceId) attrs['value-id'] = resourceId;\n\n return attrs;\n },\n /**\n * Creates and return a widget for field + add it to the widget list\n * @param field - string\n */\n async createWidgetTemplate(field: string, resource = null, transformAttributes = false): Promise<TemplateResult> {\n if (this.isString(field)) return this.createString(field); // field is a static string\n if (this.isSet(field)) return await this.createSet(field);\n\n const currentResource = resource || this.resource;\n let attributes = this.widgetAttributes(field, currentResource);\n const escapedField = this.getEscapedField(field);\n const widgetMeta = this.multiple(escapedField) || this.getWidget(escapedField);\n let tagName = widgetMeta.tagName;\n let widgetTemplate = html``;\n\n // Set attributes\n let value = await this.getValue(field, currentResource);\n if (widgetMeta.type === WidgetType.NATIVE) { // native widget (ie: h1)\n widgetTemplate = preHTML`\n <${tagName}\n name=\"${ifDefined(attributes.name)}\"\n class=\"${ifDefined(attributes.class)}\"\n >${value}</${tagName}>\n `;\n } else { // custom widget (ie: solid-display-value)\n // Check if value is defined, and if the default widget is needed\n if ((value === null || value === '') && this.element.hasAttribute('default-widget-' + field)) {\n tagName = this.element.getAttribute('default-widget-' + field);\n }\n // Set attributes to the widget\n // setAttribute set a string. Make sure null values are empty\n if (value === null || value === undefined) attributes.value = '';\n if (widgetMeta.type === WidgetType.USER && value['@id']) { // if value is a resource and solid-widget used, set data-src\n attributes['data-src'] = value['@id'];\n } else { // otherwise, set value attribute\n attributes['value'] = value;\n }\n\n // Subscribe widgets if they show a resource\n if (value && value['@id']) attributes['auto-subscribe'] = value['@id'];\n\n // Transform store://XXX attributes\n if (transformAttributes) attributes = await this.transformAttributes(attributes, currentResource);\n\n widgetTemplate = preHTML`<${tagName} ...=${spread(attributes)}></${tagName}>`;\n }\n\n this.nameWidgets.push(field);\n return widgetTemplate;\n },\n defineAttribute(widget: HTMLElement, attribute: string, value: any) {\n if (widget.getAttribute(attribute) !== value) { // if attribute is different than previous one\n widget.setAttribute(attribute, value); // set it\n }\n },\n /**\n * Create a set and add fields to it\n * @param field - string\n */\n async createSet(field: string): Promise<TemplateResult> {\n const setWidget = this.getWidget(field, true);\n\n // Get set attributes\n const attrs = { name: field };\n const setAttributes = [\n 'class',\n 'label'\n ];\n for (let attr of setAttributes) this.addToAttributes(`${attr}-${field}`, attr, attrs);\n\n // Create widget if not already existing\n let widget = this.element.querySelector(`${setWidget.tagName}[name=\"${field}\"]`);\n let initializing = false; // used to render widget only first time\n if (!widget) {\n widget = document.createElement(setWidget.tagName);\n initializing = true;\n }\n for (let name of Object.keys(attrs)) {\n this.defineAttribute(widget, name, attrs[name], setWidget.type);\n }\n if (widget.component && initializing) widget.component.render();\n let setFields = this.getSet(field);\n // Catch widget for the set if all these fields are empty\n if (this.element.hasAttribute('empty-' + field)) {\n let hasOnlyEmpty = true;\n for(let field of setFields) {\n let value: string = await this.getValue(field, this.resource);\n if (value !== '') { // if one not empty\n hasOnlyEmpty = false;\n continue; // break loop\n }\n };\n if(hasOnlyEmpty) { // if only empty values, return empty-widget\n const attributes = this.widgetAttributes(field, this.resource);\n const tagName = this.element.getAttribute(`empty-${field}`);\n const valueSet = this.element.getAttribute(`empty-${field}-value`);\n if (valueSet) attributes.value = valueSet;\n return preHTML`<${tagName} ...=${spread(attributes)}></${tagName}>`;\n };\n }\n\n // Render template\n const widgetsTemplate = await Promise.all(setFields.map((field: string) => this.createWidgetTemplate(field)));\n const template = html`${widgetsTemplate}`;\n render(template, widget.querySelector('[data-content]') || widget);\n return widget;\n },\n createString(value: string): TemplateResult {\n return html`\n <span>${value.slice(1, -1).replace(/\\\\(['\"])/g, '$1')}</span>\n `;\n },\n /**\n * Returns field name without starting \"@\"\n * @param field\n */\n getEscapedField(field: string): string {\n return field.startsWith('@') ? field.slice(1, field.length) : field;\n }\n}\n\nexport {\n WidgetMixin\n}"]}
1
+ {"version":3,"sources":["widgetMixin.ts"],"names":["spread","preHTML","parseFieldsString","findClosingBracketMatchIndex","newWidgetFactory","WidgetType","html","render","ifDefined","WidgetMixin","name","use","attributes","fields","type","String","default","undefined","initialState","nameWidgets","_div","created","attached","dataSrc","resource","noRender","populate","parentElement","div","document","createElement","element","appendChild","value","widgets","map","querySelector","getFields","attr","isContainer","res","console","error","Error","prop","properties","startsWith","push","getAction","field","action","getAttribute","editable","hasAttribute","getSetRegexp","RegExp","getSet","setString","match","firstSetBracket","indexOf","length","lastSetBracket","set","substring","isSet","foundSets","isString","fetchValue","getValue","escapedField","getEscapedField","resourceValue","empty","widgetFromTagName","tagName","CUSTOM","USER","customElements","get","NATIVE","getWidget","widget","defaultWidget","defaultSetWidget","multiple","attribute","defaultMultipleWidget","addToAttributes","lookForAttr","setAttrKey","widgetAttributes","attrs","multipleAttributes","defaultAttributes","addableAttributes","Array","from","filter","a","replace","resourceId","createWidgetTemplate","transformAttributes","createString","createSet","currentResource","widgetMeta","widgetTemplate","class","defineAttribute","setAttribute","setWidget","setAttributes","initializing","Object","keys","component","setFields","hasOnlyEmpty","valueSet","widgetsTemplate","Promise","all","template","slice"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,MAAT,EAAiBC,OAAjB,QAAgC,qBAAhC;AACA,SAASC,iBAAT,EAA4BC,4BAA5B,QAAgE,iBAAhE;AACA,SAASC,gBAAT,QAAiC,mCAAjC;AACA,SAA0BC,UAA1B,QAAsD,cAAtD;AACA,SAASC,IAAT,EAAeC,MAAf,QAA6C,UAA7C;AACA,SAASC,SAAT,QAA0B,gCAA1B;AAEA,MAAMC,WAAW,GAAG;AAClBC,EAAAA,IAAI,EAAE,cADY;AAElBC,EAAAA,GAAG,EAAE,EAFa;AAGlBC,EAAAA,UAAU,EAAE;AACVC,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAEC,MADA;AAENC,MAAAA,OAAO,EAAEC;AAFH;AADE,GAHM;AASlBC,EAAAA,YAAY,EAAE;AACZC,IAAAA,WAAW,EAAE,IADD;AAEZC,IAAAA,IAAI,EAAE;AAFM,GATI;;AAalBC,EAAAA,OAAO,GAAS;AACd,SAAKF,WAAL,GAAmB,EAAnB;AACD,GAfiB;;AAgBlBG,EAAAA,QAAQ,GAAS;AACf,QAAI,CAAC,KAAKC,OAAN,IAAiB,CAAC,KAAKC,QAAvB,IAAmC,KAAKC,QAAL,KAAkB,IAAzD,EAA+D,KAAKC,QAAL;AAChE,GAlBiB;;AAmBlB,MAA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AACAlH,IAAAA,MAAM,CAACqH,QAAD,EAAW1C,MAAM,CAAC9C,aAAP,CAAqB,gBAArB,KAA0C8C,MAArD,CAAN;AACA,WAAOA,MAAP;AACD,GAlWiB;;AAmWlBsB,EAAAA,YAAY,CAACvE,KAAD,EAAgC;AAC1C,WAAO3B,IAAP,qBACU2B,KAAK,CAAC4F,KAAN,CAAY,CAAZ,EAAe,CAAC,CAAhB,EAAmBzB,OAAnB,CAA2B,WAA3B,EAAwC,IAAxC,CADV;AAGD,GAvWiB;;AAwWlB;AACF;AACA;AACA;AACE7B,EAAAA,eAAe,CAACtB,KAAD,EAAwB;AACrC,WAAOA,KAAK,CAACH,UAAN,CAAiB,GAAjB,IAAwBG,KAAK,CAAC4E,KAAN,CAAY,CAAZ,EAAe5E,KAAK,CAACY,MAArB,CAAxB,GAAuDZ,KAA9D;AACD;;AA9WiB,CAApB;AAiXA,SACExC,WADF","sourcesContent":["import { spread, preHTML } from '../libs/lit-helpers';\nimport { parseFieldsString, findClosingBracketMatchIndex } from '../libs/helpers';\nimport { newWidgetFactory } from '../new-widgets/new-widget-factory';\nimport { WidgetInterface, WidgetType, Resource } from './interfaces';\nimport { html, render, TemplateResult } from 'lit-html';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nconst WidgetMixin = {\n name: 'widget-mixin',\n use: [],\n attributes: {\n fields: {\n type: String,\n default: undefined,\n }\n },\n initialState: {\n nameWidgets: null,\n _div: null\n },\n created(): void {\n this.nameWidgets = [];\n },\n attached(): void {\n if (!this.dataSrc && !this.resource && this.noRender === null) this.populate();\n },\n get parentElement(): string {\n return 'div';\n },\n get div(): HTMLElement {\n if (this._div) return this._div;\n this._div = document.createElement(this.parentElement);\n this.element.appendChild(this._div);\n return this._div;\n },\n set div(value) {\n this._div = value\n },\n get widgets() {\n return this.nameWidgets.map((name: string) => this.element.querySelector(`[name=\"${name}\"]`));\n },\n /**\n * Return field list of the component\n */\n async getFields(): Promise<string[]>{ // TODO : improve code\n const attr = this.fields;\n if (attr === '') return [];\n if (attr) return parseFieldsString(attr);\n\n let resource = this.resource as Resource;\n if (resource && resource.isContainer()) { // If container, keep the 1rst resource\n for (let res of resource['ldp:contains']) {\n resource = res;\n break;\n }\n }\n\n if (!this.dataSrc) console.error(new Error('You must provide a \"fields\" attribute'));\n if(!resource) return [];\n\n let fields: string[] = [];\n for (const prop of resource.properties) {\n if ((!prop.startsWith('@') && !(prop === \"permissions\")) && await resource[prop]) fields.push(prop);\n }\n return fields;\n },\n /**\n * return attribute if \"field\" is an action\n * @param field - string\n */\n getAction(field: string): string {\n const action = this.element.getAttribute('action-' + field);\n return action;\n },\n /**\n * return true if \"field\" is editable\n * @param field - string\n */\n editable(field: string): string {\n return this.element.hasAttribute('editable-' + field);\n },\n /**\n * Return regexp to check if \"field\" is a set\n * @param field - string\n */\n getSetRegexp(field: string) {\n return new RegExp(`(^|\\\\,|\\\\(|\\\\s)\\\\s*${field}\\\\s*\\\\(`, 'g')\n },\n /**\n * Return fields contained in set \"field\"\n * @param field - string\n */\n getSet(field: string): string[] {\n const setString = this.fields.match(this.getSetRegexp(field));\n if (!setString) return [];\n const firstSetBracket = this.fields.indexOf(setString[0]) + (setString[0].length) - 1;\n const lastSetBracket = findClosingBracketMatchIndex(this.fields, firstSetBracket);\n const set = this.fields.substring(firstSetBracket + 1, lastSetBracket);\n return parseFieldsString(set);\n },\n /**\n * Return true if \"field\" is a set\n * @param field - string\n */\n isSet(field: string): boolean {\n if (!this.fields) return false;\n let foundSets = this.fields.match(this.getSetRegexp(field));\n return foundSets ? foundSets.length > 0 : false;\n },\n isString(field: string): boolean {\n return field.startsWith('\\'') || field.startsWith('\\\"');\n },\n /**\n * Return the value of \"resource\" for predicate \"field\"\n * @param field - string\n * @param resource - Resource\n */\n async fetchValue(field: string, resource: Resource) {\n return resource && !resource.isContainer() ? await resource[field] : undefined;\n },\n /**\n * Return the value of the field\n * @param field - field\n */\n async getValue(field: string, resource: Resource) {\n const escapedField = this.getEscapedField(field);\n if (this.getAction(escapedField)) {\n return this.getAction(escapedField);\n }\n if (this.element.hasAttribute('value-' + field)) {\n return this.element.getAttribute('value-' + field);\n }\n let resourceValue = await this.fetchValue(field, resource);\n\n // Empty value\n if (resourceValue === undefined || resourceValue === '' || resourceValue === null) // If null or empty, return field default value\n return this.element.hasAttribute('default-' + field) ?\n this.element.getAttribute('default-' + field) : '';\n\n return resourceValue;\n },\n empty(): void {},\n /**\n * Return a widget from a tagName, and create it if necessary\n * @param tagName - string\n */\n widgetFromTagName(tagName: string) {\n let type = tagName.startsWith('solid') ? WidgetType.CUSTOM : WidgetType.USER;\n if (!customElements.get(tagName)) { // component does not exist\n if (tagName.startsWith('solid')) newWidgetFactory(tagName); // solid- -> create it\n else type = WidgetType.NATIVE; // or use a native tag\n }\n return { tagName, type }; // return tagName\n },\n /**\n * Return widget for field \"field\"\n * @param field - string\n * @param isSet - boolean\n */\n getWidget(field: string, isSet: boolean = false): WidgetInterface {\n const widget = this.element.getAttribute('widget-' + field);\n\n if (widget) return this.widgetFromTagName(widget);\n if (this.getAction(field)) return this.widgetFromTagName('solid-action');\n\n return !isSet ? this.widgetFromTagName(this.defaultWidget) : this.widgetFromTagName(this.defaultSetWidget);\n },\n /**\n * Return multiple widget if \"field\" is a multiple, false if it's not\n * @param field - string\n */\n multiple(field: string): WidgetInterface|null {\n const attribute = 'multiple-' + field;\n if (!this.element.hasAttribute(attribute)) return null;\n const widget = this.element.getAttribute(attribute) || this.defaultMultipleWidget;\n return this.widgetFromTagName(widget);\n },\n /**\n * If attribute \"lookForAttr\" is set on element, add \"attrKey\" to the \"attributes\" list\n * @param lookForAttr - string\n * @param setAttrKey - string\n * @param attributes - object\n */\n addToAttributes(lookForAttr: string, setAttrKey: string, attributes: object) {\n const attribute = this.element.getAttribute(lookForAttr);\n if (attribute == null) return;\n attributes[setAttrKey] = attribute;\n },\n /**\n * Return all the attributes of widget \"field\"\n * @param field - string\n * @param resource - Resource\n */\n widgetAttributes(field: string, resource: Resource): object {\n const attrs = { name: field };\n const escapedField = this.getEscapedField(field);\n\n // transfer all multiple-[field]-[attr] attributes as [attr] for multiple widget [field]\n const multipleAttributes = [\n 'fields',\n 'label',\n 'widget',\n 'add-label',\n 'remove-label',\n 'next', \n 'empty-widget',\n 'add-class',\n 'remove-class'\n ];\n for (let attr of multipleAttributes) this.addToAttributes(`multiple-${escapedField}-${attr}`, attr, attrs)\n\n // transfer all [attr]-[field] attributes as [attr] attribute for widget [field]\n const defaultAttributes = [\n 'range',\n 'enum',\n 'label',\n 'placeholder',\n 'class',\n /* 'widget', */,\n 'required',\n 'editable',\n 'autocomplete',\n 'upload-url',\n 'option-label',\n 'option-value',\n 'order-by', // deprecated. Remove in 0.15\n 'each-label',\n 'order-asc',\n 'order-desc',\n 'min',\n 'max',\n 'pattern',\n 'title',\n 'start-value',\n 'end-value',\n 'alt',\n 'step',\n 'maxlength',\n 'minlength',\n 'search-text',\n 'search-placeholder',\n 'link-text',\n ];\n for (let attr of defaultAttributes) this.addToAttributes(`${attr}-${escapedField}`, attr, attrs)\n\n const addableAttributes: Attr[] = (Array.from(this.element.attributes) as Attr[]).filter((a: Attr) => a.name.startsWith(`addable-${escapedField}`));\n for (let attr of addableAttributes) this.addToAttributes(attr.name, attr.name.replace(`addable-${escapedField}`, 'addable'), attrs)\n\n const resourceId = resource ? resource!['@id'] : null;\n if (this.multiple(escapedField)) attrs['widget'] = this.getWidget(escapedField).tagName;\n if (this.getAction(escapedField) && resourceId) attrs['src'] = this.element.getAttribute('src-' + escapedField) || resourceId;\n if (this.editable(escapedField) && resourceId) attrs['value-id'] = resourceId;\n\n return attrs;\n },\n /**\n * Creates and return a widget for field + add it to the widget list\n * @param field - string\n */\n async createWidgetTemplate(field: string, resource = null, transformAttributes = false): Promise<TemplateResult> {\n if (this.isString(field)) return this.createString(field); // field is a static string\n if (this.isSet(field)) return await this.createSet(field);\n\n const currentResource = resource || this.resource;\n let attributes = this.widgetAttributes(field, currentResource);\n const escapedField = this.getEscapedField(field);\n const widgetMeta = this.multiple(escapedField) || this.getWidget(escapedField);\n let tagName = widgetMeta.tagName;\n let widgetTemplate = html``;\n\n // Set attributes\n let value = await this.getValue(field, currentResource);\n if (widgetMeta.type === WidgetType.NATIVE) { // native widget (ie: h1)\n widgetTemplate = preHTML`\n <${tagName}\n name=\"${ifDefined(attributes.name)}\"\n class=\"${ifDefined(attributes.class)}\"\n >${value}</${tagName}>\n `;\n } else { // custom widget (ie: solid-display-value)\n // Check if value is defined, and if the default widget is needed\n if ((value === null || value === '') && this.element.hasAttribute('default-widget-' + field)) {\n tagName = this.element.getAttribute('default-widget-' + field);\n }\n // Set attributes to the widget\n // setAttribute set a string. Make sure null values are empty\n if (value === null || value === undefined) attributes.value = '';\n if (widgetMeta.type === WidgetType.USER && value['@id']) { // if value is a resource and solid-widget used, set data-src\n attributes['data-src'] = value['@id'];\n } else { // otherwise, set value attribute\n attributes['value'] = value;\n }\n\n // Subscribe widgets if they show a resource\n if (value && value['@id']) attributes['auto-subscribe'] = value['@id'];\n\n // Transform store://XXX attributes\n if (transformAttributes) attributes = await this.transformAttributes(attributes, currentResource);\n\n widgetTemplate = preHTML`<${tagName} ...=${spread(attributes)}></${tagName}>`;\n }\n\n this.nameWidgets.push(field);\n return widgetTemplate;\n },\n defineAttribute(widget: HTMLElement, attribute: string, value: any) {\n if (widget.getAttribute(attribute) !== value) { // if attribute is different than previous one\n widget.setAttribute(attribute, value); // set it\n }\n },\n /**\n * Create a set and add fields to it\n * @param field - string\n */\n async createSet(field: string): Promise<TemplateResult> {\n const setWidget = this.getWidget(field, true);\n\n // Get set attributes\n const attrs = { name: field };\n const setAttributes = [\n 'class',\n 'label'\n ];\n for (let attr of setAttributes) this.addToAttributes(`${attr}-${field}`, attr, attrs);\n\n // Create widget if not already existing\n let widget = this.element.querySelector(`${setWidget.tagName}[name=\"${field}\"]`);\n let initializing = false; // used to render widget only first time\n if (!widget) {\n widget = document.createElement(setWidget.tagName);\n initializing = true;\n }\n for (let name of Object.keys(attrs)) {\n this.defineAttribute(widget, name, attrs[name], setWidget.type);\n }\n if (widget.component && initializing) widget.component.render();\n let setFields = this.getSet(field);\n // Catch widget for the set if all these fields are empty\n if (this.element.hasAttribute('empty-' + field)) {\n let hasOnlyEmpty = true;\n for(let field of setFields) {\n let value: string = await this.getValue(field, this.resource);\n if (value !== '') { // if one not empty\n hasOnlyEmpty = false;\n continue; // break loop\n }\n };\n if(hasOnlyEmpty) { // if only empty values, return empty-widget\n const attributes = this.widgetAttributes(field, this.resource);\n const tagName = this.element.getAttribute(`empty-${field}`);\n const valueSet = this.element.getAttribute(`empty-${field}-value`);\n if (valueSet) attributes.value = valueSet;\n return preHTML`<${tagName} ...=${spread(attributes)}></${tagName}>`;\n };\n }\n\n // Render template\n const widgetsTemplate = await Promise.all(setFields.map((field: string) => this.createWidgetTemplate(field)));\n const template = html`${widgetsTemplate}`;\n render(template, widget.querySelector('[data-content]') || widget);\n return widget;\n },\n createString(value: string): TemplateResult {\n return html`\n <span>${value.slice(1, -1).replace(/\\\\(['\"])/g, '$1')}</span>\n `;\n },\n /**\n * Returns field name without starting \"@\"\n * @param field\n */\n getEscapedField(field: string): string {\n return field.startsWith('@') ? field.slice(1, field.length) : field;\n }\n}\n\nexport {\n WidgetMixin\n}"]}
@@ -9,7 +9,7 @@ function _templateObject2() {
9
9
  }
10
10
 
11
11
  function _templateObject() {
12
- const data = _taggedTemplateLiteral(["\n <solid-link\n data-src=", "\n next=", "\n >\n ", "\n </solid-link>\n "]);
12
+ const data = _taggedTemplateLiteral(["\n <solid-link\n data-src=", "\n next=", "\n id=", "\n link-text=", "\n >\n ", "\n </solid-link>\n "]);
13
13
 
14
14
  _templateObject = function () {
15
15
  return data;
@@ -22,10 +22,11 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
22
22
 
23
23
  import { html } from '../../_snowpack/pkg/lit-html.js';
24
24
  import { ifDefined } from '../../_snowpack/pkg/lit-html/directives/if-defined.js';
25
+ import { LinkTextMixin } from '../templatesDependencies/linkTextMixin.js';
25
26
  export const defaultTemplates = {
26
27
  action: {
27
- template: (value, attributes) => html(_templateObject(), ifDefined(attributes.src), ifDefined(value), attributes.label == null ? attributes.name || '' : attributes.label),
28
- dependencies: []
28
+ template: (value, attributes) => html(_templateObject(), ifDefined(attributes.src), ifDefined(value), ifDefined(attributes.id), ifDefined(attributes.linkText), attributes.linkText == null ? attributes.name || '' : attributes.linkText),
29
+ dependencies: [LinkTextMixin]
29
30
  },
30
31
  multiple: {
31
32
  template: (value, attributes) => html(_templateObject2(), value || '', ifDefined(attributes.fields), ifDefined(attributes.next), ifDefined(attributes.emptyWidget)),
@@ -1 +1 @@
1
- {"version":3,"sources":["defaultTemplatesDirectory.ts"],"names":["html","ifDefined","defaultTemplates","action","template","value","attributes","src","label","name","dependencies","multiple","fields","next","emptyWidget"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,IAAT,QAAqB,UAArB;AACA,SAASC,SAAT,QAA0B,gCAA1B;AAEA,OAAO,MAAMC,gBAAgB,GAAG;AAC9BC,EAAAA,MAAM,EAAE;AACNC,IAAAA,QAAQ,EAAE,CAACC,KAAD,EAAgBC,UAAhB,KAAoCN,IAApC,oBAEKC,SAAS,CAACK,UAAU,CAACC,GAAZ,CAFd,EAGCN,SAAS,CAACI,KAAD,CAHV,EAKHC,UAAU,CAACE,KAAX,IAAoB,IAApB,GAA4BF,UAAU,CAACG,IAAX,IAAmB,EAA/C,GAAqDH,UAAU,CAACE,KAL7D,CADJ;AASNE,IAAAA,YAAY,EAAE;AATR,GADsB;AAY9BC,EAAAA,QAAQ,EAAE;AACRP,IAAAA,QAAQ,EAAE,CAACC,KAAD,EAAgBC,UAAhB,KAAoCN,IAApC,qBAEKK,KAAK,IAAI,EAFd,EAGGJ,SAAS,CAACK,UAAU,CAACM,MAAZ,CAHZ,EAICX,SAAS,CAACK,UAAU,CAACO,IAAZ,CAJV,EAKSZ,SAAS,CAACK,UAAU,CAACQ,WAAZ,CALlB,CADF;AASRJ,IAAAA,YAAY,EAAE;AATN;AAZoB,CAAzB","sourcesContent":["import { html } from 'lit-html';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nexport const defaultTemplates = {\n action: {\n template: (value: string, attributes: any) => html`\n <solid-link\n data-src=${ifDefined(attributes.src)}\n next=${ifDefined(value)}\n >\n ${(attributes.label == null ? (attributes.name || '') : attributes.label)}\n </solid-link>\n `,\n dependencies: []\n },\n multiple: {\n template: (value: string, attributes: any) => html`\n <solid-display\n data-src=${value || ''}\n fields=${ifDefined(attributes.fields)}\n next=${ifDefined(attributes.next)}\n empty-widget=${ifDefined(attributes.emptyWidget)}\n ></solid-display>\n `,\n dependencies: []\n },\n}\n"]}
1
+ {"version":3,"sources":["defaultTemplatesDirectory.ts"],"names":["html","ifDefined","LinkTextMixin","defaultTemplates","action","template","value","attributes","src","id","linkText","name","dependencies","multiple","fields","next","emptyWidget"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,IAAT,QAAqB,UAArB;AACA,SAASC,SAAT,QAA0B,gCAA1B;AACA,SAASC,aAAT,QAA8B,wCAA9B;AAEA,OAAO,MAAMC,gBAAgB,GAAG;AAC9BC,EAAAA,MAAM,EAAE;AACNC,IAAAA,QAAQ,EAAE,CAACC,KAAD,EAAgBC,UAAhB,KAAoCP,IAApC,oBAEKC,SAAS,CAACM,UAAU,CAACC,GAAZ,CAFd,EAGCP,SAAS,CAACK,KAAD,CAHV,EAIDL,SAAS,CAACM,UAAU,CAACE,EAAZ,CAJR,EAKMR,SAAS,CAACM,UAAU,CAACG,QAAZ,CALf,EAOJH,UAAU,CAACG,QAAX,IAAuB,IAAvB,GAA+BH,UAAU,CAACI,IAAX,IAAmB,EAAlD,GAAwDJ,UAAU,CAACG,QAP/D,CADJ;AAWNE,IAAAA,YAAY,EAAE,CAACV,aAAD;AAXR,GADsB;AAc9BW,EAAAA,QAAQ,EAAE;AACRR,IAAAA,QAAQ,EAAE,CAACC,KAAD,EAAgBC,UAAhB,KAAoCP,IAApC,qBAEKM,KAAK,IAAI,EAFd,EAGGL,SAAS,CAACM,UAAU,CAACO,MAAZ,CAHZ,EAICb,SAAS,CAACM,UAAU,CAACQ,IAAZ,CAJV,EAKSd,SAAS,CAACM,UAAU,CAACS,WAAZ,CALlB,CADF;AASRJ,IAAAA,YAAY,EAAE;AATN;AAdoB,CAAzB","sourcesContent":["import { html } from 'lit-html';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { LinkTextMixin } from '../templatesDependencies/linkTextMixin';\n\nexport const defaultTemplates = {\n action: {\n template: (value: string, attributes: any) => html`\n <solid-link\n data-src=${ifDefined(attributes.src)}\n next=${ifDefined(value)}\n id=${ifDefined(attributes.id)}\n link-text=${ifDefined(attributes.linkText)}\n >\n ${attributes.linkText == null ? (attributes.name || '') : attributes.linkText}\n </solid-link>\n `,\n dependencies: [LinkTextMixin]\n },\n multiple: {\n template: (value: string, attributes: any) => html`\n <solid-display\n data-src=${value || ''}\n fields=${ifDefined(attributes.fields)}\n next=${ifDefined(attributes.next)}\n empty-widget=${ifDefined(attributes.emptyWidget)}\n ></solid-display>\n `,\n dependencies: []\n },\n}\n"]}
@@ -29,7 +29,7 @@ function _templateObject4() {
29
29
  }
30
30
 
31
31
  function _templateObject3() {
32
- const data = _taggedTemplateLiteral(["\n <a\n name=", "\n href=", "\n target=", "\n ?data-editable=", "\n >\n ", "\n </a>\n "]);
32
+ const data = _taggedTemplateLiteral(["\n <a\n name=", "\n href=", "\n target=", "\n ?data-editable=", "\n id=", "\n link-text=", "\n >\n ", "\n </a>\n "]);
33
33
 
34
34
  _templateObject3 = function () {
35
35
  return data;
@@ -62,6 +62,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
62
62
 
63
63
  import { EditableMixin } from '../templatesDependencies/editableMixin.js';
64
64
  import { AltMixin } from '../templatesDependencies/altMixin.js';
65
+ import { LinkTextMixin } from '../templatesDependencies/linkTextMixin.js';
65
66
  import { html } from '../../_snowpack/pkg/lit-html.js';
66
67
  import { ifDefined } from '../../_snowpack/pkg/lit-html/directives/if-defined.js';
67
68
  export const displayTemplates = {
@@ -74,8 +75,8 @@ export const displayTemplates = {
74
75
  dependencies: [EditableMixin]
75
76
  },
76
77
  link: {
77
- template: (value, attributes) => html(_templateObject3(), ifDefined(attributes.name), (attributes.mailto || attributes.tel || '') + (value || '#'), ifDefined(attributes.target), attributes.editable, attributes.label || value || ''),
78
- dependencies: [EditableMixin]
78
+ template: (value, attributes) => html(_templateObject3(), ifDefined(attributes.name), (attributes.mailto || attributes.tel || '') + (value || '#'), ifDefined(attributes.target), attributes.editable, ifDefined(attributes.id), ifDefined(attributes.linkText), attributes.linkText || value || ''),
79
+ dependencies: [EditableMixin, LinkTextMixin]
79
80
  },
80
81
  img: {
81
82
  template: (value, attributes) => html(_templateObject4(), ifDefined(attributes.name), ifDefined(value), ifDefined(attributes.alt)),
@@ -1 +1 @@
1
- {"version":3,"sources":["displayTemplatesDirectory.ts"],"names":["EditableMixin","AltMixin","html","ifDefined","displayTemplates","value","template","dependencies","div","attributes","name","editable","link","mailto","tel","target","label","img","alt","boolean"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,aAAT,QAA8B,wCAA9B;AACA,SAASC,QAAT,QAAyB,mCAAzB;AAEA,SAASC,IAAT,QAAqB,UAArB;AACA,SAASC,SAAT,QAA0B,gCAA1B;AAEA,OAAO,MAAMC,gBAAgB,GAAG;AAC9BC,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAGD,KAAD,IAAmBH,IAAnB,oBAA0BG,KAA1B,CADL;AAELE,IAAAA,YAAY,EAAE;AAFT,GADuB;AAK9BC,EAAAA,GAAG,EAAE;AACHF,IAAAA,QAAQ,EAAE,CAACD,KAAD,EAAgBI,UAAhB,KAAoCP,IAApC,qBAECC,SAAS,CAACM,UAAU,CAACC,IAAZ,CAFV,EAGWD,UAAU,CAACE,QAHtB,EAKJN,KALI,CADP;AASHE,IAAAA,YAAY,EAAE,CAAEP,aAAF;AATX,GALyB;AAgB9BY,EAAAA,IAAI,EAAE;AACJN,IAAAA,QAAQ,EAAE,CAACD,KAAD,EAAgBI,UAAhB,KAAoCP,IAApC,qBAECC,SAAS,CAACM,UAAU,CAACC,IAAZ,CAFV,EAGC,CAACD,UAAU,CAACI,MAAX,IAAqBJ,UAAU,CAACK,GAAhC,IAAuC,EAAxC,KAA6CT,KAAK,IAAI,GAAtD,CAHD,EAIGF,SAAS,CAACM,UAAU,CAACM,MAAZ,CAJZ,EAKWN,UAAU,CAACE,QALtB,EAOJF,UAAU,CAACO,KAAX,IAAoBX,KAApB,IAA6B,EAPzB,CADN;AAWJE,IAAAA,YAAY,EAAE,CAAEP,aAAF;AAXV,GAhBwB;AA6B9BiB,EAAAA,GAAG,EAAE;AACHX,IAAAA,QAAQ,EAAE,CAACD,KAAD,EAAgBI,UAAhB,KAAoCP,IAApC,qBAECC,SAAS,CAACM,UAAU,CAACC,IAAZ,CAFV,EAGAP,SAAS,CAACE,KAAD,CAHT,EAIAF,SAAS,CAACM,UAAU,CAACS,GAAZ,CAJT,CADP;AASHX,IAAAA,YAAY,EAAE,CAACN,QAAD;AATX,GA7ByB;AAwC9BkB,EAAAA,OAAO,EAAE;AACPb,IAAAA,QAAQ,EAAE,CAACD,KAAD,EAAgBI,UAAhB,KAAoCP,IAApC,qBACNG,KAAK,KAAK,MAAV,GAAmBH,IAAnB,qBAAiCO,UAAU,CAACO,KAAX,IAAoBP,UAAU,CAACC,IAA/B,IAAuC,EAAxE,IAAuF,EADjF,CADH;AAIPH,IAAAA,YAAY,EAAE;AAJP;AAxCqB,CAAzB","sourcesContent":["import { EditableMixin } from '../templatesDependencies/editableMixin';\nimport { AltMixin } from '../templatesDependencies/altMixin';\n\nimport { html } from 'lit-html';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nexport const displayTemplates = {\n value: {\n template: (value: string) => html`${value}`,\n dependencies: []\n },\n div: {\n template: (value: string, attributes: any) => html`\n <div\n name=${ifDefined(attributes.name)}\n ?data-editable=${attributes.editable}\n >\n ${value}\n </div>\n `,\n dependencies: [ EditableMixin ]\n },\n link: {\n template: (value: string, attributes: any) => html`\n <a\n name=${ifDefined(attributes.name)}\n href=${(attributes.mailto || attributes.tel || '')+(value || '#')}\n target=${ifDefined(attributes.target)}\n ?data-editable=${attributes.editable}\n >\n ${attributes.label || value || ''}\n </a>\n `,\n dependencies: [ EditableMixin ]\n },\n img: {\n template: (value: string, attributes: any) => html`\n <img\n name=${ifDefined(attributes.name)}\n src=${ifDefined(value)}\n alt=${ifDefined(attributes.alt)}\n style=\"max-width: 100%; max-height: 100%;\"\n />\n `,\n dependencies: [AltMixin]\n },\n boolean: {\n template: (value: string, attributes: any) => html`\n ${value === 'true' ? html`<label>${attributes.label || attributes.name || ''}</label>` : ''}\n `,\n dependencies: []\n },\n}\n"]}
1
+ {"version":3,"sources":["displayTemplatesDirectory.ts"],"names":["EditableMixin","AltMixin","LinkTextMixin","html","ifDefined","displayTemplates","value","template","dependencies","div","attributes","name","editable","link","mailto","tel","target","id","linkText","img","alt","boolean","label"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,aAAT,QAA8B,wCAA9B;AACA,SAASC,QAAT,QAAyB,mCAAzB;AACA,SAASC,aAAT,QAA8B,wCAA9B;AAEA,SAASC,IAAT,QAAqB,UAArB;AACA,SAASC,SAAT,QAA0B,gCAA1B;AAEA,OAAO,MAAMC,gBAAgB,GAAG;AAC9BC,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAGD,KAAD,IAAmBH,IAAnB,oBAA0BG,KAA1B,CADL;AAELE,IAAAA,YAAY,EAAE;AAFT,GADuB;AAK9BC,EAAAA,GAAG,EAAE;AACHF,IAAAA,QAAQ,EAAE,CAACD,KAA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Y,EAAE;AAJP;AA1CqB,CAAzB","sourcesContent":["import { EditableMixin } from '../templatesDependencies/editableMixin';\nimport { AltMixin } from '../templatesDependencies/altMixin';\nimport { LinkTextMixin } from '../templatesDependencies/linkTextMixin';\n\nimport { html } from 'lit-html';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nexport const displayTemplates = {\n value: {\n template: (value: string) => html`${value}`,\n dependencies: []\n },\n div: {\n template: (value: string, attributes: any) => html`\n <div\n name=${ifDefined(attributes.name)}\n ?data-editable=${attributes.editable}\n >\n ${value}\n </div>\n `,\n dependencies: [ EditableMixin ]\n },\n link: {\n template: (value: string, attributes: any) => html`\n <a\n name=${ifDefined(attributes.name)}\n href=${(attributes.mailto || attributes.tel || '')+(value || '#')}\n target=${ifDefined(attributes.target)}\n ?data-editable=${attributes.editable}\n id=${ifDefined(attributes.id)}\n link-text=${ifDefined(attributes.linkText)}\n >\n ${attributes.linkText || value || ''}\n </a>\n `,\n dependencies: [ EditableMixin, LinkTextMixin ]\n },\n img: {\n template: (value: string, attributes: any) => html`\n <img\n name=${ifDefined(attributes.name)}\n src=${ifDefined(value)}\n alt=${ifDefined(attributes.alt)}\n style=\"max-width: 100%; max-height: 100%;\"\n />\n `,\n dependencies: [AltMixin]\n },\n boolean: {\n template: (value: string, attributes: any) => html`\n ${value === 'true' ? html`<label>${attributes.label || attributes.name || ''}</label>` : ''}\n `,\n dependencies: []\n },\n}\n"]}
@@ -79,7 +79,7 @@ function _templateObject22() {
79
79
  }
80
80
 
81
81
  function _templateObject21() {
82
- const data = _taggedTemplateLiteral(["\n <div data-index=", ">\n ", "\n <button type=\"button\" @click=", ">", "</button>\n </div>\n "]);
82
+ const data = _taggedTemplateLiteral(["\n <div data-index=", ">\n ", "\n <button type=\"button\" class=", " @click=", ">", "</button>\n </div>\n "]);
83
83
 
84
84
  _templateObject21 = function () {
85
85
  return data;
@@ -89,7 +89,7 @@ function _templateObject21() {
89
89
  }
90
90
 
91
91
  function _templateObject20() {
92
- const data = _taggedTemplateLiteral(["\n ", "\n <button type=\"button\" @click=", ">", "</button>\n "]);
92
+ const data = _taggedTemplateLiteral(["\n ", "\n <button type=\"button\" class=", " @click=", ">", "</button>\n "]);
93
93
 
94
94
  _templateObject20 = function () {
95
95
  return data;
@@ -358,7 +358,7 @@ export const formTemplates = {
358
358
  dependencies: [MultipleselectFormMixin, FormMixin]
359
359
  },
360
360
  multiple: {
361
- template: (_value, attributes) => html(_templateObject20(), (attributes.children || []).map((child, index) => html(_templateObject21(), attributes.name + index, child, () => attributes.removeItem(index), attributes.removeLabel)), attributes.addItem, attributes.addLabel),
361
+ template: (_value, attributes) => html(_templateObject20(), (attributes.children || []).map((child, index) => html(_templateObject21(), attributes.name + index, child, ifDefined(attributes.removeClass), () => attributes.removeItem(index), attributes.removeLabel)), ifDefined(attributes.addClass), attributes.addItem, attributes.addLabel),
362
362
  dependencies: [MultipleFormMixin, FormMixin]
363
363
  },
364
364
  multipleselect: {
@@ -1 +1 @@
1
- {"version":3,"sources":["formTemplatesDirectory.ts"],"names":["FormMixin","FormCheckboxMixin","FormMinMaxMixin","FormNumberMixin","FormDropdownMixin","FormCheckboxesMixin","FormRadioMixin","FormFileMixin","MultipleFormMixin","MultipleselectFormMixin","RangeMixin","FilterRangeFormMixin","ValueRichtextMixin","PatternMixin","FormStepMixin","FormLengthMixin","html","ifDefined","formTemplates","text","template","value","attributes","placeholder","name","id","pattern","title","required","autocomplete","maxlength","minlength","onChange","dependencies","textarea","checkbox","label","date","_value","originalValue","rangedate","startValue","endValue","number","min","max","step","rangenumber","hidden","dropdown","multiple","range","map","el","selectedValue","values","includes","Object","entries","enum","key","val","radio","multicheckbox","checkboxes","orderAsc","orderDesc","children","child","index","removeItem","removeLabel","addItem","addLabel","multipleselect","file","fileValue","selectFile","resetButtonHidden","resetFile","output","image","richtext","color","email","password","time"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,SAAZ,CAZf,EAaIT,UAAU,CAACU,QAbf,CADF;AAiBRC,IAAAA,YAAY,EAAE,CAAEjC,SAAF,EAAaa,YAAb,EAA2BE,eAA3B;AAjBN,GAhXiB;AAmY3BuE,EAAAA,IAAI,EAAE;AACJlE,IAAAA,QAAQ,EAAE,CAACC,KAAD,EAAgBC,UAAhB,KAAoCN,IAApC,sBAGQC,SAAS,CAACK,UAAU,CAACC,WAAZ,CAHjB,EAICN,SAAS,CAACK,UAAU,CAACE,IAAZ,CAJV,EAKDP,SAAS,CAACK,UAAU,CAACG,EAAZ,CALR,EAMEJ,KAAK,IAAI,EANX,EAOAJ,SAAS,CAACK,UAAU,CAACsB,GAAZ,CAPT,EAQA3B,SAAS,CAACK,UAAU,CAACuB,GAAZ,CART,EASC5B,SAAS,CAACK,UAAU,CAACwB,IAAZ,CATV,EAUMxB,UAAU,CAACM,QAVjB,EAYIN,UAAU,CAACU,QAZf,CADN;AAgBJC,IAAAA,YAAY,EAAE,CAAEjC,SAAF,EAAaE,eAAb,EAA8BY,aAA9B;AAhBV;AAnYqB,CAAtB","sourcesContent":["import { FormMixin } from '../templatesDependencies/formMixin';\nimport { FormCheckboxMixin } from '../templatesDependencies/formCheckboxMixin';\nimport { FormMinMaxMixin } from '../templatesDependencies/formMinMaxMixin';\nimport { FormNumberMixin } from '../templatesDependencies/formNumberMixin';\nimport { FormDropdownMixin } from '../templatesDependencies/formDropdownMixin';\nimport { FormCheckboxesMixin } from '../templatesDependencies/formCheckboxesMixin';\nimport { FormRadioMixin } from '../templatesDependencies/formRadioMixin';\nimport { FormFileMixin } from '../templatesDependencies/formFileMixin';\nimport { MultipleFormMixin } from '../templatesDependencies/multipleFormMixin';\nimport { MultipleselectFormMixin } from '../templatesDependencies/multipleselectFormMixin';\nimport { RangeMixin } from '../templatesDependencies/rangeMixin';\nimport { FilterRangeFormMixin } from '../templatesDependencies/filterRangeFormMixin';\nimport { ValueRichtextMixin } from '../templatesDependencies/valueRichtextMixin';\nimport { PatternMixin } from '../templatesDependencies/patternMixin';\nimport { FormStepMixin } from '../templatesDependencies/formStepMixin';\nimport { FormLengthMixin } from '../templatesDependencies/formLengthMixin';\n\nimport { html } from 'lit-html';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nexport const formTemplates = {\n text: {\n template: (value: string, attributes: any) => html`\n <input\n type=\"text\"\n placeholder=${ifDefined(attributes.placeholder)}\n name=${ifDefined(attributes.name)}\n id=${ifDefined(attributes.id)}\n value=${value || ''}\n pattern=${ifDefined(attributes.pattern)}\n title=${ifDefined(attributes.title)}\n ?required=${attributes.required}\n autocomplete=${ifDefined(attributes.autocomplete)}\n data-holder\n maxlength=${ifDefined(attributes.maxlength)}\n minlength=${ifDefined(attributes.minlength)}\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin, PatternMixin, FormLengthMixin ]\n },\n textarea: {\n template: (value: string, attributes: any) => html`\n <textarea\n name=${ifDefined(attributes.name)}\n id=${ifDefined(attributes.id)}\n placeholder=${ifDefined(attributes.placeholder)}\n data-holder\n ?required=${attributes.required}\n autocomplete=${ifDefined(attributes.autocomplete)}\n maxlength=${ifDefined(attributes.maxlength)}\n minlength=${ifDefined(attributes.minlength)}\n @change=${attributes.onChange}\n >${value}</textarea>\n `,\n dependencies: [ FormMixin, FormLengthMixin ]\n },\n checkbox: {\n template: (value: string, attributes: any) => html`\n <label>\n <input\n data-holder\n type=\"checkbox\"\n name=${ifDefined(attributes.name)}\n ?required=${attributes.required}\n ?checked=${value === 'true'}\n @change=${attributes.onChange}\n >\n <div>${attributes.label || attributes.name}</div>\n </label>\n `,\n dependencies: [ FormCheckboxMixin, FormMixin ]\n },\n date: {\n template: (_value: string, attributes: any) => html`\n <input\n type=\"date\"\n placeholder=${ifDefined(attributes.placeholder)}\n name=${ifDefined(attributes.name)}\n id=${ifDefined(attributes.id)}\n ?required=${attributes.required}\n value=${ifDefined(attributes.originalValue)}\n data-holder\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin ]\n },\n rangedate: {\n template: (_value: string, attributes: any) => html`\n <input\n data-holder\n type=\"date\"\n name=\"${attributes.name || ''}-start\"\n @change=${attributes.onChange}\n value=${ifDefined(attributes.startValue)}\n />\n <input\n data-holder\n type=\"date\"\n name=\"${attributes.name || ''}-end\"\n @change=${attributes.onChange}\n value=${ifDefined(attributes.endValue)}\n />\n `,\n dependencies: [ FilterRangeFormMixin, FormMixin ]\n },\n number: {\n template: (value: string, attributes: any) => html`\n <input\n type=\"number\"\n placeholder=${ifDefined(attributes.placeholder)}\n name=${ifDefined(attributes.name)}\n id=${ifDefined(attributes.id)}\n value=${value}\n min=${ifDefined(attributes.min)}\n max=${ifDefined(attributes.max)}\n step=${ifDefined(attributes.step)}\n ?required=${attributes.required}\n data-holder\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormNumberMixin, FormMinMaxMixin, FormMixin, FormStepMixin ]\n },\n rangenumber: {\n template: (_value: string, attributes: any) => html`\n <input\n data-holder\n type=\"number\"\n name=\"${attributes.name || ''}-start\"\n @change=${attributes.onChange}\n value=${ifDefined(attributes.startValue)}\n />\n <input\n data-holder\n type=\"number\"\n name=\"${attributes.name || ''}-end\"\n @change=${attributes.onChange}\n value=${ifDefined(attributes.endValue)}\n />\n `,\n dependencies: [ FilterRangeFormMixin, FormNumberMixin, FormMixin ]\n },\n hidden: {\n template: (value: string, attributes: any) => html`\n <input\n type=\"hidden\"\n name=${ifDefined(attributes.name)}\n value=${value}\n data-holder\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin ]\n },\n dropdown: {\n template: (value: string, attributes: any) => html`\n <select\n name=${ifDefined(attributes.name)}\n id=${ifDefined(attributes.id)}\n data-holder\n ?required=${attributes.required}\n ?multiple=${attributes.multiple}\n autocomplete=${ifDefined(attributes.autocomplete)}\n @change=${attributes.onChange}\n >\n ${!(attributes.multiple || attributes.autocomplete) ? html`\n <option value=\"\" ?selected=${value === \"\"}>\n ${attributes.placeholder || '-'}\n </option>\n ` : ''}\n ${(attributes.range || []).map(el => html`\n <option\n value=${el.value}\n ?selected=${!attributes.multiple ? value === el.selectedValue : attributes.values.includes(el.selectedValue)}\n >\n ${el.label}\n </option>\n `)}\n ${Object.entries(attributes.enum || []).map(([key, val]) => html`\n <option\n value=\"${key}\"\n ?selected=${!attributes.multiple ? value === key : attributes.values.includes(key)}\n >\n ${val}\n </option>\n `)}\n </select>\n `,\n dependencies: [ FormDropdownMixin, FormMixin, RangeMixin ]\n },\n radio: {\n template: (value: string, attributes: any) => html`\n <div\n name=${ifDefined(attributes.name)}\n >\n ${(attributes.range || []).map(el => html`\n <label>\n <input\n type=\"radio\"\n name=${ifDefined(attributes.id)}\n value=${el.value}\n ?required=${attributes.required}\n ?checked=${value === el.selectedValue}\n > <span>${el.label}</span>\n </label>\n `)}\n ${Object.entries(attributes.enum || []).map(([key, val]) => html`\n <label>\n <input\n type=\"radio\"\n value=\"${key}\"\n name=${ifDefined(attributes.id)}\n ?required=${attributes.required}\n ?checked=${value === key}\n > <span>${val}</span>\n </label>\n `)}\n `,\n dependencies: [ FormRadioMixin, FormMixin, RangeMixin ]\n },\n multicheckbox: {\n template: (_value: string, attributes: any) => html`\n <div\n name=${ifDefined(attributes.name)}\n >\n ${(attributes.range || []).map(el => html`\n <label>\n <input\n type=\"checkbox\"\n value=${el.value}\n ?checked=${attributes.values.includes(el.selectedValue)}\n /> <span>${el.label}</span>\n </label>\n `)}\n ${Object.entries(attributes.enum || [])\n .map(([key, val]) => html`\n <label>\n <input type=\"checkbox\"\n value=\"${key}\"\n /> <span>${val}</span>\n </label>\n `)}\n </select>\n `,\n dependencies: [ FormCheckboxesMixin, FormMixin, RangeMixin ]\n },\n checkboxes: {\n template: (_value: string, attributes: any) => html`\n <solid-form-multicheckbox\n data-holder\n name=${ifDefined(attributes.name)}\n range=${ifDefined(attributes.range)}\n enum=${ifDefined(attributes.enum)}\n values=${ifDefined(attributes.values)}\n order-asc=${ifDefined(attributes.orderAsc)}\n order-desc=${ifDefined(attributes.orderDesc)}\n ?required=${attributes.required}\n ></solid-form-multicheckbox>\n `,\n dependencies: [ MultipleselectFormMixin, FormMixin ]\n },\n multiple: {\n template: (_value: string, attributes: any) => html`\n ${(attributes.children || []).map((child, index) => html`\n <div data-index=${attributes.name + index}>\n ${child}\n <button type=\"button\" @click=${() => attributes.removeItem(index)}>${attributes.removeLabel}</button>\n </div>\n `)}\n <button type=\"button\" @click=${attributes.addItem}>${attributes.addLabel}</button>\n `,\n dependencies: [ MultipleFormMixin, FormMixin ]\n },\n multipleselect: {\n template: (_value: string, attributes: any) => html`\n <solid-form-dropdown\n data-holder\n name=${ifDefined(attributes.name)}\n data-id=${ifDefined(attributes.id)}\n range=${ifDefined(attributes.range)}\n values=${ifDefined(attributes.values)}\n order-asc=${ifDefined(attributes.orderAsc)}\n order-desc=${ifDefined(attributes.orderDesc)}\n ?required=${attributes.required}\n multiple\n ></solid-form-dropdown>\n `,\n dependencies: [ MultipleselectFormMixin, FormMixin ]\n },\n file: {\n template: (value: string, attributes: any) => html`\n <div>\n <input\n data-holder\n type=\"text\"\n ?required=${attributes.required}\n name=${ifDefined(attributes.name)}\n value=${value || ''}\n >\n <input\n type=\"file\"\n id=${ifDefined(attributes.id)}\n value=${ifDefined(attributes.fileValue)}\n @change=${attributes.selectFile}\n />\n <button\n ?hidden=${attributes.resetButtonHidden}\n @click=${attributes.resetFile}\n >×</button>\n <span>${attributes.output}</span>\n </div>\n `,\n dependencies: [ FormFileMixin, FormMixin ]\n },\n image: {\n template: (value: string, attributes: any) => html`\n <div>\n <input\n data-holder\n type=\"text\"\n name=${ifDefined(attributes.name)}\n value=${value || ''}\n ?required=${attributes.required}\n >\n <input\n type=\"file\"\n accept=\"image/*\"\n id=${ifDefined(attributes.id)}\n value=${ifDefined(attributes.fileValue)}\n @change=${attributes.selectFile}\n />\n <img\n src=${value || ''}\n ?hidden=${value === ''}\n />\n <button\n ?hidden=${attributes.resetButtonHidden}\n @click=${attributes.resetFile}\n >×</button>\n <span>${attributes.output}</span>\n </div>\n `,\n dependencies: [ FormFileMixin, FormMixin ]\n },\n richtext: {\n template: (_value: string, attributes: any) => html`\n <div \n data-richtext\n name=${ifDefined(attributes.name)}\n data-holder\n ></div>\n `,\n dependencies: [ ValueRichtextMixin, FormMixin ]\n },\n color: {\n template: (_value: string, attributes: any) => html`\n <input\n type=\"color\"\n placeholder=${ifDefined(attributes.placeholder)}\n id=${ifDefined(attributes.id)}\n name=${ifDefined(attributes.name)}\n ?required=${attributes.required}\n value=${ifDefined(attributes.originalValue)}\n data-holder\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin ]\n },\n email: {\n template: (value: string, attributes: any) => html`\n <input\n type=\"email\"\n placeholder=${ifDefined(attributes.placeholder)}\n id=${ifDefined(attributes.id)}\n name=${ifDefined(attributes.name)}\n value=${value || ''}\n ?required=${attributes.required}\n data-holder\n maxlength=${ifDefined(attributes.maxlength)}\n minlength=${ifDefined(attributes.minlength)}\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin, FormLengthMixin ]\n },\n password: {\n template: (value: string, attributes: any) => html`\n <input\n type=\"password\"\n placeholder=${ifDefined(attributes.placeholder)}\n id=${ifDefined(attributes.id)}\n name=${ifDefined(attributes.name)}\n value=${value || ''}\n ?required=${attributes.required}\n pattern=${ifDefined(attributes.pattern)}\n title=${ifDefined(attributes.title)}\n data-holder\n maxlength=${ifDefined(attributes.maxlength)}\n minlength=${ifDefined(attributes.minlength)}\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin, PatternMixin, FormLengthMixin ]\n },\n time: {\n template: (value: string, attributes: any) => html`\n <input\n type=\"time\"\n placeholder=${ifDefined(attributes.placeholder)}\n name=${ifDefined(attributes.name)}\n id=${ifDefined(attributes.id)}\n value=${value || ''}\n min=${ifDefined(attributes.min)}\n max=${ifDefined(attributes.max)}\n step=${ifDefined(attributes.step)}\n ?required=${attributes.required}\n data-holder\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin, FormMinMaxMixin, FormStepMixin ]\n },\n}\n"]}
1
+ {"version":3,"sources":["formTemplatesDirectory.ts"],"names":["FormMixin","FormCheckboxMixin","FormMinMaxMixin","FormNumberMixin","FormDropdownMixin","FormCheckboxesMixin","FormRadioMixin","FormFileMixin","MultipleFormMixin","MultipleselectFormMixin","RangeMixin","FilterRangeFormMixin","ValueRichtextMixin","PatternMixin","FormStepMixin","FormLengthMixin","html","ifDefined","formTemplates","text","template","value","attributes","placeholder","name","id","pattern","title","required","autocomplete","maxlength","minlength","onChange","dependencies","textarea","checkbox","label","date","_value","originalValue","rangedate","startValue","endValue","number","min","max","step","rangenumber","hidden","dropdown","multiple","range","map","el","selectedValue","values","includes","Object","entries","enum","key","val","radio","multicheckbox","checkboxes","orderAsc","orderDesc","children","child","index","removeClass","removeItem","removeLabel","addClass","addItem","addLabel","multipleselect","file","fileValue","selectFile","resetButtonHidden","resetFile","output","image","richtext","color","email","password","time"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,SAAT,QAA0B,oCAA1B;AACA,SAASC,iBAAT,QAAkC,4CAAlC;AACA,SAASC,eAAT,QAAgC,0CAAhC;AACA,SAASC,eAAT,QAAgC,0CAAhC;AACA,SAASC,iBAAT,QAAkC,4CAAlC;AACA,SAASC,mBAAT,QAAoC,8CAApC;AACA,SAASC,cAAT,QAA+B,yCAA/B;AACA,SAASC,aAAT,QAA8B,wCAA9B;AACA,SAASC,iBAAT,Q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AS,CAACK,UAAU,CAACuB,GAAZ,CART,EASC5B,SAAS,CAACK,UAAU,CAACwB,IAAZ,CATV,EAUMxB,UAAU,CAACM,QAVjB,EAYIN,UAAU,CAACU,QAZf,CADN;AAgBJC,IAAAA,YAAY,EAAE,CAAEjC,SAAF,EAAaE,eAAb,EAA8BY,aAA9B;AAhBV;AAnYqB,CAAtB","sourcesContent":["import { FormMixin } from '../templatesDependencies/formMixin';\nimport { FormCheckboxMixin } from '../templatesDependencies/formCheckboxMixin';\nimport { FormMinMaxMixin } from '../templatesDependencies/formMinMaxMixin';\nimport { FormNumberMixin } from '../templatesDependencies/formNumberMixin';\nimport { FormDropdownMixin } from '../templatesDependencies/formDropdownMixin';\nimport { FormCheckboxesMixin } from '../templatesDependencies/formCheckboxesMixin';\nimport { FormRadioMixin } from '../templatesDependencies/formRadioMixin';\nimport { FormFileMixin } from '../templatesDependencies/formFileMixin';\nimport { MultipleFormMixin } from '../templatesDependencies/multipleFormMixin';\nimport { MultipleselectFormMixin } from '../templatesDependencies/multipleselectFormMixin';\nimport { RangeMixin } from '../templatesDependencies/rangeMixin';\nimport { FilterRangeFormMixin } from '../templatesDependencies/filterRangeFormMixin';\nimport { ValueRichtextMixin } from '../templatesDependencies/valueRichtextMixin';\nimport { PatternMixin } from '../templatesDependencies/patternMixin';\nimport { FormStepMixin } from '../templatesDependencies/formStepMixin';\nimport { FormLengthMixin } from '../templatesDependencies/formLengthMixin';\n\nimport { html } from 'lit-html';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nexport const formTemplates = {\n text: {\n template: (value: string, attributes: any) => html`\n <input\n type=\"text\"\n placeholder=${ifDefined(attributes.placeholder)}\n name=${ifDefined(attributes.name)}\n id=${ifDefined(attributes.id)}\n value=${value || ''}\n pattern=${ifDefined(attributes.pattern)}\n title=${ifDefined(attributes.title)}\n ?required=${attributes.required}\n autocomplete=${ifDefined(attributes.autocomplete)}\n data-holder\n maxlength=${ifDefined(attributes.maxlength)}\n minlength=${ifDefined(attributes.minlength)}\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin, PatternMixin, FormLengthMixin ]\n },\n textarea: {\n template: (value: string, attributes: any) => html`\n <textarea\n name=${ifDefined(attributes.name)}\n id=${ifDefined(attributes.id)}\n placeholder=${ifDefined(attributes.placeholder)}\n data-holder\n ?required=${attributes.required}\n autocomplete=${ifDefined(attributes.autocomplete)}\n maxlength=${ifDefined(attributes.maxlength)}\n minlength=${ifDefined(attributes.minlength)}\n @change=${attributes.onChange}\n >${value}</textarea>\n `,\n dependencies: [ FormMixin, FormLengthMixin ]\n },\n checkbox: {\n template: (value: string, attributes: any) => html`\n <label>\n <input\n data-holder\n type=\"checkbox\"\n name=${ifDefined(attributes.name)}\n ?required=${attributes.required}\n ?checked=${value === 'true'}\n @change=${attributes.onChange}\n >\n <div>${attributes.label || attributes.name}</div>\n </label>\n `,\n dependencies: [ FormCheckboxMixin, FormMixin ]\n },\n date: {\n template: (_value: string, attributes: any) => html`\n <input\n type=\"date\"\n placeholder=${ifDefined(attributes.placeholder)}\n name=${ifDefined(attributes.name)}\n id=${ifDefined(attributes.id)}\n ?required=${attributes.required}\n value=${ifDefined(attributes.originalValue)}\n data-holder\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin ]\n },\n rangedate: {\n template: (_value: string, attributes: any) => html`\n <input\n data-holder\n type=\"date\"\n name=\"${attributes.name || ''}-start\"\n @change=${attributes.onChange}\n value=${ifDefined(attributes.startValue)}\n />\n <input\n data-holder\n type=\"date\"\n name=\"${attributes.name || ''}-end\"\n @change=${attributes.onChange}\n value=${ifDefined(attributes.endValue)}\n />\n `,\n dependencies: [ FilterRangeFormMixin, FormMixin ]\n },\n number: {\n template: (value: string, attributes: any) => html`\n <input\n type=\"number\"\n placeholder=${ifDefined(attributes.placeholder)}\n name=${ifDefined(attributes.name)}\n id=${ifDefined(attributes.id)}\n value=${value}\n min=${ifDefined(attributes.min)}\n max=${ifDefined(attributes.max)}\n step=${ifDefined(attributes.step)}\n ?required=${attributes.required}\n data-holder\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormNumberMixin, FormMinMaxMixin, FormMixin, FormStepMixin ]\n },\n rangenumber: {\n template: (_value: string, attributes: any) => html`\n <input\n data-holder\n type=\"number\"\n name=\"${attributes.name || ''}-start\"\n @change=${attributes.onChange}\n value=${ifDefined(attributes.startValue)}\n />\n <input\n data-holder\n type=\"number\"\n name=\"${attributes.name || ''}-end\"\n @change=${attributes.onChange}\n value=${ifDefined(attributes.endValue)}\n />\n `,\n dependencies: [ FilterRangeFormMixin, FormNumberMixin, FormMixin ]\n },\n hidden: {\n template: (value: string, attributes: any) => html`\n <input\n type=\"hidden\"\n name=${ifDefined(attributes.name)}\n value=${value}\n data-holder\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin ]\n },\n dropdown: {\n template: (value: string, attributes: any) => html`\n <select\n name=${ifDefined(attributes.name)}\n id=${ifDefined(attributes.id)}\n data-holder\n ?required=${attributes.required}\n ?multiple=${attributes.multiple}\n autocomplete=${ifDefined(attributes.autocomplete)}\n @change=${attributes.onChange}\n >\n ${!(attributes.multiple || attributes.autocomplete) ? html`\n <option value=\"\" ?selected=${value === \"\"}>\n ${attributes.placeholder || '-'}\n </option>\n ` : ''}\n ${(attributes.range || []).map(el => html`\n <option\n value=${el.value}\n ?selected=${!attributes.multiple ? value === el.selectedValue : attributes.values.includes(el.selectedValue)}\n >\n ${el.label}\n </option>\n `)}\n ${Object.entries(attributes.enum || []).map(([key, val]) => html`\n <option\n value=\"${key}\"\n ?selected=${!attributes.multiple ? value === key : attributes.values.includes(key)}\n >\n ${val}\n </option>\n `)}\n </select>\n `,\n dependencies: [ FormDropdownMixin, FormMixin, RangeMixin ]\n },\n radio: {\n template: (value: string, attributes: any) => html`\n <div\n name=${ifDefined(attributes.name)}\n >\n ${(attributes.range || []).map(el => html`\n <label>\n <input\n type=\"radio\"\n name=${ifDefined(attributes.id)}\n value=${el.value}\n ?required=${attributes.required}\n ?checked=${value === el.selectedValue}\n > <span>${el.label}</span>\n </label>\n `)}\n ${Object.entries(attributes.enum || []).map(([key, val]) => html`\n <label>\n <input\n type=\"radio\"\n value=\"${key}\"\n name=${ifDefined(attributes.id)}\n ?required=${attributes.required}\n ?checked=${value === key}\n > <span>${val}</span>\n </label>\n `)}\n `,\n dependencies: [ FormRadioMixin, FormMixin, RangeMixin ]\n },\n multicheckbox: {\n template: (_value: string, attributes: any) => html`\n <div\n name=${ifDefined(attributes.name)}\n >\n ${(attributes.range || []).map(el => html`\n <label>\n <input\n type=\"checkbox\"\n value=${el.value}\n ?checked=${attributes.values.includes(el.selectedValue)}\n /> <span>${el.label}</span>\n </label>\n `)}\n ${Object.entries(attributes.enum || [])\n .map(([key, val]) => html`\n <label>\n <input type=\"checkbox\"\n value=\"${key}\"\n /> <span>${val}</span>\n </label>\n `)}\n </select>\n `,\n dependencies: [ FormCheckboxesMixin, FormMixin, RangeMixin ]\n },\n checkboxes: {\n template: (_value: string, attributes: any) => html`\n <solid-form-multicheckbox\n data-holder\n name=${ifDefined(attributes.name)}\n range=${ifDefined(attributes.range)}\n enum=${ifDefined(attributes.enum)}\n values=${ifDefined(attributes.values)}\n order-asc=${ifDefined(attributes.orderAsc)}\n order-desc=${ifDefined(attributes.orderDesc)}\n ?required=${attributes.required}\n ></solid-form-multicheckbox>\n `,\n dependencies: [ MultipleselectFormMixin, FormMixin ]\n },\n multiple: {\n template: (_value: string, attributes: any) => html`\n ${(attributes.children || []).map((child, index) => html`\n <div data-index=${attributes.name + index}>\n ${child}\n <button type=\"button\" class=${ifDefined(attributes.removeClass)} @click=${() => attributes.removeItem(index)}>${attributes.removeLabel}</button>\n </div>\n `)}\n <button type=\"button\" class=${ifDefined(attributes.addClass)} @click=${attributes.addItem}>${attributes.addLabel}</button>\n `,\n dependencies: [ MultipleFormMixin, FormMixin ]\n },\n multipleselect: {\n template: (_value: string, attributes: any) => html`\n <solid-form-dropdown\n data-holder\n name=${ifDefined(attributes.name)}\n data-id=${ifDefined(attributes.id)}\n range=${ifDefined(attributes.range)}\n values=${ifDefined(attributes.values)}\n order-asc=${ifDefined(attributes.orderAsc)}\n order-desc=${ifDefined(attributes.orderDesc)}\n ?required=${attributes.required}\n multiple\n ></solid-form-dropdown>\n `,\n dependencies: [ MultipleselectFormMixin, FormMixin ]\n },\n file: {\n template: (value: string, attributes: any) => html`\n <div>\n <input\n data-holder\n type=\"text\"\n ?required=${attributes.required}\n name=${ifDefined(attributes.name)}\n value=${value || ''}\n >\n <input\n type=\"file\"\n id=${ifDefined(attributes.id)}\n value=${ifDefined(attributes.fileValue)}\n @change=${attributes.selectFile}\n />\n <button\n ?hidden=${attributes.resetButtonHidden}\n @click=${attributes.resetFile}\n >×</button>\n <span>${attributes.output}</span>\n </div>\n `,\n dependencies: [ FormFileMixin, FormMixin ]\n },\n image: {\n template: (value: string, attributes: any) => html`\n <div>\n <input\n data-holder\n type=\"text\"\n name=${ifDefined(attributes.name)}\n value=${value || ''}\n ?required=${attributes.required}\n >\n <input\n type=\"file\"\n accept=\"image/*\"\n id=${ifDefined(attributes.id)}\n value=${ifDefined(attributes.fileValue)}\n @change=${attributes.selectFile}\n />\n <img\n src=${value || ''}\n ?hidden=${value === ''}\n />\n <button\n ?hidden=${attributes.resetButtonHidden}\n @click=${attributes.resetFile}\n >×</button>\n <span>${attributes.output}</span>\n </div>\n `,\n dependencies: [ FormFileMixin, FormMixin ]\n },\n richtext: {\n template: (_value: string, attributes: any) => html`\n <div \n data-richtext\n name=${ifDefined(attributes.name)}\n data-holder\n ></div>\n `,\n dependencies: [ ValueRichtextMixin, FormMixin ]\n },\n color: {\n template: (_value: string, attributes: any) => html`\n <input\n type=\"color\"\n placeholder=${ifDefined(attributes.placeholder)}\n id=${ifDefined(attributes.id)}\n name=${ifDefined(attributes.name)}\n ?required=${attributes.required}\n value=${ifDefined(attributes.originalValue)}\n data-holder\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin ]\n },\n email: {\n template: (value: string, attributes: any) => html`\n <input\n type=\"email\"\n placeholder=${ifDefined(attributes.placeholder)}\n id=${ifDefined(attributes.id)}\n name=${ifDefined(attributes.name)}\n value=${value || ''}\n ?required=${attributes.required}\n data-holder\n maxlength=${ifDefined(attributes.maxlength)}\n minlength=${ifDefined(attributes.minlength)}\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin, FormLengthMixin ]\n },\n password: {\n template: (value: string, attributes: any) => html`\n <input\n type=\"password\"\n placeholder=${ifDefined(attributes.placeholder)}\n id=${ifDefined(attributes.id)}\n name=${ifDefined(attributes.name)}\n value=${value || ''}\n ?required=${attributes.required}\n pattern=${ifDefined(attributes.pattern)}\n title=${ifDefined(attributes.title)}\n data-holder\n maxlength=${ifDefined(attributes.maxlength)}\n minlength=${ifDefined(attributes.minlength)}\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin, PatternMixin, FormLengthMixin ]\n },\n time: {\n template: (value: string, attributes: any) => html`\n <input\n type=\"time\"\n placeholder=${ifDefined(attributes.placeholder)}\n name=${ifDefined(attributes.name)}\n id=${ifDefined(attributes.id)}\n value=${value || ''}\n min=${ifDefined(attributes.min)}\n max=${ifDefined(attributes.max)}\n step=${ifDefined(attributes.step)}\n ?required=${attributes.required}\n data-holder\n @change=${attributes.onChange}\n />\n `,\n dependencies: [ FormMixin, FormMinMaxMixin, FormStepMixin ]\n },\n}\n"]}
@@ -0,0 +1,14 @@
1
+ const LinkTextMixin = {
2
+ name: 'link-text-mixin',
3
+ attributes: {
4
+ linkText: {
5
+ type: String,
6
+ default: '',
7
+ callback: function (newValue) {
8
+ this.addToAttributes(newValue, 'linkText');
9
+ }
10
+ }
11
+ }
12
+ };
13
+ export { LinkTextMixin };
14
+ //# sourceMappingURL=linkTextMixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["linkTextMixin.ts"],"names":["LinkTextMixin","name","attributes","linkText","type","String","default","callback","newValue","addToAttributes"],"mappings":"AAAA,MAAMA,aAAa,GAAG;AACpBC,EAAAA,IAAI,EAAE,iBADc;AAEpBC,EAAAA,UAAU,EAAE;AACVC,IAAAA,QAAQ,EAAE;AACRC,MAAAA,IAAI,EAAEC,MADE;AAERC,MAAAA,OAAO,EAAE,EAFD;AAGRC,MAAAA,QAAQ,EAAE,UAAUC,QAAV,EAA4B;AACpC,aAAKC,eAAL,CAAqBD,QAArB,EAA+B,UAA/B;AACD;AALO;AADA;AAFQ,CAAtB;AAaA,SACER,aADF","sourcesContent":["const LinkTextMixin = {\n name: 'link-text-mixin',\n attributes: {\n linkText: {\n type: String,\n default: '',\n callback: function (newValue: string) {\n this.addToAttributes(newValue, 'linkText');\n }\n },\n },\n}\n\nexport {\n LinkTextMixin\n}"]}
@@ -26,6 +26,22 @@ const MultipleFormMixin = {
26
26
  range: {
27
27
  type: String,
28
28
  default: ''
29
+ },
30
+ addClass: {
31
+ type: String,
32
+ default: undefined,
33
+ callback: function (value) {
34
+ if (value !== this.listAttributes['addClass']) this.listAttributes['addClass'] = value;
35
+ this.planRender();
36
+ }
37
+ },
38
+ removeClass: {
39
+ type: String,
40
+ default: undefined,
41
+ callback: function (value) {
42
+ if (value !== this.listAttributes['removeClass']) this.listAttributes['removeClass'] = value;
43
+ this.planRender();
44
+ }
29
45
  }
30
46
  },
31
47
 
@@ -34,6 +50,8 @@ const MultipleFormMixin = {
34
50
  this.listAttributes['children'] = [];
35
51
  this.listAttributes['addLabel'] = this.addLabel;
36
52
  this.listAttributes['removeLabel'] = this.removeLabel;
53
+ this.listAttributes['addClass'] = this.addClass;
54
+ this.listAttributes['removeClass'] = this.removeClass;
37
55
 
38
56
  this.listAttributes['addItem'] = () => {
39
57
  this.insertWidget();
@@ -1 +1 @@
1
- {"version":3,"sources":["multipleFormMixin.ts"],"names":["StoreMixin","MultipleFormMixin","name","use","attributes","widget","type","String","default","addLabel","callback","value","listAttributes","planRender","removeLabel","range","created","listValueTransformations","push","setDataSrc","bind","insertWidget","index","element","querySelector","remove","dispatchEvent","Event","bubbles","dataSrc","nextProcessor","shift","populate","resource","document","createElement","Object","keys","toggleAttribute","setAttribute","empty","getValue","dataHolder","Array","from","map","getValueFromElement","multiple"],"mappings":"AAAA,SAASA,UAAT,QAA2B,yBAA3B;AAEA,MAAMC,iBAAiB,GAAG;AACxBC,EAAAA,IAAI,EAAE,qBADkB;AAExBC,EAAAA,GAAG,EAAE,CAAEH,UAAF,CAFmB;AAGxBI,EAAAA,UAAU,EAAE;AACVC,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAEC,MADA;AAENC,MAAAA,OAAO,EAAE;AAFH,KADE;AAKVC,IAAAA,QAAQ,EAAE;AACRH,MAAAA,IAAI,EAAEC,MADE;AAERC,MAAAA,OAAO,EAAE,GAFD;AAGRE,MAAAA,QAAQ,EAAE,UAASC,KAAT,EAAgB;AACxB,YAAIA,KAAK,KAAK,KAAKC,cAAL,CAAoB,UAApB,CAAd,EAA+C,KAAKA,cAAL,CAAoB,UAApB,IAAkCD,KAAlC;AAC/C,aAAKE,UAAL;AACD;AANO,KALA;AAaVC,IAAAA,WAAW,EAAE;AACXR,MAAAA,IAAI,EAAEC,MADK;AAEXC,MAAAA,OAAO,EAAE,GAFE;AAGXE,MAAAA,QAAQ,EAAE,UAASC,KAAT,EAAgB;AACxB,YAAIA,KAAK,KAAK,KAAKC,cAAL,CAAoB,aAApB,CAAd,EAAkD,KAAKA,cAAL,CAAoB,aAApB,IAAqCD,KAArC;AAClD,aAAKE,UAAL;AACD;AANU,KAbH;AAqBVE,IAAAA,KAAK,EAAE;AACLT,MAAAA,IAAI,EAAEC,MADD;AAELC,MAAAA,OAAO,EAAE;AAFJ;AArBG,GAHY;;AA6BxBQ,EAAAA,OAAO,GAAG;AACR,SAAKC,wBAAL,CAA8BC,IAA9B,CAAmC,KAAKC,UAAL,CAAgBC,IAAhB,CAAqB,IAArB,CAAnC;AAEA,SAAKR,cAAL,CAAoB,UAApB,IAAkC,EAAlC;AACA,SAAKA,cAAL,CAAoB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AG6B,QAAQ,CAACC,aAAT,CAAuB,KAAK9B,MAA5B,CAAf;AACA,UAAMD,UAAU,GAAG;AACjB,qBAAe,IADE;AAEjB,cAAQ,KAAKF,IAFI;AAGjB,eAASS,KAHQ;AAIjB,eAAS,KAAKI;AAJG,KAAnB;;AAMA,SAAK,IAAIb,IAAT,IAAiBkC,MAAM,CAACC,IAAP,CAAYjC,UAAZ,CAAjB,EAA0C;AACxC,UAAI,OAAOA,UAAU,CAACF,IAAD,CAAjB,KAA4B,SAAhC,EAA2CG,MAAM,CAACiC,eAAP,CAAuBpC,IAAvB,EAA6BE,UAAU,CAACF,IAAD,CAAvC,EAA3C,KACKG,MAAM,CAACkC,YAAP,CAAoBrC,IAApB,EAA0BE,UAAU,CAACF,IAAD,CAApC;AACN;;AACD,SAAKU,cAAL,CAAoB,UAApB,EAAgCM,IAAhC,CAAqCb,MAArC;AACD,GA1EuB;;AA2ExBmC,EAAAA,KAAK,GAAG;AACN,SAAK5B,cAAL,CAAoB,UAApB,IAAkC,EAAlC;AACA,SAAKC,UAAL;AACD,GA9EuB;;AA+ExB4B,EAAAA,QAAQ,GAAG;AACT,QAAI,CAAC,KAAKC,UAAV,EAAsB,OAAO,EAAP;AACtB,WAAOC,KAAK,CAACC,IAAN,CAAW,KAAKF,UAAhB,EAA4BG,GAA5B,CAAiCtB,OAAD,IAAkB,KAAKuB,mBAAL,CAAyBvB,OAAzB,CAAlD,CAAP;AACD,GAlFuB;;AAmFxB,MAAIjB,IAAJ,GAAW;AACT,WAAO,UAAP;AACD,GArFuB;;AAsFxB,MAAIyC,QAAJ,GAAe;AACb,WAAO,IAAP;AACD;;AAxFuB,CAA1B;AA4FA,SACE9C,iBADF","sourcesContent":["import { StoreMixin } from '../../mixins/storeMixin';\n\nconst MultipleFormMixin = {\n name: 'multiple-form-mixin',\n use: [ StoreMixin ],\n attributes: {\n widget: {\n type: String,\n default: 'solid-form-text'\n },\n addLabel: {\n type: String,\n default: '+',\n callback: function(value) {\n if (value !== this.listAttributes['addLabel']) this.listAttributes['addLabel'] = value;\n this.planRender();\n }\n },\n removeLabel: {\n type: String,\n default: '×',\n callback: function(value) {\n if (value !== this.listAttributes['removeLabel']) this.listAttributes['removeLabel'] = value;\n this.planRender();\n }\n },\n range: {\n type: String,\n default: '',\n }\n },\n created() {\n this.listValueTransformations.push(this.setDataSrc.bind(this));\n\n this.listAttributes['children'] = [];\n this.listAttributes['addLabel'] = this.addLabel;\n this.listAttributes['removeLabel'] = this.removeLabel;\n this.listAttributes['addItem'] = () => {\n this.insertWidget();\n this.planRender();\n };\n this.listAttributes['removeItem'] = (index) => {\n this.element.querySelector(`[data-index=\"${this.name + index}\"]`).remove();\n this.element.dispatchEvent(new Event('change', {bubbles: true}));\n };\n },\n setDataSrc(value: string, listValueTransformations: Function[]) {\n if (value && value !== this.dataSrc) this.dataSrc = value;\n const nextProcessor = listValueTransformations.shift();\n if(nextProcessor) nextProcessor(value, listValueTransformations);\n },\n populate() {\n if (!this.resource || !this.resource['ldp:contains']) return;\n\n this.listAttributes['children'] = []; // reset list\n\n // set value in form\n for (let resource of this.resource['ldp:contains']) { // for each resource\n this.insertWidget(resource['@id']); // create a widget\n }\n this.planRender();\n },\n insertWidget(value: string = '') {\n if (!this.widget) return;\n const widget = document.createElement(this.widget);\n const attributes = {\n 'data-holder': true,\n 'name': this.name,\n 'value': value,\n 'range': this.range\n };\n for (let name of Object.keys(attributes)) {\n if (typeof attributes[name] === \"boolean\") widget.toggleAttribute(name, attributes[name]);\n else widget.setAttribute(name, attributes[name]);\n }\n this.listAttributes['children'].push(widget);\n },\n empty() {\n this.listAttributes['children'] = [];\n this.planRender();\n },\n getValue() {\n if (!this.dataHolder) return [];\n return Array.from(this.dataHolder).map((element: any) => this.getValueFromElement(element));\n },\n get type() {\n return 'resource';\n },\n get multiple() {\n return true;\n }\n\n}\n\nexport {\n MultipleFormMixin\n}"]}
1
+ {"version":3,"sources":["multipleFormMixin.ts"],"names":["StoreMixin","MultipleFormMixin","name","use","attributes","widget","type","String","default","addLabel","callback","value","listAttributes","planRender","removeLabel","range","addClass","undefined","removeClass","created","listValueTransformations","push","setDataSrc","bind","insertWidget","index","element","querySelector","remove","dispatchEvent","Event","bubbles","dataSrc","nextProcessor","shift","populate","resource","document","createElement","Object","keys","toggleAttribute","setAttribute","empty","getValue","dataHolder","Array","from","map","getValueFromElement","multiple"],"mappings":"AAAA,SAASA,UAAT,QAA2B,yBAA3B;AAEA,MAAMC,iBAAiB,GAAG;AACxBC,EAAAA,IAAI,EAAE,qBADkB;AAExBC,EAAAA,GAAG,EAAE,CAAEH,UAAF,CAFmB;AAGxBI,EAAAA,UAAU,EAAE;AACVC,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAEC,MADA;AAENC,MAAAA,OAAO,EAAE;AAFH,KADE;AAKVC,IAAAA,QAAQ,EAAE;AACRH,MAAAA,IAAI,EAAEC,MADE;AAERC,MAAAA,OAAO,EAAE,GAFD;AAGRE,MAAAA,QAAQ,EAAE,UAASC,KAAT,EAAgB;AACxB,YAAIA,KAAK,KAAK,KAAKC,cAAL,CAAoB,UAApB,CAAd,EAA+C,KAAKA,cAAL,CAAoB,UAApB,IAAkCD,KAAlC;AAC/C,aAAKE,UAAL;AACD;AANO,KALA;AAaVC,IAAAA,WAAW,EAAE;AACXR,MAAAA,IAAI,EAAEC,MADK;AAEXC,MAAAA,OAAO,EAAE,GAFE;AAGXE,MAAAA,QAAQ,EAAE,UAASC,KAAT,EAAgB;AACxB,YAAIA,KAAK,KAAK,KAAKC,cAAL,CAAoB,aAApB,CAAd,EAAkD,KAAKA,cAAL,CAAoB,aAApB,IAAqCD,KAArC;AAClD,aAAKE,UAAL;AACD;AANU,KAbH;AAqBVE,IAAAA,KAAK,EAAE;AACLT,MAAAA,IAAI,EAAEC,MADD;AAELC,MAAAA,OAAO,EAAE;AAFJ,KArBG;AA0BVQ,IAAAA,QAAQ,EAAE;AACRV,MAAAA,IAAI,EAAEC,MADE;AAERC,MAAAA,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xC,IAApB,EAA0BE,UAAU,CAACF,IAAD,CAApC;AACN;;AACD,SAAKU,cAAL,CAAoB,UAApB,EAAgCS,IAAhC,CAAqChB,MAArC;AACD,GA7FuB;;AA8FxBsC,EAAAA,KAAK,GAAG;AACN,SAAK/B,cAAL,CAAoB,UAApB,IAAkC,EAAlC;AACA,SAAKC,UAAL;AACD,GAjGuB;;AAkGxB+B,EAAAA,QAAQ,GAAG;AACT,QAAI,CAAC,KAAKC,UAAV,EAAsB,OAAO,EAAP;AACtB,WAAOC,KAAK,CAACC,IAAN,CAAW,KAAKF,UAAhB,EAA4BG,GAA5B,CAAiCtB,OAAD,IAAkB,KAAKuB,mBAAL,CAAyBvB,OAAzB,CAAlD,CAAP;AACD,GArGuB;;AAsGxB,MAAIpB,IAAJ,GAAW;AACT,WAAO,UAAP;AACD,GAxGuB;;AAyGxB,MAAI4C,QAAJ,GAAe;AACb,WAAO,IAAP;AACD;;AA3GuB,CAA1B;AA+GA,SACEjD,iBADF","sourcesContent":["import { StoreMixin } from '../../mixins/storeMixin';\n\nconst MultipleFormMixin = {\n name: 'multiple-form-mixin',\n use: [ StoreMixin ],\n attributes: {\n widget: {\n type: String,\n default: 'solid-form-text'\n },\n addLabel: {\n type: String,\n default: '+',\n callback: function(value) {\n if (value !== this.listAttributes['addLabel']) this.listAttributes['addLabel'] = value;\n this.planRender();\n }\n },\n removeLabel: {\n type: String,\n default: '×',\n callback: function(value) {\n if (value !== this.listAttributes['removeLabel']) this.listAttributes['removeLabel'] = value;\n this.planRender();\n }\n },\n range: {\n type: String,\n default: '',\n \n },\n addClass: {\n type: String,\n default: undefined,\n callback: function(value) {\n if (value !== this.listAttributes['addClass']) this.listAttributes['addClass'] = value;\n this.planRender();\n }\n },\n removeClass: {\n type: String,\n default: undefined,\n callback: function(value) {\n if (value !== this.listAttributes['removeClass']) this.listAttributes['removeClass'] = value;\n this.planRender();\n }\n }\n },\n created() {\n this.listValueTransformations.push(this.setDataSrc.bind(this));\n\n this.listAttributes['children'] = [];\n this.listAttributes['addLabel'] = this.addLabel;\n this.listAttributes['removeLabel'] = this.removeLabel;\n this.listAttributes['addClass'] = this.addClass;\n this.listAttributes['removeClass'] = this.removeClass;\n this.listAttributes['addItem'] = () => {\n this.insertWidget();\n this.planRender();\n };\n this.listAttributes['removeItem'] = (index) => {\n this.element.querySelector(`[data-index=\"${this.name + index}\"]`).remove();\n this.element.dispatchEvent(new Event('change', {bubbles: true}));\n };\n },\n setDataSrc(value: string, listValueTransformations: Function[]) {\n if (value && value !== this.dataSrc) this.dataSrc = value;\n const nextProcessor = listValueTransformations.shift();\n if(nextProcessor) nextProcessor(value, listValueTransformations);\n },\n populate() {\n if (!this.resource || !this.resource['ldp:contains']) return;\n\n this.listAttributes['children'] = []; // reset list\n\n // set value in form\n for (let resource of this.resource['ldp:contains']) { // for each resource\n this.insertWidget(resource['@id']); // create a widget\n }\n this.planRender();\n },\n insertWidget(value: string = '') {\n if (!this.widget) return;\n const widget = document.createElement(this.widget);\n const attributes = {\n 'data-holder': true,\n 'name': this.name,\n 'value': value,\n 'range': this.range\n };\n for (let name of Object.keys(attributes)) {\n if (typeof attributes[name] === \"boolean\") widget.toggleAttribute(name, attributes[name]);\n else widget.setAttribute(name, attributes[name]);\n }\n this.listAttributes['children'].push(widget);\n },\n empty() {\n this.listAttributes['children'] = [];\n this.planRender();\n },\n getValue() {\n if (!this.dataHolder) return [];\n return Array.from(this.dataHolder).map((element: any) => this.getValueFromElement(element));\n },\n get type() {\n return 'resource';\n },\n get multiple() {\n return true;\n }\n\n}\n\nexport {\n MultipleFormMixin\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startinblox/core",
3
- "version": "0.17.19",
3
+ "version": "0.17.21-beta.10",
4
4
  "description": "This is a series of web component respecting both the web components standards and the Linked Data Platform convention.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -82,7 +82,7 @@
82
82
  "babel-loader": "^8.2.2",
83
83
  "babel-plugin-remove-import-js-extension": "0.0.3",
84
84
  "body-parser": "^1.19.0",
85
- "cypress": "^6.6.0",
85
+ "cypress": "^6.9.1",
86
86
  "cypress-plugin-tab": "^1.0.5",
87
87
  "delta-markdown-for-quill": "0.0.9",
88
88
  "dialog-polyfill": "^0.5.6",