quasar-ui-danx 0.3.22 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/.eslintrc.cjs +32 -30
  2. package/danx-local.sh +1 -1
  3. package/dist/danx.es.js +7413 -7461
  4. package/dist/danx.es.js.map +1 -1
  5. package/dist/danx.umd.js +5 -5
  6. package/dist/danx.umd.js.map +1 -1
  7. package/dist/style.css +1 -1
  8. package/package.json +1 -1
  9. package/src/components/ActionTable/ActionMenu.vue +1 -1
  10. package/src/components/ActionTable/ActionTable.vue +67 -47
  11. package/src/components/ActionTable/{ActionTableColumn.vue → Columns/ActionTableColumn.vue} +4 -3
  12. package/src/components/ActionTable/{ActionTableHeaderColumn.vue → Columns/ActionTableHeaderColumn.vue} +2 -2
  13. package/src/components/ActionTable/Columns/index.ts +2 -0
  14. package/src/components/ActionTable/Filters/CollapsableFiltersSidebar.vue +23 -21
  15. package/src/components/ActionTable/Form/Fields/DateRangeField.vue +3 -5
  16. package/src/components/ActionTable/Form/Fields/NumberField.vue +60 -59
  17. package/src/components/ActionTable/Form/Fields/SelectField.vue +135 -135
  18. package/src/components/ActionTable/Form/Fields/TextField.vue +36 -36
  19. package/src/components/ActionTable/Form/RenderedForm.vue +133 -112
  20. package/src/components/ActionTable/Form/form.d.ts +31 -0
  21. package/src/components/ActionTable/Layouts/ActionTableLayout.vue +93 -4
  22. package/src/components/ActionTable/TableSummaryRow.vue +4 -4
  23. package/src/components/ActionTable/Toolbars/ActionToolbar.vue +46 -0
  24. package/src/components/ActionTable/Toolbars/index.ts +1 -0
  25. package/src/components/ActionTable/index.ts +1 -2
  26. package/src/components/ActionTable/listControls.ts +512 -385
  27. package/src/components/ActionTable/listHelpers.ts +46 -44
  28. package/src/components/ActionTable/tableColumns.ts +66 -66
  29. package/src/components/PanelsDrawer/PanelsDrawer.vue +37 -26
  30. package/src/components/PanelsDrawer/PanelsDrawerPanels.vue +1 -1
  31. package/src/components/PanelsDrawer/PanelsDrawerTabs.vue +1 -6
  32. package/src/components/Utility/Buttons/ExportButton.vue +1 -1
  33. package/src/components/Utility/Buttons/RefreshButton.vue +5 -5
  34. package/src/components/Utility/Controls/PreviousNextControls.vue +4 -4
  35. package/src/components/Utility/Dialogs/ConfirmDialog.vue +69 -115
  36. package/src/components/Utility/Dialogs/DialogLayout.vue +95 -0
  37. package/src/components/Utility/Dialogs/InfoDialog.vue +40 -80
  38. package/src/components/Utility/Layouts/CollapsableSidebar.vue +2 -8
  39. package/src/components/Utility/Popovers/PopoverMenu.vue +3 -3
  40. package/src/components/Utility/Tools/RenderVnode.vue +21 -12
  41. package/src/helpers/actions.ts +198 -188
  42. package/src/styles/general.scss +12 -11
  43. package/src/styles/quasar-reset.scss +81 -22
  44. package/src/styles/themes/danx/action-table.scss +19 -0
  45. package/src/styles/themes/danx/buttons.scss +13 -0
  46. package/src/styles/themes/danx/dialogs.scss +43 -0
  47. package/src/styles/themes/danx/forms.scss +23 -0
  48. package/src/styles/themes/danx/index.scss +7 -0
  49. package/src/styles/themes/danx/panels.scss +19 -0
  50. package/src/styles/themes/danx/sidebar.scss +3 -0
  51. package/src/styles/themes/danx/toolbar.scss +3 -0
  52. package/types/index.d.ts +1 -0
  53. package/src/styles/actions.scss +0 -10
@@ -16,7 +16,7 @@
16
16
  option-value="value"
17
17
  placeholder=""
18
18
  :input-class="{'is-hidden': !isShowing, [inputClass]: true}"
19
- class="max-w-full"
19
+ class="max-w-full dx-select-field"
20
20
  @filter="onFilter"
21
21
  @clear="onClear"
22
22
  @popup-show="onShow"
@@ -71,40 +71,40 @@ import { computed, isRef, nextTick, ref } from "vue";
71
71
 
72
72
  const emit = defineEmits(["update:model-value", "search", "update"]);
