@onereach/ui-components 19.6.0 → 19.7.0-beta.5077.0

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.
@@ -1 +1 @@
1
- export { s as default } from '../OrDataGridV3-c866dc8a.js';
1
+ export { s as default } from '../OrDataGridV3-864c4140.js';
@@ -41,6 +41,8 @@ declare const _default: import("vue").DefineComponent<{
41
41
  scrollPaddingInlineEnd: string;
42
42
  }>;
43
43
  selectingIndicator: import("vue").WritableComputedRef<boolean>;
44
+ showSelectingCouter: import("vue").ComputedRef<boolean | undefined>;
45
+ selectingDisabled: import("vue").ComputedRef<boolean | undefined>;
44
46
  selectingModel: import("vue").WritableComputedRef<Id[]>;
45
47
  filteringModel: import("vue").WritableComputedRef<undefined>;
46
48
  searchingModel: import("vue").WritableComputedRef<import("../../types").ModelValue<string>>;
@@ -1 +1 @@
1
- export { D as DataGridVariant, s as OrDataGridV3 } from '../OrDataGridV3-c866dc8a.js';
1
+ export { D as DataGridVariant, s as OrDataGridV3 } from '../OrDataGridV3-864c4140.js';
@@ -1 +1 @@
1
- export { a as DataGrid } from '../OrDataGridV3-c866dc8a.js';
1
+ export { a as DataGrid } from '../OrDataGridV3-864c4140.js';
@@ -29,7 +29,10 @@ export declare enum DataGridVariant {
29
29
  Compact = "compact"
30
30
  }
31
31
  export type DataGridFeatures = {
32
- selecting?: boolean;
32
+ selecting?: boolean | {
33
+ showCounter?: boolean;
34
+ disabled?: boolean;
35
+ };
33
36
  filtering?: boolean;
34
37
  searching?: boolean;
35
38
  sorting?: boolean;
@@ -949,7 +949,7 @@ var script = defineComponent({
949
949
  // State
950
950
  const selectingIndicator = computed({
951
951
  get: () => {
952
- return props.items.every(item => selectingModel.value.includes(item.id));
952
+ return !!props.items.length && props.items.every(item => selectingModel.value.includes(item.id));
953
953
  },
954
954
  set: value => {
955
955
  if (value) {
@@ -1045,6 +1045,12 @@ var script = defineComponent({
1045
1045
  });
1046
1046
  const scrollOffsetStart = ref(new Map());
1047
1047
  const scrollOffsetEnd = ref(new Map());
1048
+ const showSelectingCouter = computed(() => {
1049
+ return props.features.selecting && (typeof props.features.selecting === 'object' ? props.features.selecting.showCounter !== false : true);
1050
+ });
1051
+ const selectingDisabled = computed(() => {
1052
+ return props.items.length === 0 || props.loading || typeof props.features.selecting === 'object' && props.features.selecting.disabled;
1053
+ });
1048
1054
  // Methods
1049
1055
  function updateScrollOffset(header, offset, column) {
1050
1056
  switch (column.stickiness) {
@@ -1080,6 +1086,8 @@ var script = defineComponent({
1080
1086
  rootStyles,
1081
1087
  tableInlineStyles,
1082
1088
  selectingIndicator,
1089
+ showSelectingCouter,
1090
+ selectingDisabled,
1083
1091
  selectingModel,
1084
1092
  filteringModel,
1085
1093
  searchingModel,
@@ -1165,7 +1173,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1165
1173
  modelValue: _ctx.selectingIndicator,
1166
1174
  "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.selectingIndicator = $event),
1167
1175
  indeterminate: !_ctx.selectingIndicator && _ctx.selectingModel.length > 0,
1168
- disabled: _ctx.items.length === 0 || _ctx.loading
1176
+ disabled: _ctx.selectingDisabled
1169
1177
  }, null, 8 /* PROPS */, ["modelValue", "indeterminate", "disabled"])]),
1170
1178
  _: 1 /* STABLE */
1171
1179
  }, 8 /* PROPS */, ["onUpdate:scrollOffset", "onRemove:scrollOffset"])) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, column => {
@@ -1241,8 +1249,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1241
1249
  default: withCtx(() => [createVNode(_component_OrCheckbox, {
1242
1250
  modelValue: _ctx.selectingModel,
1243
1251
  "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => _ctx.selectingModel = $event),
1244
- value: item.id
1245
- }, null, 8 /* PROPS */, ["modelValue", "value"])]),
1252
+ value: item.id,
1253
+ disabled: _ctx.selectingDisabled
1254
+ }, null, 8 /* PROPS */, ["modelValue", "value", "disabled"])]),
1246
1255
  _: 2 /* DYNAMIC */
1247
1256
  }, 1024 /* DYNAMIC_SLOTS */)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, column => {
1248
1257
  return openBlock(), createBlock(_component_OrDataGridTableContentCell, {
@@ -1298,9 +1307,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1298
1307
  _: 3 /* FORWARDED */
1299
1308
  })]),
