bkui-vue 1.0.3-beta.35 → 1.0.3-beta.37

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.
@@ -48,6 +48,17 @@ declare const BkTableColumn: {
48
48
  } & {
49
49
  default: number;
50
50
  };
51
+ uniqueId: import("vue-types").VueTypeValidableDef<{
52
+ [key: string]: any;
53
+ }> & {
54
+ default: () => {
55
+ [key: string]: any;
56
+ };
57
+ } & {
58
+ default: () => {
59
+ [key: string]: any;
60
+ };
61
+ };
51
62
  }>>, {
52
63
  isIndexPropChanged: import("vue").Ref<boolean>;
53
64
  setIsIndexChanged: (val: boolean) => void;
@@ -93,6 +104,9 @@ declare const BkTableColumn: {
93
104
  (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string;
94
105
  };
95
106
  };
107
+ uniqueId?: {
108
+ [key: string]: any;
109
+ };
96
110
  render?: import("../table/props").RenderFunctionString;
97
111
  sort?: string | boolean | {
98
112
  sortFn?: Function;
@@ -178,8 +192,23 @@ declare const BkTableColumn: {
178
192
  } & {
179
193
  default: number;
180
194
  };
181
- }>>): {};
195
+ uniqueId: import("vue-types").VueTypeValidableDef<{
196
+ [key: string]: any;
197
+ }> & {
198
+ default: () => {
199
+ [key: string]: any;
200
+ };
201
+ } & {
202
+ default: () => {
203
+ [key: string]: any;
204
+ };
205
+ };
206
+ }>> | {
207
+ [key: string]: any;
208
+ }): {};
182
209
  rsolveIndexedColumn(): boolean;
210
+ setNodeUid(): void;
211
+ getNodeUid(ctx: any): any;
183
212
  updateColumnDefineByParent(): void;
184
213
  unmountColumn(): void;
185
214
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
@@ -231,6 +260,17 @@ declare const BkTableColumn: {
231
260
  } & {
232
261
  default: number;
233
262
  };
263
+ uniqueId: import("vue-types").VueTypeValidableDef<{
264
+ [key: string]: any;
265
+ }> & {
266
+ default: () => {
267
+ [key: string]: any;
268
+ };
269
+ } & {
270
+ default: () => {
271
+ [key: string]: any;
272
+ };
273
+ };
234
274
  }>>, {
235
275
  fixed: boolean | "right" | "left";
236
276
  resizable: boolean;
@@ -239,6 +279,9 @@ declare const BkTableColumn: {
239
279
  columnKey: string;
240
280
  colspan: import("../table/props").SpanFunctionString;
241
281
  rowspan: import("../table/props").SpanFunctionString;
282
+ uniqueId: {
283
+ [key: string]: any;
284
+ };
242
285
  }, true, {}, {}, {
243
286
  P: {};
244
287
  B: {};
@@ -295,6 +338,17 @@ declare const BkTableColumn: {
295
338
  } & {
296
339
  default: number;
297
340
  };
341
+ uniqueId: import("vue-types").VueTypeValidableDef<{
342
+ [key: string]: any;
343
+ }> & {
344
+ default: () => {
345
+ [key: string]: any;
346
+ };
347
+ } & {
348
+ default: () => {
349
+ [key: string]: any;
350
+ };
351
+ };
298
352
  }>>, {
299
353
  isIndexPropChanged: import("vue").Ref<boolean>;
300
354
  setIsIndexChanged: (val: boolean) => void;
@@ -340,6 +394,9 @@ declare const BkTableColumn: {
340
394
  (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string;
341
395
  };
342
396
  };
397
+ uniqueId?: {
398
+ [key: string]: any;
399
+ };
343
400
  render?: import("../table/props").RenderFunctionString;
344
401
  sort?: string | boolean | {
345
402
  sortFn?: Function;
@@ -425,8 +482,23 @@ declare const BkTableColumn: {
425
482
  } & {
426
483
  default: number;
427
484
  };
428
- }>>): {};
485
+ uniqueId: import("vue-types").VueTypeValidableDef<{
486
+ [key: string]: any;
487
+ }> & {
488
+ default: () => {
489
+ [key: string]: any;
490
+ };
491
+ } & {
492
+ default: () => {
493
+ [key: string]: any;
494
+ };
495
+ };
496
+ }>> | {
497
+ [key: string]: any;
498
+ }): {};
429
499
  rsolveIndexedColumn(): boolean;