73
73
  const props = defineProps({
74
- ...QSelect.props,
75
- modelValue: {
76
- type: [Array, String, Number, Object],
77
- default: undefined
78
- },
79
- placeholder: {
80
- type: String,
81
- default: ""
82
- },
83
- selectionLabel: {
84
- type: String,
85
- default: null
86
- },
87
- chipLimit: {
88
- type: Number,
89
- default: 3
90
- },
91
- inputClass: {
92
- type: String,
93
- default: ""
94
- },
95
- selectionClass: {
96
- type: String,
97
- default: ""
98
- },
99
- options: {
100
- type: Array,
101
- default: () => []
102
- },
103
- filterable: Boolean,
104
- filterFn: {
105
- type: Function,
106
- default: null
107
- }
74
+ ...QSelect.props,
75
+ modelValue: {
76
+ type: [Array, String, Number, Object],
77
+ default: undefined
78
+ },
79
+ placeholder: {
80
+ type: String,
81
+ default: ""
82
+ },
83
+ selectionLabel: {
84
+ type: String,
85
+ default: null
86
+ },
87
+ chipLimit: {
88
+ type: Number,
89
+ default: 3
90
+ },
91
+ inputClass: {
92
+ type: String,
93
+ default: ""
94
+ },
95
+ selectionClass: {
96
+ type: String,
97
+ default: ""
98
+ },
99
+ options: {
100
+ type: Array,
101
+ default: () => []
102
+ },
103
+ filterable: Boolean,
104
+ filterFn: {
105
+ type: Function,
106
+ default: null
107
+ }
108
108
  });
109
109
 
110
110
  const selectField = ref(null);
@@ -119,27 +119,27 @@ const isShowing = ref(false);
119
119
  * @type {ComputedRef<{selectionLabel: string, label: string, value: string|*}[]>}
120
120
  */
121
121
  const computedOptions = computed(() => {
122
- let options = props.options;
123
- if (props.placeholder && !props.multiple && !props.filterable) {
124
- options = [{ label: props.placeholder, value: null }, ...props.options];
125
- }
126
- options = options.map((o) => {
127
- let opt = isRef(o) ? o.value : o;
128
- return {
129
- label: resolveLabel(opt),
130
- value: resolveValue(opt),
131
- selectionLabel: resolveSelectionLabel(opt)
132
- };
133
- });
134
- return options;
122
+ let options = props.options;
123
+ if (props.placeholder && !props.multiple && !props.filterable) {
124
+ options = [{ label: props.placeholder, value: null }, ...props.options];
125
+ }
126
+ options = options.map((o) => {
127
+ let opt = isRef(o) ? o.value : o;
128
+ return {
129
+ label: resolveLabel(opt),
130
+ value: resolveValue(opt),
131
+ selectionLabel: resolveSelectionLabel(opt)
132
+ };
133
+ });
134
+ return options;
135
135
  });
136
136
 
137
137
  const filteredOptions = computed(() => {
138
- if (filter.value && !props.filterFn) {
139
- return computedOptions.value.filter(o => o.label.toLocaleLowerCase().indexOf(filter.value.toLowerCase()) > -1);
140
- } else {
141
- return computedOptions.value;
142
- }
138
+ if (filter.value && !props.filterFn) {
139
+ return computedOptions.value.filter(o => o.label.toLocaleLowerCase().indexOf(filter.value.toLowerCase()) > -1);
140
+ } else {
141
+ return computedOptions.value;
142
+ }
143
143
  });
144
144
 
145
145
  /**
@@ -147,14 +147,14 @@ const filteredOptions = computed(() => {
147
147
  * @type {ComputedRef<unknown>}
148
148
  */
149
149
  const selectedValue = computed(() => {
150
- if (props.multiple) {
151
- const arrVal = Array.isArray(props.modelValue) ? props.modelValue : [];
152
- return arrVal.map((v) => {
153
- return v === null ? "__null__" : v;
154
- }) || [];
155
- } else {
156
- return props.modelValue === null ? "__null__" : props.modelValue;
157
- }
150
+ if (props.multiple) {
151
+ const arrVal = Array.isArray(props.modelValue) ? props.modelValue : [];
152
+ return arrVal.map((v) => {
153
+ return v === null ? "__null__" : v;
154
+ }) || [];
155
+ } else {
156
+ return props.modelValue === null ? "__null__" : props.modelValue;
157
+ }
158
158
  });
159
159
 
160
160
  /**
@@ -162,13 +162,13 @@ const selectedValue = computed(() => {
162
162
  * @type {ComputedRef<*>}
163
163
  */
