@startinblox/core 0.17.21-beta.9 → 0.17.24
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/components/solid-ac-checker.js +10 -3
- package/dist/components/solid-ac-checker.js.map +1 -1
- package/dist/components/solid-display.js +1 -1
- package/dist/components/solid-display.js.map +1 -1
- package/dist/components/solid-form-search.js.map +1 -1
- package/dist/components/solid-map.js +2 -2
- package/dist/components/solid-map.js.map +1 -1
- package/dist/libs/interfaces.js.map +1 -1
- package/dist/libs/store/store.js +12 -73
- package/dist/libs/store/store.js.map +1 -1
- package/dist/mixins/filterMixin.js +61 -2
- package/dist/mixins/filterMixin.js.map +1 -1
- package/dist/mixins/widgetMixin.js +2 -2
- package/dist/mixins/widgetMixin.js.map +1 -1
- package/dist/new-widgets/templates/defaultTemplatesDirectory.js +3 -4
- package/dist/new-widgets/templates/defaultTemplatesDirectory.js.map +1 -1
- package/dist/new-widgets/templates/displayTemplatesDirectory.js +3 -4
- package/dist/new-widgets/templates/displayTemplatesDirectory.js.map +1 -1
- package/dist/new-widgets/templates/formTemplatesDirectory.js +3 -3
- package/dist/new-widgets/templates/formTemplatesDirectory.js.map +1 -1
- package/dist/new-widgets/templatesDependencies/multipleFormMixin.js +0 -18
- package/dist/new-widgets/templatesDependencies/multipleFormMixin.js.map +1 -1
- package/package.json +4 -4
- package/dist/libs/filter.js +0 -214
- package/dist/libs/filter.js.map +0 -1
- package/dist/new-widgets/templatesDependencies/linkTextMixin.js +0 -14
- package/dist/new-widgets/templatesDependencies/linkTextMixin.js.map +0 -1
|
@@ -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
|
|
32
|
+
const data = _taggedTemplateLiteral(["\n <a\n name=", "\n href=", "\n target=", "\n ?data-editable=", "\n >\n ", "\n </a>\n "]);
|
|
33
33
|
|
|
34
34
|
_templateObject3 = function () {
|
|
35
35
|
return data;
|
|
@@ -62,7 +62,6 @@ 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';
|
|
66
65
|
import { html } from '../../_snowpack/pkg/lit-html.js';
|
|
67
66
|
import { ifDefined } from '../../_snowpack/pkg/lit-html/directives/if-defined.js';
|
|
68
67
|
export const displayTemplates = {
|
|
@@ -75,8 +74,8 @@ export const displayTemplates = {
|
|
|
75
74
|
dependencies: [EditableMixin]
|
|
76
75
|
},
|
|
77
76
|
link: {
|
|
78
|
-
template: (value, attributes) => html(_templateObject3(), ifDefined(attributes.name), (attributes.mailto || attributes.tel || '') + (value || '#'), ifDefined(attributes.target), attributes.editable,
|
|
79
|
-
dependencies: [EditableMixin
|
|
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]
|
|
80
79
|
},
|
|
81
80
|
img: {
|
|
82
81
|
template: (value, attributes) => html(_templateObject4(), ifDefined(attributes.name), ifDefined(value), ifDefined(attributes.alt)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["displayTemplatesDirectory.ts"],"names":["EditableMixin","AltMixin","
|
|
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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wC9BkB,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"]}
|
|
@@ -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\"
|
|
82
|
+
const data = _taggedTemplateLiteral(["\n <div data-index=", ">\n ", "\n <button type=\"button\" @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\"
|
|
92
|
+
const data = _taggedTemplateLiteral(["\n ", "\n <button type=\"button\" @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,
|
|
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),
|
|
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","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,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,EAAAA,IAAI,EAAE;AACJC,IAAAA,QAAQ,EAAE,CAACC,KAAD,EAAgBC,UAAhB,KAAoCN,IAApC,oBAGQC,SAAS,CAACK,UAAU,CAACC,WAAZ,CA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,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;AAmY3ByE,EAAAA,IAAI,EAAE;AACJpE,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\" 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"]}
|
|
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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gBC,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"]}
|
|
@@ -26,22 +26,6 @@ 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
|
-
}
|
|
45
29
|
}
|
|
46
30
|
},
|
|
47
31
|
|
|
@@ -50,8 +34,6 @@ const MultipleFormMixin = {
|
|
|
50
34
|
this.listAttributes['children'] = [];
|
|
51
35
|
this.listAttributes['addLabel'] = this.addLabel;
|
|
52
36
|
this.listAttributes['removeLabel'] = this.removeLabel;
|
|
53
|
-
this.listAttributes['addClass'] = this.addClass;
|
|
54
|
-
this.listAttributes['removeClass'] = this.removeClass;
|
|
55
37
|
|
|
56
38
|
this.listAttributes['addItem'] = () => {
|
|
57
39
|
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","
|
|
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;AAGxB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ACxC,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}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startinblox/core",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.24",
|
|
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.
|
|
85
|
+
"cypress": "^6.6.0",
|
|
86
86
|
"cypress-plugin-tab": "^1.0.5",
|
|
87
87
|
"delta-markdown-for-quill": "0.0.9",
|
|
88
88
|
"dialog-polyfill": "^0.5.6",
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"find-free-port": "^2.0.0",
|
|
92
92
|
"fuse.js": "^6.4.6",
|
|
93
93
|
"jsonld-context-parser": "^1.3.4",
|
|
94
|
-
"leaflet": "
|
|
95
|
-
"leaflet.markercluster": "
|
|
94
|
+
"leaflet": "1.7.1",
|
|
95
|
+
"leaflet.markercluster": "1.4.1",
|
|
96
96
|
"lit-html": "^1.3.0",
|
|
97
97
|
"markdown-it": "^12.0.4",
|
|
98
98
|
"pubsub-js": "^1.9.2",
|
package/dist/libs/filter.js
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import { parseFieldsString, findClosingBracketMatchIndex, compare, uniqID } from "./helpers.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Check if the field is a set
|
|
5
|
-
* @param field - field to test
|
|
6
|
-
* @param fields - list of fields
|
|
7
|
-
* @returns true if the field is a set, false otherwise
|
|
8
|
-
*/
|
|
9
|
-
const isSet = (field, fields) => {
|
|
10
|
-
if (!fields) return false;
|
|
11
|
-
let foundSets = fields.match(getSetRegexp(field));
|
|
12
|
-
return foundSets ? foundSets.length > 0 : false;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Get the list of fields in the set
|
|
16
|
-
* @param field - set name to get
|
|
17
|
-
* @param fields - list of fields
|
|
18
|
-
* @returns a list of fields in the set
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const getSet = (field, fields) => {
|
|
23
|
-
const setString = fields.match(getSetRegexp(field));
|
|
24
|
-
if (!setString) return [];
|
|
25
|
-
const firstSetBracket = fields.indexOf(setString[0]) + setString[0].length - 1;
|
|
26
|
-
const lastSetBracket = findClosingBracketMatchIndex(fields, firstSetBracket);
|
|
27
|
-
const set = fields.substring(firstSetBracket + 1, lastSetBracket);
|
|
28
|
-
return parseFieldsString(set);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const getSetRegexp = field => {
|
|
32
|
-
return new RegExp("(^|\\,|\\(|\\s)\\s*".concat(field, "\\s*\\("), 'g');
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Check if the field is a special search field
|
|
36
|
-
* @param field - field to test
|
|
37
|
-
* @param searchForm - current search form
|
|
38
|
-
* @returns true if the field is a special search field
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const isSearchField = (field, searchForm) => {
|
|
43
|
-
return searchForm.hasAttribute('search-' + field);
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Get the fields targetted by a search field
|
|
47
|
-
* @param field - search field to get
|
|
48
|
-
* @param searchForm - current search form
|
|
49
|
-
* @returns a list of fields targetted by the current search field
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const getSearchField = (field, searchForm) => {
|
|
54
|
-
return parseFieldsString(searchForm.getAttribute('search-' + field));
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Throw or simply return value
|
|
58
|
-
* @param throwOn - should throw on True or False
|
|
59
|
-
* @param ret - value to return
|
|
60
|
-
* @returns
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const orThrow = (throwOn, ret) => {
|
|
65
|
-
if (throwOn === true && ret) throw true;
|
|
66
|
-
if (throwOn === false && !ret) throw false;
|
|
67
|
-
return ret;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Compare a value to the query
|
|
71
|
-
* @param val - value to compare
|
|
72
|
-
* @param query - object to know how and what value to compare
|
|
73
|
-
* @param throwOn - should function throw error on True or False
|
|
74
|
-
* @returns true if value matches, throw error otherwise
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const matchValue = async (val, query, throwOn) => {
|
|
79
|
-
var _subject$isContainer;
|
|
80
|
-
|
|
81
|
-
const subject = await val;
|
|
82
|
-
if (subject == null && query.value === '') return orThrow(throwOn, true); // filter not set and subject not existing -> ignore filter
|
|
83
|
-
|
|
84
|
-
if (subject == null) return orThrow(throwOn, false); // return false; // property does not exist on resource
|
|
85
|
-
|
|
86
|
-
if (query.list) {
|
|
87
|
-
// Filter on a container
|
|
88
|
-
if (query.value.length === 0) return orThrow(throwOn, true);
|
|
89
|
-
|
|
90
|
-
for (const v of query.value) {
|
|
91
|
-
if (await matchValue(subject, {
|
|
92
|
-
type: query.type,
|
|
93
|
-
value: v,
|
|
94
|
-
list: false
|
|
95
|
-
})) {
|
|
96
|
-
// do not throw here, we need the result
|
|
97
|
-
return orThrow(throwOn, true);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return orThrow(throwOn, false);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if ((_subject$isContainer = subject.isContainer) !== null && _subject$isContainer !== void 0 && _subject$isContainer.call(subject)) {
|
|
105
|
-
let ret = Promise.resolve(query.value === ''); // if no query, return a match
|
|
106
|
-
|
|
107
|
-
for (const value of subject['ldp:contains']) {
|
|
108
|
-
ret = (await ret) || (await matchValue(value, query)); // do not throw here, we need the result
|
|
109
|
-
|
|
110
|
-
if (ret) return orThrow(throwOn, true);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return orThrow(throwOn, await ret);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return orThrow(throwOn, compare[query.type](subject, query.value));
|
|
117
|
-
};
|
|
118
|
-
/**
|
|
119
|
-
* Cache properties of a filter to avoid repeated parsing
|
|
120
|
-
* @param cacheKey - uniq key
|
|
121
|
-
* @param filter - filter to check
|
|
122
|
-
* @param fields - fields attribute of the element
|
|
123
|
-
* @param searchForm - current search form
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
const cacheFieldsProps = (cacheKey, filter, fields, searchForm) => {
|
|
128
|
-
if (!window.cachePropsSearchFilter[cacheKey]) {
|
|
129
|
-
window.cachePropsSearchFilter[cacheKey] = {
|
|
130
|
-
setFields: isSet(filter, fields) ? getSet(filter, fields) : null,
|
|
131
|
-
setSearchFields: isSearchField(filter, searchForm) ? getSearchField(filter, searchForm) : null
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* Check if one resource match one filter
|
|
137
|
-
* @param resource - resource to test
|
|
138
|
-
* @param filter - name of the property tested
|
|
139
|
-
* @param query - query object to know how to compare values
|
|
140
|
-
* @param fields - fields attribute of the element
|
|
141
|
-
* @param searchForm - searchForm component
|
|
142
|
-
* @param filterId - uniqId used to fill the cache
|
|
143
|
-
* @param throwOn - should function throw error on True or False
|
|
144
|
-
* @returns return true if the resource matches the filter, throw error otherwise
|
|
145
|
-
*/
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const matchFilter = async (resource, filter, query, fieldsAttr, searchForm, filterId, throwOn) => {
|
|
149
|
-
let fields = null;
|
|
150
|
-
const cacheKey = "".concat(filter, "_").concat(filterId);
|
|
151
|
-
cacheFieldsProps(cacheKey, filter, fieldsAttr, searchForm);
|
|
152
|
-
|
|
153
|
-
if (window.cachePropsSearchFilter[cacheKey].setFields !== null) {
|
|
154
|
-
fields = window.cachePropsSearchFilter[cacheKey].setFields;
|
|
155
|
-
} else if (window.cachePropsSearchFilter[cacheKey].setSearchFields !== null) {
|
|
156
|
-
fields = window.cachePropsSearchFilter[cacheKey].setSearchFields;
|
|
157
|
-
} else {
|
|
158
|
-
// search on 1 field
|
|
159
|
-
return matchValue(resource[filter], query, throwOn);
|
|
160
|
-
} // search on multiple fields
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
try {
|
|
164
|
-
await Promise.all((fields || []).map(field => matchFilter(resource, field, query, fieldsAttr, searchForm, filterId, true // stop searching when 1 filter is true (= OR)
|
|
165
|
-
)));
|
|
166
|
-
} catch (e) {
|
|
167
|
-
return true;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
throw false;
|
|
171
|
-
};
|
|
172
|
-
/**
|
|
173
|
-
* Check if one resource match all the filters
|
|
174
|
-
* @param resource - resource to test
|
|
175
|
-
* @param filters - current filters
|
|
176
|
-
* @param filterNames - names of the filters
|
|
177
|
-
* @param fields - fields attribute of the element
|
|
178
|
-
* @param searchForm - searchForm component
|
|
179
|
-
* @param filterId - uniqId used to fill the cache
|
|
180
|
-
* @returns true if resource match, false otherwise
|
|
181
|
-
*/
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const matchFilters = async (resource, filters, filterNames, fields, searchForm, filterId) => {
|
|
185
|
-
// return true if all filters values are contained in the corresponding field of the resource
|
|
186
|
-
try {
|
|
187
|
-
await Promise.all(filterNames.map(filter => matchFilter(resource, filter, filters[filter], fields, searchForm, filterId, false // stop searching when 1 filter is false (= AND)
|
|
188
|
-
)));
|
|
189
|
-
} catch (e) {
|
|
190
|
-
return false;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return true;
|
|
194
|
-
};
|
|
195
|
-
/**
|
|
196
|
-
* Check which resources match the filters
|
|
197
|
-
* @param resources - list of resources to filter
|
|
198
|
-
* @param filters - current filters
|
|
199
|
-
* @param fields - fields attribute of the element
|
|
200
|
-
* @param searchForm - searchForm component
|
|
201
|
-
* @returns resources filtered
|
|
202
|
-
*/
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const searchInResources = async (resources, filters, fields, searchForm) => {
|
|
206
|
-
// Optim: use cache to do these things only once
|
|
207
|
-
const filterNames = Object.keys(filters);
|
|
208
|
-
const filterId = uniqID();
|
|
209
|
-
window.cachePropsSearchFilter = {};
|
|
210
|
-
return Promise.all(resources.map(resource => matchFilters(resource, filters, filterNames, fields, searchForm, filterId)));
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
export { searchInResources };
|
|
214
|
-
//# sourceMappingURL=filter.js.map
|
package/dist/libs/filter.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["filter.ts"],"names":["parseFieldsString","findClosingBracketMatchIndex","compare","uniqID","isSet","field","fields","foundSets","match","getSetRegexp","length","getSet","setString","firstSetBracket","indexOf","lastSetBracket","set","substring","RegExp","isSearchField","searchForm","hasAttribute","getSearchField","getAttribute","orThrow","throwOn","ret","matchValue","val","query","subject","value","list","v","type","isContainer","Promise","resolve","cacheFieldsProps","cacheKey","filter","window","cachePropsSearchFilter","setFields","setSearchFields","matchFilter","resource","fieldsAttr","filterId","all","map","e","matchFilters","filters","filterNames","searchInResources","resources","Object","keys"],"mappings":"AAAA,SAASA,iBAAT,EAA4BC,4BAA5B,EAA0DC,OAA1D,EAAmEC,MAAnE,QAAiF,WAAjF;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,KAAK,GAAG,CAACC,KAAD,EAAgBC,MAAhB,KAA4C;AACxD,MAAI,CAACA,MAAL,EAAa,OAAO,KAAP;AACb,MAAIC,SAAS,GAAGD,MAAM,CAACE,KAAP,CAAaC,YAAY,CAACJ,KAAD,CAAzB,CAAhB;AACA,SAAOE,SAAS,GAAGA,SAAS,CAACG,MAAV,GAAmB,CAAtB,GAA0B,KAA1C;AACD,CAJD;AAKA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,MAAM,GAAG,CAACN,KAAD,EAAgBC,MAAhB,KAA6C;AAC1D,QAAMM,SAAS,GAAGN,MAAM,CAACE,KAAP,CAAaC,YAAY,CAACJ,KAAD,CAAzB,CAAlB;AACA,MAAI,CAACO,SAAL,EAAgB,OAAO,EAAP;AAChB,QAAMC,eAAe,GAAGP,MAAM,CAACQ,OAAP,CAAeF,SAAS,CAAC,CAAD,CAAxB,IAAgCA,SAAS,CAAC,CAAD,CAAT,CAAaF,MAA7C,GAAuD,CAA/E;AACA,QAAMK,cAAc,G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AAQ,GAAG7C,MAAM,EAAvB;AACAsC,EAAAA,MAAM,CAACC,sBAAP,GAAgC,EAAhC;AAEA,SAAON,OAAO,CAACa,GAAR,CAAYO,SAAS,CAACN,GAAV,CAAcJ,QAAQ,IACvCM,YAAY,CACVN,QADU,EAEVO,OAFU,EAGVC,WAHU,EAIVhD,MAJU,EAKVc,UALU,EAMV4B,QANU,CADK,CAAZ,CAAP;AAUD,CArBD;;AAuBA,SACEO,iBADF","sourcesContent":["import { parseFieldsString, findClosingBracketMatchIndex, compare, uniqID } from \"./helpers\";\nimport type { Query, SearchQuery } from \"./interfaces\";\n\n/**\n * Check if the field is a set\n * @param field - field to test\n * @param fields - list of fields\n * @returns true if the field is a set, false otherwise\n */\nconst isSet = (field: string, fields: string): boolean => {\n if (!fields) return false;\n let foundSets = fields.match(getSetRegexp(field));\n return foundSets ? foundSets.length > 0 : false;\n}\n/**\n * Get the list of fields in the set\n * @param field - set name to get\n * @param fields - list of fields\n * @returns a list of fields in the set\n */\nconst getSet = (field: string, fields: string): string[] => {\n const setString = fields.match(getSetRegexp(field));\n if (!setString) return [];\n const firstSetBracket = fields.indexOf(setString[0]) + (setString[0].length) - 1;\n const lastSetBracket = findClosingBracketMatchIndex(fields, firstSetBracket);\n const set = fields.substring(firstSetBracket + 1, lastSetBracket);\n return parseFieldsString(set);\n}\nconst getSetRegexp = (field: string) => {\n return new RegExp(`(^|\\\\,|\\\\(|\\\\s)\\\\s*${field}\\\\s*\\\\(`, 'g')\n}\n/**\n * Check if the field is a special search field\n * @param field - field to test\n * @param searchForm - current search form\n * @returns true if the field is a special search field\n */\nconst isSearchField = (field: string, searchForm: any) => {\n return searchForm.hasAttribute('search-' + field);\n}\n/**\n * Get the fields targetted by a search field\n * @param field - search field to get\n * @param searchForm - current search form\n * @returns a list of fields targetted by the current search field\n */\nconst getSearchField = (field: string, searchForm: any): string[] => {\n return parseFieldsString(searchForm.getAttribute('search-' + field));\n}\n\n/**\n * Throw or simply return value\n * @param throwOn - should throw on True or False\n * @param ret - value to return\n * @returns\n */\nconst orThrow = (throwOn: boolean | undefined, ret: boolean) => {\n if (throwOn === true && ret) throw true;\n if (throwOn === false && !ret) throw false;\n return ret;\n}\n\n/**\n * Compare a value to the query\n * @param val - value to compare\n * @param query - object to know how and what value to compare\n * @param throwOn - should function throw error on True or False\n * @returns true if value matches, throw error otherwise\n */\nconst matchValue = async (val: any, query: Query, throwOn?: boolean): Promise<boolean> => {\n const subject = await val;\n if (subject == null && query.value === '') return orThrow(throwOn, true); // filter not set and subject not existing -> ignore filter\n if (subject == null) return orThrow(throwOn, false); // return false; // property does not exist on resource\n if (query.list) { // Filter on a container\n if(query.value.length === 0) return orThrow(throwOn, true);\n for(const v of query.value) {\n if (await matchValue(subject, { type: query.type, value: v, list: false })) { // do not throw here, we need the result\n return orThrow(throwOn, true);\n }\n }\n return orThrow(throwOn, false);\n }\n if (subject.isContainer?.()) {\n let ret: any = Promise.resolve(query.value === ''); // if no query, return a match\n for (const value of subject['ldp:contains']) {\n ret = await ret || await matchValue(value, query); // do not throw here, we need the result\n if (ret) return orThrow(throwOn, true);\n }\n return orThrow(throwOn, await ret);\n }\n\n return orThrow(throwOn, compare[query.type](subject, query.value));\n}\n\n/**\n * Cache properties of a filter to avoid repeated parsing\n * @param cacheKey - uniq key\n * @param filter - filter to check\n * @param fields - fields attribute of the element\n * @param searchForm - current search form\n */\nconst cacheFieldsProps = (\n cacheKey: string,\n filter: string,\n fields: string,\n searchForm: any\n) => {\n if (!window.cachePropsSearchFilter[cacheKey]) {\n window.cachePropsSearchFilter[cacheKey] = {\n setFields: isSet(filter, fields) ? getSet(filter, fields) : null,\n setSearchFields: isSearchField(filter, searchForm) ? getSearchField(filter, searchForm) : null\n }\n }\n}\n\n/**\n * Check if one resource match one filter\n * @param resource - resource to test\n * @param filter - name of the property tested\n * @param query - query object to know how to compare values\n * @param fields - fields attribute of the element\n * @param searchForm - searchForm component\n * @param filterId - uniqId used to fill the cache\n * @param throwOn - should function throw error on True or False\n * @returns return true if the resource matches the filter, throw error otherwise\n */\nconst matchFilter = async (\n resource: object,\n filter: string,\n query: Query,\n fieldsAttr: string,\n searchForm: any,\n filterId: string,\n throwOn: boolean\n) => {\n let fields: string[] | null = null;\n\n const cacheKey = `${filter}_${filterId}`;\n cacheFieldsProps(cacheKey, filter, fieldsAttr, searchForm);\n\n if (window.cachePropsSearchFilter[cacheKey].setFields !== null) {\n fields = window.cachePropsSearchFilter[cacheKey].setFields;\n } else if (window.cachePropsSearchFilter[cacheKey].setSearchFields !== null) {\n fields = window.cachePropsSearchFilter[cacheKey].setSearchFields;\n } else { // search on 1 field\n return matchValue(resource[filter], query, throwOn);\n }\n\n // search on multiple fields\n try {\n await Promise.all((fields || []).map(field =>\n matchFilter(\n resource,\n field,\n query,\n fieldsAttr,\n searchForm,\n filterId,\n true // stop searching when 1 filter is true (= OR)\n )\n ))\n } catch (e) { return true }\n throw false;\n}\n\n/**\n * Check if one resource match all the filters\n * @param resource - resource to test\n * @param filters - current filters\n * @param filterNames - names of the filters\n * @param fields - fields attribute of the element\n * @param searchForm - searchForm component\n * @param filterId - uniqId used to fill the cache\n * @returns true if resource match, false otherwise\n */\nconst matchFilters = async (\n resource: object,\n filters: SearchQuery,\n filterNames: string[],\n fields: string,\n searchForm: any,\n filterId: string\n): Promise<boolean> => {\n // return true if all filters values are contained in the corresponding field of the resource\n try {\n await Promise.all(filterNames.map(filter =>\n matchFilter(\n resource,\n filter,\n filters[filter],\n fields,\n searchForm,\n filterId,\n false // stop searching when 1 filter is false (= AND)\n )\n ));\n } catch (e) { return false }\n return true;\n}\n\n/**\n * Check which resources match the filters\n * @param resources - list of resources to filter\n * @param filters - current filters\n * @param fields - fields attribute of the element\n * @param searchForm - searchForm component\n * @returns resources filtered\n */\nconst searchInResources = async (\n resources: object[],\n filters: SearchQuery,\n fields: string,\n searchForm: any\n) => {\n // Optim: use cache to do these things only once\n const filterNames = Object.keys(filters);\n const filterId = uniqID();\n window.cachePropsSearchFilter = {};\n\n return Promise.all(resources.map(resource =>\n matchFilters(\n resource,\n filters,\n filterNames,\n fields,\n searchForm,\n filterId\n )\n ));\n}\n\nexport {\n searchInResources\n};\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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}"]}
|