1300
1309
  _: 3 /* FORWARDED */
1301
- }, 8 /* PROPS */, ["variant"])]),
1310
+ }, 8 /* PROPS */, ["variant"]), createTextVNode("s ")]),
1302
1311
  _: 3 /* FORWARDED */
1303
- })) : createCommentVNode("v-if", true), _ctx.$slots['actions'] || _ctx.features.selecting || _ctx.features.paging ? (openBlock(), createBlock(_component_OrDataGridFooter, {
1312
+ })) : createCommentVNode("v-if", true), _ctx.$slots['actions'] || _ctx.showSelectingCouter || _ctx.features.paging ? (openBlock(), createBlock(_component_OrDataGridFooter, {
1304
1313
  key: 3,
1305
1314
  class: normalizeClass(['shrink-0'])
1306
1315
  }, createSlots({
@@ -24,7 +24,7 @@ export { s as OrCombinedInputV3 } from './OrCombinedInputV3-7aa0d255.js';
24
24
  export { s as OrConfirm } from './OrConfirm-bcd0e8ef.js';
25
25
  export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirmV3-860933a8.js';
26
26
  export { default as OrContextMenuV3 } from './OrContextMenuV3/OrContextMenu.js';
27
- export { D as DataGridVariant, s as OrDataGridV3 } from './OrDataGridV3-c866dc8a.js';
27
+ export { D as DataGridVariant, s as OrDataGridV3 } from './OrDataGridV3-864c4140.js';
28
28
  export { s as OrDateFormatV3 } from './OrDateFormatV3-0177905c.js';
29
29
  export { s as OrDatePickerV3 } from './OrDatePickerV3-63a6c872.js';
30
30
  export { s as OrDateRangePickerV3 } from './OrDateRangePickerV3-b97bac85.js';
@@ -16,7 +16,7 @@ export { s as OrCombinedInputV3 } from './components/OrCombinedInputV3-7aa0d255.
16
16
  export { s as OrConfirm } from './components/OrConfirm-bcd0e8ef.js';
17
17
  export { C as ConfirmType, s as OrConfirmV3 } from './components/OrConfirmV3-860933a8.js';
18
18
  export { default as OrContextMenuV3 } from './components/OrContextMenuV3/OrContextMenu.js';
19
- export { D as DataGridVariant, s as OrDataGridV3 } from './components/OrDataGridV3-c866dc8a.js';
19
+ export { D as DataGridVariant, s as OrDataGridV3 } from './components/OrDataGridV3-864c4140.js';
20
20
  export { s as OrDateFormatV3 } from './components/OrDateFormatV3-0177905c.js';
21
21
  export { s as OrDateRangePickerV3 } from './components/OrDateRangePickerV3-b97bac85.js';
22
22
  export { s as OrDateTimeFormatV3 } from './components/OrDateTimeFormatV3-c26c836e.js';
@@ -41,6 +41,8 @@ declare const _default: import("vue").DefineComponent<{
41
41
  scrollPaddingInlineEnd: string;
42
42
  }>;
43
43
  selectingIndicator: import("vue").WritableComputedRef<boolean>;
44
+ showSelectingCouter: import("vue").ComputedRef<boolean | undefined>;
45
+ selectingDisabled: import("vue").ComputedRef<boolean | undefined>;
44
46
  selectingModel: import("vue").WritableComputedRef<Id[]>;
45
47
  filteringModel: import("vue").WritableComputedRef<undefined>;
46
48
  searchingModel: import("vue").WritableComputedRef<import("../../types").ModelValue<string>>;
@@ -153,7 +153,7 @@ var script = defineComponent({
153
153
  // State
154
154
  const selectingIndicator = computed({
155
155
  get: () => {
156
- return props.items.every(item => selectingModel.value.includes(item.id));
156
+ return !!props.items.length && props.items.every(item => selectingModel.value.includes(item.id));
157
157
  },
158
158
  set: value => {
159
159
  if (value) {
@@ -249,6 +249,12 @@ var script = defineComponent({
249
249
  });
250
250
  const scrollOffsetStart = ref(new Map());
251
251
  const scrollOffsetEnd = ref(new Map());
252
+ const showSelectingCouter = computed(() => {
253
+ return props.features.selecting && (typeof props.features.selecting === 'object' ? props.features.selecting.showCounter !== false : true);
254
+ });
255
+ const selectingDisabled = computed(() => {
256
+ return props.items.length === 0 || props.loading || typeof props.features.selecting === 'object' && props.features.selecting.disabled;
257
+ });
252
258
  // Methods
253
259
  function updateScrollOffset(header, offset, column) {
254
260
  switch (column.stickiness) {
@@ -284,6 +290,8 @@ var script = defineComponent({
284
290
  rootStyles,
285
291
  tableInlineStyles,
286
292
  selectingIndicator,
293
+ showSelectingCouter,
294
+ selectingDisabled,
287
295
  selectingModel,
288
296
  filteringModel,
289
297
  searchingModel,
@@ -369,7 +377,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
369
377
  modelValue: _ctx.selectingIndicator,
370
378
  "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.selectingIndicator = $event),
371
379
  indeterminate: !_ctx.selectingIndicator && _ctx.selectingModel.length > 0,
372
- disabled: _ctx.items.length === 0 || _ctx.loading
380
+ disabled: _ctx.selectingDisabled
373
381
  }, null, 8 /* PROPS */, ["modelValue", "indeterminate", "disabled"])]),
374
382
  _: 1 /* STABLE */
375
383
  }, 8 /* PROPS */, ["onUpdate:scrollOffset", "onRemove:scrollOffset"])) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, column => {
@@ -445,8 +453,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
445
453
  default: withCtx(() => [createVNode(_component_OrCheckbox, {
446
454
  modelValue: _ctx.selectingModel,
447
455
  "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => _ctx.selectingModel = $event),
448
- value: item.id
449
- }, null, 8 /* PROPS */, ["modelValue", "value"])]),
456
+ value: item.id,
457
+ disabled: _ctx.selectingDisabled
458
+ }, null, 8 /* PROPS */, ["modelValue", "value", "disabled"])]),
450
459
  _: 2 /* DYNAMIC */
451
460
  }, 1024 /* DYNAMIC_SLOTS */)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, column => {
452
461
  return openBlock(), createBlock(_component_OrDataGridTableContentCell, {
@@ -502,9 +511,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
502
511
  _: 3 /* FORWARDED */
503
512
  })]),
504
513
  _: 3 /* FORWARDED */
505
- }, 8 /* PROPS */, ["variant"])]),
514
+ }, 8 /* PROPS */, ["variant"]), createTextVNode("s ")]),
506
515
  _: 3 /* FORWARDED */