164
164
  const selectedOptions = computed(() => {
165
- let values = selectedValue.value;
166
- if (!props.multiple) {
167
- values = (values || values === 0) ? [values] : [];
168
- }
169
- return computedOptions.value.filter((o) => {
170
- return values.includes(o.value) || values.map(v => typeof v === "object" && v.id).includes(o.value?.id);
171
- });
165
+ let values = selectedValue.value;
166
+ if (!props.multiple) {
167
+ values = (values || values === 0) ? [values] : [];
168
+ }
169
+ return computedOptions.value.filter((o) => {
170
+ return values.includes(o.value) || values.map(v => typeof v === "object" && v.id).includes(o.value?.id);
171
+ });
172
172
  });
173
173
 
174
174
  /**
@@ -177,12 +177,12 @@ const selectedOptions = computed(() => {
177
177
  * @type {ComputedRef<unknown>}
178
178
  */
179
179
  const selectedLabel = computed(() => {
180
- if (props.filterable && isShowing.value) return "";
180
+ if (props.filterable && isShowing.value) return "";
181
181
 
182
- if (!selectedOptions.value || selectedOptions.value.length === 0) {
183
- return props.placeholder || "(Select Option)";
184
- }
185
- return selectedOptions.value[0].selectionLabel;
182
+ if (!selectedOptions.value || selectedOptions.value.length === 0) {
183
+ return props.placeholder || "(Select Option)";
184
+ }
185
+ return selectedOptions.value[0].selectionLabel;
186
186
  });
187
187
 
188
188
  /**
@@ -190,7 +190,7 @@ const selectedLabel = computed(() => {
190
190
  * @type {ComputedRef<*>}
191
191
  */
192
192
  const chipOptions = computed(() => {
193
- return selectedOptions.value.slice(0, props.chipLimit);
193
+ return selectedOptions.value.slice(0, props.chipLimit);
194
194
  });
195
195
 
196
196
  /**
@@ -199,16 +199,16 @@ const chipOptions = computed(() => {
199
199
  * @returns {*|string}
200
200
  */
201
201
  function resolveLabel(option) {
202
- if (typeof option === "string") {
203
- return option;
204
- }
205
- if (typeof props.optionLabel === "string") {
206
- return option[props.optionLabel];
207
- }
208
- if (typeof props.optionLabel === "function") {
209
- return props.optionLabel(option);
210
- }
211
- return option?.label;
202
+ if (typeof option === "string") {
203
+ return option;
204
+ }
205
+ if (typeof props.optionLabel === "string") {
206
+ return option[props.optionLabel];
207
+ }
208
+ if (typeof props.optionLabel === "function") {
209
+ return props.optionLabel(option);
210
+ }
211
+ return option?.label;
212
212
  }
213
213
 
214
214
  /**
@@ -218,16 +218,16 @@ function resolveLabel(option) {
218
218
  * @returns {*|{default: null, type: String | StringConstructor}|string}
219
219
  */
220
220
  function resolveSelectionLabel(option) {
221
- if (typeof option === "string") {
222
- return option;
223
- }
224
- if (typeof props.selectionLabel === "string") {
225
- return option[props.selectionLabel];
226
- }
227
- if (typeof props.selectionLabel === "function") {
228
- return props.selectionLabel(option);
229
- }
230
- return option?.selectionLabel || option?.label;
221
+ if (typeof option === "string") {
222
+ return option;
223
+ }
224
+ if (typeof props.selectionLabel === "string") {
225
+ return option[props.selectionLabel];
226
+ }
227
+ if (typeof props.selectionLabel === "function") {
228
+ return props.selectionLabel(option);
229
+ }
230
+ return option?.selectionLabel || option?.label;
231
231
  }
232
232
 
233
233
  /**
@@ -236,17 +236,17 @@ function resolveSelectionLabel(option) {
236
236
  * @returns {string|*|string}
237
237
  */
238
238
  function resolveValue(option) {
239
- if (!option || typeof option === "string") {
240
- return option;
241
- }
242
- let value = option.value;
243
- if (typeof props.optionValue === "string") {
244
- value = option[props.optionValue];
245
- } else if (typeof props.optionValue === "function") {
246
- value = props.optionValue(option);
247
- }
248
- // Note the __null__ special case here. See the onUpdate function for more details
249
- return value === null ? "__null__" : value;
239
+ if (!option || typeof option === "string") {
240
+ return option;
241
+ }
242
+ let value = option.value;
243
+ if (typeof props.optionValue === "string") {
244
+ value = option[props.optionValue];
245
+ } else if (typeof props.optionValue === "function") {
246
+ value = props.optionValue(option);
247
+ }
248
+ // Note the __null__ special case here. See the onUpdate function for more details
249
+ return value === null ? "__null__" : value;
250
250
  }
251
251
 
252
252
  /**
@@ -256,14 +256,14 @@ function resolveValue(option) {
256
256
  * @param value
257
257
  */
