bkui-vue 1.0.3-beta.34 → 1.0.3-beta.36
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/index.cjs.js +23 -23
- package/dist/index.esm.js +1800 -1780
- package/dist/index.umd.js +19 -19
- package/lib/date-picker/common.d.ts +2 -2
- package/lib/date-picker/index.js +48 -76
- package/lib/table/components/table-column.d.ts +104 -1
- package/lib/table/index.d.ts +44 -1
- package/lib/table/index.js +131 -99
- package/lib/table-column/index.d.ts +110 -3
- package/lib/table-column/index.js +130 -10
- package/package.json +1 -1
@@ -83,7 +83,95 @@ function _defineProperty(obj, key, value) {
|
|
83
83
|
;// CONCATENATED MODULE: external "vue"
|
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
|
-
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 });
|
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, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["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
|
722
|
-
|
723
|
-
|
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(props)
|
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 props = this.$.vnode.props;
|
828
|
+
if (props.uniqueId && !props.uniqueId.val) {
|
829
|
+
props.uniqueId.val = esm_browser_v4();
|
830
|
+
}
|
831
|
+
if (!props.uniqueId && !(0,external_vue_namespaceObject.isProxy)(props)) {
|
832
|
+
Object.assign(props, {
|
833
|
+
uniqueId: {
|
834
|
+
val: esm_browser_v4()
|
835
|
+
}
|
836
|
+
});
|
837
|
+
}
|
838
|
+
},
|
839
|
+
getNodeUid: function getNodeUid(props) {
|
840
|
+
var _props$uniqueId;
|
841
|
+
return (_props$uniqueId = props.uniqueId) === null || _props$uniqueId === void 0 ? void 0 : _props$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.props);
|
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)
|
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:
|
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(props)
|
808
928
|
});
|
809
929
|
this.initColumns(resolveProp, true);
|
810
930
|
}
|