507
- })) : createCommentVNode("v-if", true), _ctx.$slots['actions'] || _ctx.features.selecting || _ctx.features.paging ? (openBlock(), createBlock(_component_OrDataGridFooter, {
516
+ })) : createCommentVNode("v-if", true), _ctx.$slots['actions'] || _ctx.showSelectingCouter || _ctx.features.paging ? (openBlock(), createBlock(_component_OrDataGridFooter, {
508
517
  key: 3,
509
518
  class: normalizeClass(['shrink-0'])
510
519
  }, createSlots({
@@ -29,7 +29,10 @@ export declare enum DataGridVariant {
29
29
  Compact = "compact"
30
30
  }
31
31
  export type DataGridFeatures = {
32
- selecting?: boolean;
32
+ selecting?: boolean | {
33
+ showCounter?: boolean;
34
+ disabled?: boolean;
35
+ };
33
36
  filtering?: boolean;
34
37
  searching?: boolean;
35
38
  sorting?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "19.6.0",
3
+ "version": "19.7.0-beta.5077.0",
4
4
  "npmUnpacked": "4.15.2",
5
5
  "description": "Vue components library for v3",
6
6
  "sideEffects": false,
@@ -140,6 +140,5 @@
140
140
  "default": "./dist/bundled/components/*/index.js"
141
141
  },
142
142
  "./package.json": "./package.json"
143
- },
144
- "gitHead": "6ae2fdadb0dbcbde327db1ff4da53900b297d3f1"
143
+ }
145
144
  }
@@ -50,7 +50,7 @@
50
50
  <OrCheckbox
51
51
  v-model="selectingIndicator"
52
52
  :indeterminate="!selectingIndicator && selectingModel.length > 0"
53
- :disabled="items.length === 0 || loading"
53
+ :disabled="selectingDisabled"
54
54
  />
55
55
  </OrDataGridTableHeaderCell>
56
56
  </template>
@@ -126,6 +126,7 @@
126
126
  <OrCheckbox
127
127
  v-model="selectingModel"
128
128
  :value="item.id"
129
+ :disabled="selectingDisabled"
129
130
  />
130
131
  </OrDataGridTableContentCell>
131
132
  </template>
@@ -183,11 +184,11 @@
183
184
  <OrDataGridTableFooterCell>
184
185
  <slot :name="'extra-row'" />
185
186
  </OrDataGridTableFooterCell>
186
- </OrDataGridTableFooterRow>
187
+ </OrDataGridTableFooterRow>s
187
188
  </OrDataGridTableFooter>
188
189
  </template>
189
190
 
190
- <template v-if="$slots['actions'] || features.selecting || features.paging">
191
+ <template v-if="$slots['actions'] || showSelectingCouter || features.paging">
191
192
  <OrDataGridFooter
192
193
  :class="['shrink-0']"
193
194
  >
@@ -329,7 +330,7 @@ export default defineComponent({
329
330
  // State
330
331
  const selectingIndicator = computed({
331
332
  get: () => {
332
- return props.items.every((item) => selectingModel.value.includes(item.id));
333
+ return !!props.items.length && props.items.every((item) => selectingModel.value.includes(item.id));
333
334
  },
334
335
 
335
336
  set: (value) => {
@@ -431,6 +432,18 @@ export default defineComponent({
431
432
  const scrollOffsetStart = ref(new Map<HTMLElement, number>());
432
433
  const scrollOffsetEnd = ref(new Map<HTMLElement, number>());
433
434
 
435
+ const showSelectingCouter = computed(() => {
436
+ return props.features.selecting &&
437
+ (typeof props.features.selecting === 'object' ? props.features.selecting.showCounter !== false : true);
438
+ });
439
+
440
+ const selectingDisabled = computed(() => {
441
+ return props.items.length === 0
442
+ || props.loading
443
+ || (typeof props.features.selecting === 'object' && props.features.selecting.disabled);
444
+
445
+ });
446
+
434
447
  // Methods
435
448
  function updateScrollOffset(header: HTMLElement, offset: number, column: DataGridColumn): void {
436
449
  switch (column.stickiness) {
@@ -478,6 +491,8 @@ export default defineComponent({
478
491
  tableInlineStyles,
479
492
 
480
493
  selectingIndicator,
494
+ showSelectingCouter,
495
+ selectingDisabled,
481
496
 
482
497
  selectingModel,
483
498
  filteringModel,
@@ -42,7 +42,10 @@ export enum DataGridVariant {
42
42
  }
43
43
 
44
44
  export type DataGridFeatures = {
45
- selecting?: boolean;
45
+ selecting?: boolean | {
46
+ showCounter?: boolean;
47
+ disabled?: boolean;
48
+ };
46
49
  filtering?: boolean;
47
50
  searching?: boolean;
48
51
  sorting?: boolean;