258
258
  function onUpdate(value) {
259
- if (Array.isArray(value)) {
260
- value = value.map((v) => v === "__null__" ? null : v);
261
- }
259
+ if (Array.isArray(value)) {
260
+ value = value.map((v) => v === "__null__" ? null : v);
261
+ }
262
262
 
263
- value = value === "__null__" ? null : value;
263
+ value = value === "__null__" ? null : value;
264
264
 
265
- emit("update", value);
266
- emit("update:model-value", value);
265
+ emit("update", value);
266
+ emit("update:model-value", value);
267
267
  }
268
268
 
269
269
  /** XXX: This tells us when we should apply the filter. QSelect likes to trigger a new filter everytime you open the dropdown
@@ -277,19 +277,19 @@ const shouldFilter = ref(false);
277
277
  * @param update
278
278
  */
279
279
  async function onFilter(val, update) {
280
- if (!props.filterFn) {
281
- filter.value = val;
282
- await nextTick(update);
283
- } else {
284
- update();
285
- if (shouldFilter.value === false) return;
286
- if (val !== null && val !== filter.value) {
287
- filter.value = val;
288
- if (props.filterFn) {
289
- await props.filterFn(val);
290
- }
291
- }
292
- }
280
+ if (!props.filterFn) {
281
+ filter.value = val;
282
+ await nextTick(update);
283
+ } else {
284
+ update();
285
+ if (shouldFilter.value === false) return;
286
+ if (val !== null && val !== filter.value) {
287
+ filter.value = val;
288
+ if (props.filterFn) {
289
+ await props.filterFn(val);
290
+ }
291
+ }
292
+ }
293
293
  }
294
294
 
295
295
  /**
@@ -297,29 +297,29 @@ async function onFilter(val, update) {
297
297
  * See the onUpdate function for more details
298
298
  */
299
299
  function onClear() {
300
- emit("update:model-value", undefined);
301
- emit("update", undefined);
300
+ emit("update:model-value", undefined);
301
+ emit("update", undefined);
302
302
  }
303
303
 
304
304
  /**
305
305
  * Handle behavior when showing the dropdown
306
306
  */
307
307
  function onShow() {
308
- isShowing.value = true;
308
+ isShowing.value = true;
309
309
 
310
- // XXX: See description on shouldFilter declaration. Only allow filtering after dropdown is ALREADY opened
311
- shouldFilter.value = false;
312
- nextTick(() => {
313
- shouldFilter.value = true;
314
- selectField.value.focus();
315
- });
310
+ // XXX: See description on shouldFilter declaration. Only allow filtering after dropdown is ALREADY opened
311
+ shouldFilter.value = false;
312
+ nextTick(() => {
313
+ shouldFilter.value = true;
314
+ selectField.value.focus();
315
+ });
316
316
  }
317
317
 
318
318
  /**
319
319
  * Handle behavior when hiding the dropdown
320
320
  */
321
321
  function onHide() {
322
- isShowing.value = false;
323
- shouldFilter.value = false;
322
+ isShowing.value = false;
323
+ shouldFilter.value = false;
324
324
  }
325
325
  </script>
@@ -42,41 +42,41 @@ import LabelValueBlock from "./LabelValueBlock";
42
42
 
43
43
  defineEmits(["update:model-value", "submit"]);
44
44
  defineProps({
45
- modelValue: {
46
- type: [String, Number],
47
- default: ""
48
- },
49
- field: {
50
- type: Object,
51
- default: null
52
- },
53
- type: {
54
- type: String,
55
- default: "text"
56
- },
57
- label: {
58
- type: String,
59
- default: null
60
- },
61
- labelClass: {
62
- type: String,
63
- default: "text-sm text-gray-700"
64
- },
65
- parentClass: {
66
- type: String,
67
- default: ""
68
- },
69
- inputClass: {
70
- type: String,
71
- default: ""
72
- },
73
- noLabel: Boolean,
74
- showName: Boolean,
75
- disabled: Boolean,
76
- readonly: Boolean,
77
- debounce: {
78
- type: [String, Number],
79
- default: 0
80
- }
45
+ modelValue: {
46
+ type: [String, Number],
47
+ default: ""
48
+ },
49
+ field: {
50
+ type: Object,
51
+ default: null
52
+ },
53
+ type: {
54
+ type: String,
55
+ default: "text"
56
+ },
57
+ label: {
58
+ type: String,
59
+ default: null
60
+ },
61
+ labelClass: {
62
+ type: String,
63
+ default: ""
64
+ },
65
+ parentClass: {
66
+ type: String,
67
+ default: ""
68
+ },
69
+ inputClass: {
70
+ type: String,
71
+ default: ""
72
+ },
73
+ noLabel: Boolean,
74
+ showName: Boolean,
75
+ disabled: Boolean,
76
+ readonly: Boolean,
77
+ debounce: {
78
+ type: [String, Number],
79
+ default: 0
80
+ }
81
81
  });
82
82
  </script>