500
+ setNodeUid(): void;
501
+ getNodeUid(ctx: any): any;
430
502
  updateColumnDefineByParent(): void;
431
503
  unmountColumn(): void;
432
504
  }, {
@@ -437,6 +509,9 @@ declare const BkTableColumn: {
437
509
  columnKey: string;
438
510
  colspan: import("../table/props").SpanFunctionString;
439
511
  rowspan: import("../table/props").SpanFunctionString;
512
+ uniqueId: {
513
+ [key: string]: any;
514
+ };
440
515
  }>;
441
516
  __isFragment?: never;
442
517
  __isTeleport?: never;
@@ -490,6 +565,17 @@ declare const BkTableColumn: {
490
565
  } & {
491
566
  default: number;
492
567
  };
568
+ uniqueId: import("vue-types").VueTypeValidableDef<{
569
+ [key: string]: any;
570
+ }> & {
571
+ default: () => {
572
+ [key: string]: any;
573
+ };
574
+ } & {
575
+ default: () => {
576
+ [key: string]: any;
577
+ };
578
+ };
493
579
  }>>, {
494
580
  isIndexPropChanged: import("vue").Ref<boolean>;
495
581
  setIsIndexChanged: (val: boolean) => void;
@@ -535,6 +621,9 @@ declare const BkTableColumn: {
535
621
  (locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string;
536
622
  };
537
623
  };
624
+ uniqueId?: {
625
+ [key: string]: any;
626
+ };
538
627
  render?: import("../table/props").RenderFunctionString;
539
628
  sort?: string | boolean | {
540
629
  sortFn?: Function;
@@ -620,8 +709,23 @@ declare const BkTableColumn: {
620
709
  } & {
621
710
  default: number;
622
711
  };
623
- }>>): {};
712
+ uniqueId: import("vue-types").VueTypeValidableDef<{
713
+ [key: string]: any;
714
+ }> & {
715
+ default: () => {
716
+ [key: string]: any;
717
+ };
718
+ } & {
719
+ default: () => {
720
+ [key: string]: any;
721
+ };
722
+ };
723
+ }>> | {
724
+ [key: string]: any;
725
+ }): {};
624
726
  rsolveIndexedColumn(): boolean;
727
+ setNodeUid(): void;
728
+ getNodeUid(ctx: any): any;
625
729
  updateColumnDefineByParent(): void;
626
730
  unmountColumn(): void;
627
731
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
@@ -632,5 +736,8 @@ declare const BkTableColumn: {
632
736
  columnKey: string;
633
737
  colspan: import("../table/props").SpanFunctionString;
634
738
  rowspan: import("../table/props").SpanFunctionString;
739
+ uniqueId: {
740
+ [key: string]: any;
741
+ };
635
742
  }, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin<any[]>;
636
743
  export default BkTableColumn;
@@ -84,6 +84,94 @@ function _defineProperty(obj, key, value) {
84
84
  var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
85
85
  var external_vue_y = x => () => x
86
86
  const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref });
