@kubex/zinc 1.1.113 → 1.1.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +74 -74
- package/dist/vscode.html-custom-data.json +11 -11
- package/dist/web-types.json +23 -23
- package/dist/zn.min.js +2 -2
- package/package.json +1 -1
- package/src/components/cols/cols.scss +6 -1
- package/src/components/priority-list/priority-list.component.ts +9 -6
- package/src/components/priority-list/priority-list.test.ts +34 -0
|
@@ -56,6 +56,79 @@
|
|
|
56
56
|
}
|
|
57
57
|
]
|
|
58
58
|
},
|
|
59
|
+
{
|
|
60
|
+
"kind": "javascript-module",
|
|
61
|
+
"path": "components/action-bar/action-bar.js",
|
|
62
|
+
"declarations": [
|
|
63
|
+
{
|
|
64
|
+
"kind": "class",
|
|
65
|
+
"description": "",
|
|
66
|
+
"name": "ZnActionBar",
|
|
67
|
+
"cssProperties": [
|
|
68
|
+
{
|
|
69
|
+
"description": "An example CSS custom property.",
|
|
70
|
+
"name": "--example"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"cssParts": [
|
|
74
|
+
{
|
|
75
|
+
"description": "The component's base wrapper.",
|
|
76
|
+
"name": "base"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"slots": [
|
|
80
|
+
{
|
|
81
|
+
"description": "The default slot.",
|
|
82
|
+
"name": ""
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"description": "An example slot.",
|
|
86
|
+
"name": "example"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"members": [
|
|
90
|
+
{
|
|
91
|
+
"kind": "field",
|
|
92
|
+
"name": "localize",
|
|
93
|
+
"privacy": "private",
|
|
94
|
+
"readonly": true,
|
|
95
|
+
"default": "new LocalizeController(this)"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"events": [
|
|
99
|
+
{
|
|
100
|
+
"description": "Emitted as an example.",
|
|
101
|
+
"name": "zn-event-name"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"superclass": {
|
|
105
|
+
"name": "ZincElement",
|
|
106
|
+
"module": "/src/internal/zinc-element"
|
|
107
|
+
},
|
|
108
|
+
"summary": "Short summary of the component's intended use.",
|
|
109
|
+
"tagNameWithoutPrefix": "action-bar",
|
|
110
|
+
"tagName": "zn-action-bar",
|
|
111
|
+
"customElement": true,
|
|
112
|
+
"jsDoc": "/**\n * @summary Short summary of the component's intended use.\n * @documentation https://zinc.style/components/action-bar\n * @status experimental\n * @since 1.0\n *\n * @dependency zn-example\n *\n * @event zn-event-name - Emitted as an example.\n *\n * @slot - The default slot.\n * @slot example - An example slot.\n *\n * @csspart base - The component's base wrapper.\n *\n * @cssproperty --example - An example CSS custom property.\n */",
|
|
113
|
+
"documentation": "https://zinc.style/components/action-bar",
|
|
114
|
+
"status": "experimental",
|
|
115
|
+
"since": "1.0",
|
|
116
|
+
"dependencies": [
|
|
117
|
+
"zn-example"
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"exports": [
|
|
122
|
+
{
|
|
123
|
+
"kind": "js",
|
|
124
|
+
"name": "default",
|
|
125
|
+
"declaration": {
|
|
126
|
+
"name": "ZnActionBar",
|
|
127
|
+
"module": "components/action-bar/action-bar.js"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
},
|
|
59
132
|
{
|
|
60
133
|
"kind": "javascript-module",
|
|
61
134
|
"path": "components/alert/alert.js",
|
|
@@ -250,79 +323,6 @@
|
|
|
250
323
|
}
|
|
251
324
|
]
|
|
252
325
|
},
|
|
253
|
-
{
|
|
254
|
-
"kind": "javascript-module",
|
|
255
|
-
"path": "components/action-bar/action-bar.js",
|
|
256
|
-
"declarations": [
|
|
257
|
-
{
|
|
258
|
-
"kind": "class",
|
|
259
|
-
"description": "",
|
|
260
|
-
"name": "ZnActionBar",
|
|
261
|
-
"cssProperties": [
|
|
262
|
-
{
|
|
263
|
-
"description": "An example CSS custom property.",
|
|
264
|
-
"name": "--example"
|
|
265
|
-
}
|
|
266
|
-
],
|
|
267
|
-
"cssParts": [
|
|
268
|
-
{
|
|
269
|
-
"description": "The component's base wrapper.",
|
|
270
|
-
"name": "base"
|
|
271
|
-
}
|
|
272
|
-
],
|
|
273
|
-
"slots": [
|
|
274
|
-
{
|
|
275
|
-
"description": "The default slot.",
|
|
276
|
-
"name": ""
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
"description": "An example slot.",
|
|
280
|
-
"name": "example"
|
|
281
|
-
}
|
|
282
|
-
],
|
|
283
|
-
"members": [
|
|
284
|
-
{
|
|
285
|
-
"kind": "field",
|
|
286
|
-
"name": "localize",
|
|
287
|
-
"privacy": "private",
|
|
288
|
-
"readonly": true,
|
|
289
|
-
"default": "new LocalizeController(this)"
|
|
290
|
-
}
|
|
291
|
-
],
|
|
292
|
-
"events": [
|
|
293
|
-
{
|
|
294
|
-
"description": "Emitted as an example.",
|
|
295
|
-
"name": "zn-event-name"
|
|
296
|
-
}
|
|
297
|
-
],
|
|
298
|
-
"superclass": {
|
|
299
|
-
"name": "ZincElement",
|
|
300
|
-
"module": "/src/internal/zinc-element"
|
|
301
|
-
},
|
|
302
|
-
"summary": "Short summary of the component's intended use.",
|
|
303
|
-
"tagNameWithoutPrefix": "action-bar",
|
|
304
|
-
"tagName": "zn-action-bar",
|
|
305
|
-
"customElement": true,
|
|
306
|
-
"jsDoc": "/**\n * @summary Short summary of the component's intended use.\n * @documentation https://zinc.style/components/action-bar\n * @status experimental\n * @since 1.0\n *\n * @dependency zn-example\n *\n * @event zn-event-name - Emitted as an example.\n *\n * @slot - The default slot.\n * @slot example - An example slot.\n *\n * @csspart base - The component's base wrapper.\n *\n * @cssproperty --example - An example CSS custom property.\n */",
|
|
307
|
-
"documentation": "https://zinc.style/components/action-bar",
|
|
308
|
-
"status": "experimental",
|
|
309
|
-
"since": "1.0",
|
|
310
|
-
"dependencies": [
|
|
311
|
-
"zn-example"
|
|
312
|
-
]
|
|
313
|
-
}
|
|
314
|
-
],
|
|
315
|
-
"exports": [
|
|
316
|
-
{
|
|
317
|
-
"kind": "js",
|
|
318
|
-
"name": "default",
|
|
319
|
-
"declaration": {
|
|
320
|
-
"name": "ZnActionBar",
|
|
321
|
-
"module": "components/action-bar/action-bar.js"
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
]
|
|
325
|
-
},
|
|
326
326
|
{
|
|
327
327
|
"kind": "javascript-module",
|
|
328
328
|
"path": "components/animated-button/animated-button.js",
|
|
@@ -50889,7 +50889,7 @@
|
|
|
50889
50889
|
"package": {
|
|
50890
50890
|
"name": "@kubex/zinc",
|
|
50891
50891
|
"description": "A collection of web components for building web applications based off of @shoelace-style/Shoelace",
|
|
50892
|
-
"version": "1.1.
|
|
50892
|
+
"version": "1.1.115",
|
|
50893
50893
|
"author": "",
|
|
50894
50894
|
"license": "MIT"
|
|
50895
50895
|
}
|
|
@@ -13,6 +13,17 @@
|
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
"name": "zn-action-bar",
|
|
18
|
+
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
19
|
+
"attributes": [],
|
|
20
|
+
"references": [
|
|
21
|
+
{
|
|
22
|
+
"name": "Documentation",
|
|
23
|
+
"url": "https://zinc.style/components/action-bar"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
16
27
|
{
|
|
17
28
|
"name": "zn-alert",
|
|
18
29
|
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
@@ -53,17 +64,6 @@
|
|
|
53
64
|
}
|
|
54
65
|
]
|
|
55
66
|
},
|
|
56
|
-
{
|
|
57
|
-
"name": "zn-action-bar",
|
|
58
|
-
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
59
|
-
"attributes": [],
|
|
60
|
-
"references": [
|
|
61
|
-
{
|
|
62
|
-
"name": "Documentation",
|
|
63
|
-
"url": "https://zinc.style/components/action-bar"
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
},
|
|
67
67
|
{
|
|
68
68
|
"name": "zn-animated-button",
|
|
69
69
|
"description": "\n---\n\n\n### **Methods:**\n - **purchase(): _void_** - Programmatically trigger the purchase flow\n- **setSuccess(): _void_** - Set the button to success state manually\n- **setFailure(message): _void_** - Set the button to failure state manually with optional error message\n- **reset(): _void_** - Reset the button to idle state",
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@kubex/zinc",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.115",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -15,6 +15,28 @@
|
|
|
15
15
|
"events": [],
|
|
16
16
|
"js": { "properties": [], "events": [] }
|
|
17
17
|
},
|
|
18
|
+
{
|
|
19
|
+
"name": "zn-action-bar",
|
|
20
|
+
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
21
|
+
"doc-url": "",
|
|
22
|
+
"attributes": [],
|
|
23
|
+
"slots": [
|
|
24
|
+
{ "name": "", "description": "The default slot." },
|
|
25
|
+
{ "name": "example", "description": "An example slot." }
|
|
26
|
+
],
|
|
27
|
+
"events": [
|
|
28
|
+
{ "name": "zn-event-name", "description": "Emitted as an example." }
|
|
29
|
+
],
|
|
30
|
+
"js": {
|
|
31
|
+
"properties": [],
|
|
32
|
+
"events": [
|
|
33
|
+
{
|
|
34
|
+
"name": "zn-event-name",
|
|
35
|
+
"description": "Emitted as an example."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
18
40
|
{
|
|
19
41
|
"name": "zn-alert",
|
|
20
42
|
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
@@ -83,28 +105,6 @@
|
|
|
83
105
|
]
|
|
84
106
|
}
|
|
85
107
|
},
|
|
86
|
-
{
|
|
87
|
-
"name": "zn-action-bar",
|
|
88
|
-
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
89
|
-
"doc-url": "",
|
|
90
|
-
"attributes": [],
|
|
91
|
-
"slots": [
|
|
92
|
-
{ "name": "", "description": "The default slot." },
|
|
93
|
-
{ "name": "example", "description": "An example slot." }
|
|
94
|
-
],
|
|
95
|
-
"events": [
|
|
96
|
-
{ "name": "zn-event-name", "description": "Emitted as an example." }
|
|
97
|
-
],
|
|
98
|
-
"js": {
|
|
99
|
-
"properties": [],
|
|
100
|
-
"events": [
|
|
101
|
-
{
|
|
102
|
-
"name": "zn-event-name",
|
|
103
|
-
"description": "Emitted as an example."
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
108
|
{
|
|
109
109
|
"name": "zn-animated-button",
|
|
110
110
|
"description": "\n---\n\n\n### **Methods:**\n - **purchase(): _void_** - Programmatically trigger the purchase flow\n- **setSuccess(): _void_** - Set the button to success state manually\n- **setFailure(message): _void_** - Set the button to failure state manually with optional error message\n- **reset(): _void_** - Reset the button to idle state",
|
package/dist/zn.min.js
CHANGED
|
@@ -1072,7 +1072,7 @@ import{a as Bn,b as s3,c as zr,d as c,e as V}from"./chunks/zn.UBLZO6CI.js";var L
|
|
|
1072
1072
|
</zn-menu-item>`})}
|
|
1073
1073
|
</zn-menu>
|
|
1074
1074
|
</zn-dropdown>
|
|
1075
|
-
</td>`}};we.styles=[z(hs),z(h0)],we.dependencies={"zn-alert":Su,"zn-button":_e,"zn-empty-state":Fu,"zn-chip":Rl,"zn-hover-container":Bu,"zn-dropdown":jt,"zn-menu":gi,"zn-menu-item":rn,"zn-button-group":Gn,"zn-confirm":Pl,"zn-skeleton":Vu,"zn-style":Uu,"zn-data-table-search":Hu},c([p({attribute:"data-uri"})],we.prototype,"dataUri",2),c([p({attribute:"data",type:Object})],we.prototype,"data",2),c([p({attribute:"sort-column"})],we.prototype,"sortColumn",2),c([p({attribute:"sort-direction"})],we.prototype,"sortDirection",2),c([p({attribute:"local-sort",type:Boolean})],we.prototype,"localSort",2),c([p({attribute:"filter"})],we.prototype,"filter",2),c([p({attribute:"search"})],we.prototype,"search",2),c([p({attribute:"wide-column"})],we.prototype,"wideColumn",2),c([p({attribute:"key"})],we.prototype,"key",2),c([p({attribute:"headers",type:Object})],we.prototype,"headers",2),c([p({attribute:!1})],we.prototype,"displayTemplates",2),c([p({attribute:"hide-headers",type:Object})],we.prototype,"hiddenHeaders",2),c([p({attribute:"hide-columns",type:Object})],we.prototype,"hiddenColumns",2),c([p({attribute:"unsortable-headers",type:Object})],we.prototype,"unsortableHeaders",2),c([p({attribute:"unsortable",type:Boolean})],we.prototype,"unsortable",2),c([p({attribute:"hide-pagination",type:Boolean})],we.prototype,"hidePagination",2),c([p({type:Boolean})],we.prototype,"standalone",2),c([p()],we.prototype,"caption",2),c([p({attribute:"empty-state-caption"})],we.prototype,"emptyStateCaption",2),c([p({attribute:"empty-state-icon"})],we.prototype,"emptyStateIcon",2),c([p({attribute:"hide-checkboxes",type:Boolean})],we.prototype,"hideCheckboxes",2),c([p()],we.prototype,"filters",2),c([p()],we.prototype,"method",2),c([p({attribute:"no-initial-load",type:Boolean})],we.prototype,"noInitialLoad",2),c([p({attribute:"group-by"})],we.prototype,"groupBy",2),c([p()],we.prototype,"groups",2),c([p({attribute:"per-page-size",type:Number})],we.prototype,"itemsPerPage",2),c([F("#select-all-rows")],we.prototype,"selectAllButton",2);var d4=we;we.define("zn-data-table");var m0=_`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;--zn-col-basis:250px;--col-width:23%}:host([contents]){display:contents}.cols{display:flex;flex-wrap:wrap;flex-grow:1;flex-shrink:1;width:100%;container-type:inline-size;
|
|
1075
|
+
</td>`}};we.styles=[z(hs),z(h0)],we.dependencies={"zn-alert":Su,"zn-button":_e,"zn-empty-state":Fu,"zn-chip":Rl,"zn-hover-container":Bu,"zn-dropdown":jt,"zn-menu":gi,"zn-menu-item":rn,"zn-button-group":Gn,"zn-confirm":Pl,"zn-skeleton":Vu,"zn-style":Uu,"zn-data-table-search":Hu},c([p({attribute:"data-uri"})],we.prototype,"dataUri",2),c([p({attribute:"data",type:Object})],we.prototype,"data",2),c([p({attribute:"sort-column"})],we.prototype,"sortColumn",2),c([p({attribute:"sort-direction"})],we.prototype,"sortDirection",2),c([p({attribute:"local-sort",type:Boolean})],we.prototype,"localSort",2),c([p({attribute:"filter"})],we.prototype,"filter",2),c([p({attribute:"search"})],we.prototype,"search",2),c([p({attribute:"wide-column"})],we.prototype,"wideColumn",2),c([p({attribute:"key"})],we.prototype,"key",2),c([p({attribute:"headers",type:Object})],we.prototype,"headers",2),c([p({attribute:!1})],we.prototype,"displayTemplates",2),c([p({attribute:"hide-headers",type:Object})],we.prototype,"hiddenHeaders",2),c([p({attribute:"hide-columns",type:Object})],we.prototype,"hiddenColumns",2),c([p({attribute:"unsortable-headers",type:Object})],we.prototype,"unsortableHeaders",2),c([p({attribute:"unsortable",type:Boolean})],we.prototype,"unsortable",2),c([p({attribute:"hide-pagination",type:Boolean})],we.prototype,"hidePagination",2),c([p({type:Boolean})],we.prototype,"standalone",2),c([p()],we.prototype,"caption",2),c([p({attribute:"empty-state-caption"})],we.prototype,"emptyStateCaption",2),c([p({attribute:"empty-state-icon"})],we.prototype,"emptyStateIcon",2),c([p({attribute:"hide-checkboxes",type:Boolean})],we.prototype,"hideCheckboxes",2),c([p()],we.prototype,"filters",2),c([p()],we.prototype,"method",2),c([p({attribute:"no-initial-load",type:Boolean})],we.prototype,"noInitialLoad",2),c([p({attribute:"group-by"})],we.prototype,"groupBy",2),c([p()],we.prototype,"groups",2),c([p({attribute:"per-page-size",type:Number})],we.prototype,"itemsPerPage",2),c([F("#select-all-rows")],we.prototype,"selectAllButton",2);var d4=we;we.define("zn-data-table");var m0=_`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;--zn-col-basis:250px;--col-width:23%}:host([contents]){display:contents}.cols{display:flex;flex-wrap:wrap;flex-grow:1;flex-shrink:1;width:100%;container-type:inline-size;gap:var(--zn-gap);max-width:100%}.cols ::slotted(.zn-col-1){flex-basis:calc(var(--zn-col-basis) * 1);min-width:calc(var(--col-width) * 1);flex-grow:1}.cols ::slotted(.zn-col-2){flex-basis:calc(var(--zn-col-basis) * 2);min-width:calc(var(--col-width) * 2);flex-grow:2}.cols ::slotted(.zn-col-3){flex-basis:calc(var(--zn-col-basis) * 3);min-width:calc(var(--col-width) * 3);flex-grow:3}.cols ::slotted(.zn-col-4){flex-basis:calc(var(--zn-col-basis) * 4);min-width:calc(var(--col-width) * 4);flex-grow:4}.cols ::slotted(.zn-col-5){flex-basis:calc(var(--zn-col-basis) * 5);min-width:calc(var(--col-width) * 5);flex-grow:5}.cols ::slotted(.zn-col-6){flex-basis:calc(var(--zn-col-basis) * 6);min-width:calc(var(--col-width) * 6);flex-grow:6}.cols ::slotted(.zn-col-7){flex-basis:calc(var(--zn-col-basis) * 7);min-width:calc(var(--col-width) * 7);flex-grow:7}.cols ::slotted(.zn-col-8){flex-basis:calc(var(--zn-col-basis) * 8);min-width:calc(var(--col-width) * 8);flex-grow:8}.cols ::slotted(.zn-col-9){flex-basis:calc(var(--zn-col-basis) * 9);min-width:calc(var(--col-width) * 9);flex-grow:9}.cols ::slotted(.zn-col-10){flex-basis:calc(var(--zn-col-basis) * 10);min-width:calc(var(--col-width) * 10);flex-grow:10}.cols ::slotted(.zn-col-11){flex-basis:calc(var(--zn-col-basis) * 11);min-width:calc(var(--col-width) * 11);flex-grow:11}.cols ::slotted(.zn-col-12){flex-basis:calc(var(--zn-col-basis) * 12);min-width:calc(var(--col-width) * 12);flex-grow:12}.cols--mc-1{--col-width:calc(100% / 2)}.cols--mc-2{--col-width:calc(100% / 3)}.cols--mc-3{--col-width:calc(100% / 4)}.cols--mc-4{--col-width:calc(100% / 5)}.cols--mc-5{--col-width:calc(100% / 6)}.cols--mc-6{--col-width:calc(100% / 7)}.cols--mc-7{--col-width:calc(100% / 8)}.cols--mc-8{--col-width:calc(100% / 9)}.cols--mc-9{--col-width:calc(100% / 10)}.cols--mc-10{--col-width:calc(100% / 11)}.cols--mc-11{--col-width:calc(100% / 12)}.cols--mc-12{--col-width:calc(100% / 13)}.cols--layout-121 ::slotted(.zn-col-2){order:-1;min-width:100%}@container (min-width:1440px){.cols--layout-121 ::slotted(.zn-col-2){order:initial;min-width:46%}}.cols--divide ::slotted(*:not(:last-child)){position:relative}.cols--divide ::slotted(*:not(:last-child)):after{content:"";position:absolute;display:block;width:1px;top:0;height:100%;max-height:100%;right:calc(var(--zn-spacing-small) / 2 * -1);background-color:rgb(var(--zn-border-color))}.cols--no-gap{gap:0}.cols--border{overflow:hidden}.cols--border ::slotted(*){position:relative;padding-bottom:var(--zn-spacing-small)}.cols--border ::slotted(*):before{content:"";position:absolute;bottom:-1px;left:-100vw;right:-5px;z-index:1111;border-bottom:1px solid rgb(var(--zn-border-color)) !important}.cols ::slotted([stack-split]){display:flex;flex-direction:column;gap:var(--zn-gap)}.cols--pad{padding:var(--zn-spacing-2x-small)}.cols--pad-x{padding-inline:var(--zn-spacing-2x-small)}.cols--pad-y{padding-block:var(--zn-spacing-2x-small)}@container (max-width:359px){:host([stack-at=sm]) .cols ::slotted(*){--zn-stacked:1;--zn-stack-basis:100%;flex-basis:100%;min-width:100%;max-width:100%}:host([stack-at=sm]) .cols ::slotted([stack-split]){display:contents}:host([stack-at=sm]) .cols--divide ::slotted(*:not(:last-child)):after{display:none}}@container (max-width:479px){:host([stack-at=smp]) .cols ::slotted(*){--zn-stacked:1;--zn-stack-basis:100%;flex-basis:100%;min-width:100%;max-width:100%}:host([stack-at=smp]) .cols ::slotted([stack-split]){display:contents}:host([stack-at=smp]) .cols--divide ::slotted(*:not(:last-child)):after{display:none}}@container (max-width:599px){:host([stack-at=ph]) .cols ::slotted(*){--zn-stacked:1;--zn-stack-basis:100%;flex-basis:100%;min-width:100%;max-width:100%}:host([stack-at=ph]) .cols ::slotted([stack-split]){display:contents}:host([stack-at=ph]) .cols--divide ::slotted(*:not(:last-child)):after{display:none}}@container (max-width:767px){:host([stack-at=md]) .cols ::slotted(*){--zn-stacked:1;--zn-stack-basis:100%;flex-basis:100%;min-width:100%;max-width:100%}:host([stack-at=md]) .cols ::slotted([stack-split]){display:contents}:host([stack-at=md]) .cols--divide ::slotted(*:not(:last-child)):after{display:none}}@container (max-width:1099px){:host([stack-at=lg]) .cols ::slotted(*){--zn-stacked:1;--zn-stack-basis:100%;flex-basis:100%;min-width:100%;max-width:100%}:host([stack-at=lg]) .cols ::slotted([stack-split]){display:contents}:host([stack-at=lg]) .cols--divide ::slotted(*:not(:last-child)):after{display:none}}@container (max-width:1439px){:host([stack-at=hd]) .cols ::slotted(*){--zn-stacked:1;--zn-stack-basis:100%;flex-basis:100%;min-width:100%;max-width:100%}:host([stack-at=hd]) .cols ::slotted([stack-split]){display:contents}:host([stack-at=hd]) .cols--divide ::slotted(*:not(:last-child)):after{display:none}}@container (max-width:1959px){:host([stack-at="3k"]) .cols ::slotted(*){--zn-stacked:1;--zn-stack-basis:100%;flex-basis:100%;min-width:100%;max-width:100%}:host([stack-at="3k"]) .cols ::slotted([stack-split]){display:contents}:host([stack-at="3k"]) .cols--divide ::slotted(*:not(:last-child)):after{display:none}}@container (max-width:2559px){:host([stack-at="4k"]) .cols ::slotted(*){--zn-stacked:1;--zn-stack-basis:100%;flex-basis:100%;min-width:100%;max-width:100%}:host([stack-at="4k"]) .cols ::slotted([stack-split]){display:contents}:host([stack-at="4k"]) .cols--divide ::slotted(*:not(:last-child)):after{display:none}}`;var f0={first:-1,high:-1,last:1,low:1},p4="lg",kr=class extends k{constructor(){super(...arguments);this.layout="";this.stackAt="";this.maxColumns=0;this.noGap=!1;this.border=!1;this.divide=!1;this.childObserver=new MutationObserver(()=>this.requestUpdate())}connectedCallback(){super.connectedCallback(),this.childObserver.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this.childObserver.disconnect()}stackOrder(t){let r=t.getAttribute("stack-order");if(r===null)return null;let n=r.trim().toLowerCase();if(n in f0)return f0[n];let a=parseInt(n,10);return isNaN(a)?null:a}applyStackOrder(t,r){let n=this.stackOrder(t);return t.style.order=n===null?"":`calc(var(--zn-stacked, 0) * ${n})`,r&&(t.style.flexBasis="var(--zn-stack-basis, auto)"),n}render(){let t=this.layout.split(/[\s,]+/).map(d=>parseInt(d)).filter(d=>!!d);t.length===0&&t.push(1,1,1,1),this.layout=t.join(","),this.maxColumns=t.reduce((d,h)=>d+h,0);let r="zn-col-",n=Array.from(this.querySelectorAll(":scope > *:not([slot])")),a=t.length,s=n.length-(n.length%a||a),l=!1;return n.forEach((d,h)=>{let m=d.className.split(" ").filter(b=>!b.startsWith(r));d.className=m.join(" ");let f=h%a;d.classList.add(r+t[f]),this.border&&h>=s?d.style.overflow="hidden":d.style.overflow="",l=this.applyStackOrder(d,!1)!==null||l,d.hasAttribute("stack-split")&&(l=!0,this.childObserver.observe(d,{childList:!0}),Array.from(d.children).forEach(b=>this.applyStackOrder(b,!0)))}),l&&!this.stackAt&&(this.stackAt=p4),u`
|
|
1076
1076
|
<div part="base" class="${q({cols:!0,"cols--no-gap":this.noGap,"cols--border":this.border,"cols--pad":this.pad,"cols--pad-x":this.padX,"cols--pad-y":this.padY,"cols--divide":this.divide,[`cols--layout-${this.layout.replaceAll(",","")}`]:!!this.layout,[`cols--mc-${this.maxColumns}`]:!!this.maxColumns})}">
|
|
1077
1077
|
<slot></slot>
|
|
1078
1078
|
</div>
|
|
@@ -4430,7 +4430,7 @@ ${Ra(this.code(i,t))}
|
|
|
4430
4430
|
${r?u`
|
|
4431
4431
|
<slot name="footer" class="panel__footer"></slot>`:null}
|
|
4432
4432
|
</div>
|
|
4433
|
-
</div>`}};Si.styles=[ot.styles,z(M2)],Si.dependencies={"zn-button":_e,"zn-button-group":Gn,"zn-dropdown":jt,"zn-header":Qu,"zn-menu":gi},c([p()],Si.prototype,"label",2),c([p({type:Object})],Si.prototype,"languages",2),c([R()],Si.prototype,"_activeLanguage",2),c([R()],Si.prototype,"_activatedLanguages",2),c([R()],Si.prototype,"_overflowIndex",2);var IL=Si;Si.define("zn-translation-group");var L2=_`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;line-height:var(--zn-line-height-dense);--zn-priority-list-item-gap:var(--zn-spacing-2x-small);--zn-priority-list-item-padding:var(--zn-spacing-small) var(--zn-spacing-medium);--zn-priority-list-actions-gap:var(--zn-spacing-small);--zn-priority-list-handle-color:var(--zn-color-neutral-400);--zn-priority-list-priority-color:var(--zn-color-neutral-600)}.form-control{position:relative;border:none;padding:0;margin:0}.form-control__label{padding:0}.priority-list{display:flex;flex-direction:column;gap:var(--zn-priority-list-item-gap)}.priority-list--disabled{opacity:0.5;pointer-events:none}.priority-list--drag-active .priority-list__item{transition:transform 200ms ease,opacity 200ms ease,box-shadow 200ms ease}.priority-list__item{display:flex;align-items:center;gap:var(--zn-spacing-small);padding:var(--zn-priority-list-item-padding);background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:element;position:relative}.priority-list__item:hover{background:rgb(var(--zn-panel-hover,var(--zn-panel)));border-color:rgb(var(--zn-color-primary-500))}.priority-list__item:hover .priority-list__handle{color:rgb(var(--zn-color-primary-500))}.priority-list__item:focus-visible{outline:2px solid rgb(var(--zn-color-primary-500));outline-offset:-1px;border-color:rgb(var(--zn-color-primary-500))}.priority-list__item:active{cursor:grabbing}.priority-list__item--dragging{opacity:0.3;border-style:dashed;border-color:rgb(var(--zn-color-primary-400));background:rgb(var(--zn-color-primary-50,var(--zn-panel)));box-shadow:none}.priority-list__item--disabled{cursor:not-allowed;opacity:0.6}.priority-list__item--disabled:hover{background:rgb(var(--zn-panel));border-color:rgb(var(--zn-border-color))}.priority-list__handle{display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--zn-priority-list-handle-color);cursor:grab;transition:color 150ms ease}.priority-list__handle:active{cursor:grabbing}.priority-list__priority{display:flex;align-items:center;justify-content:center;flex-shrink:0;min-width:1.5em;font-size:var(--zn-font-size-small);font-weight:var(--zn-font-weight-semibold);color:var(--zn-priority-list-priority-color)}.priority-list__content{flex:1;min-width:0;overflow:hidden;pointer-events:none}.priority-list__content ::slotted(*){pointer-events:none;-webkit-user-drag:none}.priority-list__actions{display:flex;align-items:center;gap:var(--zn-priority-list-actions-gap);flex-shrink:0;pointer-events:auto}.priority-list__actions ::slotted(*){pointer-events:auto;-webkit-user-drag:none}:host([size=small]) .priority-list__item{padding:var(--zn-spacing-2x-small) var(--zn-spacing-small);font-size:var(--zn-font-size-small)}:host([size=small]) .priority-list__priority{font-size:var(--zn-font-size-x-small);min-width:1.25em}:host([size=large]) .priority-list__item{padding:var(--zn-spacing-medium) var(--zn-spacing-large);font-size:var(--zn-font-size-medium)}:host([size=large]) .priority-list__priority{font-size:var(--zn-font-size-medium);min-width:1.75em}.priority-list__collector{position:absolute;width:0;height:0;overflow:hidden;pointer-events:none}.priority-list__hidden-inputs{display:none}`;function DL(o){try{return JSON.parse(o)}catch{return}}var mt=class extends k{constructor(){super(...arguments);this.formControlController=new re(this,{value:t=>JSON.stringify(t.getPriorityMap()),defaultValue:t=>t.defaultValue,setValue:(t,r)=>{if(!r||Array.isArray(r)&&r.length===0)return;let n=Array.isArray(r)?r:DL(r);Array.isArray(n)&&n.every(a=>typeof a=="string")&&(t.value=n)}});this.hasSlotController=new Y(this,"help-text","label");this.name="";this._value=[];this.defaultValue=[];this.label="";this.labelTooltip="";this.helpText="";this.form="";this.size="medium";this.disabled=!1;this.required=!1;this.priorityStart=1;this.order="";this.draggedKey=null;this.isDragging=!1;this.dragOverKey=null}get value(){return this._value}set value(t){let r=this._value;this._value=[...t],this._assignSlotNames(),this.requestUpdate("value",r)}get validity(){return dt}get validationMessage(){return""}connectedCallback(){super.connectedCallback(),this.defaultValue=[...this._value]}firstUpdated(t){super.firstUpdated(t),this.formControlController.updateValidity(),this._initializeOrderFromSlot()}_initializeOrderFromSlot(){if(this._value.length===0){let r=this._getSlottedItems().map(n=>n.getAttribute("value")||"").filter(n=>n!=="");if(this.order){let n=this.order.split(",").map(h=>h.trim()).filter(h=>h!==""),a=new Set(r),s=n.filter(h=>a.has(h)),l=new Set(s),d=r.filter(h=>!l.has(h));this._value=[...s,...d]}else this._value=r}this.defaultValue=[...this._value],this._assignSlotNames(),this._syncHiddenInputs(),this.requestUpdate()}_getSlottedItems(){let t=["label","label-tooltip","help-text"];return[...this.querySelectorAll(":scope > [value]")].filter(r=>{let n=r.getAttribute("slot");return!n||n.startsWith("_item-")||!t.includes(n)})}_assignSlotNames(){[...this.querySelectorAll(":scope > [value]")].forEach(r=>{let n=r.getAttribute("value");n&&!["label","label-tooltip","help-text"].includes(n)&&r.setAttribute("slot",`_item-${n}`)})}getPriorityMap(){return this._value.map((t,r)=>({key:t,priority:this.priorityStart+r}))}_syncHiddenInputs(){this.hiddenInputsContainer&&(this.hiddenInputsContainer.innerHTML="",this.name&&this._value.forEach((t,r)=>{let n=document.createElement("input");n.type="hidden",n.name=`${this.name}[${t}]`,n.value=String(this.priorityStart+r),this.hiddenInputsContainer.appendChild(n)}))}_moveItem(t,r){if(t===r||t<0||r<0||t>=this._value.length||r>=this._value.length)return;let n=[...this._value],[a]=n.splice(t,1);n.splice(r,0,a),this._value=n,this._assignSlotNames(),this._syncHiddenInputs(),this.requestUpdate(),this.emit("zn-change"),this.emit("zn-reorder"),this._submitForm()}_submitForm(){if(this.formAction===void 0||this.formAction===null)return;
|
|
4433
|
+
</div>`}};Si.styles=[ot.styles,z(M2)],Si.dependencies={"zn-button":_e,"zn-button-group":Gn,"zn-dropdown":jt,"zn-header":Qu,"zn-menu":gi},c([p()],Si.prototype,"label",2),c([p({type:Object})],Si.prototype,"languages",2),c([R()],Si.prototype,"_activeLanguage",2),c([R()],Si.prototype,"_activatedLanguages",2),c([R()],Si.prototype,"_overflowIndex",2);var IL=Si;Si.define("zn-translation-group");var L2=_`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}*,*::before,*::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;line-height:var(--zn-line-height-dense);--zn-priority-list-item-gap:var(--zn-spacing-2x-small);--zn-priority-list-item-padding:var(--zn-spacing-small) var(--zn-spacing-medium);--zn-priority-list-actions-gap:var(--zn-spacing-small);--zn-priority-list-handle-color:var(--zn-color-neutral-400);--zn-priority-list-priority-color:var(--zn-color-neutral-600)}.form-control{position:relative;border:none;padding:0;margin:0}.form-control__label{padding:0}.priority-list{display:flex;flex-direction:column;gap:var(--zn-priority-list-item-gap)}.priority-list--disabled{opacity:0.5;pointer-events:none}.priority-list--drag-active .priority-list__item{transition:transform 200ms ease,opacity 200ms ease,box-shadow 200ms ease}.priority-list__item{display:flex;align-items:center;gap:var(--zn-spacing-small);padding:var(--zn-priority-list-item-padding);background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:var(--zn-border-radius);cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:element;position:relative}.priority-list__item:hover{background:rgb(var(--zn-panel-hover,var(--zn-panel)));border-color:rgb(var(--zn-color-primary-500))}.priority-list__item:hover .priority-list__handle{color:rgb(var(--zn-color-primary-500))}.priority-list__item:focus-visible{outline:2px solid rgb(var(--zn-color-primary-500));outline-offset:-1px;border-color:rgb(var(--zn-color-primary-500))}.priority-list__item:active{cursor:grabbing}.priority-list__item--dragging{opacity:0.3;border-style:dashed;border-color:rgb(var(--zn-color-primary-400));background:rgb(var(--zn-color-primary-50,var(--zn-panel)));box-shadow:none}.priority-list__item--disabled{cursor:not-allowed;opacity:0.6}.priority-list__item--disabled:hover{background:rgb(var(--zn-panel));border-color:rgb(var(--zn-border-color))}.priority-list__handle{display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--zn-priority-list-handle-color);cursor:grab;transition:color 150ms ease}.priority-list__handle:active{cursor:grabbing}.priority-list__priority{display:flex;align-items:center;justify-content:center;flex-shrink:0;min-width:1.5em;font-size:var(--zn-font-size-small);font-weight:var(--zn-font-weight-semibold);color:var(--zn-priority-list-priority-color)}.priority-list__content{flex:1;min-width:0;overflow:hidden;pointer-events:none}.priority-list__content ::slotted(*){pointer-events:none;-webkit-user-drag:none}.priority-list__actions{display:flex;align-items:center;gap:var(--zn-priority-list-actions-gap);flex-shrink:0;pointer-events:auto}.priority-list__actions ::slotted(*){pointer-events:auto;-webkit-user-drag:none}:host([size=small]) .priority-list__item{padding:var(--zn-spacing-2x-small) var(--zn-spacing-small);font-size:var(--zn-font-size-small)}:host([size=small]) .priority-list__priority{font-size:var(--zn-font-size-x-small);min-width:1.25em}:host([size=large]) .priority-list__item{padding:var(--zn-spacing-medium) var(--zn-spacing-large);font-size:var(--zn-font-size-medium)}:host([size=large]) .priority-list__priority{font-size:var(--zn-font-size-medium);min-width:1.75em}.priority-list__collector{position:absolute;width:0;height:0;overflow:hidden;pointer-events:none}.priority-list__hidden-inputs{display:none}`;function DL(o){try{return JSON.parse(o)}catch{return}}var mt=class extends k{constructor(){super(...arguments);this.formControlController=new re(this,{value:t=>JSON.stringify(t.getPriorityMap()),defaultValue:t=>t.defaultValue,setValue:(t,r)=>{if(!r||Array.isArray(r)&&r.length===0)return;let n=Array.isArray(r)?r:DL(r);Array.isArray(n)&&n.every(a=>typeof a=="string")&&(t.value=n)}});this.hasSlotController=new Y(this,"help-text","label");this.name="";this._value=[];this.defaultValue=[];this.label="";this.labelTooltip="";this.helpText="";this.form="";this.size="medium";this.disabled=!1;this.required=!1;this.priorityStart=1;this.order="";this.draggedKey=null;this.isDragging=!1;this.dragOverKey=null}get value(){return this._value}set value(t){let r=this._value;this._value=[...t],this._assignSlotNames(),this.requestUpdate("value",r)}get validity(){return dt}get validationMessage(){return""}connectedCallback(){super.connectedCallback(),this.defaultValue=[...this._value]}firstUpdated(t){super.firstUpdated(t),this.formControlController.updateValidity(),this._initializeOrderFromSlot()}_initializeOrderFromSlot(){if(this._value.length===0){let r=this._getSlottedItems().map(n=>n.getAttribute("value")||"").filter(n=>n!=="");if(this.order){let n=this.order.split(",").map(h=>h.trim()).filter(h=>h!==""),a=new Set(r),s=n.filter(h=>a.has(h)),l=new Set(s),d=r.filter(h=>!l.has(h));this._value=[...s,...d]}else this._value=r}this.defaultValue=[...this._value],this._assignSlotNames(),this._syncHiddenInputs(),this.requestUpdate()}_getSlottedItems(){let t=["label","label-tooltip","help-text"];return[...this.querySelectorAll(":scope > [value]")].filter(r=>{let n=r.getAttribute("slot");return!n||n.startsWith("_item-")||!t.includes(n)})}_assignSlotNames(){[...this.querySelectorAll(":scope > [value]")].forEach(r=>{let n=r.getAttribute("value");n&&!["label","label-tooltip","help-text"].includes(n)&&r.setAttribute("slot",`_item-${n}`)})}getPriorityMap(){return this._value.map((t,r)=>({key:t,priority:this.priorityStart+r}))}_syncHiddenInputs(){this.hiddenInputsContainer&&(this.hiddenInputsContainer.innerHTML="",this.name&&this._value.forEach((t,r)=>{let n=document.createElement("input");n.type="hidden",n.name=`${this.name}[${t}]`,n.value=String(this.priorityStart+r),this.hiddenInputsContainer.appendChild(n)}))}_moveItem(t,r){if(t===r||t<0||r<0||t>=this._value.length||r>=this._value.length)return;let n=[...this._value],[a]=n.splice(t,1);n.splice(r,0,a),this._value=n,this._assignSlotNames(),this._syncHiddenInputs(),this.requestUpdate(),this.emit("zn-change"),this.emit("zn-reorder"),this._submitForm()}_submitForm(){if(this.formAction===void 0||this.formAction===null)return;if(this.getForm()){let r=document.createElement("input");r.type="submit",this.formAction&&r.setAttribute("formaction",this.formAction),this.formControlController.submit(r)}else if(this.formAction){let r=document.createElement("form");r.method="post",r.action=this.formAction,r.hidden=!0,this._value.forEach((n,a)=>{if(this.name){let s=document.createElement("input");s.type="hidden",s.name=`${this.name}[${n}]`,s.value=String(this.priorityStart+a),r.appendChild(s)}}),document.body.appendChild(r),r.requestSubmit(),r.remove()}}_handleDragStart(t,r){if(this.disabled){t.preventDefault();return}this.draggedKey=r,this.isDragging=!0,t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",r))}_handleDragEnd(){this.isDragging&&(this._syncHiddenInputs(),this.emit("zn-change"),this.emit("zn-reorder"),this._submitForm()),this.draggedKey=null,this.dragOverKey=null,this.isDragging=!1}_handleDragOver(t,r){if(t.preventDefault(),!this.draggedKey||this.draggedKey===r)return;t.dataTransfer&&(t.dataTransfer.dropEffect="move");let n=this._value.indexOf(this.draggedKey),a=this._value.indexOf(r);if(n===-1||a===-1||n===a)return;let s=[...this._value],[l]=s.splice(n,1);s.splice(a,0,l),this._value=s,this._assignSlotNames(),this.requestUpdate(),this.dragOverKey=r}_handleDragLeave(t,r){let n=t.relatedTarget,a=t.currentTarget;n&&a.contains(n)||this.dragOverKey===r&&(this.dragOverKey=null)}_handleDrop(t){t.preventDefault()}_handleKeyDown(t,r){if(this.disabled)return;let n=this._value.indexOf(r);if(n===-1)return;let a=null;switch(t.key){case"ArrowUp":n>0&&(a=n-1);break;case"ArrowDown":n<this._value.length-1&&(a=n+1);break;case"Home":n>0&&(a=0);break;case"End":n<this._value.length-1&&(a=this._value.length-1);break;default:return}a!==null&&(t.preventDefault(),this._moveItem(n,a),this.updateComplete.then(()=>{this.shadowRoot?.querySelectorAll(".priority-list__item")?.[a]?.focus()}))}_handleSlotChange(){let t=[...this.querySelectorAll(":scope > [value]")],r=["label","label-tooltip","help-text"],n=t.filter(h=>{let m=h.getAttribute("slot");return!m||m.startsWith("_item-")||!r.includes(m)}).map(h=>h.getAttribute("value")||"").filter(h=>h!=="");if(n.length===0&&this._value.length>0)return;let a=new Set(this._value),s=new Set(n),l=n.filter(h=>!a.has(h)),d=this._value.filter(h=>s.has(h));(l.length>0||d.length!==this._value.length)&&(this._value=[...d,...l],this._assignSlotNames(),this._syncHiddenInputs(),this.requestUpdate())}checkValidity(){return!0}getForm(){return this.formControlController.getForm()}reportValidity(){return!0}setCustomValidity(t=""){}updated(t){super.updated(t),(t.has("value")||t.has("name")||t.has("priorityStart"))&&this._syncHiddenInputs()}render(){let t=this.hasSlotController.test("label"),r=this.hasSlotController.test("label-tooltip"),n=this.hasSlotController.test("help-text"),a=this.label?!0:t,s=this.labelTooltip?!0:r,l=this.helpText?!0:n;return u`
|
|
4434
4434
|
<fieldset
|
|
4435
4435
|
part="form-control"
|
|
4436
4436
|
class=${q({"form-control":!0,"form-control--small":this.size==="small","form-control--medium":this.size==="medium","form-control--large":this.size==="large","form-control--has-label":a,"form-control--has-label-tooltip":s,"form-control--has-help-text":l})}
|
package/package.json
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
flex-shrink: 1;
|
|
18
18
|
width: 100%;
|
|
19
19
|
container-type: inline-size;
|
|
20
|
-
overflow: hidden;
|
|
21
20
|
gap: var(--zn-gap);
|
|
22
21
|
|
|
23
22
|
max-width: 100%;
|
|
@@ -70,6 +69,12 @@
|
|
|
70
69
|
gap: 0;
|
|
71
70
|
}
|
|
72
71
|
|
|
72
|
+
// The row rule below each child is drawn by a pseudo reaching to -100vw, so border mode has to clip. Clipping
|
|
73
|
+
// every layout would cut the focus ring off any control sitting flush against a column edge.
|
|
74
|
+
&--border {
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
}
|
|
77
|
+
|
|
73
78
|
&--border ::slotted(*) {
|
|
74
79
|
position: relative;
|
|
75
80
|
padding-bottom: var(--zn-spacing-small); // Add spacing between element and border
|
|
@@ -297,15 +297,16 @@ export default class ZnPriorityList extends ZincElement implements ZincFormContr
|
|
|
297
297
|
|
|
298
298
|
const form = this.getForm();
|
|
299
299
|
if (form) {
|
|
300
|
-
|
|
300
|
+
// Submitting through the controller announces the form before it is
|
|
301
|
+
// submitted, which is what lets a host intercept the submit: a submit
|
|
302
|
+
// event raised on a form inside a shadow root never reaches the document,
|
|
303
|
+
// so submitting it directly navigates the page instead.
|
|
304
|
+
const submitter = document.createElement('input');
|
|
301
305
|
submitter.type = 'submit';
|
|
302
|
-
submitter.hidden = true;
|
|
303
306
|
if (this.formAction) {
|
|
304
307
|
submitter.setAttribute('formaction', this.formAction);
|
|
305
308
|
}
|
|
306
|
-
|
|
307
|
-
form.requestSubmit(submitter);
|
|
308
|
-
submitter.remove();
|
|
309
|
+
this.formControlController.submit(submitter);
|
|
309
310
|
} else if (this.formAction) {
|
|
310
311
|
// No parent form — create a temporary one to submit the priority data
|
|
311
312
|
const tempForm = document.createElement('form');
|
|
@@ -324,7 +325,9 @@ export default class ZnPriorityList extends ZincElement implements ZincFormContr
|
|
|
324
325
|
});
|
|
325
326
|
|
|
326
327
|
document.body.appendChild(tempForm);
|
|
327
|
-
|
|
328
|
+
// requestSubmit raises a cancellable submit event, so a host can handle
|
|
329
|
+
// the submission rather than the browser navigating to formaction.
|
|
330
|
+
tempForm.requestSubmit();
|
|
328
331
|
tempForm.remove();
|
|
329
332
|
}
|
|
330
333
|
}
|
|
@@ -179,4 +179,38 @@ describe('<zn-priority-list>', () => {
|
|
|
179
179
|
expect(item.getAttribute('draggable')).to.equal('false');
|
|
180
180
|
expect(item.getAttribute('tabindex')).to.equal('-1');
|
|
181
181
|
});
|
|
182
|
+
|
|
183
|
+
it('should announce its form before submitting a reorder, so a host can intercept it', async () => {
|
|
184
|
+
const form = await fixture(html`
|
|
185
|
+
<form action="/save" method="post">
|
|
186
|
+
<zn-priority-list name="sections" formaction="/save">
|
|
187
|
+
<div value="a">A</div>
|
|
188
|
+
<div value="b">B</div>
|
|
189
|
+
</zn-priority-list>
|
|
190
|
+
</form>
|
|
191
|
+
`) as HTMLFormElement;
|
|
192
|
+
|
|
193
|
+
const el = form.querySelector('zn-priority-list') as any;
|
|
194
|
+
await el.updateComplete;
|
|
195
|
+
|
|
196
|
+
const announced: Element[] = [];
|
|
197
|
+
const onRegister = (e: Event) => announced.push((e as CustomEvent).detail.element);
|
|
198
|
+
document.addEventListener('zn-register-element', onRegister);
|
|
199
|
+
|
|
200
|
+
let submitter: HTMLElement | null = null;
|
|
201
|
+
form.addEventListener('submit', (e: SubmitEvent) => {
|
|
202
|
+
submitter = e.submitter;
|
|
203
|
+
e.preventDefault();
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
const item = el.shadowRoot.querySelector('.priority-list__item');
|
|
207
|
+
item.dispatchEvent(new KeyboardEvent('keydown', {key: 'ArrowDown', bubbles: true, composed: true, cancelable: true}));
|
|
208
|
+
await el.updateComplete;
|
|
209
|
+
|
|
210
|
+
document.removeEventListener('zn-register-element', onRegister);
|
|
211
|
+
|
|
212
|
+
expect(announced).to.include(form);
|
|
213
|
+
expect(submitter).to.exist;
|
|
214
|
+
expect(submitter!.getAttribute('formaction')).to.equal('/save');
|
|
215
|
+
});
|
|
182
216
|
});
|