@nmorph/nmorph-ui-kit 2.2.10 → 2.2.13
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/README.md +11 -7
- package/dist/components/basic/nmorph-icon/NmorphIcon.css +1 -1
- package/dist/components/basic/nmorph-icon/NmorphIcon.vue2.js +11 -11
- package/dist/components/data/nmorph-avatar/NmorphAvatar.css +1 -0
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue.js +74 -46
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +26 -21
- package/dist/components/data/nmorph-carousel/NmorphCarousel.vue2.js +4 -4
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +77 -38
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +31 -30
- package/dist/components/data/nmorph-pagination/NmorphPagination.css +1 -1
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +36 -30
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +48 -41
- package/dist/components/data/nmorph-table/NmorphTable.css +1 -1
- package/dist/components/data/nmorph-table/NmorphTable.vue.js +228 -103
- package/dist/components/data/nmorph-table/NmorphTable.vue2.js +49 -30
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.css +1 -1
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +91 -35
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +48 -35
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.css +1 -1
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue.js +15 -13
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +8 -8
- package/dist/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue2.js +22 -14
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +11 -10
- package/dist/components/form/nmorph-radio/NmorphRadio.css +1 -1
- package/dist/components/form/nmorph-radio/NmorphRadio.vue.js +22 -20
- package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +7 -7
- package/dist/components/form/nmorph-radio-group/NmorphRadioGroup.vue2.js +14 -14
- package/dist/components/form/nmorph-select/NmorphSelect.css +1 -1
- package/dist/components/form/nmorph-select/NmorphSelect.vue.js +115 -58
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +104 -75
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +12 -10
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue.js +7 -7
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue.js +29 -42
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +39 -20
- package/dist/components/others/nmorph-overlay/NmorphOverlay.vue.js +29 -24
- package/dist/components/others/nmorph-overlay/NmorphOverlay.vue2.js +17 -15
- package/dist/hooks/use-common-styles.js +23 -20
- package/dist/hooks/use-placement.js +76 -44
- package/dist/hooks/use-virtual-list.js +46 -0
- package/dist/index.es.js +698 -694
- package/dist/index.umd.js +46 -38
- package/dist/nuxt.mjs +21 -8
- package/dist/outside-hooks/use-nmorph-browser.js +9 -9
- package/dist/outside-hooks/use-nmorph-theme.js +133 -87
- package/dist/package.json.js +1 -1
- package/dist/plugin.js +34 -29
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-image/NmorphImage.vue.d.ts +3 -3
- package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +14 -2
- package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +3 -0
- package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +9 -0
- package/dist/src/components/data/nmorph-table/types.d.ts +2 -2
- package/dist/src/components/feedback/nmorph-tooltip/NmorphTooltip.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +11 -0
- package/dist/src/components/form/nmorph-checkbox/NmorphCheckbox.vue.d.ts +1 -0
- package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +4 -3
- package/dist/src/components/form/nmorph-radio/NmorphRadio.vue.d.ts +1 -0
- package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +4 -3
- package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +8 -0
- package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +1 -0
- package/dist/src/components/form/nmorph-select/types.d.ts +1 -0
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +3 -1
- package/dist/src/components/others/nmorph-overlay/NmorphOverlay.vue.d.ts +4 -0
- package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +1 -1
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/use-common-styles.d.ts +1 -0
- package/dist/src/hooks/use-placement.d.ts +8 -4
- package/dist/src/hooks/use-virtual-list.d.ts +21 -0
- package/dist/src/outside-hooks/use-nmorph-notification.d.ts +2 -2
- package/dist/src/outside-hooks/use-nmorph-theme.d.ts +1 -0
- package/dist/src/plugin.d.ts +2 -0
- package/dist/src/types/index.d.ts +12 -3
- package/dist/style.css +1 -1
- package/dist/types/index.js +14 -8
- package/package.json +1 -1
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
import './NmorphTable.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as t, createElementBlock as
|
|
2
|
+
import m from "./NmorphTable.vue2.js";
|
|
3
|
+
import { openBlock as t, createElementBlock as e, normalizeClass as _, createElementVNode as o, Fragment as n, renderList as i, normalizeStyle as d, toDisplayString as b, createBlock as y, createCommentVNode as u, renderSlot as p } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
return t(),
|
|
9
|
-
(t(),
|
|
5
|
+
import v from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const w = { class: "nmorph-table__wrapper" }, f = { class: "nmorph-table__header" }, k = ["data-src"], g = { class: "nmorph-table__table-row" }, S = { class: "nmorph-table__cell" }, x = ["id"], W = { class: "nmorph-table__slot-columns" }, B = ["id"], N = { class: "nmorph-table__slot-columns" };
|
|
7
|
+
function E(c, h, H, l, L, C) {
|
|
8
|
+
return t(), e("div", null, [
|
|
9
|
+
(t(), e(
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
12
12
|
ref: "nmorphDOMTable",
|
|
13
13
|
key: l.key,
|
|
14
|
-
class:
|
|
14
|
+
class: _(l.modifiers)
|
|
15
15
|
},
|
|
16
16
|
[
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
(t(!0),
|
|
21
|
-
|
|
17
|
+
o("div", w, [
|
|
18
|
+
o("table", f, [
|
|
19
|
+
o("colgroup", null, [
|
|
20
|
+
(t(!0), e(
|
|
21
|
+
n,
|
|
22
22
|
null,
|
|
23
|
-
|
|
23
|
+
i(l.columns, (r) => (t(), e("col", {
|
|
24
24
|
key: r.prop,
|
|
25
|
-
style:
|
|
25
|
+
style: d({ width: `${l.getWidth(r.width)}px` }),
|
|
26
26
|
"data-src": `${l.getWidth(r.width)}px`
|
|
27
27
|
}, null, 12, k))),
|
|
28
28
|
128
|
|
29
29
|
/* KEYED_FRAGMENT */
|
|
30
30
|
))
|
|
31
31
|
]),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
(t(!0),
|
|
35
|
-
|
|
32
|
+
o("thead", null, [
|
|
33
|
+
o("tr", g, [
|
|
34
|
+
(t(!0), e(
|
|
35
|
+
n,
|
|
36
36
|
null,
|
|
37
|
-
|
|
37
|
+
i(l.columns, (r, s) => (t(), e(
|
|
38
38
|
"th",
|
|
39
39
|
{
|
|
40
|
-
key:
|
|
41
|
-
class:
|
|
40
|
+
key: s,
|
|
41
|
+
class: _(["nmorph-table__table-data", { "nmorph-table__table-data--bordered": l.props.bordered }])
|
|
42
42
|
},
|
|
43
43
|
[
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
o("div", S, [
|
|
45
|
+
o(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
|
-
style:
|
|
48
|
+
style: d({ "justify-content": r.alignment }),
|
|
49
49
|
class: "nmorph-table__cell-content"
|
|
50
50
|
},
|
|
51
51
|
[
|
|
52
|
-
|
|
52
|
+
o(
|
|
53
53
|
"span",
|
|
54
54
|
null,
|
|
55
|
-
|
|
55
|
+
b(r.label),
|
|
56
56
|
1
|
|
57
57
|
/* TEXT */
|
|
58
58
|
),
|
|
59
|
-
l.sortData && l.sortData[r.prop] ? (t(),
|
|
59
|
+
l.sortData && l.sortData[r.prop] ? (t(), y(l.NmorphSortButton, {
|
|
60
60
|
key: 0,
|
|
61
61
|
class: "nmorph-table__button-wrapper",
|
|
62
62
|
value: l.sortData[r.prop],
|
|
63
|
-
onSort: (
|
|
64
|
-
}, null, 8, ["value", "onSort"])) :
|
|
63
|
+
onSort: (a) => l.onSort(a, r.prop)
|
|
64
|
+
}, null, 8, ["value", "onSort"])) : u("v-if", !0)
|
|
65
65
|
],
|
|
66
66
|
4
|
|
67
67
|
/* STYLE */
|
|
@@ -77,52 +77,177 @@ function B(c, W, T, l, j, z) {
|
|
|
77
77
|
])
|
|
78
78
|
])
|
|
79
79
|
]),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
o(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
ref: l.virtualList.containerRef,
|
|
84
|
+
class: _(["nmorph-table__body", { "nmorph-table__body--virtual": l.virtualEnabled }]),
|
|
85
|
+
style: d(l.tableBodyStyle),
|
|
86
|
+
onScroll: h[0] || (h[0] = (...r) => l.virtualList.scrollHandler && l.virtualList.scrollHandler(...r))
|
|
87
|
+
},
|
|
88
|
+
[
|
|
89
|
+
l.virtualEnabled ? (t(), e(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
key: 0,
|
|
93
|
+
class: "nmorph-table__virtual-spacer",
|
|
94
|
+
style: d(l.virtualSpacerStyle)
|
|
95
|
+
},
|
|
96
|
+
[
|
|
97
|
+
o(
|
|
98
|
+
"div",
|
|
88
99
|
{
|
|
89
|
-
|
|
90
|
-
style:
|
|
100
|
+
class: "nmorph-table__virtual-content",
|
|
101
|
+
style: d(l.virtualContentStyle)
|
|
91
102
|
},
|
|
92
|
-
|
|
103
|
+
[
|
|
104
|
+
o("table", null, [
|
|
105
|
+
o("colgroup", null, [
|
|
106
|
+
(t(!0), e(
|
|
107
|
+
n,
|
|
108
|
+
null,
|
|
109
|
+
i(l.columns, (r) => (t(), e(
|
|
110
|
+
"col",
|
|
111
|
+
{
|
|
112
|
+
key: r.prop,
|
|
113
|
+
style: d({ width: `${l.getWidth(r.width)}px` })
|
|
114
|
+
},
|
|
115
|
+
null,
|
|
116
|
+
4
|
|
117
|
+
/* STYLE */
|
|
118
|
+
))),
|
|
119
|
+
128
|
|
120
|
+
/* KEYED_FRAGMENT */
|
|
121
|
+
))
|
|
122
|
+
]),
|
|
123
|
+
o("tbody", null, [
|
|
124
|
+
(t(!0), e(
|
|
125
|
+
n,
|
|
126
|
+
null,
|
|
127
|
+
i(l.tableRows, (r, s) => (t(), e(
|
|
128
|
+
"tr",
|
|
129
|
+
{
|
|
130
|
+
key: s,
|
|
131
|
+
class: _(["nmorph-table__table-data-row", { "nmorph-table__table-data-row--row-hover": l.props.rowHover }])
|
|
132
|
+
},
|
|
133
|
+
[
|
|
134
|
+
(t(!0), e(
|
|
135
|
+
n,
|
|
136
|
+
null,
|
|
137
|
+
i(l.columns, (a) => (t(), e(
|
|
138
|
+
"td",
|
|
139
|
+
{
|
|
140
|
+
key: a.prop,
|
|
141
|
+
class: _([{ "nmorph-table__table-data--bordered": l.props.bordered }, "nmorph-table__table-data"])
|
|
142
|
+
},
|
|
143
|
+
[
|
|
144
|
+
o("div", {
|
|
145
|
+
id: `table-cell-${l.tableIdentifier}-${s}-${a.prop}`,
|
|
146
|
+
style: d({ "text-align": a.alignment }),
|
|
147
|
+
class: "nmorph-table__cell nmorph-table__cell--data"
|
|
148
|
+
}, b(l.tableData(r[a.prop])), 13, x)
|
|
149
|
+
],
|
|
150
|
+
2
|
|
151
|
+
/* CLASS */
|
|
152
|
+
))),
|
|
153
|
+
128
|
|
154
|
+
/* KEYED_FRAGMENT */
|
|
155
|
+
))
|
|
156
|
+
],
|
|
157
|
+
2
|
|
158
|
+
/* CLASS */
|
|
159
|
+
))),
|
|
160
|
+
128
|
|
161
|
+
/* KEYED_FRAGMENT */
|
|
162
|
+
))
|
|
163
|
+
])
|
|
164
|
+
]),
|
|
165
|
+
o("table", null, [
|
|
166
|
+
o("colgroup", null, [
|
|
167
|
+
(t(!0), e(
|
|
168
|
+
n,
|
|
169
|
+
null,
|
|
170
|
+
i(l.columns, (r) => (t(), e(
|
|
171
|
+
"col",
|
|
172
|
+
{
|
|
173
|
+
key: r.prop,
|
|
174
|
+
style: d({ width: `${l.getWidth(r.width)}px` })
|
|
175
|
+
},
|
|
176
|
+
null,
|
|
177
|
+
4
|
|
178
|
+
/* STYLE */
|
|
179
|
+
))),
|
|
180
|
+
128
|
|
181
|
+
/* KEYED_FRAGMENT */
|
|
182
|
+
))
|
|
183
|
+
]),
|
|
184
|
+
o("tbody", W, [
|
|
185
|
+
p(c.$slots, "default")
|
|
186
|
+
])
|
|
187
|
+
])
|
|
188
|
+
],
|
|
93
189
|
4
|
|
94
190
|
/* STYLE */
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
null,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
key: _,
|
|
108
|
-
class: i(["nmorph-table__table-data-row", { "nmorph-table__table-data-row--row-hover": l.props.rowHover }])
|
|
109
|
-
},
|
|
110
|
-
[
|
|
111
|
-
(t(!0), o(
|
|
112
|
-
a,
|
|
191
|
+
)
|
|
192
|
+
],
|
|
193
|
+
4
|
|
194
|
+
/* STYLE */
|
|
195
|
+
)) : (t(), e(
|
|
196
|
+
n,
|
|
197
|
+
{ key: 1 },
|
|
198
|
+
[
|
|
199
|
+
o("table", null, [
|
|
200
|
+
o("colgroup", null, [
|
|
201
|
+
(t(!0), e(
|
|
202
|
+
n,
|
|
113
203
|
null,
|
|
114
|
-
|
|
115
|
-
"
|
|
204
|
+
i(l.columns, (r) => (t(), e(
|
|
205
|
+
"col",
|
|
116
206
|
{
|
|
117
|
-
key:
|
|
118
|
-
|
|
207
|
+
key: r.prop,
|
|
208
|
+
style: d({ width: `${l.getWidth(r.width)}px` })
|
|
209
|
+
},
|
|
210
|
+
null,
|
|
211
|
+
4
|
|
212
|
+
/* STYLE */
|
|
213
|
+
))),
|
|
214
|
+
128
|
|
215
|
+
/* KEYED_FRAGMENT */
|
|
216
|
+
))
|
|
217
|
+
]),
|
|
218
|
+
o("tbody", null, [
|
|
219
|
+
(t(!0), e(
|
|
220
|
+
n,
|
|
221
|
+
null,
|
|
222
|
+
i(l.tableRows, (r, s) => (t(), e(
|
|
223
|
+
"tr",
|
|
224
|
+
{
|
|
225
|
+
key: s,
|
|
226
|
+
class: _(["nmorph-table__table-data-row", { "nmorph-table__table-data-row--row-hover": l.props.rowHover }])
|
|
119
227
|
},
|
|
120
228
|
[
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
229
|
+
(t(!0), e(
|
|
230
|
+
n,
|
|
231
|
+
null,
|
|
232
|
+
i(l.columns, (a) => (t(), e(
|
|
233
|
+
"td",
|
|
234
|
+
{
|
|
235
|
+
key: a.prop,
|
|
236
|
+
class: _([{ "nmorph-table__table-data--bordered": l.props.bordered }, "nmorph-table__table-data"])
|
|
237
|
+
},
|
|
238
|
+
[
|
|
239
|
+
o("div", {
|
|
240
|
+
id: `table-cell-${l.tableIdentifier}-${s}-${a.prop}`,
|
|
241
|
+
style: d({ "text-align": a.alignment }),
|
|
242
|
+
class: "nmorph-table__cell nmorph-table__cell--data"
|
|
243
|
+
}, b(l.tableData(r[a.prop])), 13, B)
|
|
244
|
+
],
|
|
245
|
+
2
|
|
246
|
+
/* CLASS */
|
|
247
|
+
))),
|
|
248
|
+
128
|
|
249
|
+
/* KEYED_FRAGMENT */
|
|
250
|
+
))
|
|
126
251
|
],
|
|
127
252
|
2
|
|
128
253
|
/* CLASS */
|
|
@@ -130,39 +255,39 @@ function B(c, W, T, l, j, z) {
|
|
|
130
255
|
128
|
|
131
256
|
/* KEYED_FRAGMENT */
|
|
132
257
|
))
|
|
133
|
-
]
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
258
|
+
])
|
|
259
|
+
]),
|
|
260
|
+
o("table", null, [
|
|
261
|
+
o("colgroup", null, [
|
|
262
|
+
(t(!0), e(
|
|
263
|
+
n,
|
|
264
|
+
null,
|
|
265
|
+
i(l.columns, (r) => (t(), e(
|
|
266
|
+
"col",
|
|
267
|
+
{
|
|
268
|
+
key: r.prop,
|
|
269
|
+
style: d({ width: `${l.getWidth(r.width)}px` })
|
|
270
|
+
},
|
|
271
|
+
null,
|
|
272
|
+
4
|
|
273
|
+
/* STYLE */
|
|
274
|
+
))),
|
|
275
|
+
128
|
|
276
|
+
/* KEYED_FRAGMENT */
|
|
277
|
+
))
|
|
278
|
+
]),
|
|
279
|
+
o("tbody", N, [
|
|
280
|
+
p(c.$slots, "default")
|
|
281
|
+
])
|
|
282
|
+
])
|
|
283
|
+
],
|
|
284
|
+
64
|
|
285
|
+
/* STABLE_FRAGMENT */
|
|
286
|
+
))
|
|
287
|
+
],
|
|
288
|
+
38
|
|
289
|
+
/* CLASS, STYLE, NEED_HYDRATION */
|
|
290
|
+
)
|
|
166
291
|
])
|
|
167
292
|
],
|
|
168
293
|
2
|
|
@@ -170,7 +295,7 @@ function B(c, W, T, l, j, z) {
|
|
|
170
295
|
))
|
|
171
296
|
]);
|
|
172
297
|
}
|
|
173
|
-
const
|
|
298
|
+
const I = /* @__PURE__ */ v(m, [["render", E], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-table/NmorphTable.vue"]]);
|
|
174
299
|
export {
|
|
175
|
-
|
|
300
|
+
I as default
|
|
176
301
|
};
|
|
@@ -1,52 +1,71 @@
|
|
|
1
1
|
import './NmorphTable.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { generateUUID as
|
|
5
|
-
import
|
|
6
|
-
|
|
2
|
+
import { defineComponent as j, computed as r, ref as s, provide as q, watch as I } from "vue";
|
|
3
|
+
import { useModifiers as T } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { generateUUID as M } from "../../../utils/common.js";
|
|
5
|
+
import Q from "./inner-components/nmorph-sort-button/NmorphSortButton.vue.js";
|
|
6
|
+
import { useVirtualList as U } from "../../../hooks/use-virtual-list.js";
|
|
7
|
+
const P = /* @__PURE__ */ j({
|
|
7
8
|
__name: "NmorphTable",
|
|
8
9
|
props: {
|
|
9
10
|
data: { type: Array, required: !1, default: () => [] },
|
|
10
11
|
rowHover: { type: Boolean, required: !1, default: !0 },
|
|
11
12
|
bordered: { type: Boolean, required: !1, default: !1 },
|
|
12
13
|
sort: { type: Object, required: !1, default: void 0 },
|
|
13
|
-
design: { type: String, required: !1, default: "nmorph" }
|
|
14
|
+
design: { type: String, required: !1, default: "nmorph" },
|
|
15
|
+
virtual: { type: Boolean, required: !1, default: !1 },
|
|
16
|
+
virtualHeight: { type: [Number, String], required: !1, default: "320px" },
|
|
17
|
+
virtualOverscan: { type: Number, required: !1, default: 5 },
|
|
18
|
+
virtualRowHeight: { type: Number, required: !1, default: 42 }
|
|
14
19
|
},
|
|
15
|
-
setup(
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
() =>
|
|
19
|
-
"nmorph-table": [`${
|
|
20
|
+
setup(x, { expose: W }) {
|
|
21
|
+
W();
|
|
22
|
+
const t = x, B = r(
|
|
23
|
+
() => T({
|
|
24
|
+
"nmorph-table": [`${t.design}`]
|
|
20
25
|
})
|
|
21
|
-
),
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
), l = s([...t.data]), i = r(() => t.virtual), g = r(() => t.virtualRowHeight), b = r(() => t.virtualOverscan), d = U(l, {
|
|
27
|
+
enabled: i,
|
|
28
|
+
itemHeight: g,
|
|
29
|
+
overscan: b
|
|
30
|
+
}), y = r(
|
|
31
|
+
() => i.value ? d.virtualItems.value.map((e) => e.item) : l.value
|
|
32
|
+
), n = s(t.sort), N = (e, o) => {
|
|
33
|
+
n.value && (n.value[o] = e, l.value.sort((m, p) => {
|
|
34
|
+
const h = String(m[o]).toLowerCase(), a = String(p[o]).toLowerCase();
|
|
24
35
|
if (!n.value)
|
|
25
36
|
return 0;
|
|
26
|
-
const
|
|
27
|
-
return
|
|
37
|
+
const c = n.value[o];
|
|
38
|
+
return c === "ascending" ? h.localeCompare(a) : c === "descending" ? a.localeCompare(h) : 0;
|
|
28
39
|
}));
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const e =
|
|
33
|
-
return
|
|
34
|
-
}),
|
|
35
|
-
|
|
36
|
-
() =>
|
|
40
|
+
}, f = s(null), u = s([]);
|
|
41
|
+
q("table-data", { rows: y, columns: u });
|
|
42
|
+
const w = r(() => {
|
|
43
|
+
const e = u.value.map((a) => a.width).filter((a) => !!a), o = e.length, m = e.reduce((a, c) => (a += Number(c), a), 0), p = u.value.length - o;
|
|
44
|
+
return f.value?.clientWidth ? (f.value?.clientWidth - m) / p : 0;
|
|
45
|
+
}), O = (e) => e !== "" ? e : w.value, v = s(0);
|
|
46
|
+
I(
|
|
47
|
+
() => t.data,
|
|
37
48
|
() => {
|
|
38
|
-
|
|
49
|
+
v.value = v.value + 1, l.value = [...t.data], u.value = [];
|
|
39
50
|
},
|
|
40
51
|
{
|
|
41
52
|
immediate: !0
|
|
42
53
|
}
|
|
43
54
|
);
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
55
|
+
const R = (e) => typeof e == "object" ? "" : e, C = M();
|
|
56
|
+
q("table-identifier", C);
|
|
57
|
+
const S = (e) => typeof e == "number" ? `${e}px` : e, H = r(() => S(t.virtualHeight)), $ = r(() => ({
|
|
58
|
+
"--table-virtual-row-height": `${t.virtualRowHeight}px`,
|
|
59
|
+
height: i.value ? H.value : void 0,
|
|
60
|
+
overflowY: i.value ? "auto" : void 0
|
|
61
|
+
})), D = r(() => ({
|
|
62
|
+
height: `${d.totalHeight.value}px`
|
|
63
|
+
})), L = r(() => ({
|
|
64
|
+
transform: `translateY(${d.offsetTop.value}px)`
|
|
65
|
+
})), _ = { props: t, modifiers: B, rows: l, virtualEnabled: i, virtualRowHeight: g, virtualOverscan: b, virtualList: d, tableRows: y, sortData: n, onSort: N, nmorphDOMTable: f, columns: u, defaultColWidth: w, getWidth: O, key: v, tableData: R, tableIdentifier: C, getCssSize: S, virtualHeight: H, tableBodyStyle: $, virtualSpacerStyle: D, virtualContentStyle: L, NmorphSortButton: Q };
|
|
66
|
+
return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
|
|
48
67
|
}
|
|
49
68
|
});
|
|
50
69
|
export {
|
|
51
|
-
|
|
70
|
+
P as default
|
|
52
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-autocomplete .nmorph-autocomplete__list-item{padding:var(--indentation-02) var(--indentation-04);cursor:pointer}.nmorph-autocomplete .nmorph-autocomplete__list-item:last-child{border-bottom-left-radius:var(--indentation-02);border-bottom-right-radius:var(--indentation-02)}.nmorph-autocomplete .nmorph-autocomplete__loading{display:flex;align-items:center;justify-content:center;height:100px}.nmorph-autocomplete .nmorph-autocomplete__list-item:hover{color:var(--nmorph-white-color);background:var(--nmorph-accent-color)}
|
|
1
|
+
.nmorph-autocomplete .nmorph-autocomplete__list-item{padding:var(--indentation-02) var(--indentation-04);cursor:pointer}.nmorph-autocomplete .nmorph-autocomplete__list-item:last-child{border-bottom-left-radius:var(--indentation-02);border-bottom-right-radius:var(--indentation-02)}.nmorph-autocomplete .nmorph-autocomplete__loading{display:flex;align-items:center;justify-content:center;height:100px}.nmorph-autocomplete .nmorph-autocomplete__list-item:hover{color:var(--nmorph-white-color);background:var(--nmorph-accent-color)}.nmorph-autocomplete .nmorph-autocomplete__list--virtual{overflow-y:auto}.nmorph-autocomplete .nmorph-autocomplete__list--virtual .nmorph-autocomplete__list-item{height:var(--autocomplete-virtual-item-height);overflow:hidden}.nmorph-autocomplete .nmorph-autocomplete__virtual-spacer{position:relative}.nmorph-autocomplete .nmorph-autocomplete__virtual-content{position:absolute;top:0;right:0;left:0}
|