87
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/native.js
88
+ const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
89
+ /* harmony default export */ const esm_browser_native = ({
90
+ randomUUID
91
+ });
92
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/rng.js
93
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
94
+ // require the crypto API and do not support built-in fallback to lower quality random number
95
+ // generators (like Math.random()).
96
+ let getRandomValues;
97
+ const rnds8 = new Uint8Array(16);
98
+ function rng() {
99
+ // lazy load so that environments that need to polyfill have a chance to do so
100
+ if (!getRandomValues) {
101
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
102
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
103
+
104
+ if (!getRandomValues) {
105
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
106
+ }
107
+ }
108
+
109
+ return getRandomValues(rnds8);
110
+ }
111
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/stringify.js
112
+
113
+ /**
114
+ * Convert array of 16 byte values to UUID string format of the form:
115
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
116
+ */
117
+
118
+ const byteToHex = [];
119
+
120
+ for (let i = 0; i < 256; ++i) {
121
+ byteToHex.push((i + 0x100).toString(16).slice(1));
122
+ }
123
+
124
+ function unsafeStringify(arr, offset = 0) {
125
+ // Note: Be careful editing this code! It's been tuned for performance
126
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
127
+ return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
128
+ }
129
+
130
+ function stringify(arr, offset = 0) {
131
+ const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
132
+ // of the following:
133
+ // - One or more input array values don't map to a hex octet (leading to
134
+ // "undefined" in the uuid)
135
+ // - Invalid input values for the RFC `version` or `variant` fields
136
+
137
+ if (!validate(uuid)) {
138
+ throw TypeError('Stringified UUID is invalid');
139
+ }
140
+
141
+ return uuid;
142
+ }
143
+
144
+ /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
145
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/v4.js
146
+
147
+
148
+
149
+
150
+ function v4(options, buf, offset) {
151
+ if (esm_browser_native.randomUUID && !buf && !options) {
152
+ return esm_browser_native.randomUUID();
153
+ }
154
+
155
+ options = options || {};
156
+ const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
157
+
158
+ rnds[6] = rnds[6] & 0x0f | 0x40;
159
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
160
+
161
+ if (buf) {
162
+ offset = offset || 0;
163
+
164
+ for (let i = 0; i < 16; ++i) {
165
+ buf[offset + i] = rnds[i];
166
+ }
167
+
168
+ return buf;
169
+ }
170
+
171
+ return unsafeStringify(rnds);
172
+ }
173
+
174
+ /* harmony default export */ const esm_browser_v4 = (v4);
87
175
  ;// CONCATENATED MODULE: ../../packages/table/src/const.ts
88
176
 
