From bb7f010f606d2c5104c96c6777e570923cf220e4 Mon Sep 17 00:00:00 2001 From: wildone Date: Wed, 5 Jul 2023 10:16:24 +1000 Subject: [PATCH 001/206] update page content. --- .../components/widgets/security/.content.xml | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/security/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/security/.content.xml index 4b810217e..5bb356001 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/security/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/security/.content.xml @@ -1,4 +1,24 @@ - - + + + +
+ +
+ +
+ + + \ No newline at end of file From 6d4f23eb9120f5c674b8837b60df33b551dfa7dc Mon Sep 17 00:00:00 2001 From: wildone Date: Mon, 10 Jul 2023 12:51:31 +1000 Subject: [PATCH 002/206] add extra example. --- application/frontend/src/html/index.html | 35 +++++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/application/frontend/src/html/index.html b/application/frontend/src/html/index.html index 65909f5d6..13d970c06 100644 --- a/application/frontend/src/html/index.html +++ b/application/frontend/src/html/index.html @@ -166,7 +166,7 @@

Page Details 2

-
+

Page Details 3

Image Full Size

@@ -192,7 +192,7 @@

Page Details 3

-
+

Page Details 4

Image Right

@@ -218,7 +218,7 @@

Page Details 4

-
+

Page Details 5

Image Left

@@ -244,7 +244,7 @@

Page Details 5

-
+

Page Details 6

Full Width

@@ -311,6 +311,33 @@

Page Details 7

+ +
+ + + +
+ From f881b900e3506e4604ac484eeeb9c0a7c8998a8d Mon Sep 17 00:00:00 2001 From: wildone Date: Mon, 10 Jul 2023 13:12:14 +1000 Subject: [PATCH 003/206] cleanup css. --- .../details/page-details-oblique.scss | 52 +++++++++++-------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/application/frontend/src/components/details/page-details-oblique.scss b/application/frontend/src/components/details/page-details-oblique.scss index 93e5ae9a1..fa9457e1f 100644 --- a/application/frontend/src/components/details/page-details-oblique.scss +++ b/application/frontend/src/components/details/page-details-oblique.scss @@ -4,47 +4,55 @@ @include default.root; - @media (min-width: 576px) { - .container { - width: 100% !important; - } - } - @media (min-width: 768px) { - .container { - width: 50% !important; - } - } .container { display: flex; position: absolute; - width: 50%; height: 100%; left: 0px; overflow: hidden; + + @media (min-width: 576px) { + width: 100% !important; + } + + @media (min-width: 768px) { + width: 50% !important; + } + } .image { - height: 100%; - width: 50%; + height: 100%; + position: absolute; + top: 0; + z-index: -1; + + width: 100% !important; + left: 0; + + @media (min-width: 992px) { + width: 50% !important; left: 50%; - position: absolute; - top: 0; - z-index: -1; + } .picture-container { - transform: skewX(-10deg); overflow: hidden; width: 100%; - border-bottom-left-radius: 0.75rem; height: 100%; position: absolute; - margin-left: 3rem; + + @media (min-width: 992px) { + transform: skewX(-10deg); + margin-left: 3rem; + } img { + @media (min-width: 992px) { + margin-left: -4rem; + transform: skewX(10deg); + } + width: 105%; height: 100%; - margin-left: -4rem; - width: 100%; - transform: skewX(10deg); } } From f375a79cfe2a7c09fde44c324a3917791a8819fe Mon Sep 17 00:00:00 2001 From: wildone Date: Fri, 14 Jul 2023 22:21:16 +1000 Subject: [PATCH 004/206] update port to not conflict with juputerlab. --- application/frontend/webpack.dev.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/frontend/webpack.dev.js b/application/frontend/webpack.dev.js index 420c7a73a..0fa441a51 100644 --- a/application/frontend/webpack.dev.js +++ b/application/frontend/webpack.dev.js @@ -40,7 +40,7 @@ module.exports = merge(common, { serveIndex: true, } ], - port: 8888, + port: 8999, hot: true, liveReload:true, // devMiddleware: { From 13a56a101c23b93e224027aa3eb1895c0712a5fa Mon Sep 17 00:00:00 2001 From: wildone Date: Wed, 30 Aug 2023 20:42:33 +1000 Subject: [PATCH 005/206] add new space actions. --- .../actions/spaces/rest/SpacesRestModel.java | 18 ++ .../components/actions/spaces/exportspace.js | 50 +++++ .../actions/spaces/exportspace.modal.js | 188 ++++++++++++++++++ .../components/actions/spaces/importspace.js | 50 +++++ .../actions/spaces/importspace.modal.js | 186 +++++++++++++++++ .../components/actions/spaces/publishspace.js | 2 +- 6 files changed, 493 insertions(+), 1 deletion(-) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/exportspace.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/exportspace.modal.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/importspace.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/importspace.modal.js diff --git a/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/SpacesRestModel.java b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/SpacesRestModel.java index d69f22cab..cd0781e2c 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/SpacesRestModel.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/SpacesRestModel.java @@ -3,6 +3,7 @@ import java.util.List; import javax.validation.constraints.NotEmpty; import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.models.annotations.Default; import org.apache.sling.models.annotations.Model; import ai.typerefinery.websight.rest.spaces.SpacesRestModelBase; @@ -20,8 +21,17 @@ public class SpacesRestModel extends SpacesRestModelBase implements Validatable private String options; @RequestParameter + @Default(booleanValues = true, values = {"false"}) private Boolean deploy; + @RequestParameter + @Default(booleanValues = true, values = {"false"}) + private Boolean commit; + + @RequestParameter + @Default(booleanValues = true, values = {"false"}) + private Boolean backup; + public List getItems() { return this.items; } @@ -33,6 +43,14 @@ public String getOptions() { public Boolean getDeploy() { return this.deploy; } + + public Boolean getCommit() { + return this.commit; + } + + public Boolean getBackup() { + return this.backup; + } public Errors validate() { Errors errors = Errors.createErrors(); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/exportspace.js b/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/exportspace.js new file mode 100644 index 000000000..6975df8b1 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/exportspace.js @@ -0,0 +1,50 @@ +import React from "/apps/websight-atlaskit-esm/web-resources/react.js"; +import ExportSpaceModal from "/apps/typerefinery/components/actions/spaces/exportspace.modal.js"; + +class ExportSpaceAction extends React.Component { + constructor(props) { + super(props); + this.state = {}; + this.execute = this.execute.bind(this); + } + + execute(space) { + console.log("space", space); + this.setState({ + spaceName: space.name, + spacePath: space.path + }); + this.modalRef.open(space); + } + + + render() { + const { + spaceName, + spacePath, + executeCallback + } = this.props; + return /*#__PURE__*/React.createElement(ExportSpaceModal, { + spaceName: spaceName, + spacePath: spacePath, + onSuccess: () => executeCallback(), + ref: element => { + this.modalRef = element; + }, + testId: "Modal_ExportSpace" + }); + } + +} + +const exportSpace = { + data: { + name: "Export Space", + icon: "upload", + properties: { + appearance: "primary" + } + }, + actionComponent: ExportSpaceAction +}; +export default exportSpace; \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/exportspace.modal.js b/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/exportspace.modal.js new file mode 100644 index 000000000..ebf3c0bf4 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/exportspace.modal.js @@ -0,0 +1,188 @@ +import React from "/apps/websight-atlaskit-esm/web-resources/react.js"; +import { setView } from "/apps/websight/web-resources/js/viewControl.js"; +import { HelperMessage } from "/apps/websight-atlaskit-esm/web-resources/@atlaskit/form.js"; +import TextField from "/apps/websight-atlaskit-esm/web-resources/@atlaskit/textfield.js"; +import Toggle from "/apps/websight-atlaskit-esm/web-resources/@atlaskit/toggle.js"; +import Select from "/apps/websight-atlaskit-esm/web-resources/@atlaskit/select.js"; +import Form from "/apps/websight-rest-atlaskit-client/web-resources/js/Form.js"; +import { Modal } from "/apps/websight-ui-components/modal/web-resources/index.js"; +import RestClient from "/apps/websight-rest-atlaskit-client/web-resources/js/RestClient.js"; +import styled from "/apps/websight-atlaskit-esm/web-resources/styled-components.js"; +import { colors } from "/apps/websight-atlaskit-esm/web-resources/@atlaskit/theme.js"; + +const ItemsContainer = styled.div` + margin: 0; + padding: 0; + height: 228px; + overflow-y: auto; + position: relative; + color: ${colors.N300}; +`; + +class ExportSpaceModal extends React.Component { + constructor(props) { + super(props); + this.state = { + isFormSubmitting: false, + isFormValid: false, + }; + this.restClient = new RestClient("typerefinery-backend"); + this.onSubmit = this.onSubmit.bind(this); + this.onSuccess = this.onSuccess.bind(this); + this.open = this.open.bind(this); + this.close = this.close.bind(this); + this.updateFormSubmitting = this.updateFormSubmitting.bind(this); + } + + onSubmit(formData, ...submitArgs) { + + // submit rest call + const { + options, + deploy + } = formData; + const { + space, + spaceName, + spacePath + } = this.state; + + + console.log("options", options); + console.log("space", space); + console.log("spaceName", spaceName); + console.log("spacePath", spacePath); + + + if (spacePath) { + console.log("post"); + this.restClient.post({ + resourcePath: spacePath, + action: "export-space", + data: { + items: spacePath, + options: options ? options.value : "export", + deploy: deploy + }, + onSuccess: () => { + console.log("onSuccess"); + const { + onSuccess + } = this.props; + this.close(); + onSuccess() + }, + onError: () => { + console.log("onError"); + const { + onError + } = this.props; + this.close(); + onError(); + } + }); + } else { + console.log("no space path"); + // this.close(); + } + } + + open(space) { + console.log("open", space); + this.setState({ + isOpen: true, + options: null, + isFormSubmitting: false, + isFormValid: true, + space: space, + spaceName: space.name, + spacePath: space.path + }); + } + + close() { + this.setState({ + isOpen: false, + options: null, + isFormSubmitting: false, + isFormValid: false, + }); + } + + updateFormValid(isFormValid) { + this.setState({ + isFormValid + }); + } + + updateFormSubmitting(isFormSubmitting) { + this.setState({ + isFormSubmitting + }); + } + + onSuccess() { + const { + onSuccess + } = this.props; + this.close(); + onSuccess(); + } + + render() { + const { + isOpen, + isFormSubmitting, + isFormValid, + options, + spaceName, + spacePath + } = this.state; + return /*#__PURE__*/React.createElement(Modal, + { + isOpen: isOpen, + title: "Export Space", + onClose: this.close, + primaryAction: { + title: "Export", + isLoading: isFormSubmitting, + isDisabled: !isFormValid, + onClick: () => this.form.submit() + } + }, + /*#__PURE__*/React.createElement(Form, + { + ref: element => { + this.form = element; + }, + onSubmit: this.onSubmit, + onSuccess: this.onSuccess, + onSubmittedChange: this.updateFormSubmitting + }, + () => + /*#__PURE__*/React.createElement(React.Fragment, + null, + /*#__PURE__*/React.createElement(ItemsContainer, + null, + /*#__PURE__*/React.createElement(Toggle, { + name: "commit", + label: "Commit after Export", + size: "large", + appearance: "default", + onChange: (value) => { + console.log("deploy value", value); + this.updateFormValid(value !== ""); + } + }), + ) + ) + ) + ); + } + +} + +ExportSpaceModal.defaultProps = { + hideSuccessNotification: false +}; +export default ExportSpaceModal; \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/importspace.js b/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/importspace.js new file mode 100644 index 000000000..97494dc3a --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/importspace.js @@ -0,0 +1,50 @@ +import React from "/apps/websight-atlaskit-esm/web-resources/react.js"; +import ImportSpaceModal from "/apps/typerefinery/components/actions/spaces/importspace.modal.js"; + +class ImportSpaceAction extends React.Component { + constructor(props) { + super(props); + this.state = {}; + this.execute = this.execute.bind(this); + } + + execute(space) { + console.log("space", space); + this.setState({ + spaceName: space.name, + spacePath: space.path + }); + this.modalRef.open(space); + } + + + render() { + const { + spaceName, + spacePath, + executeCallback + } = this.props; + return /*#__PURE__*/React.createElement(ImportSpaceModal, { + spaceName: spaceName, + spacePath: spacePath, + onSuccess: () => executeCallback(), + ref: element => { + this.modalRef = element; + }, + testId: "Modal_ImportSpace" + }); + } + +} + +const importSpace = { + data: { + name: "Import Space", + icon: "download", + properties: { + appearance: "primary" + } + }, + actionComponent: ImportSpaceAction +}; +export default importSpace; \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/importspace.modal.js b/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/importspace.modal.js new file mode 100644 index 000000000..2be0061d2 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/importspace.modal.js @@ -0,0 +1,186 @@ +import React from "/apps/websight-atlaskit-esm/web-resources/react.js"; +import { setView } from "/apps/websight/web-resources/js/viewControl.js"; +import { HelperMessage } from "/apps/websight-atlaskit-esm/web-resources/@atlaskit/form.js"; +import TextField from "/apps/websight-atlaskit-esm/web-resources/@atlaskit/textfield.js"; +import Toggle from "/apps/websight-atlaskit-esm/web-resources/@atlaskit/toggle.js"; +import Select from "/apps/websight-atlaskit-esm/web-resources/@atlaskit/select.js"; +import Form from "/apps/websight-rest-atlaskit-client/web-resources/js/Form.js"; +import { Modal } from "/apps/websight-ui-components/modal/web-resources/index.js"; +import RestClient from "/apps/websight-rest-atlaskit-client/web-resources/js/RestClient.js"; +import styled from "/apps/websight-atlaskit-esm/web-resources/styled-components.js"; +import { colors } from "/apps/websight-atlaskit-esm/web-resources/@atlaskit/theme.js"; + +const ItemsContainer = styled.div` + margin: 0; + padding: 0; + height: 228px; + overflow-y: auto; + position: relative; + color: ${colors.N300}; +`; + +class ImportSpaceModal extends React.Component { + constructor(props) { + super(props); + this.state = { + isFormSubmitting: false, + isFormValid: false, + }; + this.restClient = new RestClient("typerefinery-backend"); + this.onSubmit = this.onSubmit.bind(this); + this.onSuccess = this.onSuccess.bind(this); + this.open = this.open.bind(this); + this.close = this.close.bind(this); + this.updateFormSubmitting = this.updateFormSubmitting.bind(this); + } + + onSubmit(formData, ...submitArgs) { + + // submit rest call + const { + options, + deploy + } = formData; + const { + space, + spaceName, + spacePath + } = this.state; + + console.log("options", options); + console.log("space", space); + console.log("spaceName", spaceName); + console.log("spacePath", spacePath); + + if (options) { + if (spacePath) { + + this.restClient.post({ + resourcePath: spacePath, + action: "import-space", + data: { + items: spacePath, + options: options.value, + deploy: deploy + }, + onSuccess: () => { + console.log("onSuccess"); + const { + onSuccess + } = this.props; + this.close(); + onSuccess() + }, + onError: () => { + console.log("onError"); + const { + onError + } = this.props; + this.close(); + onError(); + } + }); + } + // this.close(); + } + } + + open(space) { + console.log("open", space); + this.setState({ + isOpen: true, + options: null, + isFormSubmitting: false, + isFormValid: false, + space: space, + spaceName: space.name, + spacePath: space.path + }); + } + + close() { + this.setState({ + isOpen: false, + options: null, + isFormSubmitting: false, + isFormValid: false, + }); + } + + updateFormValid(isFormValid) { + this.setState({ + isFormValid + }); + } + + updateFormSubmitting(isFormSubmitting) { + this.setState({ + isFormSubmitting + }); + } + + onSuccess() { + const { + onSuccess + } = this.props; + this.close(); + onSuccess(); + } + + render() { + const { + isOpen, + isFormSubmitting, + isFormValid, + options, + spaceName, + spacePath + } = this.state; + return /*#__PURE__*/React.createElement(Modal, + { + isOpen: isOpen, + title: "Import Space", + onClose: this.close, + primaryAction: { + title: "Import", + isLoading: isFormSubmitting, + isDisabled: !isFormValid, + onClick: () => this.form.submit() + } + }, + /*#__PURE__*/React.createElement(Form, + { + ref: element => { + this.form = element; + }, + onSubmit: this.onSubmit, + onSuccess: this.onSuccess, + onSubmittedChange: this.updateFormSubmitting + }, + () => + /*#__PURE__*/React.createElement(React.Fragment, + null, + /*#__PURE__*/React.createElement(ItemsContainer, + null, + /*#__PURE__*/React.createElement(Toggle, { + name: "backup", + label: "Package space before import.", + size: "large", + appearance: "default", + onChange: (value) => { + console.log("deploy value", value); + this.updateFormValid(value !== ""); + } + }), + ) + ) + ) + ); + } + +} + +ImportSpaceModal.defaultProps = { + hideSuccessNotification: false +}; +export default ImportSpaceModal; \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/publishspace.js b/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/publishspace.js index 7109750f2..0d7fc52ff 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/publishspace.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/actions/spaces/publishspace.js @@ -31,7 +31,7 @@ class PublishSpaceAction extends React.Component { ref: element => { this.modalRef = element; }, - testId: "Modal_CreatePage" + testId: "Modal_PublishSpace" }); } From 2aefbbcbf18a0cce5ada94b2768c21cc56f313ee Mon Sep 17 00:00:00 2001 From: wildone Date: Wed, 30 Aug 2023 20:43:18 +1000 Subject: [PATCH 006/206] add log4j version property. --- application/backend/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/application/backend/pom.xml b/application/backend/pom.xml index 37614f8ba..45fe425c1 100644 --- a/application/backend/pom.xml +++ b/application/backend/pom.xml @@ -34,6 +34,7 @@ 0.20.0 6.5.0.202303070854-r 2.0.7 + 2.20.0 1.2.3 From d91294f1d9d94e0c754e0498e01d006309850e5a Mon Sep 17 00:00:00 2001 From: wildone Date: Wed, 30 Aug 2023 20:48:35 +1000 Subject: [PATCH 007/206] update config. --- .vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index e486207f8..1e76ebe40 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "configurations": [ { "type": "java", - "name": "Debug (Attach)", + "name": "Debug (Attach 8115)", "request": "attach", "projectName": "CMS", "hostName": "localhost", From 99a97fee44798de08eac70b111afb9b890ab38e4 Mon Sep 17 00:00:00 2001 From: wildone Date: Wed, 30 Aug 2023 21:08:16 +1000 Subject: [PATCH 008/206] fix missing ref. --- .../typerefinery/websight/models/components/BaseComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java index d673c2747..a40834467 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java @@ -356,7 +356,7 @@ protected void init() { .collect(Collectors.toCollection(LinkedHashSet::new)) .toArray(new String[] {}); - grid.addClasses(getAllGridClasses()); + grid.addClasses(grid.getAllGridClasses()); } //bootstrap margin styling From bd83c6950ba16a7405fab8d226d299249dd4eb5d Mon Sep 17 00:00:00 2001 From: wildone Date: Wed, 30 Aug 2023 21:09:15 +1000 Subject: [PATCH 009/206] change dialog text field type to password. --- .../structure/spaceconfig/dialog/.content.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/spaceconfig/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/structure/spaceconfig/dialog/.content.json index e8d09b021..a959c6abc 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/spaceconfig/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/spaceconfig/dialog/.content.json @@ -76,7 +76,8 @@ "sling:resourceType": "wcm/dialogs/components/textfield", "label": "Personal Token", "name": "deployGithubToken", - "description": "Github Personal Access Token", + "type": "password", + "description": "Github Personal Access Token (ghp_xxx...)", "placeholder": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, "githubBranch": { @@ -86,6 +87,13 @@ "name": "deployGithubBranch", "placeholder": "main" }, + "contentGithubBranch": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "label": "Content Export and Import Branch", + "description": "branch to use for exporting and importing space contents.", + "name": "contentGithubBranch", + "placeholder": "content" + }, "githubUsername": { "sling:resourceType": "wcm/dialogs/components/textfield", "label": "Username", From 6ec8dce25b787d03a22f05398b2564fe7da54742 Mon Sep 17 00:00:00 2001 From: wildone Date: Wed, 30 Aug 2023 21:09:43 +1000 Subject: [PATCH 010/206] add jcr utils. --- .../repository/JcrPackageEditFacade.java | 181 ++++++++++++++++++ .../websight/repository/JcrPackageUtil.java | 175 +++++++++++++++++ .../repository/OpenPackageException.java | 18 ++ .../websight/repository/RepositoryUtil.java | 174 +++++++++++++++++ .../websight/repository/package-info.java | 20 ++ 5 files changed, 568 insertions(+) create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/repository/JcrPackageEditFacade.java create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/repository/JcrPackageUtil.java create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/repository/OpenPackageException.java create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/repository/RepositoryUtil.java create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/repository/package-info.java diff --git a/application/backend/src/main/java/ai/typerefinery/websight/repository/JcrPackageEditFacade.java b/application/backend/src/main/java/ai/typerefinery/websight/repository/JcrPackageEditFacade.java new file mode 100644 index 000000000..089acfb4b --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/repository/JcrPackageEditFacade.java @@ -0,0 +1,181 @@ +package ai.typerefinery.websight.repository; + +import java.io.InputStream; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.jcr.Node; +import javax.jcr.Property; +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import org.apache.commons.lang3.StringUtils; +import org.apache.jackrabbit.vault.fs.api.PathFilterSet; +import org.apache.jackrabbit.vault.fs.api.WorkspaceFilter; +import org.apache.jackrabbit.vault.fs.config.DefaultWorkspaceFilter; +import org.apache.jackrabbit.vault.fs.config.MetaInf; +import org.apache.jackrabbit.vault.fs.io.AccessControlHandling; +import org.apache.jackrabbit.vault.packaging.Dependency; +import org.apache.jackrabbit.vault.packaging.JcrPackage; +import org.apache.jackrabbit.vault.packaging.JcrPackageDefinition; +import org.apache.sling.api.resource.PersistenceException; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.api.resource.ResourceResolver; +import org.apache.sling.api.resource.ResourceUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class JcrPackageEditFacade { + private static final Logger LOG = LoggerFactory.getLogger(JcrPackageEditFacade.class); + private static final String THUMBNAIL_MIMETYPE = "image/png"; + private final JcrPackageDefinition packageDefinition; + + private JcrPackageEditFacade(JcrPackageDefinition packageDefinition) { + this.packageDefinition = packageDefinition; + } + + public static JcrPackageEditFacade forPackage(JcrPackage jcrPackage) { + return JcrPackageUtil.fetchDefinition(jcrPackage) + .map(JcrPackageEditFacade::new) + .orElse(null); + } + + public void setDescription(String newDescription) { + String description = this.packageDefinition.getDescription(); + if (!StringUtils.equals(description, newDescription)) { + this.packageDefinition.set("jcr:description", newDescription, false); + } + + } + + public void setFilters(List newFilters) throws RepositoryException { + MetaInf metaInfo = this.packageDefinition.getMetaInf(); + boolean isFilterNotReinitialized = true; + WorkspaceFilter filter = metaInfo.getFilter(); + String downloadName = this.getPackageDownloadName(); + if (filter == null) { + LOG.warn("Package {} doesn't contain its own Workspace filter, created new {}", downloadName, DefaultWorkspaceFilter.class.getSimpleName()); + isFilterNotReinitialized = false; + filter = new DefaultWorkspaceFilter(); + } + + List packageFilters = ((WorkspaceFilter)filter).getFilterSets(); + if (!isFilterNotReinitialized || !this.arePathFilterSetsEqual(packageFilters, newFilters)) { + packageFilters.clear(); + packageFilters.addAll(newFilters); + LOG.debug("Setting filters for package {}", downloadName); + this.packageDefinition.setFilter((WorkspaceFilter)filter, false); + LOG.debug("Updating last modification date of package {} due to setting filters", downloadName); + this.updateLastModificationDate(); + } + } + + private boolean arePathFilterSetsEqual(List list, List compared) { + if (list.size() != compared.size()) { + return false; + } else { + for(int i = 0; i < list.size(); ++i) { + PathFilterSet pathFilterSet = (PathFilterSet)list.get(i); + PathFilterSet comparedPathFilterSet = (PathFilterSet)compared.get(i); + if (!pathFilterSet.equals(comparedPathFilterSet) || !pathFilterSet.getImportMode().equals(comparedPathFilterSet.getImportMode())) { + return false; + } + } + + return true; + } + } + + public void deleteThumbnail() throws RepositoryException { + Node packageNode = this.packageDefinition.getNode(); + if (!packageNode.hasNode("thumbnail.png")) { + LOG.debug("No thumbnail to remove for package definition: {}", this.getPackageDefinitionPath()); + } else { + Session session = this.packageDefinition.getNode().getSession(); + String downloadName = this.getPackageDownloadName(); + LOG.debug("Deleting current thumbnail for package: {}", downloadName); + session.removeItem(packageNode.getNode("thumbnail.png").getPath()); + LOG.debug("Updating last modification date of package {} due to thumbnail removal", downloadName); + this.updateLastModificationDate(); + } + } + + public void setThumbnail(InputStream newThumbnailStream, ResourceResolver resolver) throws RepositoryException, PersistenceException { + if (newThumbnailStream == null) { + LOG.warn("New thumbnail inputstream does not contain any data, skipping thumbnail update"); + } else { + String packageDefPath = this.getPackageDefinitionPath(); + String downloadName = this.getPackageDownloadName(); + LOG.debug("Setting thumbnail for package {}", downloadName); + Resource thumbnailFileResource = ResourceUtil.getOrCreateResource(resolver, packageDefPath + "/thumbnail.png", Collections.singletonMap("jcr:primaryType", "nt:file"), "nt:unstructured", false); + Resource thumbnailContent = thumbnailFileResource.getChild("jcr:content"); + if (thumbnailContent != null) { + resolver.delete(thumbnailContent); + } + + resolver.create(thumbnailFileResource, "jcr:content", getThumbnailContentProperties(newThumbnailStream)); + LOG.debug("Successfully updated thumbnail for package: {}", downloadName); + LOG.debug("Updating last modification date of package {} due to thumbnail update", downloadName); + this.updateLastModificationDate(); + } + } + + private String getPackageDefinitionPath() throws RepositoryException { + return this.packageDefinition.getNode().getPath(); + } + + private String getPackageDownloadName() { + return this.packageDefinition.getId().getDownloadName(); + } + + private static Map getThumbnailContentProperties(InputStream thumbnailStream) { + Map contentProps = new HashMap(); + contentProps.put("jcr:primaryType", "nt:resource"); + contentProps.put("jcr:mimeType", "image/png"); + contentProps.put("jcr:data", thumbnailStream); + return contentProps; + } + + private void updateLastModificationDate() { + this.packageDefinition.touch((Calendar)null, false); + } + + public void setDependencies(List newDependencies) { + List oldDependencies = Arrays.asList(this.packageDefinition.getDependencies()); + if (!oldDependencies.equals(newDependencies)) { + this.packageDefinition.setDependencies((Dependency[])newDependencies.toArray(new Dependency[0]), false); + } + } + + public void setAcHandling(AccessControlHandling newAcHandling) throws RepositoryException { + AccessControlHandling oldAcHandling = this.packageDefinition.getAccessControlHandling(); + if (!Objects.equals(oldAcHandling, newAcHandling)) { + if (newAcHandling == null) { + this.removeAcHandlingProperty(); + } else { + this.packageDefinition.set("acHandling", newAcHandling.toString().toLowerCase(JcrPackageUtil.DEFAULT_LOCALE), false); + } + + } + } + + private void removeAcHandlingProperty() throws RepositoryException { + Node packageDefinitionNode = this.packageDefinition.getNode(); + Property acHandlingProp = packageDefinitionNode.getProperty("acHandling"); + if (acHandlingProp != null) { + acHandlingProp.remove(); + } + + } + + public void setRequiresRestart(boolean newRequiredRestart) { + boolean requiredRestart = this.packageDefinition.requiresRestart(); + if (requiredRestart != newRequiredRestart) { + this.packageDefinition.set("requiresRestart", newRequiredRestart, false); + } + } +} diff --git a/application/backend/src/main/java/ai/typerefinery/websight/repository/JcrPackageUtil.java b/application/backend/src/main/java/ai/typerefinery/websight/repository/JcrPackageUtil.java new file mode 100644 index 000000000..6a125f398 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/repository/JcrPackageUtil.java @@ -0,0 +1,175 @@ +package ai.typerefinery.websight.repository; + +import java.util.EnumSet; +import java.util.Locale; +import java.util.Optional; +import javax.jcr.Node; +import javax.jcr.NodeIterator; +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import org.apache.commons.lang3.StringUtils; +import org.apache.jackrabbit.vault.fs.api.ImportMode; +import org.apache.jackrabbit.vault.fs.config.MetaInf; +import org.apache.jackrabbit.vault.fs.io.AccessControlHandling; +import org.apache.jackrabbit.vault.packaging.JcrPackage; +import org.apache.jackrabbit.vault.packaging.JcrPackageDefinition; +import org.apache.jackrabbit.vault.packaging.JcrPackageManager; +import org.apache.jackrabbit.vault.packaging.PackageId; +import org.jetbrains.annotations.NotNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class JcrPackageUtil { + private static final Logger LOG = LoggerFactory.getLogger(JcrPackageUtil.class); + private static final String PACKAGE_VLT_REL_PATH = "/jcr:content/vlt:definition"; + public static final Locale DEFAULT_LOCALE; + public static final String NN_PACKAGE_THUMBNAIL = "thumbnail.png"; + public static final String THUMBNAIL_REL_PATH = "/jcr:content/vlt:definition/thumbnail.png"; + public static final String PACKAGE_FILTERS_REL_PATH = "/jcr:content/vlt:definition/filter"; + public static final String PACKAGES_ROOT_PATH = "/etc/packages/"; + public static final String NO_GROUP = ":no_group"; + + private JcrPackageUtil() { + } + + public static boolean hasValidFilters(Session session, String jcrPackagePath) { + String filtersPath = jcrPackagePath + "/jcr:content/vlt:definition/filter"; + + try { + if (!session.nodeExists(filtersPath)) { + return false; + } else { + NodeIterator filterNodes = session.getNode(filtersPath).getNodes(); + if (!filterNodes.hasNext()) { + return false; + } else { + Node filterNode; + do { + if (!filterNodes.hasNext()) { + return true; + } + + filterNode = filterNodes.nextNode(); + } while(filterNode.hasProperty("root") && filterNode.hasProperty("mode")); + + return false; + } + } + } catch (RepositoryException var5) { + LOG.warn("Could not check package filters", var5); + return false; + } + } + + public static boolean hasValidWorkspaceFilter(JcrPackage jcrPackage) { + return (Boolean)fetchDefinition(jcrPackage).map((definition) -> { + try { + return definition.getMetaInf(); + } catch (RepositoryException var2) { + return null; + } + }).map((metaInf) -> { + return metaInf.getFilter() != null; + }).orElse(false); + } + + public static boolean isValidPackageNode(Node packageNode) { + try { + if (packageNode.isNodeType("nt:hierarchyNode") && packageNode.hasNode("jcr:content")) { + return packageNode.getNode("jcr:content").isNodeType("vlt:Package"); + } + } catch (RepositoryException var2) { + LOG.warn("Error during node validation", var2); + } + + return false; + } + + public static ImportMode toImportMode(String importModeName) { + return (ImportMode)getEnum(importModeName, ImportMode.class, ImportMode.REPLACE); + } + + public static AccessControlHandling toAcHandling(String acHandlingName) { + String formattedAcHandlingName = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(acHandlingName), "_"); + formattedAcHandlingName = StringUtils.lowerCase(formattedAcHandlingName, DEFAULT_LOCALE); + return getEnum(formattedAcHandlingName, AccessControlHandling.class, null); + // return (AccessControlHandling)getEnum(formattedAcHandlingName, AccessControlHandling.class, (Enum)null); + } + + private static > E getEnum(String enumName, Class enumClass, E defaultValue) { + return (E)EnumSet.allOf(enumClass).stream().filter((enumVal) -> { + return enumVal.name().equalsIgnoreCase(enumName); + }).findFirst().orElseGet(() -> { + if (LOG.isDebugEnabled()) { + LOG.debug("Could not recognize value: {} in Enum class: '{}'", enumName, enumClass.getSimpleName()); + } + + return defaultValue; + }); + } + + public static String getSimplePackageName(String name, String version) { + return name + (!version.isEmpty() ? "-" + version : "") + ".zip"; + } + + public static String getSimplePackageName(JcrPackage jcrPackage) { + return fetchDefinition(jcrPackage) + .map(JcrPackageDefinition::getId) + .map(PackageId::getDownloadName) + .orElse(null); + } + + public static @NotNull String getGroupIdFromNode(Node packageRoot, Node groupNode) throws RepositoryException { + return groupNode.getPath().substring(packageRoot.getPath().length() + 1); + } + + public static Optional fetchDefinition(JcrPackage jcrPackage) { + try { + return Optional.ofNullable(jcrPackage.getDefinition()); + } catch (RepositoryException var2) { + LOG.warn("Cannot get package definition", var2); + return Optional.empty(); + } + } + + public static void close(JcrPackage jcrPackage) { + if (jcrPackage != null) { + jcrPackage.close(); + } + + } + + public static JcrPackage open(String packagePath, Session session, JcrPackageManager packageManager) throws RepositoryException, OpenPackageException { + Node packageNode = session.getNode(packagePath); + JcrPackage openedPackage = packageManager.open(packageNode); + if (openedPackage == null) { + throw new OpenPackageException(packagePath); + } else { + return openedPackage; + } + } + + public static long countPackages(Node root, long limit, boolean deep) throws RepositoryException { + long packages = 0L; + NodeIterator nodeIterator = root.getNodes(); + + while(nodeIterator.hasNext() && packages <= limit) { + Node child = nodeIterator.nextNode(); + if (!".snapshot".equals(child.getName())) { + if (isValidPackageNode(child)) { + ++packages; + } else if (deep && child.hasNodes()) { + packages += countPackages(child, limit - packages, true); + } + } + } + + return packages; + } + + static { + DEFAULT_LOCALE = Locale.ENGLISH; + } + +} diff --git a/application/backend/src/main/java/ai/typerefinery/websight/repository/OpenPackageException.java b/application/backend/src/main/java/ai/typerefinery/websight/repository/OpenPackageException.java new file mode 100644 index 000000000..14d841340 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/repository/OpenPackageException.java @@ -0,0 +1,18 @@ +package ai.typerefinery.websight.repository; + +public class OpenPackageException extends Exception { + private static final String SIMPLIFIED_MESSAGE = "Provided package is not valid"; + private final String packagePath; + + public OpenPackageException(String packagePath) { + this.packagePath = packagePath; + } + + public String getSimplifiedMessage() { + return "Provided package is not valid"; + } + + public String getMessage() { + return "Provided path: " + this.packagePath + " does not point to a valid package"; + } +} diff --git a/application/backend/src/main/java/ai/typerefinery/websight/repository/RepositoryUtil.java b/application/backend/src/main/java/ai/typerefinery/websight/repository/RepositoryUtil.java new file mode 100644 index 000000000..3bb1ab5af --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/repository/RepositoryUtil.java @@ -0,0 +1,174 @@ +package ai.typerefinery.websight.repository; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.net.URISyntaxException; +import java.util.Properties; + +import javax.jcr.RepositoryException; +import javax.jcr.Session; + +import org.apache.jackrabbit.vault.fs.api.RepositoryAddress; +import org.apache.jackrabbit.vault.fs.api.VaultFile; +import org.apache.jackrabbit.vault.fs.api.VaultFileSystem; +import org.apache.jackrabbit.vault.fs.api.VaultFsConfig; +import org.apache.jackrabbit.vault.fs.config.ConfigurationException; +import org.apache.jackrabbit.vault.fs.config.DefaultMetaInf; +import org.apache.jackrabbit.vault.fs.config.MetaInf; +import org.apache.jackrabbit.vault.fs.io.AbstractExporter; +import org.apache.jackrabbit.vault.fs.io.Archive; +import org.apache.jackrabbit.vault.fs.io.FileArchive; +import org.apache.jackrabbit.vault.fs.io.Importer; +import org.apache.jackrabbit.vault.fs.io.PlatformExporter; +import org.apache.jackrabbit.vault.packaging.ExportOptions; +import org.apache.jackrabbit.vault.fs.Mounter; +import org.apache.jackrabbit.vault.util.DefaultProgressListener; +import org.apache.sling.api.resource.ResourceResolver; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RepositoryUtil { + final static Logger log = LoggerFactory.getLogger(RepositoryUtil.class); + + /** + * use jackrabit platfromexporter to export the repository + * @throws IOException + * @throws RepositoryException + */ + public static void jcrExport(ResourceResolver resourceResolver, String localpath, String jcrPath, boolean verbose) throws RepositoryException, IOException { + Session session = null; + VaultFileSystem jcrfs = null; + File exportRoot = new File(localpath); + // create exportRoot if not exist + if (!exportRoot.exists()) { + exportRoot.mkdirs(); + } + + AbstractExporter exporter = new PlatformExporter(exportRoot); + try { + session = getSession(resourceResolver); + + // get jcrpath in exportRoot + ExportOptions opts = new ExportOptions(); + opts.setRootPath("/"); + + + Properties props = new Properties(); + props.setProperty("group", "typerefinery"); + props.setProperty("name", "typerefinery"); + DefaultMetaInf metaInf = new DefaultMetaInf(); + metaInf.setProperties(props); + + opts.setMetaInf(metaInf); + + // get mount path, this will be used to connect to JCR + RepositoryAddress addr; + try { + String mountPath = opts.getMountPath(); + if (mountPath == null || mountPath.length() == 0) { + mountPath = "/"; + } + addr = new RepositoryAddress("/" + session.getWorkspace().getName() + mountPath); + } catch (URISyntaxException e) { + throw new IllegalArgumentException(e); + } + + VaultFsConfig config = opts.getMetaInf().getConfig(); + + // get jcrfs + jcrfs = Mounter.mount(config, metaInf.getFilter(), addr, opts.getRootPath(), session); + VaultFile vaultFile = jcrfs.getFile(jcrPath); + + // set exporter + ((PlatformExporter) exporter).setPruneMissing(true); + if (jcrPath == null || !jcrPath.startsWith("/")) { + exporter.setRelativePaths(true); + } + + log.info("Exporting {} to {}", vaultFile.getPath(), exportRoot.getCanonicalPath()); + + PrintWriter logStream = new PrintWriter(new OutputStream() { + @Override + public void write(int b) throws IOException { + log.info("{}", (char) b); + } + }); + + // exporter.setVerbose(new DefaultProgressListener(logStream)); + + //do not export package meta + // exporter.setNoMetaInf(true); + + exporter.setProperties(props); + + exporter.export(vaultFile, false); + + } finally { + if (exporter != null) { + exporter.close(); + } + if (jcrfs != null) { + jcrfs.unmount(); + } + ungetSession(session); + } + + } + + public static void jcrImport(ResourceResolver resourceResolver, String localpath, String jcrPath, boolean verbose) throws RepositoryException, IOException, ConfigurationException { + Session session = null; + File exportRoot = new File(localpath); + + Importer importer = new Importer(); + importer.getOptions().setListener(new DefaultProgressListener()); + + Archive archive = new FileArchive(exportRoot); + try { + session = getSession(resourceResolver); + importer.run(archive, session, jcrPath); + } finally { + ungetSession(session); + } + + } + + + public static File getFile(File file, String path, boolean mustExist) + throws IOException { + File newFile = new File(path); + if (newFile.isAbsolute()) { + newFile = newFile.getCanonicalFile(); + } else { + newFile = new File(file, path).getCanonicalFile(); + } + if (!newFile.exists() && mustExist) { + throw new FileNotFoundException(newFile.getPath()); + } + return newFile; + } + + public static Session getSession(ResourceResolver resourceResolver) throws RepositoryException { + Session session = resourceResolver.adaptTo(Session.class); + if (session == null) { + throw new RepositoryException("could not obtain a session from calling user " + resourceResolver.getUserID()); + } + return session; + } + + public static void ungetSession(Session session) { + if (session != null) { + try { + if (session.hasPendingChanges()) { + session.save(); + } + } catch (RepositoryException e) { + log.error("Cannot save session", e); + } + } + } + + +} diff --git a/application/backend/src/main/java/ai/typerefinery/websight/repository/package-info.java b/application/backend/src/main/java/ai/typerefinery/websight/repository/package-info.java new file mode 100644 index 000000000..10352ea56 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/repository/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2023 Typerefinery.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Version("1.0.0") +package ai.typerefinery.websight.repository; + +import org.osgi.annotation.versioning.Version; \ No newline at end of file From 075f3a524c234d3bf1ea80e5b3d820d0dc9aa9b3 Mon Sep 17 00:00:00 2001 From: wildone Date: Wed, 30 Aug 2023 21:10:03 +1000 Subject: [PATCH 011/206] update git utils. --- .../websight/utils/git/GitUtil.java | 59 +++++++++++++++---- 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/utils/git/GitUtil.java b/application/backend/src/main/java/ai/typerefinery/websight/utils/git/GitUtil.java index fd46a3b02..855b2076e 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/utils/git/GitUtil.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/utils/git/GitUtil.java @@ -1,6 +1,7 @@ package ai.typerefinery.websight.utils.git; import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.api.InitCommand; import org.eclipse.jgit.api.PullResult; import org.eclipse.jgit.api.PushCommand; @@ -41,6 +42,7 @@ import org.eclipse.jgit.api.FetchCommand; import org.eclipse.jgit.api.MergeCommand; import org.eclipse.jgit.api.MergeResult; +import org.eclipse.jgit.api.PullCommand; import org.eclipse.jgit.api.PushCommand; import org.eclipse.jgit.api.ResetCommand; import org.eclipse.jgit.api.errors.GitAPIException; @@ -97,6 +99,9 @@ public class GitUtil { private static final Logger log = LoggerFactory.getLogger(GitUtil.class); public static void initializeGit(GitConfig gitConfig, boolean failOnError) { + initializeGit(gitConfig, failOnError, false); + } + public static void initializeGit(GitConfig gitConfig, boolean failOnError, boolean forceInit) { if (gitConfig.git != null && gitConfig.localFolder != null) { return; } @@ -125,7 +130,7 @@ public static void initializeGit(GitConfig gitConfig, boolean failOnError) { // If LFS is enabled, we will use only built-in LFS. // BuiltinLFS.register(); //TODO: check if this is needed - boolean clonedOrCreated = cloneOrInit(gitConfig); + boolean clonedOrCreated = cloneOrInit(gitConfig, forceInit); gitConfig.git = Git.open(gitConfig.localFolder); updateGitConfigs(gitConfig); @@ -507,7 +512,7 @@ private static void fastForwardNotMergedCommits(GitConfig gitConfig, FetchResult } } - private void pull(GitConfig gitConfig, String commitToRevert) throws GitAPIException, IOException { + public static void pull(GitConfig gitConfig, String commitToRevert) throws GitAPIException, IOException { if (gitConfig.uri == null) { return; } @@ -570,7 +575,7 @@ private void reset(GitConfig gitConfig) { * * @param commitToDiscard if null, commit will not be discarded. If not null, commit with that id will be discarded. */ - private void reset(GitConfig gitConfig, String commitToDiscard) { + private static void reset(GitConfig gitConfig, String commitToDiscard) { try { String fullBranch = gitConfig.git.getRepository().getFullBranch(); if (ObjectId.isId(fullBranch)) { @@ -607,7 +612,7 @@ private void reset(GitConfig gitConfig, String commitToDiscard) { } } - private boolean isCommitMerged(GitConfig gitConfig, String commitId) throws IOException { + private static boolean isCommitMerged(GitConfig gitConfig, String commitId) throws IOException { Repository repository = gitConfig.git.getRepository(); try (RevWalk revWalk = new RevWalk(repository)) { RevCommit branchHead = revWalk.parseCommit(repository.resolve(Constants.R_HEADS + gitConfig.branch)); @@ -679,7 +684,7 @@ private String getNextTagId(GitConfig gitConfig) throws GitAPIException { return String.valueOf(maxId + 1); } - private void applyMergeCommit(GitConfig gitConfig, MergeResult mergeResult, String mergeMessage) throws GitAPIException { + private static void applyMergeCommit(GitConfig gitConfig, MergeResult mergeResult, String mergeMessage) throws GitAPIException { if (mergeResult.getMergeStatus().equals(MergeResult.MergeStatus.MERGED_NOT_COMMITTED)) { gitConfig.git.commit() .setMessage(mergeMessage) @@ -719,7 +724,7 @@ public void setCommentTemplate(GitConfig gitConfig, String commentTemplate) { } - private String getMergeMessage(GitConfig gitConfig, Ref r) throws IOException { + private static String getMergeMessage(GitConfig gitConfig, Ref r) throws IOException { String userMessage = new MergeMessageFormatter().format(Collections.singletonList(r), gitConfig.git.getRepository().exactRef(Constants.HEAD)); if (gitConfig.escapedCommentTemplate == null) { @@ -744,6 +749,9 @@ private static void resetLfsCredentials(GitConfig gitConfig) { } public static boolean cloneOrInit(GitConfig gitConfig) throws IOException, GitAPIException { + return cloneOrInit(gitConfig, false); + } + public static boolean cloneOrInit(GitConfig gitConfig, Boolean forceInit) throws IOException, GitAPIException { boolean shouldCloneOrInit; boolean shouldUpdateOrigin = false; if (!gitConfig.localFolder.exists()) { @@ -783,10 +791,39 @@ public static boolean cloneOrInit(GitConfig gitConfig) throws IOException, GitAP } shouldCloneOrInit = false; } else { - // Cannot overwrite existing files that is definitely not git repository - throw new IOException(String.format( - "Folder '%s' already exists and is not a git repository. Use another gitConfig.localFolder path or delete the existing folder to create a git repository.", - gitConfig.localFolder)); + if (forceInit) { + //init new repo + Git repo = Git.init() + .setDirectory(gitConfig.localFolder) + .call(); + + try { + repo.remoteAdd() + .setName(Constants.DEFAULT_REMOTE_NAME) + .setUri(new URIish(gitConfig.uri)) + .call(); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + log.debug("Could not add remote {}", gitConfig.uri); + } + try { + repo.branchCreate() + .setName(gitConfig.branch) + .call(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + log.debug("Could not create branch {}", gitConfig.branch); + } + repo.close(); + return true; + } else { + // Cannot overwrite existing files that is definitely not git repository + throw new IOException(String.format( + "Folder '%s' already exists and is not a git repository. Use another gitConfig.localFolder path or delete the existing folder to create a git repository.", + gitConfig.localFolder)); + } } } else { shouldCloneOrInit = true; @@ -795,6 +832,7 @@ public static boolean cloneOrInit(GitConfig gitConfig) throws IOException, GitAP if (shouldCloneOrInit) { try { + //clone repo if (gitConfig.uri != null) { CloneCommand cloneCommand = Git.cloneRepository() .setURI(gitConfig.uri) @@ -827,6 +865,7 @@ public static boolean cloneOrInit(GitConfig gitConfig) throws IOException, GitAP cloned.close(); } else { + //init new repo Git repo = Git.init().setDirectory(gitConfig.localFolder).call(); repo.close(); } From 51b27bdb75a9b0b0ea2e1f8bf0baf5720f15460a Mon Sep 17 00:00:00 2001 From: wildone Date: Wed, 30 Aug 2023 21:10:15 +1000 Subject: [PATCH 012/206] update space actions. --- .../actions/spaces/ExportSpaceWebAction.java | 22 +++ .../actions/spaces/ImportSpaceWebAction.java | 22 +++ .../actions/spaces/SpaceConfigModel.java | 38 ++++ .../websight/actions/spaces/SpaceUtil.java | 68 +++++++ .../spaces/rest/ExportSpaceRestAction.java | 142 ++++++++++++++ .../spaces/rest/ImportSpaceRestAction.java | 183 ++++++++++++++++++ .../spaces/rest/PublishSpaceRestAction.java | 15 +- 7 files changed, 479 insertions(+), 11 deletions(-) create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/ExportSpaceWebAction.java create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/ImportSpaceWebAction.java create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/SpaceConfigModel.java create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/SpaceUtil.java create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/ExportSpaceRestAction.java create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/ImportSpaceRestAction.java diff --git a/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/ExportSpaceWebAction.java b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/ExportSpaceWebAction.java new file mode 100644 index 000000000..6fec17642 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/ExportSpaceWebAction.java @@ -0,0 +1,22 @@ +package ai.typerefinery.websight.actions.spaces; + +import org.jetbrains.annotations.NotNull; +import org.osgi.service.component.annotations.Component; +import pl.ds.websight.ui.framework.actions.service.Condition; +import pl.ds.websight.ui.framework.actions.service.WebAction; +import pl.ds.websight.ui.framework.actions.service.WebActionConfig; +import pl.ds.websight.ui.framework.actions.service.conditions.HasPrivilegesCondition; + +@Component +public class ExportSpaceWebAction implements WebAction { + private static final WebActionConfig CONFIG = WebActionConfig.Builder.newWebActionConfig("/apps/typerefinery/components/actions/spaces/exportspace.js") + .forAllModules() + .forTypes(new String[] { "ws:Space" }).forViewTypes(new String[] { "row" }) + .withCondition((Condition)new HasPrivilegesCondition(new String[] { "ws:publish" })).withRanking(600) + .build(); + + @NotNull + public WebActionConfig getConfig() { + return CONFIG; + } +} diff --git a/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/ImportSpaceWebAction.java b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/ImportSpaceWebAction.java new file mode 100644 index 000000000..2b5992874 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/ImportSpaceWebAction.java @@ -0,0 +1,22 @@ +package ai.typerefinery.websight.actions.spaces; + +import org.jetbrains.annotations.NotNull; +import org.osgi.service.component.annotations.Component; +import pl.ds.websight.ui.framework.actions.service.Condition; +import pl.ds.websight.ui.framework.actions.service.WebAction; +import pl.ds.websight.ui.framework.actions.service.WebActionConfig; +import pl.ds.websight.ui.framework.actions.service.conditions.HasPrivilegesCondition; + +@Component +public class ImportSpaceWebAction implements WebAction { + private static final WebActionConfig CONFIG = WebActionConfig.Builder.newWebActionConfig("/apps/typerefinery/components/actions/spaces/importspace.js") + .forAllModules() + .forTypes(new String[] { "ws:Space" }).forViewTypes(new String[] { "row" }) + .withCondition((Condition)new HasPrivilegesCondition(new String[] { "ws:publish" })).withRanking(600) + .build(); + + @NotNull + public WebActionConfig getConfig() { + return CONFIG; + } +} diff --git a/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/SpaceConfigModel.java b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/SpaceConfigModel.java new file mode 100644 index 000000000..1c23ef71a --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/SpaceConfigModel.java @@ -0,0 +1,38 @@ +package ai.typerefinery.websight.actions.spaces; + +import java.net.URI; + +import org.apache.commons.lang3.StringUtils; + +public class SpaceConfigModel { + + public static final String PAGES_SPACE_RESOURCE_TYPE = "typerefinery/components/structure/pagesspace"; + public static final String ASSEPS_SPACE_RESOURCE_TYPE = "typerefinery/components/structure/assetsspace"; + + public static final String DEFAULT_GIT_USER_NAME = "typerefinery"; + public static final String DEFAULT_GIT_USER_EMAIL = "deploy@typerefinery.ai"; + + public static final String DEFAULT_LOCAL_PATH = "content"; + public static final String DEFAULT_LOCAL_CONTENT_ROOT_PATH = "contentroot"; + public static final String DEFAULT_GIT_CONTENT_ROOT_ENV_VAR = "GIT_CONTENT_ROOT"; + public static final String DEFAULT_PACKAGE_GROUP = "space-backup"; + public static final String DEFAULT_PACKAGE_PREFIX = "space-backup-"; + public static final String DEFAULT_PACKAGE_VERSION = "1.0.0"; + public static final String DEFAULT_GIT_PROVIDER = "github"; + + public String repositoryUrl; + public String token; + public String branch; + public String branchContent; + public String configUsername = DEFAULT_GIT_USER_NAME; + public String configEmail = DEFAULT_GIT_USER_EMAIL; + + public String getGitProvider() { + if (StringUtils.isEmpty(repositoryUrl)) { + return DEFAULT_GIT_PROVIDER; + } + URI repositoryUri = URI.create(repositoryUrl); + + return repositoryUri.getHost(); + } +} diff --git a/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/SpaceUtil.java b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/SpaceUtil.java new file mode 100644 index 000000000..5026ca970 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/SpaceUtil.java @@ -0,0 +1,68 @@ +package ai.typerefinery.websight.actions.spaces; + +import java.util.Map; + +import org.apache.sling.api.resource.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ai.typerefinery.websight.actions.spaces.rest.PublishSpaceRestAction; +import pl.ds.websight.pages.core.api.Page; +import pl.ds.websight.rest.framework.RestActionResult; + +public class SpaceUtil { + + private static final Logger LOG = LoggerFactory.getLogger(PublishSpaceRestAction.class); + + public static SpaceConfigModel getSpaceConfig(Resource space) { + SpaceConfigModel spaceConfig = new SpaceConfigModel(); + try { + Resource pagesRoot = space.getChild("pages"); + // quick fail if pagesRoot is null + if (pagesRoot == null) { + LOG.error("No pages to deploy."); + return spaceConfig; + } + + Resource adminChild = pagesRoot.getChild("_admin"); + // quick fail if adminChild is null + if (adminChild == null) { + LOG.error("No admin page with config to deploy."); + return spaceConfig; + } + + Page adminChildPage = adminChild.adaptTo(Page.class); + Map adminChildProperties = adminChildPage.getContentProperties(); + if (adminChildProperties == null) { + LOG.error("Admin config page does not have any properties."); + return spaceConfig; + } + // ValueMap adminChildValueMap = adminChild.getValueMap( + + spaceConfig.repositoryUrl = adminChildProperties.containsKey("deployGithubRepositoryUrl") + ? adminChildProperties.get("deployGithubRepositoryUrl").toString() + : ""; + spaceConfig.branch = adminChildProperties.containsKey("deployGithubBranch") + ? adminChildProperties.get("deployGithubBranch").toString() + : ""; + spaceConfig.token = adminChildProperties.containsKey("deployGithubToken") + ? adminChildProperties.get("deployGithubToken").toString() + : ""; + spaceConfig.configUsername = adminChildProperties.containsKey("deployGithubUserName") + ? adminChildProperties.get("deployGithubUserName").toString() + : ""; + + spaceConfig.configEmail = adminChildProperties.containsKey("deployGithubUserEmail") + ? adminChildProperties.get("deployGithubUserEmail").toString() + : ""; + spaceConfig.branchContent = adminChildProperties.containsKey("contentGithubBranch") + ? adminChildProperties.get("contentGithubBranch").toString() + : ""; + + } catch (Exception e) { + LOG.error("Error getting space config.", e); + } + return spaceConfig; + } + +} diff --git a/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/ExportSpaceRestAction.java b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/ExportSpaceRestAction.java new file mode 100644 index 000000000..1c6dc194c --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/ExportSpaceRestAction.java @@ -0,0 +1,142 @@ +package ai.typerefinery.websight.actions.spaces.rest; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.text.MessageFormat; +import java.util.List; +import org.apache.commons.lang3.StringUtils; +import org.apache.jackrabbit.vault.packaging.Packaging; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.event.jobs.JobManager; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import ai.typerefinery.websight.actions.spaces.SpaceConfigModel; +import ai.typerefinery.websight.actions.spaces.SpaceUtil; +import ai.typerefinery.websight.repository.RepositoryUtil; +import ai.typerefinery.websight.utils.git.GitConfig; +import ai.typerefinery.websight.utils.git.GitUtil; +import pl.ds.websight.rest.framework.RestAction; +import pl.ds.websight.rest.framework.RestActionResult; +import pl.ds.websight.rest.framework.annotations.PrimaryTypes; +import pl.ds.websight.rest.framework.annotations.SlingAction; +import static ai.typerefinery.websight.actions.spaces.SpaceConfigModel.*; + +@SlingAction +@PrimaryTypes({ "ws:PagesSpace" }) +@Component +public class ExportSpaceRestAction extends AbstractSpacesRestAction + implements RestAction { + + private static final Logger LOG = LoggerFactory.getLogger(ExportSpaceRestAction.class); + + @Reference + private Packaging packaging; + + @Reference + private JobManager jobManager; + + RestActionResult execute(SpacesRestModel model, List resources) { + + // publish pages and assets recursively + boolean isCommit = model.getCommit(); + + // this would only run on one space + for (Resource resource : resources) { + + try { + + // get space config + SpaceConfigModel spaceConfig = SpaceUtil.getSpaceConfig(resource); + + if (StringUtils.isNotBlank(spaceConfig.repositoryUrl)) { + + // get environment variable GIT_CONTENT_ROOT + String docrootPath = System.getenv(DEFAULT_GIT_CONTENT_ROOT_ENV_VAR); + if (StringUtils.isBlank(docrootPath)) { + docrootPath = DEFAULT_LOCAL_CONTENT_ROOT_PATH; + } + + // create new folder docroot/export/githuib/ + Path contentSpacePath = Paths.get(docrootPath,DEFAULT_LOCAL_PATH, spaceConfig.getGitProvider(), resource.getName()); + contentSpacePath.toFile().mkdirs(); + + GitConfig gitConfig = null; + // clone git repo to docroot/export/githuib/ + try { + // create git config object + gitConfig = new GitConfig( + spaceConfig.repositoryUrl, + contentSpacePath, + spaceConfig.branchContent, + spaceConfig.token, + spaceConfig.configEmail, + spaceConfig.configUsername + ); + + // get git object + GitUtil.initializeGit(gitConfig, true, true); + + // get latest from git remote + GitUtil.pull(gitConfig, null); + + } catch (Exception ex) { + // TODO Auto-generated catch block + ex.printStackTrace(); + return RestActionResult.failure("Failed", MessageFormat.format("Error while exporting to github, {}", ex.getMessage())); + } + + // export pages to docroot/export/githuib/ + RepositoryUtil.jcrExport(resource.getResourceResolver(), contentSpacePath.toString(), resource.getPath(), true); + + Path jcrRootToCommit = Paths.get(contentSpacePath.toString(), "jcr_root"); + + if (isCommit && jcrRootToCommit.toFile().exists()) { + + try { + + // add all files to git + GitUtil.createCommit(gitConfig, ".", "Exported from " + resource.getPath()); + + // push to git remote + GitUtil.push(gitConfig); + + } catch (Exception ex) { + // TODO Auto-generated catch block + ex.printStackTrace(); + return RestActionResult.failure("Failed", MessageFormat.format("Error while exporting to github, {}", ex.getMessage())); + } + } else { + LOG.info("Not committing to github."); + } + + } else { + LOG.error("Repository URL is blank, not exporting to github."); + return RestActionResult.failure("Failed", "Please configure space with Git config."); + } + + return RestActionResult.success("Success", "Space exported successfully."); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return RestActionResult.failure("Failed", "Error exporting space."); + } + + } + + return RestActionResult.failure("Failed", "Could not export space."); + } + + private RestActionResult getSuccessResult(int assetsCount) { + String message = "Publishing requested"; + String messageDetails = String.format("Publishing requested successfully for %d %s", + new Object[] { Integer.valueOf(assetsCount), + (assetsCount == 1) ? "asset" : "assets" }); + return RestActionResult.success(message, messageDetails); + } + + String getFailureMessage(SpacesRestModel model) { + return "Error while requesting publishing"; + } +} \ No newline at end of file diff --git a/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/ImportSpaceRestAction.java b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/ImportSpaceRestAction.java new file mode 100644 index 000000000..4b5927947 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/ImportSpaceRestAction.java @@ -0,0 +1,183 @@ +package ai.typerefinery.websight.actions.spaces.rest; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.List; +import javax.jcr.Session; + +import org.apache.commons.lang3.StringUtils; +import org.apache.jackrabbit.vault.fs.api.PathFilterSet; +import org.apache.jackrabbit.vault.fs.io.AccessControlHandling; +import org.apache.jackrabbit.vault.packaging.JcrPackage; +import org.apache.jackrabbit.vault.packaging.JcrPackageManager; +import org.apache.jackrabbit.vault.packaging.Packaging; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.event.jobs.JobManager; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import ai.typerefinery.websight.actions.spaces.SpaceConfigModel; +import ai.typerefinery.websight.actions.spaces.SpaceUtil; +import ai.typerefinery.websight.repository.JcrPackageEditFacade; +import ai.typerefinery.websight.repository.JcrPackageUtil; +import ai.typerefinery.websight.repository.RepositoryUtil; +import ai.typerefinery.websight.utils.git.GitConfig; +import ai.typerefinery.websight.utils.git.GitUtil; +import pl.ds.websight.rest.framework.RestAction; +import pl.ds.websight.rest.framework.RestActionResult; +import pl.ds.websight.rest.framework.annotations.PrimaryTypes; +import pl.ds.websight.rest.framework.annotations.SlingAction; +// import pl.ds.websight.packagemanager.JcrPackageEditFacade; +// import pl.ds.websight.packagemanager.util.JcrPackageUtil; +import static ai.typerefinery.websight.actions.spaces.SpaceConfigModel.*; + +@SlingAction +@PrimaryTypes({ "ws:PagesSpace" }) +@Component +public class ImportSpaceRestAction extends AbstractSpacesRestAction + implements RestAction { + + private static final Logger LOG = LoggerFactory.getLogger(ImportSpaceRestAction.class); + + @Reference + private Packaging packaging; + + @Reference + private JobManager jobManager; + + RestActionResult execute(SpacesRestModel model, List resources) { + + // publish pages and assets recursively + boolean iBackup = model.getBackup(); + + // this would only run on one space + for (Resource resource : resources) { + + try { + + // get space config + SpaceConfigModel spaceConfig = SpaceUtil.getSpaceConfig(resource); + + if (StringUtils.isNotBlank(spaceConfig.repositoryUrl)) { + // get environment variable GIT_CONTENT_ROOT + String contentRootPath = System.getenv(DEFAULT_GIT_CONTENT_ROOT_ENV_VAR); + if (StringUtils.isBlank(contentRootPath)) { + contentRootPath = DEFAULT_LOCAL_CONTENT_ROOT_PATH; + } + + // create new folder docroot/content/github/ + Path contentSpacePath = Paths.get(contentRootPath,DEFAULT_LOCAL_PATH,spaceConfig.getGitProvider(), resource.getName()); + contentSpacePath.toFile().mkdirs(); + + // get content to import from git repo if repository url is not blank + if (StringUtils.isNotBlank(spaceConfig.repositoryUrl)) { + // push to git + GitConfig gitConfig = null; + try { + // create git config object + gitConfig = new GitConfig( + spaceConfig.repositoryUrl, + contentSpacePath, + spaceConfig.branchContent, + spaceConfig.token, + spaceConfig.configEmail, + spaceConfig.configUsername + ); + + // get git object + GitUtil.initializeGit(gitConfig, true); + + // push to git remote + GitUtil.pull(gitConfig, null); + + } catch (Exception ex) { + // TODO Auto-generated catch block + ex.printStackTrace(); + return RestActionResult.failure("Failed", MessageFormat.format("Error while exporting to github, {}", ex.getMessage())); + } + } else { + LOG.error("Repository URL is blank, not exporting to github."); + } + + // backup current content to package if backup is true + if (iBackup && packaging != null) { + Session session = resource.getResourceResolver().adaptTo(Session.class); + if (session == null) { + LOG.warn("Could not get session from resource resolver"); + return RestActionResult.failure("Failed", "Could not get session from resource resolver"); + } + JcrPackageManager packageManager = this.packaging.getPackageManager(session); + if (packageManager == null) { + LOG.warn("Could not get package manager"); + return RestActionResult.failure("Failed", "Could not get package manager"); + } + String packageGroup = DEFAULT_PACKAGE_GROUP; + String packageName = DEFAULT_PACKAGE_PREFIX + resource.getName() + "-" + System.currentTimeMillis(); + String packageVersion = DEFAULT_PACKAGE_VERSION; + JcrPackage createdPackage = packageManager.create(packageGroup, packageName, packageVersion); + if (createdPackage == null) { + LOG.warn("Could not create package"); + return RestActionResult.failure("Failed", "Could not create package"); + } + try { + JcrPackageEditFacade editFacade = JcrPackageEditFacade.forPackage(createdPackage); + if (editFacade == null) { + LOG.warn("Could not access definition after creating a package: {}", JcrPackageUtil.getSimplePackageName(packageName, packageVersion)); + if (createdPackage != null) { + createdPackage.close(); + } + return RestActionResult.failure("Failed", MessageFormat.format("Error exporting space, package '{0}' has been created, but could not save details.", packageName)); + } + List filters = new ArrayList<>(); + filters.add(new PathFilterSet(resource.getPath())); + editFacade.setFilters(filters); + + editFacade.setAcHandling(AccessControlHandling.IGNORE); + editFacade.setRequiresRestart(false); + editFacade.setDependencies(new ArrayList<>(0)); + session.save(); + + packageManager.assemble(createdPackage, null); + + } catch (Exception e) { + LOG.error("Error creating package", e); + return RestActionResult.failure("Failed", MessageFormat.format("Error creating space, package '{0}' has been created, but could not be built.", packageName)); + } + + } + + // import content from disk to jcr + RepositoryUtil.jcrImport(resource.getResourceResolver(), contentSpacePath.toString(), resource.getPath(), true); + + return RestActionResult.success("Success", "Space exported successfully."); + } else { + LOG.error("Repository URL is blank, not exporting to github."); + return RestActionResult.failure("Failed", "Please configure space with Git config."); + } + + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return RestActionResult.failure("Failed", "Error exporting space."); + } + + } + + return RestActionResult.failure("Failed", "Could not export space."); + } + + private RestActionResult getSuccessResult(int assetsCount) { + String message = "Publishing requested"; + String messageDetails = String.format("Publishing requested successfully for %d %s", + new Object[] { Integer.valueOf(assetsCount), + (assetsCount == 1) ? "asset" : "assets" }); + return RestActionResult.success(message, messageDetails); + } + + String getFailureMessage(SpacesRestModel model) { + return "Error while requesting publishing"; + } +} \ No newline at end of file diff --git a/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/PublishSpaceRestAction.java b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/PublishSpaceRestAction.java index f5db66850..51f04296d 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/PublishSpaceRestAction.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/actions/spaces/rest/PublishSpaceRestAction.java @@ -1,6 +1,5 @@ package ai.typerefinery.websight.actions.spaces.rest; -import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; import java.text.MessageFormat; @@ -17,12 +16,8 @@ import org.apache.jackrabbit.JcrConstants; import org.apache.jackrabbit.api.security.user.Authorizable; import org.apache.jackrabbit.api.security.user.UserManager; -import org.apache.jackrabbit.core.TransactionException; import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ValueMap; -import org.eclipse.jgit.api.Git; -import org.eclipse.jgit.api.errors.GitAPIException; -import org.eclipse.jgit.api.errors.JGitInternalException; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; import org.slf4j.Logger; @@ -38,6 +33,7 @@ import pl.ds.websight.rest.framework.RestActionResult; import pl.ds.websight.rest.framework.annotations.PrimaryTypes; import pl.ds.websight.rest.framework.annotations.SlingAction; +import static ai.typerefinery.websight.actions.spaces.SpaceConfigModel.*; import org.apache.sling.jcr.base.util.AccessControlUtil; @@ -48,12 +44,6 @@ public class PublishSpaceRestAction extends AbstractSpacesRestAction { private static final Logger LOG = LoggerFactory.getLogger(PublishSpaceRestAction.class); - - public static final String PAGES_SPACE_RESOURCE_TYPE = "typerefinery/components/structure/pagesspace"; - public static final String ASSEPS_SPACE_RESOURCE_TYPE = "typerefinery/components/structure/assetsspace"; - - public static final String DEFAULT_GIT_USER_NAME = "typerefinery"; - public static final String DEFAULT_GIT_USER_EMAIL = "deploy@typerefinery.ai"; @Reference private PublishService publishService; @@ -232,6 +222,9 @@ RestActionResult execute(SpacesRestModel model, List resources) // get environment variable PUBLISH_DOCROOT String docrootPath = System.getenv("PUBLISH_DOCROOT"); + if (StringUtils.isBlank(docrootPath)) { + docrootPath = "docroot"; + } // create new folder docroot/deploy/githuib/ Path publishPagesPath = Paths.get(docrootPath,"deploy","github", resource.getName()); From 3015276328c31aff299d9ab2f29a043ec73e3b12 Mon Sep 17 00:00:00 2001 From: wildone Date: Tue, 30 Jan 2024 00:27:52 +1100 Subject: [PATCH 013/206] update url suffix to have double brackets. --- .../ai/typerefinery/websight/services/flow/FlowService.java | 2 +- .../typerefinery-showcase/pages/components/forms/.content.xml | 4 ++-- .../pages/forms/connection/delete/.content.xml | 4 ++-- .../pages/forms/connection/edit/.content.xml | 4 ++-- .../pages/forms/project/delete/.content.xml | 4 ++-- .../pages/forms/project/edit/.content.xml | 4 ++-- .../pages/forms/query/delete/.content.xml | 4 ++-- .../typerefinery-showcase/pages/forms/query/edit/.content.xml | 4 ++-- .../pages/forms/theme/delete/.content.xml | 4 ++-- .../typerefinery-showcase/pages/forms/theme/edit/.content.xml | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/services/flow/FlowService.java b/application/backend/src/main/java/ai/typerefinery/websight/services/flow/FlowService.java index b71ce5b21..54174fec0 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/services/flow/FlowService.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/services/flow/FlowService.java @@ -109,7 +109,7 @@ public class FlowService { public static final String FLOW_TEMPLATE_FIELD_TMS_TOPIC = ""; // flow step tms topic, used for filtering and wrapping payloads for TMS Payload messages public static final String FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL = ""; // used to specify which http route flow will use if any, eg form get url to be used /form/* will be updated to the {page URL}/* - public static final String FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_SUFFIX = "/{id}"; // used to prefix http route url, eg form get url to be used /form/{id} will be updated to the {page URL}/{id}, this will allow client to substitiute the id in the url + public static final String FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_SUFFIX = "/{{id}}"; // used to prefix http route url, eg form get url to be used /form/{{id}} will be updated to the {page URL}/{{id}}, this will allow client to substitiute the id in the url public static final String FLOW_DEFAULT_TITLE_SUFFIX = " flow"; // used to generate flow title if not specified, flow title will be {page title} flow diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/.content.xml index a5b713265..390a4bf2e 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/.content.xml @@ -18,9 +18,9 @@ sling:resourceType="typerefinery/components/forms/form" writePayloadType="application/json" writeMethod="POST" - writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/{id}" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/{{id}}" readMethod="GET" - readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/{id}"> + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/{{id}}"> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/delete/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/delete/.content.xml index 875a33617..84d4d5ae0 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/delete/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/delete/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/connection/{id}" + readUrl="https://api.typerefinery.localhost:8101/datastore/connection/{{id}}" writeMethod="DELETE" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/connection/{id}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/connection/{{id}}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/edit/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/edit/.content.xml index be54c5f2f..42f68458f 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/edit/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/edit/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/connection/{id}" + readUrl="https://api.typerefinery.localhost:8101/datastore/connection/{{id}}" writeMethod="PUT" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/connection/{id}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/connection/{{id}}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/delete/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/delete/.content.xml index 7b80ba6bb..cfa33b14d 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/delete/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/delete/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/project/{id}" + readUrl="https://api.typerefinery.localhost:8101/datastore/project/{{id}}" writeMethod="DELETE" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/project/{id}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/project/{{id}}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/edit/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/edit/.content.xml index 26a48ba63..18cc299be 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/edit/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/edit/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/project/{id}" + readUrl="https://api.typerefinery.localhost:8101/datastore/project/{{id}}" writeMethod="PUT" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/project/{id}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/project/{{id}}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/delete/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/delete/.content.xml index b98a4d1c1..1e79d77bf 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/delete/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/delete/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/query/{id}" + readUrl="https://api.typerefinery.localhost:8101/datastore/query/{{id}}" writeMethod="DELETE" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/query/{id}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/query/{{id}}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/edit/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/edit/.content.xml index 0784ce026..42e1ac2e1 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/edit/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/edit/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/query/{id}" + readUrl="https://api.typerefinery.localhost:8101/datastore/query/{{id}}" writeMethod="PUT" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/query/{id}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/query/{{id}}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/delete/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/delete/.content.xml index 5f66c2bf0..fba8d8543 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/delete/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/delete/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/theme/{id}" + readUrl="https://api.typerefinery.localhost:8101/datastore/theme/{{id}}" writeMethod="DELETE" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/theme/{id}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/theme/{{id}}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/edit/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/edit/.content.xml index ab3005965..f71543030 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/edit/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/edit/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/theme/{id}" + readUrl="https://api.typerefinery.localhost:8101/datastore/theme/{{id}}" writeMethod="PUT" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/theme/{id}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/theme/{{id}}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" From 4038171b3da3862328751d9602e5700bb8a9e6a5 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 30 Jan 2024 00:28:21 +1100 Subject: [PATCH 014/206] fix namespace. --- .../components/widgets/security/stix/clientlibs/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/functions.js index 47649a0f7..b0e935422 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/functions.js @@ -2,7 +2,7 @@ window.Typerefinery = window.Typerefinery || {}; window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Widgets = Typerefinery.Components.Widgets || {}; window.Typerefinery.Components.Widgets.Security = Typerefinery.Components.Widgets.Security || {}; -window.Typerefinery.Components.Widgets.Security.Stix = Typerefinery.Components.Widgets.Chart.Stix || {}; +window.Typerefinery.Components.Widgets.Security.Stix = Typerefinery.Components.Widgets.Security.Stix || {}; window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; From 8e7ede35f4347c45c77860ab80b7dee56e7c3bb1 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 30 Jan 2024 00:33:39 +1100 Subject: [PATCH 015/206] fix regex replace to remove params if not found. --- .../components/clientlibs/clientlibs-header/components.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js index 64e80179d..f5b91f052 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js @@ -15,7 +15,10 @@ window.Typerefinery.VueData = Typerefinery.VueData || {}; }; ns.replaceRegex = (str, obj) => { return str.replace(/{{(\w+)}}/gm, function(match, key) { - return obj[key]; + if (!obj.hasOwnProperty(key)) { + console.warn(`replaceRegex: ${key} is not defined in the data object, ignoring...`); + } + return obj[key] || ""; }); }; ns.queryToObject = (query) => { From c09b8dac731a4afdaabe9e707d9c6c8a93557731 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 30 Jan 2024 02:47:48 +1100 Subject: [PATCH 016/206] add helper function. --- .../components/clientlibs/clientlibs-header/components.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js index f5b91f052..380808985 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js @@ -13,6 +13,9 @@ window.Typerefinery.VueData = Typerefinery.VueData || {}; ns.getComponentConfig = ($component) => { return $($component).data('model') || {}; }; + ns.hasRegex = (str) => { + return str.match(/{{(\w+)}}/gm); + }; ns.replaceRegex = (str, obj) => { return str.replace(/{{(\w+)}}/gm, function(match, key) { if (!obj.hasOwnProperty(key)) { From 4059aabc84ff3f2a16c8fbd05907b2e647a03838 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 30 Jan 2024 03:59:37 +1100 Subject: [PATCH 017/206] ensure forms submission works. --- .../forms/form/clientlibs/functions.js | 103 ++++++++++++++---- 1 file changed, 79 insertions(+), 24 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index c8b0e423e..07c9c1fb6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -34,7 +34,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; 'accept': 'application/json', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS' - } + }, + redirect: 'follow' } ); } @@ -55,7 +56,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; 'accept': 'application/json', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS' - } + }, + redirect: 'follow' }, ); // REMOVE LOADER @@ -127,32 +129,81 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; }; ns.submit = async (url, method, payloadType, body, successCallback = () => { }, errorCallback = () => { }) => { + console.log("---------------SUBMIT----------------") + console.log([url, method, payloadType, body]) + let controller = new AbortController(); try { - const response = await fetch( - url, - { - method: method, - headers: { - "Content-Type": payloadType - }, - body - } - ); - // if status is 200 to 299 then it will call success callback. - if (response.status >= 200 && response.status <= 299) { - successCallback(); - } else { - console.log("Error in submitting the request"); - console.error(response); - errorCallback(); - } - return; + + await fetch('https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/create-user/_jcr_content/rootcontainer/form', { + method: method || 'POST', + headers: { + 'Content-Type': payloadType || 'application/x-www-form-urlencoded' + }, + body: body, + keepalive: true, + redirect: 'follow', + signal: controller.signal + }) + .then(res => res.json()) + .then(res => { + console.log("---------------SUBMITED RESPONSE----------------") + console.log(res) + successCallback() + }); + + + // const [submitResponse] = await Promise.all([ + // fetch( + // url, + // { + // method: method || "POST", + // mode: 'no-cors', + // headers: { + // "Content-Type": payloadType || "application/x-www-form-urlencoded" + // }, + // cache: 'no-cache', + // body: body, + // keepalive: true, + // redirect: 'follow', + // signal: controller.signal + // } + // ) + // ]); + // // const response = await fetch( + // // url, + // // { + // // method: method || "POST", + // // mode: 'no-cors', + // // headers: { + // // "Content-Type": payloadType || "application/x-www-form-urlencoded" + // // }, + // // body: body, + // // keepalive: true, + // // redirect: 'follow', + // // signal: controller.signal + // // } + // // ); + // var responseJson = await submitResponse.json(); + // // console.log(json); + // // var text = await response.text(); + // console.log(responseJson); + // // if status is 200 to 299 then it will call success callback. + // if (submitResponse.status >= 200 && submitResponse.status <= 299) { + // successCallback(); + // } else { + // console.log("Error in submitting the request"); + // console.error(submitResponse); + // errorCallback(); + // } + // return; } catch (error) { console.log("Error in submitting the request"); console.error(error); errorCallback(); return; } + controller = null; + return; }; ns.successCallback = () => { @@ -172,12 +223,12 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; }; ns.formRequest = async (url, componentConfig, payload) => { - const { payloadType, writeMethod } = componentConfig; + const { writePayloadType, writeMethod } = componentConfig; const formData = new URLSearchParams(); Object.entries(payload).map(item => { formData.append(item[0], item[1]) }); - await ns.submit(url, writeMethod, payloadType, formData.toString(), ns.successCallback, ns.errorCallback); + await ns.submit(url, writeMethod, writePayloadType, formData.toString(), ns.successCallback, ns.errorCallback); }; ns.updateButtonState = ($component, state) => { @@ -193,6 +244,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.formSubmitHandler = async ($component) => { const componentConfig = componentNs.getComponentConfig($component); + console.log(["componentConfig", componentConfig]) let { writePayloadType, writeMethod, writeUrl } = componentConfig; if (!writePayloadType || !writeMethod || !writeUrl) { console.log("Author should fill all the parameters."); @@ -227,7 +279,9 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; method: readMethod || "GET", headers: { "Content-Type": readPayloadType || "application/json" - } + }, + keepalive: true, + redirect: 'follow' } ).then(response => response.json()); @@ -322,6 +376,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log("---------------SUBMITTING----------------") e.preventDefault(); const { target } = e; + console.log(target) ns.formSubmitHandler(target); }); }; From 702e3f1848e16d5e1b1840f198e48f33c23877f0 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 30 Jan 2024 23:20:11 +1100 Subject: [PATCH 018/206] use sdubmit url for form writing. --- .../typerefinery/components/forms/form/clientlibs/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index 07c9c1fb6..7a4d11b1e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -134,7 +134,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; let controller = new AbortController(); try { - await fetch('https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/create-user/_jcr_content/rootcontainer/form', { + await fetch(url, { method: method || 'POST', headers: { 'Content-Type': payloadType || 'application/x-www-form-urlencoded' From 498527f7bd644e00e31b47c8cc690688153e4129 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 29 Feb 2024 01:06:06 +1100 Subject: [PATCH 019/206] add helper aria dialog. --- .../components/dialog/tabs/aria/.content.json | 255 ++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json new file mode 100644 index 000000000..aaac45dfb --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json @@ -0,0 +1,255 @@ +{ + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Aria", + "ariaAttributes": { + "name": "ariaAttributes", + "label": "Aria Attributes", + "sling:resourceType": "wcm/dialogs/components/multifield", + "ws:disallowedContext": ["edit:panel"], + "attirbuteSelect": { + "sling:resourceType": "wcm/dialogs/components/select", + "name": "attirbuteSelect", + "label": "Attribute", + "default": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Other", + "value": "" + }, + "ariaAutocomplete": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Auto Complete", + "value": "aria-autocomplete" + }, + "ariaChecked": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Checked", + "value": "aria-checked" + }, + "ariaDisabled": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Disabled", + "value": "aria-disabled" + }, + "ariaExpanded": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Expanded", + "value": "aria-expanded" + }, + "ariaHaspopup": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Has Popup", + "value": "aria-haspopup" + }, + "ariaHidden": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Hidden", + "value": "aria-hidden" + }, + "ariaInvalid": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Invalid", + "value": "aria-invalid" + }, + "ariaLabel": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Label", + "value": "aria-label" + }, + "ariaLevel": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Level", + "value": "aria-level" + }, + "ariaModal": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Modal", + "value": "aria-modal" + }, + "ariaMultiline": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Multi Line", + "value": "aria-multiline" + }, + "ariaMultiselectable": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Multi Selectable", + "value": "aria-multiselectable" + }, + "ariaOrientation": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Orientation", + "value": "aria-orientation" + }, + "ariaPressed": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Pressed", + "value": "aria-pressed" + }, + "ariaReadonly": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Read Only", + "value": "aria-readonly" + }, + "ariaRequired": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Required", + "value": "aria-required" + }, + "ariaSelected": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Selected", + "value": "aria-selected" + }, + "ariaSort": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Sort", + "value": "aria-sort" + }, + "ariaValuemax": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Value Max", + "value": "aria-valuemax" + }, + "ariaValuemin": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Value Min", + "value": "aria-valuemin" + }, + "ariaValuenow": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Value Now", + "value": "aria-valuenow" + }, + "ariaValuetext": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Value Text", + "value": "aria-valuetext" + }, + "ariaBusy": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Live Region - Busy", + "value": "aria-busy" + }, + "ariaLive": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Live Region - Live", + "value": "aria-live" + }, + "ariaRelevant": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Live Region - Relevant", + "value": "aria-relevant" + }, + "ariaAtomic": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Live Region - Atomic", + "value": "aria-atomic" + }, + "ariaDropeffect": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Drag and Drop - Drop Effect", + "value": "aria-dropeffect" + }, + "ariaGrabbed": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Drag and Drop - Grabbed", + "value": "aria-grabbed" + }, + "ariaActivedescendant": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Active Descendant", + "value": "aria-activedescendant" + }, + "ariaColcount": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Column Count", + "value": "aria-colcount" + }, + "ariaColindex": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Column Index", + "value": "aria-colindex" + }, + "ariaColspan": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Column Span", + "value": "aria-colspan" + }, + "ariaControls": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Controls", + "value": "aria-controls" + }, + "ariaDescribedby": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Described By", + "value": "aria-describedby" + }, + "ariaDescription": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Description", + "value": "aria-description" + }, + "ariaDetails": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Details", + "value": "aria-details" + }, + "ariaErrormessage": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Error Message", + "value": "aria-errormessage" + }, + "ariaFlowto": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Flow To", + "value": "aria-flowto" + }, + "ariaLabelledby": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Labelled By", + "value": "aria-labelledby" + }, + "ariaOwns": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Owns", + "value": "aria-owns" + }, + "ariaPosinset": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Position in Set", + "value": "aria-posinset" + }, + "ariaRowcount": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Row Count", + "value": "aria-rowcount" + }, + "ariaRowindex": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Row Index", + "value": "aria-rowindex" + }, + "ariaRowspan": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Row Span", + "value": "aria-rowspan" + }, + "ariaSetsize": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Relationships - Set Size", + "value": "aria-setsize" + } + }, + "attirbuteName": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "attirbuteName", + "label": "Name (other optional)" + }, + "attirbuteValue": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "attirbuteValue", + "label": "Value" + } + } +} From 85289fcfdd2f05b8d1e66249176a689c81a22461 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 29 Feb 2024 01:06:22 +1100 Subject: [PATCH 020/206] add helper image dialog. --- .../dialog/tabs/image/.content.json | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/image/.content.json diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/image/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/image/.content.json new file mode 100644 index 000000000..e9f6c2b5a --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/image/.content.json @@ -0,0 +1,51 @@ +{ + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Image", + "lgImageSrc": { + "sling:resourceType": "wcm/dialogs/components/assetreference", + "mimeTypes": ["image/*"], + "name": "lgImageSrc", + "description": "L breakpoint image will be used also on smaller screens if only this source is provided", + "label": "Choose image - L breakpoint" + }, + "mdImageSrc": { + "sling:resourceType": "wcm/dialogs/components/assetreference", + "mimeTypes": ["image/*"], + "name": "mdImageSrc", + "label": "Choose image - M breakpoint" + }, + "smImageSrc": { + "sling:resourceType": "wcm/dialogs/components/assetreference", + "mimeTypes": ["image/*"], + "name": "smImageSrc", + "label": "Choose image - S breakpoint" + }, + "alt": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "alt", + "label": "Alt text" + }, + "showLink": { + "sling:resourceType": "wcm/dialogs/components/toggle", + "name": "showLink", + "label": "Link" + }, + "container": { + "sling:resourceType": "wcm/dialogs/components/container", + "url": { + "sling:resourceType": "wcm/dialogs/components/pathpicker", + "rootPath": "/content", + "name": "url", + "label": "URL" + }, + "openInNewTab": { + "sling:resourceType": "wcm/dialogs/components/toggle", + "name": "openInNewTab", + "label": "Open link in a new tab" + }, + "ws:display": {"condition": { + "sourceName": "showLink", + "values": true + }} + } +} From 5b3caa13724b9ce6aad72255b89bfd1256250bed Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 29 Feb 2024 01:20:03 +1100 Subject: [PATCH 021/206] add role to aria dialog. --- .../components/dialog/tabs/aria/.content.json | 270 ++++++++++++++++++ 1 file changed, 270 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json index aaac45dfb..9e9fee150 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json @@ -1,6 +1,276 @@ { "sling:resourceType": "wcm/dialogs/components/tab", "label": "Aria", + "roleOther": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "roleOther", + "label": "Role Value (other)" + }, + "roleSelect": { + "sling:resourceType": "wcm/dialogs/components/select", + "name": "attirbuteSelect", + "label": "Role Select", + "default": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Other", + "value": "" + }, + "documentToolbar": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Document - Toolbar", + "value": "toolbar" + }, + "documentTooltip": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Document - Tooltip", + "value": "tooltip" + }, + "documentFeed": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Document - Feed", + "value": "feed" + }, + "documentMath": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Document - Math", + "value": "math" + }, + "documentPresentation": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Document - Presentation", + "value": "presentation" + }, + "documentNote": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Document - Note", + "value": "note" + }, + "documentDirectory": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Document - Directory", + "value": "directory" + }, + "documentDocument": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Document - Document", + "value": "document" + }, + "documentGroup": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Document - Group", + "value": "group" + }, + "widgetScrollbar": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Scrollbar", + "value": "scrollbar" + }, + "widgetSearchbox": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Searchbox", + "value": "searchbox" + }, + "widgetSeparator": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Separator", + "value": "separator" + }, + "widgetSlider": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Slider", + "value": "slider" + }, + "widgetSpinbutton": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Spinbutton", + "value": "spinbutton" + }, + "widgetSwitch": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Switch", + "value": "switch" + }, + "widgetTab": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Tab", + "value": "tab" + }, + "widgetTabPanel": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Tab Panel", + "value": "tabpanel" + }, + "widgetTreeitem": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Widget - Treeitem", + "value": "treeitem" + }, + "compositeCombobox": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Composite - Combobox", + "value": "combobox" + }, + "compositeMenu": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Composite - Menu", + "value": "menu" + }, + "compositeMenubar": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Composite - Menubar", + "value": "menubar" + }, + "compositeTablist": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Composite - Tablist", + "value": "tablist" + }, + "compositeTree": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Composite - Tree", + "value": "tree" + }, + "compositeTreeGrid": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Composite - Tree Grid", + "value": "treegrid" + }, + "landmarkBanner": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Landmark - Banner", + "value": "banner" + }, + "landmarkComplementary": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Landmark - Complementary", + "value": "complementary" + }, + "landmarkContentinfo": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Landmark - Contentinfo", + "value": "contentinfo" + }, + "landmarkForm": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Landmark - Form", + "value": "form" + }, + "landmarkMain": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Landmark - Main", + "value": "main" + }, + "landmarkNavigation": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Landmark - Navigation", + "value": "navigation" + }, + "landmarkRegion": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Landmark - Region", + "value": "region" + }, + "landmarkSearch": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Landmark - Search", + "value": "search" + }, + "liveRegionAlert": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Live Region - Alert", + "value": "alert" + }, + "liveRegionLog": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Live Region - Log", + "value": "log" + }, + "liveRegionMarquee": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Live Region - Marquee", + "value": "marquee" + }, + "liveRegionStatus": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Live Region - Status", + "value": "status" + }, + "liveRegionTimer": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Live Region - Timer", + "value": "timer" + }, + "windowAlertdialog": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Window - Alertdialog", + "value": "alertdialog" + }, + "windowDialog": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Window - Dialog", + "value": "dialog" + }, + "abstractCommand": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Abstract - Command", + "value": "command" + }, + "abstractComposite": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Abstract - Composite", + "value": "composite" + }, + "abstractInput": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Abstract - Input", + "value": "input" + }, + "abstractLandmark": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Abstract - Landmark", + "value": "landmark" + }, + "abstractRange": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Abstract - Range", + "value": "range" + }, + "abstractRoletype": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Abstract - Roletype", + "value": "roletype" + }, + "abstractSection": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Abstract - Section", + "value": "section" + }, + "abstractSectionhead": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Abstract - Sectionhead", + "value": "sectionhead" + }, + "abstractSelect": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Abstract - Select", + "value": "select" + }, + "abstractStructure": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Abstract - Structure", + "value": "structure" + }, + "abstractWidget": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Abstract - Widget", + "value": "widget" + }, + "abstractWindow": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Abstract - Window", + "value": "window" + } + }, "ariaAttributes": { "name": "ariaAttributes", "label": "Aria Attributes", From 4b64174e009dc39c3919b9208e94248576638674 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 29 Feb 2024 01:21:25 +1100 Subject: [PATCH 022/206] rename components. --- application/frontend/src/components/details/_index.scss | 4 ---- application/frontend/src/components/index.scss | 2 +- application/frontend/src/components/list/_index.scss | 2 +- .../src/components/list/{page-list.scss => list.scss} | 2 +- application/frontend/src/components/teaser/_index.scss | 4 ++++ .../page-details-default.scss => teaser/teaser-default.scss} | 2 +- .../page-details-hover.scss => teaser/teaser-hover.scss} | 4 ++-- .../page-details-oblique.scss => teaser/teaser-oblique.scss} | 4 ++-- .../{details/page-details.scss => teaser/teaser.scss} | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 application/frontend/src/components/details/_index.scss rename application/frontend/src/components/list/{page-list.scss => list.scss} (95%) create mode 100644 application/frontend/src/components/teaser/_index.scss rename application/frontend/src/components/{details/page-details-default.scss => teaser/teaser-default.scss} (96%) rename application/frontend/src/components/{details/page-details-hover.scss => teaser/teaser-hover.scss} (96%) rename application/frontend/src/components/{details/page-details-oblique.scss => teaser/teaser-oblique.scss} (92%) rename application/frontend/src/components/{details/page-details.scss => teaser/teaser.scss} (89%) diff --git a/application/frontend/src/components/details/_index.scss b/application/frontend/src/components/details/_index.scss deleted file mode 100644 index 1aed3f2d5..000000000 --- a/application/frontend/src/components/details/_index.scss +++ /dev/null @@ -1,4 +0,0 @@ -@forward 'page-details'; -@forward 'page-details-default'; -@forward 'page-details-oblique'; -@forward 'page-details-hover'; diff --git a/application/frontend/src/components/index.scss b/application/frontend/src/components/index.scss index 3a6c25e46..a75f50ac4 100644 --- a/application/frontend/src/components/index.scss +++ b/application/frontend/src/components/index.scss @@ -1,5 +1,5 @@ @import './utils/index'; -@import './details/index'; +@import './teaser/index'; @import './layout/index'; @import './list/index'; \ No newline at end of file diff --git a/application/frontend/src/components/list/_index.scss b/application/frontend/src/components/list/_index.scss index afeaeb3ea..6ec2dd3a1 100644 --- a/application/frontend/src/components/list/_index.scss +++ b/application/frontend/src/components/list/_index.scss @@ -1 +1 @@ -@forward 'page-list'; +@forward 'list'; diff --git a/application/frontend/src/components/list/page-list.scss b/application/frontend/src/components/list/list.scss similarity index 95% rename from application/frontend/src/components/list/page-list.scss rename to application/frontend/src/components/list/list.scss index e61801381..e059f85d0 100644 --- a/application/frontend/src/components/list/page-list.scss +++ b/application/frontend/src/components/list/list.scss @@ -1,4 +1,4 @@ -[component="page-list"] { +[component="list"] { .card { overflow: hidden; } diff --git a/application/frontend/src/components/teaser/_index.scss b/application/frontend/src/components/teaser/_index.scss new file mode 100644 index 000000000..9d61e5e19 --- /dev/null +++ b/application/frontend/src/components/teaser/_index.scss @@ -0,0 +1,4 @@ +@forward 'teaser'; +@forward 'teaser-default'; +@forward 'teaser-oblique'; +@forward 'teaser-hover'; diff --git a/application/frontend/src/components/details/page-details-default.scss b/application/frontend/src/components/teaser/teaser-default.scss similarity index 96% rename from application/frontend/src/components/details/page-details-default.scss rename to application/frontend/src/components/teaser/teaser-default.scss index 2a111d3c8..ca3113a2f 100644 --- a/application/frontend/src/components/details/page-details-default.scss +++ b/application/frontend/src/components/teaser/teaser-default.scss @@ -8,7 +8,7 @@ } /* namespace for this component */ -[component="page-details"].default { +[component="teaser"].default { @include root; diff --git a/application/frontend/src/components/details/page-details-hover.scss b/application/frontend/src/components/teaser/teaser-hover.scss similarity index 96% rename from application/frontend/src/components/details/page-details-hover.scss rename to application/frontend/src/components/teaser/teaser-hover.scss index aceb00ba4..45b4ace3a 100644 --- a/application/frontend/src/components/details/page-details-hover.scss +++ b/application/frontend/src/components/teaser/teaser-hover.scss @@ -1,4 +1,4 @@ -@use 'page-details-default' as default; +@use 'teaser-default' as default; @use '~bootstrap/scss/bootstrap-utilities' as bs; @use "sass:map"; @use "../utils/index" as utils; @@ -18,7 +18,7 @@ $enable-shadows: true; display: flex; } -[component="page-details"].hover { +[component="teaser"].hover { @include default.root; diff --git a/application/frontend/src/components/details/page-details-oblique.scss b/application/frontend/src/components/teaser/teaser-oblique.scss similarity index 92% rename from application/frontend/src/components/details/page-details-oblique.scss rename to application/frontend/src/components/teaser/teaser-oblique.scss index fa9457e1f..789fbb9b5 100644 --- a/application/frontend/src/components/details/page-details-oblique.scss +++ b/application/frontend/src/components/teaser/teaser-oblique.scss @@ -1,6 +1,6 @@ -@use 'page-details-default' as default; +@use 'teaser-default' as default; -[component="page-details"].oblique { +[component="teaser"].oblique { @include default.root; diff --git a/application/frontend/src/components/details/page-details.scss b/application/frontend/src/components/teaser/teaser.scss similarity index 89% rename from application/frontend/src/components/details/page-details.scss rename to application/frontend/src/components/teaser/teaser.scss index 9d050cc39..71236a2eb 100644 --- a/application/frontend/src/components/details/page-details.scss +++ b/application/frontend/src/components/teaser/teaser.scss @@ -1,10 +1,10 @@ -[component="page-details"] { +[component="teaser"] { img { object-fit: cover; } } -[component="page-details"] { +[component="teaser"] { /* default positioning of items */ padding: 0; From fc7550ed8e37f8f6a437e26eaec6d61640f63fbd Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 29 Feb 2024 01:21:48 +1100 Subject: [PATCH 023/206] update new component examples. --- application/frontend/src/html/index.html | 147 +++++++++++++++-------- 1 file changed, 97 insertions(+), 50 deletions(-) diff --git a/application/frontend/src/html/index.html b/application/frontend/src/html/index.html index 13d970c06..eb2824fd3 100644 --- a/application/frontend/src/html/index.html +++ b/application/frontend/src/html/index.html @@ -8,11 +8,11 @@ <link rel="stylesheet" href="./main/main.css"> <!-- <link rel="stylesheet" href="src/style.css" /> --> - <!-- <link rel="stylesheet" href="src/page-details-default.scss" /> --> - <!-- <link rel="stylesheet" href="src/page-details-oblique.scss" /> --> - <!-- <link rel="stylesheet" href="src/page-details-oblique.css" /> --> - <!-- <link rel="stylesheet" href="src/page-details-hover.css" /> --> - <!-- <link rel="stylesheet" href="src/page-list.css" /> --> + <!-- <link rel="stylesheet" href="src/teaser-default.scss" /> --> + <!-- <link rel="stylesheet" href="src/teaser-oblique.scss" /> --> + <!-- <link rel="stylesheet" href="src/teaser-oblique.css" /> --> + <!-- <link rel="stylesheet" href="src/teaser-hover.css" /> --> + <!-- <link rel="stylesheet" href="src/list.css" /> --> <!-- <link rel="stylesheet" href="src/container.css" /> --> </head> </head> @@ -90,8 +90,8 @@ <!-- NAV END --> <main class="text-center"> - <!-- PAGE DETAILS START --> - <div component="page-details" class="oblique" role="banner"> + <!-- TEASER START --> + <div component="teaser" class="oblique" role="banner"> <div class="image d-none d-md-block"> <div class="picture-container"> <picture> @@ -108,11 +108,33 @@ <h1>Join us at our midyear Study Expo.</h1> </div> </div> </div> - <!-- PAGE DETAILS END --> + <!-- TEASER END --> <section> - <!-- PAGE DETAILS START --> - <div component="page-details" class="default" role="banner"> + <!-- TEASER START --> + <div component="teaser" class="oblique" role="banner"> + <div class="image d-none d-md-block"> + <div class="picture-container rounded-3"> + <picture> + <img alt="" data-sizes="auto" src="./assets/general/service.jpg" sizes="1407px"> + </picture> + </div> + </div> + <div class="container d-flex align-items-center justify-content-center"> + <div component="text"> + <h1>Join us at our midyear Study Expo.</h1> + <p>Tuesday 6 June, 4pm-6pm.</p> + <button type="button" class="btn btn-primary">Primary</button> + <button type="button" class="btn btn-secondary">Secondary</button> + </div> + </div> + </div> + <!-- TEASER END --> + </section> + + <section> + <!-- TEASER START --> + <div component="teaser" class="default" role="banner"> <div class="image d-none d-md-block"> <div class="picture-container"> <picture> @@ -122,19 +144,41 @@ <h1>Join us at our midyear Study Expo.</h1> </div> <div class="container d-flex align-items-center justify-content-center"> <div component="text"> - <h1>Page Details 1</h1> + <h1>Teaser 1</h1> + <p>Tuesday 6 June, 4pm-6pm.</p> + <button type="button" class="btn btn-primary">Primary</button> + <button type="button" class="btn btn-secondary">Secondary</button> + </div> + </div> + </div> + <!-- TEASER END --> + </section> + + <section> + <!-- TEASER START --> + <div component="teaser" class="default" role="banner"> + <div class="image d-none d-md-block"> + <div class="picture-container rounded-3"> + <picture> + <img alt="" data-sizes="auto" src="./assets/general/service.jpg" sizes="1407px"> + </picture> + </div> + </div> + <div class="container d-flex align-items-center justify-content-center"> + <div component="text"> + <h1>Teaser 1</h1> <p>Tuesday 6 June, 4pm-6pm.</p> <button type="button" class="btn btn-primary">Primary</button> <button type="button" class="btn btn-secondary">Secondary</button> </div> </div> </div> - <!-- PAGE DETAILS END --> + <!-- TEASER END --> </section> <section> - <!-- PAGE DETAILS START --> - <div component="page-details" class="hover" role="banner"> + <!-- TEASER START --> + <div component="teaser" class="hover" role="banner"> <div class="image "> <div class="picture-container"> <picture> @@ -144,19 +188,19 @@ <h1>Page Details 1</h1> </div> <div class="container d-flex align-items-center justify-content-center shadow rounded-2"> <div component="text"> - <h1>Page Details 2</h1> + <h1>Teaser 2</h1> <p>Tuesday 6 June, 4pm-6pm.</p> <button type="button" class="btn btn-primary">Primary</button> <button type="button" class="btn btn-secondary">Secondary</button> </div> </div> </div> - <!-- PAGE DETAILS END --> + <!-- TEASER END --> </section> <section> - <!-- PAGE DETAILS START --> - <div component="page-details" class="" role="banner"> + <!-- TEASER START --> + <div component="teaser" class="" role="banner"> <div class="image z-0"> <div class="picture-container position-absolute fixed-top h-100 w-100"> <picture> @@ -168,7 +212,7 @@ <h1>Page Details 2</h1> <div class="d-flex justify-content-center flex-column col-lg-7"> <div class="row d-flex align-items-center justify-content-center shadow-lg rounded-2 p-5 h-60 blur"> <div component="text"> - <h1>Page Details 3</h1> + <h1>Teaser 3</h1> <p>Image Full Size</p> <button type="button" class="btn btn-primary">Primary</button> <button type="button" class="btn btn-secondary">Secondary</button> @@ -177,12 +221,12 @@ <h1>Page Details 3</h1> </div> </div> </div> - <!-- PAGE DETAILS END --> + <!-- TEASER END --> </section> <section> - <!-- PAGE DETAILS START --> - <div component="page-details" class="" role="banner"> + <!-- TEASER START --> + <div component="teaser" class="" role="banner"> <div class="image z-0"> <div class="picture-container position-absolute fixed-top ms-auto w-sm-100 w-lg-50 rounded-2"> <picture> @@ -194,7 +238,7 @@ <h1>Page Details 3</h1> <div class="d-flex justify-content-center flex-column col-lg-7 "> <div class="row d-flex align-items-center justify-content-center shadow-lg rounded-2 p-5 h-60 blur"> <div component="text"> - <h1>Page Details 4</h1> + <h1>Teaser 4</h1> <p>Image Right</p> <button type="button" class="btn btn-primary">Primary</button> <button type="button" class="btn btn-secondary">Secondary</button> @@ -203,12 +247,12 @@ <h1>Page Details 4</h1> </div> </div> </div> - <!-- PAGE DETAILS END --> + <!-- TEASER END --> </section> <section> - <!-- PAGE DETAILS START --> - <div component="page-details" class="" role="banner"> + <!-- TEASER START --> + <div component="teaser" class="" role="banner"> <div class="image z-0"> <div class="picture-container position-absolute fixed-top w-sm-100 w-lg-50"> <picture> @@ -220,7 +264,7 @@ <h1>Page Details 4</h1> <div class="d-flex justify-content-center flex-column col-lg-7 offset-md-5"> <div class="row d-flex align-items-center justify-content-center shadow-lg rounded-2 p-5 h-60 blur"> <div component="text"> - <h1>Page Details 5</h1> + <h1>Teaser 5</h1> <p>Image Left</p> <button type="button" class="btn btn-primary">Primary</button> <button type="button" class="btn btn-secondary">Secondary</button> @@ -229,12 +273,12 @@ <h1>Page Details 5</h1> </div> </div> </div> - <!-- PAGE DETAILS END --> + <!-- TEASER END --> </section> <section> - <!-- PAGE DETAILS START --> - <div component="page-details" class="" role="banner"> + <!-- TEASER START --> + <div component="teaser" class="" role="banner"> <div class="image z-0"> <div class="picture-container position-absolute fixed-top w-100"> <picture> @@ -246,7 +290,7 @@ <h1>Page Details 5</h1> <div class="d-flex justify-content-center flex-column col-lg-12"> <div class="row d-flex align-items-center justify-content-center shadow-lg rounded-2 p-5 h-60 blur"> <div component="text"> - <h1>Page Details 6</h1> + <h1>Teaser 6</h1> <p>Full Width</p> <button type="button" class="btn btn-primary">Primary</button> <button type="button" class="btn btn-secondary">Secondary</button> @@ -255,12 +299,12 @@ <h1>Page Details 6</h1> </div> </div> </div> - <!-- PAGE DETAILS END --> + <!-- TEASER END --> </section> <section> - <!-- PAGE DETAILS START --> - <div component="page-details" class="" role="banner"> + <!-- TEASER START --> + <div component="teaser" class="" role="banner"> <div class="image z-0"> <div class="picture-container position-absolute fixed-top w-100 rounded-3"> <picture> @@ -272,7 +316,7 @@ <h1>Page Details 6</h1> <div class="d-flex justify-content-center flex-column col-lg-12"> <div class="row d-flex align-items-center justify-content-center shadow-lg rounded-2 p-5 mt-5 h-60 blur"> <div component="text"> - <h1>Page Details 6</h1> + <h1>Teaser 6</h1> <p>Full Width Rounded</p> <button type="button" class="btn btn-primary">Primary</button> <button type="button" class="btn btn-secondary">Secondary</button> @@ -281,13 +325,13 @@ <h1>Page Details 6</h1> </div> </div> </div> - <!-- PAGE DETAILS END --> + <!-- TEASER END --> </section> <section> - <!-- PAGE DETAILS START --> - <div component="page-details" class="oblique h-30rem" role="banner"> + <!-- TEASER START --> + <div component="teaser" class="oblique h-30rem" role="banner"> <div class="image z-0"> <div class="picture-container position-absolute fixed-top w-100 rounded-3"> <picture> @@ -299,7 +343,7 @@ <h1>Page Details 6</h1> <div class="d-flex justify-content-center flex-column col-lg-12"> <div class="row d-flex align-items-center justify-content-center shadow-lg rounded-2 p-5 mt-5 h-60 blur"> <div component="text"> - <h1>Page Details 7</h1> + <h1>Teaser 7</h1> <p>Full Width Rounded</p> <button type="button" class="btn btn-primary">Primary</button> <button type="button" class="btn btn-secondary">Secondary</button> @@ -308,13 +352,13 @@ <h1>Page Details 7</h1> </div> </div> </div> - <!-- PAGE DETAILS END --> + <!-- TEASER END --> </section> <section> - <!-- PAGE DETAILS START --> - <div component="page-details" class="oblique h-30rem rounded-3" role="banner"> + <!-- TEASER START --> + <div component="teaser" class="oblique h-30rem rounded-3" role="banner"> <div class="image z-0"> <div class="picture-container position-absolute fixed-top w-100 rounded-3"> <picture> @@ -326,7 +370,7 @@ <h1>Page Details 7</h1> <div class="d-flex justify-content-center flex-column col-lg-12"> <div class="row d-flex align-items-center justify-content-center shadow-lg rounded-2 p-5 mt-5 h-60 blur"> <div component="text"> - <h1>Page Details 8</h1> + <h1>Teaser 8</h1> <p>Full Width Rounded</p> <button type="button" class="btn btn-primary">Primary</button> <button type="button" class="btn btn-secondary">Secondary</button> @@ -335,18 +379,21 @@ <h1>Page Details 8</h1> </div> </div> </div> - <!-- PAGE DETAILS END --> + <!-- TEASER END --> </section> - + <section> + <div component="container" class="col-lg-6 col-md-6 col-sm-12 container-fluid center between"> + <div component="text"> + <h2>Our Services</h2> + <p>We're constantly trying to express ourselves and actualize our dreams. If you have the opportunity to play this game of life you need to appreciate every moment.</p> + </div> + </div> + </section> <!-- PAGE LIST START --> <section> - <div component="text"> - <h2>Our Services</h2> - <p>Test about our servicves</p> - </div> - <div component="page-list" class="container text-center"> + <div component="list" class="container text-center"> <div class="row align-items-end"> <div class="col"> From e2e29cb9dba80a8d7555252a334107c14119cce3 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 29 Feb 2024 01:40:23 +1100 Subject: [PATCH 024/206] update aria select to use generic attribute structure. --- .../components/dialog/tabs/aria/.content.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json index 9e9fee150..e8375d396 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json @@ -8,7 +8,7 @@ }, "roleSelect": { "sling:resourceType": "wcm/dialogs/components/select", - "name": "attirbuteSelect", + "name": "roleSelect", "label": "Role Select", "default": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", @@ -276,9 +276,9 @@ "label": "Aria Attributes", "sling:resourceType": "wcm/dialogs/components/multifield", "ws:disallowedContext": ["edit:panel"], - "attirbuteSelect": { + "select": { "sling:resourceType": "wcm/dialogs/components/select", - "name": "attirbuteSelect", + "name": "select", "label": "Attribute", "default": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", @@ -511,14 +511,14 @@ "value": "aria-setsize" } }, - "attirbuteName": { + "other": { "sling:resourceType": "wcm/dialogs/components/textfield", - "name": "attirbuteName", - "label": "Name (other optional)" + "name": "other", + "label": "Other" }, "attirbuteValue": { "sling:resourceType": "wcm/dialogs/components/textfield", - "name": "attirbuteValue", + "name": "value", "label": "Value" } } From f7a160a4c7c40a56ee70bb08b6fa11ed54a24322 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 29 Feb 2024 01:41:07 +1100 Subject: [PATCH 025/206] add helper attribute select model. --- .../components/AttributeSelectValue.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/models/components/AttributeSelectValue.java diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/AttributeSelectValue.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/AttributeSelectValue.java new file mode 100644 index 000000000..b0b2324b4 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/AttributeSelectValue.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 Typerefinery.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ai.typerefinery.websight.models.components; + +import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; + +import javax.inject.Inject; +import lombok.Getter; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Model; + +@Model(adaptables = Resource.class, defaultInjectionStrategy = OPTIONAL) +public class AttributeSelectValue { + + @Getter + @Inject + public String select; + + @Getter + @Inject + public String other; + + @Getter + @Inject + public String value; + +} From fae7c5b0881faedf9c743d82f9c1246c4bf509e5 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 29 Feb 2024 09:49:54 +1100 Subject: [PATCH 026/206] add embed component. --- .../components/content/embed/.content.json | 5 ++ .../content/embed/clientlibs/.content.json | 13 +++ .../content/embed/clientlibs/behaviour.js | 14 ++++ .../content/embed/clientlibs/functions.js | 64 ++++++++++++++ .../content/embed/dialog/.content.json | 83 +++++++++++++++++++ .../components/content/embed/embed.html | 34 ++++++++ .../content/embed/variants/iframe.html | 28 +++++++ .../content/embed/variants/source.html | 21 +++++ 8 files changed, 262 insertions(+) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/content/embed/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/behaviour.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/content/embed/dialog/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/content/embed/embed.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/content/embed/variants/iframe.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/content/embed/variants/source.html diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/.content.json new file mode 100644 index 000000000..e823f9f6b --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/.content.json @@ -0,0 +1,5 @@ +{ + "title": "Embed", + "group": "Typerefinery - Content", + "sling:resourceType": "ws:Component" +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/.content.json new file mode 100644 index 000000000..54674861c --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/.content.json @@ -0,0 +1,13 @@ +{ + "title": "Client Libs - Content - Embed", + "jcr:primaryType": "sling:Folder", + "sling:resourceType": "io/typerefinery/websight/clientlibs", + "categories": [ + "ai.typerefinery.websight.components", + "ai.typerefinery.websight.components.content.embed" + ], + "js": [ + "functions.js", + "behaviour.js" + ] +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/behaviour.js new file mode 100644 index 000000000..c4b017230 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/behaviour.js @@ -0,0 +1,14 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Content = Typerefinery.Components.Content || {}; +window.Typerefinery.Components.Content.Embed = Typerefinery.Components.Content.Embed || {}; + +(function (ns, document, window) { + "use strict"; + $(document).ready(function () { + console.log('Embed component Behaviour loaded'); + $('[component="embed"]').each(function () { + ns.init(this); + }); + }); +})(Typerefinery.Components.Content.Embed, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js new file mode 100644 index 000000000..9eb9264bc --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js @@ -0,0 +1,64 @@ +window.Typerefinery = window.Typerefinery || {}; +Typerefinery.Components = Typerefinery.Components || {}; +Typerefinery.Components.Content = Typerefinery.Components.Content || {}; +Typerefinery.Components.Content.Embed = Typerefinery.Components.Content.Embed || {}; +Typerefinery.Page = Typerefinery.Page || {}; +Typerefinery.Page.Events = Typerefinery.Page.Events || {}; + +(function (ns, componentNs, eventNs, document, window) { + "use strict"; + + ns.registerEvent = ($component, componentId, fieldName) => { + const key = `${componentId}-${fieldName}`; + eventNs.registerEvents(key, (data) => { + if(data.type === "LOAD_DATA") { + // get the first children and set the inner html. + const $firstChild = $component.children[0]; + const componentConfig = componentNs.getComponentConfig($component); + if (componentConfig.variant === "iframe") { + $component.find("iframe").attr("src", data.data.value); + } + } + }); + } + + ns.autoLoad = ($component) => { + // if autoResize is set to true, then register the autoResize event. + const componentConfig = componentNs.getComponentConfig($component); + if (componentConfig.autoResize) { + $iframe.on("load", function() { + ns.autoResize($component); + }); + } + } + + ns.autoResize = ($component) => { + if (!$component) { + return; + } + const $iframe = $component.find("iframe"); + //console.log(["autoResize", embedid, $iframe]); + var newHeight = $iframe.contents().height()+200; + var maxHeight = $iframe.attr("max-height"); + + // set new height to maxheight if its specified. + if (maxHeight && parseInt(maxHeight, 10)) { + if (parseInt(maxHeight, 10) < newHeight) { + newHeight = maxHeight; + } + } + //console.log(["autoResize newHeight", embedid, newHeight]); + $iframe.height(newHeight); + } + + ns.init = ($component) => { + // check if the component have a data attribute with the name "data-field-componentId" and "data-field-name" then register eventNs + const componentId = $component.getAttribute("data-field-componentId"); + const fieldName = $component.getAttribute("data-field-name"); + if (componentId && fieldName) { + ns.registerEvent($component, componentId, fieldName); + }; + ns.autoLoad($component); + } +} +)(Typerefinery.Components.Content.Embed, Typerefinery.Components, Typerefinery.Page.Events, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/dialog/.content.json new file mode 100644 index 000000000..4b4a95f32 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/dialog/.content.json @@ -0,0 +1,83 @@ +{ + "sling:resourceType": "wcm/dialogs/dialog", + "tabs": { + "sling:resourceType": "wcm/dialogs/components/tabs", + "generalTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "General", + "variant": { + "sling:resourceType": "wcm/dialogs/components/select", + "name": "variant", + "label": "Variant", + "default": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Source", + "value": "" + }, + "iframe": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "iFrame", + "value": "iframe" + } + }, + "variantiframe": { + "sling:resourceType": "wcm/dialogs/components/container", + "url": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "label": "Url", + "name": "url" + }, + "height": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "label": "Height", + "name": "height" + }, + "scrolling": { + "sling:resourceType": "wcm/dialogs/components/toggle", + "name": "scrolling", + "checkedValue": "yes", + "uncheckedValue": "no", + "label": "Scrolling", + "description": "Enable or disable scrolling in iFrame" + }, + "autoResize": { + "sling:resourceType": "wcm/dialogs/components/toggle", + "name": "autoResize", + "label": "Auto Resize to fit content", + "description": "On loading of content will resize iFrame to fit contents." + }, + + "ws:display": { + "condition": { + "sourceName": "variant", + "values": "iframe" + } + } + }, + "variantsource": { + "sling:resourceType": "wcm/dialogs/components/container", + "source": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "wcm/dialogs/components/textarea", + "name": "source", + "title": "Source", + "description": "Output plain HTML." + }, + "ws:display": { + "condition": { + "sourceName": "variant", + "values": "" + } + } + } + }, + "gridTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" + } + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/embed.html b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/embed.html new file mode 100644 index 000000000..42eb18f44 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/embed.html @@ -0,0 +1,34 @@ +<!--/* + Copyright (C) 2023 Typerefinery.io + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.content.Embed" + data-sly-set.templateVariant="${'./variants/{0}.html' @ format=model.variant}" + data-sly-set.templateDefault="${'./variants/source.html'}" + data-sly-set.template="${model.variant ? templateVariant : templateDefault}" +> + <div + component="${model.componentName}" + class="${model.componentClassNames}" + id="${model.id}" + data-model="${model.jsonString}" + > + <sly data-sly-use.template="${template}" data-sly-call="${template.variant @ model=model}"> + </sly> + <sly data-sly-test="${wcmmode.isEdit}"> + <div style="--bs-bg-opacity: .5;" class="bg-warning">${model.componentTitle} Component</div> + </sly> + </div> +</sly> + \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/variants/iframe.html b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/variants/iframe.html new file mode 100644 index 000000000..cd1cbf0d4 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/variants/iframe.html @@ -0,0 +1,28 @@ +<!--/* + Copyright (C) 2023 Typerefinery.io + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/--> +<template data-sly-template.variant="${ @ model }"> + <div class="${model.variantClassNames}"> + <iframe src="${model.url}" + frameborder="0" + scrolling="${model.scrolling}" + allowfullscreen="${model.allowfullscreen}" + autoResize="${model.autoResize}" + height="${model.height}" + width="100%" + ></iframe> + </div> +</template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/variants/source.html b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/variants/source.html new file mode 100644 index 000000000..9bc80bc0a --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/variants/source.html @@ -0,0 +1,21 @@ +<!--/* + Copyright (C) 2023 Typerefinery.io + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/--> +<template data-sly-template.variant="${ @ model }"> + <div class="${model.variantClassNames}"> + ${model.source @ context='unsafe'} + </div> +</template> \ No newline at end of file From 60997993e4b4453577b3291a3d45994395bd9594 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 29 Feb 2024 10:10:02 +1100 Subject: [PATCH 027/206] fix columns. --- .../columns/four/template/.content.json | 18 +++++++++--------- .../columns/one/template/.content.json | 6 +----- .../columns/three/template/.content.json | 14 +++++++------- .../columns/two/template/.content.json | 14 +++++++------- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/four/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/four/template/.content.json index 69a64a98b..371778095 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/four/template/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/four/template/.content.json @@ -1,32 +1,32 @@ { - "classes": "", + "flexEnabled": true, "jcr:primaryType": "nt:unstructured", "container1": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "/apps/typerefinery/components/layout/container", - "smColSize": 8, - "mdColSize": 4, + "smColSize": 3, + "mdColSize": 3, "lgColSize": 3 }, "container2": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "/apps/typerefinery/components/layout/container", - "smColSize": 8, - "mdColSize": 4, + "smColSize": 3, + "mdColSize": 3, "lgColSize": 3 }, "container3": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "/apps/typerefinery/components/layout/container", - "smColSize": 8, - "mdColSize": 4, + "smColSize": 3, + "mdColSize": 3, "lgColSize": 3 }, "container4": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "/apps/typerefinery/components/layout/container", - "smColSize": 8, - "mdColSize": 4, + "smColSize": 3, + "mdColSize": 3, "lgColSize": 3 } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/one/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/one/template/.content.json index a6978adc3..81ef774a4 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/one/template/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/one/template/.content.json @@ -1,11 +1,7 @@ { - "classes": "", "jcr:primaryType": "nt:unstructured", "container1": { "jcr:primaryType": "nt:unstructured", - "sling:resourceType": "/apps/typerefinery/components/layout/container", - "smColSize": 24, - "mdColSize": 18, - "lgColSize": 12 + "sling:resourceType": "/apps/typerefinery/components/layout/container" } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/three/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/three/template/.content.json index e4690fa35..ae55ac9b0 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/three/template/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/three/template/.content.json @@ -1,25 +1,25 @@ { - "classes": "", + "flexEnabled": true, "jcr:primaryType": "nt:unstructured", "container1": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "/apps/typerefinery/components/layout/container", - "smColSize": 10, - "mdColSize": 6, + "smColSize": 4, + "mdColSize": 4, "lgColSize": 4 }, "container2": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "/apps/typerefinery/components/layout/container", - "smColSize": 10, - "mdColSize": 6, + "smColSize": 4, + "mdColSize": 4, "lgColSize": 4 }, "container3": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "/apps/typerefinery/components/layout/container", - "smColSize": 10, - "mdColSize": 6, + "smColSize": 4, + "mdColSize": 4, "lgColSize": 4 } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/two/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/two/template/.content.json index 8d56d7850..a06285da6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/two/template/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/columns/two/template/.content.json @@ -1,18 +1,18 @@ { - "classes": "", + "flexEnabled": true, "jcr:primaryType": "nt:unstructured", "container1": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "/apps/typerefinery/components/layout/container", - "smColSize": 2, - "mdColSize": 2, - "lgColSize": 2 + "smColSize": 6, + "mdColSize": 6, + "lgColSize": 6 }, "container2": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "/apps/typerefinery/components/layout/container", - "smColSize": 22, - "mdColSize": 16, - "lgColSize": 10 + "smColSize": 6, + "mdColSize": 6, + "lgColSize": 6 } } From 0aa82f7029eea5a64e285a8543cdf0ae25046a33 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 13 Mar 2024 16:18:54 +1100 Subject: [PATCH 028/206] add stix form components. --- .../components/stix/forms/field/.content.json | 12 ++ .../stix/forms/field/dialog/.content.json | 14 ++ .../components/stix/forms/field/field.html | 4 + .../stix/forms/field/template/.content.json | 12 ++ .../components/stix/forms/field/variant.html | 6 + .../stix/forms/fields/input/.content.json | 6 + .../fields/input/clientlibs/.content.json | 14 ++ .../fields/input/clientlibs/behaviour.js | 15 ++ .../fields/input/clientlibs/functions.js | 36 +++++ .../forms/fields/input/dialog/.content.json | 100 ++++++++++++ .../stix/forms/fields/input/input.html | 21 +++ .../stix/forms/fields/input/variant.html | 30 ++++ .../stix/forms/fields/select/.content.json | 6 + .../fields/select/clientlibs/.content.json | 17 +++ .../fields/select/clientlibs/behaviour.js | 14 ++ .../fields/select/clientlibs/functions.js | 111 ++++++++++++++ .../forms/fields/select/dialog/.content.json | 144 ++++++++++++++++++ .../stix/forms/fields/select/select.html | 21 +++ .../stix/forms/fields/select/variant.html | 31 ++++ .../stix/forms/input/binary/.content.json | 9 ++ .../stix/forms/input/binary/binary.html | 19 +++ .../forms/input/binary/template/.content.json | 13 ++ .../stix/forms/input/boolean/.content.json | 9 ++ .../stix/forms/input/boolean/boolean.html | 19 +++ .../input/boolean/template/.content.json | 13 ++ .../forms/input/embeddedobject/.content.json | 9 ++ .../input/embeddedobject/embeddedobject.html | 19 +++ .../embeddedobject/template/.content.json | 13 ++ .../stix/forms/input/float/.content.json | 9 ++ .../stix/forms/input/float/float.html | 19 +++ .../forms/input/float/template/.content.json | 13 ++ .../stix/forms/input/hex/.content.json | 9 ++ .../components/stix/forms/input/hex/hex.html | 19 +++ .../forms/input/hex/template/.content.json | 13 ++ .../stix/forms/input/id/.content.json | 9 ++ .../components/stix/forms/input/id/id.html | 19 +++ .../forms/input/id/template/.content.json | 13 ++ .../stix/forms/input/integer/.content.json | 9 ++ .../stix/forms/input/integer/integer.html | 19 +++ .../input/integer/template/.content.json | 13 ++ .../forms/input/objectreference/.content.json | 9 ++ .../objectreference/objectreference.html | 19 +++ .../objectreference/template/.content.json | 13 ++ .../stix/forms/input/reference/.content.json | 9 ++ .../stix/forms/input/reference/reference.html | 19 +++ .../input/reference/template/.content.json | 13 ++ .../stix/forms/input/selector/.content.json | 9 ++ .../stix/forms/input/selector/selector.html | 19 +++ .../input/selector/template/.content.json | 13 ++ .../stix/forms/input/string/.content.json | 9 ++ .../stix/forms/input/string/string.html | 19 +++ .../forms/input/string/template/.content.json | 13 ++ .../stix/forms/input/threat/.content.json | 9 ++ .../forms/input/threat/template/.content.json | 13 ++ .../stix/forms/input/threat/threat.html | 19 +++ .../stix/forms/input/timestamp/.content.json | 9 ++ .../input/timestamp/template/.content.json | 13 ++ .../stix/forms/input/timestamp/timestamp.html | 19 +++ .../forms/select/dictionary/.content.json | 9 ++ .../forms/select/dictionary/dictionary.html | 19 +++ .../select/dictionary/template/.content.json | 13 ++ .../stix/forms/select/enum/.content.json | 9 ++ .../stix/forms/select/enum/enum.html | 19 +++ .../forms/select/enum/template/.content.json | 13 ++ .../stix/forms/select/extension/.content.json | 9 ++ .../forms/select/extension/extension.html | 19 +++ .../select/extension/template/.content.json | 13 ++ .../stix/forms/select/hash/.content.json | 9 ++ .../stix/forms/select/hash/hash.html | 19 +++ .../forms/select/hash/template/.content.json | 13 ++ .../stix/forms/select/list/.content.json | 9 ++ .../stix/forms/select/list/list.html | 19 +++ .../forms/select/list/template/.content.json | 13 ++ .../stix/forms/select/pattern/.content.json | 9 ++ .../stix/forms/select/pattern/pattern.html | 19 +++ .../select/pattern/template/.content.json | 13 ++ .../stix/forms/select/vocab/.content.json | 9 ++ .../forms/select/vocab/template/.content.json | 13 ++ .../stix/forms/select/vocab/vocab.html | 19 +++ 79 files changed, 1434 insertions(+) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/dialog/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/field.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/variant.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/behaviour.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/dialog/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/variant.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/dialog/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/binary/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/binary/binary.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/binary/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/boolean/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/boolean/boolean.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/boolean/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/embeddedobject/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/embeddedobject/embeddedobject.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/embeddedobject/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/float/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/float/float.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/float/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/hex/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/hex/hex.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/hex/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/id/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/id/id.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/id/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/integer/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/integer/integer.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/integer/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/objectreference/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/objectreference/objectreference.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/objectreference/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/reference/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/reference/reference.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/reference/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/selector/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/selector/selector.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/selector/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/string/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/string/string.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/string/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/threat/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/threat/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/threat/threat.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/timestamp/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/timestamp/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/timestamp/timestamp.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/dictionary/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/dictionary/dictionary.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/dictionary/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/enum/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/enum/enum.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/enum/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/extension/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/extension/extension.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/extension/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/hash/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/hash/hash.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/hash/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/list/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/list/list.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/list/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/pattern/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/pattern/pattern.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/pattern/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/vocab/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/vocab/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/vocab/vocab.html diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/.content.json new file mode 100644 index 000000000..0dabd9118 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/.content.json @@ -0,0 +1,12 @@ +{ + "isContainer": true, + "group": ".hidden", + "isLayout": false, + "allowedComponents": [ + "Typerefinery - Forms - Stix - Input", + "Typerefinery - Forms - Stix - Select" + ], + "sling:resourceType": "ws:Component", + "description": "Container for form elements", + "title": "Form Field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/dialog/.content.json new file mode 100644 index 000000000..27c484a99 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/dialog/.content.json @@ -0,0 +1,14 @@ +{ + "sling:resourceType": "wcm/dialogs/dialog", + "tabs": { + "sling:resourceType": "wcm/dialogs/components/tabs", + "gridTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "alignmentTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/alignment" + } + } +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/field.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/field.html new file mode 100644 index 000000000..1d539a656 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/field.html @@ -0,0 +1,4 @@ +<sly data-sly-use.model="ai.typerefinery.websight.models.components.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/template/.content.json new file mode 100644 index 000000000..de44c32a1 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/template/.content.json @@ -0,0 +1,12 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "title": "Label" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/input", + "title": "Field" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/variant.html new file mode 100644 index 000000000..3f94b0599 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/variant.html @@ -0,0 +1,6 @@ +<template data-sly-template.variant="${ @ model }"> + <field id="${model.id}" class="${model.componentClassNames}" data-fieldid="${model.id}" label="${label}"> + <sly data-sly-resource="${'label' @ selectors=['id', resource.name]}"></sly> + <sly data-sly-resource="${'field' @ selectors=['id', resource.name]}"></sly> + </field> +</template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/.content.json new file mode 100644 index 000000000..004bac991 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/.content.json @@ -0,0 +1,6 @@ +{ + "group": ".hidden", + "sling:resourceType": "ws:Component", + "description": "Basic form input field.", + "title": "Input" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/.content.json new file mode 100644 index 000000000..f4e6cdd1a --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/.content.json @@ -0,0 +1,14 @@ +{ + "title": "Client Libs - Forms - Stix - Input", + "jcr:primaryType": "sling:Folder", + "sling:resourceType": "io/typerefinery/websight/clientlibs", + "categories": ["ai.typerefinery.websight.components","ai.typerefinery.websight.components.stix.forms.input"], + "prepend": [], + "append": [], + "css": [ + "style.css" + ], + "js": [ + "/apps/typerefinery/clientlibs/vendor/inputmask/inputmask.min.js" + ] +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/behaviour.js new file mode 100644 index 000000000..4444a83a7 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/behaviour.js @@ -0,0 +1,15 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; +window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; +window.Typerefinery.Components.Stix.Forms.Input = Typerefinery.Components.Stix.Forms.Input || {}; + +(function (ns, document) { + "use strict"; + $(document).ready(function () { + console.log('Embed component Behaviour loaded'); + $('[component="stix-input"]').each(function () { + ns.init(this); + }); + }); +})(window.Typerefinery.Components.Stix.Forms.Input, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js new file mode 100644 index 000000000..727ffda77 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js @@ -0,0 +1,36 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; +window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; +window.Typerefinery.Components.Stix.Forms.Input = Typerefinery.Components.Stix.Forms.Input || {}; +window.Typerefinery.Page = Typerefinery.Page || {}; +window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; + +(function (ns, componentNs, eventNs, document, window) { + "use strict"; + + ns.registerEvent = ($component, componentId, fieldName) => { + const key = `${componentId}-${fieldName}`; + eventNs.registerEvents(key, (data) => { + if(data.type === "LOAD_DATA") { + // get the first children and set the inner html. + const $firstChild = $component.children[0]; + // get the component config + const componentConfig = componentNs.getComponentConfig($component); + // set field value + $component.find("input").val(data.data.value); + } + }); + } + + + ns.init = ($component) => { + // check if the component have a data attribute with the name "data-field-componentId" and "data-field-name" then register eventNs + const componentId = $component.getAttribute("id"); + const fieldName = $component.getAttribute("name"); + if (componentId && fieldName) { + ns.registerEvent($component, componentId, fieldName); + }; + } +} +)(window.Typerefinery.Components.Stix.Forms.Input, Typerefinery.Components, Typerefinery.Page.Events, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/dialog/.content.json new file mode 100644 index 000000000..0152dfcaf --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/dialog/.content.json @@ -0,0 +1,100 @@ +{ + "sling:resourceType": "wcm/dialogs/dialog", + "tabs": { + "sling:resourceType": "wcm/dialogs/components/tabs", + "generalTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "General", + "fieldName": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/forms/form/common/fieldName" + }, + "placeholder": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/forms/form/common/placeholder" + }, + "inputType": { + "sling:resourceType": "wcm/dialogs/components/select", + "name": "inputType", + "label": "Type", + "string": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "String", + "value": "string" + }, + "integer": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Integer", + "value": "integer" + }, + "float": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Float", + "value": "float" + }, + "boolean": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Boolean", + "value": "boolean" + }, + "timestamp": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Timestamp", + "value": "timestamp" + }, + "binary": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Binary", + "value": "binary" + }, + "hex": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Hex", + "value": "hex" + }, + "embeddedObject": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Embedded Object", + "value": "embeddedobject" + }, + "id": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "ID", + "value": "id" + }, + "objectReference": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Object Reference", + "value": "objectrference" + }, + "reference": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Reference", + "value": "reference" + }, + "selector": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Selector", + "value": "selector" + }, + "threat": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Threat", + "value": "threat" + } + } + }, + "validationTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/validation" + }, + "gridTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" + } + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html new file mode 100644 index 000000000..9f0620b40 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html @@ -0,0 +1,21 @@ +<!--/* + Copyright (C) 2022 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Input"> + <div class="${model.componentClassNames}" id="${model.id}" component="stix-${model.componentName}"> + <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> + </sly> + </div> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/variant.html new file mode 100644 index 000000000..4a5c2e856 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/variant.html @@ -0,0 +1,30 @@ +<!--/* + Copyright (C) 2022 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<template data-sly-template.variant="${ @ model }"> + <input + component="${model.componentName}" + isInput="true" + id="${model.id}" + type="${model.inputType}" + name="${model.name}" + data-fieldId="${model.id}-${model.name}" + placeholder="${model.placeholder}" + class=" ${model.variantClassNames}" + required="${model.validationRequired}" + data-inputmask = " 'mask' : '${model.validationInputMask}'" + disabled="${model.disabled}" + /> +</template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/.content.json new file mode 100644 index 000000000..5407710bc --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/.content.json @@ -0,0 +1,6 @@ +{ + "group": ".hidden", + "sling:resourceType": "ws:Component", + "description": "This is Select component for Typerefinery", + "title": "Select" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/.content.json new file mode 100644 index 000000000..b5d2d82f3 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/.content.json @@ -0,0 +1,17 @@ +{ + "title": "Client Libs - Forms - Stix - Select", + "jcr:primaryType": "sling:Folder", + "sling:resourceType": "io/typerefinery/websight/clientlibs", + "categories": [ + "ai.typerefinery.websight.components", + "ai.typerefinery.websight.components.stix.forms.select" + ], + "css": [ + "/apps/typerefinery/clientlibs/vendor/select/style.css" + ], + "js": [ + "/apps/typerefinery/clientlibs/vendor/select/script.js", + "functions.js", + "behaviour.js" + ] +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js new file mode 100644 index 000000000..2fc46b5e7 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js @@ -0,0 +1,14 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; +window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; +window.Typerefinery.Components.Stix.Forms.Select = Typerefinery.Components.Stix.Forms.Select || {}; + +;(function (ns, document) { + "use strict"; + $(document).ready(function () { + $("[component='stix-select']").each(function () { + ns.init(this); + }); + }); +})(window.Typerefinery.Components.Stix.Forms.Select, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js new file mode 100644 index 000000000..415d5735d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js @@ -0,0 +1,111 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; +window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; +window.Typerefinery.Components.Stix.Forms.Select = Typerefinery.Components.Stix.Forms.Select || {}; +window.Typerefinery.Components.Stix.Forms.Select.Instances = Typerefinery.Components.Stix.Forms.Select.Instances || {}; + + +;(function (ns, componentNs, selectInstances, window, document) { + "use strict"; + + ns.getOptionsSelectedAsAnArray = ($component) => { + const $selectedOption = $component.querySelector('option[selected]'); + if($selectedOption) { + return [$selectedOption.value]; + } else { + return []; + } + } + + ns.getDefaultOptionsSelected = (defaultSelectedOptions) => { + // convert the defaultSelectedOptions to an array + // if the defaultSelectedOptions is a string, then split it by comma + // if the defaultSelectedOptions is an array, then do nothing + + if(typeof defaultSelectedOptions === 'string') { + return defaultSelectedOptions.split(','); + } + + return defaultSelectedOptions; + }; + + ns.isValueSelectedAsDefault = (options, value) => { + if(options) { + if(Array.isArray(options)) { + return options.includes(value?.trim()) ? 'selected' : ''; + } + } + return ''; + }; + + ns.getOptionsFromDataSource = async (componentConfig) => { + try{ + const { readOptionsFromDataSource, readMethod , readPayloadType } = componentConfig; + if(!readOptionsFromDataSource) { + return []; + } + const response = await fetch( + readOptionsFromDataSource, + { + method: readMethod || "GET", + headers: { + "Content-Type": readPayloadType || "application/json" + } + } + ).then(response => response.json()); + return Array.isArray(response) ? response : (response?.data || []); + }catch(error) { + console.error(error); + return []; + } + }; + + ns.addOptionsToSelect = async ($component, componentConfig, defaultSelectedOptions) => { + + if(componentConfig.readOptionsFromDataSource) { + const options = await ns.getOptionsFromDataSource(componentConfig); + console.log(options, 'options') + if(options.length !== 0) { + const selectOptions = options.map((option) => { + return `<option ${ns.isValueSelectedAsDefault(defaultSelectedOptions, option[componentConfig.keyNameInOptionList || 'key'])} value="${option[componentConfig.keyNameInOptionList || 'key']}">${option[componentConfig.labelNameInOptionList || 'label']}</option>` + }); + $component.innerHTML = selectOptions.join(''); + return; + } + + } + + if(componentConfig.selectOptions) { + if(Array.isArray(componentConfig.selectOptions)) { + const selectOptions = componentConfig.selectOptions.map((option) => { + return `<option ${ns.isValueSelectedAsDefault(defaultSelectedOptions, option.value)} value="${option.value}">${option.label}</option>` + }); + $component.innerHTML = selectOptions.join(''); + } else { + throw new Error('componentConfig.selectOptions is not an array'); + } + } + }; + + + + ns.init = async ($component) => { + const componentConfig = componentNs.getComponentConfig($component); + if(componentConfig.multipleSelection) { + $component.setAttribute('multiple', 'true'); + } + + const defaultSelectedOptions = ns.getDefaultOptionsSelected(componentConfig.defaultSelectedOptions); + + await ns.addOptionsToSelect($component, componentConfig, defaultSelectedOptions); + + + selectInstances[componentConfig.id] = new Choices($component, { + removeItemButton: true, + maxItemCount: componentConfig.maxSelection || -1, + labelId: componentConfig.id + }); + } + +})(Typerefinery.Components.Stix.Forms.Select, Typerefinery.Components, Typerefinery.Components.Stix.Forms.Select.Instances, window, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/dialog/.content.json new file mode 100644 index 000000000..6ec37ac85 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/dialog/.content.json @@ -0,0 +1,144 @@ +{ + "sling:resourceType": "wcm/dialogs/dialog", + "tabs": { + "sling:resourceType": "wcm/dialogs/components/tabs", + "generalTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "General", + "warning": { + "sling:resourceType": "typerefinery/components/dialog/label", + "ws:disallowedContext": ["edit:dialog"], + "appearance": "error", + "iconLabel": "Open Dialog", + "title": "Some fields are not editable in side-panel.", + "message": "Please open this component in dialog to edit these fields.", + "secondaryText": "", + "placement": "bottom-start" + }, + "fieldName": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/forms/form/common/fieldName" + }, + "placeholder": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/forms/form/common/placeholder" + }, + "inputType": { + "sling:resourceType": "wcm/dialogs/components/select", + "name": "inputType", + "label": "Type", + "string": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Dictionary", + "value": "dictionary" + }, + "extension": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Extension", + "value": "extension" + }, + "list": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "List", + "value": "list" + }, + "enum": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Enum", + "value": "enum" + }, + "vocab": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Vocab", + "value": "vocab" + }, + "hash": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Hash", + "value": "hash" + }, + "pattern": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Pattern", + "value": "pattern" + } + }, + "selectOptions": { + "name": "selectOptions", + "label": "Add Options", + "description": "If option endpoint is mentioned then options will be read from datasource", + "sling:resourceType": "wcm/dialogs/components/multifield", + "ws:disallowedContext": ["edit:panel"], + "labelText": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "label", + "label": "Label" + }, + "value": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "value", + "label": "Value" + } + } + + }, + "optionsTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Options", + "readOptionsFromDataSource": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "readOptionsFromDataSource", + "label": "Read options from data source", + "description": "Enter the path to a data source. The data source must be a JSON array of objects with label and value properties." + }, + "keyNameInOptionList": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "keyNameInOptionList", + "label": "Key name in option list" + }, + "labelNameInOptionList": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "labelNameInOptionList", + "label": "Label name in option list" + } + }, + "advancedTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Advanced", + "multipleSelection": { + "sling:resourceType": "wcm/dialogs/components/toggle", + "name": "multipleSelection", + "label": "Multiple Select" + }, + "maxSelection": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "maxSelection", + "label": "Max Selections", + "ws:display": { + "condition": { + "sourceName": "multipleSelection", + "values": true + } + } + }, + "defaultSelectedOptions": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "defaultSelectedOptions", + "label": "Default Selected Options", + "description": "Comma separated list of values to be selected by default" + } + }, + "validationTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/validation" + }, + "gridTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" + } + } +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html new file mode 100644 index 000000000..b5788cd55 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html @@ -0,0 +1,21 @@ +<!--/* + Copyright (C) 2023 Typerefinery.io + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Select"> + <div class="${model.componentClassNames}" id="${model.id}" component="stix-${model.componentName}"> + <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> + </sly> + </div> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html new file mode 100644 index 000000000..8900776c6 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html @@ -0,0 +1,31 @@ +<!--/* + Copyright (C) 2023 Typerefinery.io + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<template data-sly-template.variant="${ @ model }"> + <select + component="${model.componentName}" + isInput="true" + id="${model.id}" + type="${model.inputType}" + name="${model.name}" + data-fieldId="${model.id}-${model.name}" + placeholder="${model.placeholder}" + class="${model.variantClassNames} form-control" + required="${model.validationRequired}" + data-model="${model.jsonString}" + disabled="${model.disabled}" + > + </select> +</template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/binary/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/binary/.content.json new file mode 100644 index 000000000..52c1760fc --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/binary/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Input", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Binary input field.", + "title": "Binary", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/binary/binary.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/binary/binary.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/binary/binary.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/binary/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/binary/template/.content.json new file mode 100644 index 000000000..5e64e168a --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/binary/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Binary" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "Binary", + "inputType": "binary" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/boolean/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/boolean/.content.json new file mode 100644 index 000000000..a6c57a6f8 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/boolean/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Input", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Boolean input field.", + "title": "Boolean", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/boolean/boolean.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/boolean/boolean.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/boolean/boolean.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/boolean/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/boolean/template/.content.json new file mode 100644 index 000000000..b716b77b3 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/boolean/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Boolean" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "Boolean", + "inputType": "boolean" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/embeddedobject/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/embeddedobject/.content.json new file mode 100644 index 000000000..bce73dae0 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/embeddedobject/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Input", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Embedded Object input field.", + "title": "Embedded Object", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/embeddedobject/embeddedobject.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/embeddedobject/embeddedobject.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/embeddedobject/embeddedobject.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/embeddedobject/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/embeddedobject/template/.content.json new file mode 100644 index 000000000..b4f109038 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/embeddedobject/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Embedded Object" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "Embedded Object", + "inputType": "embeddedobject" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/float/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/float/.content.json new file mode 100644 index 000000000..af1f0f3d3 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/float/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Input", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Float input field.", + "title": "Float", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/float/float.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/float/float.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/float/float.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/float/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/float/template/.content.json new file mode 100644 index 000000000..9b03d0d41 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/float/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Float" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "Float", + "inputType": "float" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/hex/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/hex/.content.json new file mode 100644 index 000000000..14d05c7c1 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/hex/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Input", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Hex input field.", + "title": "Hex", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/hex/hex.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/hex/hex.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/hex/hex.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/hex/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/hex/template/.content.json new file mode 100644 index 000000000..bdbdcc01f --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/hex/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Hex" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "Hex", + "inputType": "hex" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/id/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/id/.content.json new file mode 100644 index 000000000..84edc8f9d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/id/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Input", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "ID input field.", + "title": "ID", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/id/id.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/id/id.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/id/id.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/id/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/id/template/.content.json new file mode 100644 index 000000000..1cee81e58 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/id/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "ID" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "ID", + "inputType": "id" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/integer/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/integer/.content.json new file mode 100644 index 000000000..24b33022d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/integer/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Input", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Integer input field.", + "title": "Integer", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/integer/integer.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/integer/integer.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/integer/integer.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/integer/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/integer/template/.content.json new file mode 100644 index 000000000..d50b3dff2 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/integer/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Integer" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "Integer", + "inputType": "integer" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/objectreference/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/objectreference/.content.json new file mode 100644 index 000000000..48ca2ea86 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/objectreference/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Input", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Object Reference input field.", + "title": "Object Reference", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/objectreference/objectreference.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/objectreference/objectreference.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/objectreference/objectreference.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/objectreference/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/objectreference/template/.content.json new file mode 100644 index 000000000..4f2123e3b --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/objectreference/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Object Reference" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "Object Reference", + "inputType": "objectreference" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/reference/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/reference/.content.json new file mode 100644 index 000000000..1296dfb1a --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/reference/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Input", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Reference input field.", + "title": "Reference", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/reference/reference.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/reference/reference.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/reference/reference.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/reference/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/reference/template/.content.json new file mode 100644 index 000000000..e897eb705 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/reference/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Reference" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "Reference", + "inputType": "reference" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/selector/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/selector/.content.json new file mode 100644 index 000000000..7b04b19d9 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/selector/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Input", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Selector input field.", + "title": "Selector", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/selector/selector.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/selector/selector.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/selector/selector.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/selector/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/selector/template/.content.json new file mode 100644 index 000000000..5871364da --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/selector/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Selector" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "Selector", + "inputType": "selector" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/string/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/string/.content.json new file mode 100644 index 000000000..b06032385 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/string/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Input", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "String input field.", + "title": "String", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/string/string.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/string/string.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/string/string.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/string/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/string/template/.content.json new file mode 100644 index 000000000..a504b1721 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/string/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "String" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "Field", + "inputType": "string" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/threat/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/threat/.content.json new file mode 100644 index 000000000..e17a05e0d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/threat/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Input", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Threat input field.", + "title": "Threat", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/threat/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/threat/template/.content.json new file mode 100644 index 000000000..fd407b774 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/threat/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Threat" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "Threat", + "inputType": "threat" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/threat/threat.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/threat/threat.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/threat/threat.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/timestamp/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/timestamp/.content.json new file mode 100644 index 000000000..be5b2a772 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/timestamp/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Input", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Timestamp input field.", + "title": "Timestamp", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/timestamp/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/timestamp/template/.content.json new file mode 100644 index 000000000..824d13290 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/timestamp/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Timestamp" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "Timestamp", + "inputType": "timestamp" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/timestamp/timestamp.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/timestamp/timestamp.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/input/timestamp/timestamp.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/dictionary/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/dictionary/.content.json new file mode 100644 index 000000000..d4b72a87e --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/dictionary/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Select", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Dictionary Select", + "title": "Dictionary", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/dictionary/dictionary.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/dictionary/dictionary.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/dictionary/dictionary.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/dictionary/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/dictionary/template/.content.json new file mode 100644 index 000000000..11c0e63d3 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/dictionary/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Dictionary" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/select", + "label": "Dictionary", + "inputType": "dictionary" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/enum/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/enum/.content.json new file mode 100644 index 000000000..62edea804 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/enum/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Select", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Enum Select", + "title": "Enum", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/enum/enum.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/enum/enum.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/enum/enum.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/enum/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/enum/template/.content.json new file mode 100644 index 000000000..96a4b03b7 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/enum/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Enum" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/select", + "label": "Enum", + "inputType": "enum" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/extension/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/extension/.content.json new file mode 100644 index 000000000..269b76b3d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/extension/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Select", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Extension Select", + "title": "Extension", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/extension/extension.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/extension/extension.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/extension/extension.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/extension/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/extension/template/.content.json new file mode 100644 index 000000000..663a1f1e1 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/extension/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Extension" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/select", + "label": "Extension", + "inputType": "extension" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/hash/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/hash/.content.json new file mode 100644 index 000000000..96e44733d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/hash/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Select", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Hash Select", + "title": "Hash", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/hash/hash.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/hash/hash.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/hash/hash.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/hash/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/hash/template/.content.json new file mode 100644 index 000000000..54c2c4ae1 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/hash/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Hash" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/select", + "label": "Hash", + "inputType": "hash" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/list/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/list/.content.json new file mode 100644 index 000000000..d84c8a1c5 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/list/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Select", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "List Select", + "title": "List", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/list/list.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/list/list.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/list/list.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/list/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/list/template/.content.json new file mode 100644 index 000000000..5e3cf39d2 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/list/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "List" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/select", + "label": "List", + "inputType": "list" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/pattern/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/pattern/.content.json new file mode 100644 index 000000000..2bd86c3b2 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/pattern/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Select", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Pattern Select", + "title": "Pattern", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/pattern/pattern.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/pattern/pattern.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/pattern/pattern.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/pattern/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/pattern/template/.content.json new file mode 100644 index 000000000..c80546bd4 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/pattern/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Pattern" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/select", + "label": "Pattern", + "inputType": "pattern" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/vocab/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/vocab/.content.json new file mode 100644 index 000000000..7308b3512 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/vocab/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Select", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Vocab Select", + "title": "Vocab", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/vocab/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/vocab/template/.content.json new file mode 100644 index 000000000..3ac78ff81 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/vocab/template/.content.json @@ -0,0 +1,13 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Vocab" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/select", + "label": "Vocab", + "inputType": "vocab" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/vocab/vocab.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/vocab/vocab.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/select/vocab/vocab.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file From e3583d4a1efc33e6bd5759d08ee35d8f99380f22 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 13 Mar 2024 16:19:38 +1100 Subject: [PATCH 029/206] add console print. --- .../components/structure/page/clientlibs-footer/script.js | 1 + 1 file changed, 1 insertion(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-footer/script.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-footer/script.js index d4bbf9a86..40a6043bd 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-footer/script.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-footer/script.js @@ -110,4 +110,5 @@ $(document).ready(() => { }); vueApp.use(router).use(primevue.config.default).mount('#app'); + console.log("Vue app mounted"); }); \ No newline at end of file From 45cd2e2bd6d046dc329c0220c5ccb4c4132420cb Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 13 Mar 2024 16:53:54 +1100 Subject: [PATCH 030/206] update forms to include stix inputs. --- .../apps/typerefinery/components/forms/form/.content.json | 2 ++ .../apps/typerefinery/components/forms/form/variant.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/.content.json index 4de4ae910..28d3db37b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/.content.json @@ -6,6 +6,8 @@ "Typerefinery - Content", "Typerefinery - Details", "Typerefinery - Forms", + "Typerefinery - Forms - Stix - Input", + "Typerefinery - Forms - Stix - Select", "Typerefinery - Graphs", "Typerefinery - Layout", "Typerefinery - List", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/variant.html index e9b206aa1..e314864d4 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/variant.html @@ -27,7 +27,7 @@ <sly data-sly-test="${!resource.hasChildren}"> <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" - data-sly-call="${lib.placeholder @ classes=CSSclasses}"> + data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> </sly> </sly> </template> \ No newline at end of file From 9c0785ff9eb01fa15f8a0e37121a32c4a1f8febb Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 13 Mar 2024 16:54:15 +1100 Subject: [PATCH 031/206] refactor accordion. --- .../layout/accordion/accordion.html | 41 ++++++----------- .../layout/accordion/dialog/.content.json | 43 ++++++++---------- .../layout/accordionitem/accordionitem.html | 37 +++++++++------- .../layout/accordionitem/dialog/.content.json | 44 ++++++++++--------- 4 files changed, 78 insertions(+), 87 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html index 55f244638..ad5b81f08 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html @@ -13,30 +13,17 @@ See the License for the specific language governing permissions and limitations under the License. */--> -<sly data-sly-use.model="pl.ds.howlite.components.models.DefaultStyledGridComponent"> - <sly data-sly-test.CSSclasses="hl-accordion ${model.classes @ join=' '}"></sly> - <!-- <sly data-sly-test="${wcmmode.isEdit}"> --> - <sly data-sly-test.multiple="true"></sly> - <sly data-sly-test.activeIndex="0"></sly> - <ul data-sly-list="${resource.listChildren @ begin = 1}"> - <sly data-sly-test.activeIndex="${activeIndex},${itemList.index}"></sly> - </ul> - - <!-- </sly> --> - <div - component="${model.componentName}" - id="${model.id}" - class="${model.componentClassNames} ${model.variantClassNames}"> - data-sly-test="${resource.hasChildren}" class="${CSSclasses}"> - <!-- multiple and active index not working else accordion component working --> - <p-accordion :multiple="${multiple}" :active-index="[${activeIndex}]"> - <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"> - </sly> - </p-accordion> - </div> - <sly data-sly-test="${!resource.hasChildren}"> - <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" - data-sly-call="${lib.placeholder @ classes=CSSclasses}"> - </sly> - </sly> -</sly> \ No newline at end of file +<sly data-sly-use.model="ai.typerefinery.websight.models.components.layout.Accordion"> + <div + component="${model.componentName}" + id="${model.id}" + class="${model.componentName} ${model.componentClassNames} ${model.variantClassNames}" + data-sly-test="${resource.hasChildren}"> + <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"> + </sly> + </div> + <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" + data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> + </sly> + <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle}</div> +</sly> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/dialog/.content.json index c99a130cb..77aa2a4eb 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/dialog/.content.json @@ -1,25 +1,18 @@ -{ - "sling:resourceType": "wcm/dialogs/dialog", - "tabs": { - "sling:resourceType": "wcm/dialogs/components/tabs", - "generalTab": { - "sling:resourceType": "wcm/dialogs/components/tab", - "label": "General", - "title": { - "sling:resourceType": "wcm/dialogs/components/textfield", - "name": "title", - "label": "Title" - }, - "content": { - "sling:resourceType": "wcm/dialogs/components/textfield", - "name": "content", - "label": "Content" - }, - "item": { - "sling:resourceType": "wcm/dialogs/components/textfield", - "name": "slides", - "label": "Slides" - } - } - } -} +{ + "sling:resourceType": "wcm/dialogs/dialog", + "tabs": { + "sling:resourceType": "wcm/dialogs/components/tabs", + "eventTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event" + }, + "gridTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" + } + } +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html index e82974738..ba97ff9ba 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html @@ -11,18 +11,25 @@ limitations under the License. */--> <!-- new --> -<sly data-sly-use.model="ai.typerefinery.websight.models.components.layout.Accordion"> - <li> - <p-accordiontab header="${model.title}"> - <sly data-sly-test="${resource.hasChildren}"> - <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"> - </sly> - </sly> - <sly data-sly-test="${!resource.hasChildren}"> - <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" - data-sly-call="${lib.placeholder @ classes=CSSclasses}"> - </sly> - </sly> - </p-accordiontab> - </li> -</sly> \ No newline at end of file +<sly data-sly-use.model="ai.typerefinery.websight.models.components.layout.AccordionItem"> + <div class="accordion-item" + data-sly-set.expand="${wcmmode.isEdit || model.show}"> + <h2 class="accordion-header"> + <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#${model.id}" aria-expanded="${model.show ? 'true' : ''}" aria-controls="${model.id}"> + ${model.title} + </button> + </h2> + <!--${expand}--> + <div id="${model.id}" class="accordion-collapse collapse ${expand ? 'show' : ''}" data-bs-parent="#${resource.parent.id}"> + <div class="accordion-body"> + <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"> + </sly> + <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" + data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> + </sly> + + <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle}</div> + </div> + </div> + </div> +</sly> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/dialog/.content.json index 91a860a22..c8dcfdff3 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/dialog/.content.json @@ -1,20 +1,24 @@ -{ - "sling:resourceType": "wcm/dialogs/dialog", - "tabs": { - "sling:resourceType": "wcm/dialogs/components/tabs", - "generalTab": { - "sling:resourceType": "wcm/dialogs/components/tab", - "label": "General", - "title": { - "sling:resourceType": "wcm/dialogs/components/textfield", - "name": "title", - "label": "Title" - }, - "content": { - "sling:resourceType": "wcm/dialogs/components/textfield", - "name": "content", - "label": "Content" - } - } - } -} +{ + "sling:resourceType": "wcm/dialogs/dialog", + "tabs": { + "sling:resourceType": "wcm/dialogs/components/tabs", + "generalTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "General", + "title": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "title", + "label": "Title" + }, + "enable": { + "sling:resourceType": "wcm/dialogs/components/checkbox", + "name": "show", + "label": "Show Open" + } + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" + } + } +} From 9e1b896baa6a16f1525e8205d9df8735c8c20134 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 13 Mar 2024 16:54:37 +1100 Subject: [PATCH 032/206] update container to include aria and stix forms. --- .../typerefinery/components/layout/container/.content.json | 2 ++ .../components/layout/container/dialog/.content.json | 4 ++++ .../typerefinery/components/layout/container/variant.html | 2 ++ 3 files changed, 8 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/.content.json index 78a4b652d..83c2fb654 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/.content.json @@ -6,6 +6,8 @@ "Typerefinery - Content", "Typerefinery - Details", "Typerefinery - Forms", + "Typerefinery - Forms - Stix - Input", + "Typerefinery - Forms - Stix - Select", "Typerefinery - Graphs", "Typerefinery - Layout", "Typerefinery - List", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/dialog/.content.json index b634ef03c..4ddb3701a 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/dialog/.content.json @@ -177,6 +177,10 @@ "backgroundTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/background" + }, + "ariaTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/aria" } } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html index 52f1a8392..26384dfaa 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html @@ -36,6 +36,8 @@ data-model="${model.jsonString}" data-sly-element="${model.decorationTagName}" style="${model.inlineStyleValue @ context='unsafe'}" + role="${model.role}" + ${model.ariaAttributesString @ context='unsafe'} data-sly-test="${resource.hasChildren}"> <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> </div> From 8937dd381a240afb9c07393d01ea16593d84dc71 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 13 Mar 2024 16:55:02 +1100 Subject: [PATCH 033/206] add frontend code to main clientlibs. --- .../components/clientlibs/clientlibs-vendor/.content.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-vendor/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-vendor/.content.json index c4715f516..90efcc3be 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-vendor/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-vendor/.content.json @@ -6,7 +6,8 @@ "css": [ "/apps/typerefinery/clientlibs/vendor/bootstrap/bootstrap.min.css", "/apps/typerefinery/clientlibs/vendor/primevue/primeicons/primeicons.css", - "/apps/typerefinery/clientlibs/vendor/bootstrap/bootstrap-icons.css" + "/apps/typerefinery/clientlibs/vendor/bootstrap/bootstrap-icons.css", + "/apps/typerefinery/webroot/main.css" ], "js": [ "/apps/typerefinery/clientlibs/vendor/jquery/jquery.min.js", From 215ffa3f47d48447ec7a13215aaa43d4330a56a8 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 13 Mar 2024 16:55:15 +1100 Subject: [PATCH 034/206] add embed model. --- .../models/components/content/Embed.java | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/models/components/content/Embed.java diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/content/Embed.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/content/Embed.java new file mode 100644 index 000000000..7e750baa6 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/content/Embed.java @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2023 Typerefinery.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ai.typerefinery.websight.models.components.content; + +import javax.annotation.PostConstruct; +import javax.inject.Inject; +import javax.inject.Named; + +import lombok.Getter; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Model; +import org.jetbrains.annotations.Nullable; +import org.apache.sling.models.annotations.DefaultInjectionStrategy; +import ai.typerefinery.websight.models.components.BaseComponent; +import ai.typerefinery.websight.utils.PageUtil; + +import org.apache.commons.lang3.StringUtils; +import org.apache.jackrabbit.vault.util.JcrConstants; +import org.apache.sling.api.SlingHttpServletRequest; + +@Model( + adaptables = { + Resource.class, + SlingHttpServletRequest.class + }, + defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL +) +public class Embed extends BaseComponent { + + private static final String PROPERTY_URL = "url"; + private static final String PROPERTY_SOURCE = "source"; + private static final String PROPERTY_AUTORESIZE = "autoResize"; + + + @Inject + @Named(PROPERTY_URL) + @Getter + @Nullable + private String url; + + @Inject + @Named(PROPERTY_SOURCE) + @Getter + @Nullable + private String source; + + @Inject + @Named(PROPERTY_AUTORESIZE) + @Getter + @Nullable + private String autoResize; + + @Inject + @Getter + @Nullable + private String allowfullscreen; + + @Inject + @Getter + @Nullable + private String scrolling; + + @Inject + @Getter + @Nullable + private String height; + + + @Override + @PostConstruct + protected void init() { + super.init(); + + if (title == null) { + Resource page = PageUtil.getResourcePage(resource); + // get title from page + if (page.getChild(JcrConstants.JCR_CONTENT) != null) { + Resource pageContent = page.getChild(JcrConstants.JCR_CONTENT); + title = pageContent.getValueMap().get(JcrConstants.JCR_TITLE, String.class); + } + + } + + } +} From 4495ea7d13585882a78cb579213f52f2abb3af55 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 13 Mar 2024 16:55:26 +1100 Subject: [PATCH 035/206] add accordion model. --- .../models/components/layout/Accordion.java | 49 ++++++++++--- .../components/layout/AccordionItem.java | 73 +++++++++++++++++++ 2 files changed, 110 insertions(+), 12 deletions(-) create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/AccordionItem.java diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Accordion.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Accordion.java index ebacf70bd..8cb86b5f9 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Accordion.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Accordion.java @@ -16,22 +16,47 @@ //namespace package ai.typerefinery.websight.models.components.layout; import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; + +import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Model; +import org.jetbrains.annotations.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ai.typerefinery.websight.models.components.BaseComponent; + +import javax.annotation.PostConstruct; import javax.inject.Inject; +import javax.inject.Named; + import org.apache.sling.models.annotations.Default; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.ExporterOption; + import lombok.Getter; -@Model(adaptables = Resource.class, defaultInjectionStrategy = OPTIONAL) -public class Accordion { - private String label; - - @Inject - @Getter - @Default(values = "Accordion Item ") - private String title; - @Inject - @Getter - @Default(values = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.") - private String content; +@Model( + adaptables = { + Resource.class, + SlingHttpServletRequest.class + }, + resourceType = { Accordion.RESOURCE_TYPE }, + defaultInjectionStrategy = OPTIONAL +) +@Exporter(name = "jackson", extensions = "json", options = { + @ExporterOption(name = "MapperFeature.SORT_PROPERTIES_ALPHABETICALLY", value = "true"), + @ExporterOption(name = "SerializationFeature.WRITE_DATES_AS_TIMESTAMPS", value = "false") +}) +public class Accordion extends BaseComponent { + + private static final Logger LOGGER = LoggerFactory.getLogger(Accordion.class); + + public static final String RESOURCE_TYPE = "typerefinery/components/layout/accordion"; + + @Override + @PostConstruct + protected void init() { + super.init(); + } } \ No newline at end of file diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/AccordionItem.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/AccordionItem.java new file mode 100644 index 000000000..344a715bf --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/AccordionItem.java @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2023 Typerefinery.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +//namespace +package ai.typerefinery.websight.models.components.layout; +import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; + +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Model; +import org.jetbrains.annotations.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ai.typerefinery.websight.models.components.BaseComponent; + +import javax.annotation.PostConstruct; +import javax.inject.Inject; +import javax.inject.Named; + +import org.apache.sling.models.annotations.Default; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.ExporterOption; + +import lombok.Getter; + +@Model( + adaptables = { + Resource.class, + SlingHttpServletRequest.class + }, + resourceType = { AccordionItem.RESOURCE_TYPE }, + defaultInjectionStrategy = OPTIONAL +) +@Exporter(name = "jackson", extensions = "json", options = { + @ExporterOption(name = "MapperFeature.SORT_PROPERTIES_ALPHABETICALLY", value = "true"), + @ExporterOption(name = "SerializationFeature.WRITE_DATES_AS_TIMESTAMPS", value = "false") +}) +public class AccordionItem extends BaseComponent { + + private static final Logger LOGGER = LoggerFactory.getLogger(AccordionItem.class); + + public static final String RESOURCE_TYPE = "typerefinery/components/layout/accordionitem"; + + @Inject + @Getter + @Default(values = "Accordion Item ") + private String title; + + @Getter + @Inject + @Nullable + private Boolean show; + + + @Override + @PostConstruct + protected void init() { + super.init(); + } +} \ No newline at end of file From 4538e3831db2e72425aff5c63481311b4addf7ad Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 13 Mar 2024 16:55:42 +1100 Subject: [PATCH 036/206] update utils. --- .../components/AttributeSelectValue.java | 5 ++++ .../models/components/BaseComponent.java | 28 ++++++++++++++++++- .../websight/models/components/BaseModel.java | 3 +- .../typerefinery/websight/utils/PageUtil.java | 26 +++++++++++++++++ 4 files changed, 60 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/AttributeSelectValue.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/AttributeSelectValue.java index b0b2324b4..15b5fa3ba 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/AttributeSelectValue.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/AttributeSelectValue.java @@ -38,4 +38,9 @@ public class AttributeSelectValue { @Inject public String value; + // override toString method + public String toString() { + String attributeName = select != null ? select : other; + return attributeName + "=\"" + value + "\""; + } } diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java index a40834467..6564c96db 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java @@ -5,6 +5,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.LinkedHashSet; +import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -169,7 +170,18 @@ public class BaseComponent extends BaseModel implements Styled, Grid { @Getter @Default(values = "") private String name; - + + @Inject + @Getter + @Default(values = "") + private String roleOther; + @Inject + @Getter + @Default(values = "") + private String roleSelect; + @Inject + @Getter + public List<AttributeSelectValue> ariaAttributes; @Inject @Getter @@ -433,4 +445,18 @@ protected void init() { // } } } + + public String getRole() { + if (StringUtils.isNotBlank(roleSelect)) { + return roleSelect; + } + return roleOther; + } + + public String getAriaAttributesString() { + if (ariaAttributes != null) { + return ariaAttributes.stream().map(AttributeSelectValue::toString).collect(Collectors.joining(" ")); + } + return ""; + } } \ No newline at end of file diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseModel.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseModel.java index 4ff5579f2..dff63e170 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseModel.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseModel.java @@ -83,7 +83,8 @@ public class BaseModel { protected void init() { this.componentName = PageUtil.getResourceTypeName(resource); - this.componentTitle = StringUtils.capitalize(this.componentName); + // this.componentTitle = StringUtils.capitalize(this.componentName); + this.componentTitle = PageUtil.getResourceTypeTitle(resource, resourceResolver); if (StringUtils.isBlank(this.id)) { //TODO: generate a unique id diff --git a/application/backend/src/main/java/ai/typerefinery/websight/utils/PageUtil.java b/application/backend/src/main/java/ai/typerefinery/websight/utils/PageUtil.java index 214c09d17..80112f685 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/utils/PageUtil.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/utils/PageUtil.java @@ -69,6 +69,19 @@ public static Resource getResourceParentByResourceType(@NotNull Resource resourc return null; } + + /** + * return resource as a ValueMap + * @param resource resource to use + * @return ValueMap of resource + */ + public static ValueMap getResourceValueMap(@NotNull Resource resource) { + if (resource != null ) { + return resource.getValueMap(); + } + return null; + } + /** * return resource child JCR_CONTENT as a ValueMap * @param resource resource to use @@ -101,6 +114,19 @@ public static String getResourcePagePath(@NotNull Resource resource) { return resource.getPath().substring(0, resource.getPath().indexOf(JcrConstants.JCR_CONTENT)-1); } + public static String getResourceTypeTitle(@NotNull Resource resource, @NotNull ResourceResolver resourceResolver) { + String resourceType = resource.getResourceType(); + //get resource type resource + Resource resourceTypeResource = resourceResolver.getResource(resourceType); + if (resourceTypeResource != null) { + ValueMap resourceTypeValueMap = getResourceValueMap(resourceTypeResource); + if (resourceTypeValueMap != null && resourceTypeValueMap.containsKey(PROPERTY_TITLE)) { + return resourceTypeValueMap.get(PROPERTY_TITLE, StringUtils.EMPTY); + } + } + return getResourceTypeName(resource); + } + /** * if resource type is a path get last part of the path * @param resource resource From c535ce3a5183e48bbfaa69473aaaaf9126617467 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 13 Mar 2024 16:55:57 +1100 Subject: [PATCH 037/206] add sample pages. --- .../components/content/embed/.content.xml | 69 +++++++++++++++++++ .../components/content/table/.content.xml | 16 +++++ 2 files changed, 85 insertions(+) create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/table/.content.xml diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/.content.xml new file mode 100644 index 000000000..fe6b2810b --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/.content.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:primaryType="ws:PageContent" + jcr:title="Embed" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_5JESE944V"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_AVG9YJRZC"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_JWF66T5J9"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_A0C0JQKPF" + text="<p>Source Code</p>"/> + <embed + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + borderEnabled="false" + id="embed_SSRJRONQ2" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + source="<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d10601.849068561562!2d144.95320519129666!3d-37.81467323756081!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x6ad646b5d2ba4df7%3A0x4045675218ccd90!2sMelbourne%20VIC!5e0!3m2!1sen!2sau!4v1709510888812!5m2!1sen!2sau" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>"/> + </container> + <container_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_BEBJSPR7B"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_MZSFNJ3FH" + text="<p>iFrame</p>"/> + <embed + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + autoResize="false" + borderEnabled="false" + height="300" + id="embed_1E2Q4TQMD" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + scrolling="no" + url="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d10601.849068561562!2d144.95320519129666!3d-37.81467323756081!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x6ad646b5d2ba4df7%3A0x4045675218ccd90!2sMelbourne%20VIC!5e0!3m2!1sen!2sau!4v1709510888812!5m2!1sen!2sau" + variant="iframe"/> + </container_1> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_0HDYMOOJD"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/table/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/table/.content.xml new file mode 100644 index 000000000..ce7988bd6 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/table/.content.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" + xmlns:nt="http://www.jcp.org/jcr/nt/1.0" + xmlns:ws="http://ds.pl/websight" + xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> + <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Title" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> + <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> + <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> + <section jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"> + <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title"/> + </section> + </container> + </rootcontainer> + </jcr:content> +</jcr:root> From 940b0112286e216834b4cc94ac4d3d1db1ed0dfc Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 13 Mar 2024 16:56:45 +1100 Subject: [PATCH 038/206] ensure image component uses picture container. --- .../components/content/image/variant.html | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/image/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/content/image/variant.html index 6a00f8144..ec7b16f79 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/image/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/image/variant.html @@ -32,6 +32,8 @@ <template data-sly-template.image="${ @ imagesCount, defaultImage, imageSources, alt, showLink, url, openInNewTab, classes}"> <!-- imagesCount: ${imagesCount} --> + <!-- imagesCount==1: ${imagesCount == 1} --> + <!-- imagesCount>1: ${imagesCount > 1} --> <!-- defaultImage: ${defaultImage} --> <!-- imageSources: ${imageSources} --> <!-- alt: ${alt} --> @@ -39,14 +41,17 @@ <!-- url: ${url} --> <!-- openInNewTab: ${openInNewTab} --> <!-- classes: ${classes} --> - <sly data-sly-test="${imagesCount == 1}" - data-sly-test.imageClasses="${classes @ join=' '}"> - <sly data-sly-call="${simpleImage @ defaultImage=defaultImage, showLink=showLink, alt=alt, url=url, openInNewTab=openInNewTab, classes=imageClasses}"></sly> + <sly data-sly-test="${imagesCount == 1}"> + <div class="picture-container ${classes @ join=' '}"> + <picture> + <sly data-sly-call="${simpleImage @ defaultImage=defaultImage, showLink=showLink, alt=alt, url=url, openInNewTab=openInNewTab}"></sly> + </picture> + </div> </sly> - <sly data-sly-test="${imagesCount > 1}" - data-sly-set.imageClasses="${classes @ join=' '}"> + <sly data-sly-test="${imagesCount > 1}"> <div class="hl-image ${classes @ join=' '}"> <a href="${url}" class="hl-image__link" target="${openInNewTab ? '_blank' : ''}" data-sly-unwrap="${!showLink || !url || url == ''}"> + <div class="picture-container"> <picture class="hl-image__picture"> <sly data-sly-list="${imageSources}"> <source media="(min-width:${item.minWidth}px)" @@ -54,6 +59,7 @@ </sly> <sly data-sly-call="${img @ defaultImage=defaultImage, alt=alt}"></sly> </picture> + </div> </a> </div> </sly> From eeb57ad3a85bff220a762ede04ab7a8ab3a06b34 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 13 Mar 2024 16:56:56 +1100 Subject: [PATCH 039/206] add teaser. --- .../components/content/teaser/.content.json | 10 +++++ .../components/content/teaser/teaser.html | 19 ++++++++ .../content/teaser/template/.content.json | 44 +++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/content/teaser/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/content/teaser/teaser.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/content/teaser/template/.content.json diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/teaser/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/content/teaser/.content.json new file mode 100644 index 000000000..2f16b2136 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/teaser/.content.json @@ -0,0 +1,10 @@ +{ + "title": "Teaser", + "group": "Typerefinery - Content", + "sling:resourceType": "ws:Component", + "isContainer": false, + "isLayout": false, + "description": "Used to create a teaser for a page.", + "sling:resourceSuperType": "typerefinery/components/layout/container" +} + diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/teaser/teaser.html b/application/backend/src/main/resources/apps/typerefinery/components/content/teaser/teaser.html new file mode 100644 index 000000000..f05dd9f7f --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/teaser/teaser.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.io + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="${'ai.typerefinery.websight.models.components.layout.Container' @ decorationTagName='div'}" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/teaser/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/content/teaser/template/.content.json new file mode 100644 index 000000000..a140c5e37 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/teaser/template/.content.json @@ -0,0 +1,44 @@ +{ + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/layout/container", + "title": "Teaser - Oblique", + "classes": "oblique", + "image": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/content/image", + "classes": "image d-none d-md-block", + "title": "Image" + }, + "container": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/layout/container", + "title": "Container", + "classes": "d-flex align-items-center justify-content-center", + "text": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/content/text", + "title": "Text" + }, + "actions": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/layout/container", + "title": "Container", + "buton1": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/button", + "label": "Primary", + "navigateTo": "#", + "buttonStyle": "primary", + "buttonType": "navigate" + }, + "buton2": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/button", + "label": "Secondary", + "navigateTo": "#", + "buttonStyle": "secondary", + "buttonType": "navigate" + } + } + } +} \ No newline at end of file From c6b7f4fa496afa2e154ddb864e6ac91931dff9ac Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 14 Mar 2024 09:01:48 +1100 Subject: [PATCH 040/206] update input type on stix forms. --- .../websight/models/components/forms/Input.java | 6 +++--- .../websight/models/components/forms/Select.java | 8 ++++++-- .../components/stix/forms/fields/input/input.html | 2 +- .../components/stix/forms/fields/select/select.html | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Input.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Input.java index 77c5dbdb0..f6bcc4891 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Input.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Input.java @@ -51,17 +51,17 @@ public class Input extends BaseFormComponent { @Inject @Getter @Default(values = "text") - private String inputType; + public String inputType; @Inject @Getter @Default(booleanValues = false) - private Boolean validationRequired; + public Boolean validationRequired; @Inject @Getter - private String validationInputMask; + public String validationInputMask; @Override @PostConstruct diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Select.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Select.java index 90f22768e..adab226af 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Select.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Select.java @@ -38,14 +38,18 @@ public class Select extends BaseFormComponent { protected static final String DEFAULT_SELECT_CLASSES = "form-select mt-1"; protected static final String DEFAULT_PLACEHOLDER = "Select an item"; + @Inject + @Getter + public String inputType; + @Inject @Getter @Default(booleanValues = false) - private Boolean validationRequired; + public Boolean validationRequired; @Inject @Getter - private List<SelectOptionItems> selectOptions; + public List<SelectOptionItems> selectOptions; @Getter @Inject diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html index 9f0620b40..0323d7f9c 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html @@ -14,7 +14,7 @@ limitations under the License. */--> <sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Input"> - <div class="${model.componentClassNames}" id="${model.id}" component="stix-${model.componentName}"> + <div class="${model.componentClassNames}" id="${model.id}" type="${model.inputType}" component="stix-${model.componentName}"> <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> </sly> </div> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html index b5788cd55..b90003097 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html @@ -14,7 +14,7 @@ limitations under the License. */--> <sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Select"> - <div class="${model.componentClassNames}" id="${model.id}" component="stix-${model.componentName}"> + <div class="${model.componentClassNames}" id="${model.id}" type="${model.inputType}" component="stix-${model.componentName}"> <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> </sly> </div> From 59c7a03c4f05653ecda5c80afa744903fee77d1d Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 25 Mar 2024 22:52:37 +1100 Subject: [PATCH 041/206] update field labels. --- .../components/forms/checkbox/template/.content.json | 4 ++-- .../components/forms/field/template/.content.json | 4 ++-- .../typerefinery/components/forms/fields/button/.content.json | 2 +- .../components/forms/fileupload/template/.content.json | 4 ++-- .../components/forms/input/template/.content.json | 4 ++-- .../components/forms/radio/template/.content.json | 4 ++-- .../components/forms/select/template/.content.json | 4 ++-- .../components/forms/textarea/template/.content.json | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/checkbox/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/checkbox/template/.content.json index f845f4cdc..aa6b6c1bb 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/checkbox/template/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/checkbox/template/.content.json @@ -2,11 +2,11 @@ "label": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/label", - "title": "Label" + "label": "Checkbox Label" }, "field": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/checkbox", - "title": "Field" + "label": "Checkbox" } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/field/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/field/template/.content.json index de44c32a1..df0492474 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/field/template/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/field/template/.content.json @@ -2,11 +2,11 @@ "label": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/label", - "title": "Label" + "label": "Field Label" }, "field": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/input", - "title": "Field" + "label": "Field Input" } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/.content.json index 360a8cad0..60fff95c4 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/.content.json @@ -4,6 +4,6 @@ "isLayout": false, "sling:resourceType": "ws:Component", "description": "Form Button.", - "title": "Button", + "title": "Button Field", "sling:resourceSuperType": "typerefinery/components/forms/field" } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/template/.content.json index cec6d7d1e..aac2d4054 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/template/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/template/.content.json @@ -2,11 +2,11 @@ "label": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/label", - "title": "Label" + "label": "File Upload Label" }, "field": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/fileupload", - "title": "Field" + "label": "File Upload" } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/input/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/input/template/.content.json index de44c32a1..c8114cad1 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/input/template/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/input/template/.content.json @@ -2,11 +2,11 @@ "label": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/label", - "title": "Label" + "label": "Input Label" }, "field": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/input", - "title": "Field" + "label": "Input" } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/radio/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/radio/template/.content.json index 186171367..61b31846f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/radio/template/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/radio/template/.content.json @@ -2,11 +2,11 @@ "label": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/label", - "title": "Label" + "label": "Radio Label" }, "field": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/radio", - "title": "Field" + "label": "Radio" } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/select/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/select/template/.content.json index 852c07723..775de3d60 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/select/template/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/select/template/.content.json @@ -2,11 +2,11 @@ "label": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/label", - "title": "Label" + "label": "Select Label" }, "field": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/select", - "title": "Field" + "label": "Select" } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/textarea/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/textarea/template/.content.json index fa3a3cadc..a24342518 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/textarea/template/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/textarea/template/.content.json @@ -2,12 +2,12 @@ "label": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/label", - "title": "Label", + "label": "Textarea Label", "display": "none" }, "field": { "jcr:primaryType": "nt:unstructured", "sling:resourceType": "typerefinery/components/forms/fields/textarea", - "title": "Field" + "label": "Textarea" } } \ No newline at end of file From b4a2e8a48d00bfc86bef3a4ccb74796bf7a6607c Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 25 Mar 2024 23:32:23 +1100 Subject: [PATCH 042/206] add composite field. --- .../models/components/FlowComponent.java | 6 + .../models/components/forms/Composite.java | 55 ++++++ .../websight/services/flow/FlowService.java | 7 +- .../clientlibs-header/components.js | 25 ++- .../components/forms/composite/.content.json | 12 ++ .../components/forms/composite/composite.html | 19 ++ .../forms/composite/dialog/.content.json | 14 ++ .../forms/composite/template/.content.json | 12 ++ .../forms/fields/composite/.content.json | 10 ++ .../fields/composite/clientlibs/.content.json | 15 ++ .../fields/composite/clientlibs/behaviour.js | 14 ++ .../fields/composite/clientlibs/functions.js | 89 ++++++++++ .../forms/fields/composite/composite.html | 21 +++ .../fields/composite/dialog/.content.json | 46 +++++ .../forms/fields/composite/variant.html | 37 ++++ .../forms/form/clientlibs/behaviour.js | 6 +- .../forms/form/clientlibs/functions.js | 164 +++++++++++------- .../form/templates/flowform-service.json | 2 +- 18 files changed, 488 insertions(+), 66 deletions(-) create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Composite.java create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/composite/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/composite/composite.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/composite/dialog/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/composite/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/FlowComponent.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/FlowComponent.java index 56e566abe..63815632b 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/FlowComponent.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/FlowComponent.java @@ -136,6 +136,12 @@ public class FlowComponent extends BaseComponent { @Named(FlowService.PROPERTY_PREFIX + FlowService.PROPERTY_HTTPROUTE) public String flowapi_httproute; + @Getter + @Inject + @Nullable + @Named(FlowService.PROPERTY_PREFIX + FlowService.PROPERTY_HTTPROUTE_NOSFX) + public String flowapi_httproutenosfx; + @Getter @Inject @Nullable diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Composite.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Composite.java new file mode 100644 index 000000000..9853a1707 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Composite.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2023 Typerefinery.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ai.typerefinery.websight.models.components.forms; +import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; + +import org.apache.commons.lang3.StringUtils; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Model; + +import javax.annotation.PostConstruct; +import javax.inject.Inject; +import lombok.Getter; + +import ai.typerefinery.websight.models.components.BaseFormComponent; + +@Model(adaptables = Resource.class, defaultInjectionStrategy = OPTIONAL) +public class Composite extends BaseFormComponent { + + protected static final String DEFAULT_LABEL = "Composite"; + protected static final String DEFAULT_ID = "composite"; + protected static final String DEFAULT_MODULE = "composite"; + protected static final String DEFAULT_SELECT_CLASSES = "form-composite mt-1"; + + @Inject + @Getter + public String inputType; + + @Override + @PostConstruct + protected void init() { + this.module = DEFAULT_MODULE; + super.init(); + + if (StringUtils.isBlank(label)) { + this.label = DEFAULT_LABEL; + } + + style.addClasses(DEFAULT_SELECT_CLASSES); + + } + +} \ No newline at end of file diff --git a/application/backend/src/main/java/ai/typerefinery/websight/services/flow/FlowService.java b/application/backend/src/main/java/ai/typerefinery/websight/services/flow/FlowService.java index 54174fec0..e8ae0b530 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/services/flow/FlowService.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/services/flow/FlowService.java @@ -92,6 +92,7 @@ public class FlowService { public static final String PROPERTY_TEMPLATE_DESIGN = "designtemplate"; public static final String PROPERTY_ISCONTAINER = "iscontainer"; public static final String PROPERTY_HTTPROUTE = "httproute"; + public static final String PROPERTY_HTTPROUTE_NOSFX = "httproutenosfx"; public static final String PROPERTY_WEBSOCKETURL = "websocketurl"; public static final String PROPERTY_SAMPLEDATA = "sampledata"; // path to json to be used to seed flow with sample data @@ -110,6 +111,7 @@ public class FlowService { public static final String FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL = "<http-route-url>"; // used to specify which http route flow will use if any, eg form get url to be used /form/* will be updated to the {page URL}/* public static final String FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_SUFFIX = "/{{id}}"; // used to prefix http route url, eg form get url to be used /form/{{id}} will be updated to the {page URL}/{{id}}, this will allow client to substitiute the id in the url + public static final String FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_NOSFX = "<http-route-url-nosfx>"; // used to specify which http route flow will use if any, will be url without suffix public static final String FLOW_DEFAULT_TITLE_SUFFIX = " flow"; // used to generate flow title if not specified, flow title will be {page title} flow @@ -762,6 +764,7 @@ public String createFlowFromTemplate(@NotNull FlowComponent flowComponent) { response.put(prop(PROPERTY_CREATEDON), DateUtil.getIsoDate(new Date())); response.put(prop(PROPERTY_EDITURL), compileEditUrl(responseFlowId)); response.put(prop(PROPERTY_HTTPROUTE), compileClientHttpRouteUrl(httpRoutePath + FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_SUFFIX)); + response.put(prop(PROPERTY_HTTPROUTE_NOSFX), compileClientHttpRouteUrl(httpRoutePath)); response.put(prop(PROPERTY_WEBSOCKETURL), configuration.flow_tms_url()); LOGGER.info("flowstreamdata: {}", response); @@ -826,6 +829,7 @@ public void updateFlowFromTemplate(@NotNull FlowComponent flowComponent) { response.put(prop(PROPERTY_EDITURL), compileEditUrl(flowstreamid)); response.put(prop(PROPERTY_TITLE), newTitle); response.put(prop(PROPERTY_HTTPROUTE), compileClientHttpRouteUrl(httpRoutePath + FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_SUFFIX)); + response.put(prop(PROPERTY_HTTPROUTE_NOSFX), compileClientHttpRouteUrl(httpRoutePath)); response.put(prop(PROPERTY_WEBSOCKETURL), configuration.flow_tms_url()); LOGGER.info("flowstreamdata: {}", response); @@ -870,7 +874,8 @@ public HashMap<String, String> getReplaceMap(String childFlowId, String flowstre put(FLOW_TEMPLATE_FIELD_PRINTJSON_ID, StringUtils.join(childPathId, "printjson")); put(FLOW_TEMPLATE_FIELD_SENDDATA_ID, StringUtils.join(childPathId, "senddata")); put(FLOW_TEMPLATE_FIELD_PUBLISH_ID, StringUtils.join(childPathId, "publish")); - put(FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL, httpRoutePath + FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_SUFFIX); // used for HTTP Route step, eg in forms + put(FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL, httpRoutePath + FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_SUFFIX); // used for HTTP Route step, eg in forms + put(FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_NOSFX, httpRoutePath); // used for HTTP Route step with url without suffix, eg in forms put(FLOW_TEMPLATE_FIELD_SAMPLE_DATA, componentSampleDataValueFinal); // used for HTTP Route step, eg in forms put(FLOW_TEMPLATE_FIELD_TMS_TOPIC, topic); // used for filtering TMS messages }}; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js index 380808985..c116d5a8c 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js @@ -2,15 +2,36 @@ window.Typerefinery = window.Typerefinery || {}; window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.VueData = Typerefinery.VueData || {}; -; (function (ns, vueDataNs, document, window) { +;(function ($, ns, vueDataNs, document, window) { "use strict"; + + ns.findExclude = function($component, selector, mask) { + return $component.find(selector).not($component.find(mask).find(selector)); + } + ns.registerComponent = (componentData) => { vueDataNs.data = { ...vueDataNs.data, ...componentData } }; + + ns.isTrue = function(value) { + // if undefined or null return false + if (value == null) { + return false; + } + return new Boolean(value) == true; + }; + + ns.isJQuery = function(obj) { + //test if object is a jQuery object + return obj instanceof $ || (typeof obj === "object" && obj != null && obj.jquery != null); + }; ns.getComponentConfig = ($component) => { + if (ns.isJQuery($component)) { + return $component.data('model') || {}; + } return $($component).data('model') || {}; }; ns.hasRegex = (str) => { @@ -88,4 +109,4 @@ window.Typerefinery.VueData = Typerefinery.VueData || {}; }, 1000); }; ns.init(); -})(window.Typerefinery.Components, window.Typerefinery.VueData, document, window); +})(jQuery, window.Typerefinery.Components, window.Typerefinery.VueData, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/.content.json new file mode 100644 index 000000000..835654f96 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/.content.json @@ -0,0 +1,12 @@ +{ + "isContainer": true, + "group": "Typerefinery - Forms", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Form Composite", + "title": "Composite Field", + "sling:resourceSuperType": "typerefinery/components/forms/field", + "allowedComponents": [ + "Typerefinery - Forms" + ] +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/composite.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/composite.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/composite.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/dialog/.content.json new file mode 100644 index 000000000..27c484a99 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/dialog/.content.json @@ -0,0 +1,14 @@ +{ + "sling:resourceType": "wcm/dialogs/dialog", + "tabs": { + "sling:resourceType": "wcm/dialogs/components/tabs", + "gridTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "alignmentTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/alignment" + } + } +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/template/.content.json new file mode 100644 index 000000000..f5d9142ca --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/template/.content.json @@ -0,0 +1,12 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Composite" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/composite", + "label": "Composite Field" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/.content.json new file mode 100644 index 000000000..7bb7d435e --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/.content.json @@ -0,0 +1,10 @@ +{ + "isContainer": true, + "group": ".hidden", + "sling:resourceType": "ws:Component", + "description": "This is Composite field returning JSON of its values", + "title": "Composite", + "allowedComponents": [ + "Typerefinery - Forms" + ] +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/.content.json new file mode 100644 index 000000000..02123e829 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/.content.json @@ -0,0 +1,15 @@ +{ + "title": "Client Libs - Forms", + "jcr:primaryType": "sling:Folder", + "sling:resourceType": "io/typerefinery/websight/clientlibs", + "categories": [ + "ai.typerefinery.websight.components", + "ai.typerefinery.websight.components.forms.composite" + ], + "css": [ + ], + "js": [ + "functions.js", + "behaviour.js" + ] +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js new file mode 100644 index 000000000..0ff9cb514 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js @@ -0,0 +1,14 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; +window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.Composite || {}; + +;(function (ns, document) { + "use strict"; + $(document).ready(function () { + console.log('Composite component Behaviour loaded'); + $("[component='composite']").each(function () { + ns.init(this); + }); + }); +})(window.Typerefinery.Components.Forms.Composite, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js new file mode 100644 index 000000000..6da36a450 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js @@ -0,0 +1,89 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; +window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.Composite || {}; + + +;(function ($, ns, componentNs, window, document) { + "use strict"; + + ns.selectorAttribute = "isCompositeParent"; + ns.selector = `[${ns.selectorAttribute}]`; + ns.selectorValueAttribute = "isCompositeValue"; + ns.selectorValue = `[${ns.selectorValueAttribute}]`; + //how to find all form input fields + ns.selectorInputAttribute = "isInput"; + ns.selectorInput = `[${ns.selectorInputAttribute}]`; + //how to find all input fields that are part of this composite input + ns.selectorCompositeInputAttribute = "isCompositeInput"; + ns.selectorCompositeInput = `[${ns.selectorCompositeInputAttribute}]`; + //template for form components in parent + ns.selectorTemplate = "> [template]"; + ns.selectonNameAttribute = "name"; + + $.fn.findExclude = function(selector, mask) { + return this.find(selector).not(this.find(mask).find(selector)); + } + + $.fn.compositeVal = function() { + //get all immediate isCompositeParent + var $compositeParents = this.parent(ns.selector).findExclude(ns.selector,ns.selector); + var data = {}; + + //add current field values to data + Object.assign(data,JSON.parse(this.val())); + + //for each get their values and merge their composites in + $compositeParents.each(function(){ + //find composite value input field + var $compositeValue = $(this).findExclude(ns.selectorValue,ns.selector); + if ($compositeValue) { + // create placeholder for composite value + data[$compositeValue.attr(ns.selectonNameAttribute)] = {}; + // get composite value for this field, this will cascade to other composite fields + Object.assign(data[$compositeValue.attr(ns.selectonNameAttribute)],$compositeValue.compositeVal()); + } + }); + return data; + } + + ns.compileValue = function($compositeParent) { + var $field = $compositeParent.findExclude(ns.selectorValue,ns.selector); + var $templateFields = $compositeParent.findExclude(ns.selectorTemplate,ns.selector).findExclude(ns.selectorCompositeInput,ns.selector); + var data = {}; + + $templateFields.each(function(){ + //get name and value of each input field + var name = $(this).attr(ns.selectonNameAttribute); + var value = $(this).val(); + data[name] = value; + }); + //set value of composite input + $field.val(JSON.stringify(data)); + } + + ns.init = async ($component) => { + const componentConfig = componentNs.getComponentConfig($component); + + $(document).ready(function () { + + $(ns.selector).each(function(){ + //find all input fields that are not inside another composite input + var $field = $(this).findExclude(ns.selectorTemplate,ns.selector).findExclude(ns.selectorInput, ns.selector); + //remove isInput attribute and add isCompositeInput attribute, this will ensure that form fields are not processed by form submit + $field.removeAttr(ns.selectorInputAttribute); + $field.attr(ns.selectorCompositeInputAttribute,"true"); + //compile value for composite input + ns.compileValue($(this)); + }); + }) + + //listen for change event on all input fields and compile value for composite input + $(ns.selector).on("change", function() { + ns.compileValue($(this)); + }); + + } + + +})(jQuery, Typerefinery.Components.Forms.Composite, window.Typerefinery.Components, window, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html new file mode 100644 index 000000000..c28c618b3 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html @@ -0,0 +1,21 @@ +<!--/* + Copyright (C) 2023 Typerefinery.io + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Composite"> + <div class="${model.componentClassNames}" id="${model.id}" type="${model.inputType}" component="${model.componentName}" isCompositeParent="true"> + <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> + </sly> + </div> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json new file mode 100644 index 000000000..4b7fafc38 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json @@ -0,0 +1,46 @@ +{ + "sling:resourceType": "wcm/dialogs/dialog", + "tabs": { + "sling:resourceType": "wcm/dialogs/components/tabs", + "generalTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "General", + "warning": { + "sling:resourceType": "typerefinery/components/dialog/label", + "ws:disallowedContext": ["edit:dialog"], + "appearance": "error", + "iconLabel": "Open Dialog", + "title": "Some fields are not editable in side-panel.", + "message": "Please open this component in dialog to edit these fields.", + "secondaryText": "", + "placement": "bottom-start" + }, + "fieldName": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/forms/form/common/fieldName" + }, + "inputType": { + "sling:resourceType": "wcm/dialogs/components/select", + "name": "inputType", + "label": "Type", + "granularmarking": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Composite", + "value": "composite" + } + } + }, + "validationTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/validation" + }, + "gridTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" + } + } +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html new file mode 100644 index 000000000..bc44db212 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html @@ -0,0 +1,37 @@ +<!--/* + Copyright (C) 2023 Typerefinery.io + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<template data-sly-template.variant="${ @ model }"> + <input + component="${model.componentName}" + isInput="true" + id="${model.id}" + type="${model.inputType}" + name="${model.name}" + data-fieldId="${model.id}-${model.name}" + placeholder="${model.placeholder}" + class="${model.variantClassNames} form-control" + required="${model.validationRequired}" + data-model="${model.jsonString}" + disabled="${model.disabled}" + isCompositeValue="true" + hidden + > + </input> + <div template> + <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> + </div> + <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle}</div> +</template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/behaviour.js index d52d01e6b..35e79d1c5 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/behaviour.js @@ -3,11 +3,11 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Form = Typerefinery.Components.Forms.Form || {}; -(function (ns, document) { +(function ($, ns, document) { "use strict"; $(document).ready(function () { $('[component="form"]').each(function () { - ns.init(this); + ns.init($(this)); }); }); -})(window.Typerefinery.Components.Forms.Form, document); +})(jQuery, window.Typerefinery.Components.Forms.Form, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index 7a4d11b1e..63942083f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -2,19 +2,22 @@ window.Typerefinery = window.Typerefinery || {}; window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Form = Typerefinery.Components.Forms.Form || {}; -window.Typerefinery.Components.Forms.Form = Typerefinery.Components.Forms.Form || {}; window.Typerefinery.Components.Widgets = Typerefinery.Components.Widgets || {}; window.Typerefinery.Components.Widgets.Editor = Typerefinery.Components.Widgets.Editor || {}; window.Typerefinery.Components.Widgets.Editor.Instances = Typerefinery.Components.Widgets.Editor.Instances || {}; window.Typerefinery.Components.Forms.Select = Typerefinery.Components.Forms.Select || {}; window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components.Forms.Select.Instances || {}; +window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.Composite || {}; Typerefinery.Page = Typerefinery.Page || {}; Typerefinery.Page.Events = Typerefinery.Page.Events || {}; -(function (ns, componentNs, editorInstanceNs, selectInstanceNs, eventNs, document, window) { +(function ($, ns, componentNs, editorInstanceNs, selectInstanceNs, compositeNs, eventNs, document, window) { "use strict"; ns.filesUrl = "https://files.typerefinery.localhost:8101"; + + ns.selectorInputAttribute = "isInput"; + ns.selectorInput = `[${ns.selectorInputAttribute}]`; ns.uploadFile = async (file) => { const fileName = file?.name?.trim()?.replace(/\s/g, "-"); @@ -71,26 +74,48 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.getFormData = async ($component) => { const result = {}; - const _inputs = $component.querySelectorAll("[isInput]"); - for(let i = 0; i < _inputs.length; i++) { - const $input = _inputs[i]; - const name = $input.getAttribute("name"); + // get all non composite fields and immidiate composite fields. + const $formComponents = $component.findExclude(`${ns.selectorInput},${compositeNs.selector}`,compositeNs.selector); + console.log(["getFormData", $formComponents, $component]) + // using for to ensure async await works. + for(let i = 0; i < $formComponents.length; i++) { + const $input = $($formComponents[i]); + const inputObject = $input.get(0); + console.log($input); + const name = $input.attr("name"); + + //is this input field + const isInput = $input.attr(ns.selectorInputAttribute); + //is this composite value + const isCompositeParent = componentNs.isTrue($input.attr(compositeNs.selectorAttribute)); + + console.log(["getFormData form component", name, isInput, isCompositeParent]); + if (name) { - const isInput = $input.getAttribute('isInput'); - if(isInput === "child") { + //is this select tag + const isSelect = $input.prop("tagName") === "SELECT"; + //is this file input + const isFile = $input.type === "file"; + // is this text area or input field. + const isChild = isInput === "child"; + + console.log(["getFormData basic form component", isSelect, isFile, isChild]); + + if(isChild) { // get value from child component const $firstChild = $input.children[0]; // get value from codemirror editor - result[name] = editorInstanceNs[$firstChild.getAttribute("id")].getValue(); + result[name] = editorInstanceNs[$firstChild.attr("id")].getValue(); - }else if($input.tagName === "SELECT") { + }else if(isSelect) { // get value from select tag - result[name] = selectInstanceNs[$input.getAttribute("id")].getValue(true); - }else if($input.type === "file") { + result[name] = selectInstanceNs[$input.attr("id")].getValue(true); + }else if(isFile) { - const files = [...$input.files]; + + const files = [...inputObject.files]; // add loader. files.forEach(file => { const fileName = file?.name?.trim()?.replace(/\s/g, "-"); @@ -117,14 +142,25 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; result[name] = ""; } - - } else { // get value from $input tag - result[name] = $input?.value || ""; + result[name] = $input.val(); } + + } else if(isCompositeParent) { + + console.log(["getFormData composite component", name, isCompositeParent]); + + // get value from composite value + var $compositeValue = $input.findExclude(compositeNs.selectorValue, compositeNs.selector); + console.log(["getFormData composite value input", $compositeValue]); + var compositeValueName = $compositeValue.attr(compositeNs.selectonNameAttribute); + console.log(["getFormData composite value", $compositeValue]); + result[compositeValueName] = {}; + Object.assign(result[compositeValueName], $compositeValue.compositeVal()); } } + console.log(["getFormData", result]); return result; }; @@ -232,19 +268,19 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; }; ns.updateButtonState = ($component, state) => { - const $button = $component.querySelector("button[type='submit']"); + const $button = $component.find("button[type='submit']"); if ($button) { // disable the button and loading text $button.disabled = state === "loading"; - $button.innerHTML = state === "loading" ? `<i class="pi pi-spin pi-spinner"></i>` : $button.getAttribute("data-label"); + $button.innerHTML = state === "loading" ? `<i class="pi pi-spin pi-spinner"></i>` : $button.attr("data-label"); } }; ns.formSubmitHandler = async ($component) => { const componentConfig = componentNs.getComponentConfig($component); - console.log(["componentConfig", componentConfig]) + console.log(["formSubmitHandler", componentConfig, $component]) let { writePayloadType, writeMethod, writeUrl } = componentConfig; if (!writePayloadType || !writeMethod || !writeUrl) { console.log("Author should fill all the parameters."); @@ -263,41 +299,50 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.updateButtonState($component, "completed"); }; - ns.loadInitialData = async ($component) => { + ns.loadInitialData = async ($component, initConfig) => { try { - const componentConfig = componentNs.getComponentConfig($component); + const componentConfig = initConfig || componentNs.getComponentConfig($component); const { readUrl, readMethod = "GET", readPayloadType = "application/json", id } = componentConfig; - if (!readUrl) { + if (!readUrl && readUrl != "") { return; } - + console.log(["componentConfig", componentConfig, readUrl, readMethod, readPayloadType]); const url = componentNs.replaceRegex(readUrl, componentNs.getQueryParams()); - const response = await fetch( - url, - { - method: readMethod || "GET", - headers: { - "Content-Type": readPayloadType || "application/json" - }, - keepalive: true, - redirect: 'follow' - } - ).then(response => response.json()); - - $component.querySelectorAll("[isInput]").forEach($item => { + try { + const response = await fetch( + url, + { + method: readMethod || "GET", + headers: { + "Content-Type": readPayloadType || "application/json" + }, + keepalive: true, + redirect: 'follow' + } + ).then(response => response.json()); + + } catch (error) { + console.log(`Could not read data from ${readUrl}, possible reasons: querystring is missing; endpoint does not provide default data; CORS issue or server error.`); + console.error(error); + return; + } - const name = $item.getAttribute("name"); + // loop through all the input fields and set the value from the response. + $component.find("[isInput]").each(function() { + const $item = $(this); + + const name = $item.attr("name"); if (!response[name]) { return; } - const isInput = $item.getAttribute('isInput'); + const isInput = $item.attr('isInput'); if (isInput === "true") { // if select tag then update the option with selected attribute if ($item.tagName === "SELECT") { - const options = $item.querySelectorAll("option"); + const options = $item.find("option"); // if response[name] is string then split by , and trim all. if (typeof response[name] === "string") { @@ -306,35 +351,37 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; // if response[name] is array then loop through the array and check wether the option value is present in the array or not. if (Array.isArray(response[name])) { - // check wether choice js is rendered then update the value of the select tag - options.forEach(option => { - if (response[name].includes(option.getAttribute("value"))) { - option.setAttribute("selected", true); + // if choice js gas not rendered the select, set values in select tag. + options.each(function() { + const option = $(this); + if (response[name].includes(option.attr("value"))) { + option.attr("selected", true); } }); - response[name].forEach((option) => { - selectInstanceNs[`${$item.getAttribute('id')}`].setChoiceByValue(option); + //set values in choice js instance + response[name].forEach(function(option) { + selectInstanceNs[`${$item.attr('id')}`].setChoiceByValue(option); }); - // $(`#${$item.getAttribute('id')}`).val(response[name]); + // $(`#${$item.attr('id')}`).val(response[name]); } } // if item type is checked or radio then set checked attribute - if ($item.getAttribute("type") === "checkbox" || $item.getAttribute("type") === "radio") { + if ($item.attr("type") === "checkbox" || $item.attr("type") === "radio") { if (response[name]) { - $item.setAttribute("checked", name); + $item.attr("checked", name); } } // set value attribute - $item.setAttribute("value", response[name]); + $item.attr("value", response[name]); } else if (isInput === "child") { // check the first children of the $item component and check wether it is editable or not and set the value accordingly. const $firstChild = $item.children[0]; const editorConfig = componentNs.getComponentConfig($firstChild) - if ($firstChild.getAttribute("component") === "editor") { + if ($firstChild.attr("component") === "editor") { if (editorInstanceNs[`${editorConfig.id}`]) { if (editorConfig.variant === "CODE_EDITOR") { @@ -348,10 +395,10 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } } }); - $component.querySelectorAll("[data-field-name]").forEach( + $component.find("[data-field-name]").forEach( $item => { - const fieldName = $item.getAttribute("data-field-name"); - const componentId = $item.getAttribute("data-field-componentId"); + const fieldName = $item.attr("data-field-name"); + const componentId = $item.attr("data-field-componentId"); if (response[fieldName]) { const key = `${componentId}-${fieldName}`; eventNs.emitEvent(key, { @@ -371,25 +418,24 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } ns.addEventListener = ($component) => { - $component.addEventListener("submit", function (e) { - + $component.on("submit", function (e) { console.log("---------------SUBMITTING----------------") e.preventDefault(); const { target } = e; console.log(target) - ns.formSubmitHandler(target); + ns.formSubmitHandler($(target)); }); }; ns.init = ($component) => { const componentConfig = componentNs.getComponentConfig($component); + console.log(["forms init", componentConfig, "componentConfig", $component]); if (Object.keys(componentConfig).length === 0) { - console.log(componentConfig, "componentConfig", $component) console.log("Component config of form component is missing"); return; } - ns.loadInitialData($component); + ns.loadInitialData($component, componentConfig); ns.addEventListener($component); } -})(Typerefinery.Components.Forms.Form, Typerefinery.Components, Typerefinery.Components.Widgets.Editor.Instances, Typerefinery.Components.Forms.Select.Instances, Typerefinery.Page.Events, document, window); \ No newline at end of file +})(jQuery, Typerefinery.Components.Forms.Form, Typerefinery.Components, Typerefinery.Components.Widgets.Editor.Instances, Typerefinery.Components.Forms.Select.Instances, window.Typerefinery.Components.Forms.Composite, Typerefinery.Page.Events, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/templates/flowform-service.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/templates/flowform-service.json index 54f8652fb..a5bd7ab55 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/templates/flowform-service.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/templates/flowform-service.json @@ -51,7 +51,7 @@ "httppost": { "id": "httppost", "config": { - "url": "<http-route-url>", + "url": "<http-route-url-nosfx>", "method": "POST", "timeout": 5000, "limit": 5120, From 9992fc044a8161c9e538b6b30b5e64edc7b47aca Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 26 Mar 2024 00:15:08 +1100 Subject: [PATCH 043/206] add stix composite fields. --- .../components/forms/form/.content.json | 1 + .../components/layout/container/.content.json | 1 + .../composite/externalreference/.content.json | 9 ++ .../externalreference/externalreference.html | 19 +++ .../externalreference/template/.content.json | 93 ++++++++++++++ .../composite/granularmarking/.content.json | 9 ++ .../granularmarking/granularmarking.html | 19 +++ .../granularmarking/template/.content.json | 61 +++++++++ .../composite/killchainphase/.content.json | 9 ++ .../killchainphase/killchainphase.html | 19 +++ .../killchainphase/template/.content.json | 45 +++++++ .../components/stix/forms/field/.content.json | 3 +- .../stix/forms/fields/composite/.content.json | 7 + .../fields/composite/clientlibs/.content.json | 17 +++ .../fields/composite/clientlibs/behaviour.js | 15 +++ .../fields/composite/clientlibs/functions.js | 90 +++++++++++++ .../forms/fields/composite/composite.html | 21 +++ .../fields/composite/dialog/.content.json | 120 ++++++++++++++++++ .../stix/forms/fields/composite/variant.html | 36 ++++++ 19 files changed, 593 insertions(+), 1 deletion(-) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/externalreference/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/externalreference/externalreference.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/externalreference/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/granularmarking/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/granularmarking/granularmarking.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/granularmarking/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/killchainphase/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/killchainphase/killchainphase.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/killchainphase/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/behaviour.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/functions.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/composite.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/dialog/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/.content.json index 28d3db37b..af4b81abf 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/.content.json @@ -8,6 +8,7 @@ "Typerefinery - Forms", "Typerefinery - Forms - Stix - Input", "Typerefinery - Forms - Stix - Select", + "Typerefinery - Forms - Stix - Composite", "Typerefinery - Graphs", "Typerefinery - Layout", "Typerefinery - List", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/.content.json index 83c2fb654..a1b5eb295 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/.content.json @@ -8,6 +8,7 @@ "Typerefinery - Forms", "Typerefinery - Forms - Stix - Input", "Typerefinery - Forms - Stix - Select", + "Typerefinery - Forms - Stix - Composite", "Typerefinery - Graphs", "Typerefinery - Layout", "Typerefinery - List", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/externalreference/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/externalreference/.content.json new file mode 100644 index 000000000..f15a716a7 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/externalreference/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Composite", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "External Reference composite field.", + "title": "External Reference", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/externalreference/externalreference.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/externalreference/externalreference.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/externalreference/externalreference.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/externalreference/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/externalreference/template/.content.json new file mode 100644 index 000000000..de9a4e95b --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/externalreference/template/.content.json @@ -0,0 +1,93 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "External Reference" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/composite", + "label": "External Reference Field", + "inputType": "externalreference", + "source_name": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/input", + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "source_name" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "source_name", + "name": "source_name", + "inputType": "string" + } + }, + "description": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/input", + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "description" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "description", + "name": "description", + "inputType": "string" + } + }, + "url": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/input", + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "url" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "url", + "name": "url", + "inputType": "string" + } + }, + "hashes": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/input", + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "hashes" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "hashes", + "name": "hashes", + "inputType": "string" + } + }, + "external_id": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/input", + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "external_id" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "external_id", + "name": "external_id", + "inputType": "string" + } + } + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/granularmarking/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/granularmarking/.content.json new file mode 100644 index 000000000..eb6f070bf --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/granularmarking/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Composite", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Granular Marking composite field.", + "title": "Granular Marking", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/granularmarking/granularmarking.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/granularmarking/granularmarking.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/granularmarking/granularmarking.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/granularmarking/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/granularmarking/template/.content.json new file mode 100644 index 000000000..829178066 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/granularmarking/template/.content.json @@ -0,0 +1,61 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Granular Marking" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/composite", + "label": "Granular Marking Field", + "inputType": "granularmarking", + "lang": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/input", + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "lang" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "lang", + "name": "lang", + "inputType": "string" + } + }, + "marking_ref": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/input", + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "marking_ref" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "marking_ref", + "name": "marking_ref", + "inputType": "string" + } + }, + "selectors": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/input", + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "selectors" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "selectors", + "name": "selectors", + "inputType": "string" + } + } + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/killchainphase/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/killchainphase/.content.json new file mode 100644 index 000000000..cd4eae2a1 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/killchainphase/.content.json @@ -0,0 +1,9 @@ +{ + "isContainer": false, + "group": "Typerefinery - Forms - Stix - Composite", + "isLayout": false, + "sling:resourceType": "ws:Component", + "description": "Kill Chain Phase composite field.", + "title": "Kill Chain Phase", + "sling:resourceSuperType": "typerefinery/components/stix/forms/field" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/killchainphase/killchainphase.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/killchainphase/killchainphase.html new file mode 100644 index 000000000..333fe8a4d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/killchainphase/killchainphase.html @@ -0,0 +1,19 @@ +<!--/* + Copyright (C) 2023 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Field" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/killchainphase/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/killchainphase/template/.content.json new file mode 100644 index 000000000..6fdbf9545 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/composite/killchainphase/template/.content.json @@ -0,0 +1,45 @@ +{ + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "Kill Chain Phase" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/composite", + "label": "Kill Chain Phase Field", + "inputType": "killchainphase", + "kill_chain_name": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/input", + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "kill_chain_name" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "kill_chain_name", + "name": "kill_chain_name", + "inputType": "string" + } + }, + "phase_name": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/input", + "label": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/forms/fields/label", + "label": "phase_name" + }, + "field": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "typerefinery/components/stix/forms/fields/input", + "label": "phase_name", + "name": "phase_name", + "inputType": "string" + } + } + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/.content.json index 0dabd9118..dc95c41bb 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/.content.json @@ -4,7 +4,8 @@ "isLayout": false, "allowedComponents": [ "Typerefinery - Forms - Stix - Input", - "Typerefinery - Forms - Stix - Select" + "Typerefinery - Forms - Stix - Select", + "Typerefinery - Forms - Stix - Composite" ], "sling:resourceType": "ws:Component", "description": "Container for form elements", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/.content.json new file mode 100644 index 000000000..7d130996e --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/.content.json @@ -0,0 +1,7 @@ +{ + "isContainer": true, + "group": ".hidden", + "sling:resourceType": "ws:Component", + "description": "This is Composite field returning JSON of its values", + "title": "Composite" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/.content.json new file mode 100644 index 000000000..b5d2d82f3 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/.content.json @@ -0,0 +1,17 @@ +{ + "title": "Client Libs - Forms - Stix - Select", + "jcr:primaryType": "sling:Folder", + "sling:resourceType": "io/typerefinery/websight/clientlibs", + "categories": [ + "ai.typerefinery.websight.components", + "ai.typerefinery.websight.components.stix.forms.select" + ], + "css": [ + "/apps/typerefinery/clientlibs/vendor/select/style.css" + ], + "js": [ + "/apps/typerefinery/clientlibs/vendor/select/script.js", + "functions.js", + "behaviour.js" + ] +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/behaviour.js new file mode 100644 index 000000000..cc9b8ada3 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/behaviour.js @@ -0,0 +1,15 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; +window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; +window.Typerefinery.Components.Stix.Forms.Composite = Typerefinery.Components.Stix.Forms.Composite || {}; + +;(function (ns, document) { + "use strict"; + $(document).ready(function () { + console.log('Stix Composite component Behaviour loaded'); + $("[component='stix-composite']").each(function () { + ns.init(this); + }); + }); +})(window.Typerefinery.Components.Stix.Forms.Composite, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/functions.js new file mode 100644 index 000000000..490376add --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/functions.js @@ -0,0 +1,90 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; +window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; +window.Typerefinery.Components.Stix.Forms.Composite = Typerefinery.Components.Stix.Forms.Composite || {}; + + +;(function ($, ns, componentNs, window, document) { + "use strict"; + + ns.selectorAttribute = "isCompositeParent"; + ns.selector = `[${ns.selectorAttribute}]`; + ns.selectorValueAttribute = "isCompositeValue"; + ns.selectorValue = `[${ns.selectorValueAttribute}]`; + //how to find all form input fields + ns.selectorInputAttribute = "isInput"; + ns.selectorInput = `[${ns.selectorInputAttribute}]`; + //how to find all input fields that are part of this composite input + ns.selectorCompositeInputAttribute = "isCompositeInput"; + ns.selectorCompositeInput = `[${ns.selectorCompositeInputAttribute}]`; + //template for form components in parent + ns.selectorTemplate = "> [template]"; + ns.selectonNameAttribute = "name"; + + $.fn.findExclude = function(selector, mask) { + return this.find(selector).not(this.find(mask).find(selector)); + } + + $.fn.compositeVal = function() { + //get all immediate isCompositeParent + var $compositeParents = this.parent(ns.selector).findExclude(ns.selector,ns.selector); + var data = {}; + + //add current field values to data + Object.assign(data,JSON.parse(this.val())); + + //for each get their values and merge their composites in + $compositeParents.each(function(){ + //find composite value input field + var $compositeValue = $(this).findExclude(ns.selectorValue,ns.selector); + if ($compositeValue) { + // create placeholder for composite value + data[$compositeValue.attr(ns.selectonNameAttribute)] = {}; + // get composite value for this field, this will cascade to other composite fields + Object.assign(data[$compositeValue.attr(ns.selectonNameAttribute)],$compositeValue.compositeVal()); + } + }); + return data; + } + + ns.compileValue = function($compositeParent) { + var $field = $compositeParent.findExclude(ns.selectorValue,ns.selector); + var $templateFields = $compositeParent.findExclude(ns.selectorTemplate,ns.selector).findExclude(ns.selectorCompositeInput,ns.selector); + var data = {}; + + $templateFields.each(function(){ + //get name and value of each input field + var name = $(this).attr(ns.selectonNameAttribute); + var value = $(this).val(); + data[name] = value; + }); + //set value of composite input + $field.val(JSON.stringify(data)); + } + + ns.init = async ($component) => { + const componentConfig = componentNs.getComponentConfig($component); + + $(document).ready(function () { + + $(ns.selector).each(function(){ + //find all input fields that are not inside another composite input + var $field = $(this).findExclude(ns.selectorTemplate,ns.selector).findExclude(ns.selectorInput, ns.selector); + //remove isInput attribute and add isCompositeInput attribute, this will ensure that form fields are not processed by form submit + $field.removeAttr(ns.selectorInputAttribute); + $field.attr(ns.selectorCompositeInputAttribute,"true"); + //compile value for composite input + ns.compileValue($(this)); + }); + }) + + //listen for change event on all input fields and compile value for composite input + $(ns.selector).on("change", function() { + ns.compileValue($(this)); + }); + + } + + +})(jQuery, Typerefinery.Components.Stix.Forms.Composite, Typerefinery.Components, window, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/composite.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/composite.html new file mode 100644 index 000000000..706da7d2c --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/composite.html @@ -0,0 +1,21 @@ +<!--/* + Copyright (C) 2023 Typerefinery.io + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Composite"> + <div class="${model.componentClassNames}" id="${model.id}" type="${model.inputType}" component="stix-${model.componentName}" isCompositeParent="true"> + <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> + </sly> + </div> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/dialog/.content.json new file mode 100644 index 000000000..b34c497c2 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/dialog/.content.json @@ -0,0 +1,120 @@ +{ + "sling:resourceType": "wcm/dialogs/dialog", + "tabs": { + "sling:resourceType": "wcm/dialogs/components/tabs", + "generalTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "General", + "warning": { + "sling:resourceType": "typerefinery/components/dialog/label", + "ws:disallowedContext": ["edit:dialog"], + "appearance": "error", + "iconLabel": "Open Dialog", + "title": "Some fields are not editable in side-panel.", + "message": "Please open this component in dialog to edit these fields.", + "secondaryText": "", + "placement": "bottom-start" + }, + "fieldName": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/forms/form/common/fieldName" + }, + "inputType": { + "sling:resourceType": "wcm/dialogs/components/select", + "name": "inputType", + "label": "Type", + "granularmarking": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Granular Marking", + "value": "granularmarking" + }, + "externalreference": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "External Reference", + "value": "externalreference" + }, + "killchainphase": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Kill Chain Phase", + "value": "killchainphase" + } + }, + "selectOptions": { + "name": "selectOptions", + "label": "Add Options", + "description": "If option endpoint is mentioned then options will be read from datasource", + "sling:resourceType": "wcm/dialogs/components/multifield", + "ws:disallowedContext": ["edit:panel"], + "labelText": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "label", + "label": "Label" + }, + "value": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "value", + "label": "Value" + } + } + + }, + "optionsTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Options", + "readOptionsFromDataSource": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "readOptionsFromDataSource", + "label": "Read options from data source", + "description": "Enter the path to a data source. The data source must be a JSON array of objects with label and value properties." + }, + "keyNameInOptionList": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "keyNameInOptionList", + "label": "Key name in option list" + }, + "labelNameInOptionList": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "labelNameInOptionList", + "label": "Label name in option list" + } + }, + "advancedTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Advanced", + "multipleSelection": { + "sling:resourceType": "wcm/dialogs/components/toggle", + "name": "multipleSelection", + "label": "Multiple Select" + }, + "maxSelection": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "maxSelection", + "label": "Max Selections", + "ws:display": { + "condition": { + "sourceName": "multipleSelection", + "values": true + } + } + }, + "defaultSelectedOptions": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "defaultSelectedOptions", + "label": "Default Selected Options", + "description": "Comma separated list of values to be selected by default" + } + }, + "validationTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/validation" + }, + "gridTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" + } + } +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html new file mode 100644 index 000000000..8eec4015b --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html @@ -0,0 +1,36 @@ +<!--/* + Copyright (C) 2023 Typerefinery.io + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<template data-sly-template.variant="${ @ model }"> + <input + component="${model.componentName}" + isInput="true" + id="${model.id}" + type="${model.inputType}" + name="${model.name}" + data-fieldId="${model.id}-${model.name}" + placeholder="${model.placeholder}" + class="${model.variantClassNames} form-control" + required="${model.validationRequired}" + data-model="${model.jsonString}" + disabled="${model.disabled}" + isCompositeValue="true" + hidden + > + </input> + <div template> + <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> + </div> +</template> \ No newline at end of file From b3505a0759d2342d9a0b68c9a5eecbc69b9ae5da Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 26 Mar 2024 23:40:05 +1100 Subject: [PATCH 044/206] add parsys component to only render nodes that have sling resource type. --- .../apps/typerefinery/components/parsys/.content.json | 7 +++++++ .../apps/typerefinery/components/parsys/parsys.html | 1 + 2 files changed, 8 insertions(+) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/parsys/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/parsys/parsys.html diff --git a/application/backend/src/main/resources/apps/typerefinery/components/parsys/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/parsys/.content.json new file mode 100644 index 000000000..b18c2a816 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/parsys/.content.json @@ -0,0 +1,7 @@ +{ + "isContainer": true, + "group": ".hidden", + "sling:resourceType": "ws:Component", + "description": "Paragraph System component responsible for rendering sub-nodes.", + "title": "Parsys Component" +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/parsys/parsys.html b/application/backend/src/main/resources/apps/typerefinery/components/parsys/parsys.html new file mode 100644 index 000000000..872d16fef --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/parsys/parsys.html @@ -0,0 +1 @@ +<sly data-sly-repeat.paragraph="${resource.children}"><sly data-sly-test="${paragraph.resourceType && paragraph['sling:resourceType']}" data-sly-resource="${paragraph.path @ resourceType=paragraph.resourceType}"></sly></sly><!--/*do not add empty line at the end of file*/--> \ No newline at end of file From c588f52e1ed2e736a3730e175c77b06c86145869 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 12:09:26 +1100 Subject: [PATCH 045/206] add new dialog component to list component actions. --- .../websight/models/components/KeyValue.java | 39 ++++++++ .../models/components/KeyValuePair.java | 6 +- .../websight/models/dialog/Dialog.java | 94 +++++++++++++++++++ .../dialog/eventactions/EventActions.js | 65 +++++++++++++ .../components/dialog/eventactions/README.md | 17 ++++ .../eventactions/eventactions.json.html | 17 ++++ .../selectitem/selectitem.json.html | 6 ++ 7 files changed, 241 insertions(+), 3 deletions(-) create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/models/components/KeyValue.java create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/models/dialog/Dialog.java create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/EventActions.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/README.md create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/eventactions.json.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/selectitem/selectitem.json.html diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/KeyValue.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/KeyValue.java new file mode 100644 index 000000000..6ca645bc8 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/KeyValue.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 Typerefinery.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ai.typerefinery.websight.models.components; + +import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; + +import javax.inject.Inject; +import lombok.Getter; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Model; + +public class KeyValue { + + @Getter + public String key; + + @Getter + public String value; + + public KeyValue(String key, String value) { + this.key = key; + this.value = value; + } + +} diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/KeyValuePair.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/KeyValuePair.java index 8e0470485..df1f17182 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/KeyValuePair.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/KeyValuePair.java @@ -22,17 +22,17 @@ import lombok.Getter; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Model; +import org.apache.sling.models.annotations.injectorspecific.ValueMapValue; @Model(adaptables = Resource.class, defaultInjectionStrategy = OPTIONAL) public class KeyValuePair { @Getter - @Inject + @ValueMapValue public String key; - @Getter - @Inject + @ValueMapValue public String value; } diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/dialog/Dialog.java b/application/backend/src/main/java/ai/typerefinery/websight/models/dialog/Dialog.java new file mode 100644 index 000000000..4f1587a58 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/dialog/Dialog.java @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2023 Typerefinery.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + package ai.typerefinery.websight.models.dialog; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import javax.annotation.PostConstruct; +import javax.inject.Inject; +import javax.inject.Named; + +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.api.resource.ValueMap; +import org.apache.sling.models.annotations.DefaultInjectionStrategy; +import org.apache.sling.models.annotations.Model; +import org.apache.sling.models.annotations.injectorspecific.ChildResource; +import org.apache.sling.models.annotations.injectorspecific.SlingObject; + +import ai.typerefinery.websight.models.components.KeyValue; +import ai.typerefinery.websight.models.components.KeyValuePair; +import ai.typerefinery.websight.utils.ComponentUtil; +import lombok.Getter; + +@Model( + adaptables = { + Resource.class, + SlingHttpServletRequest.class + }, + defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL +) +public class Dialog { + + @Getter + @SlingObject + private Resource resource; + + @Getter + private Resource dialog; + + @Getter + private Resource component; + + @Getter + public List<KeyValuePair> eventActions = new ArrayList<KeyValuePair>(); + + private String FIELD_EVENT_ACTIONS = "eventactions"; + + @PostConstruct + private void init() { + + this.dialog = ComponentUtil.getResourceAncestorByResourceType(resource, ComponentUtil.WS_RESOURCE_TYPE_DIALOG); + if (dialog == null) { + return; + } + + this.component = ComponentUtil.getResourceAncestorByResourceType(resource, ComponentUtil.WS_RESOURCE_TYPE_COMPONENT); + + // get component child eventActions + if (this.component != null) { + + //for each child of component, get eventActions + Resource eventActionResource = this.component.getChild(FIELD_EVENT_ACTIONS); + + if (eventActionResource != null) { + //for each child of eventActions, get key and value + for (Resource child : eventActionResource.getChildren()) { + KeyValuePair eventAction = child.adaptTo(KeyValuePair.class); + if (eventAction != null) { + this.eventActions.add(eventAction); + } + } + + } + + } + + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/EventActions.js b/application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/EventActions.js new file mode 100644 index 000000000..af83ab5fe --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/EventActions.js @@ -0,0 +1,65 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +import AtlaskitSelect from "/apps/websight-atlaskit-esm/web-resources/@atlaskit/select.js"; +import React from "/apps/websight-atlaskit-esm/web-resources/react.js"; +class Select extends React.Component { + constructor(props) { + super(props); + this.state = { + defaultOption: this.findDefaultOption() + }; + } + componentDidUpdate(prevProps) { + const { + options + } = this.props; + if (prevProps.options !== options) { + this.setState({ + defaultOption: this.findDefaultOption() + }); + } + } + findOption(value) { + const { + options + } = this.props; + return options.find(option => option.value === value); + } + findDefaultOption() { + const { + options + } = this.props; + return options.find(option => option.selected); + } + render() { + const { + options, + onChange, + value, + label, + testId + } = this.props; + const { + defaultOption + } = this.state; + return /*#__PURE__*/React.createElement(AtlaskitSelect + // eslint-disable-next-line react/jsx-props-no-spreading + , _extends({}, this.props, { + classNamePrefix: testId, + onChange: ev => { + onChange(ev.value); + }, + options: options, + value: this.findOption(value) ?? defaultOption ?? '', + placeholder: label, + defaultValue: defaultOption, + menuPortalTarget: document.body, + styles: { + menuPortal: base => ({ + ...base, + zIndex: 9999 + }) + } + })); + } +} +export default Select; \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/README.md b/application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/README.md new file mode 100644 index 000000000..5f7814b11 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/README.md @@ -0,0 +1,17 @@ +# Event Actions + +This component is used to output a components supported event actions select in Events tab in a dialog. + +Reference: https://atlassian.design/components/select/examples + +Example + +```json + "eventactions": { + "sling:resourceType": "typerefinery/components/dialog/eventactions", + "name": "name", + "label": "Label", + "description": "Description", + "required": true + }, +``` \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/eventactions.json.html b/application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/eventactions.json.html new file mode 100644 index 000000000..56ba982e9 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/eventactions.json.html @@ -0,0 +1,17 @@ +<sly data-sly-use.model="ai.typerefinery.websight.models.dialog.Dialog"></sly> +{ + "type": "/apps/typerefinery/components/dialog/eventactions/EventActions.js", + "props": { + "name": "${properties.name}", + "label": "${properties.label}", + "description": "${properties.description}", + "required": ${properties.required || false}, + "options": [ + <sly data-sly-use.selectitem="./selectitem/selectitem.json.html"> + <sly data-sly-list.item="${model.eventActions}"> + <sly data-sly-call="${selectitem.item @ item=item}"></sly><sly data-sly-test="${!itemList.last}">,</sly> + </sly> + </sly> + ] + } +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/selectitem/selectitem.json.html b/application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/selectitem/selectitem.json.html new file mode 100644 index 000000000..632759732 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/eventactions/selectitem/selectitem.json.html @@ -0,0 +1,6 @@ +<template data-sly-template.item="${ @ item}"> + { + "label": "${item.value}", + "value": "${item.key}" + } +</template> \ No newline at end of file From d2a3a258503b2ce7476f6f43b2aa5a775c56a3bf Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 12:09:52 +1100 Subject: [PATCH 046/206] update vs config. --- .vscode/launch.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 1e76ebe40..583a20a4e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,6 @@ "type": "java", "name": "Debug (Attach 8115)", "request": "attach", - "projectName": "CMS", "hostName": "localhost", "port": "8115" } From 7ad1878ac69c4e4fa7d3bc3de16d4859dfe47614 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 12:10:21 +1100 Subject: [PATCH 047/206] add events actions to form. --- .../models/components/forms/Form.java | 7 ++ .../models/dialog/EventsListItem.java | 81 +++++++++++++++++++ .../websight/models/dialog/package-info.java | 21 +++++ 3 files changed, 109 insertions(+) create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/models/dialog/EventsListItem.java create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/models/dialog/package-info.java diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Form.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Form.java index 3a670c372..c7dc9de40 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Form.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Form.java @@ -17,6 +17,7 @@ import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; import java.util.HashMap; +import java.util.List; import javax.inject.Inject; import lombok.Getter; @@ -27,13 +28,16 @@ import org.apache.sling.models.annotations.Exporter; import org.apache.sling.models.annotations.ExporterOption; import org.apache.sling.models.annotations.Model; +import org.apache.sling.models.annotations.injectorspecific.ChildResource; import org.osgi.service.component.annotations.Component; import javax.annotation.PostConstruct; import ai.typerefinery.websight.models.components.BaseFormComponent; import ai.typerefinery.websight.models.components.FlowComponent; +import ai.typerefinery.websight.models.components.KeyValuePair; import ai.typerefinery.websight.models.components.flow.FlowContainer; +import ai.typerefinery.websight.models.dialog.EventsListItem; import ai.typerefinery.websight.services.flow.FlowService; import ai.typerefinery.websight.services.flow.registry.FlowComponentRegister; import ai.typerefinery.websight.utils.PageUtil; @@ -79,6 +83,9 @@ public class Form extends FlowComponent implements FlowComponentRegister { @Getter private String readPayloadType; + @Getter + @ChildResource(name = "_events_") + private List<EventsListItem> events; @Inject @Getter diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/dialog/EventsListItem.java b/application/backend/src/main/java/ai/typerefinery/websight/models/dialog/EventsListItem.java new file mode 100644 index 000000000..f8b51a857 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/dialog/EventsListItem.java @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2023 Typerefinery.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + package ai.typerefinery.websight.models.dialog; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import javax.annotation.PostConstruct; +import javax.inject.Inject; +import javax.inject.Named; + +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.api.resource.ValueMap; +import org.apache.sling.models.annotations.DefaultInjectionStrategy; +import org.apache.sling.models.annotations.Model; +import org.apache.sling.models.annotations.injectorspecific.ChildResource; +import org.apache.sling.models.annotations.injectorspecific.SlingObject; +import org.apache.sling.models.annotations.injectorspecific.ValueMapValue; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ai.typerefinery.websight.models.components.KeyValue; +import ai.typerefinery.websight.models.components.KeyValuePair; +import ai.typerefinery.websight.utils.ComponentUtil; +import lombok.Getter; + +@Model( + adaptables = { + Resource.class, + SlingHttpServletRequest.class + }, + defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL +) +public class EventsListItem { + + private static final Logger LOGGER = LoggerFactory.getLogger(EventsListItem.class); + + @Getter + @ValueMapValue + private String action; + + @Getter + @ValueMapValue + private String topic; + + @Getter + @ValueMapValue + private String name; + + @Getter + @ValueMapValue + private String nameCustom; + + @Getter + @ValueMapValue + private String type; + + + @PostConstruct + protected void init() { + LOGGER.info("EventsListItem init()"); + } + + +} \ No newline at end of file diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/dialog/package-info.java b/application/backend/src/main/java/ai/typerefinery/websight/models/dialog/package-info.java new file mode 100644 index 000000000..c96ace4e3 --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/dialog/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2023 Typerefinery.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Version("1.0.0") +package ai.typerefinery.websight.models.dialog; + +import org.osgi.annotation.versioning.Version; + From 0dbe63670f712ab56aff09230d02b1c9b4b45bd9 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 12:10:45 +1100 Subject: [PATCH 048/206] add new dialog select to support groups. --- .../components/dialog/select/README.md | 17 ++ .../components/dialog/select/Select.js | 174 ++++++++++++++++++ .../components/dialog/select/select.json.html | 22 +++ .../select/selectgroup/selectgroup.json.html | 13 ++ .../select/selectitem/selectitem.json.html | 9 + 5 files changed, 235 insertions(+) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/dialog/select/README.md create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/dialog/select/Select.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/dialog/select/select.json.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/dialog/select/selectgroup/selectgroup.json.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/dialog/select/selectitem/selectitem.json.html diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/README.md b/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/README.md new file mode 100644 index 000000000..57dc6ec30 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/README.md @@ -0,0 +1,17 @@ +# Select + +This component is used to output a items with ability to add new items. + +Reference: https://atlassian.design/components/select/examples + +Example + +```json + "eventactions": { + "sling:resourceType": "typerefinery/components/dialog/select", + "name": "name", + "label": "Label", + "description": "Description", + "required": true + }, +``` \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/Select.js b/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/Select.js new file mode 100644 index 000000000..c79cf851f --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/Select.js @@ -0,0 +1,174 @@ +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +import AtlaskitSelect from "/apps/websight-atlaskit-esm/web-resources/@atlaskit/select.js"; +import React from "/apps/websight-atlaskit-esm/web-resources/react.js"; +class Select extends React.Component { + constructor(props) { + super(props); + const { + options + } = this.props; + + let defaultOption = this.findDefaultOption(options); + this.state = { + defaultOption: defaultOption, + // isLoading: false, + options: options, + // initValue: value + }; + } + // componentDidUpdate(prevProps) { + // console.log(["componentDidUpdate", prevProps]) + // const { + // options, + // defaultOption, + // initValue + // } = this.state; + // if (prevProps.options !== options) { + // this.setState({ + // defaultOption: this.findDefaultOption(options) + // }); + // } + // } + findOption(value) { + //find the option value in the options of the select + const { + options, + defaultOption + } = this.state; + + var returnOption = ''; + var optionsList = options; + var hasGroups = false; + + var notFound = true; + + optionsList.forEach(option => { + //check if this is a group + if (option["options"]) { + hasGroups = true; + var foundSubOption = false; + option["options"].forEach(subOption => { + if (subOption.value === value) { + returnOption = subOption; + foundSubOption = true; + notFound = false; + return returnOption; + } + }) + if (foundSubOption) { + return returnOption; + } + } else { + if (option.value === value) { + returnOption = option; + notFound = false; + return returnOption; + } + } + }); + + return returnOption; + + } + //go thought all options and find last selected option + findDefaultOption(options) { + var returnOption = ''; + + options.forEach(option => { + //check if this is a group + if (option["options"]) { + this.setState({ + hasGroups: true + }); + option["options"].forEach(subOption => { + if (subOption.selected) { + returnOption = subOption; + return subOption; + } + }) + } else { + if (option.selected) { + returnOption = option; + } + } + }); + + return returnOption; + } + createOption(label) { + console.log(["createOption", label]) + return { + label, + value: label ? label.toLowerCase().replace(/\W/g, '') : '' + } + }; + isLoading() { + const { + isLoading + } = this.state; + return isLoading; + } + handleChange(newValue) { + console.group('Value Changed'); + console.log(newValue); + console.groupEnd(); + this.setState({ value: newValue }); + }; + handleCreate(inputValue) { + const { + options, + allowCreate + } = this.state; + + this.setState({ isLoading: true }); + console.group('Option created'); + + console.log(["creating new option", allowCreate, inputValue]); + + const newOption = this.createOption(inputValue); + this.setState({ + isLoading: false, + options: [...options, newOption], + value: newOption, + }); + return newOption; + } + render() { + const { + options, + onChange, + value, + label, + testId + } = this.props; + const { + defaultOption + } = this.state; + return /*#__PURE__*/React.createElement(AtlaskitSelect + // eslint-disable-next-line react/jsx-props-no-spreading + , _extends({}, this.props, { + classNamePrefix: testId, + onChange: ev => { + console.log(["onChange", ev]); + // this.handleChange(ev); + onChange(ev.value); + }, + onCreateOption: ev => { + console.log(["onCreateOption", ev]); + this.handleCreate(ev); + }, + options: options, + value: this.findOption(value) ?? defaultOption ?? '', + placeholder: label, + defaultValue: defaultOption, + menuPortalTarget: document.body, + styles: { + menuPortal: base => ({ + ...base, + zIndex: 9999 + }) + } + })); + } +} +export default Select; \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/select.json.html b/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/select.json.html new file mode 100644 index 000000000..c093c178b --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/select.json.html @@ -0,0 +1,22 @@ +{ + "type": "/apps/typerefinery/components/dialog/select/Select.js", + "props": { + "name": "${properties.name}", + "label": "${properties.label}", + "description": "${properties.description}", + "allowCreate": "${properties.allowCreate || false}", + "required": ${properties.required || false}, + "options": [ + <sly data-sly-list.item="${resource.children}" + data-sly-use.selectitem="./selectitem/selectitem.json.html" + data-sly-use.selectgroup="./selectgroup/selectgroup.json.html"> + <sly data-sly-test="${item['sling:resourceType']=='typerefinery/components/dialog/select/selectitem'}"> + <sly data-sly-call="${selectitem.item @ item=item}"></sly><sly data-sly-test="${!itemList.last}">,</sly> + </sly> + <sly data-sly-test="${item['sling:resourceType']=='typerefinery/components/dialog/select/selectgroup'}"> + <sly data-sly-call="${selectgroup.item @ item=item}"></sly><sly data-sly-test="${!itemList.last}">,</sly> + </sly> + </sly> + ] + } +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/selectgroup/selectgroup.json.html b/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/selectgroup/selectgroup.json.html new file mode 100644 index 000000000..0bb3dc968 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/selectgroup/selectgroup.json.html @@ -0,0 +1,13 @@ +<template data-sly-template.item="${ @ item}"> + { + "label": "${item.label}", + "options": [ + <sly data-sly-list.item="${item.children}" + data-sly-use.selectitem="/apps/typerefinery/components/dialog/select/selectitem/selectitem.json.html"> + <sly data-sly-test="${item['sling:resourceType']=='typerefinery/components/dialog/select/selectitem'}"> + <sly data-sly-call="${selectitem.item @ item=item}"></sly><sly data-sly-test="${!itemList.last}">,</sly> + </sly> + </sly> + ] + } +</template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/selectitem/selectitem.json.html b/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/selectitem/selectitem.json.html new file mode 100644 index 000000000..018928adc --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/select/selectitem/selectitem.json.html @@ -0,0 +1,9 @@ +<template data-sly-template.item="${ @ item}"> + { + "label": "${item.label}", + "value": "${item.value}" + <sly data-sly-test="${item.selected}">, + "selected": ${item.selected} + </sly> + } +</template> \ No newline at end of file From 7b7081790b3d5a092b289c48ba74447da8e8b4ee Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 12:11:23 +1100 Subject: [PATCH 049/206] update helpers. --- .../websight/utils/ComponentUtil.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/utils/ComponentUtil.java b/application/backend/src/main/java/ai/typerefinery/websight/utils/ComponentUtil.java index f31717b62..a57e6d0c3 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/utils/ComponentUtil.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/utils/ComponentUtil.java @@ -18,6 +18,7 @@ import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.api.resource.ValueMap; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; @@ -30,6 +31,9 @@ public class ComponentUtil { + public static final String WS_RESOURCE_TYPE_COMPONENT = "ws:Component"; + public static final String WS_RESOURCE_TYPE_DIALOG = "wcm/dialogs/dialog"; + /*** * get or generate component id. * @param componentNode component node @@ -176,4 +180,26 @@ private static Resource copyTemplate(Resource template, Resource targetParent, S return resource; } + @Nullable + public static Resource getDialogDefinition(Resource componentResource) { + ComponentManager componentManager = (ComponentManager)componentResource.getResourceResolver().adaptTo(ComponentManager.class); + if (componentManager == null) { + return null; + } + Component component = componentManager.getComponentOfResource(componentResource.getPath()); + if (component == null) { + return null; + } + return component.getDialogResource(); + } + + @Nullable + public static Resource getResourceAncestorByResourceType(@NotNull Resource resource, @NotNull String resourceType) { + Resource parent = resource.getParent(); + if (parent == null) + return null; + if (parent.isResourceType(resourceType)) + return parent; + return getResourceAncestorByResourceType(parent, resourceType); + } } From 62cb4ee05e7bc2d7f44f371503c2661cda837636 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 12:12:32 +1100 Subject: [PATCH 050/206] update event names to use events namespace. --- .../components/content/embed/clientlibs/functions.js | 2 +- .../components/content/text/clientlibs/functions.js | 5 +++-- .../components/content/title/clientlibs/functions.js | 5 +++-- .../stix/forms/fields/input/clientlibs/functions.js | 2 +- .../components/widgets/table/clientlibs/functions.js | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js index 9eb9264bc..a17bb5755 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js @@ -11,7 +11,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.registerEvent = ($component, componentId, fieldName) => { const key = `${componentId}-${fieldName}`; eventNs.registerEvents(key, (data) => { - if(data.type === "LOAD_DATA") { + if(data.type === eventNs.EVENTS.EVENT_READ_ACTION) { // get the first children and set the inner html. const $firstChild = $component.children[0]; const componentConfig = componentNs.getComponentConfig($component); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js index 92ce9a148..4d9787d94 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js @@ -11,7 +11,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.registerEvent = ($component, componentId, fieldName) => { const key = `${componentId}-${fieldName}`; eventNs.registerEvents(key, (data) => { - if(data.type === "LOAD_DATA") { + if(data.type === eventNs.EVENTS.EVENT_READ_ACTION) { // get the first children and set the inner html. const $firstChild = $component.children[0]; const componentConfig = componentNs.getComponentConfig($component); @@ -34,7 +34,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const componentId = $component.getAttribute("data-field-componentId"); const fieldName = $component.getAttribute("data-field-name"); if (componentId && fieldName) { - ns.registerEvent($component, componentId, fieldName); + //listen for evenets and update the innerHTML + ns.registerEvent($component, componentId, fieldName); }; } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/functions.js index 966bcc4e2..c41a26c25 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/functions.js @@ -11,7 +11,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.registerEvent = ($component, componentId, fieldName) => { const key = `${componentId}-${fieldName}`; eventNs.registerEvents(key, (data) => { - if(data.type === "LOAD_DATA") { + if(data.type === eventNs.EVENTS.EVENT_READ_ACTION) { const $firstChild = $component.children[0]; const innerHTML = $firstChild.innerHTML.replace(`{{${fieldName}}}`, data.data.value) || data.data.value; @@ -32,7 +32,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const componentId = $component.getAttribute("data-field-componentId"); const fieldName = $component.getAttribute("data-field-name"); if (componentId && fieldName) { - ns.registerEvent($component, componentId, fieldName); + //listen for evenets and update the innerHTML + ns.registerEvent($component, componentId, fieldName); }; } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js index 727ffda77..78478afcb 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js @@ -12,7 +12,7 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.registerEvent = ($component, componentId, fieldName) => { const key = `${componentId}-${fieldName}`; eventNs.registerEvents(key, (data) => { - if(data.type === "LOAD_DATA") { + if(data.type === eventNs.EVENTS.EVENT_READ_ACTION) { // get the first children and set the inner html. const $firstChild = $component.children[0]; // get the component config diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/functions.js index 804aa0aa6..0c4804ab4 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/functions.js @@ -389,7 +389,7 @@ window.Typerefinery.Modal = Typerefinery.Modal || {}; const key = `${componentId}-${fieldName}`; eventNs.registerEvents(key, (data) => { - if(data.type === "LOAD_DATA") { + if(data.type === eventNs.EVENTS.EVENT_READ_ACTION) { ns.updateComponentHTML(id, data.data.value, $component); } }); From f10136aee70504b409dbd6d877823ad81e302679 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 12:15:05 +1100 Subject: [PATCH 051/206] update composite to use parsys that does not print non sling nodes. --- .../typerefinery/components/forms/fields/composite/variant.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html index bc44db212..0619c8927 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html @@ -31,7 +31,7 @@ > </input> <div template> - <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> + <sly data-sly-include="${'parsys.html' @ prependPath='/apps/typerefinery/components/parsys'}"></sly> </div> <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle}</div> </template> \ No newline at end of file From 7750cdfa14835461d9e71cd4ff46f4c2a2c65900 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 12:15:25 +1100 Subject: [PATCH 052/206] update form event tab. --- .../dialog/tabs/event/.content.json | 180 ++++++++++++++---- 1 file changed, 146 insertions(+), 34 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json index d9890269d..e689ff43f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json @@ -1,40 +1,152 @@ { - "sling:resourceType": "wcm/dialogs/components/tab", + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Events", + "warning": { + "sling:resourceType": "typerefinery/components/dialog/label", + "ws:disallowedContext": ["edit:dialog"], + "appearance": "error", + "iconLabel": "Open Dialog", + "title": "Some fields are not editable in side-panel.", + "secondaryText": "", + "placement": "bottom-start" + }, + "info": { + "sling:resourceType": "typerefinery/components/dialog/label", + "appearance": "info", + "iconLabel": "Info", + "title": "Map component actions to events, this allows you to respond to component actions in other components.", + "secondaryText": "", + "placement": "bottom-start" + }, + "event": { + "sling:resourceType": "wcm/dialogs/components/multifield", + "ws:disallowedContext": ["edit:panel"], + "name": "_events_", + "description": "Pick generic event or specify custom event to which component action will be mapped.", "label": "Events", - "warning": { - "sling:resourceType": "typerefinery/components/dialog/label", - "ws:disallowedContext": ["edit:dialog"], - "appearance": "error", - "iconLabel": "Open Dialog", - "title": "Some fields are not editable in side-panel.", - "secondaryText": "", - "placement": "bottom-start" + "topic": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "topic", + "label": "Topic", + "description": "The topic of the event, default is component id." }, - "event": { - "sling:resourceType": "wcm/dialogs/components/multifield", - "ws:disallowedContext": ["edit:panel"], - "name": "events", - "description": "Event that this component is emits/send to", - "label": "Events", - "key": { - "sling:resourceType": "wcm/dialogs/components/textfield", - "name": "key", - "label": "Topic" - }, - "value": { - "sling:resourceType": "wcm/dialogs/components/select", - "name": "value", - "label": "Event Action", - "HIGHLIGHT": { - "sling:resourceType": "wcm/dialogs/components/select/selectitem", - "label": "HIGHLIGHT", - "value": "HIGHLIGHT" - }, - "FILTER": { - "sling:resourceType": "wcm/dialogs/components/select/selectitem", - "label": "FILTER", - "value": "FILTER" - } + "type": { + "sling:resourceType": "wcm/dialogs/components/select", + "name": "type", + "label": "Event Type", + "description": "How will the component interact with the event system.", + "listen": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Listen", + "value": "listen", + "selected": true + }, + "emit": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Emit", + "value": "emit", + "selected": true + } + }, + "eventAction": { + "sling:resourceType": "typerefinery/components/dialog/eventactions", + "name": "action", + "label": "Component Action", + "description": "Which component action to map to event." + }, + "eventName": { + "sling:resourceType": "typerefinery/components/dialog/select", + "name": "name", + "allowCreate": true, + "label": "Event Name", + "description": "Event Name of the even raised by the component", + "default": { + "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", + "label": "Default", + "default": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Custom", + "value": "" + } + }, + "componenetcrud": { + "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", + "label": "Componenet", + "create": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Create", + "value": "createaction" + }, + "read": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Read", + "value": "readaction" + }, + "update": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Update", + "value": "updateaction" + }, + "delete": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Delete", + "value": "deleteaction" + }, + "filter": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Filter", + "value": "filteraction" } + }, + "generic": { + "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", + "label": "Generic", + "success": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Success", + "value": "successaction" + }, + "error": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Error", + "value": "erroraction" + } + }, + "itemcrud": { + "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", + "label": "Item", + "create": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Create", + "value": "createitem" + }, + "read": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Read", + "value": "readitem" + }, + "update": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Update", + "value": "updateitem" + }, + "delete": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Delete", + "value": "deleteitem" + }, + "seelect": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Select", + "value": "selectitem" + } + } + }, + "eventNameCustom": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "nameCustom", + "label": "Custom Event Name", + "description": "Custom Event Name of the even raised by the component" } + } } \ No newline at end of file From 0e02cb5a14816cf109d2ce1575eb24df7044482f Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 12:15:48 +1100 Subject: [PATCH 053/206] update form to use non breaking parsys. --- .../apps/typerefinery/components/forms/form/variant.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/variant.html index e314864d4..9d950461e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/variant.html @@ -22,7 +22,7 @@ class="${model.componentClassNames}" toggleTheme="true" > - <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> + <sly data-sly-include="${'parsys.html' @ prependPath='/apps/typerefinery/components/parsys'}"></sly> </form> <sly data-sly-test="${!resource.hasChildren}"> From 77a77f1cd03fe105316ca8410ebb7e7097f86894 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 13:48:06 +1100 Subject: [PATCH 054/206] update form dialog with event config. --- .../forms/form/dialog/.content.json | 161 +++++++++++++++++- 1 file changed, 159 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json index f948093bb..70c3882b1 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json @@ -13,11 +13,162 @@ "defaultValue": "Demo" } }, + "eventTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Events", + "warning": { + "sling:resourceType": "typerefinery/components/dialog/label", + "ws:disallowedContext": ["edit:dialog"], + "appearance": "error", + "iconLabel": "Open Dialog", + "title": "Some fields are not editable in side-panel.", + "secondaryText": "", + "placement": "bottom-start" + }, + "info": { + "sling:resourceType": "typerefinery/components/dialog/label", + "appearance": "info", + "iconLabel": "Info", + "title": "Map component actions to events, this allows you to respond to component actions in other components.", + "secondaryText": "", + "placement": "bottom-start" + }, + "event": { + "sling:resourceType": "wcm/dialogs/components/multifield", + "ws:disallowedContext": ["edit:panel"], + "name": "_events_", + "description": "Pick generic event or specify custom event to which component action will be mapped.", + "label": "Events", + "topic": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "topic", + "label": "Topic", + "description": "The topic of the event, default is component id." + }, + "type": { + "sling:resourceType": "wcm/dialogs/components/select", + "name": "type", + "label": "Event Type", + "description": "How will the component interact with the event system.", + "listen": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Listen", + "value": "listen", + "selected": true + }, + "emit": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Emit", + "value": "emit", + "selected": true + } + }, + "eventAction": { + "sling:resourceType": "typerefinery/components/dialog/eventactions", + "name": "action", + "label": "Component Action", + "description": "Which component action to map to event." + }, + "eventName": { + "sling:resourceType": "typerefinery/components/dialog/select", + "name": "name", + "allowCreate": true, + "label": "Event Name", + "description": "Event Name of the even raised by the component", + "default": { + "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", + "label": "Default", + "default": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Custom", + "value": "" + } + }, + "componenetcrud": { + "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", + "label": "Componenet", + "create": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Create", + "value": "createaction" + }, + "read": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Read", + "value": "readaction" + }, + "update": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Update", + "value": "updateaction" + }, + "delete": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Delete", + "value": "deleteaction" + }, + "filter": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Filter", + "value": "filteraction" + } + }, + "generic": { + "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", + "label": "Generic", + "success": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Success", + "value": "successaction" + }, + "error": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Error", + "value": "erroraction" + } + }, + "itemcrud": { + "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", + "label": "Item", + "create": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Create", + "value": "createitem" + }, + "read": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Read", + "value": "readitem" + }, + "update": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Update", + "value": "updateitem" + }, + "delete": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Delete", + "value": "deleteitem" + }, + "seelect": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Select", + "value": "selectitem" + } + } + }, + "eventNameCustom": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "nameCustom", + "label": "Custom Event Name", + "description": "Custom Event Name of the even raised by the component" + } + } + }, "styleTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/style" }, - "gridTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/grid" @@ -92,7 +243,13 @@ "sling:resourceType": "wcm/dialogs/components/textfield", "name": "readUrl", "label": "Endpoint URL" - } + }, + "readEmitEvent": { + "sling:resourceType": "wcm/dialogs/components/checkbox", + "name": "readEmitEvent", + "label": "Emit Event on Read", + "description": "Emit form data to other components on page. Any component with matching field name will receive the data." + } }, "flowTab": { "sling:resourceType": "wcm/dialogs/components/include", From 37087bca5ac10f805940527a33ff6e35d3c28efa Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 13:48:56 +1100 Subject: [PATCH 055/206] add form custom component actions for display in dialog. --- .../forms/form/eventactions/.content.json | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/form/eventactions/.content.json diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/eventactions/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/eventactions/.content.json new file mode 100644 index 000000000..e4e1f32f7 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/eventactions/.content.json @@ -0,0 +1,23 @@ +{ + "sling:resourceType": "nt:unstructured", + "formsuccess": { + "sling:resourceType": "nt:unstructured", + "key": "FORM_SUCCESS", + "value": "Form Success" + }, + "formerror":{ + "sling:resourceType": "nt:unstructured", + "key": "FORM_ERROR", + "value": "Form Error" + }, + "formsubmit": { + "sling:resourceType": "nt:unstructured", + "key": "FORM_SUBMIT", + "value": "Form Submit" + }, + "formcancel": { + "sling:resourceType": "nt:unstructured", + "key": "FORM_CANCEL", + "value": "Form Cancel" + } +} \ No newline at end of file From 763289738475593931d3f1717e19486230b60daa Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 20:58:00 +1100 Subject: [PATCH 056/206] move files operations into its own namespace. --- .../page/clientlibs-header/.content.json | 3 +- .../page/clientlibs-header/files/functions.js | 63 +++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/files/functions.js diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/.content.json index 1717c8dba..a7a61595b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/.content.json @@ -9,7 +9,8 @@ "tms/client.js", "tms/jsonschema.js", "tms/functions.js", - "events/functions.js" + "events/functions.js", + "files/functions.js" ], "css": [ "style.css" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/files/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/files/functions.js new file mode 100644 index 000000000..3007be31b --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/files/functions.js @@ -0,0 +1,63 @@ +window.Typerefinery = window.Typerefinery || {}; +Typerefinery.Page = Typerefinery.Page || {}; +Typerefinery.Page.Files = Typerefinery.Page.Files || {}; + +(function (ns, document, window) { + "use strict"; + + ns.filesUrl = "https://files.typerefinery.localhost:8101"; + + ns.uploadFile = async (file) => { + const fileName = file?.name?.trim()?.replace(/\s/g, "-"); + const datePathWithTime = new Date().toISOString().split("T")[0].replace(/-/g, "-") + "/" + new Date().toISOString().split("T")[1].split(".")[0].replace(/:/g, "-"); + let path = window.location.pathname === "/" ? "" : window.location.pathname; + // remove .html from the path + path = path.replace(".html", ""); + path += `/${datePathWithTime}`; + const PREVIEW = `${ns.filesUrl}/api${path}/${fileName}` + try{ + await fetch( + `${ns.filesUrl}/api${path}?type=CREATE_FOLDER`, + { + method: "POST", + mode: 'no-cors', + headers: { + 'accept': 'application/json', + 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS' + }, + redirect: 'follow' + } + ); + } + catch(error) { + // ERROR IN CASE PATH EXIST. + } + try{ + const URL = `${ns.filesUrl}/api${path}/${fileName}?type=UPLOAD_FILE&overwrite=true`; + const formData = new FormData(); + formData.append("upload", file); + await fetch( + URL, + { + method: "POST", + body: formData, + mode: 'no-cors', + headers: { + 'accept': 'application/json', + 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS' + }, + redirect: 'follow' + }, + ); + // REMOVE LOADER + + return PREVIEW; + }catch(error) { + return PREVIEW; + } + + }; + +})(Typerefinery.Page.Files, document, window); From 726015b5ed0aacceff459cad3b5a4a9f2bcf0df3 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 21:00:29 +1100 Subject: [PATCH 057/206] add additional events. --- .../forms/form/dialog/.content.json | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json index 70c3882b1..c681169f6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json @@ -27,6 +27,7 @@ }, "info": { "sling:resourceType": "typerefinery/components/dialog/label", + "ws:disallowedContext": ["edit:panel"], "appearance": "info", "iconLabel": "Info", "title": "Map component actions to events, this allows you to respond to component actions in other components.", @@ -121,6 +122,21 @@ "label": "Success", "value": "successaction" }, + "cancel": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Cancel", + "value": "cancelaction" + }, + "reset": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Reset", + "value": "resetaction" + }, + "submit": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Submit", + "value": "submitaction" + }, "error": { "sling:resourceType": "typerefinery/components/dialog/select/selectitem", "label": "Error", @@ -218,7 +234,8 @@ "writeUrl": { "sling:resourceType": "wcm/dialogs/components/textfield", "name": "writeUrl", - "label": "Endpoint URL" + "label": "Endpoint URL", + "description": "Add the endpoint URL to send the data to, parameters can be specified using {{...}}, parameters will be replaced with the values from querystring." } }, "readTab": { @@ -242,14 +259,9 @@ "readUrl": { "sling:resourceType": "wcm/dialogs/components/textfield", "name": "readUrl", - "label": "Endpoint URL" - }, - "readEmitEvent": { - "sling:resourceType": "wcm/dialogs/components/checkbox", - "name": "readEmitEvent", - "label": "Emit Event on Read", - "description": "Emit form data to other components on page. Any component with matching field name will receive the data." - } + "label": "Endpoint URL", + "description": "Add the endpoint URL to send the data to, parameters can be specified using {{...}}, parameters will be replaced with the values from querystring." + } }, "flowTab": { "sling:resourceType": "wcm/dialogs/components/include", From ac8feab4d4fae1dac0efd1582c92793a00d572e4 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 2 Apr 2024 21:00:52 +1100 Subject: [PATCH 058/206] update field notes. --- .../components/forms/fieldset/dialog/.content.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fieldset/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fieldset/dialog/.content.json index 60f677f48..847b73ac2 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fieldset/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fieldset/dialog/.content.json @@ -38,7 +38,8 @@ "writeUrl": { "sling:resourceType": "wcm/dialogs/components/textfield", "name": "writeUrl", - "label": "Endpoint URL" + "label": "Endpoint URL", + "description": "Add the endpoint URL to send the data to, parameters can be specified using {{...}}, parameters will be replaced with the values from querystring." } }, "readTab": { @@ -62,7 +63,8 @@ "readUrl": { "sling:resourceType": "wcm/dialogs/components/textfield", "name": "readUrl", - "label": "Endpoint URL" + "label": "Endpoint URL", + "description": "Add the endpoint URL to send the data to, parameters can be specified using {{...}}, parameters will be replaced with the values from querystring." } }, "flowTab": { From eb8bc04cb70423022f7053419beca4c9839fea0d Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 3 Apr 2024 12:36:44 +1100 Subject: [PATCH 059/206] add js vendor library jsonpath. --- .../clientlibs/vendor/jsonpath/jsonpath.js | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 application/frontend/src/static/clientlibs/vendor/jsonpath/jsonpath.js diff --git a/application/frontend/src/static/clientlibs/vendor/jsonpath/jsonpath.js b/application/frontend/src/static/clientlibs/vendor/jsonpath/jsonpath.js new file mode 100644 index 000000000..1210436da --- /dev/null +++ b/application/frontend/src/static/clientlibs/vendor/jsonpath/jsonpath.js @@ -0,0 +1,88 @@ +/* JSONPath 0.8.0 - XPath for JSON + * + * Copyright (c) 2007 Stefan Goessner (goessner.net) + * Licensed under the MIT (MIT-LICENSE.txt) licence. + */ +function jsonPath(obj, expr, arg) { + var P = { + resultType: arg && arg.resultType || "VALUE", + result: [], + normalize: function(expr) { + var subx = []; + return expr.replace(/[\['](\??\(.*?\))[\]']/g, function($0,$1){return "[#"+(subx.push($1)-1)+"]";}) + .replace(/'?\.'?|\['?/g, ";") + .replace(/;;;|;;/g, ";..;") + .replace(/;$|'?\]|'$/g, "") + .replace(/#([0-9]+)/g, function($0,$1){return subx[$1];}); + }, + asPath: function(path) { + var x = path.split(";"), p = "$"; + for (var i=1,n=x.length; i<n; i++) + p += /^[0-9*]+$/.test(x[i]) ? ("["+x[i]+"]") : ("['"+x[i]+"']"); + return p; + }, + store: function(p, v) { + if (p) P.result[P.result.length] = P.resultType == "PATH" ? P.asPath(p) : v; + return !!p; + }, + trace: function(expr, val, path) { + if (expr) { + var x = expr.split(";"), loc = x.shift(); + x = x.join(";"); + if (val && val.hasOwnProperty(loc)) + P.trace(x, val[loc], path + ";" + loc); + else if (loc === "*") + P.walk(loc, x, val, path, function(m,l,x,v,p) { P.trace(m+";"+x,v,p); }); + else if (loc === "..") { + P.trace(x, val, path); + P.walk(loc, x, val, path, function(m,l,x,v,p) { typeof v[m] === "object" && P.trace("..;"+x,v[m],p+";"+m); }); + } + else if (/,/.test(loc)) { // [name1,name2,...] + for (var s=loc.split(/'?,'?/),i=0,n=s.length; i<n; i++) + P.trace(s[i]+";"+x, val, path); + } + else if (/^\(.*?\)$/.test(loc)) // [(expr)] + P.trace(P.eval(loc, val, path.substr(path.lastIndexOf(";")+1))+";"+x, val, path); + else if (/^\?\(.*?\)$/.test(loc)) // [?(expr)] + P.walk(loc, x, val, path, function(m,l,x,v,p) { if (P.eval(l.replace(/^\?\((.*?)\)$/,"$1"),v[m],m)) P.trace(m+";"+x,v,p); }); + else if (/^(-?[0-9]*):(-?[0-9]*):?([0-9]*)$/.test(loc)) // [start:end:step] phyton slice syntax + P.slice(loc, x, val, path); + } + else + P.store(path, val); + }, + walk: function(loc, expr, val, path, f) { + if (val instanceof Array) { + for (var i=0,n=val.length; i<n; i++) + if (i in val) + f(i,loc,expr,val,path); + } + else if (typeof val === "object") { + for (var m in val) + if (val.hasOwnProperty(m)) + f(m,loc,expr,val,path); + } + }, + slice: function(loc, expr, val, path) { + if (val instanceof Array) { + var len=val.length, start=0, end=len, step=1; + loc.replace(/^(-?[0-9]*):(-?[0-9]*):?(-?[0-9]*)$/g, function($0,$1,$2,$3){start=parseInt($1||start);end=parseInt($2||end);step=parseInt($3||step);}); + start = (start < 0) ? Math.max(0,start+len) : Math.min(len,start); + end = (end < 0) ? Math.max(0,end+len) : Math.min(len,end); + for (var i=start; i<end; i+=step) + P.trace(i+";"+expr, val, path); + } + }, + eval: function(x, _v, _vname) { + try { return $ && _v && eval(x.replace(/@/g, "_v")); } + catch(e) { throw new SyntaxError("jsonPath: " + e.message + ": " + x.replace(/@/g, "_v").replace(/\^/g, "_a")); } + } + }; + + var $ = obj; + if (expr && obj && (P.resultType == "VALUE" || P.resultType == "PATH")) { + P.trace(P.normalize(expr).replace(/^\$;/,""), obj, "$"); + return P.result.length ? P.result : false; + } + } + \ No newline at end of file From 69a12154970da00f4e9848caae90252434291943 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 8 Apr 2024 22:57:24 +1000 Subject: [PATCH 060/206] fix typo. --- .../typerefinery/components/dialog/tabs/event/.content.json | 4 ++-- .../typerefinery/components/forms/form/dialog/.content.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json index e689ff43f..fe3c60614 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json @@ -69,9 +69,9 @@ "value": "" } }, - "componenetcrud": { + "componentcrud": { "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", - "label": "Componenet", + "label": "Component", "create": { "sling:resourceType": "typerefinery/components/dialog/select/selectitem", "label": "Create", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json index c681169f6..fed93aa78 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json @@ -85,9 +85,9 @@ "value": "" } }, - "componenetcrud": { + "componentcrud": { "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", - "label": "Componenet", + "label": "Component", "create": { "sling:resourceType": "typerefinery/components/dialog/select/selectitem", "label": "Create", From 278c785c62ab35f08cae0251dac52608106d9815 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Apr 2024 23:56:51 +1000 Subject: [PATCH 061/206] update form urls. --- .../typerefinery-showcase/pages/components/forms/.content.xml | 4 ++-- .../pages/forms/connection/delete/.content.xml | 4 ++-- .../pages/forms/connection/edit/.content.xml | 4 ++-- .../pages/forms/project/delete/.content.xml | 4 ++-- .../pages/forms/project/edit/.content.xml | 4 ++-- .../pages/forms/query/delete/.content.xml | 4 ++-- .../typerefinery-showcase/pages/forms/query/edit/.content.xml | 4 ++-- .../pages/forms/theme/delete/.content.xml | 4 ++-- .../typerefinery-showcase/pages/forms/theme/edit/.content.xml | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/.content.xml index 390a4bf2e..31239f4fb 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/.content.xml @@ -18,9 +18,9 @@ sling:resourceType="typerefinery/components/forms/form" writePayloadType="application/json" writeMethod="POST" - writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/{{id}}" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/" readMethod="GET" - readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/{{id}}"> + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/"> <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Personal Information" /> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/delete/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/delete/.content.xml index 84d4d5ae0..1a201c7c4 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/delete/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/delete/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/connection/{{id}}" + readUrl="https://api.typerefinery.localhost:8101/datastore/connection/" writeMethod="DELETE" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/connection/{{id}}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/connection/"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/edit/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/edit/.content.xml index 42f68458f..7d8b08824 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/edit/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/edit/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/connection/{{id}}" + readUrl="https://api.typerefinery.localhost:8101/datastore/connection/" writeMethod="PUT" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/connection/{{id}}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/connection/"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/delete/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/delete/.content.xml index cfa33b14d..f83f33afc 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/delete/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/delete/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/project/{{id}}" + readUrl="https://api.typerefinery.localhost:8101/datastore/project/" writeMethod="DELETE" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/project/{{id}}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/project/"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/edit/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/edit/.content.xml index 18cc299be..aa6c29529 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/edit/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/edit/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/project/{{id}}" + readUrl="https://api.typerefinery.localhost:8101/datastore/project/" writeMethod="PUT" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/project/{{id}}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/project/"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/delete/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/delete/.content.xml index 1e79d77bf..263431479 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/delete/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/delete/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/query/{{id}}" + readUrl="https://api.typerefinery.localhost:8101/datastore/query/" writeMethod="DELETE" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/query/{{id}}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/query/"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/edit/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/edit/.content.xml index 42e1ac2e1..485654f58 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/edit/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/edit/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/query/{{id}}" + readUrl="https://api.typerefinery.localhost:8101/datastore/query/" writeMethod="PUT" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/query/{{id}}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/query/"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/delete/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/delete/.content.xml index fba8d8543..319bb1c45 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/delete/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/delete/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/theme/{{id}}" + readUrl="https://api.typerefinery.localhost:8101/datastore/theme/" writeMethod="DELETE" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/theme/{{id}}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/theme/"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/edit/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/edit/.content.xml index f71543030..dfb4ce162 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/edit/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/edit/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/theme/{{id}}" + readUrl="https://api.typerefinery.localhost:8101/datastore/theme/" writeMethod="PUT" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/theme/{{id}}"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/theme/"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" From 76b122e987327d27e9ec37ac0c02034431adf231 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Apr 2024 23:57:41 +1000 Subject: [PATCH 062/206] add default name to form field model. --- .../websight/models/components/BaseFormComponent.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java index 4eb0856f1..854a2b927 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java @@ -94,6 +94,9 @@ protected void init() { } } super.init(); + if (StringUtils.isBlank(this.name)) { + this.name = this.id; + } } From 9dfeb7ee8cfa3fa552cf0687760223f1a05b8ce4 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Apr 2024 23:58:18 +1000 Subject: [PATCH 063/206] add a no suffix extention. --- .../ai/typerefinery/websight/services/flow/FlowService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/services/flow/FlowService.java b/application/backend/src/main/java/ai/typerefinery/websight/services/flow/FlowService.java index e8ae0b530..e90de455f 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/services/flow/FlowService.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/services/flow/FlowService.java @@ -112,6 +112,7 @@ public class FlowService { public static final String FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL = "<http-route-url>"; // used to specify which http route flow will use if any, eg form get url to be used /form/* will be updated to the {page URL}/* public static final String FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_SUFFIX = "/{{id}}"; // used to prefix http route url, eg form get url to be used /form/{{id}} will be updated to the {page URL}/{{id}}, this will allow client to substitiute the id in the url public static final String FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_NOSFX = "<http-route-url-nosfx>"; // used to specify which http route flow will use if any, will be url without suffix + public static final String FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_NOSFX_VALUE = "/*"; // used to specify which http route flow will use if any, will be url without suffix public static final String FLOW_DEFAULT_TITLE_SUFFIX = " flow"; // used to generate flow title if not specified, flow title will be {page title} flow @@ -875,7 +876,7 @@ public HashMap<String, String> getReplaceMap(String childFlowId, String flowstre put(FLOW_TEMPLATE_FIELD_SENDDATA_ID, StringUtils.join(childPathId, "senddata")); put(FLOW_TEMPLATE_FIELD_PUBLISH_ID, StringUtils.join(childPathId, "publish")); put(FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL, httpRoutePath + FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_SUFFIX); // used for HTTP Route step, eg in forms - put(FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_NOSFX, httpRoutePath); // used for HTTP Route step with url without suffix, eg in forms + put(FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_NOSFX, httpRoutePath + FLOW_TEMPLATE_FIELD_HTTP_ROUTE_URL_NOSFX_VALUE); // used for HTTP Route step with url without suffix, eg in forms put(FLOW_TEMPLATE_FIELD_SAMPLE_DATA, componentSampleDataValueFinal); // used for HTTP Route step, eg in forms put(FLOW_TEMPLATE_FIELD_TMS_TOPIC, topic); // used for filtering TMS messages }}; From c8087f1def80f30e67c29f5dbd3a5dba5ced2cda Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Apr 2024 23:59:02 +1000 Subject: [PATCH 064/206] add ability to add form field hints. --- .../fields/composite/clientlibs/functions.js | 46 +++++++++++++++---- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js index 6da36a450..f6ab3d91f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js @@ -1,10 +1,11 @@ window.Typerefinery = window.Typerefinery || {}; window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; +window.Typerefinery.Components.Forms.Form = Typerefinery.Components.Forms.Form || {}; window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.Composite || {}; -;(function ($, ns, componentNs, window, document) { +;(function ($, ns, componentNs, formNs, document, window) { "use strict"; ns.selectorAttribute = "isCompositeParent"; @@ -19,44 +20,71 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C ns.selectorCompositeInput = `[${ns.selectorCompositeInputAttribute}]`; //template for form components in parent ns.selectorTemplate = "> [template]"; - ns.selectonNameAttribute = "name"; + ns.selectorNameAttribute = "name"; + ns.selectorIdAttribute = "id"; $.fn.findExclude = function(selector, mask) { return this.find(selector).not(this.find(mask).find(selector)); } - $.fn.compositeVal = function() { + $.fn.compositeVal = function(addFieldHint) { //get all immediate isCompositeParent var $compositeParents = this.parent(ns.selector).findExclude(ns.selector,ns.selector); var data = {}; //add current field values to data Object.assign(data,JSON.parse(this.val())); - + //for each get their values and merge their composites in $compositeParents.each(function(){ //find composite value input field var $compositeValue = $(this).findExclude(ns.selectorValue,ns.selector); if ($compositeValue) { // create placeholder for composite value - data[$compositeValue.attr(ns.selectonNameAttribute)] = {}; + data[$compositeValue.attr(ns.selectorNameAttribute)] = {}; // get composite value for this field, this will cascade to other composite fields - Object.assign(data[$compositeValue.attr(ns.selectonNameAttribute)],$compositeValue.compositeVal()); + Object.assign(data[$compositeValue.attr(ns.selectorNameAttribute)],$compositeValue.compositeVal()); } }); return data; } - ns.compileValue = function($compositeParent) { + ns.setValue = function($compositeParent, data) { + //get all immediate isCompositeParent + var $compositeParents = $compositeParent.parent(ns.selector).findExclude(ns.selector,ns.selector); + //set value of composite input + $compositeParent.val(JSON.stringify(data)); + //for each get their values and merge their composites in + $compositeParents.each(function(){ + //find composite value input field + var $compositeValue = $(this).findExclude(ns.selectorValue,ns.selector); + if ($compositeValue) { + // get composite value for this field, this will cascade to other composite fields + $compositeValue.setValue(data[$compositeValue.attr(ns.selectorNameAttribute)]); + } + }); + } + + ns.compileValue = function($compositeParent, addFieldHint) { var $field = $compositeParent.findExclude(ns.selectorValue,ns.selector); var $templateFields = $compositeParent.findExclude(ns.selectorTemplate,ns.selector).findExclude(ns.selectorCompositeInput,ns.selector); var data = {}; + if (addFieldHint) { + //add hint to component + formNs.addFieldHint($field, $field.attr(ns.selectorNameAttribute), $field.attr(ns.selectorIdAttribute)); + } + $templateFields.each(function(){ //get name and value of each input field - var name = $(this).attr(ns.selectonNameAttribute); + var name = $(this).attr(ns.selectorNameAttribute); var value = $(this).val(); data[name] = value; + + if (addFieldHint) { + //add hint to component + formNs.addFieldHint($(this), $(this).attr(ns.selectorNameAttribute), $(this).attr(ns.selectorIdAttribute)); + } }); //set value of composite input $field.val(JSON.stringify(data)); @@ -86,4 +114,4 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C } -})(jQuery, Typerefinery.Components.Forms.Composite, window.Typerefinery.Components, window, document); +})(jQuery, Typerefinery.Components.Forms.Composite, Typerefinery.Components, Typerefinery.Components.Forms.Form, document, window); From 920f41009ff2b388bb1d216a5b9c26b833de26fa Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Apr 2024 23:59:30 +1000 Subject: [PATCH 065/206] enable form label. --- .../typerefinery/components/forms/fields/label/.content.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/.content.json index bcee41034..8aa4b9eaa 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/.content.json @@ -1,5 +1,5 @@ { - "group": ".hidden", + "group": "Typerefinery - Forms", "sling:resourceType": "ws:Component", "description": "Label for fields.", "title": "Label" From b0d3f9e975d3783b2ff9dff9dcdaac08abe7620a Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 17 Apr 2024 00:00:05 +1000 Subject: [PATCH 066/206] move select utils into its namespace. --- .../fields/select/clientlibs/behaviour.js | 1 + .../fields/select/clientlibs/functions.js | 25 ++++++++++++++++++- .../forms/fields/select/variant.html | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js index 21a982b35..56ffa9079 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js @@ -6,6 +6,7 @@ window.Typerefinery.Components.Forms.Select = Typerefinery.Components.Forms.Sele ;(function (ns, document) { "use strict"; $(document).ready(function () { + console.log('Select component Behaviour loaded'); $("[component='select']").each(function () { ns.init(this); }); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js index 5c2470a0f..a115ba184 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js @@ -88,7 +88,30 @@ window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components. } }; - + // public methods to interact with the select component instances + ns.getValue = function (id) { + console.group('select getValue'); + console.log('id', id); + let returnValue = ""; + returnValue = selectInstances[id].getValue(true) + console.log('returnValue', returnValue); + console.groupEnd(); + return returnValue; + } + ns.setChoiceByValue = function (id, value) { + console.group('select setChoiceByValue'); + console.log('id', id); + console.log('value', value); + selectInstances[id].setChoiceByValue(value); + console.groupEnd(); + } + ns.setValue = function (id, data) { + console.group('select setValue'); + console.log('id', id); + console.log('value', value); + selectInstances[id].setValue(data); + console.groupEnd(); + } ns.init = async ($component) => { const componentConfig = componentNs.getComponentConfig($component); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/variant.html index e572222ea..949a7d8d9 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/variant.html @@ -15,7 +15,7 @@ */--> <template data-sly-template.variant="${ @ model }"> <select - isInput="true" + isInput="select" name="${model.name}" class="${model.variantClassNames} form-control" id="${model.id}" From 52734409db971060932e67430b15f0743f264b9d Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 17 Apr 2024 00:00:23 +1000 Subject: [PATCH 067/206] add missing form field attribute. --- .../typerefinery/components/forms/fields/textarea/variant.html | 1 + 1 file changed, 1 insertion(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/textarea/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/textarea/variant.html index 512173424..be1d8ed17 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/textarea/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/textarea/variant.html @@ -15,6 +15,7 @@ */--> <template data-sly-template.variant="${ @ model }"> <textarea + isInput="true" component="${model.componentName}" id="${model.id}" name="${model.name}" From 799a78a56eb6c178f9c1b5fd114bac2d4e524a44 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 17 Apr 2024 00:01:05 +1000 Subject: [PATCH 068/206] move editor utils into its namespace. --- .../widgets/editor/clientlibs/behaviour.js | 1 + .../widgets/editor/clientlibs/functions.js | 41 +++++++++++++++++++ .../components/widgets/editor/editor.html | 2 +- .../components/widgets/editor/variant.html | 1 - 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/behaviour.js index e2fa539aa..70bdb173e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/behaviour.js @@ -6,6 +6,7 @@ window.Typerefinery.Components.Widgets.Editor = Typerefinery.Components.Widgets. (function (ns, document) { "use strict"; $(document).ready(function () { + console.log('Editor component Behaviour loaded'); $('[component=editor]').each(function () { ns?.init(this); }); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js index 88e28eec8..774fdcee2 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js @@ -170,6 +170,47 @@ window.Typerefinery.Components.Widgets.Editor.Instances = Typerefinery.Component ); }; + // public methods to interact with the editor component instances + ns.getValue = async function (id) { + console.group('editor getValue'); + console.log('id', id); + console.log('editorInstanceNs', editorInstanceNs); + const editorObject = editorInstanceNs[id]; + console.log('editorObject', editorObject); + let returnValue = ""; + if (editorObject) { + if (editorObject instanceof CodeMirror) { + console.log('CodeMirror getValue'); + // get value from codemirror editor + returnValue = editorObject.getValue(); + } else if (Object.keys(editorObject).includes("save")) { + console.log('save sync'); + returnValue = await editorObject.save().then((outputData) => { + console.log('save getValueAsync', outputData); + return outputData; + }); + } + } + console.log('returnValue', returnValue); + console.groupEnd(); + return returnValue; + } + + ns.setEditorData = function (id, data) { + console.group('editor setEditorData'); + console.log('id', id); + console.log('data', data); + console.log('editorInstanceNs', editorInstanceNs); + const editorObject = editorInstanceNs[id]; + if (editorObject instanceof CodeMirror) { + // set value to codemirror editor + editorObject.setValue(data); + } else if (Object.keys(editorObject).includes("render")) { + editorObject.render(data); + } + console.log('returnValue', returnValue); + console.groupEnd(); + } ns.init = ($component) => { // parse json value from data-model attribute as component config diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/editor.html b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/editor.html index 179ac988e..0c843abc8 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/editor.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/editor.html @@ -14,7 +14,7 @@ * limitations under the License. */ --> <sly data-sly-use.model="ai.typerefinery.websight.models.components.widgets.Editor"> - <div isInput="child" name="${model.name}" class="${model.componentClassNames} card card-body shadow-sm"> + <div isInput="editor" data-editor-id="${model.id}" name="${model.name}" class="${model.componentClassNames} card card-body shadow-sm"> <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> </sly> </div> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/variant.html index ef3002ce9..a549616d0 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/variant.html @@ -15,7 +15,6 @@ */ --> <template data-sly-template.variant="${ @ model }"> <div - isInput="true" class="${model.variantClassNames}" id="${model.id}" data-model="${model.jsonString}" From 7a580343ce7c47209ccf890ad1e66946a8ff289b Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 17 Apr 2024 00:01:31 +1000 Subject: [PATCH 069/206] fix meta for form radio. --- .../apps/typerefinery/components/forms/radio/.content.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/radio/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/radio/.content.json index 36775699e..a2d0bce32 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/radio/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/radio/.content.json @@ -3,7 +3,7 @@ "group": "Typerefinery - Forms", "isLayout": false, "sling:resourceType": "ws:Component", - "description": "Form Radio button.", - "title": "Radiobutton Field", + "description": "Form Radio.", + "title": "Radio Field", "sling:resourceSuperType": "typerefinery/components/forms/field" } From 242df84523dc476acc98884364e2dd9e1af70255 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 17 Apr 2024 00:03:18 +1000 Subject: [PATCH 070/206] update form template urls to remove url params to be handled by flows. --- .../components/forms/form/templates/flowform-service.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/templates/flowform-service.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/templates/flowform-service.json index a5bd7ab55..7e0ffd54a 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/templates/flowform-service.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/templates/flowform-service.json @@ -106,7 +106,7 @@ "httpget": { "id": "httpget", "config": { - "url": "<http-route-url>", + "url": "<http-route-url-nosfx>", "method": "GET", "timeout": 5000, "limit": 5120, @@ -163,7 +163,7 @@ "httpput": { "id": "httpput", "config": { - "url": "<http-route-url>", + "url": "<http-route-url-nosfx>", "method": "PUT", "timeout": 5000, "limit": 5120, @@ -263,7 +263,7 @@ "httpdelete": { "id": "httpdelete", "config": { - "url": "<http-route-url>", + "url": "<http-route-url-nosfx>", "method": "DELETE", "timeout": 5000, "limit": 5120, From d76b67ef42297d505a32699169df51054ff2b0bf Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 17 Apr 2024 00:03:49 +1000 Subject: [PATCH 071/206] refactor events namespace with default and custom events. --- .../clientlibs-header/events/functions.js | 102 +++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js index 71d62a7c1..dc1f0c5ba 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js @@ -1,6 +1,5 @@ window.Typerefinery = window.Typerefinery || {}; Typerefinery.Page = Typerefinery.Page || {}; -Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; Typerefinery.Page.Events = Typerefinery.Page.Events || {}; (function (ns, document, window) { @@ -8,6 +7,102 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.registery = {}; + // component event types + ns.EVENT_TYPE_EMIT = "emit"; + ns.EVENT_TYPE_LISTEN = "listen"; + + // cache for events + ns.EVENTS_CACHE = null; + // component generic events + ns.EVENTS = { + //item crud + EVENT_ITEM_CREATE: "createitem", + EVENT_ITEM_READ: "readitem", + EVENT_ITEM_UPDATE: "updateitem", + EVENT_ITEM_DELETE: "deleteitem", + EVENT_ITEM_SELECT: "selectitem", + //component crud + EVENT_CREATE_ACTION: "createaction", + EVENT_READ_ACTION: "readaction", + EVENT_UPDATE_ACTION: "updateaction", + EVENT_DELETE_ACTION: "deleteaction", + EVENT_FILTER_ACTION: "filteraction", + //action success/error + EVENT_SUCCESS_ACTION: "successaction", + EVENT_CANCEL_ACTION: "cancelaction", + EVENT_RESET_ACTION: "resetaction", + EVENT_SUBMIT_ACTION: "submitaction", + EVENT_ERROR_ACTION: "erroraction" + } + + //return object with all generic events + ns.genericEvents = function(initValue) { + var eventMap = {}; + // add all generic events + for (var key in ns.EVENTS) { + //copy value into new object + eventMap[ns.EVENTS[key]] = JSON.parse(JSON.stringify(initValue)); + } + return eventMap; + }; + + //map of events to topics, each event when occures will be attached to all mapped topics + // type (listen,emit) -> event (string) -> [topics] (string) + ns.genericEventsTopicMap = function() { + if (ns.EVENTS_CACHE) { + return ns.EVENTS_CACHE; + } + ns.EVENTS_CACHE = {}; + ns.EVENTS_CACHE[ns.EVENT_TYPE_EMIT] = ns.genericEvents([]); + ns.EVENTS_CACHE[ns.EVENT_TYPE_LISTEN] = ns.genericEvents([]); + return ns.EVENTS_CACHE; + } + + //add event mapping in eventMap local to component, maps component action to topic with event, for quick access by functions. + ns.registerEventActionMapping = function(eventMap, topic, type, componentAction, eventName) { + console.group('registerEventActionMapping'); + console.log(eventMap, topic, type, componentAction, eventName); + //check if params are passed + if (!topic || !componentAction || !eventMap) { + console.error("missing params"); + return; + } + + // check if type is valid, and set to emit if not + if (type !== ns.EVENT_TYPE_EMIT && type !== ns.EVENT_TYPE_LISTEN) { + type = ns.EVENT_TYPE_EMIT; + console.warn("resetting type to emit, invalid type passed"); + } + + //create event config + const topicAction = { + topic: topic, + action: componentAction, + } + + //init type + if (!eventMap[type]) { + eventMap[type] = [eventName]; + console.warn("type not found, creating new type"); + } + + if (!eventMap[type][eventName]) { + eventMap[type][eventName] = [componentAction]; + console.warn("event not found, creating new event"); + } + + if (!eventMap[type][eventName][componentAction]) { + eventMap[type][eventName][componentAction] = [topic]; + console.warn("component action not found, creating new component action"); + } else { + //add event to type + eventMap[type][eventName][componentAction].push(topic); + console.warn("component action found, adding topic to component action"); + } + + console.groupEnd(); + }; + ns.emitEvent = (topic, payload) => { const evt = document.createEvent('customEvent'); evt.initCustomEvent('customEvent', false, false, { topic, payload }); @@ -33,6 +128,11 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; }); }; + + ns.compileEventData = (payload, eventName, action) => { + return { type: eventName, payload: payload, action: action}; + }; + ns.registerEvents = (topic, callbackFn) => { if (!ns.registery[topic]) { ns.registery[topic] = [callbackFn]; From b3ba0cfc188af934dfed425debf199961234b296 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 17 Apr 2024 00:04:55 +1000 Subject: [PATCH 072/206] refactor forms component event and data handling. --- .../forms/form/clientlibs/functions.js | 754 +++++++++++------- .../forms/form/clientlibs/style.css | 12 + 2 files changed, 484 insertions(+), 282 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index 63942083f..4fff10f4d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -4,172 +4,160 @@ window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Form = Typerefinery.Components.Forms.Form || {}; window.Typerefinery.Components.Widgets = Typerefinery.Components.Widgets || {}; window.Typerefinery.Components.Widgets.Editor = Typerefinery.Components.Widgets.Editor || {}; -window.Typerefinery.Components.Widgets.Editor.Instances = Typerefinery.Components.Widgets.Editor.Instances || {}; window.Typerefinery.Components.Forms.Select = Typerefinery.Components.Forms.Select || {}; -window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components.Forms.Select.Instances || {}; window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.Composite || {}; -Typerefinery.Page = Typerefinery.Page || {}; -Typerefinery.Page.Events = Typerefinery.Page.Events || {}; +window.Typerefinery.Page = Typerefinery.Page || {}; +window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; +window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; -(function ($, ns, componentNs, editorInstanceNs, selectInstanceNs, compositeNs, eventNs, document, window) { +(function ($, ns, componentNs, editorNs, selectNs, compositeNs, eventNs, filesNs, document, window) { "use strict"; - ns.filesUrl = "https://files.typerefinery.localhost:8101"; - ns.selectorInputAttribute = "isInput"; ns.selectorInput = `[${ns.selectorInputAttribute}]`; - - ns.uploadFile = async (file) => { - const fileName = file?.name?.trim()?.replace(/\s/g, "-"); - const datePathWithTime = new Date().toISOString().split("T")[0].replace(/-/g, "-") + "/" + new Date().toISOString().split("T")[1].split(".")[0].replace(/:/g, "-"); - let path = window.location.pathname === "/" ? "" : window.location.pathname; - // remove .html from the path - path = path.replace(".html", ""); - path += `/${datePathWithTime}`; - const PREVIEW = `${ns.filesUrl}/api${path}/${fileName}` - try{ - await fetch( - `${ns.filesUrl}/api${path}?type=CREATE_FOLDER`, - { - method: "POST", - mode: 'no-cors', - headers: { - 'accept': 'application/json', - 'Access-Control-Allow-Origin': '*', - 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS' - }, - redirect: 'follow' - } - ); - } - catch(error) { - // ERROR IN CASE PATH EXIST. - } - try{ - const URL = `${ns.filesUrl}/api${path}/${fileName}?type=UPLOAD_FILE&overwrite=true`; - const formData = new FormData(); - formData.append("upload", file); - await fetch( - URL, - { - method: "POST", - body: formData, - mode: 'no-cors', - headers: { - 'accept': 'application/json', - 'Access-Control-Allow-Origin': '*', - 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS' - }, - redirect: 'follow' - }, - ); - // REMOVE LOADER - - return PREVIEW; - }catch(error) { - return PREVIEW; - } - - }; - ns.getFormData = async ($component) => { + // map event types to handlers in component + // this will indicate which events are supported by component + ns.eventMap = eventNs.genericEventsTopicMap(); + + // compule form data into payload + ns.getFormData = async ($component, addFieldHint) => { const result = {}; // get all non composite fields and immidiate composite fields. const $formComponents = $component.findExclude(`${ns.selectorInput},${compositeNs.selector}`,compositeNs.selector); - console.log(["getFormData", $formComponents, $component]) + console.group("getFormData"); + + const formId = $component.attr("id"); + //get form data from global form object + const formData = Object.fromEntries(new FormData(document.forms[formId])); + + console.log($formComponents, $component, formData); + // using for to ensure async await works. for(let i = 0; i < $formComponents.length; i++) { const $input = $($formComponents[i]); const inputObject = $input.get(0); - console.log($input); - const name = $input.attr("name"); + const name = $input.attr("name") || $input.attr("id"); + const id = $input.attr("id"); + const type = $input.attr("type") || ""; + console.group(name); + console.log("$input", $input); + console.log("inputObject", inputObject); + console.log("console.log($input.val());", $input.val()); //is this input field const isInput = $input.attr(ns.selectorInputAttribute); //is this composite value - const isCompositeParent = componentNs.isTrue($input.attr(compositeNs.selectorAttribute)); + const isCompositeParent = $input.is(compositeNs.selector); console.log(["getFormData form component", name, isInput, isCompositeParent]); + //skip all field that do not have a name if (name) { - //is this select tag - const isSelect = $input.prop("tagName") === "SELECT"; - //is this file input - const isFile = $input.type === "file"; // is this text area or input field. - const isChild = isInput === "child"; + const isEditor = isInput === "editor"; + const isSelect = isInput === "select"; - console.log(["getFormData basic form component", isSelect, isFile, isChild]); + console.log(["getFormData basic form component", isSelect, isEditor]); - if(isChild) { + if(isCompositeParent) { - // get value from child component - const $firstChild = $input.children[0]; - - // get value from codemirror editor - result[name] = editorInstanceNs[$firstChild.attr("id")].getValue(); - + console.log(["getFormData composite component", name, isCompositeParent]); + + // get value from composite value + var $compositeValue = $input.findExclude(compositeNs.selectorValue, compositeNs.selector); + console.log(["getFormData composite value input", $compositeValue]); + var compositeValueName = $compositeValue.attr(compositeNs.selectorNameAttribute); + console.log(["getFormData composite value", $compositeValue]); + result[compositeValueName] = {}; + Object.assign(result[compositeValueName], $compositeValue.compositeVal(addFieldHint)); + + if (addFieldHint) { + ns.addFieldHint($input, compositeValueName, id); + } + + } else if(isEditor) { + const editorId = $input.data("editor-id"); + console.log(["getFormData editor component", name, editorId]); + result[name] = await editorNs.getValue(editorId); + + if (addFieldHint) { + ns.addFieldHint($input, name, editorId); + } }else if(isSelect) { // get value from select tag - result[name] = selectInstanceNs[$input.attr("id")].getValue(true); - }else if(isFile) { - - - const files = [...inputObject.files]; - // add loader. - files.forEach(file => { - const fileName = file?.name?.trim()?.replace(/\s/g, "-"); - document.getElementById(`close-${fileName}`).style.display = "none"; - document.getElementById(`loader-${fileName}`).style.display = "block"; - }); - if($input.multiple) { - result[name] = []; - for(let i = 0; i < files.length; i++) { - const fileName = files[i]?.name?.trim()?.replace(/\s/g, "-"); - const output = await ns.uploadFile(files[i]); - document.getElementById(`loader-${fileName}`).style.display = "none"; - document.getElementById(`close-${fileName}`).style.display = "block"; - result[name].push(output); + console.log(["getFormData select component", name, id]); + result[name] = selectNs.getValue(id); + if (addFieldHint) { + ns.addFieldHint($input, name, id); + } + } else { + console.log(["getFormData other component value", name, result[name], $input.val()]); + if (type === "checkbox") { + // get value from checkbox if checked + if ($input.is(":checked")) { + if (!result[name]) { + result[name] = []; + } + result[name].push($input.val()); + } + } else if (type === "radio") { + // get value from radio if checked + if ($input.is(":checked")) { + result[name] = $input.val(); } - }else if($input.files.length > 0){ - const blobUrl = await ns.uploadFile(files[0]); - const fileName = files[0]?.name?.trim()?.replace(/\s/g, "-"); - document.getElementById(`loader-${fileName}`).style.display = "none"; - document.getElementById(`close-${fileName}`).style.display = "block"; - result[name] = blobUrl; - } else { - // if no file is selected then it will return empty string. - result[name] = ""; + } else if (type === "file") { + const files = [...inputObject.files]; + // add loader. + files.forEach(file => { + const fileName = file?.name?.trim()?.replace(/\s/g, "-"); + document.getElementById(`close-${fileName}`).style.display = "none"; + document.getElementById(`loader-${fileName}`).style.display = "block"; + }); + if($input.multiple) { + result[name] = []; + for(let i = 0; i < files.length; i++) { + const fileName = files[i]?.name?.trim()?.replace(/\s/g, "-"); + const output = await filesNs.uploadFile(files[i]); + document.getElementById(`loader-${fileName}`).style.display = "none"; + document.getElementById(`close-${fileName}`).style.display = "block"; + result[name].push(output); + } + }else if($input.files.length > 0){ + const blobUrl = await filesNs.uploadFile(files[0]); + const fileName = files[0]?.name?.trim()?.replace(/\s/g, "-"); + document.getElementById(`loader-${fileName}`).style.display = "none"; + document.getElementById(`close-${fileName}`).style.display = "block"; + result[name] = blobUrl; + } else { + // if no file is selected then it will return empty string. + result[name] = ""; + } + } else { + // get value from $input tag + result[name] = $input.val(); } + + if (addFieldHint) { + ns.addFieldHint($input, name, id); + } - } else { - // get value from $input tag - result[name] = $input.val(); } - } else if(isCompositeParent) { - - console.log(["getFormData composite component", name, isCompositeParent]); - - // get value from composite value - var $compositeValue = $input.findExclude(compositeNs.selectorValue, compositeNs.selector); - console.log(["getFormData composite value input", $compositeValue]); - var compositeValueName = $compositeValue.attr(compositeNs.selectonNameAttribute); - console.log(["getFormData composite value", $compositeValue]); - result[compositeValueName] = {}; - Object.assign(result[compositeValueName], $compositeValue.compositeVal()); } + console.groupEnd(); } console.log(["getFormData", result]); + console.groupEnd(); return result; }; + // submit the request to the server ns.submit = async (url, method, payloadType, body, successCallback = () => { }, errorCallback = () => { }) => { - console.log("---------------SUBMIT----------------") + console.group("submit"); console.log([url, method, payloadType, body]) let controller = new AbortController(); - try { - + try { await fetch(url, { method: method || 'POST', headers: { @@ -182,91 +170,72 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; }) .then(res => res.json()) .then(res => { - console.log("---------------SUBMITED RESPONSE----------------") + console.group("submit response"); console.log(res) - successCallback() + successCallback({ + url: url, + method: method, + payloadType: payloadType, + body: body + }) + console.groupEnd(); }); - - // const [submitResponse] = await Promise.all([ - // fetch( - // url, - // { - // method: method || "POST", - // mode: 'no-cors', - // headers: { - // "Content-Type": payloadType || "application/x-www-form-urlencoded" - // }, - // cache: 'no-cache', - // body: body, - // keepalive: true, - // redirect: 'follow', - // signal: controller.signal - // } - // ) - // ]); - // // const response = await fetch( - // // url, - // // { - // // method: method || "POST", - // // mode: 'no-cors', - // // headers: { - // // "Content-Type": payloadType || "application/x-www-form-urlencoded" - // // }, - // // body: body, - // // keepalive: true, - // // redirect: 'follow', - // // signal: controller.signal - // // } - // // ); - // var responseJson = await submitResponse.json(); - // // console.log(json); - // // var text = await response.text(); - // console.log(responseJson); - // // if status is 200 to 299 then it will call success callback. - // if (submitResponse.status >= 200 && submitResponse.status <= 299) { - // successCallback(); - // } else { - // console.log("Error in submitting the request"); - // console.error(submitResponse); - // errorCallback(); - // } - // return; } catch (error) { - console.log("Error in submitting the request"); + console.group("Error in submitting the request"); console.error(error); - errorCallback(); + errorCallback({ + url: url, + method: method, + payloadType: payloadType, + body: body + }); + console.groupEnd(); return; } controller = null; + console.groupEnd(); return; }; - ns.successCallback = () => { - // TODO: Need to add toast. - alert("SUCCESS"); - }; - - ns.errorCallback = () => { - // TODO: Need to add toast. - alert("ERROR"); - }; + // local actions representing the form actions + ns.FORM_SUCCESS = ($component, componentConfig, formData) => { + ns.emitLocalEvent($component, componentConfig, formData, eventNs.EVENTS.EVENT_SUCCESS_ACTION, "FORM_SUCCESS"); + } + ns.FORM_ERROR = ($component, componentConfig, formData) => { + ns.emitLocalEvent($component, componentConfig, formData, eventNs.EVENTS.EVENT_ERROR_ACTION, "FORM_ERROR"); + } + ns.FORM_SUBMIT = ($component, componentConfig, formData) => { + ns.emitLocalEvent($component, componentConfig, formData, eventNs.EVENTS.EVENT_SUBMIT_ACTION, "FORM_SUBMIT"); + } + ns.FORM_CANCEL = ($component, componentConfig, formData) => { + ns.emitLocalEvent($component, componentConfig, formData, eventNs.EVENTS.EVENT_CANCEL_ACTION, "FORM_CANCEL"); + } + ns.FORM_RESET = ($component, componentConfig, formData) => { + ns.emitLocalEvent($component, componentConfig, formData, eventNs.EVENTS.EVENT_RESET_ACTION, "FORM_RESET"); + } + ns.FORM_LOADED = ($component, componentConfig, formData) => { + ns.emitLocalEvent($component, componentConfig, formData, eventNs.EVENTS.EVENT_READ_ACTION, "FORM_LOADED"); + } + // json form post ns.jsonRequest = async (url, componentConfig, payload) => { const { writePayloadType, writeMethod } = componentConfig; - - await ns.submit(url, writeMethod, writePayloadType, JSON.stringify(payload), ns.successCallback, ns.errorCallback); + ns.FORM_SUBMIT(payload); + await ns.submit(url, writeMethod, writePayloadType, JSON.stringify(payload), ns.FORM_SUCCESS, ns.FORM_ERROR); }; - + //plain form post ns.formRequest = async (url, componentConfig, payload) => { const { writePayloadType, writeMethod } = componentConfig; const formData = new URLSearchParams(); Object.entries(payload).map(item => { formData.append(item[0], item[1]) }); - await ns.submit(url, writeMethod, writePayloadType, formData.toString(), ns.successCallback, ns.errorCallback); + ns.FORM_SUBMIT(formData); + await ns.submit(url, writeMethod, writePayloadType, formData.toString(), ns.FORM_SUCCESS, ns.FORM_ERROR); }; + // update the button state to loading or completed. ns.updateButtonState = ($component, state) => { const $button = $component.find("button[type='submit']"); if ($button) { @@ -278,17 +247,20 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; }; + // form submit handler ns.formSubmitHandler = async ($component) => { const componentConfig = componentNs.getComponentConfig($component); console.log(["formSubmitHandler", componentConfig, $component]) let { writePayloadType, writeMethod, writeUrl } = componentConfig; if (!writePayloadType || !writeMethod || !writeUrl) { + ns.FORM_CANCEL({data: payload, reason: "Form has not been configured properly."}); console.log("Author should fill all the parameters."); return; } const payload = await ns.getFormData($component); ns.updateButtonState($component, "loading"); + //TODO: do form validation here and cancel the request if validation fails writeUrl = componentNs.replaceRegex(writeUrl, componentNs.getQueryParams()); if (writePayloadType === "application/json") { @@ -299,18 +271,162 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.updateButtonState($component, "completed"); }; - ns.loadInitialData = async ($component, initConfig) => { + ns.loadData = async ($component, data, componentConfig) => { + try { + // if componentConfig is not passed then get the componentConfig from the $component + if (!componentConfig) { + componentConfig = componentNs.getComponentConfig($component); + } + const $formComponents = $component.findExclude(`${ns.selectorInput},${compositeNs.selector}`,compositeNs.selector); + console.group("loadData"); + console.log(["loadData", $component, data, componentConfig, $formComponents]); + + // if data is not passed then return + if (!data) { + console.log("Data is missing"); + return; + } + + // step though $formComponents + for(let i = 0; i < $formComponents.length; i++) { + const $input = $($formComponents[i]); + const inputObject = $input.get(0); + const name = $input.attr("name") || $input.attr("id"); + const id = $input.attr("id"); + const type = $input.attr("type") || ""; + const tagName = $input.prop("tagName"); + const isInput = $input.attr(ns.selectorInputAttribute); + const isCompositeParent = $input.is(compositeNs.selector); + console.group(name); + console.log($input); + console.log(inputObject); + console.log($input.val()); + + //skip all field that do not have a name and dont exist in data + if (name && data[name]) { + const isSelect = tagName === "SELECT"; + const isEditor = isInput === "editor"; + console.log(["loadData basic form component", isSelect, isEditor]); + + if(isCompositeParent) { + console.log(["loadData composite component", name, isCompositeParent]); + compositeNs.setValue($input, data[name]); + } else if(isEditor) { + const editorId = $input.data("editor-id"); + console.log(["loadData editor component", name, editorId]); + editorNs.setEditorData(editorId, data[name]); + } else if(isSelect) { + selectNs.setValue(id, data[name]); + } else { + console.log(["loadData other component value", name, data[name], $input.val()]); + if (type === "checkbox") { + // check all inputs + if (data[name] === $input.val()) { + $input.attr("checked", "checked"); + } + } else if (type === "radio") { + // check all radio inputs + if (data[name] === $input.val()) { + $input.attr("checked", "checked"); + } + } else { + $input.attr("value", data[name]); + } + } + } + console.groupEnd(); + + } + + // loop through all the input fields and set the value from the response. + $component.find("[isInput]").each(function() { + const $item = $(this); + + const name = $item.attr("name"); + + if (!data[name]) { + return; + } + + const isInput = $item.attr('isInput'); + if (isInput === "true") { + // if select tag then update the option with selected attribute + if ($item.tagName === "SELECT") { + const options = $item.find("option"); + + // if data[name] is string then split by , and trim all. + if (typeof data[name] === "string") { + data[name] = data[name].split(",").map(item => item.trim()); + } + + // if data[name] is array then loop through the array and check wether the option value is present in the array or not. + if (Array.isArray(data[name])) { + // if choice js gas not rendered the select, set values in select tag. + options.each(function() { + const option = $(this); + if (data[name].includes(option.attr("value"))) { + option.attr("selected", true); + } + }); + //set values in choice js instance + data[name].forEach(function(option) { + selectNs.setChoiceByValue(`${$item.attr('id')}`, option); + }); + // $(`#${$item.attr('id')}`).val(data[name]); + } + } + + + // if item type is checked or radio then set checked attribute + if ($item.attr("type") === "checkbox" || $item.attr("type") === "radio") { + if (data[name]) { + $item.attr("checked", name); + } + } + + // set value attribute + $item.attr("value", data[name]); + + } else if (isInput === "editor") { + const editorId = $input.data("editor-id"); + ns.editorNs.setEditorData(editorId, data[name]); + } + }); + + // emit event to notify the form is loaded + ns.FORM_LOADED($component, componentConfig, data); + + } catch (error) { + console.log("Error loading data into form"); + console.error(error); + } + } + + // check if query string exists and return the query string. + ns.isDataLoadRequired = (componentConfig) => { + const { readUrl } = componentConfig; + console.warn(["isDataLoadRequired", readUrl, window.location, window.location.search.substring(1)]); + if (!readUrl && readUrl != "") { + return false; + } + return window.location.search.substring(1) === "" ? false : true; + } + + + ns.getData = async ($component, initConfig) => { try { const componentConfig = initConfig || componentNs.getComponentConfig($component); const { readUrl, readMethod = "GET", readPayloadType = "application/json", id } = componentConfig; if (!readUrl && readUrl != "") { return; } - console.log(["componentConfig", componentConfig, readUrl, readMethod, readPayloadType]); - const url = componentNs.replaceRegex(readUrl, componentNs.getQueryParams()); + const queryParams = componentNs.getQueryParams(); + const url = componentNs.replaceRegex(readUrl, queryParams); + console.log(["componentConfig", componentConfig, readUrl, queryParams, url, readMethod, readPayloadType]); + var response; try { - const response = await fetch( + response = await fetch( url, { method: readMethod || "GET", @@ -328,114 +444,188 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; return; } - // loop through all the input fields and set the value from the response. - $component.find("[isInput]").each(function() { - const $item = $(this); - - const name = $item.attr("name"); - - if (!response[name]) { - return; - } - - const isInput = $item.attr('isInput'); - if (isInput === "true") { - // if select tag then update the option with selected attribute - if ($item.tagName === "SELECT") { - const options = $item.find("option"); + return response; - // if response[name] is string then split by , and trim all. - if (typeof response[name] === "string") { - response[name] = response[name].split(",").map(item => item.trim()); - } - - // if response[name] is array then loop through the array and check wether the option value is present in the array or not. - if (Array.isArray(response[name])) { - // if choice js gas not rendered the select, set values in select tag. - options.each(function() { - const option = $(this); - if (response[name].includes(option.attr("value"))) { - option.attr("selected", true); - } - }); - //set values in choice js instance - response[name].forEach(function(option) { - selectInstanceNs[`${$item.attr('id')}`].setChoiceByValue(option); - }); - // $(`#${$item.attr('id')}`).val(response[name]); - } - } + } catch (error) { + console.log("Error in fetching form initial data"); + console.error(error); + } + } + ns.emitLocalEvent = ($component, componentConfig, payload, eventName, componentAction) => { + console.group('emitLocalEvent'); + console.log(["config", $component, componentConfig, payload, eventName, componentAction]); + const eventData = eventNs.compileEventData(payload, eventName, componentAction); - // if item type is checked or radio then set checked attribute - if ($item.attr("type") === "checkbox" || $item.attr("type") === "radio") { - if (response[name]) { - $item.attr("checked", name); - } - } + if (!ns.eventMap) { + console.error("Event map is missing"); + console.groupEnd(); + return; + } + //find event in eventMap and emit event to all the topics + if (ns.eventMap[eventNs.EVENT_TYPE_EMIT]) { + if (ns.eventMap[eventNs.EVENT_TYPE_EMIT][eventName]) { + if (ns.eventMap[eventNs.EVENT_TYPE_EMIT][eventName][componentAction]) { + const topicValues = ns.eventMap[eventNs.EVENT_TYPE_EMIT][eventName][componentAction]; + console.log("match"); + + // if topicValues is array then emit event to all the topics + if (Array.isArray(topicValues)) { + topicValues.forEach(topicValue => { + console.log(topicValue); + eventNs.emitEvent(topicValue, eventData); + }); + } else { + //is single value use it as topic + if (topicValues) { + console.log(topicValues); + eventNs.emitEvent(topicValues, eventData); + } + } + } else { + console.log("no match"); + } + } + } - // set value attribute - $item.attr("value", response[name]); + console.groupEnd(); + } - } else if (isInput === "child") { - // check the first children of the $item component and check wether it is editable or not and set the value accordingly. - const $firstChild = $item.children[0]; - const editorConfig = componentNs.getComponentConfig($firstChild) - if ($firstChild.attr("component") === "editor") { - if (editorInstanceNs[`${editorConfig.id}`]) { + ns.consumeIncomingEvent = ($component, eventData) => { + const { type, topic, payload } = eventData; + console.log(["consumeIncomingEvent", type, topic, payload]); + const componentConfig = componentNs.getComponentConfig($component); + const { id } = componentConfig; + const key = `${id}-${type}`; + const event = ns.eventMap[eventNs.EVENT_TYPE_LISTEN][key]; + if (event) { + event(payload); + } + }; - if (editorConfig.variant === "CODE_EDITOR") { - // Works for code mirror editor. - editorInstanceNs[`${editorConfig.id}`].setValue(response[name]); - } + ns.addEventListener = ($component, componentConfig) => { + console.group('addEventListener'); + const { events, id } = componentConfig; + const defaultTopic = id; + + console.log(["config", events, id, defaultTopic]); + + console.log("registering events"); + //register events + if (events) { + events.forEach(event => { + const { topic, type, name, nameCustom, action } = event; + //if topic not set use component id as topic + const topicName = topic || defaultTopic; + // if type is not defined then its emitted + let typeName = type || eventNs.EVENT_TYPE_EMIT; + + let eventName = name || nameCustom; + + console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap), topicName, typeName, action, eventName]); + eventNs.registerEventActionMapping(ns.eventMap, topicName, typeName, action, eventName); + console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap)]); + + // if event type is listen then add event listener for the event + + if (typeName === eventNs.EVENT_TYPE_EMIT) { + //emit do nothing here + } else { + //listen register the event and listent for specific event on topic + console.log(["registerEvents", topicName, eventName]); + eventNs.registerEvents(topicName, (data) => { + // check make sure the event is for this event + if (data.type === eventName) { + ns.update($component, data.type, data.data); + } + }); + } + }); + } + + console.log(["eventMap", ns.eventMap]); + + console.log("adding submit event listener"); + + // override default submit to handle form submit using code + $component.on("submit", function (e) { + console.group("form submit event listener") + e.preventDefault(); + const { target } = e; + console.log(target) + ns.formSubmitHandler($(target)); + console.groupEnd(); + }); + + // add event listener to document to listen for incoming events + $(document).keydown(function(event) { + if (event.ctrlKey && event.shiftKey && event.altKey && String.fromCharCode(event.which) === "I") { + console.group("showhints"); + ns.showFormHints($component, componentConfig).then(() => { + console.groupEnd(); + }); + } + }); - // TODO: need to load the data for other editors. + console.groupEnd(); + }; - } - } - } - }); - $component.find("[data-field-name]").forEach( - $item => { - const fieldName = $item.attr("data-field-name"); - const componentId = $item.attr("data-field-componentId"); - if (response[fieldName]) { - const key = `${componentId}-${fieldName}`; - eventNs.emitEvent(key, { - data: { - value: response[fieldName] - }, - type: "LOAD_DATA" - }); - // eventNs.registerEvents(key, ns.getEventHandlerCallBackFn($component, event)); - } - } - ) - } catch (error) { - console.log("Error in fetching form initial data"); - console.error(error); + ns.addFieldHint = ($field, fieldName, fieldId) => { + const $fieldHint = $field.find(`div.fieldhint[data-fieldid="${fieldId}"]`); + console.log("found field", $field); + console.log("found hint", $fieldHint); + //updated it or create it + if ($fieldHint.length > 0) { + $fieldHint.html(`${fieldName}`); + } else { + const $hint = $(`<div class="fieldhint badge rounded-pill bg-secondary" data-fieldid="${fieldId}">${fieldName}</div>`); + console.log("created hint", $hint); + const $fieldParent = $field.closest(`field`); + console.log("found parent", $fieldParent); + if ($fieldParent.length > 0) { + $hint.insertBefore($fieldParent); + } else { + //add hint above the field + $hint.insertBefore($field); + } + } + } + + ns.showFormHints = async ($component, componentConfig) => { + //find all fields and show hints that represent field name and value + const formData = await ns.getFormData($component, true); + console.group("showFormHints"); + console.log(formData); + $component.find(".fieldhint").show(); + console.groupEnd(); + } + + ns.update = ($component, eventName, data) => { + console.log(["update", $component, eventName, data]); + //load data into form + if (eventName === eventNs.EVENTS.EVENT_READ_ACTION) { + ns.loadData($component, data); } } - ns.addEventListener = ($component) => { - $component.on("submit", function (e) { - console.log("---------------SUBMITTING----------------") - e.preventDefault(); - const { target } = e; - console.log(target) - ns.formSubmitHandler($(target)); - }); - }; - ns.init = ($component) => { const componentConfig = componentNs.getComponentConfig($component); - console.log(["forms init", componentConfig, "componentConfig", $component]); + console.group("forms init"); + console.log(["config", componentConfig, $component, ns.eventMap]); if (Object.keys(componentConfig).length === 0) { - console.log("Component config of form component is missing"); + console.error("Component config of form component is missing"); return; } - ns.loadInitialData($component, componentConfig); - ns.addEventListener($component); + console.log("adding event listeners"); + ns.addEventListener($component, componentConfig); + console.log(["ns.eventMap", ns.eventMap]); + + if (ns.isDataLoadRequired(componentConfig)) { + console.log("query string exists, loading data..."); + var initData = ns.getData($component, componentConfig); + ns.loadData($component, initData, componentConfig); + } + console.groupEnd(); } -})(jQuery, Typerefinery.Components.Forms.Form, Typerefinery.Components, Typerefinery.Components.Widgets.Editor.Instances, Typerefinery.Components.Forms.Select.Instances, window.Typerefinery.Components.Forms.Composite, Typerefinery.Page.Events, document, window); \ No newline at end of file +})(jQuery, Typerefinery.Components.Forms.Form, Typerefinery.Components, Typerefinery.Components.Widgets.Editor, Typerefinery.Components.Forms.Select, window.Typerefinery.Components.Forms.Composite, Typerefinery.Page.Events, Typerefinery.Page.Files, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/style.css b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/style.css index 8a2d44cf1..ca4fa1371 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/style.css +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/style.css @@ -1,3 +1,15 @@ .label { margin-left: 10px; +} + +.fieldhint { + top: 10px; + z-index: 999; + width: fit-content; + right: 0px; + display: inline-flex; + display: none; + align-self: end; + position: relative; + float:inline-end; } \ No newline at end of file From bce057a341c039b73c6a325fc7e21bb953e5340c Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 17 Apr 2024 00:12:36 +1000 Subject: [PATCH 073/206] update stix to use core composite functions. --- .../fields/composite/clientlibs/functions.js | 75 +++---------------- 1 file changed, 11 insertions(+), 64 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/functions.js index 490376add..7d87aa786 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/functions.js @@ -1,90 +1,37 @@ window.Typerefinery = window.Typerefinery || {}; window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; +window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.Composite || {}; window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; window.Typerefinery.Components.Stix.Forms.Composite = Typerefinery.Components.Stix.Forms.Composite || {}; - -;(function ($, ns, componentNs, window, document) { +;(function ($, ns, componentNs, formsNs, compositeNs, document, window) { "use strict"; - ns.selectorAttribute = "isCompositeParent"; - ns.selector = `[${ns.selectorAttribute}]`; - ns.selectorValueAttribute = "isCompositeValue"; - ns.selectorValue = `[${ns.selectorValueAttribute}]`; - //how to find all form input fields - ns.selectorInputAttribute = "isInput"; - ns.selectorInput = `[${ns.selectorInputAttribute}]`; - //how to find all input fields that are part of this composite input - ns.selectorCompositeInputAttribute = "isCompositeInput"; - ns.selectorCompositeInput = `[${ns.selectorCompositeInputAttribute}]`; - //template for form components in parent - ns.selectorTemplate = "> [template]"; - ns.selectonNameAttribute = "name"; - - $.fn.findExclude = function(selector, mask) { - return this.find(selector).not(this.find(mask).find(selector)); - } - - $.fn.compositeVal = function() { - //get all immediate isCompositeParent - var $compositeParents = this.parent(ns.selector).findExclude(ns.selector,ns.selector); - var data = {}; - - //add current field values to data - Object.assign(data,JSON.parse(this.val())); - - //for each get their values and merge their composites in - $compositeParents.each(function(){ - //find composite value input field - var $compositeValue = $(this).findExclude(ns.selectorValue,ns.selector); - if ($compositeValue) { - // create placeholder for composite value - data[$compositeValue.attr(ns.selectonNameAttribute)] = {}; - // get composite value for this field, this will cascade to other composite fields - Object.assign(data[$compositeValue.attr(ns.selectonNameAttribute)],$compositeValue.compositeVal()); - } - }); - return data; - } - - ns.compileValue = function($compositeParent) { - var $field = $compositeParent.findExclude(ns.selectorValue,ns.selector); - var $templateFields = $compositeParent.findExclude(ns.selectorTemplate,ns.selector).findExclude(ns.selectorCompositeInput,ns.selector); - var data = {}; - - $templateFields.each(function(){ - //get name and value of each input field - var name = $(this).attr(ns.selectonNameAttribute); - var value = $(this).val(); - data[name] = value; - }); - //set value of composite input - $field.val(JSON.stringify(data)); - } ns.init = async ($component) => { const componentConfig = componentNs.getComponentConfig($component); $(document).ready(function () { - $(ns.selector).each(function(){ + $(compositeNs.selector).each(function(){ //find all input fields that are not inside another composite input - var $field = $(this).findExclude(ns.selectorTemplate,ns.selector).findExclude(ns.selectorInput, ns.selector); + var $field = $(this).findExclude(compositeNs.selectorTemplate,compositeNs.selector).findExclude(compositeNs.selectorInput, compositeNs.selector); //remove isInput attribute and add isCompositeInput attribute, this will ensure that form fields are not processed by form submit - $field.removeAttr(ns.selectorInputAttribute); - $field.attr(ns.selectorCompositeInputAttribute,"true"); + $field.removeAttr(compositeNs.selectorInputAttribute); + $field.attr(compositeNs.selectorCompositeInputAttribute,"true"); //compile value for composite input - ns.compileValue($(this)); + compositeNs.compileValue($(this)); }); }) //listen for change event on all input fields and compile value for composite input - $(ns.selector).on("change", function() { - ns.compileValue($(this)); + $(compositeNs.selector).on("change", function() { + compositeNs.compileValue($(this)); }); } -})(jQuery, Typerefinery.Components.Stix.Forms.Composite, Typerefinery.Components, window, document); +})(jQuery, Typerefinery.Components.Stix.Forms.Composite, Typerefinery.Components, Typerefinery.Components.Forms, Typerefinery.Components.Forms.Composite, document, window); From 767c610dfdaae5c3a5b8719007d4ad15eb1bf4a7 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 18 Apr 2024 16:52:28 +1000 Subject: [PATCH 074/206] update names. --- .../components/forms/fields/composite/clientlibs/functions.js | 4 ++-- .../components/forms/fields/composite/dialog/.content.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js index f6ab3d91f..7650a16f5 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js @@ -5,7 +5,7 @@ window.Typerefinery.Components.Forms.Form = Typerefinery.Components.Forms.Form | window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.Composite || {}; -;(function ($, ns, componentNs, formNs, document, window) { +;(function ($, ns, componentsNs, formNs, document, window) { "use strict"; ns.selectorAttribute = "isCompositeParent"; @@ -91,7 +91,7 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C } ns.init = async ($component) => { - const componentConfig = componentNs.getComponentConfig($component); + const componentConfig = componentsNs.getComponentConfig($component); $(document).ready(function () { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json index 4b7fafc38..feee2d895 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json @@ -23,7 +23,7 @@ "sling:resourceType": "wcm/dialogs/components/select", "name": "inputType", "label": "Type", - "granularmarking": { + "composite": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", "label": "Composite", "value": "composite" From 8f41e88ed92203d515c97957afb8a9968565c4a9 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 23 Apr 2024 01:35:15 +1000 Subject: [PATCH 075/206] add helpers to watch dom elements. --- .../clientlibs-header/components.js | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js index c116d5a8c..5d3916eee 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js @@ -108,5 +108,77 @@ window.Typerefinery.VueData = Typerefinery.VueData || {}; }); }, 1000); }; + + //find all selectors and run callbackFn + ns.initComponentBySelector = (selector, callbackFn) => { + if ((selector == null || selector == undefined) || (callbackFn == null || callbackFn == undefined)) { + console.error("initComponent: selector and callbackFn is required"); + return; + } + //init component on all found instances + var elements = document.querySelectorAll(selector); + for (var i = 0; i < elements.length; i++) { + callbackFn($(elements[i])); + } + } + + //observe DOM for new instances of a selector and run callbackFn + ns.observeDOMForSelector = (selector, callbackFn) => { + + if ((selector == null || selector == undefined) || (callbackFn == null || callbackFn == undefined)) { + console.error("observeDOMForSelector: selector and callbackFn is required"); + return; + } + + //observe DOM for future instances of a selector + var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; + var body = document.querySelector("body"); + var observer = new MutationObserver(function(mutations) { + mutations.forEach(function(mutation) { + var nodesArray = [].slice.call(mutation.addedNodes); + if (nodesArray.length > 0) { + nodesArray.forEach(function(addedNode) { + if (addedNode.querySelectorAll) { + var elementsArray = [].slice.call(addedNode.querySelectorAll(selector)); + elementsArray.forEach(function(element) { + console.log("new element", selector); + callbackFn($(element)); + }); + } + }); + } + }); + }); + + observer.observe(body, { + subtree: true, + childList: true, + characterData: true + }); + } + + ns.onDocumentReady = (selector, callbackFn) => { + if ((selector == null || selector == undefined) || (callbackFn == null || callbackFn == undefined)) { + console.error("onDocumentReady: selector and callbackFn is required"); + return; + } + + console.group("loading searchBox"); + + ns.initComponentBySelector(selector, callbackFn); + ns.observeDOMForSelector(selector, callbackFn); + + console.groupEnd(); + + } + + ns.watchDOMForComponent = (selector, callbackFn) => { + if (document.readyState !== "loading") { + ns.onDocumentReady(selector, callbackFn); + } else { + document.addEventListener("DOMContentLoaded", ns.onDocumentReady(selector, callbackFn)); + } + } + ns.init(); })(jQuery, window.Typerefinery.Components, window.Typerefinery.VueData, document, window); From 3d2bb382af1537268f8ffb80cc17334626fa282e Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 23 Apr 2024 01:36:03 +1000 Subject: [PATCH 076/206] add sortable vendor lib. --- .../clientlibs/vendor/sortable/sortable.js | 3362 +++++++++++++++++ 1 file changed, 3362 insertions(+) create mode 100644 application/frontend/src/static/clientlibs/vendor/sortable/sortable.js diff --git a/application/frontend/src/static/clientlibs/vendor/sortable/sortable.js b/application/frontend/src/static/clientlibs/vendor/sortable/sortable.js new file mode 100644 index 000000000..50c60a53e --- /dev/null +++ b/application/frontend/src/static/clientlibs/vendor/sortable/sortable.js @@ -0,0 +1,3362 @@ +/**! + * Sortable 1.15.2 + * @author RubaXa <trash@rubaxa.org> + * @author owenm <owen23355@gmail.com> + * @license MIT + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.Sortable = factory()); + }(this, (function () { 'use strict'; + + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) { + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + } + keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + return target; + } + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function (obj) { + return typeof obj; + }; + } else { + _typeof = function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return _typeof(obj); + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); + } + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + return target; + } + function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + var target = _objectWithoutPropertiesLoose(source, excluded); + var key, i; + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + return target; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + var version = "1.15.2"; + + function userAgent(pattern) { + if (typeof window !== 'undefined' && window.navigator) { + return !! /*@__PURE__*/navigator.userAgent.match(pattern); + } + } + var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i); + var Edge = userAgent(/Edge/i); + var FireFox = userAgent(/firefox/i); + var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i); + var IOS = userAgent(/iP(ad|od|hone)/i); + var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i); + + var captureMode = { + capture: false, + passive: false + }; + function on(el, event, fn) { + el.addEventListener(event, fn, !IE11OrLess && captureMode); + } + function off(el, event, fn) { + el.removeEventListener(event, fn, !IE11OrLess && captureMode); + } + function matches( /**HTMLElement*/el, /**String*/selector) { + if (!selector) return; + selector[0] === '>' && (selector = selector.substring(1)); + if (el) { + try { + if (el.matches) { + return el.matches(selector); + } else if (el.msMatchesSelector) { + return el.msMatchesSelector(selector); + } else if (el.webkitMatchesSelector) { + return el.webkitMatchesSelector(selector); + } + } catch (_) { + return false; + } + } + return false; + } + function getParentOrHost(el) { + return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode; + } + function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) { + if (el) { + ctx = ctx || document; + do { + if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) { + return el; + } + if (el === ctx) break; + /* jshint boss:true */ + } while (el = getParentOrHost(el)); + } + return null; + } + var R_SPACE = /\s+/g; + function toggleClass(el, name, state) { + if (el && name) { + if (el.classList) { + el.classList[state ? 'add' : 'remove'](name); + } else { + var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' '); + el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' '); + } + } + } + function css(el, prop, val) { + var style = el && el.style; + if (style) { + if (val === void 0) { + if (document.defaultView && document.defaultView.getComputedStyle) { + val = document.defaultView.getComputedStyle(el, ''); + } else if (el.currentStyle) { + val = el.currentStyle; + } + return prop === void 0 ? val : val[prop]; + } else { + if (!(prop in style) && prop.indexOf('webkit') === -1) { + prop = '-webkit-' + prop; + } + style[prop] = val + (typeof val === 'string' ? '' : 'px'); + } + } + } + function matrix(el, selfOnly) { + var appliedTransforms = ''; + if (typeof el === 'string') { + appliedTransforms = el; + } else { + do { + var transform = css(el, 'transform'); + if (transform && transform !== 'none') { + appliedTransforms = transform + ' ' + appliedTransforms; + } + /* jshint boss:true */ + } while (!selfOnly && (el = el.parentNode)); + } + var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix; + /*jshint -W056 */ + return matrixFn && new matrixFn(appliedTransforms); + } + function find(ctx, tagName, iterator) { + if (ctx) { + var list = ctx.getElementsByTagName(tagName), + i = 0, + n = list.length; + if (iterator) { + for (; i < n; i++) { + iterator(list[i], i); + } + } + return list; + } + return []; + } + function getWindowScrollingElement() { + var scrollingElement = document.scrollingElement; + if (scrollingElement) { + return scrollingElement; + } else { + return document.documentElement; + } + } + + /** + * Returns the "bounding client rect" of given element + * @param {HTMLElement} el The element whose boundingClientRect is wanted + * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container + * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr + * @param {[Boolean]} undoScale Whether the container's scale() should be undone + * @param {[HTMLElement]} container The parent the element will be placed in + * @return {Object} The boundingClientRect of el, with specified adjustments + */ + function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) { + if (!el.getBoundingClientRect && el !== window) return; + var elRect, top, left, bottom, right, height, width; + if (el !== window && el.parentNode && el !== getWindowScrollingElement()) { + elRect = el.getBoundingClientRect(); + top = elRect.top; + left = elRect.left; + bottom = elRect.bottom; + right = elRect.right; + height = elRect.height; + width = elRect.width; + } else { + top = 0; + left = 0; + bottom = window.innerHeight; + right = window.innerWidth; + height = window.innerHeight; + width = window.innerWidth; + } + if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) { + // Adjust for translate() + container = container || el.parentNode; + + // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312) + // Not needed on <= IE11 + if (!IE11OrLess) { + do { + if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) { + var containerRect = container.getBoundingClientRect(); + + // Set relative to edges of padding box of container + top -= containerRect.top + parseInt(css(container, 'border-top-width')); + left -= containerRect.left + parseInt(css(container, 'border-left-width')); + bottom = top + elRect.height; + right = left + elRect.width; + break; + } + /* jshint boss:true */ + } while (container = container.parentNode); + } + } + if (undoScale && el !== window) { + // Adjust for scale() + var elMatrix = matrix(container || el), + scaleX = elMatrix && elMatrix.a, + scaleY = elMatrix && elMatrix.d; + if (elMatrix) { + top /= scaleY; + left /= scaleX; + width /= scaleX; + height /= scaleY; + bottom = top + height; + right = left + width; + } + } + return { + top: top, + left: left, + bottom: bottom, + right: right, + width: width, + height: height + }; + } + + /** + * Checks if a side of an element is scrolled past a side of its parents + * @param {HTMLElement} el The element who's side being scrolled out of view is in question + * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom') + * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom') + * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element + */ + function isScrolledPast(el, elSide, parentSide) { + var parent = getParentAutoScrollElement(el, true), + elSideVal = getRect(el)[elSide]; + + /* jshint boss:true */ + while (parent) { + var parentSideVal = getRect(parent)[parentSide], + visible = void 0; + if (parentSide === 'top' || parentSide === 'left') { + visible = elSideVal >= parentSideVal; + } else { + visible = elSideVal <= parentSideVal; + } + if (!visible) return parent; + if (parent === getWindowScrollingElement()) break; + parent = getParentAutoScrollElement(parent, false); + } + return false; + } + + /** + * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible) + * and non-draggable elements + * @param {HTMLElement} el The parent element + * @param {Number} childNum The index of the child + * @param {Object} options Parent Sortable's options + * @return {HTMLElement} The child at index childNum, or null if not found + */ + function getChild(el, childNum, options, includeDragEl) { + var currentChild = 0, + i = 0, + children = el.children; + while (i < children.length) { + if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) { + if (currentChild === childNum) { + return children[i]; + } + currentChild++; + } + i++; + } + return null; + } + + /** + * Gets the last child in the el, ignoring ghostEl or invisible elements (clones) + * @param {HTMLElement} el Parent element + * @param {selector} selector Any other elements that should be ignored + * @return {HTMLElement} The last child, ignoring ghostEl + */ + function lastChild(el, selector) { + var last = el.lastElementChild; + while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) { + last = last.previousElementSibling; + } + return last || null; + } + + /** + * Returns the index of an element within its parent for a selected set of + * elements + * @param {HTMLElement} el + * @param {selector} selector + * @return {number} + */ + function index(el, selector) { + var index = 0; + if (!el || !el.parentNode) { + return -1; + } + + /* jshint boss:true */ + while (el = el.previousElementSibling) { + if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) { + index++; + } + } + return index; + } + + /** + * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements. + * The value is returned in real pixels. + * @param {HTMLElement} el + * @return {Array} Offsets in the format of [left, top] + */ + function getRelativeScrollOffset(el) { + var offsetLeft = 0, + offsetTop = 0, + winScroller = getWindowScrollingElement(); + if (el) { + do { + var elMatrix = matrix(el), + scaleX = elMatrix.a, + scaleY = elMatrix.d; + offsetLeft += el.scrollLeft * scaleX; + offsetTop += el.scrollTop * scaleY; + } while (el !== winScroller && (el = el.parentNode)); + } + return [offsetLeft, offsetTop]; + } + + /** + * Returns the index of the object within the given array + * @param {Array} arr Array that may or may not hold the object + * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find + * @return {Number} The index of the object in the array, or -1 + */ + function indexOfObject(arr, obj) { + for (var i in arr) { + if (!arr.hasOwnProperty(i)) continue; + for (var key in obj) { + if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i); + } + } + return -1; + } + function getParentAutoScrollElement(el, includeSelf) { + // skip to window + if (!el || !el.getBoundingClientRect) return getWindowScrollingElement(); + var elem = el; + var gotSelf = false; + do { + // we don't need to get elem css if it isn't even overflowing in the first place (performance) + if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) { + var elemCSS = css(elem); + if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) { + if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement(); + if (gotSelf || includeSelf) return elem; + gotSelf = true; + } + } + /* jshint boss:true */ + } while (elem = elem.parentNode); + return getWindowScrollingElement(); + } + function extend(dst, src) { + if (dst && src) { + for (var key in src) { + if (src.hasOwnProperty(key)) { + dst[key] = src[key]; + } + } + } + return dst; + } + function isRectEqual(rect1, rect2) { + return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width); + } + var _throttleTimeout; + function throttle(callback, ms) { + return function () { + if (!_throttleTimeout) { + var args = arguments, + _this = this; + if (args.length === 1) { + callback.call(_this, args[0]); + } else { + callback.apply(_this, args); + } + _throttleTimeout = setTimeout(function () { + _throttleTimeout = void 0; + }, ms); + } + }; + } + function cancelThrottle() { + clearTimeout(_throttleTimeout); + _throttleTimeout = void 0; + } + function scrollBy(el, x, y) { + el.scrollLeft += x; + el.scrollTop += y; + } + function clone(el) { + var Polymer = window.Polymer; + var $ = window.jQuery || window.Zepto; + if (Polymer && Polymer.dom) { + return Polymer.dom(el).cloneNode(true); + } else if ($) { + return $(el).clone(true)[0]; + } else { + return el.cloneNode(true); + } + } + function setRect(el, rect) { + css(el, 'position', 'absolute'); + css(el, 'top', rect.top); + css(el, 'left', rect.left); + css(el, 'width', rect.width); + css(el, 'height', rect.height); + } + function unsetRect(el) { + css(el, 'position', ''); + css(el, 'top', ''); + css(el, 'left', ''); + css(el, 'width', ''); + css(el, 'height', ''); + } + function getChildContainingRectFromElement(container, options, ghostEl) { + var rect = {}; + Array.from(container.children).forEach(function (child) { + var _rect$left, _rect$top, _rect$right, _rect$bottom; + if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return; + var childRect = getRect(child); + rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left); + rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top); + rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right); + rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom); + }); + rect.width = rect.right - rect.left; + rect.height = rect.bottom - rect.top; + rect.x = rect.left; + rect.y = rect.top; + return rect; + } + var expando = 'Sortable' + new Date().getTime(); + + function AnimationStateManager() { + var animationStates = [], + animationCallbackId; + return { + captureAnimationState: function captureAnimationState() { + animationStates = []; + if (!this.options.animation) return; + var children = [].slice.call(this.el.children); + children.forEach(function (child) { + if (css(child, 'display') === 'none' || child === Sortable.ghost) return; + animationStates.push({ + target: child, + rect: getRect(child) + }); + var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); + + // If animating: compensate for current animation + if (child.thisAnimationDuration) { + var childMatrix = matrix(child, true); + if (childMatrix) { + fromRect.top -= childMatrix.f; + fromRect.left -= childMatrix.e; + } + } + child.fromRect = fromRect; + }); + }, + addAnimationState: function addAnimationState(state) { + animationStates.push(state); + }, + removeAnimationState: function removeAnimationState(target) { + animationStates.splice(indexOfObject(animationStates, { + target: target + }), 1); + }, + animateAll: function animateAll(callback) { + var _this = this; + if (!this.options.animation) { + clearTimeout(animationCallbackId); + if (typeof callback === 'function') callback(); + return; + } + var animating = false, + animationTime = 0; + animationStates.forEach(function (state) { + var time = 0, + target = state.target, + fromRect = target.fromRect, + toRect = getRect(target), + prevFromRect = target.prevFromRect, + prevToRect = target.prevToRect, + animatingRect = state.rect, + targetMatrix = matrix(target, true); + if (targetMatrix) { + // Compensate for current animation + toRect.top -= targetMatrix.f; + toRect.left -= targetMatrix.e; + } + target.toRect = toRect; + if (target.thisAnimationDuration) { + // Could also check if animatingRect is between fromRect and toRect + if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && + // Make sure animatingRect is on line between toRect & fromRect + (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) { + // If returning to same place as started from animation and on same axis + time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options); + } + } + + // if fromRect != toRect: animate + if (!isRectEqual(toRect, fromRect)) { + target.prevFromRect = fromRect; + target.prevToRect = toRect; + if (!time) { + time = _this.options.animation; + } + _this.animate(target, animatingRect, toRect, time); + } + if (time) { + animating = true; + animationTime = Math.max(animationTime, time); + clearTimeout(target.animationResetTimer); + target.animationResetTimer = setTimeout(function () { + target.animationTime = 0; + target.prevFromRect = null; + target.fromRect = null; + target.prevToRect = null; + target.thisAnimationDuration = null; + }, time); + target.thisAnimationDuration = time; + } + }); + clearTimeout(animationCallbackId); + if (!animating) { + if (typeof callback === 'function') callback(); + } else { + animationCallbackId = setTimeout(function () { + if (typeof callback === 'function') callback(); + }, animationTime); + } + animationStates = []; + }, + animate: function animate(target, currentRect, toRect, duration) { + if (duration) { + css(target, 'transition', ''); + css(target, 'transform', ''); + var elMatrix = matrix(this.el), + scaleX = elMatrix && elMatrix.a, + scaleY = elMatrix && elMatrix.d, + translateX = (currentRect.left - toRect.left) / (scaleX || 1), + translateY = (currentRect.top - toRect.top) / (scaleY || 1); + target.animatingX = !!translateX; + target.animatingY = !!translateY; + css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)'); + this.forRepaintDummy = repaint(target); // repaint + + css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : '')); + css(target, 'transform', 'translate3d(0,0,0)'); + typeof target.animated === 'number' && clearTimeout(target.animated); + target.animated = setTimeout(function () { + css(target, 'transition', ''); + css(target, 'transform', ''); + target.animated = false; + target.animatingX = false; + target.animatingY = false; + }, duration); + } + } + }; + } + function repaint(target) { + return target.offsetWidth; + } + function calculateRealTime(animatingRect, fromRect, toRect, options) { + return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation; + } + + var plugins = []; + var defaults = { + initializeByDefault: true + }; + var PluginManager = { + mount: function mount(plugin) { + // Set default static properties + for (var option in defaults) { + if (defaults.hasOwnProperty(option) && !(option in plugin)) { + plugin[option] = defaults[option]; + } + } + plugins.forEach(function (p) { + if (p.pluginName === plugin.pluginName) { + throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once"); + } + }); + plugins.push(plugin); + }, + pluginEvent: function pluginEvent(eventName, sortable, evt) { + var _this = this; + this.eventCanceled = false; + evt.cancel = function () { + _this.eventCanceled = true; + }; + var eventNameGlobal = eventName + 'Global'; + plugins.forEach(function (plugin) { + if (!sortable[plugin.pluginName]) return; + // Fire global events if it exists in this sortable + if (sortable[plugin.pluginName][eventNameGlobal]) { + sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({ + sortable: sortable + }, evt)); + } + + // Only fire plugin event if plugin is enabled in this sortable, + // and plugin has event defined + if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) { + sortable[plugin.pluginName][eventName](_objectSpread2({ + sortable: sortable + }, evt)); + } + }); + }, + initializePlugins: function initializePlugins(sortable, el, defaults, options) { + plugins.forEach(function (plugin) { + var pluginName = plugin.pluginName; + if (!sortable.options[pluginName] && !plugin.initializeByDefault) return; + var initialized = new plugin(sortable, el, sortable.options); + initialized.sortable = sortable; + initialized.options = sortable.options; + sortable[pluginName] = initialized; + + // Add default options from plugin + _extends(defaults, initialized.defaults); + }); + for (var option in sortable.options) { + if (!sortable.options.hasOwnProperty(option)) continue; + var modified = this.modifyOption(sortable, option, sortable.options[option]); + if (typeof modified !== 'undefined') { + sortable.options[option] = modified; + } + } + }, + getEventProperties: function getEventProperties(name, sortable) { + var eventProperties = {}; + plugins.forEach(function (plugin) { + if (typeof plugin.eventProperties !== 'function') return; + _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name)); + }); + return eventProperties; + }, + modifyOption: function modifyOption(sortable, name, value) { + var modifiedValue; + plugins.forEach(function (plugin) { + // Plugin must exist on the Sortable + if (!sortable[plugin.pluginName]) return; + + // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin + if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') { + modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value); + } + }); + return modifiedValue; + } + }; + + function dispatchEvent(_ref) { + var sortable = _ref.sortable, + rootEl = _ref.rootEl, + name = _ref.name, + targetEl = _ref.targetEl, + cloneEl = _ref.cloneEl, + toEl = _ref.toEl, + fromEl = _ref.fromEl, + oldIndex = _ref.oldIndex, + newIndex = _ref.newIndex, + oldDraggableIndex = _ref.oldDraggableIndex, + newDraggableIndex = _ref.newDraggableIndex, + originalEvent = _ref.originalEvent, + putSortable = _ref.putSortable, + extraEventProperties = _ref.extraEventProperties; + sortable = sortable || rootEl && rootEl[expando]; + if (!sortable) return; + var evt, + options = sortable.options, + onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); + // Support for new CustomEvent feature + if (window.CustomEvent && !IE11OrLess && !Edge) { + evt = new CustomEvent(name, { + bubbles: true, + cancelable: true + }); + } else { + evt = document.createEvent('Event'); + evt.initEvent(name, true, true); + } + evt.to = toEl || rootEl; + evt.from = fromEl || rootEl; + evt.item = targetEl || rootEl; + evt.clone = cloneEl; + evt.oldIndex = oldIndex; + evt.newIndex = newIndex; + evt.oldDraggableIndex = oldDraggableIndex; + evt.newDraggableIndex = newDraggableIndex; + evt.originalEvent = originalEvent; + evt.pullMode = putSortable ? putSortable.lastPutMode : undefined; + var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable)); + for (var option in allEventProperties) { + evt[option] = allEventProperties[option]; + } + if (rootEl) { + rootEl.dispatchEvent(evt); + } + if (options[onName]) { + options[onName].call(sortable, evt); + } + } + + var _excluded = ["evt"]; + var pluginEvent = function pluginEvent(eventName, sortable) { + var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, + originalEvent = _ref.evt, + data = _objectWithoutProperties(_ref, _excluded); + PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({ + dragEl: dragEl, + parentEl: parentEl, + ghostEl: ghostEl, + rootEl: rootEl, + nextEl: nextEl, + lastDownEl: lastDownEl, + cloneEl: cloneEl, + cloneHidden: cloneHidden, + dragStarted: moved, + putSortable: putSortable, + activeSortable: Sortable.active, + originalEvent: originalEvent, + oldIndex: oldIndex, + oldDraggableIndex: oldDraggableIndex, + newIndex: newIndex, + newDraggableIndex: newDraggableIndex, + hideGhostForTarget: _hideGhostForTarget, + unhideGhostForTarget: _unhideGhostForTarget, + cloneNowHidden: function cloneNowHidden() { + cloneHidden = true; + }, + cloneNowShown: function cloneNowShown() { + cloneHidden = false; + }, + dispatchSortableEvent: function dispatchSortableEvent(name) { + _dispatchEvent({ + sortable: sortable, + name: name, + originalEvent: originalEvent + }); + } + }, data)); + }; + function _dispatchEvent(info) { + dispatchEvent(_objectSpread2({ + putSortable: putSortable, + cloneEl: cloneEl, + targetEl: dragEl, + rootEl: rootEl, + oldIndex: oldIndex, + oldDraggableIndex: oldDraggableIndex, + newIndex: newIndex, + newDraggableIndex: newDraggableIndex + }, info)); + } + var dragEl, + parentEl, + ghostEl, + rootEl, + nextEl, + lastDownEl, + cloneEl, + cloneHidden, + oldIndex, + newIndex, + oldDraggableIndex, + newDraggableIndex, + activeGroup, + putSortable, + awaitingDragStarted = false, + ignoreNextClick = false, + sortables = [], + tapEvt, + touchEvt, + lastDx, + lastDy, + tapDistanceLeft, + tapDistanceTop, + moved, + lastTarget, + lastDirection, + pastFirstInvertThresh = false, + isCircumstantialInvert = false, + targetMoveDistance, + // For positioning ghost absolutely + ghostRelativeParent, + ghostRelativeParentInitialScroll = [], + // (left, top) + + _silent = false, + savedInputChecked = []; + + /** @const */ + var documentExists = typeof document !== 'undefined', + PositionGhostAbsolutely = IOS, + CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float', + // This will not pass for IE9, because IE9 DnD only works on anchors + supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'), + supportCssPointerEvents = function () { + if (!documentExists) return; + // false when <= IE11 + if (IE11OrLess) { + return false; + } + var el = document.createElement('x'); + el.style.cssText = 'pointer-events:auto'; + return el.style.pointerEvents === 'auto'; + }(), + _detectDirection = function _detectDirection(el, options) { + var elCSS = css(el), + elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth), + child1 = getChild(el, 0, options), + child2 = getChild(el, 1, options), + firstChildCSS = child1 && css(child1), + secondChildCSS = child2 && css(child2), + firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width, + secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width; + if (elCSS.display === 'flex') { + return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal'; + } + if (elCSS.display === 'grid') { + return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal'; + } + if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') { + var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right'; + return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal'; + } + return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal'; + }, + _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) { + var dragElS1Opp = vertical ? dragRect.left : dragRect.top, + dragElS2Opp = vertical ? dragRect.right : dragRect.bottom, + dragElOppLength = vertical ? dragRect.width : dragRect.height, + targetS1Opp = vertical ? targetRect.left : targetRect.top, + targetS2Opp = vertical ? targetRect.right : targetRect.bottom, + targetOppLength = vertical ? targetRect.width : targetRect.height; + return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2; + }, + /** + * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold. + * @param {Number} x X position + * @param {Number} y Y position + * @return {HTMLElement} Element of the first found nearest Sortable + */ + _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) { + var ret; + sortables.some(function (sortable) { + var threshold = sortable[expando].options.emptyInsertThreshold; + if (!threshold || lastChild(sortable)) return; + var rect = getRect(sortable), + insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, + insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold; + if (insideHorizontally && insideVertically) { + return ret = sortable; + } + }); + return ret; + }, + _prepareGroup = function _prepareGroup(options) { + function toFn(value, pull) { + return function (to, from, dragEl, evt) { + var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name; + if (value == null && (pull || sameGroup)) { + // Default pull value + // Default pull and put value if same group + return true; + } else if (value == null || value === false) { + return false; + } else if (pull && value === 'clone') { + return value; + } else if (typeof value === 'function') { + return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt); + } else { + var otherGroup = (pull ? to : from).options.group.name; + return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1; + } + }; + } + var group = {}; + var originalGroup = options.group; + if (!originalGroup || _typeof(originalGroup) != 'object') { + originalGroup = { + name: originalGroup + }; + } + group.name = originalGroup.name; + group.checkPull = toFn(originalGroup.pull, true); + group.checkPut = toFn(originalGroup.put); + group.revertClone = originalGroup.revertClone; + options.group = group; + }, + _hideGhostForTarget = function _hideGhostForTarget() { + if (!supportCssPointerEvents && ghostEl) { + css(ghostEl, 'display', 'none'); + } + }, + _unhideGhostForTarget = function _unhideGhostForTarget() { + if (!supportCssPointerEvents && ghostEl) { + css(ghostEl, 'display', ''); + } + }; + + // #1184 fix - Prevent click event on fallback if dragged but item not changed position + if (documentExists && !ChromeForAndroid) { + document.addEventListener('click', function (evt) { + if (ignoreNextClick) { + evt.preventDefault(); + evt.stopPropagation && evt.stopPropagation(); + evt.stopImmediatePropagation && evt.stopImmediatePropagation(); + ignoreNextClick = false; + return false; + } + }, true); + } + var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) { + if (dragEl) { + evt = evt.touches ? evt.touches[0] : evt; + var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY); + if (nearest) { + // Create imitation event + var event = {}; + for (var i in evt) { + if (evt.hasOwnProperty(i)) { + event[i] = evt[i]; + } + } + event.target = event.rootEl = nearest; + event.preventDefault = void 0; + event.stopPropagation = void 0; + nearest[expando]._onDragOver(event); + } + } + }; + var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) { + if (dragEl) { + dragEl.parentNode[expando]._isOutsideThisEl(evt.target); + } + }; + + /** + * @class Sortable + * @param {HTMLElement} el + * @param {Object} [options] + */ + function Sortable(el, options) { + if (!(el && el.nodeType && el.nodeType === 1)) { + throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el)); + } + this.el = el; // root element + this.options = options = _extends({}, options); + + // Export instance + el[expando] = this; + var defaults = { + group: null, + sort: true, + disabled: false, + store: null, + handle: null, + draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*', + swapThreshold: 1, + // percentage; 0 <= x <= 1 + invertSwap: false, + // invert always + invertedSwapThreshold: null, + // will be set to same as swapThreshold if default + removeCloneOnHide: true, + direction: function direction() { + return _detectDirection(el, this.options); + }, + ghostClass: 'sortable-ghost', + chosenClass: 'sortable-chosen', + dragClass: 'sortable-drag', + ignore: 'a, img', + filter: null, + preventOnFilter: true, + animation: 0, + easing: null, + setData: function setData(dataTransfer, dragEl) { + dataTransfer.setData('Text', dragEl.textContent); + }, + dropBubble: false, + dragoverBubble: false, + dataIdAttr: 'data-id', + delay: 0, + delayOnTouchOnly: false, + touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1, + forceFallback: false, + fallbackClass: 'sortable-fallback', + fallbackOnBody: false, + fallbackTolerance: 0, + fallbackOffset: { + x: 0, + y: 0 + }, + supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari, + emptyInsertThreshold: 5 + }; + PluginManager.initializePlugins(this, el, defaults); + + // Set default options + for (var name in defaults) { + !(name in options) && (options[name] = defaults[name]); + } + _prepareGroup(options); + + // Bind all private methods + for (var fn in this) { + if (fn.charAt(0) === '_' && typeof this[fn] === 'function') { + this[fn] = this[fn].bind(this); + } + } + + // Setup drag mode + this.nativeDraggable = options.forceFallback ? false : supportDraggable; + if (this.nativeDraggable) { + // Touch start threshold cannot be greater than the native dragstart threshold + this.options.touchStartThreshold = 1; + } + + // Bind events + if (options.supportPointer) { + on(el, 'pointerdown', this._onTapStart); + } else { + on(el, 'mousedown', this._onTapStart); + on(el, 'touchstart', this._onTapStart); + } + if (this.nativeDraggable) { + on(el, 'dragover', this); + on(el, 'dragenter', this); + } + sortables.push(this.el); + + // Restore sorting + options.store && options.store.get && this.sort(options.store.get(this) || []); + + // Add animation state manager + _extends(this, AnimationStateManager()); + } + Sortable.prototype = /** @lends Sortable.prototype */{ + constructor: Sortable, + _isOutsideThisEl: function _isOutsideThisEl(target) { + if (!this.el.contains(target) && target !== this.el) { + lastTarget = null; + } + }, + _getDirection: function _getDirection(evt, target) { + return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction; + }, + _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) { + if (!evt.cancelable) return; + var _this = this, + el = this.el, + options = this.options, + preventOnFilter = options.preventOnFilter, + type = evt.type, + touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt, + target = (touch || evt).target, + originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, + filter = options.filter; + _saveInputCheckedState(el); + + // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group. + if (dragEl) { + return; + } + if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) { + return; // only left button and enabled + } + + // cancel dnd if original target is content editable + if (originalTarget.isContentEditable) { + return; + } + + // Safari ignores further event handling after mousedown + if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') { + return; + } + target = closest(target, options.draggable, el, false); + if (target && target.animated) { + return; + } + if (lastDownEl === target) { + // Ignoring duplicate `down` + return; + } + + // Get the index of the dragged element within its parent + oldIndex = index(target); + oldDraggableIndex = index(target, options.draggable); + + // Check filter + if (typeof filter === 'function') { + if (filter.call(this, evt, target, this)) { + _dispatchEvent({ + sortable: _this, + rootEl: originalTarget, + name: 'filter', + targetEl: target, + toEl: el, + fromEl: el + }); + pluginEvent('filter', _this, { + evt: evt + }); + preventOnFilter && evt.cancelable && evt.preventDefault(); + return; // cancel dnd + } + } else if (filter) { + filter = filter.split(',').some(function (criteria) { + criteria = closest(originalTarget, criteria.trim(), el, false); + if (criteria) { + _dispatchEvent({ + sortable: _this, + rootEl: criteria, + name: 'filter', + targetEl: target, + fromEl: el, + toEl: el + }); + pluginEvent('filter', _this, { + evt: evt + }); + return true; + } + }); + if (filter) { + preventOnFilter && evt.cancelable && evt.preventDefault(); + return; // cancel dnd + } + } + if (options.handle && !closest(originalTarget, options.handle, el, false)) { + return; + } + + // Prepare `dragstart` + this._prepareDragStart(evt, touch, target); + }, + _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) { + var _this = this, + el = _this.el, + options = _this.options, + ownerDocument = el.ownerDocument, + dragStartFn; + if (target && !dragEl && target.parentNode === el) { + var dragRect = getRect(target); + rootEl = el; + dragEl = target; + parentEl = dragEl.parentNode; + nextEl = dragEl.nextSibling; + lastDownEl = target; + activeGroup = options.group; + Sortable.dragged = dragEl; + tapEvt = { + target: dragEl, + clientX: (touch || evt).clientX, + clientY: (touch || evt).clientY + }; + tapDistanceLeft = tapEvt.clientX - dragRect.left; + tapDistanceTop = tapEvt.clientY - dragRect.top; + this._lastX = (touch || evt).clientX; + this._lastY = (touch || evt).clientY; + dragEl.style['will-change'] = 'all'; + dragStartFn = function dragStartFn() { + pluginEvent('delayEnded', _this, { + evt: evt + }); + if (Sortable.eventCanceled) { + _this._onDrop(); + return; + } + // Delayed drag has been triggered + // we can re-enable the events: touchmove/mousemove + _this._disableDelayedDragEvents(); + if (!FireFox && _this.nativeDraggable) { + dragEl.draggable = true; + } + + // Bind the events: dragstart/dragend + _this._triggerDragStart(evt, touch); + + // Drag start event + _dispatchEvent({ + sortable: _this, + name: 'choose', + originalEvent: evt + }); + + // Chosen item + toggleClass(dragEl, options.chosenClass, true); + }; + + // Disable "draggable" + options.ignore.split(',').forEach(function (criteria) { + find(dragEl, criteria.trim(), _disableDraggable); + }); + on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent); + on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent); + on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent); + on(ownerDocument, 'mouseup', _this._onDrop); + on(ownerDocument, 'touchend', _this._onDrop); + on(ownerDocument, 'touchcancel', _this._onDrop); + + // Make dragEl draggable (must be before delay for FireFox) + if (FireFox && this.nativeDraggable) { + this.options.touchStartThreshold = 4; + dragEl.draggable = true; + } + pluginEvent('delayStart', this, { + evt: evt + }); + + // Delay is impossible for native DnD in Edge or IE + if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) { + if (Sortable.eventCanceled) { + this._onDrop(); + return; + } + // If the user moves the pointer or let go the click or touch + // before the delay has been reached: + // disable the delayed drag + on(ownerDocument, 'mouseup', _this._disableDelayedDrag); + on(ownerDocument, 'touchend', _this._disableDelayedDrag); + on(ownerDocument, 'touchcancel', _this._disableDelayedDrag); + on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler); + on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler); + options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler); + _this._dragStartTimer = setTimeout(dragStartFn, options.delay); + } else { + dragStartFn(); + } + } + }, + _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) { + var touch = e.touches ? e.touches[0] : e; + if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) { + this._disableDelayedDrag(); + } + }, + _disableDelayedDrag: function _disableDelayedDrag() { + dragEl && _disableDraggable(dragEl); + clearTimeout(this._dragStartTimer); + this._disableDelayedDragEvents(); + }, + _disableDelayedDragEvents: function _disableDelayedDragEvents() { + var ownerDocument = this.el.ownerDocument; + off(ownerDocument, 'mouseup', this._disableDelayedDrag); + off(ownerDocument, 'touchend', this._disableDelayedDrag); + off(ownerDocument, 'touchcancel', this._disableDelayedDrag); + off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler); + off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler); + off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler); + }, + _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) { + touch = touch || evt.pointerType == 'touch' && evt; + if (!this.nativeDraggable || touch) { + if (this.options.supportPointer) { + on(document, 'pointermove', this._onTouchMove); + } else if (touch) { + on(document, 'touchmove', this._onTouchMove); + } else { + on(document, 'mousemove', this._onTouchMove); + } + } else { + on(dragEl, 'dragend', this); + on(rootEl, 'dragstart', this._onDragStart); + } + try { + if (document.selection) { + // Timeout neccessary for IE9 + _nextTick(function () { + document.selection.empty(); + }); + } else { + window.getSelection().removeAllRanges(); + } + } catch (err) {} + }, + _dragStarted: function _dragStarted(fallback, evt) { + awaitingDragStarted = false; + if (rootEl && dragEl) { + pluginEvent('dragStarted', this, { + evt: evt + }); + if (this.nativeDraggable) { + on(document, 'dragover', _checkOutsideTargetEl); + } + var options = this.options; + + // Apply effect + !fallback && toggleClass(dragEl, options.dragClass, false); + toggleClass(dragEl, options.ghostClass, true); + Sortable.active = this; + fallback && this._appendGhost(); + + // Drag start event + _dispatchEvent({ + sortable: this, + name: 'start', + originalEvent: evt + }); + } else { + this._nulling(); + } + }, + _emulateDragOver: function _emulateDragOver() { + if (touchEvt) { + this._lastX = touchEvt.clientX; + this._lastY = touchEvt.clientY; + _hideGhostForTarget(); + var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY); + var parent = target; + while (target && target.shadowRoot) { + target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY); + if (target === parent) break; + parent = target; + } + dragEl.parentNode[expando]._isOutsideThisEl(target); + if (parent) { + do { + if (parent[expando]) { + var inserted = void 0; + inserted = parent[expando]._onDragOver({ + clientX: touchEvt.clientX, + clientY: touchEvt.clientY, + target: target, + rootEl: parent + }); + if (inserted && !this.options.dragoverBubble) { + break; + } + } + target = parent; // store last element + } + /* jshint boss:true */ while (parent = parent.parentNode); + } + _unhideGhostForTarget(); + } + }, + _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) { + if (tapEvt) { + var options = this.options, + fallbackTolerance = options.fallbackTolerance, + fallbackOffset = options.fallbackOffset, + touch = evt.touches ? evt.touches[0] : evt, + ghostMatrix = ghostEl && matrix(ghostEl, true), + scaleX = ghostEl && ghostMatrix && ghostMatrix.a, + scaleY = ghostEl && ghostMatrix && ghostMatrix.d, + relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent), + dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1), + dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); + + // only set the status to dragging, when we are actually dragging + if (!Sortable.active && !awaitingDragStarted) { + if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) { + return; + } + this._onDragStart(evt, true); + } + if (ghostEl) { + if (ghostMatrix) { + ghostMatrix.e += dx - (lastDx || 0); + ghostMatrix.f += dy - (lastDy || 0); + } else { + ghostMatrix = { + a: 1, + b: 0, + c: 0, + d: 1, + e: dx, + f: dy + }; + } + var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")"); + css(ghostEl, 'webkitTransform', cssMatrix); + css(ghostEl, 'mozTransform', cssMatrix); + css(ghostEl, 'msTransform', cssMatrix); + css(ghostEl, 'transform', cssMatrix); + lastDx = dx; + lastDy = dy; + touchEvt = touch; + } + evt.cancelable && evt.preventDefault(); + } + }, + _appendGhost: function _appendGhost() { + // Bug if using scale(): https://stackoverflow.com/questions/2637058 + // Not being adjusted for + if (!ghostEl) { + var container = this.options.fallbackOnBody ? document.body : rootEl, + rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container), + options = this.options; + + // Position absolutely + if (PositionGhostAbsolutely) { + // Get relatively positioned parent + ghostRelativeParent = container; + while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) { + ghostRelativeParent = ghostRelativeParent.parentNode; + } + if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) { + if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement(); + rect.top += ghostRelativeParent.scrollTop; + rect.left += ghostRelativeParent.scrollLeft; + } else { + ghostRelativeParent = getWindowScrollingElement(); + } + ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent); + } + ghostEl = dragEl.cloneNode(true); + toggleClass(ghostEl, options.ghostClass, false); + toggleClass(ghostEl, options.fallbackClass, true); + toggleClass(ghostEl, options.dragClass, true); + css(ghostEl, 'transition', ''); + css(ghostEl, 'transform', ''); + css(ghostEl, 'box-sizing', 'border-box'); + css(ghostEl, 'margin', 0); + css(ghostEl, 'top', rect.top); + css(ghostEl, 'left', rect.left); + css(ghostEl, 'width', rect.width); + css(ghostEl, 'height', rect.height); + css(ghostEl, 'opacity', '0.8'); + css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed'); + css(ghostEl, 'zIndex', '100000'); + css(ghostEl, 'pointerEvents', 'none'); + Sortable.ghost = ghostEl; + container.appendChild(ghostEl); + + // Set transform-origin + css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%'); + } + }, + _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) { + var _this = this; + var dataTransfer = evt.dataTransfer; + var options = _this.options; + pluginEvent('dragStart', this, { + evt: evt + }); + if (Sortable.eventCanceled) { + this._onDrop(); + return; + } + pluginEvent('setupClone', this); + if (!Sortable.eventCanceled) { + cloneEl = clone(dragEl); + cloneEl.removeAttribute("id"); + cloneEl.draggable = false; + cloneEl.style['will-change'] = ''; + this._hideClone(); + toggleClass(cloneEl, this.options.chosenClass, false); + Sortable.clone = cloneEl; + } + + // #1143: IFrame support workaround + _this.cloneId = _nextTick(function () { + pluginEvent('clone', _this); + if (Sortable.eventCanceled) return; + if (!_this.options.removeCloneOnHide) { + rootEl.insertBefore(cloneEl, dragEl); + } + _this._hideClone(); + _dispatchEvent({ + sortable: _this, + name: 'clone' + }); + }); + !fallback && toggleClass(dragEl, options.dragClass, true); + + // Set proper drop events + if (fallback) { + ignoreNextClick = true; + _this._loopId = setInterval(_this._emulateDragOver, 50); + } else { + // Undo what was set in _prepareDragStart before drag started + off(document, 'mouseup', _this._onDrop); + off(document, 'touchend', _this._onDrop); + off(document, 'touchcancel', _this._onDrop); + if (dataTransfer) { + dataTransfer.effectAllowed = 'move'; + options.setData && options.setData.call(_this, dataTransfer, dragEl); + } + on(document, 'drop', _this); + + // #1276 fix: + css(dragEl, 'transform', 'translateZ(0)'); + } + awaitingDragStarted = true; + _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt)); + on(document, 'selectstart', _this); + moved = true; + if (Safari) { + css(document.body, 'user-select', 'none'); + } + }, + // Returns true - if no further action is needed (either inserted or another condition) + _onDragOver: function _onDragOver( /**Event*/evt) { + var el = this.el, + target = evt.target, + dragRect, + targetRect, + revert, + options = this.options, + group = options.group, + activeSortable = Sortable.active, + isOwner = activeGroup === group, + canSort = options.sort, + fromSortable = putSortable || activeSortable, + vertical, + _this = this, + completedFired = false; + if (_silent) return; + function dragOverEvent(name, extra) { + pluginEvent(name, _this, _objectSpread2({ + evt: evt, + isOwner: isOwner, + axis: vertical ? 'vertical' : 'horizontal', + revert: revert, + dragRect: dragRect, + targetRect: targetRect, + canSort: canSort, + fromSortable: fromSortable, + target: target, + completed: completed, + onMove: function onMove(target, after) { + return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after); + }, + changed: changed + }, extra)); + } + + // Capture animation state + function capture() { + dragOverEvent('dragOverAnimationCapture'); + _this.captureAnimationState(); + if (_this !== fromSortable) { + fromSortable.captureAnimationState(); + } + } + + // Return invocation when dragEl is inserted (or completed) + function completed(insertion) { + dragOverEvent('dragOverCompleted', { + insertion: insertion + }); + if (insertion) { + // Clones must be hidden before folding animation to capture dragRectAbsolute properly + if (isOwner) { + activeSortable._hideClone(); + } else { + activeSortable._showClone(_this); + } + if (_this !== fromSortable) { + // Set ghost class to new sortable's ghost class + toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false); + toggleClass(dragEl, options.ghostClass, true); + } + if (putSortable !== _this && _this !== Sortable.active) { + putSortable = _this; + } else if (_this === Sortable.active && putSortable) { + putSortable = null; + } + + // Animation + if (fromSortable === _this) { + _this._ignoreWhileAnimating = target; + } + _this.animateAll(function () { + dragOverEvent('dragOverAnimationComplete'); + _this._ignoreWhileAnimating = null; + }); + if (_this !== fromSortable) { + fromSortable.animateAll(); + fromSortable._ignoreWhileAnimating = null; + } + } + + // Null lastTarget if it is not inside a previously swapped element + if (target === dragEl && !dragEl.animated || target === el && !target.animated) { + lastTarget = null; + } + + // no bubbling and not fallback + if (!options.dragoverBubble && !evt.rootEl && target !== document) { + dragEl.parentNode[expando]._isOutsideThisEl(evt.target); + + // Do not detect for empty insert if already inserted + !insertion && nearestEmptyInsertDetectEvent(evt); + } + !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation(); + return completedFired = true; + } + + // Call when dragEl has been inserted + function changed() { + newIndex = index(dragEl); + newDraggableIndex = index(dragEl, options.draggable); + _dispatchEvent({ + sortable: _this, + name: 'change', + toEl: el, + newIndex: newIndex, + newDraggableIndex: newDraggableIndex, + originalEvent: evt + }); + } + if (evt.preventDefault !== void 0) { + evt.cancelable && evt.preventDefault(); + } + target = closest(target, options.draggable, el, true); + dragOverEvent('dragOver'); + if (Sortable.eventCanceled) return completedFired; + if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) { + return completed(false); + } + ignoreNextClick = false; + if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list + : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) { + vertical = this._getDirection(evt, target) === 'vertical'; + dragRect = getRect(dragEl); + dragOverEvent('dragOverValid'); + if (Sortable.eventCanceled) return completedFired; + if (revert) { + parentEl = rootEl; // actualization + capture(); + this._hideClone(); + dragOverEvent('revert'); + if (!Sortable.eventCanceled) { + if (nextEl) { + rootEl.insertBefore(dragEl, nextEl); + } else { + rootEl.appendChild(dragEl); + } + } + return completed(true); + } + var elLastChild = lastChild(el, options.draggable); + if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) { + // Insert to end of list + + // If already at end of list: Do not insert + if (elLastChild === dragEl) { + return completed(false); + } + + // if there is a last element, it is the target + if (elLastChild && el === evt.target) { + target = elLastChild; + } + if (target) { + targetRect = getRect(target); + } + if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) { + capture(); + if (elLastChild && elLastChild.nextSibling) { + // the last draggable element is not the last node + el.insertBefore(dragEl, elLastChild.nextSibling); + } else { + el.appendChild(dragEl); + } + parentEl = el; // actualization + + changed(); + return completed(true); + } + } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) { + // Insert to start of list + var firstChild = getChild(el, 0, options, true); + if (firstChild === dragEl) { + return completed(false); + } + target = firstChild; + targetRect = getRect(target); + if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) { + capture(); + el.insertBefore(dragEl, firstChild); + parentEl = el; // actualization + + changed(); + return completed(true); + } + } else if (target.parentNode === el) { + targetRect = getRect(target); + var direction = 0, + targetBeforeFirstSwap, + differentLevel = dragEl.parentNode !== el, + differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical), + side1 = vertical ? 'top' : 'left', + scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'), + scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0; + if (lastTarget !== target) { + targetBeforeFirstSwap = targetRect[side1]; + pastFirstInvertThresh = false; + isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel; + } + direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target); + var sibling; + if (direction !== 0) { + // Check if target is beside dragEl in respective direction (ignoring hidden elements) + var dragIndex = index(dragEl); + do { + dragIndex -= direction; + sibling = parentEl.children[dragIndex]; + } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl)); + } + // If dragEl is already beside target: Do not insert + if (direction === 0 || sibling === target) { + return completed(false); + } + lastTarget = target; + lastDirection = direction; + var nextSibling = target.nextElementSibling, + after = false; + after = direction === 1; + var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after); + if (moveVector !== false) { + if (moveVector === 1 || moveVector === -1) { + after = moveVector === 1; + } + _silent = true; + setTimeout(_unsilent, 30); + capture(); + if (after && !nextSibling) { + el.appendChild(dragEl); + } else { + target.parentNode.insertBefore(dragEl, after ? nextSibling : target); + } + + // Undo chrome's scroll adjustment (has no effect on other browsers) + if (scrolledPastTop) { + scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop); + } + parentEl = dragEl.parentNode; // actualization + + // must be done before animation + if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) { + targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]); + } + changed(); + return completed(true); + } + } + if (el.contains(dragEl)) { + return completed(false); + } + } + return false; + }, + _ignoreWhileAnimating: null, + _offMoveEvents: function _offMoveEvents() { + off(document, 'mousemove', this._onTouchMove); + off(document, 'touchmove', this._onTouchMove); + off(document, 'pointermove', this._onTouchMove); + off(document, 'dragover', nearestEmptyInsertDetectEvent); + off(document, 'mousemove', nearestEmptyInsertDetectEvent); + off(document, 'touchmove', nearestEmptyInsertDetectEvent); + }, + _offUpEvents: function _offUpEvents() { + var ownerDocument = this.el.ownerDocument; + off(ownerDocument, 'mouseup', this._onDrop); + off(ownerDocument, 'touchend', this._onDrop); + off(ownerDocument, 'pointerup', this._onDrop); + off(ownerDocument, 'touchcancel', this._onDrop); + off(document, 'selectstart', this); + }, + _onDrop: function _onDrop( /**Event*/evt) { + var el = this.el, + options = this.options; + + // Get the index of the dragged element within its parent + newIndex = index(dragEl); + newDraggableIndex = index(dragEl, options.draggable); + pluginEvent('drop', this, { + evt: evt + }); + parentEl = dragEl && dragEl.parentNode; + + // Get again after plugin event + newIndex = index(dragEl); + newDraggableIndex = index(dragEl, options.draggable); + if (Sortable.eventCanceled) { + this._nulling(); + return; + } + awaitingDragStarted = false; + isCircumstantialInvert = false; + pastFirstInvertThresh = false; + clearInterval(this._loopId); + clearTimeout(this._dragStartTimer); + _cancelNextTick(this.cloneId); + _cancelNextTick(this._dragStartId); + + // Unbind events + if (this.nativeDraggable) { + off(document, 'drop', this); + off(el, 'dragstart', this._onDragStart); + } + this._offMoveEvents(); + this._offUpEvents(); + if (Safari) { + css(document.body, 'user-select', ''); + } + css(dragEl, 'transform', ''); + if (evt) { + if (moved) { + evt.cancelable && evt.preventDefault(); + !options.dropBubble && evt.stopPropagation(); + } + ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl); + if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') { + // Remove clone(s) + cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl); + } + if (dragEl) { + if (this.nativeDraggable) { + off(dragEl, 'dragend', this); + } + _disableDraggable(dragEl); + dragEl.style['will-change'] = ''; + + // Remove classes + // ghostClass is added in dragStarted + if (moved && !awaitingDragStarted) { + toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false); + } + toggleClass(dragEl, this.options.chosenClass, false); + + // Drag stop event + _dispatchEvent({ + sortable: this, + name: 'unchoose', + toEl: parentEl, + newIndex: null, + newDraggableIndex: null, + originalEvent: evt + }); + if (rootEl !== parentEl) { + if (newIndex >= 0) { + // Add event + _dispatchEvent({ + rootEl: parentEl, + name: 'add', + toEl: parentEl, + fromEl: rootEl, + originalEvent: evt + }); + + // Remove event + _dispatchEvent({ + sortable: this, + name: 'remove', + toEl: parentEl, + originalEvent: evt + }); + + // drag from one list and drop into another + _dispatchEvent({ + rootEl: parentEl, + name: 'sort', + toEl: parentEl, + fromEl: rootEl, + originalEvent: evt + }); + _dispatchEvent({ + sortable: this, + name: 'sort', + toEl: parentEl, + originalEvent: evt + }); + } + putSortable && putSortable.save(); + } else { + if (newIndex !== oldIndex) { + if (newIndex >= 0) { + // drag & drop within the same list + _dispatchEvent({ + sortable: this, + name: 'update', + toEl: parentEl, + originalEvent: evt + }); + _dispatchEvent({ + sortable: this, + name: 'sort', + toEl: parentEl, + originalEvent: evt + }); + } + } + } + if (Sortable.active) { + /* jshint eqnull:true */ + if (newIndex == null || newIndex === -1) { + newIndex = oldIndex; + newDraggableIndex = oldDraggableIndex; + } + _dispatchEvent({ + sortable: this, + name: 'end', + toEl: parentEl, + originalEvent: evt + }); + + // Save sorting + this.save(); + } + } + } + this._nulling(); + }, + _nulling: function _nulling() { + pluginEvent('nulling', this); + rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null; + savedInputChecked.forEach(function (el) { + el.checked = true; + }); + savedInputChecked.length = lastDx = lastDy = 0; + }, + handleEvent: function handleEvent( /**Event*/evt) { + switch (evt.type) { + case 'drop': + case 'dragend': + this._onDrop(evt); + break; + case 'dragenter': + case 'dragover': + if (dragEl) { + this._onDragOver(evt); + _globalDragOver(evt); + } + break; + case 'selectstart': + evt.preventDefault(); + break; + } + }, + /** + * Serializes the item into an array of string. + * @returns {String[]} + */ + toArray: function toArray() { + var order = [], + el, + children = this.el.children, + i = 0, + n = children.length, + options = this.options; + for (; i < n; i++) { + el = children[i]; + if (closest(el, options.draggable, this.el, false)) { + order.push(el.getAttribute(options.dataIdAttr) || _generateId(el)); + } + } + return order; + }, + /** + * Sorts the elements according to the array. + * @param {String[]} order order of the items + */ + sort: function sort(order, useAnimation) { + var items = {}, + rootEl = this.el; + this.toArray().forEach(function (id, i) { + var el = rootEl.children[i]; + if (closest(el, this.options.draggable, rootEl, false)) { + items[id] = el; + } + }, this); + useAnimation && this.captureAnimationState(); + order.forEach(function (id) { + if (items[id]) { + rootEl.removeChild(items[id]); + rootEl.appendChild(items[id]); + } + }); + useAnimation && this.animateAll(); + }, + /** + * Save the current sorting + */ + save: function save() { + var store = this.options.store; + store && store.set && store.set(this); + }, + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * @param {HTMLElement} el + * @param {String} [selector] default: `options.draggable` + * @returns {HTMLElement|null} + */ + closest: function closest$1(el, selector) { + return closest(el, selector || this.options.draggable, this.el, false); + }, + /** + * Set/get option + * @param {string} name + * @param {*} [value] + * @returns {*} + */ + option: function option(name, value) { + var options = this.options; + if (value === void 0) { + return options[name]; + } else { + var modifiedValue = PluginManager.modifyOption(this, name, value); + if (typeof modifiedValue !== 'undefined') { + options[name] = modifiedValue; + } else { + options[name] = value; + } + if (name === 'group') { + _prepareGroup(options); + } + } + }, + /** + * Destroy + */ + destroy: function destroy() { + pluginEvent('destroy', this); + var el = this.el; + el[expando] = null; + off(el, 'mousedown', this._onTapStart); + off(el, 'touchstart', this._onTapStart); + off(el, 'pointerdown', this._onTapStart); + if (this.nativeDraggable) { + off(el, 'dragover', this); + off(el, 'dragenter', this); + } + // Remove draggable attributes + Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) { + el.removeAttribute('draggable'); + }); + this._onDrop(); + this._disableDelayedDragEvents(); + sortables.splice(sortables.indexOf(this.el), 1); + this.el = el = null; + }, + _hideClone: function _hideClone() { + if (!cloneHidden) { + pluginEvent('hideClone', this); + if (Sortable.eventCanceled) return; + css(cloneEl, 'display', 'none'); + if (this.options.removeCloneOnHide && cloneEl.parentNode) { + cloneEl.parentNode.removeChild(cloneEl); + } + cloneHidden = true; + } + }, + _showClone: function _showClone(putSortable) { + if (putSortable.lastPutMode !== 'clone') { + this._hideClone(); + return; + } + if (cloneHidden) { + pluginEvent('showClone', this); + if (Sortable.eventCanceled) return; + + // show clone at dragEl or original position + if (dragEl.parentNode == rootEl && !this.options.group.revertClone) { + rootEl.insertBefore(cloneEl, dragEl); + } else if (nextEl) { + rootEl.insertBefore(cloneEl, nextEl); + } else { + rootEl.appendChild(cloneEl); + } + if (this.options.group.revertClone) { + this.animate(dragEl, cloneEl); + } + css(cloneEl, 'display', ''); + cloneHidden = false; + } + } + }; + function _globalDragOver( /**Event*/evt) { + if (evt.dataTransfer) { + evt.dataTransfer.dropEffect = 'move'; + } + evt.cancelable && evt.preventDefault(); + } + function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) { + var evt, + sortable = fromEl[expando], + onMoveFn = sortable.options.onMove, + retVal; + // Support for new CustomEvent feature + if (window.CustomEvent && !IE11OrLess && !Edge) { + evt = new CustomEvent('move', { + bubbles: true, + cancelable: true + }); + } else { + evt = document.createEvent('Event'); + evt.initEvent('move', true, true); + } + evt.to = toEl; + evt.from = fromEl; + evt.dragged = dragEl; + evt.draggedRect = dragRect; + evt.related = targetEl || toEl; + evt.relatedRect = targetRect || getRect(toEl); + evt.willInsertAfter = willInsertAfter; + evt.originalEvent = originalEvent; + fromEl.dispatchEvent(evt); + if (onMoveFn) { + retVal = onMoveFn.call(sortable, evt, originalEvent); + } + return retVal; + } + function _disableDraggable(el) { + el.draggable = false; + } + function _unsilent() { + _silent = false; + } + function _ghostIsFirst(evt, vertical, sortable) { + var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true)); + var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl); + var spacer = 10; + return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left; + } + function _ghostIsLast(evt, vertical, sortable) { + var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable)); + var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl); + var spacer = 10; + return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top; + } + function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) { + var mouseOnAxis = vertical ? evt.clientY : evt.clientX, + targetLength = vertical ? targetRect.height : targetRect.width, + targetS1 = vertical ? targetRect.top : targetRect.left, + targetS2 = vertical ? targetRect.bottom : targetRect.right, + invert = false; + if (!invertSwap) { + // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold + if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) { + // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2 + // check if past first invert threshold on side opposite of lastDirection + if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) { + // past first invert threshold, do not restrict inverted threshold to dragEl shadow + pastFirstInvertThresh = true; + } + if (!pastFirstInvertThresh) { + // dragEl shadow (target move distance shadow) + if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow + : mouseOnAxis > targetS2 - targetMoveDistance) { + return -lastDirection; + } + } else { + invert = true; + } + } else { + // Regular + if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) { + return _getInsertDirection(target); + } + } + } + invert = invert || invertSwap; + if (invert) { + // Invert of regular + if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) { + return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1; + } + } + return 0; + } + + /** + * Gets the direction dragEl must be swapped relative to target in order to make it + * seem that dragEl has been "inserted" into that element's position + * @param {HTMLElement} target The target whose position dragEl is being inserted at + * @return {Number} Direction dragEl must be swapped + */ + function _getInsertDirection(target) { + if (index(dragEl) < index(target)) { + return 1; + } else { + return -1; + } + } + + /** + * Generate id + * @param {HTMLElement} el + * @returns {String} + * @private + */ + function _generateId(el) { + var str = el.tagName + el.className + el.src + el.href + el.textContent, + i = str.length, + sum = 0; + while (i--) { + sum += str.charCodeAt(i); + } + return sum.toString(36); + } + function _saveInputCheckedState(root) { + savedInputChecked.length = 0; + var inputs = root.getElementsByTagName('input'); + var idx = inputs.length; + while (idx--) { + var el = inputs[idx]; + el.checked && savedInputChecked.push(el); + } + } + function _nextTick(fn) { + return setTimeout(fn, 0); + } + function _cancelNextTick(id) { + return clearTimeout(id); + } + + // Fixed #973: + if (documentExists) { + on(document, 'touchmove', function (evt) { + if ((Sortable.active || awaitingDragStarted) && evt.cancelable) { + evt.preventDefault(); + } + }); + } + + // Export utils + Sortable.utils = { + on: on, + off: off, + css: css, + find: find, + is: function is(el, selector) { + return !!closest(el, selector, el, false); + }, + extend: extend, + throttle: throttle, + closest: closest, + toggleClass: toggleClass, + clone: clone, + index: index, + nextTick: _nextTick, + cancelNextTick: _cancelNextTick, + detectDirection: _detectDirection, + getChild: getChild + }; + + /** + * Get the Sortable instance of an element + * @param {HTMLElement} element The element + * @return {Sortable|undefined} The instance of Sortable + */ + Sortable.get = function (element) { + return element[expando]; + }; + + /** + * Mount a plugin to Sortable + * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted + */ + Sortable.mount = function () { + for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) { + plugins[_key] = arguments[_key]; + } + if (plugins[0].constructor === Array) plugins = plugins[0]; + plugins.forEach(function (plugin) { + if (!plugin.prototype || !plugin.prototype.constructor) { + throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin)); + } + if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils); + PluginManager.mount(plugin); + }); + }; + + /** + * Create sortable instance + * @param {HTMLElement} el + * @param {Object} [options] + */ + Sortable.create = function (el, options) { + return new Sortable(el, options); + }; + + // Export + Sortable.version = version; + + var autoScrolls = [], + scrollEl, + scrollRootEl, + scrolling = false, + lastAutoScrollX, + lastAutoScrollY, + touchEvt$1, + pointerElemChangedInterval; + function AutoScrollPlugin() { + function AutoScroll() { + this.defaults = { + scroll: true, + forceAutoScrollFallback: false, + scrollSensitivity: 30, + scrollSpeed: 10, + bubbleScroll: true + }; + + // Bind all private methods + for (var fn in this) { + if (fn.charAt(0) === '_' && typeof this[fn] === 'function') { + this[fn] = this[fn].bind(this); + } + } + } + AutoScroll.prototype = { + dragStarted: function dragStarted(_ref) { + var originalEvent = _ref.originalEvent; + if (this.sortable.nativeDraggable) { + on(document, 'dragover', this._handleAutoScroll); + } else { + if (this.options.supportPointer) { + on(document, 'pointermove', this._handleFallbackAutoScroll); + } else if (originalEvent.touches) { + on(document, 'touchmove', this._handleFallbackAutoScroll); + } else { + on(document, 'mousemove', this._handleFallbackAutoScroll); + } + } + }, + dragOverCompleted: function dragOverCompleted(_ref2) { + var originalEvent = _ref2.originalEvent; + // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached) + if (!this.options.dragOverBubble && !originalEvent.rootEl) { + this._handleAutoScroll(originalEvent); + } + }, + drop: function drop() { + if (this.sortable.nativeDraggable) { + off(document, 'dragover', this._handleAutoScroll); + } else { + off(document, 'pointermove', this._handleFallbackAutoScroll); + off(document, 'touchmove', this._handleFallbackAutoScroll); + off(document, 'mousemove', this._handleFallbackAutoScroll); + } + clearPointerElemChangedInterval(); + clearAutoScrolls(); + cancelThrottle(); + }, + nulling: function nulling() { + touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null; + autoScrolls.length = 0; + }, + _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) { + this._handleAutoScroll(evt, true); + }, + _handleAutoScroll: function _handleAutoScroll(evt, fallback) { + var _this = this; + var x = (evt.touches ? evt.touches[0] : evt).clientX, + y = (evt.touches ? evt.touches[0] : evt).clientY, + elem = document.elementFromPoint(x, y); + touchEvt$1 = evt; + + // IE does not seem to have native autoscroll, + // Edge's autoscroll seems too conditional, + // MACOS Safari does not have autoscroll, + // Firefox and Chrome are good + if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) { + autoScroll(evt, this.options, elem, fallback); + + // Listener for pointer element change + var ogElemScroller = getParentAutoScrollElement(elem, true); + if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) { + pointerElemChangedInterval && clearPointerElemChangedInterval(); + // Detect for pointer elem change, emulating native DnD behaviour + pointerElemChangedInterval = setInterval(function () { + var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true); + if (newElem !== ogElemScroller) { + ogElemScroller = newElem; + clearAutoScrolls(); + } + autoScroll(evt, _this.options, newElem, fallback); + }, 10); + lastAutoScrollX = x; + lastAutoScrollY = y; + } + } else { + // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll + if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) { + clearAutoScrolls(); + return; + } + autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false); + } + } + }; + return _extends(AutoScroll, { + pluginName: 'scroll', + initializeByDefault: true + }); + } + function clearAutoScrolls() { + autoScrolls.forEach(function (autoScroll) { + clearInterval(autoScroll.pid); + }); + autoScrolls = []; + } + function clearPointerElemChangedInterval() { + clearInterval(pointerElemChangedInterval); + } + var autoScroll = throttle(function (evt, options, rootEl, isFallback) { + // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521 + if (!options.scroll) return; + var x = (evt.touches ? evt.touches[0] : evt).clientX, + y = (evt.touches ? evt.touches[0] : evt).clientY, + sens = options.scrollSensitivity, + speed = options.scrollSpeed, + winScroller = getWindowScrollingElement(); + var scrollThisInstance = false, + scrollCustomFn; + + // New scroll root, set scrollEl + if (scrollRootEl !== rootEl) { + scrollRootEl = rootEl; + clearAutoScrolls(); + scrollEl = options.scroll; + scrollCustomFn = options.scrollFn; + if (scrollEl === true) { + scrollEl = getParentAutoScrollElement(rootEl, true); + } + } + var layersOut = 0; + var currentParent = scrollEl; + do { + var el = currentParent, + rect = getRect(el), + top = rect.top, + bottom = rect.bottom, + left = rect.left, + right = rect.right, + width = rect.width, + height = rect.height, + canScrollX = void 0, + canScrollY = void 0, + scrollWidth = el.scrollWidth, + scrollHeight = el.scrollHeight, + elCSS = css(el), + scrollPosX = el.scrollLeft, + scrollPosY = el.scrollTop; + if (el === winScroller) { + canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible'); + canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible'); + } else { + canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll'); + canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll'); + } + var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX); + var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY); + if (!autoScrolls[layersOut]) { + for (var i = 0; i <= layersOut; i++) { + if (!autoScrolls[i]) { + autoScrolls[i] = {}; + } + } + } + if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) { + autoScrolls[layersOut].el = el; + autoScrolls[layersOut].vx = vx; + autoScrolls[layersOut].vy = vy; + clearInterval(autoScrolls[layersOut].pid); + if (vx != 0 || vy != 0) { + scrollThisInstance = true; + /* jshint loopfunc:true */ + autoScrolls[layersOut].pid = setInterval(function () { + // emulate drag over during autoscroll (fallback), emulating native DnD behaviour + if (isFallback && this.layer === 0) { + Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely + } + var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0; + var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0; + if (typeof scrollCustomFn === 'function') { + if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') { + return; + } + } + scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY); + }.bind({ + layer: layersOut + }), 24); + } + } + layersOut++; + } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false))); + scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not + }, 30); + + var drop = function drop(_ref) { + var originalEvent = _ref.originalEvent, + putSortable = _ref.putSortable, + dragEl = _ref.dragEl, + activeSortable = _ref.activeSortable, + dispatchSortableEvent = _ref.dispatchSortableEvent, + hideGhostForTarget = _ref.hideGhostForTarget, + unhideGhostForTarget = _ref.unhideGhostForTarget; + if (!originalEvent) return; + var toSortable = putSortable || activeSortable; + hideGhostForTarget(); + var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent; + var target = document.elementFromPoint(touch.clientX, touch.clientY); + unhideGhostForTarget(); + if (toSortable && !toSortable.el.contains(target)) { + dispatchSortableEvent('spill'); + this.onSpill({ + dragEl: dragEl, + putSortable: putSortable + }); + } + }; + function Revert() {} + Revert.prototype = { + startIndex: null, + dragStart: function dragStart(_ref2) { + var oldDraggableIndex = _ref2.oldDraggableIndex; + this.startIndex = oldDraggableIndex; + }, + onSpill: function onSpill(_ref3) { + var dragEl = _ref3.dragEl, + putSortable = _ref3.putSortable; + this.sortable.captureAnimationState(); + if (putSortable) { + putSortable.captureAnimationState(); + } + var nextSibling = getChild(this.sortable.el, this.startIndex, this.options); + if (nextSibling) { + this.sortable.el.insertBefore(dragEl, nextSibling); + } else { + this.sortable.el.appendChild(dragEl); + } + this.sortable.animateAll(); + if (putSortable) { + putSortable.animateAll(); + } + }, + drop: drop + }; + _extends(Revert, { + pluginName: 'revertOnSpill' + }); + function Remove() {} + Remove.prototype = { + onSpill: function onSpill(_ref4) { + var dragEl = _ref4.dragEl, + putSortable = _ref4.putSortable; + var parentSortable = putSortable || this.sortable; + parentSortable.captureAnimationState(); + dragEl.parentNode && dragEl.parentNode.removeChild(dragEl); + parentSortable.animateAll(); + }, + drop: drop + }; + _extends(Remove, { + pluginName: 'removeOnSpill' + }); + + var lastSwapEl; + function SwapPlugin() { + function Swap() { + this.defaults = { + swapClass: 'sortable-swap-highlight' + }; + } + Swap.prototype = { + dragStart: function dragStart(_ref) { + var dragEl = _ref.dragEl; + lastSwapEl = dragEl; + }, + dragOverValid: function dragOverValid(_ref2) { + var completed = _ref2.completed, + target = _ref2.target, + onMove = _ref2.onMove, + activeSortable = _ref2.activeSortable, + changed = _ref2.changed, + cancel = _ref2.cancel; + if (!activeSortable.options.swap) return; + var el = this.sortable.el, + options = this.options; + if (target && target !== el) { + var prevSwapEl = lastSwapEl; + if (onMove(target) !== false) { + toggleClass(target, options.swapClass, true); + lastSwapEl = target; + } else { + lastSwapEl = null; + } + if (prevSwapEl && prevSwapEl !== lastSwapEl) { + toggleClass(prevSwapEl, options.swapClass, false); + } + } + changed(); + completed(true); + cancel(); + }, + drop: function drop(_ref3) { + var activeSortable = _ref3.activeSortable, + putSortable = _ref3.putSortable, + dragEl = _ref3.dragEl; + var toSortable = putSortable || this.sortable; + var options = this.options; + lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false); + if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) { + if (dragEl !== lastSwapEl) { + toSortable.captureAnimationState(); + if (toSortable !== activeSortable) activeSortable.captureAnimationState(); + swapNodes(dragEl, lastSwapEl); + toSortable.animateAll(); + if (toSortable !== activeSortable) activeSortable.animateAll(); + } + } + }, + nulling: function nulling() { + lastSwapEl = null; + } + }; + return _extends(Swap, { + pluginName: 'swap', + eventProperties: function eventProperties() { + return { + swapItem: lastSwapEl + }; + } + }); + } + function swapNodes(n1, n2) { + var p1 = n1.parentNode, + p2 = n2.parentNode, + i1, + i2; + if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return; + i1 = index(n1); + i2 = index(n2); + if (p1.isEqualNode(p2) && i1 < i2) { + i2++; + } + p1.insertBefore(n2, p1.children[i1]); + p2.insertBefore(n1, p2.children[i2]); + } + + var multiDragElements = [], + multiDragClones = [], + lastMultiDragSelect, + // for selection with modifier key down (SHIFT) + multiDragSortable, + initialFolding = false, + // Initial multi-drag fold when drag started + folding = false, + // Folding any other time + dragStarted = false, + dragEl$1, + clonesFromRect, + clonesHidden; + function MultiDragPlugin() { + function MultiDrag(sortable) { + // Bind all private methods + for (var fn in this) { + if (fn.charAt(0) === '_' && typeof this[fn] === 'function') { + this[fn] = this[fn].bind(this); + } + } + if (!sortable.options.avoidImplicitDeselect) { + if (sortable.options.supportPointer) { + on(document, 'pointerup', this._deselectMultiDrag); + } else { + on(document, 'mouseup', this._deselectMultiDrag); + on(document, 'touchend', this._deselectMultiDrag); + } + } + on(document, 'keydown', this._checkKeyDown); + on(document, 'keyup', this._checkKeyUp); + this.defaults = { + selectedClass: 'sortable-selected', + multiDragKey: null, + avoidImplicitDeselect: false, + setData: function setData(dataTransfer, dragEl) { + var data = ''; + if (multiDragElements.length && multiDragSortable === sortable) { + multiDragElements.forEach(function (multiDragElement, i) { + data += (!i ? '' : ', ') + multiDragElement.textContent; + }); + } else { + data = dragEl.textContent; + } + dataTransfer.setData('Text', data); + } + }; + } + MultiDrag.prototype = { + multiDragKeyDown: false, + isMultiDrag: false, + delayStartGlobal: function delayStartGlobal(_ref) { + var dragged = _ref.dragEl; + dragEl$1 = dragged; + }, + delayEnded: function delayEnded() { + this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1); + }, + setupClone: function setupClone(_ref2) { + var sortable = _ref2.sortable, + cancel = _ref2.cancel; + if (!this.isMultiDrag) return; + for (var i = 0; i < multiDragElements.length; i++) { + multiDragClones.push(clone(multiDragElements[i])); + multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex; + multiDragClones[i].draggable = false; + multiDragClones[i].style['will-change'] = ''; + toggleClass(multiDragClones[i], this.options.selectedClass, false); + multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false); + } + sortable._hideClone(); + cancel(); + }, + clone: function clone(_ref3) { + var sortable = _ref3.sortable, + rootEl = _ref3.rootEl, + dispatchSortableEvent = _ref3.dispatchSortableEvent, + cancel = _ref3.cancel; + if (!this.isMultiDrag) return; + if (!this.options.removeCloneOnHide) { + if (multiDragElements.length && multiDragSortable === sortable) { + insertMultiDragClones(true, rootEl); + dispatchSortableEvent('clone'); + cancel(); + } + } + }, + showClone: function showClone(_ref4) { + var cloneNowShown = _ref4.cloneNowShown, + rootEl = _ref4.rootEl, + cancel = _ref4.cancel; + if (!this.isMultiDrag) return; + insertMultiDragClones(false, rootEl); + multiDragClones.forEach(function (clone) { + css(clone, 'display', ''); + }); + cloneNowShown(); + clonesHidden = false; + cancel(); + }, + hideClone: function hideClone(_ref5) { + var _this = this; + var sortable = _ref5.sortable, + cloneNowHidden = _ref5.cloneNowHidden, + cancel = _ref5.cancel; + if (!this.isMultiDrag) return; + multiDragClones.forEach(function (clone) { + css(clone, 'display', 'none'); + if (_this.options.removeCloneOnHide && clone.parentNode) { + clone.parentNode.removeChild(clone); + } + }); + cloneNowHidden(); + clonesHidden = true; + cancel(); + }, + dragStartGlobal: function dragStartGlobal(_ref6) { + var sortable = _ref6.sortable; + if (!this.isMultiDrag && multiDragSortable) { + multiDragSortable.multiDrag._deselectMultiDrag(); + } + multiDragElements.forEach(function (multiDragElement) { + multiDragElement.sortableIndex = index(multiDragElement); + }); + + // Sort multi-drag elements + multiDragElements = multiDragElements.sort(function (a, b) { + return a.sortableIndex - b.sortableIndex; + }); + dragStarted = true; + }, + dragStarted: function dragStarted(_ref7) { + var _this2 = this; + var sortable = _ref7.sortable; + if (!this.isMultiDrag) return; + if (this.options.sort) { + // Capture rects, + // hide multi drag elements (by positioning them absolute), + // set multi drag elements rects to dragRect, + // show multi drag elements, + // animate to rects, + // unset rects & remove from DOM + + sortable.captureAnimationState(); + if (this.options.animation) { + multiDragElements.forEach(function (multiDragElement) { + if (multiDragElement === dragEl$1) return; + css(multiDragElement, 'position', 'absolute'); + }); + var dragRect = getRect(dragEl$1, false, true, true); + multiDragElements.forEach(function (multiDragElement) { + if (multiDragElement === dragEl$1) return; + setRect(multiDragElement, dragRect); + }); + folding = true; + initialFolding = true; + } + } + sortable.animateAll(function () { + folding = false; + initialFolding = false; + if (_this2.options.animation) { + multiDragElements.forEach(function (multiDragElement) { + unsetRect(multiDragElement); + }); + } + + // Remove all auxiliary multidrag items from el, if sorting enabled + if (_this2.options.sort) { + removeMultiDragElements(); + } + }); + }, + dragOver: function dragOver(_ref8) { + var target = _ref8.target, + completed = _ref8.completed, + cancel = _ref8.cancel; + if (folding && ~multiDragElements.indexOf(target)) { + completed(false); + cancel(); + } + }, + revert: function revert(_ref9) { + var fromSortable = _ref9.fromSortable, + rootEl = _ref9.rootEl, + sortable = _ref9.sortable, + dragRect = _ref9.dragRect; + if (multiDragElements.length > 1) { + // Setup unfold animation + multiDragElements.forEach(function (multiDragElement) { + sortable.addAnimationState({ + target: multiDragElement, + rect: folding ? getRect(multiDragElement) : dragRect + }); + unsetRect(multiDragElement); + multiDragElement.fromRect = dragRect; + fromSortable.removeAnimationState(multiDragElement); + }); + folding = false; + insertMultiDragElements(!this.options.removeCloneOnHide, rootEl); + } + }, + dragOverCompleted: function dragOverCompleted(_ref10) { + var sortable = _ref10.sortable, + isOwner = _ref10.isOwner, + insertion = _ref10.insertion, + activeSortable = _ref10.activeSortable, + parentEl = _ref10.parentEl, + putSortable = _ref10.putSortable; + var options = this.options; + if (insertion) { + // Clones must be hidden before folding animation to capture dragRectAbsolute properly + if (isOwner) { + activeSortable._hideClone(); + } + initialFolding = false; + // If leaving sort:false root, or already folding - Fold to new location + if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) { + // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible + var dragRectAbsolute = getRect(dragEl$1, false, true, true); + multiDragElements.forEach(function (multiDragElement) { + if (multiDragElement === dragEl$1) return; + setRect(multiDragElement, dragRectAbsolute); + + // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted + // while folding, and so that we can capture them again because old sortable will no longer be fromSortable + parentEl.appendChild(multiDragElement); + }); + folding = true; + } + + // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out + if (!isOwner) { + // Only remove if not folding (folding will remove them anyways) + if (!folding) { + removeMultiDragElements(); + } + if (multiDragElements.length > 1) { + var clonesHiddenBefore = clonesHidden; + activeSortable._showClone(sortable); + + // Unfold animation for clones if showing from hidden + if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) { + multiDragClones.forEach(function (clone) { + activeSortable.addAnimationState({ + target: clone, + rect: clonesFromRect + }); + clone.fromRect = clonesFromRect; + clone.thisAnimationDuration = null; + }); + } + } else { + activeSortable._showClone(sortable); + } + } + } + }, + dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) { + var dragRect = _ref11.dragRect, + isOwner = _ref11.isOwner, + activeSortable = _ref11.activeSortable; + multiDragElements.forEach(function (multiDragElement) { + multiDragElement.thisAnimationDuration = null; + }); + if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) { + clonesFromRect = _extends({}, dragRect); + var dragMatrix = matrix(dragEl$1, true); + clonesFromRect.top -= dragMatrix.f; + clonesFromRect.left -= dragMatrix.e; + } + }, + dragOverAnimationComplete: function dragOverAnimationComplete() { + if (folding) { + folding = false; + removeMultiDragElements(); + } + }, + drop: function drop(_ref12) { + var evt = _ref12.originalEvent, + rootEl = _ref12.rootEl, + parentEl = _ref12.parentEl, + sortable = _ref12.sortable, + dispatchSortableEvent = _ref12.dispatchSortableEvent, + oldIndex = _ref12.oldIndex, + putSortable = _ref12.putSortable; + var toSortable = putSortable || this.sortable; + if (!evt) return; + var options = this.options, + children = parentEl.children; + + // Multi-drag selection + if (!dragStarted) { + if (options.multiDragKey && !this.multiDragKeyDown) { + this._deselectMultiDrag(); + } + toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1)); + if (!~multiDragElements.indexOf(dragEl$1)) { + multiDragElements.push(dragEl$1); + dispatchEvent({ + sortable: sortable, + rootEl: rootEl, + name: 'select', + targetEl: dragEl$1, + originalEvent: evt + }); + + // Modifier activated, select from last to dragEl + if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) { + var lastIndex = index(lastMultiDragSelect), + currentIndex = index(dragEl$1); + if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) { + // Must include lastMultiDragSelect (select it), in case modified selection from no selection + // (but previous selection existed) + var n, i; + if (currentIndex > lastIndex) { + i = lastIndex; + n = currentIndex; + } else { + i = currentIndex; + n = lastIndex + 1; + } + for (; i < n; i++) { + if (~multiDragElements.indexOf(children[i])) continue; + toggleClass(children[i], options.selectedClass, true); + multiDragElements.push(children[i]); + dispatchEvent({ + sortable: sortable, + rootEl: rootEl, + name: 'select', + targetEl: children[i], + originalEvent: evt + }); + } + } + } else { + lastMultiDragSelect = dragEl$1; + } + multiDragSortable = toSortable; + } else { + multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1); + lastMultiDragSelect = null; + dispatchEvent({ + sortable: sortable, + rootEl: rootEl, + name: 'deselect', + targetEl: dragEl$1, + originalEvent: evt + }); + } + } + + // Multi-drag drop + if (dragStarted && this.isMultiDrag) { + folding = false; + // Do not "unfold" after around dragEl if reverted + if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) { + var dragRect = getRect(dragEl$1), + multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')'); + if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null; + toSortable.captureAnimationState(); + if (!initialFolding) { + if (options.animation) { + dragEl$1.fromRect = dragRect; + multiDragElements.forEach(function (multiDragElement) { + multiDragElement.thisAnimationDuration = null; + if (multiDragElement !== dragEl$1) { + var rect = folding ? getRect(multiDragElement) : dragRect; + multiDragElement.fromRect = rect; + + // Prepare unfold animation + toSortable.addAnimationState({ + target: multiDragElement, + rect: rect + }); + } + }); + } + + // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert + // properly they must all be removed + removeMultiDragElements(); + multiDragElements.forEach(function (multiDragElement) { + if (children[multiDragIndex]) { + parentEl.insertBefore(multiDragElement, children[multiDragIndex]); + } else { + parentEl.appendChild(multiDragElement); + } + multiDragIndex++; + }); + + // If initial folding is done, the elements may have changed position because they are now + // unfolding around dragEl, even though dragEl may not have his index changed, so update event + // must be fired here as Sortable will not. + if (oldIndex === index(dragEl$1)) { + var update = false; + multiDragElements.forEach(function (multiDragElement) { + if (multiDragElement.sortableIndex !== index(multiDragElement)) { + update = true; + return; + } + }); + if (update) { + dispatchSortableEvent('update'); + dispatchSortableEvent('sort'); + } + } + } + + // Must be done after capturing individual rects (scroll bar) + multiDragElements.forEach(function (multiDragElement) { + unsetRect(multiDragElement); + }); + toSortable.animateAll(); + } + multiDragSortable = toSortable; + } + + // Remove clones if necessary + if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') { + multiDragClones.forEach(function (clone) { + clone.parentNode && clone.parentNode.removeChild(clone); + }); + } + }, + nullingGlobal: function nullingGlobal() { + this.isMultiDrag = dragStarted = false; + multiDragClones.length = 0; + }, + destroyGlobal: function destroyGlobal() { + this._deselectMultiDrag(); + off(document, 'pointerup', this._deselectMultiDrag); + off(document, 'mouseup', this._deselectMultiDrag); + off(document, 'touchend', this._deselectMultiDrag); + off(document, 'keydown', this._checkKeyDown); + off(document, 'keyup', this._checkKeyUp); + }, + _deselectMultiDrag: function _deselectMultiDrag(evt) { + if (typeof dragStarted !== "undefined" && dragStarted) return; + + // Only deselect if selection is in this sortable + if (multiDragSortable !== this.sortable) return; + + // Only deselect if target is not item in this sortable + if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; + + // Only deselect if left click + if (evt && evt.button !== 0) return; + while (multiDragElements.length) { + var el = multiDragElements[0]; + toggleClass(el, this.options.selectedClass, false); + multiDragElements.shift(); + dispatchEvent({ + sortable: this.sortable, + rootEl: this.sortable.el, + name: 'deselect', + targetEl: el, + originalEvent: evt + }); + } + }, + _checkKeyDown: function _checkKeyDown(evt) { + if (evt.key === this.options.multiDragKey) { + this.multiDragKeyDown = true; + } + }, + _checkKeyUp: function _checkKeyUp(evt) { + if (evt.key === this.options.multiDragKey) { + this.multiDragKeyDown = false; + } + } + }; + return _extends(MultiDrag, { + // Static methods & properties + pluginName: 'multiDrag', + utils: { + /** + * Selects the provided multi-drag item + * @param {HTMLElement} el The element to be selected + */ + select: function select(el) { + var sortable = el.parentNode[expando]; + if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return; + if (multiDragSortable && multiDragSortable !== sortable) { + multiDragSortable.multiDrag._deselectMultiDrag(); + multiDragSortable = sortable; + } + toggleClass(el, sortable.options.selectedClass, true); + multiDragElements.push(el); + }, + /** + * Deselects the provided multi-drag item + * @param {HTMLElement} el The element to be deselected + */ + deselect: function deselect(el) { + var sortable = el.parentNode[expando], + index = multiDragElements.indexOf(el); + if (!sortable || !sortable.options.multiDrag || !~index) return; + toggleClass(el, sortable.options.selectedClass, false); + multiDragElements.splice(index, 1); + } + }, + eventProperties: function eventProperties() { + var _this3 = this; + var oldIndicies = [], + newIndicies = []; + multiDragElements.forEach(function (multiDragElement) { + oldIndicies.push({ + multiDragElement: multiDragElement, + index: multiDragElement.sortableIndex + }); + + // multiDragElements will already be sorted if folding + var newIndex; + if (folding && multiDragElement !== dragEl$1) { + newIndex = -1; + } else if (folding) { + newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')'); + } else { + newIndex = index(multiDragElement); + } + newIndicies.push({ + multiDragElement: multiDragElement, + index: newIndex + }); + }); + return { + items: _toConsumableArray(multiDragElements), + clones: [].concat(multiDragClones), + oldIndicies: oldIndicies, + newIndicies: newIndicies + }; + }, + optionListeners: { + multiDragKey: function multiDragKey(key) { + key = key.toLowerCase(); + if (key === 'ctrl') { + key = 'Control'; + } else if (key.length > 1) { + key = key.charAt(0).toUpperCase() + key.substr(1); + } + return key; + } + } + }); + } + function insertMultiDragElements(clonesInserted, rootEl) { + multiDragElements.forEach(function (multiDragElement, i) { + var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)]; + if (target) { + rootEl.insertBefore(multiDragElement, target); + } else { + rootEl.appendChild(multiDragElement); + } + }); + } + + /** + * Insert multi-drag clones + * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted + * @param {HTMLElement} rootEl + */ + function insertMultiDragClones(elementsInserted, rootEl) { + multiDragClones.forEach(function (clone, i) { + var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)]; + if (target) { + rootEl.insertBefore(clone, target); + } else { + rootEl.appendChild(clone); + } + }); + } + function removeMultiDragElements() { + multiDragElements.forEach(function (multiDragElement) { + if (multiDragElement === dragEl$1) return; + multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement); + }); + } + + Sortable.mount(new AutoScrollPlugin()); + Sortable.mount(Remove, Revert); + + Sortable.mount(new SwapPlugin()); + Sortable.mount(new MultiDragPlugin()); + + return Sortable; + + }))); \ No newline at end of file From 677e3bc86cdb5a85e9b29ae1349970e3ce626ca1 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 23 Apr 2024 01:36:52 +1000 Subject: [PATCH 077/206] add composite list type. --- .../fields/composite/clientlibs/.content.json | 2 + .../fields/composite/clientlibs/behaviour.js | 54 ++++- .../fields/composite/clientlibs/functions.js | 208 ++++++++++++++---- .../fields/composite/clientlibs/style.css | 77 +++++++ .../forms/fields/composite/composite.html | 3 +- .../fields/composite/dialog/.content.json | 9 +- .../forms/fields/composite/variant.list.html | 87 ++++++++ 7 files changed, 395 insertions(+), 45 deletions(-) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/style.css create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/.content.json index 02123e829..33786908b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/.content.json @@ -7,8 +7,10 @@ "ai.typerefinery.websight.components.forms.composite" ], "css": [ + "style.css" ], "js": [ + "/apps/typerefinery/clientlibs/vendor/sortable/sortable.js", "functions.js", "behaviour.js" ] diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js index 0ff9cb514..bd1ee8413 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js @@ -3,12 +3,58 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.Composite || {}; -;(function (ns, document) { +;(function (ns, componentsNs, document) { "use strict"; $(document).ready(function () { console.log('Composite component Behaviour loaded'); - $("[component='composite']").each(function () { - ns.init(this); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}${ns.selector}`, ns.init); + + //listen for change event on all input fields and compile value for composite input + $(document).on("change", `${ns.selectorComponent}`, function() { + console.group("document onchange - composite change"); + console.log($(this)); + ns.compileValue($(this)); + console.groupEnd(); + }); + + //composite list global event listeners + //move current row to top + $(document).on("click", `${ns.selectorComponent} .top`, function() { + $(this).closest(".rows").prepend($(this).closest(".row")); + }); + + //move current row to bottom + $(document).on("click", `${ns.selectorComponent} .bottom`, function() { + $(this).closest(".rows").append($(this).closest(".row")); + }); + + //move current row above next sibling + $(document).on("click", `${ns.selectorComponent} .up`, function() { + if ($(this).closest(".row").prev().length > 0) { + $(this).closest(".row").prev().before($(this).closest(".row")); + } + }); + + //move current row below previous sibling + $(document).on("click", `${ns.selectorComponent} .down`, function() { + if ($(this).closest(".row").next().length > 0) { + $(this).closest(".row").next().after($(this).closest(".row")); + } + }); + + //move current row to trash + $(document).on("click", `${ns.selectorComponent} .delete`, function() { + //remove row if new + if ($(this).closest(".row").attr("state") == "new") { + $(this).closest(".row").remove(); + } else { + //move row to trash if existing + $(this).closest(".row").attr("state", "deleted"); + $(this).closest(`${ns.selectorComponent}`).find(".trash").append($(this).closest(".row")); + } }); + }); -})(window.Typerefinery.Components.Forms.Composite, document); +})(window.Typerefinery.Components.Forms.Composite, window.Typerefinery.Components, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js index 7650a16f5..0b6a05333 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js @@ -5,9 +5,11 @@ window.Typerefinery.Components.Forms.Form = Typerefinery.Components.Forms.Form | window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.Composite || {}; -;(function ($, ns, componentsNs, formNs, document, window) { +;(function ($, ns, componentsNs, formNs, Sortable, document, window) { "use strict"; - + + ns.selectorComponentName = "composite"; + ns.selectorComponent = "[component=composite]"; ns.selectorAttribute = "isCompositeParent"; ns.selector = `[${ns.selectorAttribute}]`; ns.selectorValueAttribute = "isCompositeValue"; @@ -21,35 +23,96 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C //template for form components in parent ns.selectorTemplate = "> [template]"; ns.selectorNameAttribute = "name"; + ns.selectorName = `[${ns.selectorNameAttribute}]`; ns.selectorIdAttribute = "id"; + ns.selectorTypeList = "list"; $.fn.findExclude = function(selector, mask) { return this.find(selector).not(this.find(mask).find(selector)); } $.fn.compositeVal = function(addFieldHint) { - //get all immediate isCompositeParent - var $compositeParents = this.parent(ns.selector).findExclude(ns.selector,ns.selector); - var data = {}; - - //add current field values to data - Object.assign(data,JSON.parse(this.val())); + console.group('compositeVal'); + const type = this.attr('type'); + const isList = type === ns.selectorTypeList; + console.group("type", type); + console.group("isList", isList); - //for each get their values and merge their composites in - $compositeParents.each(function(){ - //find composite value input field - var $compositeValue = $(this).findExclude(ns.selectorValue,ns.selector); - if ($compositeValue) { - // create placeholder for composite value - data[$compositeValue.attr(ns.selectorNameAttribute)] = {}; - // get composite value for this field, this will cascade to other composite fields - Object.assign(data[$compositeValue.attr(ns.selectorNameAttribute)],$compositeValue.compositeVal()); - } - }); - return data; + if (!isList) { + //get all immediate isCompositeParent components + var $compositeParents = this.parent(ns.selector).findExclude(ns.selector,ns.selector); + var data = {}; + + console.log("this.value", this.val()); + //add current field values to data + Object.assign(data,JSON.parse(this.val())); + + console.log("compositeParents", $compositeParents); + //for each get their values and merge their composites in + $compositeParents.each(function(){ + //find composite value input field + var $compositeValue = $(this).findExclude(ns.selectorValue,ns.selector); + console.log("compositeValue", $compositeValue); + if ($compositeValue) { + const compositeValueName = $compositeValue.attr(ns.selectorNameAttribute); + console.log("compositeValueName", compositeValueName); + // create placeholder for composite value + data[compositeValueName] = {}; + // get composite value for this field, this will cascade to other composite fields + Object.assign(data[compositeValueName],$compositeValue.compositeVal(addFieldHint)); + } + }); + console.groupEnd(); + return data; + } else { + var data = []; + console.log("parent", this.parent(ns.selector)); + console.log("rows", this.parent(ns.selector).find('.row')); + this.parent(ns.selector).find('.row').each(function() { + console.log("row", this); + const $row = $(this); + const $rowContents = $row.find('.content'); + console.log("contents", $rowContents); + + var rowData = {}; + //get all simple input fields and add to data + $rowContents.find(ns.selectorInput).each(function() { + const $field = $(this); + console.log("$field", $field); + rowData[$field.attr(ns.selectorNameAttribute)] = $field.val(); + }); + console.log("rowData", JSON.stringify(rowData)); + //get all immediate isCompositeParent components and add to data + var $compositeParents = $rowContents.findExclude(ns.selector,ns.selector); + console.log("compositeParents", $compositeParents); + $compositeParents.each(function(){ + //find composite value input field + var $compositeValue = $(this).findExclude(ns.selectorValue,ns.selector); + console.log("compositeValue", $compositeValue); + if ($compositeValue) { + const compositeValueName = $compositeValue.attr(ns.selectorNameAttribute); + console.log("compositeValueName", compositeValueName); + // create placeholder for composite value + var data = {}; + // get composite value for this field, this will cascade to other composite fields + Object.assign(data,$compositeValue.compositeVal(addFieldHint)); + rowData[compositeValueName] = data; + } + console.log("rowData", JSON.stringify(rowData)); + }); + //add row data to data + data.push(rowData); + }); + console.groupEnd(); + return data; + } } ns.setValue = function($compositeParent, data) { + + const type = $compositeParent.attr('type'); + const isList = type === ns.selectorTypeList; + //get all immediate isCompositeParent var $compositeParents = $compositeParent.parent(ns.selector).findExclude(ns.selector,ns.selector); //set value of composite input @@ -90,28 +153,97 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C $field.val(JSON.stringify(data)); } - ns.init = async ($component) => { - const componentConfig = componentsNs.getComponentConfig($component); + ns.addRow = function($compositeParent) { + var $newRow = $($compositeParent.find("template.content").html()); + const $templateActions = $($compositeParent.find("template.actions").html()); + const $templateMove = $($compositeParent.find("template.move").html()); + + //add move and actions to new row + $newRow.prepend($templateMove.clone()); + $newRow.append($templateActions.clone()); + $newRow.attr('id', 'row-' + Math.random().toString(36)); + $newRow.attr('state', "new"); + + $compositeParent.find(".rows").append($newRow.clone()); + } + + ns.init = async ($compositeParent) => { + console.group("composite init"); + const componentConfig = componentsNs.getComponentConfig($compositeParent); + + console.log($compositeParent); + console.log(componentConfig); + + const type = $compositeParent.attr('type'); + const isList = type === ns.selectorTypeList; + + console.log(type); + console.log(isList); - $(document).ready(function () { + if (isList) { + console.log('Composite List component Behaviour loading'); + //setup list variant + var $newRow = $($compositeParent.find("template.content").html()); + const $templateActions = $($compositeParent.find("template.actions").html()); + const $templateMove = $($compositeParent.find("template.move").html()); - $(ns.selector).each(function(){ - //find all input fields that are not inside another composite input - var $field = $(this).findExclude(ns.selectorTemplate,ns.selector).findExclude(ns.selectorInput, ns.selector); - //remove isInput attribute and add isCompositeInput attribute, this will ensure that form fields are not processed by form submit - $field.removeAttr(ns.selectorInputAttribute); - $field.attr(ns.selectorCompositeInputAttribute,"true"); - //compile value for composite input - ns.compileValue($(this)); + //add move and actions to new row + $newRow.prepend($templateMove.clone()); + $newRow.append($templateActions.clone()); + $newRow.attr('id', 'row-' + Math.random().toString(36)); + $newRow.attr('state', "new"); + + //add move and actions to all rows + $compositeParent.find(".rows .row").each(function(){ + $(this).prepend($templateMove.clone()); + $(this).append($templateActions.clone()); }); - }) - - //listen for change event on all input fields and compile value for composite input - $(ns.selector).on("change", function() { - ns.compileValue($(this)); + console.log("sortable target",$compositeParent.get(0), $compositeParent.find(".rows").get(0)); + //initialize sortable on rows + new Sortable($compositeParent.find(".rows").get(0), { + handle: '.move', // handle's class + animation: 150 }); - + + //add new row listener + $compositeParent.find(".add").on("click", function() { + $compositeParent.find(".rows").append($newRow.clone()); + }); + console.log('Composite List component Behaviour loaded'); + } + + // compile current values for all input fields + //find all input fields that are not inside another composite input + var $field = $compositeParent.findExclude(ns.selectorTemplate,ns.selector).findExclude(ns.selectorInput, ns.selector); + console.log('remove input attribute and add composite input attribute', $field); + //remove isInput attribute and add isCompositeInput attribute, this will ensure that form fields are not processed by form submit + $field.removeAttr(ns.selectorInputAttribute); + $field.attr(ns.selectorCompositeInputAttribute,"true"); + //compile value for composite input + ns.compileValue($compositeParent); + + //find all input fields that are not inside another composite input + // var $field = $(this).findExclude(ns.selectorTemplate,ns.selector).findExclude(ns.selectorInput, ns.selector); + // console.log('remove input attribute and add composite input attribute', $field); + // //remove isInput attribute and add isCompositeInput attribute, this will ensure that form fields are not processed by form submit + // $field.removeAttr(ns.selectorInputAttribute); + // $field.attr(ns.selectorCompositeInputAttribute,"true"); + //compile value for composite input + // ns.compileValue($(this)); + + // //compile all values within this parent now for all input fields + // $compositeParent.find(ns.selector).each(function(){ + // //find all input fields that are not inside another composite input + // var $field = $(this).findExclude(ns.selectorTemplate,ns.selector).findExclude(ns.selectorInput, ns.selector); + // //remove isInput attribute and add isCompositeInput attribute, this will ensure that form fields are not processed by form submit + // $field.removeAttr(ns.selectorInputAttribute); + // $field.attr(ns.selectorCompositeInputAttribute,"true"); + // //compile value for composite input + // ns.compileValue($(this)); + // }); + + console.groupEnd(); } -})(jQuery, Typerefinery.Components.Forms.Composite, Typerefinery.Components, Typerefinery.Components.Forms.Form, document, window); +})(jQuery, Typerefinery.Components.Forms.Composite, Typerefinery.Components, Typerefinery.Components.Forms.Form, Sortable, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/style.css b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/style.css new file mode 100644 index 000000000..6e5fca1be --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/style.css @@ -0,0 +1,77 @@ + +[component=composite][type=list] .rows { + display: flex; + flex-direction: column; +} + +[component=composite][type=list] .row { + display: flex; + flex-direction: row; + margin: 0.5rem; +} + + +[component=composite][type=list] .row .content { + display: flex; + flex-direction: row; + align-items: center; + width: auto; + max-width: unset; + flex-grow: 1; + flex-wrap: wrap; +} + +[component=composite][type=list] .row .move { + display: flex; + flex-direction: row; + align-items: start; + margin: 0.5rem; + width: 4rem; + flex-wrap: wrap; + align-content: center; +} +[component=composite][type=list] .row .move .drag { + width: 4rem; +} + +[component=composite][type=list] .row .move button { + width: 2rem; +} + +[component=composite][type=list] .row .actions { + display: flex; + flex-direction: column; + align-items: center; + margin: 0.5rem; + justify-content: center; + width: auto; + margin-left: auto; +} + +[component=composite][type=list] .row:hover { + background-color: lightgray; +} +[component=composite][type=list] .add { + margin: 1em; +} + +[component=composite][type=list] .delete { + margin: 1em; +} + +[component=composite][type=list] .handle { + margin-right: 5px; + width: 1.4em; + position: relative; + background-color: #E4E6EB; + background-image: linear-gradient(45deg, #E4E6EB, #E4E6EB 2px, #fff 2px, #fff 4px, #E4E6EB 4px, #E4E6EB 9px, #fff 9px, #fff 11px, #E4E6EB 11px, #E4E6EB 16px, #fff 16px, #fff 18px, #E4E6EB 18px, #E4E6EB 22px); + background-size: 10px 20px; + cursor: move; + border-top: 2px solid #FFF; + border-bottom: 2px solid #FFF; +} + +[component=composite][type=list] .handle:active { + background-image: linear-gradient(45deg, #bab86c, #bab86c 2px, #fff 2px, #fff 4px, #bab86c 4px, #bab86c 9px, #fff 9px, #fff 11px, #bab86c 11px, #bab86c 16px, #fff 16px, #fff 18px, #bab86c 18px, #bab86c 22px); + background-size: 10px 20px; +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html index c28c618b3..8e007650a 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html @@ -15,7 +15,8 @@ */--> <sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Composite"> <div class="${model.componentClassNames}" id="${model.id}" type="${model.inputType}" component="${model.componentName}" isCompositeParent="true"> - <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> + <sly data-sly-set.variantTemplate="./variant${model.inputType ? '.' : ''}${model.inputType ? model.inputType : ''}.html"></sly> + <sly data-sly-use.template="${variantTemplate}" data-sly-call="${template.variant @ model=model}"> </sly> </div> </sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json index feee2d895..8f43a0327 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json @@ -25,8 +25,13 @@ "label": "Type", "composite": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", - "label": "Composite", - "value": "composite" + "label": "Field", + "value": "field" + }, + "list": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "List", + "value": "list" } } }, diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html new file mode 100644 index 000000000..e8832dea2 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html @@ -0,0 +1,87 @@ +<!--/* + Copyright (C) 2023 Typerefinery.io + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<template data-sly-template.variant="${ @ model }"> + <input + component="${model.componentName}" + isInput="true" + id="${model.id}" + name="${model.name}" + type="${model.inputType}" + data-fieldId="${model.id}-${model.name}" + placeholder="${model.placeholder}" + class="${model.variantClassNames} form-control" + required="${model.validationRequired}" + data-model="${model.jsonString}" + disabled="${model.disabled}" + isCompositeValue="true" + hidden + > + </input> + <sly data-sly-test="${wcmmode.isEdit}"> + <!--edit mode display row--> + <div class="contents"> + <div class="rows"> + <div class="row"> + <div class="move"> + <button class="top" disabled><i class="fa-solid fa-angles-up pi pi-angle-double-up"></i></button> + <button class="up" disabled><i class="fa-solid fa-angle-up pi pi-angle-up"></i></button> + <button class="drag" disabled><i class="fa-solid fa-up-down pi pi-arrows-v"></i></button> + <button class="down" disabled><i class="fa-solid fa-angle-down pi pi-angle-down"></i></button> + <button class="bottom" disabled><i class="fa-solid fa-angles-down pi pi-angle-double-down"></i></button> + </div> + <div class=content> + <sly data-sly-include="${'parsys.html' @ prependPath='/apps/typerefinery/components/parsys'}"></sly> + </div> + <div class="actions"> + <button class="delete" disabled><i class="fa-solid fa-trash pi pi-trash"></i></button> + </div> + </div> + </div> + <button class="add" disabled><i class="fa-solid fa-plus pi pi-plus-circle"></i></button> + </div> + </sly> + <sly data-sly-test="${!wcmmode.isEdit}"> + <div class="contents"> + <div class="rows"> + </div> + <button class="add"><i class="fa-solid fa-plus pi pi-plus-circle"></i></button> + </div> + <template class="trash"> + </template> + <template class="content"> + <div class="row"> + <div class=content> + <sly data-sly-include="${'parsys.html' @ prependPath='/apps/typerefinery/components/parsys'}"></sly> + </div> + </div> + </template> + <template class="move"> + <div class="move"> + <button class="up"><i class="fa-solid fa-angle-up pi pi-angle-up"></i></button> + <button class="top"><i class="fa-solid fa-angles-up pi pi-angle-double-up"></i></button> + <button class="drag"><i class="fa-solid fa-up-down pi pi-arrows-v"></i></button> + <button class="down"><i class="fa-solid fa-angle-down pi pi-angle-down"></i></button> + <button class="bottom"><i class="fa-solid fa-angles-down pi pi-angle-double-down"></i></button> + </div> + </template> + <template class="actions"> + <div class="actions"> + <button class="delete"><i class="fa-solid fa-trash pi pi-trash"></i></button> + </div> + </template> + </sly> + <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} - Template</div> +</template> \ No newline at end of file From e346dfc08412921249933cb8e592e06c6cacc9d5 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 23 Apr 2024 01:41:30 +1000 Subject: [PATCH 078/206] update addRow to return new row id. --- .../fields/composite/clientlibs/functions.js | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js index 0b6a05333..185119af4 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js @@ -153,6 +153,7 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C $field.val(JSON.stringify(data)); } + //add new row and return row id ns.addRow = function($compositeParent) { var $newRow = $($compositeParent.find("template.content").html()); const $templateActions = $($compositeParent.find("template.actions").html()); @@ -161,10 +162,12 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C //add move and actions to new row $newRow.prepend($templateMove.clone()); $newRow.append($templateActions.clone()); - $newRow.attr('id', 'row-' + Math.random().toString(36)); + const newid = 'row-' + Math.random().toString(36); + $newRow.attr('id', newid); $newRow.attr('state', "new"); $compositeParent.find(".rows").append($newRow.clone()); + return newid; } ns.init = async ($compositeParent) => { @@ -222,26 +225,6 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C //compile value for composite input ns.compileValue($compositeParent); - //find all input fields that are not inside another composite input - // var $field = $(this).findExclude(ns.selectorTemplate,ns.selector).findExclude(ns.selectorInput, ns.selector); - // console.log('remove input attribute and add composite input attribute', $field); - // //remove isInput attribute and add isCompositeInput attribute, this will ensure that form fields are not processed by form submit - // $field.removeAttr(ns.selectorInputAttribute); - // $field.attr(ns.selectorCompositeInputAttribute,"true"); - //compile value for composite input - // ns.compileValue($(this)); - - // //compile all values within this parent now for all input fields - // $compositeParent.find(ns.selector).each(function(){ - // //find all input fields that are not inside another composite input - // var $field = $(this).findExclude(ns.selectorTemplate,ns.selector).findExclude(ns.selectorInput, ns.selector); - // //remove isInput attribute and add isCompositeInput attribute, this will ensure that form fields are not processed by form submit - // $field.removeAttr(ns.selectorInputAttribute); - // $field.attr(ns.selectorCompositeInputAttribute,"true"); - // //compile value for composite input - // ns.compileValue($(this)); - // }); - console.groupEnd(); } From 7ea6abfe99c0091066bb2d26540a5f213ffd6580 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 23 Apr 2024 21:18:59 +1000 Subject: [PATCH 079/206] update component behaviour to init on being added to dom dynamicaly. --- .../forms/fields/button/clientlibs/behaviour.js | 13 ++++++------- .../forms/fields/button/clientlibs/functions.js | 3 +++ .../forms/fields/checkbox/clientlibs/behaviour.js | 6 +++--- .../forms/fields/select/clientlibs/behaviour.js | 14 ++++++-------- .../forms/fields/select/clientlibs/functions.js | 2 ++ .../widgets/editor/clientlibs/behaviour.js | 14 ++++++-------- .../widgets/editor/clientlibs/functions.js | 2 ++ 7 files changed, 28 insertions(+), 26 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/behaviour.js index c60fd3cb2..beef1f24d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/behaviour.js @@ -3,11 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Button = Typerefinery.Components.Forms.Button || {}; -(function (ns, document) { +(function (ns, componentsNs, document) { "use strict"; - $(document).ready(function () { - document.querySelectorAll('[component="button"]').forEach(function ($component) { - ns.init($component); - }); - }); -})(window.Typerefinery.Components.Forms.Button, document); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(window.Typerefinery.Components.Forms.Button, window.Typerefinery.Components, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js index ca2e4faff..726b3700f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js @@ -8,6 +8,9 @@ window.Typerefinery.ToggleComponent = Typerefinery.ToggleComponent || {}; window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; (function (ns, componentNs, modalNs, dropdownNs, toggleComponentNs, themeNs, document, window) { + "use strict"; + ns.selectorComponent = '[component="button"]'; + ns.addEventListener = ($component, id) => { $component.addEventListener("click", (e) => { e?.preventDefault(); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/behaviour.js index 78b63ddd5..f1ddb1335 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/behaviour.js @@ -5,7 +5,7 @@ window.Typerefinery.Components.Forms.Checkbox = Typerefinery.Components.Forms.Ch ;(function (ns, document) { "use strict"; - $(document).ready(function () { - ns.init(); - }); + // $(document).ready(function () { + // ns.init(); + // }); })(window.Typerefinery.Components.Forms.Checkbox, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js index 56ffa9079..4358f878b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js @@ -3,12 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Select = Typerefinery.Components.Forms.Select || {}; -;(function (ns, document) { +;(function (ns, componentsNs, document) { "use strict"; - $(document).ready(function () { - console.log('Select component Behaviour loaded'); - $("[component='select']").each(function () { - ns.init(this); - }); - }); -})(window.Typerefinery.Components.Forms.Select, document); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(window.Typerefinery.Components.Forms.Select, window.Typerefinery.Components, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js index a115ba184..d1b98392d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js @@ -9,6 +9,8 @@ window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components. ;(function (ns, componentNs, selectInstances, window, document) { "use strict"; + ns.selectorComponent = '[component="select"]'; + ns.getOptionsSelectedAsAnArray = ($component) => { const $selectedOption = $component.querySelector('option[selected]'); if($selectedOption) { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/behaviour.js index 70bdb173e..5a93fb31f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/behaviour.js @@ -3,12 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Widgets = Typerefinery.Components.Widgets || {}; window.Typerefinery.Components.Widgets.Editor = Typerefinery.Components.Widgets.Editor || {}; -(function (ns, document) { +(function (ns, componentsNs, document) { "use strict"; - $(document).ready(function () { - console.log('Editor component Behaviour loaded'); - $('[component=editor]').each(function () { - ns?.init(this); - }); - }); -})(Typerefinery.Components.Widgets.Editor, document); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(Typerefinery.Components.Widgets.Editor, window.Typerefinery.Components, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js index 774fdcee2..88a6b7849 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js @@ -9,6 +9,8 @@ window.Typerefinery.Components.Widgets.Editor.Instances = Typerefinery.Component (function (ns, componentNs, editorInstanceNs, document, window) { "use strict"; + ns.selectorComponent = '[component="editor"]'; + ns.getCodeEditorTheme = (editor, theme) => { switch (editor) { case "MONACO": From 4313c9e1652eb0af455f842f7905e8998a7ccdfc Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 23 Apr 2024 21:32:48 +1000 Subject: [PATCH 080/206] update form component behavior initialization and watch for new components when they are added to dom. --- .../components/forms/form/clientlibs/behaviour.js | 13 ++++++------- .../components/forms/form/clientlibs/functions.js | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/behaviour.js index 35e79d1c5..cd815fa87 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/behaviour.js @@ -3,11 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Form = Typerefinery.Components.Forms.Form || {}; -(function ($, ns, document) { +(function ($, ns, componentsNs, document) { "use strict"; - $(document).ready(function () { - $('[component="form"]').each(function () { - ns.init($(this)); - }); - }); -})(jQuery, window.Typerefinery.Components.Forms.Form, document); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, window.Typerefinery.Components.Forms.Form, window.Typerefinery.Components, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index 4fff10f4d..aabfb48c8 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -13,6 +13,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; (function ($, ns, componentNs, editorNs, selectNs, compositeNs, eventNs, filesNs, document, window) { "use strict"; + ns.selectorComponent = '[component="form"]'; ns.selectorInputAttribute = "isInput"; ns.selectorInput = `[${ns.selectorInputAttribute}]`; From 7aefa280e22ab60d0b6ec441dde3c10bfb124f57 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 23 Apr 2024 22:25:50 +1000 Subject: [PATCH 081/206] fix aria attribute on container. --- .../apps/typerefinery/components/layout/container/variant.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html index 26384dfaa..24c588244 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html @@ -37,7 +37,7 @@ data-sly-element="${model.decorationTagName}" style="${model.inlineStyleValue @ context='unsafe'}" role="${model.role}" - ${model.ariaAttributesString @ context='unsafe'} + data-sly-attribute="${model.ariaAttributesString @ context='unsafe'}" data-sly-test="${resource.hasChildren}"> <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> </div> From 24aa7f6a983d0b9705b736ef9a7f17fc5a0194bf Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 24 Apr 2024 01:33:49 +1000 Subject: [PATCH 082/206] add user readonly toggle for composite. --- .../websight/models/components/forms/Composite.java | 4 ++++ .../forms/fields/composite/dialog/.content.json | 12 ++++++++++++ .../forms/fields/composite/variant.list.html | 9 +++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Composite.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Composite.java index 9853a1707..b70d7a618 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Composite.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Composite.java @@ -38,6 +38,10 @@ public class Composite extends BaseFormComponent { @Getter public String inputType; + @Inject + @Getter + public Boolean listIsUserReadonly; + @Override @PostConstruct protected void init() { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json index 8f43a0327..6f22de8e4 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json @@ -33,6 +33,18 @@ "label": "List", "value": "list" } + }, + "listUserEditable": { + "sling:resourceType": "wcm/dialogs/components/toggle", + "name": "listIsUserReadonly", + "label": "Is User Readonly?", + "description": "Do not allow adding and removing items.", + "ws:display": { + "condition": { + "sourceName": "inputType", + "values": "list" + } + } } }, "validationTab": { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html index e8832dea2..b0c8baf10 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html @@ -26,6 +26,7 @@ required="${model.validationRequired}" data-model="${model.jsonString}" disabled="${model.disabled}" + listIsUserReadonly="${model.listIsUserReadonly}" isCompositeValue="true" hidden > @@ -35,7 +36,7 @@ <div class="contents"> <div class="rows"> <div class="row"> - <div class="move"> + <div class="move" data-sly-test="${!model.listIsUserReadonly}"> <button class="top" disabled><i class="fa-solid fa-angles-up pi pi-angle-double-up"></i></button> <button class="up" disabled><i class="fa-solid fa-angle-up pi pi-angle-up"></i></button> <button class="drag" disabled><i class="fa-solid fa-up-down pi pi-arrows-v"></i></button> @@ -45,19 +46,19 @@ <div class=content> <sly data-sly-include="${'parsys.html' @ prependPath='/apps/typerefinery/components/parsys'}"></sly> </div> - <div class="actions"> + <div class="actions" data-sly-test="${!model.listIsUserReadonly}"> <button class="delete" disabled><i class="fa-solid fa-trash pi pi-trash"></i></button> </div> </div> </div> - <button class="add" disabled><i class="fa-solid fa-plus pi pi-plus-circle"></i></button> + <button class="add" disabled data-sly-test="${!model.listIsUserReadonly}"><i class="fa-solid fa-plus pi pi-plus-circle"></i></button> </div> </sly> <sly data-sly-test="${!wcmmode.isEdit}"> <div class="contents"> <div class="rows"> </div> - <button class="add"><i class="fa-solid fa-plus pi pi-plus-circle"></i></button> + <button class="add" data-sly-test="${!model.listIsUserReadonly}"><i class="fa-solid fa-plus pi pi-plus-circle"></i></button> </div> <template class="trash"> </template> From e53ba973f2be09f8057b1a51b554c7bde13147d9 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 24 Apr 2024 01:34:42 +1000 Subject: [PATCH 083/206] ensure composite list contents displayed as column. --- .../forms/fields/composite/clientlibs/style.css | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/style.css b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/style.css index 6e5fca1be..f1f5c6093 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/style.css +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/style.css @@ -1,7 +1,16 @@ +[component=composite][type=list] .contents { + display: flex; + justify-content: center; + flex-wrap: nowrap; + flex-direction: column; + align-items: center; +} + [component=composite][type=list] .rows { display: flex; flex-direction: column; + width: 100%; } [component=composite][type=list] .row { From 21e5b8793a6ebf3db381c9f7fdd8827ced19816b Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 24 Apr 2024 01:35:13 +1000 Subject: [PATCH 084/206] update ability to set value on composite field. --- .../fields/composite/clientlibs/functions.js | 181 ++++++++++++------ 1 file changed, 127 insertions(+), 54 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js index 185119af4..c0d284048 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js @@ -25,6 +25,7 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C ns.selectorNameAttribute = "name"; ns.selectorName = `[${ns.selectorNameAttribute}]`; ns.selectorIdAttribute = "id"; + ns.selectorTypeField = "field"; ns.selectorTypeList = "list"; $.fn.findExclude = function(selector, mask) { @@ -33,7 +34,7 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C $.fn.compositeVal = function(addFieldHint) { console.group('compositeVal'); - const type = this.attr('type'); + const type = this.attr('type') || ns.selectorTypeField; const isList = type === ns.selectorTypeList; console.group("type", type); console.group("isList", isList); @@ -105,27 +106,86 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C }); console.groupEnd(); return data; - } + } } - ns.setValue = function($compositeParent, data) { + ns.findFieldAndSetValue = function($compositeParent, key, value) { + console.group(key); + console.log("value", value); + const $field = $compositeParent.find(`[${ns.selectorNameAttribute}=${key}]`); - const type = $compositeParent.attr('type'); + if ($field.length === 0) { + console.log("field not found", key); + console.groupEnd(); + return; + } + console.log("$field", $field); + console.log("$field.is(ns.selectorInput)", ns.selectorInput, $field.is(ns.selectorInput)); + console.log("$field.is(ns.selectorValue)", ns.selectorValue, $field.is(ns.selectorValue)); + // if field is basic input field + if ($field.is(ns.selectorValue)) { + // if field is composite field + ns.setValue($field, value); + console.log("set composite value"); + } else if ($field.is(ns.selectorInput)) { + $field.val(value); + console.log("set val()"); + } else { + console.log("unknow field", $field); + } + console.log("$field.val()", $field.val()); + console.groupEnd(); + } + + ns.setValue = function($compositeValue, data) { + console.group('composite setValue'); + console.log("$compositeValue", $compositeValue); + const $compositeParent = $compositeValue.parent(ns.selector); + console.log("$compositeParent", $compositeParent); + console.log("data", data); + const type = $compositeParent.attr('type') || ns.selectorTypeField; const isList = type === ns.selectorTypeList; + console.log("type", type); + console.log("isList", isList); - //get all immediate isCompositeParent - var $compositeParents = $compositeParent.parent(ns.selector).findExclude(ns.selector,ns.selector); - //set value of composite input - $compositeParent.val(JSON.stringify(data)); - //for each get their values and merge their composites in - $compositeParents.each(function(){ - //find composite value input field - var $compositeValue = $(this).findExclude(ns.selectorValue,ns.selector); - if ($compositeValue) { - // get composite value for this field, this will cascade to other composite fields - $compositeValue.setValue(data[$compositeValue.attr(ns.selectorNameAttribute)]); - } - }); + if (!isList) { + Object.keys(data).forEach(function(key) { + const value = data[key]; + ns.findFieldAndSetValue($compositeParent, key, value); + }); + } else { + //for each row in data add a new row + data.forEach(function(rowData){ + console.group("list row"); + console.log("rowData", rowData); + + //get row id from data + const rowId = rowData['id']; + console.log("data rowId", rowId); + //check if row already exists + let $dataRow = $compositeParent.find(`.row#${rowId}`); + + if ($dataRow.length > 0) { + console.log("row exists"); + } else { + const newRowId = ns.addRow($compositeParent, rowId); + console.log("newRowId", newRowId); + $dataRow = $compositeParent.find(`.row#${newRowId}`); + } + console.log("$dataRow", $dataRow); + + //for rowData set value of fields + //get all simple input fields and set value + Object.keys(rowData).forEach(function(key) { + const value = rowData[key]; + ns.findFieldAndSetValue($dataRow, key, value); + }); + console.groupEnd(); + }); + } + + console.groupEnd(); + return; } ns.compileValue = function($compositeParent, addFieldHint) { @@ -154,7 +214,7 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C } //add new row and return row id - ns.addRow = function($compositeParent) { + ns.addRow = function($compositeParent, id) { var $newRow = $($compositeParent.find("template.content").html()); const $templateActions = $($compositeParent.find("template.actions").html()); const $templateMove = $($compositeParent.find("template.move").html()); @@ -162,12 +222,17 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C //add move and actions to new row $newRow.prepend($templateMove.clone()); $newRow.append($templateActions.clone()); - const newid = 'row-' + Math.random().toString(36); - $newRow.attr('id', newid); + var rowId = id; + if (!id) { + rowId = 'row-' + Math.random().toString(36).substring(2, 15); + } + + $newRow.attr('id', rowId); $newRow.attr('state', "new"); - $compositeParent.find(".rows").append($newRow.clone()); - return newid; + var $resultRow = $compositeParent.find(".rows").append($newRow.clone()); + console.log("new row added", $resultRow); + return rowId; } ns.init = async ($compositeParent) => { @@ -177,42 +242,50 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C console.log($compositeParent); console.log(componentConfig); - const type = $compositeParent.attr('type'); - const isList = type === ns.selectorTypeList; + const type = $compositeParent.attr('type') || ns.selectorTypeField; + const isList = (type === ns.selectorTypeList) ? true : false; + const listIsUserReadonly = $compositeParent.attr('listIsUserReadonly'); - console.log(type); - console.log(isList); + console.log("type", type); + console.log("isList", isList); if (isList) { - console.log('Composite List component Behaviour loading'); - //setup list variant - var $newRow = $($compositeParent.find("template.content").html()); - const $templateActions = $($compositeParent.find("template.actions").html()); - const $templateMove = $($compositeParent.find("template.move").html()); - - //add move and actions to new row - $newRow.prepend($templateMove.clone()); - $newRow.append($templateActions.clone()); - $newRow.attr('id', 'row-' + Math.random().toString(36)); - $newRow.attr('state', "new"); - - //add move and actions to all rows - $compositeParent.find(".rows .row").each(function(){ - $(this).prepend($templateMove.clone()); - $(this).append($templateActions.clone()); - }); - console.log("sortable target",$compositeParent.get(0), $compositeParent.find(".rows").get(0)); - //initialize sortable on rows - new Sortable($compositeParent.find(".rows").get(0), { - handle: '.move', // handle's class - animation: 150 - }); + console.group("composite list init"); + + if (listIsUserReadonly && listIsUserReadonly === 'true') { + console.log('composite list is user readonly'); + } else { + //setup list variant + var $newRow = $($compositeParent.find("template.content").html()); + const $templateActions = $($compositeParent.find("template.actions").html()); + const $templateMove = $($compositeParent.find("template.move").html()); + //add move and actions to new row + $newRow.prepend($templateMove.clone()); + $newRow.append($templateActions.clone()); + $newRow.attr('state', "new"); + $newRow.attr('id', 'row-' + Math.random().toString(36).substring(2, 15)); + + //add move and actions to all rows + $compositeParent.find(".rows .row").each(function(){ + $(this).prepend($templateMove.clone()); + $(this).append($templateActions.clone()); + $(this).attr('state', "existing"); + }); + + console.log("sortable target",$compositeParent.get(0), $compositeParent.find(".rows").get(0)); + //initialize sortable on rows + new Sortable($compositeParent.find(".rows").get(0), { + handle: '.move', // handle's class + animation: 150 + }); + + //add new row listener + $compositeParent.find(".add").on("click", function() { + $compositeParent.find(".rows").append($newRow.clone()); + }); + } - //add new row listener - $compositeParent.find(".add").on("click", function() { - $compositeParent.find(".rows").append($newRow.clone()); - }); - console.log('Composite List component Behaviour loaded'); + console.groupEnd(); } // compile current values for all input fields From f1d4f3a0af5c751f0246bb08559c588a46cdfa82 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 24 Apr 2024 01:48:40 +1000 Subject: [PATCH 085/206] update composite to handle only known input types. --- .../components/forms/fields/composite/composite.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html index 8e007650a..c56061634 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html @@ -15,7 +15,8 @@ */--> <sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Composite"> <div class="${model.componentClassNames}" id="${model.id}" type="${model.inputType}" component="${model.componentName}" isCompositeParent="true"> - <sly data-sly-set.variantTemplate="./variant${model.inputType ? '.' : ''}${model.inputType ? model.inputType : ''}.html"></sly> + <sly data-sly-set.inputType="${model.inputType == 'list' ? 'list' : ''}"></sly> + <sly data-sly-set.variantTemplate="./variant${inputType ? '.' : ''}${inputType ? inputType : ''}.html"></sly> <sly data-sly-use.template="${variantTemplate}" data-sly-call="${template.variant @ model=model}"> </sly> </div> From d5e778e3031002b71cc108b8080151562e0c3197 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 24 Apr 2024 03:52:30 +1000 Subject: [PATCH 086/206] update text dom loading. --- .../components/content/text/clientlibs/behaviour.js | 12 ++++-------- .../components/content/text/clientlibs/functions.js | 2 ++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/behaviour.js index 5dc2d06de..9f2f6fad7 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/behaviour.js @@ -3,12 +3,8 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Content = Typerefinery.Components.Content || {}; window.Typerefinery.Components.Content.Text = Typerefinery.Components.Content.Text || {}; -(function (ns, document, window) { +(function (ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - console.log('Text component Behaviour loaded'); - $('[component="text"]').each(function () { - ns.init(this); - }); - }); -})(Typerefinery.Components.Content.Text, document, window); + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); +})(Typerefinery.Components.Content.Text, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js index 4d9787d94..b33e88adc 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js @@ -8,6 +8,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; (function (ns, componentNs, eventNs, document, window) { "use strict"; + ns.selectorComponent = '[component="text"]'; + ns.registerEvent = ($component, componentId, fieldName) => { const key = `${componentId}-${fieldName}`; eventNs.registerEvents(key, (data) => { From a13f68366ffce54eaf379dbc2d23e0a6f8eb094b Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 24 Apr 2024 03:52:49 +1000 Subject: [PATCH 087/206] add new template container. --- .../models/components/layout/Template.java | 58 +++++++++++++++++++ .../components/layout/template/.content.json | 20 +++++++ .../layout/template/dialog/.content.json | 20 +++++++ .../components/layout/template/tremplate.html | 18 ++++++ .../components/layout/template/variant.html | 32 ++++++++++ 5 files changed, 148 insertions(+) create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Template.java create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/template/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/template/dialog/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/template/tremplate.html create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Template.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Template.java new file mode 100644 index 000000000..b7298f58f --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Template.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2023 Typerefinery.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + package ai.typerefinery.websight.models.components.layout; + + import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; + + import javax.annotation.PostConstruct; + + import org.apache.sling.api.SlingHttpServletRequest; + import org.apache.sling.api.resource.Resource; + import org.apache.sling.models.annotations.Exporter; + import org.apache.sling.models.annotations.ExporterOption; + import org.apache.sling.models.annotations.Model; + import org.osgi.service.component.annotations.Component; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; + + @Component + @Model( + adaptables = { + Resource.class, + SlingHttpServletRequest.class + }, + resourceType = { + Footer.RESOURCE_TYPE + }, + defaultInjectionStrategy = OPTIONAL + ) + @Exporter(name = "jackson", extensions = "json", options = { + @ExporterOption(name = "MapperFeature.SORT_PROPERTIES_ALPHABETICALLY", value = "true"), + @ExporterOption(name = "SerializationFeature.WRITE_DATES_AS_TIMESTAMPS", value = "false") + }) + public class Template extends Container { + + private static final Logger LOGGER = LoggerFactory.getLogger(Footer.class); + + public static final String RESOURCE_TYPE = "typerefinery/components/layout/template"; + + @Override + @PostConstruct + protected void init() { + super.init(); + } + } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/template/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/.content.json new file mode 100644 index 000000000..28ff87c8a --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/.content.json @@ -0,0 +1,20 @@ +{ + "isContainer": true, + "group": "Typerefinery - Layout", + "isLayout": true, + "allowedComponents": [ + "Typerefinery - Content", + "Typerefinery - Details", + "Typerefinery - Forms", + "Typerefinery - Graphs", + "Typerefinery - Layout", + "Typerefinery - List", + "Typerefinery - Widgets", + "Typerefinery - Widgets - Security", + "Typerefinery - Flow" + ], + "sling:resourceType": "ws:Component", + "description": "Template container to group components into a template tag.", + "title": "Template", + "sling:resourceSuperType": "typerefinery/components/layout/container" +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/template/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/dialog/.content.json new file mode 100644 index 000000000..94e15ccd2 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/dialog/.content.json @@ -0,0 +1,20 @@ +{ + "sling:resourceType": "wcm/dialogs/dialog", + "tabs": { + "sling:resourceType": "wcm/dialogs/components/tabs", + "configTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Config", + "id": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "label": "Id", + "name": "id" + }, + "name": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "label": "Name", + "name": "name" + } + } + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/template/tremplate.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/tremplate.html new file mode 100644 index 000000000..e50fcf4fb --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/tremplate.html @@ -0,0 +1,18 @@ +<!--/* + Copyright (C) 2022 Typerefinery.ai + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<sly data-sly-use.model="${'ai.typerefinery.websight.models.components.layout.Template' @ decorationTagName='div', inheriting=false}" + data-sly-use.template="./variant.html" + data-sly-call="${template.variant @ model=model}"> +</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html new file mode 100644 index 000000000..4e39b348b --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html @@ -0,0 +1,32 @@ +<!--/* + Copyright (C) 2022 Typerefinery.ai + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/--> +<template data-sly-template.variant="${ @ model }"> + <template + data-sly-unwrap="${wcmmode.isEdit}" + component="${model.componentName}" + id="${model.id}" + name="${model.name}" + > + <sly data-sly-test="${resource.hasChildren}"> + <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> + </sly> + <sly data-sly-test="${!resource.hasChildren}"> + <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" + data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> + </sly> + </sly> + </template> +</template> \ No newline at end of file From 8641baf21f5bb65d40d81e8d9e6f47015d8ff28b Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 24 Apr 2024 03:53:14 +1000 Subject: [PATCH 088/206] add template container to accordion. --- .../models/components/layout/Accordion.java | 23 +++++++++++++++++++ .../components/layout/accordion/.content.json | 20 ++++++++-------- .../layout/accordion/accordion.html | 9 +++++++- .../layout/accordion/clientlibs/.content.json | 8 ++++++- .../layout/accordion/clientlibs/behaviour.js | 12 ++++++++++ .../layout/accordion/clientlibs/functions.js | 23 +++++++++++++++++++ .../layout/accordion/clientlibs/style.css | 0 .../layout/accordion/dialog/.content.json | 20 ++++++++++++++++ 8 files changed, 104 insertions(+), 11 deletions(-) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/behaviour.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/style.css diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Accordion.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Accordion.java index 8cb86b5f9..8e3020b75 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Accordion.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Accordion.java @@ -29,6 +29,7 @@ import javax.annotation.PostConstruct; import javax.inject.Inject; import javax.inject.Named; +import javax.jcr.Node; import org.apache.sling.models.annotations.Default; import org.apache.sling.models.annotations.Exporter; @@ -53,10 +54,32 @@ public class Accordion extends BaseComponent { private static final Logger LOGGER = LoggerFactory.getLogger(Accordion.class); public static final String RESOURCE_TYPE = "typerefinery/components/layout/accordion"; + public static final String RESOURCE_TYPE_TEMPLATE = "typerefinery/components/layout/template"; + public static final String NODE_TEMPLATE = "template"; + @Inject + @Getter + public Boolean isTemplated; + @Override @PostConstruct protected void init() { super.init(); + if (isTemplated) { + //if child node template does not exist, create it + Resource template = resource.getChild(NODE_TEMPLATE); + if (template == null) { + LOGGER.info("Creating template node"); + Node resourceNode = resource.adaptTo(Node.class); + try { + Node templateNode = resourceNode.addNode(NODE_TEMPLATE); + templateNode.setProperty("sling:resourceType", RESOURCE_TYPE_TEMPLATE); + resourceNode.getSession().save(); + } catch (Exception e) { + LOGGER.error("Error creating template node", e); + } + } + } + } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/.content.json index d7c1e2d2a..b9ccbe5e4 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/.content.json @@ -1,9 +1,11 @@ -{ - "isContainer": true, - "group": "Typerefinery - Layout", - "sling:resourceType": "ws:Component", - "title": "Accordion", - "isLayout": true, - "allowedComponents": [ - "/apps/typerefinery/components/accordion/accordionitem"] -} +{ + "isContainer": true, + "group": "Typerefinery - Layout", + "sling:resourceType": "ws:Component", + "title": "Accordion", + "isLayout": true, + "allowedComponents": [ + "/apps/typerefinery/components/layout/accordionitem", + "/apps/typerefinery/components/layout/template" + ] +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html index ad5b81f08..713757e13 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html @@ -19,7 +19,14 @@ id="${model.id}" class="${model.componentName} ${model.componentClassNames} ${model.variantClassNames}" data-sly-test="${resource.hasChildren}"> - <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"> + <sly data-sly-repeat.paragraph="${resource.children}"> + <sly data-sly-test="${paragraph.name != 'template'}"> + <sly data-sly-test="${paragraph.resourceType && paragraph['sling:resourceType']}" data-sly-resource="${paragraph.path @ resourceType=paragraph.resourceType}"></sly> + </sly> + <sly data-sly-test="${paragraph.name == 'template' && model.isTemplated}"> + <sly data-sly-test="${paragraph.resourceType && paragraph['sling:resourceType']}" data-sly-resource="${paragraph.path @ resourceType=paragraph.resourceType}"></sly> + <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} - Template</div> + </sly> </sly> </div> <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/.content.json index 33be5ba97..eeb7ca0d9 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/.content.json @@ -3,5 +3,11 @@ "jcr:primaryType": "sling:Folder", "sling:resourceType": "io/typerefinery/websight/clientlibs", "categories": ["ai.typerefinery.websight.components","ai.typerefinery.websight.components.layout.accordion"], - "js": [] + "css": [ + "style.css" + ], + "js": [ + "functions.js", + "behaviour.js" + ] } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/behaviour.js new file mode 100644 index 000000000..32e179c5d --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/behaviour.js @@ -0,0 +1,12 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Layout = Typerefinery.Components.Layout || {}; +window.Typerefinery.Components.Layout.Accordion = Typerefinery.Components.Layout.Accordion || {}; + +(function (ns, componentsNs, document) { + "use strict"; + + //init and watch for new components + // componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(window.Typerefinery.Components.Layout.Accordion, window.Typerefinery.Components, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js new file mode 100644 index 000000000..a748553cd --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -0,0 +1,23 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; +window.Typerefinery.Components.Forms.Button = Typerefinery.Components.Forms.Button || {}; +window.Typerefinery.Modal = Typerefinery.Modal || {}; +window.Typerefinery.Dropdown = Typerefinery.Dropdown || {}; +window.Typerefinery.ToggleComponent = Typerefinery.ToggleComponent || {}; +window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; + +(function (ns, componentNs, modalNs, dropdownNs, toggleComponentNs, themeNs, document, window) { + "use strict"; + + ns.selectorComponent = '[component="accordion"]'; + + ns.addNewItem = ($component) => { + // const $items = $component.querySelector('[component="accordion-items"]'); + // $items.appendChild($item); + } + + ns.init = ($component) => { + const componentConfig = componentNs.getComponentConfig($component); + } +})(Typerefinery.Components.Forms.Button, Typerefinery.Components, Typerefinery.Modal, Typerefinery.Dropdown, Typerefinery.ToggleComponent, window.Typerefinery.Page.Theme, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/style.css b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/style.css new file mode 100644 index 000000000..e69de29bb diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/dialog/.content.json index 77aa2a4eb..993d6af8e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/dialog/.content.json @@ -2,6 +2,26 @@ "sling:resourceType": "wcm/dialogs/dialog", "tabs": { "sling:resourceType": "wcm/dialogs/components/tabs", + "generalTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "General", + "warning": { + "sling:resourceType": "typerefinery/components/dialog/label", + "ws:disallowedContext": ["edit:dialog"], + "appearance": "error", + "iconLabel": "Open Dialog", + "title": "Some fields are not editable in side-panel.", + "message": "Please open this component in dialog to edit these fields.", + "secondaryText": "", + "placement": "bottom-start" + }, + "isTemplated": { + "sling:resourceType": "wcm/dialogs/components/toggle", + "name": "isTemplated", + "label": "Is Templated?", + "description": "Use a template to add new items." + } + }, "eventTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/event" From 9be5090544234f31597de307332a2dccd131cd6d Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 30 Apr 2024 09:16:35 +1000 Subject: [PATCH 089/206] fix dom watch selectors. --- .../content/text/clientlibs/functions.js | 2 +- .../fields/button/clientlibs/functions.js | 2 +- .../fields/select/clientlibs/behaviour.js | 2 +- .../fields/select/clientlibs/functions.js | 83 ++++++++++++------- .../forms/form/clientlibs/functions.js | 2 +- .../layout/accordion/clientlibs/functions.js | 2 +- .../widgets/editor/clientlibs/functions.js | 26 +++--- 7 files changed, 74 insertions(+), 45 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js index b33e88adc..9da576a39 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js @@ -8,7 +8,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; (function (ns, componentNs, eventNs, document, window) { "use strict"; - ns.selectorComponent = '[component="text"]'; + ns.selectorComponent = '[component=text]'; ns.registerEvent = ($component, componentId, fieldName) => { const key = `${componentId}-${fieldName}`; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js index 726b3700f..7de2ea4af 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js @@ -9,7 +9,7 @@ window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; (function (ns, componentNs, modalNs, dropdownNs, toggleComponentNs, themeNs, document, window) { "use strict"; - ns.selectorComponent = '[component="button"]'; + ns.selectorComponent = '[component=button]'; ns.addEventListener = ($component, id) => { $component.addEventListener("click", (e) => { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js index 4358f878b..bc973c398 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js @@ -7,6 +7,6 @@ window.Typerefinery.Components.Forms.Select = Typerefinery.Components.Forms.Sele "use strict"; //init and watch for new components - componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + componentsNs.watchDOMForComponent(`${ns.selectorComponent}${ns.selectorInitNot}`, ns.init); })(window.Typerefinery.Components.Forms.Select, window.Typerefinery.Components, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js index d1b98392d..f95369916 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js @@ -9,7 +9,9 @@ window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components. ;(function (ns, componentNs, selectInstances, window, document) { "use strict"; - ns.selectorComponent = '[component="select"]'; + ns.selectorComponent = '[component=select]'; + ns.selectorInit = '[data-choice]' + ns.selectorInitNot = ':not([data-choice])' ns.getOptionsSelectedAsAnArray = ($component) => { const $selectedOption = $component.querySelector('option[selected]'); @@ -63,31 +65,22 @@ window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components. } }; - ns.addOptionsToSelect = async ($component, componentConfig, defaultSelectedOptions) => { - - if(componentConfig.readOptionsFromDataSource) { - const options = await ns.getOptionsFromDataSource(componentConfig); - console.log(options, 'options') - if(options.length !== 0) { - const selectOptions = options.map((option) => { - return `<option ${ns.isValueSelectedAsDefault(defaultSelectedOptions, option[componentConfig.keyNameInOptionList || 'key'])} value="${option[componentConfig.keyNameInOptionList || 'key']}">${option[componentConfig.labelNameInOptionList || 'label']}</option>` - }); - $component.innerHTML = selectOptions.join(''); - return; - } - - } - - if(componentConfig.selectOptions) { - if(Array.isArray(componentConfig.selectOptions)) { - const selectOptions = componentConfig.selectOptions.map((option) => { - return `<option ${ns.isValueSelectedAsDefault(defaultSelectedOptions, option.value)} value="${option.value}">${option.label}</option>` - }); - $component.innerHTML = selectOptions.join(''); - } else { - throw new Error('componentConfig.selectOptions is not an array'); - } - } + ns.addOptionsToSelect = ($component, defaultSelectedOptions, optionsList, keyName, labelName) => { + console.log('options from data source', optionsList); + if(optionsList.length !== 0) { + const selectOptions = optionsList.map((option) => { + console.log(option); + var html = `<option ${ns.isValueSelectedAsDefault(defaultSelectedOptions, option[keyName || 'key'])} value="${option[keyName || 'key']}">${option[labelName || 'label']}</option>`; + console.log(html); + return html; + }); + var optionsHTML = selectOptions.join(''); + console.log(optionsHTML) + $component.html(optionsHTML); + return; + } else { + console.log("optionsList is empty"); + } }; // public methods to interact with the select component instances @@ -116,21 +109,51 @@ window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components. } ns.init = async ($component) => { + console.group("select init"); const componentConfig = componentNs.getComponentConfig($component); if(componentConfig.multipleSelection) { $component.setAttribute('multiple', 'true'); } + + console.log("componentConfig.id",componentConfig.id); + console.log("component select",$component.get(0)); + + console.log("loading options"); + const defaultSelectedOptions = ns.getDefaultOptionsSelected(componentConfig.defaultSelectedOptions); - await ns.addOptionsToSelect($component, componentConfig, defaultSelectedOptions); - + if(componentConfig.readOptionsFromDataSource) { + console.log("loading options from data source"); + var optionsList = await ns.getOptionsFromDataSource(componentConfig); + console.log("data source list", optionsList); + ns.addOptionsToSelect($component, defaultSelectedOptions, optionsList, componentConfig.keyNameInOptionList, componentConfig.keyNameInOptionList, componentConfig.labelNameInOptionList); + console.log($component.html()); + } else { + console.log("loading options from config"); + if(componentConfig.selectOptions && Array.isArray(componentConfig.selectOptions)) { + console.log("config options list", componentConfig.selectOptions) + ns.addOptionsToSelect($component, defaultSelectedOptions, componentConfig.selectOptions, "value", "label"); + } + } + console.log("loaded options"); - selectInstances[componentConfig.id] = new Choices($component, { + console.log("init choices"); + + selectInstances[componentConfig.id] = new Choices($component.get(0), { removeItemButton: true, maxItemCount: componentConfig.maxSelection || -1, - labelId: componentConfig.id + allowHTML: false, + shouldSort: true, + loadingText: 'Loading...', + itemSelectText: 'Press to select', + uniqueItemText: 'Only unique values can be added', + addItemText: (value) => { + return `Press Enter to add <b>"${value}"</b>`; + }, }); + + console.groupEnd(); } })(Typerefinery.Components.Forms.Select, Typerefinery.Components, Typerefinery.Components.Forms.Select.Instances, window, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index aabfb48c8..0d23ad2f5 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -13,7 +13,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; (function ($, ns, componentNs, editorNs, selectNs, compositeNs, eventNs, filesNs, document, window) { "use strict"; - ns.selectorComponent = '[component="form"]'; + ns.selectorComponent = '[component=form]'; ns.selectorInputAttribute = "isInput"; ns.selectorInput = `[${ns.selectorInputAttribute}]`; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index a748553cd..1e370ceb8 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -10,7 +10,7 @@ window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; (function (ns, componentNs, modalNs, dropdownNs, toggleComponentNs, themeNs, document, window) { "use strict"; - ns.selectorComponent = '[component="accordion"]'; + ns.selectorComponent = '[component=accordion]'; ns.addNewItem = ($component) => { // const $items = $component.querySelector('[component="accordion-items"]'); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js index 88a6b7849..f2926d94b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js @@ -9,7 +9,7 @@ window.Typerefinery.Components.Widgets.Editor.Instances = Typerefinery.Component (function (ns, componentNs, editorInstanceNs, document, window) { "use strict"; - ns.selectorComponent = '[component="editor"]'; + ns.selectorComponent = '[component=editor]'; ns.getCodeEditorTheme = (editor, theme) => { switch (editor) { @@ -111,8 +111,8 @@ window.Typerefinery.Components.Widgets.Editor.Instances = Typerefinery.Component ns.createCodeMirrorEditor = ($component, componentConfig) => { editorInstanceNs[componentConfig.id] = new CodeMirror( - (node) => { - $component.parentNode.replaceChild(node, $component); + (node) => { + $component.replaceWith(node); node.setAttribute('id', componentConfig.id); node.setAttribute('component', 'editor'); node.setAttribute('data-model', JSON.stringify(componentConfig)); @@ -215,14 +215,20 @@ window.Typerefinery.Components.Widgets.Editor.Instances = Typerefinery.Component } ns.init = ($component) => { - // parse json value from data-model attribute as component config - const componentConfig = componentNs.getComponentConfig($component); - if (componentConfig.variant === "CODE_EDITOR") { - ns.createCodeEditor($component, componentConfig); - } else if (componentConfig.variant === "TEXT_EDITOR") { - ns.createTextEditor($component, componentConfig); - } + console.group("Editor init"); + console.log($component); + // parse json value from data-model attribute as component config + const componentConfig = componentNs.getComponentConfig($component); + + console.log(componentConfig.variant); + + if (componentConfig.variant === "CODE_EDITOR") { + ns.createCodeEditor($component, componentConfig); + } else if (componentConfig.variant === "TEXT_EDITOR") { + ns.createTextEditor($component, componentConfig); + } + console.groupEnd(); } From 88f5bf0ab624377ef7548c02a1a54f45ed82251f Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 30 Apr 2024 09:17:02 +1000 Subject: [PATCH 090/206] add latest version of choicehjs vendor lib. --- .../static/clientlibs/vendor/select/script.js | 69 +-- .../static/clientlibs/vendor/select/style.css | 481 +++++++++--------- 2 files changed, 229 insertions(+), 321 deletions(-) diff --git a/application/frontend/src/static/clientlibs/vendor/select/script.js b/application/frontend/src/static/clientlibs/vendor/select/script.js index 7fff8e214..af280949e 100644 --- a/application/frontend/src/static/clientlibs/vendor/select/script.js +++ b/application/frontend/src/static/clientlibs/vendor/select/script.js @@ -1,67 +1,2 @@ -/*! choices.js v7.0.0 | (c) 2019 Josh Johnson | https://github.com/jshjohnson/Choices#readme */ -!function (e, t) { "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.Choices = t() : e.Choices = t() }(window, function () { - return function (e) { var t = {}; function i(n) { if (t[n]) return t[n].exports; var o = t[n] = { i: n, l: !1, exports: {} }; return e[n].call(o.exports, o, o.exports, i), o.l = !0, o.exports } return i.m = e, i.c = t, i.d = function (e, t, n) { i.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: n }) }, i.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }) }, i.t = function (e, t) { if (1 & t && (e = i(e)), 8 & t) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var n = Object.create(null); if (i.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) for (var o in e) i.d(n, o, function (t) { return e[t] }.bind(null, o)); return n }, i.n = function (e) { var t = e && e.__esModule ? function () { return e.default } : function () { return e }; return i.d(t, "a", t), t }, i.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t) }, i.p = "/public/assets/scripts/", i(i.s = 9) }([function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.diff = t.cloneObject = t.existsInArray = t.isIE11 = t.fetchFromObject = t.getWindowHeight = t.dispatchEvent = t.sortByScore = t.sortByAlpha = t.calcWidthOfInput = t.strToEl = t.sanitise = t.isScrolledIntoView = t.getAdjacentEl = t.findAncestorByAttrName = t.wrap = t.isElement = t.isType = t.getType = t.generateId = t.generateChars = t.getRandomNumber = void 0; var n = function (e, t) { return Math.floor(Math.random() * (t - e) + e) }; t.getRandomNumber = n; var o = function (e) { for (var t = "", i = 0; i < e; i++) { t += n(0, 36).toString(36) } return t }; t.generateChars = o; t.generateId = function (e, t) { var i = e.id || e.name && "".concat(e.name, "-").concat(o(2)) || o(4); return i = i.replace(/(:|\.|\[|\]|,)/g, ""), i = "".concat(t, "-").concat(i) }; var r = function (e) { return Object.prototype.toString.call(e).slice(8, -1) }; t.getType = r; var s = function (e, t) { return null != t && r(t) === e }; t.isType = s; t.isElement = function (e) { return e instanceof Element }; t.wrap = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : document.createElement("div"); return e.nextSibling ? e.parentNode.insertBefore(t, e.nextSibling) : e.parentNode.appendChild(t), t.appendChild(e) }; t.findAncestorByAttrName = function (e, t) { for (var i = e; i;) { if (i.hasAttribute(t)) return i; i = i.parentElement } return null }; t.getAdjacentEl = function (e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1; if (e && t) { var n = e.parentNode.parentNode, o = Array.from(n.querySelectorAll(t)), r = o.indexOf(e); return o[r + (i > 0 ? 1 : -1)] } }; t.isScrolledIntoView = function (e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1; if (e) return i > 0 ? t.scrollTop + t.offsetHeight >= e.offsetTop + e.offsetHeight : e.offsetTop >= t.scrollTop }; var a = function (e) { return s("String", e) ? e.replace(/&/g, "&").replace(/>/g, "&rt;").replace(/</g, "<").replace(/"/g, """) : e }; t.sanitise = a; var c, l = (c = document.createElement("div"), function (e) { var t = e.trim(); c.innerHTML = t; for (var i = c.children[0]; c.firstChild;)c.removeChild(c.firstChild); return i }); t.strToEl = l; t.calcWidthOfInput = function (e, t) { var i = e.value || e.placeholder, n = e.offsetWidth; if (i) { var o = l("<span>".concat(a(i), "</span>")); if (o.style.position = "absolute", o.style.padding = "0", o.style.top = "-9999px", o.style.left = "-9999px", o.style.width = "auto", o.style.whiteSpace = "pre", document.body.contains(e) && window.getComputedStyle) { var r = window.getComputedStyle(e); r && (o.style.fontSize = r.fontSize, o.style.fontFamily = r.fontFamily, o.style.fontWeight = r.fontWeight, o.style.fontStyle = r.fontStyle, o.style.letterSpacing = r.letterSpacing, o.style.textTransform = r.textTransform, o.style.padding = r.padding) } document.body.appendChild(o), requestAnimationFrame(function () { i && o.offsetWidth !== e.offsetWidth && (n = o.offsetWidth + 4), document.body.removeChild(o), t.call(void 0, "".concat(n, "px")) }) } else t.call(void 0, "".concat(n, "px")) }; t.sortByAlpha = function (e, t) { var i = "".concat(e.label || e.value).toLowerCase(), n = "".concat(t.label || t.value).toLowerCase(); return i < n ? -1 : i > n ? 1 : 0 }; t.sortByScore = function (e, t) { return e.score - t.score }; t.dispatchEvent = function (e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, n = new CustomEvent(t, { detail: i, bubbles: !0, cancelable: !0 }); return e.dispatchEvent(n) }; t.getWindowHeight = function () { var e = document.body, t = document.documentElement; return Math.max(e.scrollHeight, e.offsetHeight, t.clientHeight, t.scrollHeight, t.offsetHeight) }; t.fetchFromObject = function e(t, i) { var n = i.indexOf("."); return n > -1 ? e(t[i.substring(0, n)], i.substr(n + 1)) : t[i] }; t.isIE11 = function () { return !(!navigator.userAgent.match(/Trident/) || !navigator.userAgent.match(/rv[ :]11/)) }; t.existsInArray = function (e, t) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "value"; return e.some(function (e) { return s("String", t) ? e[i] === t.trim() : e[i] === t }) }; t.cloneObject = function (e) { return JSON.parse(JSON.stringify(e)) }; t.diff = function (e, t) { var i = Object.keys(e).sort(), n = Object.keys(t).sort(); return i.filter(function (e) { return n.indexOf(e) < 0 }) } }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.SCROLLING_SPEED = t.KEY_CODES = t.ACTION_TYPES = t.EVENTS = t.DEFAULT_CONFIG = t.DEFAULT_CLASSNAMES = void 0; var n = i(0), o = { containerOuter: "choices", containerInner: "choices__inner", input: "choices__input", inputCloned: "choices__input--cloned", list: "choices__list", listItems: "choices__list--multiple", listSingle: "choices__list--single", listDropdown: "choices__list--dropdown", item: "choices__item", itemSelectable: "choices__item--selectable", itemDisabled: "choices__item--disabled", itemChoice: "choices__item--choice", placeholder: "choices__placeholder", group: "choices__group", groupHeading: "choices__heading", button: "choices__button", activeState: "is-active", focusState: "is-focused", openState: "is-open", disabledState: "is-disabled", highlightedState: "is-highlighted", hiddenState: "is-hidden", flippedState: "is-flipped", loadingState: "is-loading", noResults: "has-no-results", noChoices: "has-no-choices" }; t.DEFAULT_CLASSNAMES = o; var r = { items: [], choices: [], silent: !1, renderChoiceLimit: -1, maxItemCount: -1, addItems: !0, addItemFilterFn: null, removeItems: !0, removeItemButton: !1, editItems: !1, duplicateItemsAllowed: !0, delimiter: ",", paste: !0, searchEnabled: !0, searchChoices: !0, searchFloor: 1, searchResultLimit: 4, searchFields: ["label", "value"], position: "auto", resetScrollPosition: !0, shouldSort: !0, shouldSortItems: !1, sortFn: n.sortByAlpha, placeholder: !0, placeholderValue: null, searchPlaceholderValue: null, prependValue: null, appendValue: null, renderSelectedChoices: "auto", loadingText: "Loading...", noResultsText: "No results found", noChoicesText: "No choices to choose from", itemSelectText: "Press to select", uniqueItemText: "Only unique values can be added", customAddItemText: "Only values matching specific conditions can be added", addItemText: function (e) { return 'Press Enter to add <b>"'.concat((0, n.sanitise)(e), '"</b>') }, maxItemText: function (e) { return "Only ".concat(e, " values can be added") }, itemComparer: function (e, t) { return e === t }, fuseOptions: { includeScore: !0 }, callbackOnInit: null, callbackOnCreateTemplates: null, classNames: o }; t.DEFAULT_CONFIG = r; t.EVENTS = { showDropdown: "showDropdown", hideDropdown: "hideDropdown", change: "change", choice: "choice", search: "search", addItem: "addItem", removeItem: "removeItem", highlightItem: "highlightItem", highlightChoice: "highlightChoice" }; t.ACTION_TYPES = { ADD_CHOICE: "ADD_CHOICE", FILTER_CHOICES: "FILTER_CHOICES", ACTIVATE_CHOICES: "ACTIVATE_CHOICES", CLEAR_CHOICES: "CLEAR_CHOICES", ADD_GROUP: "ADD_GROUP", ADD_ITEM: "ADD_ITEM", REMOVE_ITEM: "REMOVE_ITEM", HIGHLIGHT_ITEM: "HIGHLIGHT_ITEM", CLEAR_ALL: "CLEAR_ALL" }; t.KEY_CODES = { BACK_KEY: 46, DELETE_KEY: 8, ENTER_KEY: 13, A_KEY: 65, ESC_KEY: 27, UP_KEY: 38, DOWN_KEY: 40, PAGE_UP_KEY: 33, PAGE_DOWN_KEY: 34 }; t.SCROLLING_SPEED = 4 }, function (e, t, i) { "use strict"; (function (e, n) { var o, r = i(7); o = "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== e ? e : n; var s = Object(r.a)(o); t.a = s }).call(this, i(3), i(14)(e)) }, function (e, t) { var i; i = function () { return this }(); try { i = i || new Function("return this")() } catch (e) { "object" == typeof window && (i = window) } e.exports = i }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = void 0; var n = i(0); function o(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } var r = function () { function e(t) { var i = t.element, o = t.classNames; if (function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, e), Object.assign(this, { element: i, classNames: o }), !(0, n.isElement)(i)) throw new TypeError("Invalid element passed"); this.isDisabled = !1 } var t, i, r; return t = e, (i = [{ key: "conceal", value: function () { this.element.classList.add(this.classNames.input), this.element.classList.add(this.classNames.hiddenState), this.element.tabIndex = "-1"; var e = this.element.getAttribute("style"); e && this.element.setAttribute("data-choice-orig-style", e), this.element.setAttribute("aria-hidden", "true"), this.element.setAttribute("data-choice", "active") } }, { key: "reveal", value: function () { this.element.classList.remove(this.classNames.input), this.element.classList.remove(this.classNames.hiddenState), this.element.removeAttribute("tabindex"); var e = this.element.getAttribute("data-choice-orig-style"); e ? (this.element.removeAttribute("data-choice-orig-style"), this.element.setAttribute("style", e)) : this.element.removeAttribute("style"), this.element.removeAttribute("aria-hidden"), this.element.removeAttribute("data-choice"), this.element.value = this.element.value } }, { key: "enable", value: function () { this.element.removeAttribute("disabled"), this.element.disabled = !1, this.isDisabled = !1 } }, { key: "disable", value: function () { this.element.setAttribute("disabled", ""), this.element.disabled = !0, this.isDisabled = !0 } }, { key: "triggerEvent", value: function (e, t) { (0, n.dispatchEvent)(this.element, e, t) } }, { key: "value", get: function () { return this.element.value } }]) && o(t.prototype, i), r && o(t, r), e }(); t.default = r }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = t.TEMPLATES = void 0; var n, o = (n = i(27)) && n.__esModule ? n : { default: n }, r = i(0); function s(e, t, i) { return t in e ? Object.defineProperty(e, t, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = i, e } var a = { containerOuter: function (e, t, i, n, o, s) { var a = n ? 'tabindex="0"' : "", c = i ? 'role="listbox"' : "", l = ""; return i && o && (c = 'role="combobox"', l = 'aria-autocomplete="list"'), (0, r.strToEl)('\n <div\n class="'.concat(e.containerOuter, '"\n data-type="').concat(s, '"\n ').concat(c, "\n ").concat(a, "\n ").concat(l, '\n aria-haspopup="true"\n aria-expanded="false"\n dir="').concat(t, '"\n >\n </div>\n ')) }, containerInner: function (e) { return (0, r.strToEl)('\n <div class="'.concat(e.containerInner, '"></div>\n ')) }, itemList: function (e, t) { var i, n = (0, o.default)(e.list, (s(i = {}, e.listSingle, t), s(i, e.listItems, !t), i)); return (0, r.strToEl)('\n <div class="'.concat(n, '"></div>\n ')) }, placeholder: function (e, t) { return (0, r.strToEl)('\n <div class="'.concat(e.placeholder, '">\n ').concat(t, "\n </div>\n ")) }, item: function (e, t, i) { var n, a, c = t.active ? 'aria-selected="true"' : "", l = t.disabled ? 'aria-disabled="true"' : "", u = (0, o.default)(e.item, (s(n = {}, e.highlightedState, t.highlighted), s(n, e.itemSelectable, !t.highlighted), s(n, e.placeholder, t.placeholder), n)); return i ? (u = (0, o.default)(e.item, (s(a = {}, e.highlightedState, t.highlighted), s(a, e.itemSelectable, !t.disabled), s(a, e.placeholder, t.placeholder), a)), (0, r.strToEl)('\n <div\n class="'.concat(u, '"\n data-item\n data-id="').concat(t.id, '"\n data-value="').concat(t.value, "\"\n data-custom-properties='").concat(t.customProperties, "'\n data-deletable\n ").concat(c, "\n ").concat(l, "\n >\n ").concat(t.label, '\x3c!--\n --\x3e<button\n type="button"\n class="').concat(e.button, '"\n data-button\n aria-label="Remove item: \'').concat(t.value, "'\"\n >\n Remove item\n </button>\n </div>\n "))) : (0, r.strToEl)('\n <div\n class="'.concat(u, '"\n data-item\n data-id="').concat(t.id, '"\n data-value="').concat(t.value, '"\n ').concat(c, "\n ").concat(l, "\n >\n ").concat(t.label, "\n </div>\n ")) }, choiceList: function (e, t) { var i = t ? "" : 'aria-multiselectable="true"'; return (0, r.strToEl)('\n <div\n class="'.concat(e.list, '"\n dir="ltr"\n role="listbox"\n ').concat(i, "\n >\n </div>\n ")) }, choiceGroup: function (e, t) { var i = t.disabled ? 'aria-disabled="true"' : "", n = (0, o.default)(e.group, s({}, e.itemDisabled, t.disabled)); return (0, r.strToEl)('\n <div\n class="'.concat(n, '"\n data-group\n data-id="').concat(t.id, '"\n data-value="').concat(t.value, '"\n role="group"\n ').concat(i, '\n >\n <div class="').concat(e.groupHeading, '">').concat(t.value, "</div>\n </div>\n ")) }, choice: function (e, t, i) { var n, a = t.groupId > 0 ? 'role="treeitem"' : 'role="option"', c = (0, o.default)(e.item, e.itemChoice, (s(n = {}, e.itemDisabled, t.disabled), s(n, e.itemSelectable, !t.disabled), s(n, e.placeholder, t.placeholder), n)); return (0, r.strToEl)('\n <div\n class="'.concat(c, '"\n data-select-text="').concat(i, '"\n data-choice\n data-id="').concat(t.id, '"\n data-value="').concat(t.value, '"\n ').concat(t.disabled ? 'data-choice-disabled aria-disabled="true"' : "data-choice-selectable", '\n id="').concat(t.elementId, '"\n ').concat(a, "\n >\n ").concat(t.label, "\n </div>\n ")) }, input: function (e) { var t = (0, o.default)(e.input, e.inputCloned); return (0, r.strToEl)('\n <input\n type="text"\n class="'.concat(t, '"\n autocomplete="off"\n autocapitalize="off"\n spellcheck="false"\n role="textbox"\n aria-autocomplete="list"\n >\n ')) }, dropdown: function (e) { var t = (0, o.default)(e.list, e.listDropdown); return (0, r.strToEl)('\n <div\n class="'.concat(t, '"\n aria-expanded="false"\n >\n </div>\n ')) }, notice: function (e, t) { var i, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "", a = (0, o.default)(e.item, e.itemChoice, (s(i = {}, e.noResults, "no-results" === n), s(i, e.noChoices, "no-choices" === n), i)); return (0, r.strToEl)('\n <div class="'.concat(a, '">\n ').concat(t, "\n </div>\n ")) }, option: function (e) { return (0, r.strToEl)('\n <option value="'.concat(e.value, '" ').concat(e.active ? "selected" : "", " ").concat(e.disabled ? "disabled" : "", " ").concat(e.customProperties ? "data-custom-properties=".concat(e.customProperties) : "", ">").concat(e.label, "</option>\n ")) } }; t.TEMPLATES = a; var c = a; t.default = c }, function (e, t, i) { "use strict"; i.r(t); var n = i(8), o = "object" == typeof self && self && self.Object === Object && self, r = (n.a || o || Function("return this")()).Symbol, s = Object.prototype, a = s.hasOwnProperty, c = s.toString, l = r ? r.toStringTag : void 0; var u = function (e) { var t = a.call(e, l), i = e[l]; try { e[l] = void 0; var n = !0 } catch (e) { } var o = c.call(e); return n && (t ? e[l] = i : delete e[l]), o }, h = Object.prototype.toString; var d = function (e) { return h.call(e) }, f = "[object Null]", p = "[object Undefined]", v = r ? r.toStringTag : void 0; var m = function (e) { return null == e ? void 0 === e ? p : f : v && v in Object(e) ? u(e) : d(e) }; var g = function (e, t) { return function (i) { return e(t(i)) } }(Object.getPrototypeOf, Object); var _ = function (e) { return null != e && "object" == typeof e }, y = "[object Object]", b = Function.prototype, E = Object.prototype, S = b.toString, I = E.hasOwnProperty, O = S.call(Object); var C = function (e) { if (!_(e) || m(e) != y) return !1; var t = g(e); if (null === t) return !0; var i = I.call(t, "constructor") && t.constructor; return "function" == typeof i && i instanceof i && S.call(i) == O }, T = i(2), w = { INIT: "@@redux/INIT" }; function k(e, t, i) { var n; if ("function" == typeof t && void 0 === i && (i = t, t = void 0), void 0 !== i) { if ("function" != typeof i) throw new Error("Expected the enhancer to be a function."); return i(k)(e, t) } if ("function" != typeof e) throw new Error("Expected the reducer to be a function."); var o = e, r = t, s = [], a = s, c = !1; function l() { a === s && (a = s.slice()) } function u() { return r } function h(e) { if ("function" != typeof e) throw new Error("Expected listener to be a function."); var t = !0; return l(), a.push(e), function () { if (t) { t = !1, l(); var i = a.indexOf(e); a.splice(i, 1) } } } function d(e) { if (!C(e)) throw new Error("Actions must be plain objects. Use custom middleware for async actions."); if (void 0 === e.type) throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?'); if (c) throw new Error("Reducers may not dispatch actions."); try { c = !0, r = o(r, e) } finally { c = !1 } for (var t = s = a, i = 0; i < t.length; i++) { (0, t[i])() } return e } return d({ type: w.INIT }), (n = { dispatch: d, subscribe: h, getState: u, replaceReducer: function (e) { if ("function" != typeof e) throw new Error("Expected the nextReducer to be a function."); o = e, d({ type: w.INIT }) } })[T.a] = function () { var e, t = h; return (e = { subscribe: function (e) { if ("object" != typeof e) throw new TypeError("Expected the observer to be an object."); function i() { e.next && e.next(u()) } return i(), { unsubscribe: t(i) } } })[T.a] = function () { return this }, e }, n } function A(e, t) { var i = t && t.type; return "Given action " + (i && '"' + i.toString() + '"' || "an action") + ', reducer "' + e + '" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.' } function L(e) { for (var t = Object.keys(e), i = {}, n = 0; n < t.length; n++) { var o = t[n]; 0, "function" == typeof e[o] && (i[o] = e[o]) } var r = Object.keys(i); var s = void 0; try { !function (e) { Object.keys(e).forEach(function (t) { var i = e[t]; if (void 0 === i(void 0, { type: w.INIT })) throw new Error('Reducer "' + t + "\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined."); if (void 0 === i(void 0, { type: "@@redux/PROBE_UNKNOWN_ACTION_" + Math.random().toString(36).substring(7).split("").join(".") })) throw new Error('Reducer "' + t + "\" returned undefined when probed with a random type. Don't try to handle " + w.INIT + ' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.') }) }(i) } catch (e) { s = e } return function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = arguments[1]; if (s) throw s; for (var n = !1, o = {}, a = 0; a < r.length; a++) { var c = r[a], l = i[c], u = e[c], h = l(u, t); if (void 0 === h) { var d = A(c, t); throw new Error(d) } o[c] = h, n = n || h !== u } return n ? o : e } } function x(e, t) { return function () { return t(e.apply(void 0, arguments)) } } function P(e, t) { if ("function" == typeof e) return x(e, t); if ("object" != typeof e || null === e) throw new Error("bindActionCreators expected an object or a function, instead received " + (null === e ? "null" : typeof e) + '. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?'); for (var i = Object.keys(e), n = {}, o = 0; o < i.length; o++) { var r = i[o], s = e[r]; "function" == typeof s && (n[r] = x(s, t)) } return n } function D() { for (var e = arguments.length, t = Array(e), i = 0; i < e; i++)t[i] = arguments[i]; return 0 === t.length ? function (e) { return e } : 1 === t.length ? t[0] : t.reduce(function (e, t) { return function () { return e(t.apply(void 0, arguments)) } }) } var j = Object.assign || function (e) { for (var t = 1; t < arguments.length; t++) { var i = arguments[t]; for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && (e[n] = i[n]) } return e }; function M() { for (var e = arguments.length, t = Array(e), i = 0; i < e; i++)t[i] = arguments[i]; return function (e) { return function (i, n, o) { var r, s = e(i, n, o), a = s.dispatch, c = { getState: s.getState, dispatch: function (e) { return a(e) } }; return r = t.map(function (e) { return e(c) }), a = D.apply(void 0, r)(s.dispatch), j({}, s, { dispatch: a }) } } } i.d(t, "createStore", function () { return k }), i.d(t, "combineReducers", function () { return L }), i.d(t, "bindActionCreators", function () { return P }), i.d(t, "applyMiddleware", function () { return M }), i.d(t, "compose", function () { return D }) }, function (e, t, i) { "use strict"; function n(e) { var t, i = e.Symbol; return "function" == typeof i ? i.observable ? t = i.observable : (t = i("observable"), i.observable = t) : t = "@@observable", t } i.d(t, "a", function () { return n }) }, function (e, t, i) { "use strict"; (function (e) { var i = "object" == typeof e && e && e.Object === Object && e; t.a = i }).call(this, i(3)) }, function (e, t, i) { e.exports = i(10) }, function (e, t, i) { "use strict"; var n = v(i(11)), o = v(i(12)), r = v(i(13)), s = i(20), a = i(1), c = i(5), l = i(28), u = i(29), h = i(30), d = i(31), f = i(32), p = i(0); function v(e) { return e && e.__esModule ? e : { default: e } } function m(e, t, i) { return t in e ? Object.defineProperty(e, t, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = i, e } function g(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } var _ = function () { function e() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "[data-choice]", i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, e), (0, p.isType)("String", t)) { var n = Array.from(document.querySelectorAll(t)); if (n.length > 1) return this._generateInstances(n, i) } this.config = o.default.all([a.DEFAULT_CONFIG, e.userDefaults, i], { arrayMerge: function (e, t) { return [].concat(t) } }); var c = (0, p.diff)(this.config, a.DEFAULT_CONFIG); c.length && console.warn("Unknown config option(s) passed", c.join(", ")), ["auto", "always"].includes(this.config.renderSelectedChoices) || (this.config.renderSelectedChoices = "auto"); var l = (0, p.isType)("String", t) ? document.querySelector(t) : t; return l ? (this._isTextElement = "text" === l.type, this._isSelectOneElement = "select-one" === l.type, this._isSelectMultipleElement = "select-multiple" === l.type, this._isSelectElement = this._isSelectOneElement || this._isSelectMultipleElement, this._isTextElement ? this.passedElement = new s.WrappedInput({ element: l, classNames: this.config.classNames, delimiter: this.config.delimiter }) : this._isSelectElement && (this.passedElement = new s.WrappedSelect({ element: l, classNames: this.config.classNames })), this.passedElement ? (!0 === this.config.shouldSortItems && this._isSelectOneElement && !this.config.silent && console.warn("shouldSortElements: Type of passed element is 'select-one', falling back to false."), this.initialised = !1, this._store = new r.default(this.render), this._initialState = {}, this._currentState = {}, this._prevState = {}, this._currentValue = "", this._canSearch = this.config.searchEnabled, this._isScrollingOnIe = !1, this._highlightPosition = 0, this._wasTap = !0, this._placeholderValue = this._generatePlaceholderValue(), this._baseId = (0, p.generateId)(this.passedElement.element, "choices-"), this._direction = this.passedElement.element.getAttribute("dir") || "ltr", this._idNames = { itemChoice: "item-choice" }, this._presetChoices = this.config.choices, this._presetItems = this.config.items, this.passedElement.value && (this._presetItems = this._presetItems.concat(this.passedElement.value.split(this.config.delimiter))), this._render = this._render.bind(this), this._onFocus = this._onFocus.bind(this), this._onBlur = this._onBlur.bind(this), this._onKeyUp = this._onKeyUp.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onClick = this._onClick.bind(this), this._onTouchMove = this._onTouchMove.bind(this), this._onTouchEnd = this._onTouchEnd.bind(this), this._onMouseDown = this._onMouseDown.bind(this), this._onMouseOver = this._onMouseOver.bind(this), this._onFormReset = this._onFormReset.bind(this), this._onAKey = this._onAKey.bind(this), this._onEnterKey = this._onEnterKey.bind(this), this._onEscapeKey = this._onEscapeKey.bind(this), this._onDirectionKey = this._onDirectionKey.bind(this), this._onDeleteKey = this._onDeleteKey.bind(this), "active" === this.passedElement.element.getAttribute("data-choice") && console.warn("Trying to initialise Choices on element already initialised"), void this.init()) : console.error("Passed element was of an invalid type")) : console.error("Could not find passed element or passed element was of an invalid type") } var t, i, v; return t = e, (i = [{ key: "init", value: function () { if (!this.initialised) { this._createTemplates(), this._createElements(), this._createStructure(), this._initialState = (0, p.cloneObject)(this._store.state), this._store.subscribe(this._render), this._render(), this._addEventListeners(), (!this.config.addItems || this.passedElement.element.hasAttribute("disabled")) && this.disable(), this.initialised = !0; var e = this.config.callbackOnInit; e && (0, p.isType)("Function", e) && e.call(this) } } }, { key: "destroy", value: function () { this.initialised && (this._removeEventListeners(), this.passedElement.reveal(), this.containerOuter.unwrap(this.passedElement.element), this._isSelectElement && (this.passedElement.options = this._presetChoices), this.clearStore(), this.config.templates = null, this.initialised = !1) } }, { key: "enable", value: function () { return this.passedElement.isDisabled && this.passedElement.enable(), this.containerOuter.isDisabled && (this._addEventListeners(), this.input.enable(), this.containerOuter.enable()), this } }, { key: "disable", value: function () { return this.passedElement.isDisabled || this.passedElement.disable(), this.containerOuter.isDisabled || (this._removeEventListeners(), this.input.disable(), this.containerOuter.disable()), this } }, { key: "highlightItem", value: function (e) { var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; if (!e) return this; var i = e.id, n = e.groupId, o = void 0 === n ? -1 : n, r = e.value, s = void 0 === r ? "" : r, c = e.label, l = void 0 === c ? "" : c, h = o >= 0 ? this._store.getGroupById(o) : null; return this._store.dispatch((0, u.highlightItem)(i, !0)), t && this.passedElement.triggerEvent(a.EVENTS.highlightItem, { id: i, value: s, label: l, groupValue: h && h.value ? h.value : null }), this } }, { key: "unhighlightItem", value: function (e) { if (!e) return this; var t = e.id, i = e.groupId, n = void 0 === i ? -1 : i, o = e.value, r = void 0 === o ? "" : o, s = e.label, c = void 0 === s ? "" : s, l = n >= 0 ? this._store.getGroupById(n) : null; return this._store.dispatch((0, u.highlightItem)(t, !1)), this.passedElement.triggerEvent(a.EVENTS.highlightItem, { id: t, value: r, label: c, groupValue: l && l.value ? l.value : null }), this } }, { key: "highlightAll", value: function () { var e = this; return this._store.items.forEach(function (t) { return e.highlightItem(t) }), this } }, { key: "unhighlightAll", value: function () { var e = this; return this._store.items.forEach(function (t) { return e.unhighlightItem(t) }), this } }, { key: "removeActiveItemsByValue", value: function (e) { var t = this; return this._store.activeItems.filter(function (t) { return t.value === e }).forEach(function (e) { return t._removeItem(e) }), this } }, { key: "removeActiveItems", value: function (e) { var t = this; return this._store.activeItems.filter(function (t) { return t.id !== e }).forEach(function (e) { return t._removeItem(e) }), this } }, { key: "removeHighlightedItems", value: function () { var e = this, t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; return this._store.highlightedActiveItems.forEach(function (i) { e._removeItem(i), t && e._triggerChange(i.value) }), this } }, { key: "showDropdown", value: function (e) { var t = this; return this.dropdown.isActive ? this : (requestAnimationFrame(function () { t.dropdown.show(), t.containerOuter.open(t.dropdown.distanceFromTopWindow()), !e && t._canSearch && t.input.focus(), t.passedElement.triggerEvent(a.EVENTS.showDropdown, {}) }), this) } }, { key: "hideDropdown", value: function (e) { var t = this; return this.dropdown.isActive ? (requestAnimationFrame(function () { t.dropdown.hide(), t.containerOuter.close(), !e && t._canSearch && (t.input.removeActiveDescendant(), t.input.blur()), t.passedElement.triggerEvent(a.EVENTS.hideDropdown, {}) }), this) : this } }, { key: "getValue", value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = this._store.activeItems.reduce(function (t, i) { var n = e ? i.value : i; return t.push(n), t }, []); return this._isSelectOneElement ? t[0] : t } }, { key: "setValue", value: function (e) { var t = this; return this.initialised ? ([].concat(e).forEach(function (e) { return t._setChoiceOrItem(e) }), this) : this } }, { key: "setChoiceByValue", value: function (e) { var t = this; return !this.initialised || this._isTextElement ? this : (((0, p.isType)("Array", e) ? e : [e]).forEach(function (e) { return t._findAndSelectChoiceByValue(e) }), this) } }, { key: "setChoices", value: function () { var e = this, t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "", n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "", o = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]; if (!this._isSelectElement || !i) return this; o && this.clearChoices(), this.containerOuter.removeLoadingState(); return this._setLoading(!0), t.forEach(function (t) { t.choices ? e._addGroup({ group: t, id: t.id || null, valueKey: i, labelKey: n }) : e._addChoice({ value: t[i], label: t[n], isSelected: t.selected, isDisabled: t.disabled, customProperties: t.customProperties, placeholder: t.placeholder }) }), this._setLoading(!1), this } }, { key: "clearChoices", value: function () { this._store.dispatch((0, l.clearChoices)()) } }, { key: "clearStore", value: function () { return this._store.dispatch((0, d.clearAll)()), this } }, { key: "clearInput", value: function () { var e = !this._isSelectOneElement; return this.input.clear(e), !this._isTextElement && this._canSearch && (this._isSearching = !1, this._store.dispatch((0, l.activateChoices)(!0))), this } }, { key: "ajax", value: function (e) { var t = this; return this.initialised && this._isSelectElement && e ? (requestAnimationFrame(function () { return t._handleLoadingState(!0) }), e(this._ajaxCallback()), this) : this } }, { key: "_render", value: function () { if (!this._store.isLoading()) { this._currentState = this._store.state; var e = this._currentState.choices !== this._prevState.choices || this._currentState.groups !== this._prevState.groups || this._currentState.items !== this._prevState.items, t = this._isSelectElement, i = this._currentState.items !== this._prevState.items; e && (t && this._renderChoices(), i && this._renderItems(), this._prevState = this._currentState) } } }, { key: "_renderChoices", value: function () { var e = this, t = this._store, i = t.activeGroups, n = t.activeChoices, o = document.createDocumentFragment(); if (this.choiceList.clear(), this.config.resetScrollPosition && requestAnimationFrame(function () { return e.choiceList.scrollToTop() }), i.length >= 1 && !this._isSearching) { var r = n.filter(function (e) { return !0 === e.placeholder && -1 === e.groupId }); r.length >= 1 && (o = this._createChoicesFragment(r, o)), o = this._createGroupsFragment(i, n, o) } else n.length >= 1 && (o = this._createChoicesFragment(n, o)); if (o.childNodes && o.childNodes.length > 0) { var s = this._store.activeItems, a = this._canAddItem(s, this.input.value); a.response ? (this.choiceList.append(o), this._highlightChoice()) : this.choiceList.append(this._getTemplate("notice", a.notice)) } else { var c, l; this._isSearching ? (l = (0, p.isType)("Function", this.config.noResultsText) ? this.config.noResultsText() : this.config.noResultsText, c = this._getTemplate("notice", l, "no-results")) : (l = (0, p.isType)("Function", this.config.noChoicesText) ? this.config.noChoicesText() : this.config.noChoicesText, c = this._getTemplate("notice", l, "no-choices")), this.choiceList.append(c) } } }, { key: "_renderItems", value: function () { var e = this._store.activeItems || []; this.itemList.clear(); var t = this._createItemsFragment(e); t.childNodes && this.itemList.append(t) } }, { key: "_createGroupsFragment", value: function (e, t, i) { var n = this, o = i || document.createDocumentFragment(); return this.config.shouldSort && e.sort(this.config.sortFn), e.forEach(function (e) { var i = function (e) { return t.filter(function (t) { return n._isSelectOneElement ? t.groupId === e.id : t.groupId === e.id && ("always" === n.config.renderSelectedChoices || !t.selected) }) }(e); if (i.length >= 1) { var r = n._getTemplate("choiceGroup", e); o.appendChild(r), n._createChoicesFragment(i, o, !0) } }), o } }, { key: "_createChoicesFragment", value: function (e, t) { var i = this, n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], o = t || document.createDocumentFragment(), r = this.config, s = r.renderSelectedChoices, a = r.searchResultLimit, c = r.renderChoiceLimit, l = this._isSearching ? p.sortByScore : this.config.sortFn, u = function (e) { if ("auto" !== s || (i._isSelectOneElement || !e.selected)) { var t = i._getTemplate("choice", e, i.config.itemSelectText); o.appendChild(t) } }, h = e; "auto" !== s || this._isSelectOneElement || (h = e.filter(function (e) { return !e.selected })); var d = h.reduce(function (e, t) { return t.placeholder ? e.placeholderChoices.push(t) : e.normalChoices.push(t), e }, { placeholderChoices: [], normalChoices: [] }), f = d.placeholderChoices, v = d.normalChoices; (this.config.shouldSort || this._isSearching) && v.sort(l); var m = h.length, g = [].concat(f, v); this._isSearching ? m = a : c > 0 && !n && (m = c); for (var _ = 0; _ < m; _ += 1)g[_] && u(g[_]); return o } }, { key: "_createItemsFragment", value: function (e) { var t = this, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n = this.config, o = n.shouldSortItems, r = n.sortFn, s = n.removeItemButton, a = i || document.createDocumentFragment(); o && !this._isSelectOneElement && e.sort(r), this._isTextElement ? this.passedElement.value = e : this.passedElement.options = e; return e.forEach(function (e) { return function (e) { var i = t._getTemplate("item", e, s); a.appendChild(i) }(e) }), a } }, { key: "_triggerChange", value: function (e) { null != e && this.passedElement.triggerEvent(a.EVENTS.change, { value: e }) } }, { key: "_selectPlaceholderChoice", value: function () { var e = this._store.placeholderChoice; e && (this._addItem({ value: e.value, label: e.label, choiceId: e.id, groupId: e.groupId, placeholder: e.placeholder }), this._triggerChange(e.value)) } }, { key: "_handleButtonAction", value: function (e, t) { if (e && t && this.config.removeItems && this.config.removeItemButton) { var i = t.parentNode.getAttribute("data-id"), n = e.find(function (e) { return e.id === parseInt(i, 10) }); this._removeItem(n), this._triggerChange(n.value), this._isSelectOneElement && this._selectPlaceholderChoice() } } }, { key: "_handleItemAction", value: function (e, t) { var i = this, n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; if (e && t && this.config.removeItems && !this._isSelectOneElement) { var o = t.getAttribute("data-id"); e.forEach(function (e) { e.id !== parseInt(o, 10) || e.highlighted ? !n && e.highlighted && i.unhighlightItem(e) : i.highlightItem(e) }), this.input.focus() } } }, { key: "_handleChoiceAction", value: function (e, t) { if (e && t) { var i = t.getAttribute("data-id"), n = this._store.getChoiceById(i), o = e[0] && e[0].keyCode ? e[0].keyCode : null, r = this.dropdown.isActive; if (n.keyCode = o, this.passedElement.triggerEvent(a.EVENTS.choice, { choice: n }), n && !n.selected && !n.disabled) this._canAddItem(e, n.value).response && (this._addItem({ value: n.value, label: n.label, choiceId: n.id, groupId: n.groupId, customProperties: n.customProperties, placeholder: n.placeholder, keyCode: n.keyCode }), this._triggerChange(n.value)); this.clearInput(), r && this._isSelectOneElement && (this.hideDropdown(!0), this.containerOuter.focus()) } } }, { key: "_handleBackspace", value: function (e) { if (this.config.removeItems && e) { var t = e[e.length - 1], i = e.some(function (e) { return e.highlighted }); this.config.editItems && !i && t ? (this.input.value = t.value, this.input.setWidth(), this._removeItem(t), this._triggerChange(t.value)) : (i || this.highlightItem(t, !1), this.removeHighlightedItems(!0)) } } }, { key: "_setLoading", value: function (e) { this._store.dispatch((0, f.setIsLoading)(e)) } }, { key: "_handleLoadingState", value: function () { var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0], t = this.itemList.getChild(".".concat(this.config.classNames.placeholder)); e ? (this.disable(), this.containerOuter.addLoadingState(), this._isSelectOneElement ? t ? t.innerHTML = this.config.loadingText : (t = this._getTemplate("placeholder", this.config.loadingText), this.itemList.append(t)) : this.input.placeholder = this.config.loadingText) : (this.enable(), this.containerOuter.removeLoadingState(), this._isSelectOneElement ? t.innerHTML = this._placeholderValue || "" : this.input.placeholder = this._placeholderValue || "") } }, { key: "_handleSearch", value: function (e) { if (e && this.input.isFocussed) { var t = this._store.choices, i = this.config, n = i.searchFloor, o = i.searchChoices, r = t.some(function (e) { return !e.active }); if (e && e.length >= n) { var s = o ? this._searchChoices(e) : 0; this.passedElement.triggerEvent(a.EVENTS.search, { value: e, resultCount: s }) } else r && (this._isSearching = !1, this._store.dispatch((0, l.activateChoices)(!0))) } } }, { key: "_canAddItem", value: function (e, t) { var i = !0, n = (0, p.isType)("Function", this.config.addItemText) ? this.config.addItemText(t) : this.config.addItemText; if (!this._isSelectOneElement) { var o = (0, p.existsInArray)(e, t); this.config.maxItemCount > 0 && this.config.maxItemCount <= e.length && (i = !1, n = (0, p.isType)("Function", this.config.maxItemText) ? this.config.maxItemText(this.config.maxItemCount) : this.config.maxItemText), !this.config.duplicateItemsAllowed && o && i && (i = !1, n = (0, p.isType)("Function", this.config.uniqueItemText) ? this.config.uniqueItemText(t) : this.config.uniqueItemText), this._isTextElement && this.config.addItems && i && (0, p.isType)("Function", this.config.addItemFilterFn) && !this.config.addItemFilterFn(t) && (i = !1, n = (0, p.isType)("Function", this.config.customAddItemText) ? this.config.customAddItemText(t) : this.config.customAddItemText) } return { response: i, notice: n } } }, { key: "_ajaxCallback", value: function () { var e = this; return function (t, i, n) { if (t && i) { var o = (0, p.isType)("Object", t) ? [t] : t; o && (0, p.isType)("Array", o) && o.length ? (e._handleLoadingState(!1), e._setLoading(!0), o.forEach(function (t) { t.choices ? e._addGroup({ group: t, id: t.id || null, valueKey: i, labelKey: n }) : e._addChoice({ value: (0, p.fetchFromObject)(t, i), label: (0, p.fetchFromObject)(t, n), isSelected: t.selected, isDisabled: t.disabled, customProperties: t.customProperties, placeholder: t.placeholder }) }), e._setLoading(!1), e._isSelectOneElement && e._selectPlaceholderChoice()) : e._handleLoadingState(!1) } } } }, { key: "_searchChoices", value: function (e) { var t = (0, p.isType)("String", e) ? e.trim() : e, i = (0, p.isType)("String", this._currentValue) ? this._currentValue.trim() : this._currentValue; if (t.length < 1 && t === "".concat(i, " ")) return 0; var o = this._store.searchableChoices, r = t, s = [].concat(this.config.searchFields), a = Object.assign(this.config.fuseOptions, { keys: s }), c = new n.default(o, a).search(r); return this._currentValue = t, this._highlightPosition = 0, this._isSearching = !0, this._store.dispatch((0, l.filterChoices)(c)), c.length } }, { key: "_addEventListeners", value: function () { document.addEventListener("keyup", this._onKeyUp), document.addEventListener("keydown", this._onKeyDown), document.addEventListener("click", this._onClick), document.addEventListener("touchmove", this._onTouchMove), document.addEventListener("touchend", this._onTouchEnd), document.addEventListener("mousedown", this._onMouseDown), document.addEventListener("mouseover", this._onMouseOver), this._isSelectOneElement && (this.containerOuter.element.addEventListener("focus", this._onFocus), this.containerOuter.element.addEventListener("blur", this._onBlur)), this.input.element.addEventListener("focus", this._onFocus), this.input.element.addEventListener("blur", this._onBlur), this.input.element.form && this.input.element.form.addEventListener("reset", this._onFormReset), this.input.addEventListeners() } }, { key: "_removeEventListeners", value: function () { document.removeEventListener("keyup", this._onKeyUp), document.removeEventListener("keydown", this._onKeyDown), document.removeEventListener("click", this._onClick), document.removeEventListener("touchmove", this._onTouchMove), document.removeEventListener("touchend", this._onTouchEnd), document.removeEventListener("mousedown", this._onMouseDown), document.removeEventListener("mouseover", this._onMouseOver), this._isSelectOneElement && (this.containerOuter.element.removeEventListener("focus", this._onFocus), this.containerOuter.element.removeEventListener("blur", this._onBlur)), this.input.element.removeEventListener("focus", this._onFocus), this.input.element.removeEventListener("blur", this._onBlur), this.input.element.form && this.input.element.form.removeEventListener("reset", this._onFormReset), this.input.removeEventListeners() } }, { key: "_onKeyDown", value: function (e) { var t, i = e.target, n = e.keyCode, o = e.ctrlKey, r = e.metaKey; if (i === this.input.element || this.containerOuter.element.contains(i)) { var s = this._store.activeItems, c = this.input.isFocussed, l = this.dropdown.isActive, u = this.itemList.hasChildren, h = String.fromCharCode(n), d = a.KEY_CODES.BACK_KEY, f = a.KEY_CODES.DELETE_KEY, p = a.KEY_CODES.ENTER_KEY, v = a.KEY_CODES.A_KEY, g = a.KEY_CODES.ESC_KEY, _ = a.KEY_CODES.UP_KEY, y = a.KEY_CODES.DOWN_KEY, b = a.KEY_CODES.PAGE_UP_KEY, E = a.KEY_CODES.PAGE_DOWN_KEY, S = o || r; !this._isTextElement && /[a-zA-Z0-9-_ ]/.test(h) && this.showDropdown(); var I = (m(t = {}, v, this._onAKey), m(t, p, this._onEnterKey), m(t, g, this._onEscapeKey), m(t, _, this._onDirectionKey), m(t, b, this._onDirectionKey), m(t, y, this._onDirectionKey), m(t, E, this._onDirectionKey), m(t, f, this._onDeleteKey), m(t, d, this._onDeleteKey), t); I[n] && I[n]({ event: e, target: i, keyCode: n, metaKey: r, activeItems: s, hasFocusedInput: c, hasActiveDropdown: l, hasItems: u, hasCtrlDownKeyPressed: S }) } } }, { key: "_onKeyUp", value: function (e) { var t = e.target, i = e.keyCode; if (t === this.input.element) { var n = this.input.value, o = this._store.activeItems, r = this._canAddItem(o, n), s = a.KEY_CODES.BACK_KEY, c = a.KEY_CODES.DELETE_KEY; if (this._isTextElement) { if (r.notice && n) { var u = this._getTemplate("notice", r.notice); this.dropdown.element.innerHTML = u.outerHTML, this.showDropdown(!0) } else this.hideDropdown(!0) } else { var h = (i === s || i === c) && !t.value, d = !this._isTextElement && this._isSearching, f = this._canSearch && r.response; h && d ? (this._isSearching = !1, this._store.dispatch((0, l.activateChoices)(!0))) : f && this._handleSearch(this.input.value) } this._canSearch = this.config.searchEnabled } } }, { key: "_onAKey", value: function (e) { var t = e.hasItems; e.hasCtrlDownKeyPressed && t && (this._canSearch = !1, this.config.removeItems && !this.input.value && this.input.element === document.activeElement && this.highlightAll()) } }, { key: "_onEnterKey", value: function (e) { var t = e.event, i = e.target, n = e.activeItems, o = e.hasActiveDropdown, r = a.KEY_CODES.ENTER_KEY, s = i.hasAttribute("data-button"); if (this._isTextElement && i.value) { var c = this.input.value; this._canAddItem(n, c).response && (this.hideDropdown(!0), this._addItem({ value: c }), this._triggerChange(c), this.clearInput()) } if (s && (this._handleButtonAction(n, i), t.preventDefault()), o) { var l = this.dropdown.getChild(".".concat(this.config.classNames.highlightedState)); l && (n[0] && (n[0].keyCode = r), this._handleChoiceAction(n, l)), t.preventDefault() } else this._isSelectOneElement && (this.showDropdown(), t.preventDefault()) } }, { key: "_onEscapeKey", value: function (e) { e.hasActiveDropdown && (this.hideDropdown(!0), this.containerOuter.focus()) } }, { key: "_onDirectionKey", value: function (e) { var t = e.event, i = e.hasActiveDropdown, n = e.keyCode, o = e.metaKey, r = a.KEY_CODES.DOWN_KEY, s = a.KEY_CODES.PAGE_UP_KEY, c = a.KEY_CODES.PAGE_DOWN_KEY; if (i || this._isSelectOneElement) { this.showDropdown(), this._canSearch = !1; var l, u = n === r || n === c ? 1 : -1; if (o || n === c || n === s) l = u > 0 ? Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]")).pop() : this.dropdown.element.querySelector("[data-choice-selectable]"); else { var h = this.dropdown.element.querySelector(".".concat(this.config.classNames.highlightedState)); l = h ? (0, p.getAdjacentEl)(h, "[data-choice-selectable]", u) : this.dropdown.element.querySelector("[data-choice-selectable]") } l && ((0, p.isScrolledIntoView)(l, this.choiceList.element, u) || this.choiceList.scrollToChoice(l, u), this._highlightChoice(l)), t.preventDefault() } } }, { key: "_onDeleteKey", value: function (e) { var t = e.event, i = e.target, n = e.hasFocusedInput, o = e.activeItems; !n || i.value || this._isSelectOneElement || (this._handleBackspace(o), t.preventDefault()) } }, { key: "_onTouchMove", value: function () { this._wasTap && (this._wasTap = !1) } }, { key: "_onTouchEnd", value: function (e) { var t = (e || e.touches[0]).target; this._wasTap && this.containerOuter.element.contains(t) && ((t === this.containerOuter.element || t === this.containerInner.element) && (this._isTextElement ? this.input.focus() : this._isSelectMultipleElement && this.showDropdown()), e.stopPropagation()); this._wasTap = !0 } }, { key: "_onMouseDown", value: function (e) { var t = e.target, i = e.shiftKey; if (this.choiceList.element.contains(t) && (0, p.isIE11)() && (this._isScrollingOnIe = !0), this.containerOuter.element.contains(t) && t !== this.input.element) { var n = this._store.activeItems, o = i, r = (0, p.findAncestorByAttrName)(t, "data-button"), s = (0, p.findAncestorByAttrName)(t, "data-item"), a = (0, p.findAncestorByAttrName)(t, "data-choice"); r ? this._handleButtonAction(n, r) : s ? this._handleItemAction(n, s, o) : a && this._handleChoiceAction(n, a), e.preventDefault() } } }, { key: "_onMouseOver", value: function (e) { var t = e.target; (t === this.dropdown || this.dropdown.element.contains(t)) && t.hasAttribute("data-choice") && this._highlightChoice(t) } }, { key: "_onClick", value: function (e) { var t = e.target; this.containerOuter.element.contains(t) ? this.dropdown.isActive || this.containerOuter.isDisabled ? this._isSelectOneElement && t !== this.input.element && !this.dropdown.element.contains(t) && this.hideDropdown() : this._isTextElement ? document.activeElement !== this.input.element && this.input.focus() : (this.showDropdown(), this.containerOuter.focus()) : (this._store.highlightedActiveItems && this.unhighlightAll(), this.containerOuter.removeFocusState(), this.hideDropdown(!0)) } }, { key: "_onFocus", value: function (e) { var t = this, i = e.target; this.containerOuter.element.contains(i) && { text: function () { i === t.input.element && t.containerOuter.addFocusState() }, "select-one": function () { t.containerOuter.addFocusState(), i === t.input.element && t.showDropdown(!0) }, "select-multiple": function () { i === t.input.element && (t.showDropdown(!0), t.containerOuter.addFocusState()) } }[this.passedElement.element.type]() } }, { key: "_onBlur", value: function (e) { var t = this, i = e.target; if (this.containerOuter.element.contains(i) && !this._isScrollingOnIe) { var n = this._store.activeItems.some(function (e) { return e.highlighted }); ({ text: function () { i === t.input.element && (t.containerOuter.removeFocusState(), n && t.unhighlightAll(), t.hideDropdown(!0)) }, "select-one": function () { t.containerOuter.removeFocusState(), (i === t.input.element || i === t.containerOuter.element && !t._canSearch) && t.hideDropdown(!0) }, "select-multiple": function () { i === t.input.element && (t.containerOuter.removeFocusState(), t.hideDropdown(!0), n && t.unhighlightAll()) } })[this.passedElement.element.type]() } else this._isScrollingOnIe = !1, this.input.element.focus() } }, { key: "_onFormReset", value: function () { this._store.dispatch((0, d.resetTo)(this._initialState)) } }, { key: "_highlightChoice", value: function () { var e = this, t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, i = Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]")); if (i.length) { var n = t; Array.from(this.dropdown.element.querySelectorAll(".".concat(this.config.classNames.highlightedState))).forEach(function (t) { t.classList.remove(e.config.classNames.highlightedState), t.setAttribute("aria-selected", "false") }), n ? this._highlightPosition = i.indexOf(n) : (n = i.length > this._highlightPosition ? i[this._highlightPosition] : i[i.length - 1]) || (n = i[0]), n.classList.add(this.config.classNames.highlightedState), n.setAttribute("aria-selected", "true"), this.passedElement.triggerEvent(a.EVENTS.highlightChoice, { el: n }), this.dropdown.isActive && (this.input.setActiveDescendant(n.id), this.containerOuter.setActiveDescendant(n.id)) } } }, { key: "_addItem", value: function (e) { var t = e.value, i = e.label, n = void 0 === i ? null : i, o = e.choiceId, r = void 0 === o ? -1 : o, s = e.groupId, c = void 0 === s ? -1 : s, l = e.customProperties, h = void 0 === l ? null : l, d = e.placeholder, f = void 0 !== d && d, v = e.keyCode, m = void 0 === v ? null : v, g = (0, p.isType)("String", t) ? t.trim() : t, _ = m, y = h, b = this._store.items, E = n || g, S = parseInt(r, 10) || -1, I = c >= 0 ? this._store.getGroupById(c) : null, O = b ? b.length + 1 : 1; return this.config.prependValue && (g = this.config.prependValue + g.toString()), this.config.appendValue && (g += this.config.appendValue.toString()), this._store.dispatch((0, u.addItem)({ value: g, label: E, id: O, choiceId: S, groupId: c, customProperties: h, placeholder: f, keyCode: _ })), this._isSelectOneElement && this.removeActiveItems(O), this.passedElement.triggerEvent(a.EVENTS.addItem, { id: O, value: g, label: E, customProperties: y, groupValue: I && I.value ? I.value : void 0, keyCode: _ }), this } }, { key: "_removeItem", value: function (e) { if (!e || !(0, p.isType)("Object", e)) return this; var t = e.id, i = e.value, n = e.label, o = e.choiceId, r = e.groupId, s = r >= 0 ? this._store.getGroupById(r) : null; return this._store.dispatch((0, u.removeItem)(t, o)), s && s.value ? this.passedElement.triggerEvent(a.EVENTS.removeItem, { id: t, value: i, label: n, groupValue: s.value }) : this.passedElement.triggerEvent(a.EVENTS.removeItem, { id: t, value: i, label: n }), this } }, { key: "_addChoice", value: function (e) { var t = e.value, i = e.label, n = void 0 === i ? null : i, o = e.isSelected, r = void 0 !== o && o, s = e.isDisabled, a = void 0 !== s && s, c = e.groupId, u = void 0 === c ? -1 : c, h = e.customProperties, d = void 0 === h ? null : h, f = e.placeholder, p = void 0 !== f && f, v = e.keyCode, m = void 0 === v ? null : v; if (null != t) { var g = this._store.choices, _ = n || t, y = g ? g.length + 1 : 1, b = "".concat(this._baseId, "-").concat(this._idNames.itemChoice, "-").concat(y); this._store.dispatch((0, l.addChoice)({ value: t, label: _, id: y, groupId: u, disabled: a, elementId: b, customProperties: d, placeholder: p, keyCode: m })), r && this._addItem({ value: t, label: _, choiceId: y, customProperties: d, placeholder: p, keyCode: m }) } } }, { key: "_addGroup", value: function (e) { var t = this, i = e.group, n = e.id, o = e.valueKey, r = void 0 === o ? "value" : o, s = e.labelKey, a = void 0 === s ? "label" : s, c = (0, p.isType)("Object", i) ? i.choices : Array.from(i.getElementsByTagName("OPTION")), l = n || Math.floor((new Date).valueOf() * Math.random()), u = !!i.disabled && i.disabled; if (c) { this._store.dispatch((0, h.addGroup)(i.label, l, !0, u)); c.forEach(function (e) { var i = e.disabled || e.parentNode && e.parentNode.disabled; t._addChoice({ value: e[r], label: (0, p.isType)("Object", e) ? e[a] : e.innerHTML, isSelected: e.selected, isDisabled: i, groupId: l, customProperties: e.customProperties, placeholder: e.placeholder }) }) } else this._store.dispatch((0, h.addGroup)(i.label, i.id, !1, i.disabled)) } }, { key: "_getTemplate", value: function (e) { var t; if (!e) return null; for (var i = this.config, n = i.templates, o = i.classNames, r = arguments.length, s = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)s[a - 1] = arguments[a]; return (t = n[e]).call.apply(t, [this, o].concat(s)) } }, { key: "_createTemplates", value: function () { var e = this.config.callbackOnCreateTemplates, t = {}; e && (0, p.isType)("Function", e) && (t = e.call(this, p.strToEl)), this.config.templates = (0, o.default)(c.TEMPLATES, t) } }, { key: "_createElements", value: function () { this.containerOuter = new s.Container({ element: this._getTemplate("containerOuter", this._direction, this._isSelectElement, this._isSelectOneElement, this.config.searchEnabled, this.passedElement.element.type), classNames: this.config.classNames, type: this.passedElement.element.type, position: this.config.position }), this.containerInner = new s.Container({ element: this._getTemplate("containerInner"), classNames: this.config.classNames, type: this.passedElement.element.type, position: this.config.position }), this.input = new s.Input({ element: this._getTemplate("input"), classNames: this.config.classNames, type: this.passedElement.element.type }), this.choiceList = new s.List({ element: this._getTemplate("choiceList", this._isSelectOneElement) }), this.itemList = new s.List({ element: this._getTemplate("itemList", this._isSelectOneElement) }), this.dropdown = new s.Dropdown({ element: this._getTemplate("dropdown"), classNames: this.config.classNames, type: this.passedElement.element.type }) } }, { key: "_createStructure", value: function () { this.passedElement.conceal(), this.containerInner.wrap(this.passedElement.element), this.containerOuter.wrap(this.containerInner.element), this._isSelectOneElement ? this.input.placeholder = this.config.searchPlaceholderValue || "" : this._placeholderValue && (this.input.placeholder = this._placeholderValue, this.input.setWidth(!0)), this.containerOuter.element.appendChild(this.containerInner.element), this.containerOuter.element.appendChild(this.dropdown.element), this.containerInner.element.appendChild(this.itemList.element), this._isTextElement || this.dropdown.element.appendChild(this.choiceList.element), this._isSelectOneElement ? this.config.searchEnabled && this.dropdown.element.insertBefore(this.input.element, this.dropdown.element.firstChild) : this.containerInner.element.appendChild(this.input.element), this._isSelectElement ? this._addPredefinedChoices() : this._isTextElement && this._addPredefinedItems() } }, { key: "_addPredefinedChoices", value: function () { var e = this, t = this.passedElement.optionGroups; if (this._highlightPosition = 0, this._isSearching = !1, this._setLoading(!0), t && t.length) { var i = this.passedElement.placeholderOption; i && "SELECT" === i.parentNode.tagName && this._addChoice({ value: i.value, label: i.innerHTML, isSelected: i.selected, isDisabled: i.disabled, placeholder: !0 }), t.forEach(function (t) { return e._addGroup({ group: t, id: t.id || null }) }) } else { var n = this.passedElement.options, o = this.config.sortFn, r = this._presetChoices; n.forEach(function (e) { r.push({ value: e.value, label: e.innerHTML, selected: e.selected, disabled: e.disabled || e.parentNode.disabled, placeholder: e.hasAttribute("placeholder"), customProperties: e.getAttribute("data-custom-properties") }) }), this.config.shouldSort && r.sort(o); var s = r.some(function (e) { return e.selected }); r.forEach(function (t, i) { return function (t, i) { var n = t.value, o = t.label, r = t.customProperties, a = t.placeholder; if (e._isSelectElement) if (t.choices) e._addGroup({ group: t, id: t.id || null }); else { var c = e._isSelectOneElement && !s && 0 === i, l = !!c || t.selected, u = !c && t.disabled; e._addChoice({ value: n, label: o, isSelected: l, isDisabled: u, customProperties: r, placeholder: a }) } else e._addChoice({ value: n, label: o, isSelected: t.selected, isDisabled: t.disabled, customProperties: r, placeholder: a }) }(t, i) }) } this._setLoading(!1) } }, { key: "_addPredefinedItems", value: function () { var e = this; this._presetItems.forEach(function (t) { return function (t) { var i = (0, p.getType)(t); "Object" === i && t.value ? e._addItem({ value: t.value, label: t.label, choiceId: t.id, customProperties: t.customProperties, placeholder: t.placeholder }) : "String" === i && e._addItem({ value: t }) }(t) }) } }, { key: "_setChoiceOrItem", value: function (e) { var t = this; ({ object: function () { e.value && (t._isTextElement ? t._addItem({ value: e.value, label: e.label, choiceId: e.id, customProperties: e.customProperties, placeholder: e.placeholder }) : t._addChoice({ value: e.value, label: e.label, isSelected: !0, isDisabled: !1, customProperties: e.customProperties, placeholder: e.placeholder })) }, string: function () { t._isTextElement ? t._addItem({ value: e }) : t._addChoice({ value: e, label: e, isSelected: !0, isDisabled: !1 }) } })[(0, p.getType)(e).toLowerCase()]() } }, { key: "_findAndSelectChoiceByValue", value: function (e) { var t = this, i = this._store.choices.find(function (i) { return t.config.itemComparer(i.value, e) }); i && !i.selected && this._addItem({ value: i.value, label: i.label, choiceId: i.id, groupId: i.groupId, customProperties: i.customProperties, placeholder: i.placeholder, keyCode: i.keyCode }) } }, { key: "_generateInstances", value: function (t, i) { return t.reduce(function (t, n) { return t.push(new e(n, i)), t }, [this]) } }, { key: "_generatePlaceholderValue", value: function () { return !this._isSelectOneElement && (!!this.config.placeholder && (this.config.placeholderValue || this.passedElement.element.getAttribute("placeholder"))) } }]) && g(t.prototype, i), v && g(t, v), e }(); _.userDefaults = {}, e.exports = _ }, function (e, t, i) { - /*! - * Fuse.js v3.4.2 - Lightweight fuzzy-search (http://fusejs.io) - * - * Copyright (c) 2012-2017 Kirollos Risk (http://kiro.me) - * All Rights Reserved. Apache Software License 2.0 - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - var n; n = function () { - return function (e) { var t = {}; function i(n) { if (t[n]) return t[n].exports; var o = t[n] = { i: n, l: !1, exports: {} }; return e[n].call(o.exports, o, o.exports, i), o.l = !0, o.exports } return i.m = e, i.c = t, i.d = function (e, t, n) { i.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: n }) }, i.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }) }, i.t = function (e, t) { if (1 & t && (e = i(e)), 8 & t) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var n = Object.create(null); if (i.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) for (var o in e) i.d(n, o, function (t) { return e[t] }.bind(null, o)); return n }, i.n = function (e) { var t = e && e.__esModule ? function () { return e.default } : function () { return e }; return i.d(t, "a", t), t }, i.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t) }, i.p = "", i(i.s = "./src/index.js") }({ - "./src/bitap/bitap_matched_indices.js": - /*!********************************************!*\ - !*** ./src/bitap/bitap_matched_indices.js ***! - \********************************************/ - /*! no static exports found */function (e, t) { e.exports = function () { for (var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, i = [], n = -1, o = -1, r = 0, s = e.length; r < s; r += 1) { var a = e[r]; a && -1 === n ? n = r : a || -1 === n || ((o = r - 1) - n + 1 >= t && i.push([n, o]), n = -1) } return e[r - 1] && r - n >= t && i.push([n, r - 1]), i } }, "./src/bitap/bitap_pattern_alphabet.js": - /*!*********************************************!*\ - !*** ./src/bitap/bitap_pattern_alphabet.js ***! - \*********************************************/ - /*! no static exports found */function (e, t) { e.exports = function (e) { for (var t = {}, i = e.length, n = 0; n < i; n += 1)t[e.charAt(n)] = 0; for (var o = 0; o < i; o += 1)t[e.charAt(o)] |= 1 << i - o - 1; return t } }, "./src/bitap/bitap_regex_search.js": - /*!*****************************************!*\ - !*** ./src/bitap/bitap_regex_search.js ***! - \*****************************************/ - /*! no static exports found */function (e, t) { var i = /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g; e.exports = function (e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : / +/g, o = new RegExp(t.replace(i, "\\$&").replace(n, "|")), r = e.match(o), s = !!r, a = []; if (s) for (var c = 0, l = r.length; c < l; c += 1) { var u = r[c]; a.push([e.indexOf(u), u.length - 1]) } return { score: s ? .5 : 1, isMatch: s, matchedIndices: a } } }, "./src/bitap/bitap_score.js": - /*!**********************************!*\ - !*** ./src/bitap/bitap_score.js ***! - \**********************************/ - /*! no static exports found */function (e, t) { e.exports = function (e, t) { var i = t.errors, n = void 0 === i ? 0 : i, o = t.currentLocation, r = void 0 === o ? 0 : o, s = t.expectedLocation, a = void 0 === s ? 0 : s, c = t.distance, l = void 0 === c ? 100 : c, u = n / e.length, h = Math.abs(a - r); return l ? u + h / l : h ? 1 : u } }, "./src/bitap/bitap_search.js": - /*!***********************************!*\ - !*** ./src/bitap/bitap_search.js ***! - \***********************************/ - /*! no static exports found */function (e, t, i) { var n = i(/*! ./bitap_score */"./src/bitap/bitap_score.js"), o = i(/*! ./bitap_matched_indices */"./src/bitap/bitap_matched_indices.js"); e.exports = function (e, t, i, r) { for (var s = r.location, a = void 0 === s ? 0 : s, c = r.distance, l = void 0 === c ? 100 : c, u = r.threshold, h = void 0 === u ? .6 : u, d = r.findAllMatches, f = void 0 !== d && d, p = r.minMatchCharLength, v = void 0 === p ? 1 : p, m = a, g = e.length, _ = h, y = e.indexOf(t, m), b = t.length, E = [], S = 0; S < g; S += 1)E[S] = 0; if (-1 !== y) { var I = n(t, { errors: 0, currentLocation: y, expectedLocation: m, distance: l }); if (_ = Math.min(I, _), -1 !== (y = e.lastIndexOf(t, m + b))) { var O = n(t, { errors: 0, currentLocation: y, expectedLocation: m, distance: l }); _ = Math.min(O, _) } } y = -1; for (var C = [], T = 1, w = b + g, k = 1 << b - 1, A = 0; A < b; A += 1) { for (var L = 0, x = w; L < x;) { n(t, { errors: A, currentLocation: m + x, expectedLocation: m, distance: l }) <= _ ? L = x : w = x, x = Math.floor((w - L) / 2 + L) } w = x; var P = Math.max(1, m - x + 1), D = f ? g : Math.min(m + x, g) + b, j = Array(D + 2); j[D + 1] = (1 << A) - 1; for (var M = D; M >= P; M -= 1) { var N = M - 1, F = i[e.charAt(N)]; if (F && (E[N] = 1), j[M] = (j[M + 1] << 1 | 1) & F, 0 !== A && (j[M] |= (C[M + 1] | C[M]) << 1 | 1 | C[M + 1]), j[M] & k && (T = n(t, { errors: A, currentLocation: N, expectedLocation: m, distance: l })) <= _) { if (_ = T, (y = N) <= m) break; P = Math.max(1, 2 * m - y) } } if (n(t, { errors: A + 1, currentLocation: m, expectedLocation: m, distance: l }) > _) break; C = j } return { isMatch: y >= 0, score: 0 === T ? .001 : T, matchedIndices: o(E, v) } } }, "./src/bitap/index.js": - /*!****************************!*\ - !*** ./src/bitap/index.js ***! - \****************************/ - /*! no static exports found */function (e, t, i) { function n(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } var o = i(/*! ./bitap_regex_search */"./src/bitap/bitap_regex_search.js"), r = i(/*! ./bitap_search */"./src/bitap/bitap_search.js"), s = i(/*! ./bitap_pattern_alphabet */"./src/bitap/bitap_pattern_alphabet.js"), a = function () { function e(t, i) { var n = i.location, o = void 0 === n ? 0 : n, r = i.distance, a = void 0 === r ? 100 : r, c = i.threshold, l = void 0 === c ? .6 : c, u = i.maxPatternLength, h = void 0 === u ? 32 : u, d = i.isCaseSensitive, f = void 0 !== d && d, p = i.tokenSeparator, v = void 0 === p ? / +/g : p, m = i.findAllMatches, g = void 0 !== m && m, _ = i.minMatchCharLength, y = void 0 === _ ? 1 : _; !function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, e), this.options = { location: o, distance: a, threshold: l, maxPatternLength: h, isCaseSensitive: f, tokenSeparator: v, findAllMatches: g, minMatchCharLength: y }, this.pattern = this.options.isCaseSensitive ? t : t.toLowerCase(), this.pattern.length <= h && (this.patternAlphabet = s(this.pattern)) } var t, i, a; return t = e, (i = [{ key: "search", value: function (e) { if (this.options.isCaseSensitive || (e = e.toLowerCase()), this.pattern === e) return { isMatch: !0, score: 0, matchedIndices: [[0, e.length - 1]] }; var t = this.options, i = t.maxPatternLength, n = t.tokenSeparator; if (this.pattern.length > i) return o(e, this.pattern, n); var s = this.options, a = s.location, c = s.distance, l = s.threshold, u = s.findAllMatches, h = s.minMatchCharLength; return r(e, this.pattern, this.patternAlphabet, { location: a, distance: c, threshold: l, findAllMatches: u, minMatchCharLength: h }) } }]) && n(t.prototype, i), a && n(t, a), e }(); e.exports = a }, "./src/helpers/deep_value.js": - /*!***********************************!*\ - !*** ./src/helpers/deep_value.js ***! - \***********************************/ - /*! no static exports found */function (e, t, i) { var n = i(/*! ./is_array */"./src/helpers/is_array.js"); e.exports = function (e, t) { return function e(t, i, o) { if (i) { var r = i.indexOf("."), s = i, a = null; -1 !== r && (s = i.slice(0, r), a = i.slice(r + 1)); var c = t[s]; if (null != c) if (a || "string" != typeof c && "number" != typeof c) if (n(c)) for (var l = 0, u = c.length; l < u; l += 1)e(c[l], a, o); else a && e(c, a, o); else o.push(c.toString()) } else o.push(t); return o }(e, t, []) } }, "./src/helpers/is_array.js": - /*!*********************************!*\ - !*** ./src/helpers/is_array.js ***! - \*********************************/ - /*! no static exports found */function (e, t) { e.exports = function (e) { return Array.isArray ? Array.isArray(e) : "[object Array]" === Object.prototype.toString.call(e) } }, "./src/index.js": - /*!**********************!*\ - !*** ./src/index.js ***! - \**********************/ - /*! no static exports found */function (e, t, i) { function n(e) { return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e })(e) } function o(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } var r = i(/*! ./bitap */"./src/bitap/index.js"), s = i(/*! ./helpers/deep_value */"./src/helpers/deep_value.js"), a = i(/*! ./helpers/is_array */"./src/helpers/is_array.js"), c = function () { function e(t, i) { var n = i.location, o = void 0 === n ? 0 : n, r = i.distance, a = void 0 === r ? 100 : r, c = i.threshold, l = void 0 === c ? .6 : c, u = i.maxPatternLength, h = void 0 === u ? 32 : u, d = i.caseSensitive, f = void 0 !== d && d, p = i.tokenSeparator, v = void 0 === p ? / +/g : p, m = i.findAllMatches, g = void 0 !== m && m, _ = i.minMatchCharLength, y = void 0 === _ ? 1 : _, b = i.id, E = void 0 === b ? null : b, S = i.keys, I = void 0 === S ? [] : S, O = i.shouldSort, C = void 0 === O || O, T = i.getFn, w = void 0 === T ? s : T, k = i.sortFn, A = void 0 === k ? function (e, t) { return e.score - t.score } : k, L = i.tokenize, x = void 0 !== L && L, P = i.matchAllTokens, D = void 0 !== P && P, j = i.includeMatches, M = void 0 !== j && j, N = i.includeScore, F = void 0 !== N && N, K = i.verbose, R = void 0 !== K && K; !function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, e), this.options = { location: o, distance: a, threshold: l, maxPatternLength: h, isCaseSensitive: f, tokenSeparator: v, findAllMatches: g, minMatchCharLength: y, id: E, keys: I, includeMatches: M, includeScore: F, shouldSort: C, getFn: w, sortFn: A, verbose: R, tokenize: x, matchAllTokens: D }, this.setCollection(t) } var t, i, c; return t = e, (i = [{ key: "setCollection", value: function (e) { return this.list = e, e } }, { key: "search", value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { limit: !1 }; this._log('---------\nSearch pattern: "'.concat(e, '"')); var i = this._prepareSearchers(e), n = i.tokenSearchers, o = i.fullSearcher, r = this._search(n, o), s = r.weights, a = r.results; return this._computeScore(s, a), this.options.shouldSort && this._sort(a), t.limit && "number" == typeof t.limit && (a = a.slice(0, t.limit)), this._format(a) } }, { key: "_prepareSearchers", value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "", t = []; if (this.options.tokenize) for (var i = e.split(this.options.tokenSeparator), n = 0, o = i.length; n < o; n += 1)t.push(new r(i[n], this.options)); return { tokenSearchers: t, fullSearcher: new r(e, this.options) } } }, { key: "_search", value: function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = arguments.length > 1 ? arguments[1] : void 0, i = this.list, n = {}, o = []; if ("string" == typeof i[0]) { for (var r = 0, s = i.length; r < s; r += 1)this._analyze({ key: "", value: i[r], record: r, index: r }, { resultMap: n, results: o, tokenSearchers: e, fullSearcher: t }); return { weights: null, results: o } } for (var a = {}, c = 0, l = i.length; c < l; c += 1)for (var u = i[c], h = 0, d = this.options.keys.length; h < d; h += 1) { var f = this.options.keys[h]; if ("string" != typeof f) { if (a[f.name] = { weight: 1 - f.weight || 1 }, f.weight <= 0 || f.weight > 1) throw new Error("Key weight has to be > 0 and <= 1"); f = f.name } else a[f] = { weight: 1 }; this._analyze({ key: f, value: this.options.getFn(u, f), record: u, index: c }, { resultMap: n, results: o, tokenSearchers: e, fullSearcher: t }) } return { weights: a, results: o } } }, { key: "_analyze", value: function (e, t) { var i = e.key, n = e.arrayIndex, o = void 0 === n ? -1 : n, r = e.value, s = e.record, c = e.index, l = t.tokenSearchers, u = void 0 === l ? [] : l, h = t.fullSearcher, d = void 0 === h ? [] : h, f = t.resultMap, p = void 0 === f ? {} : f, v = t.results, m = void 0 === v ? [] : v; if (null != r) { var g = !1, _ = -1, y = 0; if ("string" == typeof r) { this._log("\nKey: ".concat("" === i ? "-" : i)); var b = d.search(r); if (this._log('Full text: "'.concat(r, '", score: ').concat(b.score)), this.options.tokenize) { for (var E = r.split(this.options.tokenSeparator), S = [], I = 0; I < u.length; I += 1) { var O = u[I]; this._log('\nPattern: "'.concat(O.pattern, '"')); for (var C = !1, T = 0; T < E.length; T += 1) { var w = E[T], k = O.search(w), A = {}; k.isMatch ? (A[w] = k.score, g = !0, C = !0, S.push(k.score)) : (A[w] = 1, this.options.matchAllTokens || S.push(1)), this._log('Token: "'.concat(w, '", score: ').concat(A[w])) } C && (y += 1) } _ = S[0]; for (var L = S.length, x = 1; x < L; x += 1)_ += S[x]; _ /= L, this._log("Token score average:", _) } var P = b.score; _ > -1 && (P = (P + _) / 2), this._log("Score average:", P); var D = !this.options.tokenize || !this.options.matchAllTokens || y >= u.length; if (this._log("\nCheck Matches: ".concat(D)), (g || b.isMatch) && D) { var j = p[c]; j ? j.output.push({ key: i, arrayIndex: o, value: r, score: P, matchedIndices: b.matchedIndices }) : (p[c] = { item: s, output: [{ key: i, arrayIndex: o, value: r, score: P, matchedIndices: b.matchedIndices }] }, m.push(p[c])) } } else if (a(r)) for (var M = 0, N = r.length; M < N; M += 1)this._analyze({ key: i, arrayIndex: M, value: r[M], record: s, index: c }, { resultMap: p, results: m, tokenSearchers: u, fullSearcher: d }) } } }, { key: "_computeScore", value: function (e, t) { this._log("\n\nComputing score:\n"); for (var i = 0, n = t.length; i < n; i += 1) { for (var o = t[i].output, r = o.length, s = 1, a = 1, c = 0; c < r; c += 1) { var l = e ? e[o[c].key].weight : 1, u = (1 === l ? o[c].score : o[c].score || .001) * l; 1 !== l ? a = Math.min(a, u) : (o[c].nScore = u, s *= u) } t[i].score = 1 === a ? s : a, this._log(t[i]) } } }, { key: "_sort", value: function (e) { this._log("\n\nSorting...."), e.sort(this.options.sortFn) } }, { key: "_format", value: function (e) { var t = []; if (this.options.verbose) { var i = []; this._log("\n\nOutput:\n\n", JSON.stringify(e, function (e, t) { if ("object" === n(t) && null !== t) { if (-1 !== i.indexOf(t)) return; i.push(t) } return t })), i = null } var o = []; this.options.includeMatches && o.push(function (e, t) { var i = e.output; t.matches = []; for (var n = 0, o = i.length; n < o; n += 1) { var r = i[n]; if (0 !== r.matchedIndices.length) { var s = { indices: r.matchedIndices, value: r.value }; r.key && (s.key = r.key), r.hasOwnProperty("arrayIndex") && r.arrayIndex > -1 && (s.arrayIndex = r.arrayIndex), t.matches.push(s) } } }), this.options.includeScore && o.push(function (e, t) { t.score = e.score }); for (var r = 0, s = e.length; r < s; r += 1) { var a = e[r]; if (this.options.id && (a.item = this.options.getFn(a.item, this.options.id)[0]), o.length) { for (var c = { item: a.item }, l = 0, u = o.length; l < u; l += 1)o[l](a, c); t.push(c) } else t.push(a.item) } return t } }, { key: "_log", value: function () { var e; this.options.verbose && (e = console).log.apply(e, arguments) } }]) && o(t.prototype, i), c && o(t, c), e }(); e.exports = c } - }) - }, e.exports = n() - }, function (e, t, i) { "use strict"; i.r(t); var n = function (e) { return function (e) { return !!e && "object" == typeof e }(e) && !function (e) { var t = Object.prototype.toString.call(e); return "[object RegExp]" === t || "[object Date]" === t || function (e) { return e.$$typeof === o }(e) }(e) }; var o = "function" == typeof Symbol && Symbol.for ? Symbol.for("react.element") : 60103; function r(e, t) { return !1 !== t.clone && t.isMergeableObject(e) ? a((i = e, Array.isArray(i) ? [] : {}), e, t) : e; var i } function s(e, t, i) { return e.concat(t).map(function (e) { return r(e, i) }) } function a(e, t, i) { (i = i || {}).arrayMerge = i.arrayMerge || s, i.isMergeableObject = i.isMergeableObject || n; var o = Array.isArray(t); return o === Array.isArray(e) ? o ? i.arrayMerge(e, t, i) : function (e, t, i) { var n = {}; return i.isMergeableObject(e) && Object.keys(e).forEach(function (t) { n[t] = r(e[t], i) }), Object.keys(t).forEach(function (o) { i.isMergeableObject(t[o]) && e[o] ? n[o] = a(e[o], t[o], i) : n[o] = r(t[o], i) }), n }(e, t, i) : r(t, i) } a.all = function (e, t) { if (!Array.isArray(e)) throw new Error("first argument should be an array"); return e.reduce(function (e, i) { return a(e, i, t) }, {}) }; var c = a; t.default = c }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = void 0; var n, o = i(6), r = (n = i(15)) && n.__esModule ? n : { default: n }; function s(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } var a = function () { function e() { !function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, e), this._store = (0, o.createStore)(r.default, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()) } var t, i, n; return t = e, (i = [{ key: "subscribe", value: function (e) { this._store.subscribe(e) } }, { key: "dispatch", value: function (e) { this._store.dispatch(e) } }, { key: "isLoading", value: function () { return this.state.general.loading } }, { key: "getChoiceById", value: function (e) { return !!e && this.activeChoices.find(function (t) { return t.id === parseInt(e, 10) }) } }, { key: "getGroupById", value: function (e) { return this.groups.find(function (t) { return t.id === parseInt(e, 10) }) } }, { key: "state", get: function () { return this._store.getState() } }, { key: "items", get: function () { return this.state.items } }, { key: "activeItems", get: function () { return this.items.filter(function (e) { return !0 === e.active }) } }, { key: "highlightedActiveItems", get: function () { return this.items.filter(function (e) { return e.active && e.highlighted }) } }, { key: "choices", get: function () { return this.state.choices } }, { key: "activeChoices", get: function () { return this.choices.filter(function (e) { return !0 === e.active }) } }, { key: "selectableChoices", get: function () { return this.choices.filter(function (e) { return !0 !== e.disabled }) } }, { key: "searchableChoices", get: function () { return this.selectableChoices.filter(function (e) { return !0 !== e.placeholder }) } }, { key: "placeholderChoice", get: function () { return [].concat(this.choices).reverse().find(function (e) { return !0 === e.placeholder }) } }, { key: "groups", get: function () { return this.state.groups } }, { key: "activeGroups", get: function () { var e = this.groups, t = this.choices; return e.filter(function (e) { var i = !0 === e.active && !1 === e.disabled, n = t.some(function (e) { return !0 === e.active && !1 === e.disabled }); return i && n }, []) } }]) && s(t.prototype, i), n && s(t, n), e }(); t.default = a }, function (e, t) { e.exports = function (e) { if (!e.webpackPolyfill) { var t = Object.create(e); t.children || (t.children = []), Object.defineProperty(t, "loaded", { enumerable: !0, get: function () { return t.l } }), Object.defineProperty(t, "id", { enumerable: !0, get: function () { return t.i } }), Object.defineProperty(t, "exports", { enumerable: !0 }), t.webpackPolyfill = 1 } return t } }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = void 0; var n = i(6), o = l(i(16)), r = l(i(17)), s = l(i(18)), a = l(i(19)), c = i(0); function l(e) { return e && e.__esModule ? e : { default: e } } var u = (0, n.combineReducers)({ items: o.default, groups: r.default, choices: s.default, general: a.default }), h = function (e, t) { var i = e; if ("CLEAR_ALL" === t.type) i = void 0; else if ("RESET_TO" === t.type) return (0, c.cloneObject)(t.state); return u(i, t) }; t.default = h }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : n, t = arguments.length > 1 ? arguments[1] : void 0; switch (t.type) { case "ADD_ITEM": var i = [].concat(e, [{ id: t.id, choiceId: t.choiceId, groupId: t.groupId, value: t.value, label: t.label, active: !0, highlighted: !1, customProperties: t.customProperties, placeholder: t.placeholder || !1, keyCode: null }]); return i.map(function (e) { var t = e; return t.highlighted = !1, t }); case "REMOVE_ITEM": return e.map(function (e) { var i = e; return i.id === t.id && (i.active = !1), i }); case "HIGHLIGHT_ITEM": return e.map(function (e) { var i = e; return i.id === t.id && (i.highlighted = t.highlighted), i }); default: return e } }, t.defaultState = void 0; var n = []; t.defaultState = n }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : n, t = arguments.length > 1 ? arguments[1] : void 0; switch (t.type) { case "ADD_GROUP": return [].concat(e, [{ id: t.id, value: t.value, active: t.active, disabled: t.disabled }]); case "CLEAR_CHOICES": return []; default: return e } }, t.defaultState = void 0; var n = []; t.defaultState = n }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : n, t = arguments.length > 1 ? arguments[1] : void 0; switch (t.type) { case "ADD_CHOICE": return [].concat(e, [{ id: t.id, elementId: t.elementId, groupId: t.groupId, value: t.value, label: t.label || t.value, disabled: t.disabled || !1, selected: !1, active: !0, score: 9999, customProperties: t.customProperties, placeholder: t.placeholder || !1, keyCode: null }]); case "ADD_ITEM": return t.activateOptions ? e.map(function (e) { var i = e; return i.active = t.active, i }) : t.choiceId > -1 ? e.map(function (e) { var i = e; return i.id === parseInt(t.choiceId, 10) && (i.selected = !0), i }) : e; case "REMOVE_ITEM": return t.choiceId > -1 ? e.map(function (e) { var i = e; return i.id === parseInt(t.choiceId, 10) && (i.selected = !1), i }) : e; case "FILTER_CHOICES": return e.map(function (e) { var i = e; return i.active = t.results.some(function (e) { var t = e.item, n = e.score; return t.id === i.id && (i.score = n, !0) }), i }); case "ACTIVATE_CHOICES": return e.map(function (e) { var i = e; return i.active = t.active, i }); case "CLEAR_CHOICES": return n; default: return e } }, t.defaultState = void 0; var n = []; t.defaultState = n }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = t.defaultState = void 0; var n = { loading: !1 }; t.defaultState = n; var o = function () { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : n, t = arguments.length > 1 ? arguments[1] : void 0; switch (t.type) { case "SET_IS_LOADING": return { loading: t.isLoading }; default: return e } }; t.default = o }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), Object.defineProperty(t, "Dropdown", { enumerable: !0, get: function () { return n.default } }), Object.defineProperty(t, "Container", { enumerable: !0, get: function () { return o.default } }), Object.defineProperty(t, "Input", { enumerable: !0, get: function () { return r.default } }), Object.defineProperty(t, "List", { enumerable: !0, get: function () { return s.default } }), Object.defineProperty(t, "WrappedInput", { enumerable: !0, get: function () { return a.default } }), Object.defineProperty(t, "WrappedSelect", { enumerable: !0, get: function () { return c.default } }); var n = l(i(21)), o = l(i(22)), r = l(i(23)), s = l(i(24)), a = l(i(25)), c = l(i(26)); function l(e) { return e && e.__esModule ? e : { default: e } } }, function (e, t, i) { "use strict"; function n(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } Object.defineProperty(t, "__esModule", { value: !0 }), t.default = void 0; var o = function () { function e(t) { var i = t.element, n = t.type, o = t.classNames; !function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, e), Object.assign(this, { element: i, type: n, classNames: o }), this.isActive = !1 } var t, i, o; return t = e, (i = [{ key: "distanceFromTopWindow", value: function () { return this.dimensions = this.element.getBoundingClientRect(), this.position = Math.ceil(this.dimensions.top + window.pageYOffset + this.element.offsetHeight), this.position } }, { key: "getChild", value: function (e) { return this.element.querySelector(e) } }, { key: "show", value: function () { return this.element.classList.add(this.classNames.activeState), this.element.setAttribute("aria-expanded", "true"), this.isActive = !0, this } }, { key: "hide", value: function () { return this.element.classList.remove(this.classNames.activeState), this.element.setAttribute("aria-expanded", "false"), this.isActive = !1, this } }]) && n(t.prototype, i), o && n(t, o), e }(); t.default = o }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = void 0; var n = i(0); function o(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } var r = function () { function e(t) { var i = t.element, n = t.type, o = t.classNames, r = t.position; !function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, e), Object.assign(this, { element: i, classNames: o, type: n, position: r }), this.isOpen = !1, this.isFlipped = !1, this.isFocussed = !1, this.isDisabled = !1, this.isLoading = !1, this._onFocus = this._onFocus.bind(this), this._onBlur = this._onBlur.bind(this) } var t, i, r; return t = e, (i = [{ key: "addEventListeners", value: function () { this.element.addEventListener("focus", this._onFocus), this.element.addEventListener("blur", this._onBlur) } }, { key: "removeEventListeners", value: function () { this.element.removeEventListener("focus", this._onFocus), this.element.removeEventListener("blur", this._onBlur) } }, { key: "shouldFlip", value: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : (0, n.getWindowHeight)(); if (void 0 === e) return !1; var i = !1; return "auto" === this.position ? i = e >= t : "top" === this.position && (i = !0), i } }, { key: "setActiveDescendant", value: function (e) { this.element.setAttribute("aria-activedescendant", e) } }, { key: "removeActiveDescendant", value: function () { this.element.removeAttribute("aria-activedescendant") } }, { key: "open", value: function (e) { this.element.classList.add(this.classNames.openState), this.element.setAttribute("aria-expanded", "true"), this.isOpen = !0, this.shouldFlip(e) && (this.element.classList.add(this.classNames.flippedState), this.isFlipped = !0) } }, { key: "close", value: function () { this.element.classList.remove(this.classNames.openState), this.element.setAttribute("aria-expanded", "false"), this.removeActiveDescendant(), this.isOpen = !1, this.isFlipped && (this.element.classList.remove(this.classNames.flippedState), this.isFlipped = !1) } }, { key: "focus", value: function () { this.isFocussed || this.element.focus() } }, { key: "addFocusState", value: function () { this.element.classList.add(this.classNames.focusState) } }, { key: "removeFocusState", value: function () { this.element.classList.remove(this.classNames.focusState) } }, { key: "enable", value: function () { this.element.classList.remove(this.classNames.disabledState), this.element.removeAttribute("aria-disabled"), "select-one" === this.type && this.element.setAttribute("tabindex", "0"), this.isDisabled = !1 } }, { key: "disable", value: function () { this.element.classList.add(this.classNames.disabledState), this.element.setAttribute("aria-disabled", "true"), "select-one" === this.type && this.element.setAttribute("tabindex", "-1"), this.isDisabled = !0 } }, { key: "wrap", value: function (e) { (0, n.wrap)(e, this.element) } }, { key: "unwrap", value: function (e) { this.element.parentNode.insertBefore(e, this.element), this.element.parentNode.removeChild(this.element) } }, { key: "addLoadingState", value: function () { this.element.classList.add(this.classNames.loadingState), this.element.setAttribute("aria-busy", "true"), this.isLoading = !0 } }, { key: "removeLoadingState", value: function () { this.element.classList.remove(this.classNames.loadingState), this.element.removeAttribute("aria-busy"), this.isLoading = !1 } }, { key: "_onFocus", value: function () { this.isFocussed = !0 } }, { key: "_onBlur", value: function () { this.isFocussed = !1 } }]) && o(t.prototype, i), r && o(t, r), e }(); t.default = r }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = void 0; var n = i(0); function o(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } var r = function () { function e(t) { var i = t.element, n = t.type, o = t.classNames, r = t.placeholderValue; !function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, e), Object.assign(this, { element: i, type: n, classNames: o, placeholderValue: r }), this.element = i, this.classNames = o, this.isFocussed = this.element === document.activeElement, this.isDisabled = !1, this._onPaste = this._onPaste.bind(this), this._onInput = this._onInput.bind(this), this._onFocus = this._onFocus.bind(this), this._onBlur = this._onBlur.bind(this) } var t, i, r; return t = e, (i = [{ key: "addEventListeners", value: function () { this.element.addEventListener("input", this._onInput), this.element.addEventListener("paste", this._onPaste), this.element.addEventListener("focus", this._onFocus), this.element.addEventListener("blur", this._onBlur), this.element.form && this.element.form.addEventListener("reset", this._onFormReset) } }, { key: "removeEventListeners", value: function () { this.element.removeEventListener("input", this._onInput), this.element.removeEventListener("paste", this._onPaste), this.element.removeEventListener("focus", this._onFocus), this.element.removeEventListener("blur", this._onBlur), this.element.form && this.element.form.removeEventListener("reset", this._onFormReset) } }, { key: "enable", value: function () { this.element.removeAttribute("disabled"), this.isDisabled = !1 } }, { key: "disable", value: function () { this.element.setAttribute("disabled", ""), this.isDisabled = !0 } }, { key: "focus", value: function () { this.isFocussed || this.element.focus() } }, { key: "blur", value: function () { this.isFocussed && this.element.blur() } }, { key: "clear", value: function () { var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; return this.element.value && (this.element.value = ""), e && this.setWidth(), this } }, { key: "setWidth", value: function (e) { var t = this, i = function (e) { t.element.style.width = e }; if (this._placeholderValue) { var n = this.element.value.length >= this._placeholderValue.length / 1.25; (this.element.value && n || e) && this.calcWidth(i) } else this.calcWidth(i) } }, { key: "calcWidth", value: function (e) { return (0, n.calcWidthOfInput)(this.element, e) } }, { key: "setActiveDescendant", value: function (e) { this.element.setAttribute("aria-activedescendant", e) } }, { key: "removeActiveDescendant", value: function () { this.element.removeAttribute("aria-activedescendant") } }, { key: "_onInput", value: function () { "select-one" !== this.type && this.setWidth() } }, { key: "_onPaste", value: function (e) { e.target === this.element && this.preventPaste && e.preventDefault() } }, { key: "_onFocus", value: function () { this.isFocussed = !0 } }, { key: "_onBlur", value: function () { this.isFocussed = !1 } }, { key: "placeholder", set: function (e) { this.element.placeholder = e } }, { key: "value", set: function (e) { this.element.value = e }, get: function () { return (0, n.sanitise)(this.element.value) } }]) && o(t.prototype, i), r && o(t, r), e }(); t.default = r }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = void 0; var n = i(1); function o(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } var r = function () { function e(t) { var i = t.element; !function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, e), Object.assign(this, { element: i }), this.scrollPos = this.element.scrollTop, this.height = this.element.offsetHeight, this.hasChildren = !!this.element.children } var t, i, r; return t = e, (i = [{ key: "clear", value: function () { this.element.innerHTML = "" } }, { key: "append", value: function (e) { this.element.appendChild(e) } }, { key: "getChild", value: function (e) { return this.element.querySelector(e) } }, { key: "scrollToTop", value: function () { this.element.scrollTop = 0 } }, { key: "scrollToChoice", value: function (e, t) { var i = this; if (e) { var n = this.element.offsetHeight, o = e.offsetHeight, r = e.offsetTop + o, s = this.element.scrollTop + n, a = t > 0 ? this.element.scrollTop + r - s : e.offsetTop; requestAnimationFrame(function (e) { i._animateScroll(e, a, t) }) } } }, { key: "_scrollDown", value: function (e, t, i) { var n = (i - e) / t, o = n > 1 ? n : 1; this.element.scrollTop = e + o } }, { key: "_scrollUp", value: function (e, t, i) { var n = (e - i) / t, o = n > 1 ? n : 1; this.element.scrollTop = e - o } }, { key: "_animateScroll", value: function (e, t, i) { var o = this, r = n.SCROLLING_SPEED, s = this.element.scrollTop, a = !1; i > 0 ? (this._scrollDown(s, r, t), s < t && (a = !0)) : (this._scrollUp(s, r, t), s > t && (a = !0)), a && requestAnimationFrame(function () { o._animateScroll(e, t, i) }) } }]) && o(t.prototype, i), r && o(t, r), e }(); t.default = r }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = void 0; var n, o = (n = i(4)) && n.__esModule ? n : { default: n }; function r(e) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e })(e) } function s(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } function a(e, t) { return !t || "object" !== r(t) && "function" != typeof t ? function (e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e }(e) : t } function c(e, t, i) { return (c = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function (e, t, i) { var n = function (e, t) { for (; !Object.prototype.hasOwnProperty.call(e, t) && null !== (e = l(e));); return e }(e, t); if (n) { var o = Object.getOwnPropertyDescriptor(n, t); return o.get ? o.get.call(i) : o.value } })(e, t, i || e) } function l(e) { return (l = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) { return e.__proto__ || Object.getPrototypeOf(e) })(e) } function u(e, t) { return (u = Object.setPrototypeOf || function (e, t) { return e.__proto__ = t, e })(e, t) } var h = function (e) { function t(e) { var i, n = e.element, o = e.classNames, r = e.delimiter; return function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, t), (i = a(this, l(t).call(this, { element: n, classNames: o }))).delimiter = r, i } var i, n, r; return function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), t && u(e, t) }(t, o.default), i = t, (n = [{ key: "value", set: function (e) { var t = e.map(function (e) { return e.value }).join(this.delimiter); this.element.setAttribute("value", t), this.element.value = t }, get: function () { return c(l(t.prototype), "value", this) } }]) && s(i.prototype, n), r && s(i, r), t }(); t.default = h }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = void 0; var n = r(i(4)), o = r(i(5)); function r(e) { return e && e.__esModule ? e : { default: e } } function s(e) { return (s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e })(e) } function a(e, t) { for (var i = 0; i < t.length; i++) { var n = t[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n) } } function c(e, t) { return !t || "object" !== s(t) && "function" != typeof t ? function (e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e }(e) : t } function l(e) { return (l = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) { return e.__proto__ || Object.getPrototypeOf(e) })(e) } function u(e, t) { return (u = Object.setPrototypeOf || function (e, t) { return e.__proto__ = t, e })(e, t) } var h = function (e) { function t(e) { var i = e.element, n = e.classNames; return function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, t), c(this, l(t).call(this, { element: i, classNames: n })) } var i, r, s; return function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), t && u(e, t) }(t, n.default), i = t, (r = [{ key: "appendDocFragment", value: function (e) { this.element.innerHTML = "", this.element.appendChild(e) } }, { key: "placeholderOption", get: function () { return this.element.querySelector("option[placeholder]") } }, { key: "optionGroups", get: function () { return Array.from(this.element.getElementsByTagName("OPTGROUP")) } }, { key: "options", get: function () { return Array.from(this.element.options) }, set: function (e) { var t = document.createDocumentFragment(); e.forEach(function (e) { return i = e, n = o.default.option(i), void t.appendChild(n); var i, n }), this.appendDocFragment(t) } }]) && a(i.prototype, r), s && a(i, s), t }(); t.default = h }, function (e, t, i) { - var n; - /*! - Copyright (c) 2017 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames - */ - /*! - Copyright (c) 2017 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames - */ - !function () { "use strict"; var i = {}.hasOwnProperty; function o() { for (var e = [], t = 0; t < arguments.length; t++) { var n = arguments[t]; if (n) { var r = typeof n; if ("string" === r || "number" === r) e.push(n); else if (Array.isArray(n) && n.length) { var s = o.apply(null, n); s && e.push(s) } else if ("object" === r) for (var a in n) i.call(n, a) && n[a] && e.push(a) } } return e.join(" ") } e.exports ? (o.default = o, e.exports = o) : void 0 === (n = function () { return o }.apply(t, [])) || (e.exports = n) }() - }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.clearChoices = t.activateChoices = t.filterChoices = t.addChoice = void 0; var n = i(1); t.addChoice = function (e) { var t = e.value, i = e.label, o = e.id, r = e.groupId, s = e.disabled, a = e.elementId, c = e.customProperties, l = e.placeholder, u = e.keyCode; return { type: n.ACTION_TYPES.ADD_CHOICE, value: t, label: i, id: o, groupId: r, disabled: s, elementId: a, customProperties: c, placeholder: l, keyCode: u } }; t.filterChoices = function (e) { return { type: n.ACTION_TYPES.FILTER_CHOICES, results: e } }; t.activateChoices = function () { var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; return { type: n.ACTION_TYPES.ACTIVATE_CHOICES, active: e } }; t.clearChoices = function () { return { type: n.ACTION_TYPES.CLEAR_CHOICES } } }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.highlightItem = t.removeItem = t.addItem = void 0; var n = i(1); t.addItem = function (e) { var t = e.value, i = e.label, o = e.id, r = e.choiceId, s = e.groupId, a = e.customProperties, c = e.placeholder, l = e.keyCode; return { type: n.ACTION_TYPES.ADD_ITEM, value: t, label: i, id: o, choiceId: r, groupId: s, customProperties: a, placeholder: c, keyCode: l } }; t.removeItem = function (e, t) { return { type: n.ACTION_TYPES.REMOVE_ITEM, id: e, choiceId: t } }; t.highlightItem = function (e, t) { return { type: n.ACTION_TYPES.HIGHLIGHT_ITEM, id: e, highlighted: t } } }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.addGroup = void 0; var n = i(1); t.addGroup = function (e, t, i, o) { return { type: n.ACTION_TYPES.ADD_GROUP, value: e, id: t, active: i, disabled: o } } }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.resetTo = t.clearAll = void 0; t.clearAll = function () { return { type: "CLEAR_ALL" } }; t.resetTo = function (e) { return { type: "RESET_TO", state: e } } }, function (e, t, i) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.setIsLoading = void 0; t.setIsLoading = function (e) { return { type: "SET_IS_LOADING", isLoading: e } } }]) -}); \ No newline at end of file +/*! For license information please see choices.min.js.LICENSE.txt */ +!function(){"use strict";var e={282:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.clearChoices=t.activateChoices=t.filterChoices=t.addChoice=void 0;var n=i(883);t.addChoice=function(e){var t=e.value,i=e.label,r=e.id,s=e.groupId,o=e.disabled,a=e.elementId,c=e.customProperties,l=e.placeholder,h=e.keyCode;return{type:n.ACTION_TYPES.ADD_CHOICE,value:t,label:i,id:r,groupId:s,disabled:o,elementId:a,customProperties:c,placeholder:l,keyCode:h}},t.filterChoices=function(e){return{type:n.ACTION_TYPES.FILTER_CHOICES,results:e}},t.activateChoices=function(e){return void 0===e&&(e=!0),{type:n.ACTION_TYPES.ACTIVATE_CHOICES,active:e}},t.clearChoices=function(){return{type:n.ACTION_TYPES.CLEAR_CHOICES}}},783:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.addGroup=void 0;var n=i(883);t.addGroup=function(e){var t=e.value,i=e.id,r=e.active,s=e.disabled;return{type:n.ACTION_TYPES.ADD_GROUP,value:t,id:i,active:r,disabled:s}}},464:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.highlightItem=t.removeItem=t.addItem=void 0;var n=i(883);t.addItem=function(e){var t=e.value,i=e.label,r=e.id,s=e.choiceId,o=e.groupId,a=e.customProperties,c=e.placeholder,l=e.keyCode;return{type:n.ACTION_TYPES.ADD_ITEM,value:t,label:i,id:r,choiceId:s,groupId:o,customProperties:a,placeholder:c,keyCode:l}},t.removeItem=function(e,t){return{type:n.ACTION_TYPES.REMOVE_ITEM,id:e,choiceId:t}},t.highlightItem=function(e,t){return{type:n.ACTION_TYPES.HIGHLIGHT_ITEM,id:e,highlighted:t}}},137:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.setIsLoading=t.resetTo=t.clearAll=void 0;var n=i(883);t.clearAll=function(){return{type:n.ACTION_TYPES.CLEAR_ALL}},t.resetTo=function(e){return{type:n.ACTION_TYPES.RESET_TO,state:e}},t.setIsLoading=function(e){return{type:n.ACTION_TYPES.SET_IS_LOADING,isLoading:e}}},373:function(e,t,i){var n=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,r=0,s=t.length;r<s;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(i(996)),o=r(i(221)),a=i(282),c=i(783),l=i(464),h=i(137),u=i(520),d=i(883),p=i(789),f=i(799),m=i(655),v=r(i(744)),g=r(i(686)),_="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,y={},E=function(){function e(t,i){void 0===t&&(t="[data-choice]"),void 0===i&&(i={});var r=this;void 0===i.allowHTML&&console.warn("Deprecation warning: allowHTML will default to false in a future release. To render HTML in Choices, you will need to set it to true. Setting allowHTML will suppress this message."),this.config=s.default.all([p.DEFAULT_CONFIG,e.defaults.options,i],{arrayMerge:function(e,t){return n([],t,!0)}});var o=(0,f.diff)(this.config,p.DEFAULT_CONFIG);o.length&&console.warn("Unknown config option(s) passed",o.join(", "));var a="string"==typeof t?document.querySelector(t):t;if(!(a instanceof HTMLInputElement||a instanceof HTMLSelectElement))throw TypeError("Expected one of the following types text|select-one|select-multiple");if(this._isTextElement=a.type===d.TEXT_TYPE,this._isSelectOneElement=a.type===d.SELECT_ONE_TYPE,this._isSelectMultipleElement=a.type===d.SELECT_MULTIPLE_TYPE,this._isSelectElement=this._isSelectOneElement||this._isSelectMultipleElement,this.config.searchEnabled=this._isSelectMultipleElement||this.config.searchEnabled,["auto","always"].includes("".concat(this.config.renderSelectedChoices))||(this.config.renderSelectedChoices="auto"),i.addItemFilter&&"function"!=typeof i.addItemFilter){var c=i.addItemFilter instanceof RegExp?i.addItemFilter:new RegExp(i.addItemFilter);this.config.addItemFilter=c.test.bind(c)}if(this._isTextElement?this.passedElement=new u.WrappedInput({element:a,classNames:this.config.classNames,delimiter:this.config.delimiter}):this.passedElement=new u.WrappedSelect({element:a,classNames:this.config.classNames,template:function(e){return r._templates.option(e)}}),this.initialised=!1,this._store=new v.default,this._initialState=m.defaultState,this._currentState=m.defaultState,this._prevState=m.defaultState,this._currentValue="",this._canSearch=!!this.config.searchEnabled,this._isScrollingOnIe=!1,this._highlightPosition=0,this._wasTap=!0,this._placeholderValue=this._generatePlaceholderValue(),this._baseId=(0,f.generateId)(this.passedElement.element,"choices-"),this._direction=this.passedElement.dir,!this._direction){var l=window.getComputedStyle(this.passedElement.element).direction;l!==window.getComputedStyle(document.documentElement).direction&&(this._direction=l)}if(this._idNames={itemChoice:"item-choice"},this._isSelectElement&&(this._presetGroups=this.passedElement.optionGroups,this._presetOptions=this.passedElement.options),this._presetChoices=this.config.choices,this._presetItems=this.config.items,this.passedElement.value&&this._isTextElement){var h=this.passedElement.value.split(this.config.delimiter);this._presetItems=this._presetItems.concat(h)}if(this.passedElement.options&&this.passedElement.options.forEach((function(e){r._presetChoices.push({value:e.value,label:e.innerHTML,selected:!!e.selected,disabled:e.disabled||e.parentNode.disabled,placeholder:""===e.value||e.hasAttribute("placeholder"),customProperties:(0,f.parseCustomProperties)(e.dataset.customProperties)})})),this._render=this._render.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onClick=this._onClick.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseOver=this._onMouseOver.bind(this),this._onFormReset=this._onFormReset.bind(this),this._onSelectKey=this._onSelectKey.bind(this),this._onEnterKey=this._onEnterKey.bind(this),this._onEscapeKey=this._onEscapeKey.bind(this),this._onDirectionKey=this._onDirectionKey.bind(this),this._onDeleteKey=this._onDeleteKey.bind(this),this.passedElement.isActive)return this.config.silent||console.warn("Trying to initialise Choices on element already initialised",{element:t}),void(this.initialised=!0);this.init()}return Object.defineProperty(e,"defaults",{get:function(){return Object.preventExtensions({get options(){return y},get templates(){return g.default}})},enumerable:!1,configurable:!0}),e.prototype.init=function(){if(!this.initialised){this._createTemplates(),this._createElements(),this._createStructure(),this._store.subscribe(this._render),this._render(),this._addEventListeners(),(!this.config.addItems||this.passedElement.element.hasAttribute("disabled"))&&this.disable(),this.initialised=!0;var e=this.config.callbackOnInit;e&&"function"==typeof e&&e.call(this)}},e.prototype.destroy=function(){this.initialised&&(this._removeEventListeners(),this.passedElement.reveal(),this.containerOuter.unwrap(this.passedElement.element),this.clearStore(),this._isSelectElement&&(this.passedElement.options=this._presetOptions),this._templates=g.default,this.initialised=!1)},e.prototype.enable=function(){return this.passedElement.isDisabled&&this.passedElement.enable(),this.containerOuter.isDisabled&&(this._addEventListeners(),this.input.enable(),this.containerOuter.enable()),this},e.prototype.disable=function(){return this.passedElement.isDisabled||this.passedElement.disable(),this.containerOuter.isDisabled||(this._removeEventListeners(),this.input.disable(),this.containerOuter.disable()),this},e.prototype.highlightItem=function(e,t){if(void 0===t&&(t=!0),!e||!e.id)return this;var i=e.id,n=e.groupId,r=void 0===n?-1:n,s=e.value,o=void 0===s?"":s,a=e.label,c=void 0===a?"":a,h=r>=0?this._store.getGroupById(r):null;return this._store.dispatch((0,l.highlightItem)(i,!0)),t&&this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:i,value:o,label:c,groupValue:h&&h.value?h.value:null}),this},e.prototype.unhighlightItem=function(e){if(!e||!e.id)return this;var t=e.id,i=e.groupId,n=void 0===i?-1:i,r=e.value,s=void 0===r?"":r,o=e.label,a=void 0===o?"":o,c=n>=0?this._store.getGroupById(n):null;return this._store.dispatch((0,l.highlightItem)(t,!1)),this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:t,value:s,label:a,groupValue:c&&c.value?c.value:null}),this},e.prototype.highlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.highlightItem(t)})),this},e.prototype.unhighlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.unhighlightItem(t)})),this},e.prototype.removeActiveItemsByValue=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.value===e})).forEach((function(e){return t._removeItem(e)})),this},e.prototype.removeActiveItems=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.id!==e})).forEach((function(e){return t._removeItem(e)})),this},e.prototype.removeHighlightedItems=function(e){var t=this;return void 0===e&&(e=!1),this._store.highlightedActiveItems.forEach((function(i){t._removeItem(i),e&&t._triggerChange(i.value)})),this},e.prototype.showDropdown=function(e){var t=this;return this.dropdown.isActive||requestAnimationFrame((function(){t.dropdown.show(),t.containerOuter.open(t.dropdown.distanceFromTopWindow),!e&&t._canSearch&&t.input.focus(),t.passedElement.triggerEvent(d.EVENTS.showDropdown,{})})),this},e.prototype.hideDropdown=function(e){var t=this;return this.dropdown.isActive?(requestAnimationFrame((function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(d.EVENTS.hideDropdown,{})})),this):this},e.prototype.getValue=function(e){void 0===e&&(e=!1);var t=this._store.activeItems.reduce((function(t,i){var n=e?i.value:i;return t.push(n),t}),[]);return this._isSelectOneElement?t[0]:t},e.prototype.setValue=function(e){var t=this;return this.initialised?(e.forEach((function(e){return t._setChoiceOrItem(e)})),this):this},e.prototype.setChoiceByValue=function(e){var t=this;return!this.initialised||this._isTextElement||(Array.isArray(e)?e:[e]).forEach((function(e){return t._findAndSelectChoiceByValue(e)})),this},e.prototype.setChoices=function(e,t,i,n){var r=this;if(void 0===e&&(e=[]),void 0===t&&(t="value"),void 0===i&&(i="label"),void 0===n&&(n=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof t||!t)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(n&&this.clearChoices(),"function"==typeof e){var s=e(this);if("function"==typeof Promise&&s instanceof Promise)return new Promise((function(e){return requestAnimationFrame(e)})).then((function(){return r._handleLoadingState(!0)})).then((function(){return s})).then((function(e){return r.setChoices(e,t,i,n)})).catch((function(e){r.config.silent||console.error(e)})).then((function(){return r._handleLoadingState(!1)})).then((function(){return r}));if(!Array.isArray(s))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof s));return this.setChoices(s,t,i,!1)}if(!Array.isArray(e))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),e.forEach((function(e){if(e.choices)r._addGroup({id:e.id?parseInt("".concat(e.id),10):null,group:e,valueKey:t,labelKey:i});else{var n=e;r._addChoice({value:n[t],label:n[i],isSelected:!!n.selected,isDisabled:!!n.disabled,placeholder:!!n.placeholder,customProperties:n.customProperties})}})),this._stopLoading(),this},e.prototype.clearChoices=function(){return this._store.dispatch((0,a.clearChoices)()),this},e.prototype.clearStore=function(){return this._store.dispatch((0,h.clearAll)()),this},e.prototype.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0))),this},e.prototype._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var e=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,t=this._isSelectElement,i=this._currentState.items!==this._prevState.items;e&&(t&&this._renderChoices(),i&&this._renderItems(),this._prevState=this._currentState)}},e.prototype._renderChoices=function(){var e=this,t=this._store,i=t.activeGroups,n=t.activeChoices,r=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame((function(){return e.choiceList.scrollToTop()})),i.length>=1&&!this._isSearching){var s=n.filter((function(e){return!0===e.placeholder&&-1===e.groupId}));s.length>=1&&(r=this._createChoicesFragment(s,r)),r=this._createGroupsFragment(i,n,r)}else n.length>=1&&(r=this._createChoicesFragment(n,r));if(r.childNodes&&r.childNodes.length>0){var o=this._store.activeItems,a=this._canAddItem(o,this.input.value);if(a.response)this.choiceList.append(r),this._highlightChoice();else{var c=this._getTemplate("notice",a.notice);this.choiceList.append(c)}}else{var l=void 0;c=void 0,this._isSearching?(c="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,l=this._getTemplate("notice",c,"no-results")):(c="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,l=this._getTemplate("notice",c,"no-choices")),this.choiceList.append(l)}},e.prototype._renderItems=function(){var e=this._store.activeItems||[];this.itemList.clear();var t=this._createItemsFragment(e);t.childNodes&&this.itemList.append(t)},e.prototype._createGroupsFragment=function(e,t,i){var n=this;return void 0===i&&(i=document.createDocumentFragment()),this.config.shouldSort&&e.sort(this.config.sorter),e.forEach((function(e){var r=function(e){return t.filter((function(t){return n._isSelectOneElement?t.groupId===e.id:t.groupId===e.id&&("always"===n.config.renderSelectedChoices||!t.selected)}))}(e);if(r.length>=1){var s=n._getTemplate("choiceGroup",e);i.appendChild(s),n._createChoicesFragment(r,i,!0)}})),i},e.prototype._createChoicesFragment=function(e,t,i){var r=this;void 0===t&&(t=document.createDocumentFragment()),void 0===i&&(i=!1);var s=this.config,o=s.renderSelectedChoices,a=s.searchResultLimit,c=s.renderChoiceLimit,l=this._isSearching?f.sortByScore:this.config.sorter,h=function(e){if("auto"!==o||r._isSelectOneElement||!e.selected){var i=r._getTemplate("choice",e,r.config.itemSelectText);t.appendChild(i)}},u=e;"auto"!==o||this._isSelectOneElement||(u=e.filter((function(e){return!e.selected})));var d=u.reduce((function(e,t){return t.placeholder?e.placeholderChoices.push(t):e.normalChoices.push(t),e}),{placeholderChoices:[],normalChoices:[]}),p=d.placeholderChoices,m=d.normalChoices;(this.config.shouldSort||this._isSearching)&&m.sort(l);var v=u.length,g=this._isSelectOneElement?n(n([],p,!0),m,!0):m;this._isSearching?v=a:c&&c>0&&!i&&(v=c);for(var _=0;_<v;_+=1)g[_]&&h(g[_]);return t},e.prototype._createItemsFragment=function(e,t){var i=this;void 0===t&&(t=document.createDocumentFragment());var n=this.config,r=n.shouldSortItems,s=n.sorter,o=n.removeItemButton;return r&&!this._isSelectOneElement&&e.sort(s),this._isTextElement?this.passedElement.value=e.map((function(e){return e.value})).join(this.config.delimiter):this.passedElement.options=e,e.forEach((function(e){var n=i._getTemplate("item",e,o);t.appendChild(n)})),t},e.prototype._triggerChange=function(e){null!=e&&this.passedElement.triggerEvent(d.EVENTS.change,{value:e})},e.prototype._selectPlaceholderChoice=function(e){this._addItem({value:e.value,label:e.label,choiceId:e.id,groupId:e.groupId,placeholder:e.placeholder}),this._triggerChange(e.value)},e.prototype._handleButtonAction=function(e,t){if(e&&t&&this.config.removeItems&&this.config.removeItemButton){var i=t.parentNode&&t.parentNode.dataset.id,n=i&&e.find((function(e){return e.id===parseInt(i,10)}));n&&(this._removeItem(n),this._triggerChange(n.value),this._isSelectOneElement&&this._store.placeholderChoice&&this._selectPlaceholderChoice(this._store.placeholderChoice))}},e.prototype._handleItemAction=function(e,t,i){var n=this;if(void 0===i&&(i=!1),e&&t&&this.config.removeItems&&!this._isSelectOneElement){var r=t.dataset.id;e.forEach((function(e){e.id!==parseInt("".concat(r),10)||e.highlighted?!i&&e.highlighted&&n.unhighlightItem(e):n.highlightItem(e)})),this.input.focus()}},e.prototype._handleChoiceAction=function(e,t){if(e&&t){var i=t.dataset.id,n=i&&this._store.getChoiceById(i);if(n){var r=e[0]&&e[0].keyCode?e[0].keyCode:void 0,s=this.dropdown.isActive;n.keyCode=r,this.passedElement.triggerEvent(d.EVENTS.choice,{choice:n}),n.selected||n.disabled||this._canAddItem(e,n.value).response&&(this._addItem({value:n.value,label:n.label,choiceId:n.id,groupId:n.groupId,customProperties:n.customProperties,placeholder:n.placeholder,keyCode:n.keyCode}),this._triggerChange(n.value)),this.clearInput(),s&&this._isSelectOneElement&&(this.hideDropdown(!0),this.containerOuter.focus())}}},e.prototype._handleBackspace=function(e){if(this.config.removeItems&&e){var t=e[e.length-1],i=e.some((function(e){return e.highlighted}));this.config.editItems&&!i&&t?(this.input.value=t.value,this.input.setWidth(),this._removeItem(t),this._triggerChange(t.value)):(i||this.highlightItem(t,!1),this.removeHighlightedItems(!0))}},e.prototype._startLoading=function(){this._store.dispatch((0,h.setIsLoading)(!0))},e.prototype._stopLoading=function(){this._store.dispatch((0,h.setIsLoading)(!1))},e.prototype._handleLoadingState=function(e){void 0===e&&(e=!0);var t=this.itemList.getChild(".".concat(this.config.classNames.placeholder));e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t?t.innerHTML=this.config.loadingText:(t=this._getTemplate("placeholder",this.config.loadingText))&&this.itemList.append(t):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?t&&(t.innerHTML=this._placeholderValue||""):this.input.placeholder=this._placeholderValue||"")},e.prototype._handleSearch=function(e){if(this.input.isFocussed){var t=this._store.choices,i=this.config,n=i.searchFloor,r=i.searchChoices,s=t.some((function(e){return!e.active}));if(null!=e&&e.length>=n){var o=r?this._searchChoices(e):0;this.passedElement.triggerEvent(d.EVENTS.search,{value:e,resultCount:o})}else s&&(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0)))}},e.prototype._canAddItem=function(e,t){var i=!0,n="function"==typeof this.config.addItemText?this.config.addItemText(t):this.config.addItemText;if(!this._isSelectOneElement){var r=(0,f.existsInArray)(e,t);this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(i=!1,n="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&r&&i&&(i=!1,n="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText(t):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&i&&"function"==typeof this.config.addItemFilter&&!this.config.addItemFilter(t)&&(i=!1,n="function"==typeof this.config.customAddItemText?this.config.customAddItemText(t):this.config.customAddItemText)}return{response:i,notice:n}},e.prototype._searchChoices=function(e){var t="string"==typeof e?e.trim():e,i="string"==typeof this._currentValue?this._currentValue.trim():this._currentValue;if(t.length<1&&t==="".concat(i," "))return 0;var r=this._store.searchableChoices,s=t,c=Object.assign(this.config.fuseOptions,{keys:n([],this.config.searchFields,!0),includeMatches:!0}),l=new o.default(r,c).search(s);return this._currentValue=t,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch((0,a.filterChoices)(l)),l.length},e.prototype._addEventListeners=function(){var e=document.documentElement;e.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},e.prototype._removeEventListeners=function(){var e=document.documentElement;e.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},e.prototype._onKeyDown=function(e){var t=e.keyCode,i=this._store.activeItems,n=this.input.isFocussed,r=this.dropdown.isActive,s=this.itemList.hasChildren(),o=String.fromCharCode(t),a=/[^\x00-\x1F]/.test(o),c=d.KEY_CODES.BACK_KEY,l=d.KEY_CODES.DELETE_KEY,h=d.KEY_CODES.ENTER_KEY,u=d.KEY_CODES.A_KEY,p=d.KEY_CODES.ESC_KEY,f=d.KEY_CODES.UP_KEY,m=d.KEY_CODES.DOWN_KEY,v=d.KEY_CODES.PAGE_UP_KEY,g=d.KEY_CODES.PAGE_DOWN_KEY;switch(this._isTextElement||r||!a||(this.showDropdown(),this.input.isFocussed||(this.input.value+=e.key.toLowerCase())),t){case u:return this._onSelectKey(e,s);case h:return this._onEnterKey(e,i,r);case p:return this._onEscapeKey(r);case f:case v:case m:case g:return this._onDirectionKey(e,r);case l:case c:return this._onDeleteKey(e,i,n)}},e.prototype._onKeyUp=function(e){var t=e.target,i=e.keyCode,n=this.input.value,r=this._store.activeItems,s=this._canAddItem(r,n),o=d.KEY_CODES.BACK_KEY,c=d.KEY_CODES.DELETE_KEY;if(this._isTextElement)if(s.notice&&n){var l=this._getTemplate("notice",s.notice);this.dropdown.element.innerHTML=l.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0);else{var h=(i===o||i===c)&&t&&!t.value,u=!this._isTextElement&&this._isSearching,p=this._canSearch&&s.response;h&&u?(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0))):p&&this._handleSearch(this.input.rawValue)}this._canSearch=this.config.searchEnabled},e.prototype._onSelectKey=function(e,t){var i=e.ctrlKey,n=e.metaKey;(i||n)&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e.prototype._onEnterKey=function(e,t,i){var n=e.target,r=d.KEY_CODES.ENTER_KEY,s=n&&n.hasAttribute("data-button");if(this._isTextElement&&n&&n.value){var o=this.input.value;this._canAddItem(t,o).response&&(this.hideDropdown(!0),this._addItem({value:o}),this._triggerChange(o),this.clearInput())}if(s&&(this._handleButtonAction(t,n),e.preventDefault()),i){var a=this.dropdown.getChild(".".concat(this.config.classNames.highlightedState));a&&(t[0]&&(t[0].keyCode=r),this._handleChoiceAction(t,a)),e.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),e.preventDefault())},e.prototype._onEscapeKey=function(e){e&&(this.hideDropdown(!0),this.containerOuter.focus())},e.prototype._onDirectionKey=function(e,t){var i=e.keyCode,n=e.metaKey,r=d.KEY_CODES.DOWN_KEY,s=d.KEY_CODES.PAGE_UP_KEY,o=d.KEY_CODES.PAGE_DOWN_KEY;if(t||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var a=i===r||i===o?1:-1,c="[data-choice-selectable]",l=void 0;if(n||i===o||i===s)l=a>0?this.dropdown.element.querySelector("".concat(c,":last-of-type")):this.dropdown.element.querySelector(c);else{var h=this.dropdown.element.querySelector(".".concat(this.config.classNames.highlightedState));l=h?(0,f.getAdjacentEl)(h,c,a):this.dropdown.element.querySelector(c)}l&&((0,f.isScrolledIntoView)(l,this.choiceList.element,a)||this.choiceList.scrollToChildElement(l,a),this._highlightChoice(l)),e.preventDefault()}},e.prototype._onDeleteKey=function(e,t,i){var n=e.target;this._isSelectOneElement||n.value||!i||(this._handleBackspace(t),e.preventDefault())},e.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(t)&&((t===this.containerOuter.element||t===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()),this._wasTap=!0},e.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(_&&this.choiceList.element.contains(t)){var i=this.choiceList.element.firstElementChild,n="ltr"===this._direction?e.offsetX>=i.offsetWidth:e.offsetX<i.offsetLeft;this._isScrollingOnIe=n}if(t!==this.input.element){var r=t.closest("[data-button],[data-item],[data-choice]");if(r instanceof HTMLElement){var s=e.shiftKey,o=this._store.activeItems,a=r.dataset;"button"in a?this._handleButtonAction(o,r):"item"in a?this._handleItemAction(o,r,s):"choice"in a&&this._handleChoiceAction(o,r)}e.preventDefault()}}},e.prototype._onMouseOver=function(e){var t=e.target;t instanceof HTMLElement&&"choice"in t.dataset&&this._highlightChoice(t)},e.prototype._onClick=function(e){var t=e.target;this.containerOuter.element.contains(t)?this.dropdown.isActive||this.containerOuter.isDisabled?this._isSelectOneElement&&t!==this.input.element&&!this.dropdown.element.contains(t)&&this.hideDropdown():this._isTextElement?document.activeElement!==this.input.element&&this.input.focus():(this.showDropdown(),this.containerOuter.focus()):(this._store.highlightedActiveItems.length>0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},e.prototype._onFocus=function(e){var t,i=this,n=e.target;n&&this.containerOuter.element.contains(n)&&((t={})[d.TEXT_TYPE]=function(){n===i.input.element&&i.containerOuter.addFocusState()},t[d.SELECT_ONE_TYPE]=function(){i.containerOuter.addFocusState(),n===i.input.element&&i.showDropdown(!0)},t[d.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.showDropdown(!0),i.containerOuter.addFocusState())},t)[this.passedElement.element.type]()},e.prototype._onBlur=function(e){var t,i=this,n=e.target;if(n&&this.containerOuter.element.contains(n)&&!this._isScrollingOnIe){var r=this._store.activeItems.some((function(e){return e.highlighted}));((t={})[d.TEXT_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),r&&i.unhighlightAll(),i.hideDropdown(!0))},t[d.SELECT_ONE_TYPE]=function(){i.containerOuter.removeFocusState(),(n===i.input.element||n===i.containerOuter.element&&!i._canSearch)&&i.hideDropdown(!0)},t[d.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),i.hideDropdown(!0),r&&i.unhighlightAll())},t)[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},e.prototype._onFormReset=function(){this._store.dispatch((0,h.resetTo)(this._initialState))},e.prototype._highlightChoice=function(e){var t=this;void 0===e&&(e=null);var i=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(i.length){var n=e;Array.from(this.dropdown.element.querySelectorAll(".".concat(this.config.classNames.highlightedState))).forEach((function(e){e.classList.remove(t.config.classNames.highlightedState),e.setAttribute("aria-selected","false")})),n?this._highlightPosition=i.indexOf(n):(n=i.length>this._highlightPosition?i[this._highlightPosition]:i[i.length-1])||(n=i[0]),n.classList.add(this.config.classNames.highlightedState),n.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(d.EVENTS.highlightChoice,{el:n}),this.dropdown.isActive&&(this.input.setActiveDescendant(n.id),this.containerOuter.setActiveDescendant(n.id))}},e.prototype._addItem=function(e){var t=e.value,i=e.label,n=void 0===i?null:i,r=e.choiceId,s=void 0===r?-1:r,o=e.groupId,a=void 0===o?-1:o,c=e.customProperties,h=void 0===c?{}:c,u=e.placeholder,p=void 0!==u&&u,f=e.keyCode,m=void 0===f?-1:f,v="string"==typeof t?t.trim():t,g=this._store.items,_=n||v,y=s||-1,E=a>=0?this._store.getGroupById(a):null,b=g?g.length+1:1;this.config.prependValue&&(v=this.config.prependValue+v.toString()),this.config.appendValue&&(v+=this.config.appendValue.toString()),this._store.dispatch((0,l.addItem)({value:v,label:_,id:b,choiceId:y,groupId:a,customProperties:h,placeholder:p,keyCode:m})),this._isSelectOneElement&&this.removeActiveItems(b),this.passedElement.triggerEvent(d.EVENTS.addItem,{id:b,value:v,label:_,customProperties:h,groupValue:E&&E.value?E.value:null,keyCode:m})},e.prototype._removeItem=function(e){var t=e.id,i=e.value,n=e.label,r=e.customProperties,s=e.choiceId,o=e.groupId,a=o&&o>=0?this._store.getGroupById(o):null;t&&s&&(this._store.dispatch((0,l.removeItem)(t,s)),this.passedElement.triggerEvent(d.EVENTS.removeItem,{id:t,value:i,label:n,customProperties:r,groupValue:a&&a.value?a.value:null}))},e.prototype._addChoice=function(e){var t=e.value,i=e.label,n=void 0===i?null:i,r=e.isSelected,s=void 0!==r&&r,o=e.isDisabled,c=void 0!==o&&o,l=e.groupId,h=void 0===l?-1:l,u=e.customProperties,d=void 0===u?{}:u,p=e.placeholder,f=void 0!==p&&p,m=e.keyCode,v=void 0===m?-1:m;if(null!=t){var g=this._store.choices,_=n||t,y=g?g.length+1:1,E="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(y);this._store.dispatch((0,a.addChoice)({id:y,groupId:h,elementId:E,value:t,label:_,disabled:c,customProperties:d,placeholder:f,keyCode:v})),s&&this._addItem({value:t,label:_,choiceId:y,customProperties:d,placeholder:f,keyCode:v})}},e.prototype._addGroup=function(e){var t=this,i=e.group,n=e.id,r=e.valueKey,s=void 0===r?"value":r,o=e.labelKey,a=void 0===o?"label":o,l=(0,f.isType)("Object",i)?i.choices:Array.from(i.getElementsByTagName("OPTION")),h=n||Math.floor((new Date).valueOf()*Math.random()),u=!!i.disabled&&i.disabled;l?(this._store.dispatch((0,c.addGroup)({value:i.label,id:h,active:!0,disabled:u})),l.forEach((function(e){var i=e.disabled||e.parentNode&&e.parentNode.disabled;t._addChoice({value:e[s],label:(0,f.isType)("Object",e)?e[a]:e.innerHTML,isSelected:e.selected,isDisabled:i,groupId:h,customProperties:e.customProperties,placeholder:e.placeholder})}))):this._store.dispatch((0,c.addGroup)({value:i.label,id:i.id,active:!1,disabled:i.disabled}))},e.prototype._getTemplate=function(e){for(var t,i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];return(t=this._templates[e]).call.apply(t,n([this,this.config],i,!1))},e.prototype._createTemplates=function(){var e=this.config.callbackOnCreateTemplates,t={};e&&"function"==typeof e&&(t=e.call(this,f.strToEl)),this._templates=(0,s.default)(g.default,t)},e.prototype._createElements=function(){this.containerOuter=new u.Container({element:this._getTemplate("containerOuter",this._direction,this._isSelectElement,this._isSelectOneElement,this.config.searchEnabled,this.passedElement.element.type,this.config.labelId),classNames:this.config.classNames,type:this.passedElement.element.type,position:this.config.position}),this.containerInner=new u.Container({element:this._getTemplate("containerInner"),classNames:this.config.classNames,type:this.passedElement.element.type,position:this.config.position}),this.input=new u.Input({element:this._getTemplate("input",this._placeholderValue),classNames:this.config.classNames,type:this.passedElement.element.type,preventPaste:!this.config.paste}),this.choiceList=new u.List({element:this._getTemplate("choiceList",this._isSelectOneElement)}),this.itemList=new u.List({element:this._getTemplate("itemList",this._isSelectOneElement)}),this.dropdown=new u.Dropdown({element:this._getTemplate("dropdown"),classNames:this.config.classNames,type:this.passedElement.element.type})},e.prototype._createStructure=function(){this.passedElement.conceal(),this.containerInner.wrap(this.passedElement.element),this.containerOuter.wrap(this.containerInner.element),this._isSelectOneElement?this.input.placeholder=this.config.searchPlaceholderValue||"":this._placeholderValue&&(this.input.placeholder=this._placeholderValue,this.input.setWidth()),this.containerOuter.element.appendChild(this.containerInner.element),this.containerOuter.element.appendChild(this.dropdown.element),this.containerInner.element.appendChild(this.itemList.element),this._isTextElement||this.dropdown.element.appendChild(this.choiceList.element),this._isSelectOneElement?this.config.searchEnabled&&this.dropdown.element.insertBefore(this.input.element,this.dropdown.element.firstChild):this.containerInner.element.appendChild(this.input.element),this._isSelectElement&&(this._highlightPosition=0,this._isSearching=!1,this._startLoading(),this._presetGroups.length?this._addPredefinedGroups(this._presetGroups):this._addPredefinedChoices(this._presetChoices),this._stopLoading()),this._isTextElement&&this._addPredefinedItems(this._presetItems)},e.prototype._addPredefinedGroups=function(e){var t=this,i=this.passedElement.placeholderOption;i&&i.parentNode&&"SELECT"===i.parentNode.tagName&&this._addChoice({value:i.value,label:i.innerHTML,isSelected:i.selected,isDisabled:i.disabled,placeholder:!0}),e.forEach((function(e){return t._addGroup({group:e,id:e.id||null})}))},e.prototype._addPredefinedChoices=function(e){var t=this;this.config.shouldSort&&e.sort(this.config.sorter);var i=e.some((function(e){return e.selected})),n=e.findIndex((function(e){return void 0===e.disabled||!e.disabled}));e.forEach((function(e,r){var s=e.value,o=void 0===s?"":s,a=e.label,c=e.customProperties,l=e.placeholder;if(t._isSelectElement)if(e.choices)t._addGroup({group:e,id:e.id||null});else{var h=!(!t._isSelectOneElement||i||r!==n)||e.selected,u=e.disabled;t._addChoice({value:o,label:a,isSelected:!!h,isDisabled:!!u,placeholder:!!l,customProperties:c})}else t._addChoice({value:o,label:a,isSelected:!!e.selected,isDisabled:!!e.disabled,placeholder:!!e.placeholder,customProperties:c})}))},e.prototype._addPredefinedItems=function(e){var t=this;e.forEach((function(e){"object"==typeof e&&e.value&&t._addItem({value:e.value,label:e.label,choiceId:e.id,customProperties:e.customProperties,placeholder:e.placeholder}),"string"==typeof e&&t._addItem({value:e})}))},e.prototype._setChoiceOrItem=function(e){var t=this;({object:function(){e.value&&(t._isTextElement?t._addItem({value:e.value,label:e.label,choiceId:e.id,customProperties:e.customProperties,placeholder:e.placeholder}):t._addChoice({value:e.value,label:e.label,isSelected:!0,isDisabled:!1,customProperties:e.customProperties,placeholder:e.placeholder}))},string:function(){t._isTextElement?t._addItem({value:e}):t._addChoice({value:e,label:e,isSelected:!0,isDisabled:!1})}})[(0,f.getType)(e).toLowerCase()]()},e.prototype._findAndSelectChoiceByValue=function(e){var t=this,i=this._store.choices.find((function(i){return t.config.valueComparer(i.value,e)}));i&&!i.selected&&this._addItem({value:i.value,label:i.label,choiceId:i.id,groupId:i.groupId,customProperties:i.customProperties,placeholder:i.placeholder,keyCode:i.keyCode})},e.prototype._generatePlaceholderValue=function(){if(this._isSelectElement&&this.passedElement.placeholderOption){var e=this.passedElement.placeholderOption;return e?e.text:null}var t=this.config,i=t.placeholder,n=t.placeholderValue,r=this.passedElement.element.dataset;if(i){if(n)return n;if(r.placeholder)return r.placeholder}return null},e}();t.default=E},613:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var n=i(799),r=i(883),s=function(){function e(e){var t=e.element,i=e.type,n=e.classNames,r=e.position;this.element=t,this.classNames=n,this.type=i,this.position=r,this.isOpen=!1,this.isFlipped=!1,this.isFocussed=!1,this.isDisabled=!1,this.isLoading=!1,this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}return e.prototype.addEventListeners=function(){this.element.addEventListener("focus",this._onFocus),this.element.addEventListener("blur",this._onBlur)},e.prototype.removeEventListeners=function(){this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},e.prototype.shouldFlip=function(e){if("number"!=typeof e)return!1;var t=!1;return"auto"===this.position?t=!window.matchMedia("(min-height: ".concat(e+1,"px)")).matches:"top"===this.position&&(t=!0),t},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype.open=function(e){this.element.classList.add(this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e)&&(this.element.classList.add(this.classNames.flippedState),this.isFlipped=!0)},e.prototype.close=function(){this.element.classList.remove(this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(this.element.classList.remove(this.classNames.flippedState),this.isFlipped=!1)},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.addFocusState=function(){this.element.classList.add(this.classNames.focusState)},e.prototype.removeFocusState=function(){this.element.classList.remove(this.classNames.focusState)},e.prototype.enable=function(){this.element.classList.remove(this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===r.SELECT_ONE_TYPE&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},e.prototype.disable=function(){this.element.classList.add(this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===r.SELECT_ONE_TYPE&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},e.prototype.wrap=function(e){(0,n.wrap)(e,this.element)},e.prototype.unwrap=function(e){this.element.parentNode&&(this.element.parentNode.insertBefore(e,this.element),this.element.parentNode.removeChild(this.element))},e.prototype.addLoadingState=function(){this.element.classList.add(this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},e.prototype.removeLoadingState=function(){this.element.classList.remove(this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}();t.default=s},217:function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){var t=e.element,i=e.type,n=e.classNames;this.element=t,this.classNames=n,this.type=i,this.isActive=!1}return Object.defineProperty(e.prototype,"distanceFromTopWindow",{get:function(){return this.element.getBoundingClientRect().bottom},enumerable:!1,configurable:!0}),e.prototype.getChild=function(e){return this.element.querySelector(e)},e.prototype.show=function(){return this.element.classList.add(this.classNames.activeState),this.element.setAttribute("aria-expanded","true"),this.isActive=!0,this},e.prototype.hide=function(){return this.element.classList.remove(this.classNames.activeState),this.element.setAttribute("aria-expanded","false"),this.isActive=!1,this},e}();t.default=i},520:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WrappedSelect=t.WrappedInput=t.List=t.Input=t.Container=t.Dropdown=void 0;var r=n(i(217));t.Dropdown=r.default;var s=n(i(613));t.Container=s.default;var o=n(i(11));t.Input=o.default;var a=n(i(624));t.List=a.default;var c=n(i(541));t.WrappedInput=c.default;var l=n(i(982));t.WrappedSelect=l.default},11:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var n=i(799),r=i(883),s=function(){function e(e){var t=e.element,i=e.type,n=e.classNames,r=e.preventPaste;this.element=t,this.type=i,this.classNames=n,this.preventPaste=r,this.isFocussed=this.element.isEqualNode(document.activeElement),this.isDisabled=t.disabled,this._onPaste=this._onPaste.bind(this),this._onInput=this._onInput.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}return Object.defineProperty(e.prototype,"placeholder",{set:function(e){this.element.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return(0,n.sanitise)(this.element.value)},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rawValue",{get:function(){return this.element.value},enumerable:!1,configurable:!0}),e.prototype.addEventListeners=function(){this.element.addEventListener("paste",this._onPaste),this.element.addEventListener("input",this._onInput,{passive:!0}),this.element.addEventListener("focus",this._onFocus,{passive:!0}),this.element.addEventListener("blur",this._onBlur,{passive:!0})},e.prototype.removeEventListeners=function(){this.element.removeEventListener("input",this._onInput),this.element.removeEventListener("paste",this._onPaste),this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.isDisabled=!0},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.blur=function(){this.isFocussed&&this.element.blur()},e.prototype.clear=function(e){return void 0===e&&(e=!0),this.element.value&&(this.element.value=""),e&&this.setWidth(),this},e.prototype.setWidth=function(){var e=this.element,t=e.style,i=e.value,n=e.placeholder;t.minWidth="".concat(n.length+1,"ch"),t.width="".concat(i.length+1,"ch")},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype._onInput=function(){this.type!==r.SELECT_ONE_TYPE&&this.setWidth()},e.prototype._onPaste=function(e){this.preventPaste&&e.preventDefault()},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}();t.default=s},624:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var n=i(883),r=function(){function e(e){var t=e.element;this.element=t,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}return e.prototype.clear=function(){this.element.innerHTML=""},e.prototype.append=function(e){this.element.appendChild(e)},e.prototype.getChild=function(e){return this.element.querySelector(e)},e.prototype.hasChildren=function(){return this.element.hasChildNodes()},e.prototype.scrollToTop=function(){this.element.scrollTop=0},e.prototype.scrollToChildElement=function(e,t){var i=this;if(e){var n=this.element.offsetHeight,r=this.element.scrollTop+n,s=e.offsetHeight,o=e.offsetTop+s,a=t>0?this.element.scrollTop+o-r:e.offsetTop;requestAnimationFrame((function(){i._animateScroll(a,t)}))}},e.prototype._scrollDown=function(e,t,i){var n=(i-e)/t,r=n>1?n:1;this.element.scrollTop=e+r},e.prototype._scrollUp=function(e,t,i){var n=(e-i)/t,r=n>1?n:1;this.element.scrollTop=e-r},e.prototype._animateScroll=function(e,t){var i=this,r=n.SCROLLING_SPEED,s=this.element.scrollTop,o=!1;t>0?(this._scrollDown(s,r,e),s<e&&(o=!0)):(this._scrollUp(s,r,e),s>e&&(o=!0)),o&&requestAnimationFrame((function(){i._animateScroll(e,t)}))},e}();t.default=r},730:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var n=i(799),r=function(){function e(e){var t=e.element,i=e.classNames;if(this.element=t,this.classNames=i,!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement))throw new TypeError("Invalid element passed");this.isDisabled=!1}return Object.defineProperty(e.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.conceal=function(){this.element.classList.add(this.classNames.input),this.element.hidden=!0,this.element.tabIndex=-1;var e=this.element.getAttribute("style");e&&this.element.setAttribute("data-choice-orig-style",e),this.element.setAttribute("data-choice","active")},e.prototype.reveal=function(){this.element.classList.remove(this.classNames.input),this.element.hidden=!1,this.element.removeAttribute("tabindex");var e=this.element.getAttribute("data-choice-orig-style");e?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",e)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},e.prototype.triggerEvent=function(e,t){(0,n.dispatchEvent)(this.element,e,t)},e}();t.default=r},541:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){var i=t.element,n=t.classNames,r=t.delimiter,s=e.call(this,{element:i,classNames:n})||this;return s.delimiter=r,s}return r(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),t}(s(i(730)).default);t.default=o},982:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){var i=t.element,n=t.classNames,r=t.template,s=e.call(this,{element:i,classNames:n})||this;return s.template=r,s}return r(t,e),Object.defineProperty(t.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optionGroups",{get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return Array.from(this.element.options)},set:function(e){var t=this,i=document.createDocumentFragment();e.forEach((function(e){return n=e,r=t.template(n),void i.appendChild(r);var n,r})),this.appendDocFragment(i)},enumerable:!1,configurable:!0}),t.prototype.appendDocFragment=function(e){this.element.innerHTML="",this.element.appendChild(e)},t}(s(i(730)).default);t.default=o},883:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.SCROLLING_SPEED=t.SELECT_MULTIPLE_TYPE=t.SELECT_ONE_TYPE=t.TEXT_TYPE=t.KEY_CODES=t.ACTION_TYPES=t.EVENTS=void 0,t.EVENTS={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice",unhighlightItem:"unhighlightItem"},t.ACTION_TYPES={ADD_CHOICE:"ADD_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM",CLEAR_ALL:"CLEAR_ALL",RESET_TO:"RESET_TO",SET_IS_LOADING:"SET_IS_LOADING"},t.KEY_CODES={BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},t.TEXT_TYPE="text",t.SELECT_ONE_TYPE="select-one",t.SELECT_MULTIPLE_TYPE="select-multiple",t.SCROLLING_SPEED=4},789:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CONFIG=t.DEFAULT_CLASSNAMES=void 0;var n=i(799);t.DEFAULT_CLASSNAMES={containerOuter:"choices",containerInner:"choices__inner",input:"choices__input",inputCloned:"choices__input--cloned",list:"choices__list",listItems:"choices__list--multiple",listSingle:"choices__list--single",listDropdown:"choices__list--dropdown",item:"choices__item",itemSelectable:"choices__item--selectable",itemDisabled:"choices__item--disabled",itemChoice:"choices__item--choice",placeholder:"choices__placeholder",group:"choices__group",groupHeading:"choices__heading",button:"choices__button",activeState:"is-active",focusState:"is-focused",openState:"is-open",disabledState:"is-disabled",highlightedState:"is-highlighted",selectedState:"is-selected",flippedState:"is-flipped",loadingState:"is-loading",noResults:"has-no-results",noChoices:"has-no-choices"},t.DEFAULT_CONFIG={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,allowHTML:!0,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:n.sortByAlpha,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add <b>"'.concat((0,n.sanitise)(e),'"</b>')},maxItemText:function(e){return"Only ".concat(e," values can be added")},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:t.DEFAULT_CLASSNAMES}},18:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},978:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},948:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},359:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},285:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},533:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},187:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(18),t),r(i(978),t),r(i(948),t),r(i(359),t),r(i(285),t),r(i(533),t),r(i(287),t),r(i(132),t),r(i(837),t),r(i(598),t),r(i(369),t),r(i(37),t),r(i(47),t),r(i(923),t),r(i(876),t)},287:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},132:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},837:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},598:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},37:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},369:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},47:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},923:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},876:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},799:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.parseCustomProperties=t.diff=t.cloneObject=t.existsInArray=t.dispatchEvent=t.sortByScore=t.sortByAlpha=t.strToEl=t.sanitise=t.isScrolledIntoView=t.getAdjacentEl=t.wrap=t.isType=t.getType=t.generateId=t.generateChars=t.getRandomNumber=void 0,t.getRandomNumber=function(e,t){return Math.floor(Math.random()*(t-e)+e)},t.generateChars=function(e){return Array.from({length:e},(function(){return(0,t.getRandomNumber)(0,36).toString(36)})).join("")},t.generateId=function(e,i){var n=e.id||e.name&&"".concat(e.name,"-").concat((0,t.generateChars)(2))||(0,t.generateChars)(4);return n=n.replace(/(:|\.|\[|\]|,)/g,""),"".concat(i,"-").concat(n)},t.getType=function(e){return Object.prototype.toString.call(e).slice(8,-1)},t.isType=function(e,i){return null!=i&&(0,t.getType)(i)===e},t.wrap=function(e,t){return void 0===t&&(t=document.createElement("div")),e.parentNode&&(e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t)),t.appendChild(e)},t.getAdjacentEl=function(e,t,i){void 0===i&&(i=1);for(var n="".concat(i>0?"next":"previous","ElementSibling"),r=e[n];r;){if(r.matches(t))return r;r=r[n]}return r},t.isScrolledIntoView=function(e,t,i){return void 0===i&&(i=1),!!e&&(i>0?t.scrollTop+t.offsetHeight>=e.offsetTop+e.offsetHeight:e.offsetTop>=t.scrollTop)},t.sanitise=function(e){return"string"!=typeof e?e:e.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""")},t.strToEl=(i=document.createElement("div"),function(e){var t=e.trim();i.innerHTML=t;for(var n=i.children[0];i.firstChild;)i.removeChild(i.firstChild);return n}),t.sortByAlpha=function(e,t){var i=e.value,n=e.label,r=void 0===n?i:n,s=t.value,o=t.label,a=void 0===o?s:o;return r.localeCompare(a,[],{sensitivity:"base",ignorePunctuation:!0,numeric:!0})},t.sortByScore=function(e,t){var i=e.score,n=void 0===i?0:i,r=t.score;return n-(void 0===r?0:r)},t.dispatchEvent=function(e,t,i){void 0===i&&(i=null);var n=new CustomEvent(t,{detail:i,bubbles:!0,cancelable:!0});return e.dispatchEvent(n)},t.existsInArray=function(e,t,i){return void 0===i&&(i="value"),e.some((function(e){return"string"==typeof t?e[i]===t.trim():e[i]===t}))},t.cloneObject=function(e){return JSON.parse(JSON.stringify(e))},t.diff=function(e,t){var i=Object.keys(e).sort(),n=Object.keys(t).sort();return i.filter((function(e){return n.indexOf(e)<0}))},t.parseCustomProperties=function(e){if(void 0!==e)try{return JSON.parse(e)}catch(t){return e}return{}}},273:function(e,t){var i=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,r=0,s=t.length;r<s;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0,t.defaultState=[],t.default=function(e,n){switch(void 0===e&&(e=t.defaultState),void 0===n&&(n={}),n.type){case"ADD_CHOICE":var r=n,s={id:r.id,elementId:r.elementId,groupId:r.groupId,value:r.value,label:r.label||r.value,disabled:r.disabled||!1,selected:!1,active:!0,score:9999,customProperties:r.customProperties,placeholder:r.placeholder||!1};return i(i([],e,!0),[s],!1);case"ADD_ITEM":var o=n;return o.choiceId>-1?e.map((function(e){var t=e;return t.id===parseInt("".concat(o.choiceId),10)&&(t.selected=!0),t})):e;case"REMOVE_ITEM":var a=n;return a.choiceId&&a.choiceId>-1?e.map((function(e){var t=e;return t.id===parseInt("".concat(a.choiceId),10)&&(t.selected=!1),t})):e;case"FILTER_CHOICES":var c=n;return e.map((function(e){var t=e;return t.active=c.results.some((function(e){var i=e.item,n=e.score;return i.id===t.id&&(t.score=n,!0)})),t}));case"ACTIVATE_CHOICES":var l=n;return e.map((function(e){var t=e;return t.active=l.active,t}));case"CLEAR_CHOICES":return t.defaultState;default:return e}}},871:function(e,t){var i=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,r=0,s=t.length;r<s;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0,t.defaultState=[],t.default=function(e,n){switch(void 0===e&&(e=t.defaultState),void 0===n&&(n={}),n.type){case"ADD_GROUP":var r=n;return i(i([],e,!0),[{id:r.id,value:r.value,active:r.active,disabled:r.disabled}],!1);case"CLEAR_CHOICES":return[];default:return e}}},655:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0;var r=i(791),s=n(i(52)),o=n(i(871)),a=n(i(273)),c=n(i(502)),l=i(799);t.defaultState={groups:[],items:[],choices:[],loading:!1};var h=(0,r.combineReducers)({items:s.default,groups:o.default,choices:a.default,loading:c.default});t.default=function(e,i){var n=e;if("CLEAR_ALL"===i.type)n=t.defaultState;else if("RESET_TO"===i.type)return(0,l.cloneObject)(i.state);return h(n,i)}},52:function(e,t){var i=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,r=0,s=t.length;r<s;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0,t.defaultState=[],t.default=function(e,n){switch(void 0===e&&(e=t.defaultState),void 0===n&&(n={}),n.type){case"ADD_ITEM":var r=n;return i(i([],e,!0),[{id:r.id,choiceId:r.choiceId,groupId:r.groupId,value:r.value,label:r.label,active:!0,highlighted:!1,customProperties:r.customProperties,placeholder:r.placeholder||!1,keyCode:null}],!1).map((function(e){var t=e;return t.highlighted=!1,t}));case"REMOVE_ITEM":return e.map((function(e){var t=e;return t.id===n.id&&(t.active=!1),t}));case"HIGHLIGHT_ITEM":var s=n;return e.map((function(e){var t=e;return t.id===s.id&&(t.highlighted=s.highlighted),t}));default:return e}}},502:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0,t.defaultState=!1,t.default=function(e,i){return void 0===e&&(e=t.defaultState),void 0===i&&(i={}),"SET_IS_LOADING"===i.type?i.isLoading:e}},744:function(e,t,i){var n=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,r=0,s=t.length;r<s;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(791),o=r(i(655)),a=function(){function e(){this._store=(0,s.createStore)(o.default,window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__())}return e.prototype.subscribe=function(e){this._store.subscribe(e)},e.prototype.dispatch=function(e){this._store.dispatch(e)},Object.defineProperty(e.prototype,"state",{get:function(){return this._store.getState()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this.state.items},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeItems",{get:function(){return this.items.filter((function(e){return!0===e.active}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightedActiveItems",{get:function(){return this.items.filter((function(e){return e.active&&e.highlighted}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"choices",{get:function(){return this.state.choices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeChoices",{get:function(){return this.choices.filter((function(e){return!0===e.active}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectableChoices",{get:function(){return this.choices.filter((function(e){return!0!==e.disabled}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"searchableChoices",{get:function(){return this.selectableChoices.filter((function(e){return!0!==e.placeholder}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"placeholderChoice",{get:function(){return n([],this.choices,!0).reverse().find((function(e){return!0===e.placeholder}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groups",{get:function(){return this.state.groups},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeGroups",{get:function(){var e=this.groups,t=this.choices;return e.filter((function(e){var i=!0===e.active&&!1===e.disabled,n=t.some((function(e){return!0===e.active&&!1===e.disabled}));return i&&n}),[])},enumerable:!1,configurable:!0}),e.prototype.isLoading=function(){return this.state.loading},e.prototype.getChoiceById=function(e){return this.activeChoices.find((function(t){return t.id===parseInt(e,10)}))},e.prototype.getGroupById=function(e){return this.groups.find((function(t){return t.id===e}))},e}();t.default=a},686:function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i={containerOuter:function(e,t,i,n,r,s,o){var a=e.classNames.containerOuter,c=Object.assign(document.createElement("div"),{className:a});return c.dataset.type=s,t&&(c.dir=t),n&&(c.tabIndex=0),i&&(c.setAttribute("role",r?"combobox":"listbox"),r&&c.setAttribute("aria-autocomplete","list")),c.setAttribute("aria-haspopup","true"),c.setAttribute("aria-expanded","false"),o&&c.setAttribute("aria-labelledby",o),c},containerInner:function(e){var t=e.classNames.containerInner;return Object.assign(document.createElement("div"),{className:t})},itemList:function(e,t){var i=e.classNames,n=i.list,r=i.listSingle,s=i.listItems;return Object.assign(document.createElement("div"),{className:"".concat(n," ").concat(t?r:s)})},placeholder:function(e,t){var i,n=e.allowHTML,r=e.classNames.placeholder;return Object.assign(document.createElement("div"),((i={className:r})[n?"innerHTML":"innerText"]=t,i))},item:function(e,t,i){var n,r,s=e.allowHTML,o=e.classNames,a=o.item,c=o.button,l=o.highlightedState,h=o.itemSelectable,u=o.placeholder,d=t.id,p=t.value,f=t.label,m=t.customProperties,v=t.active,g=t.disabled,_=t.highlighted,y=t.placeholder,E=Object.assign(document.createElement("div"),((n={className:a})[s?"innerHTML":"innerText"]=f,n));if(Object.assign(E.dataset,{item:"",id:d,value:p,customProperties:m}),v&&E.setAttribute("aria-selected","true"),g&&E.setAttribute("aria-disabled","true"),y&&E.classList.add(u),E.classList.add(_?l:h),i){g&&E.classList.remove(h),E.dataset.deletable="";var b="Remove item",S=Object.assign(document.createElement("button"),((r={type:"button",className:c})[s?"innerHTML":"innerText"]=b,r));S.setAttribute("aria-label","".concat(b,": '").concat(p,"'")),S.dataset.button="",E.appendChild(S)}return E},choiceList:function(e,t){var i=e.classNames.list,n=Object.assign(document.createElement("div"),{className:i});return t||n.setAttribute("aria-multiselectable","true"),n.setAttribute("role","listbox"),n},choiceGroup:function(e,t){var i,n=e.allowHTML,r=e.classNames,s=r.group,o=r.groupHeading,a=r.itemDisabled,c=t.id,l=t.value,h=t.disabled,u=Object.assign(document.createElement("div"),{className:"".concat(s," ").concat(h?a:"")});return u.setAttribute("role","group"),Object.assign(u.dataset,{group:"",id:c,value:l}),h&&u.setAttribute("aria-disabled","true"),u.appendChild(Object.assign(document.createElement("div"),((i={className:o})[n?"innerHTML":"innerText"]=l,i))),u},choice:function(e,t,i){var n,r=e.allowHTML,s=e.classNames,o=s.item,a=s.itemChoice,c=s.itemSelectable,l=s.selectedState,h=s.itemDisabled,u=s.placeholder,d=t.id,p=t.value,f=t.label,m=t.groupId,v=t.elementId,g=t.disabled,_=t.selected,y=t.placeholder,E=Object.assign(document.createElement("div"),((n={id:v})[r?"innerHTML":"innerText"]=f,n.className="".concat(o," ").concat(a),n));return _&&E.classList.add(l),y&&E.classList.add(u),E.setAttribute("role",m&&m>0?"treeitem":"option"),Object.assign(E.dataset,{choice:"",id:d,value:p,selectText:i}),g?(E.classList.add(h),E.dataset.choiceDisabled="",E.setAttribute("aria-disabled","true")):(E.classList.add(c),E.dataset.choiceSelectable=""),E},input:function(e,t){var i=e.classNames,n=i.input,r=i.inputCloned,s=Object.assign(document.createElement("input"),{type:"search",name:"search_terms",className:"".concat(n," ").concat(r),autocomplete:"off",autocapitalize:"off",spellcheck:!1});return s.setAttribute("role","textbox"),s.setAttribute("aria-autocomplete","list"),s.setAttribute("aria-label",t),s},dropdown:function(e){var t=e.classNames,i=t.list,n=t.listDropdown,r=document.createElement("div");return r.classList.add(i,n),r.setAttribute("aria-expanded","false"),r},notice:function(e,t,i){var n,r=e.allowHTML,s=e.classNames,o=s.item,a=s.itemChoice,c=s.noResults,l=s.noChoices;void 0===i&&(i="");var h=[o,a];return"no-choices"===i?h.push(l):"no-results"===i&&h.push(c),Object.assign(document.createElement("div"),((n={})[r?"innerHTML":"innerText"]=t,n.className=h.join(" "),n))},option:function(e){var t=e.label,i=e.value,n=e.customProperties,r=e.active,s=e.disabled,o=new Option(t,i,!1,r);return n&&(o.dataset.customProperties="".concat(n)),o.disabled=!!s,o}};t.default=i},996:function(e){var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((i=e,Array.isArray(i)?[]:{}),e,t):e;var i}function r(e,t,i){return e.concat(t).map((function(e){return n(e,i)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function o(e,t){try{return t in e}catch(e){return!1}}function a(e,i,c){(c=c||{}).arrayMerge=c.arrayMerge||r,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=n;var l=Array.isArray(i);return l===Array.isArray(e)?l?c.arrayMerge(e,i,c):function(e,t,i){var r={};return i.isMergeableObject(e)&&s(e).forEach((function(t){r[t]=n(e[t],i)})),s(t).forEach((function(s){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(o(e,s)&&i.isMergeableObject(t[s])?r[s]=function(e,t){if(!t.customMerge)return a;var i=t.customMerge(e);return"function"==typeof i?i:a}(s,i)(e[s],t[s],i):r[s]=n(t[s],i))})),r}(e,i,c):n(i,c)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,i){return a(e,i,t)}),{})};var c=a;e.exports=c},221:function(e,t,i){function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===l(e)}function r(e){return"string"==typeof e}function s(e){return"number"==typeof e}function o(e){return"object"==typeof e}function a(e){return null!=e}function c(e){return!e.trim().length}function l(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}i.r(t),i.d(t,{default:function(){return R}});const h=Object.prototype.hasOwnProperty;class u{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let i=d(e);t+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function d(e){let t=null,i=null,s=null,o=1,a=null;if(r(e)||n(e))s=e,t=p(e),i=f(e);else{if(!h.call(e,"name"))throw new Error("Missing name property in key");const n=e.name;if(s=n,h.call(e,"weight")&&(o=e.weight,o<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(n));t=p(n),i=f(n),a=e.getFn}return{path:t,id:i,weight:o,src:s,getFn:a}}function p(e){return n(e)?e:e.split(".")}function f(e){return n(e)?e.join("."):e}var m={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(e,t){let i=[],c=!1;const h=(e,t,u)=>{if(a(e))if(t[u]){const d=e[t[u]];if(!a(d))return;if(u===t.length-1&&(r(d)||s(d)||function(e){return!0===e||!1===e||function(e){return o(e)&&null!==e}(e)&&"[object Boolean]"==l(e)}(d)))i.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(d));else if(n(d)){c=!0;for(let e=0,i=d.length;e<i;e+=1)h(d[e],t,u+1)}else t.length&&h(d,t,u+1)}else i.push(e)};return h(e,r(t)?t.split("."):t,0),c?i:i[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};const v=/[^ ]+/g;class g{constructor({getFn:e=m.getFn,fieldNormWeight:t=m.fieldNormWeight}={}){this.norm=function(e=1,t=3){const i=new Map,n=Math.pow(10,t);return{get(t){const r=t.match(v).length;if(i.has(r))return i.get(r);const s=1/Math.pow(r,.5*e),o=parseFloat(Math.round(s*n)/n);return i.set(r,o),o},clear(){i.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,r(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();r(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t<i;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!a(e)||c(e))return;let i={v:e,i:t,n:this.norm.get(e)};this.records.push(i)}_addObject(e,t){let i={i:t,$:{}};this.keys.forEach(((t,s)=>{let o=t.getFn?t.getFn(e):this.getFn(e,t.path);if(a(o))if(n(o)){let e=[];const t=[{nestedArrIndex:-1,value:o}];for(;t.length;){const{nestedArrIndex:i,value:s}=t.pop();if(a(s))if(r(s)&&!c(s)){let t={v:s,i:i,n:this.norm.get(s)};e.push(t)}else n(s)&&s.forEach(((e,i)=>{t.push({nestedArrIndex:i,value:e})}))}i.$[s]=e}else if(r(o)&&!c(o)){let e={v:o,n:this.norm.get(o)};i.$[s]=e}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function _(e,t,{getFn:i=m.getFn,fieldNormWeight:n=m.fieldNormWeight}={}){const r=new g({getFn:i,fieldNormWeight:n});return r.setKeys(e.map(d)),r.setSources(t),r.create(),r}function y(e,{errors:t=0,currentLocation:i=0,expectedLocation:n=0,distance:r=m.distance,ignoreLocation:s=m.ignoreLocation}={}){const o=t/e.length;if(s)return o;const a=Math.abs(n-i);return r?o+a/r:a?1:o}const E=32;function b(e){let t={};for(let i=0,n=e.length;i<n;i+=1){const r=e.charAt(i);t[r]=(t[r]||0)|1<<n-i-1}return t}class S{constructor(e,{location:t=m.location,threshold:i=m.threshold,distance:n=m.distance,includeMatches:r=m.includeMatches,findAllMatches:s=m.findAllMatches,minMatchCharLength:o=m.minMatchCharLength,isCaseSensitive:a=m.isCaseSensitive,ignoreLocation:c=m.ignoreLocation}={}){if(this.options={location:t,threshold:i,distance:n,includeMatches:r,findAllMatches:s,minMatchCharLength:o,isCaseSensitive:a,ignoreLocation:c},this.pattern=a?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const l=(e,t)=>{this.chunks.push({pattern:e,alphabet:b(e),startIndex:t})},h=this.pattern.length;if(h>E){let e=0;const t=h%E,i=h-t;for(;e<i;)l(this.pattern.substr(e,E),e),e+=E;if(t){const e=h-E;l(this.pattern.substr(e),e)}}else l(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:i}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return i&&(t.indices=[[0,e.length-1]]),t}const{location:n,distance:r,threshold:s,findAllMatches:o,minMatchCharLength:a,ignoreLocation:c}=this.options;let l=[],h=0,u=!1;this.chunks.forEach((({pattern:t,alphabet:d,startIndex:p})=>{const{isMatch:f,score:v,indices:g}=function(e,t,i,{location:n=m.location,distance:r=m.distance,threshold:s=m.threshold,findAllMatches:o=m.findAllMatches,minMatchCharLength:a=m.minMatchCharLength,includeMatches:c=m.includeMatches,ignoreLocation:l=m.ignoreLocation}={}){if(t.length>E)throw new Error("Pattern length exceeds max of 32.");const h=t.length,u=e.length,d=Math.max(0,Math.min(n,u));let p=s,f=d;const v=a>1||c,g=v?Array(u):[];let _;for(;(_=e.indexOf(t,f))>-1;){let e=y(t,{currentLocation:_,expectedLocation:d,distance:r,ignoreLocation:l});if(p=Math.min(e,p),f=_+h,v){let e=0;for(;e<h;)g[_+e]=1,e+=1}}f=-1;let b=[],S=1,O=h+u;const I=1<<h-1;for(let n=0;n<h;n+=1){let s=0,a=O;for(;s<a;)y(t,{errors:n,currentLocation:d+a,expectedLocation:d,distance:r,ignoreLocation:l})<=p?s=a:O=a,a=Math.floor((O-s)/2+s);O=a;let c=Math.max(1,d-a+1),m=o?u:Math.min(d+a,u)+h,_=Array(m+2);_[m+1]=(1<<n)-1;for(let s=m;s>=c;s-=1){let o=s-1,a=i[e.charAt(o)];if(v&&(g[o]=+!!a),_[s]=(_[s+1]<<1|1)&a,n&&(_[s]|=(b[s+1]|b[s])<<1|1|b[s+1]),_[s]&I&&(S=y(t,{errors:n,currentLocation:o,expectedLocation:d,distance:r,ignoreLocation:l}),S<=p)){if(p=S,f=o,f<=d)break;c=Math.max(1,2*d-f)}}if(y(t,{errors:n+1,currentLocation:d,expectedLocation:d,distance:r,ignoreLocation:l})>p)break;b=_}const C={isMatch:f>=0,score:Math.max(.001,S)};if(v){const e=function(e=[],t=m.minMatchCharLength){let i=[],n=-1,r=-1,s=0;for(let o=e.length;s<o;s+=1){let o=e[s];o&&-1===n?n=s:o||-1===n||(r=s-1,r-n+1>=t&&i.push([n,r]),n=-1)}return e[s-1]&&s-n>=t&&i.push([n,s-1]),i}(g,a);e.length?c&&(C.indices=e):C.isMatch=!1}return C}(e,t,d,{location:n+p,distance:r,threshold:s,findAllMatches:o,minMatchCharLength:a,includeMatches:i,ignoreLocation:c});f&&(u=!0),h+=v,f&&g&&(l=[...l,...g])}));let d={isMatch:u,score:u?h/this.chunks.length:1};return u&&i&&(d.indices=l),d}}class O{constructor(e){this.pattern=e}static isMultiMatch(e){return I(e,this.multiRegex)}static isSingleMatch(e){return I(e,this.singleRegex)}search(){}}function I(e,t){const i=e.match(t);return i?i[1]:null}class C extends O{constructor(e,{location:t=m.location,threshold:i=m.threshold,distance:n=m.distance,includeMatches:r=m.includeMatches,findAllMatches:s=m.findAllMatches,minMatchCharLength:o=m.minMatchCharLength,isCaseSensitive:a=m.isCaseSensitive,ignoreLocation:c=m.ignoreLocation}={}){super(e),this._bitapSearch=new S(e,{location:t,threshold:i,distance:n,includeMatches:r,findAllMatches:s,minMatchCharLength:o,isCaseSensitive:a,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class T extends O{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,i=0;const n=[],r=this.pattern.length;for(;(t=e.indexOf(this.pattern,i))>-1;)i=t+r,n.push([t,i-1]);const s=!!n.length;return{isMatch:s,score:s?0:1,indices:n}}}const L=[class extends O{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},T,class extends O{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends O{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends O{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends O{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends O{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},C],w=L.length,A=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,M=new Set([C.type,T.type]);const P=[];function x(e,t){for(let i=0,n=P.length;i<n;i+=1){let n=P[i];if(n.condition(e,t))return new n(e,t)}return new S(e,t)}const N="$and",D=e=>!(!e.$and&&!e.$or),j=e=>({[N]:Object.keys(e).map((t=>({[t]:e[t]})))});function F(e,t,{auto:i=!0}={}){const s=e=>{let a=Object.keys(e);const c=(e=>!!e.$path)(e);if(!c&&a.length>1&&!D(e))return s(j(e));if((e=>!n(e)&&o(e)&&!D(e))(e)){const n=c?e.$path:a[0],s=c?e.$val:e[n];if(!r(s))throw new Error((e=>`Invalid value for key ${e}`)(n));const o={keyId:f(n),pattern:s};return i&&(o.searcher=x(s,t)),o}let l={children:[],operator:a[0]};return a.forEach((t=>{const i=e[t];n(i)&&i.forEach((e=>{l.children.push(s(e))}))})),l};return D(e)||(e=j(e)),s(e)}function k(e,t){const i=e.matches;t.matches=[],a(i)&&i.forEach((e=>{if(!a(e.indices)||!e.indices.length)return;const{indices:i,value:n}=e;let r={indices:i,value:n};e.key&&(r.key=e.key.src),e.idx>-1&&(r.refIndex=e.idx),t.matches.push(r)}))}function K(e,t){t.score=e.score}class R{constructor(e,t={},i){this.options={...m,...t},this.options.useExtendedSearch,this._keyStore=new u(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof g))throw new Error("Incorrect 'index' type");this._myIndex=t||_(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){a(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let i=0,n=this._docs.length;i<n;i+=1){const r=this._docs[i];e(r,i)&&(this.removeAt(i),i-=1,n-=1,t.push(r))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:i,includeScore:n,shouldSort:o,sortFn:a,ignoreFieldNorm:c}=this.options;let l=r(e)?r(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,{ignoreFieldNorm:t=m.ignoreFieldNorm}){e.forEach((e=>{let i=1;e.matches.forEach((({key:e,norm:n,score:r})=>{const s=e?e.weight:null;i*=Math.pow(0===r&&s?Number.EPSILON:r,(s||1)*(t?1:n))})),e.score=i}))}(l,{ignoreFieldNorm:c}),o&&l.sort(a),s(t)&&t>-1&&(l=l.slice(0,t)),function(e,t,{includeMatches:i=m.includeMatches,includeScore:n=m.includeScore}={}){const r=[];return i&&r.push(k),n&&r.push(K),e.map((e=>{const{idx:i}=e,n={item:t[i],refIndex:i};return r.length&&r.forEach((t=>{t(e,n)})),n}))}(l,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const t=x(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach((({v:e,i:i,n:r})=>{if(!a(e))return;const{isMatch:s,score:o,indices:c}=t.searchIn(e);s&&n.push({item:e,idx:i,matches:[{score:o,value:e,norm:r,indices:c}]})})),n}_searchLogical(e){const t=F(e,this.options),i=(e,t,n)=>{if(!e.children){const{keyId:i,searcher:r}=e,s=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:r});return s&&s.length?[{idx:n,item:t,matches:s}]:[]}const r=[];for(let s=0,o=e.children.length;s<o;s+=1){const o=e.children[s],a=i(o,t,n);if(a.length)r.push(...a);else if(e.operator===N)return[]}return r},n=this._myIndex.records,r={},s=[];return n.forEach((({$:e,i:n})=>{if(a(e)){let o=i(t,e,n);o.length&&(r[n]||(r[n]={idx:n,item:e,matches:[]},s.push(r[n])),o.forEach((({matches:e})=>{r[n].matches.push(...e)})))}})),s}_searchObjectList(e){const t=x(e,this.options),{keys:i,records:n}=this._myIndex,r=[];return n.forEach((({$:e,i:n})=>{if(!a(e))return;let s=[];i.forEach(((i,n)=>{s.push(...this._findMatches({key:i,value:e[n],searcher:t}))})),s.length&&r.push({idx:n,item:e,matches:s})})),r}_findMatches({key:e,value:t,searcher:i}){if(!a(t))return[];let r=[];if(n(t))t.forEach((({v:t,i:n,n:s})=>{if(!a(t))return;const{isMatch:o,score:c,indices:l}=i.searchIn(t);o&&r.push({score:c,key:e,value:t,idx:n,norm:s,indices:l})}));else{const{v:n,n:s}=t,{isMatch:o,score:a,indices:c}=i.searchIn(n);o&&r.push({score:a,key:e,value:n,norm:s,indices:c})}return r}}R.version="6.6.2",R.createIndex=_,R.parseIndex=function(e,{getFn:t=m.getFn,fieldNormWeight:i=m.fieldNormWeight}={}){const{keys:n,records:r}=e,s=new g({getFn:t,fieldNormWeight:i});return s.setKeys(n),s.setIndexRecords(r),s},R.config=m,R.parseQuery=F,function(...e){P.push(...e)}(class{constructor(e,{isCaseSensitive:t=m.isCaseSensitive,includeMatches:i=m.includeMatches,minMatchCharLength:n=m.minMatchCharLength,ignoreLocation:r=m.ignoreLocation,findAllMatches:s=m.findAllMatches,location:o=m.location,threshold:a=m.threshold,distance:c=m.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:s,ignoreLocation:r,location:o,threshold:a,distance:c},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map((e=>{let i=e.trim().split(A).filter((e=>e&&!!e.trim())),n=[];for(let e=0,r=i.length;e<r;e+=1){const r=i[e];let s=!1,o=-1;for(;!s&&++o<w;){const e=L[o];let i=e.isMultiMatch(r);i&&(n.push(new e(i,t)),s=!0)}if(!s)for(o=-1;++o<w;){const e=L[o];let i=e.isSingleMatch(r);if(i){n.push(new e(i,t));break}}}return n}))}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:n}=this.options;e=n?e:e.toLowerCase();let r=0,s=[],o=0;for(let n=0,a=t.length;n<a;n+=1){const a=t[n];s.length=0,r=0;for(let t=0,n=a.length;t<n;t+=1){const n=a[t],{isMatch:c,indices:l,score:h}=n.search(e);if(!c){o=0,r=0,s.length=0;break}if(r+=1,o+=h,i){const e=n.constructor.type;M.has(e)?s=[...s,...l]:s.push(l)}}if(r){let e={isMatch:!0,score:o/r};return i&&(e.indices=s),e}}return{isMatch:!1,score:1}}})},791:function(e,t,i){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t,i){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t);if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function o(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?s(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function a(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}i.r(t),i.d(t,{__DO_NOT_USE__ActionTypes:function(){return h},applyMiddleware:function(){return _},bindActionCreators:function(){return v},combineReducers:function(){return f},compose:function(){return g},createStore:function(){return d},legacy_createStore:function(){return p}});var c="function"==typeof Symbol&&Symbol.observable||"@@observable",l=function(){return Math.random().toString(36).substring(7).split("").join(".")},h={INIT:"@@redux/INIT"+l(),REPLACE:"@@redux/REPLACE"+l(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+l()}};function u(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function d(e,t,i){var n;if("function"==typeof t&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(a(0));if("function"==typeof t&&void 0===i&&(i=t,t=void 0),void 0!==i){if("function"!=typeof i)throw new Error(a(1));return i(d)(e,t)}if("function"!=typeof e)throw new Error(a(2));var r=e,s=t,o=[],l=o,p=!1;function f(){l===o&&(l=o.slice())}function m(){if(p)throw new Error(a(3));return s}function v(e){if("function"!=typeof e)throw new Error(a(4));if(p)throw new Error(a(5));var t=!0;return f(),l.push(e),function(){if(t){if(p)throw new Error(a(6));t=!1,f();var i=l.indexOf(e);l.splice(i,1),o=null}}}function g(e){if(!u(e))throw new Error(a(7));if(void 0===e.type)throw new Error(a(8));if(p)throw new Error(a(9));try{p=!0,s=r(s,e)}finally{p=!1}for(var t=o=l,i=0;i<t.length;i++)(0,t[i])();return e}function _(e){if("function"!=typeof e)throw new Error(a(10));r=e,g({type:h.REPLACE})}function y(){var e,t=v;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(a(11));function i(){e.next&&e.next(m())}return i(),{unsubscribe:t(i)}}})[c]=function(){return this},e}return g({type:h.INIT}),(n={dispatch:g,subscribe:v,getState:m,replaceReducer:_})[c]=y,n}var p=d;function f(e){for(var t=Object.keys(e),i={},n=0;n<t.length;n++){var r=t[n];"function"==typeof e[r]&&(i[r]=e[r])}var s,o=Object.keys(i);try{!function(e){Object.keys(e).forEach((function(t){var i=e[t];if(void 0===i(void 0,{type:h.INIT}))throw new Error(a(12));if(void 0===i(void 0,{type:h.PROBE_UNKNOWN_ACTION()}))throw new Error(a(13))}))}(i)}catch(e){s=e}return function(e,t){if(void 0===e&&(e={}),s)throw s;for(var n=!1,r={},c=0;c<o.length;c++){var l=o[c],h=i[l],u=e[l],d=h(u,t);if(void 0===d)throw t&&t.type,new Error(a(14));r[l]=d,n=n||d!==u}return(n=n||o.length!==Object.keys(e).length)?r:e}}function m(e,t){return function(){return t(e.apply(this,arguments))}}function v(e,t){if("function"==typeof e)return m(e,t);if("object"!=typeof e||null===e)throw new Error(a(16));var i={};for(var n in e){var r=e[n];"function"==typeof r&&(i[n]=m(r,t))}return i}function g(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function _(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(e){return function(){var i=e.apply(void 0,arguments),n=function(){throw new Error(a(15))},r={getState:i.getState,dispatch:function(){return n.apply(void 0,arguments)}},s=t.map((function(e){return e(r)}));return n=g.apply(void 0,s)(i.dispatch),o(o({},i),{},{dispatch:n})}}}}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n,r,s={};n=i(373),r=i.n(n),i(187),i(883),i(789),i(686),s.default=r(),window.Choices=s.default}(); \ No newline at end of file diff --git a/application/frontend/src/static/clientlibs/vendor/select/style.css b/application/frontend/src/static/clientlibs/vendor/select/style.css index 2d9c545b3..feb4139c0 100644 --- a/application/frontend/src/static/clientlibs/vendor/select/style.css +++ b/application/frontend/src/static/clientlibs/vendor/select/style.css @@ -1,50 +1,51 @@ +/* =============================== += Choices = +=============================== */ .choices { position: relative; + overflow: hidden; margin-bottom: 24px; - font-size: 16px -} - -.choices:focus { - outline: none -} - -.choices:last-child { - margin-bottom: 0 -} - -.choices.is-disabled .choices__inner, -.choices.is-disabled .choices__input { + font-size: 16px; + } + .choices:focus { + outline: none; + } + .choices:last-child { + margin-bottom: 0; + } + .choices.is-open { + overflow: visible; + } + .choices.is-disabled .choices__inner, + .choices.is-disabled .choices__input { background-color: #eaeaea; cursor: not-allowed; -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none -} - -.choices.is-disabled .choices__item { - cursor: not-allowed -} - -.choices[data-type*=select-one] { - cursor: pointer -} - -.choices[data-type*=select-one] .choices__inner { - padding-bottom: 7.5px -} - -.choices[data-type*=select-one] .choices__input { + user-select: none; + } + .choices.is-disabled .choices__item { + cursor: not-allowed; + } + .choices [hidden] { + display: none !important; + } + + .choices[data-type*=select-one] { + cursor: pointer; + } + .choices[data-type*=select-one] .choices__inner { + padding-bottom: 7.5px; + } + .choices[data-type*=select-one] .choices__input { display: block; width: 100%; padding: 10px; border-bottom: 1px solid #ddd; background-color: #fff; - margin: 0 -} - -.choices[data-type*=select-one] .choices__button { - background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==); + margin: 0; + } + .choices[data-type*=select-one] .choices__button { + background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg=="); padding: 0; background-size: 8px; position: absolute; @@ -55,19 +56,18 @@ height: 20px; width: 20px; border-radius: 10em; - opacity: .5 -} - -.choices[data-type*=select-one] .choices__button:focus, -.choices[data-type*=select-one] .choices__button:hover { - opacity: 1 -} - -.choices[data-type*=select-one] .choices__button:focus { - box-shadow: 0 0 0 2px #00bcd4 -} - -.choices[data-type*=select-one]:after { + opacity: 0.25; + } + .choices[data-type*=select-one] .choices__button:hover, .choices[data-type*=select-one] .choices__button:focus { + opacity: 1; + } + .choices[data-type*=select-one] .choices__button:focus { + box-shadow: 0 0 0 2px #00bcd4; + } + .choices[data-type*=select-one] .choices__item[data-value=""] .choices__button { + display: none; + } + .choices[data-type*=select-one]::after { content: ""; height: 0; width: 0; @@ -78,105 +78,94 @@ right: 11.5px; top: 50%; margin-top: -2.5px; - pointer-events: none -} - -.choices[data-type*=select-one].is-open:after { + pointer-events: none; + } + .choices[data-type*=select-one].is-open::after { border-color: transparent transparent #333 transparent; - margin-top: -7.5px -} - -.choices[data-type*=select-one][dir=rtl]:after { + margin-top: -7.5px; + } + .choices[data-type*=select-one][dir=rtl]::after { left: 11.5px; - right: auto -} - -.choices[data-type*=select-one][dir=rtl] .choices__button { + right: auto; + } + .choices[data-type*=select-one][dir=rtl] .choices__button { right: auto; left: 0; margin-left: 25px; - margin-right: 0 -} - -.choices[data-type*=select-multiple] .choices__inner, -.choices[data-type*=text] .choices__inner { - cursor: text -} - -.choices[data-type*=select-multiple] .choices__button, -.choices[data-type*=text] .choices__button { + margin-right: 0; + } + + .choices[data-type*=select-multiple] .choices__inner, + .choices[data-type*=text] .choices__inner { + cursor: text; + } + .choices[data-type*=select-multiple] .choices__button, + .choices[data-type*=text] .choices__button { position: relative; display: inline-block; - margin: 0 -4px 0 8px; + margin-top: 0; + margin-right: -4px; + margin-bottom: 0; + margin-left: 8px; padding-left: 16px; border-left: 1px solid #008fa1; - background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==); + background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg=="); background-size: 8px; width: 8px; line-height: 1; - opacity: .75; - border-radius: 0 -} - -.choices[data-type*=select-multiple] .choices__button:focus, -.choices[data-type*=select-multiple] .choices__button:hover, -.choices[data-type*=text] .choices__button:focus, -.choices[data-type*=text] .choices__button:hover { - opacity: 1 -} - -.choices__inner { + opacity: 0.75; + border-radius: 0; + } + .choices[data-type*=select-multiple] .choices__button:hover, .choices[data-type*=select-multiple] .choices__button:focus, + .choices[data-type*=text] .choices__button:hover, + .choices[data-type*=text] .choices__button:focus { + opacity: 1; + } + + .choices__inner { display: inline-block; vertical-align: top; width: 100%; background-color: #f9f9f9; padding: 7.5px 7.5px 3.75px; border: 1px solid #ddd; - border-radius: 7px; + border-radius: 2.5px; font-size: 14px; min-height: 44px; - overflow: hidden -} - -.is-focused .choices__inner, -.is-open .choices__inner { - border-color: #b7b7b7 -} - -.is-open .choices__inner { - border-radius: 2.5px 2.5px 0 0 -} - -.is-flipped.is-open .choices__inner { - border-radius: 0 0 2.5px 2.5px -} - -.choices__list { + overflow: hidden; + } + .is-focused .choices__inner, .is-open .choices__inner { + border-color: #b7b7b7; + } + .is-open .choices__inner { + border-radius: 2.5px 2.5px 0 0; + } + .is-flipped.is-open .choices__inner { + border-radius: 0 0 2.5px 2.5px; + } + + .choices__list { margin: 0; padding-left: 0; - list-style: none -} - -.choices__list--single { + list-style: none; + } + .choices__list--single { display: inline-block; padding: 4px 16px 4px 4px; - width: 100% -} - -[dir=rtl] .choices__list--single { + width: 100%; + } + [dir=rtl] .choices__list--single { padding-right: 4px; - padding-left: 16px -} - -.choices__list--single .choices__item { - width: 100% -} - -.choices__list--multiple { - display: inline -} - -.choices__list--multiple .choices__item { + padding-left: 16px; + } + .choices__list--single .choices__item { + width: 100%; + } + + .choices__list--multiple { + display: inline; + } + .choices__list--multiple .choices__item { display: inline-block; vertical-align: middle; border-radius: 20px; @@ -188,31 +177,28 @@ background-color: #00bcd4; border: 1px solid #00a5bb; color: #fff; - word-break: break-all -} - -.choices__list--multiple .choices__item[data-deletable] { - padding-right: 5px -} - -[dir=rtl] .choices__list--multiple .choices__item { + word-break: break-all; + box-sizing: border-box; + } + .choices__list--multiple .choices__item[data-deletable] { + padding-right: 5px; + } + [dir=rtl] .choices__list--multiple .choices__item { margin-right: 0; - margin-left: 3.75px -} - -.choices__list--multiple .choices__item.is-highlighted { + margin-left: 3.75px; + } + .choices__list--multiple .choices__item.is-highlighted { background-color: #00a5bb; - border: 1px solid #008fa1 -} - -.is-disabled .choices__list--multiple .choices__item { - background-color: #aaa; - border: 1px solid #919191 -} - -.choices__list--dropdown { - display: none; - z-index: 999 !important; + border: 1px solid #008fa1; + } + .is-disabled .choices__list--multiple .choices__item { + background-color: #aaaaaa; + border: 1px solid #919191; + } + + .choices__list--dropdown, .choices__list[aria-expanded] { + visibility: hidden; + z-index: 1; position: absolute; width: 100%; background-color: #fff; @@ -222,120 +208,105 @@ border-bottom-left-radius: 2.5px; border-bottom-right-radius: 2.5px; overflow: hidden; - word-break: break-all -} - -.choices__list--dropdown.is-active { - display: block -} - -.is-open .choices__list--dropdown { - border-color: #b7b7b7 -} - -.is-flipped .choices__list--dropdown { + word-break: break-all; + will-change: visibility; + } + .is-active.choices__list--dropdown, .is-active.choices__list[aria-expanded] { + visibility: visible; + } + .is-open .choices__list--dropdown, .is-open .choices__list[aria-expanded] { + border-color: #b7b7b7; + } + .is-flipped .choices__list--dropdown, .is-flipped .choices__list[aria-expanded] { top: auto; bottom: 100%; margin-top: 0; margin-bottom: -1px; - border-radius: .25rem .25rem 0 0 -} - -.choices__list--dropdown .choices__list { + border-radius: 0.25rem 0.25rem 0 0; + } + .choices__list--dropdown .choices__list, .choices__list[aria-expanded] .choices__list { position: relative; max-height: 300px; overflow: auto; -webkit-overflow-scrolling: touch; - will-change: scroll-position -} - -.choices__list--dropdown .choices__item { + will-change: scroll-position; + } + .choices__list--dropdown .choices__item, .choices__list[aria-expanded] .choices__item { position: relative; padding: 10px; - font-size: 14px -} - -[dir=rtl] .choices__list--dropdown .choices__item { - text-align: right -} - -@media (min-width:640px) { - .choices__list--dropdown .choices__item--selectable { - padding-right: 100px + font-size: 14px; + } + [dir=rtl] .choices__list--dropdown .choices__item, [dir=rtl] .choices__list[aria-expanded] .choices__item { + text-align: right; + } + @media (min-width: 640px) { + .choices__list--dropdown .choices__item--selectable, .choices__list[aria-expanded] .choices__item--selectable { + padding-right: 100px; } - - .choices__list--dropdown .choices__item--selectable:after { - content: attr(data-select-text); - font-size: 12px; - opacity: 0; - position: absolute; - right: 10px; - top: 50%; - transform: translateY(-50%) + .choices__list--dropdown .choices__item--selectable::after, .choices__list[aria-expanded] .choices__item--selectable::after { + content: attr(data-select-text); + font-size: 12px; + opacity: 0; + position: absolute; + right: 10px; + top: 50%; + transform: translateY(-50%); } - - [dir=rtl] .choices__list--dropdown .choices__item--selectable { - text-align: right; - padding-left: 100px; - padding-right: 10px + [dir=rtl] .choices__list--dropdown .choices__item--selectable, [dir=rtl] .choices__list[aria-expanded] .choices__item--selectable { + text-align: right; + padding-left: 100px; + padding-right: 10px; } - - [dir=rtl] .choices__list--dropdown .choices__item--selectable:after { - right: auto; - left: 10px + [dir=rtl] .choices__list--dropdown .choices__item--selectable::after, [dir=rtl] .choices__list[aria-expanded] .choices__item--selectable::after { + right: auto; + left: 10px; } -} - -.choices__list--dropdown .choices__item--selectable.is-highlighted { - background-color: #f2f2f2 -} - -.choices__list--dropdown .choices__item--selectable.is-highlighted:after { - opacity: .5 -} - -.choices__item { - cursor: default -} - -.choices__item--selectable { - cursor: pointer -} - -.choices__item--disabled { + } + .choices__list--dropdown .choices__item--selectable.is-highlighted, .choices__list[aria-expanded] .choices__item--selectable.is-highlighted { + background-color: #f2f2f2; + } + .choices__list--dropdown .choices__item--selectable.is-highlighted::after, .choices__list[aria-expanded] .choices__item--selectable.is-highlighted::after { + opacity: 0.5; + } + + .choices__item { + cursor: default; + } + + .choices__item--selectable { + cursor: pointer; + } + + .choices__item--disabled { cursor: not-allowed; -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - opacity: .5 -} - -.choices__heading { + user-select: none; + opacity: 0.5; + } + + .choices__heading { font-weight: 600; font-size: 12px; padding: 10px; border-bottom: 1px solid #f7f7f7; - color: gray -} - -.choices__button { + color: gray; + } + + .choices__button { text-indent: -9999px; -webkit-appearance: none; - -moz-appearance: none; - appearance: none; + appearance: none; border: 0; background-color: transparent; background-repeat: no-repeat; background-position: center; - cursor: pointer -} - -.choices__button:focus { - outline: none -} - -.choices__input { + cursor: pointer; + } + .choices__button:focus { + outline: none; + } + + .choices__input { display: inline-block; vertical-align: baseline; background-color: #f9f9f9; @@ -344,24 +315,26 @@ border: 0; border-radius: 0; max-width: 100%; - padding: 4px 0 4px 2px -} - -.choices__input:focus { - outline: 0 -} - -[dir=rtl] .choices__input { + padding: 4px 0 4px 2px; + } + .choices__input:focus { + outline: 0; + } + .choices__input::-webkit-search-decoration, .choices__input::-webkit-search-cancel-button, .choices__input::-webkit-search-results-button, .choices__input::-webkit-search-results-decoration { + display: none; + } + .choices__input::-ms-clear, .choices__input::-ms-reveal { + display: none; + width: 0; + height: 0; + } + [dir=rtl] .choices__input { padding-right: 2px; - padding-left: 0 -} - -.choices__placeholder { - opacity: .5 -} - -.choices[data-type*=select-multiple] .choices__input.is-hidden, -.choices[data-type*=select-one] .choices__input.is-hidden, -.choices__input.is-hidden { - display: none -} \ No newline at end of file + padding-left: 0; + } + + .choices__placeholder { + opacity: 0.5; + } + + /* ===== End of Choices ====== */ \ No newline at end of file From 7c116399f8d0b317a32c941a7c812f186ac3f9e2 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 30 Apr 2024 15:15:54 +1000 Subject: [PATCH 091/206] ensure id attributes for each form field is prefixed with id of parent. --- .../apps/typerefinery/components/forms/field/variant.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html index 3f94b0599..d30a0ad11 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html @@ -1,6 +1,6 @@ <template data-sly-template.variant="${ @ model }"> - <field id="${model.id}" class="${model.componentClassNames}" data-fieldid="${model.id}" label="${label}"> - <sly data-sly-resource="${'label' @ selectors=['id', resource.name]}"></sly> - <sly data-sly-resource="${'field' @ selectors=['id', resource.name]}"></sly> + <field id="${model.id}" class="${model.componentClassNames}" data-fieldid="${model.id}" label="${label}"> + <sly data-sly-set.labelid="${'{0}-{1}' @ format=[model.id, resource.name]}" data-sly-resource="${'label' @ selectors=['id', labelid]}"></sly> + <sly data-sly-set.inputid="${'{0}-{1}' @ format=[model.id, resource.name]}" data-sly-resource="${'field' @ selectors=['id', inputid]}"></sly> </field> </template> \ No newline at end of file From 331060bda0e24677074791962f662a96571288e8 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 7 May 2024 12:05:08 +1000 Subject: [PATCH 092/206] ensure form component name is resource name. --- .../websight/models/components/BaseFormComponent.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java index 854a2b927..7d363d0d5 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java @@ -42,7 +42,7 @@ public class BaseFormComponent extends BaseComponent { public static final String PROPERTY_PLACEHOLDER = "placeholder"; @Self - private SlingHttpServletRequest request; + protected SlingHttpServletRequest request; @Inject @Getter @@ -95,7 +95,7 @@ protected void init() { } super.init(); if (StringUtils.isBlank(this.name)) { - this.name = this.id; + this.name = resource.getName(); } } From 0725f3bb0a69cad48ff1c87b9cae4c1fe7bd2db5 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 7 May 2024 12:06:40 +1000 Subject: [PATCH 093/206] update label to ensure for works. --- .../models/components/forms/Label.java | 25 +++++++++++++++++++ .../components/forms/field/variant.html | 8 +++--- .../forms/fields/label/dialog/.content.json | 6 +++++ .../forms/fields/label/variant.html | 2 +- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Label.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Label.java index b6bd92a91..fdf60ad83 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Label.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Label.java @@ -18,6 +18,7 @@ import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Model; @@ -51,6 +52,13 @@ public class Label extends BaseFormComponent { protected static final String PROPERTY_HIDE_LABEL = "hideLabel"; + public static final String PROPERTY_FOR = "for"; + + @Inject + @Getter + @Named(PROPERTY_FOR) + @Nullable + public String forId; @Inject @Getter @@ -64,6 +72,23 @@ protected void init() { this.module = DEFAULT_MODULE; super.init(); + // check if selectors are present + if (request != null && request.getRequestPathInfo() != null) { + String selectors = request.getRequestPathInfo().getSelectorString(); + if (StringUtils.isNotBlank(selectors)) { + String[] selectorArray = StringUtils.split(selectors, "."); + if (selectorArray.length >= 2) { + // check if id is present and update component id + if (ArrayUtils.contains(selectorArray, "for")) { + String value = selectorArray[ArrayUtils.indexOf(selectorArray, "for")+1]; + if (StringUtils.isNotBlank(value)) { + this.forId = value; + } + } + + } + } + } if (StringUtils.isBlank(label)) { label = DEFAULT_LABEL; } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html index d30a0ad11..ace8bfbff 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html @@ -1,6 +1,8 @@ <template data-sly-template.variant="${ @ model }"> - <field id="${model.id}" class="${model.componentClassNames}" data-fieldid="${model.id}" label="${label}"> - <sly data-sly-set.labelid="${'{0}-{1}' @ format=[model.id, resource.name]}" data-sly-resource="${'label' @ selectors=['id', labelid]}"></sly> - <sly data-sly-set.inputid="${'{0}-{1}' @ format=[model.id, resource.name]}" data-sly-resource="${'field' @ selectors=['id', inputid]}"></sly> + <field id="${model.id}" class="${model.componentClassNames}" data-fieldid="${model.id}" + data-sly-set.labelid="${'{0}-{1}' @ format=[model.id, 'label']}" + data-sly-set.inputid="${'{0}-{1}' @ format=[model.id, 'field']}"> + <sly data-sly-resource="${'label' @ selectors=['id', labelid, 'for', inputid]}"></sly> + <sly data-sly-resource="${'field' @ selectors=['id', inputid]}"></sly> </field> </template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/dialog/.content.json index a67fb8094..0ce6a08ff 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/dialog/.content.json @@ -9,6 +9,12 @@ "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/forms/form/common/fieldLabel" }, + "forId": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "forId", + "label": "For ID", + "description": "Enter the ID of the form element this label is for, if this label is associated with a form element it will be generated." + }, "hideLabel": { "sling:resourceType": "wcm/dialogs/components/toggle", "name": "hideLabel", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/variant.html index 4fd434478..a6614e05a 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/variant.html @@ -4,7 +4,7 @@ component="${model.componentName}" id="${model.id}" class="${model.componentClassNames} ${model.variantClassNames}" - for="${model.id}">${model.label}</label> + for="${model.forId}">${model.label}</label> </sly> <sly data-sly-test="${wcmmode.isEdit && model.hideLabel}"> <div style="--bs-bg-opacity: .5;" class="bg-warning">Label is Hidden</div> From 04719fa6123ecd2be7d6fc9dc3b177cd87f7273f Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 7 May 2024 12:07:12 +1000 Subject: [PATCH 094/206] update debug label. --- .../components/clientlibs/clientlibs-header/components.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js index 5d3916eee..712b76f90 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js @@ -163,7 +163,7 @@ window.Typerefinery.VueData = Typerefinery.VueData || {}; return; } - console.group("loading searchBox"); + console.group("onDocumentReady for " + selector); ns.initComponentBySelector(selector, callbackFn); ns.observeDOMForSelector(selector, callbackFn); From 445e7722058cbc257c5ba3ce19937370473a8e0f Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 7 May 2024 12:07:30 +1000 Subject: [PATCH 095/206] set default for accrodion templated value. --- .../websight/models/components/layout/Accordion.java | 1 + 1 file changed, 1 insertion(+) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Accordion.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Accordion.java index 8e3020b75..fa1559024 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Accordion.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/Accordion.java @@ -59,6 +59,7 @@ public class Accordion extends BaseComponent { @Inject @Getter + @Default(values = "false") public Boolean isTemplated; @Override From 8d09fd0a08359a3c4b634583fe76de3e468a28fd Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 7 May 2024 22:49:52 +1000 Subject: [PATCH 096/206] fix breadcrumb. --- .../models/components/BaseComponent.java | 7 + .../models/components/layout/BreadCrumbs.java | 133 +++++++++++++++++- .../models/components/list/ListItem.java | 129 +++++++++++++++++ .../websight/utils/ResourceUtils.java | 17 +++ .../layout/breadcrumbs/variant.html | 34 +++-- 5 files changed, 309 insertions(+), 11 deletions(-) create mode 100644 application/backend/src/main/java/ai/typerefinery/websight/models/components/list/ListItem.java diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java index 6564c96db..91c5167f2 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java @@ -56,6 +56,7 @@ public class BaseComponent extends BaseModel implements Styled, Grid { public static final String PROPERTY_DECORATION_TAG_NAME = "decorationTagName"; public static final String PROPERTY_VARIANT = "variant"; public static final String PROPERTY_TITLE = "title"; + public static final String PROPERTY_REL = "rel"; //html sematic relationship, how this element relates to the current context/document public static final String PROPERTY_TITLE_TAG_NAME = "titleTagName"; public static final String PROPERTY_DESCRIPTION = "description"; @@ -70,6 +71,12 @@ public class BaseComponent extends BaseModel implements Styled, Grid { @Nullable public String title; + @Inject + @Getter + @Named(PROPERTY_REL) + @Nullable + public String rel; + @Inject @Getter @Named(PROPERTY_TITLE_TAG_NAME) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/BreadCrumbs.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/BreadCrumbs.java index a1b02c82f..6750e3584 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/BreadCrumbs.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/BreadCrumbs.java @@ -1,5 +1,136 @@ +/* + * Copyright (C) 2023 Typerefinery.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +//namespace package ai.typerefinery.websight.models.components.layout; +import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; -public class BreadCrumbs { +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Model; +import org.apache.sling.models.annotations.injectorspecific.ValueMapValue; +import org.jetbrains.annotations.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ai.typerefinery.websight.models.components.BaseComponent; +import ai.typerefinery.websight.models.components.list.ListItem; +import ai.typerefinery.websight.utils.ResourceUtils; +import pl.ds.websight.pages.core.api.Page; + +import javax.annotation.PostConstruct; +import javax.inject.Inject; +import javax.inject.Named; +import javax.jcr.Node; + +import org.apache.jackrabbit.util.Text; + +import org.apache.sling.models.annotations.Default; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.ExporterOption; + +import ai.typerefinery.websight.utils.LinkUtil; +import ai.typerefinery.websight.utils.PageUtil; + +@Model( + adaptables = { + Resource.class, + SlingHttpServletRequest.class + }, + resourceType = { Accordion.RESOURCE_TYPE }, + defaultInjectionStrategy = OPTIONAL +) +@Exporter(name = "jackson", extensions = "json", options = { + @ExporterOption(name = "MapperFeature.SORT_PROPERTIES_ALPHABETICALLY", value = "true"), + @ExporterOption(name = "SerializationFeature.WRITE_DATES_AS_TIMESTAMPS", value = "false") +}) +public class BreadCrumbs extends BaseComponent { + private static final Logger LOGGER = LoggerFactory.getLogger(BreadCrumbs.class); + public static final String RESOURCE_TYPE = "typerefinery/components/layout/breadcrumbs"; + + protected static final boolean PROP_SHOW_HIDDEN_DEFAULT = false; + protected static final boolean PROP_HIDE_CURRENT_DEFAULT = false; + protected static final int PROP_START_LEVEL_DEFAULT = 2; + + private List<ListItem> items; + + @ValueMapValue + @Default(intValues = PROP_START_LEVEL_DEFAULT) + private int startLevel; + + @ValueMapValue + @Default(booleanValues = PROP_SHOW_HIDDEN_DEFAULT) + private boolean showHidden; + + @ValueMapValue + @Default(booleanValues = PROP_HIDE_CURRENT_DEFAULT) + private boolean hideCurrent; + + public Collection<ListItem> getItems() { + if (items == null) { + items = createItems(); + } + return Collections.unmodifiableList(items); + } + + @Override + @PostConstruct + protected void init() { + super.init(); + } + + private List<ListItem> createItems() { + List<ListItem> items = new ArrayList<>(); + int currentLevel = ResourceUtils.getDepth(currentPage); + Page currentPageModel = currentPage.adaptTo(Page.class); + while (startLevel < currentLevel) { + Page page = currentPageModel.getParentFromRoot(startLevel); + if (page != null && page.getContentResource() != null) { + boolean isActivePage = page.equals(currentPageModel); + if (isActivePage && hideCurrent) { + break; + } + if (checkIfNotHidden(page)) { + ListItem listItem = new ListItem(); + listItem.setTitle(page.getTitle()); + listItem.setUrl(LinkUtil.handleLink(page.getPath(), resourceResolver)); + items.add(listItem); + } + } + startLevel++; + } + return items; + } + + private boolean checkIfNotHidden(Page page) { + if (page == null) { + return false; + } + String hideInNav = page.getContentProperty(PageUtil.PROPERTY_HIDEINNAV, ""); + boolean isNotHidden = true; + if (hideInNav != null && !hideInNav.isEmpty()) { + isNotHidden = !Boolean.parseBoolean(hideInNav); + } + return isNotHidden; + } + + } diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/list/ListItem.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/list/ListItem.java new file mode 100644 index 000000000..96ddc3b4a --- /dev/null +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/list/ListItem.java @@ -0,0 +1,129 @@ +/* + * Copyright (C) 2023 Typerefinery.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +//namespace +package ai.typerefinery.websight.models.components.list; +import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; + +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Model; +import org.apache.sling.models.annotations.injectorspecific.OSGiService; +import org.apache.sling.models.annotations.injectorspecific.ValueMapValue; +import org.jetbrains.annotations.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ai.typerefinery.websight.models.components.BaseComponent; +import ai.typerefinery.websight.utils.LinkUtil; + +import javax.annotation.PostConstruct; +import javax.inject.Inject; +import javax.inject.Named; +import javax.jcr.Node; + +import org.apache.sling.models.annotations.Default; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.ExporterOption; + +@Model( + adaptables = { + Resource.class, + SlingHttpServletRequest.class + }, + defaultInjectionStrategy = OPTIONAL +) +@Exporter(name = "jackson", extensions = "json", options = { + @ExporterOption(name = "MapperFeature.SORT_PROPERTIES_ALPHABETICALLY", value = "true"), + @ExporterOption(name = "SerializationFeature.WRITE_DATES_AS_TIMESTAMPS", value = "false") +}) +public class ListItem extends BaseComponent { + + @ValueMapValue + private String title; + + @ValueMapValue + private String url; + + @ValueMapValue + private String hreflang; + + @ValueMapValue + private String text; + + @ValueMapValue + private String ping; + + @ValueMapValue + private String referrerpolicy; + + @ValueMapValue + private boolean target; + + @ValueMapValue + private String mediaType; //media/MIME type + + public String getTitle() { + return title; + } + public String getUrl() { + return url; + } + public String getHreflang() { + return hreflang; + } + public String getText() { + return text; + } + public String getPing() { + return ping; + } + public String getReferrerpolicy() { + return referrerpolicy; + } + public boolean getTarget() { + return target; + } + public String getMediaType() { + return mediaType; + } + + public void setTitle(String title) { + this.title = title; + } + public void setUrl(String url) { + this.url = url; + } + public void setHreflang(String hreflang) { + this.hreflang = hreflang; + } + public void setText(String text) { + this.text = text; + } + public void setPing(String ping) { + this.ping = ping; + } + public void setReferrerpolicy(String referrerpolicy) { + this.referrerpolicy = referrerpolicy; + } + public void setTarget(boolean target) { + this.target = target; + } + public void setMediaType(String mediaType) { + this.mediaType = mediaType; + } + + +} \ No newline at end of file diff --git a/application/backend/src/main/java/ai/typerefinery/websight/utils/ResourceUtils.java b/application/backend/src/main/java/ai/typerefinery/websight/utils/ResourceUtils.java index 31d91e65f..45283f5d1 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/utils/ResourceUtils.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/utils/ResourceUtils.java @@ -90,4 +90,21 @@ private static void updateModifiedProperties(Page page, PageManager pageManager) } } + public static int getDepth(Resource resource) { + if (resource == null) { + return 0; + } + String path = resource.getPath(); + if (path == null || path.isEmpty()) { + return 0; + } + int depth = 0; + //count the number of slashes in the path + for (int i = 0; i < path.length(); i++) { + if (path.charAt(i) == '/') + depth++; + } + return depth; + } + } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/breadcrumbs/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/breadcrumbs/variant.html index 8d7315e03..a0eb3d005 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/breadcrumbs/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/breadcrumbs/variant.html @@ -14,14 +14,28 @@ limitations under the License. */--> <template data-sly-template.variant="${ @ model }"> - <div - component="${model.componentName}" - id="${model.id}" - class="${model.componentClassNames}"> - <p-breadcrumb - :home="breadcrumb.home" - :model="breadcrumb.items" - > - </p-breadcrumb> - </div> + <nav + aria-label="breadcrumb" + component="${model.componentName}" + id="${model.id}" + class="${model.componentClassNames}"> + <ol class="breadcrumb ${model.variantClassNames}" itemscope itemtype="http://schema.org/BreadcrumbList" + data-sly-list.navItem="${model.items}"> + <li class="breadcrumb-item${navItem.active ? ' active' : ''}" + itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" + aria-current="${navItem.active ? 'page' : false}"> + <a class="link" + itemprop="item" + lang="${navItem.lang}" + href="${navItem.url}" + hreflang="${navItem.lang}" + data-sly-attribute="${navItem.ariaAttributesString @ context='unsafe'}" + data-sly-unwrap="${navItem.active}"> + <span itemprop="name">${navItem.title}</span> + </a> + <meta itemprop="position" content="${navItemList.count}" /> + </li> + </ol> + </nav> + </template> \ No newline at end of file From 32f422f31c8ad0e5e5c53da005527830251999e0 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 8 May 2024 00:02:50 +1000 Subject: [PATCH 097/206] add missing options to acordion item. --- .../models/components/layout/AccordionItem.java | 11 ++++++++--- .../layout/accordionitem/accordionitem.html | 9 ++++----- .../layout/accordionitem/dialog/.content.json | 7 ++++++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/AccordionItem.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/AccordionItem.java index 344a715bf..e1c29a05f 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/AccordionItem.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/layout/AccordionItem.java @@ -57,12 +57,17 @@ public class AccordionItem extends BaseComponent { @Inject @Getter @Default(values = "Accordion Item ") - private String title; + public String title; @Getter @Inject - @Nullable - private Boolean show; + @Default(values = "false") + public Boolean showopen; + + @Getter + @Inject + @Default(values = "false") + public Boolean alwaysopen; @Override diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html index ba97ff9ba..5ed977cb2 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html @@ -10,17 +10,16 @@ See the License for the specific language governing permissions and limitations under the License. */--> -<!-- new --> <sly data-sly-use.model="ai.typerefinery.websight.models.components.layout.AccordionItem"> <div class="accordion-item" - data-sly-set.expand="${wcmmode.isEdit || model.show}"> + data-sly-set.expand="${wcmmode.isEdit || model.showopen}"> <h2 class="accordion-header"> - <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#${model.id}" aria-expanded="${model.show ? 'true' : ''}" aria-controls="${model.id}"> + <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#${model.id}" aria-expanded="${model.showopen ? 'true' : ''}" aria-controls="${model.id}"> ${model.title} </button> </h2> - <!--${expand}--> - <div id="${model.id}" class="accordion-collapse collapse ${expand ? 'show' : ''}" data-bs-parent="#${resource.parent.id}"> + <sly data-sly-set.parentid="#${resource.parent.id}"></sly> + <div id="${model.id}" class="accordion-collapse collapse ${expand ? 'show' : ''}" data-bs-parent="${model.alwaysopen ? '' : parentid }"> <div class="accordion-body"> <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"> </sly> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/dialog/.content.json index c8dcfdff3..c5c77c474 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/dialog/.content.json @@ -12,8 +12,13 @@ }, "enable": { "sling:resourceType": "wcm/dialogs/components/checkbox", - "name": "show", + "name": "showopen", "label": "Show Open" + }, + "alwaysopen": { + "sling:resourceType": "wcm/dialogs/components/checkbox", + "name": "alwaysopen", + "label": "Always Open" } }, "styleTab": { From bde9632edd02d818805cb3b33d8afe8223cf445f Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 8 May 2024 01:33:55 +1000 Subject: [PATCH 098/206] cleanup js namespace signatures. --- .../clientlibs-header/components.js | 2 +- .../clientlibs/clientlibs-header/dropdown.js | 4 +- .../clientlibs/clientlibs-header/modal.js | 4 +- .../clientlibs-header/togglecomponent.js | 4 +- .../content/embed/clientlibs/behaviour.js | 14 +-- .../content/embed/clientlibs/functions.js | 10 +- .../content/text/clientlibs/behaviour.js | 6 +- .../content/text/clientlibs/functions.js | 8 +- .../content/title/clientlibs/behaviour.js | 14 +-- .../content/title/clientlibs/functions.js | 10 +- .../fields/button/clientlibs/behaviour.js | 4 +- .../fields/button/clientlibs/functions.js | 4 +- .../fields/checkbox/clientlibs/behaviour.js | 10 +- .../fields/checkbox/clientlibs/functions.js | 18 +-- .../fields/composite/clientlibs/behaviour.js | 4 +- .../fields/composite/clientlibs/functions.js | 2 +- .../fields/radio/clientlibs/behaviour.js | 10 +- .../fields/radio/clientlibs/functions.js | 19 +-- .../fields/select/clientlibs/behaviour.js | 4 +- .../fields/select/clientlibs/functions.js | 6 +- .../forms/fileupload/clientlibs/behaviour.js | 14 +-- .../forms/fileupload/clientlibs/functions.js | 6 +- .../forms/form/clientlibs/behaviour.js | 4 +- .../forms/input/clientlibs/.content.json | 1 + .../forms/input/clientlibs/behaviour.js | 12 +- .../forms/input/clientlibs/functions.js | 16 +++ .../layout/accordion/clientlibs/behaviour.js | 6 +- .../layout/accordion/clientlibs/functions.js | 47 ++++++- .../containerlist/clientlibs/behaviour.js | 12 +- .../containerlist/clientlibs/functions.js | 8 +- .../layout/treeview/clientlibs/behaviour.js | 13 +- .../layout/treeview/clientlibs/functions.js | 5 +- .../fields/composite/clientlibs/behaviour.js | 4 +- .../fields/input/clientlibs/behaviour.js | 14 +-- .../fields/input/clientlibs/functions.js | 28 +---- .../fields/select/clientlibs/behaviour.js | 13 +- .../fields/select/clientlibs/functions.js | 115 +++++++++++++----- .../page/clientlibs-header/.content.json | 6 +- .../clientlibs-header/events/functions.js | 4 +- .../page/clientlibs-header/files/functions.js | 4 +- .../page/clientlibs-header/functions.js | 5 +- .../{tms => jsonschema}/jsonschema.js | 11 +- .../page/clientlibs-header/theme/functions.js | 6 +- .../page/clientlibs-header/tms/client.js | 17 ++- .../page/clientlibs-header/tms/functions.js | 6 +- .../clientlibs/variants/barchart/behaviour.js | 14 +-- .../clientlibs/variants/barchart/functions.js | 6 +- .../variants/linechart/behaviour.js | 14 +-- .../variants/linechart/functions.js | 6 +- .../clientlibs/variants/piechart/behaviour.js | 14 +-- .../clientlibs/variants/piechart/functions.js | 6 +- .../widgets/editor/clientlibs/behaviour.js | 4 +- .../widgets/editor/clientlibs/functions.js | 4 +- .../widgets/map/clientlibs/behaviour.js | 13 +- .../widgets/map/clientlibs/functions.js | 7 +- .../widgets/search/clientlibs/behaviour.js | 13 +- .../widgets/search/clientlibs/functions.js | 6 +- .../security/stix/clientlibs/behaviour.js | 16 +-- .../security/stix/clientlibs/functions.js | 3 + .../clientlibs/resources/stix2viz/stix2viz.js | 5 +- .../widgets/table/clientlibs/behaviour.js | 13 +- .../widgets/table/clientlibs/functions.js | 10 +- .../widgets/tabs/clientlibs/behaviour.js | 13 +- .../widgets/tabs/clientlibs/functions.js | 6 +- .../widgets/ticker/clientlibs/behaviour.js | 12 +- .../widgets/ticker/clientlibs/functions.js | 7 +- 66 files changed, 384 insertions(+), 342 deletions(-) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/functions.js rename application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/{tms => jsonschema}/jsonschema.js (99%) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js index 712b76f90..cd7e36d7b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js @@ -2,7 +2,7 @@ window.Typerefinery = window.Typerefinery || {}; window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.VueData = Typerefinery.VueData || {}; -;(function ($, ns, vueDataNs, document, window) { +(function ($, ns, vueDataNs, document, window) { "use strict"; ns.findExclude = function($component, selector, mask) { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js index eefba6f85..b583e3ce5 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js @@ -2,7 +2,7 @@ window.Typerefinery = window.Typerefinery || {}; Typerefinery.Dropdown = Typerefinery.Dropdown || {}; Typerefinery.Modal = Typerefinery.Modal || {}; -; (function (ns, modalNs, document, window) { +(function ($, ns, modalNs, document, window) { // Inner HTML for the Dropdown window. ns.getDropdownInnerHTML = (menuItems) => { @@ -68,4 +68,4 @@ Typerefinery.Modal = Typerefinery.Modal || {}; }; ns.dropDownButtonEventListener(); -})(Typerefinery.Dropdown, Typerefinery.Modal, document, window); \ No newline at end of file +})(jQuery, Typerefinery.Dropdown, Typerefinery.Modal, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/modal.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/modal.js index f2c4fc324..d486a6b10 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/modal.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/modal.js @@ -1,7 +1,7 @@ window.Typerefinery = window.Typerefinery || {}; window.Typerefinery.Modal = Typerefinery.Modal || {}; -; (function (ns, document, window) { +(function ($, ns, document, window) { // Inner HTML for the modal window. ns.getModalInnerHTML = (modalTitle, iframeURL, hideFooter) => { @@ -228,4 +228,4 @@ window.Typerefinery.Modal = Typerefinery.Modal || {}; // A common modals for all the components. ns.initCommonModal(); -})(Typerefinery.Modal, document, window); \ No newline at end of file +})(jQuery, Typerefinery.Modal, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/togglecomponent.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/togglecomponent.js index a7e707e21..b9bd856d1 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/togglecomponent.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/togglecomponent.js @@ -1,7 +1,7 @@ window.Typerefinery = window.Typerefinery || {}; window.Typerefinery.ToggleComponent = Typerefinery.ToggleComponent || {}; -(function (ns, document, window) { +(function ($, ns, document, window) { ns.init = ($component, componentConfig) => { // Updating the component with Bootstrap Attributes. $component.setAttribute("data-bs-toggle", "collapse"); @@ -18,4 +18,4 @@ window.Typerefinery.ToggleComponent = Typerefinery.ToggleComponent || {}; element.classList.add("collapse"); }); }; -})(Typerefinery.ToggleComponent, document, window); +})(jQuery, Typerefinery.ToggleComponent, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/behaviour.js index c4b017230..8608c6854 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/behaviour.js @@ -3,12 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Content = Typerefinery.Components.Content || {}; window.Typerefinery.Components.Content.Embed = Typerefinery.Components.Content.Embed || {}; -(function (ns, document, window) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - console.log('Embed component Behaviour loaded'); - $('[component="embed"]').each(function () { - ns.init(this); - }); - }); -})(Typerefinery.Components.Content.Embed, document, window); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, Typerefinery.Components.Content.Embed, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js index a17bb5755..f386fe7dd 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js @@ -5,9 +5,11 @@ Typerefinery.Components.Content.Embed = Typerefinery.Components.Content.Embed || Typerefinery.Page = Typerefinery.Page || {}; Typerefinery.Page.Events = Typerefinery.Page.Events || {}; -(function (ns, componentNs, eventNs, document, window) { +(function ($, ns, componentNs, eventNs, document, window) { "use strict"; + ns.selectorComponent = '[component="embed"]'; + ns.registerEvent = ($component, componentId, fieldName) => { const key = `${componentId}-${fieldName}`; eventNs.registerEvents(key, (data) => { @@ -53,12 +55,12 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.init = ($component) => { // check if the component have a data attribute with the name "data-field-componentId" and "data-field-name" then register eventNs - const componentId = $component.getAttribute("data-field-componentId"); - const fieldName = $component.getAttribute("data-field-name"); + const componentId = $component.attr("data-field-componentId"); + const fieldName = $component.attr("data-field-name"); if (componentId && fieldName) { ns.registerEvent($component, componentId, fieldName); }; ns.autoLoad($component); } } -)(Typerefinery.Components.Content.Embed, Typerefinery.Components, Typerefinery.Page.Events, document, window); +)(jQuery, Typerefinery.Components.Content.Embed, Typerefinery.Components, Typerefinery.Page.Events, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/behaviour.js index 9f2f6fad7..0f13888dd 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/behaviour.js @@ -3,8 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Content = Typerefinery.Components.Content || {}; window.Typerefinery.Components.Content.Text = Typerefinery.Components.Content.Text || {}; -(function (ns, componentsNs, document, window) { +(function ($, ns, componentsNs, document, window) { "use strict"; + //init and watch for new components componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); -})(Typerefinery.Components.Content.Text, window.Typerefinery.Components, document, window); + +})(jQuery, Typerefinery.Components.Content.Text, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js index 9da576a39..a3134ebf8 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/text/clientlibs/functions.js @@ -5,7 +5,7 @@ Typerefinery.Components.Content.Text = Typerefinery.Components.Content.Text || { Typerefinery.Page = Typerefinery.Page || {}; Typerefinery.Page.Events = Typerefinery.Page.Events || {}; -(function (ns, componentNs, eventNs, document, window) { +(function ($, ns, componentNs, eventNs, document, window) { "use strict"; ns.selectorComponent = '[component=text]'; @@ -33,12 +33,12 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.init = ($component) => { // check if the component have a data attribute with the name "data-field-componentId" and "data-field-name" then register eventNs - const componentId = $component.getAttribute("data-field-componentId"); - const fieldName = $component.getAttribute("data-field-name"); + const componentId = $component.attr("data-field-componentId"); + const fieldName = $component.attr("data-field-name"); if (componentId && fieldName) { //listen for evenets and update the innerHTML ns.registerEvent($component, componentId, fieldName); }; } } -)(Typerefinery.Components.Content.Text, Typerefinery.Components, Typerefinery.Page.Events, document, window); +)(jQuery, Typerefinery.Components.Content.Text, Typerefinery.Components, Typerefinery.Page.Events, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/behaviour.js index 70b1d4393..e4967d33f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/behaviour.js @@ -3,12 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Content = Typerefinery.Components.Content || {}; window.Typerefinery.Components.Content.Title = Typerefinery.Components.Content.Title || {}; -(function (ns, document, window) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - console.log('Title component Behaviour loaded'); - $('[component="title"]').each(function () { - ns.init(this); - }); - }); -})(Typerefinery.Components.Content.Title, document, window); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, Typerefinery.Components.Content.Title, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/functions.js index c41a26c25..0fe5ff491 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/functions.js @@ -5,9 +5,11 @@ Typerefinery.Components.Content.Title = Typerefinery.Components.Content.Title || Typerefinery.Page = Typerefinery.Page || {}; Typerefinery.Page.Events = Typerefinery.Page.Events || {}; -(function (ns, componentNs, eventNs, document, window) { +(function ($, ns, componentNs, eventNs, document, window) { "use strict"; + ns.selectorComponent = '[component="title"]'; + ns.registerEvent = ($component, componentId, fieldName) => { const key = `${componentId}-${fieldName}`; eventNs.registerEvents(key, (data) => { @@ -29,12 +31,12 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.init = ($component) => { // check if the component have a data attribute with the name "data-field-componentId" and "data-field-name" then register eventNs - const componentId = $component.getAttribute("data-field-componentId"); - const fieldName = $component.getAttribute("data-field-name"); + const componentId = $component.attr("data-field-componentId"); + const fieldName = $component.attr("data-field-name"); if (componentId && fieldName) { //listen for evenets and update the innerHTML ns.registerEvent($component, componentId, fieldName); }; } } -)(Typerefinery.Components.Content.Title, Typerefinery.Components, Typerefinery.Page.Events, document, window); +)(jQuery, Typerefinery.Components.Content.Title, Typerefinery.Components, Typerefinery.Page.Events, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/behaviour.js index beef1f24d..69c8f5ede 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/behaviour.js @@ -3,10 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Button = Typerefinery.Components.Forms.Button || {}; -(function (ns, componentsNs, document) { +(function ($, ns, componentsNs, document) { "use strict"; //init and watch for new components componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); -})(window.Typerefinery.Components.Forms.Button, window.Typerefinery.Components, document); +})(jQuery, window.Typerefinery.Components.Forms.Button, window.Typerefinery.Components, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js index 7de2ea4af..7b90951c1 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js @@ -7,7 +7,7 @@ window.Typerefinery.Dropdown = Typerefinery.Dropdown || {}; window.Typerefinery.ToggleComponent = Typerefinery.ToggleComponent || {}; window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; -(function (ns, componentNs, modalNs, dropdownNs, toggleComponentNs, themeNs, document, window) { +(function ($, ns, componentNs, modalNs, dropdownNs, toggleComponentNs, themeNs, document, window) { "use strict"; ns.selectorComponent = '[component=button]'; @@ -83,4 +83,4 @@ window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; ns.addEventListener($component, id); ns.windowResizeListener($component) } -})(Typerefinery.Components.Forms.Button, Typerefinery.Components, Typerefinery.Modal, Typerefinery.Dropdown, Typerefinery.ToggleComponent, window.Typerefinery.Page.Theme, document, window); \ No newline at end of file +})(jQuery, Typerefinery.Components.Forms.Button, Typerefinery.Components, Typerefinery.Modal, Typerefinery.Dropdown, Typerefinery.ToggleComponent, window.Typerefinery.Page.Theme, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/behaviour.js index f1ddb1335..bd6175eb1 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/behaviour.js @@ -3,9 +3,9 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Checkbox = Typerefinery.Components.Forms.Checkbox || {}; -;(function (ns, document) { +(function ($, ns, componentsNs, document, window) { "use strict"; - // $(document).ready(function () { - // ns.init(); - // }); -})(window.Typerefinery.Components.Forms.Checkbox, document); + //init and watch for new components + //componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, window.Typerefinery.Components.Forms.Checkbox, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/functions.js index 767151724..811f6c017 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/functions.js @@ -4,23 +4,13 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Checkbox = Typerefinery.Components.Forms.Checkbox || {}; -; (function (ns, componentNs, window, document) { +(function ($, ns, componentNs, window, document) { "use strict"; - ns.init = () => { - - const data = {}; + ns.selectorComponent = '[component="checkBox"]'; - document.querySelectorAll('[data-module="vue-checkBox"]').forEach($component => { - let modelName = $component.getAttribute("name"); - let value = $component.getAttribute("value"); - modelName.trim(); - $component.setAttribute("v-model", modelName); - data[modelName] = [value] || ""; - }); + ns.init = () => { - // Register vue data. - componentNs.registerComponent(data); } -})(window.Typerefinery.Components.Forms.Checkbox, window.Typerefinery.Components, window, document); +})(jQuery, window.Typerefinery.Components.Forms.Checkbox, window.Typerefinery.Components, window, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js index bd1ee8413..310e8dfcf 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js @@ -3,7 +3,7 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.Composite || {}; -;(function (ns, componentsNs, document) { +(function ($, ns, componentsNs, document) { "use strict"; $(document).ready(function () { console.log('Composite component Behaviour loaded'); @@ -57,4 +57,4 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C }); }); -})(window.Typerefinery.Components.Forms.Composite, window.Typerefinery.Components, document); +})(jQuery, window.Typerefinery.Components.Forms.Composite, window.Typerefinery.Components, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js index c0d284048..8f0667cf2 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js @@ -5,7 +5,7 @@ window.Typerefinery.Components.Forms.Form = Typerefinery.Components.Forms.Form | window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.Composite || {}; -;(function ($, ns, componentsNs, formNs, Sortable, document, window) { +(function ($, ns, componentsNs, formNs, Sortable, document, window) { "use strict"; ns.selectorComponentName = "composite"; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/clientlibs/behaviour.js index b9c3ebe41..32f15cb81 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/clientlibs/behaviour.js @@ -3,9 +3,9 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Radio = Typerefinery.Components.Forms.Radio || {}; -;(function (ns, document) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - ns.init(); - }); -})(window.Typerefinery.Components.Forms.Radio, document); + //init and watch for new components + //componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, window.Typerefinery.Components.Forms.Radio, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/clientlibs/functions.js index cebbcf1d9..a66c0fc3c 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/clientlibs/functions.js @@ -4,24 +4,13 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Radio = Typerefinery.Components.Forms.Radio || {}; -; (function (ns, componentNs, window, document) { +(function ($, ns, componentNs, window, document) { "use strict"; - ns.init = () => { - - const data = {}; + ns.selectorComponent = '[component="radio"]'; - document.querySelectorAll('[data-module="vue-radioButton"]').forEach(_ => { - let modelName = _.getAttribute("name"); - modelName?.trim(); - _.setAttribute("v-model", modelName); - if(modelName){ - data[modelName] = ""; - } - }); + ns.init = () => { - // Register vue data. - componentNs.registerComponent(data); } -})(window.Typerefinery.Components.Forms.Radio, window.Typerefinery.Components, window, document); +})(jQuery, window.Typerefinery.Components.Forms.Radio, window.Typerefinery.Components, window, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js index bc973c398..c5f9a4a3f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js @@ -3,10 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Select = Typerefinery.Components.Forms.Select || {}; -;(function (ns, componentsNs, document) { +(function ($, ns, componentsNs, document) { "use strict"; //init and watch for new components componentsNs.watchDOMForComponent(`${ns.selectorComponent}${ns.selectorInitNot}`, ns.init); -})(window.Typerefinery.Components.Forms.Select, window.Typerefinery.Components, document); +})(jQuery, window.Typerefinery.Components.Forms.Select, window.Typerefinery.Components, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js index f95369916..b277df90d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js @@ -4,9 +4,7 @@ window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Select = Typerefinery.Components.Forms.Select || {}; window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components.Forms.Select.Instances || {}; - - -;(function (ns, componentNs, selectInstances, window, document) { +(function ($, ns, componentNs, selectInstances, window, document) { "use strict"; ns.selectorComponent = '[component=select]'; @@ -156,4 +154,4 @@ window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components. console.groupEnd(); } -})(Typerefinery.Components.Forms.Select, Typerefinery.Components, Typerefinery.Components.Forms.Select.Instances, window, document); +})(jQuery, Typerefinery.Components.Forms.Select, Typerefinery.Components, Typerefinery.Components.Forms.Select.Instances, window, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/clientlibs/behaviour.js index 65dd93993..bd23aea30 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/clientlibs/behaviour.js @@ -3,12 +3,10 @@ Typerefinery.Components = Typerefinery.Components || {}; Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; Typerefinery.Components.Forms.Fileupload = Typerefinery.Components.Forms.Fileupload || {}; -(function (ns, document, window) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - $('[component="fileupload"]').each(function () { - console.log('fileupload', this); - ns.init(this); - }); - }); -})(window.Typerefinery.Components.Forms.Fileupload, document, window); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, window.Typerefinery.Components.Forms.Fileupload, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/clientlibs/functions.js index 901fc368c..32d527bd3 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/clientlibs/functions.js @@ -4,10 +4,12 @@ Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; Typerefinery.Components.Forms.Fileupload = Typerefinery.Components.Forms.Fileupload || {}; -(function (ns, componentNs, document, window) { +(function ($, ns, componentNs, document, window) { "use strict"; + ns.selectorComponent = '[component="fileupload"]'; + ns.customDragAndDrop = ($component, componentConfig) => { // } let uploadButton = document.getElementById(`${componentConfig.id}-${componentConfig.name}`); @@ -111,4 +113,4 @@ Typerefinery.Components.Forms.Fileupload = Typerefinery.Components.Forms.Fileupl $component = document.getElementById(componentConfig.id); ns.customDragAndDrop($component, componentConfig); } -})(Typerefinery.Components.Forms.Fileupload, Typerefinery.Components, document, window); \ No newline at end of file +})(jQuery, Typerefinery.Components.Forms.Fileupload, Typerefinery.Components, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/behaviour.js index cd815fa87..17bc47952 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/behaviour.js @@ -3,10 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Form = Typerefinery.Components.Forms.Form || {}; -(function ($, ns, componentsNs, document) { +(function ($, ns, componentsNs, document, window) { "use strict"; //init and watch for new components componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); -})(jQuery, window.Typerefinery.Components.Forms.Form, window.Typerefinery.Components, document); +})(jQuery, window.Typerefinery.Components.Forms.Form, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/.content.json index 12a654430..e00f90a7e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/.content.json @@ -7,6 +7,7 @@ "style.css" ], "js": [ + "functions.js", "behaviour.js" ] } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/behaviour.js index 24e261750..88ff30b8f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/behaviour.js @@ -3,10 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Input = Typerefinery.Components.Forms.Input || {}; -(function (ns, document) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - // Input mask will be added for all input tag. - // $(":input")?.inputmask(); - }); -})(window.Typerefinery.Components.Forms.Input, document); + + //init and watch for new components + //componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, window.Typerefinery.Components.Forms.Input, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/functions.js new file mode 100644 index 000000000..8d23aec9f --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/functions.js @@ -0,0 +1,16 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; +window.Typerefinery.Components.Forms.Input = Typerefinery.Components.Forms.Input || {}; + + +(function ($, ns, componentNs, document, window) { + "use strict"; + + ns.selectorComponent = '[component="input"]'; + + ns.init = ($component) => { + const componentConfig = componentNs.getComponentConfig($component); + } + +})(jQuery, window.Typerefinery.Components.Forms.Input, document); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/behaviour.js index 32e179c5d..d337e78ec 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/behaviour.js @@ -3,10 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Layout = Typerefinery.Components.Layout || {}; window.Typerefinery.Components.Layout.Accordion = Typerefinery.Components.Layout.Accordion || {}; -(function (ns, componentsNs, document) { +(function ($, ns, componentsNs, document, window) { "use strict"; //init and watch for new components - // componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); -})(window.Typerefinery.Components.Layout.Accordion, window.Typerefinery.Components, document); +})(jQuery, window.Typerefinery.Components.Layout.Accordion, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index 1e370ceb8..05f123974 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -7,17 +7,54 @@ window.Typerefinery.Dropdown = Typerefinery.Dropdown || {}; window.Typerefinery.ToggleComponent = Typerefinery.ToggleComponent || {}; window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; -(function (ns, componentNs, modalNs, dropdownNs, toggleComponentNs, themeNs, document, window) { +(function ($, ns, componentNs, modalNs, dropdownNs, toggleComponentNs, themeNs, document, window) { "use strict"; ns.selectorComponent = '[component=accordion]'; + ns.selectorTemplate = "> template"; + ns.selectorButton = 'button.accordion-button'; + ns.attributeTarget = "data-bs-target"; + ns.attributeParent = "data-bs-parent"; + ns.attributeAriaControls = "aria-controls"; ns.addNewItem = ($component) => { - // const $items = $component.querySelector('[component="accordion-items"]'); - // $items.appendChild($item); + const componentId = $component.attr('id'); + const $template = $component.find(ns.selectorTemplate); + var $newRow = $($template.html()); + const itemId = Math.random().toString(36).substring(2, 15); + console.group('addNewItem'); + + $newRow.attr('state', "new"); + $newRow.attr('id', itemId); + + console.log('itemId', itemId); + + const itemContentId = `accordionitem_${itemId}`; + + console.log('itemContentId', itemContentId); + + const $itemButton = $newRow.find(ns.selectorButton); + const itemButtonTarget = $itemButton.attr(ns.attributeTarget); //needs to be updated with new id + const itemAriaControls = $itemButton.attr(ns.attributeAriaControls); //needs to be updated with new id + $itemButton.attr(ns.attributeTarget, `#${itemContentId}`); + $itemButton.attr(ns.attributeAriaControls, itemContentId); + + const $itemCollapse = $newRow.find(itemButtonTarget); + const itemCollapseId = $itemCollapse.attr('id'); //needs to be updated with new id + $itemCollapse.attr('id', itemContentId); + + const itemDataParent = $itemCollapse.attr(ns.attributeParent); // is pointing to the parent, needs to be updated to current component + $itemCollapse.attr(ns.attributeParent, componentId); + + console.log('$newRow', $newRow); + + $template.before($newRow); + + console.groupEnd(); } ns.init = ($component) => { - const componentConfig = componentNs.getComponentConfig($component); + const componentConfig = componentNs.getComponentConfig($component); + ns.addNewItem($component); } -})(Typerefinery.Components.Forms.Button, Typerefinery.Components, Typerefinery.Modal, Typerefinery.Dropdown, Typerefinery.ToggleComponent, window.Typerefinery.Page.Theme, document, window); \ No newline at end of file +})(jQuery, Typerefinery.Components.Forms.Button, Typerefinery.Components, Typerefinery.Modal, Typerefinery.Dropdown, Typerefinery.ToggleComponent, window.Typerefinery.Page.Theme, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/containerlist/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/containerlist/clientlibs/behaviour.js index 24e351016..dbfc2eeb5 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/containerlist/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/containerlist/clientlibs/behaviour.js @@ -3,14 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Layout = Typerefinery.Components.Layout || {}; window.Typerefinery.Components.Layout.ContainerList = Typerefinery.Components.Layout.ContainerList || {}; -(function (ns, document, window) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - $('[component=containerlist]').each(function () { - ns?.init(this); - }); - }); + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); - -})(Typerefinery.Components.Layout.ContainerList, document, window); +})(jQuery, Typerefinery.Components.Layout.ContainerList, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/containerlist/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/containerlist/clientlibs/functions.js index 5b127a2cc..6313d817e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/containerlist/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/containerlist/clientlibs/functions.js @@ -4,7 +4,11 @@ window.Typerefinery.Components.Layout = Typerefinery.Components.Layout || {}; window.Typerefinery.Components.Layout.ContainerList = Typerefinery.Components.Layout.ContainerList || {}; -(function (ns, componentNs, document, window) { +(function ($, ns, componentNs, document, window) { + "use strict"; + + ns.selectorComponent = '[component="containerlist"]'; + ns.updateComponentHTML = ($component) => { if (!$component) { return; @@ -55,4 +59,4 @@ window.Typerefinery.Components.Layout.ContainerList = ns.updateComponentHTML($component); ns.eventListnerActiveClass(); }; -})(Typerefinery.Components.Layout.ContainerList,Typerefinery.Components,document,window); +})(jQuery, Typerefinery.Components.Layout.ContainerList,Typerefinery.Components,document,window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/behaviour.js index 49c006cb4..14d1bd09b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/behaviour.js @@ -4,12 +4,9 @@ Typerefinery.Components = Typerefinery.Components || {}; Typerefinery.Components.Widgets = Typerefinery.Components.Widgets || {}; Typerefinery.Components.Widgets.Treeview = Typerefinery.Components.Widgets.Treeview || {}; +(function ($, ns, componentsNs, document, window) { + "use strict"; + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); -;(function (ns, document, window) { - "use strict"; - $(document).ready(function () { - $("[component='treeview']").each(function () { - ns.init(this); - }); - }); -})(Typerefinery.Components.Widgets.Treeview, document, window); \ No newline at end of file +})(jQuery, Typerefinery.Components.Widgets.Treeview, window.Typerefinery.Components, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/functions.js index b9299908d..a317d23e2 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/functions.js @@ -8,9 +8,10 @@ Typerefinery.Components.Widgets.Treeview.Instance = Typerefinery.Components.Widg Typerefinery.Page = Typerefinery.Page || {}; Typerefinery.Page.Events = Typerefinery.Page.Events || {}; -(function (ns, componentNs, treeViewInstanceNs, eventNs, searchNs, document, window) { +(function ($, ns, componentNs, treeViewInstanceNs, eventNs, searchNs, document, window) { "use strict"; + ns.selectorComponent = '[component="treeview"]'; String.prototype.insert = function (index, string) { if (index > 0) { @@ -253,4 +254,4 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } } -})(Typerefinery.Components.Widgets.Treeview, Typerefinery.Components, Typerefinery.Components.Widgets.Treeview.Instance, Typerefinery.Page.Events, Typerefinery.Components.Widgets.Search, document, window); \ No newline at end of file +})(jQuery, Typerefinery.Components.Widgets.Treeview, Typerefinery.Components, Typerefinery.Components.Widgets.Treeview.Instance, Typerefinery.Page.Events, Typerefinery.Components.Widgets.Search, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/behaviour.js index cc9b8ada3..e54ea7168 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/behaviour.js @@ -4,7 +4,7 @@ window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; window.Typerefinery.Components.Stix.Forms.Composite = Typerefinery.Components.Stix.Forms.Composite || {}; -;(function (ns, document) { +(function ($, ns, document) { "use strict"; $(document).ready(function () { console.log('Stix Composite component Behaviour loaded'); @@ -12,4 +12,4 @@ window.Typerefinery.Components.Stix.Forms.Composite = Typerefinery.Components.St ns.init(this); }); }); -})(window.Typerefinery.Components.Stix.Forms.Composite, document); +})(jQuery, window.Typerefinery.Components.Stix.Forms.Composite, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/behaviour.js index 4444a83a7..e2aadc09d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/behaviour.js @@ -4,12 +4,10 @@ window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; window.Typerefinery.Components.Stix.Forms.Input = Typerefinery.Components.Stix.Forms.Input || {}; -(function (ns, document) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - console.log('Embed component Behaviour loaded'); - $('[component="stix-input"]').each(function () { - ns.init(this); - }); - }); -})(window.Typerefinery.Components.Stix.Forms.Input, document); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, window.Typerefinery.Components.Stix.Forms.Input, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js index 78478afcb..ebfb5488d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js @@ -6,31 +6,13 @@ window.Typerefinery.Components.Stix.Forms.Input = Typerefinery.Components.Stix.F window.Typerefinery.Page = Typerefinery.Page || {}; window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; -(function (ns, componentNs, eventNs, document, window) { +(function ($, ns, componentNs, eventNs, document, window) { "use strict"; - ns.registerEvent = ($component, componentId, fieldName) => { - const key = `${componentId}-${fieldName}`; - eventNs.registerEvents(key, (data) => { - if(data.type === eventNs.EVENTS.EVENT_READ_ACTION) { - // get the first children and set the inner html. - const $firstChild = $component.children[0]; - // get the component config - const componentConfig = componentNs.getComponentConfig($component); - // set field value - $component.find("input").val(data.data.value); - } - }); - } - - + ns.selectorComponent = "[component='stix-input']"; + ns.init = ($component) => { - // check if the component have a data attribute with the name "data-field-componentId" and "data-field-name" then register eventNs - const componentId = $component.getAttribute("id"); - const fieldName = $component.getAttribute("name"); - if (componentId && fieldName) { - ns.registerEvent($component, componentId, fieldName); - }; + } } -)(window.Typerefinery.Components.Stix.Forms.Input, Typerefinery.Components, Typerefinery.Page.Events, document, window); +)(jQuery, window.Typerefinery.Components.Stix.Forms.Input, Typerefinery.Components, Typerefinery.Page.Events, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js index 2fc46b5e7..230441097 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js @@ -4,11 +4,10 @@ window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; window.Typerefinery.Components.Stix.Forms.Select = Typerefinery.Components.Stix.Forms.Select || {}; -;(function (ns, document) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - $("[component='stix-select']").each(function () { - ns.init(this); - }); - }); -})(window.Typerefinery.Components.Stix.Forms.Select, document); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, window.Typerefinery.Components.Stix.Forms.Select, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js index 415d5735d..623eb897d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js @@ -5,10 +5,14 @@ window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms | window.Typerefinery.Components.Stix.Forms.Select = Typerefinery.Components.Stix.Forms.Select || {}; window.Typerefinery.Components.Stix.Forms.Select.Instances = Typerefinery.Components.Stix.Forms.Select.Instances || {}; - -;(function (ns, componentNs, selectInstances, window, document) { +(function ($, ns, componentNs, selectInstances, window, document) { "use strict"; + ns.selectorComponent = "[component='stix-select']"; + + ns.selectorInit = '[data-choice]' + ns.selectorInitNot = ':not([data-choice])' + ns.getOptionsSelectedAsAnArray = ($component) => { const $selectedOption = $component.querySelector('option[selected]'); if($selectedOption) { @@ -61,51 +65,96 @@ window.Typerefinery.Components.Stix.Forms.Select.Instances = Typerefinery.Compon } }; - ns.addOptionsToSelect = async ($component, componentConfig, defaultSelectedOptions) => { - - if(componentConfig.readOptionsFromDataSource) { - const options = await ns.getOptionsFromDataSource(componentConfig); - console.log(options, 'options') - if(options.length !== 0) { - const selectOptions = options.map((option) => { - return `<option ${ns.isValueSelectedAsDefault(defaultSelectedOptions, option[componentConfig.keyNameInOptionList || 'key'])} value="${option[componentConfig.keyNameInOptionList || 'key']}">${option[componentConfig.labelNameInOptionList || 'label']}</option>` - }); - $component.innerHTML = selectOptions.join(''); - return; - } - - } - - if(componentConfig.selectOptions) { - if(Array.isArray(componentConfig.selectOptions)) { - const selectOptions = componentConfig.selectOptions.map((option) => { - return `<option ${ns.isValueSelectedAsDefault(defaultSelectedOptions, option.value)} value="${option.value}">${option.label}</option>` - }); - $component.innerHTML = selectOptions.join(''); - } else { - throw new Error('componentConfig.selectOptions is not an array'); - } - } + ns.addOptionsToSelect = ($component, defaultSelectedOptions, optionsList, keyName, labelName) => { + console.log('options from data source', optionsList); + if(optionsList.length !== 0) { + const selectOptions = optionsList.map((option) => { + console.log(option); + var html = `<option ${ns.isValueSelectedAsDefault(defaultSelectedOptions, option[keyName || 'key'])} value="${option[keyName || 'key']}">${option[labelName || 'label']}</option>`; + console.log(html); + return html; + }); + var optionsHTML = selectOptions.join(''); + console.log(optionsHTML) + $component.html(optionsHTML); + return; + } else { + console.log("optionsList is empty"); + } }; - + // public methods to interact with the select component instances + ns.getValue = function (id) { + console.group('select getValue'); + console.log('id', id); + let returnValue = ""; + returnValue = selectInstances[id].getValue(true) + console.log('returnValue', returnValue); + console.groupEnd(); + return returnValue; + } + ns.setChoiceByValue = function (id, value) { + console.group('select setChoiceByValue'); + console.log('id', id); + console.log('value', value); + selectInstances[id].setChoiceByValue(value); + console.groupEnd(); + } + ns.setValue = function (id, data) { + console.group('select setValue'); + console.log('id', id); + console.log('value', value); + selectInstances[id].setValue(data); + console.groupEnd(); + } ns.init = async ($component) => { + console.group("select init"); const componentConfig = componentNs.getComponentConfig($component); if(componentConfig.multipleSelection) { $component.setAttribute('multiple', 'true'); } + + console.log("componentConfig.id",componentConfig.id); + console.log("component select",$component.get(0)); + + console.log("loading options"); + const defaultSelectedOptions = ns.getDefaultOptionsSelected(componentConfig.defaultSelectedOptions); - await ns.addOptionsToSelect($component, componentConfig, defaultSelectedOptions); - + if(componentConfig.readOptionsFromDataSource) { + console.log("loading options from data source"); + var optionsList = await ns.getOptionsFromDataSource(componentConfig); + console.log("data source list", optionsList); + ns.addOptionsToSelect($component, defaultSelectedOptions, optionsList, componentConfig.keyNameInOptionList, componentConfig.keyNameInOptionList, componentConfig.labelNameInOptionList); + console.log($component.html()); + } else { + console.log("loading options from config"); + if(componentConfig.selectOptions && Array.isArray(componentConfig.selectOptions)) { + console.log("config options list", componentConfig.selectOptions) + ns.addOptionsToSelect($component, defaultSelectedOptions, componentConfig.selectOptions, "value", "label"); + } + } + console.log("loaded options"); - selectInstances[componentConfig.id] = new Choices($component, { + console.log("init choices"); + + selectInstances[componentConfig.id] = new Choices($component.get(0), { removeItemButton: true, maxItemCount: componentConfig.maxSelection || -1, - labelId: componentConfig.id + allowHTML: false, + shouldSort: true, + loadingText: 'Loading...', + itemSelectText: 'Press to select', + uniqueItemText: 'Only unique values can be added', + addItemText: (value) => { + return `Press Enter to add <b>"${value}"</b>`; + }, }); + + console.groupEnd(); } -})(Typerefinery.Components.Stix.Forms.Select, Typerefinery.Components, Typerefinery.Components.Stix.Forms.Select.Instances, window, document); + +})(jQuery, Typerefinery.Components.Stix.Forms.Select, Typerefinery.Components, Typerefinery.Components.Stix.Forms.Select.Instances, window, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/.content.json index a7a61595b..95e625bec 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/.content.json @@ -4,13 +4,13 @@ "sling:resourceType": "io/typerefinery/websight/clientlibs", "categories": ["ai.typerefinery.websight.components-header","ai.typerefinery.websight.components.structure.page-header"], "js": [ - "functions.js", + "jsonschema/jsonschema.js", "theme/functions.js", "tms/client.js", - "tms/jsonschema.js", "tms/functions.js", "events/functions.js", - "files/functions.js" + "files/functions.js", + "functions.js" ], "css": [ "style.css" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js index dc1f0c5ba..6b09f8a08 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js @@ -2,7 +2,7 @@ window.Typerefinery = window.Typerefinery || {}; Typerefinery.Page = Typerefinery.Page || {}; Typerefinery.Page.Events = Typerefinery.Page.Events || {}; -(function (ns, document, window) { +(function ($, ns, document, window) { "use strict"; ns.registery = {}; @@ -153,4 +153,4 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; $(document).ready(() => { ns.init(); }); -})(Typerefinery.Page.Events, document, window); +})(jQuery, Typerefinery.Page.Events, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/files/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/files/functions.js index 3007be31b..0c983091b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/files/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/files/functions.js @@ -2,7 +2,7 @@ window.Typerefinery = window.Typerefinery || {}; Typerefinery.Page = Typerefinery.Page || {}; Typerefinery.Page.Files = Typerefinery.Page.Files || {}; -(function (ns, document, window) { +(function ($, ns, document, window) { "use strict"; ns.filesUrl = "https://files.typerefinery.localhost:8101"; @@ -60,4 +60,4 @@ Typerefinery.Page.Files = Typerefinery.Page.Files || {}; }; -})(Typerefinery.Page.Files, document, window); +})(jQuery, Typerefinery.Page.Files, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/functions.js index 03dc51557..6dd4195af 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/functions.js @@ -4,8 +4,7 @@ window.Typerefinery.Page = Typerefinery.Page || {}; window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; - -(function (ns, themeNs, tmsNs, document, window) { +(function ($, ns, themeNs, tmsNs, document, window) { "use strict"; ns.init = () => { @@ -17,4 +16,4 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; $(document).ready(function () { ns.init(); }); -})(Typerefinery.Page, Typerefinery.Page.Theme, Typerefinery.Page.Tms, document, window); \ No newline at end of file +})(jQuery, Typerefinery.Page, Typerefinery.Page.Theme, Typerefinery.Page.Tms, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/jsonschema.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/jsonschema/jsonschema.js similarity index 99% rename from application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/jsonschema.js rename to application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/jsonschema/jsonschema.js index b324df26f..1908133de 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/jsonschema.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/jsonschema/jsonschema.js @@ -1,6 +1,6 @@ -$(document).ready(function (e) { -window.JSONSchemas = {} -;(function (ns) { +window.JSONSchemas = {}; + +(function ($, ns) { ns.REG_NUMBER = /[\d,\\.]+/g ns.jsonschemas = {} ns.SchemaValue = function () { @@ -601,5 +601,6 @@ window.JSONSchemas = {} ns.register = function (schema) { if (schema.$id) ns.jsonschemas[schema.$id] = schema } -})(window.JSONSchemas) -}) + +})(jQuery, window.JSONSchemas); + diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/theme/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/theme/functions.js index d732a1076..2c0dda55e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/theme/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/theme/functions.js @@ -7,7 +7,7 @@ window.Typerefinery.Components.Widgets.Chart = Typerefinery.Components.Widgets.C window.Typerefinery.Components.Widgets.Chart.Instances = Typerefinery.Components.Widgets. Chart.Instances || {}; -(function (ns, chartInstances, document, window) { +(function ($, ns, chartInstances, document, window) { "use strict"; ns.toggleTheme = () => { @@ -63,7 +63,7 @@ window.Typerefinery.Components.Widgets.Chart.Instances = Typerefinery.Components ns.updateATagColor(newTheme); - + //TODO: move this to chart component setTimeout(() => { Object.entries(chartInstances)?.forEach(($chart) => { const gridAxisToBeValidated = ["x", "y", "r"]; @@ -147,4 +147,4 @@ window.Typerefinery.Components.Widgets.Chart.Instances = Typerefinery.Components ns.setInitialTheme(componentConfig); ns.attachEventListener($component, componentConfig); }; -})(Typerefinery.Page.Theme, Typerefinery.Components.Widgets.Chart.Instances, document, window); +})(jQuery, Typerefinery.Page.Theme, Typerefinery.Components.Widgets.Chart.Instances, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js index 2e69609ef..e2d397725 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js @@ -1,12 +1,10 @@ - -console.log("client.js loaded") - -window.MessageService = {} +window.MessageService = {}; // eslint-disable-next-line no-undef -window.MessageService.Config = MessageService.Config || {} +window.MessageService.Config = MessageService.Config || {}; // eslint-disable-next-line no-undef -window.MessageService.Client = MessageService.Client || {} - ; (function (ns, JSONSchemas, document, window) { +window.MessageService.Client = MessageService.Client || {}; + +(function ($, ns, JSONSchemas, document, window) { ns.publishers = {} ns.subscribers = {} ns.callbacks = {} @@ -231,5 +229,6 @@ window.MessageService.Client = MessageService.Client || {} } } - init() - })(window.MessageService.Client, window.JSONSchemas, document, window) \ No newline at end of file + init(); + + })(jQuery, window.MessageService.Client, window.JSONSchemas, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js index 756b9b671..4496c626c 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js @@ -1,12 +1,10 @@ window.Typerefinery = window.Typerefinery || {}; -window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Page = Typerefinery.Page || {}; -window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; window.MessageService = window.MessageService || {}; window.MessageService.Client = MessageService.Client || {}; -(function (ns, clientNs, document, window) { +(function ($, ns, clientNs, document, window) { "use strict"; ns.registery = {}; @@ -84,4 +82,4 @@ window.MessageService.Client = MessageService.Client || {}; ns.init = () => { ns.connect(); }; -})(Typerefinery.Page.Tms, MessageService.Client, document, window); +})(jQuery, Typerefinery.Page.Tms, MessageService.Client, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/barchart/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/barchart/behaviour.js index a2ee023cf..f5d083007 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/barchart/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/barchart/behaviour.js @@ -5,16 +5,10 @@ window.Typerefinery.Components.Widgets.Chart = Typerefinery.Components.Widgets.C window.Typerefinery.Components.Widgets.Chart.Variants = Typerefinery.Components.Widgets.Chart.Variants || {}; window.Typerefinery.Components.Widgets.Chart.Variants.BarChart = Typerefinery.Components.Widgets.Chart.Variants.BarChart || {}; - - -(function (ns, document, window) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - $("[component='chart'][data-module='barChart']").each(function () { - ns?.init(this); - }); - }); - + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); -})(Typerefinery.Components.Widgets.Chart.Variants.BarChart, document, window); +})(jQuery, Typerefinery.Components.Widgets.Chart.Variants.BarChart, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/barchart/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/barchart/functions.js index b6b0435bb..df06fa8ac 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/barchart/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/barchart/functions.js @@ -10,9 +10,11 @@ window.Typerefinery.Page = Typerefinery.Page || {}; window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; -(function (ns, tmsNs, componentNs, themeNs, chartInstanceNs, document, window) { +(function ($, ns, tmsNs, componentNs, themeNs, chartInstanceNs, document, window) { "use strict"; + ns.selectorComponent = "[component='chart'][data-module='barChart']"; + ns.defaultData = { chartData: [75000, 75000, 75000, 15000, 14000, 12000, 11000, 11500, 11000], labelName: "Typerefinery Bar Chart", @@ -200,4 +202,4 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; ns.modelDataConnected($component); } }; -})(Typerefinery.Components.Widgets.Chart.Variants.BarChart, Typerefinery.Page.Tms, Typerefinery.Components, Typerefinery.Page.Theme, Typerefinery.Components.Widgets.Chart.Instances, document, window); +})(jQuery, Typerefinery.Components.Widgets.Chart.Variants.BarChart, Typerefinery.Page.Tms, Typerefinery.Components, Typerefinery.Page.Theme, Typerefinery.Components.Widgets.Chart.Instances, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/linechart/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/linechart/behaviour.js index d859e1843..332627793 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/linechart/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/linechart/behaviour.js @@ -5,16 +5,10 @@ window.Typerefinery.Components.Widgets.Chart = Typerefinery.Components.Widgets.C window.Typerefinery.Components.Widgets.Chart.Variants = Typerefinery.Components.Widgets.Chart.Variants || {}; window.Typerefinery.Components.Widgets.Chart.Variants.LineChart = Typerefinery.Components.Widgets.Chart.Variants.LineChart || {}; - - -(function (ns, document, window) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - $("[component='chart'][data-module='lineChart']").each(function () { - ns?.init(this); - }); - }); - + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); -})(Typerefinery.Components.Widgets.Chart.Variants.LineChart, document, window); +})(jQuery, Typerefinery.Components.Widgets.Chart.Variants.LineChart, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/linechart/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/linechart/functions.js index 7ac0a9d6d..c36b66547 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/linechart/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/linechart/functions.js @@ -10,9 +10,11 @@ window.Typerefinery.Page = Typerefinery.Page || {}; window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; -(function (ns, tmsNs, componentNs, themeNs, chartInstanceNs, document, window) { +(function ($, ns, tmsNs, componentNs, themeNs, chartInstanceNs, document, window) { "use strict"; + ns.selectorComponent = "[component='chart'][data-module='lineChart']"; + ns.defaultData = { chartData: [1, 1, 2, 3, 55, 50, 44, 39, 6, 7, 9, 35], labelName: "Typerefinery Line Chart", @@ -210,4 +212,4 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; ns.modelDataConnected($component); } } -})(Typerefinery.Components.Widgets.Chart.Variants.LineChart, Typerefinery.Page.Tms, Typerefinery.Components, Typerefinery.Page.Theme, Typerefinery.Components.Widgets.Chart.Instances, document, window); +})(jQuery, Typerefinery.Components.Widgets.Chart.Variants.LineChart, Typerefinery.Page.Tms, Typerefinery.Components, Typerefinery.Page.Theme, Typerefinery.Components.Widgets.Chart.Instances, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/piechart/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/piechart/behaviour.js index 8ef2d4e43..cf15745a6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/piechart/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/piechart/behaviour.js @@ -5,16 +5,10 @@ window.Typerefinery.Components.Widgets.Chart = Typerefinery.Components.Widgets.C window.Typerefinery.Components.Widgets.Chart.Variants = Typerefinery.Components.Widgets.Chart.Variants || {}; window.Typerefinery.Components.Widgets.Chart.Variants.PieChart = Typerefinery.Components.Widgets.Chart.Variants.PieChart || {}; - - -(function (ns, document, window) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - $("[component='chart'][data-module='pieChart']").each(function () { - ns?.init(this); - }); - }); - + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); -})(Typerefinery.Components.Widgets.Chart.Variants.PieChart, document, window); +})(jQuery, Typerefinery.Components.Widgets.Chart.Variants.PieChart, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/piechart/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/piechart/functions.js index 77babf9b6..ea959226b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/piechart/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/piechart/functions.js @@ -10,9 +10,11 @@ window.Typerefinery.Page = Typerefinery.Page || {}; window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; -(function (ns, tmsNs, componentNs, themeNs, chartInstanceNs, document, window) { +(function ($, ns, tmsNs, componentNs, themeNs, chartInstanceNs, document, window) { "use strict"; + ns.selectorComponent = "[component='chart'][data-module='pieChart']"; + ns.defaultData = { labels: ["Group A", "Group B", "Group C", "Group D", "Group E", "Group F"], labelName: "Typerefinery Pie Chart", @@ -205,4 +207,4 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; ns.modelDataConnected($component); } } -})(Typerefinery.Components.Widgets.Chart.Variants.PieChart, Typerefinery.Page.Tms, Typerefinery.Components, Typerefinery.Page.Theme, Typerefinery.Components.Widgets.Chart.Instances, document, window); +})(jQuery, Typerefinery.Components.Widgets.Chart.Variants.PieChart, Typerefinery.Page.Tms, Typerefinery.Components, Typerefinery.Page.Theme, Typerefinery.Components.Widgets.Chart.Instances, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/behaviour.js index 5a93fb31f..3a608dda7 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/behaviour.js @@ -3,10 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Widgets = Typerefinery.Components.Widgets || {}; window.Typerefinery.Components.Widgets.Editor = Typerefinery.Components.Widgets.Editor || {}; -(function (ns, componentsNs, document) { +(function ($, ns, componentsNs, document, window) { "use strict"; //init and watch for new components componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); -})(Typerefinery.Components.Widgets.Editor, window.Typerefinery.Components, document); +})(jQuery, Typerefinery.Components.Widgets.Editor, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js index f2926d94b..597879c0c 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js @@ -6,7 +6,7 @@ window.Typerefinery.Components.Widgets.Editor.Instances = Typerefinery.Component -(function (ns, componentNs, editorInstanceNs, document, window) { +(function ($, ns, componentNs, editorInstanceNs, document, window) { "use strict"; ns.selectorComponent = '[component=editor]'; @@ -232,4 +232,4 @@ window.Typerefinery.Components.Widgets.Editor.Instances = Typerefinery.Component } -})(Typerefinery.Components.Widgets.Editor, Typerefinery.Components, Typerefinery.Components.Widgets.Editor.Instances, document, window); +})(jQuery, Typerefinery.Components.Widgets.Editor, Typerefinery.Components, Typerefinery.Components.Widgets.Editor.Instances, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/map/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/map/clientlibs/behaviour.js index 00c787b40..b9be6431f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/map/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/map/clientlibs/behaviour.js @@ -4,11 +4,10 @@ window.Typerefinery.Components.Widgets = Typerefinery.Components.Widgets || {}; window.Typerefinery.Components.Widgets.Map = Typerefinery.Components.Widgets.Map || {}; window.Typerefinery.Components.Widgets.Map.LeafletMap = Typerefinery.Components.Widgets.Map.LeafletMap || {}; -;(function (ns, document) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - $("[component='map']").each(function() { - ns.init(this); - }); - }); -})(window.Typerefinery.Components.Widgets.Map.LeafletMap, document); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, window.Typerefinery.Components.Widgets.Map.LeafletMap, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/map/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/map/clientlibs/functions.js index 3d2bb8c1b..9ccef03d8 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/map/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/map/clientlibs/functions.js @@ -6,8 +6,11 @@ window.Typerefinery.Components.Widgets.Map.LeafletMap = Typerefinery.Components. window.Typerefinery.Components.Widgets.Map.Instances = Typerefinery.Components.Widgets.Map.Instances || {}; window.Typerefinery.Page = Typerefinery.Page || {}; window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; -; (function (ns, componentNs, tmsNs, leafletMap, mapInstanceNs, window, document) { +(function ($, ns, componentNs, tmsNs, leafletMap, mapInstanceNs, window, document) { "use strict"; + + ns.selectorComponent = "[component='map']"; + ns.updateComponentHTML = (data, $component) => { if (!$component) { console.log('[LeafletMap/clientlibs/functions.js] component does not exist') @@ -114,4 +117,4 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; ns.modelDataConnected($component); } } -})(window.Typerefinery.Components.Widgets.Map.LeafletMap, window.Typerefinery.Components, window.Typerefinery.Page.Tms, L, window.Typerefinery.Components.Widgets.Map.Instances, window, document); +})(jQuery, window.Typerefinery.Components.Widgets.Map.LeafletMap, window.Typerefinery.Components, window.Typerefinery.Page.Tms, L, window.Typerefinery.Components.Widgets.Map.Instances, window, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/search/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/search/clientlibs/behaviour.js index a87b0bc8d..05ef07f8c 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/search/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/search/clientlibs/behaviour.js @@ -3,11 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Widgets = Typerefinery.Components.Widgets || {}; window.Typerefinery.Components.Widgets.Search = Typerefinery.Components.Widgets.Search || {}; -;(function (ns, document) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - $("[component='search']").each(function() { - ns.init(this); - }); - }); -})(window.Typerefinery.Components.Widgets.Search, document); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, window.Typerefinery.Components.Widgets.Search, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/search/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/search/clientlibs/functions.js index 32f9bce4f..e080805df 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/search/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/search/clientlibs/functions.js @@ -5,9 +5,11 @@ window.Typerefinery.Components.Widgets.Search = Typerefinery.Components.Widgets. window.Typerefinery.Page = Typerefinery.Page|| {}; window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; -; (function (ns, componentNs, eventNs, document, window) { +(function ($, ns, componentNs, eventNs, document, window) { "use strict"; + ns.selectorComponent = "[component='search']"; + ns.debounce = (fn, delay) => { let timerId; return function (...args) { @@ -56,4 +58,4 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; $component.addEventListener("input", ns.debounce(() => eventNs.emitEvent(topic, { value: document.getElementById(componentConfig.id).value }), 500)); }; -})(Typerefinery.Components.Widgets.Search, Typerefinery.Components, Typerefinery.Page.Events, document, window); +})(jQuery, Typerefinery.Components.Widgets.Search, Typerefinery.Components, Typerefinery.Page.Events, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/behaviour.js index 53c6c9314..5f27bf046 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/behaviour.js @@ -4,16 +4,10 @@ window.Typerefinery.Components.Widgets = Typerefinery.Components.Widgets || {}; window.Typerefinery.Components.Widgets.Security = Typerefinery.Components.Widgets.Security || {}; window.Typerefinery.Components.Widgets.Security.Stix = Typerefinery.Components.Widgets.Security.Stix || {}; - - -(function (ns, document, window) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - $('[component="stix"]').each(function () { - ns.init($(this)); - }); - }); - - -})(window.Typerefinery.Components.Widgets.Security.Stix, document, window); + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, window.Typerefinery.Components.Widgets.Security.Stix, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/functions.js index b0e935422..4c122be16 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/functions.js @@ -8,6 +8,9 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; (function ($, ns, tmsNs, componentNs, d3, stix2viz, document, window) { "use strict"; + + ns.selectorComponent = '[component="stix"]'; + class ComponentElements { canvasElement = null; legendElement = null; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/resources/stix2viz/stix2viz.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/resources/stix2viz/stix2viz.js index 683d56a43..78ff06e0c 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/resources/stix2viz/stix2viz.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/resources/stix2viz/stix2viz.js @@ -2,8 +2,7 @@ window.Typerefinery = window.Typerefinery || {}; window.Typerefinery.Vendor = Typerefinery.Vendor || {}; window.Typerefinery.Vendor.Stix2Viz = Typerefinery.Vendor.Stix2Viz || {}; - -(function (ns, d3, document, window) { +(function ($, ns, d3, document, window) { refRegex = /_refs*$/; var parsed; // provides a single store for all parsed content @@ -983,4 +982,4 @@ window.Typerefinery.Vendor.Stix2Viz = Typerefinery.Vendor.Stix2Viz || {}; // export the Viz object to the global namespace ns.Viz = Viz; -})(window.Typerefinery.Vendor.Stix2Viz, d3, document, window); +})(jQuery, window.Typerefinery.Vendor.Stix2Viz, d3, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/behaviour.js index eb0fc58f1..948c70f72 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/behaviour.js @@ -3,11 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Widgets = Typerefinery.Components.Widgets || {}; window.Typerefinery.Components.Widgets.Table = Typerefinery.Components.Widgets.Table || {}; -;(function (ns, document) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - $("[component='table']").each(function() { - ns.init(this); - }); - }); -})(window.Typerefinery.Components.Widgets.Table, document); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, window.Typerefinery.Components.Widgets.Table, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/functions.js index 0c4804ab4..d3fb36c53 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/functions.js @@ -9,9 +9,11 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; window.Typerefinery.Modal = Typerefinery.Modal || {}; -(function (ns, tmsNs, eventNs, componentNs, modalNs, tableInstanceNs, searchNs, document, window) { +(function ($, ns, tmsNs, eventNs, componentNs, modalNs, tableInstanceNs, searchNs, document, window) { "use strict"; + ns.selectorComponent = '[component="table"]'; + ns.defaultData = { columns: [], data: [], @@ -380,8 +382,8 @@ window.Typerefinery.Modal = Typerefinery.Modal || {}; eventNs.registerEvents(event.topic, ns.getEventHandlerCallBackFn($component, event)); }); - const componentId = $component.getAttribute("data-field-componentId"); - const fieldName = $component.getAttribute("data-field-name"); + const componentId = $component.attr("data-field-componentId"); + const fieldName = $component.attr("data-field-name"); if(!componentId || !fieldName) { return; } @@ -429,4 +431,4 @@ window.Typerefinery.Modal = Typerefinery.Modal || {}; }; -})(Typerefinery.Components.Widgets.Table, Typerefinery.Page.Tms, Typerefinery.Page.Events, Typerefinery.Components, Typerefinery.Modal, Typerefinery.Components.Widgets.Table.Instances, Typerefinery.Components.Widgets.Search, document, window); +})(jQuery, Typerefinery.Components.Widgets.Table, Typerefinery.Page.Tms, Typerefinery.Page.Events, Typerefinery.Components, Typerefinery.Modal, Typerefinery.Components.Widgets.Table.Instances, Typerefinery.Components.Widgets.Search, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/clientlibs/behaviour.js index 6ab54d9ea..dfc074518 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/clientlibs/behaviour.js @@ -2,11 +2,10 @@ window.Typerefinery = window.Typerefinery || {}; Typerefinery.Components.Widgets = Typerefinery.Components.Widgets || {}; Typerefinery.Components.Widgets.Tab = Typerefinery.Components.Widgets.Tab || {}; -;(function (ns, document, window) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - $("[component='tabs']").each(function() { - ns.init(this); - }); - }); -})(Typerefinery.Components.Widgets.Tab, document, window); + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + + })(jQuery, Typerefinery.Components.Widgets.Tab, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/clientlibs/functions.js index a89b7d8cd..bc749531a 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/clientlibs/functions.js @@ -5,10 +5,10 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; Typerefinery.Components.Widgets = Typerefinery.Components.Widgets || {}; Typerefinery.Components.Widgets.Tab = Typerefinery.Components.Widgets.Tab || {}; -(function (ns, componentNs, eventNs, document, window) { +(function ($, ns, componentNs, eventNs, document, window) { "use strict"; - + ns.selectorComponent = "[component='tabs']"; ns.compileHandlerBar = ($component, componentConfig) => { const items = { @@ -344,6 +344,6 @@ Typerefinery.Components.Widgets.Tab = Typerefinery.Components.Widgets.Tab || {}; }; -})(Typerefinery.Components.Widgets.Tab, Typerefinery.Components, Typerefinery.Page.Events, document, window); +})(jQuery, Typerefinery.Components.Widgets.Tab, Typerefinery.Components, Typerefinery.Page.Events, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/behaviour.js index dee5dfbe0..e7f68a991 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/behaviour.js @@ -3,14 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Widgets = Typerefinery.Components.Widgets || {}; window.Typerefinery.Components.Widgets.Ticker = Typerefinery.Components.Widgets.Ticker || {}; -(function (ns, document, window) { +(function ($, ns, componentsNs, document, window) { "use strict"; - $(document).ready(function () { - $('[component=ticker]').each(function () { - ns?.init(this); - }); - }); + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); - -})(Typerefinery.Components.Widgets.Ticker, document, window); +})(jQuery, Typerefinery.Components.Widgets.Ticker, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/functions.js index 0c1e112ee..b83c4d7da 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/functions.js @@ -7,8 +7,11 @@ window.Typerefinery.Page = Typerefinery.Page || {}; window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; -(function (ns, tmsNs, componentNs, themeNs, document, window) { +(function ($, ns, tmsNs, componentNs, themeNs, document, window) { "use strict"; + + ns.selectorComponent = '[component=ticker]'; + ns.updateComponentHTML = (data, $component) => { if (!$component) { return; @@ -123,4 +126,4 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; ns.modelDataConnected($component); } } -})(Typerefinery.Components.Widgets.Ticker, Typerefinery.Page.Tms, Typerefinery.Components, Typerefinery.Page.Theme, document, window); +})(jQuery, Typerefinery.Components.Widgets.Ticker, Typerefinery.Page.Tms, Typerefinery.Components, Typerefinery.Page.Theme, document, window); From 864a982805c7a416dd86f4104a033f12a90e00a4 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 8 May 2024 01:55:49 +1000 Subject: [PATCH 099/206] add ability to add new accordion item from template. --- .../layout/accordion/clientlibs/functions.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index 05f123974..d48c45b71 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -1,13 +1,9 @@ window.Typerefinery = window.Typerefinery || {}; window.Typerefinery.Components = Typerefinery.Components || {}; -window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; -window.Typerefinery.Components.Forms.Button = Typerefinery.Components.Forms.Button || {}; -window.Typerefinery.Modal = Typerefinery.Modal || {}; -window.Typerefinery.Dropdown = Typerefinery.Dropdown || {}; -window.Typerefinery.ToggleComponent = Typerefinery.ToggleComponent || {}; -window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; - -(function ($, ns, componentNs, modalNs, dropdownNs, toggleComponentNs, themeNs, document, window) { +window.Typerefinery.Components.Layout = Typerefinery.Components.Layout || {}; +window.Typerefinery.Components.Layout.Accordion = Typerefinery.Components.Layout.Accordion || {}; + +(function ($, ns, componentNs, document, window) { "use strict"; ns.selectorComponent = '[component=accordion]'; @@ -44,7 +40,7 @@ window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; $itemCollapse.attr('id', itemContentId); const itemDataParent = $itemCollapse.attr(ns.attributeParent); // is pointing to the parent, needs to be updated to current component - $itemCollapse.attr(ns.attributeParent, componentId); + $itemCollapse.attr(ns.attributeParent, `#${componentId}`); console.log('$newRow', $newRow); @@ -55,6 +51,5 @@ window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; ns.init = ($component) => { const componentConfig = componentNs.getComponentConfig($component); - ns.addNewItem($component); } -})(jQuery, Typerefinery.Components.Forms.Button, Typerefinery.Components, Typerefinery.Modal, Typerefinery.Dropdown, Typerefinery.ToggleComponent, window.Typerefinery.Page.Theme, document, window); \ No newline at end of file +})(jQuery, Typerefinery.Components.Layout.Accordion, Typerefinery.Components, document, window); \ No newline at end of file From 5628acdcea3338c384006f6f649e7eea0da70c3c Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 8 May 2024 02:01:15 +1000 Subject: [PATCH 100/206] fix selectors. --- .../components/content/embed/clientlibs/functions.js | 2 +- .../components/content/title/clientlibs/functions.js | 2 +- .../components/forms/fields/checkbox/clientlibs/functions.js | 2 +- .../components/forms/fields/radio/clientlibs/functions.js | 2 +- .../components/forms/fileupload/clientlibs/functions.js | 2 +- .../typerefinery/components/forms/input/clientlibs/functions.js | 2 +- .../components/layout/containerlist/clientlibs/functions.js | 2 +- .../components/layout/treeview/clientlibs/functions.js | 2 +- .../components/widgets/security/stix/clientlibs/functions.js | 2 +- .../components/widgets/table/clientlibs/functions.js | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js index f386fe7dd..d12633dfd 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js @@ -8,7 +8,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; (function ($, ns, componentNs, eventNs, document, window) { "use strict"; - ns.selectorComponent = '[component="embed"]'; + ns.selectorComponent = '[component=embed]'; ns.registerEvent = ($component, componentId, fieldName) => { const key = `${componentId}-${fieldName}`; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/functions.js index 0fe5ff491..19d1caa66 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/title/clientlibs/functions.js @@ -8,7 +8,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; (function ($, ns, componentNs, eventNs, document, window) { "use strict"; - ns.selectorComponent = '[component="title"]'; + ns.selectorComponent = '[component=title]'; ns.registerEvent = ($component, componentId, fieldName) => { const key = `${componentId}-${fieldName}`; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/functions.js index 811f6c017..79835d7fa 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/clientlibs/functions.js @@ -7,7 +7,7 @@ window.Typerefinery.Components.Forms.Checkbox = Typerefinery.Components.Forms.Ch (function ($, ns, componentNs, window, document) { "use strict"; - ns.selectorComponent = '[component="checkBox"]'; + ns.selectorComponent = '[component=checkBox]'; ns.init = () => { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/clientlibs/functions.js index a66c0fc3c..b23f44c89 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/clientlibs/functions.js @@ -7,7 +7,7 @@ window.Typerefinery.Components.Forms.Radio = Typerefinery.Components.Forms.Radio (function ($, ns, componentNs, window, document) { "use strict"; - ns.selectorComponent = '[component="radio"]'; + ns.selectorComponent = '[component=radio]'; ns.init = () => { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/clientlibs/functions.js index 32d527bd3..101f62885 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/clientlibs/functions.js @@ -8,7 +8,7 @@ Typerefinery.Components.Forms.Fileupload = Typerefinery.Components.Forms.Fileupl "use strict"; - ns.selectorComponent = '[component="fileupload"]'; + ns.selectorComponent = '[component=fileupload]'; ns.customDragAndDrop = ($component, componentConfig) => { // } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/functions.js index 8d23aec9f..d394d57c7 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/input/clientlibs/functions.js @@ -7,7 +7,7 @@ window.Typerefinery.Components.Forms.Input = Typerefinery.Components.Forms.Input (function ($, ns, componentNs, document, window) { "use strict"; - ns.selectorComponent = '[component="input"]'; + ns.selectorComponent = '[component=input]'; ns.init = ($component) => { const componentConfig = componentNs.getComponentConfig($component); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/containerlist/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/containerlist/clientlibs/functions.js index 6313d817e..7d584602b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/containerlist/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/containerlist/clientlibs/functions.js @@ -7,7 +7,7 @@ window.Typerefinery.Components.Layout.ContainerList = (function ($, ns, componentNs, document, window) { "use strict"; - ns.selectorComponent = '[component="containerlist"]'; + ns.selectorComponent = '[component=containerlist]'; ns.updateComponentHTML = ($component) => { if (!$component) { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/functions.js index a317d23e2..ebc62f862 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/functions.js @@ -11,7 +11,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; (function ($, ns, componentNs, treeViewInstanceNs, eventNs, searchNs, document, window) { "use strict"; - ns.selectorComponent = '[component="treeview"]'; + ns.selectorComponent = '[component=treeview]'; String.prototype.insert = function (index, string) { if (index > 0) { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/functions.js index 4c122be16..7f4594265 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/functions.js @@ -9,7 +9,7 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; (function ($, ns, tmsNs, componentNs, d3, stix2viz, document, window) { "use strict"; - ns.selectorComponent = '[component="stix"]'; + ns.selectorComponent = '[component=stix]'; class ComponentElements { canvasElement = null; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/functions.js index d3fb36c53..365610d5d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/table/clientlibs/functions.js @@ -12,7 +12,7 @@ window.Typerefinery.Modal = Typerefinery.Modal || {}; (function ($, ns, tmsNs, eventNs, componentNs, modalNs, tableInstanceNs, searchNs, document, window) { "use strict"; - ns.selectorComponent = '[component="table"]'; + ns.selectorComponent = '[component=table]'; ns.defaultData = { columns: [], From 8ff66ae18e0aef3cbf99d89cf6251820dba9d5fe Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 8 May 2024 11:20:30 +1000 Subject: [PATCH 101/206] fix js to use jquery syntax. --- .../clientlibs/clientlibs-header/dropdown.js | 12 ++--- .../clientlibs/clientlibs-header/modal.js | 12 ++--- .../clientlibs-header/togglecomponent.js | 4 +- .../fields/select/clientlibs/functions.js | 2 +- .../layout/treeview/clientlibs/functions.js | 2 +- .../page/clientlibs-header/theme/functions.js | 52 ++++++++++--------- .../clientlibs/variants/barchart/functions.js | 4 +- .../variants/linechart/functions.js | 4 +- .../clientlibs/variants/piechart/functions.js | 6 +-- .../widgets/search/clientlibs/functions.js | 4 +- .../widgets/ticker/clientlibs/functions.js | 2 +- 11 files changed, 53 insertions(+), 51 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js index b583e3ce5..f96d3d774 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js @@ -27,16 +27,16 @@ Typerefinery.Modal = Typerefinery.Modal || {}; // Updating the component with Bootstrap Attributes. - $component.setAttribute("data-bs-toggle", "dropdown"); - $component.setAttribute("type", "button"); - $component.setAttribute("aria-expanded", "false"); - const buttonId = $component.getAttribute("id"); + $component.attr("data-bs-toggle", "dropdown"); + $component.attr("type", "button"); + $component.attr("aria-expanded", "false"); + const buttonId = $component.asttr("id"); // Dropdown Container with default Attributes const newDropdownContainer = document.createElement("div"); - newDropdownContainer.setAttribute("class", "dropdown-menu dropdownMenu"); - newDropdownContainer.setAttribute("aria-labelledby", buttonId); + newDropdownContainer.attr("class", "dropdown-menu dropdownMenu"); + newDropdownContainer.attr("aria-labelledby", buttonId); const { dropdownItems } = componentConfig; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/modal.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/modal.js index d486a6b10..e27d31258 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/modal.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/modal.js @@ -158,16 +158,16 @@ window.Typerefinery.Modal = Typerefinery.Modal || {}; // Modal Container with default Attributes const newModalDivContainer = document.createElement("div"); const randIdForModal = Math.random().toString(16).slice(2); - newModalDivContainer.setAttribute("class", "modal fade"); - newModalDivContainer.setAttribute("id", randIdForModal); + newModalDivContainer.attr("class", "modal fade"); + newModalDivContainer.attr("id", randIdForModal); // Updating the component with Bootstrap Attributes. - $component.setAttribute("data-bs-toggle", "modal"); - $component.setAttribute("type", "button"); - $component.setAttribute("data-bs-target", `#${randIdForModal}`); + $component.attr("data-bs-toggle", "modal"); + $component.attr("type", "button"); + $component.attr("data-bs-target", `#${randIdForModal}`); // invoke remove loader on modal load when a modal is opened. - $component.addEventListener("click", ns.removeLoaderOnModalLoad); + $component.on("click", ns.removeLoaderOnModalLoad); const ORIGIN = window.location.origin; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/togglecomponent.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/togglecomponent.js index b9bd856d1..71c607eba 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/togglecomponent.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/togglecomponent.js @@ -4,8 +4,8 @@ window.Typerefinery.ToggleComponent = Typerefinery.ToggleComponent || {}; (function ($, ns, document, window) { ns.init = ($component, componentConfig) => { // Updating the component with Bootstrap Attributes. - $component.setAttribute("data-bs-toggle", "collapse"); - $component.setAttribute( + $component.attr("data-bs-toggle", "collapse"); + $component.attr( "data-bs-target", `${componentConfig.toggleTarget}` ); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js index b277df90d..ae177640b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js @@ -110,7 +110,7 @@ window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components. console.group("select init"); const componentConfig = componentNs.getComponentConfig($component); if(componentConfig.multipleSelection) { - $component.setAttribute('multiple', 'true'); + $component.attr('multiple', 'true'); } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/functions.js index ebc62f862..90398dd6f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/clientlibs/functions.js @@ -24,7 +24,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.addSidebarTreeNodes = ($component, componentConfig) => { - const dataTree = JSON.parse($component.getAttribute('data-tree') || '{}'); + const dataTree = JSON.parse($component.attr('data-tree') || '{}'); if (Object.keys(dataTree).length === 0) { return; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/theme/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/theme/functions.js index 2c0dda55e..b951964e7 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/theme/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/theme/functions.js @@ -13,49 +13,50 @@ window.Typerefinery.Components.Widgets.Chart.Instances = Typerefinery.Components ns.toggleTheme = () => { const currentPageTheme = localStorage.getItem("pageTheme") || "light"; const newTheme = currentPageTheme == "light" ? "dark" : "light"; - const $body = document.getElementsByTagName("body")[0]; + const $body = $("body")[0]; if ($body) { - $body.classList.remove(`bg-${currentPageTheme}`); - $body.classList.add(`bg-${newTheme}`); + $body.removeClass(`bg-${currentPageTheme}`); + $body.addClass(`bg-${newTheme}`); } //to change the background of component - const toggleTheme = document.querySelectorAll(`[toggleTheme]`); - toggleTheme.forEach(function ($component) { + const toggleTheme = $(`[toggleTheme]`); + toggleTheme.each(function ($component) { + var $component = $(this); - const toggle = $component.getAttribute("toggleTheme"); + const toggle = $component.attr("toggleTheme"); const $body = document.getElementsByTagName("body")[0]; if (newTheme === "light") { - $body.classList.add("bg-light"); + $body.addClass("bg-light"); } else if (newTheme === "dark") { - $body.classList.add("bg-dark"); + $body.addClass("bg-dark"); } if (newTheme === 'dark') { if (toggle === "text") { - $component.classList.remove("text-dark"); - $component.classList.add("text-white"); + $component.removeClass("text-dark"); + $component.addClass("text-white"); } else if(toggle === "component") { - $component.classList.remove("bg-light", "shadow-lg"); - $component.classList.add("bg-dark", "shadow-lg"); + $component.removeClass("bg-light", "shadow-lg"); + $component.addClass("bg-dark", "shadow-lg"); }else if (toggle === "true") { - $component.classList.remove("bg-light", "shadow-lg", "text-dark"); - $component.classList.add("bg-dark", "shadow-lg", "text-white"); + $component.removeClass("bg-light", "shadow-lg", "text-dark"); + $component.addClass("bg-dark", "shadow-lg", "text-white"); } } else { if (toggle === "text") { - $component.classList.remove("text-white"); - $component.classList.add("text-dark"); + $component.removeClass("text-white"); + $component.addClass("text-dark"); } else if (toggle === "true") { - $component.classList.remove("bg-dark", "shadow-lg", "text-white"); - $component.classList.add("bg-light", "shadow-lg", "text-dark"); + $component.removeClass("bg-dark", "shadow-lg", "text-white"); + $component.addClass("bg-light", "shadow-lg", "text-dark"); } } }); @@ -102,14 +103,15 @@ window.Typerefinery.Components.Widgets.Chart.Instances = Typerefinery.Components }; ns.updateATagColor = (theme) => { - const $aTags = document.querySelectorAll("a"); - $aTags.forEach(($aTag) => { + const $aTags = $("a"); + $aTags.each(() => { + var $aTag = $(this); if (theme === "dark") { - $aTag.classList.remove("text-dark"); - $aTag.classList.add("text-white"); + $aTag.removeClass("text-dark"); + $aTag.addClass("text-white"); } else { - $aTag.classList.remove("text-white"); - $aTag.classList.add("text-dark"); + $aTag.removeClass("text-white"); + $aTag.addClass("text-dark"); } }); }; @@ -140,7 +142,7 @@ window.Typerefinery.Components.Widgets.Chart.Instances = Typerefinery.Components ns.attachEventListener = ($component, componentConfig) => { // Event Listener for toggle theme (dark | light); - $($component).on("click", ns.toggleTheme); + $component.on("click", ns.toggleTheme); }; ns.init = ($component, componentConfig) => { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/barchart/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/barchart/functions.js index df06fa8ac..d3628cd21 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/barchart/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/barchart/functions.js @@ -189,12 +189,12 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; // TMS. if (componentHost && componentTopic) { - $component.setAttribute("id", componentTopic); + $component.attr("id", componentTopic); ns.tmsConnected(componentHost, componentTopic, $component); } // JSON else if (componentDataSource) { - $component.setAttribute("id", componentPath); + $component.attr("id", componentPath); ns.jsonConnected(componentDataSource, $component); } // MODEL diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/linechart/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/linechart/functions.js index c36b66547..46daf5093 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/linechart/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/linechart/functions.js @@ -199,12 +199,12 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; // TMS. if (componentHost && componentTopic) { - $component.setAttribute("id", componentTopic); + $component.attr("id", componentTopic); ns.tmsConnected(componentHost, componentTopic, $component); } // JSON else if (componentDataSource) { - $component.setAttribute("id", componentPath); + $component.attr("id", componentPath); ns.jsonConnected(componentDataSource, $component); } // MODEL diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/piechart/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/piechart/functions.js index ea959226b..2ff98d272 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/piechart/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/chart/clientlibs/variants/piechart/functions.js @@ -47,7 +47,7 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; ...ns.defaultData } if (!componentConfig.resourcePath) { - componentConfig.resourcePath = data.resourcePath || $component.getAttribute(`data-resource-path`); + componentConfig.resourcePath = data.resourcePath || $component.attr(`data-resource-path`); } const ctx = document.getElementById(`${componentConfig.resourcePath}-pieChart`).getContext("2d"); @@ -194,12 +194,12 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; // TMS. if (componentHost && componentTopic) { - $component.setAttribute("id", componentTopic); + $component.attr("id", componentTopic); ns.tmsConnected(componentHost, componentTopic, $component); } // JSON else if (componentDataSource) { - $component.setAttribute("id", componentPath); + $component.attr("id", componentPath); ns.jsonConnected(componentDataSource, $component); } // MODEL diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/search/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/search/clientlibs/functions.js index e080805df..d06cb789e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/search/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/search/clientlibs/functions.js @@ -51,11 +51,11 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const topic = componentConfig.topic; if(topic === "#PAGE" || !topic) { - $component.addEventListener("input", ns.debounce(() => ns.highlightWholePage(componentConfig), 500)); + $component.on("input", ns.debounce(() => ns.highlightWholePage(componentConfig), 500)); return; } - $component.addEventListener("input", ns.debounce(() => eventNs.emitEvent(topic, { value: document.getElementById(componentConfig.id).value }), 500)); + $component.on("input", ns.debounce(() => eventNs.emitEvent(topic, { value: document.getElementById(componentConfig.id).value }), 500)); }; })(jQuery, Typerefinery.Components.Widgets.Search, Typerefinery.Components, Typerefinery.Page.Events, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/functions.js index b83c4d7da..93f461b0e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/functions.js @@ -114,7 +114,7 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; const componentPath = componentConfig.resourcePath; // TMS. if (componentHost && componentTopic) { - $component.setAttribute("id", `${componentPath}-${componentTopic}`); + $component.attr("id", `${componentPath}-${componentTopic}`); ns.tmsConnected(componentHost, componentTopic, $component); } // JSON From e4c3b10078ccce29ddf57df25944a9b8674151a0 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 8 May 2024 11:21:07 +1000 Subject: [PATCH 102/206] fix jquery syntax. --- .../components/stix/forms/fields/select/clientlibs/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js index 623eb897d..2bfcf0d6d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js @@ -112,7 +112,7 @@ window.Typerefinery.Components.Stix.Forms.Select.Instances = Typerefinery.Compon console.group("select init"); const componentConfig = componentNs.getComponentConfig($component); if(componentConfig.multipleSelection) { - $component.setAttribute('multiple', 'true'); + $component.attr('multiple', 'true'); } From 5b2e66e03eef482d4872203f3a2ae4e658ba13d5 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 8 May 2024 11:52:56 +1000 Subject: [PATCH 103/206] fix jquery usage. --- .../fields/select/clientlibs/functions.js | 4 +- .../fields/select/clientlibs/functions.js | 4 +- .../widgets/tabs/clientlibs/functions.js | 102 +++++++++--------- 3 files changed, 58 insertions(+), 52 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js index ae177640b..8239487f2 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js @@ -12,9 +12,9 @@ window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components. ns.selectorInitNot = ':not([data-choice])' ns.getOptionsSelectedAsAnArray = ($component) => { - const $selectedOption = $component.querySelector('option[selected]'); + const $selectedOption = $component.find('option[selected]'); if($selectedOption) { - return [$selectedOption.value]; + return [$selectedOption.val()]; } else { return []; } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js index 2bfcf0d6d..ecbf00205 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js @@ -14,9 +14,9 @@ window.Typerefinery.Components.Stix.Forms.Select.Instances = Typerefinery.Compon ns.selectorInitNot = ':not([data-choice])' ns.getOptionsSelectedAsAnArray = ($component) => { - const $selectedOption = $component.querySelector('option[selected]'); + const $selectedOption = $component.find('option[selected]'); if($selectedOption) { - return [$selectedOption.value]; + return [$selectedOption.val()]; } else { return []; } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/clientlibs/functions.js index bc749531a..57d43d43f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/clientlibs/functions.js @@ -47,22 +47,24 @@ Typerefinery.Components.Widgets.Tab = Typerefinery.Components.Widgets.Tab || {}; ns.updateComponentHtml = ($component, componentConfig, listOfTab) => { // filter listOfTab if that li has no id and already exists in the $component. - const $header = $component.querySelector("ul"); - const $tabContent = $component.querySelector("div.tab-content"); - const $headerTabs = $header.querySelectorAll("li"); + const $header = $component.find("ul"); + const $tabContent = $component.find("div.tab-content"); + const $headerTabs = $header.find("li"); const $headerTabIds = [...$headerTabs].map((tab) => tab.id); // remove the active class from all the tabs. - $headerTabs.forEach((tab) => { - tab.classList.remove("active"); - tab.querySelector("button").classList.remove("active"); + $headerTabs.each(() => { + var $tab = $(this); + $tab.removeClass("active"); + $tab.find("button").removeClass("active"); }); // remove the active class from all the tab contents. - $tabContent.querySelectorAll("div.tab-pane").forEach((tab) => { - tab.classList.remove("active"); + $tabContent.find("div.tab-pane").each(() => { + var $tab = $(this); + $tab.removeClass("active"); }); @@ -125,37 +127,39 @@ Typerefinery.Components.Widgets.Tab = Typerefinery.Components.Widgets.Tab || {}; `; // get ul tag from $component and append the new tab to it. - $header.insertAdjacentHTML('beforeend', newHeaderTabs); - $tabContent.insertAdjacentHTML('beforeend',newTabContents); + $header.before(newHeaderTabs); + $tabContent.before(newTabContents); }; ns.setActiveTabInDOM = ($component, componentConfig, tabId, activeIndex = -1) => { - const $header = $component.querySelector("ul"); - const $tabContent = $component.querySelector("div.tab-content"); - const $headerTabs = $header.querySelectorAll("li"); + const $header = $component.find("ul"); + const $tabContent = $component.find("div.tab-content"); + const $headerTabs = $header.find("li"); if(activeIndex === -1) { // remove the active class from all the tabs. - $headerTabs.forEach((tab, index) => { - tab.classList.remove("active"); - tab.querySelector("button").classList.remove("active"); - if(tab.id == tabId) { + $headerTabs.each((index) => { + var $tab = $(this); + $tab.removeClass("active"); + $tab.find("button").removeClass("active"); + if($tab.id == tabId) { activeIndex = index } }); } // remove the active class from all the tab contents. - $tabContent.querySelectorAll("div.tab-pane").forEach((tab) => { - tab.classList.remove("active"); - tab.classList.remove("show"); + $tabContent.find("div.tab-pane").each(() => { + var $tab = $(this); + $tab.removeClass("active"); + $tab.removeClass("show"); }); if(activeIndex == -1) return; // add the active class to the tab and tab content. - $header.querySelectorAll("button")[activeIndex].classList.add("active"); + $header.find("button").get(activeIndex).removeClass("active"); // add show and active class to the tab content. - $tabContent.querySelectorAll("div.tab-pane")[activeIndex].classList.add("active"); - $tabContent.querySelectorAll("div.tab-pane")[activeIndex].classList.add("show"); + $tabContent.find("div.tab-pane")[activeIndex].removeClass("active"); + $tabContent.find("div.tab-pane")[activeIndex].removeClass("show"); }; @@ -206,42 +210,43 @@ Typerefinery.Components.Widgets.Tab = Typerefinery.Components.Widgets.Tab || {}; ns.removeTab = ($component, componentConfig, tabId) => { - let $header = $component.querySelector("ul"); - let $tabContent = $component.querySelector("div.tab-content"); - let $headerTabs = $header.querySelectorAll("li"); + let $header = $component.find("ul"); + let $tabContent = $component.find("div.tab-content"); + let $headerTabs = $header.find("li"); // remove tabId from the $component. - $headerTabs.forEach((tab, index) => { - const dataTabId = tab.getAttribute("data-tab-id"); - if(tab.id === tabId || dataTabId === tabId) { - tab.remove(); + $headerTabs.each((index) => { + var $tab = $(this); + const dataTabId = $tab.attr("data-tab-id"); + if($tab.id === tabId || dataTabId === tabId) { + $tab.remove(); // then remove the tab content from the $component as well. - const $tab = $tabContent.querySelectorAll(`.tab-pane`)[index]; - if(!$tab) { + const $tabPane = $tabContent.find(`.tab-pane`)[index]; + if(!$tabPane) { return; } - $tab.remove(); + $tabPane.remove(); } }); // make the last tab active from $component. - $header = $component.querySelector("ul"); - $headerTabs = $header.querySelectorAll("li"); + $header = $component.find("ul"); + $headerTabs = $header.find("li"); - $headerTabs.forEach((tab, index) => { + $headerTabs.eachEach((index) => { if(index === $headerTabs.length - 1 ) { - const $tab = $tabContent.querySelectorAll(`.tab-pane`)[index]; + const $tab = $tabContent.find(`.tab-pane`)[index]; if(!$tab) { return; } - if(!$tab.getAttribute("data-tab-id")) { + if(!$tab.attr("data-tab-id")) { // eventNs.emitEvent(`${componentConfig.topic}-TAB_CHANGE`, {type: "SELECT_TAB", tab: {id: tab.id}}); } // if tab class have active class then it is active tab so return. - if(tab.classList.contains("active")) { + if($tab.hasClass("active")) { return; } - ns.setActiveTabInDOM($component, componentConfig, tab.id); + ns.setActiveTabInDOM($component, componentConfig, $tab.attr("id")); } }); @@ -313,13 +318,14 @@ Typerefinery.Components.Widgets.Tab = Typerefinery.Components.Widgets.Tab || {}; // pass query params from parent page to iframe // for all iframes that have addquerystring, get srchref append query params from the parent page and set as src. - const iframes = $component.querySelectorAll("iframe"); + const $iframes = $component.find("iframe"); - if(iframes && iframes.length > 0) { - iframes.forEach((iframe) => { - if(iframe.getAttribute("addquerystring") === "true") { + if($iframes && $iframes.length > 0) { + $iframes.each(() => { + var $iframe = $(this); + if($iframe.attr("addquerystring") === "true") { - const srchref = iframe.getAttribute("srchref"); + const srchref = $iframe.attr("srchref"); const url = new URL(srchref); const params = new URLSearchParams(url.search); const parentUrl = new URL(window.location.href); @@ -328,7 +334,7 @@ Typerefinery.Components.Widgets.Tab = Typerefinery.Components.Widgets.Tab || {}; params.set(key, value); }); url.search = params.toString(); - iframe.setAttribute("src", url.toString()); + $iframe.attr("src", url.toString()); } }); } @@ -336,9 +342,9 @@ Typerefinery.Components.Widgets.Tab = Typerefinery.Components.Widgets.Tab || {}; ns[componentConfig.id] = componentConfig.tabsList; // set the height of the tab content. - const $tabContent = $component.querySelector(".tab-content"); + const $tabContent = $component.find(".tab-content"); if($tabContent) { - $tabContent.style.height = componentConfig.contentHeight || `80vh`; + $tabContent.height(componentConfig.contentHeight || `80vh`); } }; From 61104da551aaa68b0706efa12b364cc19b022423 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 8 May 2024 15:39:55 +1000 Subject: [PATCH 104/206] move events to base component. --- .../websight/models/components/BaseComponent.java | 6 ++++++ .../websight/models/components/forms/Form.java | 11 ----------- .../websight/models/components/widgets/Treeview.java | 6 ------ .../models/components/widgets/table/Table.java | 9 --------- .../websight/models/components/widgets/tabs/Tabs.java | 5 ----- 5 files changed, 6 insertions(+), 31 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java index 91c5167f2..972e3eb41 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseComponent.java @@ -20,6 +20,7 @@ import org.apache.sling.models.annotations.Exporter; import org.apache.sling.models.annotations.ExporterOption; import org.apache.sling.models.annotations.Model; +import org.apache.sling.models.annotations.injectorspecific.ChildResource; import org.apache.sling.models.annotations.injectorspecific.Self; import org.jetbrains.annotations.Nullable; import org.apache.sling.api.SlingHttpServletRequest; @@ -29,6 +30,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import ai.typerefinery.websight.models.components.BaseComponent; +import ai.typerefinery.websight.models.dialog.EventsListItem; import ai.typerefinery.websight.utils.Styled; import ai.typerefinery.websight.utils.Grid; import ai.typerefinery.websight.utils.PageUtil; @@ -190,6 +192,10 @@ public class BaseComponent extends BaseModel implements Styled, Grid { @Getter public List<AttributeSelectValue> ariaAttributes; + @Getter + @ChildResource(name = "_events_") + private List<EventsListItem> events; + @Inject @Getter public Boolean persistColorWhenThemeSwitches; diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Form.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Form.java index c7dc9de40..00da46158 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Form.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Form.java @@ -17,8 +17,6 @@ import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; import java.util.HashMap; -import java.util.List; - import javax.inject.Inject; import lombok.Getter; @@ -28,16 +26,11 @@ import org.apache.sling.models.annotations.Exporter; import org.apache.sling.models.annotations.ExporterOption; import org.apache.sling.models.annotations.Model; -import org.apache.sling.models.annotations.injectorspecific.ChildResource; import org.osgi.service.component.annotations.Component; import javax.annotation.PostConstruct; -import ai.typerefinery.websight.models.components.BaseFormComponent; import ai.typerefinery.websight.models.components.FlowComponent; -import ai.typerefinery.websight.models.components.KeyValuePair; -import ai.typerefinery.websight.models.components.flow.FlowContainer; -import ai.typerefinery.websight.models.dialog.EventsListItem; import ai.typerefinery.websight.services.flow.FlowService; import ai.typerefinery.websight.services.flow.registry.FlowComponentRegister; import ai.typerefinery.websight.utils.PageUtil; @@ -83,10 +76,6 @@ public class Form extends FlowComponent implements FlowComponentRegister { @Getter private String readPayloadType; - @Getter - @ChildResource(name = "_events_") - private List<EventsListItem> events; - @Inject @Getter private String readMethod; diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/widgets/Treeview.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/widgets/Treeview.java index 4885ed17d..9fe4fff7a 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/widgets/Treeview.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/widgets/Treeview.java @@ -94,12 +94,6 @@ public class Treeview extends BaseComponent { @Getter public String numOfNodeLevelsToExpand; - // key is topic and value is type = HIGHLIGHT || FILTER - @Getter - @Inject - public List<KeyValuePair> events; - - @Inject @Getter public Boolean openNodeInNewTab; diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/widgets/table/Table.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/widgets/table/Table.java index fba2a28c4..ab538f4ca 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/widgets/table/Table.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/widgets/table/Table.java @@ -108,19 +108,10 @@ public class Table extends FlowComponent implements FlowComponentRegister { @Inject public Boolean multipleSelectRowEnabled; - - // key is topic and value is type = HIGHLIGHT || FILTER - @Getter - @Inject - public List<KeyValuePair> events; - - @Getter @Inject public Boolean singleSelectEnabled; - - @Getter @Inject public Boolean showActionButtons; diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/widgets/tabs/Tabs.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/widgets/tabs/Tabs.java index 22066405b..eddc240bf 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/widgets/tabs/Tabs.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/widgets/tabs/Tabs.java @@ -40,11 +40,6 @@ public class Tabs extends BaseComponent { @Inject @ChildResource(name = "tabs") public List<TabItem> tabsList; - - @Inject - @Getter - public List<KeyValuePair> events; - @Inject @Getter From fc30ea52eb28dad41883a983753bba0b250a5511 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 9 May 2024 16:56:21 +1000 Subject: [PATCH 105/206] do not output emprty and null values. --- .../src/main/java/ai/typerefinery/websight/utils/JsonUtil.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/utils/JsonUtil.java b/application/backend/src/main/java/ai/typerefinery/websight/utils/JsonUtil.java index 833d6fecf..02f4e8aef 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/utils/JsonUtil.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/utils/JsonUtil.java @@ -1,6 +1,7 @@ package ai.typerefinery.websight.utils; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; @@ -12,6 +13,8 @@ public class JsonUtil { */ public static String getJsonString(Object source) { ObjectMapper mapper = new ObjectMapper().configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); String jsonString =null; try { JsonNode node = mapper.valueToTree(source); From 63610c05c77ea8b1147a19429d172e656b9b5926 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 14 May 2024 04:08:23 +1000 Subject: [PATCH 106/206] add aocnfig field to events. --- .../websight/models/dialog/EventsListItem.java | 4 ++++ .../components/dialog/tabs/event/.content.json | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/dialog/EventsListItem.java b/application/backend/src/main/java/ai/typerefinery/websight/models/dialog/EventsListItem.java index f8b51a857..5b5a95701 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/dialog/EventsListItem.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/dialog/EventsListItem.java @@ -71,6 +71,10 @@ public class EventsListItem { @ValueMapValue private String type; + @Getter + @ValueMapValue + private String config; + @PostConstruct protected void init() { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json index fe3c60614..6ad9d6132 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json @@ -135,7 +135,7 @@ "label": "Delete", "value": "deleteitem" }, - "seelect": { + "select": { "sling:resourceType": "typerefinery/components/dialog/select/selectitem", "label": "Select", "value": "selectitem" @@ -147,6 +147,12 @@ "name": "nameCustom", "label": "Custom Event Name", "description": "Custom Event Name of the even raised by the component" + }, + "eventConfig": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "config", + "label": "Event Config", + "description": "Additional config to send with event." } } } \ No newline at end of file From acfc00797a39759eb8ce27a934f0f36d8df5bf0e Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 14 May 2024 04:09:50 +1000 Subject: [PATCH 107/206] clenaup emmitting events. --- .../fields/button/clientlibs/functions.js | 151 +++++++++++++---- .../forms/fields/button/dialog/.content.json | 45 +++++ .../fields/button/eventactions/.content.json | 8 + .../forms/form/clientlibs/functions.js | 3 +- .../layout/accordion/accordion.html | 1 + .../layout/accordion/clientlibs/functions.js | 154 +++++++++++++++++- .../layout/accordion/dialog/.content.json | 45 ++++- .../accordion/eventactions/.content.json | 13 ++ .../layout/accordionitem/accordionitem.html | 8 +- .../clientlibs-header/events/functions.js | 116 +++++++++++-- 10 files changed, 485 insertions(+), 59 deletions(-) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/eventactions/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/eventactions/.content.json diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js index 7b90951c1..cbc8f4593 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js @@ -6,40 +6,111 @@ window.Typerefinery.Modal = Typerefinery.Modal || {}; window.Typerefinery.Dropdown = Typerefinery.Dropdown || {}; window.Typerefinery.ToggleComponent = Typerefinery.ToggleComponent || {}; window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; +window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; -(function ($, ns, componentNs, modalNs, dropdownNs, toggleComponentNs, themeNs, document, window) { +(function ($, ns, componentNs, modalNs, dropdownNs, toggleComponentNs, themeNs, eventNs, document, window) { "use strict"; ns.selectorComponent = '[component=button]'; - ns.addEventListener = ($component, id) => { - $component.addEventListener("click", (e) => { - e?.preventDefault(); - const componentConfig = componentNs.getComponentConfig(e.currentTarget); - let { buttonType, navigateTo, navigateToInNewWindow } = componentConfig; - - if(buttonType === "navigate") { - if(navigateTo) { - - if(navigateToInNewWindow) { - window.open(navigateTo); - return; - } - window.location.href = navigateTo; - } - }else if(buttonType === "action") { - const { actionType } = componentConfig; - if(actionType === "openModal") { - // add query params from the url and pass it to the modal. - const url = new URL(window.location.href); - const params = new URLSearchParams(url.search); - const modalUrl = componentConfig.actionUrl + "?" + params.toString(); - modalNs.createModalAndOpen(componentConfig.actionModalTitle, modalUrl, componentConfig.hideFooter); - } - } + // map event types to handlers in component + // this will indicate which events are supported by component + // ns.eventMap = eventNs.genericEventsTopicMap(); + ns.eventMap = {}; + + ns.addEventListener = ($component, componentConfig) => { + + const { events, id } = componentConfig; + const defaultTopic = id; + console.group('addEventListener ' + id); + + console.log(["config", events, id, defaultTopic]); + + console.log("registering events"); + //register events + if (events) { + events.forEach(event => { + const { topic, type, name, nameCustom, action, config } = event; + //if topic not set use component id as topic + const topicName = topic || defaultTopic; + // if type is not defined then its emitted + let typeName = type || eventNs.EVENT_TYPE_LISTEN; + + let eventName = nameCustom || name; + console.group(action + " " + eventName); + console.log(["event config", topic, type, name, nameCustom, action, config]); + + console.log(["event to register", topicName, typeName, eventName, action]); + + console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap), topicName, typeName, action, eventName, config]); + eventNs.registerEventActionMapping(ns.eventMap, id, topicName, typeName, action, eventName, config); + console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap)]); + + // if event type is listen then add event listener for the event + + if (typeName === eventNs.EVENT_TYPE_EMIT) { + //emit do nothing here + } else { + //listen register the event and listent for specific event on topic + console.log(["register event listen", topicName, eventName]); + eventNs.registerEvents(topicName, (data) => { + // check make sure the event is for this event + if (data.type === eventName) { + ns.handleEventAction($component, action, data); + } + }); + } + console.groupEnd(); }); + + console.log(["eventMap", ns.eventMap]); + + } else { + console.log("no events found"); + } + + console.groupEnd(); + + console.group("adding click listener"); + + $component.on("click", (e) => { + console.group("click"); + console.log(["click", e]); + e?.preventDefault(); + const componentConfig = componentNs.getComponentConfig(e.currentTarget); + let { buttonType, navigateTo, navigateToInNewWindow } = componentConfig; + + console.log(["config", componentConfig, buttonType, navigateTo, navigateToInNewWindow]); + + if(buttonType === "navigate") { + if(navigateTo) { + + if(navigateToInNewWindow) { + window.open(navigateTo); + return; + } + window.location.href = navigateTo; + } + }else if(buttonType === "action") { + const { actionType } = componentConfig; + if(actionType === "openModal") { + // add query params from the url and pass it to the modal. + const url = new URL(window.location.href); + const params = new URLSearchParams(url.search); + const modalUrl = componentConfig.actionUrl + "?" + params.toString(); + modalNs.createModalAndOpen(componentConfig.actionModalTitle, modalUrl, componentConfig.hideFooter); + } else { + ns.BUTTON_CLICK($component, componentConfig, { type: "button", action: "click" , "id": id } ); + } + } + console.groupEnd(); + }); + + console.groupEnd(); } + + //FIXME: this is for hamburger functionality ns.windowResizeListener = ($component) => { - const target = $component.getAttribute("data-bs-target"); + const target = $component.attr("data-bs-target"); // remove the '#' from the value const targetId = target?.replace("#", ""); // select all elements with the same id as targetId @@ -57,11 +128,28 @@ window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; }) .resize(); }; + + // local actions representing the form actions + ns.BUTTON_CLICK = ($component, componentConfig, data) => { + console.group('BUTTON_CLICK'); + eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, data, eventNs.EVENTS.EVENT_SUCCESS_ACTION, "BUTTON_CLICK"); + console.groupEnd(); + } + + ns.handleEventAction = ($component, action, data) => { + console.group('handleEvent'); + console.log(["handleEvent", $component, action, data]); + console.groupEnd(); + } + ns.init = ($component) => { const componentConfig = componentNs.getComponentConfig($component); const { buttonType, id, actionType } = componentConfig; + console.group("init " + id); + console.log(["config", componentConfig, $component, ns.eventMap]); + if(buttonType === "submit") { return; } @@ -80,7 +168,12 @@ window.Typerefinery.Page.Theme = Typerefinery.Page.Theme || {}; return; } } - ns.addEventListener($component, id); + console.log("adding event listeners"); + ns.addEventListener($component, componentConfig); + console.log(["ns.eventMap", ns.eventMap]); + + //FIXME: this is for hamburger functionality ns.windowResizeListener($component) + console.groupEnd(); } -})(jQuery, Typerefinery.Components.Forms.Button, Typerefinery.Components, Typerefinery.Modal, Typerefinery.Dropdown, Typerefinery.ToggleComponent, window.Typerefinery.Page.Theme, document, window); \ No newline at end of file +})(jQuery, Typerefinery.Components.Forms.Button, Typerefinery.Components, Typerefinery.Modal, Typerefinery.Dropdown, Typerefinery.ToggleComponent, window.Typerefinery.Page.Theme, Typerefinery.Page.Events, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json index 7f014f6fd..63a6f2d1a 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json @@ -134,6 +134,51 @@ } } }, + "eventTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Events", + "warning": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/warning" + }, + "info": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/info" + }, + "event": { + "sling:resourceType": "wcm/dialogs/components/multifield", + "ws:disallowedContext": ["edit:panel"], + "name": "_events_", + "description": "Pick generic event or specify custom event to which component action will be mapped.", + "label": "Events", + "topic": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/topic" + }, + "type": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/type" + }, + "eventAction": { + "sling:resourceType": "typerefinery/components/dialog/eventactions", + "name": "action", + "label": "Component Action", + "description": "Which component action to map to event." + }, + "eventName": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventName" + }, + "eventNameCustom": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventNameCustom" + }, + "eventConfig": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventConfig" + } + } + }, "actionMetaData": { "sling:resourceType": "wcm/dialogs/components/tab", "label": "Action", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/eventactions/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/eventactions/.content.json new file mode 100644 index 000000000..c303d231a --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/eventactions/.content.json @@ -0,0 +1,8 @@ +{ + "sling:resourceType": "nt:unstructured", + "buttonclick": { + "sling:resourceType": "nt:unstructured", + "key": "BUTTON_CLICK", + "value": "Button Click" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index 0d23ad2f5..12ba5eda1 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -521,7 +521,8 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; // if type is not defined then its emitted let typeName = type || eventNs.EVENT_TYPE_EMIT; - let eventName = name || nameCustom; + //custom name takes precidence over name, this will be raised as event name + let eventName = nameCustom || name; console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap), topicName, typeName, action, eventName]); eventNs.registerEventActionMapping(ns.eventMap, topicName, typeName, action, eventName); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html index 713757e13..a6cef31b6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html @@ -18,6 +18,7 @@ component="${model.componentName}" id="${model.id}" class="${model.componentName} ${model.componentClassNames} ${model.variantClassNames}" + data-model="${model.jsonString}" data-sly-test="${resource.hasChildren}"> <sly data-sly-repeat.paragraph="${resource.children}"> <sly data-sly-test="${paragraph.name != 'template'}"> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index d48c45b71..e5c90af98 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -2,23 +2,139 @@ window.Typerefinery = window.Typerefinery || {}; window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Layout = Typerefinery.Components.Layout || {}; window.Typerefinery.Components.Layout.Accordion = Typerefinery.Components.Layout.Accordion || {}; +window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; -(function ($, ns, componentNs, document, window) { +(function ($, ns, componentNs, eventNs, document, window) { "use strict"; ns.selectorComponent = '[component=accordion]'; ns.selectorTemplate = "> template"; ns.selectorButton = 'button.accordion-button'; + ns.selectorAccordionItem = "accordion-item"; ns.attributeTarget = "data-bs-target"; ns.attributeParent = "data-bs-parent"; ns.attributeAriaControls = "aria-controls"; - ns.addNewItem = ($component) => { + // map event types to handlers in component + // this will indicate which events are supported by component + // ns.eventMap = eventNs.genericEventsTopicMap(); + ns.eventMap = {}; + + ns.addEventListener = ($component, componentConfig) => { + + const { events, id } = componentConfig; + const defaultTopic = id; + console.group('addEventListener ' + id); + + console.log(["config", events, id, defaultTopic]); + + console.log("registering events"); + //register events + if (events) { + events.forEach(event => { + const { topic, type, name, nameCustom, action, config } = event; + //if topic not set use component id as topic + const topicName = topic || defaultTopic; + // if type is not defined then its emitted + let typeName = type || eventNs.EVENT_TYPE_LISTEN || "custom"; + + let eventName = nameCustom || name; + console.group(action + " " + eventName); + console.log(["event config", topic, type, name, nameCustom, action]); + + console.log(["event to register", topicName, typeName, eventName, action]); + + console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap), topicName, typeName, action, eventName]); + eventNs.registerEventActionMapping(ns.eventMap, id, topicName, typeName, action, eventName, config); + console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap)]); + + // if event type is listen then add event listener for the event + + if (typeName === eventNs.EVENT_TYPE_EMIT) { + //emit do nothing here + } else { + //listen register the event and listent for specific event on topic + console.log(["register event listen", topicName, eventName]); + eventNs.registerEvents(topicName, (data) => { + // check make sure the event is for this event + console.log(["event data", data]); + if (data.type === eventName) { + ns.handleEventAction($component, action, data); + } + }); + } + console.groupEnd(); + }); + + console.log(["eventMap", ns.eventMap]); + + } else { + console.log("no events found"); + } + + console.groupEnd(); + + } + + // local actions representing the form actions + ns.ADD_ITEM = ($component, componentConfig, data) => { + console.group('ADD_ITEM'); + eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, data, eventNs.EVENTS.ADD_ITEM, "ADD_ITEM"); + console.groupEnd(); + } + + ns.openItem = ($component, data) => { + console.group('openItem'); + console.log(["openItem", $component, data]); + + const { config } = data; + const id = config; + const $item = $component.find(`#${id}`); + const $itemContainer = $item.closest(ns.selectorAccordionItem); + const $itemButton = $itemContainer.find(ns.selectorButton); + const itemButtonTarget = $itemButton.attr(ns.attributeTarget); + const $itemCollapse = $itemContainer.find(itemButtonTarget); + const itemDataParent = $itemCollapse.attr(ns.attributeParent); + + console.log(["$item", $item]); + console.log(["$itemContainer", $itemContainer]); + console.log(["$itemButton", $itemButton]); + console.log(["itemButtonTarget", itemButtonTarget]); + console.log(["$itemCollapse", $itemCollapse]); + console.log(["itemDataParent", itemDataParent]); + + $itemButton.removeClass('collapsed'); + $item.addClass('show'); + + console.groupEnd(); + } + + ns.addNewItem = ($component, data) => { + console.group('addNewItem'); + + console.log(["addNewItem", $component, data]); + const componentId = $component.attr('id'); - const $template = $component.find(ns.selectorTemplate); + const componentConfig = componentNs.getComponentConfig($component); + + //default template + const $internalTemplate = $component.find(ns.selectorTemplate); + let $template = $internalTemplate; + + console.log('$template', $template); + + const { config } = data; + console.log('config', config); + + if (config) { + const $externalTemplate = $(config); + $template = $externalTemplate.length ? $externalTemplate : $template; + console.log('$template', $template); + } + + var $newRow = $($template.html()); const itemId = Math.random().toString(36).substring(2, 15); - console.group('addNewItem'); $newRow.attr('state', "new"); $newRow.attr('id', itemId); @@ -43,13 +159,37 @@ window.Typerefinery.Components.Layout.Accordion = Typerefinery.Components.Layout $itemCollapse.attr(ns.attributeParent, `#${componentId}`); console.log('$newRow', $newRow); - - $template.before($newRow); + + $internalTemplate.before($newRow); + + ns.ADD_ITEM($component, componentConfig, { type: "accordion", action: "add_item" , "id": itemId } ); console.groupEnd(); } + ns.handleEventAction = ($component, action, data) => { + console.group('handleEvent'); + console.log(["handleEvent", $component, action, data]); + //load data into form + if (action === "ADD_ITEM") { + ns.addNewItem($component, data); + } + if (action === "OPEN_ITEM") { + ns.openItem($component, data); + } + console.groupEnd(); + } + ns.init = ($component) => { const componentConfig = componentNs.getComponentConfig($component); + const { id} = componentConfig; + console.group('init ' + id); + console.log(["config", componentConfig]); + + console.log("adding event listeners"); + ns.addEventListener($component, componentConfig); + console.log(["ns.eventMap", ns.eventMap]); + + console.groupEnd(); } -})(jQuery, Typerefinery.Components.Layout.Accordion, Typerefinery.Components, document, window); \ No newline at end of file +})(jQuery, Typerefinery.Components.Layout.Accordion, Typerefinery.Components, Typerefinery.Page.Events, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/dialog/.content.json index 993d6af8e..68956704b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/dialog/.content.json @@ -23,8 +23,49 @@ } }, "eventTab": { - "sling:resourceType": "wcm/dialogs/components/include", - "path": "/apps/typerefinery/components/dialog/tabs/event" + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Events", + "warning": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/warning" + }, + "info": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/info" + }, + "event": { + "sling:resourceType": "wcm/dialogs/components/multifield", + "ws:disallowedContext": ["edit:panel"], + "name": "_events_", + "description": "Pick generic event or specify custom event to which component action will be mapped.", + "label": "Events", + "topic": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/topic" + }, + "type": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/type" + }, + "eventAction": { + "sling:resourceType": "typerefinery/components/dialog/eventactions", + "name": "action", + "label": "Component Action", + "description": "Which component action to map to event." + }, + "eventName": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventName" + }, + "eventNameCustom": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventNameCustom" + }, + "eventConfig": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventConfig" + } + } }, "gridTab": { "sling:resourceType": "wcm/dialogs/components/include", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/eventactions/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/eventactions/.content.json new file mode 100644 index 000000000..cf4b06b96 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/eventactions/.content.json @@ -0,0 +1,13 @@ +{ + "sling:resourceType": "nt:unstructured", + "additem": { + "sling:resourceType": "nt:unstructured", + "key": "ADD_ITEM", + "value": "Add New Item" + }, + "openitem": { + "sling:resourceType": "nt:unstructured", + "key": "OPEN_ITEM", + "value": "Open Item" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html index 5ed977cb2..84a982bf4 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html @@ -12,13 +12,17 @@ */--> <sly data-sly-use.model="ai.typerefinery.websight.models.components.layout.AccordionItem"> <div class="accordion-item" + data-sly-set.parentid="#${resource.parent.id}" data-sly-set.expand="${wcmmode.isEdit || model.showopen}"> + <!-- wcmmode.isEdit ${wcmmode.isEdit}--> + <!-- model.showopen ${model.showopen}--> + <!-- expand ${expand}--> <h2 class="accordion-header"> - <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#${model.id}" aria-expanded="${model.showopen ? 'true' : ''}" aria-controls="${model.id}"> + <button class="accordion-button ${expand ? '' : 'collapsed'}" type="button" data-bs-toggle="collapse" data-bs-target="#${model.id}" aria-expanded="${expand ? 'true' : 'false'}" aria-controls="${model.id}"> ${model.title} </button> </h2> - <sly data-sly-set.parentid="#${resource.parent.id}"></sly> + <!-- expand ${expand}--> <div id="${model.id}" class="accordion-collapse collapse ${expand ? 'show' : ''}" data-bs-parent="${model.alwaysopen ? '' : parentid }"> <div class="accordion-body"> <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js index 6b09f8a08..1e6cd4f95 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js @@ -53,15 +53,15 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; return ns.EVENTS_CACHE; } ns.EVENTS_CACHE = {}; - ns.EVENTS_CACHE[ns.EVENT_TYPE_EMIT] = ns.genericEvents([]); - ns.EVENTS_CACHE[ns.EVENT_TYPE_LISTEN] = ns.genericEvents([]); + //ns.EVENTS_CACHE[ns.EVENT_TYPE_EMIT] = ns.genericEvents([]); + //ns.EVENTS_CACHE[ns.EVENT_TYPE_LISTEN] = ns.genericEvents([]); return ns.EVENTS_CACHE; } //add event mapping in eventMap local to component, maps component action to topic with event, for quick access by functions. - ns.registerEventActionMapping = function(eventMap, topic, type, componentAction, eventName) { + ns.registerEventActionMapping = function(eventMap, componentId, topic, type, componentAction, eventName, config) { console.group('registerEventActionMapping'); - console.log(eventMap, topic, type, componentAction, eventName); + console.log(eventMap, topic, type, componentAction, eventName, config); //check if params are passed if (!topic || !componentAction || !eventMap) { console.error("missing params"); @@ -75,38 +75,53 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } //create event config - const topicAction = { + let topicAction = { topic: topic, action: componentAction, + event: eventName, + config: config } - //init type + //init event type, EMIT or LISTEN if (!eventMap[type]) { - eventMap[type] = [eventName]; - console.warn("type not found, creating new type"); + eventMap[type] = {}; + console.warn(`event type not found ${type}, creating new type ${type}`); } - if (!eventMap[type][eventName]) { - eventMap[type][eventName] = [componentAction]; - console.warn("event not found, creating new event"); + //init component action that maps to event name + if (!eventMap[type][componentAction]) { + eventMap[type][componentAction] = {}; + console.warn(`event action not found ${componentAction}, creating new action ${componentAction}`); + } + + //init mapped event name to component id + if (!eventMap[type][componentAction][componentId]) { + eventMap[type][componentAction][componentId] = {}; + console.warn(`component id not found ${componentId}, creating new component id ${componentId}`); } - if (!eventMap[type][eventName][componentAction]) { - eventMap[type][eventName][componentAction] = [topic]; - console.warn("component action not found, creating new component action"); + console.log(["topicAction", topicAction]); + + //init mapped event name that maps to topic + if (!eventMap[type][componentAction][componentId][eventName]) { + eventMap[type][componentAction][componentId][eventName] = [topicAction]; + console.warn(`event name not found ${eventName}, creating new event name with topic ${topic}`); } else { //add event to type - eventMap[type][eventName][componentAction].push(topic); - console.warn("component action found, adding topic to component action"); + eventMap[type][componentAction][componentId][eventName].push(topicAction); + console.warn(`component action found ${eventName}, adding topic to component action ${topic}`); } console.groupEnd(); }; ns.emitEvent = (topic, payload) => { + console.group('emitEvent'); + console.log(["topic", topic, "payload", payload]); const evt = document.createEvent('customEvent'); evt.initCustomEvent('customEvent', false, false, { topic, payload }); ns.socket.dispatchEvent(evt); + console.groupEnd(); }; ns.createWebSocketConnection = () => { @@ -128,9 +143,74 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; }); }; + ns.emitLocalEvent = ($component, componentConfig, eventMap, payload, eventName, componentAction) => { + console.group('emitLocalEvent'); + console.log(["config", $component, componentConfig, payload, eventName, componentAction]); + + const { id } = componentConfig; + + // const eventData = ns.compileEventData(payload, eventName, componentAction); + // console.log(["eventData", eventData]); + console.log(["eventMap", eventMap]); + + if (!eventMap) { + console.error("Event map is missing"); + console.groupEnd(); + return; + } + //find event in eventMap and emit event to all the topics + if (eventMap[ns.EVENT_TYPE_EMIT]) { + console.log("eventMap found", componentAction, eventMap[ns.EVENT_TYPE_EMIT]); + if (eventMap[ns.EVENT_TYPE_EMIT][componentAction]) { + console.log("componentAction found", eventName, eventMap[ns.EVENT_TYPE_EMIT][componentAction]); + + //check if events exist for component id + if (!eventMap[ns.EVENT_TYPE_EMIT][componentAction][id]) { + console.warn("no events found for component"); + console.groupEnd(); + return; + } + + // for each event name in the component action emit event + const eventNames = Object.keys(eventMap[ns.EVENT_TYPE_EMIT][componentAction][id]); + console.group("eventNames"); + console.log("eventNames", eventNames); + // for each topic in the event name emit event + eventNames.forEach(eventName => { + console.log("eventName", eventName); + const topicValues = eventMap[ns.EVENT_TYPE_EMIT][componentAction][id][eventName]; + console.log("topicValues", topicValues); + // if topicValues is array then emit event to all the topics + if (Array.isArray(topicValues)) { + topicValues.forEach(topicValue => { + const { topic, config } = topicValue; + console.log("emit event for topic", topic); + const eventData = ns.compileEventData(payload, eventName, componentAction, id, config); + ns.emitEvent(topic, eventData); + }); + } else { + //is single value use it as topic + if (topicValues) { + const { topic, config } = topicValue; + console.log("emit event for topic", topic); + const eventData = ns.compileEventData(payload, eventName, componentAction, id, config); + ns.emitEvent(topic, eventData); + } + } + }); + console.groupEnd(); + } else { + console.log("no component action match"); + } + } else { + console.log("no event type match"); + } + + console.groupEnd(); + } - ns.compileEventData = (payload, eventName, action) => { - return { type: eventName, payload: payload, action: action}; + ns.compileEventData = (payload, eventName, action, componentId, config) => { + return { type: eventName, payload: payload, action: action, componentId: componentId, config: config}; }; ns.registerEvents = (topic, callbackFn) => { From c32573e5390575c4317d89e18f116261e203f7ab Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 14 May 2024 04:14:47 +1000 Subject: [PATCH 108/206] update usage of emitLocalEvent. --- .../forms/form/clientlibs/functions.js | 51 +++---------------- 1 file changed, 6 insertions(+), 45 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index 12ba5eda1..a68fc4b9f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -201,22 +201,22 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; // local actions representing the form actions ns.FORM_SUCCESS = ($component, componentConfig, formData) => { - ns.emitLocalEvent($component, componentConfig, formData, eventNs.EVENTS.EVENT_SUCCESS_ACTION, "FORM_SUCCESS"); + eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, formData, eventNs.EVENTS.EVENT_SUCCESS_ACTION, "FORM_SUCCESS"); } ns.FORM_ERROR = ($component, componentConfig, formData) => { - ns.emitLocalEvent($component, componentConfig, formData, eventNs.EVENTS.EVENT_ERROR_ACTION, "FORM_ERROR"); + eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, formData, eventNs.EVENTS.EVENT_ERROR_ACTION, "FORM_ERROR"); } ns.FORM_SUBMIT = ($component, componentConfig, formData) => { - ns.emitLocalEvent($component, componentConfig, formData, eventNs.EVENTS.EVENT_SUBMIT_ACTION, "FORM_SUBMIT"); + eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, formData, eventNs.EVENTS.EVENT_SUBMIT_ACTION, "FORM_SUBMIT"); } ns.FORM_CANCEL = ($component, componentConfig, formData) => { - ns.emitLocalEvent($component, componentConfig, formData, eventNs.EVENTS.EVENT_CANCEL_ACTION, "FORM_CANCEL"); + eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, formData, eventNs.EVENTS.EVENT_CANCEL_ACTION, "FORM_CANCEL"); } ns.FORM_RESET = ($component, componentConfig, formData) => { - ns.emitLocalEvent($component, componentConfig, formData, eventNs.EVENTS.EVENT_RESET_ACTION, "FORM_RESET"); + eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, formData, eventNs.EVENTS.EVENT_RESET_ACTION, "FORM_RESET"); } ns.FORM_LOADED = ($component, componentConfig, formData) => { - ns.emitLocalEvent($component, componentConfig, formData, eventNs.EVENTS.EVENT_READ_ACTION, "FORM_LOADED"); + eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, formData, eventNs.EVENTS.EVENT_READ_ACTION, "FORM_LOADED"); } // json form post @@ -453,45 +453,6 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; } } - ns.emitLocalEvent = ($component, componentConfig, payload, eventName, componentAction) => { - console.group('emitLocalEvent'); - console.log(["config", $component, componentConfig, payload, eventName, componentAction]); - const eventData = eventNs.compileEventData(payload, eventName, componentAction); - - if (!ns.eventMap) { - console.error("Event map is missing"); - console.groupEnd(); - return; - } - //find event in eventMap and emit event to all the topics - if (ns.eventMap[eventNs.EVENT_TYPE_EMIT]) { - if (ns.eventMap[eventNs.EVENT_TYPE_EMIT][eventName]) { - if (ns.eventMap[eventNs.EVENT_TYPE_EMIT][eventName][componentAction]) { - const topicValues = ns.eventMap[eventNs.EVENT_TYPE_EMIT][eventName][componentAction]; - console.log("match"); - - // if topicValues is array then emit event to all the topics - if (Array.isArray(topicValues)) { - topicValues.forEach(topicValue => { - console.log(topicValue); - eventNs.emitEvent(topicValue, eventData); - }); - } else { - //is single value use it as topic - if (topicValues) { - console.log(topicValues); - eventNs.emitEvent(topicValues, eventData); - } - } - } else { - console.log("no match"); - } - } - } - - console.groupEnd(); - } - ns.consumeIncomingEvent = ($component, eventData) => { const { type, topic, payload } = eventData; console.log(["consumeIncomingEvent", type, topic, payload]); From 4bb4fab912cb7e04a36f5095c411d5f768d37e2a Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 14 May 2024 04:14:55 +1000 Subject: [PATCH 109/206] add hint. --- .../components/layout/accordion/clientlibs/functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index e5c90af98..65d9c4274 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -58,7 +58,7 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; eventNs.registerEvents(topicName, (data) => { // check make sure the event is for this event console.log(["event data", data]); - if (data.type === eventName) { + if (data.type === eventName) { ns.handleEventAction($component, action, data); } }); @@ -170,7 +170,7 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.handleEventAction = ($component, action, data) => { console.group('handleEvent'); console.log(["handleEvent", $component, action, data]); - //load data into form + //FIXME: execute the correct function based on action from current namespace if (action === "ADD_ITEM") { ns.addNewItem($component, data); } From 107cd6b903b54eecd8852d5a7122d423a0a5d3dd Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 20 May 2024 13:47:57 +1000 Subject: [PATCH 110/206] fix button toggle elements. --- .../clientlibs-header/togglecomponent.js | 25 ++++++++++++------- .../fields/button/clientlibs/functions.js | 23 +++++++++-------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/togglecomponent.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/togglecomponent.js index 71c607eba..2dec8586b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/togglecomponent.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/togglecomponent.js @@ -3,19 +3,26 @@ window.Typerefinery.ToggleComponent = Typerefinery.ToggleComponent || {}; (function ($, ns, document, window) { ns.init = ($component, componentConfig) => { - // Updating the component with Bootstrap Attributes. - $component.attr("data-bs-toggle", "collapse"); + + console.group("ToggleComponent"); + console.log(["config", componentConfig, $component]); + $component.attr( - "data-bs-target", + "data-action-target", `${componentConfig.toggleTarget}` ); - //Set class "collapse" to hide the elements intially, which need to be toggle. - const targetElement = document.querySelectorAll( - `${componentConfig.toggleTarget}` - ); - targetElement.forEach((element) => { - element.classList.add("collapse"); + console.log(["target", componentConfig.toggleTarget]); + + $component.on("click", function () { + var targetElement = $(this).attr("data-action-target"); + var $targetElement = $(targetElement); + console.log("ToggleComponent Clicked", $targetElement); + $targetElement.toggle(); + $targetElement.focus(); }); + + console.groupEnd(); + }; })(jQuery, Typerefinery.ToggleComponent, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js index cbc8f4593..b3020c70d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js @@ -116,17 +116,18 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; // select all elements with the same id as targetId const elements = document.querySelectorAll(`#${targetId}`); - $(window) - .on("resize", function () { - if ($(this).width() > 1000) { - $(document).find(".collapse").removeClass("collapse"); - } else { - elements.forEach((element) => { - element.classList.add("collapse"); - }); - } - }) - .resize(); + //FIXME: this needs to be converted to events + // $(window) + // .on("resize", function () { + // if ($(this).width() > 1000) { + // $(document).find(".collapse").removeClass("collapse"); + // } else { + // elements.forEach((element) => { + // element.classList.add("collapse"); + // }); + // } + // }) + // .resize(); }; // local actions representing the form actions From 14285a116475e5f137b5f0f75f6450f4ceee3e1b Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 20 May 2024 13:48:24 +1000 Subject: [PATCH 111/206] fix button toggle. --- .../fields/button/clientlibs/functions.js | 74 +++++++++---------- 1 file changed, 33 insertions(+), 41 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js index b3020c70d..009e3fde1 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js @@ -108,28 +108,6 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.groupEnd(); } - //FIXME: this is for hamburger functionality - ns.windowResizeListener = ($component) => { - const target = $component.attr("data-bs-target"); - // remove the '#' from the value - const targetId = target?.replace("#", ""); - // select all elements with the same id as targetId - const elements = document.querySelectorAll(`#${targetId}`); - - //FIXME: this needs to be converted to events - // $(window) - // .on("resize", function () { - // if ($(this).width() > 1000) { - // $(document).find(".collapse").removeClass("collapse"); - // } else { - // elements.forEach((element) => { - // element.classList.add("collapse"); - // }); - // } - // }) - // .resize(); - }; - // local actions representing the form actions ns.BUTTON_CLICK = ($component, componentConfig, data) => { console.group('BUTTON_CLICK'); @@ -151,30 +129,44 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.group("init " + id); console.log(["config", componentConfig, $component, ns.eventMap]); - if(buttonType === "submit") { - return; - } - else if(buttonType === "action") { - // if(actionType === "openModal") { - // modalNs.init($component, componentConfig); - // }else - if(actionType === "openDropdown") { + let initEvents = true; + + switch (buttonType) { + case "submit": + initEvents = false; + break; + case "action": + //FIXME: need to convert these to events. + switch (actionType) { + case "openModal": + modalNs.init($component, componentConfig); + break; + case "openDropdown": dropdownNs.init($component, componentConfig); - return; - }else if(actionType === "initialTheme") { + initEvents = false; + break; + case "initialTheme": themeNs.init($component, componentConfig); - return; - }else if(actionType === "toggleComponent") { + break; + case "toggleComponent": toggleComponentNs.init($component, componentConfig); - return; + break; + default: + break; } + initEvents = false; + break; + default: + break; } - console.log("adding event listeners"); - ns.addEventListener($component, componentConfig); - console.log(["ns.eventMap", ns.eventMap]); - - //FIXME: this is for hamburger functionality - ns.windowResizeListener($component) + + + if (initEvents) { + console.log("adding event listeners"); + ns.addEventListener($component, componentConfig); + console.log(["ns.eventMap", ns.eventMap]); + } + console.groupEnd(); } })(jQuery, Typerefinery.Components.Forms.Button, Typerefinery.Components, Typerefinery.Modal, Typerefinery.Dropdown, Typerefinery.ToggleComponent, window.Typerefinery.Page.Theme, Typerefinery.Page.Events, document, window); \ No newline at end of file From 60dbb6783926679dc31afa1458ce6426323f14ee Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 20 May 2024 13:48:45 +1000 Subject: [PATCH 112/206] format button template. --- .../components/forms/fields/button/variant.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/variant.html index b2ee7cada..3c9493a17 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/variant.html @@ -17,8 +17,14 @@ <i class="${model.icon}"></i> </template> <template data-sly-template.variant="${ @ model }"> - <button data-label="${model.label}" toggleTheme="${model.persistColorWhenThemeSwitches ? 'false': 'text' }" component="${model.componentName}" id="${model.id}" type="${model.buttonType}" data-model="${model.jsonString}" - class="${model.componentClassNames} ${model.variantClassNames}"> + <button data-label="${model.label}" + toggleTheme="${model.persistColorWhenThemeSwitches ? 'false': 'text' }" + component="${model.componentName}" + id="${model.id}" + type="${model.buttonType}" + data-actionType="${model.actionType}" + data-model="${model.jsonString}" + class="${model.componentClassNames} ${model.variantClassNames}"> <sly data-sly-call="${icon @ model=model}" data-sly-test="${ model.showIcon && model.iconPosition== 'left' }"> </sly> ${model.label} From 61c870daca4acc91b0cabe9ea8ba0bd2100be1a4 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 20 May 2024 13:49:17 +1000 Subject: [PATCH 113/206] move global hidden style to page styles. --- .../apps/typerefinery/components/structure/page/body.html | 2 +- .../components/structure/page/clientlibs-header/style.css | 5 +++++ .../security/stix/clientlibs/resources/app/application.css | 4 ---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/body.html b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/body.html index 2705109b3..857e15bca 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/body.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/body.html @@ -12,7 +12,7 @@ See the License for the specific language governing permissions and limitations under the License. */--> -<body class="${properties.defaultTemplateCSS} ${properties.bodyClasses}"> +<body data-sly-set.isEditMode="${wcmmode.isEdit ? 'isEditMode ' : ''}" class="${isEditMode}${properties.defaultTemplateCSS} ${properties.bodyClasses}"> <sly data-sly-include="body-content.html"></sly> <sly data-sly-include="body-end.html"></sly> </body> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/style.css b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/style.css index 338c2f5bf..5f3b590c8 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/style.css +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/style.css @@ -61,4 +61,9 @@ body { .dropdownMenu { width: 10px; +} + +/*global utils */ +body:not(.isEditMode) .hidden { + display: none; } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/resources/app/application.css b/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/resources/app/application.css index 3e7d0cfd1..02f8cebc3 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/resources/app/application.css +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/security/stix/clientlibs/resources/app/application.css @@ -204,10 +204,6 @@ ul > li > p { cursor: pointer; } -.hidden { - display: none; -} - /*.selected { >>> This style is in the header of the index.html file for comptibility reasons! <<< filter: url("#drop-shadow"); From 334348ffdb12eb84fd5535396f9edf9356c6775c Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 22 May 2024 13:12:31 +1000 Subject: [PATCH 114/206] refactor custom event name into variable. --- .../structure/page/clientlibs-header/events/functions.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js index 1e6cd4f95..9db0fce18 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js @@ -7,6 +7,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.registery = {}; + ns.CUSTOM_EVENT_NAME = "customEvent"; + // component event types ns.EVENT_TYPE_EMIT = "emit"; ns.EVENT_TYPE_LISTEN = "listen"; @@ -118,8 +120,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.emitEvent = (topic, payload) => { console.group('emitEvent'); console.log(["topic", topic, "payload", payload]); - const evt = document.createEvent('customEvent'); - evt.initCustomEvent('customEvent', false, false, { topic, payload }); + const evt = document.createEvent(ns.CUSTOM_EVENT_NAME); + evt.initCustomEvent(ns.CUSTOM_EVENT_NAME, false, false, { topic, payload }); ns.socket.dispatchEvent(evt); console.groupEnd(); }; @@ -129,7 +131,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; }; ns.socketListener = () => { - ns.socket.addEventListener('customEvent', (e) => { + ns.socket.addEventListener(ns.CUSTOM_EVENT_NAME, (e) => { const detail = e.detail; const { topic, payload } = detail; From f4d0c6f25be141ccf4aeba7afac9e460b865b859 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 23 May 2024 14:10:30 +1000 Subject: [PATCH 115/206] reactor accordion to allow adding new templates. --- .../layout/accordion/accordion.html | 18 +- .../layout/accordion/clientlibs/functions.js | 174 +++++++++++++++++- .../layout/accordion/clientlibs/style.css | 1 + .../accordion/eventactions/.content.json | 25 +++ .../layout/accordionitem/accordionitem.html | 6 +- .../accordionitem/clientlibs/.content.json | 11 ++ .../layout/accordionitem/clientlibs/style.css | 1 + 7 files changed, 222 insertions(+), 14 deletions(-) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/clientlibs/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/clientlibs/style.css diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html index a6cef31b6..57db9c06f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html @@ -20,15 +20,23 @@ class="${model.componentName} ${model.componentClassNames} ${model.variantClassNames}" data-model="${model.jsonString}" data-sly-test="${resource.hasChildren}"> - <sly data-sly-repeat.paragraph="${resource.children}"> + <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} - Items Start</div> + <sly data-sly-repeat.paragraph="${resource.children}"> <sly data-sly-test="${paragraph.name != 'template'}"> <sly data-sly-test="${paragraph.resourceType && paragraph['sling:resourceType']}" data-sly-resource="${paragraph.path @ resourceType=paragraph.resourceType}"></sly> </sly> - <sly data-sly-test="${paragraph.name == 'template' && model.isTemplated}"> - <sly data-sly-test="${paragraph.resourceType && paragraph['sling:resourceType']}" data-sly-resource="${paragraph.path @ resourceType=paragraph.resourceType}"></sly> - <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} - Template</div> - </sly> + </sly> + <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} - Items End</div> + + <sly data-sly-test="${model.isTemplated}"> + <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} - Template Start</div> + <sly data-sly-repeat.paragraph="${resource.children}"> + <sly data-sly-test="${paragraph.name == 'template'}"> + <sly data-sly-test="${paragraph.resourceType && paragraph['sling:resourceType']}" data-sly-resource="${paragraph.path @ resourceType=paragraph.resourceType}"></sly> + </sly> </sly> + <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} - Template End</div> + </sly> </div> <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index 65d9c4274..2e3e53f85 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -87,6 +87,38 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.group('openItem'); console.log(["openItem", $component, data]); + const { config } = data; + const id = config; + const $item = $component.find(`#${id}`); + const $itemContainer = $item.closest(ns.selectorAccordionItem); + const $itemButton = $item.find(ns.selectorButton); + const itemButtonTarget = $itemButton.attr(ns.attributeTarget); + const $itemCollapse = $item.find(itemButtonTarget); + const itemDataParent = $itemCollapse.attr(ns.attributeParent); + + console.log(["$item", $item]); + console.log(["$itemContainer", $itemContainer]); + console.log(["$itemButton", $itemButton]); + console.log(["itemButtonTarget", itemButtonTarget]); + console.log(["$itemCollapse", $itemCollapse]); + console.log(["itemDataParent", itemDataParent]); + + // if button is not aria-expanded then click it + const ariaExpanded = $itemButton.attr('aria-expanded'); + console.log(["ariaExpanded", ariaExpanded]); + if (ariaExpanded === "false") { + $itemButton.click(); + } else { + console.log("already open"); + } + + console.groupEnd(); + } + + ns.closeItem = ($component, data) => { + console.group('openItem'); + console.log(["openItem", $component, data]); + const { config } = data; const id = config; const $item = $component.find(`#${id}`); @@ -103,13 +135,97 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log(["$itemCollapse", $itemCollapse]); console.log(["itemDataParent", itemDataParent]); - $itemButton.removeClass('collapsed'); - $item.addClass('show'); + // if button is not aria-expanded then click it + const ariaExpanded = $itemButton.attr('aria-expanded'); + console.log(["ariaExpanded", ariaExpanded]); + if (ariaExpanded === "true") { + $itemButton.click(); + } else { + console.log("already closed"); + } + console.groupEnd(); } - ns.addNewItem = ($component, data) => { + ns.toggleItem = ($component, data) => { + console.group('openItem'); + console.log(["openItem", $component, data]); + + const { config } = data; + const id = config; + const $item = $component.find(`#${id}`); + const $itemContainer = $item.closest(ns.selectorAccordionItem); + const $itemButton = $itemContainer.find(ns.selectorButton); + const itemButtonTarget = $itemButton.attr(ns.attributeTarget); + const $itemCollapse = $itemContainer.find(itemButtonTarget); + const itemDataParent = $itemCollapse.attr(ns.attributeParent); + + console.log(["$item", $item]); + console.log(["$itemContainer", $itemContainer]); + console.log(["$itemButton", $itemButton]); + console.log(["itemButtonTarget", itemButtonTarget]); + console.log(["$itemCollapse", $itemCollapse]); + console.log(["itemDataParent", itemDataParent]); + + $itemButton.click(); + + console.groupEnd(); + } + + + ns.showItem = ($component, data) => { + console.group('showItem'); + console.log(["showItem", $component, data]); + + const { config } = data; + const id = config; + const $item = $component.find(`#${id}`); + const $itemContainer = $item.closest(ns.selectorAccordionItem); + const $itemButton = $itemContainer.find(ns.selectorButton); + const itemButtonTarget = $itemButton.attr(ns.attributeTarget); + const $itemCollapse = $itemContainer.find(itemButtonTarget); + const itemDataParent = $itemCollapse.attr(ns.attributeParent); + + console.log(["$item", $item]); + console.log(["$itemContainer", $itemContainer]); + console.log(["$itemButton", $itemButton]); + console.log(["itemButtonTarget", itemButtonTarget]); + console.log(["$itemCollapse", $itemCollapse]); + console.log(["itemDataParent", itemDataParent]); + + $item.show(); + + console.groupEnd(); + } + + ns.hideItem = ($component, data) => { + console.group('hideItem'); + console.log(["hideItem", $component, data]); + + const { config } = data; + const id = config; + const $item = $component.find(`#${id}`); + const $itemContainer = $item.closest(ns.selectorAccordionItem); + const $itemButton = $itemContainer.find(ns.selectorButton); + const itemButtonTarget = $itemButton.attr(ns.attributeTarget); + const $itemCollapse = $itemContainer.find(itemButtonTarget); + const itemDataParent = $itemCollapse.attr(ns.attributeParent); + + console.log(["$item", $item]); + console.log(["$itemContainer", $itemContainer]); + console.log(["$itemButton", $itemButton]); + console.log(["itemButtonTarget", itemButtonTarget]); + console.log(["$itemCollapse", $itemCollapse]); + console.log(["itemDataParent", itemDataParent]); + + $item.hide(); + + console.groupEnd(); + } + + + ns.addNewItem = ($component, data, once) => { console.group('addNewItem'); console.log(["addNewItem", $component, data]); @@ -132,10 +248,25 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log('$template', $template); } - + // get the template id if set + const templateId = $template.attr('id'); + + // if once check if template not already added + if (once && templateId !== undefined) { + const $templateExists = $component.find(`[templateId='${templateId}']`); + if ($templateExists.length > 0) { + console.log("template already used once"); + ns.openItem($component, { config: $templateExists.attr('id') }); + return; + } + } + var $newRow = $($template.html()); const itemId = Math.random().toString(36).substring(2, 15); + if (once) { + $newRow.attr('templateId', templateId); + } $newRow.attr('state', "new"); $newRow.attr('id', itemId); @@ -148,6 +279,7 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const $itemButton = $newRow.find(ns.selectorButton); const itemButtonTarget = $itemButton.attr(ns.attributeTarget); //needs to be updated with new id const itemAriaControls = $itemButton.attr(ns.attributeAriaControls); //needs to be updated with new id + console.log('$itemButton', $itemButton); $itemButton.attr(ns.attributeTarget, `#${itemContentId}`); $itemButton.attr(ns.attributeAriaControls, itemContentId); @@ -158,11 +290,26 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const itemDataParent = $itemCollapse.attr(ns.attributeParent); // is pointing to the parent, needs to be updated to current component $itemCollapse.attr(ns.attributeParent, `#${componentId}`); + const isExpanded = $itemButton.attr('aria-expanded'); + if (isExpanded === "true") { + //remove show class + $itemCollapse.removeClass('show'); + //remove aria-expanded + $itemButton.attr('aria-expanded', 'false'); + } + console.log('$newRow', $newRow); + //insert into accordion $internalTemplate.before($newRow); - + + //raise event that item is added ns.ADD_ITEM($component, componentConfig, { type: "accordion", action: "add_item" , "id": itemId } ); + + if (isExpanded === "true") { + //open the item + ns.openItem($component, { config: itemId }); + } console.groupEnd(); } @@ -172,11 +319,26 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log(["handleEvent", $component, action, data]); //FIXME: execute the correct function based on action from current namespace if (action === "ADD_ITEM") { - ns.addNewItem($component, data); + ns.addNewItem($component, data, false); + } + if (action === "ADDONCE_ITEM") { + ns.addNewItem($component, data, true); } if (action === "OPEN_ITEM") { ns.openItem($component, data); } + if (action === "CLOSE_ITEM") { + ns.closeItem($component, data); + } + if (action === "TOGGLE_ITEM") { + ns.toggleItem($component, data); + } + if (action === "SHOW_ITEM") { + ns.showItem($component, data); + } + if (action === "HIDE_ITEM") { + ns.hideItem($component, data); + } console.groupEnd(); } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/style.css b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/style.css index e69de29bb..8b1378917 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/style.css +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/style.css @@ -0,0 +1 @@ + diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/eventactions/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/eventactions/.content.json index cf4b06b96..b76936ae1 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/eventactions/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/eventactions/.content.json @@ -5,9 +5,34 @@ "key": "ADD_ITEM", "value": "Add New Item" }, + "addonceitem": { + "sling:resourceType": "nt:unstructured", + "key": "ADDONCE_ITEM", + "value": "Add New Item Once" + }, "openitem": { "sling:resourceType": "nt:unstructured", "key": "OPEN_ITEM", "value": "Open Item" + }, + "closeitem": { + "sling:resourceType": "nt:unstructured", + "key": "CLOSE_ITEM", + "value": "Close Item" + }, + "toggleitem": { + "sling:resourceType": "nt:unstructured", + "key": "TOGGLE_ITEM", + "value": "Toggle Item" + }, + "showitem": { + "sling:resourceType": "nt:unstructured", + "key": "SHOW_ITEM", + "value": "Show Item" + }, + "hideitem": { + "sling:resourceType": "nt:unstructured", + "key": "HIDE_ITEM", + "value": "Hide Item" } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html index 84a982bf4..8d21ee3e5 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html @@ -11,19 +11,19 @@ limitations under the License. */--> <sly data-sly-use.model="ai.typerefinery.websight.models.components.layout.AccordionItem"> - <div class="accordion-item" + <div id="${model.id}" component="${model.componentName}" class="accordion-item ${model.variantClassNames}" data-sly-set.parentid="#${resource.parent.id}" data-sly-set.expand="${wcmmode.isEdit || model.showopen}"> <!-- wcmmode.isEdit ${wcmmode.isEdit}--> <!-- model.showopen ${model.showopen}--> <!-- expand ${expand}--> <h2 class="accordion-header"> - <button class="accordion-button ${expand ? '' : 'collapsed'}" type="button" data-bs-toggle="collapse" data-bs-target="#${model.id}" aria-expanded="${expand ? 'true' : 'false'}" aria-controls="${model.id}"> + <button class="accordion-button ${expand ? '' : 'collapsed'}" type="button" data-bs-toggle="collapse" data-bs-target="#${model.id}_content" aria-expanded="${expand ? 'true' : 'false'}" aria-controls="${model.id}_content"> ${model.title} </button> </h2> <!-- expand ${expand}--> - <div id="${model.id}" class="accordion-collapse collapse ${expand ? 'show' : ''}" data-bs-parent="${model.alwaysopen ? '' : parentid }"> + <div id="${model.id}_content" class="accordion-collapse collapse ${expand ? 'show' : ''}" data-bs-parent="${model.alwaysopen ? '' : parentid }"> <div class="accordion-body"> <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"> </sly> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/clientlibs/.content.json new file mode 100644 index 000000000..a28d7831f --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/clientlibs/.content.json @@ -0,0 +1,11 @@ +{ + "title": "Client Libs - Layout - Accordion Item", + "jcr:primaryType": "sling:Folder", + "sling:resourceType": "io/typerefinery/websight/clientlibs", + "categories": ["ai.typerefinery.websight.components","ai.typerefinery.websight.components.layout.accordionitem"], + "css": [ + "style.css" + ], + "js": [ + ] +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/clientlibs/style.css b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/clientlibs/style.css new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/clientlibs/style.css @@ -0,0 +1 @@ + From 887a1288fe54397c7670c935d220f165b9a3a8a7 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 23 May 2024 14:10:50 +1000 Subject: [PATCH 116/206] fix typo. --- .../components/content/embed/clientlibs/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js index d12633dfd..81dcbe8c6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js @@ -28,7 +28,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; // if autoResize is set to true, then register the autoResize event. const componentConfig = componentNs.getComponentConfig($component); if (componentConfig.autoResize) { - $iframe.on("load", function() { + $component.on("load", function() { ns.autoResize($component); }); } From 7559bf34fa348cb2fe8dec792cc0659d75ed09d8 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 23 May 2024 14:12:06 +1000 Subject: [PATCH 117/206] fix init logic for button. --- .../forms/fields/button/clientlibs/functions.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js index 009e3fde1..24bef2822 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js @@ -138,28 +138,32 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; case "action": //FIXME: need to convert these to events. switch (actionType) { - case "openModal": - modalNs.init($component, componentConfig); - break; + //NOTE: handled in on click. + // case "openModal": + // modalNs.init($component, componentConfig); + // initEvents = false; + // break; case "openDropdown": dropdownNs.init($component, componentConfig); initEvents = false; break; case "initialTheme": themeNs.init($component, componentConfig); + initEvents = false; break; case "toggleComponent": toggleComponentNs.init($component, componentConfig); + initEvents = false; break; default: break; } - initEvents = false; break; default: break; } + console.log(["initEvents", initEvents]); if (initEvents) { console.log("adding event listeners"); From 40a7c5805926e57e46a66cbe76c2a4ba317d1810 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 20 Jun 2024 17:29:33 +1000 Subject: [PATCH 118/206] update js to use jquery. --- .../clientlibs/clientlibs-header/dropdown.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js index f96d3d774..fb9fb6b52 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js @@ -30,20 +30,20 @@ Typerefinery.Modal = Typerefinery.Modal || {}; $component.attr("data-bs-toggle", "dropdown"); $component.attr("type", "button"); $component.attr("aria-expanded", "false"); - const buttonId = $component.asttr("id"); + const buttonId = $component.attr("id"); // Dropdown Container with default Attributes - const newDropdownContainer = document.createElement("div"); - newDropdownContainer.attr("class", "dropdown-menu dropdownMenu"); - newDropdownContainer.attr("aria-labelledby", buttonId); + const $newDropdownContainer = $("<div></div>"); + $newDropdownContainer.attr("class", "dropdown-menu dropdownMenu"); + $newDropdownContainer.attr("aria-labelledby", buttonId); const { dropdownItems } = componentConfig; - newDropdownContainer.innerHTML = ns.getDropdownInnerHTML(dropdownItems); + $newDropdownContainer.html(ns.getDropdownInnerHTML(dropdownItems)); - $component.parentNode.appendChild(newDropdownContainer); + $component.add($newDropdownContainer); }; From a35e56b66d0867c6720d75e29fadfd218c997dc8 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 20 Jun 2024 20:06:03 +1000 Subject: [PATCH 119/206] update models to allow field override via selectors. --- .../models/components/BaseFormComponent.java | 17 ++++++++++-- .../models/components/forms/Button.java | 11 +++++++- .../models/components/forms/Composite.java | 11 +++++++- .../models/components/forms/Field.java | 26 +++++++++++++++++++ .../models/components/forms/Select.java | 12 ++++++++- .../components/forms/SelectOptionItems.java | 12 ++++++++- 6 files changed, 83 insertions(+), 6 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java index 7d363d0d5..6ae53d25d 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java @@ -72,11 +72,18 @@ public class BaseFormComponent extends BaseComponent { @Getter @Default(booleanValues = false) protected Boolean disabled; - + + @Getter + protected String parentFieldId; + @Override @PostConstruct protected void init() { + + // set default parent field id + this.parentFieldId = this.id; + // check if selectors are present if (request != null && request.getRequestPathInfo() != null) { String selectors = request.getRequestPathInfo().getSelectorString(); @@ -84,11 +91,17 @@ protected void init() { String[] selectorArray = StringUtils.split(selectors, "."); if (selectorArray.length >= 2) { // check if id is present and update component id - if (ArrayUtils.contains(selectorArray, "id")) { + if (ArrayUtils.contains(selectorArray, "id")) { //overide id String value = selectorArray[ArrayUtils.indexOf(selectorArray, "id")+1]; if (StringUtils.isNotBlank(value)) { this.id = value; } + } + if (ArrayUtils.contains(selectorArray, "fid")) { //parent field id + String value = selectorArray[ArrayUtils.indexOf(selectorArray, "fid")+1]; + if (StringUtils.isNotBlank(value)) { + this.parentFieldId = value; + } } } } diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Button.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Button.java index ed4803498..e46814899 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Button.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Button.java @@ -23,6 +23,7 @@ import java.util.Map; import ai.typerefinery.websight.models.components.layout.NavigationItemComponent; +import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Model; import org.jetbrains.annotations.Nullable; @@ -37,10 +38,18 @@ import lombok.Getter; import org.apache.sling.models.annotations.Default; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.ExporterOption; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; -@Model(adaptables = Resource.class, defaultInjectionStrategy = OPTIONAL) +@Model(adaptables = { + Resource.class, + SlingHttpServletRequest.class +}, defaultInjectionStrategy = OPTIONAL) +@Exporter(name = "jackson", extensions = "json", options = { + @ExporterOption(name = "SerializationFeature.WRITE_DATES_AS_TIMESTAMPS", value = "true") +}) public class Button extends BaseFormComponent { protected static final String DEFAULT_LABEL = "Click me"; diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Composite.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Composite.java index b70d7a618..3b1dcb801 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Composite.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Composite.java @@ -17,7 +17,10 @@ import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; import org.apache.commons.lang3.StringUtils; +import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.ExporterOption; import org.apache.sling.models.annotations.Model; import javax.annotation.PostConstruct; @@ -26,7 +29,13 @@ import ai.typerefinery.websight.models.components.BaseFormComponent; -@Model(adaptables = Resource.class, defaultInjectionStrategy = OPTIONAL) +@Model(adaptables = { + Resource.class, + SlingHttpServletRequest.class +}, defaultInjectionStrategy = OPTIONAL) +@Exporter(name = "jackson", extensions = "json", options = { + @ExporterOption(name = "SerializationFeature.WRITE_DATES_AS_TIMESTAMPS", value = "true") +}) public class Composite extends BaseFormComponent { protected static final String DEFAULT_LABEL = "Composite"; diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java index 4fe68196b..f09f08567 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java @@ -32,6 +32,7 @@ import org.apache.sling.models.annotations.Exporter; import org.apache.sling.models.annotations.ExporterOption; import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.sling.api.SlingHttpServletRequest; @Model(adaptables = { @@ -46,6 +47,12 @@ public class Field extends BaseFormComponent { protected static final String DEFAULT_ID = "field"; protected static final String DEFAULT_MODULE = "field"; + @Getter + protected String labelId = DEFAULT_ID; + + @Getter + protected String fieldId = DEFAULT_ID; + // authored flex toggle @Inject @Getter @@ -72,6 +79,25 @@ protected void init() { } // Default margin gap. grid.addClasses("mb-3"); + + if (this.resource != null) { + this.labelId = this.resource.getName(); + this.fieldId = this.resource.getName(); + + if (this.resource.hasChildren()) { + this.resource.getChildren().forEach(child -> { + String name = child.getName(); + if (name.equals("label")) { + String id = child.getValueMap().get("id", ""); + this.labelId = this.resource.getName() + (StringUtils.isNotEmpty(id) ? "-" + id : ""); + } else if (name.equals("field")) { + String id = child.getValueMap().get("id", ""); + this.fieldId = this.resource.getName() + (StringUtils.isNotEmpty(id) ? "-" + id : ""); + } + }); + } + + } } } \ No newline at end of file diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Select.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Select.java index adab226af..ebc80823b 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Select.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Select.java @@ -19,17 +19,27 @@ import java.util.List; import org.apache.commons.lang3.StringUtils; +import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Model; import javax.annotation.PostConstruct; import javax.inject.Inject; import org.apache.sling.models.annotations.Default; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.ExporterOption; + import lombok.Getter; import ai.typerefinery.websight.models.components.BaseFormComponent; -@Model(adaptables = Resource.class, defaultInjectionStrategy = OPTIONAL) +@Model(adaptables = { + Resource.class, + SlingHttpServletRequest.class +}, defaultInjectionStrategy = OPTIONAL) +@Exporter(name = "jackson", extensions = "json", options = { + @ExporterOption(name = "SerializationFeature.WRITE_DATES_AS_TIMESTAMPS", value = "true") +}) public class Select extends BaseFormComponent { protected static final String DEFAULT_LABEL = "Select"; diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/SelectOptionItems.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/SelectOptionItems.java index b2ed72409..7d7dfe8c9 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/SelectOptionItems.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/SelectOptionItems.java @@ -20,10 +20,20 @@ import javax.inject.Inject; import lombok.Getter; + +import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.ExporterOption; import org.apache.sling.models.annotations.Model; -@Model(adaptables = Resource.class, defaultInjectionStrategy = OPTIONAL) +@Model(adaptables = { + Resource.class, + SlingHttpServletRequest.class +}, defaultInjectionStrategy = OPTIONAL) +@Exporter(name = "jackson", extensions = "json", options = { + @ExporterOption(name = "SerializationFeature.WRITE_DATES_AS_TIMESTAMPS", value = "true") +}) public class SelectOptionItems { @Getter From 45705d785384c089cdbb491d10d86138429dec27 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 20 Jun 2024 20:07:49 +1000 Subject: [PATCH 120/206] update form element model ids usage. --- .../typerefinery/components/forms/field/variant.html | 8 +++----- .../components/forms/fields/composite/variant.html | 2 +- .../forms/fields/composite/variant.list.html | 2 +- .../components/forms/fields/input/variant.html | 2 +- .../components/forms/fields/select/variant.html | 11 +++++++---- .../components/stix/forms/field/variant.html | 6 +++--- .../stix/forms/fields/composite/composite.html | 2 +- .../stix/forms/fields/composite/variant.html | 2 +- .../components/stix/forms/fields/input/input.html | 2 +- .../components/stix/forms/fields/input/variant.html | 7 ++++--- .../components/stix/forms/fields/select/select.html | 2 +- .../components/stix/forms/fields/select/variant.html | 2 +- 12 files changed, 25 insertions(+), 23 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html index ace8bfbff..cbaa329e2 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html @@ -1,8 +1,6 @@ <template data-sly-template.variant="${ @ model }"> - <field id="${model.id}" class="${model.componentClassNames}" data-fieldid="${model.id}" - data-sly-set.labelid="${'{0}-{1}' @ format=[model.id, 'label']}" - data-sly-set.inputid="${'{0}-{1}' @ format=[model.id, 'field']}"> - <sly data-sly-resource="${'label' @ selectors=['id', labelid, 'for', inputid]}"></sly> - <sly data-sly-resource="${'field' @ selectors=['id', inputid]}"></sly> + <field id="${model.id}" class="${model.componentClassNames}"> + <sly data-sly-resource="${'label' @ selectors=['id', model.labelId, 'for', model.fieldId, 'fid', model.parentFieldId]}"></sly> + <sly data-sly-resource="${'field' @ selectors=['id', model.fieldId, 'fid', model.parentFieldId]}"></sly> </field> </template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html index 0619c8927..335ec2a1f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html @@ -20,7 +20,7 @@ id="${model.id}" type="${model.inputType}" name="${model.name}" - data-fieldId="${model.id}-${model.name}" + data-fieldId="${model.parentFieldId}" placeholder="${model.placeholder}" class="${model.variantClassNames} form-control" required="${model.validationRequired}" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html index b0c8baf10..bf22ef35b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html @@ -20,7 +20,7 @@ id="${model.id}" name="${model.name}" type="${model.inputType}" - data-fieldId="${model.id}-${model.name}" + data-fieldId="${model.parentFieldId}" placeholder="${model.placeholder}" class="${model.variantClassNames} form-control" required="${model.validationRequired}" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/variant.html index 4a5c2e856..79e60f47b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/variant.html @@ -20,7 +20,7 @@ id="${model.id}" type="${model.inputType}" name="${model.name}" - data-fieldId="${model.id}-${model.name}" + data-fieldId="${model.parentFieldId}" placeholder="${model.placeholder}" class=" ${model.variantClassNames}" required="${model.validationRequired}" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/variant.html index 949a7d8d9..11b6f8b52 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/variant.html @@ -15,13 +15,16 @@ */--> <template data-sly-template.variant="${ @ model }"> <select - isInput="select" + component="${model.componentName}" + isInput="true" + id="${model.id}" + type="${model.inputType}" name="${model.name}" + data-fieldId="${model.parentFieldId}" + placeholder="${model.placeholder}" class="${model.variantClassNames} form-control" - id="${model.id}" + required="${model.validationRequired}" data-model="${model.jsonString}" - component="${model.componentName}" - placeholder="${model.placeholder}" disabled="${model.disabled}" > </select> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/variant.html index 3f94b0599..cbaa329e2 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/variant.html @@ -1,6 +1,6 @@ <template data-sly-template.variant="${ @ model }"> - <field id="${model.id}" class="${model.componentClassNames}" data-fieldid="${model.id}" label="${label}"> - <sly data-sly-resource="${'label' @ selectors=['id', resource.name]}"></sly> - <sly data-sly-resource="${'field' @ selectors=['id', resource.name]}"></sly> + <field id="${model.id}" class="${model.componentClassNames}"> + <sly data-sly-resource="${'label' @ selectors=['id', model.labelId, 'for', model.fieldId, 'fid', model.parentFieldId]}"></sly> + <sly data-sly-resource="${'field' @ selectors=['id', model.fieldId, 'fid', model.parentFieldId]}"></sly> </field> </template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/composite.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/composite.html index 706da7d2c..fb65e0335 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/composite.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/composite.html @@ -14,7 +14,7 @@ limitations under the License. */--> <sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Composite"> - <div class="${model.componentClassNames}" id="${model.id}" type="${model.inputType}" component="stix-${model.componentName}" isCompositeParent="true"> + <div class="${model.componentClassNames}" type="${model.inputType}" component="stix-${model.componentName}" isCompositeParent="true"> <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> </sly> </div> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html index 8eec4015b..9cbb7f1b6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html @@ -20,7 +20,7 @@ id="${model.id}" type="${model.inputType}" name="${model.name}" - data-fieldId="${model.id}-${model.name}" + data-fieldId="${model.parentFieldId}" placeholder="${model.placeholder}" class="${model.variantClassNames} form-control" required="${model.validationRequired}" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html index 0323d7f9c..e3ef8df82 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html @@ -14,7 +14,7 @@ limitations under the License. */--> <sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Input"> - <div class="${model.componentClassNames}" id="${model.id}" type="${model.inputType}" component="stix-${model.componentName}"> + <div class="${model.componentClassNames}" type="${model.inputType}" component="stix-${model.componentName}"> <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> </sly> </div> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/variant.html index 4a5c2e856..31bb9c0cd 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/variant.html @@ -17,13 +17,14 @@ <input component="${model.componentName}" isInput="true" - id="${model.id}" + id="${model.id}" type="${model.inputType}" name="${model.name}" - data-fieldId="${model.id}-${model.name}" - placeholder="${model.placeholder}" + data-fieldId="${model.parentFieldId}" + placeholder="${model.placeholder}" class=" ${model.variantClassNames}" required="${model.validationRequired}" + autocomplete="${model.autocomplete}" data-inputmask = " 'mask' : '${model.validationInputMask}'" disabled="${model.disabled}" /> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html index b90003097..f43c054a2 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html @@ -14,7 +14,7 @@ limitations under the License. */--> <sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Select"> - <div class="${model.componentClassNames}" id="${model.id}" type="${model.inputType}" component="stix-${model.componentName}"> + <div class="${model.componentClassNames}" type="${model.inputType}" component="stix-${model.componentName}"> <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> </sly> </div> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html index 8900776c6..11b6f8b52 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html @@ -20,7 +20,7 @@ id="${model.id}" type="${model.inputType}" name="${model.name}" - data-fieldId="${model.id}-${model.name}" + data-fieldId="${model.parentFieldId}" placeholder="${model.placeholder}" class="${model.variantClassNames} form-control" required="${model.validationRequired}" From 0c5b2523eceaec471232e26bc4c755e31485353a Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 20 Jun 2024 20:08:04 +1000 Subject: [PATCH 121/206] add data-fieldId to label. --- .../apps/typerefinery/components/forms/fields/label/variant.html | 1 + 1 file changed, 1 insertion(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/variant.html index a6614e05a..3dbf4d906 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/variant.html @@ -3,6 +3,7 @@ <label component="${model.componentName}" id="${model.id}" + data-fieldId="${model.parentFieldId}" class="${model.componentClassNames} ${model.variantClassNames}" for="${model.forId}">${model.label}</label> </sly> From a6ae70278df0198c8d88422baad3fac37e1c868e Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 20 Jun 2024 20:32:29 +1000 Subject: [PATCH 122/206] remove junk text. --- .../forms/fields/button/dialog/.content.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json index 63a6f2d1a..2173c1223 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json @@ -368,32 +368,32 @@ }, "warning": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", - "label": "Warning Button", + "label": "Warning", "value": "warning" }, "danger": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", - "label": "Danger Button", + "label": "Danger", "value": "danger" }, "info": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", - "label": "Info Button", + "label": "Info", "value": "info" }, "dark": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", - "label": "Dark Button", + "label": "Dark", "value": "dark" }, "gray": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", - "label": "Gray Button", + "label": "Gray", "value": "light" }, "link": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", - "label": "Link Button", + "label": "Link", "value": "text" } }, From 6b0d6d8eacddd68d0594a65986e00328d24ad540 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 20 Jun 2024 21:50:10 +1000 Subject: [PATCH 123/206] add title to button. --- .../websight/models/components/BaseFormComponent.java | 7 +++++++ .../components/forms/fields/button/dialog/.content.json | 4 ++++ .../components/forms/fields/button/variant.html | 1 + .../components/forms/form/common/.content.json | 5 +++++ 4 files changed, 17 insertions(+) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java index 6ae53d25d..293d7ea85 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java @@ -38,6 +38,7 @@ public class BaseFormComponent extends BaseComponent { public static final String PROPERTY_NAME = "name"; public static final String PROPERTY_LABEL = "label"; + public static final String PROPERTY_TITLE = "title"; public static final String PROPERTY_VALUE = "value"; public static final String PROPERTY_PLACEHOLDER = "placeholder"; @@ -55,6 +56,12 @@ public class BaseFormComponent extends BaseComponent { @Named(PROPERTY_LABEL) @Nullable protected String label; + + @Inject + @Getter + @Named(PROPERTY_TITLE) + @Nullable + protected String title; @Inject @Getter diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json index 2173c1223..d5e4e2db9 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json @@ -19,6 +19,10 @@ "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/forms/form/common/fieldLabel" }, + "fieldTitle": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/forms/form/common/fieldTitle" + }, "buttonType": { "sling:resourceType": "wcm/dialogs/components/select", "name": "buttonType", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/variant.html index 3c9493a17..8bade3584 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/variant.html @@ -20,6 +20,7 @@ <button data-label="${model.label}" toggleTheme="${model.persistColorWhenThemeSwitches ? 'false': 'text' }" component="${model.componentName}" + title="${model.title}" id="${model.id}" type="${model.buttonType}" data-actionType="${model.actionType}" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/common/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/common/.content.json index b4bf3f3fa..7a59988a9 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/common/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/common/.content.json @@ -6,6 +6,11 @@ "name": "label", "label": "Label" }, + "fieldTitle": { + "sling:resourceType": "wcm/dialogs/components/textfield", + "name": "title", + "label": "Title" + }, "fieldName": { "sling:resourceType": "wcm/dialogs/components/textfield", "name": "name", From dde3dded13eef94afb4c987206153fd35777992c Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 20 Jun 2024 21:51:01 +1000 Subject: [PATCH 124/206] add sendMessage to embed. --- .../components/content/embed/clientlibs/functions.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js index 81dcbe8c6..5cfe5fa03 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js @@ -24,6 +24,13 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; }); } + ns.sendMessage = function($component, data) { + console.log(["sendMessage", data]); + var $iframe = $component.find("iframe"); + var iframe = $iframe[0]; + iframe.contentWindow.postMessage(data, "*"); + } + ns.autoLoad = ($component) => { // if autoResize is set to true, then register the autoResize event. const componentConfig = componentNs.getComponentConfig($component); From 57db97f5a2618e5bac62c36a5177d4300162fe8e Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 20 Jun 2024 21:51:39 +1000 Subject: [PATCH 125/206] update select to load js. --- .../fields/select/clientlibs/behaviour.js | 4 +- .../fields/select/clientlibs/functions.js | 57 +++++++++++++------ .../forms/fields/select/select.html | 2 +- 3 files changed, 42 insertions(+), 21 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js index c5f9a4a3f..5a885f5aa 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/behaviour.js @@ -3,10 +3,10 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Select = Typerefinery.Components.Forms.Select || {}; -(function ($, ns, componentsNs, document) { +(function ($, ns, componentsNs, document, window) { "use strict"; //init and watch for new components componentsNs.watchDOMForComponent(`${ns.selectorComponent}${ns.selectorInitNot}`, ns.init); -})(jQuery, window.Typerefinery.Components.Forms.Select, window.Typerefinery.Components, document); +})(jQuery, window.Typerefinery.Components.Forms.Select, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js index 8239487f2..f1d845b86 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js @@ -122,36 +122,57 @@ window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components. const defaultSelectedOptions = ns.getDefaultOptionsSelected(componentConfig.defaultSelectedOptions); if(componentConfig.readOptionsFromDataSource) { - console.log("loading options from data source"); + console.log("loading options from data source, wait for response"); + console.groupEnd(); var optionsList = await ns.getOptionsFromDataSource(componentConfig); + console.group("select init, resume after response from data source"); console.log("data source list", optionsList); ns.addOptionsToSelect($component, defaultSelectedOptions, optionsList, componentConfig.keyNameInOptionList, componentConfig.keyNameInOptionList, componentConfig.labelNameInOptionList); console.log($component.html()); + console.log("loaded options"); + + console.log("init choices"); + + selectInstances[componentConfig.id] = new Choices($component.get(0), { + removeItemButton: true, + maxItemCount: componentConfig.maxSelection || -1, + allowHTML: false, + shouldSort: true, + loadingText: 'Loading...', + itemSelectText: 'Press to select', + uniqueItemText: 'Only unique values can be added', + addItemText: (value) => { + return `Press Enter to add <b>"${value}"</b>`; + }, + }); + console.groupEnd(); } else { console.log("loading options from config"); + if(componentConfig.selectOptions && Array.isArray(componentConfig.selectOptions)) { console.log("config options list", componentConfig.selectOptions) ns.addOptionsToSelect($component, defaultSelectedOptions, componentConfig.selectOptions, "value", "label"); } + console.log("loaded options"); + + console.log("init choices"); + + selectInstances[componentConfig.id] = new Choices($component.get(0), { + removeItemButton: true, + maxItemCount: componentConfig.maxSelection || -1, + allowHTML: false, + shouldSort: true, + loadingText: 'Loading...', + itemSelectText: 'Press to select', + uniqueItemText: 'Only unique values can be added', + addItemText: (value) => { + return `Press Enter to add <b>"${value}"</b>`; + }, + }); + + console.groupEnd(); } - console.log("loaded options"); - - console.log("init choices"); - - selectInstances[componentConfig.id] = new Choices($component.get(0), { - removeItemButton: true, - maxItemCount: componentConfig.maxSelection || -1, - allowHTML: false, - shouldSort: true, - loadingText: 'Loading...', - itemSelectText: 'Press to select', - uniqueItemText: 'Only unique values can be added', - addItemText: (value) => { - return `Press Enter to add <b>"${value}"</b>`; - }, - }); - console.groupEnd(); } })(jQuery, Typerefinery.Components.Forms.Select, Typerefinery.Components, Typerefinery.Components.Forms.Select.Instances, window, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/select.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/select.html index 5c1c26b21..5d77b36a6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/select.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/select.html @@ -14,7 +14,7 @@ limitations under the License. */--> <sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Select"> - <div class="${model.componentClassNames}" id="${model.id}" component="${model.componentName}-input"> + <div class="${model.componentClassNames}" type="${model.inputType}" component="${model.componentName}-input"> <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> </sly> </div> From 84b242168dd7351c4da5a1d1d43b36f769d144e3 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 20 Jun 2024 21:51:53 +1000 Subject: [PATCH 126/206] add author helpers to template. --- .../apps/typerefinery/components/layout/template/variant.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html index 4e39b348b..91d645a55 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html @@ -20,6 +20,7 @@ id="${model.id}" name="${model.name}" > + <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} Start (${model.id})</div> <sly data-sly-test="${resource.hasChildren}"> <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> </sly> @@ -28,5 +29,6 @@ data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> </sly> </sly> + <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} End (${model.id})</div> </template> </template> \ No newline at end of file From 4c09f1fafd3058c8ef4c98726250d14003f23e48 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 20 Jun 2024 21:52:37 +1000 Subject: [PATCH 127/206] add windowListener to raise events. --- .../clientlibs-header/events/functions.js | 76 ++++++++++++++++--- 1 file changed, 65 insertions(+), 11 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js index 9db0fce18..b4d13e32d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js @@ -130,19 +130,72 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.socket = new EventTarget(); }; + ns.windowListener = function() { + console.log("windowListener added"); + window.addEventListener('message', function(event) { + console.group('windowListener'); + console.log(["event", event]); + var eventData = event.data; + var sourceWindow = event.source; + var sourceOrigin = event.origin; + console.log(["sourceWindow", sourceWindow, "sourceOrigin", sourceOrigin, "eventData", eventData]); + // if (event.origin !== window.location.origin) { + // console.error("origin not matched"); + // return; + // } + + var sourceData; + if (eventData) { + if (typeof eventData === 'string') { + sourceData = JSON.parse( eventData ); + } + } + + console.log(["sourceData", sourceData]); + + if (sourceData) { + const { action, payload } = sourceData; + console.log(["action", action, "payload", payload]); + console.log(["registery", ns.registery]); + console.log(["ns.registery action", ns.registery[action]]); + + + const eventPayloadData = ns.compileEventData(payload, action, sourceData.action, sourceData.componentId, sourceData.config); + + console.log(["eventPayloadData", eventPayloadData]); + // ns.emitLocalEvent($component, componentConfig, ns.eventMap, data, action, action); + ns.emitEvent(action, eventPayloadData); + // if (ns.registery[action]) { + // console.log("topic found", action); + // ns.registery[action].forEach((callbackFn) => { + // console.log("callbackFn", callbackFn); + // if (typeof callbackFn === 'function') { + // callbackFn(payload); + // } + // }); + // } + } + console.groupEnd(); + }); + }; + ns.socketListener = () => { - ns.socket.addEventListener(ns.CUSTOM_EVENT_NAME, (e) => { - const detail = e.detail; - const { topic, payload } = detail; - - if (ns.registery[topic]) { - ns.registery[topic].forEach((callbackFn) => { - if (typeof callbackFn === 'function') { - callbackFn(payload); - } - }); + console.log("socketListener added"); + ns.socket.addEventListener(ns.CUSTOM_EVENT_NAME, (e) => { + console.group('socketListener'); + const detail = e.detail; + const { topic, payload } = detail; + console.log(["topic", topic, "payload", payload]); + if (ns.registery[topic]) { + console.log("topic found", topic); + ns.registery[topic].forEach((callbackFn) => { + console.log("callbackFn", callbackFn); + if (typeof callbackFn === 'function') { + callbackFn(payload); } - }); + }); + } + }); }; ns.emitLocalEvent = ($component, componentConfig, eventMap, payload, eventName, componentAction) => { @@ -229,6 +282,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; // NOTE: socket in this ns is a custom event. It is not a websocket. ns.createWebSocketConnection(); ns.socketListener(); + ns.windowListener(); }; // document ready jquery From 62b1c94f77add96003ccefe466bbfdef94706155 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 20 Jun 2024 21:52:55 +1000 Subject: [PATCH 128/206] update select to load js. --- .../fields/select/clientlibs/behaviour.js | 2 +- .../fields/select/clientlibs/functions.js | 91 ++++++++++++++----- .../stix/forms/fields/select/select.html | 2 +- .../stix/forms/fields/select/variant.html | 2 +- 4 files changed, 71 insertions(+), 26 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js index 230441097..8985c0011 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js @@ -8,6 +8,6 @@ window.Typerefinery.Components.Stix.Forms.Select = Typerefinery.Components.Stix. "use strict"; //init and watch for new components - componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + componentsNs.watchDOMForComponent(`${ns.selectorComponent}${ns.selectorInitNot}`, ns.init); })(jQuery, window.Typerefinery.Components.Stix.Forms.Select, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js index ecbf00205..8a8d0cb62 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js @@ -111,10 +111,21 @@ window.Typerefinery.Components.Stix.Forms.Select.Instances = Typerefinery.Compon ns.init = async ($component) => { console.group("select init"); const componentConfig = componentNs.getComponentConfig($component); + console.log("componentConfig", componentConfig); if(componentConfig.multipleSelection) { $component.attr('multiple', 'true'); } + if (!componentConfig.id) { + console.log("$component",$component); + console.log("$component.html()",$component.html()); + console.log("componentConfig",componentConfig); + console.log("componentConfig.id",componentConfig.id); + console.error("component id is required"); + console.groupEnd(); + return + } + console.log("componentConfig.id",componentConfig.id); console.log("component select",$component.get(0)); @@ -124,36 +135,70 @@ window.Typerefinery.Components.Stix.Forms.Select.Instances = Typerefinery.Compon const defaultSelectedOptions = ns.getDefaultOptionsSelected(componentConfig.defaultSelectedOptions); if(componentConfig.readOptionsFromDataSource) { - console.log("loading options from data source"); - var optionsList = await ns.getOptionsFromDataSource(componentConfig); - console.log("data source list", optionsList); - ns.addOptionsToSelect($component, defaultSelectedOptions, optionsList, componentConfig.keyNameInOptionList, componentConfig.keyNameInOptionList, componentConfig.labelNameInOptionList); - console.log($component.html()); + console.log("loading options from data source", componentConfig.readOptionsFromDataSource); + console.groupEnd(); + await ns.getOptionsFromDataSource(componentConfig).then((optionsList) => { + + console.group("select init, resuming after loading options from data source"); + console.log("componentConfig", componentConfig); + console.log("id", componentConfig.id); + console.log("data source list", optionsList); + ns.addOptionsToSelect($component, defaultSelectedOptions, optionsList, componentConfig.keyNameInOptionList, componentConfig.keyNameInOptionList, componentConfig.labelNameInOptionList); + console.log($component.html()); + console.log("loaded options"); + + console.log("init choices"); + console.log("init choices for", $component.get(0)); + + selectInstances[componentConfig.id] = new Choices($component.get(0), { + removeItemButton: true, + maxItemCount: componentConfig.maxSelection || -1, + allowHTML: false, + shouldSort: true, + loadingText: 'Loading...', + itemSelectText: 'Press to select', + uniqueItemText: 'Only unique values can be added', + addItemText: (value) => { + return `Press Enter to add <b>"${value}"</b>`; + }, + }); + + console.groupEnd(); + + }); + } else { console.log("loading options from config"); if(componentConfig.selectOptions && Array.isArray(componentConfig.selectOptions)) { console.log("config options list", componentConfig.selectOptions) ns.addOptionsToSelect($component, defaultSelectedOptions, componentConfig.selectOptions, "value", "label"); } + console.log("loaded options"); + + console.log("init choices"); + + if ($component.get(0)) { + + selectInstances[componentConfig.id] = new Choices($component.get(0), { + removeItemButton: true, + maxItemCount: componentConfig.maxSelection || -1, + allowHTML: false, + shouldSort: true, + loadingText: 'Loading...', + itemSelectText: 'Press to select', + uniqueItemText: 'Only unique values can be added', + addItemText: (value) => { + return `Press Enter to add <b>"${value}"</b>`; + }, + }); + + } else { + console.error("component not found"); + } + + console.groupEnd(); } - console.log("loaded options"); - - console.log("init choices"); - - selectInstances[componentConfig.id] = new Choices($component.get(0), { - removeItemButton: true, - maxItemCount: componentConfig.maxSelection || -1, - allowHTML: false, - shouldSort: true, - loadingText: 'Loading...', - itemSelectText: 'Press to select', - uniqueItemText: 'Only unique values can be added', - addItemText: (value) => { - return `Press Enter to add <b>"${value}"</b>`; - }, - }); - - console.groupEnd(); + } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html index f43c054a2..5d77b36a6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html @@ -14,7 +14,7 @@ limitations under the License. */--> <sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Select"> - <div class="${model.componentClassNames}" type="${model.inputType}" component="stix-${model.componentName}"> + <div class="${model.componentClassNames}" type="${model.inputType}" component="${model.componentName}-input"> <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> </sly> </div> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html index 11b6f8b52..9cd9e1e54 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html @@ -15,7 +15,7 @@ */--> <template data-sly-template.variant="${ @ model }"> <select - component="${model.componentName}" + component="stix-${model.componentName}" isInput="true" id="${model.id}" type="${model.inputType}" From 881f810b1adae6d1fa85bf57aad943d5408a91a2 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 21 Jun 2024 10:48:15 +1000 Subject: [PATCH 129/206] update console messages. --- .../fields/button/clientlibs/functions.js | 6 ++++- .../layout/accordion/clientlibs/functions.js | 27 ++++++++++++++++--- .../clientlibs-header/events/functions.js | 5 ++++ .../page/clientlibs-header/functions.js | 2 ++ .../page/clientlibs-header/theme/functions.js | 5 ++++ .../page/clientlibs-header/tms/client.js | 9 +++++-- 6 files changed, 47 insertions(+), 7 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js index 24bef2822..0c6faf455 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js @@ -126,7 +126,11 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const componentConfig = componentNs.getComponentConfig($component); const { buttonType, id, actionType } = componentConfig; - console.group("init " + id); + console.group("button init " + id); + console.log("$component", $component); + console.log("componentConfig", componentConfig); + console.log("buttonType", buttonType); + console.log("actionType", actionType); console.log(["config", componentConfig, $component, ns.eventMap]); let initEvents = true; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index 2e3e53f85..d543825e8 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -233,14 +233,33 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const componentId = $component.attr('id'); const componentConfig = componentNs.getComponentConfig($component); - //default template - const $internalTemplate = $component.find(ns.selectorTemplate); + let $internalTemplate = $component.find(ns.selectorTemplate); + const { config } = data; + console.log('config', config); + if (config) { + //if config starts with # then its a selector + if (config.startsWith("#")) { + console.log(`config is a selectot for template, looking up template by selector ${ns.selectorTemplate + config}`); + const $templateById = $component.find(ns.selectorTemplate + config); + if ($templateById.length === 0) { + console.error("template not found by id"); + } else { + console.log("template found by id", $templateById); + $internalTemplate = $templateById.first(); + } + } + } + + if ($internalTemplate.length > 1) { + console.log("more than one template found, using first one"); + $internalTemplate = $internalTemplate.first(); + } + + //default template let $template = $internalTemplate; console.log('$template', $template); - const { config } = data; - console.log('config', config); if (config) { const $externalTemplate = $(config); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js index b4d13e32d..6ae280fc1 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js @@ -279,10 +279,15 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.init = () => { + + console.group("events init"); + // NOTE: socket in this ns is a custom event. It is not a websocket. ns.createWebSocketConnection(); ns.socketListener(); ns.windowListener(); + + console.groupEnd(); }; // document ready jquery diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/functions.js index 6dd4195af..bb8a4fa96 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/functions.js @@ -8,9 +8,11 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; "use strict"; ns.init = () => { + console.group("page init"); tmsNs.init(); // Commenting this because themeNs init is invoked if the theme Button is linked to the page. // themeNs.init(); + console.groupEnd(); }; $(document).ready(function () { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/theme/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/theme/functions.js index b951964e7..cb39dc0f0 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/theme/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/theme/functions.js @@ -146,7 +146,12 @@ window.Typerefinery.Components.Widgets.Chart.Instances = Typerefinery.Components }; ns.init = ($component, componentConfig) => { + + console.group("theme init"); + ns.setInitialTheme(componentConfig); ns.attachEventListener($component, componentConfig); + + console.groupEnd(); }; })(jQuery, Typerefinery.Page.Theme, Typerefinery.Components.Widgets.Chart.Instances, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js index e2d397725..e71ad5a49 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js @@ -32,11 +32,16 @@ window.MessageService.Client = MessageService.Client || {}; }, } - function init() { + ns.init = function() { + console.group("tms init"); + + //generate client id ns.client_id = Date.now() // output id to page ns.events.emit(ns.events.CLIENT_ID, ns.client_id) + + console.groupEnd(); } //get metadata field messagehost @@ -229,6 +234,6 @@ window.MessageService.Client = MessageService.Client || {}; } } - init(); + ns.init(); })(jQuery, window.MessageService.Client, window.JSONSchemas, document, window); \ No newline at end of file From 0bf1d82e2e3f9c8099e7cfe572bfa695d4097aa2 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 21 Jun 2024 10:48:49 +1000 Subject: [PATCH 130/206] fix error handling in dropdown init. --- .../clientlibs/clientlibs-header/dropdown.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js index fb9fb6b52..da2c19c5c 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js @@ -25,6 +25,7 @@ Typerefinery.Modal = Typerefinery.Modal || {}; ns.init = ($component, componentConfig) => { + console.group("dropdown init"); // Updating the component with Bootstrap Attributes. $component.attr("data-bs-toggle", "dropdown"); @@ -41,10 +42,18 @@ Typerefinery.Modal = Typerefinery.Modal || {}; const { dropdownItems } = componentConfig; - $newDropdownContainer.html(ns.getDropdownInnerHTML(dropdownItems)); + if (!dropdownItems || dropdownItems.length === 0) { + console.error("not dropdown items provided in component config."); + } else { + $newDropdownContainer.html(ns.getDropdownInnerHTML(dropdownItems)); + + } + $component.add($newDropdownContainer); + console.groupEnd(); + }; ns.dropDownButtonEventListener = () => { From afac6eff4636ad28957a44cdea5089bf8eac8071 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 21 Jun 2024 11:49:43 +1000 Subject: [PATCH 131/206] ensure form field has label and field optional. --- .../websight/models/components/forms/Field.java | 9 +++++++++ .../typerefinery/components/forms/field/variant.html | 4 ++-- .../components/stix/forms/field/variant.html | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java index f09f08567..d7c8c3eb0 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java @@ -50,9 +50,16 @@ public class Field extends BaseFormComponent { @Getter protected String labelId = DEFAULT_ID; + @Getter + protected boolean labelHidden = true; //hidden untill we find it as a child + @Getter protected String fieldId = DEFAULT_ID; + @Getter + protected boolean fieldHidden = true; //hidden untill we find it as a child + + // authored flex toggle @Inject @Getter @@ -90,9 +97,11 @@ protected void init() { if (name.equals("label")) { String id = child.getValueMap().get("id", ""); this.labelId = this.resource.getName() + (StringUtils.isNotEmpty(id) ? "-" + id : ""); + this.labelHidden = false; } else if (name.equals("field")) { String id = child.getValueMap().get("id", ""); this.fieldId = this.resource.getName() + (StringUtils.isNotEmpty(id) ? "-" + id : ""); + this.fieldHidden = false; } }); } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html index cbaa329e2..90f44203a 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/field/variant.html @@ -1,6 +1,6 @@ <template data-sly-template.variant="${ @ model }"> <field id="${model.id}" class="${model.componentClassNames}"> - <sly data-sly-resource="${'label' @ selectors=['id', model.labelId, 'for', model.fieldId, 'fid', model.parentFieldId]}"></sly> - <sly data-sly-resource="${'field' @ selectors=['id', model.fieldId, 'fid', model.parentFieldId]}"></sly> + <sly data-sly-test="${!model.labelHidden}" data-sly-resource="${'label' @ selectors=['id', model.labelId, 'for', model.fieldId, 'fid', model.parentFieldId]}"></sly> + <sly data-sly-test="${!model.fieldHidden}" data-sly-resource="${'field' @ selectors=['id', model.fieldId, 'fid', model.parentFieldId]}"></sly> </field> </template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/variant.html index cbaa329e2..90f44203a 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/variant.html @@ -1,6 +1,6 @@ <template data-sly-template.variant="${ @ model }"> <field id="${model.id}" class="${model.componentClassNames}"> - <sly data-sly-resource="${'label' @ selectors=['id', model.labelId, 'for', model.fieldId, 'fid', model.parentFieldId]}"></sly> - <sly data-sly-resource="${'field' @ selectors=['id', model.fieldId, 'fid', model.parentFieldId]}"></sly> + <sly data-sly-test="${!model.labelHidden}" data-sly-resource="${'label' @ selectors=['id', model.labelId, 'for', model.fieldId, 'fid', model.parentFieldId]}"></sly> + <sly data-sly-test="${!model.fieldHidden}" data-sly-resource="${'field' @ selectors=['id', model.fieldId, 'fid', model.parentFieldId]}"></sly> </field> </template> \ No newline at end of file From 3a48dd371dbcef7c149981abaa68204b90337fb3 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 21 Jun 2024 11:59:27 +1000 Subject: [PATCH 132/206] add value option to input field. --- .../forms/fields/input/dialog/.content.json | 11 ++++++++++- .../components/forms/fields/input/variant.html | 3 ++- .../stix/forms/fields/input/dialog/.content.json | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/dialog/.content.json index 8052e987b..efa7ace67 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/dialog/.content.json @@ -13,6 +13,10 @@ "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/forms/form/common/placeholder" }, + "fieldValue": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/forms/form/common/fieldValue" + }, "inputType": { "sling:resourceType": "wcm/dialogs/components/select", "name": "inputType", @@ -52,10 +56,15 @@ "label": "Date", "value": "date" }, - "time": { + "hidden": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", "label": "Time", "value": "time" + }, + "time": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Hidden (but, visible in edit mode)", + "value": "hidden" } } }, diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/variant.html index 79e60f47b..c584c96b4 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/variant.html @@ -18,8 +18,9 @@ component="${model.componentName}" isInput="true" id="${model.id}" - type="${model.inputType}" + type="${wcmmode.isEdit && model.inputType == 'hidden' ? 'text' : model.inputType}" name="${model.name}" + value="${model.value}" data-fieldId="${model.parentFieldId}" placeholder="${model.placeholder}" class=" ${model.variantClassNames}" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/dialog/.content.json index 0152dfcaf..b15ae877b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/dialog/.content.json @@ -13,6 +13,10 @@ "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/forms/form/common/placeholder" }, + "fieldValue": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/forms/form/common/fieldValue" + }, "inputType": { "sling:resourceType": "wcm/dialogs/components/select", "name": "inputType", From 9238d3e7b074e609ed67159ea8736c14821a9ecd Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 21 Jun 2024 16:05:49 +1000 Subject: [PATCH 133/206] add template component-info. --- .../components/structure/page/clientlibs-header/style.css | 4 ++++ .../components/structure/templates/component-info.html | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/structure/templates/component-info.html diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/style.css b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/style.css index 5f3b590c8..078546901 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/style.css +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/style.css @@ -66,4 +66,8 @@ body { /*global utils */ body:not(.isEditMode) .hidden { display: none; +} + +[component="editinfobadge"] { + --bs-bg-opacity: .5; } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/templates/component-info.html b/application/backend/src/main/resources/apps/typerefinery/components/structure/templates/component-info.html new file mode 100644 index 000000000..1fac27562 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/templates/component-info.html @@ -0,0 +1,3 @@ +<template data-sly-template.placeholder="${ @ title }"> + <div data-sly-test="${wcmmode.isEdit}" component="editinfobadge" class="bg-warning">${title}</div> +</template> \ No newline at end of file From 7d3377adbe14e4b78f1a5497a800c3818c502d47 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 21 Jun 2024 16:14:27 +1000 Subject: [PATCH 134/206] update component badges to use template. --- .../components/content/embed/embed.html | 6 ++--- .../fields/button/variant.hamburger.html | 7 +++--- .../forms/fields/composite/variant.html | 5 +++- .../forms/fields/composite/variant.list.html | 5 +++- .../forms/fields/label/variant.html | 6 ++--- .../layout/accordion/accordion.html | 25 +++++++++++++++---- .../layout/accordionitem/accordionitem.html | 4 ++- .../components/layout/container/variant.html | 5 +++- .../components/layout/template/variant.html | 9 +++++-- .../components/layout/treeview/variant.html | 9 +++---- .../components/widgets/tabs/tabs.html | 6 ++--- 11 files changed, 59 insertions(+), 28 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/embed.html b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/embed.html index 42eb18f44..a0574aa48 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/embed.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/embed.html @@ -26,9 +26,9 @@ > <sly data-sly-use.template="${template}" data-sly-call="${template.variant @ model=model}"> </sly> - <sly data-sly-test="${wcmmode.isEdit}"> - <div style="--bs-bg-opacity: .5;" class="bg-warning">${model.componentTitle} Component</div> - </sly> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> </div> </sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/variant.hamburger.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/variant.hamburger.html index f2eadfb75..54634db30 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/variant.hamburger.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/variant.hamburger.html @@ -24,7 +24,8 @@ </sly> </button> </div> - <sly data-sly-test="${wcmmode.isEdit}"> - <div style="--bs-bg-opacity: .5;" class="bg-warning">Hamburger visible for limited screen size.</div> - </sly> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - Visible only on some screen sizes.'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> + </template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html index 335ec2a1f..2592cf776 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.html @@ -33,5 +33,8 @@ <div template> <sly data-sly-include="${'parsys.html' @ prependPath='/apps/typerefinery/components/parsys'}"></sly> </div> - <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle}</div> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - (', model.name ,')'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> + </template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html index bf22ef35b..a570762bc 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/variant.list.html @@ -84,5 +84,8 @@ </div> </template> </sly> - <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} - Template</div> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - Template (', model.name ,')'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> + </template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/variant.html index 3dbf4d906..8fcbc1bd5 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/variant.html @@ -7,7 +7,7 @@ class="${model.componentClassNames} ${model.variantClassNames}" for="${model.forId}">${model.label}</label> </sly> - <sly data-sly-test="${wcmmode.isEdit && model.hideLabel}"> - <div style="--bs-bg-opacity: .5;" class="bg-warning">Label is Hidden</div> - </sly> + <sly data-sly-test="${model.hideLabel}" data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - Label is hidden'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> </template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html index 57db9c06f..be5e8612e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/accordion.html @@ -20,26 +20,41 @@ class="${model.componentName} ${model.componentClassNames} ${model.variantClassNames}" data-model="${model.jsonString}" data-sly-test="${resource.hasChildren}"> - <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} - Items Start</div> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - Items Start'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> + <sly data-sly-repeat.paragraph="${resource.children}"> <sly data-sly-test="${paragraph.name != 'template'}"> <sly data-sly-test="${paragraph.resourceType && paragraph['sling:resourceType']}" data-sly-resource="${paragraph.path @ resourceType=paragraph.resourceType}"></sly> </sly> </sly> - <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} - Items End</div> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - Items End'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> + <sly data-sly-test="${model.isTemplated}"> - <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} - Template Start</div> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - Template Start'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> + <sly data-sly-repeat.paragraph="${resource.children}"> <sly data-sly-test="${paragraph.name == 'template'}"> <sly data-sly-test="${paragraph.resourceType && paragraph['sling:resourceType']}" data-sly-resource="${paragraph.path @ resourceType=paragraph.resourceType}"></sly> </sly> </sly> - <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} - Template End</div> + + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - Template End'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> + </sly> </div> <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> </sly> - <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle}</div> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> </sly> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html index 8d21ee3e5..02849bea6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html @@ -31,7 +31,9 @@ <h2 class="accordion-header"> data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> </sly> - <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle}</div> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - (', model.title ,')'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> </div> </div> </div> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html index 24c588244..e66be5b8f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html @@ -18,7 +18,10 @@ <!--/* Show error if this container is inheriting but can't find parent. */--> <sly data-sly-test="${model.inheriting && !model.cancelInheritParent && !model.inheritedResource}"> <!--${model.componentName} inherited resource not found--> - <div data-sly-test="${wcmmode.isEdit}" component="${model.componentName}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle}: Inherited but parent not found.</div> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - Inherited but parent not found'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> + </sly> <!--/* Print output of inherited resource. */--> <sly data-sly-test="${model.inheriting && !model.cancelInheritParent && model.inheritedResource}"> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html index 91d645a55..2cdd11a9c 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html @@ -20,7 +20,10 @@ id="${model.id}" name="${model.name}" > - <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} Start (${model.id})</div> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - Start (', model.id ,')'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> + <sly data-sly-test="${resource.hasChildren}"> <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> </sly> @@ -29,6 +32,8 @@ data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> </sly> </sly> - <div data-sly-test="${wcmmode.isEdit}" component="${model.componentTitle}" style="--bs-bg-opacity: .5;" class="bg-warning ${model.componentClassNames}">${model.componentTitle} End (${model.id})</div> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - End (', model.id ,')'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> </template> </template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/variant.html index c653c7d91..0c67c413b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/treeview/variant.html @@ -8,9 +8,8 @@ data-sly-test="${model.parentPagePath}" > </div> - <sly data-sly-test="${!model.parentPagePath && wcmmode.isEdit}"> - <div style="--bs-bg-opacity: .5;" class="bg-warning text-center"> - Tree view content - </div> - </sly> + <sly data-sly-test="${!model.parentPagePath}" data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - Set parent page path.'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> + </template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/tabs.html b/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/tabs.html index cb04e4a3f..5f182ed59 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/tabs.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/tabs/tabs.html @@ -3,9 +3,9 @@ <sly data-sly-use.model="ai.typerefinery.websight.models.components.widgets.tabs.Tabs" data-sly-set.template="${'./variant.html'}"> - <sly data-sly-test="${wcmmode.isEdit}"> - <div style="--bs-bg-opacity: .5;" class="bg-warning">${model.componentTitle} Component</div> - </sly> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> <div class="${model.componentClassNames}"> <div From e5ccfd95d43a7037040a1e5309b8415fdd3dc9f0 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 21 Jun 2024 21:29:44 +1000 Subject: [PATCH 135/206] ensure all form components available for composite field. --- .../typerefinery/components/forms/composite/.content.json | 5 ++++- .../components/forms/fields/composite/.content.json | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/.content.json index 835654f96..62d3f3649 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/.content.json @@ -7,6 +7,9 @@ "title": "Composite Field", "sling:resourceSuperType": "typerefinery/components/forms/field", "allowedComponents": [ - "Typerefinery - Forms" + "Typerefinery - Forms", + "Typerefinery - Forms - Stix - Input", + "Typerefinery - Forms - Stix - Select", + "Typerefinery - Forms - Stix - Composite" ] } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/.content.json index 7bb7d435e..21eaffeef 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/.content.json @@ -5,6 +5,9 @@ "description": "This is Composite field returning JSON of its values", "title": "Composite", "allowedComponents": [ - "Typerefinery - Forms" + "Typerefinery - Forms", + "Typerefinery - Forms - Stix - Input", + "Typerefinery - Forms - Stix - Select", + "Typerefinery - Forms - Stix - Composite" ] } From ef75418715bf2b4390490d64af1220184d2e6e9a Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 24 Jun 2024 21:08:20 +1000 Subject: [PATCH 136/206] add placeholder for container. --- .../components/layout/container/variant.html | 12 ++++++++---- .../layout/container/variant.sectionwithtitle.html | 6 ++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html index e66be5b8f..208c9d80d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html @@ -28,6 +28,9 @@ <!--${model.componentName} inherited start ${model.inheritedResource.path}--> ${model.inheritedHtml @ context='unsafe'} <!--${model.componentName} inherited end ${model.inheritedResource.path}--> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - Inherited (', model.inheritedResource.path, ')'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> </sly> <!--/* Normal print of component */--> @@ -44,10 +47,11 @@ data-sly-test="${resource.hasChildren}"> <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> </div> - <sly data-sly-test="${!resource.hasChildren}"> - <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" - data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> - </sly> + <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" + data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> </sly> + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - Not Inherited'] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> </sly> </template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.sectionwithtitle.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.sectionwithtitle.html index 8010548a7..5b9e604d7 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.sectionwithtitle.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.sectionwithtitle.html @@ -34,9 +34,7 @@ </div> </div> - <sly data-sly-test="${!resource.hasChildren}"> - <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" - data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> - </sly> + <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" + data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> </sly> </template> \ No newline at end of file From 20c4db2b68c7c31c39a95955f8f4d0614f482fb4 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 24 Jun 2024 21:10:52 +1000 Subject: [PATCH 137/206] update dialog label. --- .../typerefinery/components/forms/form/common/.content.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/common/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/common/.content.json index 7a59988a9..9828a5dfc 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/common/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/common/.content.json @@ -20,8 +20,8 @@ "fieldValue": { "sling:resourceType": "wcm/dialogs/components/textfield", "name": "value", - "label": "value", - "description": "Component value" + "label": "Default Value", + "description": "Default value for the field." }, "placeholder": { "sling:resourceType": "wcm/dialogs/components/textfield", From 61b3ae483b28ff420e83cc5c7a4b221c25a168cd Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 24 Jun 2024 22:13:02 +1000 Subject: [PATCH 138/206] update placeholder. --- .../components/layout/container/variant.html | 16 +++++++++------- .../container/variant.sectionwithtitle.html | 14 ++++++++++---- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html index 208c9d80d..715392b35 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html @@ -46,12 +46,14 @@ data-sly-attribute="${model.ariaAttributesString @ context='unsafe'}" data-sly-test="${resource.hasChildren}"> <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> - </div> - <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" - data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> - </sly> - <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" - data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' - Not Inherited'] @ join=''}" - data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> + + <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" + data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> + </sly> + + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> + </div> </sly> </template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.sectionwithtitle.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.sectionwithtitle.html index 5b9e604d7..602e9db95 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.sectionwithtitle.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.sectionwithtitle.html @@ -31,10 +31,16 @@ </header> <div class="${model.classNamesForChildren}"> <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> + + <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" + data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> + </sly> + + <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle] @ join=''}" + data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> + </div> - + </div> - <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" - data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> - </sly> </template> \ No newline at end of file From 5ebab9f0668668e6dc6fa96e76f46b1c3737568f Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 24 Jun 2024 22:14:46 +1000 Subject: [PATCH 139/206] add css helper to hide field if its type of hidden. --- .../components/forms/form/clientlibs/style.css | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/style.css b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/style.css index ca4fa1371..fbf8d37db 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/style.css +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/style.css @@ -1,7 +1,7 @@ -.label { - margin-left: 10px; -} + +/* form/compoisite */ +/* composite field add hint to field */ .fieldhint { top: 10px; z-index: 999; @@ -12,4 +12,10 @@ align-self: end; position: relative; float:inline-end; +} + +/* form/field */ +/* hide field container with hidden input of type hidden */ +field:has(> div > input[type=hidden]) { + display: none; } \ No newline at end of file From 9c310cdb86aae42dd94f392a4669cf6ba0ff8e45 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 25 Jun 2024 21:39:47 +1000 Subject: [PATCH 140/206] fix index handling. --- .../models/components/BaseFormComponent.java | 18 ++++++++++++------ .../models/components/forms/Label.java | 12 +++++++----- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java index 293d7ea85..ebc42515a 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java @@ -99,15 +99,21 @@ protected void init() { if (selectorArray.length >= 2) { // check if id is present and update component id if (ArrayUtils.contains(selectorArray, "id")) { //overide id - String value = selectorArray[ArrayUtils.indexOf(selectorArray, "id")+1]; - if (StringUtils.isNotBlank(value)) { - this.id = value; + int valueIndex = ArrayUtils.indexOf(selectorArray, "id")+1; + if (valueIndex < selectorArray.length) { + String value = selectorArray[valueIndex]; + if (StringUtils.isNotBlank(value)) { + this.id = value; + } } } if (ArrayUtils.contains(selectorArray, "fid")) { //parent field id - String value = selectorArray[ArrayUtils.indexOf(selectorArray, "fid")+1]; - if (StringUtils.isNotBlank(value)) { - this.parentFieldId = value; + int valueIndex = ArrayUtils.indexOf(selectorArray, "fid")+1; + if (valueIndex < selectorArray.length) { + String value = selectorArray[valueIndex]; + if (StringUtils.isNotBlank(value)) { + this.parentFieldId = value; + } } } } diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Label.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Label.java index fdf60ad83..5eabcc442 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Label.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Label.java @@ -80,12 +80,14 @@ protected void init() { if (selectorArray.length >= 2) { // check if id is present and update component id if (ArrayUtils.contains(selectorArray, "for")) { - String value = selectorArray[ArrayUtils.indexOf(selectorArray, "for")+1]; - if (StringUtils.isNotBlank(value)) { - this.forId = value; + int valueIndex = ArrayUtils.indexOf(selectorArray, "for") + 1; + if (valueIndex < selectorArray.length) { + String value = selectorArray[valueIndex]; + if (StringUtils.isNotBlank(value)) { + this.forId = value; + } } - } - + } } } } From 1b1000f508e8a1da9b3341e3d7fb2bd9554b98e9 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 27 Jun 2024 06:15:09 +1000 Subject: [PATCH 141/206] update form submit to use defaults on submit. --- .../components/forms/form/clientlibs/functions.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index a68fc4b9f..b02199aaf 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -253,9 +253,16 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; const componentConfig = componentNs.getComponentConfig($component); console.log(["formSubmitHandler", componentConfig, $component]) let { writePayloadType, writeMethod, writeUrl } = componentConfig; - if (!writePayloadType || !writeMethod || !writeUrl) { - ns.FORM_CANCEL({data: payload, reason: "Form has not been configured properly."}); - console.log("Author should fill all the parameters."); + if (!writeUrl) { + ns.FORM_CANCEL({data: componentConfig, reason: "Form has not been configured properly."}); + console.log("Post URL not set can't continue."); + return; + } + //do default JSON and POST if not set + if (!writePayloadType || !writeMethod ) { + writePayloadType = "application/json"; + writeMethod = "POST"; + console.log("Payload type or method not set, defaulting to JSON and POST."); return; } const payload = await ns.getFormData($component); From 09b6cd64a8096a67798d0122a664bc252ac19d7a Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 27 Jun 2024 06:20:08 +1000 Subject: [PATCH 142/206] fix log message. --- .../components/forms/fields/composite/clientlibs/functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js index 8f0667cf2..ece4d32ae 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js @@ -36,8 +36,8 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C console.group('compositeVal'); const type = this.attr('type') || ns.selectorTypeField; const isList = type === ns.selectorTypeList; - console.group("type", type); - console.group("isList", isList); + console.log("type", type); + console.log("isList", isList); if (!isList) { //get all immediate isCompositeParent components From 9f4c13c33079b276c7441c1dec57bcc1cd94a678 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 27 Jun 2024 08:51:18 +1000 Subject: [PATCH 143/206] fix form submit event params. --- .../forms/form/clientlibs/functions.js | 44 +++++++++++++------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index b02199aaf..56e83532d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -154,7 +154,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; }; // submit the request to the server - ns.submit = async (url, method, payloadType, body, successCallback = () => { }, errorCallback = () => { }) => { + ns.submit = async ($component, componentConfig, url, method, payloadType, body, successCallback = () => { }, errorCallback = () => { }) => { console.group("submit"); console.log([url, method, payloadType, body]) let controller = new AbortController(); @@ -173,7 +173,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; .then(res => { console.group("submit response"); console.log(res) - successCallback({ + successCallback($component, componentConfig, { url: url, method: method, payloadType: payloadType, @@ -185,7 +185,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; } catch (error) { console.group("Error in submitting the request"); console.error(error); - errorCallback({ + errorCallback($component, componentConfig, { url: url, method: method, payloadType: payloadType, @@ -201,39 +201,57 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; // local actions representing the form actions ns.FORM_SUCCESS = ($component, componentConfig, formData) => { + console.group("FORM_SUCCESS"); + console.log(["FORM_SUCCESS", $component, componentConfig, formData]); eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, formData, eventNs.EVENTS.EVENT_SUCCESS_ACTION, "FORM_SUCCESS"); + console.groupEnd(); } ns.FORM_ERROR = ($component, componentConfig, formData) => { + console.log("FORM_ERROR"); + console.log(["FORM_ERROR", $component, componentConfig, formData]); eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, formData, eventNs.EVENTS.EVENT_ERROR_ACTION, "FORM_ERROR"); + console.groupEnd(); } ns.FORM_SUBMIT = ($component, componentConfig, formData) => { + console.log("FORM_SUBMIT"); + console.log(["FORM_SUBMIT", $component, componentConfig, formData]); eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, formData, eventNs.EVENTS.EVENT_SUBMIT_ACTION, "FORM_SUBMIT"); + console.groupEnd(); } ns.FORM_CANCEL = ($component, componentConfig, formData) => { + console.log("FORM_CANCEL"); + console.log(["FORM_CANCEL", $component, componentConfig, formData]); eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, formData, eventNs.EVENTS.EVENT_CANCEL_ACTION, "FORM_CANCEL"); + console.groupEnd(); } ns.FORM_RESET = ($component, componentConfig, formData) => { + console.log("FORM_RESET"); + console.log(["FORM_RESET", $component, componentConfig, formData]); eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, formData, eventNs.EVENTS.EVENT_RESET_ACTION, "FORM_RESET"); + console.groupEnd(); } ns.FORM_LOADED = ($component, componentConfig, formData) => { + console.log("FORM_LOADED"); + console.log(["FORM_LOADED", $component, componentConfig, formData]); eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, formData, eventNs.EVENTS.EVENT_READ_ACTION, "FORM_LOADED"); + console.groupEnd(); } // json form post - ns.jsonRequest = async (url, componentConfig, payload) => { + ns.jsonRequest = async (url, componentConfig, payload, $component) => { const { writePayloadType, writeMethod } = componentConfig; - ns.FORM_SUBMIT(payload); - await ns.submit(url, writeMethod, writePayloadType, JSON.stringify(payload), ns.FORM_SUCCESS, ns.FORM_ERROR); + ns.FORM_SUBMIT($component, componentConfig, payload); + await ns.submit($component, componentConfig, url, writeMethod, writePayloadType, JSON.stringify(payload), ns.FORM_SUCCESS, ns.FORM_ERROR); }; //plain form post - ns.formRequest = async (url, componentConfig, payload) => { + ns.formRequest = async (url, componentConfig, payload, $component) => { const { writePayloadType, writeMethod } = componentConfig; const formData = new URLSearchParams(); Object.entries(payload).map(item => { formData.append(item[0], item[1]) }); - ns.FORM_SUBMIT(formData); - await ns.submit(url, writeMethod, writePayloadType, formData.toString(), ns.FORM_SUCCESS, ns.FORM_ERROR); + ns.FORM_SUBMIT($component, componentConfig, formData); + await ns.submit($component, componentConfig, url, writeMethod, writePayloadType, formData.toString(), ns.FORM_SUCCESS, ns.FORM_ERROR); }; // update the button state to loading or completed. @@ -254,7 +272,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; console.log(["formSubmitHandler", componentConfig, $component]) let { writePayloadType, writeMethod, writeUrl } = componentConfig; if (!writeUrl) { - ns.FORM_CANCEL({data: componentConfig, reason: "Form has not been configured properly."}); + ns.FORM_CANCEL($component, componentConfig, {data: componentConfig, reason: "Form has not been configured properly."}); console.log("Post URL not set can't continue."); return; } @@ -272,9 +290,9 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; writeUrl = componentNs.replaceRegex(writeUrl, componentNs.getQueryParams()); if (writePayloadType === "application/json") { - await ns.jsonRequest(writeUrl, componentConfig, payload); + await ns.jsonRequest(writeUrl, componentConfig, payload, $component); } else if (writePayloadType === "application/x-www-form-urlencoded") { - await ns.formRequest(writeUrl, componentConfig, payload); + await ns.formRequest(writeUrl, componentConfig, payload, $component); } ns.updateButtonState($component, "completed"); }; @@ -402,7 +420,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; }); // emit event to notify the form is loaded - ns.FORM_LOADED($component, componentConfig, data); + ns.FORM_LOADED($component, componentConfig, data, $component); } catch (error) { console.log("Error loading data into form"); From e752ec2d47d8071994865e099529c1c8a6abd9f0 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 28 Jun 2024 17:07:32 +1000 Subject: [PATCH 144/206] fix selectors for accordion. --- .../layout/accordion/clientlibs/functions.js | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index d543825e8..ef15f104d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -10,7 +10,7 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.selectorComponent = '[component=accordion]'; ns.selectorTemplate = "> template"; ns.selectorButton = 'button.accordion-button'; - ns.selectorAccordionItem = "accordion-item"; + ns.selectorAccordionItem = ".accordion-item"; ns.attributeTarget = "data-bs-target"; ns.attributeParent = "data-bs-parent"; ns.attributeAriaControls = "aria-controls"; @@ -97,11 +97,11 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const itemDataParent = $itemCollapse.attr(ns.attributeParent); console.log(["$item", $item]); - console.log(["$itemContainer", $itemContainer]); - console.log(["$itemButton", $itemButton]); - console.log(["itemButtonTarget", itemButtonTarget]); - console.log(["$itemCollapse", $itemCollapse]); - console.log(["itemDataParent", itemDataParent]); + console.log(["$itemContainer", ns.selectorAccordionItem, $itemContainer]); + console.log(["$itemButton", ns.selectorButton, $itemButton]); + console.log(["itemButtonTarget", ns.attributeTarget, itemButtonTarget]); + console.log(["$itemCollapse", itemButtonTarget, $itemCollapse]); + console.log(["itemDataParent", ns.attributeParent, itemDataParent]); // if button is not aria-expanded then click it const ariaExpanded = $itemButton.attr('aria-expanded'); @@ -116,8 +116,8 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } ns.closeItem = ($component, data) => { - console.group('openItem'); - console.log(["openItem", $component, data]); + console.group('closeItem'); + console.log(["closeItem", $component, data]); const { config } = data; const id = config; @@ -129,11 +129,11 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const itemDataParent = $itemCollapse.attr(ns.attributeParent); console.log(["$item", $item]); - console.log(["$itemContainer", $itemContainer]); - console.log(["$itemButton", $itemButton]); - console.log(["itemButtonTarget", itemButtonTarget]); - console.log(["$itemCollapse", $itemCollapse]); - console.log(["itemDataParent", itemDataParent]); + console.log(["$itemContainer", ns.selectorAccordionItem, $itemContainer]); + console.log(["$itemButton", ns.selectorButton, $itemButton]); + console.log(["itemButtonTarget", ns.attributeTarget, itemButtonTarget]); + console.log(["$itemCollapse", itemButtonTarget, $itemCollapse]); + console.log(["itemDataParent", ns.attributeParent, itemDataParent]); // if button is not aria-expanded then click it const ariaExpanded = $itemButton.attr('aria-expanded'); @@ -149,12 +149,12 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } ns.toggleItem = ($component, data) => { - console.group('openItem'); - console.log(["openItem", $component, data]); + console.group('toggleItem'); + console.log(["toggleItem", $component, data]); const { config } = data; const id = config; - const $item = $component.find(`#${id}`); + const $item = $component.find(`#${id}`); //find item by id, should be accordion item const $itemContainer = $item.closest(ns.selectorAccordionItem); const $itemButton = $itemContainer.find(ns.selectorButton); const itemButtonTarget = $itemButton.attr(ns.attributeTarget); @@ -162,11 +162,11 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const itemDataParent = $itemCollapse.attr(ns.attributeParent); console.log(["$item", $item]); - console.log(["$itemContainer", $itemContainer]); - console.log(["$itemButton", $itemButton]); - console.log(["itemButtonTarget", itemButtonTarget]); - console.log(["$itemCollapse", $itemCollapse]); - console.log(["itemDataParent", itemDataParent]); + console.log(["$itemContainer", ns.selectorAccordionItem, $itemContainer]); + console.log(["$itemButton", ns.selectorButton, $itemButton]); + console.log(["itemButtonTarget", ns.attributeTarget, itemButtonTarget]); + console.log(["$itemCollapse", itemButtonTarget, $itemCollapse]); + console.log(["itemDataParent", ns.attributeParent, itemDataParent]); $itemButton.click(); @@ -188,11 +188,11 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const itemDataParent = $itemCollapse.attr(ns.attributeParent); console.log(["$item", $item]); - console.log(["$itemContainer", $itemContainer]); - console.log(["$itemButton", $itemButton]); - console.log(["itemButtonTarget", itemButtonTarget]); - console.log(["$itemCollapse", $itemCollapse]); - console.log(["itemDataParent", itemDataParent]); + console.log(["$itemContainer", ns.selectorAccordionItem, $itemContainer]); + console.log(["$itemButton", ns.selectorButton, $itemButton]); + console.log(["itemButtonTarget", ns.attributeTarget, itemButtonTarget]); + console.log(["$itemCollapse", itemButtonTarget, $itemCollapse]); + console.log(["itemDataParent", ns.attributeParent, itemDataParent]); $item.show(); @@ -213,11 +213,11 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const itemDataParent = $itemCollapse.attr(ns.attributeParent); console.log(["$item", $item]); - console.log(["$itemContainer", $itemContainer]); - console.log(["$itemButton", $itemButton]); - console.log(["itemButtonTarget", itemButtonTarget]); - console.log(["$itemCollapse", $itemCollapse]); - console.log(["itemDataParent", itemDataParent]); + console.log(["$itemContainer", ns.selectorAccordionItem, $itemContainer]); + console.log(["$itemButton", ns.selectorButton, $itemButton]); + console.log(["itemButtonTarget", ns.attributeTarget, itemButtonTarget]); + console.log(["$itemCollapse", itemButtonTarget, $itemCollapse]); + console.log(["itemDataParent", ns.attributeParent, itemDataParent]); $item.hide(); From 75edf8a55f07782d6474e7932ec91a3a031776ab Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 28 Jun 2024 17:08:18 +1000 Subject: [PATCH 145/206] update common form event config. --- .../dialog/tabs/event/.content.json | 16 ++ .../forms/form/clientlibs/functions.js | 4 +- .../forms/form/dialog/.content.json | 155 ++---------------- .../clientlibs-header/events/functions.js | 10 +- 4 files changed, 39 insertions(+), 146 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json index 6ad9d6132..58f939012 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json @@ -12,6 +12,7 @@ }, "info": { "sling:resourceType": "typerefinery/components/dialog/label", + "ws:disallowedContext": ["edit:panel"], "appearance": "info", "iconLabel": "Info", "title": "Map component actions to events, this allows you to respond to component actions in other components.", @@ -106,6 +107,21 @@ "label": "Success", "value": "successaction" }, + "cancel": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Cancel", + "value": "cancelaction" + }, + "reset": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Reset", + "value": "resetaction" + }, + "submit": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Submit", + "value": "submitaction" + }, "error": { "sling:resourceType": "typerefinery/components/dialog/select/selectitem", "label": "Error", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index 56e83532d..40ab97f55 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -501,7 +501,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; //register events if (events) { events.forEach(event => { - const { topic, type, name, nameCustom, action } = event; + const { topic, type, name, nameCustom, action, config} = event; //if topic not set use component id as topic const topicName = topic || defaultTopic; // if type is not defined then its emitted @@ -511,7 +511,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; let eventName = nameCustom || name; console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap), topicName, typeName, action, eventName]); - eventNs.registerEventActionMapping(ns.eventMap, topicName, typeName, action, eventName); + eventNs.registerEventActionMapping(ns.eventMap, id, topicName, typeName, action, eventName, config); console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap)]); // if event type is listen then add event listener for the event diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json index fed93aa78..e6cc5adf7 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json @@ -17,22 +17,12 @@ "sling:resourceType": "wcm/dialogs/components/tab", "label": "Events", "warning": { - "sling:resourceType": "typerefinery/components/dialog/label", - "ws:disallowedContext": ["edit:dialog"], - "appearance": "error", - "iconLabel": "Open Dialog", - "title": "Some fields are not editable in side-panel.", - "secondaryText": "", - "placement": "bottom-start" + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/warning" }, "info": { - "sling:resourceType": "typerefinery/components/dialog/label", - "ws:disallowedContext": ["edit:panel"], - "appearance": "info", - "iconLabel": "Info", - "title": "Map component actions to events, this allows you to respond to component actions in other components.", - "secondaryText": "", - "placement": "bottom-start" + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/info" }, "event": { "sling:resourceType": "wcm/dialogs/components/multifield", @@ -41,28 +31,12 @@ "description": "Pick generic event or specify custom event to which component action will be mapped.", "label": "Events", "topic": { - "sling:resourceType": "wcm/dialogs/components/textfield", - "name": "topic", - "label": "Topic", - "description": "The topic of the event, default is component id." + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/topic" }, "type": { - "sling:resourceType": "wcm/dialogs/components/select", - "name": "type", - "label": "Event Type", - "description": "How will the component interact with the event system.", - "listen": { - "sling:resourceType": "wcm/dialogs/components/select/selectitem", - "label": "Listen", - "value": "listen", - "selected": true - }, - "emit": { - "sling:resourceType": "wcm/dialogs/components/select/selectitem", - "label": "Emit", - "value": "emit", - "selected": true - } + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/type" }, "eventAction": { "sling:resourceType": "typerefinery/components/dialog/eventactions", @@ -71,113 +45,16 @@ "description": "Which component action to map to event." }, "eventName": { - "sling:resourceType": "typerefinery/components/dialog/select", - "name": "name", - "allowCreate": true, - "label": "Event Name", - "description": "Event Name of the even raised by the component", - "default": { - "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", - "label": "Default", - "default": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Custom", - "value": "" - } - }, - "componentcrud": { - "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", - "label": "Component", - "create": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Create", - "value": "createaction" - }, - "read": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Read", - "value": "readaction" - }, - "update": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Update", - "value": "updateaction" - }, - "delete": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Delete", - "value": "deleteaction" - }, - "filter": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Filter", - "value": "filteraction" - } - }, - "generic": { - "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", - "label": "Generic", - "success": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Success", - "value": "successaction" - }, - "cancel": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Cancel", - "value": "cancelaction" - }, - "reset": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Reset", - "value": "resetaction" - }, - "submit": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Submit", - "value": "submitaction" - }, - "error": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Error", - "value": "erroraction" - } - }, - "itemcrud": { - "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", - "label": "Item", - "create": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Create", - "value": "createitem" - }, - "read": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Read", - "value": "readitem" - }, - "update": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Update", - "value": "updateitem" - }, - "delete": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Delete", - "value": "deleteitem" - }, - "seelect": { - "sling:resourceType": "typerefinery/components/dialog/select/selectitem", - "label": "Select", - "value": "selectitem" - } - } + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventName" }, "eventNameCustom": { - "sling:resourceType": "wcm/dialogs/components/textfield", - "name": "nameCustom", - "label": "Custom Event Name", - "description": "Custom Event Name of the even raised by the component" + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventNameCustom" + }, + "eventConfig": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventConfig" } } }, diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js index 6ae280fc1..b61b06c9a 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js @@ -63,7 +63,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; //add event mapping in eventMap local to component, maps component action to topic with event, for quick access by functions. ns.registerEventActionMapping = function(eventMap, componentId, topic, type, componentAction, eventName, config) { console.group('registerEventActionMapping'); - console.log(eventMap, topic, type, componentAction, eventName, config); + console.log(eventMap, componentId, topic, type, componentAction, eventName, config); //check if params are passed if (!topic || !componentAction || !eventMap) { console.error("missing params"); @@ -87,19 +87,19 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; //init event type, EMIT or LISTEN if (!eventMap[type]) { eventMap[type] = {}; - console.warn(`event type not found ${type}, creating new type ${type}`); + console.warn(`event type not found ${type} in eventMap, creating new type ${type}`); } //init component action that maps to event name if (!eventMap[type][componentAction]) { eventMap[type][componentAction] = {}; - console.warn(`event action not found ${componentAction}, creating new action ${componentAction}`); + console.warn(`event action not found ${componentAction} in eventMap[${type}], creating new action ${componentAction}`); } //init mapped event name to component id if (!eventMap[type][componentAction][componentId]) { eventMap[type][componentAction][componentId] = {}; - console.warn(`component id not found ${componentId}, creating new component id ${componentId}`); + console.warn(`component id not found ${componentId} in eventMap[${type}][${componentAction}], creating new component id ${componentId}`); } console.log(["topicAction", topicAction]); @@ -107,7 +107,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; //init mapped event name that maps to topic if (!eventMap[type][componentAction][componentId][eventName]) { eventMap[type][componentAction][componentId][eventName] = [topicAction]; - console.warn(`event name not found ${eventName}, creating new event name with topic ${topic}`); + console.warn(`event name not found ${eventName} in eventMap[${type}][${componentAction}][${componentId}], creating new event name with topic ${topic}`); } else { //add event to type eventMap[type][componentAction][componentId][eventName].push(topicAction); From c7230c6ab2d1afa8318fc654f7a7883804cc4044 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 28 Jun 2024 22:33:28 +1000 Subject: [PATCH 146/206] use parsys that does not break on nodes that dont have a resource type. --- .../components/forms/fields/composite/composite.html | 2 +- .../components/layout/accordionitem/accordionitem.html | 2 +- .../typerefinery/components/layout/container/variant.html | 2 +- .../components/layout/container/variant.sectionwithtitle.html | 4 ++-- .../apps/typerefinery/components/layout/template/variant.html | 2 +- .../components/stix/forms/fields/composite/variant.html | 2 +- .../typerefinery/components/structure/page/body-content.html | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html index c56061634..cf7144ab0 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html @@ -14,7 +14,7 @@ limitations under the License. */--> <sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Composite"> - <div class="${model.componentClassNames}" id="${model.id}" type="${model.inputType}" component="${model.componentName}" isCompositeParent="true"> + <div class="${model.componentClassNames}" id="${model.id}" type="${model.inputType}" component="${model.componentName}" isCompositeParent="true" data-model="${model.jsonString}"> <sly data-sly-set.inputType="${model.inputType == 'list' ? 'list' : ''}"></sly> <sly data-sly-set.variantTemplate="./variant${inputType ? '.' : ''}${inputType ? inputType : ''}.html"></sly> <sly data-sly-use.template="${variantTemplate}" data-sly-call="${template.variant @ model=model}"> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html index 02849bea6..663999fc3 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordionitem/accordionitem.html @@ -25,7 +25,7 @@ <h2 class="accordion-header"> <!-- expand ${expand}--> <div id="${model.id}_content" class="accordion-collapse collapse ${expand ? 'show' : ''}" data-bs-parent="${model.alwaysopen ? '' : parentid }"> <div class="accordion-body"> - <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"> + <sly data-sly-include="${'parsys.html' @ prependPath='/apps/typerefinery/components/parsys'}"></sly> </sly> <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html index 715392b35..fb0cc0a1a 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html @@ -45,7 +45,7 @@ role="${model.role}" data-sly-attribute="${model.ariaAttributesString @ context='unsafe'}" data-sly-test="${resource.hasChildren}"> - <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> + <sly data-sly-include="${'parsys.html' @ prependPath='/apps/typerefinery/components/parsys'}"></sly> <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.sectionwithtitle.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.sectionwithtitle.html index 602e9db95..591c5e124 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.sectionwithtitle.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.sectionwithtitle.html @@ -30,8 +30,8 @@ </h2> </header> <div class="${model.classNamesForChildren}"> - <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> - + <sly data-sly-include="${'parsys.html' @ prependPath='/apps/typerefinery/components/parsys'}"></sly> + <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" data-sly-call="${lib.placeholder @ classes=model.componentClassNames}"> </sly> diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html index 2cdd11a9c..d4fe881f6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/template/variant.html @@ -25,7 +25,7 @@ data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> <sly data-sly-test="${resource.hasChildren}"> - <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> + <sly data-sly-include="${'parsys.html' @ prependPath='/apps/typerefinery/components/parsys'}"></sly> </sly> <sly data-sly-test="${!resource.hasChildren}"> <sly data-sly-use.lib="/libs/wcm/foundation/components/commons/templates.html" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html index 9cbb7f1b6..8722f3d9b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html @@ -31,6 +31,6 @@ > </input> <div template> - <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> + <sly data-sly-include="${'parsys.html' @ prependPath='/apps/typerefinery/components/parsys'}"></sly> </div> </template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/body-content.html b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/body-content.html index b963ddc61..9d70cc157 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/body-content.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/body-content.html @@ -14,7 +14,7 @@ limitations under the License. */--> <sly data-sly-test="${resource.hasChildren}"> - <sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}"></sly> + <sly data-sly-include="${'parsys.html' @ prependPath='/apps/typerefinery/components/parsys'}"></sly> </sly> <sly data-sly-test="${!resource.hasChildren}"> From 86a0ebdabdb27e8e2fd4c29988614d9ce10b9867 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 28 Jun 2024 22:40:04 +1000 Subject: [PATCH 147/206] add events to add templates to components to composite and container. --- .../forms/fields/composite/.content.json | 1 + .../fields/composite/clientlibs/functions.js | 191 +++++++++++++++- .../fields/composite/clientlibs/style.css | 12 +- .../fields/composite/dialog/.content.json | 45 ++++ .../composite/eventactions/.content.json | 13 ++ .../layout/container/clientlibs/.content.json | 16 ++ .../layout/container/clientlibs/behaviour.js | 12 + .../layout/container/clientlibs/functions.js | 206 ++++++++++++++++++ .../layout/container/dialog/.content.json | 45 ++++ .../container/eventactions/.content.json | 13 ++ 10 files changed, 545 insertions(+), 9 deletions(-) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/eventactions/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/.content.json create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/behaviour.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/functions.js create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/container/eventactions/.content.json diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/.content.json index 21eaffeef..48b1c04ee 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/.content.json @@ -5,6 +5,7 @@ "description": "This is Composite field returning JSON of its values", "title": "Composite", "allowedComponents": [ + "Typerefinery - Layout", "Typerefinery - Forms", "Typerefinery - Forms - Stix - Input", "Typerefinery - Forms - Stix - Select", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js index ece4d32ae..368de2c46 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js @@ -3,9 +3,9 @@ window.Typerefinery.Components = Typerefinery.Components || {}; window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; window.Typerefinery.Components.Forms.Form = Typerefinery.Components.Forms.Form || {}; window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.Composite || {}; +window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; - -(function ($, ns, componentsNs, formNs, Sortable, document, window) { +(function ($, ns, componentsNs, formNs, Sortable, componentNs, eventNs, document, window) { "use strict"; ns.selectorComponentName = "composite"; @@ -28,6 +28,187 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C ns.selectorTypeField = "field"; ns.selectorTypeList = "list"; + // map event types to handlers in component + // this will indicate which events are supported by component + // ns.eventMap = eventNs.genericEventsTopicMap(); + ns.eventMap = {}; + + ns.addEventListener = ($component, componentConfig) => { + + const { events, id } = componentConfig; + const defaultTopic = id; + console.group('addEventListener ' + id); + + console.log(["config", events, id, defaultTopic]); + + console.log("registering events"); + //register events + if (events) { + events.forEach(event => { + const { topic, type, name, nameCustom, action, config } = event; + //if topic not set use component id as topic + const topicName = topic || defaultTopic; + // if type is not defined then its emitted + let typeName = type || eventNs.EVENT_TYPE_LISTEN || "custom"; + + let eventName = nameCustom || name; + console.group(action + " " + eventName); + console.log(["event config", topic, type, name, nameCustom, action]); + + console.log(["event to register", topicName, typeName, eventName, action]); + + console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap), topicName, typeName, action, eventName]); + eventNs.registerEventActionMapping(ns.eventMap, id, topicName, typeName, action, eventName, config); + console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap)]); + + // if event type is listen then add event listener for the event + + if (typeName === eventNs.EVENT_TYPE_EMIT) { + //emit do nothing here + } else { + //listen register the event and listent for specific event on topic + console.log(["register event listen", topicName, eventName]); + eventNs.registerEvents(topicName, (data) => { + // check make sure the event is for this event + console.log(["event data", data]); + if (data.type === eventName) { + ns.handleEventAction($component, action, data); + } + }); + } + console.groupEnd(); + }); + + console.log(["eventMap", ns.eventMap]); + + } else { + console.log("no events found"); + } + + console.groupEnd(); + + } + + + ns.addNewItem = ($component, data, once) => { + console.group('addNewItem'); + + console.log(["addNewItem", $component, data]); + + const componentId = $component.attr('id'); + const componentConfig = componentNs.getComponentConfig($component); + const $componentBody = $component.find(ns.selectorTemplate); + + if ($componentBody.length === 0) { + console.log(`component body ${ns.selectorTemplate} to insert into not found`); + return; + } + + const { config } = data; + console.log('config', config); + let $template; + if (config) { + let found = false; + //look for template in current component first + let $templateByConfig = $component.find(config); + let $templateByConfigAsId = $component.find(`#${config}`); + + console.log('$templateByConfig', $templateByConfig); + console.log('$templateByConfigAsId', $templateByConfigAsId); + + if ($templateByConfig.length > 0) { + console.log('found template by config inside the component'); + $template = $templateByConfig; + found = true; + } else if ($templateByConfigAsId.length > 0) { + console.log('found template by config as id inside the component'); + $template = $templateByConfigAsId; + found = true; + } + + if (!found) { + $templateByConfig = $(config); + $templateByConfigAsId = $(`#${config}`); + + console.log('$templateByConfig', $templateByConfig); + console.log('$templateByConfigAsId', $templateByConfigAsId); + + if ($templateByConfig.length > 0) { + console.log('found template by config outside of component'); + $template = $templateByConfig; + found = true; + } else if ($templateByConfigAsId.length > 0) { + console.log('found template by config as id outside of component'); + $template = $templateByConfigAsId; + found = true; + } + } + + if (!found) { + console.log(`template ${config} not found, internaly or externaly`); + return; + } + } + + console.log('$template', $template); + + // get the template id if set + const templateId = $template.attr('id'); + + // if once check if template not already added + if (once && templateId !== undefined) { + const $templateExists = $component.find(`[templateId='${templateId}']`); + if ($templateExists.length > 0) { + console.log("template already used once"); + ns.openItem($component, { config: $templateExists.attr('id') }); + return; + } + } + + var $newRow = $($template.html()); + const itemId = Math.random().toString(36).substring(2, 15); + + if (once) { + $newRow.attr('templateId', templateId); + } + $newRow.attr('state', "new"); + $newRow.attr('id', itemId); + + console.log('itemId', itemId); + + console.log('$newRow', $newRow); + + //insert into component + $componentBody.append($newRow); + + //raise event that item is added + ns.ADD_ITEM($component, componentConfig, { type: ns.selectorComponentName, action: "add_item" , "id": itemId } ); + + console.groupEnd(); + } + + ns.handleEventAction = ($component, action, data) => { + console.group('handleEvent'); + console.log(["handleEvent", $component, action, data]); + + if (action === "ADD_ITEM") { + ns.addNewItem($component, data, false); + } + if (action === "ADDONCE_ITEM") { + ns.addNewItem($component, data, true); + } + console.groupEnd(); + } + + // local actions representing the form actions + ns.ADD_ITEM = ($component, componentConfig, data) => { + console.group('ADD_ITEM'); + eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, data, eventNs.EVENTS.ADD_ITEM, "ADD_ITEM"); + console.groupEnd(); + } + + + $.fn.findExclude = function(selector, mask) { return this.find(selector).not(this.find(mask).find(selector)); } @@ -298,8 +479,12 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C //compile value for composite input ns.compileValue($compositeParent); + console.log("adding event listeners"); + ns.addEventListener($compositeParent, componentConfig); + console.log(["ns.eventMap", ns.eventMap]); + console.groupEnd(); } -})(jQuery, Typerefinery.Components.Forms.Composite, Typerefinery.Components, Typerefinery.Components.Forms.Form, Sortable, document, window); +})(jQuery, Typerefinery.Components.Forms.Composite, Typerefinery.Components, Typerefinery.Components.Forms.Form, Sortable, Typerefinery.Components, Typerefinery.Page.Events, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/style.css b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/style.css index f1f5c6093..0abc3ffc6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/style.css +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/style.css @@ -16,7 +16,6 @@ [component=composite][type=list] .row { display: flex; flex-direction: row; - margin: 0.5rem; } @@ -24,7 +23,7 @@ display: flex; flex-direction: row; align-items: center; - width: auto; + width: 75%; max-width: unset; flex-grow: 1; flex-wrap: wrap; @@ -34,10 +33,11 @@ display: flex; flex-direction: row; align-items: start; - margin: 0.5rem; - width: 4rem; + width: 12%; + max-width: 4rem; flex-wrap: wrap; align-content: center; + margin-right: 1%; } [component=composite][type=list] .row .move .drag { width: 4rem; @@ -51,9 +51,9 @@ display: flex; flex-direction: column; align-items: center; - margin: 0.5rem; justify-content: center; - width: auto; + width: 6%; + max-width: 4rem; margin-left: auto; } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json index 6f22de8e4..26f811f89 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json @@ -47,6 +47,51 @@ } } }, + "eventTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Events", + "warning": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/warning" + }, + "info": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/info" + }, + "event": { + "sling:resourceType": "wcm/dialogs/components/multifield", + "ws:disallowedContext": ["edit:panel"], + "name": "_events_", + "description": "Pick generic event or specify custom event to which component action will be mapped.", + "label": "Events", + "topic": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/topic" + }, + "type": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/type" + }, + "eventAction": { + "sling:resourceType": "typerefinery/components/dialog/eventactions", + "name": "action", + "label": "Component Action", + "description": "Which component action to map to event." + }, + "eventName": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventName" + }, + "eventNameCustom": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventNameCustom" + }, + "eventConfig": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventConfig" + } + } + }, "validationTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/validation" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/eventactions/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/eventactions/.content.json new file mode 100644 index 000000000..bacd6263b --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/eventactions/.content.json @@ -0,0 +1,13 @@ +{ + "sling:resourceType": "nt:unstructured", + "additem": { + "sling:resourceType": "nt:unstructured", + "key": "ADD_ITEM", + "value": "Add New Item" + }, + "addonceitem": { + "sling:resourceType": "nt:unstructured", + "key": "ADDONCE_ITEM", + "value": "Add New Item Once" + } +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/.content.json new file mode 100644 index 000000000..f5cb89eb7 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/.content.json @@ -0,0 +1,16 @@ +{ + "title": "Client Libs - Container", + "jcr:primaryType": "sling:Folder", + "sling:resourceType": "io/typerefinery/websight/clientlibs", + "categories": [ + "ai.typerefinery.websight.components", + "ai.typerefinery.websight.components.forms.composite" + ], + "css": [ + ], + "js": [ + "/apps/typerefinery/clientlibs/vendor/sortable/sortable.js", + "functions.js", + "behaviour.js" + ] +} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/behaviour.js new file mode 100644 index 000000000..197aa1e28 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/behaviour.js @@ -0,0 +1,12 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Layout = Typerefinery.Components.Layout || {}; +window.Typerefinery.Components.Layout.Container = Typerefinery.Components.Layout.Container || {}; + +(function ($, ns, componentsNs, document, window) { + "use strict"; + + //init and watch for new components + componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); + +})(jQuery, window.Typerefinery.Components.Layout.Container, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/functions.js new file mode 100644 index 000000000..db09099a6 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/functions.js @@ -0,0 +1,206 @@ +window.Typerefinery = window.Typerefinery || {}; +window.Typerefinery.Components = Typerefinery.Components || {}; +window.Typerefinery.Components.Layout = Typerefinery.Components.Layout || {}; +window.Typerefinery.Components.Layout.Container = Typerefinery.Components.Layout.Container || {}; +window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; + +(function ($, ns, componentNs, eventNs, document, window) { + "use strict"; + + ns.selectorComponentName = "container"; + ns.selectorComponent = '[component=container]'; + + // map event types to handlers in component + // this will indicate which events are supported by component + // ns.eventMap = eventNs.genericEventsTopicMap(); + ns.eventMap = {}; + + ns.addEventListener = ($component, componentConfig) => { + + const { events, id } = componentConfig; + const defaultTopic = id; + console.group('addEventListener ' + id); + + console.log(["config", events, id, defaultTopic]); + + console.log("registering events"); + //register events + if (events) { + events.forEach(event => { + const { topic, type, name, nameCustom, action, config } = event; + //if topic not set use component id as topic + const topicName = topic || defaultTopic; + // if type is not defined then its emitted + let typeName = type || eventNs.EVENT_TYPE_LISTEN || "custom"; + + let eventName = nameCustom || name; + console.group(action + " " + eventName); + console.log(["event config", topic, type, name, nameCustom, action]); + + console.log(["event to register", topicName, typeName, eventName, action]); + + console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap), topicName, typeName, action, eventName]); + eventNs.registerEventActionMapping(ns.eventMap, id, topicName, typeName, action, eventName, config); + console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap)]); + + // if event type is listen then add event listener for the event + + if (typeName === eventNs.EVENT_TYPE_EMIT) { + //emit do nothing here + } else { + //listen register the event and listent for specific event on topic + console.log(["register event listen", topicName, eventName]); + eventNs.registerEvents(topicName, (data) => { + // check make sure the event is for this event + console.log(["event data", data]); + if (data.type === eventName) { + ns.handleEventAction($component, action, data); + } + }); + } + console.groupEnd(); + }); + + console.log(["eventMap", ns.eventMap]); + + } else { + console.log("no events found"); + } + + console.groupEnd(); + + } + + + ns.addNewItem = ($component, data, once) => { + console.group('addNewItem'); + + console.log(["addNewItem", $component, data]); + + const componentId = $component.attr('id'); + const componentConfig = componentNs.getComponentConfig($component); + const $componentBody = $component; // main tag is the body of the component + + if ($componentBody.length === 0) { + console.log(`component body to insert into not found`); + return; + } + + const { config } = data; + console.log('config', config); + let $template; + if (config) { + let found = false; + //look for template in current component first + let $templateByConfig = $component.find(config); + let $templateByConfigAsId = $component.find(`#${config}`); + + console.log('$templateByConfig', $templateByConfig); + console.log('$templateByConfigAsId', $templateByConfigAsId); + + if ($templateByConfig.length > 0) { + console.log('found template by config inside the component'); + $template = $templateByConfig; + found = true; + } else if ($templateByConfigAsId.length > 0) { + console.log('found template by config as id inside the component'); + $template = $templateByConfigAsId; + found = true; + } + + if (!found) { + $templateByConfig = $(config); + $templateByConfigAsId = $(`#${config}`); + + console.log('$templateByConfig', $templateByConfig); + console.log('$templateByConfigAsId', $templateByConfigAsId); + + if ($templateByConfig.length > 0) { + console.log('found template by config outside of component'); + $template = $templateByConfig; + found = true; + } else if ($templateByConfigAsId.length > 0) { + console.log('found template by config as id outside of component'); + $template = $templateByConfigAsId; + found = true; + } + } + + if (!found) { + console.log(`template ${config} not found, internaly or externaly`); + return; + } + } + + console.log('$template', $template); + + // get the template id if set + const templateId = $template.attr('id'); + + // if once check if template not already added + if (once && templateId !== undefined) { + const $templateExists = $component.find(`[templateId='${templateId}']`); + if ($templateExists.length > 0) { + console.log("template already used once"); + ns.openItem($component, { config: $templateExists.attr('id') }); + return; + } + } + + var $newRow = $($template.html()); + const itemId = Math.random().toString(36).substring(2, 15); + + if (once) { + $newRow.attr('templateId', templateId); + } + $newRow.attr('state', "new"); + $newRow.attr('id', itemId); + + console.log('itemId', itemId); + + console.log('$newRow', $newRow); + + //insert into component + $componentBody.append($newRow); + + //raise event that item is added + ns.ADD_ITEM($component, componentConfig, { type: ns.selectorComponentName, action: "add_item" , "id": itemId } ); + + console.groupEnd(); + } + + ns.handleEventAction = ($component, action, data) => { + console.group('handleEvent'); + console.log(["handleEvent", $component, action, data]); + + if (action === "ADD_ITEM") { + ns.addNewItem($component, data, false); + } + if (action === "ADDONCE_ITEM") { + ns.addNewItem($component, data, true); + } + console.groupEnd(); + } + + // local actions representing the form actions + ns.ADD_ITEM = ($component, componentConfig, data) => { + console.group('ADD_ITEM'); + eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, data, eventNs.EVENTS.ADD_ITEM, "ADD_ITEM"); + console.groupEnd(); + } + + + ns.init = ($component) => { + const componentConfig = componentNs.getComponentConfig($component); + const { id} = componentConfig; + console.group('init ' + id); + console.log(["config", componentConfig]); + + console.log("adding event listeners"); + ns.addEventListener($component, componentConfig); + console.log(["ns.eventMap", ns.eventMap]); + + console.groupEnd(); + } + +})(jQuery, Typerefinery.Components.Layout.Container, Typerefinery.Components, Typerefinery.Page.Events, document, window); \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/dialog/.content.json index 4ddb3701a..2886054c0 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/dialog/.content.json @@ -11,6 +11,51 @@ "name": "title" } }, + "eventTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Events", + "warning": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/warning" + }, + "info": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/info" + }, + "event": { + "sling:resourceType": "wcm/dialogs/components/multifield", + "ws:disallowedContext": ["edit:panel"], + "name": "_events_", + "description": "Pick generic event or specify custom event to which component action will be mapped.", + "label": "Events", + "topic": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/topic" + }, + "type": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/type" + }, + "eventAction": { + "sling:resourceType": "typerefinery/components/dialog/eventactions", + "name": "action", + "label": "Component Action", + "description": "Which component action to map to event." + }, + "eventName": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventName" + }, + "eventNameCustom": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventNameCustom" + }, + "eventConfig": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventConfig" + } + } + }, "gridTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/grid" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/eventactions/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/eventactions/.content.json new file mode 100644 index 000000000..bacd6263b --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/eventactions/.content.json @@ -0,0 +1,13 @@ +{ + "sling:resourceType": "nt:unstructured", + "additem": { + "sling:resourceType": "nt:unstructured", + "key": "ADD_ITEM", + "value": "Add New Item" + }, + "addonceitem": { + "sling:resourceType": "nt:unstructured", + "key": "ADDONCE_ITEM", + "value": "Add New Item Once" + } +} \ No newline at end of file From 8a7bbc938db8f5ddc3c56c988ae8c31e12d8865c Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 28 Jun 2024 22:40:18 +1000 Subject: [PATCH 148/206] update typo. --- .../components/layout/accordion/clientlibs/functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index ef15f104d..f8d1ca4a6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -239,7 +239,7 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; if (config) { //if config starts with # then its a selector if (config.startsWith("#")) { - console.log(`config is a selectot for template, looking up template by selector ${ns.selectorTemplate + config}`); + console.log(`config is a seelector for template, looking up template by selector ${ns.selectorTemplate + config}`); const $templateById = $component.find(ns.selectorTemplate + config); if ($templateById.length === 0) { console.error("template not found by id"); @@ -359,7 +359,7 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.hideItem($component, data); } console.groupEnd(); - } + } ns.init = ($component) => { const componentConfig = componentNs.getComponentConfig($component); From 436d171ec45ffca2d5aae1ae0e52e6a002b3cb0f Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 15 Jul 2024 11:03:43 +1000 Subject: [PATCH 149/206] ensure embed fits its container. --- .../components/content/embed/clientlibs/.content.json | 3 +++ .../components/content/embed/clientlibs/style.css | 5 +++++ .../components/content/embed/variants/iframe.html | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/style.css diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/.content.json index 54674861c..89f43ac1d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/.content.json @@ -6,6 +6,9 @@ "ai.typerefinery.websight.components", "ai.typerefinery.websight.components.content.embed" ], + "css": [ + "style.css" + ], "js": [ "functions.js", "behaviour.js" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/style.css b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/style.css new file mode 100644 index 000000000..4f9aceb6e --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/style.css @@ -0,0 +1,5 @@ + +.container-iframe { + height: calc(100%); +} + diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/variants/iframe.html b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/variants/iframe.html index cd1cbf0d4..3eee9e0e7 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/variants/iframe.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/variants/iframe.html @@ -15,7 +15,7 @@ */--> <template data-sly-template.variant="${ @ model }"> - <div class="${model.variantClassNames}"> + <div class="${model.variantClassNames} container-iframe"> <iframe src="${model.url}" frameborder="0" scrolling="${model.scrolling}" From 062245828518f67d468cee09d565fa7eaadf1fef Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 15 Jul 2024 11:04:14 +1000 Subject: [PATCH 150/206] fix default options on alignment tab. --- .../dialog/tabs/alignment/.content.json | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/alignment/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/alignment/.content.json index 6321bd20a..5b518234b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/alignment/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/alignment/.content.json @@ -8,8 +8,8 @@ "description": "Bootstrap container width", "default": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", - "label": "default", - "value": "default" + "label": "Default", + "value": "" }, "defaultPadding": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", @@ -32,6 +32,11 @@ "sling:resourceType": "wcm/dialogs/components/select", "name": "verticalAlignment", "label": "Vertical alignment", + "default": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Default", + "value": "" + }, "start": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", "label": "Start", @@ -73,6 +78,11 @@ "sling:resourceType": "wcm/dialogs/components/select", "name": "horizontalAlignment", "label": "Horizontal alignment", + "default": { + "sling:resourceType": "wcm/dialogs/components/select/selectitem", + "label": "Default", + "value": "" + }, "start": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", "label": "Start", @@ -110,7 +120,7 @@ "label": "Text Alignment", "default": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", - "label": "default", + "label": "Default", "value": "" }, "left": { From ddedb11273baab2a3b3f4fd495bb9ac9efc7e598 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 15 Jul 2024 11:04:41 +1000 Subject: [PATCH 151/206] update container badge to show id. --- .../apps/typerefinery/components/layout/container/variant.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html index fb0cc0a1a..c05e6eff4 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/variant.html @@ -52,7 +52,7 @@ </sly> <sly data-sly-use.lib="/apps/typerefinery/components/structure/templates/component-info.html" - data-sly-set.componentPlaceholderTitle="${[model.componentTitle] @ join=''}" + data-sly-set.componentPlaceholderTitle="${[model.componentTitle, ' (', model.id ,')'] @ join=''}" data-sly-call="${lib.placeholder @ title=componentPlaceholderTitle}"></sly> </div> </sly> From 381fdd54f256bda484462656d549999770a95292 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 15 Jul 2024 11:06:50 +1000 Subject: [PATCH 152/206] update global html body tag fit. --- .../structure/page/clientlibs-header/style.css | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/style.css b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/style.css index 078546901..0a983f194 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/style.css +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/style.css @@ -1,7 +1,15 @@ +/*try to figure out width of scrollbar */ +:root { + --bar: calc(100vw - 100%); +} + +/*ensure body fits window*/ body { display: table; - width: 100%; - height: 100%; + min-width: 100vw; + min-height: 100vh; + display: flex; + flex-direction: column; } .bg-dark { From 7fde68cd3e828512f59824eefa199a04f2e7c70e Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 15 Jul 2024 11:07:20 +1000 Subject: [PATCH 153/206] add missign aria dialog tab to footer. --- .../components/layout/footer/dialog/.content.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/footer/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/footer/dialog/.content.json index 1ef39f4fa..995ffdbfd 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/footer/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/footer/dialog/.content.json @@ -2,10 +2,6 @@ "sling:resourceType": "wcm/dialogs/dialog", "tabs": { "sling:resourceType": "wcm/dialogs/components/tabs", - "variantTab": { - "sling:resourceType": "wcm/dialogs/components/include", - "path": "/apps/typerefinery/components/dialog/tabs/inherit" - }, "gridTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/grid" @@ -21,6 +17,10 @@ "backgroundTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/background" + }, + "ariaTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/aria" } } } \ No newline at end of file From a0376b9284989b82e0ab32132433157ddbc699d9 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 15 Jul 2024 11:07:40 +1000 Subject: [PATCH 154/206] add dialog to body container. --- .../fixedrootcontainer/dialog/.content.json | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/fixedrootcontainer/dialog/.content.json diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/fixedrootcontainer/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/fixedrootcontainer/dialog/.content.json new file mode 100644 index 000000000..56f1cc8d5 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/fixedrootcontainer/dialog/.content.json @@ -0,0 +1,22 @@ +{ + "sling:resourceType": "wcm/dialogs/dialog", + "tabs": { + "sling:resourceType": "wcm/dialogs/components/tabs", + "gridTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" + }, + "alignmentTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/alignment" + }, + "backgroundTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/background" + } + } +} \ No newline at end of file From 63d45e49973bb8a51edfda1926679bc804545bbb Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 15 Jul 2024 11:07:56 +1000 Subject: [PATCH 155/206] add container styles. --- .../layout/container/clientlibs/.content.json | 1 + .../layout/container/clientlibs/style.css | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/style.css diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/.content.json index f5cb89eb7..e175ccca1 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/.content.json @@ -7,6 +7,7 @@ "ai.typerefinery.websight.components.forms.composite" ], "css": [ + "style.css" ], "js": [ "/apps/typerefinery/clientlibs/vendor/sortable/sortable.js", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/style.css b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/style.css new file mode 100644 index 000000000..c89120e90 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/style.css @@ -0,0 +1,13 @@ + +.hc-100 { + height: calc(100%); +} +.container-fill { + height: 100%; + display: flex; + flex-direction: column; +} + +.container-column-fill { + flex: 1; +} From d1d67df497f902bdc191b3b9134e12d8f95cbf02 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 15 Jul 2024 23:42:12 +1000 Subject: [PATCH 156/206] update dialogs to add missing tabs. --- .../components/dialog/tabs/aria/.content.json | 18 +++++++++++++++++ .../forms/checkbox/dialog/.content.json | 4 ++++ .../forms/composite/dialog/.content.json | 4 ++++ .../forms/fields/button/dialog/.content.json | 4 ++++ .../fields/checkbox/dialog/.content.json | 16 +++++++++++++++ .../fields/composite/dialog/.content.json | 4 ++++ .../fields/fileupload/dialog/.content.json | 12 +++++++++-- .../forms/fields/input/dialog/.content.json | 4 ++++ .../forms/fields/radio/dialog/.content.json | 16 +++++++++++++++ .../forms/fields/select/dialog/.content.json | 20 ++++++++----------- .../fields/textarea/dialog/.content.json | 20 +++++++++---------- .../forms/fileupload/dialog/.content.json | 4 ++++ .../forms/form/dialog/.content.json | 4 ++++ .../forms/input/dialog/.content.json | 4 ++++ .../forms/radio/dialog/.content.json | 4 ++++ .../forms/select/dialog/.content.json | 4 ++++ .../forms/textarea/dialog/.content.json | 4 ++++ .../stix/forms/fields/composite/.content.json | 2 +- .../stix/forms/fields/input/.content.json | 3 ++- .../stix/forms/fields/select/.content.json | 2 +- 20 files changed, 126 insertions(+), 27 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json index e8375d396..074d0cf34 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/aria/.content.json @@ -1,6 +1,24 @@ { "sling:resourceType": "wcm/dialogs/components/tab", "label": "Aria", + "warning": { + "sling:resourceType": "typerefinery/components/dialog/label", + "ws:disallowedContext": ["edit:dialog"], + "appearance": "error", + "iconLabel": "Open Dialog", + "title": "Some fields are not editable in side-panel.", + "secondaryText": "", + "placement": "bottom-start" + }, + "info": { + "sling:resourceType": "typerefinery/components/dialog/label", + "ws:disallowedContext": ["edit:panel"], + "appearance": "info", + "iconLabel": "Info", + "title": "Add relevant Aria Attributes as required", + "secondaryText": "", + "placement": "bottom-start" + }, "roleOther": { "sling:resourceType": "wcm/dialogs/components/textfield", "name": "roleOther", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/checkbox/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/checkbox/dialog/.content.json index 27c484a99..1b939b2ca 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/checkbox/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/checkbox/dialog/.content.json @@ -9,6 +9,10 @@ "alignmentTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/alignment" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" } } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/dialog/.content.json index 27c484a99..1b939b2ca 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/composite/dialog/.content.json @@ -9,6 +9,10 @@ "alignmentTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/alignment" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" } } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json index d5e4e2db9..2b06ddd8f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/dialog/.content.json @@ -423,6 +423,10 @@ "gridTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "ariaTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/aria" } } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/dialog/.content.json index 37c817d5e..7837ff49d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/checkbox/dialog/.content.json @@ -13,6 +13,22 @@ "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/forms/form/common/fieldValue" } + }, + "validationTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/validation" + }, + "gridTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" + }, + "ariaTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/aria" } } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json index 26f811f89..2c3ccaff9 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/dialog/.content.json @@ -103,6 +103,10 @@ "styleTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/style" + }, + "ariaTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/aria" } } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/fileupload/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/fileupload/dialog/.content.json index e7676134b..ba8934611 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/fileupload/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/fileupload/dialog/.content.json @@ -22,13 +22,21 @@ "description": "Allow multiple file upload" } }, - "styleTab": { + "validationTab": { "sling:resourceType": "wcm/dialogs/components/include", - "path": "/apps/typerefinery/components/dialog/tabs/style" + "path": "/apps/typerefinery/components/dialog/tabs/validation" }, "gridTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" + }, + "ariaTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/aria" } } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/dialog/.content.json index efa7ace67..4be70f277 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/input/dialog/.content.json @@ -79,6 +79,10 @@ "styleTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/style" + }, + "ariaTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/aria" } } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/dialog/.content.json index 37c817d5e..7837ff49d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/radio/dialog/.content.json @@ -13,6 +13,22 @@ "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/forms/form/common/fieldValue" } + }, + "validationTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/validation" + }, + "gridTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" + }, + "ariaTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/aria" } } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/dialog/.content.json index e784fdc5d..e80d06323 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/dialog/.content.json @@ -42,18 +42,6 @@ } }, - "validationTab": { - "sling:resourceType": "wcm/dialogs/components/tab", - "label": "Validation", - "validationRequired": { - "sling:resourceType": "wcm/dialogs/components/include", - "path": "/apps/typerefinery/components/dialog/tabs/validation/validationRequired" - }, - "disabled": { - "sling:resourceType": "wcm/dialogs/components/include", - "path": "/apps/typerefinery/components/dialog/tabs/validation/disabled" - } - }, "optionsTab": { "sling:resourceType": "wcm/dialogs/components/tab", "label": "Options", @@ -100,6 +88,10 @@ "description": "Comma separated list of values to be selected by default" } }, + "validationTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/validation" + }, "gridTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/grid" @@ -107,6 +99,10 @@ "styleTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/style" + }, + "ariaTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/aria" } } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/textarea/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/textarea/dialog/.content.json index 56cfdd597..52446021c 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/textarea/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/textarea/dialog/.content.json @@ -29,20 +29,20 @@ } }, "validationTab": { - "sling:resourceType": "wcm/dialogs/components/tab", - "label": "Validation", - "validationRequired": { - "sling:resourceType": "wcm/dialogs/components/include", - "path": "/apps/typerefinery/components/dialog/tabs/validation/validationRequired" - }, - "disabled": { - "sling:resourceType": "wcm/dialogs/components/include", - "path": "/apps/typerefinery/components/dialog/tabs/validation/disabled" - } + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/validation" }, "gridTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" + }, + "ariaTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/aria" } } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/dialog/.content.json index 3e3b8c380..63454b799 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fileupload/dialog/.content.json @@ -15,6 +15,10 @@ "label": "Arrange children in same line", "description": "Components arranged in Horizontal Direction" } + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" } } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json index e6cc5adf7..110e4905e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/dialog/.content.json @@ -70,6 +70,10 @@ "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/alignment" }, + "ariaTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/aria" + }, "writeTab": { "sling:resourceType": "wcm/dialogs/components/tab", "label": "Write", diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/input/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/input/dialog/.content.json index 3e3b8c380..63454b799 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/input/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/input/dialog/.content.json @@ -15,6 +15,10 @@ "label": "Arrange children in same line", "description": "Components arranged in Horizontal Direction" } + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" } } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/radio/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/radio/dialog/.content.json index 27c484a99..1b939b2ca 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/radio/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/radio/dialog/.content.json @@ -9,6 +9,10 @@ "alignmentTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/alignment" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" } } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/select/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/select/dialog/.content.json index 27c484a99..1b939b2ca 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/select/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/select/dialog/.content.json @@ -9,6 +9,10 @@ "alignmentTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/alignment" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" } } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/textarea/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/textarea/dialog/.content.json index 27c484a99..1b939b2ca 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/textarea/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/textarea/dialog/.content.json @@ -9,6 +9,10 @@ "alignmentTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/alignment" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" } } } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/.content.json index 7d130996e..9f6e429bc 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/.content.json @@ -3,5 +3,5 @@ "group": ".hidden", "sling:resourceType": "ws:Component", "description": "This is Composite field returning JSON of its values", - "title": "Composite" + "title": "Composite Stix" } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/.content.json index 004bac991..05b6513e4 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/.content.json @@ -2,5 +2,6 @@ "group": ".hidden", "sling:resourceType": "ws:Component", "description": "Basic form input field.", - "title": "Input" + "title": "Input Stix", + "sling:resourceSuperType": "typerefinery/components/forms/fields/input" } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/.content.json index 5407710bc..714177102 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/.content.json @@ -2,5 +2,5 @@ "group": ".hidden", "sling:resourceType": "ws:Component", "description": "This is Select component for Typerefinery", - "title": "Select" + "title": "Select Stix" } From 0ba5f833967ccbf2466b509f2d36a1a2e46ad885 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Jul 2024 00:28:20 +1000 Subject: [PATCH 157/206] replace forEach with while loop for children iterator. --- .../websight/models/components/forms/Field.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java index d7c8c3eb0..8542b3481 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java @@ -19,6 +19,7 @@ import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; import java.util.HashMap; +import java.util.Iterator; import java.util.Map; import org.apache.sling.api.resource.Resource; @@ -92,7 +93,9 @@ protected void init() { this.fieldId = this.resource.getName(); if (this.resource.hasChildren()) { - this.resource.getChildren().forEach(child -> { + Iterator<Resource> children = this.resource.listChildren(); + while (children.hasNext()) { + Resource child = children.next(); String name = child.getName(); if (name.equals("label")) { String id = child.getValueMap().get("id", ""); @@ -103,7 +106,7 @@ protected void init() { this.fieldId = this.resource.getName() + (StringUtils.isNotEmpty(id) ? "-" + id : ""); this.fieldHidden = false; } - }); + } } } From 9f776b9b41fd80cb676a9d801f13687c944618cc Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Jul 2024 00:45:47 +1000 Subject: [PATCH 158/206] ensure all resources have an id. --- .../websight/models/components/BaseFormComponent.java | 4 +++- .../websight/models/components/forms/Field.java | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java index ebc42515a..03eda6fb5 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java @@ -88,6 +88,8 @@ public class BaseFormComponent extends BaseComponent { @PostConstruct protected void init() { + super.init(); + // set default parent field id this.parentFieldId = this.id; @@ -119,7 +121,7 @@ protected void init() { } } } - super.init(); + if (StringUtils.isBlank(this.name)) { this.name = resource.getName(); } diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java index 8542b3481..72f2193dd 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java @@ -26,6 +26,7 @@ import org.apache.sling.models.annotations.Model; import ai.typerefinery.websight.models.components.BaseFormComponent; +import ai.typerefinery.websight.utils.ComponentUtil; import javax.annotation.PostConstruct; import javax.inject.Inject; @@ -99,10 +100,18 @@ protected void init() { String name = child.getName(); if (name.equals("label")) { String id = child.getValueMap().get("id", ""); + //ensure child has an id + if (StringUtils.isEmpty(id)) { + id = ComponentUtil.getComponentId(child); + } this.labelId = this.resource.getName() + (StringUtils.isNotEmpty(id) ? "-" + id : ""); this.labelHidden = false; } else if (name.equals("field")) { String id = child.getValueMap().get("id", ""); + //ensure child has an id + if (StringUtils.isEmpty(id)) { + id = ComponentUtil.getComponentId(child); + } this.fieldId = this.resource.getName() + (StringUtils.isNotEmpty(id) ? "-" + id : ""); this.fieldHidden = false; } From b3582ba7e68697a51a280447c201050f12dd0778 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Jul 2024 04:10:42 +1000 Subject: [PATCH 159/206] add missing dialog tab. --- .../components/forms/fields/label/dialog/.content.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/dialog/.content.json index 0ce6a08ff..8f7ed440d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/label/dialog/.content.json @@ -24,6 +24,10 @@ "gridTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" } } } From 0a7d58eb05022c7ed54fc65fa52fa6571723d3f5 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Jul 2024 04:12:10 +1000 Subject: [PATCH 160/206] user resource parent id generating child id instead of resource name. --- .../typerefinery/websight/models/components/forms/Field.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java index 72f2193dd..b506b77f7 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/forms/Field.java @@ -104,7 +104,7 @@ protected void init() { if (StringUtils.isEmpty(id)) { id = ComponentUtil.getComponentId(child); } - this.labelId = this.resource.getName() + (StringUtils.isNotEmpty(id) ? "-" + id : ""); + this.labelId = this.id + (StringUtils.isNotEmpty(id) ? "-" + id : ""); this.labelHidden = false; } else if (name.equals("field")) { String id = child.getValueMap().get("id", ""); @@ -112,7 +112,7 @@ protected void init() { if (StringUtils.isEmpty(id)) { id = ComponentUtil.getComponentId(child); } - this.fieldId = this.resource.getName() + (StringUtils.isNotEmpty(id) ? "-" + id : ""); + this.fieldId = this.id + (StringUtils.isNotEmpty(id) ? "-" + id : ""); this.fieldHidden = false; } } From 86f43e850a82ce6f5cb658b23832b195d7dd8d8e Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Jul 2024 04:12:43 +1000 Subject: [PATCH 161/206] do not duplicate id in field name. --- .../websight/models/components/BaseFormComponent.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java index 03eda6fb5..bfdec6ee0 100644 --- a/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java +++ b/application/backend/src/main/java/ai/typerefinery/websight/models/components/BaseFormComponent.java @@ -105,7 +105,11 @@ protected void init() { if (valueIndex < selectorArray.length) { String value = selectorArray[valueIndex]; if (StringUtils.isNotBlank(value)) { - this.id = value; + if (value.endsWith(this.id)) { + this.id = value; + } else { + this.id = value + "-" + this.id; + } } } } From 982897dcc5c9166968fae677c4260595770c1387 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Jul 2024 04:13:00 +1000 Subject: [PATCH 162/206] update debug config. --- .vscode/launch.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index 583a20a4e..ef6485ce9 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,6 +7,7 @@ { "type": "java", "name": "Debug (Attach 8115)", + "projectName": "websight", "request": "attach", "hostName": "localhost", "port": "8115" From c4e722ee3eb90afcd473134015f784907bcf3b18 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Jul 2024 04:13:35 +1000 Subject: [PATCH 163/206] use resource id on composite wrapper div. --- .../components/forms/fields/composite/composite.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html index cf7144ab0..4f00f2e5a 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/composite.html @@ -14,7 +14,7 @@ limitations under the License. */--> <sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Composite"> - <div class="${model.componentClassNames}" id="${model.id}" type="${model.inputType}" component="${model.componentName}" isCompositeParent="true" data-model="${model.jsonString}"> + <div class="${model.componentClassNames}" id="${resource.id}" type="${model.inputType}" component="${model.componentName}" isCompositeParent="true" data-model="${model.jsonString}"> <sly data-sly-set.inputType="${model.inputType == 'list' ? 'list' : ''}"></sly> <sly data-sly-set.variantTemplate="./variant${inputType ? '.' : ''}${inputType ? inputType : ''}.html"></sly> <sly data-sly-use.template="${variantTemplate}" data-sly-call="${template.variant @ model=model}"> From e9b0a55e98b8fd87dec9efd74ddb0ed66bd4b50f Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Jul 2024 04:14:05 +1000 Subject: [PATCH 164/206] add feature to highligh form comoponents if they have duplicate id. --- .../components/forms/form/clientlibs/functions.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index 40ab97f55..7b5abe8b1 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -613,6 +613,21 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; var initData = ns.getData($component, componentConfig); ns.loadData($component, initData, componentConfig); } + + //highlight fields with same ids + const isEditMode = $("body").hasClass("isEditMode"); + + if (isEditMode) { + $("form [id]").each( function () { + const fieldId = $(this).attr("id"); + const duplicates = $('form [id='+fieldId+']'); + if (duplicates.length > 1) { + duplicates.css("background-color","rgb(255 1 1 / 5%)") + .css("border","1px dashed rgb(255 1 1 / 20%)"); + } + }) + } + console.groupEnd(); } From c0a0777ad06695991723fbbe6aa432659549f33b Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 16 Jul 2024 20:59:11 +1000 Subject: [PATCH 165/206] add missing dialog tabs. --- .../forms/field/dialog/.content.json | 18 ++++++++++++++++++ .../components/stix/forms/field/.content.json | 3 ++- .../stix/forms/field/dialog/.content.json | 4 ++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/forms/field/dialog/.content.json diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/field/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/forms/field/dialog/.content.json new file mode 100644 index 000000000..1b939b2ca --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/field/dialog/.content.json @@ -0,0 +1,18 @@ +{ + "sling:resourceType": "wcm/dialogs/dialog", + "tabs": { + "sling:resourceType": "wcm/dialogs/components/tabs", + "gridTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/grid" + }, + "alignmentTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/alignment" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" + } + } +} diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/.content.json index dc95c41bb..759885973 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/.content.json @@ -9,5 +9,6 @@ ], "sling:resourceType": "ws:Component", "description": "Container for form elements", - "title": "Form Field" + "title": "Form Field", + "sling:resourceSuperType": "typerefinery/components/forms/field" } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/dialog/.content.json index 27c484a99..1b939b2ca 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/field/dialog/.content.json @@ -9,6 +9,10 @@ "alignmentTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/alignment" + }, + "styleTab": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/style" } } } From 9f850472348f913b91ddf812f272bb4659daa9a0 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 17 Jul 2024 15:52:15 +1000 Subject: [PATCH 166/206] fix typo. --- .../page/clientlibs-header/tms/functions.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js index 4496c626c..4fb913db6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js @@ -7,7 +7,7 @@ window.MessageService.Client = MessageService.Client || {}; (function ($, ns, clientNs, document, window) { "use strict"; - ns.registery = {}; + ns.registry = {}; ns.persistData = (key, data) => { localStorage.setItem(key, data); @@ -25,10 +25,10 @@ window.MessageService.Client = MessageService.Client || {}; ns.registerToTms = (host, topic, key, callbackFn) => { ns.hostAdded(host); - ns.registery[host] = ns.registery[host] || {}; - ns.registery[host][topic] = ns.registery[host][topic] || {}; - ns.registery[host][topic] = callbackFn; - ns.registery[host][topic][key] = callbackFn; + ns.registry[host] = ns.registry[host] || {}; + ns.registry[host][topic] = ns.registry[host][topic] || {}; + ns.registry[host][topic] = callbackFn; + ns.registry[host][topic][key] = callbackFn; }; ns.connect = () => { @@ -61,7 +61,7 @@ window.MessageService.Client = MessageService.Client || {}; ns.persistData(messageTopic, messagePayload); console.log(["tms message save to local storage", messageTopic]); // TODO: get host from the message. - const host = Object.entries(ns.registery)[0]; + const host = Object.entries(ns.registry)[0]; console.log(["tms message host", host]); // first idx[key, values]. if (host) { From fa8677c8361c15b13fdccb55fb8275fa238c602d Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 17 Jul 2024 16:59:56 +1000 Subject: [PATCH 167/206] inherit from core forms components. --- .../stix/forms/fields/composite/.content.json | 3 +- .../fields/composite/clientlibs/.content.json | 17 -- .../fields/composite/clientlibs/behaviour.js | 15 -- .../fields/composite/clientlibs/functions.js | 37 ---- .../forms/fields/composite/composite.html | 21 -- .../stix/forms/fields/composite/variant.html | 36 --- .../fields/input/clientlibs/.content.json | 14 -- .../fields/input/clientlibs/behaviour.js | 13 -- .../fields/input/clientlibs/functions.js | 18 -- .../stix/forms/fields/input/input.html | 21 -- .../stix/forms/fields/input/variant.html | 31 --- .../stix/forms/fields/select/.content.json | 3 +- .../fields/select/clientlibs/.content.json | 17 -- .../fields/select/clientlibs/behaviour.js | 13 -- .../fields/select/clientlibs/functions.js | 205 ------------------ .../stix/forms/fields/select/select.html | 21 -- .../stix/forms/fields/select/variant.html | 31 --- 17 files changed, 4 insertions(+), 512 deletions(-) delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/.content.json delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/behaviour.js delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/functions.js delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/composite.html delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/.content.json delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/behaviour.js delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/variant.html delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/.content.json delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html delete mode 100644 application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/.content.json index 9f6e429bc..1dc1f7303 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/.content.json @@ -3,5 +3,6 @@ "group": ".hidden", "sling:resourceType": "ws:Component", "description": "This is Composite field returning JSON of its values", - "title": "Composite Stix" + "title": "Composite Stix", + "sling:resourceSuperType": "typerefinery/components/forms/fields/composite" } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/.content.json deleted file mode 100644 index b5d2d82f3..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/.content.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "title": "Client Libs - Forms - Stix - Select", - "jcr:primaryType": "sling:Folder", - "sling:resourceType": "io/typerefinery/websight/clientlibs", - "categories": [ - "ai.typerefinery.websight.components", - "ai.typerefinery.websight.components.stix.forms.select" - ], - "css": [ - "/apps/typerefinery/clientlibs/vendor/select/style.css" - ], - "js": [ - "/apps/typerefinery/clientlibs/vendor/select/script.js", - "functions.js", - "behaviour.js" - ] -} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/behaviour.js deleted file mode 100644 index e54ea7168..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/behaviour.js +++ /dev/null @@ -1,15 +0,0 @@ -window.Typerefinery = window.Typerefinery || {}; -window.Typerefinery.Components = Typerefinery.Components || {}; -window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; -window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; -window.Typerefinery.Components.Stix.Forms.Composite = Typerefinery.Components.Stix.Forms.Composite || {}; - -(function ($, ns, document) { - "use strict"; - $(document).ready(function () { - console.log('Stix Composite component Behaviour loaded'); - $("[component='stix-composite']").each(function () { - ns.init(this); - }); - }); -})(jQuery, window.Typerefinery.Components.Stix.Forms.Composite, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/functions.js deleted file mode 100644 index 7d87aa786..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/clientlibs/functions.js +++ /dev/null @@ -1,37 +0,0 @@ -window.Typerefinery = window.Typerefinery || {}; -window.Typerefinery.Components = Typerefinery.Components || {}; -window.Typerefinery.Components.Forms = Typerefinery.Components.Forms || {}; -window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.Composite || {}; -window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; -window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; -window.Typerefinery.Components.Stix.Forms.Composite = Typerefinery.Components.Stix.Forms.Composite || {}; - -;(function ($, ns, componentNs, formsNs, compositeNs, document, window) { - "use strict"; - - - ns.init = async ($component) => { - const componentConfig = componentNs.getComponentConfig($component); - - $(document).ready(function () { - - $(compositeNs.selector).each(function(){ - //find all input fields that are not inside another composite input - var $field = $(this).findExclude(compositeNs.selectorTemplate,compositeNs.selector).findExclude(compositeNs.selectorInput, compositeNs.selector); - //remove isInput attribute and add isCompositeInput attribute, this will ensure that form fields are not processed by form submit - $field.removeAttr(compositeNs.selectorInputAttribute); - $field.attr(compositeNs.selectorCompositeInputAttribute,"true"); - //compile value for composite input - compositeNs.compileValue($(this)); - }); - }) - - //listen for change event on all input fields and compile value for composite input - $(compositeNs.selector).on("change", function() { - compositeNs.compileValue($(this)); - }); - - } - - -})(jQuery, Typerefinery.Components.Stix.Forms.Composite, Typerefinery.Components, Typerefinery.Components.Forms, Typerefinery.Components.Forms.Composite, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/composite.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/composite.html deleted file mode 100644 index fb65e0335..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/composite.html +++ /dev/null @@ -1,21 +0,0 @@ -<!--/* - Copyright (C) 2023 Typerefinery.io - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/--> -<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Composite"> - <div class="${model.componentClassNames}" type="${model.inputType}" component="stix-${model.componentName}" isCompositeParent="true"> - <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> - </sly> - </div> -</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html deleted file mode 100644 index 8722f3d9b..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/composite/variant.html +++ /dev/null @@ -1,36 +0,0 @@ -<!--/* - Copyright (C) 2023 Typerefinery.io - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/--> -<template data-sly-template.variant="${ @ model }"> - <input - component="${model.componentName}" - isInput="true" - id="${model.id}" - type="${model.inputType}" - name="${model.name}" - data-fieldId="${model.parentFieldId}" - placeholder="${model.placeholder}" - class="${model.variantClassNames} form-control" - required="${model.validationRequired}" - data-model="${model.jsonString}" - disabled="${model.disabled}" - isCompositeValue="true" - hidden - > - </input> - <div template> - <sly data-sly-include="${'parsys.html' @ prependPath='/apps/typerefinery/components/parsys'}"></sly> - </div> -</template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/.content.json deleted file mode 100644 index f4e6cdd1a..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/.content.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "title": "Client Libs - Forms - Stix - Input", - "jcr:primaryType": "sling:Folder", - "sling:resourceType": "io/typerefinery/websight/clientlibs", - "categories": ["ai.typerefinery.websight.components","ai.typerefinery.websight.components.stix.forms.input"], - "prepend": [], - "append": [], - "css": [ - "style.css" - ], - "js": [ - "/apps/typerefinery/clientlibs/vendor/inputmask/inputmask.min.js" - ] -} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/behaviour.js deleted file mode 100644 index e2aadc09d..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/behaviour.js +++ /dev/null @@ -1,13 +0,0 @@ -window.Typerefinery = window.Typerefinery || {}; -window.Typerefinery.Components = Typerefinery.Components || {}; -window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; -window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; -window.Typerefinery.Components.Stix.Forms.Input = Typerefinery.Components.Stix.Forms.Input || {}; - -(function ($, ns, componentsNs, document, window) { - "use strict"; - - //init and watch for new components - componentsNs.watchDOMForComponent(`${ns.selectorComponent}`, ns.init); - -})(jQuery, window.Typerefinery.Components.Stix.Forms.Input, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js deleted file mode 100644 index ebfb5488d..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/clientlibs/functions.js +++ /dev/null @@ -1,18 +0,0 @@ -window.Typerefinery = window.Typerefinery || {}; -window.Typerefinery.Components = Typerefinery.Components || {}; -window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; -window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; -window.Typerefinery.Components.Stix.Forms.Input = Typerefinery.Components.Stix.Forms.Input || {}; -window.Typerefinery.Page = Typerefinery.Page || {}; -window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; - -(function ($, ns, componentNs, eventNs, document, window) { - "use strict"; - - ns.selectorComponent = "[component='stix-input']"; - - ns.init = ($component) => { - - } -} -)(jQuery, window.Typerefinery.Components.Stix.Forms.Input, Typerefinery.Components, Typerefinery.Page.Events, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html deleted file mode 100644 index e3ef8df82..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/input.html +++ /dev/null @@ -1,21 +0,0 @@ -<!--/* - Copyright (C) 2022 Typerefinery.ai - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/--> -<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Input"> - <div class="${model.componentClassNames}" type="${model.inputType}" component="stix-${model.componentName}"> - <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> - </sly> - </div> -</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/variant.html deleted file mode 100644 index 31bb9c0cd..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/input/variant.html +++ /dev/null @@ -1,31 +0,0 @@ -<!--/* - Copyright (C) 2022 Typerefinery.ai - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/--> -<template data-sly-template.variant="${ @ model }"> - <input - component="${model.componentName}" - isInput="true" - id="${model.id}" - type="${model.inputType}" - name="${model.name}" - data-fieldId="${model.parentFieldId}" - placeholder="${model.placeholder}" - class=" ${model.variantClassNames}" - required="${model.validationRequired}" - autocomplete="${model.autocomplete}" - data-inputmask = " 'mask' : '${model.validationInputMask}'" - disabled="${model.disabled}" - /> -</template> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/.content.json index 714177102..08943c0ac 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/.content.json @@ -2,5 +2,6 @@ "group": ".hidden", "sling:resourceType": "ws:Component", "description": "This is Select component for Typerefinery", - "title": "Select Stix" + "title": "Select Stix", + "sling:resourceSuperType": "typerefinery/components/forms/fields/select" } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/.content.json deleted file mode 100644 index b5d2d82f3..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/.content.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "title": "Client Libs - Forms - Stix - Select", - "jcr:primaryType": "sling:Folder", - "sling:resourceType": "io/typerefinery/websight/clientlibs", - "categories": [ - "ai.typerefinery.websight.components", - "ai.typerefinery.websight.components.stix.forms.select" - ], - "css": [ - "/apps/typerefinery/clientlibs/vendor/select/style.css" - ], - "js": [ - "/apps/typerefinery/clientlibs/vendor/select/script.js", - "functions.js", - "behaviour.js" - ] -} \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js deleted file mode 100644 index 8985c0011..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/behaviour.js +++ /dev/null @@ -1,13 +0,0 @@ -window.Typerefinery = window.Typerefinery || {}; -window.Typerefinery.Components = Typerefinery.Components || {}; -window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; -window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; -window.Typerefinery.Components.Stix.Forms.Select = Typerefinery.Components.Stix.Forms.Select || {}; - -(function ($, ns, componentsNs, document, window) { - "use strict"; - - //init and watch for new components - componentsNs.watchDOMForComponent(`${ns.selectorComponent}${ns.selectorInitNot}`, ns.init); - -})(jQuery, window.Typerefinery.Components.Stix.Forms.Select, window.Typerefinery.Components, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js deleted file mode 100644 index 8a8d0cb62..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/clientlibs/functions.js +++ /dev/null @@ -1,205 +0,0 @@ -window.Typerefinery = window.Typerefinery || {}; -window.Typerefinery.Components = Typerefinery.Components || {}; -window.Typerefinery.Components.Stix = Typerefinery.Components.Stix || {}; -window.Typerefinery.Components.Stix.Forms = Typerefinery.Components.Stix.Forms || {}; -window.Typerefinery.Components.Stix.Forms.Select = Typerefinery.Components.Stix.Forms.Select || {}; -window.Typerefinery.Components.Stix.Forms.Select.Instances = Typerefinery.Components.Stix.Forms.Select.Instances || {}; - -(function ($, ns, componentNs, selectInstances, window, document) { - "use strict"; - - ns.selectorComponent = "[component='stix-select']"; - - ns.selectorInit = '[data-choice]' - ns.selectorInitNot = ':not([data-choice])' - - ns.getOptionsSelectedAsAnArray = ($component) => { - const $selectedOption = $component.find('option[selected]'); - if($selectedOption) { - return [$selectedOption.val()]; - } else { - return []; - } - } - - ns.getDefaultOptionsSelected = (defaultSelectedOptions) => { - // convert the defaultSelectedOptions to an array - // if the defaultSelectedOptions is a string, then split it by comma - // if the defaultSelectedOptions is an array, then do nothing - - if(typeof defaultSelectedOptions === 'string') { - return defaultSelectedOptions.split(','); - } - - return defaultSelectedOptions; - }; - - ns.isValueSelectedAsDefault = (options, value) => { - if(options) { - if(Array.isArray(options)) { - return options.includes(value?.trim()) ? 'selected' : ''; - } - } - return ''; - }; - - ns.getOptionsFromDataSource = async (componentConfig) => { - try{ - const { readOptionsFromDataSource, readMethod , readPayloadType } = componentConfig; - if(!readOptionsFromDataSource) { - return []; - } - const response = await fetch( - readOptionsFromDataSource, - { - method: readMethod || "GET", - headers: { - "Content-Type": readPayloadType || "application/json" - } - } - ).then(response => response.json()); - return Array.isArray(response) ? response : (response?.data || []); - }catch(error) { - console.error(error); - return []; - } - }; - - ns.addOptionsToSelect = ($component, defaultSelectedOptions, optionsList, keyName, labelName) => { - console.log('options from data source', optionsList); - if(optionsList.length !== 0) { - const selectOptions = optionsList.map((option) => { - console.log(option); - var html = `<option ${ns.isValueSelectedAsDefault(defaultSelectedOptions, option[keyName || 'key'])} value="${option[keyName || 'key']}">${option[labelName || 'label']}</option>`; - console.log(html); - return html; - }); - var optionsHTML = selectOptions.join(''); - console.log(optionsHTML) - $component.html(optionsHTML); - return; - } else { - console.log("optionsList is empty"); - } - }; - - // public methods to interact with the select component instances - ns.getValue = function (id) { - console.group('select getValue'); - console.log('id', id); - let returnValue = ""; - returnValue = selectInstances[id].getValue(true) - console.log('returnValue', returnValue); - console.groupEnd(); - return returnValue; - } - ns.setChoiceByValue = function (id, value) { - console.group('select setChoiceByValue'); - console.log('id', id); - console.log('value', value); - selectInstances[id].setChoiceByValue(value); - console.groupEnd(); - } - ns.setValue = function (id, data) { - console.group('select setValue'); - console.log('id', id); - console.log('value', value); - selectInstances[id].setValue(data); - console.groupEnd(); - } - - ns.init = async ($component) => { - console.group("select init"); - const componentConfig = componentNs.getComponentConfig($component); - console.log("componentConfig", componentConfig); - if(componentConfig.multipleSelection) { - $component.attr('multiple', 'true'); - } - - if (!componentConfig.id) { - console.log("$component",$component); - console.log("$component.html()",$component.html()); - console.log("componentConfig",componentConfig); - console.log("componentConfig.id",componentConfig.id); - console.error("component id is required"); - console.groupEnd(); - return - } - - - console.log("componentConfig.id",componentConfig.id); - console.log("component select",$component.get(0)); - - console.log("loading options"); - - const defaultSelectedOptions = ns.getDefaultOptionsSelected(componentConfig.defaultSelectedOptions); - - if(componentConfig.readOptionsFromDataSource) { - console.log("loading options from data source", componentConfig.readOptionsFromDataSource); - console.groupEnd(); - await ns.getOptionsFromDataSource(componentConfig).then((optionsList) => { - - console.group("select init, resuming after loading options from data source"); - console.log("componentConfig", componentConfig); - console.log("id", componentConfig.id); - console.log("data source list", optionsList); - ns.addOptionsToSelect($component, defaultSelectedOptions, optionsList, componentConfig.keyNameInOptionList, componentConfig.keyNameInOptionList, componentConfig.labelNameInOptionList); - console.log($component.html()); - console.log("loaded options"); - - console.log("init choices"); - console.log("init choices for", $component.get(0)); - - selectInstances[componentConfig.id] = new Choices($component.get(0), { - removeItemButton: true, - maxItemCount: componentConfig.maxSelection || -1, - allowHTML: false, - shouldSort: true, - loadingText: 'Loading...', - itemSelectText: 'Press to select', - uniqueItemText: 'Only unique values can be added', - addItemText: (value) => { - return `Press Enter to add <b>"${value}"</b>`; - }, - }); - - console.groupEnd(); - - }); - - } else { - console.log("loading options from config"); - if(componentConfig.selectOptions && Array.isArray(componentConfig.selectOptions)) { - console.log("config options list", componentConfig.selectOptions) - ns.addOptionsToSelect($component, defaultSelectedOptions, componentConfig.selectOptions, "value", "label"); - } - console.log("loaded options"); - - console.log("init choices"); - - if ($component.get(0)) { - - selectInstances[componentConfig.id] = new Choices($component.get(0), { - removeItemButton: true, - maxItemCount: componentConfig.maxSelection || -1, - allowHTML: false, - shouldSort: true, - loadingText: 'Loading...', - itemSelectText: 'Press to select', - uniqueItemText: 'Only unique values can be added', - addItemText: (value) => { - return `Press Enter to add <b>"${value}"</b>`; - }, - }); - - } else { - console.error("component not found"); - } - - console.groupEnd(); - } - - } - - -})(jQuery, Typerefinery.Components.Stix.Forms.Select, Typerefinery.Components, Typerefinery.Components.Stix.Forms.Select.Instances, window, document); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html deleted file mode 100644 index 5d77b36a6..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/select.html +++ /dev/null @@ -1,21 +0,0 @@ -<!--/* - Copyright (C) 2023 Typerefinery.io - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/--> -<sly data-sly-use.model="ai.typerefinery.websight.models.components.forms.Select"> - <div class="${model.componentClassNames}" type="${model.inputType}" component="${model.componentName}-input"> - <sly data-sly-use.template="./variant.html" data-sly-call="${template.variant @ model=model}"> - </sly> - </div> -</sly> \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html deleted file mode 100644 index 9cd9e1e54..000000000 --- a/application/backend/src/main/resources/apps/typerefinery/components/stix/forms/fields/select/variant.html +++ /dev/null @@ -1,31 +0,0 @@ -<!--/* - Copyright (C) 2023 Typerefinery.io - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/--> -<template data-sly-template.variant="${ @ model }"> - <select - component="stix-${model.componentName}" - isInput="true" - id="${model.id}" - type="${model.inputType}" - name="${model.name}" - data-fieldId="${model.parentFieldId}" - placeholder="${model.placeholder}" - class="${model.variantClassNames} form-control" - required="${model.validationRequired}" - data-model="${model.jsonString}" - disabled="${model.disabled}" - > - </select> -</template> \ No newline at end of file From 12e0e84d1ff5d9c545acb7c0be5fb3b4e8afb896 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 17 Jul 2024 17:03:26 +1000 Subject: [PATCH 168/206] update debug group with paths. --- .../components/clientlibs/clientlibs-header/components.js | 4 +++- .../components/forms/fields/button/clientlibs/functions.js | 2 +- .../components/forms/form/clientlibs/functions.js | 2 +- .../components/layout/accordion/clientlibs/functions.js | 2 +- .../components/layout/container/clientlibs/functions.js | 2 +- .../components/structure/page/clientlibs-header/functions.js | 2 +- .../components/widgets/editor/clientlibs/functions.js | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js index cd7e36d7b..771601f3b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js @@ -163,7 +163,9 @@ window.Typerefinery.VueData = Typerefinery.VueData || {}; return; } - console.group("onDocumentReady for " + selector); + const pagePath = window.location.pathname; + + console.groupCollapsed("onDocumentReady for " + selector + " on " + pagePath); ns.initComponentBySelector(selector, callbackFn); ns.observeDOMForSelector(selector, callbackFn); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js index 0c6faf455..081dc432e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js @@ -126,7 +126,7 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const componentConfig = componentNs.getComponentConfig($component); const { buttonType, id, actionType } = componentConfig; - console.group("button init " + id); + console.groupCollapsed("button init " + id); console.log("$component", $component); console.log("componentConfig", componentConfig); console.log("buttonType", buttonType); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index 7b5abe8b1..276c79a05 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -598,7 +598,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; ns.init = ($component) => { const componentConfig = componentNs.getComponentConfig($component); - console.group("forms init"); + console.groupCollapsed("forms init"); console.log(["config", componentConfig, $component, ns.eventMap]); if (Object.keys(componentConfig).length === 0) { console.error("Component config of form component is missing"); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index f8d1ca4a6..e8c91757d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -364,7 +364,7 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.init = ($component) => { const componentConfig = componentNs.getComponentConfig($component); const { id} = componentConfig; - console.group('init ' + id); + console.groupCollapsed('init ' + id); console.log(["config", componentConfig]); console.log("adding event listeners"); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/functions.js index db09099a6..20a1a843d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/functions.js @@ -193,7 +193,7 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.init = ($component) => { const componentConfig = componentNs.getComponentConfig($component); const { id} = componentConfig; - console.group('init ' + id); + console.groupCollapsed('init ' + id); console.log(["config", componentConfig]); console.log("adding event listeners"); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/functions.js index bb8a4fa96..2fe18ba91 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/functions.js @@ -8,7 +8,7 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; "use strict"; ns.init = () => { - console.group("page init"); + console.group("page init on " + window.location); tmsNs.init(); // Commenting this because themeNs init is invoked if the theme Button is linked to the page. // themeNs.init(); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js index 597879c0c..e746fa849 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/editor/clientlibs/functions.js @@ -216,7 +216,7 @@ window.Typerefinery.Components.Widgets.Editor.Instances = Typerefinery.Component ns.init = ($component) => { - console.group("Editor init"); + console.groupCollapsed("Editor init"); console.log($component); // parse json value from data-model attribute as component config const componentConfig = componentNs.getComponentConfig($component); From 4d9c66102dc1cdcb35f826b7c9c0b5b9a534b28f Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 17 Jul 2024 17:18:00 +1000 Subject: [PATCH 169/206] update debug messages. --- .../components/forms/fields/composite/clientlibs/behaviour.js | 1 - .../components/forms/fields/select/clientlibs/functions.js | 2 +- .../components/structure/page/clientlibs-header/tms/client.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js index 310e8dfcf..2037d0006 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/behaviour.js @@ -6,7 +6,6 @@ window.Typerefinery.Components.Forms.Composite = Typerefinery.Components.Forms.C (function ($, ns, componentsNs, document) { "use strict"; $(document).ready(function () { - console.log('Composite component Behaviour loaded'); //init and watch for new components componentsNs.watchDOMForComponent(`${ns.selectorComponent}${ns.selector}`, ns.init); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js index f1d845b86..1d1bc5ae7 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js @@ -125,7 +125,7 @@ window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components. console.log("loading options from data source, wait for response"); console.groupEnd(); var optionsList = await ns.getOptionsFromDataSource(componentConfig); - console.group("select init, resume after response from data source"); + console.groupCollapsed("select init, resume after response from data source on" + window.location); console.log("data source list", optionsList); ns.addOptionsToSelect($component, defaultSelectedOptions, optionsList, componentConfig.keyNameInOptionList, componentConfig.keyNameInOptionList, componentConfig.labelNameInOptionList); console.log($component.html()); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js index e71ad5a49..f163ae104 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js @@ -33,7 +33,7 @@ window.MessageService.Client = MessageService.Client || {}; } ns.init = function() { - console.group("tms init"); + console.groupCollapsed("tms init on " + window.location); //generate client id ns.client_id = Date.now() From cc6db4fb61b66e6408435677fc419db40805e3e5 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Wed, 17 Jul 2024 19:50:03 +1000 Subject: [PATCH 170/206] update debug messages. --- .../components/clientlibs/clientlibs-header/dropdown.js | 5 +++-- .../components/clientlibs/clientlibs-header/modal.js | 2 +- .../components/forms/fields/select/clientlibs/functions.js | 2 +- .../structure/page/clientlibs-header/tms/functions.js | 3 +++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js index da2c19c5c..fd75c72fa 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/dropdown.js @@ -57,8 +57,8 @@ Typerefinery.Modal = Typerefinery.Modal || {}; }; ns.dropDownButtonEventListener = () => { - console.log("drop down button event listener") - $(document).on("click", "#__dropdown__", function (e) { + $(document).on("click", "#__dropdown__", function (e) { + console.groupCollapsed("drop down button event listener on " + window.location); // console.log("again 1 clicked on dropdown item", e.target ); const componentConfig = JSON.parse(e.target.getAttribute("data-model")); const { label, name, link, action, hideFooter = false } = componentConfig; @@ -73,6 +73,7 @@ Typerefinery.Modal = Typerefinery.Modal || {}; // navigate to the link. window.location.href = link; } + console.groupEnd(); }); }; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/modal.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/modal.js index e27d31258..af050c9b7 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/modal.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/modal.js @@ -132,7 +132,7 @@ window.Typerefinery.Modal = Typerefinery.Modal || {}; // if this is not a parent view then return. if(!isParentView) { - console.log("This is not a parent view"); + // console.log("This is not a parent view"); return; } diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js index 1d1bc5ae7..2a796d10b 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js @@ -125,7 +125,7 @@ window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components. console.log("loading options from data source, wait for response"); console.groupEnd(); var optionsList = await ns.getOptionsFromDataSource(componentConfig); - console.groupCollapsed("select init, resume after response from data source on" + window.location); + console.groupCollapsed("select init, resume after response from data source on " + window.location); console.log("data source list", optionsList); ns.addOptionsToSelect($component, defaultSelectedOptions, optionsList, componentConfig.keyNameInOptionList, componentConfig.keyNameInOptionList, componentConfig.labelNameInOptionList); console.log($component.html()); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js index 4fb913db6..e8f943dc5 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js @@ -53,6 +53,8 @@ window.MessageService.Client = MessageService.Client || {}; // listen to messages. window.addEventListener(clientNs?.events.MESSAGE, function (message) { + console.groupCollapsed("tms message on " + window.location); + console.log(["tms message", message]); let messagePayload = message?.detail?.data?.payload || null; let messageTopic = message?.detail?.data?.topic || null; @@ -76,6 +78,7 @@ window.MessageService.Client = MessageService.Client || {}; } } } + console.groupEnd(); }); }; From 95e01d7d2379a0af3cf5a00f6d7b01ae98388a82 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 19 Jul 2024 23:46:09 +1000 Subject: [PATCH 171/206] refactor and add event proxy event type. --- .../clientlibs-header/events/functions.js | 98 ++++++++++++------- 1 file changed, 65 insertions(+), 33 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js index b61b06c9a..541ca6d1e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js @@ -5,7 +5,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; (function ($, ns, document, window) { "use strict"; - ns.registery = {}; + //global registry for events + ns.registry = {}; ns.CUSTOM_EVENT_NAME = "customEvent"; @@ -34,7 +35,9 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; EVENT_CANCEL_ACTION: "cancelaction", EVENT_RESET_ACTION: "resetaction", EVENT_SUBMIT_ACTION: "submitaction", - EVENT_ERROR_ACTION: "erroraction" + EVENT_ERROR_ACTION: "erroraction", + //event proxy + EVENT_PROXY: "eventproxy", //one component proxying event to another } //return object with all generic events @@ -130,10 +133,10 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.socket = new EventTarget(); }; + /* listen for messages posted to this window */ ns.windowListener = function() { - console.log("windowListener added"); window.addEventListener('message', function(event) { - console.group('windowListener'); + console.groupCollapsed('global windowListener on ' + window.location); console.log(["event", event]); var eventData = event.data; var sourceWindow = event.source; @@ -149,6 +152,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; if (typeof eventData === 'string') { sourceData = JSON.parse( eventData ); } + sourceData = eventData; } console.log(["sourceData", sourceData]); @@ -156,50 +160,70 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; if (sourceData) { const { action, payload } = sourceData; console.log(["action", action, "payload", payload]); - console.log(["registery", ns.registery]); - console.log(["ns.registery action", ns.registery[action]]); + console.log(["registry", ns.registry]); + console.log(["ns.registry action", ns.registry[action]]); const eventPayloadData = ns.compileEventData(payload, action, sourceData.action, sourceData.componentId, sourceData.config); console.log(["eventPayloadData", eventPayloadData]); // ns.emitLocalEvent($component, componentConfig, ns.eventMap, data, action, action); - ns.emitEvent(action, eventPayloadData); - // if (ns.registery[action]) { + //ns.emitEvent(action, eventPayloadData); + // if (ns.registry[action]) { // console.log("topic found", action); - // ns.registery[action].forEach((callbackFn) => { + // ns.registry[action].forEach((callbackFn) => { // console.log("callbackFn", callbackFn); // if (typeof callbackFn === 'function') { // callbackFn(payload); // } // }); // } + } else { + console.warn("no source data sent"); } console.groupEnd(); }); }; ns.socketListener = () => { + console.group('socketListener'); console.log("socketListener added"); ns.socket.addEventListener(ns.CUSTOM_EVENT_NAME, (e) => { - console.group('socketListener'); - const detail = e.detail; + console.group('socketListener on ' + window.location); + var detail = e.detail; + //parse detail if string + if (detail) { + if (typeof detail === 'string') { + detail = JSON.parse( detail ); + } + } const { topic, payload } = detail; console.log(["topic", topic, "payload", payload]); - if (ns.registery[topic]) { + if (ns.registry[topic]) { console.log("topic found", topic); - ns.registery[topic].forEach((callbackFn) => { + ns.registry[topic].forEach((callbackFn) => { console.log("callbackFn", callbackFn); if (typeof callbackFn === 'function') { callbackFn(payload); } }); + } else { + console.warn("topic not found", topic); } + const { componentId } = payload; + const componentConfig = { id: componentId || null }; + // ns.emitLocalEvent(null, componentConfig, ns.eventMap, data, eventNs.EVENTS.EVENT_SUCCESS_ACTION, "BUTTON_CLICK"); + //emit local event + console.groupEnd(); }); + console.groupEnd(); }; ns.emitLocalEvent = ($component, componentConfig, eventMap, payload, eventName, componentAction) => { console.group('emitLocalEvent'); + if (!$component) { + console.warn("event is external, no component found"); + } console.log(["config", $component, componentConfig, payload, eventName, componentAction]); const { id } = componentConfig; @@ -215,7 +239,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } //find event in eventMap and emit event to all the topics if (eventMap[ns.EVENT_TYPE_EMIT]) { - console.log("eventMap found", componentAction, eventMap[ns.EVENT_TYPE_EMIT]); + console.log("eventMap type found", componentAction, eventMap[ns.EVENT_TYPE_EMIT]); if (eventMap[ns.EVENT_TYPE_EMIT][componentAction]) { console.log("componentAction found", eventName, eventMap[ns.EVENT_TYPE_EMIT][componentAction]); @@ -227,28 +251,28 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } // for each event name in the component action emit event - const eventNames = Object.keys(eventMap[ns.EVENT_TYPE_EMIT][componentAction][id]); - console.group("eventNames"); - console.log("eventNames", eventNames); + const actionComponents = Object.keys(eventMap[ns.EVENT_TYPE_EMIT][componentAction][id]); + console.group("actionComponents"); + console.log("actionComponents", actionComponents); // for each topic in the event name emit event - eventNames.forEach(eventName => { - console.log("eventName", eventName); - const topicValues = eventMap[ns.EVENT_TYPE_EMIT][componentAction][id][eventName]; - console.log("topicValues", topicValues); + actionComponents.forEach(actionComponent => { + console.log("actionComponents", actionComponent); + const actionEvents = eventMap[ns.EVENT_TYPE_EMIT][componentAction][id][actionComponent]; + console.log("topicValues", actionEvents); // if topicValues is array then emit event to all the topics - if (Array.isArray(topicValues)) { - topicValues.forEach(topicValue => { + if (Array.isArray(actionEvents)) { + actionEvents.forEach(topicValue => { const { topic, config } = topicValue; console.log("emit event for topic", topic); - const eventData = ns.compileEventData(payload, eventName, componentAction, id, config); + const eventData = ns.compileEventData(payload, actionComponent, componentAction, id, config); ns.emitEvent(topic, eventData); }); } else { //is single value use it as topic - if (topicValues) { + if (actionEvents) { const { topic, config } = topicValue; console.log("emit event for topic", topic); - const eventData = ns.compileEventData(payload, eventName, componentAction, id, config); + const eventData = ns.compileEventData(payload, actionComponent, componentAction, id, config); ns.emitEvent(topic, eventData); } } @@ -269,23 +293,31 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; }; ns.registerEvents = (topic, callbackFn) => { - if (!ns.registery[topic]) { - ns.registery[topic] = [callbackFn]; + console.group('registerEvents'); + if (!ns.registry[topic]) { + ns.registry[topic] = [callbackFn]; } else { - // push to array - ns.registery[topic].push(callbackFn); + // push to array + ns.registry[topic].push(callbackFn); } + console.log(["topic", topic, "callbackFn", callbackFn]); + console.log(["registry", ns.registry]); + console.groupEnd(); }; - ns.init = () => { - console.group("events init"); + console.groupCollapsed("events init on " + window.location); // NOTE: socket in this ns is a custom event. It is not a websocket. ns.createWebSocketConnection(); + + // socket listener for custom events ns.socketListener(); - ns.windowListener(); + + // window listener for postMessage + //TODO: this is only needed if we expect to receive global messages from other windows + //ns.windowListener(); console.groupEnd(); }; From fe36a5f6d4e67550eb1448de8813823032c9a08b Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 19 Jul 2024 23:46:48 +1000 Subject: [PATCH 172/206] add action names. --- .../components/forms/form/clientlibs/functions.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index 276c79a05..6aed5e2a6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -17,6 +17,14 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; ns.selectorInputAttribute = "isInput"; ns.selectorInput = `[${ns.selectorInputAttribute}]`; + //actions supported by this component + ns.ACTIONS = { + FORM_SUBMIT: "FORM_SUBMIT", + FORM_SUCCESS: "FORM_SUCCESS", + FORM_ERROR: "FORM_ERROR", + FORM_CANCEL: "FORM_CANCEL", + } + // map event types to handlers in component // this will indicate which events are supported by component ns.eventMap = eventNs.genericEventsTopicMap(); @@ -593,6 +601,8 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; //load data into form if (eventName === eventNs.EVENTS.EVENT_READ_ACTION) { ns.loadData($component, data); + } else { + console.error(["unsupported action", eventName]); } } From 7f4bfe66612b61f9f341ee931fe7e5df868754f9 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 19 Jul 2024 23:48:05 +1000 Subject: [PATCH 173/206] update events dialog with event proxy. --- .../typerefinery/components/dialog/tabs/event/.content.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json index 58f939012..0ff933a4e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json @@ -97,6 +97,11 @@ "sling:resourceType": "typerefinery/components/dialog/select/selectitem", "label": "Filter", "value": "filteraction" + }, + "proxy": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Proxy", + "value": "eventproxy" } }, "generic": { From 7e0f8e83f64dc03f723a26f05a7cc73389e3de4d Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 19 Jul 2024 23:48:54 +1000 Subject: [PATCH 174/206] add event proxy to embed. --- .../content/embed/clientlibs/functions.js | 242 ++++++++++++++++-- .../content/embed/dialog/.content.json | 45 ++++ .../content/embed/eventactions/.content.json | 8 + 3 files changed, 274 insertions(+), 21 deletions(-) create mode 100644 application/backend/src/main/resources/apps/typerefinery/components/content/embed/eventactions/.content.json diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js index 5cfe5fa03..aec3aff26 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js @@ -10,35 +10,80 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.selectorComponent = '[component=embed]'; + //actions supported by this component + ns.ACTIONS = { + EVENT_PROXY: "EVENT_PROXY" + } + + // map event types to handlers in component + // this will indicate which events are supported by component + ns.eventMap = eventNs.genericEventsTopicMap(); + ns.registerEvent = ($component, componentId, fieldName) => { - const key = `${componentId}-${fieldName}`; - eventNs.registerEvents(key, (data) => { - if(data.type === eventNs.EVENTS.EVENT_READ_ACTION) { - // get the first children and set the inner html. - const $firstChild = $component.children[0]; - const componentConfig = componentNs.getComponentConfig($component); - if (componentConfig.variant === "iframe") { - $component.find("iframe").attr("src", data.data.value); - } + console.group("registerEvent"); + const key = `${componentId}-${fieldName}`; + console.log(["registerEvent", key]); + eventNs.registerEvents(key, (data) => { + console.group("registerEvents callback on " + window.location); + console.log(["registerEvents callback", key, data.type, data]); + if(data.type === eventNs.EVENTS.EVENT_PROXY) { + // get the first children and set the inner html. + const $firstChild = $component.children[0]; + console.log(["registerEvents callback EVENT_PROXY", $firstChild]); + const componentConfig = componentNs.getComponentConfig($component); + console.log(["registerEvents callback EVENT_PROXY", componentConfig, componentConfig.variant]); + if (componentConfig.variant === "iframe") { + console.log(["registerEvents callback EVENT_PROXY", componentConfig, componentConfig.variant, $component.find("iframe").attr("src"), data.data.value]); + $component.find("iframe").attr("src", data.data.value); } - }); + } + console.groupEnd(); + }); + console.groupEnd(); } - ns.sendMessage = function($component, data) { - console.log(["sendMessage", data]); + //send message to iframe + ns.sendMessageToiFrame = function($component, data) { + console.group("sendMessageToiFrame on " + window.location); + + + var sourceData = data; + if (typeof sourceData === 'string') { + sourceData = JSON.parse( data ); + } + + if (!sourceData) { + console.error("no data to send"); + console.groupEnd(); + return; + } + + // console.log(["sendMessageToiFrame", data]); var $iframe = $component.find("iframe"); var iframe = $iframe[0]; - iframe.contentWindow.postMessage(data, "*"); + console.log(["sendMessageToiFrame", sourceData, $iframe, iframe]); + //if iframe does not have TypeRefinery then it will need to manage its own events + iframe.contentWindow.postMessage(sourceData, "*"); + //call events + if (iframe.contentWindow.Typerefinery.Page.Events) { + const topic = sourceData.type; + iframe.contentWindow.Typerefinery.Page.Events.emitEvent(topic, sourceData); + } + console.groupEnd(); } ns.autoLoad = ($component) => { + console.group("autoLoad"); // if autoResize is set to true, then register the autoResize event. const componentConfig = componentNs.getComponentConfig($component); + console.log(["autoLoad", componentConfig.autoResize]); if (componentConfig.autoResize) { + console.log(["register outo resie event"]); $component.on("load", function() { ns.autoResize($component); }); } + console.groupEnd(); } ns.autoResize = ($component) => { @@ -58,16 +103,171 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } //console.log(["autoResize newHeight", embedid, newHeight]); $iframe.height(newHeight); - } + } + + // local actions + ns.EVENT_PROXY = ($component, componentConfig, data) => { + console.group(ns.ACTIONS.EVENT_PROXY); + console.log([ns.ACTIONS.EVENT_PROXY, $component, componentConfig, data]); + eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, data, eventNs.EVENTS.EVENT_PROXY, ns.ACTIONS.EVENT_PROXY); + console.groupEnd(); + } + + + ns.handleEvent = ($component, eventName, data) => { + console.log(["update", $component, eventName, data]); + //load data into form + if (eventName === eventNs.EVENTS.EVENT_PROXY) { + ns.EVENT_PROXY($component, data); + } else { + console.error(["unsupported action", eventName]); + } + } + + + ns.addEventListener = ($component, componentConfig) => { + console.group('addEventListener'); + const { events, id } = componentConfig; + const defaultTopic = id; + + console.log(["config", events, id, defaultTopic]); + + console.log("registering events"); + //register events + if (events) { + events.forEach(event => { + console.log(["event", event]); + const { topic, type, name, nameCustom, action, config} = event; + //if topic not set use component id as topic + const topicName = topic || defaultTopic; + // if type is not defined then its emitted + let typeName = type || eventNs.EVENT_TYPE_LISTEN; //default is listen + + //custom name takes precidence over name, this will be raised as event name + let eventName = nameCustom || name; + + // if action is EVENT_PROXY + + // if action is EVENT_PROXY then add the event to registry + if (action === ns.ACTIONS.EVENT_PROXY) { + + console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap), topicName, typeName, action, eventName]); + eventNs.registerEventActionMapping(ns.eventMap, id, topicName, typeName, action, eventName, config); + console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap)]); + + // if event type is listen then add event listener for the event + if (typeName === eventNs.EVENT_TYPE_EMIT) { + console.log(["add windowListeneriFrameEventProxy for this component", eventName, id]); + //listen for global message events that are emited by iframe + ns.windowListeneriFrameEventProxy($component, componentConfig, eventName, action, id, config); + } else { + //listen register the event and listent for specific event on topic + console.log(["registerEvents", topicName, eventName]); + eventNs.registerEvents(topicName, (data) => { + console.log(["registerEvents callback", topicName, eventName, data]); + // check make sure the event is for this event + if (data.type === eventName) { + //send message to iframe + ns.sendMessageToiFrame($component, data.payload); + } + }); + //need to reach into the frame and register message event + //this will ensure that only messages from this frame are listened + //windowListener + } + } else { + console.error(["unsupported action", action]); + } + + }); + } + + console.log(["eventMap", ns.eventMap]); + + + console.groupEnd(); + } + + ns.isProxyEnabled = ($component, componentConfig) => { + + //for all keys in eventMap check if any action is EVENT_PROXY + for (const key in ns.eventMap) { + if (ns.eventMap.hasOwnProperty(key)) { + const events = ns.eventMap[key]; + for (const key in events) { + if (events.hasOwnProperty(key)) { + const event = events[key]; + if (event.action === eventNs.EVENTS.EVENT_PROXY) { + //does this event has maping to this component + if (events.hasOwnProperty(componentConfig.id)) { + return true; + } + } + } + } + } + } + + return false; + + } + + /* listen for window post messages sent by iframe to this component */ + ns.windowListeneriFrameEventProxy = function($component, componentConfig, eventName, action, id, config) { + const iFrameContentWindow = $component.find("iframe")[0].contentWindow; + console.log(["windowListeneriFrameEventProxy", iFrameContentWindow]); + window.addEventListener('message', function(event) { + console.groupCollapsed('embed windowListeneriFrameEventProxy on ' + window.location); + console.log(["event", event, event.source == iFrameContentWindow, eventName, action, id, config, event.data]); + if (event.source == iFrameContentWindow) { + console.log(["event", event]); + var eventData = event.data; + var sourceWindow = event.source; + var sourceOrigin = event.origin; + console.log(["sourceWindow", sourceWindow, "sourceOrigin", sourceOrigin, "eventData", eventData]); + + var sourceData; + if (eventData) { + if (typeof eventData === 'string') { + sourceData = JSON.parse( eventData ); + } + sourceData = eventData; + } + + console.log(["sourceData", sourceData]); + + if (sourceData) { + //const eventPayloadData = eventNs.compileEventData(sourceData, eventName, action, id, config); + + //console.log(["eventPayloadData", eventPayloadData]); + + //emit the event + ns.EVENT_PROXY($component, componentConfig, sourceData); + + } + } else { + console.warn("source not matched"); + } + console.groupEnd(); + }); + }; ns.init = ($component) => { - // check if the component have a data attribute with the name "data-field-componentId" and "data-field-name" then register eventNs - const componentId = $component.attr("data-field-componentId"); - const fieldName = $component.attr("data-field-name"); - if (componentId && fieldName) { - ns.registerEvent($component, componentId, fieldName); - }; - ns.autoLoad($component); + console.groupCollapsed("embed init"); + const componentConfig = componentNs.getComponentConfig($component); + // check if the component have a data attribute with the name "data-field-componentId" and "data-field-name" then register eventNs + // const componentId = $component.attr("data-field-componentId"); + // const fieldName = $component.attr("data-field-name"); + console.log(["embed init", componentConfig]); + + //run events for this component when it loads + ns.autoLoad($component); + + // add event listener that have been configured for this component + ns.addEventListener($component, componentConfig); + + console.log(["embed init done"]); + console.groupEnd(); } } )(jQuery, Typerefinery.Components.Content.Embed, Typerefinery.Components, Typerefinery.Page.Events, document, window); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/dialog/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/dialog/.content.json index 4b4a95f32..94b9f83bc 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/dialog/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/dialog/.content.json @@ -71,6 +71,51 @@ } } }, + "eventTab": { + "sling:resourceType": "wcm/dialogs/components/tab", + "label": "Events", + "warning": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/warning" + }, + "info": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/info" + }, + "event": { + "sling:resourceType": "wcm/dialogs/components/multifield", + "ws:disallowedContext": ["edit:panel"], + "name": "_events_", + "description": "Pick generic event or specify custom event to which component action will be mapped.", + "label": "Events", + "topic": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/topic" + }, + "type": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/type" + }, + "eventAction": { + "sling:resourceType": "typerefinery/components/dialog/eventactions", + "name": "action", + "label": "Component Action", + "description": "Which component action to map to event." + }, + "eventName": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventName" + }, + "eventNameCustom": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventNameCustom" + }, + "eventConfig": { + "sling:resourceType": "wcm/dialogs/components/include", + "path": "/apps/typerefinery/components/dialog/tabs/event/event/eventConfig" + } + } + }, "gridTab": { "sling:resourceType": "wcm/dialogs/components/include", "path": "/apps/typerefinery/components/dialog/tabs/grid" diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/eventactions/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/eventactions/.content.json new file mode 100644 index 000000000..33d51d155 --- /dev/null +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/eventactions/.content.json @@ -0,0 +1,8 @@ +{ + "sling:resourceType": "nt:unstructured", + "buttonclick": { + "sling:resourceType": "nt:unstructured", + "key": "EVENT_PROXY", + "value": "Event Proxy" + } +} \ No newline at end of file From ac9433d18b5c4ee3df21780e97b15102a631011a Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 15 Aug 2024 00:04:40 +1000 Subject: [PATCH 175/206] add jsconfig. --- jsconfig.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 jsconfig.json diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 000000000..e881b4a91 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "module": "None", + "target": "ES5", + "checkJs": true, + "moduleResolution": "node", + "allowJs": true + }, + "include": ["application/backend/src/main/resources/**/*.js"] + } \ No newline at end of file From 8cc41df63738a3460dc8f92f79ecf3c06f240f96 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 15 Aug 2024 00:06:32 +1000 Subject: [PATCH 176/206] update js config. --- jsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsconfig.json b/jsconfig.json index e881b4a91..e188df6bd 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "None", - "target": "ES5", + "target": "ES2023", "checkJs": true, "moduleResolution": "node", "allowJs": true From 4662f119f1ffec01488b4a7dc047f9b7a6a3038b Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 15 Aug 2024 00:08:36 +1000 Subject: [PATCH 177/206] update tms messages. --- .../page/clientlibs-header/tms/client.js | 22 +++++- .../page/clientlibs-header/tms/functions.js | 72 ++++++++++++++----- 2 files changed, 74 insertions(+), 20 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js index f163ae104..53b4331f9 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/client.js @@ -5,6 +5,12 @@ window.MessageService.Config = MessageService.Config || {}; window.MessageService.Client = MessageService.Client || {}; (function ($, ns, JSONSchemas, document, window) { + + ns.MESSAGE_PREFIX_OPEN = "[open]" + ns.MESSAGE_PREFIX_CLOSE = "[close]" + ns.MESSAGE_PREFIX_ERROR = "[error]" + ns.MESSAGE_OPEN = `${ns.MESSAGE_PREFIX_OPEN} Connection established cms` + ns.MESSAGE_CLOSE = `${ns.MESSAGE_PREFIX_CLOSE} Connection closed cms` ns.publishers = {} ns.subscribers = {} ns.callbacks = {} @@ -12,6 +18,8 @@ window.MessageService.Client = MessageService.Client || {}; ns.dataToSend = [] ns.callTimeout = 10000 ns.meta = undefined + ns.isOpen = false + ns.errorLog = [] ns.events = { READY: "messageservice:ready", CLIENT_ID: "messageservice:clientid", @@ -38,6 +46,8 @@ window.MessageService.Client = MessageService.Client || {}; //generate client id ns.client_id = Date.now() + console.log("client id: ", ns.events.CLIENT_ID, ns.client_id) + // output id to page ns.events.emit(ns.events.CLIENT_ID, ns.client_id) @@ -53,11 +63,19 @@ window.MessageService.Client = MessageService.Client || {}; ns.ws = new WebSocket(host) ns.ws.onopen = function (e) { - ns.logMessage("[open] Connection established cms") + ns.isOpen = true + ns.logMessage(ns.MESSAGE_OPEN) + } + ns.ws.onclose = function (e) { + ns.isOpen = false + ns.logMessage(ns.MESSAGE_CLOSE) } ns.ws.onerror = function (error) { var message = JSON.stringify(error) - ns.logMessage(`[error] ${message}`) + ns.isError = true + const timestamp = new Date().toISOString() + ns.errorLog.push(`${timestamp} - ${message}`) + ns.logMessage(`${ns.MESSAGE_PREFIX_ERROR} ${message}`) } ns.ws.onmessage = function (event) { var message = JSON.parse(event.data) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js index e8f943dc5..6cd663d56 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js @@ -31,6 +31,35 @@ window.MessageService.Client = MessageService.Client || {}; ns.registry[host][topic][key] = callbackFn; }; + ns.isSystemMessage = (message) => { + + // if message?.detail is a type of string + if (typeof message?.detail === "string") { + // is message a connect message + if (message?.detail.startsWith(ns.MESSAGE_PREFIX_OPEN)) { + return true; + } + // is message a disconnect message + if (message?.detail.startsWith(ns.MESSAGE_PREFIX_CLOSE)) { + return true; + } + // is message a error message + if (message?.detail.startsWith(ns.MESSAGE_PREFIX_ERROR)) { + return true; + } + } + //check is message has TMS welcome fields + if (message?.detail?.call + && message?.detail?.name + && message?.detail?.publish + && message?.detail?.subscribe + && message?.detail?.subscribers) { + return true; + } + + return false; + } + ns.connect = () => { const listOfHost = JSON.parse(localStorage.getItem("tmsHost") || "[]"); @@ -56,28 +85,35 @@ window.MessageService.Client = MessageService.Client || {}; console.groupCollapsed("tms message on " + window.location); console.log(["tms message", message]); - let messagePayload = message?.detail?.data?.payload || null; - let messageTopic = message?.detail?.data?.topic || null; - if (messagePayload && messageTopic) { - console.log(["tms message payload", messageTopic, messagePayload]); - ns.persistData(messageTopic, messagePayload); - console.log(["tms message save to local storage", messageTopic]); - // TODO: get host from the message. - const host = Object.entries(ns.registry)[0]; - console.log(["tms message host", host]); - // first idx[key, values]. - if (host) { - // grab the topic from the host. - const hostCallbacks = host[1]; - console.log(["tms message host topic", hostCallbacks, messageTopic, hostCallbacks[messageTopic]]); - if (hostCallbacks) { - console.log(["tms message call topic callbacks", hostCallbacks]); - if(hostCallbacks && hostCallbacks[messageTopic]) { - hostCallbacks[messageTopic](JSON.parse(messagePayload)); + + //is this a message from the tms? + if (!ns.isSystemMessage(message)) { + let messagePayload = message?.detail?.data?.payload || null; + let messageTopic = message?.detail?.data?.topic || null; + if (messagePayload && messageTopic) { + console.log(["tms message payload", messageTopic, messagePayload]); + ns.persistData(messageTopic, messagePayload); + console.log(["tms message save to local storage", messageTopic]); + // TODO: get host from the message. + const host = Object.entries(ns.registry)[0]; + console.log(["tms message host", host]); + // first idx[key, values]. + if (host) { + // grab the topic from the host. + const hostCallbacks = host[1]; + console.log(["tms message host topic", hostCallbacks, messageTopic, hostCallbacks[messageTopic]]); + if (hostCallbacks) { + console.log(["tms message call topic callbacks", hostCallbacks]); + if(hostCallbacks && hostCallbacks[messageTopic]) { + hostCallbacks[messageTopic](JSON.parse(messagePayload)); + } } } } + } else { + console.log(["tms welcome message", message]); } + console.groupEnd(); }); }; From 8b5f867ed9f0d57fa84f9d3e1acaf7e2c60b2576 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 15 Aug 2024 00:09:33 +1000 Subject: [PATCH 178/206] add new topic and fix socket send. --- .../structure/page/clientlibs-header/events/functions.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js index 541ca6d1e..95f5fa181 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js @@ -38,6 +38,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; EVENT_ERROR_ACTION: "erroraction", //event proxy EVENT_PROXY: "eventproxy", //one component proxying event to another + //topic + EVENT_TOPIC_PAYLOAD: "topicpayload", //payload for topic } //return object with all generic events @@ -125,7 +127,11 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log(["topic", topic, "payload", payload]); const evt = document.createEvent(ns.CUSTOM_EVENT_NAME); evt.initCustomEvent(ns.CUSTOM_EVENT_NAME, false, false, { topic, payload }); - ns.socket.dispatchEvent(evt); + if (ns.socket && ns.socket.dispatchEvent) { + ns.socket.dispatchEvent(evt); + } else { + console.warn("socket not found."); + } console.groupEnd(); }; From 0426ba8f10ab119ecccb8e996ef867c4f6c954ca Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 15 Aug 2024 00:12:40 +1000 Subject: [PATCH 179/206] update error messages. --- .../components/clientlibs/clientlibs-header/components.js | 3 +++ .../typerefinery/components/forms/form/clientlibs/functions.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js index 771601f3b..5e76ab021 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js @@ -167,8 +167,11 @@ window.Typerefinery.VueData = Typerefinery.VueData || {}; console.groupCollapsed("onDocumentReady for " + selector + " on " + pagePath); + console.log("initComponentBySelector", selector); ns.initComponentBySelector(selector, callbackFn); + console.log("observeDOMForSelector", selector); ns.observeDOMForSelector(selector, callbackFn); + console.log("onDocumentReady done"); console.groupEnd(); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index 6aed5e2a6..27a4774b7 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -499,7 +499,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; }; ns.addEventListener = ($component, componentConfig) => { - console.group('addEventListener'); + console.group('addEventListener form'); const { events, id } = componentConfig; const defaultTopic = id; From 2cc785a4a904a747d0105fc6c8f94eb469e381d8 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 15 Aug 2024 00:13:19 +1000 Subject: [PATCH 180/206] refactor embed message emit and add new actions. --- .../content/embed/clientlibs/functions.js | 290 ++++++++++++++---- .../content/embed/eventactions/.content.json | 17 +- .../dialog/tabs/event/.content.json | 9 + 3 files changed, 255 insertions(+), 61 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js index aec3aff26..c6250f61c 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js @@ -10,40 +10,37 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.selectorComponent = '[component=embed]'; + ns.ACTION_EVENT_PROXY = "EVENT_PROXY"; + ns.ACTION_DATA_REQUEST = "DATA_REQUEST"; + ns.ACTION_DATA_PAYLOAD = "DATA_PAYLOAD"; + ns.ACTION_DATA_SOURCE = "DATA_SOURCE"; + //actions supported by this component ns.ACTIONS = { - EVENT_PROXY: "EVENT_PROXY" + EVENT_PROXY: ns.ACTION_EVENT_PROXY, //send event to above component + DATA_REQUEST: ns.ACTION_DATA_REQUEST, //request data + DATA_PAYLOAD: ns.ACTION_DATA_PAYLOAD, //deliver data + DATA_SOURCE: ns.ACTION_DATA_SOURCE //change source for iframe } // map event types to handlers in component // this will indicate which events are supported by component ns.eventMap = eventNs.genericEventsTopicMap(); - ns.registerEvent = ($component, componentId, fieldName) => { - console.group("registerEvent"); - const key = `${componentId}-${fieldName}`; - console.log(["registerEvent", key]); - eventNs.registerEvents(key, (data) => { - console.group("registerEvents callback on " + window.location); - console.log(["registerEvents callback", key, data.type, data]); - if(data.type === eventNs.EVENTS.EVENT_PROXY) { - // get the first children and set the inner html. - const $firstChild = $component.children[0]; - console.log(["registerEvents callback EVENT_PROXY", $firstChild]); - const componentConfig = componentNs.getComponentConfig($component); - console.log(["registerEvents callback EVENT_PROXY", componentConfig, componentConfig.variant]); - if (componentConfig.variant === "iframe") { - console.log(["registerEvents callback EVENT_PROXY", componentConfig, componentConfig.variant, $component.find("iframe").attr("src"), data.data.value]); - $component.find("iframe").attr("src", data.data.value); - } - } - console.groupEnd(); - }); + // change src for iframe + ns.updateDataSource = ($component, config) => { + console.group("updateDataSource"); + console.log(["updateDataSource", $component, config]); + if (config.source) { + $component.find("iframe").attr("src", config.source); + } else { + console.error("no source was specified"); + } console.groupEnd(); } //send message to iframe - ns.sendMessageToiFrame = function($component, data) { + ns.sendMessageToiFrame = function($component, action, data) { console.group("sendMessageToiFrame on " + window.location); @@ -61,7 +58,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; // console.log(["sendMessageToiFrame", data]); var $iframe = $component.find("iframe"); var iframe = $iframe[0]; - console.log(["sendMessageToiFrame", sourceData, $iframe, iframe]); + console.log(["sendMessageToiFrame", action, sourceData, $iframe, iframe]); //if iframe does not have TypeRefinery then it will need to manage its own events iframe.contentWindow.postMessage(sourceData, "*"); //call events @@ -107,26 +104,78 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; // local actions ns.EVENT_PROXY = ($component, componentConfig, data) => { - console.group(ns.ACTIONS.EVENT_PROXY); - console.log([ns.ACTIONS.EVENT_PROXY, $component, componentConfig, data]); + console.group(ns.ACTION_EVENT_PROXY); + console.log([ns.ACTION_EVENT_PROXY, $component, componentConfig, data]); eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, data, eventNs.EVENTS.EVENT_PROXY, ns.ACTIONS.EVENT_PROXY); console.groupEnd(); } + ns.DATA_REQUEST = ($component, componentConfig, data) => { + console.group(ns.ACTION_DATA_REQUEST); + console.log([ns.ACTION_DATA_REQUEST, $component, componentConfig, data]); + + // get data - make a get request to the url + + // raise event - ns.ACTION_DATA_PAYLOAD + + + + //eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, data, eventNs.EVENTS.DATA_REQUEST, ns.ACTIONS.DATA_REQUEST); + console.groupEnd(); + } + + // ns.tmsConnected = async (host, topic, $component) => { + // try { + // if (!topic || !host) { + // ns.modelDataConnected($component); + // return; + // } + + // let componentConfig = componentNs.getComponentConfig($component); + // tmsNs.registerToTms(host, topic, componentConfig.resourcePath, (data) => ns.updateChartInstance(data, $component)); + // const componentData = localStorage.getItem(`${topic}`); + // if (!componentData) { + // ns.modelDataConnected($component); + // return; + // } + // ns.updateComponentHTML(JSON.parse(componentData), $component); + // } catch (error) { + // ns.modelDataConnected($component); + // } + // }; + + + // iframe has requested data + ns.handleDataRequest = ($component, componentConfig, event) => { + console.group("getData"); + console.log(["getData", $component, componentConfig, event]); + ns.DATA_REQUEST($component, componentConfig, event); + console.groupEnd(); + } - ns.handleEvent = ($component, eventName, data) => { - console.log(["update", $component, eventName, data]); + // decide which action to take based on action name + ns.handleEventAction = ($component, action, data) => { + console.log(["update", $component, action, data]); //load data into form - if (eventName === eventNs.EVENTS.EVENT_PROXY) { - ns.EVENT_PROXY($component, data); + if (action === ns.ACTION_EVENT_PROXY) { + //send message to iframe + ns.sendMessageToiFrame($component, action, data.payload); + // ns.EVENT_PROXY($component, data); + } else if (action === ns.ACTION_DATA_PAYLOAD) { + ns.sendMessageToiFrame($component, action, data.payload); + // ns.DATA_PAYLOAD($component, data); + } else if (action === ns.ACTION_DATA_REQUEST) { + ns.handleDataRequest($component, data); + } else if (action === ns.ACTION_DATA_SOURCE) { + // ns.DATA_REQUEST($component, data); + ns.updateDataSource($component, data); } else { - console.error(["unsupported action", eventName]); + console.error(["unsupported action", action]); } } - ns.addEventListener = ($component, componentConfig) => { - console.group('addEventListener'); + console.group('addEventListener embed'); const { events, id } = componentConfig; const defaultTopic = id; @@ -136,6 +185,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; //register events if (events) { events.forEach(event => { + console.groupCollapsed("event"); console.log(["event", event]); const { topic, type, name, nameCustom, action, config} = event; //if topic not set use component id as topic @@ -149,7 +199,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; // if action is EVENT_PROXY // if action is EVENT_PROXY then add the event to registry - if (action === ns.ACTIONS.EVENT_PROXY) { + // does ns.ACTIONS have this action + if (ns.ACTIONS[action]) { console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap), topicName, typeName, action, eventName]); eventNs.registerEventActionMapping(ns.eventMap, id, topicName, typeName, action, eventName, config); @@ -157,20 +208,47 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; // if event type is listen then add event listener for the event if (typeName === eventNs.EVENT_TYPE_EMIT) { - console.log(["add windowListeneriFrameEventProxy for this component", eventName, id]); + //NOTE: this is the event that will be raised by iFrame + // iframe will raise events and this component will emit them + + // if action is EVENT_PROXY then add event listener for the event + //listen for global message events that are emited by iframe + + //TODO: handle all different actions in windowListeneriFrameEvent + if (action === ns.ACTION_EVENT_PROXY) { + console.log(["add windowListeneriFrameEvent for this component", action, id]); //listen for global message events that are emited by iframe - ns.windowListeneriFrameEventProxy($component, componentConfig, eventName, action, id, config); + ns.addEventEmitter($component, componentConfig, topicName, eventName, action, (data) => { + console.log(["windowListeneriFrameEvent callback", topicName, eventName, action, data]); + // proxy all events + console.log(["EVENT_PROXY", $component, componentConfig, data]); + ns.EVENT_PROXY($component, componentConfig, data); + }); + } else if (action === ns.ACTION_DATA_REQUEST) { + console.log(["add windowListeneriFrameEvent for this component", action, id]); + //listen for global message events that are emited by iframe + ns.addEventEmitter($component, componentConfig, topicName, eventName, action, (data) => { + console.log(["windowListeneriFrameEvent callback", topicName, eventName, action, data]); + console.log(["DATA_REQUEST", $component, componentConfig, data]); + ns.DATA_REQUEST($component, componentConfig, data); + }); + } } else { //listen register the event and listent for specific event on topic console.log(["registerEvents", topicName, eventName]); - eventNs.registerEvents(topicName, (data) => { + + if (eventName === eventNs.EVENTS.EVENT_TOPIC_PAYLOAD) { + //register with TMS + console.warn("register with TMS, not implemented"); + } else { + eventNs.registerEvents(topicName, (data) => { console.log(["registerEvents callback", topicName, eventName, data]); // check make sure the event is for this event if (data.type === eventName) { - //send message to iframe - ns.sendMessageToiFrame($component, data.payload); + ns.handleEventAction($component, action, data); } - }); + }); + } //need to reach into the frame and register message event //this will ensure that only messages from this frame are listened //windowListener @@ -179,6 +257,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.error(["unsupported action", action]); } + console.log(["addEventListener done"]); + console.groupEnd(); }); } @@ -212,41 +292,121 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } + //all the callbacks for events, these are the actions to be taken when event is raised + ns.windowListeneriFrameEventCallBacks = {}; + ns.addEventEmitter = function($component, componentConfig, topicName, eventName, action, callbackFn) { + console.groupCollapsed(`embed addEmitter for ${topicName},${eventName},${action}, on ${window.location}`); + console.log(["addEmitter", topicName, eventName, action, callbackFn]); + + const { id } = componentConfig; + const callbackId = `${id}-${topicName}-${eventName}-${action}`; + + ns.windowListeneriFrameEventCallBacks[callbackId] = { + $component: $component, + componentConfig: componentConfig, + topicName: topicName, + eventName: eventName, + action: action, + callbackFn: callbackFn + } + console.log(["windowListeneriFrameEventCallBacks", ns.windowListeneriFrameEventCallBacks]); + ns.bindWindowListeneriFrameEvent($component); + console.groupEnd(); + } + + ns.windowListeneriFrameEventBound = false; + ns.bindWindowListeneriFrameEvent = function($component) { + console.groupCollapsed("bindWindowListeneriFrameEvent"); + console.log(["bindWindowListeneriFrameEvent", ns.windowListeneriFrameEventBound]); + if (ns.windowListeneriFrameEventBound) { + console.groupEnd(); + return; + } + ns.windowListeneriFrameEvent($component); + ns.windowListeneriFrameEventBound = true; + console.log(["bindWindowListeneriFrameEvent", ns.windowListeneriFrameEventBound]); + console.groupEnd(); + } + + ns.processWindowListenerEvent = function($component, event, sourceData) { + console.groupCollapsed("processWindowListenerEvent"); + console.log(["processWindowListenerEvent", $component, event, sourceData]); + const eventType = sourceData.type; + const eventAction = sourceData.action; + console.log(["eventType", eventType]); + console.log(["eventAction", eventAction]); + console.log(["sourceData", sourceData]); + const countofCallbacks = Object.keys(ns.windowListeneriFrameEventCallBacks).length; + console.log(`find matching callbacks for event ${eventAction}:${eventType} in ${countofCallbacks} callbacks`); + + //check if this event is for this component + for (const key in ns.windowListeneriFrameEventCallBacks) { + if (ns.windowListeneriFrameEventCallBacks.hasOwnProperty(key)) { + const callBack = ns.windowListeneriFrameEventCallBacks[key]; + const callBackAction = callBack.action; //action component supports + const callBackTopicName = callBack.topicName; //topic name, should match event type + // const eventName = callBack.eventName; //named or custom event name + console.groupCollapsed(`callBack action ${callBackAction}:${callBackTopicName}`); + console.log(["callBack", callBack]); + // console.log(["eventName", eventName]); + const isProxyEvent = (callBackAction === ns.ACTION_EVENT_PROXY); + const isActionMatch = (callBackAction === eventAction); + const isTopicMatch = (callBackTopicName === eventType); + if (isProxyEvent) { + console.warn(["isProxyEvent", isProxyEvent]); + } else { + console.log(["isProxyEvent", isProxyEvent]); + } + if (isActionMatch) { + console.warn(["isActionMatch", isActionMatch]); + } else { + console.log(["isActionMatch", isActionMatch]); + } + if (isTopicMatch) { + console.warn(["isTopicMatch", isTopicMatch]); + } else { + console.log(["isTopicMatch", isTopicMatch]); + } + if (isProxyEvent || (isActionMatch && isTopicMatch)) { + console.log(["call", callBack]); + callBack.callbackFn(sourceData); + } else { + console.warn("no match"); + } + console.groupEnd(); + } + } + console.groupEnd(); + }; + /* listen for window post messages sent by iframe to this component */ - ns.windowListeneriFrameEventProxy = function($component, componentConfig, eventName, action, id, config) { + ns.windowListeneriFrameEvent = function($component) { const iFrameContentWindow = $component.find("iframe")[0].contentWindow; - console.log(["windowListeneriFrameEventProxy", iFrameContentWindow]); + console.log(["windowListeneriFrameEvent", iFrameContentWindow]); + + //listen for global message events that are emited by iframe window.addEventListener('message', function(event) { - console.groupCollapsed('embed windowListeneriFrameEventProxy on ' + window.location); - console.log(["event", event, event.source == iFrameContentWindow, eventName, action, id, config, event.data]); + console.groupCollapsed(`embed windowListeneriFrameEvent on ${window.location}`); if (event.source == iFrameContentWindow) { + //this message is from component iframe console.log(["event", event]); var eventData = event.data; var sourceWindow = event.source; var sourceOrigin = event.origin; console.log(["sourceWindow", sourceWindow, "sourceOrigin", sourceOrigin, "eventData", eventData]); - var sourceData; - if (eventData) { - if (typeof eventData === 'string') { - sourceData = JSON.parse( eventData ); - } - sourceData = eventData; + var sourceData = eventData; + if (typeof eventData === 'string') { + sourceData = JSON.parse( eventData ); } - - console.log(["sourceData", sourceData]); - + if (sourceData) { - //const eventPayloadData = eventNs.compileEventData(sourceData, eventName, action, id, config); - - //console.log(["eventPayloadData", eventPayloadData]); - - //emit the event - ns.EVENT_PROXY($component, componentConfig, sourceData); + console.log(["sourceData", sourceData]); + ns.processWindowListenerEvent($component, event, sourceData); } } else { - console.warn("source not matched"); + console.warn("event.source does not match component iframe, ignoring"); } console.groupEnd(); }); @@ -263,6 +423,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; //run events for this component when it loads ns.autoLoad($component); + console.log(["addEventListener"]); // add event listener that have been configured for this component ns.addEventListener($component, componentConfig); @@ -270,4 +431,13 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.groupEnd(); } } -)(jQuery, Typerefinery.Components.Content.Embed, Typerefinery.Components, Typerefinery.Page.Events, document, window); +)( + // @ts-ignore + window.jQuery, + Typerefinery.Components.Content.Embed, + Typerefinery.Components, + Typerefinery.Page.Events, + document, + window +); + diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/eventactions/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/eventactions/.content.json index 33d51d155..4df09fa2f 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/eventactions/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/eventactions/.content.json @@ -1,8 +1,23 @@ { "sling:resourceType": "nt:unstructured", - "buttonclick": { + "eventproxy": { "sling:resourceType": "nt:unstructured", "key": "EVENT_PROXY", "value": "Event Proxy" + }, + "datarequest": { + "sling:resourceType": "nt:unstructured", + "key": "DATA_REQUEST", + "value": "Data Request" + }, + "datapayload": { + "sling:resourceType": "nt:unstructured", + "key": "DATA_PAYLOAD", + "value": "Data Payload" + }, + "datasource": { + "sling:resourceType": "nt:unstructured", + "key": "DATA_SOURCE", + "value": "Data Source" } } \ No newline at end of file diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json index 0ff933a4e..6ac384a0d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json @@ -70,6 +70,15 @@ "value": "" } }, + "topic": { + "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", + "label": "Topic", + "create": { + "sling:resourceType": "typerefinery/components/dialog/select/selectitem", + "label": "Payload", + "value": "topicpayload" + } + }, "componentcrud": { "sling:resourceType": "typerefinery/components/dialog/select/selectgroup", "label": "Component", From 1b20fadf1f78a7b5d38767ea60cd4e583133b352 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 16 Aug 2024 01:49:51 +1000 Subject: [PATCH 181/206] add debug. --- .../structure/page/clientlibs-header/tms/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js index 6cd663d56..11d16543e 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/tms/functions.js @@ -96,7 +96,7 @@ window.MessageService.Client = MessageService.Client || {}; console.log(["tms message save to local storage", messageTopic]); // TODO: get host from the message. const host = Object.entries(ns.registry)[0]; - console.log(["tms message host", host]); + console.log(["tms message host", host, ns.registry]); // first idx[key, values]. if (host) { // grab the topic from the host. From aeb8e2c46eba10a13e4cf99a11d933889e0f5427 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 16 Aug 2024 01:50:10 +1000 Subject: [PATCH 182/206] add config for intellisence. --- globals.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 globals.d.ts diff --git a/globals.d.ts b/globals.d.ts new file mode 100644 index 000000000..b9d4fbd44 --- /dev/null +++ b/globals.d.ts @@ -0,0 +1,12 @@ +//NOTE: this file is used to declare global types and interfaces to +// allow TW to recognize them in conmponent JS files in application/backend + +interface Components { +} +interface Typerefinery { + Components: Components; +} + +interface Window { + Typerefinery: Typerefinery; +} From 29c96380f7e9fe4f502db76c03b92feb953469d0 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 16 Aug 2024 01:58:16 +1000 Subject: [PATCH 183/206] add hint. --- .../components/widgets/ticker/clientlibs/functions.js | 1 + 1 file changed, 1 insertion(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/functions.js index 93f461b0e..50b5cf0d1 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/widgets/ticker/clientlibs/functions.js @@ -56,6 +56,7 @@ window.Typerefinery.Page.Tms = Typerefinery.Page.Tms || {}; </div> `; + //TODO: add Handlebars to namesapce signature const handlebarTemplate = Handlebars.compile(htmlTemplate); // merge all the objects. $component.innerHTML = handlebarTemplate({ ...defaultData, ...defaultConfigData, ...data }); From 0904487325414d92869a76863456c61f618a1c7f Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 16 Aug 2024 01:58:57 +1000 Subject: [PATCH 184/206] add ability to get data for iframe with events and though tms. --- .../content/embed/clientlibs/functions.js | 222 +++++++++++++----- 1 file changed, 166 insertions(+), 56 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js index c6250f61c..42da8cd83 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js @@ -1,3 +1,4 @@ +// @ts-check window.Typerefinery = window.Typerefinery || {}; Typerefinery.Components = Typerefinery.Components || {}; Typerefinery.Components.Content = Typerefinery.Components.Content || {}; @@ -5,7 +6,7 @@ Typerefinery.Components.Content.Embed = Typerefinery.Components.Content.Embed || Typerefinery.Page = Typerefinery.Page || {}; Typerefinery.Page.Events = Typerefinery.Page.Events || {}; -(function ($, ns, componentNs, eventNs, document, window) { +(function ($, ns, componentNs, eventNs, tmsNs, document, window) { "use strict"; ns.selectorComponent = '[component=embed]'; @@ -62,9 +63,14 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; //if iframe does not have TypeRefinery then it will need to manage its own events iframe.contentWindow.postMessage(sourceData, "*"); //call events - if (iframe.contentWindow.Typerefinery.Page.Events) { - const topic = sourceData.type; - iframe.contentWindow.Typerefinery.Page.Events.emitEvent(topic, sourceData); + //TODO: this will trigger CORS issue + try { + if (iframe.contentWindow.Typerefinery.Page.Events) { + const topic = sourceData.type; + iframe.contentWindow.Typerefinery.Page.Events.emitEvent(topic, sourceData); + } + } catch (error) { + console.error("sendMessageToiFrame", error); } console.groupEnd(); } @@ -110,67 +116,153 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.groupEnd(); } - ns.DATA_REQUEST = ($component, componentConfig, data) => { - console.group(ns.ACTION_DATA_REQUEST); - console.log([ns.ACTION_DATA_REQUEST, $component, componentConfig, data]); - - // get data - make a get request to the url + ns.DATA_PAYLOAD = ($component, topic, data, doNotSave) => { + console.group(ns.ACTION_DATA_PAYLOAD); + console.log([ns.ACTION_DATA_PAYLOAD, $component, topic, data, doNotSave]); - // raise event - ns.ACTION_DATA_PAYLOAD - - + if (ns.useLocalStorage && !doNotSave) { + console.log("save data to local storage"); + //save data to local storage to load nexr time + localStorage.setItem(`${topic}`, JSON.stringify(data)); + } + + console.log("send data to iframe"); + //TODO: send data to iframe + ns.sendMessageToiFrame($component, ns.ACTION_DATA_PAYLOAD, data); + console.log("data sent to iframe"); + console.groupEnd(); + } + ns.DATA_REQUEST = ($component, componentConfig, eventData, url) => { + console.group(ns.ACTION_DATA_REQUEST); + console.log([ns.ACTION_DATA_REQUEST, $component, componentConfig, url]); + console.log(["getRequest", url]); + //TODO: get data - make a get request to the url + ns.getRequest($component, eventData, url, ($component, data) => { + console.log(["getData success", $component, data]); + // raise event - ns.ACTION_DATA_PAYLOAD + ns.sendMessageToiFrame($component, ns.ACTION_DATA_PAYLOAD, data); + return data; + }, ($component, data) => { + console.log(["getData error", $component, data]); + return data; + }); + console.log(["DATA_REQUEST initiated", $component, componentConfig, url]); //eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, data, eventNs.EVENTS.DATA_REQUEST, ns.ACTIONS.DATA_REQUEST); console.groupEnd(); } - // ns.tmsConnected = async (host, topic, $component) => { - // try { - // if (!topic || !host) { - // ns.modelDataConnected($component); - // return; - // } - - // let componentConfig = componentNs.getComponentConfig($component); - // tmsNs.registerToTms(host, topic, componentConfig.resourcePath, (data) => ns.updateChartInstance(data, $component)); - // const componentData = localStorage.getItem(`${topic}`); - // if (!componentData) { - // ns.modelDataConnected($component); - // return; - // } - // ns.updateComponentHTML(JSON.parse(componentData), $component); - // } catch (error) { - // ns.modelDataConnected($component); - // } - // }; - - - // iframe has requested data - ns.handleDataRequest = ($component, componentConfig, event) => { - console.group("getData"); - console.log(["getData", $component, componentConfig, event]); - ns.DATA_REQUEST($component, componentConfig, event); + // json form post + ns.getRequest = async ($component, eventData, url, successCallbackFn, errorCallbackFn, requestMethod, responseContentType) => { + const contentType = responseContentType || "application/json"; + const method = requestMethod || "GET"; + const responseData = await ns.fetch( + $component, + url, + method, + contentType, + eventData, + null, + successCallbackFn, + errorCallbackFn, + ); + return responseData; + }; + + // send the request to the server + ns.fetch = async ($component, url, method, contentType, eventData, body, successCallback = ($component, data) => { }, errorCallback = ($component, data) => { }) => { + console.group(["fetch", url, method, contentType, body]); + console.log([url, method, contentType, body]) + let controller = new AbortController(); + try { + await window.fetch(url, { + method: method || 'GET', + headers: { + 'Content-Type': contentType || 'application/x-www-form-urlencoded' + }, + body: body, + keepalive: true, + redirect: 'follow', + signal: controller.signal + }) + .then(response => response.json()) + .then(response => { + console.group("fetch response"); + successCallback($component, { + ...eventData, + url: url, + method: method, + payloadType: contentType, + body: body, + ok: true, + response: response, + }) + console.groupEnd(); + }); + + } catch (error) { + console.group("Error in submitting the request"); + console.error(error); + errorCallback($component, { + ...eventData, + url: url, + method: method, + payloadType: contentType, + body: body, + error: error, + }); + console.groupEnd(); + } + controller = null; + console.groupEnd(); + return; + }; + + + //listen for data from TMS and run callback + ns.useLocalStorage = false; + ns.tmsConnected = function ($component, host, topic, callbackFn) { + console.group(`tmsConnected ${host} ${topic} on ${window.location}`); + try { + let componentConfig = componentNs.getComponentConfig($component); + tmsNs.registerToTms(host, topic, componentConfig.resourcePath, callbackFn); + if (ns.useLocalStorage) { + const componentData = localStorage.getItem(`${topic}`); + if (!componentData) { + console.warn("no data found in local storage"); + } else { + callbackFn(JSON.parse(componentData)); + } + } + } catch (error) { + console.error("tmsConnected", host, topic, error); + } console.groupEnd(); - } + }; + + // // iframe has requested data + // ns.handleDataRequest = ($component, componentConfig, event) => { + // console.group("handleDataRequest getData"); + // console.log(["handleDataRequest getData", $component, componentConfig, event]); + // ns.DATA_REQUEST($component, componentConfig, event); + // console.groupEnd(); + // } // decide which action to take based on action name ns.handleEventAction = ($component, action, data) => { - console.log(["update", $component, action, data]); + console.log(["handleEventAction", $component, action, data]); //load data into form if (action === ns.ACTION_EVENT_PROXY) { //send message to iframe ns.sendMessageToiFrame($component, action, data.payload); - // ns.EVENT_PROXY($component, data); } else if (action === ns.ACTION_DATA_PAYLOAD) { ns.sendMessageToiFrame($component, action, data.payload); - // ns.DATA_PAYLOAD($component, data); - } else if (action === ns.ACTION_DATA_REQUEST) { - ns.handleDataRequest($component, data); + // } else if (action === ns.ACTION_DATA_REQUEST) { + // ns.handleDataRequest($component, data); } else if (action === ns.ACTION_DATA_SOURCE) { - // ns.DATA_REQUEST($component, data); ns.updateDataSource($component, data); } else { - console.error(["unsupported action", action]); + console.error(["handleEventAction unsupported action", action]); } } @@ -185,8 +277,6 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; //register events if (events) { events.forEach(event => { - console.groupCollapsed("event"); - console.log(["event", event]); const { topic, type, name, nameCustom, action, config} = event; //if topic not set use component id as topic const topicName = topic || defaultTopic; @@ -196,6 +286,9 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; //custom name takes precidence over name, this will be raised as event name let eventName = nameCustom || name; + console.groupCollapsed(`event ${typeName} - ${action}:${topic} [${config}]`); + console.log(["event", event]); + // if action is EVENT_PROXY // if action is EVENT_PROXY then add the event to registry @@ -211,10 +304,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; //NOTE: this is the event that will be raised by iFrame // iframe will raise events and this component will emit them - // if action is EVENT_PROXY then add event listener for the event - //listen for global message events that are emited by iframe - - //TODO: handle all different actions in windowListeneriFrameEvent + //TODO: add new event to allow sending data to tms + //NOTE: handle all different actions in windowListeneriFrameEvent if (action === ns.ACTION_EVENT_PROXY) { console.log(["add windowListeneriFrameEvent for this component", action, id]); //listen for global message events that are emited by iframe @@ -229,8 +320,16 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; //listen for global message events that are emited by iframe ns.addEventEmitter($component, componentConfig, topicName, eventName, action, (data) => { console.log(["windowListeneriFrameEvent callback", topicName, eventName, action, data]); - console.log(["DATA_REQUEST", $component, componentConfig, data]); - ns.DATA_REQUEST($component, componentConfig, data); + console.log(["DATA_REQUEST", $component, componentConfig, config]); + const eventData = { + ...data, + topicName: topicName, + eventName: eventName, + action: action, + url: config + } + eventData.target = "iframe-" + id; + ns.DATA_REQUEST($component, componentConfig, eventData, config); }); } } else { @@ -238,8 +337,18 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log(["registerEvents", topicName, eventName]); if (eventName === eventNs.EVENTS.EVENT_TOPIC_PAYLOAD) { - //register with TMS - console.warn("register with TMS, not implemented"); + + //if config is string then use it as host + const host = (typeof config === 'string' ? (config ? config : false) : (typeof config === 'object' ? config.host : false)) || "ws://localhost:8112/$tms"; + console.log(["register with TMS", host, topicName]); + + ns.tmsConnected($component, host, topicName, (data) => { + console.log(["tms data callback", topicName, eventName, data]); + // check make sure the event is for this event + // ns.handleEventAction($component, action, data); + ns.DATA_PAYLOAD($component, topicName, data); + }); + //console.warn("register with TMS, not implemented"); } else { eventNs.registerEvents(topicName, (data) => { console.log(["registerEvents callback", topicName, eventName, data]); @@ -437,6 +546,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; Typerefinery.Components.Content.Embed, Typerefinery.Components, Typerefinery.Page.Events, + Typerefinery.Page.Tms, document, window ); From 55f53d2379d020fafaf1b8b6b76628890e94dd62 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Fri, 16 Aug 2024 02:32:17 +1000 Subject: [PATCH 185/206] update to use event data as payload. --- .../content/embed/clientlibs/functions.js | 44 ++++++++++++------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js index 42da8cd83..35e94bca9 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js @@ -62,6 +62,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log(["sendMessageToiFrame", action, sourceData, $iframe, iframe]); //if iframe does not have TypeRefinery then it will need to manage its own events iframe.contentWindow.postMessage(sourceData, "*"); + + //call events //TODO: this will trigger CORS issue try { @@ -116,19 +118,21 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.groupEnd(); } - ns.DATA_PAYLOAD = ($component, topic, data, doNotSave) => { + ns.DATA_PAYLOAD = ($component, eventData, doNotSave) => { console.group(ns.ACTION_DATA_PAYLOAD); - console.log([ns.ACTION_DATA_PAYLOAD, $component, topic, data, doNotSave]); + console.log([ns.ACTION_DATA_PAYLOAD, $component, eventData, doNotSave]); - if (ns.useLocalStorage && !doNotSave) { - console.log("save data to local storage"); - //save data to local storage to load nexr time - localStorage.setItem(`${topic}`, JSON.stringify(data)); - } + //TODO: save data to local storage + // if (ns.useLocalStorage && !doNotSave) { + // const { topic, data } = eventData; + // console.log("save data to local storage"); + // //save data to local storage to load nexr time + // localStorage.setItem(`${topic}`, JSON.stringify(data)); + // } console.log("send data to iframe"); //TODO: send data to iframe - ns.sendMessageToiFrame($component, ns.ACTION_DATA_PAYLOAD, data); + ns.sendMessageToiFrame($component, ns.ACTION_DATA_PAYLOAD, eventData); console.log("data sent to iframe"); console.groupEnd(); } @@ -138,11 +142,12 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log([ns.ACTION_DATA_REQUEST, $component, componentConfig, url]); console.log(["getRequest", url]); //TODO: get data - make a get request to the url - ns.getRequest($component, eventData, url, ($component, data) => { - console.log(["getData success", $component, data]); + ns.getRequest($component, eventData, url, ($component, eventData) => { + console.log(["getData success", $component, eventData]); // raise event - ns.ACTION_DATA_PAYLOAD - ns.sendMessageToiFrame($component, ns.ACTION_DATA_PAYLOAD, data); - return data; + ns.sendMessageToiFrame($component, ns.ACTION_DATA_PAYLOAD, eventData); + console.log(["getData done"]); + return eventData; }, ($component, data) => { console.log(["getData error", $component, data]); return data; @@ -186,7 +191,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; signal: controller.signal }) .then(response => response.json()) - .then(response => { + .then(responseJson => { console.group("fetch response"); successCallback($component, { ...eventData, @@ -195,7 +200,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; payloadType: contentType, body: body, ok: true, - response: response, + data: responseJson, }) console.groupEnd(); }); @@ -343,10 +348,19 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log(["register with TMS", host, topicName]); ns.tmsConnected($component, host, topicName, (data) => { + const eventData = { + topicName: topicName, + eventName: eventName, + action: action, + url: config, + data: data, + target: "iframe-" + id, + source: host + } console.log(["tms data callback", topicName, eventName, data]); // check make sure the event is for this event // ns.handleEventAction($component, action, data); - ns.DATA_PAYLOAD($component, topicName, data); + ns.DATA_PAYLOAD($component, eventData); }); //console.warn("register with TMS, not implemented"); } else { From 7c5779aae45ec9de8f1f3426f0d9e02ff2b9a010 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Sun, 8 Sep 2024 21:46:55 +1000 Subject: [PATCH 186/206] update to allow data request api to use config as json. --- .../content/embed/clientlibs/functions.js | 59 ++++++++++++++----- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js index 35e94bca9..f82431708 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js @@ -137,21 +137,39 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.groupEnd(); } - ns.DATA_REQUEST = ($component, componentConfig, eventData, url) => { + /** + * Get data from endpoint + * @param {*} $component component instance + * @param {*} componentConfig component configuration + * @param {*} eventData event data + * @param {*} endpointConfig endpoint configuration to make request, needs to have at least url + */ + ns.DATA_REQUEST = ($component, componentConfig, eventData, endpointConfig) => { console.group(ns.ACTION_DATA_REQUEST); - console.log([ns.ACTION_DATA_REQUEST, $component, componentConfig, url]); - console.log(["getRequest", url]); + console.log([ns.ACTION_DATA_REQUEST, $component, componentConfig, endpointConfig]); + console.log(["getRequest", endpointConfig]); //TODO: get data - make a get request to the url - ns.getRequest($component, eventData, url, ($component, eventData) => { - console.log(["getData success", $component, eventData]); - // raise event - ns.ACTION_DATA_PAYLOAD - ns.sendMessageToiFrame($component, ns.ACTION_DATA_PAYLOAD, eventData); - console.log(["getData done"]); - return eventData; - }, ($component, data) => { - console.log(["getData error", $component, data]); - return data; - }); + let url = endpointConfig.url; + let requestMethod = endpointConfig.method || "GET"; + let responseContentType = endpointConfig.responseContentType || "application/json"; + ns.getRequest( + $component, + eventData, + url, + ($component, eventData) => { + console.log(["getData success", $component, eventData]); + // raise event - ns.ACTION_DATA_PAYLOAD + ns.sendMessageToiFrame($component, ns.ACTION_DATA_PAYLOAD, eventData); + console.log(["getData done"]); + return eventData; + }, + ($component, data) => { + console.log(["getData error", $component, data]); + return data; + }, + requestMethod, + responseContentType + ); console.log(["DATA_REQUEST initiated", $component, componentConfig, url]); //eventNs.emitLocalEvent($component, componentConfig, ns.eventMap, data, eventNs.EVENTS.DATA_REQUEST, ns.ACTIONS.DATA_REQUEST); console.groupEnd(); @@ -326,15 +344,26 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.addEventEmitter($component, componentConfig, topicName, eventName, action, (data) => { console.log(["windowListeneriFrameEvent callback", topicName, eventName, action, data]); console.log(["DATA_REQUEST", $component, componentConfig, config]); + + let endpointConfig = {}; + try { + const test = JSON.parse(config); + endpointConfig = test; + } catch (error) { + endpointConfig.url = config; + } + const eventData = { ...data, topicName: topicName, eventName: eventName, action: action, - url: config + endpointConfig: endpointConfig } eventData.target = "iframe-" + id; - ns.DATA_REQUEST($component, componentConfig, eventData, config); + //check if config is possible JSON string + + ns.DATA_REQUEST($component, componentConfig, eventData, endpointConfig); }); } } else { From b7fe0062eeb288c18e892b5b92e468908cbac8b9 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Sun, 8 Sep 2024 21:47:28 +1000 Subject: [PATCH 187/206] add edit mode css token. --- .../typerefinery/components/structure/page/head.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/head.html b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/head.html index 3e9a71e17..02976fd97 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/head.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/head.html @@ -30,6 +30,16 @@ <meta data-sly-test.ogUrl="${properties.ogUrl}" name="og:url" content="${ogUrl}" /> <meta data-sly-test.ogDescription="${properties.ogDescription}" name="og:description" content="${ogDescription}" /> <meta data-sly-test.ogTitle="${properties.ogTitle}" name="og:title" content="${ogTitle}"> + + <sly data-sly-test="${wcmmode.isEdit}"> + <!-- Set custom media query for edit mode --> + <style> + :root { + --is-edit-mode: true; + } + </style> + </sly> + <!-- <link href="/libs/howlite/web_root/main.css" rel="stylesheet" type="text/css"> --> <!-- <link data-sly-test="${wcmmode.isEdit}" href="/libs/howlite/author/author.css" rel="stylesheet" type="text/css"> --> <sly data-sly-include="head-libs.html"></sly> From 7395b59b6b2ab222cf585f764126a76b958f6eab Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Sun, 8 Sep 2024 21:47:52 +1000 Subject: [PATCH 188/206] stop aside growth in edit more. --- .../layout/aside/clientlibs/style.css | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/aside/clientlibs/style.css b/application/backend/src/main/resources/apps/typerefinery/components/layout/aside/clientlibs/style.css index fe57a2ef7..0cd79d8db 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/aside/clientlibs/style.css +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/aside/clientlibs/style.css @@ -29,3 +29,20 @@ width: 15%; } +/* disable all resizing features to allow authoring ui to work */ +@container style(--is-edit-mode) { + [component="aside"] { + height: 250px; + min-height: auto !important; + } + + [component="aside"] .aside { + height: 250px; + min-height: auto !important; + } + + [component="aside"] ._aside_container_ { + height: 250px; + min-height: auto !important; + } +} \ No newline at end of file From 3ad4b90ce62898ba360b08683368c1166f4974d8 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Sun, 8 Sep 2024 21:48:09 +1000 Subject: [PATCH 189/206] move header above asides. --- .../templates/pagewithsidebar/initial/.content.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/templates/pagewithsidebar/initial/.content.json b/application/backend/src/main/resources/apps/typerefinery/templates/pagewithsidebar/initial/.content.json index f8276b069..5e73915ab 100644 --- a/application/backend/src/main/resources/apps/typerefinery/templates/pagewithsidebar/initial/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/templates/pagewithsidebar/initial/.content.json @@ -6,15 +6,15 @@ "rootcontainer": { "sling:resourceType": "typerefinery/components/layout/rootcontainer", "jcr:primaryType": "nt:unstructured", + "header": { + "sling:resourceType": "typerefinery/components/layout/header", + "jcr:primaryType": "nt:unstructured" + }, "asideleft": { "sling:resourceType": "typerefinery/components/layout/aside", "jcr:primaryType": "nt:unstructured", "classes": "aside-left" }, - "header": { - "sling:resourceType": "typerefinery/components/layout/header", - "jcr:primaryType": "nt:unstructured" - }, "main": { "sling:resourceType": "typerefinery/components/layout/container", "jcr:primaryType": "nt:unstructured", From 2bc5d20ab394a9db529afc465570526b7060cf2c Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 9 Sep 2024 16:24:03 +1000 Subject: [PATCH 190/206] add logging. --- .../page/clientlibs-header/events/functions.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js index 95f5fa181..7d18fd3d8 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js @@ -126,7 +126,11 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.group('emitEvent'); console.log(["topic", topic, "payload", payload]); const evt = document.createEvent(ns.CUSTOM_EVENT_NAME); - evt.initCustomEvent(ns.CUSTOM_EVENT_NAME, false, false, { topic, payload }); + if (evt.initCustomEvent) { + evt.initCustomEvent(ns.CUSTOM_EVENT_NAME, false, false, { topic, payload }); + } else { + console.error("initCustomEvent not found on custom event."); + } if (ns.socket && ns.socket.dispatchEvent) { ns.socket.dispatchEvent(evt); } else { @@ -204,7 +208,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } } const { topic, payload } = detail; - console.log(["topic", topic, "payload", payload]); + console.log(["topic", topic, "payload", payload, ns.registry]); if (ns.registry[topic]) { console.log("topic found", topic); ns.registry[topic].forEach((callbackFn) => { @@ -272,6 +276,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log("emit event for topic", topic); const eventData = ns.compileEventData(payload, actionComponent, componentAction, id, config); ns.emitEvent(topic, eventData); + console.log("event emitted", topic, eventData); }); } else { //is single value use it as topic @@ -280,6 +285,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log("emit event for topic", topic); const eventData = ns.compileEventData(payload, actionComponent, componentAction, id, config); ns.emitEvent(topic, eventData); + console.log("event emitted", topic, eventData); } } }); From aff91e651402145ac13fcb8a2442465fed5849d8 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 9 Sep 2024 16:24:48 +1000 Subject: [PATCH 191/206] update form event register. --- .../forms/form/clientlibs/functions.js | 43 ++++++++++++++++--- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index 27a4774b7..f96c47e53 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -19,6 +19,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; //actions supported by this component ns.ACTIONS = { + FORM_LOAD: "FORM_LOAD", FORM_SUBMIT: "FORM_SUBMIT", FORM_SUCCESS: "FORM_SUCCESS", FORM_ERROR: "FORM_ERROR", @@ -510,11 +511,26 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; if (events) { events.forEach(event => { const { topic, type, name, nameCustom, action, config} = event; + + //if type unset then log warning + if (!type) { + console.warn("type is unset for event will default to emit", event); + } + + // if topic is not set then log warning + if (!topic) { + console.warn("topic is unset for event will default to component id", event); + } + + // if nameCustom is not set then log warning + if (!nameCustom) { + console.warn("nameCustom is unset for event will default to name", event); + } + //if topic not set use component id as topic const topicName = topic || defaultTopic; // if type is not defined then its emitted let typeName = type || eventNs.EVENT_TYPE_EMIT; - //custom name takes precidence over name, this will be raised as event name let eventName = nameCustom || name; @@ -526,13 +542,16 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; if (typeName === eventNs.EVENT_TYPE_EMIT) { //emit do nothing here + console.info("event type is emit, do nothing"); } else { //listen register the event and listent for specific event on topic console.log(["registerEvents", topicName, eventName]); eventNs.registerEvents(topicName, (data) => { + console.log(["registerEvents consumeIncomingEvent", data, eventName]); // check make sure the event is for this event if (data.type === eventName) { - ns.update($component, data.type, data.data); + console.log(["registerEvents match calling update", action, data]); + ns.update($component, action, data); } }); } @@ -596,13 +615,23 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; console.groupEnd(); } - ns.update = ($component, eventName, data) => { - console.log(["update", $component, eventName, data]); - //load data into form - if (eventName === eventNs.EVENTS.EVENT_READ_ACTION) { + /** + * + * @param {*} $component + * @param {*} actionName can be either global action name or component action name + * @param {*} data + */ + ns.update = ($component, actionName, data) => { + console.log(["form update", $component, actionName, data]); + //load data into form if action is FORM_LOAD or EVENT_READ_ACTION + if (ns.ACTIONS[actionName] == "FORM_LOAD" || actionName === eventNs.EVENTS.EVENT_READ_ACTION) { ns.loadData($component, data); + } else if (ns.ACTIONS[actionName] == "FORM_SUBMIT" || actionName == eventNs.EVENTS.EVENT_SUBMIT_ACTION) { + //submit form if action is FORM_SUBMIT or EVENT_SUBMIT_ACTION + ns.formSubmitHandler($component); } else { - console.error(["unsupported action", eventName]); + //log error if action is not supported + console.error(["unsupported action", actionName]); } } From eaca945ffc347b8ed02be014348ac1862f760a56 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 9 Sep 2024 16:59:34 +1000 Subject: [PATCH 192/206] update logging. --- .../components/forms/fields/select/clientlibs/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js index 2a796d10b..fbbdd2477 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/select/clientlibs/functions.js @@ -64,7 +64,7 @@ window.Typerefinery.Components.Forms.Select.Instances = Typerefinery.Components. }; ns.addOptionsToSelect = ($component, defaultSelectedOptions, optionsList, keyName, labelName) => { - console.log('options from data source', optionsList); + console.log('options from data source', optionsList, defaultSelectedOptions, keyName, labelName); if(optionsList.length !== 0) { const selectOptions = optionsList.map((option) => { console.log(option); From 22f6be2532fba269fbd41c553091b192a8435f1b Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 9 Sep 2024 16:59:58 +1000 Subject: [PATCH 193/206] fix form input check for editor and select. --- .../components/forms/form/clientlibs/functions.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index f96c47e53..a2b35691a 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -50,6 +50,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; const name = $input.attr("name") || $input.attr("id"); const id = $input.attr("id"); const type = $input.attr("type") || ""; + const component = $input.attr("component") || ""; console.group(name); console.log("$input", $input); console.log("inputObject", inputObject); @@ -59,14 +60,17 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; const isInput = $input.attr(ns.selectorInputAttribute); //is this composite value const isCompositeParent = $input.is(compositeNs.selector); + // is this text area or input field. + const isEditor = $input.is(editorNs.selectorComponent); + // is this select field + const isSelect = $input.is(selectNs.selectorComponent); - console.log(["getFormData form component", name, isInput, isCompositeParent]); + console.log(["isInput", $input, compositeNs.selector, editorNs.selectorComponent, selectNs.selectorComponent]); + + console.log(["getFormData form component", name, isInput, isCompositeParent, isEditor, isSelect]); //skip all field that do not have a name if (name) { - // is this text area or input field. - const isEditor = isInput === "editor"; - const isSelect = isInput === "select"; console.log(["getFormData basic form component", isSelect, isEditor]); From 69712cbf9df5481a8f957494a8cd5214b446d22e Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Sat, 14 Sep 2024 20:35:46 +1000 Subject: [PATCH 194/206] add logs. --- .../forms/fields/composite/clientlibs/functions.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js index 368de2c46..3b719ba32 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js @@ -263,10 +263,10 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log("$field", $field); rowData[$field.attr(ns.selectorNameAttribute)] = $field.val(); }); - console.log("rowData", JSON.stringify(rowData)); + console.log("rowData row", JSON.stringify(rowData)); //get all immediate isCompositeParent components and add to data var $compositeParents = $rowContents.findExclude(ns.selector,ns.selector); - console.log("compositeParents", $compositeParents); + console.log("compositeParents to process", $compositeParents, $compositeParents.length); $compositeParents.each(function(){ //find composite value input field var $compositeValue = $(this).findExclude(ns.selectorValue,ns.selector); @@ -280,11 +280,13 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; Object.assign(data,$compositeValue.compositeVal(addFieldHint)); rowData[compositeValueName] = data; } - console.log("rowData", JSON.stringify(rowData)); + console.log("rowData with compositeParents", JSON.stringify(rowData)); }); //add row data to data data.push(rowData); + console.log("data", data); }); + console.log("data final", data); console.groupEnd(); return data; } From 2c33651da24ba3365da4de2516b8ee4cc4135621 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Sat, 14 Sep 2024 20:36:07 +1000 Subject: [PATCH 195/206] ensure form load with query string is async. --- .../forms/form/clientlibs/functions.js | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index a2b35691a..af47fb9ef 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -83,8 +83,10 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; console.log(["getFormData composite value input", $compositeValue]); var compositeValueName = $compositeValue.attr(compositeNs.selectorNameAttribute); console.log(["getFormData composite value", $compositeValue]); - result[compositeValueName] = {}; - Object.assign(result[compositeValueName], $compositeValue.compositeVal(addFieldHint)); + const compositeValue = $compositeValue.compositeVal(addFieldHint); + console.log("compositeValue", compositeValue); + result[compositeValueName] = compositeValue; + // Object.assign(result[compositeValueName], $compositeValue.compositeVal(addFieldHint)); if (addFieldHint) { ns.addFieldHint($input, compositeValueName, id); @@ -334,17 +336,27 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; const id = $input.attr("id"); const type = $input.attr("type") || ""; const tagName = $input.prop("tagName"); + //is this input field const isInput = $input.attr(ns.selectorInputAttribute); + //is this composite value const isCompositeParent = $input.is(compositeNs.selector); + // is this text area or input field. + const isEditor = $input.is(editorNs.selectorComponent); + // is this select field + const isSelect = $input.is(selectNs.selectorComponent); console.group(name); - console.log($input); - console.log(inputObject); - console.log($input.val()); + console.log(`$input[${name}]`, $input); + console.log(`data[${name}]`, data[name]); + console.log("inputObject", inputObject); + console.log("console.log($input.val());", $input.val()); + console.log("isInput", isInput); + console.log("isCompositeParent", isCompositeParent); + console.log("isEditor", isEditor); + console.log("isSelect", isSelect); + //skip all field that do not have a name and dont exist in data if (name && data[name]) { - const isSelect = tagName === "SELECT"; - const isEditor = isInput === "editor"; console.log(["loadData basic form component", isSelect, isEditor]); if(isCompositeParent) { @@ -427,7 +439,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; $item.attr("value", data[name]); } else if (isInput === "editor") { - const editorId = $input.data("editor-id"); + const editorId = $item.data("editor-id"); ns.editorNs.setEditorData(editorId, data[name]); } }); @@ -653,8 +665,11 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; if (ns.isDataLoadRequired(componentConfig)) { console.log("query string exists, loading data..."); - var initData = ns.getData($component, componentConfig); - ns.loadData($component, initData, componentConfig); + ns.getData($component, componentConfig).then(data => {; + console.log("data loaded", data); + ns.loadData($component, data, componentConfig); + console.log("data loaded done", data); + }); } //highlight fields with same ids From b0b6c8de7e89d28888847f96653f2eb1572a0fd3 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 16 Sep 2024 00:48:25 +1000 Subject: [PATCH 196/206] default to form post if not set. --- .../components/forms/form/clientlibs/functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index af47fb9ef..86dc43233 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -295,8 +295,8 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; if (!writePayloadType || !writeMethod ) { writePayloadType = "application/json"; writeMethod = "POST"; - console.log("Payload type or method not set, defaulting to JSON and POST."); - return; + console.warn("Payload type or method not set, defaulting to JSON and POST."); + // return; } const payload = await ns.getFormData($component); ns.updateButtonState($component, "loading"); From b59345c715ae47df6620d55ef788c0781c1e943c Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 16 Sep 2024 00:56:01 +1000 Subject: [PATCH 197/206] fix textarea tag to remove empty lines. --- .../typerefinery/components/forms/fields/textarea/variant.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/textarea/variant.html b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/textarea/variant.html index be1d8ed17..f6c726fd4 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/textarea/variant.html +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/textarea/variant.html @@ -26,6 +26,5 @@ class="${model.variantClassNames}" required="${model.validationRequired}" disabled="${model.disabled}" - > - </textarea> + ></textarea> </template> \ No newline at end of file From 1308f5a9243444de48dedd81fd32917675346fdc Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Sat, 21 Sep 2024 22:43:59 +1000 Subject: [PATCH 198/206] fix accordion template insert. --- .../layout/accordion/clientlibs/functions.js | 91 ++++++++++++++----- 1 file changed, 67 insertions(+), 24 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index e8c91757d..54071fae3 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -224,7 +224,6 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.groupEnd(); } - ns.addNewItem = ($component, data, once) => { console.group('addNewItem'); @@ -233,38 +232,81 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const componentId = $component.attr('id'); const componentConfig = componentNs.getComponentConfig($component); - let $internalTemplate = $component.find(ns.selectorTemplate); + let $componentTemplate = $component.find(ns.selectorTemplate); + const isComponentTemplate = $componentTemplate.length > 0; const { config } = data; console.log('config', config); - if (config) { - //if config starts with # then its a selector - if (config.startsWith("#")) { - console.log(`config is a seelector for template, looking up template by selector ${ns.selectorTemplate + config}`); - const $templateById = $component.find(ns.selectorTemplate + config); - if ($templateById.length === 0) { - console.error("template not found by id"); - } else { - console.log("template found by id", $templateById); - $internalTemplate = $templateById.first(); + + const isDataString = typeof config === 'string' || config instanceof String; + + //if config starts with # then its a selector + const isDataId = isDataString && config.startsWith("#"); + + let dataIdString = isDataId ? config.substring(1) : (isDataString ? config : null); + + //if config an object then try get id + if (!dataIdString && config && typeof config === 'object') { + console.log('config is an object, looking for id'); + // if object config has own attribute id then get it + if (Object.hasOwnProperty.call(config, 'id')) { + const dataObjectIdString = config["id"]; + if (dataObjectIdString) { + console.log('has an id attibute', dataObjectIdString); + dataIdString = dataObjectIdString; } } + } else { + console.log('config is not an object'); } - if ($internalTemplate.length > 1) { - console.log("more than one template found, using first one"); - $internalTemplate = $internalTemplate.first(); + let $template; //template + let isFoundTemplate = false; // is template found at all + let isFoundTemplateInternal = false; //if template is found by id in internal templates + let isFoundTemplateExternal = false; //if template is found by id in external templates + + if (config) { + console.log(`config is a seelector for template, looking up template by selector [${ns.selectorTemplate} #${dataIdString}]`); + const $interntalTemplateById = $component.find(`${ns.selectorTemplate} #${dataIdString}`); + + console.log("internal template found by id", $interntalTemplateById); + if ($interntalTemplateById.length === 0) { + console.error("internal template not found by id"); + } else { + if ($interntalTemplateById.length > 1) { + console.log("more than one template found, using first one"); + } + $template = $interntalTemplateById.first(); + isFoundTemplateInternal = true; + isFoundTemplate = true; + } } - //default template - let $template = $internalTemplate; - + console.log('isFoundTemplate', isFoundTemplate); + console.log('isFoundTemplateInternal', isFoundTemplateInternal); console.log('$template', $template); + if (!isFoundTemplateInternal) { + const $externalTemplateById = $(`#${dataIdString}`); + if ($externalTemplateById.length === 0) { + console.error("external template not found by id"); + } else { + if ($externalTemplateById.length > 1) { + console.log("more than one template found, using first one"); + } + isFoundTemplateExternal = true; + isFoundTemplate = true; + $template = $externalTemplateById.first(); + } + } + + console.log('isFoundTemplate', isFoundTemplate); + console.log('isFoundTemplateExternal', isFoundTemplateExternal); + console.log('$template', $template); - if (config) { - const $externalTemplate = $(config); - $template = $externalTemplate.length ? $externalTemplate : $template; - console.log('$template', $template); + // if template not found then return + if (!isFoundTemplate) { + console.error("template not found"); + return; } // get the template id if set @@ -319,8 +361,9 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log('$newRow', $newRow); - //insert into accordion - $internalTemplate.before($newRow); + //insert newrow into accordion + $component.append($newRow); + //raise event that item is added ns.ADD_ITEM($component, componentConfig, { type: "accordion", action: "add_item" , "id": itemId } ); From e8cfcbcd97524b938bce84a8d1b9047a16838e9e Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Sat, 21 Sep 2024 23:18:14 +1000 Subject: [PATCH 199/206] stop openning of nested accordions on open. --- .../components/layout/accordion/clientlibs/functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index 54071fae3..5c6025885 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -91,9 +91,9 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const id = config; const $item = $component.find(`#${id}`); const $itemContainer = $item.closest(ns.selectorAccordionItem); - const $itemButton = $item.find(ns.selectorButton); + const $itemButton = $item.find(ns.selectorButton).first(); const itemButtonTarget = $itemButton.attr(ns.attributeTarget); - const $itemCollapse = $item.find(itemButtonTarget); + const $itemCollapse = $item.find(itemButtonTarget).first(); const itemDataParent = $itemCollapse.attr(ns.attributeParent); console.log(["$item", $item]); From 65d267f7810af04d4f870229020054368ea50482 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Sat, 21 Sep 2024 23:45:40 +1000 Subject: [PATCH 200/206] when accordion item is opened, check parents and open them. --- .../layout/accordion/clientlibs/functions.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index 5c6025885..a087eb1e6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -103,6 +103,30 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log(["$itemCollapse", itemButtonTarget, $itemCollapse]); console.log(["itemDataParent", ns.attributeParent, itemDataParent]); + //find all nested parent accordion items that are not open and open them in reverse order top down + const $parentItems = $($itemContainer.parents(ns.selectorAccordionItem).toArray().reverse()); + console.log(["$parentItems", $parentItems]); + $parentItems.each((index, item) => { + const $parentItem = $(item); + const $parentItemButton = $parentItem.find(ns.selectorButton).first(); + const parentItemButtonTarget = $parentItemButton.attr(ns.attributeTarget); + const $parentItemCollapse = $parentItem.find(parentItemButtonTarget).first(); + const parentItemDataParent = $parentItemCollapse.attr(ns.attributeParent); + console.log(["$parentItem", $parentItem]); + console.log(["$parentItemButton", $parentItemButton]); + console.log(["parentItemButtonTarget", parentItemButtonTarget]); + console.log(["$parentItemCollapse", $parentItemCollapse]); + console.log(["parentItemDataParent", parentItemDataParent]); + // if button is not aria-expanded then click it + const ariaExpanded = $parentItemButton.attr('aria-expanded'); + console.log(["ariaExpanded", ariaExpanded]); + if (ariaExpanded === "false") { + $parentItemButton.click(); + } else { + console.log("already open"); + } + }); + // if button is not aria-expanded then click it const ariaExpanded = $itemButton.attr('aria-expanded'); console.log(["ariaExpanded", ariaExpanded]); From 29554ad02208fc2597d7680bbf045bdc8cc3be40 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 30 Sep 2024 21:53:39 +1000 Subject: [PATCH 201/206] enable event json config and fix iframe event window filtering. --- .../content/embed/clientlibs/functions.js | 242 +++++++++++++----- 1 file changed, 175 insertions(+), 67 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js index f82431708..85f2104bd 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js @@ -11,16 +11,16 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.selectorComponent = '[component=embed]'; - ns.ACTION_EVENT_PROXY = "EVENT_PROXY"; - ns.ACTION_DATA_REQUEST = "DATA_REQUEST"; - ns.ACTION_DATA_PAYLOAD = "DATA_PAYLOAD"; - ns.ACTION_DATA_SOURCE = "DATA_SOURCE"; + ns.ACTION_EVENT_PROXY = "EVENT_PROXY"; //emmit event from iframe as if it was raised by this component + ns.ACTION_DATA_REQUEST = "DATA_REQUEST"; //request data by iframe + ns.ACTION_DATA_PAYLOAD = "DATA_PAYLOAD"; //deliver data to iframe + ns.ACTION_DATA_SOURCE = "DATA_SOURCE"; //change source for iframe //actions supported by this component ns.ACTIONS = { - EVENT_PROXY: ns.ACTION_EVENT_PROXY, //send event to above component - DATA_REQUEST: ns.ACTION_DATA_REQUEST, //request data - DATA_PAYLOAD: ns.ACTION_DATA_PAYLOAD, //deliver data + EVENT_PROXY: ns.ACTION_EVENT_PROXY, //emmit event from iframe as if it was raised by this component + DATA_REQUEST: ns.ACTION_DATA_REQUEST, //request data by iframe + DATA_PAYLOAD: ns.ACTION_DATA_PAYLOAD, //deliver data to iframe DATA_SOURCE: ns.ACTION_DATA_SOURCE //change source for iframe } @@ -32,8 +32,15 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; ns.updateDataSource = ($component, config) => { console.group("updateDataSource"); console.log(["updateDataSource", $component, config]); - if (config.source) { - $component.find("iframe").attr("src", config.source); + //check if config has source or config.config.source then get is value + let sourceUrl = config.source || config.config.source; + + const payloadData = config.payload || {}; + + if (sourceUrl) { + sourceUrl = componentNs.replaceRegex(sourceUrl, payloadData) + console.log(["update iframe source", sourceUrl]); + $component.find("iframe").attr("src", sourceUrl); } else { console.error("no source was specified"); } @@ -289,6 +296,26 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } } + // function to check if string is JSON + ns.isJsonString = (str) => { + try { + JSON.parse(str); + } catch (e) { + return false; + } + return true; + } + + //function to convert string to JSON or return string + ns.parseJson = (str) => { + if (ns.isJsonString(str)) { + return JSON.parse(str); + } + return str; + } + + + ns.addEventListener = ($component, componentConfig) => { console.group('addEventListener embed'); const { events, id } = componentConfig; @@ -301,6 +328,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; if (events) { events.forEach(event => { const { topic, type, name, nameCustom, action, config} = event; + const configData = ns.parseJson(config) || ""; //if topic not set use component id as topic const topicName = topic || defaultTopic; // if type is not defined then its emitted @@ -309,7 +337,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; //custom name takes precidence over name, this will be raised as event name let eventName = nameCustom || name; - console.groupCollapsed(`event ${typeName} - ${action}:${topic} [${config}]`); + console.groupCollapsed(`event ${typeName} - ${action}:${topic}`); console.log(["event", event]); // if action is EVENT_PROXY @@ -319,7 +347,7 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; if (ns.ACTIONS[action]) { console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap), topicName, typeName, action, eventName]); - eventNs.registerEventActionMapping(ns.eventMap, id, topicName, typeName, action, eventName, config); + eventNs.registerEventActionMapping(ns.eventMap, id, topicName, typeName, action, eventName, configData); console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap)]); // if event type is listen then add event listener for the event @@ -330,27 +358,27 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; //TODO: add new event to allow sending data to tms //NOTE: handle all different actions in windowListeneriFrameEvent if (action === ns.ACTION_EVENT_PROXY) { - console.log(["add windowListeneriFrameEvent for this component", action, id]); + console.log(["add windowListeneriFrameEvent for this component", action, id, configData]); //listen for global message events that are emited by iframe - ns.addEventEmitter($component, componentConfig, topicName, eventName, action, (data) => { - console.log(["windowListeneriFrameEvent callback", topicName, eventName, action, data]); + ns.addEventEmitter($component, componentConfig, topicName, eventName, action, configData, (data) => { + console.log(["windowListeneriFrameEvent callback", topicName, eventName, action, data, configData]); // proxy all events console.log(["EVENT_PROXY", $component, componentConfig, data]); ns.EVENT_PROXY($component, componentConfig, data); }); } else if (action === ns.ACTION_DATA_REQUEST) { - console.log(["add windowListeneriFrameEvent for this component", action, id]); - //listen for global message events that are emited by iframe - ns.addEventEmitter($component, componentConfig, topicName, eventName, action, (data) => { + console.log(["add windowListeneriFrameEvent for this component", action, id, configData]); + //listen for data request that are emited by iframe and conver these to data request events + ns.addEventEmitter($component, componentConfig, topicName, eventName, action, configData, (data) => { console.log(["windowListeneriFrameEvent callback", topicName, eventName, action, data]); - console.log(["DATA_REQUEST", $component, componentConfig, config]); - - let endpointConfig = {}; - try { - const test = JSON.parse(config); - endpointConfig = test; - } catch (error) { - endpointConfig.url = config; + console.log(["DATA_REQUEST", $component, componentConfig, configData]); + + // get url from config or use config as url + let endpointConfig = {}; + if (typeof configData === 'string') { + endpointConfig.url = configData; + } else { + endpointConfig = configData; } const eventData = { @@ -373,15 +401,26 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; if (eventName === eventNs.EVENTS.EVENT_TOPIC_PAYLOAD) { //if config is string then use it as host - const host = (typeof config === 'string' ? (config ? config : false) : (typeof config === 'object' ? config.host : false)) || "ws://localhost:8112/$tms"; + const host = (typeof configData === 'string' ? (configData ? configData : false) : (typeof configData === 'object' ? configData.host : false)) || "ws://localhost:8112/$tms"; //TODO: get host default value from config + //add warning if host is not set + if (!host) { + console.warn("host not set for TMS address."); + } console.log(["register with TMS", host, topicName]); + + const url = typeof configData === 'string' ? configData : configData.url; + //add warning if url is not set + if (!url) { + console.warn("url is not set for Payload."); + } + ns.tmsConnected($component, host, topicName, (data) => { const eventData = { topicName: topicName, eventName: eventName, action: action, - url: config, + url: url, data: data, target: "iframe-" + id, source: host @@ -445,22 +484,23 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } //all the callbacks for events, these are the actions to be taken when event is raised - ns.windowListeneriFrameEventCallBacks = {}; - ns.addEventEmitter = function($component, componentConfig, topicName, eventName, action, callbackFn) { + ns.windowListeneriFrameEventCallBacks = new Map(); + ns.addEventEmitter = function($component, componentConfig, topicName, eventName, action, configData, callbackFn) { console.groupCollapsed(`embed addEmitter for ${topicName},${eventName},${action}, on ${window.location}`); - console.log(["addEmitter", topicName, eventName, action, callbackFn]); + console.log(["addEmitter", topicName, eventName, action, configData, callbackFn]); const { id } = componentConfig; const callbackId = `${id}-${topicName}-${eventName}-${action}`; - ns.windowListeneriFrameEventCallBacks[callbackId] = { + ns.windowListeneriFrameEventCallBacks.set(callbackId,{ $component: $component, componentConfig: componentConfig, topicName: topicName, eventName: eventName, action: action, + config: configData, callbackFn: callbackFn - } + }) console.log(["windowListeneriFrameEventCallBacks", ns.windowListeneriFrameEventCallBacks]); ns.bindWindowListeneriFrameEvent($component); console.groupEnd(); @@ -481,52 +521,120 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } ns.processWindowListenerEvent = function($component, event, sourceData) { - console.groupCollapsed("processWindowListenerEvent"); + console.groupCollapsed(`processWindowListenerEvent ${sourceData.type}`); console.log(["processWindowListenerEvent", $component, event, sourceData]); const eventType = sourceData.type; const eventAction = sourceData.action; console.log(["eventType", eventType]); console.log(["eventAction", eventAction]); console.log(["sourceData", sourceData]); - const countofCallbacks = Object.keys(ns.windowListeneriFrameEventCallBacks).length; + const countofCallbacks = ns.windowListeneriFrameEventCallBacks.size; console.log(`find matching callbacks for event ${eventAction}:${eventType} in ${countofCallbacks} callbacks`); - //check if this event is for this component - for (const key in ns.windowListeneriFrameEventCallBacks) { - if (ns.windowListeneriFrameEventCallBacks.hasOwnProperty(key)) { - const callBack = ns.windowListeneriFrameEventCallBacks[key]; - const callBackAction = callBack.action; //action component supports - const callBackTopicName = callBack.topicName; //topic name, should match event type - // const eventName = callBack.eventName; //named or custom event name - console.groupCollapsed(`callBack action ${callBackAction}:${callBackTopicName}`); - console.log(["callBack", callBack]); - // console.log(["eventName", eventName]); - const isProxyEvent = (callBackAction === ns.ACTION_EVENT_PROXY); - const isActionMatch = (callBackAction === eventAction); - const isTopicMatch = (callBackTopicName === eventType); - if (isProxyEvent) { - console.warn(["isProxyEvent", isProxyEvent]); - } else { - console.log(["isProxyEvent", isProxyEvent]); - } - if (isActionMatch) { - console.warn(["isActionMatch", isActionMatch]); - } else { - console.log(["isActionMatch", isActionMatch]); - } - if (isTopicMatch) { - console.warn(["isTopicMatch", isTopicMatch]); - } else { - console.log(["isTopicMatch", isTopicMatch]); - } - if (isProxyEvent || (isActionMatch && isTopicMatch)) { - console.log(["call", callBack]); + let hasCatchAll = false; + + const matchedCallbacksArray = [...ns.windowListeneriFrameEventCallBacks]; + + console.log(["matchedCallbacksArray", matchedCallbacksArray]); + + //find all callbacks that match the event + const matchedCallbacks = [...ns.windowListeneriFrameEventCallBacks].filter(([key, callBack]) => { + const callBackAction = callBack.action; //action component supports + const callBackTopicName = callBack.topicName; //topic name, should match event type + // const eventName = callBack.eventName; //named or custom event name + console.groupCollapsed(`callBack action ${callBackAction}:${callBackTopicName}`); + console.log(["callBack", callBack]); + console.log(["callBackAction", callBackAction]); + console.log(["callBackTopicName", callBackTopicName]); + // console.log(["eventName", eventName]); + const isProxyEvent = (callBackAction === ns.ACTION_EVENT_PROXY); + const isActionMatch = (callBackAction === eventAction); + const isTopicMatch = (callBackTopicName === eventType); + const isCatchAll = (callBack.config ? (callBack.config.catchAll ? callBack.config.catchAll : false) : false); + if (isProxyEvent) { + console.warn(["isProxyEvent", isProxyEvent]); + } else { + console.log(["isProxyEvent", isProxyEvent]); + } + if (isActionMatch) { + console.warn(["isActionMatch", isActionMatch]); + } else { + console.log(["isActionMatch", isActionMatch]); + } + if (isTopicMatch) { + console.warn(["isTopicMatch", isTopicMatch]); + } else { + console.log(["isTopicMatch", isTopicMatch]); + } + if (isCatchAll) { + console.warn(["isCatchAll", isCatchAll]); + hasCatchAll = true; + } else { + console.log(["isCatchAll", isCatchAll]); + } + + // if event is proxy and is catch all then match all events + // if event is proxy then match topic only + // if action is match and topic is match then match + if ((isProxyEvent && isCatchAll) || (isProxyEvent && isTopicMatch) || (isActionMatch && isTopicMatch)) { + console.log(["match"]); + console.groupEnd(); + return true; + //callBack.callbackFn(sourceData); + } else { + console.warn("no match"); + } + console.groupEnd(); + return false; + }); + + console.log(["matchedCallbacks", matchedCallbacks]); + + + if (matchedCallbacks.length > 0) { + if (matchedCallbacks.length == 1) { + console.log(["matchedCallbacks", matchedCallbacks]); + const callBackItem = matchedCallbacks[0]; + const callBack = callBackItem[1]; + const callBackKey = callBackItem[0]; + console.log([`callBack exec ${callBackKey}`, callBack]); + // if callbackFn is set then call it + if (callBack.callbackFn) { callBack.callbackFn(sourceData); + console.log([`callBack done ${callBackKey}`]); } else { - console.warn("no match"); + console.error(`no callback function found ${callBackKey}`); } - console.groupEnd(); - } + } else { + //order the to have the catch all last + matchedCallbacks.sort((a, b) => { + if (a.config && a.config.catchAll) { + return 1; + } + return 0; + }); + + console.log(["matchedCallbacks", matchedCallbacks]); + + //run callbacks + matchedCallbacks.forEach(([key, callBack]) => { + //skip catch all but not if catchAllAlways is set + if (callBack.config && callBack.config.catchAll && !callBack.config.catchAllAlways) { + return; + } + + console.log([`callBack exec ${key}`, callBack]); + // if callbackFn is set then call it + if (callBack.callbackFn) { + callBack.callbackFn(sourceData); + console.log([`callBack done ${key}`]); + } else { + console.error(`no callback function found ${key}`); + } + }); + } + } else { + console.warn("no matching callbacks found"); } console.groupEnd(); }; From 06048442fd0119e2c950bde39197c4a7c97d88ec Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Mon, 30 Sep 2024 21:58:43 +1000 Subject: [PATCH 202/206] update evenet emit logic to match by topic or action. --- .../clientlibs-header/events/functions.js | 58 +++++++++++++------ 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js index 7d18fd3d8..99683f6c6 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/structure/page/clientlibs-header/events/functions.js @@ -123,16 +123,23 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; }; ns.emitEvent = (topic, payload) => { - console.group('emitEvent'); + console.groupCollapsed(`emitEvent ${topic}`); console.log(["topic", topic, "payload", payload]); const evt = document.createEvent(ns.CUSTOM_EVENT_NAME); - if (evt.initCustomEvent) { - evt.initCustomEvent(ns.CUSTOM_EVENT_NAME, false, false, { topic, payload }); + // if evt has initCustomEvent then use it + console.log(["initCustomEvent", evt["initCustomEvent"]]); + if (typeof evt["initCustomEvent"] === 'function') { + console.log("initCustomEvent found on custom event."); + evt["initCustomEvent"](ns.CUSTOM_EVENT_NAME, false, false, { topic, payload }); + // evt.initCustomEvent(ns.CUSTOM_EVENT_NAME, false, false, { topic, payload }); + console.log("event initialized"); } else { console.error("initCustomEvent not found on custom event."); } if (ns.socket && ns.socket.dispatchEvent) { + console.log("socket found, dispatching event"); ns.socket.dispatchEvent(evt); + console.log("event dispatched"); } else { console.warn("socket not found."); } @@ -238,9 +245,13 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const { id } = componentConfig; + console.log(["id", id]); + // const eventData = ns.compileEventData(payload, eventName, componentAction); // console.log(["eventData", eventData]); console.log(["eventMap", eventMap]); + const eventType = payload.type || ""; + console.log(["eventType", eventType]); if (!eventMap) { console.error("Event map is missing"); @@ -249,9 +260,9 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; } //find event in eventMap and emit event to all the topics if (eventMap[ns.EVENT_TYPE_EMIT]) { - console.log("eventMap type found", componentAction, eventMap[ns.EVENT_TYPE_EMIT]); + console.log(["eventMap type found", componentAction, eventMap[ns.EVENT_TYPE_EMIT]]); if (eventMap[ns.EVENT_TYPE_EMIT][componentAction]) { - console.log("componentAction found", eventName, eventMap[ns.EVENT_TYPE_EMIT][componentAction]); + console.log(["componentAction found", eventName, eventMap[ns.EVENT_TYPE_EMIT][componentAction]]); //check if events exist for component id if (!eventMap[ns.EVENT_TYPE_EMIT][componentAction][id]) { @@ -266,26 +277,39 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; console.log("actionComponents", actionComponents); // for each topic in the event name emit event actionComponents.forEach(actionComponent => { - console.log("actionComponents", actionComponent); + console.log("actionComponent", actionComponent); const actionEvents = eventMap[ns.EVENT_TYPE_EMIT][componentAction][id][actionComponent]; console.log("topicValues", actionEvents); // if topicValues is array then emit event to all the topics if (Array.isArray(actionEvents)) { + if (actionEvents.length == 0) { + console.warn("no topics found"); + } actionEvents.forEach(topicValue => { - const { topic, config } = topicValue; - console.log("emit event for topic", topic); - const eventData = ns.compileEventData(payload, actionComponent, componentAction, id, config); - ns.emitEvent(topic, eventData); - console.log("event emitted", topic, eventData); + const { topic, config, event } = topicValue; + if (topic && (topic == eventType || event == actionComponent)) { + console.log("emit event for topic", topic); + const eventData = ns.compileEventData(payload, actionComponent, componentAction, id, config); + ns.emitEvent(topic, eventData); + console.log("event emitted", topic, eventData); + } else { + console.warn("topic not matched", topic, eventType, actionComponent); + } }); } else { //is single value use it as topic if (actionEvents) { - const { topic, config } = topicValue; - console.log("emit event for topic", topic); - const eventData = ns.compileEventData(payload, actionComponent, componentAction, id, config); - ns.emitEvent(topic, eventData); - console.log("event emitted", topic, eventData); + const { topic, config, event } = actionEvents; + if (topic && (topic == eventType || event == actionComponent)) { + console.log("emit event for topic", topic); + const eventData = ns.compileEventData(payload, actionComponent, componentAction, id, config); + ns.emitEvent(topic, eventData); + console.log("event emitted", topic, eventData); + } else { + console.warn("topic not matched", topic, eventType, actionComponent); + } + } else { + console.warn("no topic found"); } } }); @@ -338,4 +362,4 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; $(document).ready(() => { ns.init(); }); -})(jQuery, Typerefinery.Page.Events, document, window); +})(window["jQuery"], Typerefinery.Page.Events, document, window); From 6eee4f95b6601a532e82083fdc0393daad234c76 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 8 Oct 2024 01:43:44 +1100 Subject: [PATCH 203/206] update event type dropdown to not select any value by default. --- .../typerefinery/components/dialog/tabs/event/.content.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json index 6ac384a0d..cbbd5be86 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json +++ b/application/backend/src/main/resources/apps/typerefinery/components/dialog/tabs/event/.content.json @@ -39,14 +39,12 @@ "listen": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", "label": "Listen", - "value": "listen", - "selected": true + "value": "listen" }, "emit": { "sling:resourceType": "wcm/dialogs/components/select/selectitem", "label": "Emit", - "value": "emit", - "selected": true + "value": "emit" } }, "eventAction": { From 3253b215c72a2828432aa161a61b95eec95061ec Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Tue, 8 Oct 2024 01:45:41 +1100 Subject: [PATCH 204/206] update default event type to be listen. --- .../content/embed/clientlibs/functions.js | 4 +- .../fields/button/clientlibs/functions.js | 4 +- .../fields/composite/clientlibs/functions.js | 2 +- .../forms/form/clientlibs/functions.js | 58 ++++++++++++------- .../layout/accordion/clientlibs/functions.js | 2 +- .../layout/container/clientlibs/functions.js | 2 +- 6 files changed, 43 insertions(+), 29 deletions(-) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js index 85f2104bd..742ced655 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/content/embed/clientlibs/functions.js @@ -331,8 +331,8 @@ Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const configData = ns.parseJson(config) || ""; //if topic not set use component id as topic const topicName = topic || defaultTopic; - // if type is not defined then its emitted - let typeName = type || eventNs.EVENT_TYPE_LISTEN; //default is listen + // if type is not defined then its listen event + let typeName = type || eventNs.EVENT_TYPE_LISTEN || "custom"; //custom name takes precidence over name, this will be raised as event name let eventName = nameCustom || name; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js index 081dc432e..eeacefc8d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/button/clientlibs/functions.js @@ -32,8 +32,8 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const { topic, type, name, nameCustom, action, config } = event; //if topic not set use component id as topic const topicName = topic || defaultTopic; - // if type is not defined then its emitted - let typeName = type || eventNs.EVENT_TYPE_LISTEN; + // if type is not defined then its listen event + let typeName = type || eventNs.EVENT_TYPE_LISTEN || "custom"; let eventName = nameCustom || name; console.group(action + " " + eventName); diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js index 3b719ba32..fc0c26013 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/fields/composite/clientlibs/functions.js @@ -48,7 +48,7 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const { topic, type, name, nameCustom, action, config } = event; //if topic not set use component id as topic const topicName = topic || defaultTopic; - // if type is not defined then its emitted + // if type is not defined then its listen event let typeName = type || eventNs.EVENT_TYPE_LISTEN || "custom"; let eventName = nameCustom || name; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js index 86dc43233..ddd6b020d 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/forms/form/clientlibs/functions.js @@ -169,7 +169,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; }; // submit the request to the server - ns.submit = async ($component, componentConfig, url, method, payloadType, body, successCallback = () => { }, errorCallback = () => { }) => { + ns.submit = async ($component, componentConfig, url, method, payloadType, body, successCallback = ($component, componentConfig, payload) => { }, errorCallback = ($component, componentConfig, payload) => { }) => { console.group("submit"); console.log([url, method, payloadType, body]) let controller = new AbortController(); @@ -516,9 +516,10 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; }; ns.addEventListener = ($component, componentConfig) => { - console.group('addEventListener form'); const { events, id } = componentConfig; const defaultTopic = id; + + console.group('addEventListener ' + id); console.log(["config", events, id, defaultTopic]); @@ -528,6 +529,7 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; events.forEach(event => { const { topic, type, name, nameCustom, action, config} = event; + //if type unset then log warning if (!type) { console.warn("type is unset for event will default to emit", event); @@ -545,11 +547,16 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; //if topic not set use component id as topic const topicName = topic || defaultTopic; - // if type is not defined then its emitted - let typeName = type || eventNs.EVENT_TYPE_EMIT; + // if type is not defined then its listen event + let typeName = type || eventNs.EVENT_TYPE_LISTEN || "custom"; //custom name takes precidence over name, this will be raised as event name let eventName = nameCustom || name; + console.group(action + " " + eventName); + + console.log(["event config", topic, type, name, nameCustom, action]); + console.log(["event to register", topicName, typeName, eventName, action]); + console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap), topicName, typeName, action, eventName]); eventNs.registerEventActionMapping(ns.eventMap, id, topicName, typeName, action, eventName, config); console.log(["registerEventActionMapping", JSON.stringify(ns.eventMap)]); @@ -561,16 +568,18 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; console.info("event type is emit, do nothing"); } else { //listen register the event and listent for specific event on topic - console.log(["registerEvents", topicName, eventName]); + console.log(["register event listen", topicName, eventName]); eventNs.registerEvents(topicName, (data) => { console.log(["registerEvents consumeIncomingEvent", data, eventName]); // check make sure the event is for this event if (data.type === eventName) { console.log(["registerEvents match calling update", action, data]); - ns.update($component, action, data); + ns.handleEventAction($component, action, data); } }); } + + console.groupEnd(); }); } @@ -631,24 +640,29 @@ window.Typerefinery.Page.Files = Typerefinery.Page.Files || {}; console.groupEnd(); } + /** - * - * @param {*} $component - * @param {*} actionName can be either global action name or component action name - * @param {*} data + * handle events for the form component + * @param {*} $component component instance + * @param {*} action component action + * @param {*} data data to be passed to the action */ - ns.update = ($component, actionName, data) => { - console.log(["form update", $component, actionName, data]); - //load data into form if action is FORM_LOAD or EVENT_READ_ACTION - if (ns.ACTIONS[actionName] == "FORM_LOAD" || actionName === eventNs.EVENTS.EVENT_READ_ACTION) { - ns.loadData($component, data); - } else if (ns.ACTIONS[actionName] == "FORM_SUBMIT" || actionName == eventNs.EVENTS.EVENT_SUBMIT_ACTION) { - //submit form if action is FORM_SUBMIT or EVENT_SUBMIT_ACTION - ns.formSubmitHandler($component); - } else { - //log error if action is not supported - console.error(["unsupported action", actionName]); - } + ns.handleEventAction = ($component, action, data) => { + console.group('handleEvent'); + console.log(["handleEvent", $component, action, data]); + + //load data into form if action is FORM_LOAD or EVENT_READ_ACTION + if (ns.ACTIONS[action] == "FORM_LOAD" || action === eventNs.EVENTS.EVENT_READ_ACTION) { + ns.loadData($component, data); + } else if (ns.ACTIONS[action] == "FORM_SUBMIT" || action == eventNs.EVENTS.EVENT_SUBMIT_ACTION) { + //submit form if action is FORM_SUBMIT or EVENT_SUBMIT_ACTION + ns.formSubmitHandler($component); + } else { + //log error if action is not supported + console.error(["unsupported action", action]); + } + + console.groupEnd(); } ns.init = ($component) => { diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js index a087eb1e6..a78a53e21 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/accordion/clientlibs/functions.js @@ -35,7 +35,7 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const { topic, type, name, nameCustom, action, config } = event; //if topic not set use component id as topic const topicName = topic || defaultTopic; - // if type is not defined then its emitted + // if type is not defined then its listen event let typeName = type || eventNs.EVENT_TYPE_LISTEN || "custom"; let eventName = nameCustom || name; diff --git a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/functions.js b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/functions.js index 20a1a843d..e1888f630 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/functions.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/layout/container/clientlibs/functions.js @@ -30,7 +30,7 @@ window.Typerefinery.Page.Events = Typerefinery.Page.Events || {}; const { topic, type, name, nameCustom, action, config } = event; //if topic not set use component id as topic const topicName = topic || defaultTopic; - // if type is not defined then its emitted + // if type is not defined then its listen event let typeName = type || eventNs.EVENT_TYPE_LISTEN || "custom"; let eventName = nameCustom || name; From 239dc1f094377a1f82d9dd291bf343d9b24cd263 Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 10 Oct 2024 23:09:43 +1100 Subject: [PATCH 205/206] add sample content. --- .../jcr_root/content/os-triage/.content.xml | 7 + .../content/os-triage/assets/.content.xml | 3 + .../content/os-triage/pages/.content.xml | 6 + .../os-triage/pages/incidents/.content.xml | 56 + .../typerefinery-showcase/.content.xml | 4 +- .../typerefinery-showcase/assets/.content.xml | 4 +- .../assets/images/.content.xml | 4 +- .../typerefinery-showcase/pages/.content.xml | 7 + .../pages/components/.content.xml | 11 +- .../pages/components/content/.content.xml | 46 +- .../components/content/card/.content.xml | 107 +- .../components/content/embed/.content.xml | 23 +- .../content/embed/codepen/.content.xml | 149 ++ .../content/embed/codesandbox/.content.xml | 149 ++ .../content/embed/github/.content.xml | 149 ++ .../content/embed/jsfiddle/.content.xml | 149 ++ .../content/embed/vizhub/.content.xml | 149 ++ .../components/content/image/.content.xml | 52 +- .../components/content/table/.content.xml | 111 +- .../pages/components/content/tag/.content.xml | 38 +- .../components/content/text/.content.xml | 62 +- .../components/content/title/.content.xml | 34 +- .../content/upload-file/.content.xml | 20 +- .../pages/components/flow/.content.xml | 7 +- .../pages/components/forms/.content.xml | 703 ++++++- .../components/forms/button/.content.xml | 181 +- .../components/forms/checkbox/.content.xml | 102 +- .../forms/composite-list/.content.xml | 240 +++ .../components/forms/composite/.content.xml | 469 +++++ .../components/forms/form-events/.content.xml | 76 + .../components/forms/forms-test/.content.xml | 599 ++++++ .../pages/components/forms/input/.content.xml | 155 +- .../components/forms/radiobutton/.content.xml | 165 +- .../components/forms/select/.content.xml | 166 +- .../components/forms/textarea/.content.xml | 127 +- .../pages/components/graphs/.content.xml | 39 +- .../components/graphs/d3graph/.content.xml | 54 +- .../pages/components/layout/.content.xml | 8 + .../components/layout/accordion/.content.xml | 389 ++++ .../layout/accordion/accordion1/.content.xml | 494 +++++ .../layout/bread-crumbs/.content.xml | 42 + .../layout/containerlist/.content.xml | 4 +- .../conatinerListWithoutPath/.content.xml | 2 +- .../components/layout/footer/.content.xml | 5 +- .../components/layout/header/.content.xml | 2 + .../components/layout/sidebar/.content.xml | 41 +- .../layout/sidebar/child1/.content.xml | 32 +- .../layout/sidebar/child1/child1/.content.xml | 29 +- .../layout/sidebar/child1/child2/.content.xml | 29 +- .../layout/sidebar/child1/child3/.content.xml | 29 +- .../layout/sidebar/child2/.content.xml | 32 +- .../layout/sidebar/child2/child1/.content.xml | 32 +- .../sidebar/child2/child1/child1/.content.xml | 29 +- .../sidebar/child2/child1/child2/.content.xml | 29 +- .../sidebar/child2/child1/child3/.content.xml | 29 +- .../layout/sidebar/child2/child2/.content.xml | 32 +- .../sidebar/child2/child2/child1/.content.xml | 29 +- .../sidebar/child2/child2/child2/.content.xml | 29 +- .../sidebar/child2/child2/child3/.content.xml | 29 +- .../layout/sidebar/child2/child3/.content.xml | 32 +- .../sidebar/child2/child3/child1/.content.xml | 29 +- .../sidebar/child2/child3/child2/.content.xml | 29 +- .../sidebar/child2/child3/child3/.content.xml | 29 +- .../layout/sidebar/child3/.content.xml | 32 +- .../layout/sidebar/child3/child1/.content.xml | 32 +- .../sidebar/child3/child1/child1/.content.xml | 29 +- .../sidebar/child3/child1/child2/.content.xml | 29 +- .../sidebar/child3/child1/child3/.content.xml | 29 +- .../layout/sidebar/child3/child2/.content.xml | 32 +- .../sidebar/child3/child2/child1/.content.xml | 29 +- .../sidebar/child3/child2/child2/.content.xml | 29 +- .../sidebar/child3/child2/child3/.content.xml | 29 +- .../layout/sidebar/child3/child3/.content.xml | 32 +- .../sidebar/child3/child3/child1/.content.xml | 29 +- .../sidebar/child3/child3/child2/.content.xml | 29 +- .../sidebar/child3/child3/child3/.content.xml | 29 +- .../sidebar/sidebarwithoutparent/.content.xml | 32 +- .../sidebar/sidebarwithparent/.content.xml | 33 +- .../pages/components/widgets/.content.xml | 43 +- .../components/widgets/chart/.content.xml | 102 +- .../widgets/chart/barchart/.content.xml | 2 + .../widgets/chart/linechart/.content.xml | 2 + .../widgets/chart/piechart/.content.xml | 2 + .../components/widgets/editor/.content.xml | 39 + .../pages/components/widgets/map/.content.xml | 2 + .../components/widgets/security/.content.xml | 27 +- .../widgets/security/stix/.content.xml | 15 +- .../pages/components/widgets/tab/.content.xml | 28 +- .../components/widgets/table/.content.xml | 2 + .../components/widgets/ticker/.content.xml | 877 +++++++-- .../widgets/ticker/template1/.content.xml | 450 ++++- .../widgets/ticker/template2/.content.xml | 467 ++++- .../widgets/ticker/template3/.content.xml | 459 ++++- .../components/widgets/treeview/.content.xml | 42 + .../pages/content/.content.xml | 8 +- .../pages/content/footer/.content.xml | 178 +- .../header-with-hamburger/.content.xml | 172 +- .../pages/content/header/.content.xml | 72 +- .../pages/forms/.content.xml | 10 +- .../pages/forms/connection/.content.xml | 7 +- .../forms/connection/delete/.content.xml | 8 +- .../pages/forms/connection/edit/.content.xml | 8 +- .../pages/forms/connection/list/.content.xml | 4 +- .../pages/forms/connection/new/.content.xml | 2 +- .../pages/forms/project/.content.xml | 7 +- .../pages/forms/project/delete/.content.xml | 4 +- .../pages/forms/project/edit/.content.xml | 4 +- .../pages/forms/query/.content.xml | 7 +- .../pages/forms/query/delete/.content.xml | 4 +- .../pages/forms/query/edit/.content.xml | 8 +- .../pages/forms/query/list/.content.xml | 4 +- .../pages/forms/query/new/.content.xml | 61 +- .../pages/forms/test/.content.xml | 374 ++++ .../pages/forms/theme/.content.xml | 7 +- .../pages/forms/theme/delete/.content.xml | 4 +- .../pages/forms/theme/edit/.content.xml | 4 +- .../pages/forms/theme/list/.content.xml | 4 +- .../pages/forms/theme/new/.content.xml | 119 +- .../pages/os-intel/.content.xml | 78 +- .../pages/os-intel/admin/.content.xml | 7 +- .../pages/os-intel/admin/content/.content.xml | 7 +- .../os-intel/admin/content/forms/.content.xml | 5 +- .../admin/content/header/.content.xml | 41 +- .../pages/os-triage/.content.xml | 70 +- .../pages/os-triage/admin/.content.xml | 5 + .../os-triage/admin/asideleft/.content.xml | 6 +- .../admin/asideleft/default/.content.xml | 29 +- .../pages/os-triage/admin/footer/.content.xml | 6 +- .../admin/footer/default/.content.xml | 5 +- .../pages/os-triage/admin/header/.content.xml | 6 +- .../admin/header/default/.content.xml | 2 + .../pages/os-triage/forms/.content.xml | 25 +- .../forms/add-email-address/.content.xml | 101 + .../os-triage/forms/addtask/.content.xml | 228 ++- .../os-triage/forms/create-user/.content.xml | 134 ++ .../os-triage/forms/identity/.content.xml | 878 +++++++++ .../os-triage/forms/identity1/.content.xml | 1726 +++++++++++++++++ .../pages/os-triage/forms/note/.content.xml | 121 +- .../pages/os-triage/forms/stix/.content.xml | 41 + .../os-triage/forms/stix/company/.content.xml | 46 + .../forms/stix/company/create/.content.xml | 207 ++ .../forms/stix/company/update/.content.xml | 465 +++++ .../forms/stix/identity/.content.xml | 39 + .../forms/stix/identity/update/.content.xml | 1726 +++++++++++++++++ .../forms/stix/individual/.content.xml | 38 + .../forms/updateincident/.content.xml | 2 + .../forms/vizandform-local/.content.xml | 208 ++ .../os-triage/forms/vizandform/.content.xml | 93 + .../pages/os-triage/pages/.content.xml | 59 +- .../os-triage/pages/artifacts/.content.xml | 232 ++- .../os-triage/pages/createnew/.content.xml | 316 ++- .../os-triage/pages/dashboard/.content.xml | 567 +++--- .../os-triage/pages/enrichments/.content.xml | 127 +- .../os-triage/pages/incidents/.content.xml | 288 +-- .../pages/incidents/incident/.content.xml | 400 ++-- .../incidents/incident/artifacts/.content.xml | 16 + .../incident/domainname/.content.xml | 5 +- .../incident/enrichment/.content.xml | 2 + .../incident/enrichments/.content.xml | 2 + .../incidents/incident/info/.content.xml | 451 +++-- .../incidents/incident/notes/.content.xml | 195 +- .../incident/observables/.content.xml | 20 +- .../incidents/incident/tags/.content.xml | 194 +- .../incidents/incident/tasks/.content.xml | 205 +- .../incident/totalvirus/.content.xml | 7 +- .../pages/os-triage/pages/info/.content.xml | 461 +++-- .../pages/os-triage/pages/notes/.content.xml | 213 +- .../os-triage/pages/observables/.content.xml | 75 +- .../observables/observable1/.content.xml | 116 +- .../os-triage/pages/options/.content.xml | 377 ++++ .../pages/os-triage/pages/tags/.content.xml | 215 +- .../pages/os-triage/pages/tasks/.content.xml | 230 ++- .../pages/pages/.content.xml | 8 +- .../pages/pages/dashboard/.content.xml | 390 +++- .../pages/pages/form/.content.xml | 254 ++- .../pages/pages/report/.content.xml | 155 +- .../pages/test/.content.xml | 54 + 177 files changed, 18552 insertions(+), 3438 deletions(-) create mode 100644 tests/content/src/main/content/jcr_root/content/os-triage/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/os-triage/assets/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/os-triage/pages/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/os-triage/pages/incidents/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/codepen/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/codesandbox/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/github/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/jsfiddle/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/vizhub/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/composite-list/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/composite/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/form-events/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/forms-test/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/accordion/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/accordion/accordion1/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/bread-crumbs/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/editor/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/treeview/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/test/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/add-email-address/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/create-user/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/identity/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/identity1/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/company/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/company/create/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/company/update/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/identity/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/identity/update/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/individual/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/vizandform-local/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/vizandform/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/options/.content.xml create mode 100644 tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/test/.content.xml diff --git a/tests/content/src/main/content/jcr_root/content/os-triage/.content.xml b/tests/content/src/main/content/jcr_root/content/os-triage/.content.xml new file mode 100644 index 000000000..046fb0f00 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/os-triage/.content.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:ws="http://ds.pl/websight" + jcr:primaryType="ws:PagesSpace" + jcr:title="OS Triage"> + <pages/> + <assets/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/os-triage/assets/.content.xml b/tests/content/src/main/content/jcr_root/content/os-triage/assets/.content.xml new file mode 100644 index 000000000..9e42a382f --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/os-triage/assets/.content.xml @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:ws="http://ds.pl/websight" + jcr:primaryType="ws:Assets"/> diff --git a/tests/content/src/main/content/jcr_root/content/os-triage/pages/.content.xml b/tests/content/src/main/content/jcr_root/content/os-triage/pages/.content.xml new file mode 100644 index 000000000..b1679c64b --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/os-triage/pages/.content.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:ws="http://ds.pl/websight" + jcr:primaryType="ws:Pages" + ws:template="/apps/typerefinery/templates/pagesspace"> + <incidents/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/os-triage/pages/incidents/.content.xml b/tests/content/src/main/content/jcr_root/content/os-triage/pages/incidents/.content.xml new file mode 100644 index 000000000..0e9d98491 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/os-triage/pages/incidents/.content.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-08-19T21:30:40.687+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Incidents" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-08-19T21:32:37.453+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/rootcontainer"> + <asideleft + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + cancelInheritParent="true" + classes="aside-left" + id="asideleft_DMHOYTZ2T"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_UQZPSOTK4"/> + </asideleft> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + cancelInheritParent="true" + id="header_GY91PKXMC"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_MDL1X75ZE"/> + </header> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + containerType="fullWidth" + decorationTagName="main" + id="main_H2XLSFGKM"/> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_AHTJZ3SSX"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/.content.xml index 6db81349b..043645878 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/.content.xml @@ -2,6 +2,6 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:ws="http://ds.pl/websight" jcr:primaryType="ws:PagesSpace" jcr:title="Typerefinery Showcase"> - <pages/> - <assets/> + <pages/> + <assets/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/assets/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/assets/.content.xml index 9e42a382f..c9b3b49a6 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/assets/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/assets/.content.xml @@ -1,3 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:ws="http://ds.pl/websight" - jcr:primaryType="ws:Assets"/> + jcr:primaryType="ws:Assets"> + <images/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/assets/images/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/assets/images/.content.xml index 8e689b737..aec96c300 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/assets/images/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/assets/images/.content.xml @@ -1,3 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="sling:OrderedFolder"/> + jcr:primaryType="sling:OrderedFolder"> + <typerefinery.png/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/.content.xml index 8479b3f8a..39c4a3d16 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/.content.xml @@ -2,4 +2,11 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:ws="http://ds.pl/websight" jcr:primaryType="ws:Pages" ws:template="/apps/typerefinery/templates/pagesspace"> + <components/> + <content/> + <forms/> + <os-intel/> + <os-triage/> + <pages/> + <test/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/.content.xml index 7c0eb47e7..01b3718b0 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/.content.xml @@ -2,13 +2,20 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:33.565+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Components" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <content/> + <flow/> + <forms/> + <graphs/> + <layout/> + <widgets/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/.content.xml index a8792cde5..64dfdfd1f 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/.content.xml @@ -1,16 +1,42 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Content" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <section jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"/> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Title component" /> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <card/> + <image/> + <tag/> + <text/> + <upload-file/> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:33.582+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Content" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_4KQN8EC2N"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_VKSOQX1EX"> + <section + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/section" + id="section_XFWEWUB3D"/> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + id="title_COXUSTCUP" + title="Title component"/> </container> </rootcontainer> </jcr:content> <title/> + <table/> + <embed/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/card/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/card/.content.xml index 0f5b067e6..88999cdea 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/card/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/card/.content.xml @@ -1,52 +1,59 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content - jcr:primaryType="ws:PageContent" - jcr:title="Card" - sling:resourceType="typerefinery/components/structure/page" - ws:template="/apps/typerefinery/templates/page"> - <rootcontainer - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/rootcontainer"> - <header jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/header" /> - <card - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/card" - lgColSize="{Long}3"> - <bodyContainer - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - id="bodyContainer_ERIJJQO0K"> - <cardTitle +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:33.612+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Card" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/title" - id="cardTitle_GGPPD7CTV" - title="Card Title" /> - <cardText - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/text" - classes="mb-3" - id="cardText_HXPBE1KM6" - text="Some quick example text to build on the card title and make up the bulk of the card's content. " - title="Card Text" /> - </bodyContainer> - <buttonContainer - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - classes="container-fluid" - id="buttonContainer_BWW3GYF6A" - title="Card Footer"> - <button1 - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/button" - id="button1_YA3LLYL9Z" /> - </buttonContainer> - </card> - <footer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/footer" /> - </rootcontainer> - </jcr:content> -</jcr:root> \ No newline at end of file + sling:resourceType="typerefinery/components/layout/rootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_4YCAL7UKI"/> + <card + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/card" + id="card_UBI7LCIBW" + lgColSize="{Long}3"> + <bodyContainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="bodyContainer_ERIJJQO0K"> + <cardTitle + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + id="cardTitle_GGPPD7CTV" + title="Card Title"/> + <cardText + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + classes="mb-3" + id="cardText_HXPBE1KM6" + text="Some quick example text to build on the card title and make up the bulk of the card's content. " + title="Card Text"/> + </bodyContainer> + <buttonContainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + classes="container-fluid" + id="buttonContainer_BWW3GYF6A" + title="Card Footer"> + <button1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + id="button1_YA3LLYL9Z" + persistColorWhenThemeSwitches="{Boolean}true"/> + </buttonContainer> + </card> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_9SKH5RPTH"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/.content.xml index fe6b2810b..60da22660 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/.content.xml @@ -2,10 +2,21 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2024-03-04T11:07:15.292+11:00" + jcr:lastModifiedBy="admin" jcr:primaryType="ws:PageContent" jcr:title="Embed" sling:resourceType="typerefinery/components/structure/page" - ws:template="/apps/typerefinery/templates/page"> + ws:lastModified="{Date}2024-03-04T11:10:14.232+11:00" + ws:lastModifiedBy="admin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> @@ -30,11 +41,13 @@ jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/embed" borderEnabled="false" + classes="\0" id="embed_SSRJRONQ2" marginEnabled="false" paddingEnabled="false" persistColorWhenThemeSwitches="false" - source="<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d10601.849068561562!2d144.95320519129666!3d-37.81467323756081!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x6ad646b5d2ba4df7%3A0x4045675218ccd90!2sMelbourne%20VIC!5e0!3m2!1sen!2sau!4v1709510888812!5m2!1sen!2sau" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>"/> + source="<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d10601.849068561562!2d144.95320519129666!3d-37.81467323756081!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x6ad646b5d2ba4df7%3A0x4045675218ccd90!2sMelbourne%20VIC!5e0!3m2!1sen!2sau!4v1709510888812!5m2!1sen!2sau" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>" + variant="\0"/> </container> <container_1 jcr:primaryType="nt:unstructured" @@ -50,6 +63,7 @@ sling:resourceType="typerefinery/components/content/embed" autoResize="false" borderEnabled="false" + classes="\0" height="300" id="embed_1E2Q4TQMD" marginEnabled="false" @@ -66,4 +80,9 @@ id="footer_0HDYMOOJD"/> </rootcontainer> </jcr:content> + <vizhub/> + <github/> + <codesandbox/> + <jsfiddle/> + <codepen/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/codepen/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/codepen/.content.xml new file mode 100644 index 000000000..784979dcb --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/codepen/.content.xml @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-05-23T10:37:56.507+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="CodePen" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-05-23T16:21:38.801+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_JTBHLNIX3"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_PYOSUQFSS"> + <two + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="{Boolean}true" + id="two_2DXFLCZZN"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + id="container1_CWXJXINKJ" + lgColSize="{Long}6" + mdColSize="{Long}6" + smColSize="{Long}6"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_LZ8IS8WAV" + isOutlinedButton="false" + label="Open Item" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="test_item" + name="\0" + nameCustom="OPEN_ITEM" + topic="OPEN_ITEM" + type="emit"/> + </_events_> + </button> + <embed_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + autoResize="true" + borderEnabled="false" + classes="\0" + height="\0" + id="embed_DAJIHC1MX" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + scrolling="no" + url="https://codepen.io/maxbarrass/embed/vYwKJbw?default-tab=result" + variant="iframe"/> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + id="container2_OIFJS7N18" + lgColSize="{Long}6" + mdColSize="{Long}6" + smColSize="{Long}6"> + <embed + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + id="embed_GFPVKVHAU"/> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + borderEnabled="false" + classes="\0" + id="accordion_BWUQHML3O" + isTemplated="false" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="test_item"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_66PPH5MDN" + text="<p>test_item</p>"/> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem2_3V6ZDG7FO"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_COTTARWGA"/> + </accordionitem2> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem3_8QUTZ6TC7"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_KQCAERU6D"/> + </accordionitem3> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="OPEN_ITEM" + config="\0" + name="\0" + nameCustom="OPEN_ITEM" + topic="OPEN_ITEM"/> + </_events_> + </accordion> + </container2> + </two> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_ZQFBU1YKN"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/codesandbox/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/codesandbox/.content.xml new file mode 100644 index 000000000..8f5adf802 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/codesandbox/.content.xml @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-05-23T10:37:56.507+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="CodeSandbox" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-05-23T16:20:59.045+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_JTBHLNIX3"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_PYOSUQFSS"> + <two + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="{Boolean}true" + id="two_2DXFLCZZN"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + id="container1_CWXJXINKJ" + lgColSize="{Long}6" + mdColSize="{Long}6" + smColSize="{Long}6"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_LZ8IS8WAV" + isOutlinedButton="false" + label="Open Item" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="test_item" + name="\0" + nameCustom="OPEN_ITEM" + topic="OPEN_ITEM" + type="emit"/> + </_events_> + </button> + <embed_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + autoResize="true" + borderEnabled="false" + classes="\0" + height="\0" + id="embed_DAJIHC1MX" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + scrolling="no" + url="https://73t82v.csb.app/widget.html" + variant="iframe"/> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + id="container2_OIFJS7N18" + lgColSize="{Long}6" + mdColSize="{Long}6" + smColSize="{Long}6"> + <embed + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + id="embed_GFPVKVHAU"/> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + borderEnabled="false" + classes="\0" + id="accordion_BWUQHML3O" + isTemplated="false" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="test_item"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_66PPH5MDN" + text="<p>test_item</p>"/> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem2_3V6ZDG7FO"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_COTTARWGA"/> + </accordionitem2> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem3_8QUTZ6TC7"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_KQCAERU6D"/> + </accordionitem3> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="OPEN_ITEM" + config="\0" + name="\0" + nameCustom="OPEN_ITEM" + topic="OPEN_ITEM"/> + </_events_> + </accordion> + </container2> + </two> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_ZQFBU1YKN"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/github/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/github/.content.xml new file mode 100644 index 000000000..5b8bfc821 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/github/.content.xml @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-05-23T10:37:56.507+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Github" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-05-23T16:20:18.996+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_JTBHLNIX3"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_PYOSUQFSS"> + <two + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="{Boolean}true" + id="two_2DXFLCZZN"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + id="container1_CWXJXINKJ" + lgColSize="{Long}6" + mdColSize="{Long}6" + smColSize="{Long}6"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_LZ8IS8WAV" + isOutlinedButton="false" + label="Open Item" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="test_item" + name="\0" + nameCustom="OPEN_ITEM" + topic="OPEN_ITEM" + type="emit"/> + </_events_> + </button> + <embed_1_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + autoResize="true" + borderEnabled="false" + classes="\0" + height="\0" + id="embed_DAJIHC1MX" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + scrolling="no" + url="https://typerefinery-ai.github.io/widget-parent-frame/" + variant="iframe"/> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + id="container2_OIFJS7N18" + lgColSize="{Long}6" + mdColSize="{Long}6" + smColSize="{Long}6"> + <embed + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + id="embed_GFPVKVHAU"/> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + borderEnabled="false" + classes="\0" + id="accordion_BWUQHML3O" + isTemplated="false" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="test_item"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_66PPH5MDN" + text="<p>test_item</p>"/> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem2_3V6ZDG7FO"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_COTTARWGA"/> + </accordionitem2> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem3_8QUTZ6TC7"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_KQCAERU6D"/> + </accordionitem3> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="OPEN_ITEM" + config="\0" + name="\0" + nameCustom="OPEN_ITEM" + topic="OPEN_ITEM"/> + </_events_> + </accordion> + </container2> + </two> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_ZQFBU1YKN"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/jsfiddle/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/jsfiddle/.content.xml new file mode 100644 index 000000000..d4a281d72 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/jsfiddle/.content.xml @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-05-23T10:37:56.507+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="JsFiddle" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-05-23T16:21:19.359+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_JTBHLNIX3"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_PYOSUQFSS"> + <two + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="{Boolean}true" + id="two_2DXFLCZZN"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + id="container1_CWXJXINKJ" + lgColSize="{Long}6" + mdColSize="{Long}6" + smColSize="{Long}6"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_LZ8IS8WAV" + isOutlinedButton="false" + label="Open Item" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="test_item" + name="\0" + nameCustom="OPEN_ITEM" + topic="OPEN_ITEM" + type="emit"/> + </_events_> + </button> + <embed_1_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + autoResize="true" + borderEnabled="false" + classes="\0" + height="\0" + id="embed_DAJIHC1MX" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + scrolling="no" + url="https://jsfiddle.net/mrwildone/dz506kpx/1/embedded/result/" + variant="iframe"/> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + id="container2_OIFJS7N18" + lgColSize="{Long}6" + mdColSize="{Long}6" + smColSize="{Long}6"> + <embed + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + id="embed_GFPVKVHAU"/> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + borderEnabled="false" + classes="\0" + id="accordion_BWUQHML3O" + isTemplated="false" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="test_item"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_66PPH5MDN" + text="<p>test_item</p>"/> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem2_3V6ZDG7FO"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_COTTARWGA"/> + </accordionitem2> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem3_8QUTZ6TC7"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_KQCAERU6D"/> + </accordionitem3> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="OPEN_ITEM" + config="\0" + name="\0" + nameCustom="OPEN_ITEM" + topic="OPEN_ITEM"/> + </_events_> + </accordion> + </container2> + </two> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_ZQFBU1YKN"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/vizhub/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/vizhub/.content.xml new file mode 100644 index 000000000..81dd3ef54 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/embed/vizhub/.content.xml @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-05-23T10:37:56.507+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="VizHub" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-05-23T16:18:23.691+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_JTBHLNIX3"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_PYOSUQFSS"> + <two + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="{Boolean}true" + id="two_2DXFLCZZN"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + id="container1_CWXJXINKJ" + lgColSize="{Long}6" + mdColSize="{Long}6" + smColSize="{Long}6"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_LZ8IS8WAV" + isOutlinedButton="false" + label="Open Item" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="test_item" + name="\0" + nameCustom="OPEN_ITEM" + topic="OPEN_ITEM" + type="emit"/> + </_events_> + </button> + <embed + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + autoResize="true" + borderEnabled="false" + classes="\0" + height="\0" + id="embed_DAJIHC1MX" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + scrolling="no" + url="https://vizhub.com/wildone/30bc05aacb934cddaec3894ef421c23d?mode=embed" + variant="iframe"/> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + id="container2_OIFJS7N18" + lgColSize="{Long}6" + mdColSize="{Long}6" + smColSize="{Long}6"> + <embed + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + id="embed_GFPVKVHAU"/> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + borderEnabled="false" + classes="\0" + id="accordion_BWUQHML3O" + isTemplated="false" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="test_item"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_66PPH5MDN" + text="<p>test_item</p>"/> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem2_3V6ZDG7FO"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_COTTARWGA"/> + </accordionitem2> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem3_8QUTZ6TC7"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_KQCAERU6D"/> + </accordionitem3> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="OPEN_ITEM" + config="\0" + name="\0" + nameCustom="OPEN_ITEM" + topic="OPEN_ITEM"/> + </_events_> + </accordion> + </container2> + </two> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_ZQFBU1YKN"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/image/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/image/.content.xml index d6284371e..ef605436b 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/image/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/image/.content.xml @@ -1,17 +1,39 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Image" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <section jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Image component" /> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text"/> - </section> - </container> - </rootcontainer> - </jcr:content> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:33.668+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Image" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_1PPHEEDIU"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_0AA01MXJS"> + <section + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/section" + id="section_W1PXFYA5K"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + id="title_VRPHNZKHL" + title="Image component"/> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_KHZCMZJNH"/> + </section> + </container> + </rootcontainer> + </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/table/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/table/.content.xml index ce7988bd6..ff244ccc4 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/table/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/table/.content.xml @@ -1,16 +1,103 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Title" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <section jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title"/> - </section> - </container> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-01-22T08:24:36.163+11:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Table" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-03-12T16:23:44.712+11:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_RJUKLVSKC"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_LJQEXZ1Q7"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_FLCMAHMNG"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_VFHQOU0ZU" + text="<p>Table</p>"/> + <table + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/table" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="2024-03-12T05:04:44.240Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff1ac25002ya50d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f1ac25002ya50d" + flowapi_group="/content/typerefinery-showcase/pages/components/content/table/_jcr_content/rootcontainer/main/container/table" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/content/table/_jcr_content/rootcontainer/main/container/table/{{id}}" + flowapi_iscontainer="false" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + flowapi_title="Table flow" + flowapi_topic="table_6a056ceba2fa473e89c528da67c684f1" + flowapi_updatedon="\0" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="table_8GQ29FHGD" + marginEnabled="false" + multipleSelectRowEnabled="false" + name="\0" + overRideColumns="{Boolean}false" + paddingEnabled="false" + paginationEnabled="false" + persistColorWhenThemeSwitches="false" + resizableEnabled="false" + searchEnabled="false" + showActionButtons="false" + singleSelectEnabled="false" + uniqueIdColumn="\0" + websocketHost="\0" + websocketTopic="\0"> + <events jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="\0"/> + </events> + <columns jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + field="name" + title="First Name" + type="\0"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + field="email" + title="Email" + type="\0"/> + </columns> + </table> + </container> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_NUHKROSFD"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/tag/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/tag/.content.xml index 7febdfe61..107aeeb09 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/tag/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/tag/.content.xml @@ -1,15 +1,31 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Tag" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <section jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title"/> - <tag jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/tag"/> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:33.697+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Tag" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container"> + <section + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/section"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title"/> + <tag + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/tag"/> </section> </container> </rootcontainer> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/text/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/text/.content.xml index 529692b3c..a3a6ff38d 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/text/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/text/.content.xml @@ -1,21 +1,45 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Text" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <section jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Text component" /> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text"/> - </section> - <section1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" text="Rich Text"/> - </section1> - </container> - <footer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/footer"/> - </rootcontainer> - </jcr:content> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:33.722+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Text" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container"> + <section + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/section"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + title="Text component"/> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text"/> + </section> + <section1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/section"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + text="Rich Text"/> + </section1> + </container> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer"/> + </rootcontainer> + </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/title/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/title/.content.xml index ce7988bd6..f8eee9056 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/title/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/title/.content.xml @@ -1,14 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Title" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <section jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title"/> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:33.761+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Title" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container"> + <section + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/section"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title"/> </section> </container> </rootcontainer> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/upload-file/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/upload-file/.content.xml index ae28df1a4..a02df5f52 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/upload-file/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/content/upload-file/.content.xml @@ -1,20 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:33.787+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Upload File" sling:resourceType="typerefinery/components/structure/page" - ws:template="/apps/typerefinery/templates/page" - > + ws:template="/apps/typerefinery/templates/page"> <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header" - id="header_NPGB9QTQ6" /> + id="header_NPGB9QTQ6"/> <main jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/main" @@ -22,7 +22,7 @@ <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" - id="title_OEHORDEIT" /> + id="title_OEHORDEIT"/> <fileupload jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fileupload" @@ -32,17 +32,17 @@ sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="true" id="label_DLECGSBUJ" - title="Label" /> + title="Label"/> <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/fileupload" - title="Field" /> + title="Field"/> </fileupload> </main> <footer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/footer" - id="footer_ATMRJHFOH" /> + id="footer_ATMRJHFOH"/> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/flow/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/flow/.content.xml index 56d59292b..a48ebe9f5 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/flow/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/flow/.content.xml @@ -43,20 +43,20 @@ <ticker jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" - flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/widget.json" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/widget.json" id="ticker_GKU7ITWUJ"/> <ticker_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" - flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/widget.json" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/widget.json" id="ticker_1_0GHKAJZNF"/> <ticker_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" - flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/widget.json" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/widget.json" id="ticker_2_0GWHOCC6B"/> </flowcontainer> </main> @@ -66,4 +66,5 @@ id="footer_40IAPOQCO"/> </rootcontainer> </jcr:content> + <flowform/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/.content.xml index 31239f4fb..0947617b2 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/.content.xml @@ -1,88 +1,635 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" - jcr:title="Form" - sling:resourceType="typerefinery/components/structure/page" - ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/header" /> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container"> - <form jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/form" - writePayloadType="application/json" - writeMethod="POST" - writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/" - readMethod="GET" - readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/"> - <title jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/title" - title="Personal Information" /> - <input_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/label" - label="First Name" /> - <field jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/input" - name="firstName" - inputType="text" - placeholder="Eg. John" /> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.033+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Form" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-04-16T11:42:12.775+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_L3F78WLBJ"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_WRGFBVOL4"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_createdon="2024-02-07T22:56:52.025Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff19b3w001tj51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f19b3w001tj51d" + flowapi_group="/content/typerefinery-showcase/pages/components/forms/_jcr_content/rootcontainer/container/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/_jcr_content/rootcontainer/container/form/{{id}}" + flowapi_iscontainer="false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_fafba38087f746c482b546837af7bfa0" + flowapi_updatedon="\0" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_NVN6J0A1C" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readEmitEvent="false" + readMethod="GET" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/_jcr_content/rootcontainer/container/form/{{id}}" + title="Form flow" + writeMethod="POST" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/_jcr_content/rootcontainer/container/form/{{id}}"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + id="title_W9MS7QJWU" + title="Personal Information"/> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_AEYT5TVB6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_NEVA22YMK" + label="First Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_NUSGP7DSF" + inputType="text" + name="firstName" + placeholder="Eg. John"/> </input_1> - <input_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/label" - label="Second Name" /> - <field jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/input" - name="secondName" - inputType="text" - placeholder="Eg. Peter" /> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2_UFYLKJ70M"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_EOVIS9LTY" + label="Second Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_TAEOEVUZW" + inputType="text" + name="secondName" + placeholder="Eg. Peter"/> </input_2> - <input_3 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/label" - label="Email Address" /> - <field jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/input" - name="email" - inputType="email" - placeholder="Eg. john@gmail.com" /> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_3_P4Y07RYKX"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_H9N43URDD" + label="Email Address"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_FD40B7GJA" + inputType="email" + name="email" + placeholder="Eg. john@gmail.com"/> </input_3> - <input_4 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/label" - label="Date of Birth" /> - <field jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/input" - name="dob" - inputType="date" - placeholder="" /> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_DLJACPAGI" + label="Code"/> + <editor + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/editor" + id="editor_4CH5HDPLO" + name="editorcode"/> + <label_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_1_O6RA1QKDF" + label="Text Editor"/> + <editor_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/editor" + id="editor_1_UAGL2A2DY" + name="editortext" + variant="TEXT_EDITOR"/> + <select + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_YJ4TDHLOP"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_32X8ZLVFQ" + label="Select Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + borderEnabled="false" + classes="\0" + defaultSelectedOptions="\0" + disabled="false" + id="field_PNMPOV5HJ" + keyNameInOptionList="\0" + label="Select" + labelNameInOptionList="\0" + marginEnabled="false" + multipleSelection="false" + name="sel" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="\0" + readOptionsFromDataSource="\0" + validationRequired="false"> + <selectOptions jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + label="a" + value="a"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + label="b" + value="b"/> + </selectOptions> + </field> + </select> + <textarea_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_1_DCHJI5TFG"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + id="label_CPYDCI9CU" + label="Textarea Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_HZ4IPBHI2" + label="Textarea" + name="textarea"/> + </textarea_1> + <input_8 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_8_R2FVDTZ3M"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_EWG1R3Q83" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_IUOTNFH9Z" + label="Input"/> + </input_8> + <input_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_4_S7KMEDL6F"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_OI8I797B0" + label="Date of Birth"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_ACI4HB1IO" + inputType="date" + name="dob" + placeholder="\0"/> </input_4> - <input_5 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/checkbox"> - <label jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/label" - label="Receive Updates" /> - <field jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/checkbox" - name="reciveUpdates" /> + <input_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/checkbox" + id="input_5_KGDNPWUNT"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_NQCSDSC6J" + label="Receive Updates"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/checkbox" + id="field_W528LOJWS" + name="reciveUpdates"/> </input_5> - <button jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/button" - type="submit" - label="Update Profile" /> + <radio_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/radio" + id="radio_1_RKDL3TUCM"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_GFKCJYRNW" + label="Radio Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/radio" + id="field_RHWL6JOMZ" + label="Radio"/> + </radio_1> + <radio + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/radio" + id="radio_TIYA6O25Q"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_P6023XSC9" + label="Radio Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/radio" + id="field_NQOG5ZNZO" + label="Radio"/> + </radio> + <radio_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/radio" + id="radio_2_JJF4QI9MM"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_EZQV2QPAC" + label="Radio Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/radio" + id="field_BDDTXQEG6" + label="Radio" + name="ra" + value="a"/> + </radio_2> + <radio_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/radio" + id="radio_3_VHCMH8EAU"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_8GQ79CIQK" + label="Radio Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/radio" + id="field_HYJ4WKBE5" + label="Radio" + name="ra" + value="b"/> + </radio_3> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_0TB0YNCWQ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_297G3AUDR" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_LPPBYD85D" + label="Input"/> + </input> + <checkbox + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/checkbox" + id="checkbox_XK2GGLBAR"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_SXQ0KB2EK" + label="Checkbox Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/checkbox" + id="field_PCIGN1V5L" + label="Checkbox"/> + </checkbox> + <textarea + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_L98HLHTET"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + id="label_8WWASYFGA" + label="Textarea Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_GKKSWYWVK" + label="Textarea"/> + </textarea> + <input_6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_6_8AYYVY7MZ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_PJ97PVT8K" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_OLLZZ8TGF" + label="Input"/> + </input_6> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="FORM_SUCCESS" + name="\0" + nameCustom="test" + topic="aaa" + type="emit"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + action="FORM_SUCCESS" + name="createitem" + nameCustom="\0" + topic="bbb" + type="emit"/> + </_events_> + <input_7 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_7_6GA6QRJTD"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_3VCFSIRZT" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_TUXTRHYR0" + label="Input" + name="ci"/> + </input_7> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_CP1SEPEXC"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_WA2KWYU6L" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_ZRZTSBFIG" + label="Composite Field" + name="compositefield"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_7W7SDWMMO"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_KAMB8TGBZ" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_VI5QYNRXB" + label="Input" + name="ci"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_LE78PYRCB"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_7INNX6G7U" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_1QRSTXXLQ" + label="Input" + name="ci2"/> + </input_1> + </field> + </composite> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_LXFFELZSL"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_FI4IQ5ESO" + label="Container"/> + <textarea_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_1_RDGLC0CHQ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + id="label_KHWUADU8G" + label="C t1"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_LIEACCYUT" + label="Textarea"/> + </textarea_1> + <textarea_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_2_RCEIAGMTJ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + id="label_R7D2JEYEH" + label="C t2"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_F01ONDMQT" + label="Textarea"/> + </textarea_2> + <textarea + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_KVK2SUO0F"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + id="label_J0C6FOBSV" + label="C t0"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_XE5HBXDT8" + label="Textarea"/> + </textarea> + </container> + <label_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_2_FGNYC8K2Y"/> + <textarea_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_3_M6R3EIHUS"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + id="label_WIZSYPKTG" + label="Textarea Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_18QBA5BZR" + label="Textarea"/> + </textarea_3> + <textarea_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_4_NGKNXC3RZ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + id="label_1B8SLLLRG" + label="Textarea Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_QWLGIS2EK" + label="Textarea"/> + </textarea_4> + <textarea_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_2_PKQITEUNZ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + id="label_OGLD3P9PW" + label="Textarea Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_UAL8J7SAQ" + label="Textarea" + name="ta2"/> + </textarea_2> + <container_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_LXFFELZSL"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_FI4IQ5ESO" + label="Container"/> + <textarea_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_1_RDGLC0CHQ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + id="label_KHWUADU8G" + label="C t1"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_8J0NFAPTO" + label="Textarea"/> + </textarea_1> + <textarea_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_2_RCEIAGMTJ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + id="label_R7D2JEYEH" + label="C t2"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_VUPSWJLWL" + label="Textarea"/> + </textarea_2> + <textarea + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_KVK2SUO0F"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + id="label_J0C6FOBSV" + label="C t0"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_O9YNGAYYQ" + label="Textarea"/> + </textarea> + </container_1> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + id="button_PAP7KQNJI" + label="Update Profile" + persistColorWhenThemeSwitches="{Boolean}true" + type="submit"/> </form> </container> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file + <button/> + <checkbox/> + <fileupload/> + <input/> + <radiobutton/> + <select/> + <textarea/> + <form-events/> + <composite/> + <forms-test/> + <composite-list/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/button/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/button/.content.xml index b5a07205a..182be8254 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/button/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/button/.content.xml @@ -1,43 +1,140 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Button" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <form1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/form"> - <container_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" variant="sectionwithtitle" title="Available Button Types"> - <button_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" label="Start" lgColSize="3" buttonStyle="primary"> - </button_1> - <button_1_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" label="Navigate" lgColSize="3" buttonStyle="primary"> - </button_1_2> - <button_1_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" label="Action" lgColSize="3" buttonStyle="primary"> - </button_1_3> - </container_1> - <container_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" variant="sectionwithtitle" title="Available Button Style"> - <button_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" label="Success" buttonStyle="success" lgColSize="3"> - </button_2> - <button_2_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" label="Secoundary" buttonStyle="secondary" lgColSize="3"> - </button_2_1> - <button_2_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" label="Click edit -> Style -> select variants" lgColSize="3" buttonStyle="primary"> - </button_2_2> - </container_2> - <title3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Available Action Button Types" headingSize="h4" /> - <container_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" > - <button_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" label="Open Model" lgColSize="3" buttonStyle="primary"> - </button_3> - <button_3_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" label="Open DropDown" lgColSize="3" buttonStyle="primary"> - </button_3_1> - </container_3> - <container_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" variant="sectionwithtitle" title="Button with variant"> - <button_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" label="Click edit -> General -> select variant -> Hamburger" lgColSize="3" buttonStyle="primary"> - </button_4> - - </container_4> - </form1> - </container> - </rootcontainer> - </jcr:content> -</jcr:root> \ No newline at end of file +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.101+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Button" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_XIL1TKDQR"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_MXIOWI04X"> + <form1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + id="form1_EWQVHWNHH"> + <container_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_1_9N33EIOZG" + title="Available Button Types" + variant="sectionwithtitle"> + <button_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="primary" + id="button_1_QGGWD7817" + label="Start" + lgColSize="3" + persistColorWhenThemeSwitches="{Boolean}true"/> + <button_1_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="primary" + id="button_1_2_OW6WKNSTH" + label="Navigate" + lgColSize="3" + persistColorWhenThemeSwitches="{Boolean}true"/> + <button_1_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="primary" + id="button_1_3_JW0VM4RRH" + label="Action" + lgColSize="3" + persistColorWhenThemeSwitches="{Boolean}true"/> + </container_1> + <container_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_2_KGHWCBR3W" + title="Available Button Style" + variant="sectionwithtitle"> + <button_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="success" + id="button_2_PWOMEZDUA" + label="Success" + lgColSize="3" + persistColorWhenThemeSwitches="{Boolean}true"/> + <button_2_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="secondary" + id="button_2_1_RDNBRZSM2" + label="Secoundary" + lgColSize="3" + persistColorWhenThemeSwitches="{Boolean}true"/> + <button_2_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="primary" + id="button_2_2_FPXD3LAWK" + label="Click edit -> Style -> select variants" + lgColSize="3" + persistColorWhenThemeSwitches="{Boolean}true"/> + </container_2> + <title3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingSize="h4" + id="title3_QXHVYZM9Q" + title="Available Action Button Types"/> + <container_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_3_LBD9H9FWI"> + <button_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="primary" + id="button_3_WJLYOHXKX" + label="Open Model" + lgColSize="3" + persistColorWhenThemeSwitches="{Boolean}true"/> + <button_3_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="primary" + id="button_3_1_VBBW5JMJG" + label="Open DropDown" + lgColSize="3" + persistColorWhenThemeSwitches="{Boolean}true"/> + </container_3> + <container_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_4_STW6K6LYV" + title="Button with variant" + variant="sectionwithtitle"> + <button_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="primary" + id="button_4_UTOLDJME2" + label="Click edit -> General -> select variant -> Hamburger" + lgColSize="3" + persistColorWhenThemeSwitches="{Boolean}true"/> + </container_4> + </form1> + </container> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/checkbox/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/checkbox/.content.xml index edc29b433..08745c43e 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/checkbox/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/checkbox/.content.xml @@ -1,30 +1,76 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Checkbox" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <form1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/form"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Checkbox With Label" headingSize="h4" /> - <label1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Select User Tech Skill"/> - <checkbox_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/checkbox"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Vue JS" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/checkbox"/> - </checkbox_1> - <checkbox_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/checkbox"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="React" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/checkbox"/> - </checkbox_2> - <title2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Checkbox With Hidden Label" headingSize="h4" /> - <checkbox_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/checkbox"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Subscribe" hideLabel="true" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/checkbox"/> - </checkbox_3> - </form1> - </container> - </rootcontainer> - </jcr:content> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.177+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Checkbox" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container"> + <form1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + id="form1_VWML1OGNY"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingSize="h4" + title="Checkbox With Label"/> + <label1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Select User Tech Skill"/> + <checkbox_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/checkbox"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Vue JS"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/checkbox"/> + </checkbox_1> + <checkbox_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/checkbox"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="React"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/checkbox"/> + </checkbox_2> + <title2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingSize="h4" + title="Checkbox With Hidden Label"/> + <checkbox_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/checkbox"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + label="Subscribe"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/checkbox"/> + </checkbox_3> + </form1> + </container> + </rootcontainer> + </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/composite-list/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/composite-list/.content.xml new file mode 100644 index 000000000..9b78712f7 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/composite-list/.content.xml @@ -0,0 +1,240 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-04-22T20:58:20.325+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Composite List" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-04-23T23:28:57.369+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_IK7FGPSCG"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_DFNNOIXT5" + roleOther="\0" + roleSelect="\0"> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_CNLOEVJ2C"> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + label="Composite Field"/> + </composite> + <composite_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + label="Composite Field"/> + </composite_2> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Composite"/> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + label="Composite Field"/> + </composite_1> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_RPOYFTM9E" + inputType="list" + label="Composite Field" + listIsUserReadonly="false" + name="compositelistreadonly"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_8SIC7FXJ4" + lgColSize="4" + mdColSize="12" + smColSize="12"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_7U0EWO48I" + label="Input" + name="fielda" + placeholder="fielda"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_BTMSVTELQ" + lgColSize="4" + mdColSize="12" + smColSize="12"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_VFJ2Q7NMI" + label="Input" + name="fieldb" + placeholder="fieldb"/> + </input_1> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2_WVHCK5OK7" + lgColSize="4"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_CS5KDDVCY" + label="Input" + name="fieldc" + placeholder="fieldc"/> + </input_2> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_E552M0WRI"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_3OVVZEANV" + label="Composite Field"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_VQTWPLOKP"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_SVXQYULN7" + label="Input" + name="c1"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_77YLWGJLX"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_OFSSDUTDZ" + label="Input" + name="c2"/> + </input_1> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2_KP53UA1LT"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_VVRIHOEHT" + label="Input" + name="c3"/> + </input_2> + </field> + </composite> + </field> + </composite> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_A7SGGQA34"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_UGSMFY8ZK" + label="Composite Field"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_ZFQLVZNTM"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_2GWNU8NAT" + label="Input" + name="fieldxx" + placeholder="fieldxx"/> + </input> + </field> + </composite_1> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_Z7MJSLYTZ"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/composite/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/composite/.content.xml new file mode 100644 index 000000000..d06444d61 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/composite/.content.xml @@ -0,0 +1,469 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-03-25T15:06:40.120+11:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Composite" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-03-27T02:08:05.813+11:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_WZHPUYSTY"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_716GSIGCM"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_createdon="2024-03-25T04:10:51.408Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff1aqgm001nx51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f1aqgm001nx51d" + flowapi_group="/content/typerefinery-showcase/pages/components/forms/composite/_jcr_content/rootcontainer/main/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/composite/_jcr_content/rootcontainer/main/form/{{id}}" + flowapi_iscontainer="false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_11ccbd55dd4545948dbf2b3df55b852a" + flowapi_updatedon="\0" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_V4E827GND" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readEmitEvent="false" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/composite/_jcr_content/rootcontainer/main/form/{{id}}" + title="Form flow" + writeMethod="POST" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/composite/_jcr_content/rootcontainer/main/form/{{id}}"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_E28FZ9QKR"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_SC3LQNRPE" + label="Field A"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_HGZF74YTP" + label="Input" + name="fielda"/> + </input> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_GYNIHVPWR"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_5SDKJYCNW" + label="Composite Field" + name="fieldc"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_UQ3YP0ARX"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_YOWBCYEJ4" + label="Field C - input A"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_WCF6QPNMB" + label="Input" + name="fieldcinputa"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_73CM0ZNVZ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_LBIQCTHL4" + label="Field C - input B"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_AXJQDMZSH" + label="Input" + name="fieldcinputb"/> + </input_1> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2_TVZHY0MYT"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_VPZ9UGT9W" + label="Field C - input C"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_XOYUSFTTT" + label="Input" + name="fieldcinputc"/> + </input_2> + </field> + </composite> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_UAULTE0BB"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_QDMKYBWRO" + label="Field B"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_CFHXPLBAD" + label="Input" + name="fieldb"/> + </input_1> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="submit" + classes="\0" + hideButtonLabel="false" + id="button_ICNSZAGWO" + isOutlinedButton="false" + label="Submit" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false"/> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="FORM_SUCCESS" + topic="\0" + type="emit"/> + </_events_> + </form> + <table + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/table" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="\0" + flowapi_designtemplate="\0" + flowapi_editurl="\0" + flowapi_enable="false" + flowapi_flowstreamid="\0" + flowapi_group="\0" + flowapi_httproute="\0" + flowapi_iscontainer="\0" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + flowapi_title="\0" + flowapi_topic="\0" + flowapi_updatedon="\0" + id="table_T0N6TBDAG" + marginEnabled="false" + multipleSelectRowEnabled="false" + name="\0" + overRideColumns="{Boolean}true" + paddingEnabled="false" + paginationEnabled="false" + persistColorWhenThemeSwitches="false" + resizableEnabled="false" + searchEnabled="false" + showActionButtons="false" + singleSelectEnabled="false" + uniqueIdColumn="\0" + websocketHost="\0" + websocketTopic="\0"> + <events jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="test" + value="addnewitem"/> + </events> + </table> + <form_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + flowapi_createdon="2024-03-25T12:18:55.431Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff1aqu6003nx51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f1aqu6003nx51d" + flowapi_group="/content/typerefinery-showcase/pages/components/forms/composite/_jcr_content/rootcontainer/main/form_1" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/composite/_jcr_content/rootcontainer/main/form_1/{{id}}" + flowapi_httproutenosfx="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/composite/_jcr_content/rootcontainer/main/form_1" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_69d69eadd0b8405c9b57a68cdf3f0f6a" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_YTUUHJ9DV" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/composite/_jcr_content/rootcontainer/main/form_1/{{id}}" + title="Form flow" + writeMethod="POST" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/composite/_jcr_content/rootcontainer/main/form_1/{{id}}"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_QFJMIBULY"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_OBD0UNQIO" + label="Input" + name="fieldname"/> + </input> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="submit" + classes="\0" + hideButtonLabel="false" + id="button_7WATXPFUN" + isOutlinedButton="false" + label="Submit" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false"/> + <killchainphase + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/composite/killchainphase" + id="killchainphase_AIZR22G6W"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Kill Chain Phase"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/composite" + id="field_CIGFWQARH" + inputType="killchainphase" + label="Kill Chain Phase Field"> + <kill_chain_name + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="kill_chain_name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="kill_chain_name" + name="kill_chain_name"/> + </kill_chain_name> + <phase_name + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="phase_name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="phase_name" + name="phase_name"/> + </phase_name> + </field> + </killchainphase> + <granularmarking + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/composite/granularmarking" + id="granularmarking_SNGXMXGDM"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Granular Marking"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/composite" + id="field_GH32A6GEB" + inputType="granularmarking" + label="Granular Marking Field"> + <lang + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="lang"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="lang" + name="lang"/> + </lang> + <marking_ref + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="marking_ref"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="marking_ref" + name="marking_ref"/> + </marking_ref> + <selectors + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="selectors"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="selectors" + name="selectors"/> + </selectors> + </field> + </granularmarking> + <externalreference + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/composite/externalreference" + id="externalreference_2DVVMDT1Q"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="External Reference"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/composite" + id="field_0DXOFIGER" + inputType="externalreference" + label="External Reference Field"> + <source_name + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="source_name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="source_name" + name="source_name"/> + </source_name> + <description + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="description" + name="description"/> + </description> + <url + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="url"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="url" + name="url"/> + </url> + <hashes + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="hashes"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="hashes" + name="hashes"/> + </hashes> + <external_id + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="external_id"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="external_id" + name="external_id"/> + </external_id> + </field> + </externalreference> + </form_1> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_TWARROHOE"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/form-events/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/form-events/.content.xml new file mode 100644 index 000000000..e661e4f1f --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/form-events/.content.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-03-12T15:50:18.434+11:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Form Events" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-03-12T15:59:16.235+11:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_SIBWG4QG2"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_NYOXTBBD3"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + id="form_JDZQ3SJGR"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_DPNDZFR2B"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + title="Field"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_OF71WQUOW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + title="Field"/> + </input_1> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + id="button_XMDYX4UVB" + persistColorWhenThemeSwitches="{Boolean}true"/> + </form> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_FVXTBGIIZ"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/forms-test/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/forms-test/.content.xml new file mode 100644 index 000000000..52b2d8338 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/forms-test/.content.xml @@ -0,0 +1,599 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-04-17T21:13:59.845+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Forms Test" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-04-17T23:05:56.180+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/rootcontainer"> + <asideleft + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + classes="aside-left" + id="asideleft_IYOVG11HR"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_LWGBNSDYU"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + containerType="fullWidth" + decorationTagName="main" + id="main_LJCTMILAQ"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + flowapi_createdon="2024-04-17T12:17:00.378Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff1bge5001ny51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f1bge5001ny51d" + flowapi_group="/content/typerefinery-showcase/pages/components/forms/forms-test/_jcr_content/rootcontainer/main/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/forms-test/_jcr_content/rootcontainer/main/form/{{id}}" + flowapi_httproutenosfx="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/forms-test/_jcr_content/rootcontainer/main/form" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_4e4a0ca3418c4332aafe44b49ff71f6d" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_MDL8OP1TZ" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/forms-test/_jcr_content/rootcontainer/main/form/{{id}}" + title="Form flow" + writeMethod="POST" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/forms-test/_jcr_content/rootcontainer/main/form/{{id}}"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_KDKQTIGOQ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_FOCRHMNDF" + label="Input" + name="text"/> + </input> + <textarea + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_ZKBMZNYB1"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + label="Textarea Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_FRTWM4KNZ" + label="Textarea" + name="textarea"/> + </textarea> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_ALXJSMTO7" + label="Write some"/> + <editor + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/editor" + id="editor_XK0MVNCJW" + name="writesome" + variant="TEXT_EDITOR"/> + <select + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_T3BOFBAE2"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Select Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + id="field_LSMTSFHMD" + label="Select" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/forms/forms-test/_jcr_content/rootcontainer/main/form/selectdata"/> + </select> + <label_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_2_K8RKZDZBD" + label="Base"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_GX0AP9R2X"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + flexEnabled="true" + id="input_4CYDUPIEN" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + label="Input"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + flexEnabled="true" + id="input_1_3DDOQ9ZFT" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + label="Input"/> + </input_1> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + flexEnabled="true" + id="input_2_CNTGXNAX1" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + label="Input"/> + </input_2> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + flexEnabled="true" + id="input_3_XOZMJFBR2" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + label="Input"/> + </input_3> + </container> + <label_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_1_CYQP4SXW0" + label="Give me some"/> + <editor_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/editor" + id="editor_1_VF1TF7DXC" + name="getsomecode"/> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_O5IPHCYVT"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_UNHAAKYA8" + label="Composite Field" + lgColSize="12" + mdColSize="12" + name="comp1" + smColSize="12"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HWZEVP97O"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_GI1VQWTMA" + label="Input" + name="fielda"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_PF9KKNXFF"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_H5R5WYG7T" + label="Input" + name="fieldb"/> + </input_1> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_YN48OHLVR"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_RSVMKLSIH" + label="Composite Field" + name="sub"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_6YQSMPVAM"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_TQ4GGXOTZ" + label="Input" + name="ddd"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_IBXPF4QZE"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_Y0TNAONK6" + label="Input" + name="asfasfas"/> + </input_1> + </field> + </composite> + </field> + </composite> + <embeddedobject + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/embeddedobject" + id="embeddedobject_QBZIAATOG"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Embedded Object"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="embeddedobject" + label="Embedded Object"/> + </embeddedobject> + <float + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/float" + id="float_L7QOOR9VT"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Float"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="float" + label="Float"/> + </float> + <killchainphase + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/composite/killchainphase" + id="killchainphase_0LMI7UXWQ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Kill Chain Phase"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/composite" + id="field_FCWYLGAVT" + inputType="killchainphase" + label="Kill Chain Phase Field"> + <kill_chain_name + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="kill_chain_name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="kill_chain_name" + name="kill_chain_name"/> + </kill_chain_name> + <phase_name + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="phase_name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="phase_name" + name="phase_name"/> + </phase_name> + </field> + </killchainphase> + <granularmarking + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/composite/granularmarking" + id="granularmarking_QPEABRLMN"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Granular Marking"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/composite" + id="field_BCPDB4R9D" + inputType="granularmarking" + label="Granular Marking Field"> + <lang + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="lang"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="lang" + name="lang"/> + </lang> + <marking_ref + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="marking_ref"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="marking_ref" + name="marking_ref"/> + </marking_ref> + <selectors + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="selectors"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="selectors" + name="selectors"/> + </selectors> + </field> + </granularmarking> + <externalreference + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/composite/externalreference" + id="externalreference_SDHKM1JNQ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="External Reference"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/composite" + id="field_TVBCBKHUT" + inputType="externalreference" + label="External Reference Field"> + <source_name + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="source_name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="source_name" + name="source_name"/> + </source_name> + <description + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="description" + name="description"/> + </description> + <url + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="url"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="url" + name="url"/> + </url> + <hashes + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="hashes"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="hashes" + name="hashes"/> + </hashes> + <external_id + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="external_id"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + inputType="string" + label="external_id" + name="external_id"/> + </external_id> + </field> + </externalreference> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="submit" + classes="\0" + hideButtonLabel="false" + id="button_C4E4XNDHZ" + isOutlinedButton="false" + label="Submit" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false"/> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + id="accordion_BSAVPTSSD"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem1_9ZOZ6FLXZ"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_WWW0GTKJW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + label="Input"/> + </input> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem2_NO2DXTHR4"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_9FDWNUKYF"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + label="Input"/> + </input> + </accordionitem2> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem3_3HEOEIYCH"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_92EMDQUPG"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + label="Input"/> + </input> + </accordionitem3> + </accordion> + </form> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_3O0HTIIWY"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/input/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/input/.content.xml index 65a074391..00e84041e 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/input/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/input/.content.xml @@ -1,41 +1,116 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Input" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <form1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/form"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Type of Input Field" headingSize="h4" /> - <input_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter Email Address"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" inputType="email" placeholder="Eg. test@example.com"/> - </input_1> - <input_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter Name"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" inputType="text" placeholder="Eg. John Henry"/> - </input_2> - <input_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter Phone Number"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" inputType="tel" placeholder="Eg. 65412441245"/> - </input_3> - <input_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter Date of Birth" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" inputType="date"/> - </input_4> - <input_5 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter Password" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" inputType="password" placeholder="Eg. 123456" /> - </input_5> - <title1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Input Field With hidden Label" headingSize="h4" /> - <input_6 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter Name" hideLabel="true" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" inputType="text" placeholder="Click on edit -> toggle hide Label to show/hide label"/> - </input_6> - </form1> - </container> - </rootcontainer> - </jcr:content> -</jcr:root> \ No newline at end of file +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.277+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Input" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container"> + <form1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + id="form1_ILMQCNVCH"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingSize="h4" + title="Type of Input Field"/> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter Email Address"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + inputType="email" + placeholder="Eg. test@example.com"/> + </input_1> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + inputType="text" + placeholder="Eg. John Henry"/> + </input_2> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter Phone Number"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + inputType="tel" + placeholder="Eg. 65412441245"/> + </input_3> + <input_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter Date of Birth"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + inputType="date"/> + </input_4> + <input_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter Password"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + inputType="password" + placeholder="Eg. 123456"/> + </input_5> + <title1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingSize="h4" + title="Input Field With hidden Label"/> + <input_6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + label="Enter Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + inputType="text" + placeholder="Click on edit -> toggle hide Label to show/hide label"/> + </input_6> + </form1> + </container> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/radiobutton/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/radiobutton/.content.xml index d30bb9201..18f997c93 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/radiobutton/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/radiobutton/.content.xml @@ -1,47 +1,122 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Radio" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <form1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/form"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Radio" headingLevel="XL" /> - <label1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Select User Dress Color" /> - <radio_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/radio"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Red" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/radio"/> - </radio_1> - <radio_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/radio"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Black" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/radio"/> - </radio_2> - <radio_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/radio"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Blue" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/radio"/> - </radio_3> - <label2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Select User Age" /> - <radio_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/radio"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Below 18" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/radio"/> - </radio_4> - <radio_5 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/radio"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Above 18" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/radio"/> - </radio_5> - <label3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Apply New Terms and Conditions" /> - <radio_6 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/radio"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Agree" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/radio"/> - </radio_6> - <radio_7 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/radio"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Disagree" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/radio"/> - </radio_7> - </form1> - </container> - </rootcontainer> - </jcr:content> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.352+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Radio" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container"> + <form1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + id="form1_BG703DQMV"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="XL" + title="Radio"/> + <label1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Select User Dress Color"/> + <radio_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/radio"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Red"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/radio"/> + </radio_1> + <radio_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/radio"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Black"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/radio"/> + </radio_2> + <radio_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/radio"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Blue"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/radio"/> + </radio_3> + <label2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Select User Age"/> + <radio_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/radio"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Below 18"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/radio"/> + </radio_4> + <radio_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/radio"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Above 18"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/radio"/> + </radio_5> + <label3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Apply New Terms and Conditions"/> + <radio_6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/radio"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Agree"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/radio"/> + </radio_6> + <radio_7 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/radio"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Disagree"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/radio"/> + </radio_7> + </form1> + </container> + </rootcontainer> + </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/select/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/select/.content.xml index 271c5f323..50fabcf96 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/select/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/select/.content.xml @@ -1,36 +1,134 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Select" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <form1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/form"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Select" headingLevel="XL" /> - <select_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/select"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Select User Age" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/select" placeholder="Age" /> - </select_1> - <select_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/select"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Select Country Code" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/select" placeholder="Country Code" /> - </select_2> - <select_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/select"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Select User City" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/select" placeholder="Cities" /> - </select_3> - <select_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/select"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Select User Database Number" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/select" placeholder="Database Number" /> - </select_4> - <select_5 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/select"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Select Roll Number" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/select" placeholder="Roll Number" /> - </select_5> - </form1> - </container> - </rootcontainer> - </jcr:content> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.443+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Select" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-05-07T23:51:47.747+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_Q86EYZOUW"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_NKNO0QKSB"> + <form1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + id="form1_LXPPOY6UZ"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="XL" + id="title_TPTQ8WVJW" + title="Select"/> + <select_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_1_PZFWKJQAW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Select User Age"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + borderEnabled="false" + classes="\0" + defaultSelectedOptions="\0" + disabled="false" + id="field_GAEIQPZTU" + keyNameInOptionList="\0" + labelNameInOptionList="\0" + marginEnabled="false" + multipleSelection="false" + name="age" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="Age" + readOptionsFromDataSource="\0" + validationRequired="false"> + <selectOptions jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + label="20-30" + value="20"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + label="30-40" + value="30"/> + </selectOptions> + </field> + </select_1> + <select_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_2_NLQBWDQRI"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Select Country Code"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + id="field_Y3YAQ9GNQ" + placeholder="Country Code"/> + </select_2> + <select_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_3_NU3YCVERD"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Select User City"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + id="field_XILGDO0RU" + placeholder="Cities"/> + </select_3> + <select_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_4_U0CT59HAW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Select User Database Number"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + id="field_XHZ4KOEHF" + placeholder="Database Number"/> + </select_4> + <select_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_5_3HNV5GKDI"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Select Roll Number"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + id="field_YP7LTAPCK" + placeholder="Roll Number"/> + </select_5> + </form1> + </container> + </rootcontainer> + </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/textarea/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/textarea/.content.xml index a9856e29a..1f73f965a 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/textarea/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/forms/textarea/.content.xml @@ -1,37 +1,94 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="TextArea" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <form1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/form"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Textarea" headingSize=" XL" textAlignment="center" /> - <textarea_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/textarea"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter User Temporary Address" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/textarea" placeholder="Address" /> - </textarea_1> - <textarea_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/textarea"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter User Permanent Address" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/textarea" placeholder="Address" /> - </textarea_2> - <textarea_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/textarea"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter User College Details" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/textarea" placeholder="College Details" /> - </textarea_3> - <textarea_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/textarea"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter User Occupation" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/textarea" placeholder="Occupation" /> - </textarea_4> - <textarea_5 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/textarea"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter Hobbies" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/textarea" placeholder="Hobbies" /> - </textarea_5> - </form1> - </container> - </rootcontainer> - </jcr:content> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.500+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="TextArea" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container"> + <form1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + id="form1_YAW9XSGQN"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingSize=" XL" + textAlignment="center" + title="Textarea"/> + <textarea_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter User Temporary Address"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + placeholder="Address"/> + </textarea_1> + <textarea_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter User Permanent Address"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + placeholder="Address"/> + </textarea_2> + <textarea_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter User College Details"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + placeholder="College Details"/> + </textarea_3> + <textarea_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter User Occupation"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + placeholder="Occupation"/> + </textarea_4> + <textarea_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter Hobbies"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + placeholder="Hobbies"/> + </textarea_5> + </form1> + </container> + </rootcontainer> + </jcr:content> </jcr:root> - diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/graphs/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/graphs/.content.xml index 24d1d860a..7b2ac4258 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/graphs/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/graphs/.content.xml @@ -1,15 +1,34 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Graphs" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <section jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"/> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.554+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Graphs" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_KFCAATIEQ"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_ISR2P8NRZ"> + <section + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/section" + id="section_CVWCXDY8Y"/> </container> - <footer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/footer"/> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_UJSMLCP6C"/> </rootcontainer> </jcr:content> + <d3graph/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/graphs/d3graph/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/graphs/d3graph/.content.xml index a175f6246..1151dbbbf 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/graphs/d3graph/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/graphs/d3graph/.content.xml @@ -1,18 +1,38 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="D3Graph" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <section jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="D3Graph component" /> - <d3graph jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/graphs/d3graph"> - </d3graph> - </section> - </container> - </rootcontainer> - </jcr:content> -</jcr:root> \ No newline at end of file +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.574+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="D3Graph" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_FHLHRLJV3"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_PKPCERHVR"> + <section + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/section" + id="section_OXRUVLFW3"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + id="title_EPH5MLE01" + title="D3Graph component"/> + <d3graph + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/graphs/d3graph"/> + </section> + </container> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/.content.xml index dcbbe11ee..18ef83f7c 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.596+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Layout" sling:resourceType="typerefinery/components/structure/page" @@ -14,4 +16,10 @@ sling:resourceType="typerefinery/components/layout/header"/> </rootcontainer> </jcr:content> + <containerlist/> + <footer/> + <header/> + <sidebar/> + <accordion/> + <bread-crumbs/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/accordion/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/accordion/.content.xml new file mode 100644 index 000000000..70a8ce48f --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/accordion/.content.xml @@ -0,0 +1,389 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-03-12T16:25:35.813+11:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Accordion" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-09-30T16:52:10.424+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_ULNWJAKGA"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_OLRMRO6WA"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_N0DE3S2HO"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_QYT28Z0ZO" + text="<p>Options</p>"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_K53WKGGS8"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + flexEnabled="false" + hideButtonLabel="false" + id="button_JOQ8R93RN" + isOutlinedButton="false" + label="CB" + lgColSize="1" + mdColSize="1" + persistColorWhenThemeSwitches="true" + roleOther="\0" + showIcon="false" + showTextualElementOfButton="false" + smColSize="1" + title="\0"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="accordionitem1_VXSDA4BJH" + name="\0" + nameCustom="openitem" + topic="open1" + type="emit"/> + </_events_> + </button> + <button_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + flexEnabled="false" + hideButtonLabel="false" + id="button_1_CXWBZKGWP" + isOutlinedButton="false" + label="DF" + lgColSize="1" + mdColSize="1" + persistColorWhenThemeSwitches="true" + roleOther="\0" + showIcon="false" + showTextualElementOfButton="false" + smColSize="1" + title="\0"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="accordionitem2_DA1NOJRXM" + name="selectitem" + nameCustom="\0" + topic="open1" + type="emit"/> + </_events_> + </button_1> + <button_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_1_1_S89EQCVUW" + isOutlinedButton="false" + label="LB" + lgColSize="1" + mdColSize="1" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="1"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="accordionitem3_FPZ2RIS0P" + name="\0" + nameCustom="openitem" + topic="open1" + type="emit"/> + </_events_> + </button_1_1> + <button_1_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + flexEnabled="false" + hideButtonLabel="false" + id="button_1_2_DWSALPKQQ" + isOutlinedButton="false" + label="CO" + lgColSize="1" + mdColSize="1" + persistColorWhenThemeSwitches="true" + roleOther="\0" + showIcon="false" + showTextualElementOfButton="false" + smColSize="1" + title="\0"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="#template_CB" + name="createitem" + nameCustom="\0" + topic="add1" + type="emit"/> + </_events_> + </button_1_2> + </container> + </container> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + actionType="toggleComponent" + buttonType="action" + id="button_BORYZR5EM" + label="Toggle" + lgColSize="1" + mdColSize="1" + persistColorWhenThemeSwitches="{Boolean}true" + smColSize="1" + toggleTarget="#hidden2"/> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_N08VGERTD" + text="<p>Accordion</p>"/> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + borderEnabled="false" + classes="\0" + id="accordion_HMGEDDXUO" + isTemplated="true" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="AA"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + content="test1" + id="accordionitem1_VXSDA4BJH" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + show="true" + showopen="false" + title="CB"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_NOASSVF3F"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_POFFHTQGN" + text="<p>Item 1</p>"/> + </container> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + content="a" + id="accordionitem2_DA1NOJRXM" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + show="false" + title="DF"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_HTA8NR6HQ"/> + </accordionitem2> + <template + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_5ZV4QWZXI"> + <accordionitem + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem_YH02G7SXQ"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_HHGCNSSUE"/> + <text_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_1_0YLDWCJKZ"/> + </accordionitem> + </template> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + id="accordionitem3_FPZ2RIS0P" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + show="false" + title="LB"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="hidden" + decorationTagName="template" + flexEnabled="false" + id="container_CU3ZBHB6E" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + roleOther="\0" + title="\0"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_U5NXDV3ZK"/> + </container> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_OVWY3H50S"/> + </accordionitem3> + <accordionitem_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + classes="hidden" + id="hidden1"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_COVI7TNTI" + text="<p>hidden 1</p>"/> + </accordionitem_1> + <accordionitem + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + classes="hidden" + id="hidden2"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_HOWXSJR4X" + text="<p>hidden 2</p>"/> + </accordionitem> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="OPEN_ITEM" + name="\0" + nameCustom="openitem" + topic="open1" + type="listen"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + action="ADDONCE_ITEM" + config="\0" + name="createitem" + nameCustom="\0" + topic="add1" + type="listen"/> + </_events_> + </accordion> + <template_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_CB"> + <accordionitem + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem_ASAS55X8L" + showopen="true"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_GM3WWKENS"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_CGFGJXDFN" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_GVX5SM74Y" + label="Input" + name="templatefield"/> + </input> + </accordionitem> + </template_1> + <template + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_DF"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_4N5UBO5YM" + text="<p>Template DF</p>"/> + </template> + <template_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_LB"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_4N5UBO5YM" + text="<p>Template LB</p>"/> + </template_1_1> + <template_1_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_CO"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_4N5UBO5YM" + text="<p>Template CO</p>"/> + </template_1_2> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_DO8RLG21K"/> + </rootcontainer> + </jcr:content> + <accordion1/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/accordion/accordion1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/accordion/accordion1/.content.xml new file mode 100644 index 000000000..09d2e7163 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/accordion/accordion1/.content.xml @@ -0,0 +1,494 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-03-12T16:25:35.813+11:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Multi" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-09-21T23:27:13.883+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_ULNWJAKGA"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_OLRMRO6WA"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_N0DE3S2HO"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_QYT28Z0ZO" + text="<p>Options</p>"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_K53WKGGS8"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + flexEnabled="false" + hideButtonLabel="false" + id="button_JOQ8R93RN" + isOutlinedButton="false" + label="CB" + lgColSize="1" + mdColSize="1" + persistColorWhenThemeSwitches="true" + roleOther="\0" + showIcon="false" + showTextualElementOfButton="false" + smColSize="1" + title="\0"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="accordionitem1_VXSDA4BJH" + name="\0" + nameCustom="openitem" + topic="open1" + type="emit"/> + </_events_> + </button> + <button_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_1_CXWBZKGWP" + isOutlinedButton="false" + label="DF" + lgColSize="1" + mdColSize="1" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="1"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="accordionitem2_DA1NOJRXM" + name="\0" + nameCustom="openitem" + topic="open1" + type="emit"/> + </_events_> + </button_1> + <button_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_1_1_S89EQCVUW" + isOutlinedButton="false" + label="LB" + lgColSize="1" + mdColSize="1" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="1"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="accordionitem3_FPZ2RIS0P" + name="\0" + nameCustom="openitem" + topic="open1" + type="emit"/> + </_events_> + </button_1_1> + <button_1_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + flexEnabled="false" + hideButtonLabel="false" + id="button_1_2_DWSALPKQQ" + isOutlinedButton="false" + label="CO" + lgColSize="1" + mdColSize="1" + persistColorWhenThemeSwitches="true" + roleOther="\0" + showIcon="false" + showTextualElementOfButton="false" + smColSize="1" + title="\0"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="#template_CB" + name="createitem" + nameCustom="\0" + topic="add1" + type="emit"/> + </_events_> + </button_1_2> + <button_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + flexEnabled="false" + hideButtonLabel="false" + id="button_2_EOSHF6NM4" + isOutlinedButton="false" + label="Open Nested" + lgColSize="1" + mdColSize="1" + persistColorWhenThemeSwitches="true" + roleOther="\0" + showIcon="false" + showTextualElementOfButton="false" + smColSize="1" + title="\0"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="accordionitem2_HO01D3F1O" + name="selectitem" + nameCustom="\0" + topic="opennested1" + type="emit"/> + </_events_> + </button_2> + </container> + </container> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + actionType="toggleComponent" + buttonType="action" + id="button_BORYZR5EM" + label="Toggle" + lgColSize="1" + mdColSize="1" + persistColorWhenThemeSwitches="{Boolean}true" + smColSize="1" + toggleTarget="#hidden2"/> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_N08VGERTD" + text="<p>Accordion</p>"/> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + borderEnabled="false" + classes="\0" + id="accordion_HMGEDDXUO" + isTemplated="true" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="AA"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + content="test1" + id="accordionitem1_VXSDA4BJH" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + show="true" + showopen="false" + title="CB"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_NOASSVF3F"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_POFFHTQGN" + text="<p>Item 1</p>"/> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + id="accordion_ZBPOO9MUU"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem1_C3R2GEJCD"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_BOQIVTDX1"/> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem2_EHN3QH1WT"> + <text_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_1_SRWDHJUY8"/> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + borderEnabled="false" + classes="\0" + id="accordion_FXO2JSGHG" + isTemplated="false" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem1_6OBTHQQE3"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_4QZBVFWPY"/> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem2_HO01D3F1O"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_GXVIURQSS" + text="<p>Pick me!</p>"/> + </accordionitem2> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem3_GWPVZ22OT"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_2KFTWJTVB"/> + </accordionitem3> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="OPEN_ITEM" + config="\0" + name="selectitem" + nameCustom="\0" + topic="opennested1"/> + </_events_> + </accordion> + </accordionitem2> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem3_FTDRKXA3P"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_BU2PARH75"/> + </accordionitem3> + </accordion> + </container> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + content="a" + id="accordionitem2_DA1NOJRXM" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + show="false" + title="DF"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_HTA8NR6HQ"/> + </accordionitem2> + <template + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_5ZV4QWZXI"> + <accordionitem + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem_YH02G7SXQ"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_HHGCNSSUE"/> + <text_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_1_0YLDWCJKZ"/> + </accordionitem> + </template> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + id="accordionitem3_FPZ2RIS0P" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + show="false" + title="LB"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="hidden" + decorationTagName="template" + flexEnabled="false" + id="container_CU3ZBHB6E" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + roleOther="\0" + title="\0"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_U5NXDV3ZK"/> + </container> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_OVWY3H50S"/> + </accordionitem3> + <accordionitem_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + classes="hidden" + id="hidden1"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_COVI7TNTI" + text="<p>hidden 1</p>"/> + </accordionitem_1> + <accordionitem + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + classes="hidden" + id="hidden2"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_HOWXSJR4X" + text="<p>hidden 2</p>"/> + </accordionitem> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="OPEN_ITEM" + name="\0" + nameCustom="openitem" + topic="open1" + type="listen"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + action="ADDONCE_ITEM" + config="\0" + name="createitem" + nameCustom="\0" + topic="add1" + type="listen"/> + </_events_> + </accordion> + <template_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_CB"> + <accordionitem + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem_ASAS55X8L" + showopen="true"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_GM3WWKENS"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_CGFGJXDFN" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_GVX5SM74Y" + label="Input" + name="templatefield"/> + </input> + </accordionitem> + </template_1> + <template + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_DF"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_4N5UBO5YM" + text="<p>Template DF</p>"/> + </template> + <template_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_LB"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_4N5UBO5YM" + text="<p>Template LB</p>"/> + </template_1_1> + <template_1_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_CO"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_4N5UBO5YM" + text="<p>Template CO</p>"/> + </template_1_2> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_DO8RLG21K"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/bread-crumbs/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/bread-crumbs/.content.xml new file mode 100644 index 000000000..76c59382c --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/bread-crumbs/.content.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-05-07T14:42:49.925+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Bread Crumbs" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-05-07T14:42:57.568+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_L1P1CHTCT"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_ERVRYNP66"> + <breadcrumbs + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/breadcrumbs" + id="breadcrumbs_XECWIGTGX"/> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_MWHX9TMPC"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/containerlist/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/containerlist/.content.xml index 78e9aaa26..bf8cca4e8 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/containerlist/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/containerlist/.content.xml @@ -34,7 +34,7 @@ sling:resourceType="typerefinery/components/layout/containerlist" id="containerlist_MITCMTYXY" listAlignment="float-start" - path=""/> + path="\0"/> <container_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" @@ -101,4 +101,6 @@ id="footer_HFFBU37M8"/> </rootcontainer> </jcr:content> + <conatinerListWithoutPath/> + <conatinerListWithPath/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/containerlist/conatinerListWithoutPath/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/containerlist/conatinerListWithoutPath/.content.xml index 78e9aaa26..a36b047d3 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/containerlist/conatinerListWithoutPath/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/containerlist/conatinerListWithoutPath/.content.xml @@ -34,7 +34,7 @@ sling:resourceType="typerefinery/components/layout/containerlist" id="containerlist_MITCMTYXY" listAlignment="float-start" - path=""/> + path="\0"/> <container_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/footer/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/footer/.content.xml index 0c40128cf..96b0357ce 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/footer/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/footer/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.761+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Footer" sling:resourceType="typerefinery/components/structure/page" @@ -11,7 +13,8 @@ sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> <footer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/footer"/> + sling:resourceType="typerefinery/components/layout/footer" + id="footer_NRX0BW5EQ"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/header/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/header/.content.xml index 8c3401486..f886af730 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/header/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/header/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.772+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Header" sling:resourceType="typerefinery/components/structure/page" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/.content.xml index 6b0c86cf8..3c8e95b34 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/.content.xml @@ -1,26 +1,41 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.788+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/pagewithsidebar"> - <rootcontainer jcr:primaryType="nt:unstructured" + <rootcontainer + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <nav jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/nav" cancelInheritParent="true" + <nav + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/nav" + cancelInheritParent="true" classes="bg-secondary mb-3 "> - <treeview jcr:primaryType="nt:unstructured" + <treeview + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/treeview" - parentPagePath="/content/typerefinery-showcase/pages/pages"></treeview> + parentPagePath="/content/typerefinery-showcase/pages/pages"/> </nav> - <header jcr:primaryType="nt:unstructured" + <header + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header" - cancelInheritParent="true" classes="bg-secondary mb-3 "> - <reference jcr:primaryType="nt:unstructured" + cancelInheritParent="true" + classes="bg-secondary mb-3 "> + <reference + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/reference" - path="/content/typerefinery-showcase/pages/content/header/jcr:content/container"></reference> + path="/content/typerefinery-showcase/pages/content/header/jcr:content/container"/> </header> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file + <child1/> + <child2/> + <child3/> + <sidebarwithoutparent/> + <sidebarwithparent/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/.content.xml index 89aef3c24..b41fdbe5a 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/.content.xml @@ -1,12 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.810+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> + <child1/> + <child2/> + <child3/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/child1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/child1/.content.xml index 89aef3c24..53e4f2b49 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/child1/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/child1/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.829+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/child2/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/child2/.content.xml index 89aef3c24..726dd1a30 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/child2/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/child2/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.851+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/child3/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/child3/.content.xml index 89aef3c24..5743b4d50 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/child3/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child1/child3/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.866+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/.content.xml index 89aef3c24..dd73fe27c 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/.content.xml @@ -1,12 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.877+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> + <child1/> + <child2/> + <child3/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/.content.xml index 89aef3c24..0da85a387 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/.content.xml @@ -1,12 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.890+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> + <child1/> + <child2/> + <child3/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/child1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/child1/.content.xml index 89aef3c24..a0611a06e 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/child1/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/child1/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.901+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/child2/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/child2/.content.xml index 89aef3c24..d77932692 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/child2/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/child2/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.913+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/child3/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/child3/.content.xml index 89aef3c24..e6f6d40d2 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/child3/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child1/child3/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.926+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/.content.xml index 89aef3c24..85f11fb19 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/.content.xml @@ -1,12 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.936+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> + <child1/> + <child2/> + <child3/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/child1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/child1/.content.xml index 89aef3c24..9139c4854 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/child1/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/child1/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.946+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/child2/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/child2/.content.xml index 89aef3c24..bcc5bab6a 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/child2/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/child2/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.958+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/child3/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/child3/.content.xml index 89aef3c24..d469099ee 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/child3/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child2/child3/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.970+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/.content.xml index 89aef3c24..0cad3a976 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/.content.xml @@ -1,12 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:34.988+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> + <child1/> + <child2/> + <child3/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/child1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/child1/.content.xml index 89aef3c24..ecad9c330 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/child1/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/child1/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.002+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/child2/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/child2/.content.xml index 89aef3c24..be1928b34 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/child2/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/child2/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.016+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/child3/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/child3/.content.xml index 89aef3c24..5c4598794 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/child3/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child2/child3/child3/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.030+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/.content.xml index 89aef3c24..ef07c9c6d 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/.content.xml @@ -1,12 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.043+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> + <child1/> + <child2/> + <child3/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/.content.xml index 89aef3c24..85cb0e0b3 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/.content.xml @@ -1,12 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.054+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> + <child1/> + <child2/> + <child3/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/child1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/child1/.content.xml index 89aef3c24..15d149cf8 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/child1/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/child1/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.067+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/child2/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/child2/.content.xml index 89aef3c24..383c3eee9 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/child2/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/child2/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.081+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/child3/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/child3/.content.xml index 89aef3c24..37f8bd24c 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/child3/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child1/child3/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.094+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/.content.xml index 89aef3c24..8c902dd4f 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/.content.xml @@ -1,12 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.105+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> + <child1/> + <child2/> + <child3/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/child1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/child1/.content.xml index 89aef3c24..5148140b5 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/child1/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/child1/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.115+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/child2/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/child2/.content.xml index 89aef3c24..ba85c5d5b 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/child2/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/child2/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.126+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/child3/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/child3/.content.xml index 89aef3c24..acd7cfffb 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/child3/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child2/child3/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.137+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/.content.xml index 89aef3c24..be0dca4c0 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/.content.xml @@ -1,12 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.146+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> + <child1/> + <child2/> + <child3/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/child1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/child1/.content.xml index 89aef3c24..10b668e4b 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/child1/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/child1/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.155+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/child2/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/child2/.content.xml index 89aef3c24..2e7cdeef3 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/child2/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/child2/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.165+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/child3/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/child3/.content.xml index 89aef3c24..7d09ab3aa 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/child3/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/child3/child3/child3/.content.xml @@ -1,12 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - </container1> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.174+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/sidebarwithoutparent/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/sidebarwithoutparent/.content.xml index 3207d802c..ef7b12e17 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/sidebarwithoutparent/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/sidebarwithoutparent/.content.xml @@ -1,12 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - <sidebar jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/sidebar" /> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.183+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"> + <sidebar + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/sidebar"/> </container1> </rootcontainer> </jcr:content> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/sidebarwithparent/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/sidebarwithparent/.content.xml index f05d49497..c337f2ae2 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/sidebarwithparent/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/layout/sidebar/sidebarwithparent/.content.xml @@ -1,12 +1,29 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Sidebar" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="3" mdColSize="2" smColSize="12" smRowSize="1" mdRowSize="1" lgRowSize="12"> - <sidebar jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/sidebar" parentPagePath="/content/typerefinery-showcase/pages/components/layout/sidebar" /> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.193+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Sidebar" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="howlite/components/rootcontainer/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + lgColSize="3" + lgRowSize="12" + mdColSize="2" + mdRowSize="1" + smColSize="12" + smRowSize="1"> + <sidebar + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/sidebar" + parentPagePath="/content/typerefinery-showcase/pages/components/layout/sidebar"/> </container1> </rootcontainer> </jcr:content> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/.content.xml index d5068c611..92bb7eced 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/.content.xml @@ -1,15 +1,38 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Widgets" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <section jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"/> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.204+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Widgets" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container"> + <section + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/section"/> </container> - <footer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/footer"/> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer"/> </rootcontainer> </jcr:content> + <chart/> + <map/> + <security/> + <tab/> + <table/> + <tabs/> + <ticker/> + <editor/> + <treeview/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/.content.xml index 125550c65..9b59166f2 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/.content.xml @@ -1,25 +1,79 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Charts" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"/> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container"> - <section1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Line chart with default values" /> - <chart jcr:primaryType= "nt:unstructured" sling:resourceType= "typerefinery/components/widgets/chart" variant="lineChart" /> - </section1> - <section2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Pie chart with default values" /> - <chart jcr:primaryType= "nt:unstructured" sling:resourceType= "typerefinery/components/widgets/chart" variant="pieChart" /> - </section2> - <section3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/section"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Bar chart with default values" /> - <chart jcr:primaryType= "nt:unstructured" sling:resourceType= "typerefinery/components/widgets/chart" variant="barChart" /> - </section3> - </container> - </rootcontainer> - </jcr:content> -</jcr:root> \ No newline at end of file +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.219+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Charts" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_5NX7LYLMI"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_UANRTMYVV"> + <section1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/section" + id="section1_BPPEQLR3R"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + id="title_IZBC409IK" + title="Line chart with default values"/> + <chart + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/chart" + flowapi_sampledata="/apps/typerefinery/components/widgets/chart/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/chart/templates/chart.json" + id="chart_EO7JIJICB" + variant="lineChart"/> + </section1> + <section2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/section" + id="section2_HNTYK9YR2"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + id="title_NIJNWP12N" + title="Pie chart with default values"/> + <chart + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/chart" + flowapi_sampledata="/apps/typerefinery/components/widgets/chart/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/chart/templates/chart.json" + id="chart_KQRD4VBUR" + variant="pieChart"/> + </section2> + <section3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/section" + id="section3_PXBNRUWZS"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + id="title_JDXMYR2D0" + title="Bar chart with default values"/> + <chart + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/chart" + flowapi_sampledata="/apps/typerefinery/components/widgets/chart/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/chart/templates/chart.json" + id="chart_BVFPYGLML" + variant="barChart"/> + </section3> + </container> + </rootcontainer> + </jcr:content> + <barchart/> + <linechart/> + <piechart/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/barchart/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/barchart/.content.xml index 48e23ff94..0ce69faca 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/barchart/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/barchart/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.243+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Bar chart" sling:resourceType="typerefinery/components/structure/page" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/linechart/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/linechart/.content.xml index d535ffc81..c034ee997 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/linechart/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/linechart/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.274+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Line chart" sling:resourceType="typerefinery/components/structure/page" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/piechart/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/piechart/.content.xml index 01e65f6bc..f59172a78 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/piechart/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/chart/piechart/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.307+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Pie chart" sling:resourceType="typerefinery/components/structure/page" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/editor/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/editor/.content.xml new file mode 100644 index 000000000..a2fc0ecfc --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/editor/.content.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:33.848+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Editor" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_YMZKJEHYJ"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_CSDU42W43"> + <section + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/section" + id="section_VFAIH7XOK"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + id="title_CL3DPSBVJ" + title="Code Editor (HTML Language)"/> + <editor + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/editor" + id="editor_JTMAR0OCH"/> + </section> + </container> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/map/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/map/.content.xml index 88cde59d1..427e89754 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/map/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/map/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.338+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Map" sling:resourceType="typerefinery/components/structure/page" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/security/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/security/.content.xml index 5bb356001..2c270092a 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/security/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/security/.content.xml @@ -1,24 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" - jcr:title="Security" - sling:resourceType="typerefinery/components/structure/page" - ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/header" /> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container"> - <section jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/section" /> - </container> - <footer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/footer" /> - </rootcontainer> - </jcr:content> -</jcr:root> \ No newline at end of file +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:ws="http://ds.pl/websight" + jcr:primaryType="ws:Page"> + <stix/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/security/stix/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/security/stix/.content.xml index dca0e7219..3d57714a3 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/security/stix/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/security/stix/.content.xml @@ -7,7 +7,7 @@ jcr:primaryType="ws:PageContent" jcr:title="Stix" sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-03-04T09:26:22.047Z" + ws:lastModified="{Date}2024-02-08T09:47:59.780+11:00" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/page" description="\0" @@ -36,8 +36,21 @@ <stix jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/security/stix" + flowapi_createdon="2024-02-07T22:48:01.099Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff19b3n001tj51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f19b3n001tj51d" + flowapi_group="/content/typerefinery-showcase/pages/components/widgets/security/stix/_jcr_content/rootcontainer/main/stix" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/components/widgets/security/stix/_jcr_content/rootcontainer/main/stix/{{id}}" + flowapi_iscontainer="{Boolean}false" flowapi_sampledata="/apps/typerefinery/components/widgets/security/stix/templates/flowsample.json" + flowapi_success="true" flowapi_template="/apps/typerefinery/components/widgets/security/stix/templates/stix.json" + flowapi_title="Stix flow" + flowapi_topic="stix_a327cba72a7b465a95e9e976c0b921ff" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" id="stix_SVTBP4VXM"/> </main> <footer diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/tab/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/tab/.content.xml index ceadab08f..5057e3c50 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/tab/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/tab/.content.xml @@ -1,20 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.400+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Tab" sling:resourceType="typerefinery/components/structure/page" - ws:template="/apps/typerefinery/templates/page" - > + ws:template="/apps/typerefinery/templates/page"> <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header" - id="header_ALUWHNQWD" /> + id="header_ALUWHNQWD"/> <main jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/main" @@ -23,8 +23,8 @@ jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" id="container_C4GZXZKMX" - variant="sectionwithtitle" - title="Tab"> + title="Tab" + variant="sectionwithtitle"> <tabs jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/tabs" @@ -45,14 +45,14 @@ icon="pi pi-file" isCloseable="false" title="Tab1" - useQueryParamsFromParent="false" /> + useQueryParamsFromParent="false"/> <_x0031_ jcr:primaryType="nt:unstructured" content="\0" icon="pi pi-file" isCloseable="false" title="Tab2" - useQueryParamsFromParent="false" /> + useQueryParamsFromParent="false"/> </listOfTab> </tabs> </container> @@ -60,8 +60,8 @@ jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" id="container_0FN7MUEXT" - variant="sectionwithtitle" - title="tab with content"> + title="tab with content" + variant="sectionwithtitle"> <tabs jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/tabs" @@ -82,7 +82,7 @@ icon="pi pi-google" isCloseable="false" title="Google" - useQueryParamsFromParent="false" /> + useQueryParamsFromParent="false"/> </listOfTab> </tabs> </container_1> @@ -90,7 +90,7 @@ <footer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/footer" - id="footer_YEYNLNJEF" /> + id="footer_YEYNLNJEF"/> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/table/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/table/.content.xml index 5c271410c..ec0712fe2 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/table/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/table/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.430+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Table" sling:resourceType="typerefinery/components/structure/page" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/.content.xml index df9ed92eb..ce107b7ec 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/.content.xml @@ -1,177 +1,794 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Ticker" sling:resourceType="typerefinery/components/structure/page" ws:lastModified="{Date}2023-03-31T07:22:45.705Z" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header" id="header_AZTFOAMY4"/> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" containerType="defaultPadding" decorationTagName="\0" id="container1_1FGDIU8XF" marginBottom="five" marginEnabled="true" marginTop="five" textAlignment="\0" title="Ticker Showcase " titleTagName="h3" variant="sectionwithtitle"> - <container1_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" decorationTagName="section" flexEnabled="true" horizontalAlignment="evenly" id="container1_1_G9PQ8B3AL" lgColSize="12" marginEnabled="false" mdColSize="12" paddingEnabled="false" persistColorWhenThemeSwitches="false" smColSize="12" title="\0"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" borderEnabled="false" classes="\0" headingLevel="h6" headingSize="h5" id="title_JYVLB6LCF" marginBottom="four" marginEnabled="true" marginTop="five" paddingEnabled="false" persistColorWhenThemeSwitches="false" textAlignment="center" title="Template 1"/> - <container1_1_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" flexEnabled="true" gap="4" horizontalAlignment="between" id="container1_1_1_BIGU7KFZO" lgColSize="12" marginEnabled="false" mdColSize="12" paddingEnabled="false" persistColorWhenThemeSwitches="false" smColSize="12" title="\0"> - <ticker1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" id="ticker1_51GLSKN1U" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="1"> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.526+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Ticker" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-03-31T07:22:45.705Z" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_AZTFOAMY4"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + containerType="defaultPadding" + decorationTagName="\0" + id="container1_1FGDIU8XF" + marginBottom="five" + marginEnabled="true" + marginTop="five" + textAlignment="\0" + title="Ticker Showcase " + titleTagName="h3" + variant="sectionwithtitle"> + <container1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + decorationTagName="section" + flexEnabled="true" + horizontalAlignment="evenly" + id="container1_1_G9PQ8B3AL" + lgColSize="12" + marginEnabled="false" + mdColSize="12" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="12" + title="\0"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + borderEnabled="false" + classes="\0" + headingLevel="h6" + headingSize="h5" + id="title_JYVLB6LCF" + marginBottom="four" + marginEnabled="true" + marginTop="five" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="Template 1"/> + <container1_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + gap="4" + horizontalAlignment="between" + id="container1_1_1_BIGU7KFZO" + lgColSize="12" + marginEnabled="false" + mdColSize="12" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="12" + title="\0"> + <ticker1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker1_51GLSKN1U" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0031_ jcr:primaryType="nt:unstructured" key="title" value="Number of Total Users"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="value" value="240K"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="35.5K"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-users"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-up"/> - <_x0037_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since last year"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="title" + value="Number of Total Users"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="value" + value="240K"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="35.5K"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-users"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-up"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since last year"/> </configData> </ticker1> - <ticker2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" id="ticker2_ZOZEKJCBU" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="1"> + <ticker2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker2_ZOZEKJCBU" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0031_ jcr:primaryType="nt:unstructured" key="title" value="Number of paid users"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="value" value="2K"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="23.5K"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="indicatorType" value="danger"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-user-plus"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-up"/> - <_x0037_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since last week"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="title" + value="Number of paid users"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="value" + value="2K"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="23.5K"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="danger"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-user-plus"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-up"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since last week"/> </configData> </ticker2> - - <!-- ticker3 --> - <ticker3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" id="ticker3_1ZQZQZQZQ" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="1"> + <ticker3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker3_1ZQZQZQZQ" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0031_ jcr:primaryType="nt:unstructured" key="title" value="Number of free users"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="value" value="121.5K"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="51.5K"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-user-minus"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-up"/> - <_x0037_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since last week"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="title" + value="Number of free users"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="value" + value="121.5K"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="51.5K"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-user-minus"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-up"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since last week"/> </configData> </ticker3> - - <!-- ticker4 --> - <ticker4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" id="ticker4_U3ZYZBYXV" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="1"> + <ticker4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker4_U3ZYZBYXV" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0031_ jcr:primaryType="nt:unstructured" key="title" value="Number of bugs reported"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="value" value="12k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="5.5K"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-stopwatch"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-up"/> - <_x0037_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since last week"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="title" + value="Number of bugs reported"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="value" + value="12k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="5.5K"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-stopwatch"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-up"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since last week"/> </configData> </ticker4> - - <!-- ticker5 --> - <ticker5 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" id="ticker5_BAGRCHW4G" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="1"> + <ticker5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker5_BAGRCHW4G" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0031_ jcr:primaryType="nt:unstructured" key="title" value="Number of feedbacks recived"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="value" value="4k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="2.5K"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="indicatorType" value="danger"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0037_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since last week"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="title" + value="Number of feedbacks recived"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="value" + value="4k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="2.5K"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="danger"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since last week"/> </configData> </ticker5> - - <!-- ticker6 --> - - <ticker6 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" id="ticker6_P4BGUKIKC" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="1"> + <ticker6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker6_P4BGUKIKC" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0031_ jcr:primaryType="nt:unstructured" key="title" value="Number of Activites"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="value" value="441k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="5.5K"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-discord"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0037_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since last week"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="title" + value="Number of Activites"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="value" + value="441k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="5.5K"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-discord"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since last week"/> </configData> - </ticker6> - </container1_1_1> </container1_1> - <container1_1_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" decorationTagName="section" flexEnabled="true" horizontalAlignment="evenly" id="container1_1_G9PQ8B3AL" lgColSize="12" marginEnabled="false" mdColSize="12" paddingEnabled="false" persistColorWhenThemeSwitches="false" smColSize="12" title="\0"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" borderEnabled="false" classes="\0" headingLevel="h6" headingSize="h5" id="title_JYVLB6LCF" marginBottom="four" marginEnabled="true" marginTop="five" paddingEnabled="false" persistColorWhenThemeSwitches="false" textAlignment="center" title="Template 2"/> - <container1_1_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" flexEnabled="true" gap="4" horizontalAlignment="between" id="container1_1_1_BIGU7KFZO" lgColSize="12" marginEnabled="false" mdColSize="12" paddingEnabled="false" persistColorWhenThemeSwitches="false" smColSize="12" title="\0"> - <!-- create 6 tickers with variant 2 and random key value for the ticker --> - <ticker1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker2.json" id="ticker1_BAGRCHW4G" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="2"> + <container1_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + decorationTagName="section" + flexEnabled="true" + horizontalAlignment="evenly" + id="container1_1_G9PQ8B3AL" + lgColSize="12" + marginEnabled="false" + mdColSize="12" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="12" + title="\0"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + borderEnabled="false" + classes="\0" + headingLevel="h6" + headingSize="h5" + id="title_JYVLB6LCF" + marginBottom="four" + marginEnabled="true" + marginTop="five" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="Template 2"/> + <container1_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + gap="4" + horizontalAlignment="between" + id="container1_1_1_BIGU7KFZO" + lgColSize="12" + marginEnabled="false" + mdColSize="12" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="12" + title="\0"> + <ticker1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker2.json" + id="ticker1_BAGRCHW4G" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="2"> <configData jcr:primaryType="nt:unstructured"> - <_x0031_ jcr:primaryType="nt:unstructured" key="title" value="Number of feedbacks recived"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="value" value="4k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="2.5K"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0037_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since last week"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="title" + value="Number of feedbacks recived"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="value" + value="4k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="2.5K"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since last week"/> </configData> </ticker1> - - <ticker2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker2.json" id="ticker2_BAGRCHW4G" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="2"> + <ticker2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker2.json" + id="ticker2_BAGRCHW4G" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="2"> <configData jcr:primaryType="nt:unstructured"> - <_x0031_ jcr:primaryType="nt:unstructured" key="title" value="Number of Activites"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="value" value="441k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="5.5K"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-discord"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0037_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since last week"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="title" + value="Number of Activites"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="value" + value="441k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="5.5K"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-discord"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since last week"/> </configData> </ticker2> - - <ticker3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker2.json" id="ticker3_BAGRCHW4G" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="2"> + <ticker3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker2.json" + id="ticker3_BAGRCHW4G" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="2"> <configData jcr:primaryType="nt:unstructured"> - <_x0031_ jcr:primaryType="nt:unstructured" key="title" value="Number of Activites"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="value" value="441k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="5.5K"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-discord"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0037_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since last week"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="title" + value="Number of Activites"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="value" + value="441k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="5.5K"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-discord"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since last week"/> </configData> </ticker3> - - <ticker4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker2.json" id="ticker4_BAGRCHW4G" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="2"> + <ticker4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker2.json" + id="ticker4_BAGRCHW4G" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="2"> <configData jcr:primaryType="nt:unstructured"> - <_x0031_ jcr:primaryType="nt:unstructured" key="title" value="Number of Activites"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="value" value="23K"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="5.5K"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-discord"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0037_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since last week"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="title" + value="Number of Activites"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="value" + value="23K"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="5.5K"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-discord"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since last week"/> </configData> </ticker4> - - <ticker5 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker2.json" id="ticker5_BAGRCHW4G" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="2"> + <ticker5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker2.json" + id="ticker5_BAGRCHW4G" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="2"> <configData jcr:primaryType="nt:unstructured"> - <_x0031_ jcr:primaryType="nt:unstructured" key="title" value="Number of Activites"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="value" value="441k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="5.5K"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-discord"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0037_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since last week"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="title" + value="Number of Activites"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="value" + value="441k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="5.5K"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-discord"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since last week"/> </configData> </ticker5> - - <ticker6 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker2.json" id="ticker6_BAGRCHW4G" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="2"> + <ticker6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker2.json" + id="ticker6_BAGRCHW4G" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="2"> <configData jcr:primaryType="nt:unstructured"> - <_x0031_ jcr:primaryType="nt:unstructured" key="title" value="Number of Activites"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="value" value="441k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="5.5K"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-discord"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0037_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since last week"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="title" + value="Number of Activites"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="value" + value="441k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="5.5K"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-discord"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since last week"/> </configData> </ticker6> </container1_1_1> </container1_1_1> - <container1_1_1_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" decorationTagName="section" flexEnabled="true" horizontalAlignment="evenly" id="container1_1_G9PQ8B3AL" lgColSize="12" marginEnabled="false" mdColSize="12" paddingEnabled="false" persistColorWhenThemeSwitches="false" smColSize="12" title="\0"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" borderEnabled="false" classes="\0" headingLevel="h6" headingSize="h5" id="title_JYVLB6LCF" marginBottom="four" marginEnabled="true" marginTop="five" paddingEnabled="false" persistColorWhenThemeSwitches="false" textAlignment="center" title="Template 3"/> - <container1_1_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" flexEnabled="true" gap="4" horizontalAlignment="between" id="container1_1_1_BIGU7KFZO" lgColSize="12" marginEnabled="false" mdColSize="12" paddingEnabled="false" persistColorWhenThemeSwitches="false" smColSize="12" title="\0"> - <ticker1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" borderEnabled="false" classes="\0" dataSource="\0" flowapi_createdon="\0" flowapi_designtemplate="\0" flowapi_editurl="\0" flowapi_enable="false" flowapi_flowstreamid="\0" flowapi_group="\0" flowapi_httproute="\0" flowapi_iscontainer="\0" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" flowapi_title="\0" flowapi_topic="\0" flowapi_updatedon="\0" id="ticker1_51GLSKN1U" lgColSize="3" marginEnabled="false" mdColSize="3" paddingEnabled="false" persistColorWhenThemeSwitches="false" smColSize="12" templateSelected="3" title="\0" websocketHost="\0" websocketTopic="\0"/> - <ticker2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" borderEnabled="false" classes="\0" dataSource="\0" flowapi_createdon="\0" flowapi_designtemplate="\0" flowapi_editurl="\0" flowapi_enable="false" flowapi_flowstreamid="\0" flowapi_group="\0" flowapi_httproute="\0" flowapi_iscontainer="\0" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" flowapi_title="\0" flowapi_topic="\0" flowapi_updatedon="\0" id="ticker2_ZOZEKJCBU" lgColSize="3" marginEnabled="false" mdColSize="3" paddingEnabled="false" persistColorWhenThemeSwitches="false" smColSize="12" templateSelected="3" title="\0" websocketHost="\0" websocketTopic="\0"/> - <ticker3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" borderEnabled="false" classes="\0" dataSource="\0" flowapi_createdon="\0" flowapi_designtemplate="\0" flowapi_editurl="\0" flowapi_enable="false" flowapi_flowstreamid="\0" flowapi_group="\0" flowapi_httproute="\0" flowapi_iscontainer="\0" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" flowapi_title="\0" flowapi_topic="\0" flowapi_updatedon="\0" id="ticker3_V1ZPPMBLE" lgColSize="3" marginEnabled="false" mdColSize="3" paddingEnabled="false" persistColorWhenThemeSwitches="false" smColSize="12" templateSelected="3" title="\0" websocketHost="\0" websocketTopic="\0"/> - <ticker4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" id="ticker4_U3ZYZBYXV" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="3"/> - <ticker5 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" id="ticker5_BAGRCHW4G" lgColSize="3" mdColSize="3" smColSize="12" templateSelected="3"/> - <ticker6 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" borderEnabled="false" classes="\0" dataSource="\0" flowapi_createdon="\0" flowapi_designtemplate="\0" flowapi_editurl="\0" flowapi_enable="false" flowapi_flowstreamid="\0" flowapi_group="\0" flowapi_httproute="\0" flowapi_iscontainer="\0" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" flowapi_title="\0" flowapi_topic="\0" flowapi_updatedon="\0" id="ticker6_P4BGUKIKC" lgColSize="3" marginEnabled="false" mdColSize="3" paddingEnabled="false" persistColorWhenThemeSwitches="false" smColSize="12" templateSelected="3" title="\0" websocketHost="\0" websocketTopic="\0"/> + <container1_1_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + decorationTagName="section" + flexEnabled="true" + horizontalAlignment="evenly" + id="container1_1_G9PQ8B3AL" + lgColSize="12" + marginEnabled="false" + mdColSize="12" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="12" + title="\0"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + borderEnabled="false" + classes="\0" + headingLevel="h6" + headingSize="h5" + id="title_JYVLB6LCF" + marginBottom="four" + marginEnabled="true" + marginTop="five" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="Template 3"/> + <container1_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + gap="4" + horizontalAlignment="between" + id="container1_1_1_BIGU7KFZO" + lgColSize="12" + marginEnabled="false" + mdColSize="12" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="12" + title="\0"> + <ticker1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="\0" + flowapi_designtemplate="\0" + flowapi_editurl="\0" + flowapi_enable="false" + flowapi_flowstreamid="\0" + flowapi_group="\0" + flowapi_httproute="\0" + flowapi_iscontainer="\0" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + flowapi_title="\0" + flowapi_topic="\0" + flowapi_updatedon="\0" + id="ticker1_51GLSKN1U" + lgColSize="3" + marginEnabled="false" + mdColSize="3" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="12" + templateSelected="3" + title="\0" + websocketHost="\0" + websocketTopic="\0"/> + <ticker2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="\0" + flowapi_designtemplate="\0" + flowapi_editurl="\0" + flowapi_enable="false" + flowapi_flowstreamid="\0" + flowapi_group="\0" + flowapi_httproute="\0" + flowapi_iscontainer="\0" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + flowapi_title="\0" + flowapi_topic="\0" + flowapi_updatedon="\0" + id="ticker2_ZOZEKJCBU" + lgColSize="3" + marginEnabled="false" + mdColSize="3" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="12" + templateSelected="3" + title="\0" + websocketHost="\0" + websocketTopic="\0"/> + <ticker3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="\0" + flowapi_designtemplate="\0" + flowapi_editurl="\0" + flowapi_enable="false" + flowapi_flowstreamid="\0" + flowapi_group="\0" + flowapi_httproute="\0" + flowapi_iscontainer="\0" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + flowapi_title="\0" + flowapi_topic="\0" + flowapi_updatedon="\0" + id="ticker3_V1ZPPMBLE" + lgColSize="3" + marginEnabled="false" + mdColSize="3" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="12" + templateSelected="3" + title="\0" + websocketHost="\0" + websocketTopic="\0"/> + <ticker4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker4_U3ZYZBYXV" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="3"/> + <ticker5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker5_BAGRCHW4G" + lgColSize="3" + mdColSize="3" + smColSize="12" + templateSelected="3"/> + <ticker6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="\0" + flowapi_designtemplate="\0" + flowapi_editurl="\0" + flowapi_enable="false" + flowapi_flowstreamid="\0" + flowapi_group="\0" + flowapi_httproute="\0" + flowapi_iscontainer="\0" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + flowapi_title="\0" + flowapi_topic="\0" + flowapi_updatedon="\0" + id="ticker6_P4BGUKIKC" + lgColSize="3" + marginEnabled="false" + mdColSize="3" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="12" + templateSelected="3" + title="\0" + websocketHost="\0" + websocketTopic="\0"/> </container1_1_1> </container1_1_1_1> </container1> </rootcontainer> </jcr:content> + <template1/> + <template2/> + <template3/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/template1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/template1/.content.xml index 9ce05a6fc..fbecb2236 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/template1/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/template1/.content.xml @@ -1,110 +1,398 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Ticker Template 1" sling:resourceType="typerefinery/components/structure/page" ws:lastModified="{Date}2023-03-31T08:23:20.775Z" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header" /> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" containerType="defaultPadding" flexEnabled="false" marginEnabled="true" marginTop="four" paddingEnabled="false" persistColorWhenThemeSwitches="false" title="Template 1" titleTagName="h3" variant="sectionwithtitle"> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" containerType="defaultPadding" flexEnabled="true" gap="4" horizontalAlignment="evenly" marginEnabled="true" marginTop="five" paddingEnabled="false" persistColorWhenThemeSwitches="false" title="\0"> - <ticker_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="1" lgColSize="3"> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:35.847+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Ticker Template 1" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-03-31T08:23:20.775Z" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + containerType="defaultPadding" + flexEnabled="false" + marginEnabled="true" + marginTop="four" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="Template 1" + titleTagName="h3" + variant="sectionwithtitle"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + containerType="defaultPadding" + flexEnabled="true" + gap="4" + horizontalAlignment="evenly" + marginEnabled="true" + marginTop="five" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="\0"> + <ticker_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_HXMJ8D8VK" + lgColSize="3" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 1"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 1"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4> - <ticker_4_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="1" lgColSize="3"> + <ticker_4_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_1_BCYHQQ42J" + lgColSize="3" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 1"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 1"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_1> - <ticker_4_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="1" lgColSize="3"> + <ticker_4_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_2_HFXSHG7PO" + lgColSize="3" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 1"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 1"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_2> - <ticker_4_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="1" lgColSize="3"> + <ticker_4_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_3_8Z5GXQMKP" + lgColSize="3" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 1"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 1"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_3> - <ticker_4_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="1" lgColSize="3"> + <ticker_4_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_4_OQZJI8BC7" + lgColSize="3" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 1"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 1"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_4> - <ticker_4_5 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="1" lgColSize="3"> + <ticker_4_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_5_JYNX6FSYG" + lgColSize="3" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 1"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 1"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_5> - <ticker_4_6 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="1" lgColSize="3"> + <ticker_4_6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_6_VJGNLAGI9" + lgColSize="3" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 1"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 1"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_6> - <ticker_4_7 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="1" lgColSize="3"> + <ticker_4_7 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_7_Z6JAZRITT" + lgColSize="3" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 1"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 1"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_7> - <ticker_4_8 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="1" lgColSize="3"> + <ticker_4_8 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_8_NWTYDEZCS" + lgColSize="3" + templateSelected="1"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 1"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 1"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_8> </container> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/template2/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/template2/.content.xml index b5bc2262c..5325e57ee 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/template2/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/template2/.content.xml @@ -1,105 +1,366 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Ticker Template 2" sling:resourceType="typerefinery/components/structure/page" ws:lastModified="{Date}2023-03-31T08:23:20.775Z" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header" /> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" containerType="defaultPadding" flexEnabled="false" marginEnabled="true" marginTop="four" paddingEnabled="false" persistColorWhenThemeSwitches="false" title="Template 2" titleTagName="h3" variant="sectionwithtitle"> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" containerType="defaultPadding" flexEnabled="true" gap="4" horizontalAlignment="evenly" marginEnabled="true" marginTop="five" paddingEnabled="false" persistColorWhenThemeSwitches="false" title="\0"> - <ticker_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="2" lgColSize="3"> - <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 2"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> - </configData> - </ticker_4> - <ticker_4_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="2" lgColSize="3"> - <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 2"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> - </configData> - </ticker_4_1> - <ticker_4_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="2" lgColSize="3"> - <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 2"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> - </configData> - </ticker_4_2> - <ticker_4_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="2" lgColSize="3"> - <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 2"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> - </configData> - </ticker_4_3> - <ticker_4_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="2" lgColSize="3"> - <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 2"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> - </configData> - </ticker_4_4> - <ticker_4_5 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="2" lgColSize="3"> - <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 2"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> - </configData> - </ticker_4_5> - <ticker_4_6 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="2" lgColSize="3"> - <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 2"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> - </configData> - </ticker_4_6> - <ticker_4_7 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="2" lgColSize="3"> - <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 2"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> - </configData> - </ticker_4_7> - <ticker_4_8 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="2" lgColSize="3"> - <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 2"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> - </configData> - </ticker_4_8> - </container> - </container> - </rootcontainer> - </jcr:content> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:36.030+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Ticker Template 2" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-03-31T08:23:20.775Z" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + containerType="defaultPadding" + flexEnabled="false" + marginEnabled="true" + marginTop="four" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="Template 2" + titleTagName="h3" + variant="sectionwithtitle"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + containerType="defaultPadding" + flexEnabled="true" + gap="4" + horizontalAlignment="evenly" + marginEnabled="true" + marginTop="five" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="\0"> + <ticker_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_PZGFRAQSN" + lgColSize="3" + templateSelected="2"> + <configData jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 2"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> + </configData> + </ticker_4> + <ticker_4_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_1_K3GEPBXGN" + lgColSize="3" + templateSelected="2"> + <configData jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 2"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> + </configData> + </ticker_4_1> + <ticker_4_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_2_JCANLQAIA" + lgColSize="3" + templateSelected="2"> + <configData jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 2"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> + </configData> + </ticker_4_2> + <ticker_4_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_3_GXKPQ3OWJ" + lgColSize="3" + templateSelected="2"> + <configData jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 2"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> + </configData> + </ticker_4_3> + <ticker_4_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_4_7RDKUVE0N" + lgColSize="3" + templateSelected="2"> + <configData jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 2"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> + </configData> + </ticker_4_4> + <ticker_4_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_5_XOI46PQMK" + lgColSize="3" + templateSelected="2"> + <configData jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 2"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> + </configData> + </ticker_4_5> + <ticker_4_6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_6_XRAAE3BL7" + lgColSize="3" + templateSelected="2"> + <configData jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 2"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> + </configData> + </ticker_4_6> + <ticker_4_7 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_7_I3VBXCKWV" + lgColSize="3" + templateSelected="2"> + <configData jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 2"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> + </configData> + </ticker_4_7> + <ticker_4_8 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_8_AZHO5PP8W" + lgColSize="3" + templateSelected="2"> + <configData jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 2"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="indicatorIcon" + value="pi pi-arrow-down"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> + </configData> + </ticker_4_8> + </container> + </container> + </rootcontainer> + </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/template3/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/template3/.content.xml index 785c278f5..43746b7dd 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/template3/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/ticker/template3/.content.xml @@ -1,119 +1,398 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Ticker Template 3" sling:resourceType="typerefinery/components/structure/page" ws:lastModified="{Date}2023-03-31T08:23:20.775Z" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header" /> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" containerType="defaultPadding" flexEnabled="false" marginEnabled="true" marginTop="four" paddingEnabled="false" persistColorWhenThemeSwitches="false" title="Template 3" titleTagName="h3" variant="sectionwithtitle"> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" containerType="defaultPadding" flexEnabled="true" gap="4" horizontalAlignment="evenly" marginEnabled="true" marginTop="five" paddingEnabled="false" persistColorWhenThemeSwitches="false" title="\0"> - <ticker_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="3" lgColSize="3"> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:36.182+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Ticker Template 3" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-03-31T08:23:20.775Z" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + containerType="defaultPadding" + flexEnabled="false" + marginEnabled="true" + marginTop="four" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="Template 3" + titleTagName="h3" + variant="sectionwithtitle"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + containerType="defaultPadding" + flexEnabled="true" + gap="4" + horizontalAlignment="evenly" + marginEnabled="true" + marginTop="five" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="\0"> + <ticker_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_HLV7G358S" + lgColSize="3" + templateSelected="3"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 3"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle text-light"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-up"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="widgetIcon" value="pi pi-briefcase text-light"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 3"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle text-light"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="widgetIcon" + value="pi pi-briefcase text-light"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4> - <ticker_4_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="3" lgColSize="3"> + <ticker_4_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_1_GYHZXJIRS" + lgColSize="3" + templateSelected="3"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 3"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle text-light"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-up"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="widgetIcon" value="pi pi-briefcase text-light"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 3"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle text-light"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="widgetIcon" + value="pi pi-briefcase text-light"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_1> - <ticker_4_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="3" lgColSize="3"> + <ticker_4_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_2_JUNEGNVYJ" + lgColSize="3" + templateSelected="3"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 3"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle text-light"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-up"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="widgetIcon" value="pi pi-briefcase text-light"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 3"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle text-light"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="widgetIcon" + value="pi pi-briefcase text-light"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_2> - <ticker_4_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="3" lgColSize="3"> + <ticker_4_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_3_J3ERTX2AN" + lgColSize="3" + templateSelected="3"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 3"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle text-light"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-up"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="widgetIcon" value="pi pi-briefcase text-light"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 3"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle text-light"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="widgetIcon" + value="pi pi-briefcase text-light"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_3> - <ticker_4_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="3" lgColSize="3"> + <ticker_4_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_4_QK4REDXOJ" + lgColSize="3" + templateSelected="3"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 3"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle text-light"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-up"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="widgetIcon" value="pi pi-briefcase text-light"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 3"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle text-light"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="widgetIcon" + value="pi pi-briefcase text-light"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_4> - <ticker_4_5 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="3" lgColSize="3"> + <ticker_4_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_5_UJBEBVWKE" + lgColSize="3" + templateSelected="3"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 3"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle text-light"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-up"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="widgetIcon" value="pi pi-briefcase text-light"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 3"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle text-light"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="widgetIcon" + value="pi pi-briefcase text-light"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_5> - <ticker_4_6 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="3" lgColSize="3"> + <ticker_4_6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_6_NT03GG0ZH" + lgColSize="3" + templateSelected="3"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 3"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle text-light"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-up"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="widgetIcon" value="pi pi-briefcase text-light"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 3"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle text-light"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="widgetIcon" + value="pi pi-briefcase text-light"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_6> - <ticker_4_7 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="3" lgColSize="3"> + <ticker_4_7 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_7_BMS2WB53Z" + lgColSize="3" + templateSelected="3"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 3"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle text-light"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-up"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="widgetIcon" value="pi pi-briefcase text-light"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 3"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle text-light"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="widgetIcon" + value="pi pi-briefcase text-light"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_7> - <ticker_4_8 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" templateSelected="3" lgColSize="3"> + <ticker_4_8 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_4_8_SDQLXA4EK" + lgColSize="3" + templateSelected="3"> <configData jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 3"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle text-light"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-up"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="widgetIcon" value="pi pi-briefcase text-light"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + key="title" + value="Template 3"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + key="value" + value="140K"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + key="indicatorValue" + value="45k"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + key="indicatorType" + value="success"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + key="tickerIcon" + value="pi pi-question-circle text-light"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + key="widgetIcon" + value="pi pi-briefcase text-light"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + key="indicatorPrecisionValue" + value="Since March 2023"/> </configData> </ticker_4_8> </container> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/treeview/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/treeview/.content.xml new file mode 100644 index 000000000..892dfce31 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/components/widgets/treeview/.content.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-05-08T15:36:05.937+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Treeview" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-05-08T15:36:19.983+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_4EAZKDXVZ"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_TQCAOUVPO"> + <treeview + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/treeview" + id="treeview_SNGDXIFDS"/> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_QQP7LXDYL"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/.content.xml index 2dd5da414..251670927 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/.content.xml @@ -2,13 +2,17 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:36.409+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Content" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <footer/> + <header/> + <header-with-hamburger/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/footer/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/footer/.content.xml index 2a2153ea7..e9dfa2c3a 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/footer/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/footer/.content.xml @@ -1,42 +1,138 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Footer" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" paddingEnabled="true" paddingGeneral="three" marginEnabled="true" marginTop="four" flexEnabled="true" horizontalAlignment="between" cancelInheritParent="true"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="2" mdColSize="12" smColSize="12" flexEnabled="true"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Pages" headingLevel="h5"/> - <text1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" text= - "<p> <a class='text-decoration-none'href='/content/typerefinery-showcase/pages/pages/dashboard.html' > Dashboard </a> </p> - <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/pages/form.html' > Form </a> </p> - <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/pages/report.html' > Reports </a> </p> - <p> <a class='text-decoration-none' href='https://typerefinery.ai/' > Content </a> </p> "/> - </container1> - <container2 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="2" mdColSize="12" smColSize="12" flexEnabled="true"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Widgets" headingLevel="h5"/> - <text2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" text= - "<p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/graphs/d3graph.html' > Graph </a> </p> - <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/widgets/table.html' > Table </a> </p> - <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/widgets/chart.html' > Charts </a> </p> - <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/widgets/map.html' > Map </a> </p> "/> - </container2> - <container3 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="2" mdColSize="12" smColSize="12" flexEnabled="true"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Resources" headingLevel="h5"/> - <text3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" text= - "<p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/flow/flowform.html' > Flow Form </a> </p> - <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/content/image.html' > Images </a> </p> - <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/content/card.html' > Cards </a> </p> - <p> <a class='text-decoration-none' href='https://github.com/typerefinery-ai/typerefinery-websight' > FAQ </a> </p> "/> - </container3> - <container5 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="12" mdColSize="12" smColSize="12" flexEnabled="true" horizontalAlignment="between" classes="p-2 mt-4" borderPositionTop="true"> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="/apps/typerefinery/components/layout/container" lgColSize="8" mdColSize="12" smColSize="12" flexEnabled="true"> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" text="<p>Copyright © 2023 Typerefinery. All Rights Reserved.</p>" headingLevel="h6"/> - </container1> - <container2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" lgColSize="4" mdColSize="12" smColSize="12" gap="3" flexEnabled="true" horizontalAlignment="end"> - <button_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" buttonType="navigate" buttonStyle="primary" isOutlinedButton="true" label="Github" showIcon="true" icon="pi pi-github" lgColSize="4" mdColSize="6" navigateTo="https://github.com/typerefinery-ai/typerefinery-websight" openInNewTab="true" classes="btn-sm"></button_1> - </container2> - </container5> - </container> - </jcr:content> -</jcr:root> \ No newline at end of file +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:36.417+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Footer" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + cancelInheritParent="true" + flexEnabled="true" + horizontalAlignment="between" + id="container_R2RMCAMVE" + marginEnabled="true" + marginTop="four" + paddingEnabled="true" + paddingGeneral="three"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + flexEnabled="true" + id="container1_BOCB0ZYWU" + lgColSize="2" + mdColSize="12" + smColSize="12"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h5" + id="title_MPWRMFBGZ" + title="Pages"/> + <text1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text1_HN0K6OQBB" + text="<p> <a class='text-decoration-none'href='/content/typerefinery-showcase/pages/pages/dashboard.html' > Dashboard </a> </p> <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/pages/form.html' > Form </a> </p> <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/pages/report.html' > Reports </a> </p> <p> <a class='text-decoration-none' href='https://typerefinery.ai/' > Content </a> </p> "/> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + flexEnabled="true" + id="container2_TUPCUJL7T" + lgColSize="2" + mdColSize="12" + smColSize="12"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h5" + id="title_ZMEDBOQO3" + title="Widgets"/> + <text2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text2_71MQZD23S" + text="<p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/graphs/d3graph.html' > Graph </a> </p> <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/widgets/table.html' > Table </a> </p> <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/widgets/chart.html' > Charts </a> </p> <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/widgets/map.html' > Map </a> </p> "/> + </container2> + <container3 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + flexEnabled="true" + id="container3_NJ5OC6UCV" + lgColSize="2" + mdColSize="12" + smColSize="12"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h5" + id="title_OHKGGO3LQ" + title="Resources"/> + <text3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text3_MYLKSTQKQ" + text="<p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/flow/flowform.html' > Flow Form </a> </p> <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/content/image.html' > Images </a> </p> <p> <a class='text-decoration-none' href='/content/typerefinery-showcase/pages/components/content/card.html' > Cards </a> </p> <p> <a class='text-decoration-none' href='https://github.com/typerefinery-ai/typerefinery-websight' > FAQ </a> </p> "/> + </container3> + <container5 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + borderPositionTop="true" + classes="p-2 mt-4" + flexEnabled="true" + horizontalAlignment="between" + id="container5_QMQRCSVFB" + lgColSize="12" + mdColSize="12" + smColSize="12"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + flexEnabled="true" + id="container1_GKP99SBE6" + lgColSize="8" + mdColSize="12" + smColSize="12"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + headingLevel="h6" + id="text_ZOX1CUPNY" + text="<p>Copyright © 2023 Typerefinery. All Rights Reserved.</p>"/> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + gap="3" + horizontalAlignment="end" + id="container2_HWLPKB3PL" + lgColSize="4" + mdColSize="12" + smColSize="12"> + <button_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="primary" + buttonType="navigate" + classes="btn-sm" + icon="pi pi-github" + id="button_1_QGUSDACSI" + isOutlinedButton="true" + label="Github" + lgColSize="4" + mdColSize="6" + navigateTo="https://github.com/typerefinery-ai/typerefinery-websight" + openInNewTab="true" + persistColorWhenThemeSwitches="{Boolean}true" + showIcon="true"/> + </container2> + </container5> + </container> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/header-with-hamburger/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/header-with-hamburger/.content.xml index 8d9d14ac6..cb897ad96 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/header-with-hamburger/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/header-with-hamburger/.content.xml @@ -1,85 +1,89 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Header with hamburger" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <container - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - backgroundColor="secondary" - id="container_WOK1PBQ5S"> - <two - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - horizontalAlignment="between" - id="two_VRS4HRNAY"> - <container1 - jcr:primaryType="nt:unstructured" - sling:resourceType="/apps/typerefinery/components/layout/container" - borderEnabled="false" - gap="2" - id="container1_T2DHXFASX" - lgColSize="3" - mdColSize="6" - smColSize="2"> - <button - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/button" - id="button_XIIWHQNME" - isOutlinedButton="true" - lgColSize="1" - mdColSize="2" - persistColorWhenThemeSwitches="true" - target="#container2_W4VJPPTFJ" - variant="hamburger"/> - </container1> - <container2 - jcr:primaryType="nt:unstructured" - sling:resourceType="/apps/typerefinery/components/layout/container" - flexEnabled="true" - gap="2" - horizontalAlignment="end" - id="container2_W4VJPPTFJ" - lgColSize="6" - marginEnabled="false" - mdColSize="6" - paddingEnabled="false" - smColSize="22"> - <button - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/button" - buttonStyle="warning" - buttonType="navigate" - classes="btn-sm" - hideButtonLabel="false" - id="button_FSICIBX7K" - label="Typerefinery.ai" - lgColSize="2" - mdColSize="6" - navigateTo="https://typerefinery.ai" - navigateToInNewWindow="true" - persistColorWhenThemeSwitches="true"/> - <button_1 - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/button" - actionType="initialTheme" - buttonStyle="primary" - buttonType="action" - classes="btn-sm " - hideButtonLabel="true" - icon=" pi pi-sun " - id="button_1_THEUGUJ6F" - isOutlinedButton="false" - label="\0" - lgColSize="1" - mdColSize="6" - persistColorWhenThemeSwitches="true" - showIcon="true" - showTextualElementOfButton="false"/> - </container2> - </two> -</container> - </jcr:content> -</jcr:root> \ No newline at end of file +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:37.812+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Header with hamburger" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + backgroundColor="secondary" + id="container_WOK1PBQ5S"> + <two + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + horizontalAlignment="between" + id="two_VRS4HRNAY"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + borderEnabled="false" + gap="2" + id="container1_T2DHXFASX" + lgColSize="3" + mdColSize="6" + smColSize="2"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + id="button_XIIWHQNME" + isOutlinedButton="true" + lgColSize="1" + mdColSize="2" + persistColorWhenThemeSwitches="true" + target="#container2_W4VJPPTFJ" + variant="hamburger"/> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + flexEnabled="true" + gap="2" + horizontalAlignment="end" + id="container2_W4VJPPTFJ" + lgColSize="6" + marginEnabled="false" + mdColSize="6" + paddingEnabled="false" + smColSize="22"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="warning" + buttonType="navigate" + classes="btn-sm" + hideButtonLabel="false" + id="button_FSICIBX7K" + label="Typerefinery.ai" + lgColSize="2" + mdColSize="6" + navigateTo="https://typerefinery.ai" + navigateToInNewWindow="true" + persistColorWhenThemeSwitches="true"/> + <button_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + actionType="initialTheme" + buttonStyle="primary" + buttonType="action" + classes="btn-sm " + hideButtonLabel="true" + icon=" pi pi-sun " + id="button_1_THEUGUJ6F" + isOutlinedButton="false" + label="\0" + lgColSize="1" + mdColSize="6" + persistColorWhenThemeSwitches="true" + showIcon="true" + showTextualElementOfButton="false"/> + </container2> + </two> + </container> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/header/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/header/.content.xml index 8eb5b71c6..c74424d69 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/header/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/content/header/.content.xml @@ -1,14 +1,60 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Header" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" classes="p-3 bg-secondary m-0" cancelInheritParent="true"> - <container2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" lgColSize="12" mdColSize="12" smColSize="12" gap="3" flexEnabled="true" horizontalAlignment="end"> - <button_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" label="Typerefinery.ai" buttonType="navigate" buttonStyle="warning" showIcon="true" icon="pi pi-file" lgColSize="2" mdColSize="6" navigateTo="https://typerefinery.ai/" persistColorWhenThemeSwitches="true" openInNewTab="true" classes="btn-sm"></button_1> - <button_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" buttonType="action" showIcon="true" icon=" pi pi-sun " hideButtonLabel="true" actionType="initialTheme" toggleTheme="light" lgColSize="1" mdColSize="6" classes="btn-sm " persistColorWhenThemeSwitches="true" buttonStyle="primary" ></button_3> - </container2> - </container> - </jcr:content> -</jcr:root> \ No newline at end of file +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:37.787+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Header" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + cancelInheritParent="true" + classes="p-3 bg-secondary m-0" + id="container_YQ0RUX1QR"> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + gap="3" + horizontalAlignment="end" + id="container2_E3SUQJINR" + lgColSize="12" + mdColSize="12" + smColSize="12"> + <button_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="warning" + buttonType="navigate" + classes="btn-sm" + icon="pi pi-file" + id="button_1_TXVBGG7J8" + label="Typerefinery.ai" + lgColSize="2" + mdColSize="6" + navigateTo="https://typerefinery.ai/" + openInNewTab="true" + persistColorWhenThemeSwitches="true" + showIcon="true"/> + <button_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + actionType="initialTheme" + buttonStyle="primary" + buttonType="action" + classes="btn-sm " + hideButtonLabel="true" + icon=" pi pi-sun " + id="button_3_9PTMKPFHA" + lgColSize="1" + mdColSize="6" + persistColorWhenThemeSwitches="true" + showIcon="true" + toggleTheme="light"/> + </container2> + </container> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/.content.xml index 3403bc94b..9c60bbf4b 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/.content.xml @@ -2,13 +2,19 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:37.853+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Forms" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <connection/> + <project/> + <query/> + <theme/> + <test/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/.content.xml index 35bc09eb0..dacbce7ba 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/.content.xml @@ -12,7 +12,10 @@ ws:template="/apps/typerefinery/templates/pagewithsidebar"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <delete/> + <edit/> + <list/> + <new/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/delete/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/delete/.content.xml index 1a201c7c4..6b262fe45 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/delete/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/delete/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/connection/" + readUrl="https://api.typerefinery.localhost:8101/datastore/connection/{id}" writeMethod="DELETE" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/connection/"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/connection/{id}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" @@ -71,8 +71,8 @@ <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" - title="Label" - label="Projects"/> + label="Projects" + title="Label"/> <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/select" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/edit/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/edit/.content.xml index 7d8b08824..3a6aead01 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/edit/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/edit/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/connection/" + readUrl="https://api.typerefinery.localhost:8101/datastore/connection/{id}" writeMethod="PUT" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/connection/"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/connection/{id}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" @@ -71,8 +71,8 @@ <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" - title="Label" - label="Projects"/> + label="Projects" + title="Label"/> <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/select" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/list/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/list/.content.xml index 1039a78ea..e165e25c6 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/list/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/list/.content.xml @@ -32,11 +32,11 @@ <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" + backgroundColor="light" + backgroundColorOfHeader="bg-light" borderColor="light" borderEnabled="true" borderPositionBottom="true" - backgroundColor="light" - backgroundColorOfHeader="bg-light" borderPositionLeft="true" borderPositionRight="true" borderPositionTop="true" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/new/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/new/.content.xml index 3b37f2c84..c59ae7f19 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/new/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/connection/new/.content.xml @@ -368,8 +368,8 @@ jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" gap="2" - label="Create Connection" id="button_5QVNHQCN6" + label="Create Connection" lgColSize="4" persistColorWhenThemeSwitches="{Boolean}true"/> </container> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/.content.xml index 28297bad7..e7e2b6b88 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/.content.xml @@ -12,7 +12,10 @@ ws:template="/apps/typerefinery/templates/pagewithsidebar"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <delete/> + <edit/> + <list/> + <new/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/delete/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/delete/.content.xml index f83f33afc..7b80ba6bb 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/delete/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/delete/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/project/" + readUrl="https://api.typerefinery.localhost:8101/datastore/project/{id}" writeMethod="DELETE" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/project/"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/project/{id}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/edit/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/edit/.content.xml index aa6c29529..26a48ba63 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/edit/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/project/edit/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/project/" + readUrl="https://api.typerefinery.localhost:8101/datastore/project/{id}" writeMethod="PUT" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/project/"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/project/{id}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/.content.xml index 4b11defe0..50d5314da 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/.content.xml @@ -12,7 +12,10 @@ ws:template="/apps/typerefinery/templates/pagewithsidebar"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <delete/> + <edit/> + <list/> + <new/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/delete/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/delete/.content.xml index 263431479..b98a4d1c1 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/delete/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/delete/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/query/" + readUrl="https://api.typerefinery.localhost:8101/datastore/query/{id}" writeMethod="DELETE" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/query/"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/query/{id}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/edit/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/edit/.content.xml index 485654f58..b1a6fede4 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/edit/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/edit/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/query/" + readUrl="https://api.typerefinery.localhost:8101/datastore/query/{id}" writeMethod="PUT" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/query/"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/query/{id}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" @@ -71,8 +71,8 @@ <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" - title="Label" - label="Project Id"/> + label="Project Id" + title="Label"/> <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/select" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/list/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/list/.content.xml index 0fb73cdd8..2b32b15ae 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/list/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/list/.content.xml @@ -32,13 +32,13 @@ <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" + backgroundColor="light" + backgroundColorOfHeader="bg-light" borderColor="light" borderEnabled="true" borderPositionBottom="true" borderPositionLeft="true" borderPositionRight="true" - backgroundColor="light" - backgroundColorOfHeader="bg-light" borderPositionTop="true" borderRadius="rounded" borderWidth="three" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/new/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/new/.content.xml index f8cd3912a..3a35e226e 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/new/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/query/new/.content.xml @@ -71,43 +71,42 @@ title="\0" variant="\0"> <container_0 - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="\0" - flexEnabled="false" - id="container_GQ6TYA7QK" - lgColSize="10" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - title="\0"> - <select_1 - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/select" - id="select_1_XXXESKT7S"> - <label jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/label" - label="Projects"/> - <field - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/select" + sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" - defaultSelectedOptions="\0" - id="field_EKXHG5WB9" + flexEnabled="false" + id="container_GQ6TYA7QK" + lgColSize="10" marginEnabled="false" - multipleSelection="false" - name="projectid" paddingEnabled="false" persistColorWhenThemeSwitches="false" - placeholder="Select Project" - readOptionsFromDataSource="\0" - validationRequired="false"/> - </select_1> - </container_0> - + title="\0"> + <select_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_1_XXXESKT7S"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Projects"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + borderEnabled="false" + classes="\0" + defaultSelectedOptions="\0" + id="field_EKXHG5WB9" + marginEnabled="false" + multipleSelection="false" + name="projectid" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="Select Project" + readOptionsFromDataSource="\0" + validationRequired="false"/> + </select_1> + </container_0> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/test/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/test/.content.xml new file mode 100644 index 000000000..5b169fda0 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/test/.content.xml @@ -0,0 +1,374 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-09-16T12:57:59.013+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Test" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-09-16T14:20:37.182+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_OCIIEOPID"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_CFUSIGBLV"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + flowapi_createdon="2024-09-16T03:00:17.122Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff1g4uo001wt51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f1g4uo001wt51d" + flowapi_group="/content/typerefinery-showcase/pages/forms/test/_jcr_content/rootcontainer/main/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/forms/test/_jcr_content/rootcontainer/main/form/{{id}}" + flowapi_httproutenosfx="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/forms/test/_jcr_content/rootcontainer/main/form" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_2728690a34604cae9f94272518e2744c" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_CPPZC5CZE" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/forms/test/_jcr_content/rootcontainer/main/form/{{id}}" + title="Form flow" + writeMethod="POST" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/forms/test/_jcr_content/rootcontainer/main/form/{{id}}"> + <button_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + flexEnabled="false" + hideButtonLabel="false" + id="button_1_EJY1AIYYE" + isOutlinedButton="false" + label="\0" + persistColorWhenThemeSwitches="true" + roleOther="\0" + showIcon="false" + showTextualElementOfButton="false" + title="\0"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="template_RGGAGSMEP" + name="\0" + nameCustom="add-field-to-form" + topic="add-field-to-form" + type="emit"/> + </_events_> + </button_1> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2SQBM7FTZ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_WI8DXZ9ON" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_XAK6S3FWU" + label="Input" + name="a"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_WFV2BAHZZ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_33OPGIOTO" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_JRH6MJUBJ" + label="Input" + name="b"/> + </input_1> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_3_GHMKB7NWV"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_BHLLJEPQS" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_RFVETBLJR" + label="Input"/> + </input_3> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2_X15EXBTWX"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_AZFBJNTFH" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_9NHLGT4IE" + label="Input" + name="c"/> + </input_2> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_5T0CX9TWG"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_KQWPYYPEY" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_CHZIKYC78" + inputType="field" + label="Composite Field" + name="sub"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_3JRKN8SRX"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_2XF7YPFVT" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_R6L4HVXV8" + label="Input" + name="dd"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_ECLNU1UWJ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_VMUPHXCDC" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_ZCFMDL8GW" + label="Input" + name="gg"/> + </input_1> + </field> + </composite> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + borderEnabled="false" + classes="\0" + id="accordion_RLVUFB5TT" + isTemplated="false" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem1_PITSHXDZS"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_EPGEG5RO0"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_HRPOYVKJP" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_RO5FCMQ8N" + label="Input" + placeholder="a"/> + </input> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem2_0U7J9LMVI"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_QXDCLFFRK"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_VSHK6HLTV" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_WV77ZU0UQ" + label="Input" + placeholder="2"/> + </input> + </accordionitem2> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem3_FQOJJO8P8"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_YWUR0ZAIE"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_ZV5SEP7TH" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_THSZ85H06" + label="Input" + placeholder="3"/> + </input> + </accordionitem3> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="ADDONCE_ITEM" + config="\0" + name="\0" + nameCustom="add-field-to-form" + topic="add-field-to-form"/> + </_events_> + <template + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_6ZA8PICQO"/> + </accordion> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_2RCFW6R4R"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_RSBMFUT7E" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_0HLGWF0D3" + inputType="list" + label="Composite Field" + name="BBB"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_EXQSBKKZ0"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_RFZ3FLFGI" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_N1XFG2F6M" + label="Input" + name="sdfghscvb"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_HSAEM8SMH"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_RV8QUXOYN" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_HGX9XSY7G" + label="Input" + name="xcvbxcvb"/> + </input_1> + </field> + </composite_1> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="submit" + id="button_EXKGOUBEZ" + label="Submit" + persistColorWhenThemeSwitches="{Boolean}true"/> + <template + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_RGGAGSMEP"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="accordionitem1_PITSHXDZS"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_UDTS3JGU1"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_23QISBOLK" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_KCT03J859" + label="Input" + name="WOW" + placeholder="4"/> + </input> + </accordionitem1> + </template> + </form> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_OIE744FUT"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/.content.xml index 4631457f7..a9d73b14b 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/.content.xml @@ -12,7 +12,10 @@ ws:template="/apps/typerefinery/templates/pagewithsidebar"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <delete/> + <edit/> + <list/> + <new/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/delete/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/delete/.content.xml index 319bb1c45..5f66c2bf0 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/delete/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/delete/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/theme/" + readUrl="https://api.typerefinery.localhost:8101/datastore/theme/{id}" writeMethod="DELETE" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/theme/"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/theme/{id}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/edit/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/edit/.content.xml index dfb4ce162..ab3005965 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/edit/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/edit/.content.xml @@ -40,10 +40,10 @@ flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZNQAPBZCP" readMethod="GET" - readUrl="https://api.typerefinery.localhost:8101/datastore/theme/" + readUrl="https://api.typerefinery.localhost:8101/datastore/theme/{id}" writeMethod="PUT" writePayloadType="application/json" - writeUrl="https://api.typerefinery.localhost:8101/datastore/theme/"> + writeUrl="https://api.typerefinery.localhost:8101/datastore/theme/{id}"> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/list/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/list/.content.xml index c27558712..cdc87ae7a 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/list/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/list/.content.xml @@ -32,6 +32,8 @@ <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" + backgroundColor="light" + backgroundColorOfHeader="bg-light" borderColor="light" borderEnabled="true" borderPositionBottom="true" @@ -44,8 +46,6 @@ marginGeneral="three" paddingEnabled="true" paddingGeneral="three" - backgroundColor="light" - backgroundColorOfHeader="bg-light" title="List Of Queries" titleTagName="h3" variant="sectionwithtitle"> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/new/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/new/.content.xml index 8301cdcd0..9b9068825 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/new/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/forms/theme/new/.content.xml @@ -71,43 +71,42 @@ title="\0" variant="\0"> <container_0 - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="\0" - flexEnabled="false" - id="container_GQ6TYA7QK" - lgColSize="10" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - title="\0"> - <select_1 - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/select" - id="select_1_XXXESKT7S"> - <label - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/label" - label="Projects"/> - <field jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/select" + sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" - defaultSelectedOptions="\0" - id="field_EKXHG5WB9" + flexEnabled="false" + id="container_GQ6TYA7QK" + lgColSize="10" marginEnabled="false" - multipleSelection="false" - name="projectid" paddingEnabled="false" persistColorWhenThemeSwitches="false" - placeholder="Select Project" - readOptionsFromDataSource="\0" - validationRequired="false"/> - </select_1> - </container_0> - + title="\0"> + <select_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_1_XXXESKT7S"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Projects"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + borderEnabled="false" + classes="\0" + defaultSelectedOptions="\0" + id="field_EKXHG5WB9" + marginEnabled="false" + multipleSelection="false" + name="projectid" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="Select Project" + readOptionsFromDataSource="\0" + validationRequired="false"/> + </select_1> + </container_0> <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" @@ -315,39 +314,39 @@ </input> </container_8> <container_8_1 - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - id="container_8_4SM3SFAF8" - lgColSize="10"> - <input jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/input" - id="input_ONJZUBJPB"> - <label - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/label" - id="label_LQTBNXM3M" - label="Data" - title="Label"/> - <field + sling:resourceType="typerefinery/components/layout/container" + id="container_8_4SM3SFAF8" + lgColSize="10"> + <input jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/input" - id="field_85KUDERPK" - name="data" - title="Field"/> - </input> - </container_8_1> + sling:resourceType="typerefinery/components/forms/input" + id="input_ONJZUBJPB"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_LQTBNXM3M" + label="Data" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_85KUDERPK" + name="data" + title="Field"/> + </input> + </container_8_1> <container_4 - jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - id="container_4_TOWUSCUZB" - lgColSize="10"> - <editor jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/editor" - id="editor_4A6VQMWER" - name="theme"/> - </container_4> + sling:resourceType="typerefinery/components/layout/container" + id="container_4_TOWUSCUZB" + lgColSize="10"> + <editor + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/editor" + id="editor_4A6VQMWER" + name="theme"/> + </container_4> <button jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/.content.xml index 879b7edd1..f525de4b9 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/.content.xml @@ -1,20 +1,72 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="OS-Intel" sling:resourceType="typerefinery/components/structure/page" ws:lastModified="{Date}2023-04-07T10:48:57.413+05:30" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/pagewithsidebar"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <nav jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/nav" backgroundColor="secondary" cancelInheritParent="true" id="nav_J8JAHY4VB"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" headingLevel="h5" id="title_C17MCHIDV" marginBottom="five" marginEnabled="true" marginTop="three" persistColorWhenThemeSwitches="true" textAlignment="center" title="OS-Intel Wireframe"/> - <treeview jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/treeview" id="treeview_ORCJNMMHK" parentPagePath="/content/typerefinery-showcase/pages/os-intel/admin/pages"/> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="OS-Intel" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-07T10:48:57.413+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <nav + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/nav" + backgroundColor="secondary" + cancelInheritParent="true" + id="nav_J8JAHY4VB"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h5" + id="title_C17MCHIDV" + marginBottom="five" + marginEnabled="true" + marginTop="three" + persistColorWhenThemeSwitches="true" + textAlignment="center" + title="OS-Intel Wireframe"/> + <treeview + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/treeview" + id="treeview_ORCJNMMHK" + parentPagePath="/content/typerefinery-showcase/pages/os-intel/admin/pages"/> </nav> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header" backgroundColor="secondary" cancelInheritParent="true" id="header_GF7UCAM5R" marginBottom="three" marginEnabled="true"> - <reference jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/reference" id="reference_MJSE4IO2W" path="/content/typerefinery-showcase/pages/os-intel/admin/content/header/jcr:content/container"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + backgroundColor="secondary" + cancelInheritParent="true" + id="header_GF7UCAM5R" + marginBottom="three" + marginEnabled="true"> + <reference + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/reference" + id="reference_MJSE4IO2W" + path="/content/typerefinery-showcase/pages/os-intel/admin/content/header/jcr:content/container"/> </header> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" id="container1_MQ28VZFGF" lgColSize="12" marginEnabled="true" marginLeft="two"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" headingLevel="h5" persistColorWhenThemeSwitches="true" textAlignment="center" title="Welcome to OS-Intel Wireframe"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container1_MQ28VZFGF" + lgColSize="12" + marginEnabled="true" + marginLeft="two"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h5" + persistColorWhenThemeSwitches="true" + textAlignment="center" + title="Welcome to OS-Intel Wireframe"/> </container1> </rootcontainer> </jcr:content> + <admin/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/.content.xml index f3afff991..8dce50f4c 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/.content.xml @@ -2,13 +2,16 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:39.585+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Admin" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <content/> + <pages/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/content/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/content/.content.xml index 2dd5da414..97982ac3e 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/content/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/content/.content.xml @@ -2,13 +2,16 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:39.593+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Content" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <forms/> + <header/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/content/forms/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/content/forms/.content.xml index 3403bc94b..1b282f3a8 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/content/forms/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/content/forms/.content.xml @@ -2,13 +2,14 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:39.602+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Forms" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/content/header/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/content/header/.content.xml index 26a0a0991..b5f0ba438 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/content/header/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-intel/admin/content/header/.content.xml @@ -1,12 +1,31 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Header" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" marginEnabled="true" paddingEnabled="true" paddingGeneral="four" backgroundColor="secondary" marginGeneral= "zero" cancelInheritParent="true"> - <container2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" lgColSize="12" mdColSize="12" smColSize="12" gap="3" flexEnabled="true" horizontalAlignment="end"> - </container2> - </container> - </jcr:content> -</jcr:root> \ No newline at end of file +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:39.611+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Header" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + backgroundColor="secondary" + cancelInheritParent="true" + marginEnabled="true" + marginGeneral="zero" + paddingEnabled="true" + paddingGeneral="four"> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + gap="3" + horizontalAlignment="end" + lgColSize="12" + mdColSize="12" + smColSize="12"/> + </container> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/.content.xml index 22476c8a4..cd93f42fd 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/.content.xml @@ -1,20 +1,64 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="OS-Triage" sling:resourceType="typerefinery/components/structure/page" ws:lastModified="{Date}2023-04-07T10:48:57.413+05:30" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/pagewithsidebar"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <aside jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/aside" backgroundColor="secondary" cancelInheritParent="true"> - <reference jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/reference" path="/content/typerefinery-showcase/pages/os-triage/admin/asideleft/default/jcr:content/container"/> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <forms/> + <pages/> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="OS-Triage" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-01-30T17:27:38.707+11:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + backgroundColor="secondary" + cancelInheritParent="true" + id="aside_FNBJXZF8A"> + <reference + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/reference" + id="reference_YTGVDNARH" + path="/content/typerefinery-showcase/pages/os-triage/admin/asideleft/default/jcr:content/container"/> </aside> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header" backgroundColor="secondary" cancelInheritParent="true" id="header_GF7UCAM5R" marginBottom="three" marginEnabled="true"> - <reference jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/reference" path="/content/typerefinery-showcase/pages/os-triage/admin/header/default/jcr:content/container"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + backgroundColor="secondary" + cancelInheritParent="true" + id="header_GF7UCAM5R" + marginBottom="three" + marginEnabled="true"> + <reference + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/reference" + id="reference_YGAXGJYSH" + path="/content/typerefinery-showcase/pages/os-triage/admin/header/default/jcr:content/container"/> </header> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" id="container1_MQ28VZFGF" lgColSize="12" marginEnabled="true" marginLeft="two"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" headingLevel="h5" persistColorWhenThemeSwitches="true" textAlignment="center" title="Welcome to OS-Triage Wireframe"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container1_MQ28VZFGF" + lgColSize="12" + marginEnabled="true" + marginLeft="two"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h5" + id="title_ROCGXMVDR" + persistColorWhenThemeSwitches="true" + textAlignment="center" + title="Welcome to OS-Triage Wireframe"/> </container1> </rootcontainer> </jcr:content> <admin/> -</jcr:root> \ No newline at end of file +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/.content.xml index 332f79888..83d7bc104 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:40.145+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Admin Pages" sling:resourceType="typerefinery/components/structure/page" @@ -10,4 +12,7 @@ jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <asideleft/> + <footer/> + <header/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/asideleft/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/asideleft/.content.xml index 79563f9ff..8c6aab524 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/asideleft/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/asideleft/.content.xml @@ -2,13 +2,15 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:40.153+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Aside" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <default/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/asideleft/default/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/asideleft/default/.content.xml index ec9ac2189..b4df57df0 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/asideleft/default/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/asideleft/default/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:40.160+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Default Aside Left" sling:resourceType="typerefinery/components/structure/page" @@ -10,10 +12,29 @@ jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" backgroundColor="secondary" - cancelInheritParent="true"> - <nav jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/nav" cancelInheritParent="true"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" headingLevel="h5" id="title_C17MCHIDV" marginBottom="five" marginEnabled="true" marginTop="three" persistColorWhenThemeSwitches="true" textAlignment="center" title="OS-Triage Wireframe"/> - <treeview jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/treeview" id="treeview_ORCJNMMHK" parentPagePath="/content/typerefinery-showcase/pages/os-triage/pages"/> + cancelInheritParent="true" + id="container_P8K79NAUG"> + <nav + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/nav" + cancelInheritParent="true" + id="nav_MXXT7PAED"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h5" + id="title_C17MCHIDV" + marginBottom="five" + marginEnabled="true" + marginTop="three" + persistColorWhenThemeSwitches="true" + textAlignment="center" + title="OS-Triage Wireframe"/> + <treeview + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/treeview" + id="treeview_ORCJNMMHK" + parentPagePath="/content/typerefinery-showcase/pages/os-triage/pages"/> </nav> </container> </jcr:content> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/footer/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/footer/.content.xml index 840464093..c3cdaa896 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/footer/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/footer/.content.xml @@ -2,13 +2,15 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:40.174+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Footer" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <default/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/footer/default/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/footer/default/.content.xml index a8ba43deb..f52ac7ec5 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/footer/default/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/footer/default/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:40.180+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Default Footer" sling:resourceType="typerefinery/components/structure/page" @@ -10,7 +12,6 @@ jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" backgroundColor="secondary" - cancelInheritParent="true"> - </container> + cancelInheritParent="true"/> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/header/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/header/.content.xml index 2dd5da414..35b7039aa 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/header/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/header/.content.xml @@ -2,13 +2,15 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:40.187+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Content" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <default/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/header/default/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/header/default/.content.xml index 43b9a8dae..d3e86195f 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/header/default/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/admin/header/default/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:40.197+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Default Header" sling:resourceType="typerefinery/components/structure/page" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/.content.xml index 02b870820..a112666e6 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/.content.xml @@ -1,15 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> <note/> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Forms" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:40.223+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Forms" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/page"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> <addtag/> <addtask/> <updateincident/> <createincident/> <artifact/> + <create-user/> + <add-email-address/> + <identity/> + <identity1/> + <vizandform/> + <vizandform-local/> + <stix/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/add-email-address/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/add-email-address/.content.xml new file mode 100644 index 000000000..bbfa58337 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/add-email-address/.content.xml @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-01-30T22:29:49.853+11:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Add Email Address" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-01-30T22:35:05.101+11:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/blank" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/rootcontainer" + decorationTagName="main"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + id="form_WAEGSLCVP" + writePayloadType="application/json"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HGP9NYO3G"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_BEC0L47HW" + label="Address" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + borderEnabled="false" + classes="\0" + disabled="false" + id="field_RSWVZT16K" + inputType="email" + marginEnabled="false" + name="email" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="you@provider.com" + title="Field" + validationRequired="false"/> + </input> + <select + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_FY5VLMEXC"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_LRW4BIFPX" + label="Type" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + borderEnabled="false" + classes="\0" + defaultSelectedOptions="\0" + disabled="false" + id="field_0GT0WGKFS" + keyNameInOptionList="\0" + labelNameInOptionList="\0" + marginEnabled="false" + multipleSelection="false" + name="type" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="\0" + readOptionsFromDataSource="\0" + title="Field" + validationRequired="false"> + <selectOptions jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + label="Work" + value="work"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + label="Home" + value="home"/> + </selectOptions> + </field> + </select> + </form> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/addtask/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/addtask/.content.xml index da2468758..862c47e5b 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/addtask/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/addtask/.content.xml @@ -1,39 +1,213 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-10T18:08:17.501+05:30" jcr:lastModifiedBy="wsadmin" jcr:primaryType="ws:PageContent" jcr:title="Add Task" sling:resourceType="typerefinery/components/structure/page" ws:lastModified="{Date}2023-04-21T15:59:31.348+05:30" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/page" description="\0" flowstreamid="\0" hideInNav="false" icon="\0" ogDescription="\0" ogTitle="\0" ogUrl="\0" propertyTitle="\0"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <main jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/main" id="main_PGKS4F8GU"> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" flexEnabled="false" id="container_JPNAI1MPK" marginEnabled="false" paddingEnabled="true" paddingGeneral="two" persistColorWhenThemeSwitches="false" title="\0"> - <form jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/form" flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_LHSNPXYQE"> - <select jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/select" id="select_HWZ3UTXYC"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="false" id="label_OLFOYMJP3" label="Group" title="Label"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/select" borderEnabled="false" classes="\0" defaultSelectedOptions="\0" id="field_RI5RYRU6P" marginBottom="two" marginEnabled="true" multipleSelection="false" name="selectGroup" paddingEnabled="false" persistColorWhenThemeSwitches="false" placeholder="group" readOptionsFromDataSource="\0" title="Field" validationRequired="false"/> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-10T18:08:17.501+05:30" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Add Task" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-21T15:59:31.348+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + flowstreamid="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_PGKS4F8GU"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="container_JPNAI1MPK" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="two" + persistColorWhenThemeSwitches="false" + title="\0"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + id="form_LHSNPXYQE"> + <select + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_HWZ3UTXYC"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_OLFOYMJP3" + label="Group" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + borderEnabled="false" + classes="\0" + defaultSelectedOptions="\0" + id="field_RI5RYRU6P" + marginBottom="two" + marginEnabled="true" + multipleSelection="false" + name="selectGroup" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="group" + readOptionsFromDataSource="\0" + title="Field" + validationRequired="false"/> </select> - <input jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input" id="input_D3X4WIP76"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="false" id="label_SKLABW1DX" label="Title" title="Label"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" borderEnabled="false" classes="\0" id="field_J4YA2PUFB" inputType="text" marginBottom="two" marginEnabled="true" name="tasktitle" paddingEnabled="false" persistColorWhenThemeSwitches="false" placeholder="Enter Task Title" title="Field" validationInputMask="\0" validationRequired="false"/> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_D3X4WIP76"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_SKLABW1DX" + label="Title" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + borderEnabled="false" + classes="\0" + id="field_J4YA2PUFB" + inputType="text" + marginBottom="two" + marginEnabled="true" + name="tasktitle" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="Enter Task Title" + title="Field" + validationInputMask="\0" + validationRequired="false"/> </input> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" borderEnabled="false" classes="\0" headingLevel="\0" headingSize="h6" id="title_3LGHFAQRE" marginEnabled="false" paddingEnabled="false" persistColorWhenThemeSwitches="false" title="Discription"/> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" classes="\0" id="text_JS8FELMFM" markdown="\0" paragraphMode="false" text="<p>Please enter new task description</p><p>here ..</p>"/> - <select_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/select" id="select_1_2OOG5IMOW"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="false" id="label_QQPPFARAX" label="Assignee" title="Label"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/select" borderEnabled="false" classes="\0" defaultSelectedOptions="\0" id="field_N978TJWCJ" marginBottom="two" marginEnabled="true" multipleSelection="false" name="selectAssignee" paddingEnabled="false" persistColorWhenThemeSwitches="false" placeholder="assignee" readOptionsFromDataSource="\0" title="Field" validationRequired="false"/> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + borderEnabled="false" + classes="\0" + headingLevel="\0" + headingSize="h6" + id="title_3LGHFAQRE" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="Discription"/> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + classes="\0" + id="text_JS8FELMFM" + markdown="\0" + paragraphMode="false" + text="<p>Please enter new task description</p><p>here ..</p>"/> + <select_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_1_2OOG5IMOW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_QQPPFARAX" + label="Assignee" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + borderEnabled="false" + classes="\0" + defaultSelectedOptions="\0" + id="field_N978TJWCJ" + marginBottom="two" + marginEnabled="true" + multipleSelection="false" + name="selectAssignee" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="assignee" + readOptionsFromDataSource="\0" + title="Field" + validationRequired="false"/> </select_1> - <checkbox jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/checkbox" flexEnabled="true" horizontalAlignment="start" id="checkbox_M0XT29HDC" textAlignment="left" verticalAlignment="start"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="false" id="label_87WSMBAKZ" label="Flag this task?" title="Label"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/checkbox" id="field_JNCKRXFIA" name="flag" title="Field" value="flagtask"/> + <checkbox + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/checkbox" + flexEnabled="true" + horizontalAlignment="start" + id="checkbox_M0XT29HDC" + textAlignment="left" + verticalAlignment="start"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_87WSMBAKZ" + label="Flag this task?" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/checkbox" + id="field_JNCKRXFIA" + name="flag" + title="Field" + value="flagtask"/> </checkbox> - <input_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input" id="input_1_01GHDBULC"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="false" id="label_W3EZTDWQR" label="Due Date" title="Label"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" borderEnabled="false" classes="\0" id="field_PS17JXP8U" inputType="date" marginBottom="two" marginEnabled="true" marginTop="zero" name="taskdate" paddingEnabled="false" persistColorWhenThemeSwitches="false" placeholder="Eg. 10/04/23" title="Field" validationInputMask="\0" validationRequired="false"/> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_01GHDBULC"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_W3EZTDWQR" + label="Due Date" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + borderEnabled="false" + classes="\0" + id="field_PS17JXP8U" + inputType="date" + marginBottom="two" + marginEnabled="true" + marginTop="zero" + name="taskdate" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="Eg. 10/04/23" + title="Field" + validationInputMask="\0" + validationRequired="false"/> </input_1> </form> </container> </main> - <footer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/footer" id="footer_IS2AONRWL"/> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_IS2AONRWL"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/create-user/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/create-user/.content.xml new file mode 100644 index 000000000..447f70f78 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/create-user/.content.xml @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-01-29T16:57:38.573+11:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Create User" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-09-14T20:22:11.792+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/blank" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/rootcontainer" + decorationTagName="main"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_createdon="2024-09-14T10:22:13.053Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff1g2yy001wt51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f1g2yy001wt51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/forms/create-user/_jcr_content/rootcontainer/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/create-user/_jcr_content/rootcontainer/form/{{id}}" + flowapi_httproutenosfx="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/create-user/_jcr_content/rootcontainer/form" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_91e5ddf0feb4411890f3fc3ac9557865" + flowapi_updatedon="\0" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_TCWKYNWIA" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/create-user/_jcr_content/rootcontainer/form/{{id}}" + title="Form flow" + writeMethod="POST" + writePayloadType="application/x-www-form-urlencoded" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/create-user/_jcr_content/rootcontainer/form"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_XIV69UCOF"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_JVBHDKVOD" + label="User ID" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_GOKD5VYNF" + name="user_id" + title="Field"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_NX18RJ5HV"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_3RJS3HETE" + label="Account Login" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_CXHVOUJD6" + name="account_login" + title="Field"/> + </input_1> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2_ZO22NASOW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_MHTRQU7IW" + label="Account Type" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_IRP1PZY1P" + name="account_type" + title="Field"/> + </input_2> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_3_DSELEZYB6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_ZOAFZ4WR9" + label="Display Name" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_EIVVUU9GO" + name="display_name" + title="Field"/> + </input_3> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="submit" + id="button_TA4ZRWRUG" + label="Create" + persistColorWhenThemeSwitches="{Boolean}true"/> + </form> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/identity/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/identity/.content.xml new file mode 100644 index 000000000..452320341 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/identity/.content.xml @@ -0,0 +1,878 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-06-20T12:21:53.612+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Identity" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-07-15T23:05:58.507+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + cancelInheritParent="true" + id="header_CBO9D7PKR"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + gap="0" + id="main_7KZVYHQJY" + marginEnabled="false" + marginGeneral="three" + paddingEnabled="false" + paddingGeneral="zero"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + gap="0" + id="container_CNONTMTLW" + paddingBottom="three" + paddingEnabled="true"> + <two + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="{Boolean}true" + horizontalAlignment="start" + id="two_V30OAL8HE"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + horizontalAlignment="center" + id="container1_ZCTMXBMGV" + lgColSize="{Long}6" + mdColSize="{Long}6" + smColSize="{Long}6" + textAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_MY94YFGQ2" + text="<p>Options</p>"/> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_LYLYDNEYC" + isOutlinedButton="false" + label="CB" + lgColSize="1" + mdColSize="2" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="2" + title="Created By"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="#template_identity_cb" + name="\0" + nameCustom="form-identity-add-once" + topic="form-identity-add-once" + type="emit"/> + </_events_> + </button> + <button_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + id="button_1_W3CBZHL60" + label="DF" + lgColSize="1" + mdColSize="2" + persistColorWhenThemeSwitches="{Boolean}true" + smColSize="2" + title="Defanged"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="#template_identity_df" + name="\0" + nameCustom="form-identity-add-once" + topic="form-identity-add-once" + type="emit"/> + </_events_> + </button_1> + <button_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + id="button_2_ZRTMKHGTO" + label="LB" + lgColSize="1" + mdColSize="2" + persistColorWhenThemeSwitches="{Boolean}true" + smColSize="2" + title="Labels"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="#template_identity_lb" + name="\0" + nameCustom="form-identity-add-once" + topic="form-identity-add-once" + type="emit"/> + </_events_> + </button_2> + <button_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + id="button_3_CSSTNFCXQ" + label="CO" + lgColSize="1" + mdColSize="2" + persistColorWhenThemeSwitches="{Boolean}true" + smColSize="2" + title="Confidence"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="#template_identity_co" + name="\0" + nameCustom="form-identity-add-once" + topic="form-identity-add-once" + type="emit"/> + </_events_> + </button_3> + <button_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + id="button_4_W2UHVEXMV" + label="LN" + lgColSize="1" + mdColSize="2" + persistColorWhenThemeSwitches="{Boolean}true" + smColSize="2" + title="Language"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="#template_identity_ln" + name="\0" + nameCustom="form-identity-add-once" + topic="form-identity-add-once" + type="emit"/> + </_events_> + </button_4> + <button_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + id="button_5_0OHAHJ0YJ" + label="ER" + lgColSize="1" + mdColSize="2" + persistColorWhenThemeSwitches="{Boolean}true" + smColSize="2" + title="External References"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="#template_identity_er" + name="\0" + nameCustom="form-identity-add-once" + topic="form-identity-add-once" + type="emit"/> + </_events_> + </button_5> + <button_6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + id="button_6_K0R1W8FVI" + label="OM" + lgColSize="1" + mdColSize="2" + persistColorWhenThemeSwitches="{Boolean}true" + smColSize="2" + title="Object Markings"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="#template_identity_om" + name="\0" + nameCustom="form-identity-add-once" + topic="form-identity-add-once" + type="emit"/> + </_events_> + </button_6> + <button_7 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + id="button_7_NYG76FLTO" + label="GM" + lgColSize="1" + mdColSize="2" + persistColorWhenThemeSwitches="{Boolean}true" + smColSize="2" + title="Granular Markings"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="#template_identity_gm" + name="\0" + nameCustom="form-identity-add-once" + topic="form-identity-add-once" + type="emit"/> + </_events_> + </button_7> + <button_7_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_7_NYG76FLTO" + isOutlinedButton="false" + label="RV" + lgColSize="1" + mdColSize="2" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="2" + title="Revoked"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="#template_identity_rv" + name="\0" + nameCustom="form-identity-add-once" + topic="form-identity-add-once" + type="emit"/> + </_events_> + </button_7_1> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + id="container2_WVP4DIGAS" + lgColSize="{Long}6" + mdColSize="{Long}6" + smColSize="{Long}6" + textAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_XIDCRG1O8" + text="<p>Extentions</p>"/> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="warning" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_CENED2IYF" + isOutlinedButton="false" + label="IC" + lgColSize="1" + mdColSize="2" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="2" + title="Identity Contact Extension"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="#template_identity_ic" + name="\0" + nameCustom="form-identity-add-once" + topic="form-identity-add-once" + type="emit"/> + </_events_> + </button> + </container2> + </two> + </container> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + id="form_RNBNWDBWK"> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + borderEnabled="false" + classes="\0" + id="accordion_PVAJHWCES" + isTemplated="false" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + id="identity_base" + showopen="true" + title="Base"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="false" + id="container_ZVGPNXN7T" + title="Base" + variant="\0"> + <one + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="one_RCHDIA36C" + title="Column"> + <id_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/id" + id="id_1_UCQHCCG9Y" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_7GZPIMC9D" + label="ID"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_H2RXWKFW1" + inputType="id" + label="ID" + name="id" + placeholder="id"/> + </id_1> + <string + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_FHQGQHONL" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_PKDIROQPV" + label="Spec Version"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_RHZ7BR3DT" + inputType="string" + label="Field" + name="spec_version" + placeholder="spec_version"/> + </string> + <timestamp + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/timestamp" + id="timestamp_CA84HOTQO" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_GBQSHFVNH" + label="Created"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_OK1EQJYNM" + inputType="timestamp" + label="Timestamp" + name="created" + placeholder="created"/> + </timestamp> + <timestamp_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/timestamp" + id="timestamp_1_YIMIHBDGC" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_XDM6COQCH" + label="Modified"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_DAP9THO67" + inputType="timestamp" + label="Timestamp" + name="modified" + placeholder="modified"/> + </timestamp_1> + </one> + </container> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + id="identity_object" + showopen="true" + title="Object"> + <container_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="container_ZVGPNXN7T" + lgColSizeForChildren="col-lg-12" + marginEnabled="false" + mdColSizeForChildren="col-lg-12" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + roleOther="\0" + smColSizeForChildren="col-lg-12" + title="Object" + variant="\0"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + flexEnabled="true" + gap="0" + id="container_DTUM16K7X" + paddingEnabled="false" + paddingGeneral="two"> + <string + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + containerType="default" + flexEnabled="false" + id="string_1EO8XMUY4" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_XVO8QUUVH" + label="Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + disabled="false" + id="field_MUOTDBG2Ia" + inputType="string" + label="Field" + name="name" + placeholder="name" + validationRequired="false"/> + </string> + <string_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + flexEnabled="false" + id="string_1_GWBY2POLY" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_3DBRWL6XN" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_JXFDEO92I" + inputType="string" + label="Field" + name="description" + placeholder="description"/> + </string_1> + <vocab + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/select/vocab" + id="vocab_JCYZN7D1V" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_POB9A5FHO" + label="Identity Class"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/select" + id="field_LDGANZ0Z5" + inputType="vocab" + label="Vocab" + name="identity_class" + placeholder="identity_class" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/identity/class"/> + </vocab> + <list_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/select/list" + id="list_1_Q8V4TAU8J" + lgColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_N1H3WMCKO" + label="Roles"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/select" + id="field_E0USNEPFK" + inputType="list" + label="List" + lgColSize="12" + mdColSize="12" + name="roles" + placeholder="roles" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/roles/type" + smColSize="12"/> + </list_1> + <string_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_2_UEM5WYWUT" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_ZTBMN5VA5" + label="Contact Information"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_MQDVXD0RF" + inputType="string" + label="Field" + name="contact_information" + placeholder="contact_information"/> + </string_2> + <list + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/select/list" + id="list_45L77RIHQ" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_1DUSPBMOW" + label="Sectors"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/select" + id="field_ABEBHRUBY" + inputType="list" + label="List" + name="sectors" + placeholder="sectors" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/sectors/type"/> + </list> + </container> + </container_1> + </accordionitem2> + <template + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_MXMJLGXNV"/> + <template_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="template_identity_ic" + marginEnabled="false" + name="\0" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + roleOther="\0" + title="\0"> + <accordionitem3_8 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + id="identity_ic" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + showopen="true" + title="Identity Contact Extension (IC)"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_IUB0QYSOB"/> + </accordionitem3_8> + </template_1> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="OPEN_ITEM" + config="\0" + name="\0" + nameCustom="form-identity-open" + topic="form-identity-open"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + action="ADDONCE_ITEM" + config="\0" + name="\0" + nameCustom="form-identity-add-once" + topic="form-identity-add-once"/> + </_events_> + <template_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_identity_gm"> + <accordionitem3_7 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + id="identity_gm" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + showopen="true" + title="Granular Markings (GM)"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_IUB0QYSOB"/> + </accordionitem3_7> + </template_2> + <template_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_identity_om"> + <accordionitem3_6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + id="identity_om" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + showopen="true" + title="Object Markings (OM)"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_IUB0QYSOB"/> + </accordionitem3_6> + </template_3> + <template_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_identity_er"> + <accordionitem3_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + id="identity_er" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + showopen="true" + title="External References (ER)"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_IUB0QYSOB"/> + </accordionitem3_5> + </template_4> + <template_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_identity_ln"> + <accordionitem3_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + id="identity_ln" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + showopen="true" + title="Language (LN)"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_IUB0QYSOB"/> + </accordionitem3_4> + </template_5> + <template_6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_identity_co"> + <accordionitem3_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + id="identity_co" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + showopen="true" + title="Confidence (CO)"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_IUB0QYSOB"/> + </accordionitem3_3> + </template_6> + <template_7 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_identity_lb"> + <accordionitem3_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + id="identity_lb" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + showopen="true" + title="Labels (LB)"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_IUB0QYSOB"/> + </accordionitem3_2> + </template_7> + <template_8 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_identity_df"> + <accordionitem3_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + id="identity_df" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + showopen="true" + title="Defanged (DF)"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_IUB0QYSOB"/> + </accordionitem3_1> + </template_8> + <template_9 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_identity_cb"> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + id="identity_cb" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + showopen="true" + title="Created By (CB)"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_IUB0QYSOB"/> + </accordionitem3> + </template_9> + <template_9_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/template" + id="template_identity_rv"> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + alwaysopen="false" + borderEnabled="false" + classes="\0" + id="identity_cb" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + showopen="true" + title="Revoked (RV)"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_IUB0QYSOB"/> + </accordionitem3> + </template_9_1> + </accordion> + </form> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_NE6HSXGTK"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/identity1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/identity1/.content.xml new file mode 100644 index 000000000..af9c790bf --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/identity1/.content.xml @@ -0,0 +1,1726 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-06-21T10:36:11.116+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Identity1" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-10-08T01:42:35.698+11:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + cancelInheritParent="true" + id="header_8GLRQQ6QZ"> + <two + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="two_NEMN1RX22"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + flexEnabled="true" + horizontalAlignment="start" + id="container1_AVOPAG1E7" + lgColSize="{Long}6" + mdColSize="{Long}6" + paddingEnabled="true" + paddingLeft="two" + smColSize="{Long}6" + verticalAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_ECIBBCTDI" + text="<h1>Identity Form</h1>"/> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + flexEnabled="true" + gap="0" + horizontalAlignment="end" + id="container2_P4OIFH8MJ" + lgColSize="{Long}6" + marginEnabled="false" + marginRight="zero" + mdColSize="{Long}6" + paddingEnabled="true" + paddingRight="two" + persistColorWhenThemeSwitches="false" + smColSize="{Long}6" + textAlignment="\0" + verticalAlignment="center"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + flexEnabled="false" + hideButtonLabel="false" + id="button_MKFRZOYJF" + isOutlinedButton="false" + label="Save" + lgColSize="4" + mdColSize="4" + persistColorWhenThemeSwitches="true" + roleOther="\0" + showIcon="false" + showTextualElementOfButton="false" + smColSize="4" + title="Save"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="\0" + name="submitaction" + nameCustom="\0" + topic="form-identity-submit" + type="emit"/> + </_events_> + </button> + </container2> + </two> + </header> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_NB7BMTQ0U"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + gap="0" + id="container_CNONTMTLW" + lgColSize="12" + mdColSize="12" + paddingBottom="three" + paddingEnabled="true" + smColSize="12"> + <two + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + containerType="default" + flexEnabled="true" + horizontalAlignment="start" + id="two_V30OAL8HE" + lgColSize="12" + marginEnabled="false" + mdColSize="12" + paddingEnabled="false" + smColSize="12" + textAlignment="\0"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + horizontalAlignment="center" + id="container1_ZCTMXBMGV" + lgColSize="6" + mdColSize="8" + smColSize="8" + textAlignment="center" + title="One"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_MY94YFGQ2" + text="<p>Options</p>"/> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_LYLYDNEYC" + isOutlinedButton="false" + label="Base" + lgColSize="2" + mdColSize="2" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="2" + title="Created By"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="section_base_required" + name="\0" + nameCustom="form-identity-toggle-item" + topic="form-identity-toggle-item" + type="emit"/> + </_events_> + </button> + <button_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_1_W3CBZHL60" + isOutlinedButton="false" + label="Optional" + lgColSize="2" + mdColSize="2" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="2" + title="Defanged"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="section_base_optional" + name="\0" + nameCustom="form-identity-toggle-item" + topic="form-identity-toggle-item" + type="emit"/> + </_events_> + </button_1> + <button_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_2_ZRTMKHGTO" + isOutlinedButton="false" + label="Object" + lgColSize="2" + mdColSize="2" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="2" + title="Labels"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="section_object" + name="\0" + nameCustom="form-identity-toggle-item" + topic="form-identity-toggle-item" + type="emit"/> + </_events_> + </button_2> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + id="container2_WVP4DIGAS" + lgColSize="6" + mdColSize="4" + smColSize="4" + textAlignment="center" + title="Two"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_XIDCRG1O8" + text="<p>Extentions</p>"/> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="warning" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_CENED2IYF" + isOutlinedButton="false" + label="Extensions" + lgColSize="2" + mdColSize="4" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="4" + title="Identity Contact Extension"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="section_extensions" + name="\0" + nameCustom="form-identity-toggle-item" + topic="form-identity-toggle-item" + type="emit"/> + </_events_> + </button> + </container2> + </two> + </container> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_createdon="2024-10-07T06:15:35.605Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff1gsc3001rn51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f1gsc3001rn51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/forms/identity1/_jcr_content/rootcontainer/main/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/identity1/_jcr_content/rootcontainer/main/form/{{id}}" + flowapi_httproutenosfx="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/identity1/_jcr_content/rootcontainer/main/form" + flowapi_iscontainer="false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_e227a44891bc43afb49961eead6c6f39" + flowapi_updatedon="\0" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_RV9MGWSUF" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readMethod="GET" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/identity1/_jcr_content/rootcontainer/main/form/{{id}}" + roleOther="\0" + title="Form flow" + writeMethod="POST" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/identity1/_jcr_content/rootcontainer/main/form/{{id}}"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_7X4RTXYG3"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_IMWLIWWNE" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_VDUCGJNGE" + inputType="hidden" + label="Input" + name="_type" + placeholder="\0" + value="identity"/> + </input> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + borderEnabled="false" + classes="\0" + id="accordion_HGQUWW86Z" + isTemplated="false" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="section_base_required" + title="Base Required"> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_LPYU5IPSY"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_XHROJK4IN" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + borderEnabled="false" + classes="\0" + disabled="false" + id="field_HEFIHRE9C" + inputType="field" + label="Composite Field" + marginEnabled="false" + name="base_required" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + validationRequired="false"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="false" + id="container_ZVGPNXN7Ta" + title="Base" + variant="\0"> + <one + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + id="one_RCHDIA36Ca" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + roleOther="\0" + title="Column"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_AXAD9QWGS"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_VYHNV8NJC" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_R3BBIXMYV" + label="Input" + name="type" + placeholder="_type" + value="_type"/> + </input> + <id + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/id" + id="id_1_UCQHCCG9Y" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_7GZPIMC9D" + label="ID"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_H2RXWKFW1" + inputType="id" + label="ID" + name="id" + placeholder="id"/> + </id> + <string + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_FHQGQHONL" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_PKDIROQPV" + label="Spec Version"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_RHZ7BR3DT" + inputType="string" + label="Field" + name="spec_version" + placeholder="spec_version"/> + </string> + <timestamp + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/timestamp" + id="timestamp_CA84HOTQO" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_GBQSHFVNH" + label="Created"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_OK1EQJYNM" + inputType="timestamp" + label="Timestamp" + name="created" + placeholder="created"/> + </timestamp> + <timestamp_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/timestamp" + id="timestamp_1_YIMIHBDGC" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_XDM6COQCH" + label="Modified"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_DAP9THO67" + inputType="timestamp" + label="Timestamp" + name="modified" + placeholder="modified"/> + </timestamp_1> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="ADDONCE_ITEM" + config="\0" + name="\0" + nameCustom="form-identity-base-required-addonce1" + topic="form-identity-base-required-addonce1" + type="listen"/> + </_events_> + </one> + </container> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="ADDONCE_ITEM" + config="\0" + name="\0" + nameCustom="form-identity-base-required-addonce" + topic="form-identity-base-required-addonce" + type="listen"/> + </_events_> + </field> + </composite> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="section_base_optional" + title="Base Optional"> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_S6YLTN8GU"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_OVLNCLIRC" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_NYILS4DCX" + label="Composite Field" + name="base_optional"> + <reference + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/reference" + id="reference_72FJ1KFWJaaaaa"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_0SEKXJGS0aa" + label="Reference"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_C9ROSXKGY" + inputType="reference" + label="Reference"/> + </reference> + <boolean + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/boolean" + id="boolean_HGAFSZQJK"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_74SVASJPF" + label="Boolean"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_AFBYEMTW4" + inputType="boolean" + label="Boolean"/> + </boolean> + <list + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/select/list" + id="list_THW5OLAXS"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_SN4WYDRAW" + label="Labels"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/select" + id="field_Q6ZWKKDAS" + inputType="list" + label="List" + multipleSelection="true" + name="labels" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/utils/label"/> + </list> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_TSSQEWZMT"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_XGYJQ5MXG" + label="Confidence"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_JPRPAFPYB" + inputType="number" + label="Input" + name="confidence" + placeholder="confidence"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_ZOGOKYZDQ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_I8UJFNUUT" + label="Lang"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_YJXDLL3GG" + label="Input" + name="lang" + placeholder="lang"/> + </input_1> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_Y7M0OBKPI"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_N5ZMBIHYY" + label="External References"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + classes="form-control" + id="field_B6CV7RDAH" + inputType="list" + label="Composite Field" + name="external_references"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_O0SH1VNTX" + lgColSize="5" + mdColSize="5" + smColSize="5"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_KEVIIXQBT" + label="source_name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_ALGP9F6MQ" + label="Input" + name="source_name" + placeholder="source_name"/> + </input> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNR" + lgColSize="5" + mdColSize="5" + smColSize="5"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSH" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZ" + label="Input" + name="description" + placeholder="description" + value="\0"/> + </input_2> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + borderEnabled="true" + id="input_1_HYTIZRDKVz" + lgColSize="5" + mdColSize="5" + smColSize="5"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_EYBHSWJJM" + label="Url"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_M83MLD2STz" + label="Input" + name="url" + placeholder="url"/> + </input_1> + <input_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_HYTIZRDKVbbn" + lgColSize="5" + mdColSize="5" + smColSize="5"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_EYBHSWJJMa" + label="Hashes"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_M83MLD2ST" + label="Input" + name="hashes" + placeholder="hashes"/> + </input_1_1> + <input_1_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_HYTIZRDKVba" + lgColSize="5" + mdColSize="5" + smColSize="5"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_EYBHSWJJMbn" + label="External ID"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_M83MLD2ST" + label="Input" + name="external_id" + placeholder="external_id"/> + </input_1_1_1> + </field> + </composite> + <reference_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/reference" + id="reference_72FJ1KFWJaawewee"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_XEFV1S5R9bbwdsgee" + label="Object Marking Refs"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_CD4NAUAGB" + inputType="reference" + label="Reference" + name="object_marking_refs" + placeholder="object_marking_refs"/> + </reference_1> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_V3RGSNZMM"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_Q6LRBTXH1" + label="Granular Markings"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + classes="form-control" + id="field_PKSC4OPPK" + inputType="list" + label="Composite Field" + name="granular_markings"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_M872226HQ" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_YBELKHSWT" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_YHHDZM8OE" + label="Input"/> + </input> + <reference + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/reference" + id="reference_MPSEUOJJT" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_YWR53CAAF" + label="Reference"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_6NUONJLMK" + inputType="reference" + label="Reference"/> + </reference> + <list + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/select/list" + id="list_OB8P3NKUW" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_ESEEJ4WGA" + label="List"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/select" + id="field_ZEEIKPKGI" + inputType="list" + label="List"/> + </list> + </field> + </composite_1> + </field> + </composite> + </accordionitem2> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="section_object" + title="Object"> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_OYMR0JUC3"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_KPUGUYRJG" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_LQ0GSLXMV" + inputType="field" + label="Composite Field" + name="base_optional"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="container_ZVGPNXN7Taa" + lgColSizeForChildren="col-lg-12" + marginEnabled="false" + mdColSizeForChildren="col-lg-12" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + roleOther="\0" + smColSizeForChildren="col-lg-12" + title="Object" + variant="\0"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + flexEnabled="true" + gap="0" + id="container_DTUM16K7X1a" + paddingEnabled="false" + paddingGeneral="two"> + <string + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + containerType="default" + flexEnabled="false" + id="string_1EO8XMUY4qq" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_XVO8QUUVH" + label="Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_MUOTDBG2Ia" + inputType="string" + label="Field" + name="name" + placeholder="name"/> + </string> + <string_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + flexEnabled="false" + id="string_1_GWBY2POLY" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_3DBRWL6XN" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_JXFDEO92I" + inputType="string" + label="Field" + name="description" + placeholder="description"/> + </string_1> + <vocab + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/select/vocab" + id="vocab_JCYZN7D1V" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_POB9A5FHO" + label="Identity Class"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/select" + id="field_LDGANZ0Z5" + inputType="vocab" + label="Vocab" + name="identity_class" + placeholder="identity_class" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/utils/identity"/> + </vocab> + <list_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/select/list" + id="list_1_Q8V4TAU8J" + lgColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_N1H3WMCKO" + label="Roles"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/select" + id="field_E0USNEPFK" + inputType="list" + label="List" + lgColSize="12" + mdColSize="12" + name="roles" + placeholder="roles" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/utils/role" + smColSize="12"/> + </list_1> + <string_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_2_UEM5WYWUT" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_ZTBMN5VA5" + label="Contact Information"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_MQDVXD0RF" + inputType="string" + label="Field" + name="contact_information" + placeholder="contact_information"/> + </string_2> + <list + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/select/list" + id="list_45L77RIHQ" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_1DUSPBMOW" + label="Sectors"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/select" + id="field_ABEBHRUBY" + inputType="list" + label="List" + name="sectors" + placeholder="sectors" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/utils/sector"/> + </list> + </container> + </container> + </field> + </composite_1> + </accordionitem3> + <accordionitem3_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="section_extensions" + title="Extensions"> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_EIYLQEKCE"> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_VMBAGYTEJ" + label="Composite Field" + name="extensions"> + <composite_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_E89JLVCNW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_WENYDITU3" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_XTC902F1F" + label="Composite Field" + name="extension-definition--66e2492a-bbd3-4be6-88f5-cc91a017a498"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_PF2DXSFGI"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_REMI3GTOI" + label="_type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_OPZ3D48PK" + inputType="hidden" + label="Input" + name="_type" + placeholder="extension-definition--66e2492a-bbd3-4be6-88f5-cc91a017a498" + value="extension-definition--66e2492a-bbd3-4be6-88f5-cc91a017a498"/> + </input> + <string + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_RBARVNDLF"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_3KAWGUFXP" + label="Extension Type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_XKJFQMYD5" + inputType="string" + label="Field" + name="extension_type" + placeholder="extension_type"/> + </string> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_FDMPO1RUO"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_JSIYE8IFO" + label="Contact Numbers"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + classes="form-control" + id="field_NWUIF02PX" + inputType="list" + label="Composite Field" + name="contact_numbers"> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_WTMXH3HFS" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_LSITPW9YG" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_EQFFOVMK8" + inputType="hidden" + label="Input" + name="type" + placeholder="ContactNumber" + value="\0"/> + </input_1> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNRqa" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSH" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZ" + label="Input" + name="description" + placeholder="description" + value="\0"/> + </input> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + gap="0" + id="input_HS9TIIBNRa" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_IVH92LNHSa" + label="Contact Number Type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_75XLXJND0" + label="Input" + name="contact_number_type" + placeholder="contact_number_type" + value="\0"/> + </input_2> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNRq" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_CGZGGM747" + label="Contact Number"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_TKW2PEMOT" + label="Input" + name="contact_number" + placeholder="contact_number" + value="\0"/> + </input_3> + </field> + </composite> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_E89JLVCNWd"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_N45OF36GVa" + label="Email Addresses"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + classes="form-control" + id="field_2IN8NSD3Taeggegeg" + inputType="list" + label="Composite Field" + name="email_addresses"> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_WTMXH3HFS" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_LSITPW9YG" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_EQFFOVMK8" + inputType="hidden" + label="Input" + name="type" + placeholder="ContactNumber" + value="ContactNumber"/> + </input_1> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNR" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSHsgdge" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZfwfwf" + label="Input" + name="description" + placeholder="description" + value="\0"/> + </input> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNRdsgsdgseg" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSHwww" + label="Digital Contact Type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZfff" + label="Input" + name="digital_contact_type" + placeholder="digital_contact_type" + value="\0"/> + </input_2> + <reference + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/reference" + id="reference_TXUK0SIOP" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_Y80BDBWHA" + label="Email Address Ref"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_4Z1GJKR5V" + inputType="reference" + label="Reference" + name="email_address_ref" + placeholder="email_address_ref"/> + </reference> + </field> + </composite_1> + <string_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_1_MRIDQI710awwwww"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_QGR7HPPGTafasfasf" + label="First Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_WYX5LXX3P" + inputType="string" + label="Field" + name="first_name" + placeholder="first_name"/> + </string_1> + <string_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_1_MRIDQI710b"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_XIU2ASKZIb" + label="Last Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_YDTNWHC4M" + inputType="string" + label="Field" + name="last_name" + placeholder="last_name"/> + </string_1_1> + <string_1_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_1_MRIDQI710f"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_QANKH3D69f" + label="Middle Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_QVJFYKFPN" + inputType="string" + label="Field" + name="middle_name" + placeholder="middle_name"/> + </string_1_2> + <string_1_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_1_MRIDQI710s"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_FWGMOWPFB" + label="Prefix"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_QHJI9NDKD" + inputType="string" + label="Field" + name="prefix" + placeholder="prefix"/> + </string_1_3> + <composite_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_E89JLVCNWa"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_N45OF36GVs" + label="Social Media Accounts"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + classes="form-control" + id="field_2IN8NSD3T" + inputType="list" + label="Composite Field" + name="social_media_accounts"> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_WTMXH3HFS" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_LSITPW9YG" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_EQFFOVMK8" + inputType="hidden" + label="Input" + name="type" + placeholder="ContactNumber" + value="ContactNumber"/> + </input_1> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNRssf" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSH" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZffsa" + label="Input" + name="description" + placeholder="description" + value="\0"/> + </input> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNRasf" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSHeee" + label="Digital Contact Type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZfff" + label="Input" + name="digital_contact_type" + placeholder="digital_contact_type" + value="\0"/> + </input_2> + <input_2_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNRaaaas" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSH" + label="Extension Type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZasfasf" + label="Input" + name="extension_type" + placeholder="extension_type" + value="\0"/> + </input_2_1> + </field> + </composite_1_1> + <string_1_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_1_MRIDQI710aasas"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_BKGNORTAO" + label="Suffix"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_ZNZFTQY83" + inputType="string" + label="Field" + name="suffix"/> + </string_1_4> + <string_1_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_1_MRIDQI710afasfs"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_OXZVOBP54" + label="Team"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_TGI8P8BBS" + inputType="string" + label="Field" + name="team" + placeholder="team"/> + </string_1_5> + </field> + </composite_1_1> + </field> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_E89JLVCNW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + label="Composite Field"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_PF2DXSFGI"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_REMI3GTOI" + label="_type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_OPZ3D48PK" + inputType="hidden" + label="Input" + name="_type" + value="extension-definition--66e2492a-bbd3-4be6-88f5-cc91a017a498"/> + </input> + <string + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_RBARVNDLF"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="String"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_XKJFQMYD5" + inputType="string" + label="Field" + name="extension_type"/> + </string> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_FDMPO1RUO"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_JSIYE8IFO" + label="Contact Numbers"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + classes="form-control" + id="field_NWUIF02PX" + inputType="list" + label="Composite Field" + name="contact_numbers"> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_WTMXH3HFS" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_LSITPW9YG" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_EQFFOVMK8" + inputType="hidden" + label="Input" + name="type" + placeholder="ContactNumber" + value="ContactNumber"/> + </input_1> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNR" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSH" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZ" + label="Input" + name="description" + placeholder="description" + value="description"/> + </input> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + gap="0" + id="input_HS9TIIBNR" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_IVH92LNHS" + label="Contact Number Type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_75XLXJND0" + label="Input" + name="contact_number_type" + placeholder="contact_number_type" + value="contact_number_type"/> + </input_2> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNR" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_CGZGGM747" + label="Contact Number"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_TKW2PEMOT" + label="Input" + name="contact_number" + placeholder="contact_number" + value="contact_number"/> + </input_3> + </field> + </composite> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_E89JLVCNW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_N45OF36GV" + label="Email Addresses"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_2IN8NSD3T" + inputType="list" + label="Composite Field" + name="email_addresses"/> + </composite_1> + </field> + </composite_1> + </composite> + </accordionitem3_1> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="TOGGLE_ITEM" + config="\0" + name="\0" + nameCustom="form-identity-toggle-item" + topic="form-identity-toggle-item"/> + </_events_> + </accordion> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="FORM_SUBMIT" + name="submitaction" + nameCustom="\0" + topic="form-identity-submit" + type="listen"/> + </_events_> + </form> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_KCPCUGQZH"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/note/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/note/.content.xml index 19165c74a..6bf95be31 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/note/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/note/.content.xml @@ -1,25 +1,114 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-10T18:08:17.501+05:30" jcr:lastModifiedBy="wsadmin" jcr:primaryType="ws:PageContent" jcr:title="Note" sling:resourceType="typerefinery/components/structure/page" ws:lastModified="{Date}2023-04-25T15:36:57.959+05:30" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/page" description="\0" flowstreamid="\0" hideInNav="false" icon="\0" ogDescription="\0" ogTitle="\0" ogUrl="\0" propertyTitle="\0"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <main jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/main" id="main_PGKS4F8GU"> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" flexEnabled="false" id="container_JPNAI1MPK" marginEnabled="false" paddingEnabled="true" paddingGeneral="two" persistColorWhenThemeSwitches="false" title="\0"> - <form jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/form" flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_LHSNPXYQE" title="note"> - <select jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/select" id="select_HWZ3UTXYC"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="false" id="label_OLFOYMJP3" label="Category" title="Label"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/select" borderEnabled="false" classes="\0" defaultSelectedOptions="\0" id="field_RI5RYRU6P" marginBottom="two" marginEnabled="true" multipleSelection="false" name="selectCategory" paddingEnabled="false" persistColorWhenThemeSwitches="false" placeholder="Tags" readOptionsFromDataSource="\0" title="Field" validationRequired="false"/> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-10T18:08:17.501+05:30" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Note" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-25T15:36:57.959+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + flowstreamid="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_PGKS4F8GU"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="container_JPNAI1MPK" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="two" + persistColorWhenThemeSwitches="false" + title="\0"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + id="form_LHSNPXYQE" + title="note"> + <select + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_HWZ3UTXYC"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_OLFOYMJP3" + label="Category" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + borderEnabled="false" + classes="\0" + defaultSelectedOptions="\0" + id="field_RI5RYRU6P" + marginBottom="two" + marginEnabled="true" + multipleSelection="false" + name="selectCategory" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="Tags" + readOptionsFromDataSource="\0" + title="Field" + validationRequired="false"/> </select> - <select_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/select" id="select_1_2OOG5IMOW"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="false" id="label_QQPPFARAX" label="Markdown" title="Label"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/select" borderEnabled="false" classes="\0" defaultSelectedOptions="\0" id="field_N978TJWCJ" marginBottom="two" marginEnabled="true" multipleSelection="false" name="selectMarkdown" paddingEnabled="false" persistColorWhenThemeSwitches="false" placeholder="markdown" readOptionsFromDataSource="\0" title="Field" validationRequired="false"/> + <select_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_1_2OOG5IMOW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_QQPPFARAX" + label="Markdown" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + borderEnabled="false" + classes="\0" + defaultSelectedOptions="\0" + id="field_N978TJWCJ" + marginBottom="two" + marginEnabled="true" + multipleSelection="false" + name="selectMarkdown" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="markdown" + readOptionsFromDataSource="\0" + title="Field" + validationRequired="false"/> </select_1> </form> </container> </main> - <footer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/footer" id="footer_IS2AONRWL"/> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_IS2AONRWL"/> </rootcontainer> </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/.content.xml new file mode 100644 index 000000000..605a4dd68 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/.content.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-09-09T13:36:05.496+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Stix" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/rootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <asideleft + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + classes="aside-left"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + containerType="fullWidth" + decorationTagName="main"/> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer"/> + </rootcontainer> + </jcr:content> + <company/> + <identity/> + <individual/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/company/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/company/.content.xml new file mode 100644 index 000000000..ad667b62b --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/company/.content.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-09-09T14:32:32.060+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Company" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-09-09T14:32:42.526+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/rootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_2PGNKASAC"/> + <asideleft + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + classes="aside-left" + id="asideleft_M4VWYELLH"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + containerType="fullWidth" + decorationTagName="main" + id="main_XXSE17VEC"/> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_XYUMKG3OZ"/> + </rootcontainer> + </jcr:content> + <update/> + <create/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/company/create/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/company/create/.content.xml new file mode 100644 index 000000000..13d90a5f0 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/company/create/.content.xml @@ -0,0 +1,207 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-06-21T10:36:11.116+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Create Company" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-09-09T20:13:01.936+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + cancelInheritParent="true" + id="header_8GLRQQ6QZ"> + <two + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="two_NEMN1RX22"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + flexEnabled="true" + horizontalAlignment="start" + id="container1_AVOPAG1E7" + lgColSize="{Long}6" + mdColSize="{Long}6" + paddingEnabled="true" + paddingLeft="two" + smColSize="{Long}6" + verticalAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_ECIBBCTDI" + text="<h1>Create Company</h1>"/> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + flexEnabled="true" + gap="0" + horizontalAlignment="end" + id="container2_P4OIFH8MJ" + lgColSize="{Long}6" + marginEnabled="false" + marginRight="zero" + mdColSize="{Long}6" + paddingEnabled="true" + paddingRight="two" + persistColorWhenThemeSwitches="false" + smColSize="{Long}6" + textAlignment="\0" + verticalAlignment="center"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + flexEnabled="false" + hideButtonLabel="false" + id="button_MKFRZOYJF" + isOutlinedButton="false" + label="Create" + lgColSize="4" + mdColSize="4" + persistColorWhenThemeSwitches="true" + roleOther="\0" + showIcon="false" + showTextualElementOfButton="false" + smColSize="4" + title="Create"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="\0" + name="\0" + nameCustom="form-company-create-submit" + topic="form-company-create-submit" + type="emit"/> + </_events_> + </button> + </container2> + </two> + </header> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_NB7BMTQ0U"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_createdon="2024-09-09T04:38:21.537Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff1fx5e002im50d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f1fx5e002im50d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/forms/stix/company/create/_jcr_content/rootcontainer/main/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/stix/company/create/_jcr_content/rootcontainer/main/form/{{id}}" + flowapi_httproutenosfx="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/stix/company/create/_jcr_content/rootcontainer/main/form" + flowapi_iscontainer="false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_e227a44891bc43afb49961eead6c6f39" + flowapi_updatedon="\0" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_RV9MGWSUF" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readMethod="GET" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/stix/company/create/_jcr_content/rootcontainer/main/form/{{id}}" + roleOther="\0" + title="Form flow" + writeMethod="POST" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/stix/company/create/_jcr_content/rootcontainer/main/form/{{id}}"> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2_WEFW6ISUG"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_B5ZE4WDVZ" + label="Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_NAPZHLGCE" + label="Input" + name="name"/> + </input_2> + <textarea + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_0OCZRKUMU"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + forId="\0" + id="label_UXO6MWSCL" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_ODRMYYDZX" + label="\0" + name="description"/> + </textarea> + <select + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_QMUMD9EJI"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_VXKWMAGCY" + label="Sectors"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + id="field_5LQIKABFF" + label="Select" + name="sectors" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/utils/sector"/> + </select> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="FORM_SUBMIT" + name="\0" + nameCustom="form-company-create-submit" + topic="form-company-create-submit" + type="listen"/> + </_events_> + </form> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_KCPCUGQZH"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/company/update/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/company/update/.content.xml new file mode 100644 index 000000000..d9bb86443 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/company/update/.content.xml @@ -0,0 +1,465 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-06-21T10:36:11.116+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Update Company" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-09-09T14:39:14.576+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + cancelInheritParent="true" + id="header_8GLRQQ6QZ"> + <two + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="two_NEMN1RX22"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + flexEnabled="true" + horizontalAlignment="start" + id="container1_AVOPAG1E7" + lgColSize="{Long}6" + mdColSize="{Long}6" + paddingEnabled="true" + paddingLeft="two" + smColSize="{Long}6" + verticalAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_ECIBBCTDI" + text="<h1>Update Company</h1>"/> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + flexEnabled="true" + gap="0" + horizontalAlignment="end" + id="container2_P4OIFH8MJ" + lgColSize="{Long}6" + marginEnabled="false" + marginRight="zero" + mdColSize="{Long}6" + paddingEnabled="true" + paddingRight="two" + persistColorWhenThemeSwitches="false" + smColSize="{Long}6" + textAlignment="\0" + verticalAlignment="center"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + flexEnabled="false" + hideButtonLabel="false" + id="button_MKFRZOYJF" + isOutlinedButton="false" + label="Update" + lgColSize="4" + mdColSize="4" + persistColorWhenThemeSwitches="true" + roleOther="\0" + showIcon="false" + showTextualElementOfButton="false" + smColSize="4" + title="Update"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="\0" + name="\0" + nameCustom="form-company-submit" + topic="form-company-submit" + type="emit"/> + </_events_> + </button> + </container2> + </two> + </header> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_NB7BMTQ0U"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_createdon="2024-09-09T04:38:12.168Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff1fx5e001im51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f1fx5e001im51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/forms/stix/company/update/_jcr_content/rootcontainer/main/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/stix/company/update/_jcr_content/rootcontainer/main/form/{{id}}" + flowapi_httproutenosfx="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/stix/company/update/_jcr_content/rootcontainer/main/form" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_e227a44891bc43afb49961eead6c6f39" + flowapi_updatedon="\0" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_RV9MGWSUF" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/identity1/_jcr_content/rootcontainer/main/form/{{id}}" + roleOther="\0" + title="Form flow" + writeMethod="POST" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/identity1/_jcr_content/rootcontainer/main/form/{{id}}"> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_Y9UVRRS7H"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_UXFQ4JD1M" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_BUQVHHXTW" + inputType="field" + label="Composite Field" + name="stix_object"> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2_WEFW6ISUG"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_B5ZE4WDVZ" + label="Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_NAPZHLGCE" + label="Input" + name="name"/> + </input_2> + <textarea + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_0OCZRKUMU"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + forId="\0" + id="label_UXO6MWSCL" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_ODRMYYDZX" + label="\0" + name="description"/> + </textarea> + <select_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_1_FHSRLBISV"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_L3BQWL588" + label="Roles"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + id="field_98HSQ9YAZ" + label="Select" + name="roles" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/utils/role"/> + </select_1> + <select + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_QMUMD9EJI"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_VXKWMAGCY" + label="Sectors"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + id="field_5LQIKABFF" + label="Select" + name="sectors" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/utils/sector"/> + </select> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_ZZ07BFK38"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_SF8Y2MLH5" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_T2PUPIIMO" + inputType="hidden" + label="Input" + name="identity_class" + value="asset"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_HM1BLR933"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_NC7RR4QQW" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_9YBL0B3NB" + inputType="hidden" + label="Input" + name="type" + value="identity"/> + </input_1> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_3_GWG2NKLOF"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_QAD92ISJZ" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_HSIHCXSFW" + inputType="hidden" + label="Input" + name="spec_version" + value="2.1"/> + </input_3> + <input_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_4_3L11FCEYW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_PXBUCMNJK" + label="Created"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_0G8O7WGS1" + label="Input" + name="created"/> + </input_4> + <input_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_5_SFPT5Z19D"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_AHQNYNEPS" + label="Modified"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_E0VMWF7KQ" + label="Input" + name="modified"/> + </input_5> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_9N8CJBRGP"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_V2HWQYPNF" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_1ZKPLLYQG" + inputType="list" + label="Composite Field" + name="external_references"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_CZJVJGZEG" + lgColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_JIEWVUYNE" + label="Source Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_X6KLKBR1H" + label="Input" + name="source_name"/> + </input> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2_ZLALARMDA" + lgColSize="6" + smColSize="12"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_FUTZ4L0ES" + label="ID"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_BVN2XFY5L" + label="Input" + name="external_id"/> + </input_2> + <textarea + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/textarea" + id="textarea_3DOP3EX10"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + display="none" + id="label_BDXWVN8BS" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/textarea" + id="field_QHJQQ7AZX" + label="\0" + name="description"/> + </textarea> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_BJVW91IMR"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_OZ6EA3YHH" + label="URL"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_P0NIEUWAC" + label="Input" + name="url"/> + </input_1> + </field> + </composite> + </field> + </composite> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_NZ9CRXUVP"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_RQLFLOFAT" + label="Composite"/> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + label="Input"/> + </input> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_A6UAZRZPZ" + inputType="field" + label="Composite Field" + name="context_type"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_FZ5LQLF87"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_KETVSD8C0" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_07EYZZLCN" + inputType="hidden" + label="Input" + name="context_type" + value="assets"/> + </input> + </field> + </composite_1> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="FORM_SUBMIT" + name="\0" + nameCustom="form-company-submit" + topic="form-company-submit"/> + </_events_> + </form> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_KCPCUGQZH"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/identity/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/identity/.content.xml new file mode 100644 index 000000000..b03404c78 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/identity/.content.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-09-09T14:33:06.065+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Identity" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/rootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <asideleft + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + classes="aside-left"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + containerType="fullWidth" + decorationTagName="main"/> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer"/> + </rootcontainer> + </jcr:content> + <update/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/identity/update/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/identity/update/.content.xml new file mode 100644 index 000000000..94f7b3711 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/identity/update/.content.xml @@ -0,0 +1,1726 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-06-21T10:36:11.116+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Identity Update" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-10-08T01:42:13.411+11:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + cancelInheritParent="true" + id="header_8GLRQQ6QZ"> + <two + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="two_NEMN1RX22"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + flexEnabled="true" + horizontalAlignment="start" + id="container1_AVOPAG1E7" + lgColSize="{Long}6" + mdColSize="{Long}6" + paddingEnabled="true" + paddingLeft="two" + smColSize="{Long}6" + verticalAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_ECIBBCTDI" + text="<h1>Update Identity</h1>"/> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + flexEnabled="true" + gap="0" + horizontalAlignment="end" + id="container2_P4OIFH8MJ" + lgColSize="{Long}6" + marginEnabled="false" + marginRight="zero" + mdColSize="{Long}6" + paddingEnabled="true" + paddingRight="two" + persistColorWhenThemeSwitches="false" + smColSize="{Long}6" + textAlignment="\0" + verticalAlignment="center"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + flexEnabled="false" + hideButtonLabel="false" + id="button_MKFRZOYJF" + isOutlinedButton="false" + label="Update" + lgColSize="4" + mdColSize="4" + persistColorWhenThemeSwitches="true" + roleOther="\0" + showIcon="false" + showTextualElementOfButton="false" + smColSize="4" + title="Update"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="\0" + name="\0" + nameCustom="form-identity-submit" + topic="form-identity-submit" + type="emit"/> + </_events_> + </button> + </container2> + </two> + </header> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + id="main_NB7BMTQ0U"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + gap="0" + id="container_CNONTMTLW" + lgColSize="12" + mdColSize="12" + paddingBottom="three" + paddingEnabled="true" + smColSize="12"> + <two + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + containerType="default" + flexEnabled="true" + horizontalAlignment="start" + id="two_V30OAL8HE" + lgColSize="12" + marginEnabled="false" + mdColSize="12" + paddingEnabled="false" + smColSize="12" + textAlignment="\0"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + horizontalAlignment="center" + id="container1_ZCTMXBMGV" + lgColSize="6" + mdColSize="8" + smColSize="8" + textAlignment="center" + title="One"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_MY94YFGQ2" + text="<p>Options</p>"/> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_LYLYDNEYC" + isOutlinedButton="false" + label="Base" + lgColSize="2" + mdColSize="2" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="2" + title="Created By"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="section_base_required" + name="\0" + nameCustom="form-identity-toggle-item" + topic="form-identity-toggle-item" + type="emit"/> + </_events_> + </button> + <button_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_1_W3CBZHL60" + isOutlinedButton="false" + label="Optional" + lgColSize="2" + mdColSize="2" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="2" + title="Defanged"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="section_base_optional" + name="\0" + nameCustom="form-identity-toggle-item" + topic="form-identity-toggle-item" + type="emit"/> + </_events_> + </button_1> + <button_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_2_ZRTMKHGTO" + isOutlinedButton="false" + label="Object" + lgColSize="2" + mdColSize="2" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="2" + title="Labels"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="section_object" + name="\0" + nameCustom="form-identity-toggle-item" + topic="form-identity-toggle-item" + type="emit"/> + </_events_> + </button_2> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="/apps/typerefinery/components/layout/container" + id="container2_WVP4DIGAS" + lgColSize="6" + mdColSize="4" + smColSize="4" + textAlignment="center" + title="Two"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_XIDCRG1O8" + text="<p>Extentions</p>"/> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="warning" + buttonType="action" + classes="\0" + hideButtonLabel="false" + id="button_CENED2IYF" + isOutlinedButton="false" + label="Extensions" + lgColSize="2" + mdColSize="4" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false" + smColSize="4" + title="Identity Contact Extension"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="BUTTON_CLICK" + config="section_extensions" + name="\0" + nameCustom="form-identity-toggle-item" + topic="form-identity-toggle-item" + type="emit"/> + </_events_> + </button> + </container2> + </two> + </container> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_createdon="2024-09-09T03:40:09.221Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff1fx3s001im51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f1fx3s001im51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/forms/stix/identity/update/_jcr_content/rootcontainer/main/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/stix/identity/_jcr_content/rootcontainer/main/form/{{id}}" + flowapi_httproutenosfx="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/stix/identity/_jcr_content/rootcontainer/main/form" + flowapi_iscontainer="false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_e227a44891bc43afb49961eead6c6f39" + flowapi_updatedon="\0" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_RV9MGWSUF" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readMethod="GET" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/stix/identity/_jcr_content/rootcontainer/main/form/{{id}}" + roleOther="\0" + title="Form flow" + writeMethod="POST" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/identity1/_jcr_content/rootcontainer/main/form/{{id}}"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_7X4RTXYG3"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_IMWLIWWNE" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_VDUCGJNGE" + inputType="hidden" + label="Input" + name="_type" + placeholder="\0" + value="identity"/> + </input> + <accordion + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordion" + borderEnabled="false" + classes="\0" + id="accordion_HGQUWW86Z" + isTemplated="false" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false"> + <accordionitem1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="section_base_required" + title="Base Required"> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_LPYU5IPSY"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_XHROJK4IN" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + borderEnabled="false" + classes="\0" + disabled="false" + id="field_HEFIHRE9C" + inputType="field" + label="Composite Field" + marginEnabled="false" + name="base_required" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + validationRequired="false"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="false" + id="container_ZVGPNXN7Ta" + title="Base" + variant="\0"> + <one + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + id="one_RCHDIA36Ca" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + roleOther="\0" + title="Column"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_AXAD9QWGS"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_VYHNV8NJC" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_R3BBIXMYV" + label="Input" + name="type" + placeholder="_type" + value="_type"/> + </input> + <id + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/id" + id="id_1_UCQHCCG9Y" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_7GZPIMC9D" + label="ID"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_H2RXWKFW1" + inputType="id" + label="ID" + name="id" + placeholder="id"/> + </id> + <string + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_FHQGQHONL" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_PKDIROQPV" + label="Spec Version"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_RHZ7BR3DT" + inputType="string" + label="Field" + name="spec_version" + placeholder="spec_version"/> + </string> + <timestamp + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/timestamp" + id="timestamp_CA84HOTQO" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_GBQSHFVNH" + label="Created"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_OK1EQJYNM" + inputType="timestamp" + label="Timestamp" + name="created" + placeholder="created"/> + </timestamp> + <timestamp_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/timestamp" + id="timestamp_1_YIMIHBDGC" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_XDM6COQCH" + label="Modified"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_DAP9THO67" + inputType="timestamp" + label="Timestamp" + name="modified" + placeholder="modified"/> + </timestamp_1> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="ADDONCE_ITEM" + config="\0" + name="\0" + nameCustom="form-identity-base-required-addonce1" + topic="form-identity-base-required-addonce1" + type="listen"/> + </_events_> + </one> + </container> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="ADDONCE_ITEM" + config="\0" + name="\0" + nameCustom="form-identity-base-required-addonce" + topic="form-identity-base-required-addonce" + type="listen"/> + </_events_> + </field> + </composite> + </accordionitem1> + <accordionitem2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="section_base_optional" + title="Base Optional"> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_S6YLTN8GU"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_OVLNCLIRC" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_NYILS4DCX" + label="Composite Field" + name="base_optional"> + <reference + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/reference" + id="reference_72FJ1KFWJaaaaa"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_0SEKXJGS0aa" + label="Reference"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_C9ROSXKGY" + inputType="reference" + label="Reference"/> + </reference> + <boolean + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/boolean" + id="boolean_HGAFSZQJK"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_74SVASJPF" + label="Boolean"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_AFBYEMTW4" + inputType="boolean" + label="Boolean"/> + </boolean> + <list + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/select/list" + id="list_THW5OLAXS"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_SN4WYDRAW" + label="Labels"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/select" + id="field_Q6ZWKKDAS" + inputType="list" + label="List" + multipleSelection="true" + name="labels" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/labels/type"/> + </list> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_TSSQEWZMT"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_XGYJQ5MXG" + label="Confidence"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_JPRPAFPYB" + inputType="number" + label="Input" + name="confidence" + placeholder="confidence"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_ZOGOKYZDQ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_I8UJFNUUT" + label="Lang"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_YJXDLL3GG" + label="Input" + name="lang" + placeholder="lang"/> + </input_1> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_Y7M0OBKPI"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_N5ZMBIHYY" + label="External References"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + classes="form-control" + id="field_B6CV7RDAH" + inputType="list" + label="Composite Field" + name="external_references"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_O0SH1VNTX" + lgColSize="5" + mdColSize="5" + smColSize="5"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_KEVIIXQBT" + label="source_name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_ALGP9F6MQ" + label="Input" + name="source_name" + placeholder="source_name"/> + </input> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNR" + lgColSize="5" + mdColSize="5" + smColSize="5"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSH" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZ" + label="Input" + name="description" + placeholder="description" + value="\0"/> + </input_2> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + borderEnabled="true" + id="input_1_HYTIZRDKVz" + lgColSize="5" + mdColSize="5" + smColSize="5"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_EYBHSWJJM" + label="Url"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_M83MLD2STz" + label="Input" + name="url" + placeholder="url"/> + </input_1> + <input_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_HYTIZRDKVbbn" + lgColSize="5" + mdColSize="5" + smColSize="5"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_EYBHSWJJMa" + label="Hashes"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_M83MLD2ST" + label="Input" + name="hashes" + placeholder="hashes"/> + </input_1_1> + <input_1_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_HYTIZRDKVba" + lgColSize="5" + mdColSize="5" + smColSize="5"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_EYBHSWJJMbn" + label="External ID"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_M83MLD2ST" + label="Input" + name="external_id" + placeholder="external_id"/> + </input_1_1_1> + </field> + </composite> + <reference_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/reference" + id="reference_72FJ1KFWJaawewee"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_XEFV1S5R9bbwdsgee" + label="Object Marking Refs"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_CD4NAUAGB" + inputType="reference" + label="Reference" + name="object_marking_refs" + placeholder="object_marking_refs"/> + </reference_1> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_V3RGSNZMM"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_Q6LRBTXH1" + label="Granular Markings"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + classes="form-control" + id="field_PKSC4OPPK" + inputType="list" + label="Composite Field" + name="granular_markings"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_M872226HQ" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_YBELKHSWT" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_YHHDZM8OE" + label="Input"/> + </input> + <reference + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/reference" + id="reference_MPSEUOJJT" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_YWR53CAAF" + label="Reference"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_6NUONJLMK" + inputType="reference" + label="Reference"/> + </reference> + <list + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/select/list" + id="list_OB8P3NKUW" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_ESEEJ4WGA" + label="List"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/select" + id="field_ZEEIKPKGI" + inputType="list" + label="List"/> + </list> + </field> + </composite_1> + </field> + </composite> + </accordionitem2> + <accordionitem3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="section_object" + title="Object"> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_OYMR0JUC3"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_KPUGUYRJG" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_LQ0GSLXMV" + inputType="field" + label="Composite Field" + name="base_optional"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="container_ZVGPNXN7Taa" + lgColSizeForChildren="col-lg-12" + marginEnabled="false" + mdColSizeForChildren="col-lg-12" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + roleOther="\0" + smColSizeForChildren="col-lg-12" + title="Object" + variant="\0"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + flexEnabled="true" + gap="0" + id="container_DTUM16K7X1a" + paddingEnabled="false" + paddingGeneral="two"> + <string + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + containerType="default" + flexEnabled="false" + id="string_1EO8XMUY4qq" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_XVO8QUUVH" + label="Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_MUOTDBG2Ia" + inputType="string" + label="Field" + name="name" + placeholder="name"/> + </string> + <string_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + flexEnabled="false" + id="string_1_GWBY2POLY" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_3DBRWL6XN" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_JXFDEO92I" + inputType="string" + label="Field" + name="description" + placeholder="description"/> + </string_1> + <vocab + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/select/vocab" + id="vocab_JCYZN7D1V" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_POB9A5FHO" + label="Identity Class"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/select" + id="field_LDGANZ0Z5" + inputType="vocab" + label="Vocab" + name="identity_class" + placeholder="identity_class" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/identity/class"/> + </vocab> + <list_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/select/list" + id="list_1_Q8V4TAU8J" + lgColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_N1H3WMCKO" + label="Roles"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/select" + id="field_E0USNEPFK" + inputType="list" + label="List" + lgColSize="12" + mdColSize="12" + name="roles" + placeholder="roles" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/roles/type" + smColSize="12"/> + </list_1> + <string_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_2_UEM5WYWUT" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_ZTBMN5VA5" + label="Contact Information"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_MQDVXD0RF" + inputType="string" + label="Field" + name="contact_information" + placeholder="contact_information"/> + </string_2> + <list + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/select/list" + id="list_45L77RIHQ" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + forId="\0" + id="label_1DUSPBMOW" + label="Sectors"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/select" + id="field_ABEBHRUBY" + inputType="list" + label="List" + name="sectors" + placeholder="sectors" + readOptionsFromDataSource="https://flow.typerefinery.localhost:8101/stix/sectors/type"/> + </list> + </container> + </container> + </field> + </composite_1> + </accordionitem3> + <accordionitem3_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/accordionitem" + id="section_extensions" + title="Extensions"> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_EIYLQEKCE"> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_VMBAGYTEJ" + label="Composite Field" + name="extensions"> + <composite_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_E89JLVCNW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_WENYDITU3" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_XTC902F1F" + label="Composite Field" + name="extension-definition--66e2492a-bbd3-4be6-88f5-cc91a017a498"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_PF2DXSFGI"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_REMI3GTOI" + label="_type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_OPZ3D48PK" + inputType="hidden" + label="Input" + name="_type" + placeholder="extension-definition--66e2492a-bbd3-4be6-88f5-cc91a017a498" + value="extension-definition--66e2492a-bbd3-4be6-88f5-cc91a017a498"/> + </input> + <string + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_RBARVNDLF"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_3KAWGUFXP" + label="Extension Type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_XKJFQMYD5" + inputType="string" + label="Field" + name="extension_type" + placeholder="extension_type"/> + </string> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_FDMPO1RUO"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_JSIYE8IFO" + label="Contact Numbers"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + classes="form-control" + id="field_NWUIF02PX" + inputType="list" + label="Composite Field" + name="contact_numbers"> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_WTMXH3HFS" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_LSITPW9YG" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_EQFFOVMK8" + inputType="hidden" + label="Input" + name="type" + placeholder="ContactNumber" + value="\0"/> + </input_1> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNRqa" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSH" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZ" + label="Input" + name="description" + placeholder="description" + value="\0"/> + </input> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + gap="0" + id="input_HS9TIIBNRa" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_IVH92LNHSa" + label="Contact Number Type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_75XLXJND0" + label="Input" + name="contact_number_type" + placeholder="contact_number_type" + value="\0"/> + </input_2> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNRq" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_CGZGGM747" + label="Contact Number"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_TKW2PEMOT" + label="Input" + name="contact_number" + placeholder="contact_number" + value="\0"/> + </input_3> + </field> + </composite> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_E89JLVCNWd"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_N45OF36GVa" + label="Email Addresses"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + classes="form-control" + id="field_2IN8NSD3Taeggegeg" + inputType="list" + label="Composite Field" + name="email_addresses"> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_WTMXH3HFS" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_LSITPW9YG" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_EQFFOVMK8" + inputType="hidden" + label="Input" + name="type" + placeholder="ContactNumber" + value="ContactNumber"/> + </input_1> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNR" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSHsgdge" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZfwfwf" + label="Input" + name="description" + placeholder="description" + value="\0"/> + </input> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNRdsgsdgseg" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSHwww" + label="Digital Contact Type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZfff" + label="Input" + name="digital_contact_type" + placeholder="digital_contact_type" + value="\0"/> + </input_2> + <reference + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/reference" + id="reference_TXUK0SIOP" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_Y80BDBWHA" + label="Email Address Ref"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_4Z1GJKR5V" + inputType="reference" + label="Reference" + name="email_address_ref" + placeholder="email_address_ref"/> + </reference> + </field> + </composite_1> + <string_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_1_MRIDQI710awwwww"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_QGR7HPPGTafasfasf" + label="First Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_WYX5LXX3P" + inputType="string" + label="Field" + name="first_name" + placeholder="first_name"/> + </string_1> + <string_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_1_MRIDQI710b"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_XIU2ASKZIb" + label="Last Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_YDTNWHC4M" + inputType="string" + label="Field" + name="last_name" + placeholder="last_name"/> + </string_1_1> + <string_1_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_1_MRIDQI710f"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_QANKH3D69f" + label="Middle Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_QVJFYKFPN" + inputType="string" + label="Field" + name="middle_name" + placeholder="middle_name"/> + </string_1_2> + <string_1_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_1_MRIDQI710s"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_FWGMOWPFB" + label="Prefix"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_QHJI9NDKD" + inputType="string" + label="Field" + name="prefix" + placeholder="prefix"/> + </string_1_3> + <composite_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_E89JLVCNWa"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_N45OF36GVs" + label="Social Media Accounts"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + classes="form-control" + id="field_2IN8NSD3T" + inputType="list" + label="Composite Field" + name="social_media_accounts"> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_WTMXH3HFS" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_LSITPW9YG" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_EQFFOVMK8" + inputType="hidden" + label="Input" + name="type" + placeholder="ContactNumber" + value="ContactNumber"/> + </input_1> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNRssf" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSH" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZffsa" + label="Input" + name="description" + placeholder="description" + value="\0"/> + </input> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNRasf" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSHeee" + label="Digital Contact Type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZfff" + label="Input" + name="digital_contact_type" + placeholder="digital_contact_type" + value="\0"/> + </input_2> + <input_2_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNRaaaas" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSH" + label="Extension Type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZasfasf" + label="Input" + name="extension_type" + placeholder="extension_type" + value="\0"/> + </input_2_1> + </field> + </composite_1_1> + <string_1_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_1_MRIDQI710aasas"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_BKGNORTAO" + label="Suffix"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_ZNZFTQY83" + inputType="string" + label="Field" + name="suffix"/> + </string_1_4> + <string_1_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_1_MRIDQI710afasfs"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_OXZVOBP54" + label="Team"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_TGI8P8BBS" + inputType="string" + label="Field" + name="team" + placeholder="team"/> + </string_1_5> + </field> + </composite_1_1> + </field> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_E89JLVCNW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Composite"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + label="Composite Field"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_PF2DXSFGI"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_REMI3GTOI" + label="_type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_OPZ3D48PK" + inputType="hidden" + label="Input" + name="_type" + value="extension-definition--66e2492a-bbd3-4be6-88f5-cc91a017a498"/> + </input> + <string + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/input/string" + id="string_RBARVNDLF"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="String"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/stix/forms/fields/input" + id="field_XKJFQMYD5" + inputType="string" + label="Field" + name="extension_type"/> + </string> + <composite + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_FDMPO1RUO"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_JSIYE8IFO" + label="Contact Numbers"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + classes="form-control" + id="field_NWUIF02PX" + inputType="list" + label="Composite Field" + name="contact_numbers"> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_WTMXH3HFS" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_LSITPW9YG" + label="Input Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_EQFFOVMK8" + inputType="hidden" + label="Input" + name="type" + placeholder="ContactNumber" + value="ContactNumber"/> + </input_1> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNR" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_B3KYD6XSH" + label="Description"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_UTPKVHWLZ" + label="Input" + name="description" + placeholder="description" + value="description"/> + </input> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + gap="0" + id="input_HS9TIIBNR" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_IVH92LNHS" + label="Contact Number Type"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_75XLXJND0" + label="Input" + name="contact_number_type" + placeholder="contact_number_type" + value="contact_number_type"/> + </input_2> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_HS9TIIBNR" + lgColSize="6" + mdColSize="6" + smColSize="6"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_CGZGGM747" + label="Contact Number"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_TKW2PEMOT" + label="Input" + name="contact_number" + placeholder="contact_number" + value="contact_number"/> + </input_3> + </field> + </composite> + <composite_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/composite" + id="composite_1_E89JLVCNW"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_N45OF36GV" + label="Email Addresses"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/composite" + id="field_2IN8NSD3T" + inputType="list" + label="Composite Field" + name="email_addresses"/> + </composite_1> + </field> + </composite_1> + </composite> + </accordionitem3_1> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="TOGGLE_ITEM" + config="\0" + name="\0" + nameCustom="form-identity-toggle-item" + topic="form-identity-toggle-item"/> + </_events_> + </accordion> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="FORM_SUBMIT" + name="\0" + nameCustom="form-identity-submit" + topic="form-identity-submit" + type="listen"/> + </_events_> + </form> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_KCPCUGQZH"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/individual/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/individual/.content.xml new file mode 100644 index 000000000..4923e573e --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/stix/individual/.content.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-09-18T02:13:20.377+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Individual" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/rootcontainer"> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <asideleft + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + classes="aside-left"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + containerType="fullWidth" + decorationTagName="main"/> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/updateincident/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/updateincident/.content.xml index e92234083..f8131b05d 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/updateincident/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/updateincident/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:41.642+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Update Incident" sling:resourceType="typerefinery/components/structure/page" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/vizandform-local/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/vizandform-local/.content.xml new file mode 100644 index 000000000..0a86a71e8 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/vizandform-local/.content.xml @@ -0,0 +1,208 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-07-12T14:19:27.106+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="VizAndForm" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-09-23T16:44:03.837+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer" + classes="h-100"> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + classes="vh-100" + flexEnabled="false" + id="main_W0KKE5JBK"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + classes="vh-100" + containerType="default" + flexEnabled="true" + id="container_NFWPWOPJ1"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="container_5HTHP9K8N" + lgColSize="8" + marginEnabled="false" + mdColSize="8" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + roleOther="\0" + smColSize="8" + title="\0"> + <embed + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + autoResize="true" + borderEnabled="false" + classes="container-fill" + height="100%" + id="embed_BD8EU3LCD" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + scrolling="no" + url="https://typerefinery-ai.github.io/widget-graph-viz/" + variant="iframe"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="EVENT_PROXY" + config="\0" + name="eventproxy" + nameCustom="\0" + topic="embed-viz-event-proxy" + type="emit"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + action="DATA_REQUEST" + config="\{"method":"POST","url":"https://flow.typerefinery.localhost:8101/viz-data/unattached-force-graph"}" + name="readaction" + nameCustom="\0" + topic="embed-viz-event-payload-data-unattached-force-graph" + type="emit"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + action="DATA_PAYLOAD" + config="wss://tms.typerefinery.localhost:8101/$tms" + name="topicpayload" + nameCustom="\0" + topic="embed-viz-event-payload-data-unattached-force-graph" + type="listen"/> + <_x0033_ + jcr:primaryType="nt:unstructured" + action="DATA_REQUEST" + config="\{"method":"POST","url":"https://flow.typerefinery.localhost:8101/viz-data/tree-sighting"}" + name="readaction" + nameCustom="\0" + topic="embed-viz-event-payload-data-tree-sighting" + type="emit"/> + <_x0034_ + jcr:primaryType="nt:unstructured" + action="DATA_PAYLOAD" + config="wss://tms.typerefinery.localhost:8101/$tms" + name="topicpayload" + nameCustom="\0" + topic="embed-viz-event-payload-data-tree-sighting" + type="listen"/> + <_x0035_ + jcr:primaryType="nt:unstructured" + action="DATA_REQUEST" + config="\{"method":"POST","url":"https://flow.typerefinery.localhost:8101/viz-data/tree-task"}" + name="readaction" + nameCustom="\0" + topic="embed-viz-event-payload-data-tree-task" + type="emit"/> + <_x0036_ + jcr:primaryType="nt:unstructured" + action="DATA_REQUEST" + config="\{"method":"POST","url":"https://flow.typerefinery.localhost:8101/viz-data/tree-impact"}" + name="readaction" + nameCustom="\0" + topic="embed-viz-event-payload-data-tree-impact" + type="emit"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + action="DATA_REQUEST" + config="\{"method":"POST","url":"https://flow.typerefinery.localhost:8101/viz-data/tree-event"}" + name="readaction" + nameCustom="\0" + topic="embed-viz-event-payload-data-tree-event" + type="emit"/> + <_x0038_ + jcr:primaryType="nt:unstructured" + action="DATA_REQUEST" + config="\{"method":"POST","url":"https://flow.typerefinery.localhost:8101/viz-data/tree-user"}" + name="readaction" + nameCustom="\0" + topic="embed-viz-event-payload-data-tree-me" + type="emit"/> + <_x0039_ + jcr:primaryType="nt:unstructured" + action="DATA_REQUEST" + config="\{"method":"POST","url":"https://flow.typerefinery.localhost:8101/viz-data/tree-company"}" + name="readaction" + nameCustom="\0" + topic="embed-viz-event-payload-data-tree-company" + type="emit"/> + <_x0031_0 + jcr:primaryType="nt:unstructured" + action="EVENT_PROXY" + config="\{"source":"https://cms.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/stix/identity/update.html","method":"post"}" + name="updateaction" + nameCustom="\0" + topic="viz-open-form-identity" + type="emit"/> + </_events_> + </embed> + </container> + <container_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_IYURYXUW5" + lgColSize="4" + mdColSize="4" + smColSize="4"> + <embed + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + autoResize="false" + borderEnabled="false" + classes="container-fill" + height="100%" + id="embed_SRKOI421P" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + scrolling="yes" + url="https://cms.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/identity1.html" + variant="iframe"> + <_events_ jcr:primaryType="nt:unstructured"> + <_x0030_ + jcr:primaryType="nt:unstructured" + action="EVENT_PROXY" + config="\0" + name="eventproxy" + nameCustom="\0" + topic="embed-viz-event-proxy"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + action="DATA_SOURCE" + config="\0" + name="updateaction" + nameCustom="\0" + topic="embed-viz-event-change-form"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + action="DATA_SOURCE" + config="\0" + name="updateaction" + nameCustom="\0" + topic="viz-open-form-identity"/> + </_events_> + </embed> + </container_1> + </container> + </main> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/vizandform/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/vizandform/.content.xml new file mode 100644 index 000000000..938acf429 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/forms/vizandform/.content.xml @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-07-12T14:19:27.106+10:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="VizAndForm" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-07-15T10:56:02.806+10:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/page" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer" + classes="h-100"> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/main" + classes="vh-100" + flexEnabled="false" + id="main_W0KKE5JBK"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + classes="vh-100" + containerType="default" + flexEnabled="true" + id="container_NFWPWOPJ1"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="container_5HTHP9K8N" + lgColSize="8" + marginEnabled="false" + mdColSize="8" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + roleOther="\0" + smColSize="8" + title="\0"> + <embed + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + autoResize="true" + borderEnabled="false" + classes="container-fill" + height="100%" + id="embed_BD8EU3LCD" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + scrolling="no" + url="https://typerefinery-ai.github.io/widget-graph-viz/" + variant="iframe"/> + </container> + <container_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_IYURYXUW5" + lgColSize="4" + mdColSize="4" + smColSize="4"> + <embed + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/embed" + autoResize="false" + borderEnabled="false" + classes="container-fill" + height="100%" + id="embed_SRKOI421P" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + scrolling="no" + url="https://cms.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/forms/identity1.html" + variant="iframe"/> + </container_1> + </container> + </main> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/.content.xml index 6dfcd5ce8..49439fcd7 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/.content.xml @@ -1,15 +1,54 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Pages" sling:resourceType="typerefinery/components/structure/page" ws:lastModified="{Date}2023-04-07T10:48:57.413+05:30" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/pagewithsidebar"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <aside jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/aside"></aside> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"></header> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" id="container1_MQ28VZFGF" lgColSize="12" marginEnabled="true" marginLeft="two"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" headingLevel="h5" persistColorWhenThemeSwitches="true" textAlignment="center" title="Create New Pages here..."/> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Pages" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-07T10:48:57.413+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + id="aside_KVJUHNHC1"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_MMCEFBC7O"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container1_MQ28VZFGF" + lgColSize="12" + marginEnabled="true" + marginLeft="two"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h5" + id="title_OS4A7FRTH" + persistColorWhenThemeSwitches="true" + textAlignment="center" + title="Create New Pages here..."/> </container1> </rootcontainer> </jcr:content> + <artifacts/> + <createnew/> + <dashboard/> + <enrichments/> + <incidents/> + <info/> + <notes/> + <observables/> + <tags/> + <tasks/> + <options/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/artifacts/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/artifacts/.content.xml index d99ced3fc..bc123b439 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/artifacts/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/artifacts/.content.xml @@ -1,111 +1,151 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:51.057+05:30" - jcr:lastModifiedBy="sling-package-install" - jcr:primaryType="ws:PageContent" - jcr:title="Artifacts" - sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-04-27T12:51:24.851+05:30" - ws:lastModifiedBy="wsadmin" - ws:template="/apps/typerefinery/templates/pagewithsidebar"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <aside jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/aside" /> - <header jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/header" /> - <container1 jcr:primaryType="nt:unstructured" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:51.057+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Artifacts" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-27T12:51:24.851+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + id="aside_ULMGLCIVR"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_WW2G853U7"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="container" + flexEnabled="false" + id="container1_JXL7V09RM" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="two" + persistColorWhenThemeSwitches="false" + title="\0"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_createdon="2024-01-21T20:12:39.235Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d001gr51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d001gr51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/artifacts/_jcr_content/rootcontainer/container1/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/artifacts/_jcr_content/rootcontainer/container1/form/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_d5fd57a90fe9408ca30e07e6868335a0" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_F8XISIXAJ" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readMethod="GET" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/artifacts/*" + title="Form flow" + writeMethod="PUT" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/artifacts/*"> + <container + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" + classes="card shadow-md" + id="container_CRX3BEGOU" + textAlignment="center"> + <title_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h3" + headingSize="\0" + id="title_1_VTYNGZ6FQ"/> + </container> + <table + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/table" borderEnabled="false" - classes="container" - flexEnabled="false" - id="container1_JXL7V09RM" - marginEnabled="false" - paddingEnabled="true" - paddingGeneral="two" + classes="\0" + dataSource="\0" + flowapi_createdon="2024-01-21T20:12:39.235Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d002gr50d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d002gr50d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/artifacts/_jcr_content/rootcontainer/container1/form/table" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/artifacts/_jcr_content/rootcontainer/container1/form/table/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + flowapi_title="Table flow" + flowapi_topic="table_c712cd587344499eba66af31cd3f18c7" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="table_WOFHMJ2EL" + marginEnabled="true" + marginTop="three" + multipleSelectRowEnabled="false" + name="artifactsList" + overRideColumns="{Boolean}true" + paddingEnabled="false" + paginationEnabled="false" persistColorWhenThemeSwitches="false" - title="\0"> - <form jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/form" - borderEnabled="false" - classes="\0" - flexEnabled="false" - flowapi_enable="true" - id="form_F8XISIXAJ" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - readMethod="GET" - readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/artifacts/*" - title="Form flow" - writeMethod="PUT" - writePayloadType="application/json" - writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/artifacts/*"> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - classes="card shadow-md" - id="container_CRX3BEGOU" - textAlignment="center"> - <title_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/title" - headingLevel="h3" - headingSize="\0" - id="title_1_VTYNGZ6FQ" /> - </container> - <table jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/table" - borderEnabled="false" - classes="\0" - dataSource="\0" - flowapi_enable="true" - id="table_WOFHMJ2EL" - marginEnabled="true" - marginTop="three" - multipleSelectRowEnabled="false" - name="artifactsList" - overRideColumns="{Boolean}true" - paddingEnabled="false" - paginationEnabled="false" - persistColorWhenThemeSwitches="false" - resizableEnabled="false" - searchEnabled="false" - showActionButtons="true" - singleSelectEnabled="false" - uniqueIdColumn="\0" - websocketHost="\0" - websocketTopic="\0"> + resizableEnabled="false" + searchEnabled="false" + showActionButtons="true" + singleSelectEnabled="false" + uniqueIdColumn="\0" + websocketHost="\0" + websocketTopic="\0"> <actionButtons jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" - actionButtonModalContentURL="/content/typerefinery-showcase/pages/os-triage/forms/artifact.html" - actionButtonNavigateToPath="\0" - icon="pi pi-pencil" - id="0_LTPLTXMFS" - label="Edit" /> - <_x0031_ jcr:primaryType="nt:unstructured" - actionButtonModalContentURL="\0" - actionButtonNavigateToPath="" - icon="pi pi-info-circle" - id="1_Z7CLYMNHL" - label="URL" /> + <_x0030_ + jcr:primaryType="nt:unstructured" + actionButtonModalContentURL="/content/typerefinery-showcase/pages/os-triage/forms/artifact.html" + actionButtonNavigateToPath="\0" + icon="pi pi-pencil" + id="0_LTPLTXMFS" + label="Edit"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + actionButtonModalContentURL="\0" + actionButtonNavigateToPath="\0" + icon="pi pi-info-circle" + id="1_Z7CLYMNHL" + label="URL"/> </actionButtons> <columns jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" - field="url" - title="URL" - type="LINK" /> + <_x0030_ + jcr:primaryType="nt:unstructured" + field="url" + title="URL" + type="LINK"/> </columns> <columnRules jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" - field="\0" - rule="\0" /> + <_x0030_ + jcr:primaryType="nt:unstructured" + field="\0" + rule="\0"/> </columnRules> </table> </form> </container1> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/createnew/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/createnew/.content.xml index 9622f17f7..34dc9f7bc 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/createnew/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/createnew/.content.xml @@ -1,43 +1,299 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:51.414+05:30" jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Create" sling:resourceType="typerefinery/components/structure/page" ws:lastModified="{Date}2023-04-21T15:02:32.395+05:30" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/pagewithsidebar" description="\0" flowstreamid="\0" hideInNav="true" icon="\0" ogDescription="\0" ogTitle="\0" ogUrl="\0" propertyTitle="\0"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <aside jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/aside"></aside> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"></header> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" flexEnabled="true" id="container_Z0H0UAH8Q" lgColSize="12" paddingEnabled="true" paddingGeneral="two" persistColorWhenThemeSwitches="false" textAlignment="center" title="\0"> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" flexEnabled="true" horizontalAlignment="end" id="container_YLLHQBMN8" marginBottom="one" marginEnabled="true" paddingEnabled="false" persistColorWhenThemeSwitches="false" textAlignment="\0" title="\0"> - <button jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" actionModalTitle="Create New Incident " actionType="openModal" actionUrl="/content/typerefinery-showcase/pages/os-triage/forms/createincident/" buttonStyle="warning" buttonType="action" classes="\0" hideButtonLabel="false" hideFooter="false" id="button_GO1MWAD6G" isOutlinedButton="false" label="Create New Incident " lgColSize="3" persistColorWhenThemeSwitches="true" showIcon="false" showTextualElementOfButton="false"/> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:51.414+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Create" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-21T15:02:32.395+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + flowstreamid="\0" + hideInNav="true" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + id="container_Z0H0UAH8Q" + lgColSize="12" + paddingEnabled="true" + paddingGeneral="two" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="\0"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + horizontalAlignment="end" + id="container_YLLHQBMN8" + marginBottom="one" + marginEnabled="true" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + textAlignment="\0" + title="\0"> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + actionModalTitle="Create New Incident " + actionType="openModal" + actionUrl="/content/typerefinery-showcase/pages/os-triage/forms/createincident/" + buttonStyle="warning" + buttonType="action" + classes="\0" + hideButtonLabel="false" + hideFooter="false" + id="button_GO1MWAD6G" + isOutlinedButton="false" + label="Create New Incident " + lgColSize="3" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false"/> </container> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" id="container1_PVKIXMLNP" textAlignment="center"> - <container_1_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" backgroundColorOfChildren="bg-ivory" backgroundColorOfHeader="bg-primary" flexEnabled="true" id="container_1_1_VVVWAH3YJ" lgColSize="12" lgColSizeForChildren="col-lg-8" lgColSizeForHeader="col-lg-4" marginBottom="one" marginEnabled="true" textAlignment="center" title="Info" titleTagName="h3" variant="sectionwithtitle" verticalAlignment="center"> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" id="text_7YE6YEW4T" text="<p> Name, Description </p>" textAlignment="left"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container1_PVKIXMLNP" + textAlignment="center"> + <container_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + backgroundColorOfChildren="bg-ivory" + backgroundColorOfHeader="bg-primary" + flexEnabled="true" + id="container_1_1_VVVWAH3YJ" + lgColSize="12" + lgColSizeForChildren="col-lg-8" + lgColSizeForHeader="col-lg-4" + marginBottom="one" + marginEnabled="true" + textAlignment="center" + title="Info" + titleTagName="h3" + variant="sectionwithtitle" + verticalAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_7YE6YEW4T" + text="<p> Name, Description </p>" + textAlignment="left"/> </container_1_1> - <container_1_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" backgroundColorOfChildren="bg-ivory" backgroundColorOfHeader="bg-primary" flexEnabled="true" id="container_1_2_T1ZZH8JMP" lgColSize="12" lgColSizeForChildren="col-lg-8" lgColSizeForHeader="col-lg-4" marginBottom="one" marginEnabled="true" textAlignment="center" title="Author" titleTagName="h3" variant="sectionwithtitle" verticalAlignment="center"> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" id="text_GJQEDMAQB" text="<p> Creator: This user or another user </p>" textAlignment="left"/> + <container_1_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + backgroundColorOfChildren="bg-ivory" + backgroundColorOfHeader="bg-primary" + flexEnabled="true" + id="container_1_2_T1ZZH8JMP" + lgColSize="12" + lgColSizeForChildren="col-lg-8" + lgColSizeForHeader="col-lg-4" + marginBottom="one" + marginEnabled="true" + textAlignment="center" + title="Author" + titleTagName="h3" + variant="sectionwithtitle" + verticalAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_GJQEDMAQB" + text="<p> Creator: This user or another user </p>" + textAlignment="left"/> </container_1_2> - <container_1_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" backgroundColorOfChildren="bg-ivory" backgroundColorOfHeader="bg-primary" flexEnabled="true" id="container_1_3_54WGZNU2U" lgColSize="12" lgColSizeForChildren="col-lg-8" lgColSizeForHeader="col-lg-4" marginBottom="one" marginEnabled="true" textAlignment="center" title="Tags" titleTagName="h3" variant="sectionwithtitle" verticalAlignment="center"> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" id="text_FRBH3KGNI" text="<p> MISP </p>" textAlignment="left"/> + <container_1_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + backgroundColorOfChildren="bg-ivory" + backgroundColorOfHeader="bg-primary" + flexEnabled="true" + id="container_1_3_54WGZNU2U" + lgColSize="12" + lgColSizeForChildren="col-lg-8" + lgColSizeForHeader="col-lg-4" + marginBottom="one" + marginEnabled="true" + textAlignment="center" + title="Tags" + titleTagName="h3" + variant="sectionwithtitle" + verticalAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_FRBH3KGNI" + text="<p> MISP </p>" + textAlignment="left"/> </container_1_3> - <container_1_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" backgroundColorOfChildren="bg-ivory" backgroundColorOfHeader="bg-primary" flexEnabled="true" id="container_1_4_ARN0FNOI0" lgColSize="12" lgColSizeForChildren="col-lg-8" lgColSizeForHeader="col-lg-4" marginBottom="one" marginEnabled="true" textAlignment="center" title="Priorities" titleTagName="h3" variant="sectionwithtitle" verticalAlignment="center"> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" id="text_MKYBAIY5Y" text="<p> Severity, Priority </p>" textAlignment="left"/> + <container_1_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + backgroundColorOfChildren="bg-ivory" + backgroundColorOfHeader="bg-primary" + flexEnabled="true" + id="container_1_4_ARN0FNOI0" + lgColSize="12" + lgColSizeForChildren="col-lg-8" + lgColSizeForHeader="col-lg-4" + marginBottom="one" + marginEnabled="true" + textAlignment="center" + title="Priorities" + titleTagName="h3" + variant="sectionwithtitle" + verticalAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_MKYBAIY5Y" + text="<p> Severity, Priority </p>" + textAlignment="left"/> </container_1_4> - <container_1_5 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" backgroundColorOfChildren="bg-ivory" backgroundColorOfHeader="bg-primary" flexEnabled="true" id="container_1_5_NA8RAYRAH" lgColSize="12" lgColSizeForChildren="col-lg-8" lgColSizeForHeader="col-lg-4" marginBottom="one" marginEnabled="true" textAlignment="center" title="Sharing" titleTagName="h3" variant="sectionwithtitle" verticalAlignment="center"> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" id="text_7AGUGCIQ8" text="<p> TLP, PAP </p>" textAlignment="left"/> + <container_1_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + backgroundColorOfChildren="bg-ivory" + backgroundColorOfHeader="bg-primary" + flexEnabled="true" + id="container_1_5_NA8RAYRAH" + lgColSize="12" + lgColSizeForChildren="col-lg-8" + lgColSizeForHeader="col-lg-4" + marginBottom="one" + marginEnabled="true" + textAlignment="center" + title="Sharing" + titleTagName="h3" + variant="sectionwithtitle" + verticalAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_7AGUGCIQ8" + text="<p> TLP, PAP </p>" + textAlignment="left"/> </container_1_5> - <container_1_6 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" backgroundColorOfChildren="bg-ivory" backgroundColorOfHeader="bg-primary" flexEnabled="true" id="container_1_6_WOLOC0TGP" lgColSize="12" lgColSizeForChildren="col-lg-8" lgColSizeForHeader="col-lg-4" marginBottom="one" marginEnabled="true" textAlignment="center" title="Users" titleTagName="h3" variant="sectionwithtitle" verticalAlignment="center"> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" id="text_FH9ZKO3Z2" text="<p> Author </p>" textAlignment="left"/> + <container_1_6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + backgroundColorOfChildren="bg-ivory" + backgroundColorOfHeader="bg-primary" + flexEnabled="true" + id="container_1_6_WOLOC0TGP" + lgColSize="12" + lgColSizeForChildren="col-lg-8" + lgColSizeForHeader="col-lg-4" + marginBottom="one" + marginEnabled="true" + textAlignment="center" + title="Users" + titleTagName="h3" + variant="sectionwithtitle" + verticalAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_FH9ZKO3Z2" + text="<p> Author </p>" + textAlignment="left"/> </container_1_6> - <container_1_7 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" backgroundColorOfChildren="bg-ivory" backgroundColorOfHeader="bg-primary" flexEnabled="true" id="container_1_7_8XBQROPBI" lgColSize="12" lgColSizeForChildren="col-lg-8" lgColSizeForHeader="col-lg-4" marginBottom="one" marginEnabled="true" textAlignment="center" title="Incident Template" titleTagName="h3" variant="sectionwithtitle" verticalAlignment="center"> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" id="text_YIZQJL5QT" text="<p> NIST </p>" textAlignment="left"/> + <container_1_7 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + backgroundColorOfChildren="bg-ivory" + backgroundColorOfHeader="bg-primary" + flexEnabled="true" + id="container_1_7_8XBQROPBI" + lgColSize="12" + lgColSizeForChildren="col-lg-8" + lgColSizeForHeader="col-lg-4" + marginBottom="one" + marginEnabled="true" + textAlignment="center" + title="Incident Template" + titleTagName="h3" + variant="sectionwithtitle" + verticalAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_YIZQJL5QT" + text="<p> NIST </p>" + textAlignment="left"/> </container_1_7> - <container_1_8 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" backgroundColorOfChildren="bg-ivory" backgroundColorOfHeader="bg-primary" flexEnabled="true" id="container_1_8_L1UYAZFSO" lgColSize="12" lgColSizeForChildren="col-lg-8" lgColSizeForHeader="col-lg-4" marginBottom="one" marginEnabled="true" textAlignment="center" title="Dates" titleTagName="h3" variant="sectionwithtitle" verticalAlignment="center"> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" id="text_QDNM7ZGZ8" text="<p> Occurred: when? Created: now </p>" textAlignment="left"/> + <container_1_8 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + backgroundColorOfChildren="bg-ivory" + backgroundColorOfHeader="bg-primary" + flexEnabled="true" + id="container_1_8_L1UYAZFSO" + lgColSize="12" + lgColSizeForChildren="col-lg-8" + lgColSizeForHeader="col-lg-4" + marginBottom="one" + marginEnabled="true" + textAlignment="center" + title="Dates" + titleTagName="h3" + variant="sectionwithtitle" + verticalAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_QDNM7ZGZ8" + text="<p> Occurred: when? Created: now </p>" + textAlignment="left"/> </container_1_8> - <container_1_9 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" backgroundColorOfChildren="bg-ivory" backgroundColorOfHeader="bg-primary" flexEnabled="true" id="container_1_9_OQMOKGFHX" lgColSize="12" lgColSizeForChildren="col-lg-8" lgColSizeForHeader="col-lg-4" marginBottom="one" marginEnabled="true" textAlignment="center" title="Source" titleTagName="h3" variant="sectionwithtitle" verticalAlignment="center"> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" id="text_4ZHTKPYB7" text="<p> Customer Incident, Alert, … </p>" textAlignment="left"/> + <container_1_9 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + backgroundColorOfChildren="bg-ivory" + backgroundColorOfHeader="bg-primary" + flexEnabled="true" + id="container_1_9_OQMOKGFHX" + lgColSize="12" + lgColSizeForChildren="col-lg-8" + lgColSizeForHeader="col-lg-4" + marginBottom="one" + marginEnabled="true" + textAlignment="center" + title="Source" + titleTagName="h3" + variant="sectionwithtitle" + verticalAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_4ZHTKPYB7" + text="<p> Customer Incident, Alert, … </p>" + textAlignment="left"/> </container_1_9> </container1> </container> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/dashboard/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/dashboard/.content.xml index b2fbae038..0bf80b620 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/dashboard/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/dashboard/.content.xml @@ -1,238 +1,357 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:51.762+05:30" - jcr:lastModifiedBy="sling-package-install" - jcr:primaryType="ws:PageContent" - jcr:title="Dashboard" - sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-04-17T11:33:53.926+05:30" - ws:lastModifiedBy="wsadmin" - ws:template="/apps/typerefinery/templates/pagewithsidebar"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <aside jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/aside" /> - <header jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/header" /> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - id="container_CXULGGFOA" - paddingEnabled="true" - paddingGeneral="four"> - <flowcontainer_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/flow/flowcontainer" - borderEnabled="false" - classes="\0" - flexEnabled="false" - flowapi_enable="true" - id="flowcontainer_1_WTRRHZBBQ" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - title="\0"> - <container1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - gap="0" - horizontalAlignment="between" - id="container1_XBYLS6NC7" - lgColSize="12" - marginBottom="five" - marginEnabled="true" - marginTop="four" - mdColSize="12" - smColSize="12"> - <container1_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="\0" - flexEnabled="false" - id="container1_1_ZPJ3SEB52" - lgColSize="3" - marginEnabled="false" - mdColSize="6" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - smColSize="12" - title="\0"> - <ticker jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/ticker" - borderEnabled="false" - classes="\0" - dataSource="\0" - flowapi_enable="true" - id="ticker_X6LJXXAYB" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - title="\0" - websocketHost="\0" - websocketTopic="\0" /> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:51.762+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Dashboard" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-17T11:33:53.926+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + id="aside_0VY4ATN1O"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_ZGOND5CVC"/> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_CXULGGFOA" + paddingEnabled="true" + paddingGeneral="four"> + <flowcontainer_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/flow/flowcontainer" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_enable="true" + id="flowcontainer_1_WTRRHZBBQ" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="\0"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + gap="0" + horizontalAlignment="between" + id="container1_XBYLS6NC7" + lgColSize="12" + marginBottom="five" + marginEnabled="true" + marginTop="four" + mdColSize="12" + smColSize="12"> + <container1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="container1_1_ZPJ3SEB52" + lgColSize="3" + marginEnabled="false" + mdColSize="6" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="12" + title="\0"> + <ticker + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="2024-01-21T20:13:09.182Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d003gr51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d003gr51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container1/container1_1/ticker" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container1/container1_1/ticker/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + flowapi_title="Ticker flow" + flowapi_topic="ticker_4bfbcd4ce75147d3a51ad2727824a256" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="ticker_X6LJXXAYB" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="\0" + websocketHost="\0" + websocketTopic="\0"/> </container1_1> - <container1_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="\0" - flexEnabled="false" - id="container1_2_GLKJ1BAES" - lgColSize="3" - marginEnabled="false" - mdColSize="6" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - smColSize="12" - title="\0"> - <ticker jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/ticker" - borderEnabled="false" - classes="\0" - dataSource="\0" - flowapi_enable="true" - id="ticker_YBPMYGTNS" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - title="\0" - websocketHost="\0" - websocketTopic="\0" /> + <container1_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="container1_2_GLKJ1BAES" + lgColSize="3" + marginEnabled="false" + mdColSize="6" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="12" + title="\0"> + <ticker + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="2024-01-21T20:13:10.337Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d004gr50d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d004gr50d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container1/container1_2/ticker" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container1/container1_2/ticker/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + flowapi_title="Ticker flow" + flowapi_topic="ticker_bdae4837d76747c5a8c97d1005375a66" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="ticker_YBPMYGTNS" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="\0" + websocketHost="\0" + websocketTopic="\0"/> </container1_2> - <container1_3 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="\0" - flexEnabled="false" - id="container1_3_FFBFSBWDL" - lgColSize="3" - marginEnabled="false" - mdColSize="6" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - smColSize="12" - title="\0"> - <ticker jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/ticker" - borderEnabled="false" - classes="\0" - dataSource="\0" - flowapi_enable="true" - id="ticker_UCX4PAWWD" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - title="\0" - websocketHost="\0" - websocketTopic="\0" /> + <container1_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="container1_3_FFBFSBWDL" + lgColSize="3" + marginEnabled="false" + mdColSize="6" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="12" + title="\0"> + <ticker + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="2024-01-21T20:13:11.480Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d005gr51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d005gr51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container1/container1_3/ticker" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container1/container1_3/ticker/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + flowapi_title="Ticker flow" + flowapi_topic="ticker_5fb968a38e9a47a49bfb30f482396234" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="ticker_UCX4PAWWD" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="\0" + websocketHost="\0" + websocketTopic="\0"/> </container1_3> </container1> - <container2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - containerType="fullWidth" - flexEnabled="true" - gap="0" - horizontalAlignment="between" - id="container2_0XLASPK6U" - lgColSize="12" - mdColSize="12" - smColSize="12"> - <chart jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/chart" - borderEnabled="false" - classes="\0" - dataSource="\0" - flowapi_enable="true" - id="chart_XGDLYH1QM" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - websocketHost="\0" - websocketTopic="\0" /> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + containerType="fullWidth" + flexEnabled="true" + gap="0" + horizontalAlignment="between" + id="container2_0XLASPK6U" + lgColSize="12" + mdColSize="12" + smColSize="12"> + <chart + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/chart" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="2024-01-21T20:13:12.653Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d006gr50d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d006gr50d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container2/chart" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container2/chart/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/chart/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/chart/templates/chart.json" + flowapi_title="Chart flow" + flowapi_topic="chart_94754e8db33c4ff2b9f3e840ccebf965" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="chart_XGDLYH1QM" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + websocketHost="\0" + websocketTopic="\0"/> </container2> - <container3 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - gap="0" - horizontalAlignment="between" - id="container3_KY3P7RMPK" - lgColSize="12" - marginEnabled="true" - marginTop="five" - mdColSize="12" - smColSize="12"> - <container3_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - id="container3_1_4WMZO4CVI" - lgColSize="6" - mdColSize="12" - smColSize="12"> - <chart jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/chart" - borderEnabled="false" - classes="\0" - dataSource="\0" - flowapi_enable="true" - id="chart_WDTCAHTVM" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - variant="barChart" - websocketHost="\0" - websocketTopic="\0" /> + <container3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + gap="0" + horizontalAlignment="between" + id="container3_KY3P7RMPK" + lgColSize="12" + marginEnabled="true" + marginTop="five" + mdColSize="12" + smColSize="12"> + <container3_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container3_1_4WMZO4CVI" + lgColSize="6" + mdColSize="12" + smColSize="12"> + <chart + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/chart" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="2024-01-21T20:13:13.805Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d007gr51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d007gr51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container3/container3_1/chart" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container3/container3_1/chart/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/chart/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/chart/templates/chart.json" + flowapi_title="Chart flow" + flowapi_topic="chart_2f90a683f46142deb6a4925459c0d7e1" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="chart_WDTCAHTVM" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + variant="barChart" + websocketHost="\0" + websocketTopic="\0"/> </container3_1> - <container3_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - id="container3_2_HSFAJ0UFV" - lgColSize="6" - mdColSize="12" - smColSize="12"> - <chart jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/chart" - borderEnabled="false" - classes="\0" - dataSource="\0" - flowapi_enable="true" - id="chart_SXUTC05AZ" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - variant="pieChart" - websocketHost="\0" - websocketTopic="\0" /> + <container3_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container3_2_HSFAJ0UFV" + lgColSize="6" + mdColSize="12" + smColSize="12"> + <chart + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/chart" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="2024-01-21T20:13:17.269Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d008gr50d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d008gr50d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container3/container3_2/chart" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container3/container3_2/chart/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/chart/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/chart/templates/chart.json" + flowapi_title="Chart flow" + flowapi_topic="chart_eef6cb3ddb284cb8bb21277ae185dbcb" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="chart_SXUTC05AZ" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + variant="pieChart" + websocketHost="\0" + websocketTopic="\0"/> </container3_2> </container3> - <container4 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - gap="0" - horizontalAlignment="between" - id="container4_KU5EXJWIH" - lgColSize="12" - mdColSize="12" - smColSize="12"> - <map jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/map" - borderEnabled="false" - classes="\0" - copyRightUrl="\0" - dataSource="\0" - flowapi_enable="true" - id="map_WN51PHKLD" - layerZoom="\0" - mapLat="\0" - mapLng="\0" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - tileTemplate="\0" - websocketHost="\0" - websocketTopic="\0" - zoomLevel="\0" /> + <container4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + gap="0" + horizontalAlignment="between" + id="container4_KU5EXJWIH" + lgColSize="12" + mdColSize="12" + smColSize="12"> + <map + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/map" + borderEnabled="false" + classes="\0" + copyRightUrl="\0" + dataSource="\0" + flowapi_createdon="2024-01-21T20:13:18.477Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d011gr51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d011gr51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container4/map" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/dashboard/_jcr_content/rootcontainer/container/flowcontainer_1/container4/map/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/map/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/map/templates/map.json" + flowapi_title="Map flow" + flowapi_topic="map_0a0592bd392548c8abc78101abb8f635" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="map_WN51PHKLD" + layerZoom="\0" + mapLat="\0" + mapLng="\0" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + tileTemplate="\0" + websocketHost="\0" + websocketTopic="\0" + zoomLevel="\0"/> </container4> </flowcontainer_1> </container> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/enrichments/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/enrichments/.content.xml index 3b3983ab6..ac32a8ccb 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/enrichments/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/enrichments/.content.xml @@ -1,23 +1,116 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:52.066+05:30" jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Enrichments" sling:resourceType="typerefinery/components/structure/page" ws:lastModified="{Date}2023-04-21T15:03:09.600+05:30" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/pagewithsidebar" description="\0" flowstreamid="\0" hideInNav="true" icon="\0" ogDescription="\0" ogTitle="\0" ogUrl="\0" propertyTitle="\0"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <aside jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/aside"></aside> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"></header> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" flexEnabled="true" id="container1_L3BQ2XAYO" marginEnabled="false" paddingEnabled="true" paddingGeneral="four" persistColorWhenThemeSwitches="false" title="\0"> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" id="container_OL42H25MP" lgColSize="12" textAlignment="center"> - <container_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" flexEnabled="true" id="container_2_MEBG1GTBN" lgColSize="12" marginEnabled="false" marginLeft="two" paddingEnabled="false" persistColorWhenThemeSwitches="false" textAlignment="center" title="\0"> - <container_2_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" horizontalAlignment="evenly" id="container_2_1_14Z32ANLT" marginBottom="two" marginEnabled="true" textAlignment="center"> - <button_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" buttonStyle="warning" buttonType="submit" id="button_1_BQG95XDWH" label="Delete View" lgColSize="3" persistColorWhenThemeSwitches="{Boolean}true"/> - <button_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" buttonStyle="warning" buttonType="submit" id="button_2_SUF9MI6UD" label="Save View" lgColSize="3" persistColorWhenThemeSwitches="{Boolean}true"/> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:52.066+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Enrichments" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-21T15:03:09.600+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + flowstreamid="\0" + hideInNav="true" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + id="container1_L3BQ2XAYO" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="four" + persistColorWhenThemeSwitches="false" + title="\0"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_OL42H25MP" + lgColSize="12" + textAlignment="center"> + <container_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + id="container_2_MEBG1GTBN" + lgColSize="12" + marginEnabled="false" + marginLeft="two" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="\0"> + <container_2_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + horizontalAlignment="evenly" + id="container_2_1_14Z32ANLT" + marginBottom="two" + marginEnabled="true" + textAlignment="center"> + <button_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="warning" + buttonType="submit" + id="button_1_BQG95XDWH" + label="Delete View" + lgColSize="3" + persistColorWhenThemeSwitches="{Boolean}true"/> + <button_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonStyle="warning" + buttonType="submit" + id="button_2_SUF9MI6UD" + label="Save View" + lgColSize="3" + persistColorWhenThemeSwitches="{Boolean}true"/> </container_2_1> - <container_2_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" id="container_2_2_K1BFOOPEQ" textAlignment="center"> - <table jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/table" dataSource="/apps/typerefinery/components/widgets/table/mock/datasource1.json" flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" id="table_PB7TIZY2S" overRideColumns="{Boolean}true" showActionButtons="true"> + <container_2_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_2_2_K1BFOOPEQ" + textAlignment="center"> + <table + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/table" + dataSource="/apps/typerefinery/components/widgets/table/mock/datasource1.json" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + id="table_PB7TIZY2S" + overRideColumns="{Boolean}true" + showActionButtons="true"> <actionButtons jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" actionButtonModalContentURL="/content/typerefinery-showcase/pages/components/forms.html" actionButtonNavigateToPath="\0" icon="pi pi-pencil" id="0_VAB8LC90C" label="Edit"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + actionButtonModalContentURL="/content/typerefinery-showcase/pages/components/forms.html" + actionButtonNavigateToPath="\0" + icon="pi pi-pencil" + id="0_VAB8LC90C" + label="Edit"/> </actionButtons> </table> </container_2_2> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/.content.xml index 48064a234..db7e45bea 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/.content.xml @@ -1,133 +1,178 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:51.224+05:30" - jcr:lastModifiedBy="sling-package-install" - jcr:primaryType="ws:PageContent" - jcr:title="Incidents" - sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-04-27T12:32:27.878+05:30" - ws:lastModifiedBy="wsadmin" - ws:template="/apps/typerefinery/templates/pagewithsidebar"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <aside jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/aside" /> - <header jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/header" /> - <container1 jcr:primaryType="nt:unstructured" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:51.224+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Incidents" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-27T12:32:27.878+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + id="aside_E0I8QAYYW"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_3SQ2WR2E3"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container1_8DDBRAUE3" + lgColSize="12" + paddingEnabled="true" + paddingGeneral="two"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_createdon="2024-01-21T20:13:18.477Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d009gr51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d009gr51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/incidents/_jcr_content/rootcontainer/container1/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/incidents/_jcr_content/rootcontainer/container1/form/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_998943c71b624a0f93853b1c6024c3c1" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_P0EIJOUBV" + marginEnabled="false" + mdColSize="12" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readMethod="GET" + readUrl="/content/typerefinery-showcase/pages/os-triage/pages/incidents/*" + title="Form flow" + writeMethod="PUT" + writePayloadType="application/json" + writeUrl="/content/typerefinery-showcase/pages/os-triage/pages/incidents/*"> + <container + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" - id="container1_8DDBRAUE3" + id="container_ZBSSWZM4F" lgColSize="12" - paddingEnabled="true" - paddingGeneral="two"> - <form jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/form" - borderEnabled="false" - classes="\0" - flexEnabled="false" - flowapi_enable="true" - id="form_P0EIJOUBV" - marginEnabled="false" - mdColSize="12" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - readMethod="GET" - readUrl="/content/typerefinery-showcase/pages/os-triage/pages/incidents/*" - title="Form flow" - writeMethod="PUT" - writePayloadType="application/json" - writeUrl="/content/typerefinery-showcase/pages/os-triage/pages/incidents/*"> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_ZBSSWZM4F" - lgColSize="12" - textAlignment="center"> - <container_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_1_8J7GJCDND" - lgColSize="3" - textAlignment="center"> - <container_1_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_1_1_M4MFOVLTY" - marginBottom="three" - marginEnabled="true" - textAlignment="center"> - <button_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/button" - buttonType="submit" - id="button_1_ECWETHPFL" - label="Search" - persistColorWhenThemeSwitches="{Boolean}true" /> + textAlignment="center"> + <container_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_1_8J7GJCDND" + lgColSize="3" + textAlignment="center"> + <container_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_1_1_M4MFOVLTY" + marginBottom="three" + marginEnabled="true" + textAlignment="center"> + <button_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="submit" + id="button_1_ECWETHPFL" + label="Search" + persistColorWhenThemeSwitches="{Boolean}true"/> </container_1_1> </container_1> - <container_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - horizontalAlignment="around" - id="container_2_JXKVXNJHH" - lgColSize="8" - marginEnabled="true" - marginLeft="four" - textAlignment="center"> - <input_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/input" - id="input_1_BMLZULCYH"> - <label jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/label" - hideLabel="true" - label="Incident " /> - <field jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/input" - id="field_KAMQYXGOC" - inputType="text" - name="case" - placeholder="Incident 1" /> + <container_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + horizontalAlignment="around" + id="container_2_JXKVXNJHH" + lgColSize="8" + marginEnabled="true" + marginLeft="four" + textAlignment="center"> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_BMLZULCYH"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_H05XF0DYG" + label="Incident "/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_KAMQYXGOC" + inputType="text" + name="case" + placeholder="Incident 1"/> </input_1> </container_2> </container> - <container2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - containerType="fullWidth" - flexEnabled="true" - horizontalAlignment="around" - id="container2_KCY7RLENG"> - <table jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/table" - borderEnabled="false" - classes="\0" - dataSource="/apps/typerefinery/components/widgets/table/mock/datasource1.json" - flowapi_enable="true" - id="table_LUOATU17P" - marginEnabled="false" - multipleSelectRowEnabled="false" - name="caseList" - overRideColumns="{Boolean}true" - paddingEnabled="false" - paginationEnabled="false" - persistColorWhenThemeSwitches="false" - resizableEnabled="false" - searchEnabled="false" - showActionButtons="true" - singleSelectEnabled="false" - uniqueIdColumn="\0" - websocketHost="\0" - websocketTopic="\0"> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + containerType="fullWidth" + flexEnabled="true" + horizontalAlignment="around" + id="container2_KCY7RLENG"> + <table + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/table" + borderEnabled="false" + classes="\0" + dataSource="/apps/typerefinery/components/widgets/table/mock/datasource1.json" + flowapi_createdon="2024-01-21T20:13:18.476Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d010gr50d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d010gr50d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/incidents/_jcr_content/rootcontainer/container1/form/container2/table" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/incidents/_jcr_content/rootcontainer/container1/form/container2/table/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + flowapi_title="Table flow" + flowapi_topic="table_189f8a2dcd4a4182a39b32bf391e434c" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="table_LUOATU17P" + marginEnabled="false" + multipleSelectRowEnabled="false" + name="caseList" + overRideColumns="{Boolean}true" + paddingEnabled="false" + paginationEnabled="false" + persistColorWhenThemeSwitches="false" + resizableEnabled="false" + searchEnabled="false" + showActionButtons="true" + singleSelectEnabled="false" + uniqueIdColumn="\0" + websocketHost="\0" + websocketTopic="\0"> <actionButtons jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" - actionButtonModalContentURL="/content/typerefinery-showcase/pages/os-triage/forms/createincident.html" - actionButtonNavigateToPath="\0" - icon="pi pi-pencil" - id="0_YJRQJMMWP" - label="Edit" /> + <_x0030_ + jcr:primaryType="nt:unstructured" + actionButtonModalContentURL="/content/typerefinery-showcase/pages/os-triage/forms/createincident.html" + actionButtonNavigateToPath="\0" + icon="pi pi-pencil" + id="0_YJRQJMMWP" + label="Edit"/> </actionButtons> </table> </container2> @@ -135,4 +180,5 @@ </container1> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file + <incident/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/.content.xml index 175f4e31b..71ed52738 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/.content.xml @@ -1,185 +1,223 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:53.868+05:30" - jcr:lastModifiedBy="sling-package-install" - jcr:primaryType="ws:PageContent" - jcr:title="Incident" - sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-04-26T18:40:30.323+05:30" - ws:lastModifiedBy="wsadmin" - ws:template="/apps/typerefinery/templates/pagewithsidebar"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <aside jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/aside" /> - <header jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/header" /> - <container1 jcr:primaryType="nt:unstructured" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:53.868+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Incident" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-26T18:40:30.323+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + id="aside_J08TC7DZK"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_ODGBOB7FU"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + id="container1_RHMPJRLHA" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="four" + persistColorWhenThemeSwitches="false" + title="\0"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_createdon="2024-01-21T20:20:22.841Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3k001gr51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3k001gr51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/_jcr_content/rootcontainer/container1/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/_jcr_content/rootcontainer/container1/form/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_dafc1e21096c41e185cd3c8f331a0248" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_H2RWHNSIA" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readMethod="GET" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/*" + title="Form flow" + writeMethod="PUT" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/*"> + <container + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="\0" flexEnabled="true" - id="container1_RHMPJRLHA" - marginEnabled="false" - paddingEnabled="true" - paddingGeneral="four" - persistColorWhenThemeSwitches="false" - title="\0"> - <form jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/form" - borderEnabled="false" - classes="\0" - flexEnabled="false" - flowapi_enable="true" - id="form_H2RWHNSIA" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - readMethod="GET" - readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/*" - title="Form flow" - writeMethod="PUT" - writePayloadType="application/json" - writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/*"> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_SN0ZAZDTI" - lgColSize="12" - textAlignment="center"> - <container_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="card shadow-md" - flexEnabled="true" - id="container_1_RJK58YFXJ" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="\0"> - <title jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/title" - headingLevel="h5" - id="title_HKLGDVMPR" - marginBottom="two" - marginEnabled="true" - marginTop="three" - persistColorWhenThemeSwitches="true" - textAlignment="center" - title="Name: Incident 1" /> + id="container_SN0ZAZDTI" + lgColSize="12" + textAlignment="center"> + <container_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="card shadow-md" + flexEnabled="true" + id="container_1_RJK58YFXJ" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="\0"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h5" + id="title_HKLGDVMPR" + marginBottom="two" + marginEnabled="true" + marginTop="three" + persistColorWhenThemeSwitches="true" + textAlignment="center" + title="Name: Incident 1"/> </container_1> - <container_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_2_ZFDSX21RH" - lgColSize="12" - marginEnabled="true" - marginTop="three" - textAlignment="center"> - <tabs jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/tabs" - borderEnabled="false" - flowapi_sampledata="/apps/typerefinery/components/widgets/tab/templates/flowsample.json" - flowapi_template="/apps/typerefinery/components/widgets/tab/templates/tab.json" - id="tab_3G01CBBT8" - marginEnabled="false" - openNodeInNewTab="false" - openNodeInTabContainer="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - placeholderContent="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident.html"> + <container_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_2_ZFDSX21RH" + lgColSize="12" + marginEnabled="true" + marginTop="three" + textAlignment="center"> + <tabs + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/tabs" + borderEnabled="false" + flowapi_sampledata="/apps/typerefinery/components/widgets/tab/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/tab/templates/tab.json" + id="tab_3G01CBBT8" + marginEnabled="false" + openNodeInNewTab="false" + openNodeInTabContainer="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholderContent="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident.html"> <tabsList jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/info" - title="Information" - useQueryParamsFromParent="false" /> - <_x0031_ jcr:primaryType="nt:unstructured" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tags" - title="Tags" - useQueryParamsFromParent="false" /> - <_x0032_ jcr:primaryType="nt:unstructured" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tasks" - title="Tasks" - useQueryParamsFromParent="false" /> - <_x0037_ jcr:primaryType="nt:unstructured" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/notes" - title="Notes" - useQueryParamsFromParent="false" /> - <_x0038_ jcr:primaryType="nt:unstructured" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/observables" - title="Obsevables" - useQueryParamsFromParent="false" /> - <_x0039_ jcr:primaryType="nt:unstructured" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/enrichment" - title="Enrichments" - useQueryParamsFromParent="false" /> - <_x0040_ jcr:primaryType="nt:unstructured" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/artifacts" - title="Artifacts" - useQueryParamsFromParent="false" /> + <_x0030_ + jcr:primaryType="nt:unstructured" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/info" + title="Information" + useQueryParamsFromParent="false"/> + <_x0038_ + jcr:primaryType="nt:unstructured" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/observables" + title="Obsevables" + useQueryParamsFromParent="false"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tags" + title="Tags" + useQueryParamsFromParent="false"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tasks" + title="Tasks" + useQueryParamsFromParent="false"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/notes" + title="Notes" + useQueryParamsFromParent="false"/> + <_x0039_ + jcr:primaryType="nt:unstructured" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/enrichment" + title="Enrichments" + useQueryParamsFromParent="false"/> + <_x0040_ + jcr:primaryType="nt:unstructured" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/artifacts" + title="Artifacts" + useQueryParamsFromParent="false"/> </tabsList> <tabs jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" - icon="\0" - isCloseable="false" - passParentQueryString="false" - render="html" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/info/jcr:content/rootcontainer/container1/" - title="Information" - url="\0" /> - <_x0031_ jcr:primaryType="nt:unstructured" - icon="\0" - isCloseable="false" - passParentQueryString="false" - render="html" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tags/jcr:content/rootcontainer" - title="Tags" - url="\0" /> - <_x0032_ jcr:primaryType="nt:unstructured" - icon="\0" - isCloseable="false" - passParentQueryString="false" - render="html" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tasks/jcr:content/rootcontainer" - title="Tasks" - url="\0" /> - <_x0037_ jcr:primaryType="nt:unstructured" - icon="\0" - isCloseable="false" - passParentQueryString="false" - render="html" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/notes/jcr:content/rootcontainer" - title="Notes" - url="\0" /> - <_x0038 jcr:primaryType="nt:unstructured" - icon="\0" - isCloseable="false" - passParentQueryString="false" - render="html" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/observables/jcr:content/rootcontainer" - title="Observables" - url="\0" /> - <_x0039_ jcr:primaryType="nt:unstructured" - icon="\0" - isCloseable="false" - passParentQueryString="false" - render="html" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/enrichment/jcr:content/rootcontainer" - title="Enrichment" - url="\0" /> - <_x0040_ jcr:primaryType="nt:unstructured" - icon="\0" - isCloseable="false" - passParentQueryString="false" - render="html" - resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/artifacts/jcr:content/rootcontainer" - title="Artifacts" - url="\0" /> + <_x0030_ + jcr:primaryType="nt:unstructured" + icon="\0" + isCloseable="false" + passParentQueryString="false" + render="html" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/info/jcr:content/rootcontainer/container1/" + title="Information" + url="\0"/> + <_x005f_x0038 + jcr:primaryType="nt:unstructured" + icon="\0" + isCloseable="false" + passParentQueryString="false" + render="html" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/observables/jcr:content/rootcontainer" + title="Observables" + url="\0"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + icon="\0" + isCloseable="false" + passParentQueryString="false" + render="html" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tags/jcr:content/rootcontainer" + title="Tags" + url="\0"/> + <_x0032_ + jcr:primaryType="nt:unstructured" + icon="\0" + isCloseable="false" + passParentQueryString="false" + render="html" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tasks/jcr:content/rootcontainer" + title="Tasks" + url="\0"/> + <_x0037_ + jcr:primaryType="nt:unstructured" + icon="\0" + isCloseable="false" + passParentQueryString="false" + render="html" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/notes/jcr:content/rootcontainer" + title="Notes" + url="\0"/> + <_x0039_ + jcr:primaryType="nt:unstructured" + icon="\0" + isCloseable="false" + passParentQueryString="false" + render="html" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/enrichment/jcr:content/rootcontainer" + title="Enrichment" + url="\0"/> + <_x0040_ + jcr:primaryType="nt:unstructured" + icon="\0" + isCloseable="false" + passParentQueryString="false" + render="html" + resourcepath="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/artifacts/jcr:content/rootcontainer" + title="Artifacts" + url="\0"/> </tabs> </tabs> </container_2> @@ -188,4 +226,14 @@ </container1> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file + <artifacts/> + <domainname/> + <enrichment/> + <enrichments/> + <info/> + <notes/> + <observables/> + <tags/> + <tasks/> + <totalvirus/> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/artifacts/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/artifacts/.content.xml index 744321625..1755c402d 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/artifacts/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/artifacts/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:42.118+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Artifact " sling:resourceType="typerefinery/components/structure/page" @@ -38,7 +40,21 @@ borderEnabled="false" classes="\0" dataSource="/apps/typerefinery/components/widgets/table/mock/datasource1.json" + flowapi_createdon="2024-01-21T20:20:28.567Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3k006gr50d&components=" flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3k006gr50d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/artifacts/_jcr_content/rootcontainer/container1/table" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/artifacts/_jcr_content/rootcontainer/container1/table/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + flowapi_title="Table flow" + flowapi_topic="table_e0ed5bf3f99140448a23ded23b5107f8" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" id="table_FT2IXISAL" marginEnabled="false" multipleSelectRowEnabled="false" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/domainname/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/domainname/.content.xml index fc8cf285e..e9651f94b 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/domainname/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/domainname/.content.xml @@ -45,6 +45,7 @@ jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="true" + id="label_YNVXSIKX7" label="\0" title="Label"/> <field @@ -52,7 +53,7 @@ sling:resourceType="typerefinery/components/forms/fields/input" borderEnabled="false" classes="\0" - id="\0" + id="field_32EKLEISU" marginEnabled="false" name="\0" paddingEnabled="false" @@ -70,11 +71,13 @@ jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="true" + id="label_WW6LLQSO9" label="\0" title="Label"/> <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/fileupload" + id="field_3AHRIMZSK" title="Field"/> </fileupload> </container> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/enrichment/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/enrichment/.content.xml index fd242e1f9..ddd381a72 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/enrichment/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/enrichment/.content.xml @@ -52,11 +52,13 @@ jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="true" + id="label_ASOSS1WM0" label="\0" title="Label"/> <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/fileupload" + id="field_A41S3LQFZ" title="Field"/> </fileupload> <text diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/enrichments/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/enrichments/.content.xml index 8b8b0f42f..7cf310dc7 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/enrichments/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/enrichments/.content.xml @@ -2,6 +2,8 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:42.233+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Enrichment" sling:resourceType="typerefinery/components/structure/page" diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/info/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/info/.content.xml index 6f1550211..be658a392 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/info/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/info/.content.xml @@ -1,223 +1,256 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" - jcr:lastModifiedBy="sling-package-install" - jcr:primaryType="ws:PageContent" - jcr:title="Info" - sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-04-28T15:49:19.527+05:30" - ws:lastModifiedBy="wsadmin" - ws:template="/apps/typerefinery/templates/pagewithsidebar" - description="\0" - flowstreamid="\0" - hideInNav="true" - icon="\0" - ogDescription="\0" - ogTitle="\0" - ogUrl="\0" - propertyTitle="\0"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Info" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-28T15:49:19.527+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + flowstreamid="\0" + hideInNav="true" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + id="container1_MQ28VZFGF" + lgColSize="12" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="four" + persistColorWhenThemeSwitches="false" + title="\0"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_createdon="2024-02-07T22:55:22.820Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff19b3v001tj51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f19b3v001tj51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/info/_jcr_content/rootcontainer/container1/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/info/_jcr_content/rootcontainer/container1/form/{{id}}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_008d3c895ad04e2592d87281d12fb8ac" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_F9A4HOCWY" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readMethod="GET" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/info/{{caseid}}" + title="Form flow" + writeMethod="POST" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/info/{{caseid}}"> + <container + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="\0" flexEnabled="true" - id="container1_MQ28VZFGF" + id="container_3UKGOSRXF" lgColSize="12" - marginEnabled="false" - paddingEnabled="true" - paddingGeneral="four" - persistColorWhenThemeSwitches="false" - title="\0"> - <form jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/form" - borderEnabled="false" - classes="\0" - flexEnabled="false" - flowapi_enable="true" - id="form_F9A4HOCWY" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - readMethod="GET" - readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/info/{{caseid}}" - title="Form flow" - writeMethod="POST" - writePayloadType="application/json" - writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/info/{{caseid}}"> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_3UKGOSRXF" - lgColSize="12" - textAlignment="center"> - <container_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - horizontalAlignment="between" - id="container_1_EL7OP6SYA" - marginBottom="three" - marginEnabled="true" - textAlignment="center"> - <container_1_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_1_1_TJVOSRWIW" - lgColSize="4" - marginEnabled="true" - textAlignment="center"> - <input_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/input" - id="input_1_72DPYRYGQ" - textAlignment="left"> - <label jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/label" - hideLabel="false" - id="label_6EJH9NVJN" - label="Incident Status " /> - <field jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/input" - borderEnabled="false" - classes="\0" - disabled="true" - id="field_B88JQFOUP" - inputType="text" - marginEnabled="false" - name="status" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - placeholder="Incident Status" - validationRequired="false" /> + textAlignment="center"> + <container_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + horizontalAlignment="between" + id="container_1_EL7OP6SYA" + marginBottom="three" + marginEnabled="true" + textAlignment="center"> + <container_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_1_1_TJVOSRWIW" + lgColSize="4" + marginEnabled="true" + textAlignment="center"> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_72DPYRYGQ" + textAlignment="left"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_6EJH9NVJN" + label="Incident Status "/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + borderEnabled="false" + classes="\0" + disabled="true" + id="field_B88JQFOUP" + inputType="text" + marginEnabled="false" + name="status" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="Incident Status" + validationRequired="false"/> </input_1> </container_1_1> - <container_1_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_1_2_VQQXSACRI" - lgColSize="3" - textAlignment="center"> - <container_1_2_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_1_2_1_6I1ACSFZH" - marginBottom="two" - marginEnabled="true" - textAlignment="center"> - <button_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/button" - actionModalTitle="Update Case " - actionType="openModal" - actionUrl="/content/typerefinery-showcase/pages/os-triage/forms/updateincident/jcr:content" - buttonStyle="success" - buttonType="action" - classes="\0" - hideButtonLabel="false" - hideFooter="false" - id="button_2_MV5KTHEFD" - isOutlinedButton="false" - label="Update Case" - persistColorWhenThemeSwitches="true" - showIcon="false" - showTextualElementOfButton="false" /> + <container_1_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_1_2_VQQXSACRI" + lgColSize="3" + textAlignment="center"> + <container_1_2_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_1_2_1_6I1ACSFZH" + marginBottom="two" + marginEnabled="true" + textAlignment="center"> + <button_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + actionModalTitle="Update Case " + actionType="openModal" + actionUrl="/content/typerefinery-showcase/pages/os-triage/forms/updateincident/jcr:content" + buttonStyle="success" + buttonType="action" + classes="\0" + hideButtonLabel="false" + hideFooter="false" + id="button_2_MV5KTHEFD" + isOutlinedButton="false" + label="Update Case" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false"/> </container_1_2_1> - <container_1_2_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_1_2_2_D2M0B1UM8" - marginEnabled="true" - marginTop="two" - textAlignment="center"> - <text jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/text" - classes="\0" - id="text_NBTG0DPRG" - markdown="\0" - name="test" - paragraphMode="false" - text="<p>.</p>" /> + <container_1_2_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_1_2_2_D2M0B1UM8" + marginEnabled="true" + marginTop="two" + textAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + classes="\0" + id="text_NBTG0DPRG" + markdown="\0" + name="test" + paragraphMode="false" + text="<p>.</p>"/> </container_1_2_2> </container_1_2> </container_1> - <container_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="\0" - flexEnabled="true" - horizontalAlignment="between" - id="container_2_PJD1KOCBW" - marginEnabled="false" - marginLeft="two" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="\0"> - <container_2_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="card shadow-md" - flexEnabled="true" - id="container_2_1_ZOQ0LXPKJ" - lgColSize="3" - marginEnabled="false" - paddingEnabled="true" - paddingGeneral="three" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="Name" - titleTagName="h3" - variant="sectionwithtitle"> - <text jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/text" - id="text_SU9AUZL4F" - name="name" - text="<p></p>" /> + <container_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + horizontalAlignment="between" + id="container_2_PJD1KOCBW" + marginEnabled="false" + marginLeft="two" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="\0"> + <container_2_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="card shadow-md" + flexEnabled="true" + id="container_2_1_ZOQ0LXPKJ" + lgColSize="3" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="three" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="Name" + titleTagName="h3" + variant="sectionwithtitle"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_SU9AUZL4F" + name="name" + text="<p></p>"/> </container_2_1> - <container_2_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="card shadow-md" - flexEnabled="true" - id="container_2_2_LS6C8E62H" - lgColSize="3" - marginEnabled="false" - paddingEnabled="true" - paddingGeneral="three" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="Sharing" - titleTagName="h3" - variant="sectionwithtitle"> - <text jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/text" - id="text_BHPBYYQ3L" - name="sharing" - text="<p></p>" /> + <container_2_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="card shadow-md" + flexEnabled="true" + id="container_2_2_LS6C8E62H" + lgColSize="3" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="three" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="Sharing" + titleTagName="h3" + variant="sectionwithtitle"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_BHPBYYQ3L" + name="sharing" + text="<p></p>"/> </container_2_2> - <container_3_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="card shadow-md" - flexEnabled="true" - id="container_3_2_RDGLQYTCU" - lgColSize="3" - marginEnabled="false" - paddingEnabled="true" - paddingGeneral="three" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="Sources" - titleTagName="h3" - variant="sectionwithtitle"> - <text jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/text" - id="text_S0AMBDYPW" - name="source" - text="<p></p>" /> + <container_3_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="card shadow-md" + flexEnabled="true" + id="container_3_2_RDGLQYTCU" + lgColSize="3" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="three" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="Sources" + titleTagName="h3" + variant="sectionwithtitle"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_S0AMBDYPW" + name="source" + text="<p></p>"/> </container_3_2> </container_2> </container> @@ -225,4 +258,4 @@ </container1> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/notes/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/notes/.content.xml index 18e1a79ad..7516e52f4 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/notes/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/notes/.content.xml @@ -1,102 +1,121 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-05T09:14:10.146Z" - jcr:lastModifiedBy="wsadmin" - jcr:primaryType="ws:PageContent" - jcr:title="Notes" - sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-04-27T10:20:47.555+05:30" - ws:lastModifiedBy="wsadmin" - ws:template="/apps/typerefinery/templates/pagewithsidebar" - description="\0" - flowstreamid="\0" - hideInNav="true" - icon="\0" - ogDescription="\0" - ogTitle="\0" - ogUrl="\0" - propertyTitle="\0"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-05T09:14:10.146Z" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Notes" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-27T10:20:47.555+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + flowstreamid="\0" + hideInNav="true" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + containerType="fullWidth" + flexEnabled="false" + id="container1_86PDVXWJX" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="two" + persistColorWhenThemeSwitches="false" + title="\0"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_RMITH0XZD" + lgColSize="12" + textAlignment="center"> + <container_1 + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" - classes="\0" - containerType="fullWidth" - flexEnabled="false" - id="container1_86PDVXWJX" + classes="card shadow-md" + flexEnabled="true" + horizontalAlignment="center" + id="container_1_CESL9BZUN" marginEnabled="false" - paddingEnabled="true" - paddingGeneral="two" + paddingEnabled="false" persistColorWhenThemeSwitches="false" + textAlignment="center" title="\0"> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_RMITH0XZD" - lgColSize="12" - textAlignment="center"> - <container_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="card shadow-md" - flexEnabled="true" - horizontalAlignment="center" - id="container_1_CESL9BZUN" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="\0"> - <title_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/title" - borderEnabled="false" - classes="\0" - headingLevel="h3" - id="title_1_RN5ZNK9MG" - marginEnabled="false" - name="\0" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - title="Note List" /> + <title_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + borderEnabled="false" + classes="\0" + headingLevel="h3" + id="title_1_RN5ZNK9MG" + marginEnabled="false" + name="\0" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="Note List"/> </container_1> - <table jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/table" - borderEnabled="false" - classes="\0" - dataSource="\0" - flowapi_enable="true" - id="table_GNNTCW6LT" - marginEnabled="true" - marginTop="two" - multipleSelectRowEnabled="false" - name="noteList" - overRideColumns="{Boolean}true" - paddingEnabled="false" - paginationEnabled="false" - persistColorWhenThemeSwitches="false" - resizableEnabled="false" - searchEnabled="false" - showActionButtons="true" - singleSelectEnabled="false" - uniqueIdColumn="\0" - websocketHost="\0" - websocketTopic="\0"> + <table + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/table" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="2024-01-21T20:20:27.435Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3k005gr51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3k005gr51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/notes/_jcr_content/rootcontainer/container1/container/table" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/notes/_jcr_content/rootcontainer/container1/container/table/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + flowapi_title="Table flow" + flowapi_topic="table_b9913127a29d45c2a536c2bdc9a50d4f" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="table_GNNTCW6LT" + marginEnabled="true" + marginTop="two" + multipleSelectRowEnabled="false" + name="noteList" + overRideColumns="{Boolean}true" + paddingEnabled="false" + paginationEnabled="false" + persistColorWhenThemeSwitches="false" + resizableEnabled="false" + searchEnabled="false" + showActionButtons="true" + singleSelectEnabled="false" + uniqueIdColumn="\0" + websocketHost="\0" + websocketTopic="\0"> <actionButtons jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" - actionButtonModalContentURL="\0" - actionButtonNavigateToPath="\0" - icon="pi pi-pencil" - id="0_SF1IM9TSP" - label="Edit" /> + <_x0030_ + jcr:primaryType="nt:unstructured" + actionButtonModalContentURL="\0" + actionButtonNavigateToPath="\0" + icon="pi pi-pencil" + id="0_SF1IM9TSP" + label="Edit"/> </actionButtons> </table> </container> </container1> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/observables/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/observables/.content.xml index 8cbbc5f16..76bcf68a5 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/observables/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/observables/.content.xml @@ -2,10 +2,12 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:42.378+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Observables" sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-04-28T10:46:47.620+05:30" + ws:lastModified="{Date}2024-02-08T09:51:16.389+11:00" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/pagewithsidebar" description="\0" @@ -49,7 +51,21 @@ jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/security/stix" dataUrl="\0" - flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=ws%3A%2F%2Ftms.typerefinery.localhost%3A8100%2Fflows%2Ff10hmh001yc51d&components=" + flowapi_createdon="2024-02-07T22:51:17.579Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff19b3r001tj51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f19b3r001tj51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/observables/_jcr_content/rootcontainer/container1/container/container_1/stix" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/observables/_jcr_content/rootcontainer/container1/container/container_1/stix/{{id}}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/security/stix/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/security/stix/templates/stix.json" + flowapi_title="Stix flow" + flowapi_topic="stix_f1547e69ecb44da5be4531dad9458847" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" id="stix_SVTBP4VXM" maxCount="\0" title="\0"/> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tags/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tags/.content.xml index 5ae603a6d..eb4b60e93 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tags/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tags/.content.xml @@ -1,100 +1,118 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" - jcr:lastModifiedBy="sling-package-install" - jcr:primaryType="ws:PageContent" - jcr:title="Tags" - sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-04-27T10:20:30.910+05:30" - ws:lastModifiedBy="wsadmin" - ws:template="/apps/typerefinery/templates/pagewithsidebar" - description="\0" - flowstreamid="\0" - hideInNav="true" - icon="\0" - ogDescription="\0" - ogTitle="\0" - ogUrl="\0" - propertyTitle="\0"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Tags" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-27T10:20:30.910+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + flowstreamid="\0" + hideInNav="true" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + horizontalAlignment="end" + id="container1_ISWR6HFYT" + marginEnabled="false" + marginLeft="two" + marginTop="one" + paddingEnabled="true" + paddingGeneral="two" + persistColorWhenThemeSwitches="false" + title="\0"> + <container_1_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="card shadow-md" + flexEnabled="true" + id="container_1_2_Y6DTATAFC" + lgColSize="12" + marginEnabled="true" + marginTop="zero" + mdColSize="12" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="\0"> + <title_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" borderEnabled="false" classes="\0" - flexEnabled="true" - horizontalAlignment="end" - id="container1_ISWR6HFYT" + headingLevel="h3" + headingSize="\0" + id="title_1_F58GEW89Y" marginEnabled="false" - marginLeft="two" - marginTop="one" - paddingEnabled="true" - paddingGeneral="two" + name="\0" + paddingEnabled="false" persistColorWhenThemeSwitches="false" - title="\0"> - <container_1_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="card shadow-md" - flexEnabled="true" - id="container_1_2_Y6DTATAFC" - lgColSize="12" - marginEnabled="true" - marginTop="zero" - mdColSize="12" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="\0"> - <title_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/title" - borderEnabled="false" - classes="\0" - headingLevel="h3" - headingSize="\0" - id="title_1_F58GEW89Y" - marginEnabled="false" - name="\0" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - title="Tag List" /> + title="Tag List"/> </container_1_2> - <table jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/table" - borderEnabled="false" - classes="\0" - dataSource="\0" - flowapi_enable="true" - id="table_LZMYYZBV7" - marginEnabled="true" - marginTop="three" - multipleSelectRowEnabled="false" - name="tagList" - overRideColumns="{Boolean}true" - paddingEnabled="false" - paginationEnabled="false" - persistColorWhenThemeSwitches="false" - resizableEnabled="false" - searchEnabled="false" - showActionButtons="true" - singleSelectEnabled="false" - uniqueIdColumn="\0" - websocketHost="\0" - websocketTopic="\0"> + <table + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/table" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="2024-01-21T20:20:25.149Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3k003gr51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3k003gr51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tags/_jcr_content/rootcontainer/container1/table" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tags/_jcr_content/rootcontainer/container1/table/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + flowapi_title="Table flow" + flowapi_topic="table_2f74bfcbd7fb4a0198352f419af051d3" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="table_LZMYYZBV7" + marginEnabled="true" + marginTop="three" + multipleSelectRowEnabled="false" + name="tagList" + overRideColumns="{Boolean}true" + paddingEnabled="false" + paginationEnabled="false" + persistColorWhenThemeSwitches="false" + resizableEnabled="false" + searchEnabled="false" + showActionButtons="true" + singleSelectEnabled="false" + uniqueIdColumn="\0" + websocketHost="\0" + websocketTopic="\0"> <actionButtons jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" - actionButtonModalContentURL="/content/typerefinery-showcase/pages/os-triage/forms/addtag.html" - actionButtonNavigateToPath="\0" - icon="pi pi-pencil" - id="0_0JFR7N9TA" - label="Edit" /> + <_x0030_ + jcr:primaryType="nt:unstructured" + actionButtonModalContentURL="/content/typerefinery-showcase/pages/os-triage/forms/addtag.html" + actionButtonNavigateToPath="\0" + icon="pi pi-pencil" + id="0_0JFR7N9TA" + label="Edit"/> </actionButtons> </table> </container1> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tasks/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tasks/.content.xml index 1e6259ddc..6e61a15c3 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tasks/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tasks/.content.xml @@ -1,108 +1,127 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:53.505+05:30" - jcr:lastModifiedBy="sling-package-install" - jcr:primaryType="ws:PageContent" - jcr:title="Tasks" - sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-04-27T10:21:06.164+05:30" - ws:lastModifiedBy="wsadmin" - ws:template="/apps/typerefinery/templates/pagewithsidebar" - description="\0" - flowstreamid="\0" - hideInNav="true" - icon="\0" - ogDescription="\0" - ogTitle="\0" - ogUrl="\0" - propertyTitle="\0"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <container1 jcr:primaryType="nt:unstructured" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:53.505+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Tasks" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-27T10:21:06.164+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + flowstreamid="\0" + hideInNav="true" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="container1_KGV3BGNXQ" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="two" + persistColorWhenThemeSwitches="false" + title="\0"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + horizontalAlignment="center" + id="container_FIFDP220S" + lgColSize="12" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="\0"> + <container + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" - classes="\0" + classes="card shadow-md" flexEnabled="false" - id="container1_KGV3BGNXQ" + horizontalAlignment="center" + id="container_YZ8T6SZYI" marginEnabled="false" - paddingEnabled="true" - paddingGeneral="two" + paddingEnabled="false" persistColorWhenThemeSwitches="false" + textAlignment="center" title="\0"> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="\0" - flexEnabled="true" - horizontalAlignment="center" - id="container_FIFDP220S" - lgColSize="12" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="\0"> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="card shadow-md" - flexEnabled="false" - horizontalAlignment="center" - id="container_YZ8T6SZYI" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="\0"> - <title jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/title" - borderEnabled="false" - classes="\0" - headingLevel="h3" - id="title_XCFVGAYQF" - marginEnabled="false" - name="\0" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - title="Task List" /> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + borderEnabled="false" + classes="\0" + headingLevel="h3" + id="title_XCFVGAYQF" + marginEnabled="false" + name="\0" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="Task List"/> </container> - <table jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/table" - borderEnabled="false" - classes="\0" - dataSource="/apps/typerefinery/components/widgets/table/mock/datasource1.json" - flowapi_enable="true" - id="table_RWZKPV9SC" - marginEnabled="true" - marginTop="two" - multipleSelectRowEnabled="false" - name="taskList" - overRideColumns="{Boolean}true" - paddingEnabled="false" - paginationEnabled="false" - persistColorWhenThemeSwitches="false" - resizableEnabled="false" - searchEnabled="false" - showActionButtons="true" - singleSelectEnabled="false" - uniqueIdColumn="\0" - websocketHost="\0" - websocketTopic="\0"> + <table + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/table" + borderEnabled="false" + classes="\0" + dataSource="/apps/typerefinery/components/widgets/table/mock/datasource1.json" + flowapi_createdon="2024-01-21T20:20:26.296Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3k004gr50d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3k004gr50d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tasks/_jcr_content/rootcontainer/container1/container/table" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/tasks/_jcr_content/rootcontainer/container1/container/table/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + flowapi_title="Table flow" + flowapi_topic="table_efb58af3970f4c679fcde6b642b70fde" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="table_RWZKPV9SC" + marginEnabled="true" + marginTop="two" + multipleSelectRowEnabled="false" + name="taskList" + overRideColumns="{Boolean}true" + paddingEnabled="false" + paginationEnabled="false" + persistColorWhenThemeSwitches="false" + resizableEnabled="false" + searchEnabled="false" + showActionButtons="true" + singleSelectEnabled="false" + uniqueIdColumn="\0" + websocketHost="\0" + websocketTopic="\0"> <actionButtons jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" - actionButtonModalContentURL="\0" - actionButtonNavigateToPath="/content/typerefinery-showcase/pages/os-triage/forms/addtask.html" - icon="pi pi-pencil" - id="0_K7PYQOT3I" - label="Edit" /> + <_x0030_ + jcr:primaryType="nt:unstructured" + actionButtonModalContentURL="\0" + actionButtonNavigateToPath="/content/typerefinery-showcase/pages/os-triage/forms/addtask.html" + icon="pi pi-pencil" + id="0_K7PYQOT3I" + label="Edit"/> </actionButtons> </table> </container> </container1> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/totalvirus/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/totalvirus/.content.xml index 8ac497cc7..0a4a4e3a5 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/totalvirus/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/totalvirus/.content.xml @@ -45,6 +45,7 @@ jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="true" + id="label_WXR3QFOCY" label="\0" title="Label"/> <field @@ -52,9 +53,9 @@ sling:resourceType="typerefinery/components/forms/fields/input" borderEnabled="false" classes="\0" - id="\0" - marginEnabled="true" + id="field_FTPCSER21" marginBottom="three" + marginEnabled="true" name="\0" paddingEnabled="false" persistColorWhenThemeSwitches="false" @@ -71,11 +72,13 @@ jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="true" + id="label_WVP3CCILU" label="\0" title="Label"/> <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/fileupload" + id="field_QU0MNCSDH" title="Field"/> </fileupload> </container> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/info/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/info/.content.xml index 6877494b7..d49ac5613 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/info/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/info/.content.xml @@ -1,227 +1,262 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" - jcr:lastModifiedBy="sling-package-install" - jcr:primaryType="ws:PageContent" - jcr:title="Info" - sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-04-28T15:49:19.527+05:30" - ws:lastModifiedBy="wsadmin" - ws:template="/apps/typerefinery/templates/pagewithsidebar" - description="\0" - flowstreamid="\0" - hideInNav="true" - icon="\0" - ogDescription="\0" - ogTitle="\0" - ogUrl="\0" - propertyTitle="\0"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <aside jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/aside" /> - <header jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/header" /> - <container1 jcr:primaryType="nt:unstructured" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Info" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-28T15:49:19.527+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + flowstreamid="\0" + hideInNav="true" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + id="container1_MQ28VZFGF" + lgColSize="12" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="four" + persistColorWhenThemeSwitches="false" + title="\0"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_createdon="2024-01-21T20:20:23.997Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3k002gr50d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3k002gr50d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/info/_jcr_content/rootcontainer/container1/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/info/_jcr_content/rootcontainer/container1/form/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_c1336c0865e24c4383d03a48fd279529" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_F9A4HOCWY" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readMethod="GET" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/info/{{caseid}}" + title="Form flow" + writeMethod="POST" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/info/{{caseid}}"> + <container + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="\0" flexEnabled="true" - id="container1_MQ28VZFGF" + id="container_3UKGOSRXF" lgColSize="12" - marginEnabled="false" - paddingEnabled="true" - paddingGeneral="four" - persistColorWhenThemeSwitches="false" - title="\0"> - <form jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/form" - borderEnabled="false" - classes="\0" - flexEnabled="false" - flowapi_enable="true" - id="form_F9A4HOCWY" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - readMethod="GET" - readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/info/{{caseid}}" - title="Form flow" - writeMethod="POST" - writePayloadType="application/json" - writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/info/{{caseid}}"> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_3UKGOSRXF" - lgColSize="12" - textAlignment="center"> - <container_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - horizontalAlignment="between" - id="container_1_EL7OP6SYA" - marginBottom="three" - marginEnabled="true" - textAlignment="center"> - <container_1_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_1_1_TJVOSRWIW" - lgColSize="4" - marginEnabled="true" - textAlignment="center"> - <input_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/input" - id="input_1_72DPYRYGQ" - textAlignment="left"> - <label jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/label" - hideLabel="false" - id="label_6EJH9NVJN" - label="Incident Status " /> - <field jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/input" - borderEnabled="false" - classes="\0" - disabled="true" - id="field_B88JQFOUP" - inputType="text" - marginEnabled="false" - name="status" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - placeholder="Incident Status" - validationRequired="false" /> + textAlignment="center"> + <container_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + horizontalAlignment="between" + id="container_1_EL7OP6SYA" + marginBottom="three" + marginEnabled="true" + textAlignment="center"> + <container_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_1_1_TJVOSRWIW" + lgColSize="4" + marginEnabled="true" + textAlignment="center"> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_72DPYRYGQ" + textAlignment="left"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="false" + id="label_6EJH9NVJN" + label="Incident Status "/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + borderEnabled="false" + classes="\0" + disabled="true" + id="field_B88JQFOUP" + inputType="text" + marginEnabled="false" + name="status" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + placeholder="Incident Status" + validationRequired="false"/> </input_1> </container_1_1> - <container_1_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_1_2_VQQXSACRI" - lgColSize="3" - textAlignment="center"> - <container_1_2_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_1_2_1_6I1ACSFZH" - marginBottom="two" - marginEnabled="true" - textAlignment="center"> - <button_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/fields/button" - actionModalTitle="Update Case " - actionType="openModal" - actionUrl="/content/typerefinery-showcase/pages/os-triage/forms/updateincident/jcr:content" - buttonStyle="primary" - buttonType="action" - classes="\0" - hideButtonLabel="false" - hideFooter="false" - id="button_2_MV5KTHEFD" - isOutlinedButton="false" - label="Update Case" - persistColorWhenThemeSwitches="true" - showIcon="false" - showTextualElementOfButton="false" /> + <container_1_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_1_2_VQQXSACRI" + lgColSize="3" + textAlignment="center"> + <container_1_2_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_1_2_1_6I1ACSFZH" + marginBottom="two" + marginEnabled="true" + textAlignment="center"> + <button_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + actionModalTitle="Update Case " + actionType="openModal" + actionUrl="/content/typerefinery-showcase/pages/os-triage/forms/updateincident/jcr:content" + buttonStyle="primary" + buttonType="action" + classes="\0" + hideButtonLabel="false" + hideFooter="false" + id="button_2_MV5KTHEFD" + isOutlinedButton="false" + label="Update Case" + persistColorWhenThemeSwitches="true" + showIcon="false" + showTextualElementOfButton="false"/> </container_1_2_1> - <container_1_2_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - flexEnabled="true" - id="container_1_2_2_D2M0B1UM8" - marginEnabled="true" - marginTop="two" - textAlignment="center"> - <text jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/text" - classes="\0" - id="text_NBTG0DPRG" - markdown="\0" - name="test" - paragraphMode="false" - text="<p>.</p>" /> + <container_1_2_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_1_2_2_D2M0B1UM8" + marginEnabled="true" + marginTop="two" + textAlignment="center"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + classes="\0" + id="text_NBTG0DPRG" + markdown="\0" + name="test" + paragraphMode="false" + text="<p>.</p>"/> </container_1_2_2> </container_1_2> </container_1> - <container_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="\0" - flexEnabled="true" - horizontalAlignment="between" - id="container_2_PJD1KOCBW" - marginEnabled="false" - marginLeft="two" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="\0"> - <container_2_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="card shadow-md" - flexEnabled="true" - id="container_2_1_ZOQ0LXPKJ" - lgColSize="3" - marginEnabled="false" - paddingEnabled="true" - paddingGeneral="three" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="Name" - titleTagName="h3" - variant="sectionwithtitle"> - <text jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/text" - id="text_SU9AUZL4F" - name="name" - text="<p></p>" /> + <container_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + horizontalAlignment="between" + id="container_2_PJD1KOCBW" + marginEnabled="false" + marginLeft="two" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="\0"> + <container_2_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="card shadow-md" + flexEnabled="true" + id="container_2_1_ZOQ0LXPKJ" + lgColSize="3" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="three" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="Name" + titleTagName="h3" + variant="sectionwithtitle"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_SU9AUZL4F" + name="name" + text="<p></p>"/> </container_2_1> - <container_2_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="card shadow-md" - flexEnabled="true" - id="container_2_2_LS6C8E62H" - lgColSize="3" - marginEnabled="false" - paddingEnabled="true" - paddingGeneral="three" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="Sharing" - titleTagName="h3" - variant="sectionwithtitle"> - <text jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/text" - id="text_BHPBYYQ3L" - name="sharing" - text="<p></p>" /> + <container_2_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="card shadow-md" + flexEnabled="true" + id="container_2_2_LS6C8E62H" + lgColSize="3" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="three" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="Sharing" + titleTagName="h3" + variant="sectionwithtitle"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_BHPBYYQ3L" + name="sharing" + text="<p></p>"/> </container_2_2> - <container_3_2 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="card shadow-md" - flexEnabled="true" - id="container_3_2_RDGLQYTCU" - lgColSize="3" - marginEnabled="false" - paddingEnabled="true" - paddingGeneral="three" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="Sources" - titleTagName="h3" - variant="sectionwithtitle"> - <text jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/text" - id="text_S0AMBDYPW" - name="source" - text="<p></p>" /> + <container_3_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="card shadow-md" + flexEnabled="true" + id="container_3_2_RDGLQYTCU" + lgColSize="3" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="three" + persistColorWhenThemeSwitches="false" + textAlignment="center" + title="Sources" + titleTagName="h3" + variant="sectionwithtitle"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + id="text_S0AMBDYPW" + name="source" + text="<p></p>"/> </container_3_2> </container_2> </container> @@ -229,4 +264,4 @@ </container1> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/notes/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/notes/.content.xml index 73936c2bd..f859cc0e0 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/notes/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/notes/.content.xml @@ -1,102 +1,139 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-05T09:14:10.146Z" - jcr:lastModifiedBy="wsadmin" - jcr:primaryType="ws:PageContent" - jcr:title="Notes" - sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-04-27T12:52:27.831+05:30" - ws:lastModifiedBy="wsadmin" - ws:template="/apps/typerefinery/templates/pagewithsidebar"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <aside jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/aside" /> - <header jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/header" /> - <container1 jcr:primaryType="nt:unstructured" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-05T09:14:10.146Z" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Notes" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-27T12:52:27.831+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + id="aside_VGRZMXFPT"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_R4ZBKHEPQ"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + containerType="fullWidth" + flexEnabled="false" + id="container1_86PDVXWJX" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="two" + persistColorWhenThemeSwitches="false" + title="\0"> + <form1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="true" + flowapi_createdon="2024-01-21T20:13:19.736Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d012gr50d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d012gr50d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/notes/_jcr_content/rootcontainer/container1/form1" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/notes/_jcr_content/rootcontainer/container1/form1/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_d191a389150a40509ae3162cd0c26dd2" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form1_FUGCRWT4L" + marginEnabled="true" + marginTop="three" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readMethod="GET" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/notes/*" + title="Form flow" + writeMethod="PUT" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/notes/*"> + <container + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" - classes="\0" - containerType="fullWidth" - flexEnabled="false" - id="container1_86PDVXWJX" + classes="card shadow-md" + flexEnabled="true" + id="container_RTEKD0LPN" marginEnabled="false" - paddingEnabled="true" - paddingGeneral="two" + paddingEnabled="false" persistColorWhenThemeSwitches="false" + textAlignment="center" title="\0"> - <form1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/form" - borderEnabled="false" - classes="\0" - flexEnabled="true" - flowapi_enable="true" - id="form1_FUGCRWT4L" - marginEnabled="true" - marginTop="three" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - readMethod="GET" - readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/notes/*" - title="Form flow" - writeMethod="PUT" - writePayloadType="application/json" - writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/notes/*"> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="card shadow-md" - flexEnabled="true" - id="container_RTEKD0LPN" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="\0"> - <title_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/title" - headingLevel="h3" - id="title_1_6NVGAMWOB" - title="Note List" /> + <title_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h3" + id="title_1_6NVGAMWOB" + title="Note List"/> </container> - <table jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/table" - borderEnabled="false" - marginTop="three" - classes="\0" - dataSource="\0" - flowapi_enable="true" - id="table_GNNTCW6LT" - marginEnabled="true" - multipleSelectRowEnabled="false" - name="noteList" - overRideColumns="{Boolean}true" - paddingEnabled="false" - paginationEnabled="false" - persistColorWhenThemeSwitches="false" - resizableEnabled="false" - searchEnabled="false" - showActionButtons="true" - singleSelectEnabled="false" - uniqueIdColumn="\0" - websocketHost="\0" - websocketTopic="\0"> + <table + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/table" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="2024-01-21T20:13:21.060Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d013gr51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d013gr51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/notes/_jcr_content/rootcontainer/container1/form1/table" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/notes/_jcr_content/rootcontainer/container1/form1/table/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + flowapi_title="Table flow" + flowapi_topic="table_857aac175260493f9f8105eec3c0b44a" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="table_GNNTCW6LT" + marginEnabled="true" + marginTop="three" + multipleSelectRowEnabled="false" + name="noteList" + overRideColumns="{Boolean}true" + paddingEnabled="false" + paginationEnabled="false" + persistColorWhenThemeSwitches="false" + resizableEnabled="false" + searchEnabled="false" + showActionButtons="true" + singleSelectEnabled="false" + uniqueIdColumn="\0" + websocketHost="\0" + websocketTopic="\0"> <actionButtons jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" - actionButtonModalContentURL="/content/typerefinery-showcase/pages/os-triage/forms/note.html" - actionButtonNavigateToPath="\0" - icon="pi pi-pencil" - id="0_28UPAE0H1" - label="Edit" /> + <_x0030_ + jcr:primaryType="nt:unstructured" + actionButtonModalContentURL="/content/typerefinery-showcase/pages/os-triage/forms/note.html" + actionButtonNavigateToPath="\0" + icon="pi pi-pencil" + id="0_28UPAE0H1" + label="Edit"/> </actionButtons> </table> </form1> </container1> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/observables/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/observables/.content.xml index d9ee9a2a7..eaa75078e 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/observables/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/observables/.content.xml @@ -1,15 +1,70 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:52.907+05:30" jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Observables" sling:resourceType="typerefinery/components/structure/page" ws:lastModified="{Date}2023-04-21T15:04:52.209+05:30" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/pagewithsidebar" description="\0" flowstreamid="\0" hideInNav="true" icon="\0" ogDescription="\0" ogTitle="\0" ogUrl="\0" propertyTitle="\0"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <aside jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/aside"></aside> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"></header> - <container1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" flexEnabled="true" id="container1_OH16ALALY" marginEnabled="false" marginTop="one" paddingEnabled="true" paddingGeneral="two" persistColorWhenThemeSwitches="false" title="\0"> - <stix jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/security/stix" dataUrl="\0" flowapi_createdon="\0" flowapi_designtemplate="\0" flowapi_editurl="\0" flowapi_enable="false" flowapi_flowstreamid="\0" flowapi_group="\0" flowapi_httproute="\0" flowapi_iscontainer="\0" flowapi_sampledata="/apps/typerefinery/components/widgets/security/stix/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/security/stix/templates/stix.json" flowapi_title="\0" flowapi_topic="\0" flowapi_updatedon="\0" id="stix_SVTBP4VXM" maxCount="\0" mdColSize="12" title="\0"/> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:52.907+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Observables" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-21T15:04:52.209+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + flowstreamid="\0" + hideInNav="true" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + id="aside_HB7S5Q0IN"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_KXDKE5OPR"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + id="container1_OH16ALALY" + marginEnabled="false" + marginTop="one" + paddingEnabled="true" + paddingGeneral="two" + persistColorWhenThemeSwitches="false" + title="\0"> + <stix + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/security/stix" + dataUrl="\0" + flowapi_createdon="\0" + flowapi_designtemplate="\0" + flowapi_editurl="\0" + flowapi_enable="false" + flowapi_flowstreamid="\0" + flowapi_group="\0" + flowapi_httproute="\0" + flowapi_iscontainer="\0" + flowapi_sampledata="/apps/typerefinery/components/widgets/security/stix/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/security/stix/templates/stix.json" + flowapi_title="\0" + flowapi_topic="\0" + flowapi_updatedon="\0" + id="stix_SVTBP4VXM" + maxCount="\0" + mdColSize="12" + title="\0"/> </container1> </rootcontainer> </jcr:content> + <observable1/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/observables/observable1/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/observables/observable1/.content.xml index 5f286efba..824bb2164 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/observables/observable1/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/observables/observable1/.content.xml @@ -1,25 +1,105 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-10T13:26:45.215+05:30" jcr:lastModifiedBy="wsadmin" jcr:primaryType="ws:PageContent" jcr:title="Observable 1" sling:resourceType="typerefinery/components/structure/page" ws:lastModified="{Date}2023-04-18T15:42:29.552+05:30" ws:lastModifiedBy="wsadmin" ws:template="/apps/typerefinery/templates/pagewithsidebar" description="\0" flowstreamid="\0" hideInNav="false" icon="\0" ogDescription="\0" ogTitle="\0" ogUrl="\0" propertyTitle="\0"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/rootcontainer"> - <aside jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/aside"></aside> - <header jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/header"></header> - <main jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" classes="\0" containerType="fullWidth" decorationTagName="main" flexEnabled="false" id="main_4PWLBVV4K" marginEnabled="false" paddingEnabled="true" paddingGeneral="two" persistColorWhenThemeSwitches="false" title="\0"> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" id="container_IDW4SCBOO" paddingEnabled="true" paddingGeneral="two"> - <form jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/form" flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" id="form_ZAQVGSBB0"> - <fileupload jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fileupload" id="fileupload_QJS7AILLT"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" hideLabel="true" id="label_KOLPSZYYG" label="\0" title="Label"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/fileupload" title="Field"/> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-10T13:26:45.215+05:30" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Observable 1" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-18T15:42:29.552+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + flowstreamid="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/rootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + id="aside_WTHG7ZR7J"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_FQDJKZAAB"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + containerType="fullWidth" + decorationTagName="main" + flexEnabled="false" + id="main_4PWLBVV4K" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="two" + persistColorWhenThemeSwitches="false" + title="\0"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_IDW4SCBOO" + paddingEnabled="true" + paddingGeneral="two"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + id="form_ZAQVGSBB0"> + <fileupload + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fileupload" + id="fileupload_QJS7AILLT"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + hideLabel="true" + id="label_KOLPSZYYG" + label="\0" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/fileupload" + title="Field"/> </fileupload> - <text jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/text" classes="\0" id="text_CZ9MRR8TQ" markdown="\0" paragraphMode="false" text="<p>Uploaded Changes Successfully !</p>"/> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + classes="\0" + id="text_CZ9MRR8TQ" + markdown="\0" + paragraphMode="false" + text="<p>Uploaded Changes Successfully !</p>"/> </form> - <tabs jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/tabs" flowapi_sampledata="/apps/typerefinery/components/widgets/tab/templates/flowsample.json" flowapi_template="/apps/typerefinery/components/widgets/tab/templates/tab.json" id="tabs_DU6P6KQXZ" placeholderContent="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident.html"> + <tabs + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/tabs" + flowapi_sampledata="/apps/typerefinery/components/widgets/tab/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/tab/templates/tab.json" + id="tabs_DU6P6KQXZ" + placeholderContent="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident.html"> <listOfTab jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" content="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/domainname.html" icon="pi pi-globe" title="Domain" useQueryParamsFromParent="false"/> - <_x0031_ jcr:primaryType="nt:unstructured" content="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/totalvirus.html" icon="pi pi-exclamation-triangle" title="Virus total" useQueryParamsFromParent="false"/> + <_x0030_ + jcr:primaryType="nt:unstructured" + content="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/domainname.html" + icon="pi pi-globe" + title="Domain" + useQueryParamsFromParent="false"/> + <_x0031_ + jcr:primaryType="nt:unstructured" + content="/content/typerefinery-showcase/pages/os-triage/pages/incidents/incident/totalvirus.html" + icon="pi pi-exclamation-triangle" + title="Virus total" + useQueryParamsFromParent="false"/> </listOfTab> </tabs> </container> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/options/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/options/.content.xml new file mode 100644 index 000000000..016fe71e2 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/options/.content.xml @@ -0,0 +1,377 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-01-30T21:54:25.899+11:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Options" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-01-31T02:51:10.951+11:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/rootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + classes="aside-left" + id="aside_HER3RXHPD"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_2JH3YRK5G"/> + <main + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + containerType="fullWidth" + decorationTagName="main" + id="main_LGNG8O0ZE"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + containerType="fullWidth" + flexEnabled="true" + flowapi_createdon="2024-01-30T11:48:50.121Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff191pc001ke51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f191pc001ke51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/options/_jcr_content/rootcontainer/main/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/options/_jcr_content/rootcontainer/main/form/{{id}}" + flowapi_iscontainer="false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_99b5a68cd0584a46836154d5c8825b6d" + flowapi_updatedon="\0" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_WWMG2YVI1" + marginEnabled="false" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readMethod="GET" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/options/_jcr_content/rootcontainer/main/form/" + title="Form flow" + writeMethod="POST" + writePayloadType="application/x-www-form-urlencoded" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/options/_jcr_content/rootcontainer/main/form"> + <container_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_2_UICUXJ378"> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_820RBP1GT" + lgColSize="6" + marginEnabled="false" + mdColSize="6" + paddingEnabled="false" + smColSize="6" + title="My Identity" + variant="sectionwithtitle"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_SYNTOLDOZ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_R3XUUJYUH" + label="First Name" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_NI132FFBH" + name="firstname" + title="Field"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_DC15VV7MP"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_Z3LP1PEHA" + label="Last Name" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_7CR2WDMJC" + name="lastname" + title="Field"/> + </input_1> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2_CNWE1ERAN"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_SHD545SD1" + label="Middle Name" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_TAMWF9UCH" + name="middlename" + title="Field"/> + </input_2> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_3_VRLKSZ6EM"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_DRGNUXFGA" + label="Team" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_B5O9PB5YY" + name="team" + title="Field"/> + </input_3> + </container> + <container_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_1_TBM8ZOZTW" + lgColSize="6" + mdColSize="6" + smColSize="6" + title="My Organisation" + variant="sectionwithtitle"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_BNQFCSG3Q"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_717JZV60K" + label="Name" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_JA7MZ3WEZ" + name="organisationname" + title="Field"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_Q5KY35SR0"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_1L9BJSTIT" + label="Description" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_6BQ1CM1P0" + name="organisationdescription" + title="Field"/> + </input_1> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2_9MMHFGVVU"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_9AYWKYNAX" + label="Class" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_IPV3FH7RP" + name="organisationclass" + title="Field"/> + </input_2> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_3_TRBR4PQHV"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_TUZ91ZB9T" + label="Sectors (comma separated)" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_7CA9GUWTU" + name="organisationsectors" + title="Field"/> + </input_3> + </container_1> + <container_1_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_1_TBM8ZOZTW" + lgColSize="6" + mdColSize="6" + smColSize="6" + title="My Email Addresses" + variant="sectionwithtitle"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_BNQFCSG3Q"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_717JZV60K" + label="Email Address" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_JA7MZ3WEZ" + name="emailaddress" + title="Field"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_Q5KY35SR0"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_1L9BJSTIT" + label="Email Type" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_6BQ1CM1P0" + name="emailaddresstype" + title="Field"/> + </input_1> + </container_1_1> + <container_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="hiddencontainer" + lgColSize="6" + marginEnabled="false" + mdColSize="6" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + smColSize="6" + title="User Accounts" + variant="sectionwithtitle"> + <input + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_SYNTOLDOZ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_R3XUUJYUH" + label="User Id" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_NI132FFBH" + name="useraccount1_userid" + title="Field"/> + </input> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_DC15VV7MP"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_Z3LP1PEHA" + label="Account Login" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_7CR2WDMJC" + name="useraccount1_accountlogin" + title="Field"/> + </input_1> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2_CNWE1ERAN"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_SHD545SD1" + label="Account Type" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_TAMWF9UCH" + name="useraccount1_accounttype" + title="Field"/> + </input_2> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_3_VRLKSZ6EM"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + id="label_DRGNUXFGA" + label="Display Name" + title="Label"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + id="field_B5O9PB5YY" + name="useraccount1_displayname" + title="Field"/> + </input_3> + </container_2> + </container_2> + <button + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + id="button_7JFLKIOYA" + label="Save" + persistColorWhenThemeSwitches="{Boolean}true"/> + </form> + </main> + <footer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/footer" + id="footer_BHQKJNBLJ"/> + </rootcontainer> + </jcr:content> +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/tags/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/tags/.content.xml index 3afabfbec..47eefb257 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/tags/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/tags/.content.xml @@ -1,104 +1,141 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" - jcr:lastModifiedBy="sling-package-install" - jcr:primaryType="ws:PageContent" - jcr:title="Tags" - sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-04-27T12:53:07.001+05:30" - ws:lastModifiedBy="wsadmin" - ws:template="/apps/typerefinery/templates/pagewithsidebar"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <aside jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/aside" /> - <header jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/header" /> - <container1 jcr:primaryType="nt:unstructured" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:52.278+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Tags" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-27T12:53:07.001+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + id="aside_FB7FDYJHD"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_GMU1QUPIW"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="true" + horizontalAlignment="end" + id="container1_ISWR6HFYT" + marginEnabled="false" + marginLeft="two" + marginTop="one" + paddingEnabled="true" + paddingGeneral="two" + persistColorWhenThemeSwitches="false" + title="\0"> + <form + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="false" + flowapi_createdon="2024-01-21T20:13:23.437Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d014gr50d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d014gr50d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/tags/_jcr_content/rootcontainer/container1/form" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/tags/_jcr_content/rootcontainer/container1/form/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_f1288c2b6100420bba92e99f2937e14f" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form_RG77KSPDD" + marginEnabled="true" + marginTop="three" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readMethod="GET" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/tags/*" + title="Form flow" + writeMethod="PUT" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/tags/*"> + <container + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" - classes="\0" + classes="card shadow-md" flexEnabled="true" - horizontalAlignment="end" - id="container1_ISWR6HFYT" + id="container_9LFLKEO5K" marginEnabled="false" - marginLeft="two" - marginTop="one" - paddingEnabled="true" - paddingGeneral="two" + paddingEnabled="false" persistColorWhenThemeSwitches="false" + textAlignment="center" title="\0"> - <form jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/form" - borderEnabled="false" - classes="\0" - flexEnabled="false" - flowapi_enable="true" - id="form_RG77KSPDD" - marginEnabled="true" - marginTop="three" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - readMethod="GET" - readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/tags/*" - title="Form flow" - writeMethod="PUT" - writePayloadType="application/json" - writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/tags/*"> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="card shadow-md" - flexEnabled="true" - id="container_9LFLKEO5K" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="\0"> - <title jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/title" - headingLevel="h3" - id="title_WRPDH8ATX" - title="Tag List" /> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h3" + id="title_WRPDH8ATX" + title="Tag List"/> </container> - <table jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/table" - borderEnabled="false" - classes="\0" - dataSource="\0" - flowapi_enable="true" - id="table_LZMYYZBV7" - marginEnabled="true" - marginTop="three" - multipleSelectRowEnabled="false" - name="tagList" - overRideColumns="{Boolean}true" - paddingEnabled="false" - paginationEnabled="false" - persistColorWhenThemeSwitches="false" - resizableEnabled="false" - searchEnabled="false" - showActionButtons="true" - singleSelectEnabled="false" - uniqueIdColumn="\0" - websocketHost="\0" - websocketTopic="\0"> + <table + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/table" + borderEnabled="false" + classes="\0" + dataSource="\0" + flowapi_createdon="2024-01-21T20:13:23.437Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d015gr51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d015gr51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/tags/_jcr_content/rootcontainer/container1/form/table" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/tags/_jcr_content/rootcontainer/container1/form/table/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + flowapi_title="Table flow" + flowapi_topic="table_2c7a005e18b646faa25f5ec11d45d3c8" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="table_LZMYYZBV7" + marginEnabled="true" + marginTop="three" + multipleSelectRowEnabled="false" + name="tagList" + overRideColumns="{Boolean}true" + paddingEnabled="false" + paginationEnabled="false" + persistColorWhenThemeSwitches="false" + resizableEnabled="false" + searchEnabled="false" + showActionButtons="true" + singleSelectEnabled="false" + uniqueIdColumn="\0" + websocketHost="\0" + websocketTopic="\0"> <actionButtons jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" - actionButtonModalContentURL="/content/typerefinery-showcase/pages/os-triage/forms/addtag.html" - actionButtonNavigateToPath="\0" - icon="pi pi-pencil" - id="0_0JFR7N9TA" - label="Edit" /> + <_x0030_ + jcr:primaryType="nt:unstructured" + actionButtonModalContentURL="/content/typerefinery-showcase/pages/os-triage/forms/addtag.html" + actionButtonNavigateToPath="\0" + icon="pi pi-pencil" + id="0_0JFR7N9TA" + label="Edit"/> </actionButtons> </table> </form> </container1> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/tasks/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/tasks/.content.xml index 91c177455..d37c31a37 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/tasks/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/os-triage/pages/tasks/.content.xml @@ -1,113 +1,151 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" - jcr:primaryType="ws:Page"> - <jcr:content jcr:lastModified="{Date}2023-04-07T12:28:53.505+05:30" - jcr:lastModifiedBy="sling-package-install" - jcr:primaryType="ws:PageContent" - jcr:title="Tasks" - sling:resourceType="typerefinery/components/structure/page" - ws:lastModified="{Date}2023-04-27T12:55:34.751+05:30" - ws:lastModifiedBy="wsadmin" - ws:template="/apps/typerefinery/templates/pagewithsidebar"> - <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <aside jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/aside" /> - <header jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/header" /> - <container1 jcr:primaryType="nt:unstructured" +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-04-07T12:28:53.505+05:30" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Tasks" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2023-04-27T12:55:34.751+05:30" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/pagewithsidebar"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <aside + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/aside" + id="aside_NURVEW8ZF"/> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + id="header_RWYN8F7TW"/> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + borderEnabled="false" + classes="\0" + flexEnabled="false" + id="container1_KGV3BGNXQ" + marginEnabled="false" + paddingEnabled="true" + paddingGeneral="two" + persistColorWhenThemeSwitches="false" + title="\0"> + <form1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + borderEnabled="false" + classes="\0" + flexEnabled="true" + flowapi_createdon="2024-01-21T20:13:25.883Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d016gr50d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d016gr50d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/tasks/_jcr_content/rootcontainer/container1/form1" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/tasks/_jcr_content/rootcontainer/container1/form1/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + flowapi_title="Form flow" + flowapi_topic="form_97aad18218134f5f974f40665cd97073" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="form1_TPNBB4Q4I" + marginEnabled="true" + marginTop="three" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + readMethod="GET" + readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/tasks/*" + title="Form flow" + writeMethod="PUT" + writePayloadType="application/json" + writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/tasks/*"> + <container + jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" borderEnabled="false" - classes="\0" + classes="card shadow-md" flexEnabled="false" - id="container1_KGV3BGNXQ" + id="container_7C4ZETHKF" marginEnabled="false" - paddingEnabled="true" - paddingGeneral="two" + paddingEnabled="false" persistColorWhenThemeSwitches="false" + textAlignment="center" title="\0"> - <form1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/forms/form" - borderEnabled="false" - classes="\0" - flexEnabled="true" - flowapi_enable="true" - id="form1_TPNBB4Q4I" - marginEnabled="true" - marginTop="three" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - readMethod="GET" - readUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/tasks/*" - title="Form flow" - writeMethod="PUT" - writePayloadType="application/json" - writeUrl="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/tasks/*"> - <container jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/container" - borderEnabled="false" - classes="card shadow-md" - flexEnabled="false" - id="container_7C4ZETHKF" - marginEnabled="false" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - textAlignment="center" - title="\0"> - <title_1 jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/content/title" - borderEnabled="false" - classes="\0" - headingLevel="h3" - id="title_1_QPCBTVVFX" - marginEnabled="false" - name="\0" - paddingEnabled="false" - persistColorWhenThemeSwitches="false" - title="Task List" /> + <title_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + borderEnabled="false" + classes="\0" + headingLevel="h3" + id="title_1_QPCBTVVFX" + marginEnabled="false" + name="\0" + paddingEnabled="false" + persistColorWhenThemeSwitches="false" + title="Task List"/> </container> - <table jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/widgets/table" - borderEnabled="false" - classes="\0" - dataSource="/apps/typerefinery/components/widgets/table/mock/datasource1.json" - flowapi_enable="true" - id="table_RWZKPV9SC" - marginEnabled="true" - marginTop="three" - multipleSelectRowEnabled="false" - name="formTask" - overRideColumns="{Boolean}true" - paddingEnabled="false" - paginationEnabled="false" - persistColorWhenThemeSwitches="false" - resizableEnabled="false" - searchEnabled="false" - showActionButtons="true" - singleSelectEnabled="false" - uniqueIdColumn="\0" - websocketHost="\0" - websocketTopic="\0"> + <table + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/table" + borderEnabled="false" + classes="\0" + dataSource="/apps/typerefinery/components/widgets/table/mock/datasource1.json" + flowapi_createdon="2024-01-21T20:13:25.883Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff18s3d017gr51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f18s3d017gr51d" + flowapi_group="/content/typerefinery-showcase/pages/os-triage/pages/tasks/_jcr_content/rootcontainer/container1/form1/table" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/os-triage/pages/tasks/_jcr_content/rootcontainer/container1/form1/table/{id}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + flowapi_title="Table flow" + flowapi_topic="table_ab6bdfd982824dff99ff51f62f274afa" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="table_RWZKPV9SC" + marginEnabled="true" + marginTop="three" + multipleSelectRowEnabled="false" + name="formTask" + overRideColumns="{Boolean}true" + paddingEnabled="false" + paginationEnabled="false" + persistColorWhenThemeSwitches="false" + resizableEnabled="false" + searchEnabled="false" + showActionButtons="true" + singleSelectEnabled="false" + uniqueIdColumn="\0" + websocketHost="\0" + websocketTopic="\0"> <actionButtons jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" - actionButtonModalContentURL="/content/typerefinery-showcase/pages/os-triage/forms/addtask.html" - actionButtonNavigateToPath="\0" - icon="pi pi-pencil" - id="0_507VJHQT5" - label="Edit" /> + <_x0030_ + jcr:primaryType="nt:unstructured" + actionButtonModalContentURL="/content/typerefinery-showcase/pages/os-triage/forms/addtask.html" + actionButtonNavigateToPath="\0" + icon="pi pi-pencil" + id="0_507VJHQT5" + label="Edit"/> </actionButtons> <columns jcr:primaryType="nt:unstructured"> - <_x0030_ jcr:primaryType="nt:unstructured" - field="url" - title="URL" - type="LINK" /> + <_x0030_ + jcr:primaryType="nt:unstructured" + field="url" + title="URL" + type="LINK"/> </columns> </table> </form1> </container1> </rootcontainer> </jcr:content> -</jcr:root> \ No newline at end of file +</jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/pages/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/pages/.content.xml index bceb3cb65..73eed2907 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/pages/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/pages/.content.xml @@ -2,13 +2,17 @@ <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:42.753+11:00" + jcr:lastModifiedBy="sling-package-install" jcr:primaryType="ws:PageContent" jcr:title="Pages" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/page"> <rootcontainer jcr:primaryType="nt:unstructured" - sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - </rootcontainer> + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"/> </jcr:content> + <dashboard/> + <form/> + <report/> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/pages/dashboard/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/pages/dashboard/.content.xml index ac5a0ad10..7dabf97cf 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/pages/dashboard/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/pages/dashboard/.content.xml @@ -1,80 +1,312 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Dashboard" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/pagewithsidebar"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <nav jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/nav" cancelInheritParent="true" backgroundColor="secondary"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" headingLevel="h3" title="Typerefinery.ai" marginEnabled="true" marginBottom="five" marginTop="three" persistColorWhenThemeSwitches="true" textAlignment="center"> - - -
- -
- - - - - - - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 1"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> - - - - - - - - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 1"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> - - - - - - - - <_x0030_ jcr:primaryType="nt:unstructured" key="title" value="Template 1"/> - <_x0031_ jcr:primaryType="nt:unstructured" key="value" value="140K"/> - <_x0032_ jcr:primaryType="nt:unstructured" key="indicatorValue" value="45k"/> - <_x0033_ jcr:primaryType="nt:unstructured" key="indicatorType" value="success"/> - <_x0034_ jcr:primaryType="nt:unstructured" key="tickerIcon" value="pi pi-question-circle"/> - <_x0035_ jcr:primaryType="nt:unstructured" key="indicatorIcon" value="pi pi-arrow-down"/> - <_x0036_ jcr:primaryType="nt:unstructured" key="indicatorPrecisionValue" value="Since March 2023"/> - - - - - - - - - - - - - - - - - - - -
- -
- - - \ No newline at end of file + + + + -
- -
- - - - <input_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter First Name"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" inputType="text" placeholder="Eg. John Henry"/> - </input_1> - <input_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter Last Name"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" inputType="text"/> - </input_2> - <input_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter Email Address"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" inputType="email" placeholder="Eg. test@example.com"/> - </input_2> - <input_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter Phone Number"/> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" inputType="tel" placeholder="Eg. 65412441245"/> - </input_3> - <input_4 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter Date of Birth" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" inputType="date"/> - </input_4> - <input_5 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Enter Password" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" inputType="password" placeholder="Eg. 123456" /> - </input_5> - <input_6 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/input"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Re-type Password" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/input" inputType="password" /> - </input_6> - <select_2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/select"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Select Country Code" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/select" placeholder="Country Code" /> - </select_2> - <checkbox_1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/checkbox"> - <label jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/label" label="Agree Our Terms and Conditions" /> - <field jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/checkbox"/> - </checkbox_1> - <container jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" textAlignment="center"> - <button_1_3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/forms/fields/button" label="Register" buttonType="submit" lgColSize="4"></button_1_3> - </container> - </form1> - </container> - </rootcontainer> - </jcr:content> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:42.886+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Personal Information Form" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/pagewithsidebar"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <nav + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/nav" + backgroundColor="secondary" + cancelInheritParent="true" + id="nav_BVXQDWFKV"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h3" + id="title_WZ7888MBF" + marginBottom="five" + marginEnabled="true" + marginTop="three" + persistColorWhenThemeSwitches="true" + textAlignment="center" + title="Typerefinery.ai"/> + <treeview + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/treeview" + id="treeview_PGUK8Z9RL" + parentPagePath="/content/typerefinery-showcase/pages/pages"/> + </nav> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + backgroundColor="secondary" + cancelInheritParent="true" + id="header_PGLSNZ9WJ" + marginBottom="three" + marginEnabled="true"> + <reference + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/reference" + id="reference_LYVZ42XSN" + path="/content/typerefinery-showcase/pages/content/header/jcr:content/container"/> + </header> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + classes="container" + id="container_RERQRYGD8"> + <form1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/form" + flowapi_sampledata="/apps/typerefinery/components/forms/form/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/forms/form/templates/flowform-service.json" + id="form1_BRDRGQR21" + marginEnabled="true" + marginTop="one"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingSize="h4" + id="title_XQB3VQPW4" + textAlignment="center" + title="General Information"/> + <input_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_1_XOHD4JSWZ"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter First Name"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + inputType="text" + placeholder="Eg. John Henry"/> + </input_1> + <input_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_2_CGYWLBFYB"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter Email Address"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + inputType="email" + placeholder="Eg. test@example.com"/> + </input_2> + <input_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_3_35Y9TWP58"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter Phone Number"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + inputType="tel" + placeholder="Eg. 65412441245"/> + </input_3> + <input_4 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_4_SVZOQ5TJC"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter Date of Birth"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + inputType="date"/> + </input_4> + <input_5 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_5_XJMGQ6AXS"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Enter Password"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + inputType="password" + placeholder="Eg. 123456"/> + </input_5> + <input_6 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/input" + id="input_6_OZJN6H36C"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Re-type Password"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/input" + inputType="password"/> + </input_6> + <select_2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/select" + id="select_2_LJ4GEGM9N"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Select Country Code"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/select" + id="field_ZVYGAPOCS" + placeholder="Country Code"/> + </select_2> + <checkbox_1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/checkbox" + id="checkbox_1_JHPLNZI9G"> + <label + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/label" + label="Agree Our Terms and Conditions"/> + <field + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/checkbox"/> + </checkbox_1> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + id="container_CDCHRHT0Z" + textAlignment="center"> + <button_1_3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/forms/fields/button" + buttonType="submit" + id="button_1_3_5ZSVFKHZT" + label="Register" + lgColSize="4" + persistColorWhenThemeSwitches="{Boolean}true"/> + </container> + </form1> + </container> + </rootcontainer> + </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/pages/report/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/pages/report/.content.xml index ceb3afadd..bc134350f 100644 --- a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/pages/report/.content.xml +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/pages/report/.content.xml @@ -1,30 +1,129 @@ <?xml version="1.0" encoding="UTF-8"?> -<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" - xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:ws="http://ds.pl/websight" - xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="ws:Page"> - <jcr:content jcr:primaryType="ws:PageContent" jcr:title="Reports" sling:resourceType="typerefinery/components/structure/page" ws:template="/apps/typerefinery/templates/pagewithsidebar"> - <rootcontainer jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> - <nav jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/nav" cancelInheritParent="true" backgroundColor="secondary"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" headingLevel="h3" title="Typerefinery.ai" marginEnabled="true" marginBottom="five" marginTop="three" persistColorWhenThemeSwitches="true" textAlignment="center"> - - -
- -
- - - - <table1 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/table" dataSource="/apps/typerefinery/components/widgets/table/mock/datasource2.json" lgColSize="9"/> - </container1> - <container2 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" horizontalAlignment="around"> - <ticker jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/ticker" templateSelected="3" lgColSize="9"></ticker> - </container2> - <container3 jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/layout/container" flexEnabled="true" horizontalAlignment="around"> - <title jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/content/title" title="Users Detail Table With Search Field" lgColSize="12" mdColSize="12" smColSize="12" marginEnabled="true" marginTop="four" marginBottom="two" textAlignment="center"/> - <table jcr:primaryType="nt:unstructured" sling:resourceType="typerefinery/components/widgets/table" lgColSize="9"/> - </container3> - </container> - </rootcontainer> - </jcr:content> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2023-11-19T07:02:42.947+11:00" + jcr:lastModifiedBy="sling-package-install" + jcr:primaryType="ws:PageContent" + jcr:title="Reports" + sling:resourceType="typerefinery/components/structure/page" + ws:template="/apps/typerefinery/templates/pagewithsidebar"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/fixedrootcontainer"> + <nav + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/nav" + backgroundColor="secondary" + cancelInheritParent="true" + id="nav_XGMRLATQ7"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + headingLevel="h3" + id="title_TAMKKJ5R3" + marginBottom="five" + marginEnabled="true" + marginTop="three" + persistColorWhenThemeSwitches="true" + textAlignment="center" + title="Typerefinery.ai"/> + <treeview + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/treeview" + id="treeview_XF9XRNBZV" + parentPagePath="/content/typerefinery-showcase/pages/pages"/> + </nav> + <header + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/header" + backgroundColor="secondary" + cancelInheritParent="true" + id="header_TVXQ3MSQM" + marginBottom="three" + marginEnabled="true"> + <reference + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/reference" + id="reference_IBIIRULH4" + path="/content/typerefinery-showcase/pages/content/header/jcr:content/container"/> + </header> + <container + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + id="container_PWYSWZSZK"> + <container1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + horizontalAlignment="around" + id="container1_C1POM3KZB"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + id="title_KBEBF0YNZ" + lgColSize="12" + marginBottom="two" + marginEnabled="true" + marginTop="one" + mdColSize="12" + smColSize="12" + textAlignment="center" + title="Security Threat Index"/> + <table1 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/table" + dataSource="/apps/typerefinery/components/widgets/table/mock/datasource2.json" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + id="table1_TALBTM2WB" + lgColSize="9" + overRideColumns="{Boolean}true"/> + </container1> + <container2 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + horizontalAlignment="around" + id="container2_MNZDZDUAE"> + <ticker + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/ticker" + flowapi_sampledata="/apps/typerefinery/components/widgets/ticker/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/ticker/templates/ticker.json" + id="ticker_NQRQSJ1TO" + lgColSize="9" + templateSelected="3"/> + </container2> + <container3 + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/container" + flexEnabled="true" + horizontalAlignment="around" + id="container3_XLP0FJLVD"> + <title + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/title" + id="title_LAN8XOUGI" + lgColSize="12" + marginBottom="two" + marginEnabled="true" + marginTop="four" + mdColSize="12" + smColSize="12" + textAlignment="center" + title="Users Detail Table With Search Field"/> + <table + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/table" + flowapi_sampledata="/apps/typerefinery/components/widgets/table/templates/flowsample.json" + flowapi_template="/apps/typerefinery/components/widgets/table/templates/table.json" + id="table_KLTWIJBKC" + lgColSize="9" + overRideColumns="{Boolean}true"/> + </container3> + </container> + </rootcontainer> + </jcr:content> </jcr:root> diff --git a/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/test/.content.xml b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/test/.content.xml new file mode 100644 index 000000000..c7e380b12 --- /dev/null +++ b/tests/content/src/main/content/jcr_root/content/typerefinery-showcase/pages/test/.content.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ws="http://ds.pl/websight" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + jcr:primaryType="ws:Page"> + <jcr:content + jcr:lastModified="{Date}2024-02-08T10:17:32.662+11:00" + jcr:lastModifiedBy="wsadmin" + jcr:primaryType="ws:PageContent" + jcr:title="Test" + sling:resourceType="typerefinery/components/structure/page" + ws:lastModified="{Date}2024-02-08T10:20:10.179+11:00" + ws:lastModifiedBy="wsadmin" + ws:template="/apps/typerefinery/templates/blank" + description="\0" + hideInNav="false" + icon="\0" + ogDescription="\0" + ogTitle="\0" + ogUrl="\0" + propertyTitle="\0"> + <rootcontainer + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/layout/rootcontainer" + decorationTagName="main"> + <text + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/content/text" + classes="\0" + id="text_9FW0VMQ2C" + markdown="\0" + name="\0" + paragraphMode="false" + text="<p>Sample text!</p>"/> + <stix + jcr:primaryType="nt:unstructured" + sling:resourceType="typerefinery/components/widgets/security/stix" + flowapi_createdon="2024-02-07T23:20:11.383Z" + flowapi_designtemplate="\0" + flowapi_editurl="https://flow.typerefinery.localhost:8101/designer/?darkmode=0&socket=wss%3A%2F%2Fflow.typerefinery.localhost%3A8101%2Fflows%2Ff19b4j001tj51d&components=" + flowapi_enable="true" + flowapi_error="null" + flowapi_flowstreamid="f19b4j001tj51d" + flowapi_group="/content/typerefinery-showcase/pages/test/_jcr_content/rootcontainer/stix" + flowapi_httproute="https://flow.typerefinery.localhost:8101/content/typerefinery-showcase/pages/test/_jcr_content/rootcontainer/stix/{{id}}" + flowapi_iscontainer="{Boolean}false" + flowapi_sampledata="/apps/typerefinery/components/widgets/security/stix/templates/flowsample.json" + flowapi_success="true" + flowapi_template="/apps/typerefinery/components/widgets/security/stix/templates/stix.json" + flowapi_title="Stix flow" + flowapi_topic="stix_c250212cb9aa404385b5e688782d184e" + flowapi_websocketurl="wss://tms.typerefinery.localhost:8101/$tms" + id="stix_8VUFC3JXR"/> + </rootcontainer> + </jcr:content> +</jcr:root> From 2213ecaaa879338723e4b61bb6cee1e5e6eaba1b Mon Sep 17 00:00:00 2001 From: wildone <max.barrass@gmail.com> Date: Thu, 10 Oct 2024 23:09:53 +1100 Subject: [PATCH 206/206] add sample content. --- tests/content/src/main/content/META-INF/vault/filter.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/content/src/main/content/META-INF/vault/filter.xml b/tests/content/src/main/content/META-INF/vault/filter.xml index 3a371c839..7a584c535 100644 --- a/tests/content/src/main/content/META-INF/vault/filter.xml +++ b/tests/content/src/main/content/META-INF/vault/filter.xml @@ -17,4 +17,5 @@ <workspaceFilter version="1.0"> <filter root="/content/typerefinery-showcase"/> + <filter root="/content/os-triage"/> </workspaceFilter>