@umbraco-ui/uui-ref-node-form 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +43 -0
- package/custom-elements.json +126 -0
- package/dist/uui-ref-node-form.min.js +2 -0
- package/dist/uui-ref-node-form.min.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +12 -0
- package/lib/uui-ref-node-form.element.d.ts +12 -0
- package/lib/uui-ref-node-form.element.js +11 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 uui-app
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# uui-ref-node-form
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Umbraco style ref-node-form component.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
### ES imports
|
|
10
|
+
|
|
11
|
+
```zsh
|
|
12
|
+
npm i @umbraco-ui/uui-ref-node-form
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Import the registration of `<uui-ref-node-form>` via:
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
import '@umbraco-ui/uui-ref-node-form/lib';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
When looking to leverage the `UUIRefNodeFormElement` base class as a type and/or for extension purposes, do so via:
|
|
22
|
+
|
|
23
|
+
```javascript
|
|
24
|
+
import { UUIRefNodeFormElement } from '@umbraco-ui/uui-ref-node-form/lib/uui-ref-node-form.element';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### CDN
|
|
28
|
+
|
|
29
|
+
The component is available via CDN. This means it can be added to your application without the need of any bundler configuration. Here is how to use it with jsDelivr.
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<!-- Latest Version -->
|
|
33
|
+
<script src="https://cdn.jsdelivr.net/npm/@umbraco-ui/uui-ref-node-form@latest/dist/uui-ref-node-form.min.js"></script>
|
|
34
|
+
|
|
35
|
+
<!-- Specific version -->
|
|
36
|
+
<script src="https://cdn.jsdelivr.net/npm/@umbraco-ui/uui-ref-node-form@X.X.X/dist/uui-ref-node-form.min.js"></script>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<uui-ref-node-form></uui-ref-node-form>
|
|
43
|
+
```
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "experimental",
|
|
3
|
+
"tags": [
|
|
4
|
+
{
|
|
5
|
+
"name": "uui-ref-node-form",
|
|
6
|
+
"path": "./lib/uui-ref-node-form.element.ts",
|
|
7
|
+
"attributes": [
|
|
8
|
+
{
|
|
9
|
+
"name": "name",
|
|
10
|
+
"description": "Node name",
|
|
11
|
+
"type": "string",
|
|
12
|
+
"default": "\"''\""
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "detail",
|
|
16
|
+
"description": "Node details",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"default": "\"''\""
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "disabled",
|
|
22
|
+
"description": "Set tot true to disable",
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"default": "\"false\""
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "error",
|
|
28
|
+
"description": "Set to true to display error state",
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"default": "\"false\""
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "selectable",
|
|
34
|
+
"description": "Set to true if you want to be able to select this particular element on.",
|
|
35
|
+
"type": "boolean"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "selected",
|
|
39
|
+
"description": "Attribute applied when the element is selected.",
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"default": "false"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"properties": [
|
|
45
|
+
{
|
|
46
|
+
"name": "name",
|
|
47
|
+
"attribute": "name",
|
|
48
|
+
"description": "Node name",
|
|
49
|
+
"type": "string",
|
|
50
|
+
"default": "\"''\""
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "detail",
|
|
54
|
+
"attribute": "detail",
|
|
55
|
+
"description": "Node details",
|
|
56
|
+
"type": "string",
|
|
57
|
+
"default": "\"''\""
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "styles",
|
|
61
|
+
"type": "CSSResult[]",
|
|
62
|
+
"default": "[null]"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "disabled",
|
|
66
|
+
"attribute": "disabled",
|
|
67
|
+
"description": "Set tot true to disable",
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"default": "\"false\""
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "error",
|
|
73
|
+
"attribute": "error",
|
|
74
|
+
"description": "Set to true to display error state",
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"default": "\"false\""
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "selectable",
|
|
80
|
+
"attribute": "selectable",
|
|
81
|
+
"description": "Set to true if you want to be able to select this particular element on.",
|
|
82
|
+
"type": "boolean"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "selected",
|
|
86
|
+
"attribute": "selected",
|
|
87
|
+
"description": "Attribute applied when the element is selected.",
|
|
88
|
+
"type": "boolean",
|
|
89
|
+
"default": "false"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"events": [
|
|
93
|
+
{
|
|
94
|
+
"name": "open",
|
|
95
|
+
"description": "fires when the ref title is clicked"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "selected",
|
|
99
|
+
"description": "fires when the ref is selected"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "unselected",
|
|
103
|
+
"description": "fires when the ref is unselected"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"slots": [
|
|
107
|
+
{
|
|
108
|
+
"name": "",
|
|
109
|
+
"description": "for content"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "icon",
|
|
113
|
+
"description": "for an icon"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "tag",
|
|
117
|
+
"description": "for a tag"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "actions",
|
|
121
|
+
"description": "for actions"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(require("@umbraco-ui/uui-ref-node/lib/uui-ref-node.element")):typeof define=="function"&&define.amd?define(["@umbraco-ui/uui-ref-node/lib/uui-ref-node.element"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e.uuiRefNode_element))})(this,function(e){"use strict";class t extends e.UUIRefNodeElement{constructor(){super(...arguments);this.fallbackIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M444.72 215.28H67.28c-11.04 0-20-8.96-20-20V64.896c0-11.04 8.96-20 20-20h377.44c11.04 0 20 8.96 20 20V195.28c0 11.056-8.96 20-20 20zm-357.44-40h337.44V84.896H87.28v90.384zm185.504 215.696c0-6.848.704-13.504 1.936-20H87.28v-90.384h337.44v12.496a108.098 108.098 0 0140 31.36v-63.856c0-11.04-8.96-20-20-20H67.28c-11.04 0-20 8.96-20 20v130.384c0 11.04 8.96 20 20 20h207.44c-1.232-6.496-1.936-13.152-1.936-20zm107.552-76.128c-41.968 0-76.112 34.16-76.112 76.128s34.144 76.128 76.112 76.128 76.128-34.16 76.128-76.128-34.144-76.128-76.128-76.128zm46.016 80.464a7.293 7.293 0 01-7.296 7.296h-27.072v27.088a7.293 7.293 0 01-7.296 7.296H376a7.293 7.293 0 01-7.296-7.296v-27.088h-27.072a7.293 7.293 0 01-7.296-7.296v-8.672a7.293 7.293 0 017.296-7.296h27.072v-27.088A7.293 7.293 0 01376 344.96h8.688a7.293 7.293 0 017.296 7.296v27.088h27.072a7.293 7.293 0 017.296 7.296v8.672z"></path></svg>'}}t.styles=[...e.UUIRefNodeElement.styles],((n,s,o)=>{if(n.indexOf("-")>0===!1){console.error(`${n} is not a valid custom element name. A custom element name should consist of at least two words separated by a hyphen.`);return}customElements.get(n)?console.error(`${n} is already defined`):customElements.define(n,s,o)})("uui-ref-node-form",t)});
|
|
2
|
+
//# sourceMappingURL=uui-ref-node-form.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uui-ref-node-form.min.js","sources":["../lib/uui-ref-node-form.element.js","../lib/index.ts","../../uui-base/lib/registration/index.js"],"sourcesContent":["import { UUIRefNodeElement } from '@umbraco-ui/uui-ref-node/lib/uui-ref-node.element';\n\nclass UUIRefNodeFormElement extends UUIRefNodeElement {\n constructor() {\n super(...arguments);\n this.fallbackIcon = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M444.72 215.28H67.28c-11.04 0-20-8.96-20-20V64.896c0-11.04 8.96-20 20-20h377.44c11.04 0 20 8.96 20 20V195.28c0 11.056-8.96 20-20 20zm-357.44-40h337.44V84.896H87.28v90.384zm185.504 215.696c0-6.848.704-13.504 1.936-20H87.28v-90.384h337.44v12.496a108.098 108.098 0 0140 31.36v-63.856c0-11.04-8.96-20-20-20H67.28c-11.04 0-20 8.96-20 20v130.384c0 11.04 8.96 20 20 20h207.44c-1.232-6.496-1.936-13.152-1.936-20zm107.552-76.128c-41.968 0-76.112 34.16-76.112 76.128s34.144 76.128 76.112 76.128 76.128-34.16 76.128-76.128-34.144-76.128-76.128-76.128zm46.016 80.464a7.293 7.293 0 01-7.296 7.296h-27.072v27.088a7.293 7.293 0 01-7.296 7.296H376a7.293 7.293 0 01-7.296-7.296v-27.088h-27.072a7.293 7.293 0 01-7.296-7.296v-8.672a7.293 7.293 0 017.296-7.296h27.072v-27.088A7.293 7.293 0 01376 344.96h8.688a7.293 7.293 0 017.296 7.296v27.088h27.072a7.293 7.293 0 017.296 7.296v8.672z\"></path></svg>';\n }\n}\nUUIRefNodeFormElement.styles = [...UUIRefNodeElement.styles];\n\nexport { UUIRefNodeFormElement };\n","import { UUIRefNodeFormElement } from './uui-ref-node-form.element';\nimport { defineElement } from '@umbraco-ui/uui-base/lib/registration';\n\ndefineElement('uui-ref-node-form', UUIRefNodeFormElement as any);\n","const defineElement = (name, constructor, options) => {\n const isValidElementName = name.indexOf(\"-\") > 0;\n if (isValidElementName === false) {\n console.error(`${name} is not a valid custom element name. A custom element name should consist of at least two words separated by a hyphen.`);\n return;\n }\n if (customElements.get(name)) {\n console.error(`${name} is already defined`);\n } else {\n customElements.define(name, constructor, options);\n }\n};\n\nexport { defineElement };\n"],"names":["UUIRefNodeElement"],"mappings":"wVAEA,eAAoCA,oBAAkB,CACpD,aAAc,OACN,GAAG,gBACJ,aAAe,27BAGxB,EAAsB,OAAS,CAAC,GAAGA,oBAAkB,QCLrD,ACHsB,EAAC,EAAM,EAAa,IAAY,IAEhD,AADuB,EAAK,QAAQ,KAAO,IACpB,GAAO,SACxB,MAAM,GAAG,kIAGf,eAAe,IAAI,WACb,MAAM,GAAG,uCAEF,OAAO,EAAM,EAAa,KDN/B,oBAAqB"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UUIRefNodeElement } from '@umbraco-ui/uui-ref-node/lib/uui-ref-node.element';
|
|
2
|
+
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
|
|
3
|
+
|
|
4
|
+
class UUIRefNodeFormElement extends UUIRefNodeElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.fallbackIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M444.72 215.28H67.28c-11.04 0-20-8.96-20-20V64.896c0-11.04 8.96-20 20-20h377.44c11.04 0 20 8.96 20 20V195.28c0 11.056-8.96 20-20 20zm-357.44-40h337.44V84.896H87.28v90.384zm185.504 215.696c0-6.848.704-13.504 1.936-20H87.28v-90.384h337.44v12.496a108.098 108.098 0 0140 31.36v-63.856c0-11.04-8.96-20-20-20H67.28c-11.04 0-20 8.96-20 20v130.384c0 11.04 8.96 20 20 20h207.44c-1.232-6.496-1.936-13.152-1.936-20zm107.552-76.128c-41.968 0-76.112 34.16-76.112 76.128s34.144 76.128 76.112 76.128 76.128-34.16 76.128-76.128-34.144-76.128-76.128-76.128zm46.016 80.464a7.293 7.293 0 01-7.296 7.296h-27.072v27.088a7.293 7.293 0 01-7.296 7.296H376a7.293 7.293 0 01-7.296-7.296v-27.088h-27.072a7.293 7.293 0 01-7.296-7.296v-8.672a7.293 7.293 0 017.296-7.296h27.072v-27.088A7.293 7.293 0 01376 344.96h8.688a7.293 7.293 0 017.296 7.296v27.088h27.072a7.293 7.293 0 017.296 7.296v8.672z"></path></svg>';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
UUIRefNodeFormElement.styles = [...UUIRefNodeElement.styles];
|
|
11
|
+
|
|
12
|
+
defineElement("uui-ref-node-form", UUIRefNodeFormElement);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UUIRefNodeElement } from '@umbraco-ui/uui-ref-node/lib/uui-ref-node.element';
|
|
2
|
+
/**
|
|
3
|
+
* @element uui-ref-node-form
|
|
4
|
+
* @fires {UUIRefEvent} open - fires when the ref title is clicked
|
|
5
|
+
* @fires {UUIRefEvent} selected - fires when the ref is selected
|
|
6
|
+
* @fires {UUIRefEvent} unselected - fires when the ref is unselected
|
|
7
|
+
* @description - Component for displaying a reference to a form node.
|
|
8
|
+
*/
|
|
9
|
+
export declare class UUIRefNodeFormElement extends UUIRefNodeElement {
|
|
10
|
+
static styles: import("lit").CSSResult[];
|
|
11
|
+
protected fallbackIcon: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UUIRefNodeElement } from '@umbraco-ui/uui-ref-node/lib/uui-ref-node.element';
|
|
2
|
+
|
|
3
|
+
class UUIRefNodeFormElement extends UUIRefNodeElement {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
this.fallbackIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M444.72 215.28H67.28c-11.04 0-20-8.96-20-20V64.896c0-11.04 8.96-20 20-20h377.44c11.04 0 20 8.96 20 20V195.28c0 11.056-8.96 20-20 20zm-357.44-40h337.44V84.896H87.28v90.384zm185.504 215.696c0-6.848.704-13.504 1.936-20H87.28v-90.384h337.44v12.496a108.098 108.098 0 0140 31.36v-63.856c0-11.04-8.96-20-20-20H67.28c-11.04 0-20 8.96-20 20v130.384c0 11.04 8.96 20 20 20h207.44c-1.232-6.496-1.936-13.152-1.936-20zm107.552-76.128c-41.968 0-76.112 34.16-76.112 76.128s34.144 76.128 76.112 76.128 76.128-34.16 76.128-76.128-34.144-76.128-76.128-76.128zm46.016 80.464a7.293 7.293 0 01-7.296 7.296h-27.072v27.088a7.293 7.293 0 01-7.296 7.296H376a7.293 7.293 0 01-7.296-7.296v-27.088h-27.072a7.293 7.293 0 01-7.296-7.296v-8.672a7.293 7.293 0 017.296-7.296h27.072v-27.088A7.293 7.293 0 01376 344.96h8.688a7.293 7.293 0 017.296 7.296v27.088h27.072a7.293 7.293 0 017.296 7.296v8.672z"></path></svg>';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
UUIRefNodeFormElement.styles = [...UUIRefNodeElement.styles];
|
|
10
|
+
|
|
11
|
+
export { UUIRefNodeFormElement };
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@umbraco-ui/uui-ref-node-form",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Umbraco",
|
|
7
|
+
"Custom elements",
|
|
8
|
+
"Web components",
|
|
9
|
+
"UI",
|
|
10
|
+
"Lit",
|
|
11
|
+
"Reference Form node"
|
|
12
|
+
],
|
|
13
|
+
"description": "Umbraco UI ref-node-form component",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/umbraco/Umbraco.UI.git",
|
|
17
|
+
"directory": "packages/uui-ref-node-form"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/umbraco/Umbraco.UI/issues"
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/uui-ref-node-form.min.js",
|
|
23
|
+
"module": "./lib/index.js",
|
|
24
|
+
"customElements": "custom-elements.json",
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"lib/**/*.d.ts",
|
|
28
|
+
"lib/**/*.js",
|
|
29
|
+
"custom-elements.json"
|
|
30
|
+
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@umbraco-ui/uui-base": "0.0.14"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@umbraco-ui/uui-ref-node": "~0.0.0"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
|
|
39
|
+
"clean": "tsc --build --clean && rimraf dist lib/*.js lib/**/*.js custom-elements.json",
|
|
40
|
+
"analyze": "web-component-analyzer **/*.element.ts --outFile custom-elements.json"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://uui.umbraco.com/?path=/story/uui-ref-node-form",
|
|
46
|
+
"gitHead": "27d48bb352dcac2b08d55958ecba92b28c11d957"
|
|
47
|
+
}
|