89
177
  /*
@@ -631,6 +719,7 @@ var tableProps = {
631
719
 
632
720
 
633
721
 
722
+
634
723
  var TableColumnProp = {
635
724
  label: LabelFunctionStringType,
636
725
  field: LabelFunctionStringType,
@@ -649,7 +738,10 @@ var TableColumnProp = {
649
738
  align: TableAlign,
650
739
  className: RowClassFunctionStringType,
651
740
  prop: LabelFunctionStringType,
652
- index: shared_namespaceObject.PropTypes.number.def(undefined)
741
+ index: shared_namespaceObject.PropTypes.number.def(undefined),
742
+ uniqueId: shared_namespaceObject.PropTypes.object.def({
743
+ val: ''
744
+ })
653
745
  };
654
746
  /* harmony default export */ const table_column = ((0,external_vue_namespaceObject.defineComponent)({
655
747
  name: 'TableColumn',
@@ -690,6 +782,7 @@ var TableColumnProp = {
690
782
  this.updateColumnDefine(true);
691
783
  },
692
784
  mounted: function mounted() {
785
+ this.setNodeUid();
693
786
  this.updateColumnDefine();
694
787
  },
695
788
  updated: function updated() {
@@ -718,15 +811,35 @@ var TableColumnProp = {
718
811
  rsolveIndexedColumn: function rsolveIndexedColumn() {
719
812
  // 如果是设置了Index,则先添加Index列,不做自动递归读取Column
720
813
  if (/\d+\.?\d*/.test("".concat(this.$props.index))) {
721
- var resolveProp = Object.assign({}, this.copyProps(this.$props), {
722
- field: this.$props.prop || this.$props.field,
723
- render: this.$slots["default"]
814
+ var _props$render;
815
+ var props = this.$.vnode.props;
816
+ var resolveProp = Object.assign({}, this.copyProps(props), {
817
+ field: props.prop || props.field,
818
+ render: (_props$render = props.render) !== null && _props$render !== void 0 ? _props$render : this.$slots["default"],
819
+ uniqueId: this.getNodeUid(this.$.ctx)
724
820
  });
725
821
  this.initColumns(resolveProp);
726
822
  return false;
727
823
  }
728
824
  return true;
729
825
  },
826
+ setNodeUid: function setNodeUid() {
827
+ var ctx = this.$.ctx;
828
+ if (ctx.uniqueId && !ctx.uniqueId.val) {
829
+ ctx.uniqueId.val = esm_browser_v4();
830
+ }
831
+ if (!ctx.uniqueId) {
832
+ Object.assign(ctx, {
833
+ uniqueId: {
834
+ val: esm_browser_v4()
835
+ }
836
+ });
837
+ }
838
+ },
839
+ getNodeUid: function getNodeUid(ctx) {
840
+ var _ctx$uniqueId;
841
+ return (_ctx$uniqueId = ctx.uniqueId) === null || _ctx$uniqueId === void 0 ? void 0 : _ctx$uniqueId.val;
842
+ },
730
843
  updateColumnDefineByParent: function updateColumnDefineByParent() {
731
844
  var _this = this;
732
845
  if (!this.rsolveIndexedColumn()) {
@@ -734,7 +847,7 @@ var TableColumnProp = {
734
847
  }
735
848
  var fn = function fn() {
736
849
  // @ts-ignore
737
- var selfVnode = _this._;
850
+ var selfVnode = _this.$;
738
851
  var getTableNode = function getTableNode(root) {
739
852
  var _parentVnode$type;
740
853
  if (root === document.body || !root) {
@@ -746,6 +859,9 @@ var TableColumnProp = {
746
859
  }
747
860
  return getTableNode(parentVnode);
748
861
  };
862
+ var getNodeUid = function getNodeUid(node) {
863
+ return _this.getNodeUid(node.ctx);
864
+ };
749
865
  var tableNode = getTableNode(selfVnode);
750
866
  if (!tableNode) {
751
867
  return;
@@ -758,12 +874,13 @@ var TableColumnProp = {
758
874
  return null;
759
875
  }
760
876
  if (((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'TableColumn') {
761
- var _node$children;
877
+ var _node$props$render, _node$children;
762
878
  var resolveProp = Object.assign({
763
879
  index: index
764
880
  }, _this.copyProps(node.props), {
765
881
  field: node.props.prop || node.props.field,
766
- render: (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"]
882
+ render: (_node$props$render = node.props.render) !== null && _node$props$render !== void 0 ? _node$props$render : (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"],
883
+ uniqueId: getNodeUid(node.ctx)
767
884
  });
768
885
  sortColumns.push((0,external_vue_namespaceObject.unref)(resolveProp));
769
886
  index = index + 1;
@@ -802,9 +919,12 @@ var TableColumnProp = {
802
919
  }
803
920
  },
804
921
  unmountColumn: function unmountColumn() {
922
+ var _props$render2;
923
+ var props = this.$.vnode.props;
805
924
  var resolveProp = Object.assign({}, this.copyProps(this.$props), {
806
- field: this.$props.prop || this.$props.field,
807
- render: this.$slots["default"]
925
+ field: props.prop || props.field,
926
+ render: (_props$render2 = props.render) !== null && _props$render2 !== void 0 ? _props$render2 : this.$slots["default"],
927
+ uniqueId: this.getNodeUid(this.$.ctx)
808
928
  });
809
929
  this.initColumns(resolveProp, true);
810
930
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "1.0.3-beta.35",
3
+ "version": "1.0.3-beta.37",
4
4
  "workspaces": {
5
5
  "packages": [
6
6
  "packages/!(**.bak)*",