@startinblox/core 0.17.26 → 0.17.28
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/_snowpack/pkg/import-map.json +0 -8
- package/dist/components/solid-form.js.map +1 -1
- package/dist/new-widgets/callbackMixins/index.js +2 -4
- package/dist/new-widgets/callbackMixins/index.js.map +1 -1
- package/dist/new-widgets/templates/formTemplatesDirectory.js +8 -23
- package/dist/new-widgets/templates/formTemplatesDirectory.js.map +1 -1
- package/dist/new-widgets/templatesDependencies/formFileMixin.js +27 -3
- package/dist/new-widgets/templatesDependencies/formFileMixin.js.map +1 -1
- package/package.json +2 -4
- package/dist/_snowpack/pkg/showdown.js +0 -5059
- package/dist/_snowpack/pkg/showdown.js.map +0 -1
- package/dist/_snowpack/pkg/showdown.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/tinymce/icons/default.js +0 -196
- package/dist/_snowpack/pkg/tinymce/icons/default.js.map +0 -1
- package/dist/_snowpack/pkg/tinymce/icons/default.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/tinymce/models/dom.js +0 -7955
- package/dist/_snowpack/pkg/tinymce/models/dom.js.map +0 -1
- package/dist/_snowpack/pkg/tinymce/models/dom.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/tinymce/plugins/autoresize/plugin.js +0 -156
- package/dist/_snowpack/pkg/tinymce/plugins/autoresize/plugin.js.map +0 -1
- package/dist/_snowpack/pkg/tinymce/plugins/autoresize/plugin.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/tinymce/plugins/link/plugin.js +0 -1188
- package/dist/_snowpack/pkg/tinymce/plugins/link/plugin.js.map +0 -1
- package/dist/_snowpack/pkg/tinymce/plugins/link/plugin.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/tinymce/plugins/lists/plugin.js +0 -1757
- package/dist/_snowpack/pkg/tinymce/plugins/lists/plugin.js.map +0 -1
- package/dist/_snowpack/pkg/tinymce/plugins/lists/plugin.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/tinymce/themes/silver.js +0 -26121
- package/dist/_snowpack/pkg/tinymce/themes/silver.js.map +0 -1
- package/dist/_snowpack/pkg/tinymce/themes/silver.js.map.proxy.js +0 -1
- package/dist/_snowpack/pkg/tinymce.js +0 -29045
- package/dist/_snowpack/pkg/tinymce.js.map +0 -1
- package/dist/_snowpack/pkg/tinymce.js.map.proxy.js +0 -1
- package/dist/new-widgets/callbackMixins/editorMixin.js +0 -92
- package/dist/new-widgets/callbackMixins/editorMixin.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/valueEditorMixin.js +0 -17
- package/dist/new-widgets/templatesDependencies/valueEditorMixin.js.map +0 -1
|
@@ -16,15 +16,7 @@
|
|
|
16
16
|
"quill": "./quill.js",
|
|
17
17
|
"quill-delta-to-markdown": "./quill-delta-to-markdown.js",
|
|
18
18
|
"quill/dist/quill.snow.css": "./quill/dist/quill.snow.css",
|
|
19
|
-
"showdown": "./showdown.js",
|
|
20
19
|
"slim-select": "./slim-select.js",
|
|
21
|
-
"tinymce": "./tinymce.js",
|
|
22
|
-
"tinymce/icons/default": "./tinymce/icons/default.js",
|
|
23
|
-
"tinymce/models/dom": "./tinymce/models/dom.js",
|
|
24
|
-
"tinymce/plugins/autoresize/plugin.js": "./tinymce/plugins/autoresize/plugin.js",
|
|
25
|
-
"tinymce/plugins/link/plugin.js": "./tinymce/plugins/link/plugin.js",
|
|
26
|
-
"tinymce/plugins/lists/plugin.js": "./tinymce/plugins/lists/plugin.js",
|
|
27
|
-
"tinymce/themes/silver": "./tinymce/themes/silver.js",
|
|
28
20
|
"tui-calendar": "./tui-calendar.js",
|
|
29
21
|
"tui-calendar/dist/tui-calendar.css": "./tui-calendar/dist/tui-calendar.css"
|
|
30
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["solid-form.ts"],"names":["Sib","WidgetMixin","StoreMixin","NextMixin","ValidationMixin","store","setDeepProperty","transformArrayToContainer","html","render","ifDefined","SolidForm","name","use","attributes","defaultWidget","type","String","default","naked","submitButton","undefined","callback","newValue","oldValue","noRender","populate","submitWidget","classSubmitButton","partial","Boolean","autosave","initialState","error","defaultMultipleWidget","defaultSetWidget","value","values","widgets","forEach","widget","component","getValue","JSON","parse","e","split","resource","isContainer","resourceId","isNaked","element","hasAttribute","isSavingAutomatically","isCreationForm","formValue","getFormValue","predicate","Object","keys","object","getWidget","field","isSet","tagName","widgetAttribute","getAttribute","widgetFromTagName","change","dispatchEvent","CustomEvent","bubbles","detail","save","toggleLoaderHidden","hideError","context","saved","put","post","patch","json","then","showError","id","submitForm","reset","goToNext","onInput","onChange","findErrorMessage","errors","errorFullName","errorsArray","member","errorNextName","errorAddName","concat","Array","isArray","errorMessage","errorGlobal","join","push","objectErrors","subErrors","entries","empty","filter","startsWith","errorTemplate","map","parentElement","querySelector","onSubmit","event","preventDefault","performAction","validateModal","onReset","setTimeout","getSubmitTemplate","t","oninput","onchange","fields","getFields","widgetTemplates","Promise","all","createWidgetTemplate","template","bind","getModalDialog","register"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,GAAT,QAAoB,aAApB;AACA,SAASC,WAAT,QAA4B,uBAA5B;AACA,SAASC,UAAT,QAA2B,sBAA3B;AACA,SAASC,SAAT,QAA0B,qBAA1B;AACA,SAASC,eAAT,QAAgC,2BAAhC;AACA,SAASC,KAAT,QAAsB,qBAAtB;AACA,SAASC,eAAT,EAA0BC,yBAA1B,QAA2D,iBAA3D;AAGA,SAASC,IAAT,EAAeC,MAAf,QAA6B,UAA7B;AACA,SAASC,SAAT,QAA0B,gCAA1B;AAEA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,YADiB;AAEvBC,EAAAA,GAAG,EAAE,CAACZ,WAAD,EAAcC,UAAd,EAA0BC,SA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KAAK0G,QAAL,CAAckB,IAAd,CAAmB,IAAnB,CAFZ,EAGW,KAAKb,OAAL,CAAaa,IAAb,CAAkB,IAAlB,CAHX,EAKIL,eALJ,EAMI,CAAC,KAAK1E,qBAAN,GAA8B,KAAKoE,iBAAL,EAA9B,GAAyD,EAN7D,EAOI,KAAKtE,OAAL,CAAaC,YAAb,CAA0B,OAA1B,IACE5C,IADF,uBACiC,EARrC,IAUEA,IAVF,qBAWEuH,eAXF,CAFU,EAgBV,KAAKM,cAAL,EAhBU,CAAd;AAkBA5H,IAAAA,MAAM,CAAC0H,QAAD,EAAW,KAAKhF,OAAhB,CAAN;AACD;;AAnPsB,CAAlB;AAsPPnD,GAAG,CAACsI,QAAJ,CAAa3H,SAAb","sourcesContent":["import { Sib } from '../libs/Sib';\nimport { WidgetMixin } from '../mixins/widgetMixin';\nimport { StoreMixin } from '../mixins/storeMixin';\nimport { NextMixin } from '../mixins/nextMixin';\nimport { ValidationMixin } from '../mixins/validationMixin';\nimport { store } from '../libs/store/store';\nimport { setDeepProperty, transformArrayToContainer } from '../libs/helpers';\nimport type { WidgetInterface } from '../mixins/interfaces';\n\nimport { html, render } from 'lit-html';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nexport const SolidForm = {\n name: 'solid-form',\n use: [WidgetMixin, StoreMixin, NextMixin, ValidationMixin],\n attributes: {\n defaultWidget: {\n type: String,\n default: 'solid-form-label-text'\n },\n naked: {\n type: String,\n default: null\n },\n submitButton: {\n type: String,\n default: undefined,\n callback: function (newValue: string, oldValue: string) {\n if (this.noRender == null && newValue !== oldValue) this.populate();\n },\n },\n submitWidget: {\n type: String,\n default: null\n },\n classSubmitButton: {\n type: String,\n default: undefined,\n },\n partial: {\n type: Boolean,\n default: null\n },\n autosave: {\n type: Boolean,\n default: null\n },\n },\n initialState: {\n error: ''\n },\n get defaultMultipleWidget(): string {\n return 'solid-multiple-form';\n },\n get defaultSetWidget(): string {\n return 'solid-set-default';\n },\n get value(): object {\n const values = {};\n this.widgets.forEach((widget) => {\n const name = (widget.component || widget).name;\n if (name == null) return;\n let value = widget.component ? widget.component.getValue() : widget.value;\n try {\n value = JSON.parse(value);\n } catch (e) {}\n setDeepProperty(values, name.split('.'), value);\n });\n // add @id if edition\n if (this.resource && !this.resource.isContainer()) values['@id'] = this.resourceId;\n return values;\n },\n get isNaked(): boolean {\n return this.element.hasAttribute('naked');\n },\n get isSavingAutomatically(): boolean {\n return this.autosave !== null;\n },\n isCreationForm(formValue: object): boolean {\n return !('@id' in formValue);\n },\n async getFormValue() {\n let value = this.value;\n if (this.resource && !this.resource.isContainer()) {\n for (let predicate of Object.keys(this.value)) { // add @id for nested resources\n const object = await this.resource[predicate];\n if (object && object['@id'] && !value[predicate]['@id']) value[predicate]['@id'] = object['@id'];\n }\n }\n return transformArrayToContainer(value);\n },\n getWidget(field: string, isSet: boolean = false): WidgetInterface {\n let tagName = '';\n const widgetAttribute = this.element.getAttribute('widget-' + field);\n\n // Choose widget\n if (!widgetAttribute && this.element.hasAttribute('upload-url-' + field)) {\n tagName = 'solid-form-file'\n } else if (!widgetAttribute && (this.element.hasAttribute('range-' + field) || this.element.hasAttribute('enum-' + field))) {\n tagName = 'solid-form-dropdown'\n } else {\n tagName = widgetAttribute || (!isSet ? this.defaultWidget : this.defaultSetWidget);\n }\n // Create widget\n return this.widgetFromTagName(tagName);\n },\n change(resource: object): void {\n this.element.dispatchEvent(\n new CustomEvent('formChange', {\n bubbles: true,\n detail: { resource },\n }),\n );\n },\n async save(): Promise<object> {\n this.toggleLoaderHidden(false);\n this.hideError();\n const resource = await this.getFormValue();\n resource['@context'] = this.context;\n let saved;\n try {\n if (this.partial == null) {\n saved = resource['@id'] ?\n await store.put(resource, this.resourceId) :\n await store.post(resource, this.resourceId);\n } else {\n saved = await store.patch(resource, this.resourceId);\n }\n } catch (e) {\n this.toggleLoaderHidden(true);\n if (e) { // if server error\n e.json().then(error => this.showError(error));\n throw e;\n } // else, ldpframework error, we continue\n }\n this.element.dispatchEvent(\n new CustomEvent('save', {\n bubbles: true,\n detail: {\n resource: resource,\n id: saved || null\n },\n }),\n );\n this.toggleLoaderHidden(true);\n return saved;\n },\n async submitForm(): Promise<void> {\n let id: string;\n try {\n id = await this.save() || this.getFormValue()['@id'];\n } catch (e) { return; }\n this.reset();\n this.goToNext({'@id': id})\n },\n async onInput(): Promise<void> {\n const formValue = await this.getFormValue();\n this.change(formValue);\n },\n async onChange(): Promise<void> {\n const formValue = await this.getFormValue();\n if (!this.isCreationForm(formValue) && this.isSavingAutomatically)\n this.submitForm(); // if autosave, submitForm\n },\n findErrorMessage(errors: [string, any][], errorFullName: string = '') {\n let errorsArray: string[] = [];\n errors.forEach((member: [string, any]) => {\n let errorNextName: string = Object.values(member)[0];\n let errorAddName = (errorFullName === \"\" ? errorNextName : errorFullName.concat(' - ', errorNextName));\n if (Array.isArray(Object.values(member)[1]) === true) {\n let errorMessage: string[] = Object.values(member)[1];\n let errorGlobal = errorAddName.concat(': ', errorMessage.join(', '));\n errorsArray.push(errorGlobal);\n } else {\n let objectErrors = Object.values(member)[1];\n let subErrors = Object.entries(objectErrors);\n errorsArray = [...errorsArray, ...this.findErrorMessage(subErrors, errorAddName)];\n }\n });\n return errorsArray;\n },\n empty(): void {},\n showError(e: object) {\n let errors = Object.entries(e).filter(field => !field[0].startsWith('@context'));\n\n const errorTemplate = html`\n <p>A validation error occurred.</p>\n <ul>\n ${this.findErrorMessage(errors).map(field => html`\n <li>${field}</li>\n `)}\n </ul>\n `;\n // If field exists pick its label (unsure if that's easily possible)\n // In this.getFields() map with each field and get label\n // If it does not just add a notice as we do that it's missing that field\n\n // Validation message in english ?\n const parentElement = this.element.querySelector('[data-id=error]');\n if (parentElement) render(errorTemplate, parentElement);\n },\n hideError() {\n const parentElement = this.element.querySelector('[data-id=error]');\n if (parentElement) render('', parentElement);\n },\n reset() {\n if (!this.isNaked) this.element.querySelector('form').reset();\n },\n onSubmit(event: Event) {\n if (!this.isNaked) {\n event.preventDefault();\n this.performAction(); // In validationMixin, method defining what to do according to the present attributes\n }\n },\n validateModal() { //send method to validationMixin, used by the dialog modal and performAction method\n return this.submitForm();\n },\n onReset() {\n if (!this.isNaked) setTimeout(() => this.onInput())\n },\n getSubmitTemplate() {\n return html`\n <div class=${ifDefined(this.classSubmitButton)}>\n ${this.submitWidget === 'button' ? html`\n <button type=\"submit\">${this.submitButton || this.t(\"solid-form.submit-button\")}</button>\n ` : html`\n <input type=\"submit\" value=${this.submitButton || this.t(\"solid-form.submit-button\")}>\n `}\n </div>\n `\n },\n async populate(): Promise<void> {\n this.element.oninput = () => this.onInput(); // prevent from firing change multiple times\n this.element.onchange = () => this.onChange();\n const fields = await this.getFields();\n const widgetTemplates = await Promise.all(fields.map((field: string) => this.createWidgetTemplate(field)));\n const template = html`\n <div data-id=\"error\"></div>\n ${!this.isNaked ? html`\n <form\n @submit=${this.onSubmit.bind(this)}\n @reset=${this.onReset.bind(this)}\n >\n ${widgetTemplates}\n ${!this.isSavingAutomatically ? this.getSubmitTemplate() : ''}\n ${this.element.hasAttribute('reset')\n ? html`<input type=\"reset\" />` : ''}\n </form>\n ` : html`\n ${widgetTemplates}\n `\n }\n ${this.getModalDialog()}\n `;\n render(template, this.element);\n }\n};\n\nSib.register(SolidForm);"]}
|
|
1
|
+
{"version":3,"sources":["solid-form.ts"],"names":["Sib","WidgetMixin","StoreMixin","NextMixin","ValidationMixin","store","setDeepProperty","transformArrayToContainer","html","render","ifDefined","SolidForm","name","use","attributes","defaultWidget","type","String","default","naked","submitButton","undefined","callback","newValue","oldValue","noRender","populate","submitWidget","classSubmitButton","partial","Boolean","autosave","initialState","error","defaultMultipleWidget","defaultSetWidget","value","values","widgets","forEach","widget","component","getValue","JSON","parse","e","split","resource","isContainer","resourceId","isNaked","element","hasAttribute","isSavingAutomatically","isCreationForm","formValue","getFormValue","predicate","Object","keys","object","getWidget","field","isSet","tagName","widgetAttribute","getAttribute","widgetFromTagName","change","dispatchEvent","CustomEvent","bubbles","detail","save","toggleLoaderHidden","hideError","context","saved","put","post","patch","json","then","showError","id","submitForm","reset","goToNext","onInput","onChange","findErrorMessage","errors","errorFullName","errorsArray","member","errorNextName","errorAddName","concat","Array","isArray","errorMessage","errorGlobal","join","push","objectErrors","subErrors","entries","empty","filter","startsWith","errorTemplate","map","parentElement","querySelector","onSubmit","event","preventDefault","performAction","validateModal","onReset","setTimeout","getSubmitTemplate","t","oninput","onchange","fields","getFields","widgetTemplates","Promise","all","createWidgetTemplate","template","bind","getModalDialog","register"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,GAAT,QAAoB,aAApB;AACA,SAASC,WAAT,QAA4B,uBAA5B;AACA,SAASC,UAAT,QAA2B,sBAA3B;AACA,SAASC,SAAT,QAA0B,qBAA1B;AACA,SAASC,eAAT,QAAgC,2BAAhC;AACA,SAASC,KAAT,QAAsB,qBAAtB;AACA,SAASC,eAAT,EAA0BC,yBAA1B,QAA2D,iBAA3D;AAGA,SAASC,IAAT,EAAeC,MAAf,QAA6B,UAA7B;AACA,SAASC,SAAT,QAA0B,gCAA1B;AAEA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,YADiB;AAEvBC,EAAAA,GAAG,EAAE,CAACZ,WAAD,EAAcC,UAAd,EAA0BC,SAA1B,EAAqCC,eAArC,CAFkB;AAGvBU,EAAAA,UAAU,EAAE;AACVC,IAAAA,aAAa,EAAE;AACbC,MAAAA,IAAI,EAAEC,MADO;AAEbC,MAAAA,OAAO,EAAE;AAFI,KADL;AAKVC,IAAAA,KAAK,EAAE;AACLH,MAAAA,IAAI,EAAEC,MADD;AAELC,MAAAA,OAAO,EAAE;AAFJ,KALG;AASVE,IAAAA,YAAY,EAAE;AACZJ,MAAAA,IAAI,EAAEC,MADM;AAEZC,MAAAA,OAAO,EAAEG,SAFG;AAGZC,MAAAA,Q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M,CAAC0H,QAAD,EAAW,KAAKhF,OAAhB,CAAN;AACD;;AAnPsB,CAAlB;AAsPPnD,GAAG,CAACsI,QAAJ,CAAa3H,SAAb","sourcesContent":["import { Sib } from '../libs/Sib';\nimport { WidgetMixin } from '../mixins/widgetMixin';\nimport { StoreMixin } from '../mixins/storeMixin';\nimport { NextMixin } from '../mixins/nextMixin';\nimport { ValidationMixin } from '../mixins/validationMixin';\nimport { store } from '../libs/store/store';\nimport { setDeepProperty, transformArrayToContainer } from '../libs/helpers';\nimport type { WidgetInterface } from '../mixins/interfaces';\n\nimport { html, render } from 'lit-html';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nexport const SolidForm = {\n name: 'solid-form',\n use: [WidgetMixin, StoreMixin, NextMixin, ValidationMixin],\n attributes: {\n defaultWidget: {\n type: String,\n default: 'solid-form-label-text'\n },\n naked: {\n type: String,\n default: null\n },\n submitButton: {\n type: String,\n default: undefined,\n callback: function (newValue: string, oldValue: string) {\n if (this.noRender == null && newValue !== oldValue) this.populate();\n },\n },\n submitWidget: {\n type: String,\n default: null\n },\n classSubmitButton: {\n type: String,\n default: undefined,\n },\n partial: {\n type: Boolean,\n default: null\n },\n autosave: {\n type: Boolean,\n default: null\n },\n },\n initialState: {\n error: ''\n },\n get defaultMultipleWidget(): string {\n return 'solid-multiple-form';\n },\n get defaultSetWidget(): string {\n return 'solid-set-default';\n },\n get value(): object {\n const values = {};\n this.widgets.forEach((widget) => {\n const name = (widget.component || widget).name;\n if (name == null) return;\n let value = widget.component ? widget.component.getValue() : widget.value;\n try {\n value = JSON.parse(value);\n } catch (e) {}\n setDeepProperty(values, name.split('.'), value);\n });\n // add @id if edition\n if (this.resource && !this.resource.isContainer()) values['@id'] = this.resourceId;\n return values;\n },\n get isNaked(): boolean {\n return this.element.hasAttribute('naked');\n },\n get isSavingAutomatically(): boolean {\n return this.autosave !== null;\n },\n isCreationForm(formValue: object): boolean {\n return !('@id' in formValue);\n },\n async getFormValue() {\n let value = this.value;\n if (this.resource && !this.resource.isContainer()) {\n for (let predicate of Object.keys(this.value)) { // add @id for nested resources\n const object = await this.resource[predicate];\n if (object && object['@id'] && !value[predicate]['@id']) value[predicate]['@id'] = object['@id'];\n }\n }\n return transformArrayToContainer(value);\n },\n getWidget(field: string, isSet: boolean = false): WidgetInterface {\n let tagName = '';\n const widgetAttribute = this.element.getAttribute('widget-' + field);\n\n // Choose widget\n if (!widgetAttribute && this.element.hasAttribute('upload-url-' + field)) {\n tagName = 'solid-form-file'\n } else if (!widgetAttribute && (this.element.hasAttribute('range-' + field) || this.element.hasAttribute('enum-' + field))) {\n tagName = 'solid-form-dropdown'\n } else {\n tagName = widgetAttribute || (!isSet ? this.defaultWidget : this.defaultSetWidget);\n }\n // Create widget\n return this.widgetFromTagName(tagName);\n },\n change(resource: object): void {\n this.element.dispatchEvent(\n new CustomEvent('formChange', {\n bubbles: true,\n detail: { resource },\n }),\n );\n },\n async save(): Promise<object> {\n this.toggleLoaderHidden(false);\n this.hideError();\n const resource = await this.getFormValue();\n resource['@context'] = this.context;\n let saved;\n try {\n if (this.partial == null) {\n saved = resource['@id'] ?\n await store.put(resource, this.resourceId) :\n await store.post(resource, this.resourceId);\n } else {\n saved = await store.patch(resource, this.resourceId);\n }\n } catch (e: any) {\n this.toggleLoaderHidden(true);\n if (e) { // if server error\n e.json().then(error => this.showError(error));\n throw e;\n } // else, ldpframework error, we continue\n }\n this.element.dispatchEvent(\n new CustomEvent('save', {\n bubbles: true,\n detail: {\n resource: resource,\n id: saved || null\n },\n }),\n );\n this.toggleLoaderHidden(true);\n return saved;\n },\n async submitForm(): Promise<void> {\n let id: string;\n try {\n id = await this.save() || this.getFormValue()['@id'];\n } catch (e) { return; }\n this.reset();\n this.goToNext({'@id': id})\n },\n async onInput(): Promise<void> {\n const formValue = await this.getFormValue();\n this.change(formValue);\n },\n async onChange(): Promise<void> {\n const formValue = await this.getFormValue();\n if (!this.isCreationForm(formValue) && this.isSavingAutomatically)\n this.submitForm(); // if autosave, submitForm\n },\n findErrorMessage(errors: [string, any][], errorFullName: string = '') {\n let errorsArray: string[] = [];\n errors.forEach((member: [string, any]) => {\n let errorNextName: string = Object.values(member)[0];\n let errorAddName = (errorFullName === \"\" ? errorNextName : errorFullName.concat(' - ', errorNextName));\n if (Array.isArray(Object.values(member)[1]) === true) {\n let errorMessage: string[] = Object.values(member)[1];\n let errorGlobal = errorAddName.concat(': ', errorMessage.join(', '));\n errorsArray.push(errorGlobal);\n } else {\n let objectErrors = Object.values(member)[1];\n let subErrors = Object.entries(objectErrors);\n errorsArray = [...errorsArray, ...this.findErrorMessage(subErrors, errorAddName)];\n }\n });\n return errorsArray;\n },\n empty(): void {},\n showError(e: object) {\n let errors = Object.entries(e).filter(field => !field[0].startsWith('@context'));\n\n const errorTemplate = html`\n <p>A validation error occurred.</p>\n <ul>\n ${this.findErrorMessage(errors).map(field => html`\n <li>${field}</li>\n `)}\n </ul>\n `;\n // If field exists pick its label (unsure if that's easily possible)\n // In this.getFields() map with each field and get label\n // If it does not just add a notice as we do that it's missing that field\n\n // Validation message in english ?\n const parentElement = this.element.querySelector('[data-id=error]');\n if (parentElement) render(errorTemplate, parentElement);\n },\n hideError() {\n const parentElement = this.element.querySelector('[data-id=error]');\n if (parentElement) render('', parentElement);\n },\n reset() {\n if (!this.isNaked) this.element.querySelector('form').reset();\n },\n onSubmit(event: Event) {\n if (!this.isNaked) {\n event.preventDefault();\n this.performAction(); // In validationMixin, method defining what to do according to the present attributes\n }\n },\n validateModal() { //send method to validationMixin, used by the dialog modal and performAction method\n return this.submitForm();\n },\n onReset() {\n if (!this.isNaked) setTimeout(() => this.onInput())\n },\n getSubmitTemplate() {\n return html`\n <div class=${ifDefined(this.classSubmitButton)}>\n ${this.submitWidget === 'button' ? html`\n <button type=\"submit\">${this.submitButton || this.t(\"solid-form.submit-button\")}</button>\n ` : html`\n <input type=\"submit\" value=${this.submitButton || this.t(\"solid-form.submit-button\")}>\n `}\n </div>\n `\n },\n async populate(): Promise<void> {\n this.element.oninput = () => this.onInput(); // prevent from firing change multiple times\n this.element.onchange = () => this.onChange();\n const fields = await this.getFields();\n const widgetTemplates = await Promise.all(fields.map((field: string) => this.createWidgetTemplate(field)));\n const template = html`\n <div data-id=\"error\"></div>\n ${!this.isNaked ? html`\n <form\n @submit=${this.onSubmit.bind(this)}\n @reset=${this.onReset.bind(this)}\n >\n ${widgetTemplates}\n ${!this.isSavingAutomatically ? this.getSubmitTemplate() : ''}\n ${this.element.hasAttribute('reset')\n ? html`<input type=\"reset\" />` : ''}\n </form>\n ` : html`\n ${widgetTemplates}\n `\n }\n ${this.getModalDialog()}\n `;\n render(template, this.element);\n }\n};\n\nSib.register(SolidForm);"]}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { AutocompletionMixin } from './autocompletionMixin.js';
|
|
2
2
|
import { RichtextMixin } from './richtextMixin.js';
|
|
3
|
-
import { EditorMixin } from './editorMixin.js';
|
|
4
3
|
const callbackDirectory = {
|
|
5
4
|
autocompletion: AutocompletionMixin,
|
|
6
|
-
richtext: RichtextMixin
|
|
7
|
-
editor: EditorMixin
|
|
5
|
+
richtext: RichtextMixin
|
|
8
6
|
};
|
|
9
|
-
export { callbackDirectory, AutocompletionMixin, RichtextMixin
|
|
7
|
+
export { callbackDirectory, AutocompletionMixin, RichtextMixin };
|
|
10
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["AutocompletionMixin","RichtextMixin","
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["AutocompletionMixin","RichtextMixin","callbackDirectory","autocompletion","richtext"],"mappings":"AAAA,SAASA,mBAAT,QAAoC,uBAApC;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,MAAMC,iBAAiB,GAAG;AACxBC,EAAAA,cAAc,EAAEH,mBADQ;AAExBI,EAAAA,QAAQ,EAAEH;AAFc,CAA1B;AAKA,SACEC,iBADF,EAEEF,mBAFF,EAGEC,aAHF","sourcesContent":["import { AutocompletionMixin } from './autocompletionMixin';\nimport { RichtextMixin } from './richtextMixin';\n\nconst callbackDirectory = {\n autocompletion: AutocompletionMixin,\n richtext: RichtextMixin,\n}\n\nexport {\n callbackDirectory,\n AutocompletionMixin,\n RichtextMixin,\n}\n"]}
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
function _templateObject30() {
|
|
2
|
-
const data = _taggedTemplateLiteral(["\n <input\n type=\"time\"\n placeholder=", "\n name=", "\n id=", "\n value=", "\n min=", "\n max=", "\n step=", "\n ?required=", "\n data-holder\n @change=", "\n />\n "]);
|
|
3
|
-
|
|
4
|
-
_templateObject30 = function () {
|
|
5
|
-
return data;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
return data;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
1
|
function _templateObject29() {
|
|
12
|
-
const data = _taggedTemplateLiteral(["\n <input\n type=\"
|
|
2
|
+
const data = _taggedTemplateLiteral(["\n <input\n type=\"time\"\n placeholder=", "\n name=", "\n id=", "\n value=", "\n min=", "\n max=", "\n step=", "\n ?required=", "\n data-holder\n @change=", "\n />\n "]);
|
|
13
3
|
|
|
14
4
|
_templateObject29 = function () {
|
|
15
5
|
return data;
|
|
@@ -19,7 +9,7 @@ function _templateObject29() {
|
|
|
19
9
|
}
|
|
20
10
|
|
|
21
11
|
function _templateObject28() {
|
|
22
|
-
const data = _taggedTemplateLiteral(["\n <input\n type=\"
|
|
12
|
+
const data = _taggedTemplateLiteral(["\n <input\n type=\"password\"\n placeholder=", "\n id=", "\n name=", "\n value=", "\n ?required=", "\n pattern=", "\n title=", "\n data-holder\n maxlength=", "\n minlength=", "\n @change=", "\n />\n "]);
|
|
23
13
|
|
|
24
14
|
_templateObject28 = function () {
|
|
25
15
|
return data;
|
|
@@ -29,7 +19,7 @@ function _templateObject28() {
|
|
|
29
19
|
}
|
|
30
20
|
|
|
31
21
|
function _templateObject27() {
|
|
32
|
-
const data = _taggedTemplateLiteral(["\n <input\n type=\"
|
|
22
|
+
const data = _taggedTemplateLiteral(["\n <input\n type=\"email\"\n placeholder=", "\n id=", "\n name=", "\n value=", "\n ?required=", "\n data-holder\n maxlength=", "\n minlength=", "\n @change=", "\n />\n "]);
|
|
33
23
|
|
|
34
24
|
_templateObject27 = function () {
|
|
35
25
|
return data;
|
|
@@ -39,7 +29,7 @@ function _templateObject27() {
|
|
|
39
29
|
}
|
|
40
30
|
|
|
41
31
|
function _templateObject26() {
|
|
42
|
-
const data = _taggedTemplateLiteral(["\n <
|
|
32
|
+
const data = _taggedTemplateLiteral(["\n <input\n type=\"color\"\n placeholder=", "\n id=", "\n name=", "\n ?required=", "\n value=", "\n data-holder\n @change=", "\n />\n "]);
|
|
43
33
|
|
|
44
34
|
_templateObject26 = function () {
|
|
45
35
|
return data;
|
|
@@ -313,7 +303,6 @@ import { MultipleselectFormMixin } from '../templatesDependencies/multipleselect
|
|
|
313
303
|
import { RangeMixin } from '../templatesDependencies/rangeMixin.js';
|
|
314
304
|
import { FilterRangeFormMixin } from '../templatesDependencies/filterRangeFormMixin.js';
|
|
315
305
|
import { ValueRichtextMixin } from '../templatesDependencies/valueRichtextMixin.js';
|
|
316
|
-
import { ValueEditorMixin } from '../templatesDependencies/valueEditorMixin.js';
|
|
317
306
|
import { PatternMixin } from '../templatesDependencies/patternMixin.js';
|
|
318
307
|
import { FormStepMixin } from '../templatesDependencies/formStepMixin.js';
|
|
319
308
|
import { FormLengthMixin } from '../templatesDependencies/formLengthMixin.js';
|
|
@@ -388,24 +377,20 @@ export const formTemplates = {
|
|
|
388
377
|
template: (_value, attributes) => html(_templateObject25(), ifDefined(attributes.name)),
|
|
389
378
|
dependencies: [ValueRichtextMixin, FormMixin]
|
|
390
379
|
},
|
|
391
|
-
editor: {
|
|
392
|
-
template: (_value, attributes) => html(_templateObject26(), attributes.id, ifDefined(attributes.name)),
|
|
393
|
-
dependencies: [ValueEditorMixin, FormMixin]
|
|
394
|
-
},
|
|
395
380
|
color: {
|
|
396
|
-
template: (_value, attributes) => html(
|
|
381
|
+
template: (_value, attributes) => html(_templateObject26(), ifDefined(attributes.placeholder), ifDefined(attributes.id), ifDefined(attributes.name), attributes.required, ifDefined(attributes.originalValue), attributes.onChange),
|
|
397
382
|
dependencies: [FormMixin]
|
|
398
383
|
},
|
|
399
384
|
email: {
|
|
400
|
-
template: (value, attributes) => html(
|
|
385
|
+
template: (value, attributes) => html(_templateObject27(), ifDefined(attributes.placeholder), ifDefined(attributes.id), ifDefined(attributes.name), value || '', attributes.required, ifDefined(attributes.maxlength), ifDefined(attributes.minlength), attributes.onChange),
|
|
401
386
|
dependencies: [FormMixin, FormLengthMixin]
|
|
402
387
|
},
|
|
403
388
|
password: {
|
|
404
|
-
template: (value, attributes) => html(
|
|
389
|
+
template: (value, attributes) => html(_templateObject28(), ifDefined(attributes.placeholder), ifDefined(attributes.id), ifDefined(attributes.name), value || '', attributes.required, ifDefined(attributes.pattern), ifDefined(attributes.title), ifDefined(attributes.maxlength), ifDefined(attributes.minlength), attributes.onChange),
|
|
405
390
|
dependencies: [FormMixin, PatternMixin, FormLengthMixin]
|
|
406
391
|
},
|
|
407
392
|
time: {
|
|
408
|
-
template: (value, attributes) => html(
|
|
393
|
+
template: (value, attributes) => html(_templateObject29(), ifDefined(attributes.placeholder), ifDefined(attributes.name), ifDefined(attributes.id), value || '', ifDefined(attributes.min), ifDefined(attributes.max), ifDefined(attributes.step), attributes.required, attributes.onChange),
|
|
409
394
|
dependencies: [FormMixin, FormMinMaxMixin, FormStepMixin]
|
|
410
395
|
}
|
|
411
396
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["formTemplatesDirectory.ts"],"names":["FormMixin","FormCheckboxMixin","FormMinMaxMixin","FormNumberMixin","FormDropdownMixin","FormCheckboxesMixin","FormRadioMixin","FormFileMixin","MultipleFormMixin","MultipleselectFormMixin","RangeMixin","FilterRangeFormMixin","ValueRichtextMixin","ValueEditorMixin","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","editor","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,QAAkC,4CAAlC;AACA,SAASC,uBAAT,QAAwC,kDAAxC;AACA,SAASC,UAAT,QAA2B,qCAA3B;AACA,SAASC,oBAAT,QAAqC,+CAArC;AACA,SAASC,kBAAT,QAAmC,6CAAnC;AACA,SAASC,gBAAT,QAAiC,2CAAjC;AACA,SAASC,YAAT,QAA6B,uCAA7B;AACA,SAASC,aAAT,QAA8B,wCAA9B;AAC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,EAUMxB,UAAU,CAACM,QAVjB,EAYIN,UAAU,CAACU,QAZf,CADN;AAgBJC,IAAAA,YAAY,EAAE,CAAElC,SAAF,EAAaE,eAAb,EAA8Ba,aAA9B;AAhBV;AA9YqB,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 { ValueEditorMixin } from '../templatesDependencies/valueEditorMixin';\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 editor: {\n template: (_value: string, attributes: any) => html`\n <textarea\n id=${attributes.id}\n data-editor\n name=${ifDefined(attributes.name)}\n data-holder\n ></textarea>\n `,\n dependencies: [ ValueEditorMixin, 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","removeItem","removeLabel","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,QAAkC,4CAAlC;AACA,SAASC,uBAAT,QAAwC,kDAAxC;AACA,SAASC,UAAT,QAA2B,qCAA3B;AACA,SAASC,oBAAT,QAAqC,+CAArC;AACA,SAASC,kBAAT,QAAmC,6CAAnC;AACA,SAASC,YAAT,QAA6B,uCAA7B;AACA,SAASC,aAAT,QAA8B,wCAA9B;AACA,SAASC,eAAT,QAAgC,0CAAhC;AAEA,SAASC,IAAT,QAAqB,UAArB;AACA,SAASC,SAAT,QAA0B,gCAA1B;AAEA,OAAO,MAAMC,aAAa,GAAG;AAC3BC,EA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AACK,UAAU,CAACC,WAAZ,CAHjB,EAIDN,SAAS,CAACK,UAAU,CAACG,EAAZ,CAJR,EAKCR,SAAS,CAACK,UAAU,CAACE,IAAZ,CALV,EAMEH,KAAK,IAAI,EANX,EAOMC,UAAU,CAACM,QAPjB,EAQIX,SAAS,CAACK,UAAU,CAACI,OAAZ,CARb,EASET,SAAS,CAACK,UAAU,CAACK,KAAZ,CATX,EAWMV,SAAS,CAACK,UAAU,CAACQ,SAAZ,CAXf,EAYMb,SAAS,CAACK,UAAU,CAACS,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"]}
|
|
@@ -19,12 +19,36 @@ const FormFileMixin = {
|
|
|
19
19
|
},
|
|
20
20
|
|
|
21
21
|
attached() {
|
|
22
|
-
document.addEventListener('
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
document.addEventListener('click', async e => {
|
|
23
|
+
const solidForm = this.element.parentNode.parentNode; //solid-form with solid-form-file/image
|
|
24
|
+
|
|
25
|
+
const formValue = await solidForm.component.getFormValue(); //to get modificated values
|
|
26
|
+
//if reset button clicked
|
|
27
|
+
|
|
28
|
+
if (e.target.getAttribute('type') === 'reset' && solidForm.contains(e.target)) {
|
|
29
|
+
//if edition form and value or if creation form
|
|
30
|
+
if (!solidForm.component.isCreationForm(formValue) && this.initialValue !== '' || solidForm.component.isCreationForm(formValue)) this.value = this.initialValue; //if edition form and no value
|
|
31
|
+
else if (!solidForm.component.isCreationForm(formValue) && this.initialValue === '') this.value = this.initialValue = '';
|
|
32
|
+
this.listAttributes['resetButtonHidden'] = true;
|
|
33
|
+
this.planRender();
|
|
34
|
+
} // if submit button clicked
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
if (e.target.getAttribute('type') === 'submit' && solidForm.contains(e.target)) {
|
|
38
|
+
if (solidForm.getAttribute('next') || solidForm.component.isCreationForm(formValue)) {
|
|
39
|
+
this.value = this.initialValue;
|
|
40
|
+
this.initialValue = '';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (!solidForm.component.isCreationForm(formValue)) {
|
|
44
|
+
this.initialValue = this.value;
|
|
45
|
+
}
|
|
46
|
+
|
|
25
47
|
this.listAttributes['resetButtonHidden'] = true;
|
|
26
48
|
this.planRender();
|
|
27
49
|
}
|
|
50
|
+
|
|
51
|
+
;
|
|
28
52
|
});
|
|
29
53
|
},
|
|
30
54
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["formFileMixin.ts"],"names":["store","FormFileMixin","name","attributes","uploadUrl","type","String","default","initialState","initialValue","created","listAttributes","selectFile","bind","resetFile","attached","document","addEventListener","e","target","contains","
|
|
1
|
+
{"version":3,"sources":["formFileMixin.ts"],"names":["store","FormFileMixin","name","attributes","uploadUrl","type","String","default","initialState","initialValue","created","listAttributes","selectFile","bind","resetFile","attached","document","addEventListener","e","solidForm","element","parentNode","formValue","component","getFormValue","target","getAttribute","contains","isCreationForm","value","planRender","filePicker","querySelector","files","length","file","formData","FormData","append","fetchAuthn","method","body","then","response","location","headers","get","catch","error","console","event","preventDefault"],"mappings":"AAAA,SAASA,KAAT,QAAsB,wBAAtB;AAEA,MAAMC,aAAa,GAAG;AACpBC,EAAAA,IAAI,EAAE,iBADc;AAEpBC,EAAAA,UAAU,EAAE;AACVC,IAAAA,SAAS,EAAE;AACTC,MAAAA,IAAI,EAAEC,MADG;AAETC,MAAAA,OAAO,EAAE;AAFA;AADD,GAFQ;AAQpBC,EAAAA,YAAY,EAAE;AACZC,IAAAA,YAAY,EAAE;AADF,GARM;;AAWpBC,EAAAA,OAAO,GAAG;AACR,SAAKC,cAAL,CAAoB,QAApB,IAAgC,EAAhC;AACA,SAAKA,cAAL,CAAoB,mBAApB,IAA2C,IAA3C;AACA,SAAKA,cAAL,CAAoB,YAApB,IAAoC,KAAKC,UAAL,CAAgBC,IAAhB,CAAqB,IAArB,CAApC;AACA,SAAKF,cAAL,CAAoB,WAApB,IAAmC,KAAKG,SAAL,CAAeD,IAAf,CAAoB,IAApB,CA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,aAAKjC,cAAL,CAAoB,QAApB,IAAgC,EAAhC;AACA,aAAKA,cAAL,CAAoB,mBAApB,IAA2C,KAA3C;AACA,aAAKmB,UAAL;AACD;AACF,KAdH,EAeGiB,KAfH,CAeSC,KAAK,IAAI;AACd,WAAKrC,cAAL,CAAoB,WAApB,IAAmC,EAAnC;AACA,WAAKA,cAAL,CAAoB,QAApB,IAAgC,cAAhC;AACA,WAAKmB,UAAL;AACAmB,MAAAA,OAAO,CAACD,KAAR,CAAcA,KAAd;AACD,KApBH;AAqBD,GAlFmB;;AAmFpBlC,EAAAA,SAAS,CAACoC,KAAD,EAAQ;AACfA,IAAAA,KAAK,CAACC,cAAN;AACA,SAAKtB,KAAL,GAAa,EAAb;AACA,UAAME,UAAU,GAAG,KAAKX,OAAL,CAAaY,aAAb,CAA2B,oBAA3B,CAAnB;AACA,QAAID,UAAJ,EAAgBA,UAAU,CAACF,KAAX,GAAmB,EAAnB;AAChB,SAAKlB,cAAL,CAAoB,WAApB,IAAmC,EAAnC;AACA,SAAKA,cAAL,CAAoB,QAApB,IAAgC,EAAhC;AACA,SAAKA,cAAL,CAAoB,mBAApB,IAA2C,IAA3C,CAPe,CAQf;;AACA,SAAKmB,UAAL;AACD;;AA7FmB,CAAtB;AAgGA,SACE7B,aADF","sourcesContent":["import { store } from \"../../libs/store/store\";\n\nconst FormFileMixin = {\n name: 'form-file-mixin',\n attributes: {\n uploadUrl: {\n type: String,\n default: ''\n },\n },\n initialState: {\n initialValue: ''\n },\n created() {\n this.listAttributes['output'] = '';\n this.listAttributes['resetButtonHidden'] = true;\n this.listAttributes['selectFile'] = this.selectFile.bind(this);\n this.listAttributes['resetFile'] = this.resetFile.bind(this);\n },\n attached() {\n document.addEventListener('click', async (e) => {\n const solidForm = this.element.parentNode.parentNode; //solid-form with solid-form-file/image\n const formValue = await solidForm.component.getFormValue(); //to get modificated values\n\n //if reset button clicked\n if ((e.target as HTMLElement).getAttribute('type') === 'reset' && solidForm.contains(e.target)) {\n //if edition form and value or if creation form\n if ((!solidForm.component.isCreationForm(formValue) && this.initialValue !== '') || solidForm.component.isCreationForm(formValue)) this.value = this.initialValue;\n //if edition form and no value\n else if (!solidForm.component.isCreationForm(formValue) && (this.initialValue === '')) this.value = this.initialValue = '';\n this.listAttributes['resetButtonHidden'] = true;\n this.planRender();\n }\n // if submit button clicked\n if ((e.target as HTMLElement).getAttribute('type') === 'submit' && solidForm.contains(e.target)) {\n if (solidForm.getAttribute('next') || solidForm.component.isCreationForm(formValue)) {\n this.value = this.initialValue;\n this.initialValue = '';\n }\n if (!solidForm.component.isCreationForm(formValue)) {\n this.initialValue = this.value;\n }\n this.listAttributes['resetButtonHidden'] = true;\n this.planRender();\n };\n })\n },\n selectFile() {\n if (this.uploadUrl === null) return;\n\n if (this.initialValue === '') {\n this.initialValue = this.value;\n }\n\n const filePicker = this.element.querySelector('input[type=\"file\"]');\n if (filePicker.files!.length < 1) return;\n\n this.listAttributes['output'] = '⏳';\n this.planRender();\n\n const file = filePicker.files![0];\n const formData = new FormData();\n formData.append('file', file);\n store.fetchAuthn(this.uploadUrl, {\n method: 'POST',\n body: formData,\n })\n .then(response => {\n const location = response.headers.get('location');\n if (location == null) {\n this.listAttributes['output'] = 'header location not found!';\n } else {\n this.value = location;\n this.listAttributes['output'] = '';\n this.listAttributes['resetButtonHidden'] = false;\n this.planRender();\n }\n })\n .catch(error => {\n this.listAttributes['fileValue'] = '';\n this.listAttributes['output'] = 'upload error';\n this.planRender();\n console.error(error);\n });\n },\n resetFile(event) {\n event.preventDefault();\n this.value = '';\n const filePicker = this.element.querySelector('input[type=\"file\"]');\n if (filePicker) filePicker.value = '';\n this.listAttributes['fileValue'] = '';\n this.listAttributes['output'] = '';\n this.listAttributes['resetButtonHidden'] = true;\n // this.input.dispatchEvent(new Event('change'));\n this.planRender();\n }\n}\n\nexport {\n FormFileMixin\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startinblox/core",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.28",
|
|
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",
|
|
@@ -108,8 +108,6 @@
|
|
|
108
108
|
"wait-on": "^5.2.1"
|
|
109
109
|
},
|
|
110
110
|
"dependencies": {
|
|
111
|
-
"cors": "^2.8.5"
|
|
112
|
-
"showdown": "^2.1.0",
|
|
113
|
-
"tinymce": "^6.0.2"
|
|
111
|
+
"cors": "^2.8.5"
|
|
114
112
|
}
|
|
115
113
|
}
|